Tutorial by Examples: l

BEGIN TRY -- start error handling BEGIN TRANSACTION; -- from here on transactions (modifictions) are not final -- start your statement(s) select 42/0 as ANSWER -- simple SQL Query with an error -- end your statement(s) COMMIT TRANSACTION; -- finalize all transa...
The first thing we need is to tell karma to use Webpack to read our tests, under a configuration we set for the webpack engine. Here, I am using babel because I write my code in ES6, you can change that for other flavors, such as Typescript. Or I use Pug (formerly Jade) templates, you don't have to....
Getting a reference to the main bundle using Cocoa. To get the main bundle in Cocoa application, call the mainBundle class method of the NSBundle class. NSBundle *mainBundle; // Get the main bundle for the app; mainBundle = [NSBundle mainBundle]; Getting a reference to ...
Locating a Cocoa bundle using its path To obtain the bundle at a specific path using Cocoa, call the bundleWithPath: class method of the NSBundle NSBundle *myBundle; // obtain a reference to a loadable bundle myBundle = [NSBundle bundleWithPath:@"/Library/MyBundle.bundle...
sudo docker stats $(sudo docker inspect -f "{{ .Name }}" $(sudo docker ps -q)) Shows live CPU usage of all running containers.
Before reading and writing text files you should know what encoding to use. See the Perl Unicode Documentation for more details on encoding. Here we show the setting of UTF-8 as the default encoding and decoding for the function open. This is done by using the open pragma near the top of your code (...
HTML Import caching will sometimes mean that changes made to HTML files that get imported do not get reflected upon browser refresh. Take the following import as an example: <link rel="import" href="./my-element.html"> If a change is done to my-element.html after previo...
Modern browsers provide a classList object to ease manipulation of the element's class attribute. Older browsers require direct manipulation of the element's className property. * Note class names are not stored in the element's property in any particular order W3C DOM4 Removing one class from an...
Modern browsers provide a classList object to ease manipulation of the element's class attribute. Older browsers require direct manipulation of the element's className property. * Note class names are not stored in the element's property in any particular order W3C DOM4 Testing if an element cont...
To plot an ellipse you can use its equation. An ellipse has a major and a minor axis. Also we want to be able to plot the ellipse on different center points. Therefore we write a function whose inputs and outputs are: Inputs: r1,r2: major and minor axis respectively C: center of the ellip...
In MySQL and other SQL dialects, NULL values have special properties. Consider the following table containing job applicants, the companies they worked for, and the date they left the company. NULL indicates that an applicant still works at the company: CREATE TABLE example (`applicant_id` INT, `...
SELECT 1,22,44 UNION SELECT 2,33,55 SELECT 1,22,44 UNION SELECT 2,33,55 UNION SELECT 2,33,55 The result is the same as above. use UNION ALL when SELECT 1,22,44 UNION SELECT 2,33,55 UNION ALL SELECT 2,33,55
In InnoDB, having a long PRIMARY KEY (either a single column with a lengthy value, or several columns that form a long composite value) wastes a lot of disk space. The primary key value for a row is duplicated in all the secondary index records that point to the same row. Create an AUTO_INCREME...
The correct invocation of helper modules and functions can be intimidating because these are generated dynamically (e.g., when creating a new project or adding a new resource) they are not documented explicitly (e.g., MyApp.ErrorHelpers.error_tag) the documentation does not cover all examples (...
To automatically reload vimrc upon save, add the following to your vimrc: if has('autocmd') " ignore this section if your vim does not support autocommands augroup reload_vimrc autocmd! autocmd! BufWritePost $MYVIMRC,$MYGVIMRC nested source % augroup END endif a...
The Ruby Version Manager is a command line tool to simply install and manage different versions of Ruby. rvm istall 2.3.1 for example installs Ruby version 2.3.1 on your machine. With rvm list you can see which versions are installed and which is actually set for use. user@dev:~$ rvm li...
PROC SQL options; SELECT column(s) FROM table-name | view-name WHERE expression GROUP BY column(s) HAVING expression ORDER BYcolumn(s); QUIT; Example 1: proc sql; select name ,sex from sashelp.class ; quit; The SELECT statement is specified in this order : 1....
DECLARE v_num1 NUMBER(10); v_num2 NUMBER(10); BEGIN v_num1 := 2; v_num2 := 10; IF v_num1 > v_num2 THEN dbms_output.put_line('v_num1 is bigger than v_num2'); ELSE dbms_output.put_line('v_num1 is NOT bigger than v_num2'); END IF; END;
DECLARE v_num1 NUMBER(10); v_num2 NUMBER(10); BEGIN v_num1 := 2; v_num2 := 2; IF v_num1 > v_num2 THEN dbms_output.put_line('v_num1 is bigger than v_num2'); ELSIF v_num1 < v_num2 THEN dbms_output.put_line('v_num1 is NOT bigger than v_num2'); ELSE dbms_out...
Modern versions of Jenkins (version 2.x) come with a "Build Pipeline Plugin" that can be used to orchestrate complex CI tasks without creating a multitude of interconnected jobs, and allow you to easily version-control your build / test configuration. You may install this manually in a &q...

Page 513 of 861