Tutorial by Examples: ed

To successfully create a sparkpost email api setup, add the below details to env file and your application will be good to start sending emails. MAIL_DRIVER=sparkpost SPARKPOST_SECRET= NOTE: The above details does not give you the code written in controller which has the business logic to send em...
To create AR applications on the web, you need to add a new library named AR.js. First you load A-frame followed by AR.js. Newt you must setup you scene using the A-frames a-scene-tag with the artoolkit-attribute added. The sourceType must be your webcam. The font-camera of your smartphone is also ...
If You have Role: +-----------------------------+ | roleId | name | discription | +-----------------------------+ Rights: +-----------------------------+ | rightId | name | discription| +-----------------------------+ rightrole +------------------+ | roleId | rightId | +----------...
Nested prefabs are not avaible in Unity at the moment. You can drag one prefab to another, and apply that, but any changes on the child prefab will not be applied to nested one. But there is a simple workaround - You have to add to parent prefab a simple script, that will instantiate a child one. ...
var casper = require('casper').create(); casper.start('http://casperjs.org/'); casper.then(function() { this.echo('First Page: ' + this.getTitle()); }); casper.thenOpen('http://phantomjs.org', function() { this.echo('Second Page: ' + this.getTitle()); }); casper.run();
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...
The function Emitter.listenerCount(eventName) will return the number of listeners that are currently listening for the event provided as argument const EventEmitter = require("events"); class MyEmitter extends EventEmitter{} var emitter = new MyEmitter(); emitter .on("data&quot...
if I forget the password then I'll get error. $ mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) I tried to solve the issue by first knowing the status: $ systemctl status mysql.service mysql.service - MySQL Community ...
$data = $result->mysqli_fetch_array(MYSQLI_NUM);
DRF offers the chance to further customize the behavior of the generic views/viewsets by allowing the creation of custom mixins. How to: To define a custom mixin we just need to create a class inheriting from object. Let's assume that we want to define two separate views for a model named MyM...
To discovery the default print service, we can use the PrintServiceLookup class. Let's see how:: import javax.print.PrintService; import javax.print.PrintServiceLookup; public class DiscoveringDefaultPrintService { public static void main(String[] args) { discoverDefaultPrintSer...
Doc is an interface and the Java Print Service API provide a simple implementation called SimpleDoc. Every Doc instance is basically made of two aspects: the print data content itself (an E-mail, an image, a document etc) the print data format, called DocFlavor (MIME type + Representation class...
The problem statement is like if we are given two string str1 and str2 then how many minimum number of operations can be performed on the str1 that it gets converted to str2. Implementation in Java public class EditDistance { public static void main(String[] args) { // TODO Auto-generated ...
We’ll first go over gaze-based interactions. Gaze-based interactions rely on rotating our heads and looking at objects to interact with them. This type of interaction is for headsets without a controller. Even with a rotation-only controller (Daydream, GearVR), the interaction is still similar. Sinc...
Also known as gaze-based cursor. If we set the cursor to be fuse-based, the cursor will trigger a click if the user gazes at an entity for a set amount of time. Imagine a laser strapped to the user’s head, and the laser extends out into the scene. If the user stares at an entity long enough (i.e., t...
To add visual feedback to the cursor to show when the cursor is clicking or fusing, we can use the animation system. When the cursor intersects the entity, it will emit an event, and the animation system will pick up event with the begin attribute: <a-entity cursor="fuse: true; fuseTimeout:...
Reduce is a function which will take an array, function and accumulator and use accumulator as seed to start the iteration with the first element to give next accumulator and the iteration continues for all the elements in the array (refer below example) defmodule MyList do def reduce([], _func,...
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...
Fixed-width files are text files in which columns are not separated by any character delimiter, like , or ;, but rather have a fixed character length (width). Data is usually padded with white spaces. An example: Column1 Column2 Column3 Column4Column5 1647 pi 'important' ...

Page 138 of 145