Tutorial by Examples: al

Global aliases In bash, aliases can only be placed at the beginning of of a command, but zsh supports aliases anywhere. If you place the following line in your $ZDOTDIR/.zshrc alias -g G=' | grep -i' You can then run cat haystack.txt G "needle" Suffix aliases (Added in zsh 4.2.x) ...
the receiver of a method is usually a pointer for performance reason because we wouldn't make a copy of the instance, as it would be the case in value receiver, this is especially true if the receiver type is a struct. anoter reason to make the receiver type a pointer would be so we could modify the...
You can install mocha either globally or in your project folder. The latter is the preferred way. In all the example let's assume that all the test files are in a test folder within the project folder. Install Mocha locally To install mocha in your project folder, you can use the following npm co...
Detailed instructions on getting split set up or installed.
We use the same dataset as with polyfit: npoints = 20 slope = 2 offset = 3 x = np.arange(npoints) y = slope * x + offset + np.random.normal(size=npoints) Now, we try to find a solution by minimizing the system of linear equations A b = c by minimizing |c-A b|**2 import matplotlib.pyplot as...
In tables recording events there is often a datetime field recording the time an event happened. Finding the single most recent event can be difficult because it's always possible that two events were recorded with exactly identical timestamps. You can use row_number() over (order by ...) to make su...
from sqlalchemy import create_engine cnx = create_engine('mysql+pymysql://username:password@server:3306/database').connect() sql = 'select * from mytable' df = pd.read_sql(sql, cnx)
Typically, before developing a new HERE SDK application, you need to acquire a set of credentials by registering your application on http://developer.here.com. Each application requires a unique set of credentials. When you register your app, the registered bundle identifier must match the package n...
You use the FIRST_VALUE function to determine the first value in an ordered result set, which you identify using a scalar expression. SELECT StateProvinceID, Name, TaxRate,        FIRST_VALUE(StateProvinceID)         OVER(ORDER BY TaxRate ASC) AS FirstValue FROM SalesTaxRate; In this example,...
The LAST_VALUE function provides the last value in an ordered result set, which you specify using a scalar expression. SELECT TerritoryID, StartDate, BusinessentityID,        LAST_VALUE(BusinessentityID)          OVER(ORDER BY TerritoryID) AS LastValue FROM SalesTerritoryHistory; This example...
var passport = require('passport'); var LocalStrategy = require('passport-local').Strategy; passport.serializeUser(function(user, done) { //In serialize user you decide what to store in the session. Here I'm storing the user id only. done(null, user.id); }); passport.deserializeUser(funct...
This is a complete example of all the commonly used SQLite related APIs. The aim is to get you up and running really fast. You can also get a runnable PHP file of of this tutorial. Creating/opening a database Let's create a new database first. Create it only if the file doesn't exist and open it f...
Haystack: The string in which given pattern needs to be searched. Needle: The pattern to be searched. Time complexity: Search portion (strstr method) has the complexity O(n) where n is the length of haystack but as needle is also pre parsed for building prefix table O(m) is required for building p...
Callback functions in JavaScript Callback functions are common in JavaScript. Callback functions are possible in JavaScript because functions are first-class citizens. Synchronous callbacks. Callback functions can be synchronous or asynchronous. Since Asynchronous callback functions may be more c...
Detailed instructions on getting nuget set up or installed.
Assume that I have a file named in.txt: $ cat in.txt a b a c a d I only want to replace the a\nc with deleted, but not a\nb or a\nd. $ sed -e ':loop # create a branch/label named `loop` $!{ N # append the next line of input into the pattern space /\n$/!b...
SQL has two logical functions – CHOOSE and IIF. The CHOOSE function returns an item from a list of values, based on its position in the list. This position is specified by the index. In the syntax, the index parameter specifies the item and is a whole number, or integer. The val_1 … val_n paramete...
Callback hell (also a pyramid of doom or boomerang effect) arises when you nest too many callback functions inside a callback function. Here is an example to read a file (in ES6). const fs = require('fs'); let filename = `${__dirname}/myfile.txt`; fs.exists(filename, exists => { if (exi...
When you have defined the basic layout of the application and acquired necessary permissions, the final step is to initialize the instance of the MapFragment class, thus creating and associating a Map with the MapFragment declared in the activity_main.xml file. public class BasicMapActivity extends...
Before we use the IncludeFile method, we need to : Declare std_internal_LibFiles globally Initialize it with a new dictionary Dim std_internal_LibFiles Set std_internal_LibFiles = CreateObject("Scripting.Dictionary")

Page 219 of 269