Tutorial by Examples

You can use other operators besides $set when updating a document. The $push operator allows you to push a value into an array, in this case we will add a new nickname to the nicknames array. db.people.update({name: 'Tom'}, {$push: {nicknames: 'Tommy'}}) // This adds the string 'Tommy' into the n...
If two pointers are compared using <, >, <=, or >=, the result is unspecified in the following cases: The pointers point into different arrays. (A non-array object is considered an array of size 1.) int x; int y; const bool b1 = &x < &y; // unspecified int ...
If the underlying type is not explicitly specified for an unscoped enumeration type, it is determined in an implementation-defined manner. enum E { RED, GREEN, BLUE, }; using T = std::underlying_type<E>::type; // implementation-defined However, the standard does require th...
A reference is not an object, and unlike an object, it is not guaranteed to occupy some contiguous bytes of memory. The standard leaves it unspecified whether a reference requires any storage at all. A number of features of the language conspire to make it impossible to portably examine any storage ...
This example combines multiple variants of MonoBehaviour singletons found on the internet into one and let you change its behavior depending on global static fields. This example was tested using Unity 5. To use this singleton, all you need to do is extend it as follows: public class MySingleton ...
If a function has multiple arguments, it is unspecified what order they are evaluated in. The following code could print x = 1, y = 2 or x = 2, y = 1 but it is unspecified which. int f(int x, int y) { printf("x = %d, y = %d\n", x, y); } int get_val() { static int x = 0; r...
C++11 All standard library containers are left in a valid but unspecified state after being moved from. For example, in the following code, v2 will contain {1, 2, 3, 4} after the move, but v1 is not guaranteed to be empty. int main() { std::vector<int> v1{1, 2, 3, 4}; std::vector&l...
These attributes are used when the layout is rendered in Android Studio, but have no impact on the runtime. In general you can use any Android framework attribute, just using the tools: namespace rather than the android: namespace for layout preview. You can add both the android: namespace attribu...
To use additional packages within the Rcpp ecosystem, the correct header file may not be Rcpp.h but Rcpp<PACKAGE>.h (as e.g. for RcppArmadillo). It typically needs to be imported and then the dependency is stated within // [[Rcpp::depends(Rcpp<PACKAGE>)]] Examples: // Use the RcppAr...
Most printable characters can be included in string or regular expression literals just as they are, e.g. var str = "ポケモン"; // a valid string var regExp = /[Α-Ωα-ω]/; // matches any Greek letter without diacritics In order to add arbitrary characters to a string or regular expression,...
Single character escape sequences Some escape sequences consist of a backslash followed by a single character. For example, in alert("Hello\nWorld");, the escape sequence \n is used to introduce a newline in the string parameter, so that the words "Hello" and "World" ...
This is a basic project that uses FXML, created with NetBeans (New Project -> JavaFX -> JavaFX FXML Application). It contains just three files: Main Application class package org.stackoverflow; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Par...
The time for Scheduler Tasks are measured in Ticks. Under normal conditions, there are 20 ticks per second. Tasks scheduled with .scheduleSyncDelayedTask will be run on the Main Thread Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { @Override public void run() { ...
You can make code run asynchronously from the main thread using runTaskAsynchronously. This is useful for doing intensive math or database operations, as they will prevent the main thread from freezing (and the server from lagging). Few Bukkit API methods are thread-safe, so many will cause undefin...
You can also make code run synchronously with the main thread using runTask. This is useful when you want to call Bukkit API methods after running code asynchronously from the main thread. Code called inside of this Runnable will be executed on the main thread, making it safe to call Bukkit API met...
For an ID 5 The only restrictions on the value of an id are: it must be unique in the document it must not contain any space characters it must contain at least one character So the value can be all digits, just one digit, just punctuation characters, include special characters, whatever. ...
Website: https://gitextensions.github.io Price: free Platform: Windows
post-receive hooks can be used to automatically forward incoming pushes to another repository. $ cat .git/hooks/post-receive #!/bin/bash IFS=' ' while read local_ref local_sha remote_ref remote_sha do echo "$remote_ref" | egrep '^refs\/heads\/[A-Z]+-[0-9]+$' >/dev/null &am...
HELLO * HISTORIC EXAMPLE OF HELLO WORLD IN COBOL IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. PROCEDURE DIVISION. DISPLAY "HELLO, WORLD". STOP RUN. The days of punch card layout and uppercase only inputs are far behind. Yet most COBOL imple...
Once you've downloaded the files, extract your them into your designated directory. You'll notice that there are two sets of the files. The min means that the file is "compressed" to reduce load times. These minified files are usually used in production while it is better to use the unmin...

Page 759 of 1336