Tutorial by Examples: st

In the following, we are creating an example of an Aurelia Custom Element which will allow you to display Youtube videos via their video ID. An Aurelia Custom Element can be defined in two different ways: the first one is by creating a viewmodel and accompanying view, the second one is by just cre...
A basic custom element is created in Aurelia based on naming conventions, by simply adding the suffix CustomElement to the name of a class. This suffix will automatically be stripped out by Aurelia. The remaining part of the class name will be lowercased and separated using a hyphen and can then be ...
Let's suppose we have a reference to the JQuery type definition and we want to extend it to have additional functions from a plugin we included and which doesn't have an official type definition. We can easily extend it by declaring functions added by plugin in a separate interface declaration with ...
Installation npm install -D webpack typescript ts-loader webpack.config.js module.exports = { entry: { app: ['./src/'], }, output: { path: __dirname, filename: './dist/[name].js', }, resolve: { extensions: ['', '.js', '.ts'], }, module: { loaders: [...
Detailed instructions on getting mvvmcross set up or installed.
In this code example, the char pointer p is initialized to the address of a string literal. Attempting to modify the string literal has undefined behavior. char *p = "hello world"; p[0] = 'H'; // Undefined behavior However, modifying a mutable array of char directly, or through a poin...
Detailed instructions on getting resharper set up or installed.
let strings = "bananas,apples,pear".split(","); split returns an iterator. for s in strings { println!("{}", s) } And can be "collected" in a Vec with the Iterator::collect method. let strings: Vec<&str> = "bananas,apples,pear"....
Python has only limited support for parsing ISO 8601 timestamps. For strptime you need to know exactly what format it is in. As a complication the stringification of a datetime is an ISO 8601 timestamp, with space as a separator and 6 digit fraction: str(datetime.datetime(2016, 7, 22, 9, 25, 59, 55...
Given a JList like JList myList = new JList(items); the selected items in the list can be modified through the ListSelectionModel of the JList: ListSelectionModel sm = myList.getSelectionModel(); sm.clearSelection(); // clears the selection sm.setSelectionInterval(inde...
This example adds a list of places with image and name by using an ArrayList of custom Place objects as dataset. Activity layout The layout of the activity / fragment or where the RecyclerView is used only has to contain the RecyclerView. There is no ScrollView or a specific layout needed. <?x...
Install JDK 8 (Windows, Linux) and set the path (Windows). Install Scala (Linux), For Windows visit http://www.scala-lang.org/download/ download and install binary distribution, set the environment variable for scala in PATH which is in \scala\bin. Installing Typesafe activator (It contains Scal...
Constructor overloading is not available in As3. In order to provide a different way to retrieve an instance of a class, a public static method can be provided to serve as an alternative "constructor". An example for that is flash.geom.Point, which represents a 2D point object. The coor...
The most common way to install the RSpec gem is using Bundler. Add this line to your application's Gemfile: gem 'rspec' And then execute bundle to install the dependencies: $ bundle Alternatively, you can install the gem manually: $ gem install rspec After installing the gem, run the fol...
import flash.net.URLRequest; import flash.media.Sound; import flash.media.SoundChannel; import flash.events.Event; var snd:Sound; = new Sound(); var sndChannel:SoundChannel var sndTimer:Timer; snd.addEventListener(Event.COMPLETE, soundLoaded); snd.load(new URLRequest("soundFile.mp3&...
package { import flash.events.EventDispatcher; public class AbstractDispatcher extends EventDispatcher { public function AbstractDispatcher(target:IEventDispatcher = null) { super(target); } } } To dispatch an event on an instance: var dispatcher:AbstractDispatcher =...
Prerequisites sudo apt-get install build-essential sudo apt-get install python [optional] sudo apt-get install git Get source and build cd ~ git clone https://github.com/nodejs/node.git OR For the latest LTS Node.js version 6.10.2 cd ~ wget https://nodejs.org/dist/v6.3.0/node-v6.10....
This is a short summary of the GitLab guide on Install a GitLab CE Omnibus package. Requirements In order to install the GitLab Community Edition on your server, you should read the requirements page. To make it brief, the recommended requirements are: OS: Ubuntu, Debian, CentOS, RHEL Ruby ver...
A class in Scala is a 'blueprint' of a class instance. An instance contains the state and behavior as defined by that class. To declare a class: class MyClass{} // curly braces are optional here as class body is empty An instance can be instantiated using new keyword: var instance = new MyClas...
The only way to catch exception in initializer list: struct A : public B { A() try : B(), foo(1), bar(2) { // constructor body } catch (...) { // exceptions from the initializer list and constructor are caught here // if no exception is thrown h...

Page 69 of 369