Tutorial by Examples: al

There are times in which it is desirable to consolidate factor levels into fewer groups, perhaps because of sparse data in one of the categories. It may also occur when you have varying spellings or capitalization of the category names. Consider as an example the factor set.seed(1) colorful <...
To iterate over several generators in parallel, use the zip builtin: for x, y in zip(a,b): print(x,y) Results in: 1 x 2 y 3 z In python 2 you should use itertools.izip instead. Here we can also see that the all the zip functions yield tuples. Note that zip will stop iterating as soon...
There are multiple ways to set a key's object in an NSDictionary, corresponding to the ways you get a value. For instance, to add a lamborghini to a list of cars Standard [cars setObject:lamborghini forKey:@"Lamborghini"]; Just like any other object, call the method of NSDictionary th...
There are multiple ways to get an object from an NSDictionary with a key. For instance, to get a lamborghini from a list of cars Standard Car * lamborghini = [cars objectForKey:@"Lamborghini"]; Just like any other object, call the method of NSDictionary that gives you an object for a ...
Represents a thread-safe collection of key/value pairs that can be accessed by multiple threads concurrently. Creating an instance Creating an instance works pretty much the same way as with Dictionary<TKey, TValue>, e.g.: var dict = new ConcurrentDictionary<int, string>(); Ad...
The following example shows how you can use Json.Net to serialize the data in an C# Object's instance, to JSON string. using System; using System.Collections.Generic; using Newtonsoft.Json; public class Employee { public string FirstName { get; set; } public string LastName { get; s...
The following example shows how you can deserialize a JSON string containing into an Object (i.e. into an instance of a class). using System; using System.Collections.Generic; using Newtonsoft.Json; public class Program { public class Employee { public s...
Detailed instructions on getting database set up or installed.
Installation npm install -D webpack typescript ts-loader webpack.config.js module.exports = { entry: { app: ['./src/'], }, output: { path: __dirname, filename: './dist/[name].js', }, resolve: { extensions: ['', '.js', '.ts'], }, module: { loaders: [...
There are multiple ways to populate an array. Directly 'one-dimensional Dim arrayDirect1D(2) As String arrayDirect(0) = "A" arrayDirect(1) = "B" arrayDirect(2) = "C" 'multi-dimensional (in this case 3D) Dim arrayDirectMulti(1, 1, 2) arrayDirectMulti(0, 0, 0...
To retrieve a list of all servers registered on the instance: EXEC sp_helpserver;
Detailed instructions on getting mvvmcross set up or installed.
In this code example, the char pointer p is initialized to the address of a string literal. Attempting to modify the string literal has undefined behavior. char *p = "hello world"; p[0] = 'H'; // Undefined behavior However, modifying a mutable array of char directly, or through a poin...
Detailed instructions on getting resharper set up or installed.
A hexadecimal number is a value in base-16. There are 16 digits, 0-9 and the letters A-F (case does not matter). A-F represent 10-16. An octal number is a value in base-8, and uses the digits 0-7. A binary number is a value in base-2, and uses the digits 0 and 1. All of these numbers result in ...
Python has only limited support for parsing ISO 8601 timestamps. For strptime you need to know exactly what format it is in. As a complication the stringification of a datetime is an ISO 8601 timestamp, with space as a separator and 6 digit fraction: str(datetime.datetime(2016, 7, 22, 9, 25, 59, 55...
Install JDK 8 (Windows, Linux) and set the path (Windows). Install Scala (Linux), For Windows visit http://www.scala-lang.org/download/ download and install binary distribution, set the environment variable for scala in PATH which is in \scala\bin. Installing Typesafe activator (It contains Scal...
The most common way to install the RSpec gem is using Bundler. Add this line to your application's Gemfile: gem 'rspec' And then execute bundle to install the dependencies: $ bundle Alternatively, you can install the gem manually: $ gem install rspec After installing the gem, run the fol...
import flash.net.URLRequest; import flash.media.Sound; import flash.events.Event; var req:URLRequest = new URLRequest("click.mp3"); var snd:Sound = new Sound(req); snd.addEventListener(Event.COMPLETE, function(e: Event) { snd.play(); }
Prerequisites sudo apt-get install build-essential sudo apt-get install python [optional] sudo apt-get install git Get source and build cd ~ git clone https://github.com/nodejs/node.git OR For the latest LTS Node.js version 6.10.2 cd ~ wget https://nodejs.org/dist/v6.3.0/node-v6.10....

Page 51 of 269