Tutorial by Examples

beacon = CLBeaconRegion(proximityUUID: <#NSUUID#>, major: <#CLBeaconMajorValue#>, identifier: <#String#>) // listening to all beacons with given UUID and major value beacon = CLBeaconRegion(proximityUUID: <##NSUUID#>, major: <##CLBeaconMajorValue#>, minor: <##C...
Use to push commits made on your local branch to a remote repository. The git push command takes two arguments: A remote name, for example, origin A branch name, for example, master For example: git push <REMOTENAME> <BRANCHNAME> As an example, you usually run git push orig...
Sometimes two arrays of the same length need to be iterated together, for example: $people = ['Tim', 'Tony', 'Turanga']; $foods = ['chicken', 'beef', 'slurm']; array_map is the simplest way to accomplish this: array_map(function($person, $food) { return "$person likes $food\n"; ...
Swift class FooViewController: UIViewController { override func loadView() { view = FooView() } }
Spacemacs is a popular starter kit for emacs. It features a robust package management solution and centers around emacs's popular evil mode, which provides many of the keybindings from vim. It is called Spacemacs because it uses the Space key as the leader key (the idea is similar to Vim's leader k...
Prelude is another popular starter kit. It features good support for various programming languages out-of-the-box including, notably - clojure. On *nix systems it can be installed with the following command: curl -L https://git.io/epre | sh
Model using System.ComponentModel.DataAnnotations; public class ViewModel { [Required(ErrorMessage="Name is required")] public string Name { get; set; } [StringLength(14, MinimumLength = 14, ErrorMessage = "Invalid Phone Number")] [Required(ErrorMessag...
Remote Validation used to check whether the content enter in the input control is valid or not by sending an ajax request to server side to check it. Working The RemoteAttribute works by making an AJAX call from the client to a controller action with the value of the field being validated. The con...
PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database (since version 7), TimesTen in-memory database (since version 11.2.1), and IBM DB2 (since version 9.7). The basic un...
To install packages directly from GitHub use the devtools package: library(devtools) install_github("authorName/repositoryName") To install ggplot2 from github: devtools::install_github("tidyverse/ggplot2") The above command will install the version of ggplot2 that corre...
We have to create a view which will have a image prefix to a text. text could be of variable length.We have to achieve a result where in Image + text is always in center of a parent view. Step 1: First create a single view project and name it something of your choice and open the story board fist...
You must add php to your path environment variable. Follow theses steps : Windows 7 : Right-click on a My Computer icon Click Properties Click Advanced system settings from the left nav Click Advanced tab Click Environment Variables button In the System Variables section, select Path (case-...
Once the Symfony Installer is available, create your first Symfony application with the new command: # Linux, Mac OS X $ symfony new my_project_name # Windows c:\> cd projects/ c:\projects\> php symfony new my_project_name This command can be run from anywhere, not necessarily from t...
The installer requires PHP 5.4 or higher. If you still use the legacy PHP 5.3 version, you cannot use the Symfony Installer. Read the Creating Symfony Applications without the Installer section to learn how to proceed. - source: http://symfony.com/doc/current/book/installation.html
In case your project needs to be based on a specific Symfony version, use the optional second argument of the new command: # use the most recent version in any Symfony branch $ symfony new my_project_name 2.8 $ symfony new my_project_name 3.1 # use a specific Symfony version $ symfony new my_...
Open your command console and execute the following commands: $ sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony $ sudo chmod a+x /usr/local/bin/symfony
Collections are one of the most commonly used data structures in software engineering. A Collection is just a group of objects. A collection can be a List, an array, a map, a tree or anything. So, a collection should provide some way to access its elements without exposing its internal structure. ...
Given any value of type Int or Long to render a human readable string: fun Long.humanReadable(): String { if (this <= 0) return "0" val units = arrayOf("B", "KB", "MB", "GB", "TB", "EB") val digitGroups = (Mat...
A common use case for extension methods is to improve an existing API. Here are examples of adding exist, notExists and deleteRecursively to the Java 7+ Path class: fun Path.exists(): Boolean = Files.exists(this) fun Path.notExists(): Boolean = !this.exists() fun Path.deleteRecursively(): Bool...
In Kotlin you could write code like: val x: Path = Paths.get("dirName").apply { if (Files.notExists(this)) throw IllegalStateException("The important file does not exist") } But the use of apply is not that clear as to your intent. Sometimes it is clearer to create a ...

Page 241 of 1336