Tutorial by Examples: app

Components define their own Messages, sent after emitted DOM Events, eg. CounterMsg from Parent-child communication type CounterMsg = Increment | Decrement | Reset The view of this component will send messages of CounterMsg type, therefore the view type signature is Html CounterMs...
To build a Rails application that will be an API server, you can start with a more limited subset of Rails in Rails 5. To generate a new Rails API app: rails new my_api --api What --api does is to remove functionality that is not needed when building an API. This includes sessions, cookies, ass...
Codeigniter may be configured to run more than one project without duplicating CI core files. It's possible by splitting CI Application side. For example let's take project of website, which contains front-end and back-end Content Management System (CMS) applications. In this case CI folder struct...
We try to extract imdb top chart movies and ratings R> library(RCurl) R> library(XML) R> url <- "http://www.imdb.com/chart/top" R> top <- getURL(url) R> parsed_top <- htmlParse(top, encoding = "UTF-8") R> top_table <- readHTMLTable(parsed_top)[...
Similar to currying, partial application is used to reduce the number of arguments passed to a function. Unlike currying, the number need not go down by one. Example: This function ... function multiplyThenAdd(a, b, c) { return a * b + c; } ... can be used to create another function that...
Join parent objects with their child entities, for example we want a relational table of each person and their hobbies DECLARE @json nvarchar(1000) = N'[ { "id":1, "user":{"name":"John"}, "hobbies":[ {...
A simplest Oozie application is consists of a workflow logic file (workflow.xml), workflow properties file (job.properties/job.xml) and required JAR files, scripts and configuration files. Except the workflow properties file, all the other files should to be stored in a HDFS location. The workflow p...
Once your project has been created, you can launch the app by typing $ sails lift By default, you can access the app in the browser on port 1337. The URL with the port is shown in the terminal. Another way to start the Sails app is with the node command: $ node app.js However, you lose some...
If you only need a given resource for a specific control, you can make it more local by adding it to this specific control, instead of the window. It works exactly the same way, the only difference being that you can now only access from inside the scope of the control where you put it: <StackPa...
By Code-First convention, Entity Framework creates a column for every public property that is of a supported data type and has both a getter and a setter. [NotMapped] annotation must be applied to any properties that we do NOT want a column in a database table for. An example of a property that we ...
Active Patterns can be used to make calling some .NET API's feel more natural, particularly those that use an output parameter to return more than just the function return value. For example, you'd normally call the System.Int32.TryParse method as follows: let couldParse, parsedInt = System.Int32....
Let's say you need to check if an email address appears in a long list of email addresses. Use the MATCH function to return the row number on which the email address can be found. If there is no match, the function returns an #N/A error. =MATCH(F2,$D$2:$D$200,0) The value you're retrieving ...
Overall the easiest way to work with JSON is to have a case class mapping directly to the JSON (same fields name, equivalent types, etc.). case class Person( name: String, age: Int, hobbies: Seq[String], pet: Pet ) case class Pet( name: String, `type`: String ) // these...
You want to convert all elements in an array to some other form. For example, you have theUsers = [ {id: 1, username: 'john'} {id: 2, username: 'lexy'} {id: 3, username: 'pete'} ] and you want to have an array of usernames only, i.e. ['john', 'lexy', 'pete'] Method 1 - using .map ...
The example below will collect the Device's OS version number and the the version of the application (which is defined in each projects' properties) that is entered into Version name on Android and Version on iOS. First make an interface in your PCL project: public interface INativeHelper { /...
You have to create a different strings.xml file for every new language. Right-click on the res folder Choose New → Values resource file Select a locale from the available qualifiers Click on the Next button (>>) Select a language Name the file strings.xml strings.xml <resources&...
To bootstrap a new Erlang project, simply choose the template you want to use from the list. The available templates can be retrieved by the following command: $ rebar3 new app (built-in): Complete OTP Application structure cmake (built-in): Standalone Makefile for building C/C++ in c_src escr...
Make sure you are in the directory that contains your Rails app, then create an app on Heroku. $ heroku create example Creating ⬢ example... done https://example.herokuapp.com/ | https://git.heroku.com/example.git The first URL of the ouput, http://example.herokuapp.com, is the location the ap...
Using start option npm start Using Nodemon nodemon Using forever forever start 'js file name' To stop in forever forever stop ''js file name' To restart in forever forever restart 'js filename' List the server ruuning using forever forever list

Page 12 of 33