Tutorial by Examples: and

Following are the Prerequisites for installing Cookiecutter: pip virtualenv PostgreSQL Create a virtualenv for your project and activate it: $ mkvirtualenv <virtualenv name> $ workon <virtualenv name> Now install Cookiecutter using: $ pip install cookiecutter Change dire...
Google Perf Tools also provides a CPU profiler, with a slightly friendlier interface. To use it: Install Google Perf Tools Compile your code as usual Add the libprofiler profiler library to your library load path at runtime Use pprof to generate a flat execution profile, or a callgraph diagram...
Print the path to the active developer directory (selected Xcode) xcode-select -p Select a different version of Xcode, e.g. Beta sudo xcode-select -s /Applications/Xcode-beta.app Reset to the default version of Xcode sudo xcode-select -r This is equivalent to running sudo xcode-select -s /Appl...
Ref returns and ref locals are useful for manipulating and returning references to blocks of memory instead of copying memory without resorting to unsafe pointers. Ref Return public static ref TValue Choose<TValue>( Func<bool> condition, ref TValue left, ref TValue right) { ...
We're going to use the expression tree API to create a CalculateSalesTax tree. In plain English, here's a summary of the steps it takes to create the tree. Check if the product is taxable If it is, multiply the line total by the applicable tax rate and return that amount Otherwise return 0 ...
Sometimes we want to look at what is sent and received in the SOAP request. The following methods will return the XML in the request and response: SoapClient::__getLastRequest() SoapClient::__getLastRequestHeaders() SoapClient::__getLastResponse() SoapClient::__getLastResponseHeaders() For ex...
echo off cls sqlcmd.exe -S "your server name" -U "sql user name" -P "sql password" -d "name of databse" -Q "here you may write your query/stored procedure" Batch files like these can be used to automate tasks, for example to make backups of ...
Basic Error Handling By default, Express will look for an 'error' view in the /views directory to render. Simply create the 'error' view and place it in the views directory to handle errors. Errors are written with the error message, status and stack trace, for example: views/error.pug html bo...
This command has several related yet distinct forms. del v If v is a variable, the command del v removes the variable from its scope. For example: x = 5 print(x) # out: 5 del x print(x) # NameError: name 'f' is not defined Note that del is a binding occurence, which means that unless expl...
The following query returns the documents which have an element named "company" - cts:element-value-query( xs:QName('company'), '*', ("wildcarded"))) The following query returns the documents which have an element named "company" with an attribute named "name&...
The example is for illustration purpose of using libraries and helpers and not a valid code. Do not copy / paste it on your projects. HELPER helpers/sendEmail_helper.php if ( ! function_exists('sendEmail')) { function sendEmail($email, $subject, $message, $lang, $cc = null, $file = null) { ...
To Illustrate the MERGE Statement, consider the following two tables - dbo.Product : This table contains information about the product that company is currently selling dbo.ProductNew: This table contains information about the product that the company will sell in the future. The foll...
const source = Rx.Observable.range(1, 3) .map((x, idx, obs) => `Element ${x} was at position ${idx}`); const subscription = source.subscribe( x => console.log(`Next: ${x}`), err => console.log(`Error: ${err}`), () => console.log(`Completed`) ); // => Next: Element 1...
textOnCurve(text,offset,x1,y1,x2,y2,x3,y3,x4,y4) Renders text on quadratic and cubic curves. text is the text to render offset distance from start of curve to text >= 0 x1,y1 - x3,y3 points of quadratic curve or x1,y1 - x4,y4 points of cubic curve or Example usage: textOnCurve("...
Puppet is a configuration management solution. Users describe the desired state of a server or software and configuration management achieves this state. This brings following advantages: Configurations can be reproduced exactly the same every time, as many times as necessary Configurations for ...
Coments "Comments are enclosed in double quotes. BEWARE: This is NOT a string!" "They can span multiple lines." Strings 'Strings are enclosed in sigle quotes.' 'Single quotes are escaped with a single quote, like this: ''.' '''' "<--This string contains one sin...
Classes and methods are usually defined in the Smalltalk IDE. Classes A class definition looks something like this in the browser: XMLTokenizer subclass: #XMLParser instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'XML-Parser' This is actually...
When using a WebView to display your own custom webpage and this webpage contains Javascript, it might be necessary to establish a two-way communication between the Java program and the Javascript in the web page. This example shows how to setup such a communication. The webpage shall display an i...
The only major differences between this and a regular TCP connection are the private Key and the public certificate that you’ll have to set into an option object. How to Create a Key and Certificate The first step in this security process is the creation of a private Key. And what is this private ...
public class AuthenticationHandler : DelegatingHandler { /// <summary> /// Holds request's header name which will contains token. /// </summary> private const string securityToken = "__RequestAuthToken"; /// <summary> ...

Page 85 of 153