Tutorial by Examples: el

All built-in collections in Python implement a way to check element membership using in. List alist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 5 in alist # True 10 in alist # False Tuple atuple = ('0', '1', '2', '3', '4') 4 in atuple # False '4' in atuple # True String astring = 'i am a s...
First, install a version of Microsoft Visual Studio, including the free Community edition. Then, create a Visual Basic Console Application project of type Console Application, and the following code will print the string 'Hello World' to the Console: Module Module1 Sub Main() Consol...
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char **argv) { /* Exit if no second argument is found. */ if (argc != 2) { puts("Argument missing."); return EXIT_FAILURE; } size_t len = str...
Struct fields whose names begin with an uppercase letter are exported. All other names are unexported. type Account struct { UserID int // exported accessToken string // unexported } Unexported fields can only be accessed by code within the same package. As such, if you are ev...
single channel, single goroutine, one write, one read. package main import "fmt" import "time" func main() { // create new channel of type string ch := make(chan string) // start new anonymous goroutine go func() { time.Sleep(time.Second) ...
Column aliases are used mainly to shorten code and make column names more readable. Code becomes shorter as long table names and unnecessary identification of columns (e.g., there may be 2 IDs in the table, but only one is used in the statement) can be avoided. Along with table aliases this allows ...
Warning: be sure you have at least 15 GB of free disk space. Compilation in Ubuntu >=13.04 Option A) Use Git Use git if you want to stay in sync with the latest Ubuntu kernel source. Detailed instructions can be found in the Kernel Git Guide. The git repository does not include necessary ...
Defines an <initially-hidden> custom element which hides its contents until a specified number of seconds have elapsed. const InitiallyHiddenElement = document.registerElement('initially-hidden', class extends HTMLElement { createdCallback() { this.revealTimeoutId = null; } at...
It's possible to extent native elements, but their descendants don't get to have their own tag names. Instead, the is attribute is used to specify which subclass an element is supposed to use. For example, here's an extension of the <img> element which logs a message to the console when it's l...
curl -X POST https://api.dropboxapi.com/2/users/get_current_account \ --header "Authorization: Bearer <ACCESS_TOKEN>" <ACCESS_TOKEN> should be replaced with your access token.
#include <stdio.h> #include <curl/curl.h> int main (int argc, char *argv[]) { CURL *curl; CURLcode res; /* In windows, this will init the winsock stuff */ curl_global_init(CURL_GLOBAL_ALL); /* get a curl handle */ curl = curl_ea...
<?php $headers = array("Authorization: Bearer <ACCESS_TOKEN>", "Content-Type: application/json"); $ch = curl_init('https://api.dropboxapi.com/2/users/get_space_usage'); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POS...
#! /bin/bash i=0 while [ $i -lt 5 ] #While i is less than 5 do echo "i is currently $i" i=$[$i+1] #Not the lack of spaces around the brackets. This makes it a not a test expression done #ends the loop Watch that there are spaces around the brackets during the test (aft...
Node.js can also be used to create command line utilities. The example below reads the first argument from the command line and prints a Hello message. To run this code on an Unix System: Create a new file and paste the code below. The filename is irrelevant. Make this file executable with chmo...
In iOS 8 Apple introduced the self sizing cell. Layout your UITableViewCells with Autolayout explicitly and UITableView takes care of the rest for you. Row height is calculated automatically, by default rowHeight value is UITableViewAutomaticDimension. UITableView property estimatedRowHeight is use...
$url = "https://api.dropboxapi.com/2/sharing/share_folder" $req = [System.Net.HttpWebRequest]::Create($url) $req.headers["Authorization"] = "Bearer <ACCESS_TOKEN>" $req.Method = "POST" $req.ContentType = "application/json" $enc = [system...
$url = "https://api.dropboxapi.com/2/users/get_current_account" $req = [System.Net.HttpWebRequest]::Create($url) $req.headers["Authorization"] = "Bearer <ACCESS_TOKEN>" $req.Method = "POST" $res = $req.GetResponse() Write-Host "Response Sta...
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...
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...
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 5 of 145