Tutorial by Examples: al

To install v6.x update the packages curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - Using the apt package manager sudo apt-get install -y nodejs
Download driver via nuget. Using this command in the package manager console Install-Package mongocsharpdriver
#include <stdio.h> #include <stdlib.h> int main (void) { int * pdata; size_t n; printf ("Enter the size of the array: "); fflush(stdout); /* Make sure the prompt gets printed to buffered stdout. */ if (1 != scanf("%zu", &n)) /* If zu is n...
Detailed instructions on getting pymongo set up or installed. Installing with Pip To install pymongo for the first time: pip install pymongo Installing a specific version of pymongo: Where X.X.X is the version to be installed pip install pymongo==X.X.X Upgrading existing pymon...
Adding a Conditional attribute from System.Diagnostics namespace to a method is a clean way to control which methods are called in your builds and which are not. #define EXAMPLE_A using System.Diagnostics; class Program { static void Main() { ExampleA(); // This method will ...
If you want to create and send signals in your own code (for example, if you are writing an extension), create a new Signal instance and call send when the subscribers should be notified. Signals are created using a Namespace. from flask import current_app from flask.signals import Namespace n...
This example shows a minimal Mockito test using a mocked ArrayList: import static org.mockito.Mockito.*; import static org.junit.Assert.*; import java.util.ArrayList; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRu...
Following is most basic expression tree that is created by lambda. Expression<Func<int, bool>> lambda = num => num == 42; To create expression trees 'by hand', one should use Expression class. Expression above would be equivalent to: ParameterExpression parameter = Expression.Pa...
Swift timer.fire() Objective-C [timer fire]; Calling the fire method causes an NSTimer to perform the task it would have usually performed on a schedule. In a non-repeating timer, this will automatically invalidate the timer. That is, calling fire before the time interval is up will result ...
Swift timer.invalidate() Objective-C [timer invalidate]; This will stop the timer from firing. Must be called from the thread the timer was created in, see Apple's notes: You must send this message from the thread on which the timer was installed. If you send this message from another thr...
The following values are considered falsey, in that they evaluate to False when applied to a boolean operator. None False 0, or any numerical value equivalent to zero, for example 0L, 0.0, 0j Empty sequences: '', "", (), [] Empty mappings: {} User-defined types where the __bool__ o...
To generate a list (tree view) of currently installed packages, use npm list ls, la and ll are aliases of list command. la and ll commands shows extended information like description and repository. Options The response format can be changed by passing options. npm list --json json - Sh...
The try { ... } catch ( ... ) { ... } control structure is used for handling Exceptions. String age_input = "abc"; try { int age = Integer.parseInt(age_input); if (age >= 18) { System.out.println("You can vote!"); } else { System.out.println(...
Specific to Windows System and android Phone: Requirements: USB Cable Android Device Android Driver Software Basically after connecting USB cable PC detects the Android Device and it will automatically search for the required Drivers for that Android Device. If that drivers are not found th...
Removing duplicate values in a list can be done by converting the list to a set (that is an unordered collection of distinct objects). If a list data structure is needed, then the set can be converted back to a list using the function list(): names = ["aixk", "duke", "edik&...
It is possible, inside a closure, to use an external variable with the special keyword use. For instance: <?php $quantity = 1; $calculator = function($number) use($quantity) { return $number + $quantity; }; var_dump($calculator(2)); // Shows "3" You can go further by ...
Since PHP7, it is possible to bind a closure just for one call, thanks to the call method. For instance: <?php class MyClass { private $property; public function __construct($propertyValue) { $this->property = $propertyValue; } } $myClosure = function() ...
The reduce function can be used to sum the elements in a list. (reduce '+ '(1 2 3 4)) ;;=> 10 By default, reduce performs a left-associative reduction, meaning that the sum 10 is computed as (+ (+ (+ 1 2) 3) 4) The first two elements are summed first, and then that result (3) is added to...
You can use curl: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash Or you can use wget: wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash
Listing available remote versions for installation nvm ls-remote Installing a remote version nvm install <version> For example nvm install 0.10.13

Page 67 of 269