Tutorial by Examples

To update multiple documents in a collection, set the multi option to true. db.collection.update( query, update, { upsert: boolean, multi: boolean, writeConcern: document } ) multi is optional. If set to true, updates multiple documents that meet the query crit...
You have to add a div with the class .row-height inside the row, and also add .col-height to the columns. If you want to restrict the effect to a certain media query, just use the responsive .row-height and .col-height classes: for example .row-sm-height with .col-sm-height. CSS version: .row-heig...
I find that the examples in the docker inspect documentation seem magic, but do not explain much. Docker inspect is important because it is the clean way to extract information from a running container docker inspect -f ... container_id (or all running container) docker inspect -f ... $(docker p...
import numpy as np #There is a lot of math in neurons, so use numpy to speed things up in python; in other languages, use an efficient array type for that language import random #Initial neuron weights should be random class Neuron: def __init__(self, nbr_inputs, weight_array = None): ...
Since Groovy 1.8 a convenient memoize() method is added on closures: // normal closure def sum = { int x, int y -> println "sum ${x} + ${y}" return x + y } sum(3, 4) sum(3, 4) // prints // sum 3 + 4 // sum 3 + 4 // memoized closure def sumMemoize = sum.memoize() ...
Since Groovy 2.2 groovy.transform.Memoized annotation is added to convenient memoize methods with simply adding the @Memoized annotation: import groovy.transform.Memoized class Calculator { int sum(int x, int y){ println "sum ${x} + ${y}" return x+y } ...
Auditing is an Alfresco feature that allows the user to trace and log some specific events during ECM platform usage. Enable auditing To enable auditing you have to add some lines of configuration to the alfresco-global.properties file, which resides in tomcat/shared/classes/ audit.enabled = true...
Suppose you are searching for a Title Case pattern in a large text file and you want to edit a incorrect regular expression: First, go into Ex mode by typing q: You will now see all the commands that you typed in commandline mode, press j to go the regular expression you want to edit (/\v[A-Z]\w...
A Sample class diagram based on which we will see JPA implementation. @Entity @Table(name = "VEHICLE") @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "VEHICLE_TYPE") public abstract class Vehicle { @TableGenerator(name = "VEHICLE_GE...
public ActionResult Details( string product) { .... if (productNotFound) { // http://www.eidias.com/blog/2014/7/2/mvc-custom-error-pages Response.Clear(); Response.TrySkipIisCustomErrors = true; Response.Write(product + " product not exists"); ...
Consider a one to one bidirectional relationship between employee and desk. Employee.java @Entity public class Employee { @TableGenerator(name = "employee_gen", table = "id_gen", pkColumnName = "gen_name", valueColumnName = "gen_val", allocationSize...
Show all available databases: show dbs; Select a particular database to access, e.g. mydb. This will create mydb if it does not already exist: use mydb; Show all collections in the database (be sure to select one first, see above): show collections; Show all functions that can be used w...
const r = require("rethinkdb"); r.connect({host: 'localhost', port: 28015}, (conn) => console.log(conn)) // Or as a promise let rdb_conn; r.connect({host: 'localhost', port: 28015}).then((conn) => { rdb_conn = conn; }).then(() => { // Continue to use rdb_conn }); ...
r.connect({host: 'localhost', port: 28015}) .then((conn) => { return r.dbList().run(conn); }).then((result) => { // Prints out list of databases on the RethinkDB instance console.log(result); });
r.connect({host: 'localhost', port: 28015}) .then((conn) => { return r.dbCreate("stackoverflow").run(conn); }).then((result) => { console.log(result); });
r.connect({host: 'localhost', port: 28015}) .then((conn) => { return r.db("stackoverflow").tableCreate("examples").run(conn); }).then((result) => { console.log(result); });
r.connect({host: 'localhost', port: 28015}) .then((conn) => { return r.db("stackoverflow").table("examples") .insert({ // If `id` is not set, will automatically generate a UUID id: 1, name: 'Thinker', // Wi...
r.connect({host: 'localhost', port: 28015}) .then((conn) => { // Can also use .get({id: 1}) return r.db("stackoverflow").table("examples").get(1).run(conn) }).then((result) => { console.log(result); })
A quick read of most developer sites will reveal that WinForms is considered inferior to WPF. One of the most often cited reasons is the supposed difficulty in making application wide changes to the "look-and-feel" of an entire application. In fact it is surprisingly easy to produce an a...

Page 887 of 1336