Tutorial by Examples: all

CREATE TABLE HR_EMPLOYEES ( PersonID int, LastName VARCHAR(30), FirstName VARCHAR(30), Position VARCHAR(30) ); CREATE TABLE FINANCE_EMPLOYEES ( PersonID INT, LastName VARCHAR(30), FirstName VARCHAR(30), Position VARCHAR(30) ); Let's say we want to ...
alias -p will list all the current aliases.
There are several PHP functions that accept user-defined callback functions as a parameter, such as: call_user_func(), usort() and array_map(). Depending on where the user-defined callback function was defined there are different ways to pass them: Procedural style: function square($number) { ...
6 ES6's Object.assign() function can be used to copy all of the enumerable properties from an existing Object instance to a new one. const existing = { a: 1, b: 2, c: 3 }; const clone = Object.assign({}, existing); This includes Symbol properties in addition to String ones. Object rest/sp...
from collections import Counter c = Counter(["a", "b", "c", "d", "a", "b", "a", "c", "d"]) c # Out: Counter({'a': 3, 'b': 2, 'c': 2, 'd': 2}) c["a"] # Out: 3 c[7] # not in the list (7 oc...
Introduction Package is a term used by npm to denote tools that developers can use for their projects. This includes everything from libraries and frameworks such as jQuery and AngularJS to task runners such as Gulp.js. The packages will come in a folder typically called node_modules, which will a...
$ git branch -d dev Deletes the branch named dev if its changes are merged with another branch and will not be lost. If the dev branch does contain changes that have not yet been merged that would be lost, git branch -d will fail: $ git branch -d dev error: The branch 'dev' is not fully merged...
Swift //Align contents to the left of the frame button.contentHorizontalAlignment = .left //Align contents to the right of the frame button.contentHorizontalAlignment = .right //Align contents to the center of the frame button.contentHorizontalAlignment = .center //Make contents fill th...
import multiprocessing def fib(n): """computing the Fibonacci in an inefficient way was chosen to slow down the CPU.""" if n <= 2: return 1 else: return fib(n-1)+fib(n-2) p = multiprocessing.Pool() print(p.map(fib,[38,37,3...
You can overload the function call operator (): Overloading must be done inside of a class/struct: //R -> Return type //Types -> any different type R operator()(Type name, Type2 name2, ...) { //Do something //return something } //Use it like this (R is return type, a and b a...
To begin, install Node.js on your development computer. Windows: Navigate to the download page and download/run the installer. Mac: Navigate to the download page and download/run the installer. Alternatively, you can install Node via Homebrew using brew install node. Homebrew is a command-line pac...
You can apply any kind of additional processing to the output by passing a callable to ob_start(). <?php function clearAllWhiteSpace($buffer) { return str_replace(array("\n", "\t", ' '), '', $buffer); } ob_start('clearAllWhiteSpace'); ?> <h1>Lorem Ipsum&l...
The extension method to be called is determined at compile-time based on the reference-type of the variable being accessed. It doesn't matter what the variable's type is at runtime, the same extension method will always be called. open class Super class Sub : Super() fun Super.myExtension()...
PM> Uninstall-Package EntityFramework
PM> Uninstall-Package -ProjectName MyProjectB EntityFramework
PM> Install-Package EntityFramework -Version 6.1.2
re.findall(r"[0-9]{2,3}", "some 1 text 12 is 945 here 4445588899") # Out: ['12', '945', '444', '558', '889'] Note that the r before "[0-9]{2,3}" tells python to interpret the string as-is; as a "raw" string. You could also use re.finditer() which works in...
Given some JSON file "foo.json" like: {"foo": {"bar": {"baz": 1}}} we can call the module directly from the command line (passing the filename as an argument) to pretty-print it: $ python -m json.tool foo.json { "foo": { "bar...
Install the svn client to start collaborating on the project that is using Subversion as its version control system. To install Subversion, you can build it yourself from a source code release or download a binary package pre-built for your operating system. The list of sites where you can obtain a...
Given a function that accepts a Node-style callback, fooFn(options, function callback(err, result) { ... }); you can promisify it (convert it to a promise-based function) like this: function promiseFooFn(options) { return new Promise((resolve, reject) => fooFn(options, (err, re...

Page 3 of 113