Tutorial by Examples: al

use feature qw( say ); # Numbers are true if they're not equal to 0. say 0 ? 'true' : 'false'; # false say 1 ? 'true' : 'false'; # true say 2 ? 'true' : 'false'; # true say -1 ? 'true' : 'false'; # true say 1-1 ? 'true' : 'false'; # fa...
QML comes with newer Version of the cross-platform application framework Qt. You can find the newest Version of Qt in the Downloads section. To create a new QML Project in the Qt Creator IDE, select "File -> New ..." and under "Applications" select "Qt Quick-Application...
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; ...
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
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 ...
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...
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...
The working copy (WC) is your local and private workspace that you use to interact with the central Subversion repository. You use the working copy to modify the contents of your project and fetch changes committed by others. The working copy contains your project's data and looks and acts like a r...
#include <lua.h> #include <lauxlib.h> #include <lualib.h> int main(void) { 5.1 /* Start by creating a new VM state */ lua_State *L = luaL_newstate(); /* Load standard Lua libraries: */ luaL_openlibs(L); 5.1 /* For older version of Lua use lua_open ins...
The ls command's -l option prints a specified directory's contents in a long listing format. If no directory is specified then, by default, the contents of the current directory are listed. ls -l /etc Example Output: total 1204 drwxr-xr-x 3 root root 4096 Apr 21 03:44 acpi -rw-r--r-- 1 r...
It is tricky to remove items from a list while within a loop, this is due to the fact that the index and length of the list gets changed. Given the following list, here are some examples that will give an unexpected result and some that will give the correct result. List<String> fruits = new...
/* declare items of the enum */ #define FOREACH \ X(item1) \ X(item2) \ X(item3) \ /* end of list */ /* define the enum values */ #define X(id) MyEnum_ ## id, enum MyEnum { FOREACH }; #undef X /* convert an enum value to its identifier */ const char * enum2string(int...
To publish the changes you made in your working copy, run the svn commit command. IMPORTANT: Review your changes before committing them! Use svn status and svn diff to review the changes. Also, make sure you are in the correct path before performing a commit. If you updated many files across vari...
The first operand must be a function pointer (a function designator is also acceptable because it will be converted to a pointer to the function), identifying the function to call, and all other operands, if any, are collectively known as the function call's arguments. Evaluates into the return valu...
Normally, a Docker container persists after it has exited. This allows you to run the container again, inspect its filesystem, and so on. However, sometimes you want to run a container and delete it immediately after it exits. For example to execute a command or show a file from the filesystem. Dock...
SELECT * FROM Employees WHERE ManagerId IS NULL This statement will return all Employee records where the value of the ManagerId column is NULL. The result will be: Id FName LName PhoneNumber ManagerId DepartmentId 1 James Smith 1234567890 NULL 1 SEL...
Alt-text is used by screen readers for visually impaired users and by search engines. It's therefore important to write good alt-text for your images. The text should look correct even if you replace the image with its alt attribute. For example: <!-- Incorrect --> <img src="anonymo...
std::map and std::multimap both can be initialized by providing key-value pairs separated by comma. Key-value pairs could be provided by either {key, value} or can be explicitly created by std::make_pair(key, value). As std::map does not allow duplicate keys and comma operator performs right to left...

Page 15 of 269