Tutorial by Examples: is

CREATE TABLE foo ( ... ) ENGINE=MyISAM;
Create a new Console Application Add the NuGet package Microsoft.CodeAnalysis Import the namespaces Microsoft.CodeAnalysis.MSBuild, System.Linq and Microsoft.CodeAnalysis.CSharp.Syntax Write the following example code in the Main method: // Declaring a variable with the current project file ...
In F# there are many options for creating data pipelines, for example: List, Seq and Array. What data pipeline is preferable from memory usage and performance perspective? In order to answer this we'll compare performance and memory usage using different pipelines. Data Pipeline In order to me...
In the below example value in map $color-array is treated as list of pairs. SCSS Input $color-array:( black: #4e4e4e, blue: #0099cc, green: #2ebc78 ); @each $color-name, $color-value in $color-array { .bg-#{$color-name} { background: $color-value; } } ...
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 ...
Specifying the -gui command line option when running an ANTLR grammar in the test rig will result in a window popping up with a visual representation of the parse tree. For example: Given the following grammar: JSON.g4 /** Taken from "The Definitive ANTLR 4 Reference" by Terence Parr */...
It forces you to explicitly declare all variables. What is the difference between explicitly declaring and implicitly declaring a variable? Explicitly declaring a variable: Dim anInteger As Integer = 1234 Implicitly declaring a variable: 'Did not declare aNumber using Dim aNumber = 1234 C...
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]; ...
When a Google Map is displayed in lite mode clicking on a map will open the Google Maps application. To disable this functionality you must call setClickable(false) on the MapView, e.g.: final MapView mapView = (MapView)view.findViewById(R.id.map); mapView.setClickable(false);
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...
If all you need is to wrap the value into a promise, you don't need to use the long syntax like here: //OVERLY VERBOSE var defer; defer = $q.defer(); defer.resolve(['one', 'two']); return defer.promise; In this case you can just write: //BETTER return $q.when(['one', 'two']); $q.when ...
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...
Many unbound generic parameters, like those used in a static method, cannot be recovered at runtime (see Other Threads on Erasure). However there is a common strategy employed for accessing the type satisfying a generic parameter on a class at runtime. This allows for generic code that depends on ac...
C++11 The std::is_same<T, T> type relation is used to compare two types. It will evaluate as boolean, true if the types are the same and false if otherwise. e.g. // Prints true on most x86 and x86_64 compilers. std::cout << std::is_same<int, int32_t>::value << "\n&qu...
Sometimes it's useful to check if a field is present or absent on your JSON to avoid some JSONException on your code. To achieve that, use the JSONObject#has(String) or the method, like on the following example: Sample JSON { "name":"James" } Java code String jsonStr...
Some examples for a window of size 3: ;; Naïve attempt: (loop for (first second third) on '(1 2 3 4 5) do (print (* first second third))) ;; prints 6 24 60 then Errors on (* 4 5 NIL) ;; We will try again and put our attempt into a function (defun loop-3-window1 (function list) (loop...
<dom-module id="using-listeners-obj"> <template> <style> :host{ width: 220px; height: 100px; border: 1px solid black; display: block; } #inner{ width: calc(100% - 10px); height: 50px; ...
Another way to add an event listener is to use on-event annotation in DOM. Below is an example using up event, which is fired when finger/mouse goes up <dom-module id="annotated-listener"> <template> <style> .inner{ width: calc(200px); he...
You can also add/remove listener imperatively using listen and unlisten method of Polymer <dom-module id="imparative-listener"> <template> <style> #inner{ width: 200px; height: 50px; border: 1px solid ...
In some circumstances (for example obtaining a Google API key) you need to find your keystore fingerprint. Gradle has a convenient task that display all the signing information, including keystore fingerprints: ./gradlew signingReport This is a sample output: :app:signingReport Variant: releas...

Page 52 of 109