Tutorial by Examples

In this example, we're going to set up an Express server integration to display how to process a payment with PayPal, using the PayPal Node SDK. We will use a static JSON structure for the payment details for the sake of brevity. There are three general steps that we will follow when building out t...
git ls-remote is one unique command allowing you to query a remote repo without having to clone/fetch it first. It will list refs/heads and refs/tags of said remote repo. You will see sometimes refs/tags/v0.1.6 and refs/tags/v0.1.6^{}: the ^{} to list the dereferenced annotated tag (ie the commit ...
Cascading and specificity are used together to determine the final value of a CSS styling property. They also define the mechanisms for resolving conflicts in CSS rule sets. CSS Loading order Styles are read from the following sources, in this order: User Agent stylesheet (The styles supplied b...
The !important declaration is used to override the usual specificity in a style sheet by giving a higher priority to a rule. Its usage is: property : value !important; #mydiv { font-weight: bold !important; /* This property won't be overridden by the ...
Data Manipulation Language (DML for short) includes operations such as INSERT, UPDATE and DELETE: -- Create a table HelloWorld CREATE TABLE HelloWorld ( Id INT IDENTITY, Description VARCHAR(1000) ) -- DML Operation INSERT, inserting a row into the table INSERT INTO HelloWorld (D...
do './config.pl'; This will read in the contents of the config.pl file and execute it. (See also: perldoc -f do.) N.B.: Avoid do unless golfing or something as there is no error checking. For including library modules, use require or use.
require Exporter; This will ensure that the Exporter module is loaded at runtime if it hasn't already been imported. (See also: perldoc -f require.) N.B.: Most users should use modules rather than require them. Unlike use, require does not call the module's import method and is executed at runti...
use Cwd; This will import the Cwd module at compile time and import its default symbols, i.e. make some of the module's variables and functions available to the code using it. (See also: perldoc -f use.) Generally this is will do the right thing. Sometimes, however, you will want to control whic...
Double click on the Main.Storyboard file. Set View As to iPhone 6: Drag a label and a button from the Toolbox to the design surface so that it looks like the image below: In the Properties pad, give the label and button the following properties: nothingNameTitleLabellblClicks[blank]Buttoncli...
When multi-line (?m) modifier is turned off, ^ matches only the input string's beginning: For the regex ^He The following input strings match: Hedgehog\nFirst line\nLast line Help me, please He And the following input strings do not match: First line\nHedgehog\nLast line IHedgehog ...
If you need to use the ^ character in a character class (Character classes ), either put it somewhere other than the beginning of the class: [12^3] Or escape the ^ using a backslash \: [\^123] If you want to match the caret character itself outside a character class, you need to escape it: ...
Signal numbers can be synchronous (like SIGSEGV – segmentation fault) when they are triggered by a malfunctioning of the program itself or asynchronous (like SIGINT - interactive attention) when they are initiated from outside the program, e.g by a keypress as Cntrl-C. The signal() function is part...
To conditionally include a block of code, the preprocessor has several directives (e.g #if, #ifdef, #else, #endif, etc). /* Defines a conditional `printf` macro, which only prints if `DEBUG` * has been defined */ #ifdef DEBUG #define DLOG(x) (printf(x)) #else #define DLOG(x) #endif Norm...
The most common uses of #include preprocessing directives are as in the following: #include <stdio.h> #include "myheader.h" #include replaces the statement with the contents of the file referred to. Angle brackets (<>) refer to header files installed on the system, while q...
The simplest form of macro replacement is to define a manifest constant, as in #define ARRSIZE 100 int array[ARRSIZE]; This defines a function-like macro that multiplies a variable by 10 and stores the new value: #define TIMES10(A) ((A) *= 10) double b = 34; int c = 23; TIMES10(b); //...
If the preprocessor encounters an #error directive, compilation is halted and the diagnostic message included is printed. #define DEBUG #ifdef DEBUG #error "Debug Builds Not Supported" #endif int main(void) { return 0; } Possible output: $ gcc error.c error.c: error: #e...
Swift's built-in numeric types are: Word-sized (architecture-dependent) signed Int and unsigned UInt. Fixed-size signed integers Int8, Int16, Int32, Int64, and unsigned integers UInt8, UInt16, UInt32, UInt64. Floating-point types Float32/Float, Float64/Double, and Float80 (x86-only). Literal...
func doSomething1(value: Double) { /* ... */ } func doSomething2(value: UInt) { /* ... */ } let x = 42 // x is an Int doSomething1(Double(x)) // convert x to a Double doSomething2(UInt(x)) // convert x to a UInt Integer initializers produce a runtime error if the value ove...
Use String initializers for converting numbers into strings: String(1635999) // returns "1635999" String(1635999, radix: 10) // returns "1635999" String(1635999, radix: 2) // returns "110001111011010011111&...
The searched CASE returns results when a boolean expression is TRUE. (This differs from the simple case, which can only check for equivalency with an input.) SELECT Id, ItemId, Price, CASE WHEN Price < 10 THEN 'CHEAP' WHEN Price < 20 THEN 'AFFORDABLE' ELSE 'EXPENSIVE' E...

Page 55 of 1336