Tutorial by Examples

Sonarqube uses database for storing its results and analysis. You can install MySQL for example and run it using mysql -u root -p and then run the following queries to set up the database tables. CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE USER 'sonar' IDENTIFIED BY 's...
#include <gtk/gtk.h> // callback function which is called when button is clicked static void on_button_clicked(GtkButton *btn, gpointer data) { // change button label when it's clicked gtk_button_set_label(btn, "Hello World"); } // callback function which is called ...
Formula in A1 ={"Item name","Quantity";"Apples",2;"Blueberries",5} Important: In certain countries the comma is used as a decimal separator (e.g: €1,00). If that's your case, you would need to use backslashes ( \ ) instead: (Docs) ={"Item name"\...
Interpolation means that Perl interpreter will substitute the values of variables for their name and some symbols (which are impossible or difficult to type in directly) for special sequences of characters (it is also known as escaping). The most important distinction is between single and double qu...
Perl interpolates variable names: my $name = 'Paul'; print "Hello, $name!\n"; # Hello, Paul! my @char = ('a', 'b', 'c'); print "$char[1]\n"; # b my %map = (a => 125, b => 1080, c => 11); print "$map{a}\n"; # 125 Arrays may be interpolated as a whol...
<link rel="stylesheet" href="http://openlayers.org/en/v3.17.1/css/ol.css" type="text/css"> <script src="http://openlayers.org/en/v3.17.1/build/ol.js"></script>
<html> <head> <title>Getting started</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.17.1/ol.css" type="text/css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.17.1/ol...
First, define a used defined table type to use: CREATE TYPE names as TABLE ( FirstName varchar(10), LastName varchar(10) ) GO Create the stored procedure: CREATE PROCEDURE prInsertNames ( @Names dbo.Names READONLY -- Note: You must specify the READONLY ) AS INSERT INTO d...
Modules are defined in a file named module-info.java, named a module descriptor. It should be placed in the source-code root: |-- module-info.java |-- com |-- example |-- foo |-- Foo.java |-- bar |-- Bar.java Here is a simple module descri...
For expressing the power of 2 (2^n) of integers, one may use a bitshift operation that allows to explicitly specify the n. The syntax is basically: int pow2 = 1<<n; Examples: int twoExp4 = 1<<4; //2^4 int twoExp5 = 1<<5; //2^5 int twoExp6 = 1<<6; //2^6 ... int twoEx...
To list all aliases and their functions: Get-Alias To get all aliases for specific cmdlet: PS C:\> get-alias -Definition Get-ChildItem CommandType Name Version Source ----------- ---- -...
This cmdlet allows you to create new alternate names for exiting cmdlets PS C:\> Set-Alias -Name proc -Value Get-Process PS C:\> proc Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id SI ProcessName ------- ------ ----- ----- ----- ------ -- -- ----------- 2...
While it's good practice to use a Unix based operating system (ex. Linux or BSD) as a production server you can easily install PostgreSQL on Windows (hopefully only as a development server). Download the Windows installation binaries from EnterpriseDB: http://www.enterprisedb.com/products-services-...
Assume you have a custom file you want to create an importer for. It could be an .xls file or whatever. In this case we're going to use a JSON file because it's easy but we're going to pick a custom extension to make it easy to tell which files are ours? Let's assume the format of the JSON file is ...
The "right-left" rule is a completely regular rule for deciphering C declarations. It can also be useful in creating them. Read the symbols as you encounter them in the declaration... * as "pointer to" - always on the left side [] as "array of" ...
A goto statement transfers control to the statement with the corresponding label within the same function. Executing the goto statement must not cause any variables to come into scope that were not already in scope at the point of the goto. for example see the standard library source code: https:/...
WeakMap object allows you to store key/value pairs. The difference from Map is that keys must be objects and are weakly referenced. This means that if there aren't any other strong references to the key, the element in WeakMap can be removed by garbage collector. WeakMap constructor has an optional...
To get a value associated to the key, use the .get() method. If there's no value associated to the key, it returns undefined. const obj1 = {}, obj2 = {}; const weakmap = new WeakMap([[obj1, 7]]); console.log(weakmap.get(obj1)); // 7 console.log(weakmap.get(obj2)); // undefined
To assign a value to the key, use the .set() method. It returns the WeakMap object, so you can chain .set() calls. const obj1 = {}, obj2 = {}; const weakmap = new WeakMap(); weakmap.set(obj1, 1).set(obj2, 2); console.log(weakmap.get(obj1)); // 1 console.log(weakmap.get(obj2)); // 2 ...
To check if an element with a specified key exits in a WeakMap, use the .has() method. It returns true if it exits, and otherwise false. const obj1 = {}, obj2 = {}; const weakmap = new WeakMap([[obj1, 7]]); console.log(weakmap.has(obj1)); // true console.log(weakmap.has(obj2)); // false...

Page 735 of 1336