Tutorial by Examples

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...
5.6 PHP 5.6 introduced variable-length argument lists (a.k.a. varargs, variadic arguments), using the ... token before the argument name to indicate that the parameter is variadic, i.e. it is an array including all supplied parameters from that one onward. function variadic_func($nonVariadic, ...$...
#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...
We use the null function to check if a given Map is empty: > Map.null $ Map.fromList [("Alex", 31), ("Bob", 22)] False > Map.null $ Map.empty True
There are many querying operations on maps. member :: Ord k => k -> Map k a -> Bool yields True if the key of type k is in Map k a: > Map.member "Alex" $ Map.singleton "Alex" 31 True > Map.member "Jenny" $ Map.empty False notMember is similar: &g...
Inserting elements is simple: > let m = Map.singleton "Alex" 31 fromList [("Alex",31)] > Map.insert "Bob" 99 m fromList [("Alex",31),("Bob",99)]
> let m = Map.fromList [("Alex", 31), ("Bob", 99)] fromList [("Alex",31),("Bob",99)] > Map.delete "Bob" m fromList [("Alex",31)]
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...
The Repeat command, executed with the dot or period key (.), is more useful than it first appears. Once learned, you will find yourself using it often. Command:Description.Repeat the last change10.Repeat the last change 10 times So then, for a very simple example, if you make a change to line 1 by...
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 A keyword denoting a null pointer constant. It can be converted to any pointer or pointer-to-member type, yielding a null pointer of the resulting type. Widget* p = new Widget(); delete p; p = nullptr; // set the pointer to null after deletion Note that nullptr is not itself a pointer. ...
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 728 of 1336