Tutorial by Examples

The -Command parameter is used to specify commands to be executed on launch. It supports multiple data inputs. -Command <string> You can specify commands to executed on launch as a string. Multiple semicolon ;-separated statements may be executed. >PowerShell.exe -Command "(Get-Date...
You can specify a file to a ps1-script to execute it's content on launch using the -File parameter. Basic script MyScript.ps1 (Get-Date).ToShortDateString() "Hello World" Output: >PowerShell.exe -File Desktop\MyScript.ps1 10.09.2016 Hello World Using parameters and argument...
public static async Task PostAsync(this Uri uri, object value) { var content = new ObjectContext(value.GetType(), value, new JsonMediaTypeFormatter()); using (var client = new HttpClient()) { return await client.PostAsync(uri, content); } } . . . var uri = new ...
public static async Task<TResult> GetAnsync<TResult>(this Uri uri) { using (var client = new HttpClient()) { var message = await client.GetAsync(uri); if (!message.IsSuccessStatusCode) throw new Exception(); return message.ReadAsAsyn...
In your package.json make sure to include the dependencies: { ... "dependencies": { ... "ionic-native": "^1.3.10", ... }, ... } To use geolocation: // custom-component.ts import {Geolocation} from 'ionic-native'; ...
To use default values with **kwargs def fun(**kwargs): print kwargs.get('value', 0) fun() # print 0 fun(value=1) # print 1
from py2neo import authenticate, Graph, Node, Relationship authenticate("localhost:7474", "neo4j", "<pass>") graph = Graph() You have to make sure your Neo4j Database exists at localhost:7474 with the appropriate credentials. the graph object is your interfa...
results = News.objects.todays_news() for r in results: article = graph.merge_one("NewsArticle", "news_id", r) article.properties["title"] = results[r]['news_title'] article.properties["timestamp"] = results[r]['news_timestamp'] article.pus...
results = News.objects.todays_news() for r in results: article = graph.merge_one("NewsArticle", "news_id", r) if 'LOCATION' in results[r].keys(): for loc in results[r]['LOCATION']: loc = graph.merge_one("Location", "name", loc)...
def get_autocomplete(text): query = """ start n = node(*) where n.name =~ '(?i)%s.*' return n.name,labels(n) limit 10; """ query = query % (text) obj = [] for res in graph.cypher.execute(query): # print res[0],res[1] obj.a...
def search_news_by_entity(location,timestamp): query = """ MATCH (n)-[]->(l) where l.name='%s' and n.timestamp='%s' RETURN n.news_id limit 10 """ query = query % (location,timestamp) news_ids = [] for res in graph.cypher.e...
Count articles connected to a particular person over time MATCH (n)-[]->(l) where l.name='Donald Trump' RETURN n.date,count(*) order by n.date Search for other People / Locations connected to the same news articles as Trump with at least 5 total relationship nodes. MATCH (n:NewsArticle)-[...
Detailed instructions on getting sorting set up or installed.
The EditText is the standard text entry widget in Android apps. If the user needs to enter text into an app, this is the primary way for them to do that. EditText There are many important properties that can be set to customize the behavior of an EditText. Several of these are listed below. Check ...
Text fields can have different input types, such as number, date, password, or email address. The type determines what kind of characters are allowed inside the field, and may prompt the virtual keyboard to optimize its layout for frequently used characters. By default, any text contents within an ...
The fork/join framework in Java is ideal for a problem that can be divided into smaller pieces and solved in parallel. The fundamental steps of a fork/join problem are: Divide the problem into multiple pieces Solve each of the pieces in parallel to each other Combine each of the sub-solutions ...
After building a regression model it is important to check the result and decide if the model is appropriate and works well with the data at hand. This can be done by examining the residuals plot as well as other diagnostic plots. # fit the model fit <- lm(mpg ~ wt, data = mtcars) # par(mfro...
Nested list comprehensions, unlike list comprehensions with nested loops, are List comprehensions within a list comprehension. The initial expression can be any arbitrary expression, including another list comprehension. #List Comprehension with nested loop [x + y for x in [1, 2, 3] for y in [3, 4...
Startup # Load library setwidth on start - to set the width automatically. .First <- function() { library(setwidth) # If 256 color terminal - use library colorout. if (Sys.getenv("TERM") %in% c("xterm-256color", "screen-256color")) { library("col...

Page 812 of 1336