Tutorial by Examples: ti

people := map[string]int{ "john": 30, "jane": 29, "mark": 11, } for _, value := range people { fmt.Println("Age:", value) } Note that when iterating over a map with a range loop, the iteration order is not specified and is not guaranteed to...
Installing Visual Studio If you do not have Visual Studio installed, you can download the free Visual Studio Community Edition here. If you already have it installed, you can proceed to the next step. Creating an ASP.NET Core MVC Application. Open Visual Studio. Select File > New Project. ...
Enumerating dictionaries allows you to run a block of code on each dictionary key-value pair using the method enumerateKeysAndObjectsUsingBlock:(void (^)(id key, id obj, BOOL *stop))block Example: NSDictionary stockSymbolsDictionary = @{ @"AAPL":...
In [1]: import numpy as np In [2]: import pandas as pd In [3]: df = pd.DataFrame({'A': list('XYZXYZXYZX'), 'B': [1, 2, 1, 3, 1, 2, 3, 3, 1, 2], 'C': [12, 14, 11, 12, 13, 14, 16, 12, 10, 19]}) In [4]: df.groupby('A')['B'].agg({'mean': np.mean, 'standard deviatio...
Whenever you declare a new rule inside another rule it is called nesting. With basic nesting, as shown below, the nested selector will be compiled as a new CSS selector with all its parents prepended, separated by a space. // SCSS .parent { margin: 1rem; .child { float: left; } ...
Nesting is a very powerful feature, but should be used with caution. It can happen quite easily and quickly, that you start nesting and carry on including all children in a nest, of a nest, of a nest. Let me demonstrate: // SCSS header { // [css-rules] .holder { // [css-rules] ...
Objective-C //for off-state mySwitch.tintColor = [UIColor blueColor]; [mySwitch setTintColor: [UIColor blueColor]]; //for on-state mySwitch.onTintColor = [UIColor cyanColor]; [mySwitch setOnTintColor: [UIColor cyanColor]]; Swift //for off-state mySwitch.tintColor = UIColor.blueColor() ...
import pandas as pd import numpy as np df = pd.DataFrame({'A':[1,2,np.nan,3,np.nan], 'B':[1.2,7,3,0,8]}) df['C'] = df.A.interpolate() df['D'] = df.A.interpolate(method='spline', order=1) print (df) A B C D 0 1.0 1.2 1.0 1.000000 1 2.0 7.0 2...
For annotating some point of interest on map, we use pin annotation. Now, start by creating annotation object first. MKPointAnnotation *pointAnnotation = [[MKPointAnnotation alloc] init]; Now provide coordinate to pointAnnotation,as CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake...
Detailed instructions on getting laravel set up or installed. composer is required for installing laravel easily. There are 3 methods of installing laravel in your system: Via Laravel Installer Download the Laravel installer using composer composer global require "laravel/installer&quo...
Detailed instructions on getting hdfs set up or installed.
Several values of the same type can be returned by passing an output iterator to the function. This is particularly common for generic functions (like the algorithms of the standard library). Example: template<typename Incrementable, typename OutputIterator> void generate_sequence(Increment...
Mapreduce is a part of Hadoop. So when Apache Hadoop (or any distribution of Hadoop is installed) MR is automatically installed. MapReduce is the data processing framework over HDFS(Hadoop distributed file system). MR jobs maybe written using Java, python, Scala, R, etc.
When initializing a Git repository for Unity development, there are a couple of things that need to be done. Unity Ignore Folders Not everything should be versioned in the repository. You can add the template below to your .gitignore file in the root of your repository. Or alternatively, you can c...
Int("123") // Returns 123 of Int type Int("abcd") // Returns nil Int("10") // Returns 10 of Int type Int("10", radix: 2) // Returns 2 of Int type Double("1.5") // Returns 1.5 of Double type Double("abcd") // Returns nil Note that do...
The extension 'realurl' provides complete transformation of URLs with GET parameter in the browser, like “index.php?id=123&type=0&L=1” into a virtual path, a so called “Speaking URL” like “home/about-us/index.html” and back again. The objective is that URLs shall be as human readable as poss...
In this example we will calculate the squared deviance for each column in a data frame, in this case the mtcars. Option A: integer index squared_deviance <- vector("list", length(mtcars)) for (i in seq_along(mtcars)){ squared_deviance[[i]] <- (mtcars[[i]] - mean(mtcars[[i]]))^2...
To illustrate the effect of good for loop construction, we will calculate the mean of each column in four different ways: Using a poorly optimized for loop Using a well optimized for for loop Using an *apply family of functions Using the colMeans function Each of these options will be shown...
<div [class.active]="isActive"></div> <span [style.color]="'red'"></span> <p [attr.data-note]="'This is value for data-note attribute'">A lot of text here</p>
import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: ` <h1>Angular 2 App</h1> <p>Component is directive with template</p> ` }) export class AppComponent { }

Page 105 of 505