Tutorial by Examples: st

A list in Erlang is a sequence of zero or more Erlang terms, implemented as a singly linked list. Each element in the list can be any type of term (any data type). 1> [1,2,3]. [1,2,3] 2> [wow,1,{a,b}]. [wow,1,{a,b}] The list's head is the first element of the list. The list's tail...
The where statement may be used within a switch case match to add additional criteria required for a positive match. The following example checks not only for the range, but also if the number is odd or even: switch (temperature) { case 0...49 where temperature % 2 == 0: print(&quot...
A string representation of a Guid can be obtained by using the built in ToString method string myGuidString = myGuid.ToString(); Depending on your needs you can also format the Guid, by adding a format type argument to the ToString call. var guid = new Guid("7febf16f-651b-43b0-a5e3-0da8da4...
Key Value Coding is integrated into NSObject using NSKeyValueCoding protocol. What this means? It means that any id object is capable of calling valueForKey method and its various variants like valueForKeyPath etc. ' It also means that any id object can invoke setValue method and its various vari...
Google Apps Script does not require setup or installation. The only requirement is a Google Account. A Gmail account works as well as a Google Apps for Work/Education/Government account. You can create a new Google account by going to accounts.google.com Start your first script by going to script.g...
Java SE 8 An array of strings can be joined using the static method String.join(): String[] elements = { "foo", "bar", "foobar" }; String singleString = String.join(" + ", elements); System.out.println(singleString); // Prints "foo + bar + foobar&qu...
The functions for parsing a string into POSIXct and POSIXlt take similar parameters and return a similar-looking result, but there are differences in how that date-time is stored; see "Remarks." as.POSIXct("11:38", # time string format = "...
Creating an HTML document and enabling knockout.js Create an HTML file and include knockout.js via a <script> tag. <!DOCTYPE html> <html> <head> <title>Hello world! (knockout.js)</title> </head> <body> <script src="https://cdnjs...
To start coding in the first place, you have to right click your VBA Project in the left list and add a new Module. Your first Hello-World Code could look like this: Sub HelloWorld() MsgBox "Hello, World!" End Sub To test it, hit the Play-Button in your Toolbar or simply hit the...
Swift label1.layer.shadowOffset = CGSize(width: 3, height: 3) label1.layer.shadowOpacity = 0.7 label1.layer.shadowRadius = 2 Swift 3 label1.layer.shadowOffset = CGSize(width: 3, height: 3) label1.layer.shadowOpacity = 0.7 label1.layer.shadowRadius = 2 Objective-C label1.layer.shadowOffs...
my.pipe.ts import { Pipe, PipeTransform } from '@angular/core'; @Pipe({name: 'myPipe'}) export class MyPipe implements PipeTransform { transform(value:any, args?: any):string { let transformedValue = value; // implement your transformation logic here return transformedValue; }...
See Boost Getting Started. Most of the Boost libraries are header-only, meaning that there's nothing you have to compile or link to. Make sure you are getting the most recent version of Boost: Visit www.boost.org Look for the Current Release download. Currently, this links here. Select the ...
Installing mongoose is as easy as running the npm command npm install mongoose --save But make sure you have also installed MongoDB for your OS or Have access to a MongoDB database. Connecting to MongoDB database: 1. Import mongoose into the app: import mongoose from 'mongoose'; 2. Specify...
main.rs extern crate serde; extern crate serde_json; // Import this crate to derive the Serialize and Deserialize traits. #[macro_use] extern crate serde_derive; #[derive(Serialize, Deserialize, Debug)] struct Point { x: i32, y: i32, } fn main() { let point = Point { x: ...
fn main() { let maybe_cake = Some("Chocolate cake"); let not_cake = None; // The unwrap method retrieves the value from the Option // and panics if the value is None println!("{}", maybe_cake.unwrap()); // The expect method works much like the un...
The -Regex parameter allows switch statements to perform regular expression matching against conditions. Example: switch -Regex ('Condition') { 'Con\D+ion' {'One or more non-digits'} 'Conditio*$' {'Zero or more "o"'} 'C.ndition' {'Any single char.'} '^C\w+ition$'...
The -Wildcard parameter allows switch statements to perform wildcard matching against conditions. Example: switch -Wildcard ('Condition') { 'Condition' {'Normal match'} 'Condit*' {'Zero or more wildcard chars.'} 'C[aoc]ndit[f-l]on' {'Range and set of chars...
The -Exact parameter enforces switch statements to perform exact, case-insensitive matching against string-conditions. Example: switch -Exact ('Condition') { 'condition' {'First Action'} 'Condition' {'Second Action'} 'conditioN' {'Third Action'} '^*ondition$' {'Fourth Action...
The -CaseSensitive parameter enforces switch statements to perform exact, case-sensitive matching against conditions. Example: switch -CaseSensitive ('Condition') { 'condition' {'First Action'} 'Condition' {'Second Action'} 'conditioN' {'Third Action'} } Output: Second Act...
The -file parameter allows the switch statement to receive input from a file. Each line of the file is evaluated by the switch statement. Example file input.txt: condition test Example switch statement: switch -file input.txt { 'condition' {'First Action'} 'test' {'Second Action...

Page 40 of 369