Tutorial by Examples: o

A floating point type. Its range includes that of float. When combined with long, denotes the long double floating point type, whose range includes that of double. double area(double radius) { const double pi = 3.141592653589793; return pi*radius*radius; }

for

Introduces a for loop or, in C++11 and later, a range-based for loop. // print 10 asterisks for (int i = 0; i < 10; i++) { putchar('*'); }
Jumps to a labelled statement, which must be located in the current function. bool f(int arg) { bool result = false; hWidget widget = get_widget(arg); if (!g()) { // we can't continue, but must do cleanup still goto end; } // ... result = true; end...
Denotes a signed integer type that is at least as long as int, and whose range includes at least -2147483647 to +2147483647, inclusive (that is, -(2^31 - 1) to +(2^31 - 1)). This type can also be written as long int. const long approx_seconds_per_year = 60L*60L*24L*365L; The combination long dou...
Denotes a signed integer type that is at least as long as char, and whose range includes at least -32767 to +32767, inclusive. This type can also be written as short int. // (during the last year) short hours_worked(short days_worked) { return 8*days_worked; }
In R, data objects are manipulated using named data structures. The names of the objects might be called "variables" although that term does not have a specific meaning in the official R documentation. R names are case sensitive and may contain alphanumeric characters(a-z,A-z,0-9), the dot...
This is a mistake that causes real confusion for Java beginners, at least the first time that they do it. Instead of writing this: if (feeling == HAPPY) System.out.println("Smile"); else System.out.println("Frown"); they accidentally write this: if (feeling == HAP...
const url = 'http://api.stackexchange.com/2.2/questions?site=stackoverflow&tagged=javascript'; const questionList = document.createElement('ul'); document.body.appendChild(questionList); const responseData = fetch(url).then(response => response.json()); responseData.then(({item...
#include <stdio.h> #define SIZE (10) int main() { size_t i = 0; int *p = NULL; int a[SIZE]; /* Setting up the values to be i*i */ for(i = 0; i < SIZE; ++i) { a[i] = i * i; } /* Reading the values using pointers */ for(p =...
You can define the signing configuration to sign the apk in the build.gradle file. You can define: storeFile : the keystore file storePassword: the keystore password keyAlias: a key alias name keyPassword: A key alias password You have to define the signingConfigs block to create a signin...
You can define the signing configuration in an external file as a signing.properties in the root directory of your project. For example you can define these keys (you can use your favorite names): STORE_FILE=myStoreFileLocation STORE_PASSWORD=myStorePassword KEY_ALIAS=myKeyAlias KEY_PASSWOR...
You can store the signing information setting environment variables. These values can be accessed with System.getenv("<VAR-NAME>") In your build.gradle you can define: signingConfigs { release { storeFile file(System.getenv("KEYSTORE")) storePasswo...
The Data.Map module in the containers package provides a Map structure that has both strict and lazy implementations. When using Data.Map, one usually imports it qualified to avoid clashes with functions already defined in Prelude: import qualified Data.Map as Map So we'd then prepend Map funct...
C++11 A unary operator that determines whether the evaluation of its operand can propagate an exception. Note that the bodies of called functions are not examined, so noexcept can yield false negatives. The operand is not evaluated. #include <iostream> #include <stdexcept> void f...
In Normal Mode, commands can be entered by direct key combinations (typing u to undo the last change, for example). These commands often have equivalents in 'ex' mode, accessed by typing a colon :, which drops you into a single-line buffer at the bottom of the Vim window. In 'ex' mode, after typing...
Undo Command:Descriptionuu,undoUndo the most recent change5uUndo the five most recent changes (use any number) Please be aware that in Vim, the 'most recent change' varies according to the mode you are in. If you enter Insert Mode (i) and type out an entire paragraph before dropping back to Normal...
In Vim, these operations are handled differently from what you might be used to in almost any other modern editor or word processor (Ctrl-C, Ctrl-X, Ctrl-V). To understand, you need to know a little about registers and motions. Note: this section will not cover Visual Mode copying and cutting or ra...
C++11 C++11 introduced the [[noreturn]] attribute. It can be used for a function to indicate that the function does not return to the caller by either executing a return statement, or by reaching the end if it's body (it is important to note that this does not apply to void functions, since they d...
sqlite> SELECT TYPEOF(NULL); null sqlite> SELECT TYPEOF(42); integer sqlite> SELECT TYPEOF(3.141592653589793); real sqlite> SELECT TYPEOF('Hello, world!'); text sqlite> SELECT TYPEOF(X'0123456789ABCDEF'); blob
For booleans, SQLite uses integers 0 and 1: sqlite> SELECT 2 + 2 = 4; 1 sqlite> SELECT 'a' = 'b'; 0 sqlite> SELECT typeof('a' = 'b'); integer > CREATE TABLE Users ( Name, IsAdmin ); > INSERT INTO Users VALUES ('root', 1); > INSERT INTO Users VALUES ('john', 0); > S...

Page 554 of 1038