Tutorial by Examples: and

Mostly you will use "normal variables": set(VAR TRUE) set(VAR "main.cpp") set(VAR1 ${VAR2}) But CMake does also know global "cached variables" (persisted in CMakeCache.txt). And if normal and cached variables of the same name exist in the current scope, normal var...
Static class properties that are defined with the public visibility are functionally the same as global variables. They can be accessed from anywhere the class is defined. class SomeClass { public static int $counter = 0; } // The static $counter variable can be read/written from anywhere...
let someValue : String = "Something the user entered" let text = NSMutableAttributedString(string: "The value is: ") text.appendAttributedString(NSAttributedString(string: someValue, attributes: [NSFontAttributeName:UIFont.boldSystemFontOfSize(UIFont.systemFontSize())])) ...
Like any other java program, every swing program starts with a main method. The main method is initiated by the main thread. However, Swing components need to be created and updated on the event dispatch thread (or short: EDT). To illustrate the dynamic between the main thread and the EDT take a loo...
defmodule Processes do def receiver do receive do {:ok, val} -> IO.puts "Received Value: #{val}" _ -> IO.puts "Received something else" end end end iex(1)> pid = spawn(Processes, ...
Recursion can be used to receive multiple messages defmodule Processes do def receiver do receive do {:ok, val} -> IO.puts "Received Value: #{val}" _ -> IO.puts "Received something else" end...
Like the built-in python interactive shell, IPython is a REPL (Read-Evaluate-Print Loop) shell, with a variety of features that make it more pleasant to use for day-to-day Python development than the built-in REPL shell. Installation To install it: pip install ipython Or, via Anaconda: # To i...
Avoid unnecessary operations and method calls wherever you can, especially in a method which is called many times a second, like Update. Distance/Range Checks Use sqrMagnitude instead of magnitude when comparing distances. This avoids unnecessary sqrt operations. Note that when using sqrMagnitude,...
Re-Save open file under the same filename (Save): C-x C-s Write as filename (Save As): C-x C-w filename The new file name will be prompted in the minibuffer. Create new file or load existing file (New / Load): C-x C-f filename With the mnemonic here for f meaning file. You will...
Often you will get into a state where you have a partially typed command sequence in progress, but you want to abort it. You can abort it with either of the following keybindings: C-g EscEscEsc
If profiling your build shows significant time spend in Configuring Projects, the Configure on Demand option might improve your performance. You can enable Configure on Demand mode by editing $GRADLE_USER_HOME/.gradle/gradle.properties (~/.gradle/gradle.properties by default), and setting org.gradl...
'Declare and assign a 1-character fixed-width string Dim middleInitial As String * 1 'middleInitial must be 1 character in length middleInitial = "M" 'Declare and assign a 2-character fixed-width string `stateCode`, 'must be 2 characters in length Dim stateCode As String * 2 stateC...
'Declare, dimension and assign a string array with 3 elements Dim departments(2) As String departments(0) = "Engineering" departments(1) = "Finance" departments(2) = "Marketing" 'Declare an undimensioned string array and then dynamically assign with 'the results...
By default, Eloquent models expect for the primary key to be named 'id'. If that is not your case, you can change the name of your primary key by specifying the $primaryKey property. class Citizen extends Model { protected $primaryKey = 'socialSecurityNo'; // ... } Now, any Eloqu...
DataObjects in SilverStripe represent a database table row. The fields in the model have magic methods that handle getting and setting data via their property names. Given we have a simple DataObject as an example: class Fruit extends DataObject { private static $db = ['Name' => 'Varchar'...
Const zipCode As long = 10012 Dim zeroPaddedNumber As String zeroPaddedZipCode = Format(zipCode, "00000000") 'zeroPaddedNumber = "00010012"
We can easily separate distribution specific tasks and variables into different dedicated .yml files. Ansible helps us to automatically identify the target hosts distribution via {{ ansible_distribution }} and {{ ansible_distribution_version }}, so we just have to name the distribution dedicated .y...
Create a new httpHandler inside your ASP.NET project. Apply the following code (VB) to the handler file: Public Class AttachmentDownload Implements System.Web.IHttpHandler Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest ' pass an ID thr...
Command line arguments passed to awk are stored in the internal array ARGV of ARGC elements. The first element of the array is the program name. For example: awk 'BEGIN { for (i = 0; i < ARGC; ++i) { printf "ARGV[%d]=\"%s\"\n", i, ARGV[i] } }' arg1 arg2 arg3 ...
Build.VERSION_CODES is an enumeration of the currently known SDK version codes. In order to conditionally run code based on the device's Android version, use the TargetApi annotation to avoid Lint errors, and check the build version before running the code specific to the API level. Here is an exa...

Page 51 of 153