Tutorial by Examples: l

Integer literals provide values that can be used where you need a byte, short, int, long or char instance. (This example focuses on the simple decimal forms. Other examples explain how to literals in octal, hexadecimal and binary, and the use of underscores to improve readability.) Ordinary integ...
<canvas id = "canvas" height='400' width='500'></canvas> var canvas = new fabric.Canvas(document.getElementById('canvas')); console.log(JSON.stringify(canvas)); // '{"objects":[],"background":""}' canvas.add(new fabric.Rect({ left: 10, ...
First Test.class: package foo.bar public class Test { } Also Test.class in another package package foo.bar.baz public class Test { } The above is fine because the two classes exist in different packages.
jQuery plugins are typically installed via NPM or Yarn (if hosted there), or referencing an external script file containing the plugin, whether from a relative directory or a CDN. <script type="text/javascript" src="/path/to/plugin.jquery.js"></script>
First declare a property like this in the ViewController @property (nonatomic) UIRefreshControl *refreshControl; Later in the viewDidLoad() set up the refreshControl as given below: self.refreshControl = [[UIRefreshControl alloc]init]; [self.tableView addSubview:self.refreshControl]; [self.re...
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();
var person = { name: 'John Doe', age: 42, gender: 'male', bio: function() { console.log('My name is ' + this.name); } }; person.bio(); // logs "My name is John Doe" var bio = person.bio; bio(); // logs "My name is undefined" In the above code, person.bi...
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...
import React, { Component } from 'react'; type Props = { posts: Array<Article>, dispatch: Function, children: ReactElement } class Posts extends Component { props: Props; render () { // rest of the code goes here } }
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 ...
Elements of String are characters that can be accessed by the indexing operation string[index]. val str = "Hello, World!" println(str[1]) // Prints e String elements can be iterated with a for-loop. for (c in str) { println(c) }
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...
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...

Page 680 of 861