Tutorial by Examples: on

This example wraps the asynchronous method oauth2.client.getToken(callback) from the package NPM package simple-oauth2into a Fiber so that the method may be called synchronously. const oauth2 = require('simple-oauth2')(credentials); const credentials = { clientID: '#####', clientSecret...
var myData = [ { name: "test1", value: "ok" }, { name: "test2", value: "nok" } ] // We have to select elements (here div.samples) // and assign data. The second parameter of data() is really important, // it will determine the "key" t...
Concatenation refers to the operation of appending one sequence to another. Concat Concatenates two sequences to form one sequence. Method Syntax // Concat var numbers1 = new int[] { 1, 2, 3 }; var numbers2 = new int[] { 4, 5, 6 }; var numbers = numbers1.Concat(numbers2); // number...
Filtering refers to the operations of restricting the result set to contain only those elements that satisfy a specified condition. Where Selects values that are based on a predicate function. Method Syntax // Where var numbers = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; var evens = number...
A join of two data sources is the association of objects in one data source with objects that share a common attribute in another data source. Join Joins two sequences based on key selector functions and extracts pairs of values. Method Syntax // Join class Customer { public int Id ...
Projection refers to the operations of transforming an object into a new form. Select Projects values that are based on a transform function. Method Syntax // Select var numbers = new int[] { 1, 2, 3, 4, 5 }; var strings = numbers.Select(n => n.ToString()); // strings = { "1...
A sorting operation orders the elements of a sequence based on one or more attributes. OrderBy Sorts values in ascending order. Method Syntax // OrderBy var numbers = new int[] { 5, 4, 8, 2, 7, 1, 9, 3, 6 }; var ordered = numbers.OrderBy(n => n); // ordered = { 1, 2, 3, 4, 5, 6, ...
Conversion operations change the type of input objects. AsEnumerable Returns the input typed as IEnumerable. Method Syntax // AsEnumerable int[] numbers = { 1, 2, 3, 4, 5 }; var nums = numbers.AsEnumerable(); // nums: static type is IEnumerable<int> Query Syntax // Not app...
Aggregation operations computes a single value from a collection of values. Aggregate Performs a custom aggregation operation on the values of a collection. Method Syntax // Aggregate var numbers = new int[] { 1, 2, 3, 4, 5 }; var product = numbers.Aggregate(1, (acc, n) => acc * n);...
Quantifier operations return a Boolean value that indicates whether some or all of the elements in a sequence satisfy a condition. All Determines whether all the elements in a sequence satisfy a condition. Method Syntax // All var numbers = new int[] { 1, 2, 3, 4, 5 }; bool areLessThan...
Grouping refers to the operations of putting data into groups so that the elements in each group share a common attribute. GroupBy Groups elements that share a common attribute. Method Syntax // GroupBy class Order { public string Customer { get; set; } public string Descriptio...
Partitioning refers to the operations of dividing an input sequence into two sections, without rearranging the elements, and then returning one of the sections. Skip Skips elements up to a specified position in a sequence. Method Syntax // Skip var numbers = new int[] { 1, 2, 3, 4, 5 }; ...
Generation refers to creating a new sequence of values. DefaultIfEmpty Replaces an empty collection with a default valued singleton collection. Method Syntax // DefaultIfEmpty var nums = new int[0]; var numbers = nums.DefaultIfEmpty(); // numbers = { 0 } Query Syntax // Not appl...
Set operations refer to query operations that produce a result set that is based on the presence or absence of equivalent elements within the same or separate collections (or sets). Distinct Removes duplicate values from a collection. Method Syntax // Distinct var numbers = new int[] { 1,...
Two sequences whose corresponding elements are equal and which have the same number of elements are considered equal. SequenceEqual Determines whether two sequences are equal by comparing elements in a pair-wise manner. Method Syntax // SequenceEqual var numbers1 = new int[] { 1, 2, 3, 4,...
Element operations return a single, specific element from a sequence. ElementAt Returns the element at a specified index in a collection. Method Syntax // ElementAt var strings = new string[] { "zero", "one", "two", "three" }; var str = strings.E...
Components in Vue are like widgets. They allow us to write reusable custom elements with desired behavior. They are nothing but objects which can contain any/all of the options that the root or any Vue instance can contain, including an HTML template to render. Components consist of: HTML marku...
When you bind a service to your application credentials become available through the VCAP_SERVICES environment variable. This environment variable contains JSON containing the credentials for all bound services. Example VCAP_SERVICES environment variable { "push-reappt": [ { ...
String#replace can have a function as its second argument so you can provide a replacement based on some logic. "Some string Some".replace(/Some/g, (match, startIndex, wholeString) => { if(startIndex == 0){ return 'Start'; } else { return 'End'; } }); // will retur...
In iTunesConnect, select the app which you want to add an IAP to. Click on features and you will see this: Click the plus. You will then need to select which type of IAP you want to make. Then you will need to fill out all of the information for your IAP. If you have any trouble you can cons...

Page 108 of 475