Tutorial by Examples: air

Floyd-Warshall's algorithm is for finding shortest paths in a weighted graph with positive or negative edge weights. A single execution of the algorithm will find the lengths (summed weights) of the shortest paths between all pair of vertices. With a little variation, it can print the shortest path ...
Objective-C Airdrop can be used from UIActivityViewController. The UIActivityViewController class is a standard view controller that provides several standard services, such as copying items to the clipboard, sharing content to social media sites, sending items via Messages, AirDrop and some third ...
Objective-C Add the delegate and a text-formatter to the ViewController.h file @interface ViewController : UIViewController <UIPrintInteractionControllerDelegate> { UISimpleTextPrintFormatter *_textFormatter; } In the ViewController.m file define the following constants #define Def...
You can use a TStringList to store Key-Value pairs. This can be useful if you want to store settings, for example. A settings consists of a Key (The Identifier of the setting) and the value. Each Key-Value pair is stored in one line of the StringList in Key=Value format. procedure Demo(const FileN...
To generate key pairs using different algorithms and key sizes: final KeyPairGenerator dhGenerator = KeyPairGenerator.getInstance("DiffieHellman"); final KeyPairGenerator dsaGenerator = KeyPairGenerator.getInstance("DSA"); final KeyPairGenerator rsaGenerator = KeyPairGenerator...
To illustrate how to use regr_slope(Y,X), I applied it to a real world problem. In Java, if you don't clean up memory properly, the garbage can get stuck and fill up the memory. You dump statistics every hour about memory utilization of different classes and load it into a postgres database for anal...
An example, to add a "Key2" key with a value of "Value2" to the hash table, using the addition operator: $hashTable = @{ Key1 = 'Value1' } $hashTable += @{Key2 = 'Value2'} $hashTable #Output Name Value ---- -----...
There is a particular syntax that allow us to write cons cell in a more compact way than using the cons constructor. A pair can be written as such: '(1 . 2) == (cons 1 2) The big difference is that we can create pairs using quote. Otherwise, Scheme would create a proper list (1 . (2 . '())). T...
A pair can be create with the cons function. The name of the function stand for constructor. In Scheme, everything is pretty much based on pairs. (cons a b) The function return a pair containing the element a and b. The first parameter of cons is called car (Content Address Register) and the sec...
The data in the pair can be accessed with utility functions. To access the car, we have to use the car function. (car (cons a b)) > a Also we can verify the following equality: (eq? a (car (cons a b))) > #t
To access the cdr, we have to use the cdr function. (cdr (cons a b)) b Also we can verify the following equality: (eq? b (cdr (cons a b))) #t
List in scheme are nothing else than a series of pairs nested in each other in the cdr of a cons. And the last cdr of a proper list is the empty list '(). To create the list (1 2 3 4), we'd have something like this: (cons 4 '()) > (4) (cons 3 (cons 4 '())) > (3 4) (cons 2 (cons 3 (cons 4...
Enumerating through Keys foreach ($key in $var1.Keys) { $value = $var1[$key] # or $value = $var1.$key } Enumerating through Key-Value Pairs foreach ($keyvaluepair in $var1.GetEnumerator()) { $key1 = $_.Key1 $val1 = $_.Val1 }
A keyword is "MONARCHY" then the matrix will look like The matrix is constructed by filling in the letters of the keyword (minus duplicates) from left to right and from top to bottom, and then filling in the remainder of the matrix with the remaining letters in alphabetic order. Plai...
Given a pair of points A and B in a vector space of arbitrary dimension, one can describe the line between them as X = A + t*(B - A) = (1 - t)*A + t*B so in 2d this would be x = Ax + t*(Bx - Ax) = (1 - t)*Ax + t*Bx y = Ay + t*(By - Ay) = (1 - t)*Ay + t*By As t assumes any real value, this w...
First of all you'll need to have a key pair. If you don't have one yet, take a look at the 'Generate public and private key topic'. Your key pair is composed by a private key (id_rsa) and a public key (id_rsa.pub). All you need to do is to copy the public key to the remote host and add its contents...
An example, to remove a "Key2" key with a value of "Value2" from the hash table, using the remove operator: $hashTable = @{ Key1 = 'Value1' Key2 = 'Value2' } $hashTable.Remove("Key2", "Value2") $hashTable #Output Name ...

Page 2 of 2