Tutorial by Examples

CoffeeScript allows to deconstruct objects and arrays when they are fed to functions as arguments. A function that leverages deconstruction will specify in its signature all the fields that are expected within its body. When invoking such function, an object or array containing all the expected fie...
array = [1, 2, 3, 4] [first] = array # 1 [..., last] = array # 4 [first, middle..., last] = array # first is 1, middle is [2, 3], last is 4
The unset command is used to remove one or more variables. unset ?-nocomplain? ?--? ?name name name name? Each name is a variable name specified in any of the ways acceptable to the set command. If a name refers to an element of an array then that element is removed without affecting the rema...
XML <Goku> <child name="Gohan"/> <child name="Goten"/> </Goku> XPATH count(/Goku/child) OUTPUT 2.0
XML <House> <LivingRoom> <plant name="rose"/> </LivingRoom> <TerraceGarden> <plant name="passion fruit"/> <plant name="lily"/> <plant name="golden duranta"/> ...
Enums are defined by the following the syntax above. typedef NS_ENUM(NSUInteger, MyEnum) { MyEnumValueA, MyEnumValueB, MyEnumValueC, }; You also can set your own raw-values to the enumeration types. typedef NS_ENUM(NSUInteger, MyEnum) { MyEnumValueA = 0, MyEnumValueB =...
The example below will collect the Device's OS version number and the the version of the application (which is defined in each projects' properties) that is entered into Version name on Android and Version on iOS. First make an interface in your PCL project: public interface INativeHelper { /...
When object's are linked by a lookup or master-detail relationship, the parent records field's can be referenced from the child record or 'base object' in a query. This is also known as upwards traversal. SELECT FirstName, Account.Name, Account.Category__c FROM Contact It's possible to traverse ...
A Property procedure is a series of statement that retrieves or modifies a custom property on a module. There are three types of property accessors: A Get procedure that returns the value of a property. A Let procedure that assigns a (non-Object) value to an object. A Set procedure that assign...
Any public Sub, Function, or Property inside a class module can be called by preceding the call with an object reference: Object.Procedure In a DateRange class, a Sub could be used to add a number of days to the end date: Public Sub AddDays(ByVal NoDays As Integer) mEndDate = mEndDate + No...
Another useful feature is accessing your custom object collections as arrays in PHP. There are two interfaces available in PHP (>=5.0.0) core to support this: ArrayAccess and Iterator. The former allows you to access your custom objects as array. ArrayAccess Assume we have a user class and a da...
Bootstrap requires a containing element to wrap site contents and house our grid system. You may choose one of two containers to use in your projects. Use .container class for a responsive fixed width container. <div class="container"> ... </div> Use .container-fluid c...
<?php $ch = curl_init(); //curl handler init curl_setopt($ch,CURLOPT_URL,"http://www.google.com/search?q=curl"); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);// set optional params curl_setopt($ch,CURLOPT_HEADER, false); $result=curl_exec($ch); ...
Swift UIApplication.sharedApplication().preferredContentSizeCategory Objective-C [UIApplication sharedApplication].preferredContentSizeCategory; This returns a content size category constant, or an accessibility content size category constant.
You can register for notifications of when the device text size is changed. Swift NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(updateFont), name: name:UIContentSizeCategoryDidChangeNotification, object: nil) Objective-C [[NSNotificationCenter defaultCenter] addObs...
$dbServer = "localhost,1234"; //Name of the server/instance, including optional port number (default is 1433) $dbName = "db001"; //Name of the database $dbUser = "user"; //Name of the user $dbPassword = "password"; //DB Password of that user $connectionI...
//Create Connection $conn = sqlsrv_connect($dbServer, $connectionInfo); $query = "SELECT * FROM [table]"; $stmt = sqlsrv_query($conn, $query); Note: the use of square brackets [] is to escape the word table as it is a reserved word. These work in the same way as backticks ` do in ...
To call a stored procedure on the server: $query = "{call [dbo].[myStoredProcedure](?,?,?)}"; //Parameters '?' includes OUT parameters $params = array( array($name, SQLSRV_PARAM_IN), array($age, SQLSRV_PARAM_IN), array($count, SQLSRV_PARAM_OUT, SQLSRV_PHPTYPE_INT) //$cou...
$conn = sqlsrv_connect($dbServer, $connectionInfo); $query = "SELECT * FROM [users] WHERE [name] = ? AND [password] = ?"; $params = array("joebloggs", "pa55w0rd"); $stmt = sqlsrv_query($conn, $query, $params); If you plan on using the same query statement more...
There are 3 main ways to fetch results from a query: sqlsrv_fetch_array() sqlsrv_fetch_array() retrieves the next row as an array. $stmt = sqlsrv_query($conn, $query); while($row = sqlsrv_fetch_array($stmt)) { echo $row[0]; $var = $row["name"]; //... } sqlsrv_fetch...

Page 602 of 1336