Tutorial by Examples: and

When you want the current date and time, you can do this with the Javascript function Date, but will return the following format which isn't always useful: Wed Jun 07 2017 13:26:15 GMT+0200 (Romance (zomertijd)). Copy the following code into app/helpers/helpers.js, and simply call getCurrentDateAnd...
First, you need to open your SQLite database, which can be done as follows: SQLiteDatabase myDataBase; String mPath = dbhelper.DATABASE_PATH + dbhelper.DATABASE_NAME; myDataBase = SQLiteDatabase.openDatabase(mPath, null, SQLiteDatabase.OPEN_READWRITE); After opening the database, you can easi...
Thanks to encoders and decoders, the JSR 356 offers a object oriented communication models. Messages definition Let's assume all received messages have to be transformed by the server before being sent back to all connected sessions: public abstract class AbstractMsg { public abstract void t...
// sample token string taken from the New example tokenString := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJuYmYiOjE0NDQ0Nzg0MDB9.u1riaD1rW97opCoAuRCTy4w58Br-Zk-bh7vLiRIsrpU" // Parse takes the token string and a function for looking up the key. The latter is especially ...
// Create a new token object, specifying signing method and the claims // you would like it to contain. token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{ "foo": "bar", "nbf": time.Date(2015, 10, 10, 12, 0, 0, 0, time.UTC).Unix(), }) // Si...
The StandardClaims type is designed to be embedded into your custom types to provide standard validation features. You can use it alone, but there's no way to retrieve other fields after parsing. See the custom claims example for intended usage. mySigningKey := []byte("AllYourBase") //...
For C# there exist many wrappers that offer an interface to communicate with OpenCL. OpenCL.NET: This is one of the most low level wrappers out there. It offers a complete implementation of the OpenCL API for C# without adding any abstraction at all. So C\C++ examples are easily ported for this ...
The key of parallelism is to use multiple threads to solve a problem (duh.) but there are some differences to classical multithreaded programming in how threads are organized. First lets talk about your typical GPU, for simplicities sake I'll focus on A GPU has many processing cores, which make it...
To initiate any operation on your devices, you'll need a command queue for each device. The Queue keeps track of different calls you did to the target device and keeps them in order. Most commands can also be executed either in blocking or non-blocking mode. Creating a queue is pretty straightforwa...
To make your APK file as small as possible, you should enable shrinking to remove unused code and resources in your release build. This page describes how to do that and how to specify what code and resources to keep or discard during the build. Code shrinking is available with ProGuard, which dete...
npm install --save-dev ember-cli-sass ember install ember-cli-foundation-6-sass
Adding 3DoF Controllers Controllers with 3 degrees of freedom (3DoF) are limited to rotational tracking. 3DoF controllers have no positional tracking meaning we can’t reach out nor move our hand back-and-forth or up-and-down. Having a controller with only 3DoF is like having a hand and wrist withou...
In this example, we take a sine curve plot and add more features to it; namely the title, axis labels, title, axis ticks, grid and legend. # Plotting tutorials in Python # Enhancing a plot import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 2.0*np.pi, 101) y = np.sin(x) ...
The following are some of the common extensions used in Fortran source files and the functionalities they can work on. Lowercase f in the extension These files do not have the features of preprocessor directives similar to C-programming language. They can be directly compiled to create object file...
Similar to the previous example, here, a sine and a cosine curve are plotted on the same figure using separate plot commands. This is more Pythonic and can be used to get separate handles for each plot. # Plotting tutorials in Python # Adding Multiple plots by superimposition # Good for plots sha...
Because Node.js runs on a single process uncaught exceptions are an issue to be aware of when developing applications. Silently Handling Exceptions Most of the people let node.js server(s) silently swallow up the errors. Silently handling the exception process.on('uncaughtException', functio...
As already mentioned you can declare an unordered map of any type. Let's have a unordered map named first with string and integer type. unordered_map<string, int> first; //declaration of the map first["One"] = 1; // [] operator used to insert the value first["Two"] = 2...
Suppose you are comparing value with some variable if ( i == 2) //Bad-way { doSomething; } Now suppose you have mistaken == with =. Then it will take your sweet time to figure it out. if( 2 == i) //Good-way { doSomething; } Then, if an equal sign is accidentally left out, the ...
BottomSheet DialogFragment opens up in STATE_COLLAPSED by default. Which can be forced to open to STATE_EXPANDEDand take up the full device screen with help of the following code template. @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { BottomSheetDialog dialog = ...

Page 146 of 153