Tutorial by Examples: c

\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,...
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...
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 ...
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...
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
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...
First, add Fresco to your build.gradle as shown in the Remarks section: If you need additional features, like animated GIF or WebP support, you have to add the corresponding Fresco artifacts as well. Fresco needs to be initialized. You should only do this 1 time, so placing the initialization in y...
The autocomplete feature in the Google Places API for Android provides place predictions to user. While user types in the search box, autocomplete shows places according to user's queries. AutoCompleteActivity.java private TextView txtSelectedPlaceName; @Override protected void onCreate(@Nulla...
When accessing a non-static member of an object through a pointer to member, if the object does not actually contain the member denoted by the pointer, the behavior is undefined. (Such a pointer to member can be obtained through static_cast.) struct Base { int x; }; struct Derived : Base { int y; ...
CHAR(n) is a string of a fixed length of n characters. If it is CHARACTER SET utf8mb4, that means it occupies exactly 4*n bytes, regardless of what text is in it. Most use cases for CHAR(n) involve strings that contain English characters, hence should be CHARACTER SET ascii. (latin1 will do just ...

Page 445 of 826