Tutorial by Examples: ble

- removeObjectForKey: Removes a given key and its associated value from the dictionary. NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:@{@"key1":@"Easy",@"key2": @"Tutorials"}]; [dict removeObjectForKey:@"key1"]; NSLog...
To create a build target producing an executable, one should use the add_executable command: add_executable(my_exe main.cpp utilities.cpp) This creates a build target, e.g. make my_exe for GNU make, with the appropriate invocations of the configured compiler to pr...
Variables are SHADOWED and methods are OVERRIDDEN. Which variable will be used depends on the class that the variable is declared of. Which method will be used depends on the actual class of the object that is referenced by the variable. class Car { public int gearRatio = 8; public St...
You update all rows in table by simply providing a column_name = value: UPDATE person SET planet = 'Earth';
You can update multiple columns in a table in the same statement, separating col=val pairs with commas: UPDATE person SET country = 'USA', state = 'NY' WHERE city = 'New York';
You can also update data in a table based on data from another table: UPDATE person SET state_code = cities.state_code FROM cities WHERE cities.city = city; Here we are joining the person city column to the cities city column in order to get the city's state code. This is then used to updat...
Say we are working on a class representing a Person by their first and last names. We have created a basic class to do this and implemented proper equals and hashCode methods. public class Person { private final String lastName; //invariant - nonnull private final String firstName; //in...
Environments in R can be explicitly call and named. Variables can be explicitly assigned and call to or from those environments. A commonly created environment is one which encloses package:base or a subenvironment within package:base. e1 <- new.env(parent = baseenv()) e2 <- new.env(parent ...
The following command imports CSV files into a MySQL table with the same columns while respecting CSV quoting and escaping rules. load data infile '/tmp/file.csv' into table my_table fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\n' ignore 1...
The awk language does not directly support variables local to functions. It is however easy emulate them by adding extra arguments to functions. It is traditional to prefix these variables by a _ to indicate that they are not actual parameters. We illustrate this technique with the definition of a...
A cancelable event can be raised by a class when it is about to perform an action that can be canceled, such as the FormClosing event of a Form. To create such event: Create a new event arg deriving from CancelEventArgs and add additional properties for event data. Create an event using EventH...
It is also possible to use variables as comments. This can be useful to conditionally prevent commands being executed: @echo off setlocal if /i "%~1"=="update" (set _skip=) Else (set _skip=REM) %_skip% copy update.dat %_skip% echo Update applied ... When using the ab...
Environment variables can be defined before the meteor call, like so: PORT=4000 meteor NODE_ENV="staging" meteor
Be careful, this approach might be considered as a bad design for angular apps, since it requires programmers to remember both where functions are placed in the scope tree, and to be aware of scope inheritance. In many cases it would be preferred to inject a service (Angular practice - using scope ...
PostgreSQL and SQLite To create a temporary table local to the session: CREATE TEMP TABLE MyTable(...); SQL Server To create a temporary table local to the session: CREATE TABLE #TempPhysical(...); To create a temporary table visible to everyone: CREATE TABLE ##TempPhysicalVisibleToEveryo...
Sometimes when tables are used mostly (or only) for reads, indexing does not help anymore and every little bit counts, one might use selects without LOCK to improve performance. SQL Server SELECT * FROM TableName WITH (nolock) MySQL SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;...
WITH cte AS ( SELECT ProjectID, ROW_NUMBER() OVER (PARTITION BY ProjectID ORDER BY InsertDate DESC) AS rn FROM ProjectNotes ) DELETE FROM cte WHERE rn > 1;
This function returns the floating-point remainder of the division of x/y. The returned value has the same sign as x. #include <math.h> /* for fmod() */ #include <stdio.h> /* for printf() */ int main(void) { double x = 10.0; double y = 5.1; double modulus = fmod(x,...
C99 Type Declaration A structure with at least one member may additionally contain a single array member of unspecified length at the end of the structure. This is called a flexible array member: struct ex1 { size_t foo; int flex[]; }; struct ex2_header { int foo; char...
Variables are annotated using comments: x = 3 # type: int x = negate(x) x = 'a type-checker might catch this error' Python 3.x3.6 Starting from Python 3.6, there is also new syntax for variable annotations. The code above might use the form x: int = 3 Unlike with comments, it is also pos...

Page 19 of 62