Tutorial by Examples: n

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
# 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,...
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...
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 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
Given the table Employee idName3Yooden Vranx And the file employee.txt 1 \t Arthur Dent 2 \t Marvin 3 \t Zaphod Beeblebrox The --ignore option will ignore the entry on duplicate keys $ mysqlimport --ignore mycompany employee.txt idName1Arthur Dent2Marvin3Yooden Vranx The --replace opt...
$ mysqlimport --where="id>2" mycompany employee.txt
$ mysqlimport --fields-optionally-enclosed-by='"' --fields-terminated-by=, --lines-terminated-by="\r\n" mycompany employee.csv
The familiar curry :: ((a,b) -> c) -> a -> b -> c curry = \f a b -> f (a,b) function can be generalized to tuples of arbitrary arity, for example: curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -&gt...
Template Haskell is enabled by the -XTemplateHaskell GHC extension. This extension enables all the syntactic features further detailed in this section. The full details on Template Haskell are given by the user guide. Splices A splice is a new syntactic entity enabled by Template Haskell, writ...

Page 585 of 1088