Tutorial by Examples: at

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...
The following is handy to have in build logs that identifies the build machine, and some parameters; simply make you main task depend on this task to print it before every build. <!-- Print Environment Info --> <target name="environment"> <!-- Get the current ti...
Mathematical operations on values other than numbers return NaN. "a" + 1 "b" * 3 "cde" - "e" [1, 2, 3] * 2 An exception: Single-number arrays. [2] * [3] // Returns 6 Also, remember that the + operator concatenates strings. "a" + "b&...
Generally, Math functions that are given non-numeric arguments will return NaN. Math.floor("a") The square root of a negative number returns NaN, because Math.sqrt does not support imaginary or complex numbers. Math.sqrt(-1)
In this example, we have an array containing some data. We capture the output buffer in $items_li_html and use it twice in the page. <?php // Start capturing the output ob_start(); $items = ['Home', 'Blog', 'FAQ', 'Contact']; foreach($items as $item): // Note we're about to step &q...
If you have already added a file to your Git repository and now want to stop tracking it (so that it won't be present in future commits), you can remove it from the index: git rm --cached <file> This will remove the file from the repository and prevent further changes from being tracked by...
Node provides the module.exports interface to expose functions and variables to other files. The most simple way to do so is to export only one object (function or variable), as shown in the first example. hello-world.js module.exports = function(subject) { console.log('Hello ' + subject); }...
Considering the following users table: idusername1User12User23User34User45User5 In order to constrain the number of rows in the result set of a SELECT query, the LIMIT clause can be used together with one or two positive integers as arguments (zero included). LIMIT clause with one argument When ...
Interface and implementation of a simple category on NSArray, named Filter, with a single method that filters numbers. It is good practice to add a prefix (PF) to the method to ensure we don't overwrite any future NSArray methods. @interface NSArray (PFFilter) - (NSArray *)pf_filterSmaller:(dou...
The following is how to properly use the java.util.Scanner class to interactively read user input from System.in correctly( sometimes referred to as stdin, especially in C, C++ and other languages as well as in Unix and Linux). It idiomatically demonstrates the most common things that are requested ...
Every format type is related to an HTML tag. The First Heading refers to the <h1> tag and is visualized like: Hello World and it's written underlining the text with =: Hello World =========== or by prepending # to the text: # Hello World The Second Heading refers to the <h2&gt...
When an exception object is created (i.e. when you new it), the Throwable constructor captures information about the context in which the exception was created. Later on, this information can be output in the form of a stacktrace, which can be used to help diagnose the problem that caused the excep...
You can overload all basic arithmetic operators: + and += - and -= * and *= / and /= & and &= | and |= ^ and ^= >> and >>= << and <<= Overloading for all operators is the same. Scroll down for explanation Overloading outside of class/struct: //operator...
You can overload the 2 unary operators: ++foo and foo++ --foo and foo-- Overloading is the same for both types (++ and --). Scroll down for explanation Overloading outside of class/struct: //Prefix operator ++foo T& operator++(T& lhs) { //Perform addition return lhs; } ...
You can overload all comparison operators: == and != > and < >= and <= The recommended way to overload all those operators is by implementing only 2 operators (== and <) and then using those to define the rest. Scroll down for explanation Overloading outside of class/struct: ...
You can overload type operators, so that your type can be implicitly converted into the specified type. The conversion operator must be defined in a class/struct: operator T() const { /* return something */ } Note: the operator is const to allow const objects to be converted. Example: struct ...
You can even overload the array subscript operator []. You should always (99.98% of the time) implement 2 versions, a const and a not-const version, because if the object is const, it should not be able to modify the object returned by []. The arguments are passed by const& instead of by value...
You can overload the function call operator (): Overloading must be done inside of a class/struct: //R -> Return type //Types -> any different type R operator()(Type name, Type2 name2, ...) { //Do something //return something } //Use it like this (R is return type, a and b a...
The assignment operator is one of the most important operators because it allows you to change the status of a variable. If you do not overload the assigment operator for your class/struct, it is automatically generated by the compiler: the automatically-generated assignment operator performs a &qu...

Page 17 of 442