Tutorial by Examples: l

Ajax calls, request and retrieve data for giving the user a sense of a better interactive user interface experience. This article will show you how to use jQuery and send data through Ajax calls. For this example, we’re going to POST the following JavaScript object to our server. var post = { ...
After installation of hazelcast and adding to Java Build Path, you can write Main.class that starts cluster work public static void main(String[] args){ Config config = new Config(); // creates a new HazelcastInstance (a new node in a cluster) HazelcastInstance instance = Hazelcast.n...
Prerequisite A running MongoDB server, more details on that here. Setting Up a Java Project The MongoDB Java Driver is supplied as a JAR file and can be included in a project just like any other JAR. For example: Maven: add an entry to the <dependencies> section of your pom.xml. &lt...
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...
<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...
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...
Detailed instructions on getting optimization set up or installed.
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 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 ...
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 ...
The org.bukkit.event.EventHandler annotation accepts a couple parameters. priority - Indicates the priority of your listener. There are the six different priorities, in order of execution: LOWEST,LOW,NORMAL[default],HIGH,HIGHEST,MONITOR. These constants refer to the org.bukkit.event.EventPriority e...
# It creates vendor folder and vendor.json inside it govendor init # Add dependencies in vendor.json govendor fetch <dependency> # Usage on new repository # fetch depenencies in vendor.json govendor sync Example vendor.json { "comment": "", "ignore&qu...
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...
In order to install asyncio: pip install asyncio Notice that python asyncio requires Python 3.3 or later. This module became part of the Python standard library since Python 3.4.
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...
This configuration lets' you run your total spec files in two browser instances in parallel. It helps reduce the overall test execution time. Change the maxInstances based on your need. Note: Make sure your tests are independent. var config = {}; var timeout = 120000; config.framework = 'jasmi...

Page 786 of 861