Tutorial by Examples: app

Meteor has several sample apps built-in. You can create a project with one of them and learn from how it was built. To create a sample app, install Meteor (see Getting Started) and then type: meteor create --example <app name> For example to create a sample todos app, write: meteor create...
This example comes from the official document. Suppose you have a python application using redis as backend. After writing Dockerfile, create a docker-compose.yml file like this: version: '2' services: web: build: . ports: - "5000:5000" volumes: - .:/code ...
The following code is based on the examples provided by the documentation on std::net::TcpListener. This server application will listen to incoming requests and send back all incoming data, thus acting as an "echo" server. The client application will send a small message and expect a reply...
To make express web application modular use router factories: Module: // greet.js const express = require('express'); module.exports = function(options = {}) { // Router factory const router = express.Router(); router.get('/greet', (req, res, next) => { res.end(options....
This example assumes you have already installed Java and Gradle. Use the following project structure: src/ main/ java/ com/ example/ Application.java build.gradle build.gradle is your build script for Gradle build system with the following content: buildscri...
To apply the last stash and remove it from the stack - type: git stash pop To apply specific stash and remove it from the stack - type: git stash pop stash@{n}
Applies the last stash without removing it from the stack git stash apply Or a specific stash git stash apply stash@{n}
Example that builds an executable (editor) and links a library (highlight) to it. Project structure is straightforward, it needs a master CMakeLists and a directory for each subproject: CMakeLists.txt editor/ CMakeLists.txt src/ editor.cpp highlight/ CMakeLists.txt in...
The editor.apply() method is asynchronous, while editor.commit() is synchronous. Obviously, you should call either apply() or commit(). 2.3 SharedPreferences settings = getSharedPreferences(PREFS_FILE, MODE_PRIVATE); SharedPreferences.Editor editor = settings.edit(); editor.putBoolean(PREF_CONS...
By default, Interface Builder doesn't accept the CGColor datatype, so to allow adding a CGColor using user defined attributes in interface builder; one may want to use an extension like this: Swift Extension : extension CALayer { func borderUIColor() -> UIColor? { return borderCol...
Ember CLI allows you to use one of two options to generate a new app: Create a folder and run ember init (generates application structure and sets up git and makes your first commit) Run ember new <app name> (creates a folder with the specified name, steps into it and runs ember init) O...
package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; public class Main extends Sprite { //Document Class Main Constructor public function Main() { ...
You can specify different application IDs or package names for each buildType or productFlavor using the applicationIdSuffix configuration attribute: Example of suffixing the applicationId for each buildType: defaultConfig { applicationId "com.package.android" minSdkVersion 17 ...
Extension methods can be used for writing strongly typed wrappers for dictionary-like objects. For example a cache, HttpContext.Items at cetera... public static class CacheExtensions { public static void SetUserInfo(this Cache cache, UserInfo data) => cache["UserInfo"] ...
Sometimes, programmers who are new Java will use primitive types and wrappers interchangeably. This can lead to problems. Consider this example: public class MyRecord { public int a, b; public Integer c, d; } ... MyRecord record = new MyRecord(); record.a = 1; // OK ...
Use this option if you don't need an Application subclass. This is the simplest option, but this way you can't provide your own Application subclass. If an Application subclass is needed, you will have to switch to one of the other options to do so. For this option, simply specify the fully-quali...
Use this option if your project requires an Application subclass. Specify this Application subclass using the android:name property in the manifest file inside the application tag. In the Application subclass, add the attachBaseContext() method override, and in that method call MultiDex.install():...
Set the MONGO_URL environment variable before starting your local Meteor app. Linux/MacOS Example: MONGO_URL="mongodb://some-mongo-host.com:1234/mydatabase" meteor or export MONGO_URL="mongodb://some-mongo-host.com:1234/mydatabase" meteor Windows Example Note: don't u...
Solution 1: $('#parent').append($('#child')); Solution 2: $('#child').appendTo($('#parent')); Both solutions are appending the element #child (adding at the end) to the element #parent. Before: <div id="parent"> <span>other content</span> </div> <d...
A commonly used CSS/Javascript library is Bootstrap. To install it into your Aurelia CLI driven application first you need to install it using Npm. npm install bootstrap --save Because Bootstrap has a hard dependency on jQuery, we need to make sure we also have jQuery installed: npm install jqu...

Page 4 of 33