Tutorial by Examples: er

Consider a one to one bidirectional relationship between employee and desk. Employee.java @Entity public class Employee { @TableGenerator(name = "employee_gen", table = "id_gen", pkColumnName = "gen_name", valueColumnName = "gen_val", allocationSize...
r.connect({host: 'localhost', port: 28015}) .then((conn) => { return r.db("stackoverflow").table("examples") .insert({ // If `id` is not set, will automatically generate a UUID id: 1, name: 'Thinker', // Wi...
r.connect({host: 'localhost', port: 28015}) .then((conn) => { // Can also use .get({id: 1}) return r.db("stackoverflow").table("examples").get(1).run(conn) }).then((result) => { console.log(result); })
Often you will want to have an input box that takes numbers only. Again by deriving from the standard controls this is easily achieved, for example: using System; using System.Windows.Forms; using System.Globalization; namespace StackOverflowDocumentation { public class SONumberBox : SO...
Every Country has one Capital. Every Capital has one Country. Country.java package com.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persist...
The not very secure way (because docker inspect will show it) is to pass an environment variable to docker run such as docker run -e password=abc or in a file docker run --env-file myfile where myfile can contain password1=abc password2=def it is also possible to put them in a volume dock...
By using the Grid.RowSpan and Grid.ColumnSpan attached properties, children of a Grid can span multiple rows or columns. In the following example the second TextBlock will span the second and third column of the Grid. <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/&...
Create an HTML file with the following content: <!DOCTYPE html> <html> <head> <title>Angular Interceptor Sample</title> <script src="https://code.angularjs.org/1.5.8/angular.min.js"></script> <script src="app.js"></sc...
public class PlayerJoinListener implements Listener { @EventHandler public void onPlayerJoin(PlayerJoinEvent evt) { Player joined = evt.getPlayer(); String joinedName = joined.getName(); //RETRIEVING THE JOIN MESSAGE ALREADY SET String joinMessage = ev...
public class PlayerMoveListener implements Listener { @EventHandler public void onPlayerMove(PlayerMoveEvent evt) { Location from = evt.getFrom(); Location to = evt.getTo(); double xFrom = from.getX(); double yFrom = from.getY(); double zFrom ...
public ActionResult PopulateFoods() { // Redirects to another action method. In this case the index method return RedirectToAction("Index"); } Action methods typically return a result that is known as an action result. The ActionResult class is the base class for all action ...
Xamarins built in gesture recognizers provide only very basic touch handling. E.g. there is no way to get the position of a touching finger. MR.Gestures is a component which adds 14 different touch handling events. The position of the touching fingers is part of the EventArgs passed to all MR.Gestu...
Imagine the following XML: <root> <element foobar="hello_world" /> <element example="this is one!" /> </root> /root/element[@foobar] and will return the <element foobar="hello_world" /> element.
Imagine the following XML: <root> <element foobar="hello_world" /> <element example="this is one!" /> </root> The following XPath expression: /root/element[@foobar = 'hello_world'] will return the <element foobar="hello_world&quo...
For using Attribute Routing in areas, registering areas and [RouteArea(...)] definitions are required. In RouteConfig.cs : public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); ...
How do you handle errors, rather then log them to the console? Bad way: Router.route('/') .get((req, res) => { Request.find((err, r) => { if(err){ console.log(err) } else { res.json(r) } }) }) .post((req, res) => { const reque...
The simplest way to write a parser is to use the recursive descent technique. This creates a top-down parser (which may formally be described a LL(1)). To start the example we first have to establish the grammar rules for our language. In this example we will use simple arithmetic expression assignm...
When sending a notification to an iOS device, you must set priority: "high" for it to wake up. Otherwise, the notification will not be received while the phone is asleep. Sets the priority of the message. Valid values are "normal" and "high." On iOS, these correspond...
var renderer = Platform.GetRenderer(visualElement); if (renderer == null) { renderer = Platform.CreateRenderer(visualElement); Platform.SetRenderer(visualElement, renderer); } DoSomeThingWithRender(render); // now you can do whatever you want with render

Page 279 of 417