Tutorial by Examples: n

Nightwatch accepts a second globals.json configuration file which injects data into the test runner itself, very similar to how Meteor.settings makes data from the command line available throughout the app. globals.json { "default" : { "url" : "http://localhost:300...
Readable streams can be "piped," or connected, to writable streams. This makes data flow from the source stream to the destination stream without much effort. var fs = require('fs') var readable = fs.createReadStream('file1.txt') var writable = fs.createWriteStream('file2.txt') rea...
NDB relates models as python objects, which can be stored and accessed in the Appengine NoSQL datastore, available to all AppEngine applications. models.py from google.appengine.ext import ndb # https://cloud.google.com/appengine/docs/python/ndb/properties class Series(ndb.Model): &qu...
The first part of this example explains how to implement it. In the second, I will explain how it works. This tries to be a general example. The template for the map (see step 3) and the example functions are fully customizable. ################################# IMPLEMENTATION #####################...
Helpers should extend from Mage_Core_Helper_Abstract: # File: app/code/local/Vendor/Package/Helper/Data.php class Vendor_Package_Helper_Data extends Mage_Core_Helper_Abstract { public function multiply($a, $b) { return $a * $b; } } To be able to access is via Mage::hel...
Radio Buttons allow you to let the user choose one element of those given. There are two ways to declare a RadioButton with a text besides it. Either by using the default constructor RadioButton() and setting the text with the setText(String) method or by using the other constructor RadioButton(Stri...
A ToggleGroup is used to manage the RadioButtons so that just one in each group can be selected at each time. Create a simple ToggleGroup like following: ToggleGroup group = new ToggleGroup(); After creating a Togglegroup it can be assigned to the RadioButtons by using setToggleGroup(ToggleGrou...
Typically, when one of the RadioButtons in a ToggleGroup is selected the application performs an action. Below is an example which prints the user data of the selected RadioButton which has been set with setUserData(Object). radioButton1.setUserData("awesome") radioButton2.setUserData(&q...
Let's say the second RadioButton out of three is pre-selected with setSelected(Boolean), the focus is still at the first RadioButton by default. To change this use the requestFocus() method. radioButton2.setSelected(true); radioButton2.requestFocus();
Sometimes we need a visual hint to indicate the return status of previous command. The following snippet make put it at the head of the PS1. Note that the __stat() function should be called every time a new PS1 is generated, or else it would stick to the return status of last command of your .bashr...
Open Storyboard where you have your ViewController with TableView: Add prototype cell (if there is no cell added before): Customize cell as you want (in my case there is custom UIImage and Label): Remember to set height of the cell. To do it select your whole TableView and from the Properties...
[root@localhost ~]# docker run -it -v /data --name=vol3 8251da35e7a7 /bin/bash root@d87bf9607836:/# cd /data/ root@d87bf9607836:/data# touch abc{1..10} root@d87bf9607836:/data# ls abc1 abc10 abc2 abc3 abc4 abc5 abc6 abc7 abc8 abc9
[root@localhost ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d87bf9607836 8251da35e7a7 "/bin/bash" About a minute ago Up 31 seconds vol3 [r...
[root@localhost ~]# docker inspect d87bf9607836 "Mounts": [ { "Name": "cdf78fbf79a7c9363948e133abe4c572734cd788c95d36edea0448094ec9121c", "Source": "/var/lib/docker/volumes/cdf78fbf79a7c9363948e133abe4c572734cd788c95d36edea0448094ec9121c/_data&quot...
[root@localhost ~]# docker run -it --volumes-from vol3 8251da35e7a7 /bin/bash root@ef2f5cc545be:/# ls bin boot data dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var root@ef2f5cc545be:/# ls /data abc1 abc10 abc2 abc3 abc4 abc5 abc6 abc7...
[root@localhost ~]# docker run -it -v /etc:/etc1 8251da35e7a7 /bin/bash Here: /etc is host machine directory and /etc1 is the target inside container
//create a component that will be injected trait TimeUtil { lazy val timeUtil = new TimeUtilImpl() class TimeUtilImpl{ def now() = new DateTime() } } //main controller is depended on time util trait MainController { _ : TimeUtil => //inject time util into main...
var http = require('http'); var fs = require('fs'); var path = require('path'); http.createServer(function (request, response) { console.log('request ', request.url); var filePath = '.' + request.url; if (filePath == './') filePath = './index.html'; var extname = String(path.extnam...
// Website you wish to allow to connect to response.setHeader('Access-Control-Allow-Origin', '*'); // Request methods you wish to allow response.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); // Request headers you wish to allow response.setHeader('Acce...
While each mobile platforms do offer their own settings management api, there are no built in ways to read settings from a good old .net style app.config xml file; This is due to a bunch of good reasons, notably the .net framework configuration management api being on the heavyweight side, and each...

Page 668 of 1088