Tutorial by Examples

You can combine the results of two identically structured queries with the UNION keyword. For example, if you wanted a list of all contact info from two separate tables, authors and editors, for instance, you could use the UNION keyword like so: select name, email, phone_number from authors u...
Julia uses similar binary operators for basic arithmetic operations as does mathematics or other programming languages. Most operators can be written in infix notation (that is, placed in between the values being computed). Julia has an order of operations that matches the common convention in mathe...
The remainder operator in Julia is the % operator. This operator behaves similarly to the % in languages such as C and C++. a % b is the signed remainder left over after dividing a by b. This operator is very useful for implementing certain algorithms, such as the following implementation of the Si...
So you want to deploy your app to multiple sites? and your project has too many dependencies to install them one-by-one? Npm has a solution just issue the following command: npm init In the project's root folder then follow the instructions on screen (type in the desired value then press enter) ...
In many languages, new instances of a class are created using a special new keyword. In Ruby, new is also used to create instances of a class, but it isn't a keyword; instead, it's a static/class method, no different from any other static/class method. The definition is roughly this: class MyClass ...
This example sorts elements in ascending order of a key using a map. You can use any type, including class, instead of std::string, in the example below. #include <iostream> #include <utility> #include <map> int main() { std::map<double, std::string> sorted_map; ...
To detect the endian of the device var isLittleEndian = true; (()=>{ var buf = new ArrayBuffer(4); var buf8 = new Uint8ClampedArray(buf); var data = new Uint32Array(buf); data[0] = 0x0F000000; if(buf8[0] === 0x0f){ isLittleEndian = false; } })(); Lit...
C++11 introduces what are known as scoped enums. These are enumerations whose members must be qualified with enumname::membername. Scoped enums are declared using the enum class syntax. For example, to store the colors in a rainbow: enum class rainbow { RED, ORANGE, YELLOW, GREE...
db.people.createIndex({name: 1}) This creates an ascending single field index on the field name. In this type of indexes the sort order is irrelevant, because mongo can traverse the index in both directions.
db.people.createIndex({name: 1, age: -1}) This creates an index on multiple fields, in this case on the name and age fields. It will be ascending in name and descending in age. In this type of index, the sort order is relevant, because it will determine whether the index can support a sort opera...
To drop an index you could use the index name db.people.dropIndex("nameIndex") Or the index specification document db.people.dropIndex({name: 1})
db.people.getIndexes() This will return an array of documents each describing an index on the people collection
Pattern matching extensions for C# enable many of the benefits of pattern matching from functional languages, but in a way that smoothly integrates with the feel of the underlying language switch expression Pattern matching extends the switch statement to switch on types: class Geometry {} cl...
The Timeline object allows you to get the execution time for each node in the graph: you use a classic sess.run() but also specify the optional arguments options and run_metadata you then create a Timeline object with the run_metadata.step_stats data Here is an example program that measures...
1. Setup your formatter and routing in Register of (App_Start/WebApiConfig) public static class WebApiConfig { public static void Register(HttpConfiguration config) { GlobalConfiguration.Configuration.Formatters.Clear(); GlobalConfiguration.Configuration.Formatters.Add...
How do you get the number of Debit and Credit transactions? One way to do it is by using count() function as below. > db.transactions.count({cr_dr : "D"}); or > db.transactions.find({cr_dr : "D"}).length(); But what if you do not know the possible values of cr_dr up...
Show a "Hello World!" in message box. MsgBox, Hello World! Show a "Hello World!" in tooltip. #Persistent Tooltip, Hello World! Show a "Hello World!" message in the traybar edit. #Persistent TrayTip,, Hello World! Prints "Hello, World" to Standard...
iPhone is a smartphone made by Apple that combines an iPod, a tablet PC, a digital camera and a cellular phone. The device includes Internet browsing and networking capabilities. Operating System The iPhone runs the iOS operating system, or OS. Other smartphone operating systems include Android, B...
To make a hotkey that sends the key sequence 'Hello World' from pressing Ctrl + J onto the active window (can be demonstrated in notepad, e.g.) ^j:: Send, Hello World Return
To make a script to replace a phrase use the ::abbreviation:: hotstring syntax. It will replace btw with by the way whenever you enter btw and then the space key. ::btw::by the way If you wanted to make a login script to make logging in faster you could make a script like this (the file is not e...

Page 515 of 1336