Tutorial by Examples: and

Scollector will monitor any Windows processes or services specified in the configuration file. [[Process]] Name = "^scollector" [[Process]] Name = "^chrome" [[Process]] Name = "^(MSSQLSERVER|SQLSERVERAGENT)$"
The following demo features an <output> element's use of the [for] and [form] attributes. Keep in mind, <output> needs JavaScript in order to function. Inline JavaScript is commonly used in forms as this example demonstrates. Although the <input> elements are type="number&quot...
A lambda expression evaluated in a class' member function is implicitly a friend of that class: class Foo { private: int i; public: Foo(int val) : i(val) {} // definition of a member function void Test() { auto lamb = [](Foo &foo, int val) ...
A newline can be included in a single-string or double-quoted string. Note that backslash-newline does not result in a newline, the line break is ignored. newline1=' ' newline2=" " newline3=$'\n' empty=\ echo "Line${newline1}break" echo "Line${newline2}break" ...
Variable substitutions should only be used inside double quotes. calculation='2 * 3' echo "$calculation" # prints 2 * 3 echo $calculation # prints 2, the list of files in the current directory, and 3 echo "$(($calculation))" # prints 6 Outside of doubl...
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...
The & operator will perform a binary AND, where a bit is copied if it exists in both operands. That means: # 0 & 0 = 0 # 0 & 1 = 0 # 1 & 0 = 0 # 1 & 1 = 1 # 60 = 0b111100 # 30 = 0b011110 60 & 30 # Out: 28 # 28 = 0b11100 bin(60 & 30) # Out: 0b11100
String comparison uses the == operator between quoted strings. The != operator negates the comparison. if [[ "$string1" == "$string2" ]]; then echo "\$string1 and \$string2 are identical" fi if [[ "$string1" != "$string2" ]]; then echo &quot...
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 ...
You can "overwrite" a parent element's language declaration by introducing any element apart from applet, base, basefont, br, frame, frameset, hr, iframe, meta, param, script (of HTML 4.0) with an own lang attribute: <p lang="en" title="An English paragraph"> ...
A reference cycle (or retain cycle) is so named because it indicates a cycle in the object graph: Each arrow indicates one object retaining another (a strong reference). Unless the cycle is broken, the memory for these objects will never be freed. A retain cycle is created when two instances of ...
BuildConfigField Gradle allows buildConfigField lines to define constants. These constants will be accessible at runtime as static fields of the BuildConfig class. This can be used to create flavors by defining all fields within the defaultConfig block, then overriding them for individual build fla...
# 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...
Assuming the following Person class: public class Person { public string Name { get; set; } public int Age { get; set; } } The following lambda: p => p.Age > 18 Can be passed as an argument to both methods: public void AsFunc(Func<Person, bool> func) public void AsE...
The function strtok breaks a string into a smaller strings, or tokens, using a set of delimiters. #include <stdio.h> #include <string.h> int main(void) { int toknum = 0; char src[] = "Hello,, world!"; const char delimiters[] = ", !"; char *to...
import Data.Traversable as Traversable data MyType a = -- ... instance Traversable MyType where traverse = -- ... Every Traversable structure can be made a Foldable Functor using the fmapDefault and foldMapDefault functions found in Data.Traversable. instance Functor MyType where ...
Compiler warnings can be generated using the #warning directive, and errors can likewise be generated using the #error directive. #if SOME_SYMBOL #error This is a compiler Error. #elif SOME_OTHER_SYMBOL #warning This is a compiler Warning. #endif
A compiler symbol is a keyword that is defined at compile-time that can be checked for to conditionally execute specific sections of code. There are three ways to define a compiler symbol. They can be defined via code: #define MYSYMBOL They can be defined in Visual Studio, under Project Propert...
package main import ( "log" "net/http" ) func main() { // Create a mux for routing incoming requests m := http.NewServeMux() // All URLs will be handled by this function m.HandleFunc("/", func(w http.ResponseWriter, r *http.Reque...
// Create an array with a fixed size and type. var array = new Uint8Array(5); // Generate cryptographically random values crypto.getRandomValues(array); // Print the array to the console console.log(array); crypto.getRandomValues(array) can be used with instances of the following classes...

Page 12 of 153