Tutorial by Examples

ROT13 is a special case of Caesar cipher, with a 13 shift. Only letters are changed, and white-space and special characters are left as they are. What is interesting is that ROT13 is a reciprocal cipher : applying ROT13 twice will give you the initial input. Indeed, 2 * 13 = 26, the number of lette...
To connect to a mongo database from node application we require mongoose. Installing Mongoose Go to the toot of your application and install mongoose by npm install mongoose Next we connect to the database. var mongoose = require('mongoose'); //connect to the test database running on defau...
With Mongoose, everything is derived from a Schema. Lets create a schema. var mongoose = require('mongoose'); var Schema = mongoose.Schema; var AutoSchema = new Schema({ name : String, countOf: Number, }); // defining the document structure // by default the collection...
For inserting a new document in the collection, we create a object of the schema. var Auto = require('models/auto') var autoObj = new Auto({ name: "NewName", countOf: 10 }); We save it like the following autoObj.save(function(err, insertedAuto) { if (err) return cons...
Reading Data from the collection is very easy. Getting all data of the collection. var Auto = require('models/auto') Auto.find({}, function (err, autos) { if (err) return console.error(err); // will return a json array of all the documents in the collection console.log(autos)...
For updating collections and documents we can use any of these methods: Methods update() updateOne() updateMany() replaceOne() Update() The update() method modifies one or many documents (update parameters) db.lights.update( { room: "Bedroom" }, { status: "On&quo...
Deleting documents from a collection in mongoose is done in the following manner. Auto.remove({_id:123}, function(err, result){ if (err) return console.error(err); console.log(result); // this will specify the mongo default delete result. });
You can use plugman command to install/uninstall custom cordova plugins. To install plugman npm install -g plugman Install plugin command syntax: plugman <install|uninstall> --platform <ios|android|blackberry10|wp8> --project <directory> --plugin <name|url|path> Exa...
To call a list of goals as if it were a conjunction of goals, combine the higher-order predicates call/1 and maplist/2: ?- Gs = [X = a, Y = b], maplist(call, Gs). Gs = [a=a, b=b], X = a, Y = b.
The names of modules follow the filesystem's hierarchical structure. With the following file layout: Foo/ ├── Baz/ │ └── Quux.hs └── Bar.hs Foo.hs Bar.hs the module headers would look like this: -- file Foo.hs module Foo where -- file Bar.hs module Bar where -- file Foo/Bar.hs m...
systemd provides a modern implementation of cron. To execute a script periodical a service and a timer file ist needed. The service and timer files should be placed in /etc/systemd/{system,user}. The service file: [Unit] Description=my script or programm does the very best and this is the descri...
Detailed instructions on getting slick set up or installed. http://kenwheeler.github.io/slick/ Slick Slider is easy to use and to customise. It provides good amount of customisation options including responsive options based on breakpoints. To get started with slick, it is not that difficult. Jus...
C# Visual Studio 2015 (latest update) - you can download the community version here for free: www.VisualStudio.com Important: update all VS extensions to their latest versions Tools->Extensions and Updates->Updates Download the Bot Application template from here: Template Dow...
Below is an example of Gstreamer pipeline embedded in a simple gtk window. When run, a small window should appear like this: import gi gi.require_version('Gtk', '3.0') gi.require_version('Gst', '1.0') from gi.repository import Gtk, Gst Gst.init(None) Gst.init_check(None) class GstWidg...
Below is a configuration file for log4j. Log4j2 can use the same syntax, but there are different appender classes: log4j.rootLogger=INFO, FOO ## ConsoleAppender log4j.appender.CA=org.apache.log4j.ConsoleAppender log4j.appender.CA.layout=org.apache.log4j.PatternLayout log4j.appender.CA.layout....
XML Example The below configuration configures two appenders (log output). The first logs to standard system output (console) and the other logs to file. In this example, the location of the file can be set statically in configuration (appender file) or dynamically via maven filtering feature (<...
Recursive functions can get quite expensive. If they are pure functions (functions that always return the same value when called with the same arguments, and that neither depend on nor modify external state), they can be made considerably faster at the expense of memory by storing the values already...
There are different variable types for different purposes. In Visual Basic 6 the following variable types are available: Array Boolean Byte Currency Date Double Integer Long Single String Variant You declare a variable by using the Dim keyword: Dim RandomNumber As Integer If you ...
FFmpeg (or "Fast Forward MPEG") is a simple yet feature rich command line utility to allow the manipulation (including decoding, encoding, transcoding, muxing, demuxing, streaming, filtering, and playing) of media and video files. This utility differs from other GUI orientated software as ...
update <SCHEMA_NAME>.<TABLE_NAME_1> AS A SET <COLUMN_1> = True FROM <SCHEMA_NAME>.<TABLE_NAME_2> AS B WHERE A.<COLUMN_2> = B.<COLUMN_2> AND A.<COLUMN_3> = B.<COLUMN_3>

Page 994 of 1336