Tutorial by Examples: ti

YouTube is an online video streaming service, unique in the fact that users can upload their own videos for the purposes of sharing whatever they recorded. This can range massively, from someone cooking breakfast, to playing a live concert. Now owned by Google Inc., this site has always been free to...
The ConstainsKey method is the way to know if a key already exists in the Dictionary. This come in handy for data reduction. In the sample below, each time we encountner a new word, we add it as a key in the dictionary, else we increment the counter for this specific word. Dim dic As IDictionary(...
Pancake Sort is a the colloquial term for the mathematical problem of sorting a disordered stack of pancakes in order of size when a spatula can be inserted at any point in the stack and used to flip all pancakes above it. A pancake number is the minimum number of flips required for a given number o...
public class PancakeSort { private static void SortPancake(int[] input, int n) { for (var bottom = n - 1; bottom > 0; bottom--) { var index = bottom; var maxIndex = input[bottom]; int i; for (i = bottom - 1; i >= ...
The Caesar cipher is a classic encryption method. It works by shifting the characters by a certain amount. For example, if we choose a shift of 3, A will become D and E will become H. The following text has been encrypted using a 23 shift. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG QEB NRFZH YOL...
The ASCII way This shifts the characters but doesn't care if the new character is not a letter. This is good if you want to use punctuation or special characters, but it won't necessarily give you letters only as an output. For example, "z" 3-shifts to "}". def ceasar(text, shi...
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...
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. });
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...
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...
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>
Monthwise difference between two dates(timestamp) select ( (DATE_PART('year', AgeonDate) - DATE_PART('year', tmpdate)) * 12 + (DATE_PART('month', AgeonDate) - DATE_PART('month', tmpdate)) ) from dbo."Table1" Yearwise difference between two dates...
Standard Version To install the standard version, go to the Plugin section of your WordPress installation. Search for "Advanced Custom Fields" and install/activate. You will now have access to a new area in the WordPress administrative area labeled "Custom Fields" where you can ...

Page 372 of 505