Tutorial by Examples: o

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...
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...
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 ...
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...
Installation Installation of Log4j2 is as simple as putting log4j2 jar in application classpath. Though you might want to customize logs output through additional config file Configuration maven To add log4j to project in maven, add it's dependency: In pom.xml add following dependency: <dep...
Castle Windsor is available via NuGet Use the "Manage NuGet Packages" and search for "castle windsor" To download for Visual Studio 2015 To download for previous versions Use Package Manager Console to execute: Install-Package Castle.Windsor Now you can us...
An F() object represents the value of a model field or annotated column. It makes it possible to refer to model field values and perform database operations using them without actually having to pull them out of the database into Python memory. - F() expressions It is appropriate to use F() obj...
Supposing you have setup a django project, and the settings file is in an app named main, this is how you initialize your code import os, sys # Setup environ sys.path.append(os.getcwd()) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") # Setup django imp...
Magento has a powerful set of methods to filter collections. Since there are two types of Objects that can be contained in collections, we must first determine which type of data we are working with before we can filter it. Magento implements a EAV data model for entities such as products and catego...

Page 621 of 1038