Tutorial by Examples: er

Labeling the alternatives inside a rule starting with the # operator tells ANTLR to generate listener methods for each label corresponding to the alternative. By specifying a label for each alternative in the following rule: // Rule type : int #typeInt | short #typeShort | long ...
Servant is a library for declaring APIs at the type-level and then: write servers (this part of servant can be considered a web framework), obtain client functions (in haskell), generate client functions for other programming languages, generate documentation for your web applications and m...
2.1.3 1. Preview Different Devices There is a preview panel at the right of the android studio. In thispanel there is a button with device name with which you are previewing the UI of your app like this . Click on small dropdown indicator of this and a floating panel will appear with all the pr...
VB 14.0 introduces the ability to add comments after implicit line continuation. Dim number = From c As Char 'Comment In "dj58kwd92n4" 'Comment Where Char.IsNumber(c) 'Comment Select c 'Comment
The System.String class supports a number of methods to convert between uppercase and lowercase characters in a string. System.String.ToLowerInvariant is used to return a String object converted to lowercase. System.String.ToUpperInvariant is used to return a String object converted to upper...
Add the following code to the onCreate()/onResume() method: SensorManager sensorManager; Sensor mAccelerometer; final float movementThreshold = 0.5f; // You may have to change this value. boolean isMoving = false; float[] prevValues = {1.0f, 1.0f, 1.0f}; float[] currValues = new float[3]; ...
Put your dbname.sqlite or dbname.db file in assets folder of your project. public class Databasehelper extends SQLiteOpenHelper { public static final String TAG = Databasehelper.class.getSimpleName(); public static int flag; // Exact Name of you db file that you put in as...
A spring bean can be configured such that it will register only if it has a particular value or a specified property is met. To do so, implement Condition.matches to check the property/value: public class PropertyCondition implements Condition { @Override public boolean matches(ConditionC...
By default: Use val, not var, wherever possible. This allows you to take seamless advantage of a number of functional utilities, including work distribution. Use recursion and comprehensionss, not loops. Use immutable collections. This is a corrolary to using val whenever possible. Focus on da...
The flatMap operator help you to transform one event to another Observable (or transform an event to zero, one, or more events). It's a perfect operator when you want to call another method which return an Observable public Observable<String> perform(int i) { // ... } Observabl...
The Fibonacci numbers are defined inductively as F0 = 0 F1 = 1 Fn+2 = Fn + Fn+1 The sum of the first n+1 Fibonacci numbers is given by F0 + F1 + F2 + ... + Fn = Fn+2 - 1. This summation arises, among other places, in the analysis of Fibonacci heaps, where it's used to provide a lower b...
You can animate complex changes to your collection view using the performBatchUpdates method. Inside the update block, you can specify several modifications to have them animate all at once. collecitonView.performBatchUpdates({ // Perform updates }, nil) Inside the update block, you can pe...
Filter odd elements: Prelude Data.Vector> Data.Vector.filter odd y fromList [1,3,5,7,9,11] :: Data.Vector.Vector
Most of the magic of destructuring uses the splat (*) operator. ExampleResult / commenta, b = [0,1]a=0, b=1a, *rest = [0,1,2,3]a=0, rest=[1,2,3]a, * = [0,1,2,3]a=0   Equivalent to .first*, z = [0,1,2,3]z=3   Equivalent to .last
By default Code First includes in model Types defined as a DbSet property in context class. Reference types included in entity types even if they are defined in different assembly. Derived classes even if only the base class is defined as DbSet property Here is an example, that we are only...
select returns a new hash with key-value pairs for which the block evaluates to true. { :a => 1, :b => 2, :c => 3 }.select { |k, v| k != :a && v.even? } # => { :b => 2 } When you will not need the key or value in a filter block, the convention is to use an _ in that place:...
Intersection of Hashes To get the intersection of two hashes, return the shared keys the values of which are equal: hash1 = { :a => 1, :b => 2 } hash2 = { :b => 2, :c => 3 } hash1.select { |k, v| (hash2.include?(k) && hash2[k] == v) } # => { :b => 2 } Union (...
Vim knows The Answer: :help 42 Vim will open the usr_42.txt document from the manual and show the following text: What is the meaning of life, the universe and everything? 42 Douglas Adams, the only person who knew what this question really was about is now dead, unfortunately. So now you m...
These rules apply only if you use manual reference counting! You own any object you create By calling a method whose name begins with alloc, new, copy or mutableCopy. For example: NSObject *object1 = [[NSObject alloc] init]; NSObject *object2 = [NSObject new]; NSObject *object3 = [object2 ...
The Window Object contains the following properties. PropertyDescriptionwindow.closedWhether the window has been closedwindow.lengthNumber of <iframe> elements in windowwindow.nameGets or sets the name of the windowwindow.innerHeightHeight of windowwindow.innerWidthWidth of windowwindow.scree...

Page 204 of 417