Tutorial by Examples: al

This lists all of the custom classifiers you have trained. 'use strict'; let watson = require('watson-developer-cloud'); var visualRecognition = watson.visual_recognition({ version: 'v3', api_key: process.env['API_KEY'], version_date:'2016-05-19' }); let url = "https://upl...
The following Go file can be compiled into a continuous external collector that will query a MSSQL server database that uses the StackExchange.Exceptional schema. It will query multiple servers/databases for all exceptions since UTC 00:00 to convert the raw entries into a counter. It also uses the b...
In case you have reverted back to a past commit and lost a newer commit you can recover the lost commit by running git reflog Then find your lost commit, and reset back to it by doing git reset HEAD --hard <sha1-of-commit>
5.1 The reduce() method applies a function against an accumulator and each value of the array (from left-to-right) to reduce it to a single value. Array Sum This method can be used to condense all values of an array into a single value: [1, 2, 3, 4].reduce(function(a, b) { return a + b; }); ...
5.1 .some and .every allow a logical connective of Array values. While .some combines the return values with OR, .every combines them with AND. Examples for .some [false, false].some(function(value) { return value; }); // Result: false [false, true].some(function(value) { return value...
All the examples in this paragraph print the line !"#$&'()*;<=>? @[\]^`{|}~ A backslash quotes the next character, i.e. the next character is interpreted literally. The one exception is a newline: backslash-newline expands to the empty string. echo \!\"\#\$\&\'\(\)\*\;\...
The above type handler can be installed into SqlMapper using the AddTypeHandler method. SqlMapper.AddTypeHandler<IHtmlString>(new IHtmlStringTypeHandler()); Type inference allows you to omit the generic type parameter: SqlMapper.AddTypeHandler(new IHtmlStringTypeHandler()); There's als...
Numerical comparisons use the -eq operators and friends if [[ $num1 -eq $num2 ]]; then echo "$num1 == $num2" fi if [[ $num1 -le $num2 ]]; then echo "$num1 <= $num2" fi There are six numeric operators: -eq equal -ne not equal -le less or equal -lt less than ...
You define a map using the keyword map, followed by the types of its keys and its values: // Keys are ints, values are ints. var m1 map[int]int // initialized to nil // Keys are strings, values are ints. var m2 map[string]int // initialized to nil Maps are reference types, and once defined ...
The zero value of a map is nil and has a length of 0. var m map[string]string fmt.Println(m == nil) // true fmt.Println(len(m) ==0) // true A nil map has no keys nor can keys be added. A nil map behaves like an empty map if read from but causes a runtime panic if written to. var m map[string]...
You shouldn't call NSLog without a literal format string like this: NSLog(variable); // Dangerous code! If the variable is not an NSString, the program will crash, because NSLog expects an NSString. If the variable is an NSString, it will work unless your string contains a %. NSLog will pars...
A useful tool in Java Concurrency is ThreadLocal – this allows you to have a variable that will be unique to a given thread. Thus, if the same code runs in different threads, these executions will not share the value, but instead each thread has its own variable that is local to the thread. For exa...
We can illustrate this problem with the following pseudo-code function foo() { global $bob; $bob->doSomething(); } Your first question here is an obvious one Where did $bob come from? Are you confused? Good. You've just learned why globals are confusing and considered a bad p...
You can create a horizontal break to divide your text by placing three (or more) underscores ___ or asterisks *** or hyphens --- on their own line. You can create a horizontal break to divide your text by placing three (or more) underscores or asterisks or hyphens o...
In functions taking callable as an argument, you can also put a string with PHP built-in function. It's common to use trim as array_map parameter to remove leading and trailing whitespace from all strings in the array. $arr = [' one ', 'two ', ' three']; var_dump(array_map('trim', $arr)); ...
Most databases do not have a native way of generating a series of numbers for ad-hoc use; however, common table expressions can be used with recursion to emulate that type of function. The following example generates a common table expression called Numbers with a column i which has a row for numbe...
# Create the nodes # In a real world scenario we would use at least 3 managers to cover the fail of one manager. docker-machine create -d virtualbox manager docker-machine create -d virtualbox worker1 # Create the swarm # It is possible to define a port for the *advertise-addr* and *listen-ad...
When the following is compiled, it will return a different value depending on which directives are defined. // Compile with /d:A or /d:B to see the difference string SomeFunction() { #if A return "A"; #elif B return "B"; #else return "C"; #endif ...
#import <Foundation/Foundation.h> @interface Car:NSObject { NSString *CarMotorCode; NSString *CarChassisCode; } - (instancetype)initWithMotorValue:(NSString *) motorCode andChassisValue:(NSInteger)chassisCode; - (void) startCar; - (void) stopCar; @end @implementation Car...
C11 Reading an object will cause undefined behavior, if the object is1: uninitialized defined with automatic storage duration it's address is never taken The variable a in the below example satisfies all those conditions: void Function( void ) { int a; int b = a; } 1 (Quo...

Page 18 of 269