Tutorial by Examples

The canvas element was introduced in HTML5 for drawing graphics. <canvas id="myCanvas"> Cannot display graphic. Canvas is not supported by your browser (IE<9) </canvas> The above will create a transparent HTML<canvas> element of 300×150 px in size. You can us...
The family of x86 assembly languages represents decades of advances on the original Intel 8086 architecture. In addition to there being several different dialects based on the assembler used, additional processor instructions, registers and other features have been added over the years while still r...
Pipes may be chained. <p>Today is {{ today | date:'fullDate' | uppercase}}.</p>
my.pipe.ts import { Pipe, PipeTransform } from '@angular/core'; @Pipe({name: 'myPipe'}) export class MyPipe implements PipeTransform { transform(value:any, args?: any):string { let transformedValue = value; // implement your transformation logic here return transformedValue; }...
Angular2 comes with a few built-in pipes: PipeUsageExampleDatePipedate{{ dateObj | date }} // output is 'Jun 15, 2015'UpperCasePipeuppercase{{ value | uppercase }} // output is 'SOMETEXT'LowerCasePipelowercase{{ value | lowercase }} // output is 'sometext'CurrencyPipecurrency{{ 31.00 | currency:'US...
Fixed precision and scale decimal numbers. DECIMAL and NUMERIC are functionally equivalent. Syntax: DECIMAL ( precision [ , scale] ) NUMERIC ( precision [ , scale] ) Examples: SELECT CAST(123 AS DECIMAL(5,2)) --returns 123.00 SELECT CAST(12345.12 AS NUMERIC(10,5)) --returns 12345.12000
Approximate-number data types for use with floating point numeric data. SELECT CAST( PI() AS FLOAT) --returns 3.14159265358979 SELECT CAST( PI() AS REAL) --returns 3.141593
Exact-number data types that use integer data. Data typeRangeStoragebigint-2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807)8 Bytesint-2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647)4 Bytessmallint-2^15 (-32,768) to 2^15-1 (32,767)2 Bytestinyint0 to 2551 Byte
Data types that represent monetary or currency values. Data typeRangeStoragemoney-922,337,203,685,477.5808 to 922,337,203,685,477.58078 bytessmallmoney-214,748.3648 to 214,748.36474 bytes
Binary data types of either fixed length or variable length. Syntax: BINARY [ ( n_bytes ) ] VARBINARY [ ( n_bytes | max ) ] n_bytes can be any number from 1 to 8000 bytes. max indicates that the maximum storage space is 2^31-1. Examples: SELECT CAST(12345 AS BINARY(10)) -- 0x0000000000000000...
String data types of either fixed length or variable length. Syntax: CHAR [ ( n_chars ) ] VARCHAR [ ( n_chars ) ] Examples: SELECT CAST('ABC' AS CHAR(10)) -- 'ABC ' (padded with spaces on the right) SELECT CAST('ABC' AS VARCHAR(10)) -- 'ABC' (no padding due to variable character) SELE...
UNICODE string data types of either fixed length or variable length. Syntax: NCHAR [ ( n_chars ) ] NVARCHAR [ ( n_chars | MAX ) ] Use MAX for very long strings that may exceed 8000 characters.
A 16-byte GUID / UUID. DECLARE @GUID UNIQUEIDENTIFIER = NEWID(); SELECT @GUID -- 'E28B3BD9-9174-41A9-8508-899A78A33540' DECLARE @bad_GUID_string VARCHAR(100) = 'E28B3BD9-9174-41A9-8508-899A78A33540_foobarbaz' SELECT @bad_GUID_string, -- 'E28B3BD9-9174-41A9-8508-899A78A33540_foobarbaz' ...
NSArray *myColors = [NSArray arrayWithObjects: @"Red", @"Green", @"Blue", @"Yellow", nil]; // Convert myColors to mutable NSMutableArray *myColorsMutable = [myColors mutableCopy];
Long vectors with long runs of the same value can be significantly compressed by storing them in their run-length encoding (the value of each run and the number of times that value is repeated). As an example, consider a vector of length 10 million with a huge number of 1's and only a small number o...
See Boost Getting Started. Most of the Boost libraries are header-only, meaning that there's nothing you have to compile or link to. Make sure you are getting the most recent version of Boost: Visit www.boost.org Look for the Current Release download. Currently, this links here. Select the ...
In Python 3, many of the dictionary methods are quite different in behaviour from Python 2, and many were removed as well: has_key, iter* and view* are gone. Instead of d.has_key(key), which had been long deprecated, one must now use key in d. In Python 2, dictionary methods keys, values and items ...
quickCheckAll is a Template Haskell helper which finds all the definitions in the current file whose name begins with prop_ and tests them. {-# LANGUAGE TemplateHaskell #-} import Test.QuickCheck (quickCheckAll) import Data.List (sort) idempotent :: Eq a => (a -> a) -> a -> Bool ...
Installing mongoose is as easy as running the npm command npm install mongoose --save But make sure you have also installed MongoDB for your OS or Have access to a MongoDB database. Connecting to MongoDB database: 1. Import mongoose into the app: import mongoose from 'mongoose'; 2. Specify...
static class Program { static void Main() { dynamic dynamicObject = new ExpandoObject(); string awesomeString = "Awesome"; // Prints True Console.WriteLine(awesomeString.IsThisAwesome()); dynamicObject.StringValue = awesomeStrin...

Page 142 of 1336