Tutorial by Examples: f

Syntax is: LEFT ( string-expression , integer ) RIGHT ( string-expression , integer ) SELECT LEFT('Hello',2) --return He SELECT RIGHT('Hello',2) --return lo Oracle SQL doesn't have LEFT and RIGHT functions. They can be emulated with SUBSTR and LENGTH.SUBSTR ( string-expression, 1, intege...
AngularJS has digest loop and all your functions in a view and filters are executed every time the digest cycle is run. The digest loop will be executed whenever the model is updated and it can slow down your app (filter can be hit multiple times, before the page is loaded). You should avoid this: ...
These functions are very similar in behaviour. The difference is that ng-if removes elements from the DOM. If there are large parts of the code that will not be shown, then ng-if is the way to go. ng-show will only hide the elements but will keep all the handlers. ng-if The ngIf directive removes ...
// create an array with 2 elements var myArray = new [] { "one", "two" }; // enumerate through the array foreach(var item in myArray) { Console.WriteLine(item); } // output: // one // two // exchange the element on the first position // note that all collecti...
Note: You can skip this part if your server uses HTTPS to serve content and jump to Application Setup guide. If your app targets iOS 9 and your server uses HTTPS to serve content, you don’t need to sign the file. If not (e.g. when supporting Handoff on iOS 8), it has to be signed using a SSL certif...
Mage::log('My log entry', null, 'mylogfile.log'); This wil log to /var/log/mylogfile.log
Mage::log('My log entry'); Mage::log('My log message: '.$myVariable); Mage::log($myArray); Mage::log($myObject); This will log to /var/log/system.log Objects and Arrays are automatically written via a print_r() directive. Watch out when using objects since these can get substantial in size. ...
A common usecase for the ready() hook is to access the DOM, e.g. to initiate a Javascript plugin, get the dimensions of an element etc. The problem Due to Vue's asynchronous DOM update mechanism, it's not guaranteed that the DOM has been fully updated when the ready() hook is called. This usually ...
PHP provides an alternative syntax for some control structures: if, while, for, foreach, and switch. When compared to the normal syntax, the difference is, that the opening brace is replaced by a colon (:) and the closing brace is replaced by endif;, endwhile;, endfor;, endforeach;, or endswitch;, ...
The if statement in the example above allows to execute a code fragment, when the condition is met. When you want to execute a code fragment, when the condition is not met you extend the if with an else. if ($a > $b) { echo "a is greater than b"; } else { echo "a is NOT gre...

for

for loops are typically used when you have a piece of code which you want to repeat a given number of times. for ($i = 1; $i < 10; $i++) { echo $i; } Outputs: 123456789 For detailed information, see the Loops topic.
foreach is a construct, which enables you to iterate over arrays and objects easily. $array = [1, 2, 3]; foreach ($array as $value) { echo $value; } Outputs: 123. To use foreach loop with an object, it has to implement Iterator interface. When you iterate over associative arrays: $arra...
elseif elseif combines if and else. The if statement is extended to execute a different statement in case the original if expression is not met. But, the alternative expression is only executed, when the elseif conditional expression is met. The following code displays either "a is bigger tha...

if

The if construct allows for conditional execution of code fragments. if ($a > $b) { echo "a is bigger than b"; } PHP Manual - Control Structures - If
Effects can be applied to audio by chaining nodes between the source and the destination node. In this example we use a gain node to mute the source, and only let sound through at specific times. This allows us to create morse code. function morse(gainNode, pattern) { let silenceTimeout = 300; ...
You must be very careful when providing a forwarding reference overload as it may match too well: struct A { A() = default; // #1 A(A const& ) = default; // #2 template <class T> A(T&& ); // #3 }; The intent here was that A is c...
Pointers can also be used to point at functions. Let's take a basic function: int my_function(int a, int b) { return 2 * a + 3 * b; } Now, let's define a pointer of that function's type: int (*my_pointer)(int, int); To create one, just use this template: return_type_of_func (*my_fun...
In Index page change the following: error_reporting(E_ALL | E_STRICT); to error_reporting(E_ALL); Set $_SERVER['MAGE_IS_DEVELOPER_MODE'] = true and uncomment this line (remove the #) #ini_set('display_errors', 1); You can also Set Dev Mode using SetEnv in your .htaccess file To make th...
Creating and returning an image object by loading the image data from the file at the specified path. Example: UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[cellCountry objectForKey:@"Country_Flag"] ofType:nil]]; Using Array: Example NSM...
Objective-C //set off-image mySwitch.offImage = [UIImage imageNamed:@"off_image"]; [mySwitch setOffImage:[UIImage imageNamed:@"off_image"]]; //set on-image mySwitch.onImage = [UIImage imageNamed:@"on_image"]; [mySwitch setOnImage:[UIImage imageNamed:@"on_im...

Page 95 of 457