Tutorial by Examples: and

This set of example show how to execute commands stored in strings or script files, without the need of the interactive prompt. This is especially useful to when a shell script needs to interact with a database. Execute command from a string $ mysql -uroot -proot test -e'select * from people' +...
Create example table Employee: CREATE TABLE Employee ( Id INT, EmpName VARCHAR(25), EmpGender VARCHAR(6), EmpDeptId INT ) Creates stored procedure that checks whether the values passed in stored procedure are not null or non empty and perform insert operation in Employee ta...
IIS / .NET version Requirements: See here SignalR 2+ Install the NuGet package Microsoft.AspNet.SignalR (this is the whole SignalR solution) and it will ask you to install any dependencies for other packages. Accept the terms and install them as well. Now that we've got the .dlls and clie...
In order to begin using WebRTC you need to get camera and microphone permission.For that you need following things: adapter.js, you can get it from here A html webpage with a video tag and little bit of js code The adapter.js is a JavaScript shim for WebRTC, maintained by Google with help fro...
appendToFile: Append single src, or multiple srcs from local file system to the destination file system. Also reads input from stdin and appends to destination file system. Keep the as - hdfs dfs -appendToFile [localfile1 localfile2 ..] [/HDFS/FILE/PATH..] cat: Copies source paths to stdout. ...
The command pattern encapsulates parameters to a method, current object state, and which method to call. It is useful to compartmentalize everything needed to call a method at a later time. It can be used to issue a "command" and decide later which piece of code to use to execute the comma...
You can use the TextInputLayout to display error messages according to the material design guidelines using the setError and setErrorEnabledmethods. In order to show the error below the EditText use: TextInputLayout til = (TextInputLayout) findViewById(R.id.username); til.setErrorEnabled(true); ...
int i; int n = 1000000; double area = 0; double h = 1.0 / n; #pragma omp parallel shared(n, h) { double thread_area = 0; // Private / local variable #pragma omp for for (i = 1; i <= n; i++) { double x = h * (i - 0.5); thread_area += (4.0 / (1.0 ...
On a 8 cores Linux machine using GCC version 4.4, the C codes can be compiled and run the following way: $ gcc -std=c99 -O3 -fopenmp loop.c -o loopc -lm $ OMP_NUM_THREADS=1 ./loopc Computing 1000000 cosines and summing them with 1 threads took 0.095832s $ OMP_NUM_THREADS=2 ./loopc Computing 100...
Unity networking provides the High Level API (HLA) to handle network communications abstracting from low level implementations. In this example we will see how to create a Server that can communicate with one or multiple clients. The HLA allows us to easily serialize a class and send objects of ...
Local variables - Those declared within a procedure (subroutine or function) of a class (or other structure). In this example, exampleLocalVariable is a local variable declared within ExampleFunction(): Public Class ExampleClass1 Public Function ExampleFunction() As Integer Dim exa...
'use strict'; const http = require('http'); const PORT = 8080; const server = http.createServer((request, response) => { let buffer = ''; request.on('data', chunk => { buffer += chunk; }); request.on('end', () => { const responseString = `Received string ${buffe...
Rust's coherence rule requires that either the trait or the type for which you are implementing the trait must be defined in the same crate as the impl, so it is not possible to implement Serialize and Deserialize for a type in a different crate directly. The newtype pattern and Deref coercion provi...
By default, Import-CSV imports all values as strings, so to get DateTime- and integer-objects, we need to cast or parse them. Using Foreach-Object: > $listOfRows = Import-Csv .\example.csv > $listOfRows | ForEach-Object { #Cast properties $_.DateTime = [datetime]$_.DateTime $...
The simple and most obvious way to use recursion to get the Nth term of the Fibonnaci sequence is this int get_term_fib(int n) { if (n == 0) return 0; if (n == 1) return 1; return get_term_fib(n - 1) + get_term_fib(n - 2); } However, this algorithm does not scale for higher ...
Files: To determine if a file exists, simply pass the filename to the Dir$ function and test to see if it returns a result. Note that Dir$ supports wild-cards, so to test for a specific file, the passed pathName should to be tested to ensure that it does not contain them. The sample below raises an...
NOTE: For brevity, the examples below use the FolderExists function from the Determining If Folders and Files Exist example in this topic. The MkDir statement can be used to create a new folder. It accepts paths containing drive letters (C:\Foo), UNC names (\\Server\Foo), relative paths (..\Foo...
The Runtime.exec(String ...) and Runtime.exec(String) methods allow you to execute a command as an external process1. In the first version, you supply the command name and the command arguments as separate elements of the string array, and the Java runtime requests the OS runtime system to start th...
Consider the following list comprehension Python 2.x2.7 i = 0 a = [i for i in range(3)] print(i) # Outputs 2 This occurs only in Python 2 due to the fact that the list comprehension “leaks” the loop control variable into the surrounding scope (source). This behavior can lead to hard-to-find...

Page 89 of 153