Tutorial by Examples

The regexp command is used to match a regular expression against a string. # This is a very simplistic e-mail matcher. # e-mail addresses are extremely complicated to match properly. # there is no guarantee that this regex will properly match e-mail addresses. set mydata "send mail to john....
If you have a greedy match as the first quantifier, the whole RE will be greedy, If you have non-greedy match as the first quantifier, the whole RE will be non-greedy. set mydata { Device widget1: port: 156 alias: input2 Device widget2: alias: input1 Device widget3: port: 238 alias...
The regsub command is used for regular expression matching and substitution. set mydata {The yellow dog has the blues.} # create a new string; only the first match is replaced. set newdata [regsub {(yellow|blue)} $mydata green] puts $newdata The green dog has the blues. # replace the data in t...
\m : Beginning of a word. \M : End of a word. \y : Word boundary. \Y : a point that is not a word boundary. \Z : matches end of data. Documentation: re_syntax

Vim

Install the following plugins using your favourite plugin manager: fireplace.vim: Clojure REPL support vim-sexp: For taming those hugs around your function calls vim-sexp-mappings-for-regular-people: Modified sexp mappings that are a little easier to bear vim-surround: Easily delete, change, a...
# example data DT = data.table(id = c(1,2,2,3,3,3))[, v := LETTERS[.I]][] To deal with "duplicates," combine counting rows in a group and subsetting rows by group. Keep one row per group Aka "drop duplicates" aka "deduplicate" aka "uniquify." unique(DT,...
TestSubscribers allow you to avoid the work creating your own Subscriber or subscribe Action<?> to verify that certain values where delivered, how many there are, if the Observable completed, an exception was raised and a whole lot more. Getting Started This example just shows an assertion...
There are many examples where backticks are used inside a query but for many it's still unclear when or where to use backticks ``. Backticks are mainly used to prevent an error called "MySQL reserved word". When making a table in PHPmyAdmin you are sometimes faced with a warning or alert ...
A bit field is a variable that holds various boolean states as individual bits. A bit on would represent true, and off would be false. In the past bit fields were routinely used as they saved memory and reduced processing load. Though the need to use bit field is no longer so important they do offer...
How to get FusionCharts: Download from the FusionCharts official website Install via npm: # Install fusioncharts package npm install fusioncharts # Install fusionmaps package npm install fusionmaps Install via bower: # Install fusioncharts package bower install fusioncharts #...
Literals in RDF may be language tagged strings. These literals have a text part as well as a language tag. For instance, the literal "color"@en has the text part "color" and the language tag "en". In a SPARQL query, use the lang function to get the language of a lite...
The SPARQL function langMatches can be used to compare the language tags of RDF literals in SPARQL queries. The simple equality operator, =, can be used to compare exact string matches, but will not correctly consider regional variants. For instance, the four possible values of ?str in: values ...
Even with identical tokens for inline functions, ODR can be violated if lookup of names doesn't refer to the same entity. let's consider func in following: header.h void overloaded(int); inline void func() { overloaded('*'); } foo.cpp #include "header.h" void foo() { ...
First, make sure your app can be backed up in AndroidManifest.xml, i.e. android:allowBackup is not false. Backup command: adb -s <device_id> backup -noapk <sample.package.id> Create a tar with dd command: dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.wri...
adb -s <serialNumber> shell dumpsys activity activities Very useful when used together with the watch unix command: watch -n 5 "adb -s <serialNumber> shell dumpsys activity activities | sed -En -e '/Stack #/p' -e '/Running activities/,/Run #0/p'"
You may use this command for listing the files for your own debuggable apk: adb shell run-as <sample.package.id> ls /data/data/sample.package.id/cache And this script for pulling from cache, this copy the content to sdcard first, pull and then remove it at the end: #!/bin/sh adb shell &q...
RenderScript is a framework to allow high performance parallel computation on Android. Scripts you write will be executed across all available processors (e.g. CPU, GPU etc) in parallel allowing you to focus on the task you want to achieve instead of how it is scheduled and executed. Scripts are wr...
Given the tab-separated file employee.txt 1 \t Arthur Dent 2 \t Marvin 3 \t Zaphod Beeblebrox $ mysql --user=user --password=password mycompany -e 'CREATE TABLE employee(id INT, name VARCHAR(100), PRIMARY KEY (id))' $ mysqlimport --user=user --password=password mycompany employee.txt ...
Given the text file employee.txt 1|Arthur Dent 2|Marvin 3|Zaphod Beeblebrox $ mysqlimport --fields-terminated-by='|' mycompany employee.txt
This example is useful for windows-like endings: $ mysqlimport --lines-terminated-by='\r\n' mycompany employee.txt

Page 719 of 1336