Tutorial by Examples

If you want to get the versioned project's data, but you don't need any of the version control capabilities offered by Subversion, you could run svn export <URL> command. Here is an example: $ svn export https://svn.example.com/svn/MyRepo/MyProject/trunk As a result, you will get the proje...
You are not the only person working on the project, right? This means that your colleagues are also making modifications to the project's data. To stay up to date and to fetch the modifications committed by others, you should run svn update command in your working copy. As a result, your working cop...
A a pointer to a piece of memory containing n elements may only be dereferenced if it is in the range memory and memory + (n - 1). Dereferencing a pointer outside of that range results in undefined behavior. As an example, consider the following code: int array[3]; int *beyond_array = array + 3; ...
git log -S"#define SAMPLES" Searches for addition or removal of specific string or the string matching provided REGEXP. In this case we're looking for addition/removal of the string #define SAMPLES. For example: +#define SAMPLES 100000 or -#define SAMPLES 100000 git log -G&q...
To delete a remote branch in Git: git push [remote-name] --delete [branch-name] or git push [remote-name] :[branch-name]
If a remote branch has been deleted, your local repository has to be told to prune the reference to it. To prune deleted branches from a specific remote: git fetch [remote-name] --prune To prune deleted branches from all remotes: git fetch --all --prune
Listed from least expensive to most expensive at run-time: str::strtok is the cheapest standard provided tokenization method, it also allows the delimiter to be modified between tokens, but it incurs 3 difficulties with modern C++: std::strtok cannot be used on multiple strings at the same t...
A wide variety of standard library functions have among their effects copying byte sequences from one memory region to another. Most of these functions have undefined behavior when the source and destination regions overlap. For example, this ... #include <string.h> /* for memcpy() */ ch...
Requirements: OS X 10.8 “Mountain Lion” or newer required to run Docker. While the docker binary can run natively on Mac OS X, to build and host containers you need to run a Linux virtual machine on the box. 1.12.0 Since version 1.12 you don't need to have a separate VM to be installed, as Docker...
Binaries Lua binaries are provided by most GNU/Linux distributions as a package. For example, on Debian, Ubuntu, and their derivatives it can be acquired by executing this: sudo apt-get install lua50 sudo apt-get install lua51 sudo apt-get install lua52 There are some semi-of...
To uninstall one or more locally installed packages, use: npm uninstall <package name> The uninstall command for npm has five aliases that can also be used: npm remove <package name> npm rm <package name> npm r <package name> npm unlink <package name> npm un ...
A group is a section of a regular expression enclosed in parentheses (). This is commonly called "sub-expression" and serves two purposes: It makes the sub-expression atomic, i.e. it will either match, fail or repeat as a whole. The portion of text it matched is accessible in the remai...
Since Groups are "numbered" some engines also support matching what a group has previously matched again. Assuming you wanted to match something where two equals strings of length three are divided by a $ you'd use: (.{3})\$\1 This would match any of the following strings: "abc$...
Deleting the last element: std::vector<int> v{ 1, 2, 3 }; v.pop_back(); // v becomes {1, 2} Deleting all elements: std::vector<int> v{ 1, 2, 3 }; v.clear(); // v becomes an empty vector Deleting element by index: std::vect...
Evaluates its first operand, and, if the resulting value is not equal to zero, evaluates its second operand. Otherwise, it evaluates its third operand, as shown in the following example: a = b ? c : d; is equivalent to: if (b) a = c; else a = d; This pseudo-code represents it : c...
Evaluates its left operand, discards the resulting value, and then evaluates its rights operand and result yields the value of its rightmost operand. int x = 42, y = 42; printf("%i\n", (x *= 2, y)); /* Outputs "42". */ The comma operator introduces a sequence point between i...
This example uses the Car Table from the Example Databases. SELECT * FROM Cars WHERE TotalCost IN (100, 200, 300) This query will return Car #2 which costs 200 and Car #3 which costs 100. Note that this is equivalent to using multiple clauses with OR, e.g.: SELECT * FROM Cars WHERE TotalCos...
See full documentation on LIKE operator. This example uses the Employees Table from the Example Databases. SELECT * FROM Employees WHERE FName LIKE 'John' This query will only return Employee #1 whose first name matches 'John' exactly. SELECT * FROM Employees WHERE FName like 'John%' Ad...
A simple application showing the text "Hello World" in the center of the window. import QtQuick 2.3 import QtQuick.Window 2.0 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") //The method qsTr() is used for translations from one la...
This example shows how to match an input against several values: def f(x: Int): String = x match { case 1 => "One" case 2 => "Two" case _ => "Unknown!" } f(2) // "Two" f(3) // "Unknown!" Live demo Note: _ is the fall th...

Page 79 of 1336