Tutorial by Examples: ble

int a; printf("%d", a); The variable a is an int with automatic storage duration. The example code above is trying to print the value of an uninitialized variable (a was never initialized). Automatic variables which are not initialized have indeterminate values; accessing these can le...
This code creates a sticky footer. When the content doesn't reach the end of the viewport, the footer sticks to the bottom of the viewport. When the content extends past the bottom of the viewport, the footer is also pushed out of the viewport. View Result HTML: <div class="header"&gt...
from collections import Counter c = Counter(["a", "b", "c", "d", "a", "b", "a", "c", "d"]) c # Out: Counter({'a': 3, 'b': 2, 'c': 2, 'd': 2}) c["a"] # Out: 3 c[7] # not in the list (7 oc...
project/jni/main.c #include <stdio.h> #include <unistd.h> int main(void) { printf("Hello world!\n"); return 0; } project/jni/Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := hello_world LOCAL_SRC_FILES := main.c include $(BU...
To get the “available” area of the screen (i.e. not including any bars on the edges of the screen, but including window chrome and other windows: var availableArea = { pos: { x: window.screen.availLeft, y: window.screen.availTop }, size: { width: window.scr...
Markdown tables are physically represented using dash - for to separate the header row from the content ones and pipe | for columns. ColumnColumnCellCell is produced by Column | Column ------ | ------ Cell | Cell You can also populate a table in any way you want - LetterDigitCharactera4...
Declare a new variable with var, followed by a name, type, and value: var num: Int = 10 Variables can have their values changed: num = 20 // num now equals 20 Unless they're defined with let: let num: Int = 10 // num cannot change Swift infers the type of variable, so you don't always ha...
Local variables are defined within a function, method, or closure: func printSomething() { let localString = "I'm local!" print(localString) } func printSomethingAgain() { print(localString) // error } Global variables are defined outside of a function, method, or c...
#include <stdio.h> #define is_const_int(x) _Generic((&x), \ const int *: "a const int", \ int *: "a non-const int", \ default: "of other type") int main(void) { const int i = 1; int j = 1; double...
Tuples can be decomposed into individual variables with the following syntax: let myTuple = (name: "Some Name", age: 26) let (first, second) = myTuple print(first) // "Some Name" print(second) // 26 This syntax can be used regardless of if the tuple has unnamed properti...
Variables you have provided in your view context can be accessed using double-brace notation: In your views.py: class UserView(TemplateView): """ Supply the request user object to the template """ template_name = "user.html" def get_context_data...
Create a snapshot of a whole database: mysqldump [options] db_name > filename.sql Create a snapshot of multiple databases: mysqldump [options] --databases db_name1 db_name2 ... > filename.sql mysqldump [options] --all-databases > filename.sql Create a snapshot of one or more tables...
mysql [options] db_name < filename.sql Note that: db_name needs to be an existing database; your authenticated user has sufficient privileges to execute all the commands inside your filename.sql; The file extension .sql is fully a matter of style. Any extension would work. You cannot spe...
CREATE TABLE MyTableName ( Id INT, MyColumnName NVARCHAR(1000) ) GO INSERT INTO MyTableName (Id, MyColumnName) VALUES (1, N'Hello World!') GO
int* foo(int bar) { int baz = 6; baz += bar; return &baz; /* (&baz) copied to new memory location outside of foo. */ } /* (1) The lifetime of baz and bar end here as they have automatic storage * duration (local variables), thus the returned pointer is not valid! */ ...
$( "#accordion" ).accordion( "disable" ); This method will disable the accordion, i.e. the headers are not selectable making the content read only and static. This method does not take any arguments.
$( "#accordion" ).accordion( "enable" ); This method will enable an accordion. This will enable a disabled accordion or simply do nothing on an already enabled accordion. This method does not take any arguments.
To create a variable in Python, all you need to do is specify the variable name, and then assign a value to it. <variable name> = <value> Python uses = to assign values to variables. There's no need to declare a variable in advance (or to assign a data type to it), assigning a value ...
In most environments, console.table() can be used to display objects and arrays in a tabular format. For example: console.table(['Hello', 'world']); displays like: (index)value0"Hello"1"world" console.table({foo: 'bar', bar: 'baz'}); displays like: (index)value"fo...
In standard pattern matching, the identifier used will shadow any identifier in the enclosing scope. Sometimes it is necessary to match on the enclosing scope's variable. The following example function takes a character and a list of tuples and returns a new list of tuples. If the character existed...

Page 3 of 62