Tutorial by Examples

Containers in the same docker network have access to exposed ports. docker network create sample docker run --net sample --name keys consul agent -server -client=0.0.0.0 -bootstrap Consul's Dockerfile exposes 8500, 8600, and several more ports. To demonstrate, run another container in the same ...
Networks can be specified in a compose file (v2). By default all the containers are in a shared network. Start with this file: example/docker-compose.yml: version: '2' services: keys: image: consul command: agent -server -client=0.0.0.0 -bootstrap test: image: alpine tty...
The docker --link argument, and link: sections docker-compose make aliases to other containers. docker network create sample docker run -d --net sample --name redis redis With link either the original name or the mapping will resolve the redis container. > docker run --net sample --link red...
One to Many mapping is generally simply a bidirectional relationship of Many to One mapping. We will take same example that we took for Many to one mapping. Employee.java @Entity public class Employee { @TableGenerator(name = "employee_gen", table = "id_gen", pkColumnNa...
Exporting data from employees table to /tmp/ca_employees INSERT OVERWRITE LOCAL DIRECTORY '/tmp/ca_employees' SELECT name, salary, address FROM employees WHERE se.state = 'CA'; Exporting data from employees table to multiple local directories based on specific condition The below query shows how ...
Employee Entity @Entity public class Employee { @TableGenerator(name = "employee_gen", table = "id_gen", pkColumnName = "gen_name", valueColumnName = "gen_val", allocationSize = 1) @Id @GeneratedValue(strategy = GenerationType.TABLE, generat...
Employee entity. package com.thejavageek.jpa.entities; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Joi...
Vim has special operators to match word beginning, word, end, and so forth.\< represents the beginning of a word and \> represents the end of a word. Searching for /\<foo\> in the following text will only return the last foo. football is not foolish foo
defmodule Demo do def foo do 1..10 |> Enum.map(&(&1 * &1)) |> p |> Enum.filter(&rem(&1, 2) == 0) |> p |> Enum.take(3) |> p end defp p(e) do require Logger Logger.debug inspect e, limit: :infinity...
defmodule Demo do def foo do 1..10 |> Enum.map(&(&1 * &1)) |> Enum.filter(&rem(&1, 2) == 0) |> pry |> Enum.take(3) end defp pry(e) do require IEx IEx.pry e end end iex(1)> Demo.foo Request to pry #PID<0.117...
The following configuration can be used as a base config for bundling up your project as a library. Notice how the module config contains a list of preLoaders and loaders. // webpack.config.js var path = require('path'); module.exports = { entry: path.join(__dirname, '..', 'src/index.js...
Example code : In main.html <template name="test"> <input type="checkbox" id="checkbox1" name="name" value="data">Check Me {{showData}} </template> In Main.js var check_status=''; //Reactive Var Initialization...
Express router allows you to create multiple "mini apps" so you can namespace your api, public, auth and other routes into separate routing systems. var express = require('express'); var app = express(); var router = express.Router(); router.get('/', function(req, res){ ...
Prereqs: Selenium and required Browser Drivers are installed (Available in Nuget) NUnit has been installed in VS and added to the project using NUnit.Framework; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using OpenQA.Selenium.Firefox; using OpenQA.Selenium.IE; using System; [...
Here's how to create an Express server and serve index.html by default (empty path /), and page1.html for /page1 path. Folder structure project root | server.js |____views | index.html | page1.html server.js var express = require('express'); var path = require('path')...
To use an Asset Catalog, you need to do the following: Double-click the Info.plist file in the Solution Explorer to open it for editing. Scroll down to the App Icons section. From the Source dropdown list, ensure AppIcons is selected. From the Solution Explorer, double-click the Assets.xcasset...
First we can specify the directories of header files by include_directories(), then we need to specify the corresponding source files of the target executable by add_executable(), and be sure there's exactly one main() function in the source files. Following is a simple example, all the files are a...
If you have a moment object you can use add and substract to manipulate it or set any property of the time directly moment("2016-01-01").add(1, 'year').format('YYYY-MM-DD') // -> "2017-01-01" Or use .day(), .month(), .year(), .seconds(), .milliseconds() to set those val...
You can use moment to parse date strings. By default moment tries to parse the date as an ISO-8601 string and if that does not work falls back to the browsers new Date(). Since the way that browsers construct dates varies it is best to try not to fall back to this. moment('2016-02-04').format('YYY...
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. //Declare the search bar and add it to the header of the table searchBar = new UISearchBar(); searchBar.SizeToFit(); ...

Page 894 of 1336