Tutorial by Examples

A tsconfig.json file can contain both line and block comments, using the same rules as ECMAScript. //Leading comment { "compilerOptions": { //this is a line comment "module": "commonjs", //eol line comment "target" /*inline bl...
When automating the provisioning of new nodes to a swarm, you need to know what the right join token is for the swarm as well as the advertised address of the manager. You can find this out by running the following commands on any of the existing manager nodes: # grab the ipaddress:port of the mana...
A boolean array can be created manually by using dtype=bool when creating the array. Values other than 0, None, False or empty strings are considered True. import numpy as np bool_arr = np.array([1, 0.5, 0, None, 'a', '', True, False], dtype=bool) print(bool_arr) # output: [ True True False ...
Function pointers are the most basic way of passing functions around, which can also be used in C. (See the C documentation for more details). For the purpose of callable objects, a function pointer can be defined as: typedef returnType(*name)(arguments); // All using name =...
Every class which overloads the operator() can be used as a function object. These classes can be written by hand (often referred to as functors) or automatically generated by the compiler by writing Lambdas from C++11 on. struct Person { std::string name; unsigned int age; }; // Func...
During design, the architect should look at what parts of the system need restricted access, and which parts can be less protected. For example, everyone can have read access to the public web page of the company, but only authorized individuals can edit the content. To help with the decisions to b...
Checkbox is a control that allow user to get boolean values from user for a spesific question like "Are you ok?". Has a event called CheckedChanged, which occurs whenever the check property is changed. Here is a CheckBox that has a question "Is Checked?". We got this Message...
When Vim opens a file with <CR><NL> line endings (common on MSDOS based operating systems, also called CRLF) it will set fileformat to dos, you can check what with: :set fileformat? fileformat=dos Or just :set ff? fileformat=dos To convert it to <NL> line endings (com...
HelloWorld.proj <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="SayHello"> <!-- Properties can be passed as command line parameters. i.e. /p:Name=MyName or /p:Name="My Name" (Use quotes if the value includes ...
If there is a null object on the collection it not throws a NPE, it returns a null instead: assert ['cat', 'dog', 'fish', null]*.length() == [3, 3, 4, null] Using it directly in a null object it's also null-safe: def nullCollection = null assert nullCollection*.length() == null
The sample content used here is Tears of Steel, by Blender Foundation. Specifically, we will use the download titled "HD 720p (~365MB, mov, 2.0)". This is a single file that ends with the extension "mov" and will play in just about any modern media player. Note that the download...
in the index.html, link the CSS from Google CDN <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.min.css"> Required dependencies: angular angular-aria angular-animate angular-messages <!-- Angular M...
The importance of good naming, can be best illustrated by some bad examples: [Test] Test1() {...} //Cryptic name - absolutely no information [Test] TestFoo() {...} //Name of the function - and where can I find the expected behaviour? [Test] TestTFSid567843() {...} //Huh? You want me to lo...
Same as, with writing classes - start with the simple cases, then add requirement (aka tests) and implementation (aka production code) case by case: [Test] public void EnsureThat_IsLeapYearIfDecimalMultipleOf4() {...} [Test] public void EnsureThat_IsNOTLeapYearIfDecimalMultipleOf100 {...} [Tes...
Testcode has the same quality demands, as production code. MakeSut() improves readability can be easily refactored perfectly supports dependency injection. Here's the concept: [Test] public void TestSomething() { var sut = MakeSut(); string result = sut.Do(); Assert....
Here the steps required to create a Firebase project and to connect with an Android app. Add Firebase to your app Create a Firebase project in the Firebase console and click Create New Project. Click Add Firebase to your Android app and follow the setup steps. When prompted, enter yo...
Add post-formats to post_type 'page' add_post_type_support( 'page', 'post-formats' ); Next example registers custom post type 'my_custom_post_type', and add Post Formats. Register custom post type 'my_custom_post_type' add_action( 'init', 'create_my_post_type' ); function create_my_post_type(...
Function Call add_theme_support( 'post-formats' )
Sometimes you want to know the position (index) of the current element while iterating over an enumerator. For such purpose, Ruby provides the with_index method. It can be applied to all the enumerators. Basically, by adding with_index to an enumeration, you can enumerate that enumeration. Index is ...
!process - list user mode processes .process - set process context !peb - show process environment block !teb - show thread environment block !locks - deadlock analysis .dump - save a crash dump file to disk

Page 840 of 1336