Tutorial by Examples: and

A lexer rule can have associated commands: WHITESPACE: [ \r\n] -> skip; Commands are defined after a -> at the end of the rule. skip: Skips the matched text, no token will be emited channel(n): Emits the token on a different channel type(n): Changes the emitted token type mode(n), pu...
A lexer action is a block of arbitrary code in the target language surrounded by {...}, which is executed during matching: IDENTIFIER: [A-Z]+ { log("matched rule"); }; A semantic predicate is a block of arbitrary code in the target language surrounded by {...}?, which evaluates to a bo...
Disclaimer: the examples presented here are only for the purpose of showing the use of abstract classes and inheritance and may not necessarily be of a practical use. Also, there is no sich thing as polymorphic in MATLAB and therefore the use of abstract classes is limited. This example is to show w...
It's important to know how CMake distinguishes between lists and plain strings. When you write: set(VAR "a b c") you create a string with the value "a b c". But when you write this line without quotes: set(VAR a b c) You create a list of three items instead: "a", &q...
When working with multiple open Workbooks, each of which may have multiple Sheets, it’s safest to define and set reference to all Workbooks and Sheets. Don't rely on ActiveWorkbook or ActiveSheet as they might be changed by the user. The following code example demonstrates how to copy a range from...
Download your preferred version from Lightbend with curl: curl -O http://downloads.lightbend.com/scala/2.xx.x/scala-2.xx.x.tgz Unzip the tar file to /usr/local/share or /opt/bin: unzip scala-2.xx.x.tgz mv scala-2.xx.x /usr/local/share/scala Add the PATH to ~/.profile or ~/.bash_profile or ...
{ "description": "My awesome library", "dependencies": { "NETStandard.Library": "1.6.0" }, "frameworks": { "netstandard1.3": { } } } A library that targets netstandard1.3 can be used on any fr...
{ "description": "My awesome library", "dependencies": { }, "frameworks": { "net40": { }, "netstandard1.3": { "dependencies": { "NETStandard.Library": "1.6.0" ...
The special symbol T represents the value true in Common Lisp, while the special symbol NIL represents false: CL-USER> (= 3 3) T CL-USER> (= 3 4) NIL They are called “Constant Variables” (sic!) in the standard, since they are variables whose value cannot be modified. As a consequence, y...
The command prompt comes pre-installed on all Windows NT, Windows CE, OS/2 and eComStation operating systems, and exists as cmd.exe, typically located in C:\Windows\system32\cmd.exe On Windows 7 the fastest ways to open the command prompt are: Press Win 𐌎, type "cmd" and then press ...
Any ASCII editor can edit batch files. A list of editors that can syntax highlight batch syntax can be found here. You can also use the default notepad shipped with windows to edit and view a batch file, although it does not offer syntax highlighting. To open notepad: Press Win 𐌎+R, type notepa...
One could easily center a child element using table display property. HTML <div class="wrapper"> <div class="parent"> <div class="child"></div> </div> </div> CSS .wrapper { display: table; vertica...
Expires — specifies date when the resource becomes stale. It relies on servers and clients having accurate clocks and supporting time zones correctly. Cache-control: max-age takes precedence over Expires, and is generally more reliable. post-check and pre-check directives are non-standard I...
Many commands and programs in the remote side are screen-based (e.g. mc) or they need to ask password (e.g. sudo), to be able to run these kind of programs you can use option -t. ssh -t [email protected] sudo ls / [sudo] password for alice: bin root dev etc home lib mnt opt proc root run usr ...
Django handles a request by routing the incoming URL path to a view function. The view function is responsible for returning a response back to the client making the request. Different URLs are usually handled by different view functions. To route the request to a specific view function, Django look...
This is a very common workflow when using Ansible for provisioning an AWS EC2 instance. This post assumes a basic understand of Ansible and most importantly, assumes you've properly configured it to connect to AWS. As Ansible official documentation insists, we are going to use four roles: 1- ami_f...
To install an APK file, use the following command: adb install path/to/apk/file.apk or if the app is existing and we want to reinstall adb install -r path/to/apk/file.apk To uninstall an application, we have to specify its package adb uninstall application.package.name Use the following...
import cv2 image_path= #put your image path here #use imread() function to read image data to variable img. img = cv2.imread(image_path) #display image data in a new window with title 'I am an image display window' cv2.imshow('I am an image display window',img) #wait until user hi...
With the ~ selector, you can easily implement a global accessible boolean without using JavaScript. Add boolean as a checkbox To the very beginning of your document, add as much booleans as you want with a unique id and the hidden attribute set: <input type="checkbox" id="sideba...
Clojure functions can be defined with zero or more parameters. (defn welcome "Without parameters" [] "Hello!") (defn square "Take one parameter" [x] (* x x)) (defn multiplier "Two parameters" [x y] (* x y)) ...

Page 48 of 153