Tutorial by Examples: ect

// *** Find Distinct object ids of array *** NSLog(@"Distinct id : %@",[array valueForKeyPath:@"@distinctUnionOfObjects.id"]);
You can use a For Each...Next loop to iterate through any IEnumerable type. This includes arrays, lists, and anything else that may be of type IEnumerable or returns an IEnumerable. An example of looping through a DataTable's Rows property would look like this: For Each row As DataRow In DataTable...
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...
You can open a connection (i.e. request one from the pool) using a context manager: with engine.connect() as conn: result = conn.execute('SELECT price FROM products') for row in result: print('Price:', row['price']) Or without, but it must be closed manually: conn = engine.co...
Given a JList like JList myList = new JList(items); the selected items in the list can be modified through the ListSelectionModel of the JList: ListSelectionModel sm = myList.getSelectionModel(); sm.clearSelection(); // clears the selection sm.setSelectionInterval(inde...
With Maven you can create Vaadin project with vaadin-archetype-application archetype. You can also add that archetype in IDE to create maven project with IDE. mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7....
When you inherit from a class with a property, you can provide a new implementation for one or more of the property getter, setter or deleter functions, by referencing the property object on the parent class: class BaseClass(object): @property def foo(self): return some_calculate...
letters = list('abcde') Select three letters randomly (with replacement - same item can be chosen multiple times): np.random.choice(letters, 3) ''' Out: array(['e', 'e', 'd'], dtype='<U1') ''' Sampling without replacement: np.random.choice(letters, 3, replace=False) ''' Out...
Start two named nodes in two terminal windows: >iex --name [email protected] iex([email protected])> >iex --name [email protected] iex([email protected])> Connect two nodes by instructing one node to connect: iex([email protected])> Node.connect :"[email protected]" true The two n...
Start a named process on one IP address: $ iex --name [email protected] --cookie chocolate iex([email protected])> Node.ping :"[email protected]" :pong iex([email protected])> Node.list [:"[email protected]"] Start another named process on a different IP address: $ iex ...
If need set value 0 to column B, where in column A are duplicated data first create mask by Series.duplicated and then use DataFrame.ix or Series.mask: In [224]: df = pd.DataFrame({'A':[1,2,3,3,2], ...: 'B':[1,7,3,0,8]}) In [225]: mask = df.A.duplicated(keep=False) In...
Concurrent collections are a generalization of thread-safe collections, that allow for a broader usage in a concurrent environment. While thread-safe collections have safe element addition or removal from multiple threads, they do not necessarily have safe iteration in the same context (one may not...
var a:Object; trace(a); // null trace(a.b); // Error 1009 Here, an object reference is declared, but is never assigned a value, be it with new or assignment of a non-null value. Requesting its properties or method results in a 1009 error.
In the app folder find package.json and modify the following line to include the latest version, save the file and close. "react-native": "0.32.0" In terminal: $ npm install Followed by $ react-native upgrade
If you are familiar with jQuery and Sizzle syntax, d3 selections should not be much different. d3 mimics the W3C Selectors API to make interacting with elements easier. For a basic example, to select all <p> and add a change to each of them: d3.selectAll('p') .attr('class','textClass') ...
You can alternatively use an Object Declaration that contains the main function for a Kotlin program. package my.program object App { @JvmStatic fun main(args: Array<String>) { println("Hello World") } } The class name that you will run is the name of you...
Similar to using an Object Declaration, you can define the main function of a Kotlin program using a Companion Object of a class. package my.program class App { companion object { @JvmStatic fun main(args: Array<String>) { println("Hello World") ...
You can redirect the debug output to a text file by adding a TextWriterTraceListener to the Debug.Listeners collection. public static void Main(string[] args) { TextWriterTraceListener myWriter = new TextWriterTraceListener(@"debug.txt"); Debug.Listeners.Add(myWriter); Deb...
<PROJECT_ROOT>\app\build.gradle is specific for app module. <PROJECT_ROOT>\build.gradle is a "Top-level build file" where you can add configuration options common to all sub-projects/modules. If you use another module in your project, as a local library you would have another...

Page 19 of 99