Tutorial by Examples

Swift Function for loading an animation from a file: func animationFromSceneNamed(path: String) -> CAAnimation? { let scene = SCNScene(named: path) var animation:CAAnimation? scene?.rootNode.enumerateChildNodes({ child, stop in if let animKey = child.animationKeys.first...
There are two types of Active Patterns that somewhat differ in usage - Complete and Partial. Complete Active Patterns can be used when you are able to enumerate all the outcomes, like "is a number odd or even?" let (|Odd|Even|) number = if number % 2 = 0 then Even else Odd N...
dblink EXTENSION is a technique to connect another database and make operation of this database so to do that you need: 1-Create a dblink extention: CREATE EXTENSION dblink; 2-Make your operation: For exemple Select some attribute from another table in another database: SELECT * FROM dblink...
FDW is an implimentation of dblink it is more helpful, so to use it: 1-Create an extention: CREATE EXTENSION postgres_fdw; 2-Create SERVER: CREATE SERVER name_srv FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'hostname', dbname 'bd_name', port '5432'); 3-Create user mapping for postgres...
When you try to restore database from another server you might get the following error: Error 3154: The backup set holds a backup of a database other than the existing database. In that case you should use WITH REPLACE option to replace database with the database from backup: RESTORE DATABAS...
What is retrofit? The official Retrofit page describes itself as: A type-safe REST client for Android and Java. This library makes downloading JSON or XML data from a web API fairly straightforward. Once the data is downloaded then it is parsed into a Plain Old Java Object (POJO) defined for ...
The Same Database reference allows you to split a single database into multiple projects. This is useful for cases where a project is very large or where different teams manage different parts of the database. If you consider that you have two .sqlproj SSDT database projects with the following stru...
productFlavors { // Define separate dev and prod product flavors. dev { // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin // to pre-dex each module and produce an APK that can be tested on // Android Lollipop without time c...
I have previously written documentation on this site in order to describe how to make web services on Symfony I will write again a tutorial for the symfony >= 3 version. We think that we have a installed web-server on a configured version of Symfony Framework. You must have composer (php packag...
To add a JUnit rule to a test fixture: @Rule @JvmField val myRule = TemporaryFolder() The @JvmField annotation is necessary to expose the backing field with the same visibility (public) as the myRule property (see answer). JUnit rules require the annotated rule field to be public.
Prerequisites JDK 1.7 or later installed. You can find the Oracle JDK's here. Steps Download Payara Server Full. Unzip the Payara Server at some location on your computer. We will use C:\payara41 as INSTALL_DIR for Windows users and /payara41 for Linux/Mac users. Starting / stopping Pa...
Let's understand something. JavaEE consists of a number of specifications. When you install an Application Server (Payara for example), you install all of the specifications at once. For example there's a specification for an ORM called JPA (Java Persistence API), a specification to build Component ...
Using the Profiler Class One very good practice is to use Profiler.BeginSample and Profiler.EndSample because it will have its own entry in the Profiler Window. Also, those tag will be stripped out on non-Development build using using ConditionalAttribute, so you don't need to remove them from you...
REPL stands for 'Read Evaluate Print Loop.' The REPL can be used to write and execute code one line at a time and is an alternative to writing code to a file and then compiling or interpreting the entire file before execution. To start the SMLNJ REPL from a command prompt: smluser> sml Standar...
If you want to sort your data numerically or alphabetically, you can simply use order by [column]. If you want to sort using a custom hierarchy, use a case statement. Group ----- Total Young MiddleAge Old Male Female Using a basic order by: Select * from MyTable Order by Group retur...
(************************************************* * All comments in SML are block comments * Block Comments begin with '(*' * Block Comments end with '*)' * (* Block Comments can be nested *) * The additional framing asterisks at the beginning * and end of this block comment are common ...
(* The block comment syntax allows nested comments (* whether or not this is a good thing is probably a matter of personal opinion (*or coding standards*)*)*) val _ = print "Nested comment example\n" (* line ending block comment *)
The %>% operator can also be used to pipe the dplyr output into ggplot. This creates a unified exploratory data analysis (EDA) pipeline that is easily customizable. This method is faster than doing the aggregations internally in ggplot and has the added benefit of avoiding unnecessary intermediat...
All SML expressions return a value. The REPL stores the return value of the last evaluated expression. it provides the value of the last evaluated expression within the REPL. smluser> sml Standard ML of New Jersey v110.78 [built: Thu Jul 23 11:21:58 2015] - 3+4; val it = 7 : int - it; val i...
Assuming you have a handle on the Hibernate Session object, in this case named session: List<Object[]> result = session.createNativeQuery("SELECT * FROM some_table").list(); for (Object[] row : result) { for (Object col : row) { System.out.print(col); } } Thi...

Page 942 of 1336