Tutorial by Examples: c

MongoClient.connect('mongodb://localhost:27017/myNewDB',function (err,db) { if(err) console.log("Unable to connect DB. Error: " + err) else console.log('Connected to DB'); db.close(); }); myNewDB is DB name, if it does not exists in database then it...
In GraphQL the Schema defines the root execution queries and mutations as well as the types for your data. Schema Object Type The Person type has two fields, one is a standard Scalar type and the other represents a relationship to a list of other Person types that are 'friends'. Linking other type...
1. Model : public class ContactModel { [Required, Display(Name="Sender Name")] public string SenderName { get; set; } [Required, Display(Name = "Sender Email"), EmailAddress] public string SenderEmail { get; set; } [Required] public string Messag...
<div sec:authorize="isAuthenticated()"> This text is displayed for authenticated users. </div>
/In async.series,all the functions are executed in series and the consolidated outputs of each function is passed to the final callback. e.g/ var async = require('async'); async.series([ function (callback) { console.log('First Execute..'); callback(null, 'userPersonalData'); }, function (cal...
The basic syntax of find() method with projection is as follows > db.COLLECTION_NAME.find({},{KEY:1}); If you want to show all documents without the age field then the command is as follows db.people.find({},{age : 0}); If you want to show all documents the age field then the command is a...
In MongoDB, projection means selecting only the necessary data rather than selecting whole of the data of a document. The basic syntax of find() method with projection is as follows > db.COLLECTION_NAME.find({},{KEY:1}); If you want to to show all document without the age field then the comm...
Using sequence function you can easily describe a message that calls a list of other messages. It's useful when dealing with semantics of your messages. Example 1: You are making a game engine, and you need to refresh the screen on every frame. module Video exposing (..) type Message = module Vid...
To register your methods, the class containing the EventHandler(s) must implement the Listener interface. import org.bukkit.event.Listener; public final class ListenerClass implements Listener { } You need to register the event listener by adding the following call to your onEnable method in...
Writing a Hello command Writing an Event Listener
Creating a basic block Creating a basic item Writing a Hello command Writing an Event Handler Getting started with Capabilities [1.8+]
Creating an event listener in Forge is very similar to creating one in Bukket. Creating the listener class requires a lot less. There's no interface to implement or other imports. public class ListenerClass { } //perfectly valid event listener class Registering it requires passing the instance ...
The andThen function allows update call composition. Can be used with the pipeline operator (|>) to chain updates. Example: You are making a document editor, and you want that each modification message you send to your document, you also save it: import Update.Extra exposing (andThen) import U...
public static MvcHtmlString DatePickerFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, object htmlAttributes) { var sb = new StringBuilder(); var metaData = ModelMetadata.FromLambdaExpression(expression, htm...
ArgumentCaptor will to receive the actual invocation arguments that has been passed to method. ArgumentCaptor<Foo> captor = ArgumentCaptor.forClass(Foo.class); verify(mockObj).doSomethind(captor.capture()); Foo invocationArg = captor.getValue(); //do any assertions on invocationArg For ...
Using scanf Scanf scans text read from standard input, storing successive space-separated values into successive arguments as determined by the format. It returns the number of items successfully scanned. If that is less than the number of arguments, err will report why. Newlines in the input mus...
Sometimes you need to create your own Event, one that other plugins can listen to (Vault, among other plugins, does this) and even cancel. Bukkit's Event API allows this to be possible. All you need to do is make a new class, have it extend Event, add the handlers and the attributes your event needs...
# General syntax: # grep(<pattern>, <character vector>) mystring <- c('The number 5', 'The number 8', '1 is the loneliest number', 'Company, 3 is', 'Git SSH tag is [email protected]', 'My personal site is w...
var config = {}; var timeout = 120000; config.framework = 'jasmine2'; config.allScriptsTimeout = timeout; config.getPageTimeout = timeout; config.jasmineNodeOpts.isVerbose = true; config.jasmineNodeOpts.defaultTimeoutInterval = timeout; config.specs = ['qa/**/*Spec.js']; config.browserName...
var config = {}; var timeout = 120000; config.framework = 'jasmine2'; config.allScriptsTimeout = timeout; config.getPageTimeout = timeout; config.jasmineNodeOpts.isVerbose = true; config.jasmineNodeOpts.defaultTimeoutInterval = timeout; config.specs = ['qa/**/*Spec.js']; config.capabilitie...

Page 757 of 826