Tutorial by Examples: e

If you need to sort the results of a UNION, use this pattern: ( SELECT ... ) UNION ( SELECT ... ) ORDER BY Without the parentheses, the final ORDER BY would belong to the last SELECT.
When adding a LIMIT to a UNION, this is the pattern to use: ( SELECT ... ORDER BY x LIMIT 10 ) UNION ( SELECT ... ORDER BY x LIMIT 10 ) ORDER BY x LIMIT 10 Since you cannot predict which SELECT(s) will the "10" will come from, you need to get 10 from each, then further whittle do...
Strict mode also prevents you from deleting undeletable properties. "use strict"; delete Object.prototype; // throws a TypeError The above statement would simply be ignored if you don't use strict mode, however now you know why it does not execute as expected. It also prevents you fr...
Remember to npm install all the files into devDependencies first. E.g. npm install --save-dev gulp gulp-concat gulp-rename gulp-uglify gulp-uglifycss Gulpfile.js var gulp = require('gulp'); var gulp_concat = require('gulp-concat'); var gulp_rename = require('gulp-rename'); var gulp_uglify = ...
To create a parallel collection from a sequential collection, call the par method. To create a sequential collection from a parallel collection, call the seq method. This example shows how you turn a regular Vector into a ParVector, and then back again: scala> val vect = (1 to 5).toVector vect:...
The most common mode of using TensorFlow involves first building a dataflow graph of TensorFlow operators (like tf.constant() and tf.matmul(), then running steps by calling the tf.Session.run() method in a loop (e.g. a training loop). A common source of memory leaks is where the training loop conta...
To improve memory allocation performance, many TensorFlow users often use tcmalloc instead of the default malloc() implementation, as tcmalloc suffers less from fragmentation when allocating and deallocating large objects (such as many tensors). Some memory-intensive TensorFlow programs have been kn...
PyPar is a library that uses the message passing interface (MPI) to provide parallelism in Python. A simple example in PyPar (as seen at https://github.com/daleroberts/pypar) looks like this: import pypar as pp ncpus = pp.size() rank = pp.rank() node = pp.get_processor_name() print 'I am r...
Detailed instructions on getting dropwizard set up or installed.
There are several scopes that are available only in a web-aware application context: request - new bean instance is created per HTTP request session - new bean instance is created per HTTP session application - new bean instance is created per ServletContext globalSession - new bean instance i...
When using async queries, you can execute multiple queries at the same time, but not on the same context. If the execution time of one query is 10s, the time for the bad example will be 20s, while the time for the good example will be 10s. Bad Example IEnumerable<TResult1> result1; IEnumera...
In [188]: s = pd.Series(["a","b","c","a","c"], dtype="category") In [189]: s Out[189]: 0 a 1 b 2 c 3 a 4 c dtype: category Categories (3, object): [a, b, c] In [190]: df = pd.DataFrame({"A":["a&q...
All lines must be terminated with a line feed character (LF, ASCII value 10) and not for instance CR or CR+LF. There may be no trailing white space at the end of a line. The name of a source file must equal the name of the class it contains followed by the .java extension, even for fil...
Apart from LF the only allowed white space character is Space (ASCII value 32). Note that this implies that other white space characters (in, for instance, string and character literals) must be written in escaped form. \', \", \\, \t, \b, \r, \f, and \n should be preferred over corres...
package com.example.my.package; The package declaration should not be line wrapped, regardless of whether it exceeds the recommended maximum length of a line.
// First java/javax packages import java.util.ArrayList; import javax.tools.JavaCompiler; // Then third party libraries import com.fasterxml.jackson.annotation.JsonProperty; // Then project imports import com.example.my.package.ClassA; import com.example.my.package.ClassB; // Then stat...
Order of class members Class members should be ordered as follows: Fields (in order of public, protected and private) Constructors Factory methods Other Methods (in order of public, protected and private) Ordering fields and methods primarily by their access modifiers or identifier is not ...
class ExampleClass { // Access modifiers first (don't do for instance "static public") public static void main(String[] args) { System.out.println("Hello World"); } } interface ExampleInterface { // Avoid 'public' and 'abstract' since they are imp...
Indentation level is four spaces. Only space characters may be used for indentation. No tabs. Empty lines must not be indented. (This is implied by the no trailing white space rule.) case lines should be indented with four spaces, and statements within the case should be indented with another f...
Source code and comments should generally not exceed 80 characters per line and rarely if ever exceed 100 characters per line, including indentation. The character limit must be judged on a case by case basis. What really matters is the semantical “density” and readability of the line. Making l...

Page 459 of 1191