Tutorial by Examples

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...
As per Wiki : In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is required to create exactly one object to coordinate actions across the system. class Singleton { // Private constructor so it can not be arbitra...
Express passes a next callback to every route handler and middleware function that can be used to break logic for single routes across multiple handlers. Calling next() with no arguments tells express to continue to the next matching middleware or route handler. Calling next(err) with an error will ...
These classes increase the left margin of a column by * columns. For example, .col-md-offset-4 moves .col-md-4 over four columns. <div class="row"> <div class="col-lg-4"></div> <div class="col-lg-4 col-lg-offset-4"></div> </div&g...
Sending email is pretty simple in Go. It helps to understand the RFC 822, which specifies the style an email need to be in, the code below sends a RFC 822 compliant email. package main import ( "fmt" "net/smtp" ) func main() { // user we are authorizing as ...
func bufferedUnbufferedExample(buffered bool) { // We'll declare the channel, and we'll make it buffered or // unbuffered depending on the parameter `buffered` passed // to this function. var ch chan int if buffered { ch = make(chan int, 3) } else { ch...

Page 820 of 1336