Tutorial by Examples

Tel

<input type="tel" value="+8400000000"> The input element with a type attribute whose value is tel represents a one-line plain-text edit control for entering a telephone number.
Sometimes you have to check for a condition and set the value of a variable. For ex. String name; if (A > B) { name = "Billy"; } else { name = "Jimmy"; } This can be easily written in one line as String name = A > B ? "Billy" : "Jimmy&quo...
Windows Verify that you have the correct JDK. You can check it by opening command prompt (press windows key and write cmd). In the command prompt type javac -version, this will show the current version of JDK installed on your matching or an error* if Java is missing. If the JDK is not availabl...
Suppose you have a UILabel on your storyboard and you have created an IBOutlet for it in ViewController.swift / ViewController.m and named it labelOne. To make the changes easily visible, change the backgroundColor and textColor of labelOne in the viewDidLoad method: The function sizeToFit is use...
Following is an implementation that demonstrates how an object can be serialized into its corresponding JSON string. class Test { private int idx; private String name; public int getIdx() { return idx; } public void setIdx(int idx) { this.idx = idx; ...
Errors thrown from promises are handled by the second parameter (reject) passed to then or by the handler passed to catch: throwErrorAsync() .then(null, error => { /* handle error here */ }); // or throwErrorAsync() .catch(error => { /* handle error here */ }); Chaining If you hav...
ALTER TABLE Employees DROP COLUMN salary; This will not only delete information from that column, but will drop the column salary from table employees(the column will no more exist).
A custom component that takes the type of a component as input and creates an instance of that component type inside itself. When the input is updated, the previously added dynamic component is removed and the new one added instead. @Component({ selector: 'dcl-wrapper', template: `<div #...
This example is a quick setup of Angular 2 and how to generate a quick example project. Prerequisites: Node.js v4 or greater. npm v3 or greater or yarn. Open a terminal and run the commands one by one: npm install -g @angular/cli or yarn global add @angular/cli depending on your choi...
Simple: NSString *newString = @"My String"; From multiple strings: NSString *stringOne = @"Hello"; NSString *stringTwo = @"world"; NSString *newString = [NSString stringWithFormat:@"My message: %@ %@", stringOne, stringTwo]; Usi...
The main difference is that double-quoted String literals support string interpolations and the full set of escape sequences. For instance, they can include arbitrary Ruby expressions via interpolation: # Single-quoted strings don't support interpolation puts 'Now is #{Time.now}' # Now is #{Time...
Ruby provides several ways to create a String object. The most common way is using single or double quotes to create a "string literal": s1 = 'Hello' s2 = "Hello" The main difference is that double-quoted string literals are a little bit more flexible as they support interpo...
Concatenate strings with the + operator: s1 = "Hello" s2 = " " s3 = "World" puts s1 + s2 + s3 # => Hello World s = s1 + s2 + s3 puts s # => Hello World Or with the << operator: s = 'Hello' s << ' ' s << 'World' puts s # => ...
The double-quoted delimiter " and %Q sequence supports string interpolation using #{ruby_expression}: puts "Now is #{Time.now}" # Now is Now is 2016-07-21 12:47:45 +0200 puts %Q(Now is #{Time.now}) # Now is Now is 2016-07-21 12:47:45 +0200
By default, all the required libraries for build ASP.NET applications are included during the installation of Visual Studio. If a newer version of ASP.NET is released that was not included with Visual Studio, you can download the appropriate SDK library from Microsoft, which will include all the nec...
Few people have issue regarding error message not displaying if existing value is being entered in textbox. So, For Example I'm not allowing user to enter existing email. signup.php (Page where you wanted to sign up new user without existing email id) Remove use yii\bootstrap\ActiveForm; (if p...
You can iterate over arrays either by using enhanced for loop (aka foreach) or by using array indices: int[] array = new int[10]; // using indices: read and write for (int i = 0; i < array.length; i++) { array[i] = i; } Java SE 5 // extended for: read only for (int e : array) { ...
5 The <input type="email"> is used for input fields that should contain an e-mail address. <form> <label>E-mail: <label> <input type="email" name="email"> </form> E-mail address can be automatically validated when submitte...
Tuples are created using generic types Tuple<T1>-Tuple<T1,T2,T3,T4,T5,T6,T7,T8>. Each of the types represents a tuple containing 1 to 8 elements. Elements can be of different types. // tuple with 4 elements var tuple = new Tuple<string, int, bool, MyClass>("foo", 123, t...
To access tuple elements use Item1-Item8 properties. Only the properties with index number less or equal to tuple size are going to be available (i.e. one cannot access Item3 property in Tuple<T1,T2>). var tuple = new Tuple<string, int, bool, MyClass>("foo", 123, true, new MyC...

Page 106 of 1336