Tutorial by Examples: ci

By using a module loader like Webpack we can benefit the built-in module system available in ES6 (as well as in TypeScript). We can then use the import and export features that allow us to specify what pieces of code can we are going to share between different parts of the application. When we then...
This example shows how to have a view track a pan gesture and depart in a physics-based manner. Swift class ViewController: UIViewController { // Adjust to change speed of view from flick let magnitudeMultiplier: CGFloat = 0.0008 lazy var dynamicAnimator: UIDynamicAnimator ...
If you have a multidimensional array like this: [ ['foo', 'bar'], ['fizz', 'buzz'], ] And you want to change it to an associative array like this: [ 'foo' => 'bar', 'fizz' => 'buzz', ] You can use this code: $multidimensionalArray = [ ['foo', 'bar'], ...
It is possible to specify a text hint when using EditTexts. Text hints are useful for conveying to the user what they should type in the EditText. In XML: <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="use...
Content fetched by <a-asset-item> will be returned as plain text. If we want to use a different response type such as arraybuffer, use <a-asset-item>'s response-type attribute: <a-asset-item response-type="arraybuffer" src="model.gltf"></a-asset-item> ...
Circle.yml machine: python: # Python version to use - Selenium requires python 3.0 and above version: pypy-3.6.0 dependencies: pre: # Install pip packages - pip install selenium - pip install unittest test: override: # Bash command to run main....
The ternary operator (?:) Support for the extended ternary operator was added in Twig 1.12.0. {{ foo ? 'yes' : 'no' }} Evaluates: if foo echo yes else echo no {{ foo ?: 'no' }} or {{ foo ? foo : 'no' }} Evaluates: if foo echo it, else echo no {{ foo ? 'yes' }} or {{ f...
Associated objects are useful when you want to add functionality to existing classes which requires holding state. For example, adding a activity indicator to every UIView: Objective-C Implementation #import <objc/runtime.h> static char ActivityIndicatorKey; @implementation UIView (Ac...
Jenkins: The leading open source automation server, Jenkins provides hundreds of plugins to support building, deploying and automating any project. Sonar Qube: SonarQube provides the capability to not only show health of an application but also to highlight issues newly introduced. Apache Ant: A...
The function Emitter.listenerCount(eventName) will return the number of listeners that are currently listening for the event provided as argument const EventEmitter = require("events"); class MyEmitter extends EventEmitter{} var emitter = new MyEmitter(); emitter .on("data&quot...
An inner class which is visible to any outside class can be created from this class as well. The inner class depends on the outside class and requires a reference to an instance of it. To create an instance of the inner class, the new operator only needs to be called on an instance of the outer cla...
Bottom up approach for printing the nth Fibonacci number using Dynamic Programming. Recursive Tree fib(5) / \ fib(4) fib(3) / \ / \ fib(3) fib(2...
We can put assembly instructions inside a macro and use the macro like you would call a function. #define mov(x,y) \ { \ __asm__ ("l.cmov %0,%1,%2" : "=r" (x) : "r" (y), "r" (0x0000000F)); \ } /// some definition and assignment unsigned char sbox[...
Suppose we have this source file that we would like to split: cat -n sourcefile 1 On the Ning Nang Nong 2 Where the Cows go Bong! 3 and the monkeys all say BOO! 4 There's a Nong Nang Ning 5 Where the trees go Ping! 6 And the tea pots jibber jabber joo. 7 On the Nong Ning Nang Comma...
You can get specific file using this function. get_template_part('template-parts/layout'); Include layout.php file from template-parts subdirectory placed in the root of your theme folder.
from urllib.request import urlopen from collections import Counter import re conn = urlopen('http://textfiles.com/100/dodontae.hum') lines = conn.readlines() conn.close() # readlines() returns byte strings data = ''.join([line.decode('utf-8') for line in lines]) # replace non-letters ...
Fibonacci Numbers are a prime subject for dynamic programming as the traditional recursive approach makes a lot of repeated calculations. In these examples I will be using the base case of f(0) = f(1) = 1. Here is an example recursive tree for fibonacci(4), note the repeated computations: Non-Dy...
As we can add multiple elements in Cart array and then add it to cart session, but there are 4 basic elements which Cart class requires to add data successfully in cart session. id (string) qty (number) price (number, decimal) name (String) And if you want to add more options regardin...
To specify Contact and Address info for an Employee, you should always invoke Select() method on the Contact and Address data views prior to assigning any field values. It is also recommended to assign the result of Select() method to the Contact and Address data views' Current property to guarantee...

Page 40 of 42