Tutorial by Examples: ti

package main import "fmt" func mergeSort(a []int) []int { if len(a) < 2 { return a } m := (len(a)) / 2 f := mergeSort(a[:m]) s := mergeSort(a[m:]) return merge(f, s) } func merge(f []int, s []int) []int { var i, j int size :...
Steps: clone the gradle-script-kotlin project copy/paste from the cloned project to your project: build.gradle.kts gradlew gradlew.bat settings.gradle update the content of the build.gradle.kts based on your needs, you can use as inspiration the scripts in the project just clo...
Not all libraries are defined in a way that is compatible with AMD and RequireJS's define() function. The author's have addressed this by including a shim directive for configuring those dependencies. One example is using the jQuery UI Layout Plugin. That plugin depends on jQuery. You can configu...
Parts of template can be displayed conditionally. If statement is used for this purpose. It's similar to if statement in programing languages. Contents of block are executed/displayed if an expression evaluates to true. {% if enabled == false %} Disabled {% endif %} Disabled will be displ...
As of Ruby 2.4.0, you can start an interactive IRB session inside any Ruby script using these lines: require 'irb' binding.irb This will start an IBR REPL where you will have the expected value for self and you will be able to access all local variables and instance variables that are in scope....
Detailed instructions on getting corona set up or installed.
CloudCannon offers hosting and a CMS for Jekyll applications. Here are the steps in hosting your Jekyll application on CloudCannon (http://cloudcannon.com). Without version control: Create your blog locally using some local files and jekyll serve Create a CloudCannon account and create a new si...
SWIFT: Getting an instance of UIStoryboard programmatically can be done as follows: let storyboard = UIStoryboard(name: "Main", bundle: nil) where: name => the name of the storyboard without the extension bundle => the bundle containing the storyboard file and its relate...
A basic principle of functional programming is that it avoids changing the application state (statelessness) and variables outside it's scope (immutability). Pure functions are functions that: with a given input, always return the same output they do not rely on any variable outside their scope...
RTL (Right-to-left) support is an essential part in planning for i18n and L10n. Unlike English language which is written from left to right, many languages like Arabic, Japanese, Hebrew, etc. are written from right to left. To appeal to a more global audience, it is a good idea to plan your layouts ...
Starting SDK 17 (Android 4.2), RTL support was added in Android layouts and is an essential part of localization. Going forward, the left/right notation in layouts should be replaced by start/end notation. If, however, your project has a minSdk value less than 17, then both left/right and start/end ...
To test if the layouts that have been created are RTL compatible, do the following : Go to Settings -> Developer options -> Drawing -> Force RTL layout direction Enabling this option would force the device to use RTL locales and you can easily verify all parts of the app for RTL suppo...
The first step for coding for localization is to create default resources. This step is so implicit that many developers do not even think about it. However, creating default resources is important because if the device runs on an unsupported locale, it would load all of its resources from the defau...
To provide translations in other languages (locales), we need to create a strings.xml in a separate folder by the following convention : res/values-<locale>/strings.xml An example for the same is given below: In this example, we have default English strings in the file res/values/string...
Creating language specific layouts is often unnecessary if you have specified the correct start/end notation, as described in the earlier example. However, there may be situations where the defaults layouts may not work correctly for certain languages. Sometimes, left-to-right layouts may not transl...
First method - Concatenation of strings The simplest method to plot multiple data files is to insert a for loop inside the plot command of gnuplot. Assuming you have N files named sequently, i.e. file_1.dat file_2.dat file_3.dat ... file_N.dat Executing the command plot for[i = 1:N] &quot...
Easy Install Go to http://pharo.org/download and select a fitting download and run it. Details There are a lot of different ways to install Pharo. Pharo itself consists of a vm and an image. In addition it needs its sources and plugins, and has some dependencies: It is a cross-platform environ...
From the gnuplot 5.0 official online documentation: The command language of gnuplot is case sensitive, i.e. commands and function names written in lowercase are not the same as those written in capitals. All command names may be abbreviated as long as the abbreviation is not ambiguous. Any number...
This shows how to create the demo database used in big parts of Progress documentation: sports2000. This assumes you have installed the Progress products with at least one type of database license. Run proenv script/bat-file that will give you a prompt with all environment variables set. Create ...
/* These variables are declared with `NO-UNDO`. That state...

Page 414 of 505