Tutorial by Examples: al

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
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
NSArray *myColors = [NSArray arrayWithObjects: @"Red", @"Green", @"Blue", @"Yellow", nil]; // Convert myColors to mutable NSMutableArray *myColorsMutable = [myColors mutableCopy];
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 ...
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...
% Define serial port with a baud rate of 115200 rate = 115200; if ispc s = serial('COM1', 'BaudRate',rate); elseif ismac % Note that on OSX the serial device is uniquely enumerated. You will % have to look at /dev/tty.* to discover the exact signature of your % serial device ...
Assuming you created the serial port object s as in this example, then % Read one byte data = fread(s, 1); % Read all the bytes, version 1 data = fread(s); % Read all the bytes, version 2 data = fread(s, s.BytesAvailable); % Close the serial port fclose(s);
Assuming you created the serial port object s as in this example, then to close it fclose(s) However, sometimes you can accidentally lose the port (e.g. clear, overwrite, change scope, etc...), and fclose(s) will no longer work. The solution is easy fclose(instrfindall) More info at instrfin...
Assuming you created the serial port object s as in this example, then % Write one byte fwrite(s, 255); % Write one 16-bit signed integer fwrite(s, 32767, 'int16'); % Write an array of unsigned 8-bit integers fwrite(s,[48 49 50],'uchar'); % Close the serial port fclose(s);
It is common for memory performance to compress multiple values into a single primitive value. This may be useful to pass various information into a single variable. For example, one can pack 3 bytes - such as color code in RGB - into an single int. Packing the values // Raw bytes as input byte...
ProcedureName ProcedureName argument1, argument2 Call a procedure by its name without any parentheses. Edge case The Call keyword is only required in one edge case: Call DoSomething : DoSomethingElse DoSomething and DoSomethingElse are procedures being called. If the Call keyword was rem...
To retrieve the result of a procedure call (e.g. Function or Property Get procedures), put the call on the right-hand side of an assignment: result = ProcedureName result = ProcedureName(argument1, argument2) Parentheses must be present if there are parameters. If the procedure has no parameter...
Parentheses are used to enclose the arguments of function calls. Using them for procedure calls can cause unexpected problems. Because they can introduce bugs, both at run-time by passing a possibly unintended value to the procedure, and at compile-time by simply being invalid syntax. Run-time Re...
Call ProcedureName Call ProcedureName(argument1, argument2) The explicit call syntax requires the Call keyword and parentheses around the argument list; parentheses are redundant if there are no parameters. This syntax was made obsolete when the more modern implicit call syntax was added to VB. ...
Two std::strings can be compared lexicographically using the operators ==, !=, <, <=, >, and >=: std::string str1 = "Foo"; std::string str2 = "Bar"; assert(!(str1 < str2)); assert(str > str2); assert(!(str1 <= str2)); assert(str1 >= str2); assert...
You can use the <img> or <object> elements to embed external SVG elements. Setting the height and width is optional but is highly recommended. Using the image element <img src="attention.svg" width="50" height="50"> Using <img> does not allo...
<link rel="alternate stylesheet" href="path/to/style.css" title="yourTitle"> Some browsers allow alternate style sheets to apply if they are offered. By default they will not be applied, but usually they can be changed through the browser settings: Firefox l...
When you need to remove a specific value from an array, you can use the following one-liner to create a copy array without the given value: array.filter(function(val) { return val !== to_remove; }); Or if you want to change the array itself without creating a copy (for example if you write a fun...

Page 30 of 269