Tutorial by Examples: al

A relation(or relation schema) in a given database is in first normal form, if the domain of all attributes of that relation is atomic. A domain is atomic if all the elements of that domain are considered to indivisible units. Suppose a relation employee, has attribute name, then the relation is not...
To normalize the database in the second form, there must not be any partial dependency of any column on primary key. Let's consider the following example: idnamedobsubject1Mark1-1-1981Physics2Jack2-2-1982Math2Jack2-2-1982Biology3John3-3-1983Math This table is considered to have a composite primar...
Step 1. In your host machine (Windows/Linux/OSX), create an empty dir my_project. Step 2. Create a file named Vagrantfile with this: Vagrant.configure("2") do |config| config.vm.box = "gbarbieru/xenial" #An Ubuntu 16.04 based image config.vm.hostname = "my_project&...
for numbers, a zero value evaluates to false, non zero to true int i = 0 ... if (i) print "some ${i}" else print "nothing" will print "nothing"
a string (including GStrings) evaluates to true if not null and not empty, false if null or empty def s = '' ... if (s) println 's is not empty' else println 's is empty' will print: 's is empty'
Collections and Maps evaluates to true if not null and not empty and false if null or empty /* an empty map example*/ def userInfo = [:] if (!userInfo) userInfo << ['user': 'Groot', 'species' : 'unknown' ] will add user: 'Groot' , species : 'unknown' as default userInfo since the u...
a null object reference evaluates to false, a non null reference to true, but for for strings, collections, iterators and enumerations it also takes into account the size. def m = null if (!m) println "empty" else println "${m}" will print "empty" de...
Sometimes it may be useful to have a specific asBoolean definition in your own program for some kind of objects. /** an oversimplified robot controller */ class RunController { def complexCondition int position = 0 def asBoolean() { return complexCondition(this...
You can default to the normal Mongo format by defining your collections with the idGeneration field. MyCollection = new Meteor.Collection('mycollection', {idGeneration : 'MONGO'});
Geospatial collections generally involve storing GeoJSON in the Mongo database, streaming that data to the client, accessing the browser's window.navigator.geolocation, loading up a Map API, converting GeoJSON to LatLngs, and plotting on the map. Preferably all in realtime. Here are a list of reso...
The Kernel exposes methods for getting the list of global_variables and local_variables: cats = 42 $demo = "in progress" p global_variables.sort #=> [:$!, :$", :$$, :$&, :$', :$*, :$+, :$,, :$-0, :$-F, :$-I, :$-K, :$-W, :$-a, #=> :$-d, :$-i, :$-l, :$-p, :$-v, :$-w, :$...
Ruby offers define_method as a private method on modules and classes for defining new instance methods. However, the 'body' of the method must be a Proc or another existing method. One way to create a method from raw string data is to use eval to create a Proc from the code: xml = <<ENDXML ...
Oh-my-zsh is a community-driven framework for managing your zsh configuration. It contains many plugins, which extend functionality, themes, which manage the appearance of the shell and the prompt, and helpful functions that will make your terminal much more powerful and customizable. You can create...
Pre-requirements Check the requirements for each device type you wish to automate and make sure they're installed before attempting to use Appium! iOS Requirements Mac OS X 10.10 or higher, 10.11.1 recommended XCode >= 6.0, 7.1.1 recommended Apple Developer Tools (iPhone simulator SDK, com...
To get a difference between two Calendars, use getTimeInMillis() method: Calendar c1 = Calendar.getInstance(); Calendar c2 = Calendar.getInstance(); c2.set(Calendar.DATE, c2.get(Calendar.DATE) + 1); System.out.println(c2.getTimeInMillis() - c1.getTimeInMillis()); //outputs 86400000 (24 * 60 * ...
Detailed instructions on getting pyspark set up or installed.
A regex pattern where a DOTALL modifier (in most regex flavors expressed with s) changes the behavior of . enabling it to match a newline (LF) symbol: /cat (.*?) dog/s This Perl-style regex will match a string like "cat fled from\na dog" capturing "fled from\na" into Group 1....
You may install Composer locally, as part of your project, or globally as a system wide executable. Locally To install, run these commands in your terminal. php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" # to check the validity of the downloaded installer, ch...
Reading invalid UTF-8 When reading UTF-8 encoded data, it is important to be aware of the fact the UTF-8 encoded data can be invalid or malformed. Such data should usually not be accepted by your program (unless you know what you are doing). When unexpectedly encountering malformed data, different ...
Detailed instructions on getting api set up or installed.

Page 137 of 269