Tutorial by Examples: au

Introduce environment variable VAGRANT_DEFAULT_PROVIDER export VAGRANT_DEFAULT_PROVIDER=vmware_fusion
Vagrant.configure("2") do |config| # ... other config up here config.vm.provider "vmware_fusion" end
vagrant up --provider hyperv
vagrant up --provider docker
vagrant up --provider vmware_fusion
vagrant up --provider vmware_workstation
vagrant up --provider virtualbox VirtualBox is the default provider for a vanilla Vagrant setup.
The Math.random() function should give random numbers that have a standard deviation approaching 0. When picking from a deck of card, or simulating a dice roll this is what we want. But in most situations this is unrealistic. In the real world the randomness tends to gather around an common normal...
UITextView has built in support to auto detect a variety of data. The data that is able to be auto-detected currently includes: enum { UIDataDetectorTypePhoneNumber = 1 << 0, UIDataDetectorTypeLink = 1 << 1, UIDataDetectorTypeAddress = 1 << 2, UID...
ElementAt will return the item at index n. If n is not within the range of the enumerable, throws an ArgumentOutOfRangeException. int[] numbers = { 1, 2, 3, 4, 5 }; numbers.ElementAt(2); // 3 numbers.ElementAt(10); // throws ArgumentOutOfRangeException ElementAtOrDefault will return the item...
Classic unit tests test state, but it can be impossible to properly test methods whose behavior depends on other classes through state. We test these methods through interaction tests, which verify that the system under test correctly calls its collaborators. Since the collaborators have their own...
Beware that numbers can accidentally be converted to strings or NaN (Not a Number). JavaScript is loosely typed. A variable can contain different data types, and a variable can change its data type: var x = "Hello"; // typeof x is a string x = 5; // changes typeof x to...
C++11 NOTE: std::auto_ptr has been deprecated in C++11 and will be removed in C++17. You should only use this if you are forced to use C++03 or earlier and are willing to be careful. It is recommended to move to unique_ptr in combination with std::move to replace std::auto_ptr behavior. Before we ...
Just like in case of the function arguments, template parameters can have their default values. All template parameters with a default value have to be declared at the end of the template parameter list. The basic idea is that the template parameters with default value can be omitted while template ...
Get the Source Package from http://typo3.org/download/ and upload this package to your web server. Put it one level above the document root. For this manual, we will use the .tar.gz file. Use the shell to execute the according commands: /var/www/site/htdocs/$ cd .. /var/www/site/$ wget get.typo3....
When using a VCS such as Git or SVN, there are some secret data that must never be versioned (whether the repository is public or private). Among those data, you find the SECRET_KEY setting and the database password. A common practice to hide these settings from version control is to create a file...
Consider the following component with one input myInput and an internal value called someInternalValue. Both of them are used in a component's template. import {Component, Input} from '@angular/core'; @Component({ template:` <div> <p>{{myInput}}</p> <p>{...
You often find yourself in a situation where you need to find a variables corresponding value, and collections got you covered. In the example below we got three different locales in an array with a corresponding calling code assigned. We want to be able to provide a locale and in return get the as...
ClientContext clientContext = new ClientContext("http://MyServer/sites/MySiteCollection "); GroupCollection collGroup = clientContext.Web.SiteGroups; Group oGroup = collGroup.GetById(6); UserCreationInformation userCreationInfo = new UserCreationInformation(); userCreationInfo.Email ...
ClientContext oClientContext = new ClientContext("http://MyServer/sites/MySiteCollection/MyWebSite"); Web oWebsite = clientContext.Web; Principal oUser = oWebsite.SiteUsers.GetByLoginName(@"DOMAIN\alias"); RoleDefinition oRoleDefinition = oWebsite.RoleDefinitions.GetByName...

Page 9 of 37