Tutorial by Examples: ti

Install Codeception: composer global status composer global require "codeception/codeception=~2.0.0" "codeception/specify=*" "codeception/verify=*" Install Faker: cd /var/www/yii // Path to your application composer require --de...
If you need to count distinct characters then, for the reasons explained in Remarks section, you can't simply use Length property because it's the length of the array of System.Char which are not characters but code-units (not Unicode code-points nor graphemes). If, for example, you simply write tex...
If there are no specific needs, choose x86_64 system images with Google APIs to create the emulator. It works way faster than armeabi-v7a on intel x86 x64 based computers. There are some SDK libraries compiled and designed with ARM architecture. If you try to install them on Intel based emulators...
The following example encrypts data by using a hybrid cryptosystem consisting of AES GCM and OAEP, using their default parameter sizes and an AES key size of 128 bits. OAEP is less vulnerable to padding oracle attacks than PKCS#1 v1.5 padding. GCM is also protected against padding oracle attacks. ...
Long-running operations must not be run on the JavaFX application thread, since this prevents JavaFX from updating the UI, resulting in a frozen UI. Furthermore any change to a Node that is part of a "live" scene graph must happen on the JavaFX application thread. Platform.runLater can be...
The below examples use the new form API introduced in RC3. pw-change.template.html <form class="container" [formGroup]="pwChangeForm"> <label for="current">Current Password</label> <input id="current" formControlName="curr...
In Java, there is a built-in language-level locking mechanism: the synchronized block, which can use any Java object as an intrinsic lock (i.e. every Java object may have a monitor associated with it). Intrinsic locks provide atomicity to groups of statements. To understand what that means for us, ...
An atomic operation is an operation that is executed "all at once", without any chance of other threads observing or modifying state during the atomic operation's execution. Lets consider a BAD EXAMPLE. private static int t = 0; public static void main(String[] args) { ExecutorSe...
Press Ctrl + v to enter into visual block mode. Use ↑ / ↓ / j / k to select multiple lines. Press Shift + i and start typing what you want. After you press Esc, the text will be inserted into all the lines you selected. Remember that Ctrl+c is not 100% equivalent to Esc and will not work in this...
Multidimensional arrays are basically arrays containing others arrays as elements. It is represented like [sizeDim1][sizeDim2]..[sizeLastDim]type, replacing sizeDim by numbers corresponding to the length of the dimention, and type by the type of data in the multidimensional array. For example, [2]...
Syntax for pushing to a remote branch git push <remote_name> <branch_name> Example git push origin master
Characteristics of properties : Properties that can be retrieved from an object could have the following characteristics, Enumerable Non - Enumerable own While creating the properties using Object.defineProperty(ies), we could set its characteristics except "own". Properties which...
INotifyPropertyChanged is an interface used by binding sources (i.e. the DataContext) to let the user interface or other components know that a property has been changed. WPF automatically updates the UI for you when it sees the PropertyChanged event raised. It is desirable to have this interface im...
F# Interactive, is a REPL environment that lets you execute F# code, one line at a time. If you have installed Visual Studio with F#, you can run F# Interactive in console by typing "C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\Fsi.exe". On Linux or OS X, the command is fsh...
If it is important for a sequence of numbers generated by random() to differ, it is a good idea to specify a seed with randomSeed(): void setup() { Serial.begin(9600); // If analog pin 0 is left unconnected, analogRead(0) will produce a // different random number each time the ...
name:(john doe^5) The ^ indicator can be used to boost a search term to increase it's relevance level meaning that documents containing doe are more relevant than ones containing john
By default you will get de codes and id's for optionsets and lookups. If you want to get the label as well, you need to add an extra header to the call. $.ajax({ url: Xrm.Page.context.getClientUrl() + '/api/data/v8.0/contacts', headers: { 'Accept': 'Application/json', ...
If you fetch a single record and when that record has a lookup, you can also fetch values of the lookup value using the expand option. This reduces the number of calls you need to make to the API. The sample gets all accounts and the last name of the primary contact: $.ajax({ url: Xrm.Page.co...
This sample fetches accounts using a jQuery ajax method. On thing to note is that you need to set the header in the call to make the work. $.ajax({ url: Xrm.Page.context.getClientUrl() + '/api/data/v8.0/accounts', headers: { 'Accept': 'Application/json' } }).done(function...
It is possible to write a method on a generic type that is more restrictive using where sentence. extension Array where Element: StringLiteralConvertible { func toUpperCase() -> [String] { var result = [String]() for value in self { result.append(String(value).upperca...

Page 107 of 505