Tutorial by Examples: ci

We can easily separate distribution specific tasks and variables into different dedicated .yml files. Ansible helps us to automatically identify the target hosts distribution via {{ ansible_distribution }} and {{ ansible_distribution_version }}, so we just have to name the distribution dedicated .y...
Create a new httpHandler inside your ASP.NET project. Apply the following code (VB) to the handler file: Public Class AttachmentDownload Implements System.Web.IHttpHandler Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest ' pass an ID thr...
Const baseString As String = "Foo Bar" 'Get the string starting at character 2 and ending at character 6 Dim midText As String midText = Mid$(baseString, 2, 5) 'midText = "oo Ba"
Starting out: HTML <table id='my-table' width='960' height='500'></table> JS var data = [ { type: "Name", content: "John Doe" }, { type: "Birthdate", content: "01/01/1970" }, { type: "Salary", content: "$40,000,0...
using System; namespace TypeConversionApplication { class ExplicitConversion { static void Main(string[] args) { double d = 5673.74; int i; // cast double to int. i = (int)d; Console.WriteLine(i); Cons...
Don't you hate it when interfaces pollute you class with too many members you don't even care about? Well I got a solution! Explicit Implementations public interface IMessageService { void OnMessageRecieve(); void SendMessage(); string Result { get; set; } int Encoding { get; se...
Lazy evaluation means Haskell will evaluate only list items whose values are needed. The basic recursive definition is: f (0) <- 0 f (1) <- 1 f (n) <- f (n-1) + f (n-2) If evaluated directly, it will be very slow. But, imagine we have a list that records all the results, fibs ...
Circe provides compile-time derived codecs for en/decode json into case classes. A simple example looks like this: import io.circe._ import io.circe.generic.auto._ import io.circe.parser._ import io.circe.syntax._ case class User(id: Long, name: String) val user = User(1, "John Doe&qu...
Coming from imperative languages many developers wonder how to write a for-loop that exits early as F# doesn't support break, continue or return. The answer in F# is to use tail-recursion which is a flexible and idiomatic way to iterate while still providing excellent performance. Say we want to ...
Inheritance the a fundamental mechanism of CSS by which the computed values of some properties of an element are applied to its' children. This is particularly useful when you want to set a global style to your elements rather than having to set said properties to each and every element in your mark...
Simple item insertion can be done with Array.prototype.splice method: arr.splice(index, 0, item); More advanced variant with multiple arguments and chaining support: /* Syntax: array.insert(index, value1, value2, ..., valueN) */ Array.prototype.insert = function(index) { this.splice.a...
The <see> tag can be used to link to another class. It contains the cref member which should contain the name of the class that is to be referenced. Visual Studio will provide Intellsense when writing this tag and such references will be processed when renaming the referenced class, too. /// ...
Read the accelerometer Sensor with precision. This example allocates memory: void Update() { //Get Precise Accelerometer values Vector3 accelValue = preciseAccelValue(); Debug.Log("PRECISE X: " + accelValue.x + " Y: " + accelValue.y + " Z: " + acc...
CAShapeLayer *circle = [CAShapeLayer layer]; [circle setPath:[[UIBezierPath bezierPathWithOvalInRect:CGRectMake(100, 100, 150, 150)] CGPath]]; [circle setStrokeColor:[[UIColor blueColor] CGColor]]; [circle setFillColor:[[UIColor clearColor] CGColor]]; [[self....
<svg width="900px" height="400px" viewBox="900 400"> <defs> <filter id="GaussianHardEdge" x="0%" y="0%" width="100%" height="100%"> <feGaussianBlur stdDeviation="5"/&gt...
In an enum it is possible to define a specific behavior for a particular constant of the enum which overrides the default behavior of the enum, this technique is known as constant specific body. Suppose three piano students - John, Ben and Luke - are defined in an enum named PianoClass, as follows:...
Sometimes it is desirable to evaluate a nullable expression in an if-else fashion. The elvis operator, ?:, can be used in Kotlin for such a situation. For instance: val value: String = data?.first() ?: "Nothing here." The expression above returns "Nothing here" if data?.firs...
select '123' * 2; To make the multiplication with 2 MySQL automatically converts the string 123 into a number. Return value: 246 The conversion to a number starts from left to right. If the conversion is not possible the result is 0 select '123ABC' * 2 Return value: 246 select 'A...
What's an image sprite? An image sprite is a single asset located within an image sprite sheet. An image sprite sheet is an image file that contains more than one asset that can be extracted from it. For example: The image above is an image sprite sheet, and each one of those stars is a sprite...
With the power of regex comes great responsibility.... db.posts.find({'text': /.*foo.*|.*bar.*/i})

Page 16 of 42