Tutorial by Examples: and

To execute a function within a loop in node.js, it's fine to use a for loop for short loops. But the loop is long, using for loop will increase the time of processing which might cause the node process to hang. In such scenarios, you can use: asycn.times function recursiveAction(n, callback) { ...
When we want to handle array of data, its better to use async.each. When we want to perform something with all data & want to get the final callback once everything is done, then this method will be useful. This is handled in parallel way. function createUser(userName, callback) { //creat...
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...
\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,...
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 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 --fields-optionally-enclosed-by='"' --fields-terminated-by=, --lines-terminated-by="\r\n" mycompany employee.csv
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...
The DATE datatype comprises the date but no time component. Its format is 'YYYY-MM-DD' with a range of '1000-01-01' to '9999-12-31'. The DATETIME type includes the time with a format of 'YYYY-MM-DD HH:MM:SS'. It has a range from '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. The TIMESTAMP type is...
Sometimes a poorly designed 3rd-party library will write unwanted diagnostics to System.out or System.err streams. The recommended solutions to this would be to either find a better library or (in the case of open source) fix the problem and contribute a patch to the developers. If the above solu...
In the Adobe technical white paper Adobe Acrobat 9 Digital Signatures, Changes and Improvements, especially its section "Allowed and disallowed changes", Adobe clarifies the allowed changes (as seen by Acrobat 9 and up) that can be made to a certified or signed document without invalidatin...
The following class can be used as a single class that can handle GET, POST, PUT, PATCH, and other requests: class APIResponseObject{ int responseCode; String response; APIResponseObject(int responseCode,String response) { this.responseCode = responseCode; ...
To start using FTP with Java, you will need to create a new FTPClient and then connect and login to the server using .connect(String server, int port) and .login(String username, String password). import java.io.IOException; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.n...
It is possible that the client browser does not support Javascript or have Javascript execution disabled, perhaps due to security reasons. To be able to tell users that a script is supposed to execute in the page, the <noscript> tag can be used. The content of <noscript> is displayed whe...
There are no build-in methods for intersection and difference in Sets, but you can still achieve that but converting them to arrays, filtering, and converting back to Sets: var set1 = new Set([1, 2, 3, 4]), set2 = new Set([3, 4, 5, 6]); const intersection = new Set(Array.from(set1).filter(x...
zip takes two lists and returns a list of corresponding pairs: zip [] _ = [] zip _ [] = [] zip (a:as) (b:bs) = (a,b) : zip as bs > zip [1,3,5] [2,4,6] > [(1,2),(3,4),(5,6)] Zipping two lists with a function: zipWith f [] _ = [] zipWith f _ [] =...
If you want to add a Drawable be shown during the load, you can add a placeholder: Glide.with(context) .load(yourUrl) .placeholder(R.drawable.placeholder) .into(imageView); If you want a Drawable to be shown if the load fails for any reason: Glide.with(context) .load(yourUrl...
View loading In a test for a view controller you want sometimes to trigger the execution of loadView() or viewDidLoad(). This can be done by accessing the view. Let's say you have view controller instance in your test called sut (system under test), then the code would look like this: XCTAssertNot...
// Add observer let observer = NSNotificationCenter.defaultCenter().addObserverForName("nameOfTheNotification", object: nil, queue: nil) { (notification) in // Do operations with the notification in this block } // Remove observer NSNotificationCenter.defaultCenter().removeObser...

Page 81 of 153