Tutorial by Examples: el

The delete built-in function removes the element with the specified key from a map. people := map[string]int{"john": 30, "jane": 29} fmt.Println(people) // map[john:30 jane:29] delete(people, "john") fmt.Println(people) // map[jane:29] If the map is nil or ther...
NSArray *myColors = [NSArray arrayWithObjects: @"Red", @"Green", @"Blue", @"Yellow", nil]; NSLog (@"Number of elements in array = %lu", [myColors count]);
NSMutableArray *myColors; myColors = [NSMutableArray arrayWithObjects: @"Red", @"Green", @"Blue", @"Yellow", nil]; [myColors addObject: @"Indigo"]; [myColors addObject: @"Violet"]; //Add objects from an NSArray NSArray *myArray = @[@...
NSMutableArray *myColors; int i; int count; myColors = [NSMutableArray arrayWithObjects: @"Red", @"Green", @"Blue", @"Yellow", nil]; [myColors insertObject: @"Indigo" atIndex: 1]; [myColors insertObject: @"Violet" atIndex: 3];
Remove at specific index: [myColors removeObjectAtIndex: 3]; Remove the first instance of a specific object: [myColors removeObject: @"Red"]; Remove all instances of a specific object: [myColors removeObjectIdenticalTo: @"Red"]; Remove all objects: [myColors removeAl...
NSArray *myColors = @[@"Red", @"Green", @"Blue", @"Yellow"]; // Preceding is the preferred equivalent to [NSArray arrayWithObjects:...] Getting a single item The objectAtIndex: method provides a single object. The first object in an NSArray is index 0. Si...
The lang attribute is used to specify the language of element content and attribute text values: <p lang="en">The content of this element is in English.</p> <p lang="en" title="The value of this attribute is also in English.">The content of this el...
You can "overwrite" a language declaration: <p lang="en">This English sentence contains the German word <span lang="de">Hallo</span>.</p>
The <section> element represents a generic section to thematically group content. Every section, typically, should be able to be identified with a heading element as a child of the section. You can use the <section> element within an <article> and vice-versa. Every section shou...
Subpatterns can be referenced with their relative group number: (?-1) will recurse into the previous group (?+1) will recurse into the next group Also usable with the \g<N> syntax.
To pass data from the current view controller back to the previous view controller, you can use the delegate pattern. This example assumes that you have made a segue in the Interface Builder and that you set the segue identifier to showSecondViewController. The outlets and actions must also be ho...
The built-in function len returns the number of elements in a map m := map[string]int{} len(m) // 0 m["foo"] = 1 len(m) // 1 If a variable points to a nil map, then len returns 0. var m map[string]int len(m) // 0
WITH RECURSIVE ManagersOfJonathon AS ( -- start with this row SELECT * FROM Employees WHERE ID = 4 UNION ALL -- get manager(s) of all previously selected rows SELECT Employees.* FROM Employees JOIN ManagersOfJonathon ON Employees.ID = Manager...
WITH RECURSIVE ManagedByJames(Level, ID, FName, LName) AS ( -- start with this row SELECT 1, ID, FName, LName FROM Employees WHERE ID = 1 UNION ALL -- get employees that have any of the previously selected rows as manager SELECT ManagedByJames.Level + 1, ...
BuildConfigField Gradle allows buildConfigField lines to define constants. These constants will be accessible at runtime as static fields of the BuildConfig class. This can be used to create flavors by defining all fields within the defaultConfig block, then overriding them for individual build fla...
MATLAB supports (and encourages) vectorized operations on vectors and matrices. For example, suppose we have A and B, two n-by-m matrices and we want C to be the element-wise product of the corresponding elements (i.e., C(i,j) = A(i,j)*B(i,j)). The un-vectorized way, using nested loops is as follo...
length counts the occurences of elements a in a foldable structure t a. ghci> length [7, 2, 9] -- t ~ [] 3 ghci> length (Right 'a') -- t ~ Either e 1 -- 'Either e a' may contain zero or one 'a' ghci> length (Left "foo") -- t ~ Either String 0 ghci> length (3, True) ...
package main import ( "log" "net/http" ) func main() { // Create a mux for routing incoming requests m := http.NewServeMux() // All URLs will be handled by this function m.HandleFunc("/", func(w http.ResponseWriter, r *http.Reque...
VoiceOver navigates from top-left to bottom-right, irrespective of the view hierarchy. This is usually how content is arranged in left-to-right languages since sighted individuals tend to scan the screen in an “F-shaped pattern”. VoiceOver users will expect to navigate the same way as typical users....
Most UIKit classes, including UIView, adhere to UIAccessibilityProtocol and return correct values by default. It’s easy to take for granted that a UIView set to hidden is also absent from the accessibility hierarchy and won’t be navigated by VoiceOver. While this default behavior is usually sufficie...

Page 10 of 145