Tutorial by Examples: l

Prerequisites sudo apt-get install build-essential sudo apt-get install python [optional] sudo apt-get install git Get source and build cd ~ git clone https://github.com/nodejs/node.git OR For the latest LTS Node.js version 6.10.2 cd ~ wget https://nodejs.org/dist/v6.3.0/node-v6.10....
This is a short summary of the GitLab guide on Install a GitLab CE Omnibus package. Requirements In order to install the GitLab Community Edition on your server, you should read the requirements page. To make it brief, the recommended requirements are: OS: Ubuntu, Debian, CentOS, RHEL Ruby ver...
The Iterator.remove() method is an optional method that removes the element returned by the previous call to Iterator.next(). For example, the following code populates a list of strings and then removes all of the empty strings. List<String> names = new ArrayList<>(); names.add("...
A class in Scala is a 'blueprint' of a class instance. An instance contains the state and behavior as defined by that class. To declare a class: class MyClass{} // curly braces are optional here as class body is empty An instance can be instantiated using new keyword: var instance = new MyClas...
The only way to catch exception in initializer list: struct A : public B { A() try : B(), foo(1), bar(2) { // constructor body } catch (...) { // exceptions from the initializer list and constructor are caught here // if no exception is thrown h...
void function_with_try_block() try { // try block body } catch (...) { // catch block body } Which is equivalent to void function_with_try_block() { try { // try block body } catch (...) { // catch block body } } Note t...
struct A { ~A() noexcept(false) try { // destructor body } catch (...) { // exceptions of destructor body are caught here // if no exception is thrown here // then the caught exception is re-thrown. } }; Note that, although this...
Elm has a special syntax for lambda expressions or anonymous functions: \arguments -> returnedValue For example, as seen in List.filter: > List.filter (\num -> num > 1) [1,2,3] [2,3] : List number More to the depth, a backward slash, \, is used to mark the beginning of lambda ex...
It is possible to define local variables inside a function to reduce code repetition give name to subexpressions reduce the amount of passed arguments. The construct for this is let ... in .... bigNumbers = let allNumbers = [1..100] isBig number = ...
Ruby will need to be installed first before setup. You can install Ruby through the apt package manager, rbenv, or rvm. Then Run sudo su -c "gem install sass"
File streams are buffered by default, as are many other types of streams. This means that writes to the stream may not cause the underlying file to change immediately. In oder to force all buffered writes to take place immediately, you can flush the stream. You can do this either directly by invokin...
dolist is a looping macro created to easily loop through the lists. One of the simplest uses would be: CL-USER> (dolist (item '(a b c d)) (print item)) A B C D NIL ; returned value is NIL Note that since we did not provide return value, NIL is returned (and A,B,C,D are ...
List employees earning more than $50000 born this century. List their name, date of birth and salary, sorted alphabetically by name. SELECT employee_name, date_of_birth, salary FROM employees WHERE salary > 50000 AND date_of_birth >= DATE '2000-01-01' ORDER BY employee_name; Show...
Installation The preferred way to install Mockito is to declare a dependency on mockito-core with a build system of choice. As of July 22nd, 2016, the latest non-beta version is 1.10.19, but 2.x is already encouraged to be migrated to. Maven <dependency> <groupId>org.mockito</...
When you inherit from a class with a property, you can provide a new implementation for one or more of the property getter, setter or deleter functions, by referencing the property object on the parent class: class BaseClass(object): @property def foo(self): return some_calculate...
The following example listens to window.onerror event and uses an image beacon technique to send the information through the GET parameters of an URL. var hasLoggedOnce = false; // Some browsers (at least Firefox) don't report line and column numbers // when event is handled through window.addE...
CLP(FD) constraints (Finite Domains) implement arithmetic over integers. They are available in all serious Prolog implementations. There are two major use cases of CLP(FD) constraints: Declarative integer arithmetic Solving combinatorial problems such as planning, scheduling and allocation task...
List doesn't support "random access", which means it takes more work to get, say, the fifth element from the list than the first element, and as a result there's no List.get nth list function. One has to go all the way from the beginning (1 -> 2 -> 3 -> 4 -> 5). If you need ra...
Arrays can have more than one dimension. The following example creates a two-dimensional array of ten rows and ten columns: int[,] arr = new int[10, 10]; An array of three dimensions: int[,,] arr = new int[10, 10, 10]; You can also initialize the array upon declaration: int[,] arr = new int...
This makes image masked to the shape of the letters of the label: Objective-C self.maskImage.layer.mask = self.maskLabel.layer; self.maskImage.layer.masksToBounds = YES; Swift 3 maskImageView.mask = maskLabel maskImageView.masksToBounds = true Here is the result:

Page 158 of 861