Tutorial by Examples: dp

Suppose we have a POJO class User we need to validate. public class User { @NotEmpty @Size(min=5) @Email private String email; } and a controller method to validate the user instance public String registerUser(@Valid User user, BindingResult result); Let's extend the U...
Pull (Sync) Like in the command line you need to pull the current state of the repository once in a while. In GitHub Desktop this process is called by the sync Button at the top right corner. Push When you made local changes and want to push them you make a commit by writing something into the su...
Create a new C# script in Unity and replace it's contents with the following using UnityEngine; using System.Collections; public static class UnityAndroidPlugin { }
Create a new C# script in Unity and paste these contents using UnityEngine; using System.Collections; public class UnityAndroidPluginGUI : MonoBehaviour { void OnGUI () { } }
This example shows how to make an interactive presentation transition with "real-world" physics similar to iOS's notifications screen. To start with, we need a presenting view controller that the shade will appear over. This view controller will also act as our UIViewControllerTransitio...
When an entity includes multiple mixins that define the same component properties, the right-most mixin takes precedence. In the example below, the entity includes both red and blue mixins, and since the blue mixin is included last, the final color of the cube will be blue. <a-scene> &l...
One of the features in SugarCRM 7.x is being able to easily add and extend custom endpoints to accomplish what you require. In this example, we'll create a couple of custom endpoints to return some data about the request. This custom file is being placed in custom/clients/base/api/DescriptionAPI.p...
Nested prefabs are not avaible in Unity at the moment. You can drag one prefab to another, and apply that, but any changes on the child prefab will not be applied to nested one. But there is a simple workaround - You have to add to parent prefab a simple script, that will instantiate a child one. ...
Array ( [0] => Array ( [id] => 13 [category_id] => 7 [name] => Leaving Of Liverpool [description] => Leaving Of Liverpool [price] => 1.00 [virtual] => 1 [active] =...
val map = mapOf("foo" to 1) val foo : String by map println(foo) The example prints 1
You can also use tee command to store the output of a command in a file and redirect the same output to another command. The following command will write current crontab entries to a file crontab-backup.txt and pass the crontab entries to sed command, which will do the substituion. After the substi...
Child Processes are the way to go when one wants to run processes independently with different initialization and concerns. Like forks in clusters, a child_process runs in its thread, but unlike forks, it has a way to communicate with its parent. The communication goes both ways, so parent and chil...
Promises handle errors differently to synchronous or callback-driven code. const p = new Promise(function (resolve, reject) { reject(new Error('Oops')); }); // anything that is `reject`ed inside a promise will be available through catch // while a promise is rejected, `.then` will not be ...
A simple OGL 4.0 GLSL shader program that shows the use of a model, view, and projection matrix The program is executed with a phyton script. To run the script, PyOpenGL and NumPy must be installed. Projection matrix: The projection matrix describes the mapping of a pinhole camera from 3D poi...
To prepare the ios build first we need to create the cordova project. lets create the project by the command line tool. cordova create hello com.example.hello "HelloWorld" Go to the project dir by cd hello. we are now in the project directory, lets check which platforms are availa...
To list all the packages installed in ubuntu, type below command $ apt list --installed Output will show all the installed packages. Listing... Done accountsservice/trusty-updates,now 0.6.35-0ubuntu7.3 i386 [installed] acl/trusty,now 2.2.52-1 i386 [installed,automatic] acpid/trusty,...
A bracket is considered to be any one of the following characters: (, ), {, }, [, or ]. Two brackets are considered to be a matched pair if the an opening bracket (i.e., (, [, or {) occurs to the left of a closing bracket (i.e., ), ], or }) of the exact same type. There are three types of matched p...
Here can be found the most comprehensive math library that emulates pen and paper calculations and allows working with bigger numbers. Here are another examples of pen and paper emulations: ADD , Comparison , Multiply Some math functions implementations can be found here.
Once the installation is finished click the Finish button. Now it asks if you want to copy your packages fro the older version of R to Newer version of R. Once you choose yes all the package are copied to the newer version of R. After that you can choose if you still want to keep the old package...
This code example creates a UDP client then sends "Hello World" across the network to the intended recipient. A listener does not have to be active, as UDP Is connectionless and will broadcast the message regardless. Once the message is sent, the clients work is done. byte[] data = Enco...

Page 20 of 21