Tutorial by Examples: ci

You can create a UIColor from a hexadecimal number or string, e.g. 0xff00cc, "#FFFFFF" Swift Int Value extension UIColor { convenience init(hex: Int, alpha: CGFloat = 1.0) { let r = CGFloat((hex >> 16) & 0xff) / 255 let g = CGFloat((hex >> 08) &amp...
Spacemacs is a distribution of emacs that comes with a lot of packages preconfigured and easily installed. Also, it is very friendly for those who are familiar with vim style of editing. Spacemacs provides a CIDER-based Clojure layer. To install and configure it for use with Clojure, first install ...
Note: You can skip this part if your server uses HTTPS to serve content and jump to Application Setup guide. If your app targets iOS 9 and your server uses HTTPS to serve content, you don’t need to sign the file. If not (e.g. when supporting Handoff on iOS 8), it has to be signed using a SSL certif...
To obtain a reference to a KClass object representing some class use double colons: val c1 = String::class val c2 = MyClass::class
Functions are first-class citizens in Kotlin. You can obtain a reference on it using double colons and then pass it to another function: fun isPositive(x: Int) = x > 0 val numbers = listOf(-2, -1, 0, 1, 2) println(numbers.filter(::isPositive)) // [1, 2]
ansible-playbook -i path/to/static-inventory-file -l myhost myplaybook.yml
ansible-playbook -i path/to/dynamic-inventory-script.py -l myhost myplaybook.yml See dynamic inventory for more details.
var a:Number=0.123456789; trace(a); // 0.123456789 trace(a.toPrecision(4)); // 0.1235 trace(a.toFixed(4)); // 0.1235 trace(a.toExponential(4)); // 1.2345e-1 trace(a.toString(16)); // 0 - works for integer part only var b:Number=12345678.9876543; // a bigg...
In all serious Prolog systems, association lists are available to allow faster than linear access to a collection of elements. These association lists are typically based on balanced trees like AVL trees. There is a public domain library called library(assoc) that ships with many Prolog systems and ...
You can use the Substring method to get any number of characters from a string at any given location. However, if you only want a single character, you can use the string indexer to get a single character at any given index like you do with an array: string s = "hello"; char c = s[1]; //...
To get version 5394 use: svn co --revision r5394 https://svn.example.com/svn/MyRepo/MyProject/trunk Or the shorter version: svn co -r 5394 https://svn.example.com/svn/MyRepo/MyProject/trunk Or by using pegged revisions: svn co https://svn.example.com/svn/MyRepo/MyProject/trunk@5394 If al...
In the timeline of any DisplayObject that is attached as a descendant of the display tree, you can utilise the root property. This property points to the main timeline in the case of no custom document class, or the document class if you do define one. Because root is typed DisplayObject, the compi...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <circle r="30" cx="100" cy="100" fill="#ff0000" stroke="#00ff00" /> <rect x="200" y="200" width="50&...
This type of association allows an ActiveRecord model to belong to more than one kind of model record. Common example: class Human < ActiveRecord::Base has_one :address, :as => :addressable end class Company < ActiveRecord::Base has_one :address, :as => :addressable end cl...
CSS: div{ width: 200px; height: 200px; background: teal; clip-path: circle(30% at 50% 50%); /* refer remarks before usage */ } HTML <div></div> This example shows how to clip a div to a circle. The element is clipped into a circle whose radius is 30% based on the dim...
String#replace can have a function as its second argument so you can provide a replacement based on some logic. "Some string Some".replace(/Some/g, (match, startIndex, wholeString) => { if(startIndex == 0){ return 'Start'; } else { return 'End'; } }); // will retur...
To enable a certain CORS policy for specific controllers you have to build the policy in the AddCors extension within the ConfigureServices method: services.AddCors(cors => cors.AddPolicy("AllowAll", policy => { policy.AllowAnyOrigin() .AllowAnyMethod() ...
The policy builder allows you to build sophisticated policies. app.UseCors(builder => { builder.WithOrigins("http://localhost:5000", "http://myproductionapp.com") .WithMethods("GET", "POST", "HEAD") .WithHeaders(&quo...
Let's say we have a simple table called person: CREATE TABLE person ( person_id BIGINT, name VARCHAR(255). age INT, city VARCHAR(255) ); The most basic insert involves inserting all values in the table: INSERT INTO person VALUES (1, 'john doe', 25, 'new york'); If you wa...
You can write the default protocol implementation for a specific class. protocol MyProtocol { func doSomething() } extension MyProtocol where Self: UIViewController { func doSomething() { print("UIViewController default protocol implementation") } } class M...

Page 10 of 42