Tutorial by Examples: a

Navigator works for both IOS and android. import React, { Component } from 'react'; import { Text, Navigator, TouchableHighlight } from 'react-native'; export default class NavAllDay extends Component { render() { return ( <Navigator initialRoute={{ title: 'Awesome Sc...
What is Concurrency? Doing multiple things at the same time. Taking advantage of number of cores available in multicore CPUs. Running multiple programs in parallel. Objectives of Concurrency Running program in background without hogging CPU. Define Tasks, Define Rules and let...
// plugin initialization $.fn.greenify = function() { // within the function you can use any of the jQuery methods // and `this` context refers to jQuery object this.css( "color", "green" ); }; // apply plugin $( "a" ).greenify();
This works, but there are a couple of things we need to do for our plugin to survive in the real world. One of jQuery's features is chaining, when you link five or six actions onto one selector. This is accomplished by having all jQuery object methods return the original jQuery object again (there a...
To do this in Postman, you simply have to set the following: Set request type to POST In the Headers, set the following: Content-Type = application/json Authorization = < Your FCM Server Key > (See your Firebase Console's Cloud Messaging Tab) Set the payload parameters in the Body...
When a class needs to be provided with hard dependencies best practice is to use a constructor injection pattern where those dependencies are injected using a factory. Let's assume that MyClass is hard dependent on a value $dependency that needs to be resolved from the application config. <?php...
One common pitfall is to try and use this in a nested function or an object, where the context has been lost. document.getElementById('myAJAXButton').onclick = function(){ makeAJAXRequest(function(result){ if (result) { // success this.className = 'success'; } }) }...
There are various ways to use colours in Processing since Processing is very flexible with colour formats. RGB and RGBA This is the standard RGB(A) notation and the default color mode. The first three colour values (red, green, blue) range from 0 to 255. For example, the below example is the colou...
The reference to the outer class uses the class name and this public class OuterClass { public class InnerClass { public void method() { System.out.println("I can access my enclosing class: " + OuterClass.this); } } } You can access fields and ...
Kotlin has two types of string literals: Escaped string Raw string Escaped string handles special characters by escaping them. Escaping is done with a backslash. The following escape sequences are supported: \t, \b, \n, \r, \', \", \\ and \$. To encode any other character, use the Unicod...
Both escaped strings and raw strings can contain template expressions. Template expression is a piece of code which is evaluated and its result is concatenated into string. It starts with a dollar sign $ and consists of either a variable name: val i = 10 val s = "i = $i" // evaluates to ...
In Kotlin strings are compared with == operator which chect for their structural equality. val str1 = "Hello, World!" val str2 = "Hello," + " World!" println(str1 == str2) // Prints true Referential equality is checked with === operator. val str1 = ""&q...
Download Play! 1. Goto http://www.playframework.com/download and download latest Play! release (play-2.5.X.zip at the time of this writing). Unzip in a directory of your choice. We’ll refer to uncompressed folder directory as PLAY_HOME. Add PLAY_HOME folder to you PATH environment variable, so that...
You can make your plugin customizable by accepting options. $.fn.colourize = function(options) { // This is one method to support default options var style = $.extend({ color: "green", backgroundColor: "white" }, options); // Set the col...
While writing jQuery plugins is simple, we want to enclose our plugins in a local scope. This will avoid namespace conflicts as well as polluting the global namespace, on top of ensuring that jQuery is loaded before our plugin extends it. // Encapsulate our plugins in a local scope (function($) { ...
//create a new ExcelPackage using (ExcelPackage excelPackage = new ExcelPackage()) { //create a WorkSheet ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Sheet 1"); //fill cell data with a loop, note that row and column indexes start at 1 Random rnd...
//create a new ExcelPackage using (ExcelPackage excelPackage = new ExcelPackage()) { //create a WorkSheet ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Sheet 1"); //fill cell data with a loop, note that row and column indexes start at 1 Random rnd...
The async package provides functions for asynchronous code. Using the auto function you can define asynchronous relations between two or more functions: var async = require('async'); async.auto({ get_data: function(callback) { console.log('in get_data'); // async code to ...
You can delete trailing spaces with the following command. :%s/\s\+$//e This command is explained as follows: enter Command mode with : do this to the entire file with % (default would be for the current line) substitute action s / start of the search pattern \s whitespace character \+ e...
You can delete all blank lines in a file with the following command: :g/^$/d This command is explained as follows: enter Command mode with : g is a global command that should occur on the entire file / start of the search pattern the search pattern of blank line is ^g /end of the search pat...

Page 874 of 1099