Tutorial by Examples

Use in operator to check if an element is a member of a list. iex> 2 in [1, 2, 3] true iex> "bob" in [1, 2, 3] false
{ "name": "your/package", "license": "proprietary", "type": "project", "description": "How to load an external private Composer package.", ... "require": { "your/priv...
Looping via recursion is also possible in Kotlin as in most programming languages. fun factorial(n: Long): Long = if (n == 0) 1 else n * factorial(n - 1) println(factorial(10)) // 3628800 In the example above, the factorial function will be called repeatedly by itself until the given conditio...
The Kotlin Standard Library also provides numerous useful functions to iteratively work upon collections. For example, the map function can be used to transform a list of items. val numbers = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 0) val numberStrings = numbers.map { "Number $it" } One of...
Use Conditionals via (syntax is in [brackets]): when [when:] Task: - name: run if operating system is debian command: echo "I am a Debian Computer" when: ansible_os_family == "Debian" loops [with_items:] loops [with_dicts:] Custom Facts [ wh...
Common use when: ansible_os_family == "CentOS" when: ansible_os_family == "Redhat" when: ansible_os_family == "Darwin" when: ansible_os_family == "Debian" when: ansible_os_family == "Windows" All Lists based on discuss here http://comments...
Basic Usage Use the when condition to control whether a task or role runs or is skipped. This is normally used to change play behavior based on facts from the destination system. Consider this playbook: - hosts: all tasks: - include: Ubuntu.yml when: ansible_os_family == "Ubunt...
- name: copy ssl key/cert/ssl_include files copy: src=files/ssl/{{ item }} dest=/etc/apache2/ssl/ with_items: - g_chain.crt - server.crt - server.key - ssl_vhost.inc
Ordering the results and setting a limit can easily be achieved with 2 additional lines added to the chain, like so: $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*') ->from('#__users') ->where('username = '. $db->q('John')) ->ord...
A simple query that selects all users from the #__users table with a username that matches John $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*'); $query->from('#__users'); $query->where('username = '. $db->q('John')); $db->setQuery($query); ...
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 angular.noop is a function that performs no operations, you pass angular.noop when you need to provide a function argument that will do nothing. angular.noop() A common use for angular.noop can be to provide an empty callback to a function that will otherwise throw an error when something ...
The angular.isObject return true if and only if the argument passed to it is an object, this function will also return true for an Array and will return false for null even though typeof null is object . angular.isObject(value) This function is useful for type checking when you need a defined ...
The angular.isElement returns true if the argument passed to it is a DOM Element or a jQuery wrapped Element. angular.isElement(elem) This function is useful to type check if a passed argument is an element before being processed as such. Examples: angular.isElement(document.querySelector(&q...
Preliminary Install the Cordova cli tools, if you haven't already. $ npm install -g cordova Navigate to your desired working folder. $ cd /path/to/coding/folder Creating the application Create a new application $ cordova create <appProjectName> <appNameSpace> <appName> For ...
iText for Java Importing the iText jars from the Central Maven Repository is the best way to install iText 7. These simple videos explain how to do this using different IDEs: How to import iText 7 in Eclipse to create a Hello World PDF? How to import iText 7 in Netbeans to create a Hello World ...
Behaviours are a list of functions specifications that another module can implement. They are similar to interfaces in other languages. Here’s an example behaviour: defmodule Parser do @callback parse(String.t) :: any @callback extensions() :: [String.t] end And a module that implements ...
POSIX/IEEE Open Group Base Specification says: [2addr] s/BRE/replacement/flags Substitute the replacement string for instances of the BRE in the pattern space. Any character other than backslash or newline can be used instead of a slash to delimit the BRE and the replacement. Within the BRE a...
Create a group of checkboxes that can be used to toggle multiple choices independently. The server will receive the input as a character vector of the selected values. library(shiny) ui <- fluidPage( checkboxGroupInput("checkGroup1", label = h3("This is a Checkbox group&...
Types can represents various kind of things. It can be a single data, a set of data or a function. In F#, we can group the types into two categories.: F# types: // Functions let a = fun c -> c // Tuples let b = (0, "Foo") // Unit type let c = ignore // Records...

Page 473 of 1336