R-markdown code chunks
R-markdown is a markdown file with embedded blocks of R code called chunks. There are two types of R code chunks: inline and block.
Inline chunks are added using the following syntax:
`r 2*2`
They are evaluated and inserted their output answer in place.
Block chunks hav...
Preemptive basic authentication is the practice of sending http basic authentication credentials (username and password) before a server replies with a 401 response asking for them. This can save a request round trip when consuming REST apis which are known to require basic authentication.
As descr...
Using HttpClient as RestTemplate's underlying implementation to create HTTP requests allows for automatic handling of basic authentication requests (an http 401 response) when interacting with APIs. This example shows how to configure a RestTemplate to achieve this.
// The credentials are stored he...
<?php
//Create a new SQLite3 object from a database file on the server.
$database = new SQLite3('mysqlitedb.db');
//Query the database with SQL
$results = $database->query('SELECT bar FROM foo');
//Iterate through all of the results, var_dumping them onto the page
while ($row = $resu...
Using core debugger
Node.js provides a build in non graphical debugging utility. To start the build in the debugger, start the application with this command:
node debug filename.js
Consider the following simple Node.js application contained in the debugDemo.js
'use strict';
function addTwoN...
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...
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();
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 ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d87bf9607836 8251da35e7a7 "/bin/bash" About a minute ago Up 31 seconds vol3
[r...
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 ...
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...
Don't want your columns to simply stack in smaller devices? Use the extra small and medium device grid classes by adding .col-xs-* .col-md-* to your columns. See the example below for a better idea of how it all works.
<!-- Stack the columns on mobile by making one full-width and the other half-...
Build on the previous example by creating even more dynamic and powerful layouts with tablet .col-sm-* classes.
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-8">.col-xs-12 .col-sm-6 .col-md-8</div>
<div class="col-xs-6 col-md-4">...