Tutorial by Examples

@Entity @Table(name="FOO") public class Foo { private UUID fooId; @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "barId") private Bar bar; } @Entity @Table(name="BAR") public class Bar { private UUID barId; ...
@Entity @Table(name="FOO") public class Foo { private UUID fooId; @OneToMany @JoinTable(name="FOO_BAR", joinColumns = @JoinColumn(name="fooId"), inverseJoinColumns = @JoinColumn(name="barId", unique=true)) private ...
@Entity @Table(name="FOO") public class Foo { private UUID fooId; @OneToOne private Bar bar; } @Entity @Table(name="BAR") public class Bar { private UUID barId; //No corresponding mapping to Foo.class } Specifies a one-way relationship b...
TestSchedulers allows you to control time and execution of Observables instead of having to do busy waits, joining threads or anything to manipulate system time. This is VERY important if you want to write unit tests that are predictable, consistent and fast. Because you are manipulating time, the...
There are three kinds of tags to denote PHP blocks in a file. The PHP parser is looking for the opening and (if present) closing tags to delimit the code to interpret. Standard Tags These tags are the standard method to embed PHP code in a file. <?php echo "Hello World"; ?> ...
Generic redirect to https: # Enable Rewrite engine RewriteEngine on # Check if URL does not contain https RewriteCond %{HTTPS} off [NC] # If condition is true, redirect to https RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L] Generic redirect to http: # Enable Rewrite engine Rewr...
import org.bukkit.event.Listener; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerQuitEvent; public class MyEventListener implements Listener { /** * Constructor ...
Add the following directive before using any other mod_rewrite directive (RewriteRule, RewriteCond, RewriteBase or RewriteMap). RewriteEngine on By default the engine is turned off. mod_rewrite directives found while the engine is turned off are ignored. Enable it from within the virtual host co...
Important: Using the dynamic configuration files (.htaccess) is a big performance hit. When you have access to the static configuration file (httpd.conf or something similar) you should use that instead. In the static configuration file, allow dynamic configuration files to override "Filei...
An Observable can be thought of as just a stream of events. When you define an Observable, you have three listeners: onNext, onComplete and onError. onNext will be called every time the observable acquires a new value. onComplete will be called if the parent Observable notifies that it finished prod...
import serial #Serial takes these two parameters: serial device and baudrate ser = serial.Serial('/dev/ttyUSB0', 9600)
Initialize serial device import serial #Serial takes two parameters: serial device and baudrate ser = serial.Serial('/dev/ttyUSB0', 9600) to read single byte from serial device data = ser.read() to read given number of bytes from the serial device data = ser.read(size=5) to read one li...
Custom Renderer help to allows to add new properties and render them differently in native platform that can not be otherwise does through shared code. In this example we will add radius and shadow to a boxview. Firstly, we should create custom control in PCL project, which will declare some requir...
In this exemple, we want to execute code which is stored in a string format. # the string str <- "1+1" # A string is not an expression. is.expression(str) [1] FALSE eval(str) [1] "1+1" # parse convert string into expressions parsed.str <- parse(text="1+1...
Instead of using regex, the Lua string library has a special set of characters used in syntax matches. Both can be very similar, but Lua pattern matching is more limited and has a different syntax. For instance, the character sequence %a matches any letter, while its upper-case version represents al...
This is an example on how to control PHP error logging in a virtual host site for development and debugging. Assumptions The PHP module has been installed. Development environment is not for production. <VirtualHost *:80> ServerName example.com DocumentRoot /var/www/domains/e...
string <- ' some text on line one; and then some text on line two ' Trimming Whitespace "Trimming" whitespace typically refers to removing both leading and trailing whitespace from a string. This may be done using a combination of the previous examples. gsub is used to for...
Creating a chart that displays a static dataset is relatively simple. For example, if we have this array of objects as the data: var data = [ {title: "A", value: 53}, {title: "B", value: 12}, {title: "C", value: 91}, {title: "D", value: 24...
Debian/Ubuntu # apt-get update & apt-get -y upgrade # apt-get install cron Fedora/CentOS # yum -y update # yum install vixie-cron Arch # pacman --noconfirm -Syu # pacman -S cronie
To get a list of available serial ports use python -m serial.tools.list_ports at a command prompt or from serial.tools import list_ports list_ports.comports() # Outputs list of available serial ports from the Python shell.

Page 800 of 1336