Tutorial by Examples: c

#Region directive can now be placed inside methods and can even span over methods, classes and modules. #Region "A Region Spanning A Class and Ending Inside Of A Method In A Module" Public Class FakeClass 'Nothing to see here, just a fake class. End Class Module Extensi...
The implicit keyword is used to overload a conversion operator. For example, you may declare a Fraction class that should automatically be converted to a double when needed, and that can be automatically converted from int: class Fraction(int numerator, int denominator) { public int Numerator...
Here are all access modifiers in venn diagrams, from more limiting to more accessible: Access ModifierDiagramprivateinternalprotectedprotected internalpublic Below you could find more information.
Dynamic Arrays Adding and reducing variables on an array dynamically is a huge advantage for when the information you are treating does not have a set number of variables. Adding Values Dynamically You can simply resize the Array with the ReDim Statement, this will resize the array but to if you ...
In F# there are many options for creating data pipelines, for example: List, Seq and Array. What data pipeline is preferable from memory usage and performance perspective? In order to answer this we'll compare performance and memory usage using different pipelines. Data Pipeline In order to me...
By adding the following extension to array indices can be accessed without knowing if the index is inside bounds. extension Array { subscript (safe index: Int) -> Element? { return indices ~= index ? self[index] : nil } } example: if let thirdValue = array[safe: 2] { ...
Variables exist within a specific scope, much like in in JavaScript. If you declare a variable outside of a block, it can be used throughout the sheet. $blue: dodgerblue; .main { background: $blue; p { background: #ffffff; color: $blue; } } .header { ...
In the below example value in map $color-array is treated as list of pairs. SCSS Input $color-array:( black: #4e4e4e, blue: #0099cc, green: #2ebc78 ); @each $color-name, $color-value in $color-array { .bg-#{$color-name} { background: $color-value; } } ...
Due to very specific way of actor instantiation, injecting dependencies into an actor instance is not trivial. In order to intervene in actor instantiation and allow Spring to inject dependencies one should implement a couple of akka extensions. First of those is an IndirectActorProducer: import ak...
#demo-element { background: @theme-color; color: contrast(@theme-color, black, white, 50%); } @theme-color: red; The above example will set the text color of the element as white if the background-color is dark and vice-versa. This is achieved using the contrast() color operation functi...
The presence of a tsconfig.json file indicates that the current directory is the root of a TypeScript enabled project. Initializing a TypeScript project, or better put tsconfig.json file, can be done through the following command: tsc --init As of TypeScript v2.3.0 and higher this will create t...
Setting a top-level property compileOnSave signals to the IDE to generate all files for a given tsconfig.json upon saving. { "compileOnSave": true, "compilerOptions": { ... }, "exclude": [ ... ] } This feature is available...
In Tcl, a control structure is basically just another command. This is one possible implementation of a do ... while / do ... until control structure. proc do {body keyword expression} { uplevel 1 $body switch $keyword { while {uplevel 1 [list while $expression $body]} u...
2.1.3 1. Preview Different Devices There is a preview panel at the right of the android studio. In thispanel there is a button with device name with which you are previewing the UI of your app like this . Click on small dropdown indicator of this and a floating panel will appear with all the pr...
VB 14.0 introduces the ability to add comments after implicit line continuation. Dim number = From c As Char 'Comment In "dj58kwd92n4" 'Comment Where Char.IsNumber(c) 'Comment Select c 'Comment
In Emacs, basic search tool (I-Search) allows you to search after or before the location of your cursor. To search for sometext after the location of your cursor (search-forward) hit C-s sometext. If you want to go to the next occurence of sometext, just press C-s again (and so on for the ne...
Set mark in cursor location: C-space or C-@ Kill region (Cut): C-w Copy region to kill ring: M-w or Esc-w Yank (Paste) most recently killed: C-y Yank (Paste) next last killed: M-y or Esc-y Kill killis the command used by Emacs for the deletion of ...
Document level It is on by default, but you can have an extra layer of protection by placing Option Explicit On at the top of the code file. The option will apply to the whole document. Project level You can switch it on via the menu in Visual Studio: Project > [Project] Properties > Com...
Use the task dependencies. Depending on how your modules are set up, it may be either ./gradlew dependencies or to see the dependencies of module app use ./gradlew :app:dependencies The example following build.gradle file dependencies { compile 'com.android.support:design:23.2.1' compile...
Using the System.String.Replace method, you can replace part of a string with another string. string s = "Hello World"; s = s.Replace("World", "Universe"); // s = "Hello Universe" All the occurrences of the search string are replaced. This method can al...

Page 399 of 826