Tutorial by Examples

A Table View is a list of rows that can be selected. Each row is populated from a data source. This example creates a simple table view in which each row is a single line of text. Add a UITableView to your Storyboard Although there are a number of ways to create a UITableView, one of the easiest...
Boilerplate code example override func viewDidLoad() { super.viewDidLoad() let myView = UIView() myView.backgroundColor = UIColor.blueColor() myView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(myView) // Add constraints code here // ... ...
Auto layout is used to arrange views so that they look good on any device and orientation. Constraints are the rules that tell how everything should be laid down. They include pinning edges, centering, and setting sizes, among other things. Auto layout is enabled by default, but you can double chec...
Select your button (or whatever view you want to center) on the storyboard. Then click the align button on the bottom right. Select Horizontally in Container and Vertically in Container. Click "Add 2 Constraints". If it wasn't perfectly centered already, you may need to do one more thin...
Let's take an example of adding a value to a range (as it could be done in a loop for example): 3+1:5 Gives: [1] 4 5 6 7 8 This is because the range operator : has higher precedence than addition operator +. What happens during evaluation is as follows: 3+1:5 3+c(1, 2, 3, 4, 5) expansio...
Laravel applications are installed and managed with Composer, a popular PHP dependency manager. There are two ways to create a new Laravel application. Via Composer $ composer create-project laravel/laravel [foldername] Or $ composer create-project --prefer-dist laravel/laravel [foldername] ...
The CREATE TABLE statement is used to create a table in a MySQL database. CREATE TABLE Person ( `PersonID` INTEGER NOT NULL PRIMARY KEY, `LastName` VARCHAR(80), `FirstName` VARCHAR(80), `Address` TEXT, `City` VARCHAR(100) ) Engine=InnoDB; Ev...
CREATE TABLE Person ( PersonID INT UNSIGNED NOT NULL, LastName VARCHAR(66) NOT NULL, FirstName VARCHAR(66), Address VARCHAR(255), City VARCHAR(66), PRIMARY KEY (PersonID) ); A primary key is a NOT NULL single or a multi-column identifier whic...
CREATE TABLE Account ( AccountID INT UNSIGNED NOT NULL, AccountNo INT UNSIGNED NOT NULL, PersonID INT UNSIGNED, PRIMARY KEY (AccountID), FOREIGN KEY (PersonID) REFERENCES Person (PersonID) ) ENGINE=InnoDB; Foreign key: A Foreign Key (FK) is either a single col...
Detailed instructions on getting pandas set up or installed can be found here in the official documentation. Installing pandas with Anaconda Installing pandas and the rest of the NumPy and SciPy stack can be a little difficult for inexperienced users. The simplest way to install not only pandas, ...
5 <input type="number" value="0" name="quantity"> The Input element with a type attribute whose value is number represents a precise control for setting the element’s value to a string representing a number. Please note that this field does not guarantee to h...
ReactJS is a JavaScript library contained in a single file react-<version>.js that can be included in any HTML page. People also commonly install the React DOM library react-dom-<version>.js along with the main React file: Basic Inclusion <!DOCTYPE html> <html> <...
Java SE 8 Converting an array of objects to Stream: String[] arr = new String[] {"str1", "str2", "str3"}; Stream<String> stream = Arrays.stream(arr); Converting an array of primitives to Stream using Arrays.stream() will transform the array to a primitive sp...
Instantiate a XMLWriter object: $xml = new XMLWriter(); Next open the file to which you want to write. For example, to write to /var/www/example.com/xml/output.xml, use: $xml->openUri('file:///var/www/example.com/xml/output.xml'); To start the document (create the XML open tag): $xml-&gt...
To show all staged and unstaged changes, use: git diff HEAD NOTE: You can also use the following command: git status -vv The difference being that the output of the latter will actually tell you which changes are staged for commit and which are not.
Knockout is available on most JavaScript platforms, or as a standalone script. Include as a script You can download the script from it's download page, then include it in your page with a standard script tag <script type='text/javascript' src='knockout-3.4.0.js'></script> Using a C...
Sometimes you may want to start a new activity while removing previous activities from the back stack, so the back button doesn't take you back to them. One example of this might be starting an app on the Login activity, taking you through to the Main activity of your application, but on logging out...
The built-in mtcars data frame contains information about 32 cars, including their weight, fuel efficiency (in miles-per-gallon), speed, etc. (To find out more about the dataset, use help(mtcars)). If we are interested in the relationship between fuel efficiency (mpg) and weight (wt) we may start p...
apply is used to evaluate a function (maybe an anonymous one) over the margins of an array or matrix. Let's use the iris dataset to illustrate this idea. The iris dataset has measurements of 150 flowers from 3 species. Let's see how this dataset is structured: > head(iris) Sepal.Length Sep...
A table can be replicated as follows: CREATE TABLE ClonedPersons LIKE Persons; The new table will have exactly the same structure as the original table, including indexes and column attributes. As well as manually creating a table, it is also possible to create table by selecting data from anot...

Page 103 of 1336