Tutorial by Examples: c

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...
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...
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...
Create this class : public class InputFilterMinMax implements InputFilter { private int min, max; public InputFilterMinMax(int min, int max) { this.min = min; this.max = max; } public InputFilterMinMax(String min, String max) { this.min = Integer...
When first introduced, AsyncTasks were executed serially on a single background thread. Starting with DONUT, this was changed to a pool of threads allowing multiple tasks to operate in parallel. Starting with HONEYCOMB, tasks are executed on a single thread to avoid common application errors caused ...
Intro An array is a container object that holds a number of values. In the following image you can see an array with size 10, the first element indexed 1 and the last element 10. Autohotkey offers a few ways of defining and creating arrays. Array := [] Array := Array() Creating and initia...
This example inserts/sends the current day of the week's full name (e.g. Sunday) whenever Ctrl + Alt + D is pressed: ^!d::Send, %A_DDDD%
myDebt := 9000 index := RegExMatch("You owe me $42", "\$(\d+)", dollars) if(index > 0) { ; indices are usually 1-based in AHK myDebt += dollars1 MsgBox, Current debt: %myDebt% } Result: Current debt: 9042
Comments in Tcl are best thought of as another command. A comment consists of a # followed by any number of characters up to the next newline. A comment can appear wherever a command can be placed. # this is a valid comment proc hello { } { # the next comment needs the ; before it to indicat...
Due to the way the Tcl language parser works, braces in the code must be properly matched. This includes the braces in comments. proc hw {} { # this { code will fail puts {hello world} } A missing close-brace: possible unbalanced brace in comment error will be thrown. proc hw {} { ...
The CharField is used for storing defined lengths of text. In the example below up to 128 characters of text can be stored in the field. Entering a string longer than this will result in a validation error being raised. from django.db import models class MyModel(models.Model): name = models...
Introduction Binary Search is a Divide and Conquer search algorithm. It uses O(log n) time to find the location of an element in a search space where n is the size of the search space. Binary Search works by halving the search space at each iteration after comparing the target value to the middle ...
You can use the following code for going back and forward. if (!function_exists('codepoint_encode')) { function codepoint_encode($str) { return substr(json_encode($str), 1, -1); } } if (!function_exists('codepoint_decode')) { function codepoint_decode($str) { re...

Page 374 of 826