Tutorial by Examples: c

Flags gulp has very few flags to know about. All other flags are for tasks to use if needed. -v or --version will display the global and local gulp versions --require <module path> will require a module before running the gulpfile. This is useful for transpilers but also has other applica...
Resource loading in Java comprises the following steps: Finding the Class or ClassLoader that will find the resource. Finding the resource. Obtaining the byte stream for the resource. Reading and processing the byte stream. Closing the byte stream. The last three steps are typically accomp...
React components that are pure functions of their props and do not require any internal state can be written as JavaScript functions instead of using the standard class syntax, as: import React from 'react' const HelloWorld = (props) => ( <h1>Hello, {props.name}!</h1> ); ...
The simplest react component without a state and no properties can be written as: import * as React from 'react'; const Greeter = () => <span>Hello, World!</span> That component, however, can't access this.props since typescript can't tell if it is a react component. To access ...
In case you have json with an ISO date string like this JSON.stringify({date: new Date()}) // -> "{"date":"2016-12-12T13:24:34.470Z"}" You can map it to elm Date type: import Html exposing (text) import Json.Decode as JD import Date payload = ""&...
Campaign Monitor built a nifty tool that generates code for buttons in HTML email. It uses a cominbation os CSS and VML (for Microsoft Outlook) to display background images or patterns in most major email clients. <div><!--[if mso]> <v:roundrect xmlns:v="urn:schemas-microsoft...
This button derives from this example by Email on Acid. It is entirely code-based, so it will display without images downloaded, and the entire button is hoverable + clickable. Additionally, this example also includes spacers to help control how much vertical space appears before and after the butt...
SELECT 1 NUM_COLUMN, 'foo' VARCHAR2_COLUMN from DUAL UNION ALL SELECT NULL, NULL from DUAL; NUM_COLUMNVARCHAR2_COLUMN1foo(null)(null)
SELECT 3 * NULL + 5, 'Hello ' || NULL || 'world' from DUAL; 3*NULL+5'HELLO'||NULL||'WORLD'(null)Hello world
SELECT a column_with_null, NVL(a, 'N/A') column_without_null FROM (SELECT NULL a FROM DUAL); COLUMN_WITH_NULLCOLUMN_WITHOUT_NULL(null)N/A NVL is useful to compare two values which can contain NULLs : SELECT CASE WHEN a = b THEN 1 WHEN a <> b THEN 0 else -1 END comparison_without_n...
SELECT COALESCE(a, b, c, d, 5) FROM (SELECT NULL A, NULL b, NULL c, 4 d FROM DUAL); COALESCE(A,B,C,D,5)4 In some case, using COALESCE with two parameters can be faster than using NVL when the second parameter is not a constant. NVL will always evaluate both parameters. COALESCE will stop a...
A Frame is created like any other controls: <Frame x:Name="contentRoot" Navigated="OnNavigated" Navigating="OnNavigating" /> The navigated/navigating events can then be intercepted to cancel the navigation or show/hide the back button. private...
A function that extends the functionality of the array by creating an object oriented remove function. // Need to restrict the extension to elements that can be compared. // The `Element` is the generics name defined by Array for its item types. // This restriction also gives us access to `index(...
MQTT(Message Queue Telemetry Transport) is a Publish-Subscribe based "lightweight" messaging protocol for use on top of the TCP/IP stack. It is quite useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium. Ther...
import cv2 def canny_webcam(): "Live capture frames from webcam and show the canny edge image of the captured frames." cap = cv2.VideoCapture(0) while True: ret, frame = cap.read() # ret gets a boolean value. True if reading is successful (I think). frame ...
An input port can be created in many ways, but usually the method starts with open-input-. String port You can use a string as a port using open-input-string. It will create a port that will be able to read from the string. (define p (open-input-string "(a . (b . (c . ()))) 34")) ...
A pair can be create with the cons function. The name of the function stand for constructor. In Scheme, everything is pretty much based on pairs. (cons a b) The function return a pair containing the element a and b. The first parameter of cons is called car (Content Address Register) and the sec...
The data in the pair can be accessed with utility functions. To access the car, we have to use the car function. (car (cons a b)) > a Also we can verify the following equality: (eq? a (car (cons a b))) > #t
To access the cdr, we have to use the cdr function. (cdr (cons a b)) b Also we can verify the following equality: (eq? b (cdr (cons a b))) #t
List in scheme are nothing else than a series of pairs nested in each other in the cdr of a cons. And the last cdr of a proper list is the empty list '(). To create the list (1 2 3 4), we'd have something like this: (cons 4 '()) > (4) (cons 3 (cons 4 '())) > (3 4) (cons 2 (cons 3 (cons 4...

Page 657 of 826