Tutorial by Examples: el

Ruby offers the expected if and else expressions for branching logic, terminated by the end keyword: # Simulate flipping a coin result = [:heads, :tails].sample if result == :heads puts 'The coin-toss came up "heads"' else puts 'The coin-toss came up "tails"' end ...
If you want to use a pipe character (|) in the content of a cell you'll need to escape it with a backslash. Column | Column ------ | ------ \| Cell \|| \| Cell \| This results in the following table: ColumnColumn| Cell || Cell |
The Edges The browser creates a rectangle for each element in the HTML document. The Box Model describes how the padding, border, and margin are added to the content to create this rectangle. Diagram from CSS2.2 Working Draft The perimeter of each of the four areas is called an edge. Each edge ...
In jQuery you can select elements in a page using many various properties of the element, including: Type Class ID Possession of Attribute Attribute Value Indexed Selector Pseudo-state If you know CSS selectors you will notice selectors in jQuery are the same (with minor exceptions). Ta...
SELECT your_columns, COUNT(*) OVER() as Ttl_Rows FROM your_data_set idnameTtl_Rows1example52foo53bar54baz55quux5 Instead of using two queries to get a count then the line, you can use an aggregate as a window function and use the full result set as the window. This can be used as a base for fur...
var line = 0 var maximum_lines = 5 while (line < maximum_lines) { line = line + 1 println("Line number: " + line) }
var line = 0 var maximum_lines = 5 do { line = line + 1 println("Line number: " + line) } while (line < maximum_lines) The do/while loop is infrequently used in functional programming, but can be used to work around the lack of support for the break/continue construct, as...
To delete a remote branch in Git: git push [remote-name] --delete [branch-name] or git push [remote-name] :[branch-name]
If a remote branch has been deleted, your local repository has to be told to prune the reference to it. To prune deleted branches from a specific remote: git fetch [remote-name] --prune To prune deleted branches from all remotes: git fetch --all --prune
Deleting the last element: std::vector<int> v{ 1, 2, 3 }; v.pop_back(); // v becomes {1, 2} Deleting all elements: std::vector<int> v{ 1, 2, 3 }; v.clear(); // v becomes an empty vector Deleting element by index: std::vect...
See full documentation on LIKE operator. This example uses the Employees Table from the Example Databases. SELECT * FROM Employees WHERE FName LIKE 'John' This query will only return Employee #1 whose first name matches 'John' exactly. SELECT * FROM Employees WHERE FName like 'John%' Ad...
A simple application showing the text "Hello World" in the center of the window. import QtQuick 2.3 import QtQuick.Window 2.0 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") //The method qsTr() is used for translations from one la...
This example shows the usage of the ILGenerator by generating code that makes use of already existing and new created members as well as basic Exception handling. The following code emits a DynamicAssembly that contains an equivalent to this c# code: public static class UnixTimeHelper { priva...
Delete a file asynchronously: var fs = require('fs'); fs.unlink('/path/to/file.txt', function(err) { if (err) throw err; console.log('file deleted'); }); You can also delete it synchronously*: var fs = require('fs'); fs.unlinkSync('/path/to/file.txt'); console.log('file deleted'...
The class name selector select all elements with the targeted class name. For example, the class name .warning would select the following <div> element: <div class="warning"> <p>This would be some warning copy.</p> </div> You can also combine class n...
ID selectors select DOM elements with the targeted ID. To select an element by a specific ID in CSS, the # prefix is used. For example, the following HTML div element… <div id="exampleID"> <p>Example</p> </div> …can be selected by #exampleID in CSS as sho...
URLs for links can be specified later in the document. Markdown [Text1][1] will link to the first link, and [Text2][2] to the second. You [can reuse][1] names, and give longer names [like this one][a link]. You can also link text [like this] without giving the reference an explicit name. [1]:...
In this example we are going to plot multiple lines onto a single axis. Additionally, we choose a different appearance for the lines and create a legend. % create sample data x = linspace(-2,2,100); % 100 linearly spaced points from -2 to 2 y1 = x.^2; y2 = 2*x.^2; y3 = 4*x.^2; ...
Normally, a Docker container persists after it has exited. This allows you to run the container again, inspect its filesystem, and so on. However, sometimes you want to run a container and delete it immediately after it exits. For example to execute a command or show a file from the filesystem. Dock...
An std::map takes (key, value) pairs as input. Consider the following example of std::map initialization: std::map < std::string, int > ranking { std::make_pair("stackoverflow", 2), std::make_pair("docs-beta", 1) }; In an std::...

Page 8 of 145