Tutorial by Examples: comp

Computed GOTO allows branching of the program according to the value of an integer expression. GOTO (label_1, label_2,... label_n) scalar-integer-expression If scalar-integer-expression is equal to 1 the program continues at statement label label_1, if it is equal to 2 it goes to label_2 and so ...
Before we download and install Composer, we need to make sure our server has all dependencies installed. First, update the package manager cache by running: sudo apt-get update Now, let's install the dependencies. We'll need curl in order to download Composer and php5-cli for installing and run...
The code below implements a very simple complex number type for which the underlying field is automatically promoted, following the language's type promotion rules, under application of the four basic operators (+, -, *, and /) with a member of a different field (be it another complex<T> or so...
BrandVersions SupportedInternet Explorer6.0 +Firefox2.0 +Chrome1.0 +Safari4.0 +Opera9.0 +iOS (Safari)3.0 +Android Browser2.0 + Highcharts supports jQuery version 1.6+ for legacy browsers, and 2.0+ for modern browsers.
{ "name": "your/package", "license": "proprietary", "type": "project", "description": "How to load an external private Composer package.", ... "require": { "your/priv...
Directives can be used to build reusable components. Here is an example of a "user box" component: userBox.js angular.module('simpleDirective', []).directive('userBox', function() { return { scope: { username: '=username', reputation: '=reputation' }, ...
The year, month or day components of a DATE data type can be found using the EXTRACT( [ YEAR | MONTH | DAY ] FROM datevalue ) SELECT EXTRACT (YEAR FROM DATE '2016-07-25') AS YEAR, EXTRACT (MONTH FROM DATE '2016-07-25') AS MONTH, EXTRACT (DAY FROM DATE '2016-07-25') AS DAY FROM D...
While implementing one of the standard hashing algorithm in awk is probably a tedious task, defining a hash function that can be used as a handle to text documents is much more tractable. A practical situation where such a function is useful is to assign short ids to items given their description, ...
<svg width="800px" height="600px"> <defs> <filter id="complex-shadow" color-interpolation-filters="sRGB" x="-50%" y="-50%" height="200%" width="200%"> <!-- Take source alpha, offset it by angle/...
Related to Monads are F# computation expressions (CE). A programmer typically implements a CE to provide an alternative approach to chaining Monads, ie instead of this: let v = m >>= fun x -> n >>= fun y -> return_ (x, y) You can write this: let v = ce { let! x = m ...
Suppose we want to query the "cheapest products" from the "top categories". Here is an example of query using Common Table Expressions -- all_sales: just a simple SELECT with all the needed JOINS WITH all_sales AS ( SELECT product.price as product_price, category.id a...
Adding components one after another results in a UI that's hard to use, because the components all are somewhere. The components are ordered from top to bottom, each component in a separate "row". To remedy this and provide you as developer with a possibility to layout components easily S...
Preallocation. Mongo sets aside disk-space in empty containers, so when the time comes to write something to disk, it doesn't have to shuffle bits out of the way first. It does so by a doubling algorithm, always doubling the amount of disk space preallocated until it reaches 2GB; and then each preal...
There are many cases when one has created an NSDate from only an hour and minute format, i.e: 08:12 The downside for this situation is that your NSDate is almost completely "naked" and what you need to do is to create: day, month, year, second and time zone in order to this object to &quo...
This example is based on a blog post by Nicolas Hery. It utilizes ES6 classes and ReactJS's lifecycle methods to keep the D3 component updated d3_react.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Hello, d3React!</title>...
To build vim from source on Ubuntu: Get a copy of the source code by downloading from the official Vim repository on GitHub. Get the dependencies by running $ sudo apt-get build-dep vim-gnome or similar. Go to the directory of the Vim source code: cd vim/src Run $ ./configure. You can customiz...
OperatorDescription==true if the two values are equal.!=true if the two values are not equal.<true if the value of the operand on the left is less than the value on the right.>true if the value of the operand on the left is greater than the value on the right.>=true if the value of the oper...
AlertDialog is a subclass of Dialog that can display one, two or three buttons. If you only want to display a String in this dialog box, use the setMessage() method. The AlertDialog from android.app package displays differently on different Android OS Versions. The Android V7 Appcompat library pro...
List.sortWith allows you to sort lists with data of any shape - you supply it with a comparison function. compareBools : Bool -> Bool -> Order compareBools a b = case (a,b) of (False, True) -> LT (True, False) -> GT _ -> ...
C++14 Those following complex user literals are declared in the namespace std::literals::complex_literals, where both literals and complex_literals are inline namespaces. Access to these operators can be gained with using namespace std::literals, using namespace std::complex_literals, and using nam...

Page 12 of 34