Java-only stuff
Java-only stuff
(base64-decode b64-string)(base64-encode string)(content-files dir & regex)(copy-paths in-path out-path)Copy in-path to out-path, in-path can be URI or filename, out-path should be a file
Copy in-path to out-path, in-path can be URI or filename, out-path should be a file
(dataset-fields ds)(date+ date days hours minutes)(date-format date format)(directory-files d filterfn)(download uri file)Common use case for copy-paths
Common use case for copy-paths
(ensure-directory d)Create directory if it doesn't exist (recursively)
Create directory if it doesn't exist (recursively)
(ensure-file f)Ensure that the directory structure to contain this file exists
Ensure that the directory structure to contain this file exists
(error s & args)Throw a generic Exception with formatted string
Throw a generic Exception with formatted string
(error-message e)Given an exception, returns the error message
Given an exception, returns the error message
(expand-homedir path)(file-delete-recursively fname)Delete a directory and its contents
Delete a directory and its contents
(file-delete-safe fname)Delete a file or directory safely (that is, no error if doesn't exist)
Delete a file or directory safely (that is, no error if doesn't exist)
(file-lines file)(file-lines-out file seq)(file-seq-filtered remove-fn dir)A tree seq on java.io.Files
A tree seq on java.io.Files
(flatten-directory dir dest-dir)(git-log-info file)returns [user email timestamp msg commit] of last commit for file
returns [user email timestamp msg commit] of last commit for file
(humanize-number n)(in-background & body)(invoke-private o methodname)(java-resource->string resource)(join-path & args)Joins the elements passed in into a path
Joins the elements passed in into a path
(list-dir-recursive dir)Like fs/list-dir, but recurses through subdirectories and does not include dirs in result. Ignore .dotfiles
Like fs/list-dir, but recurses through subdirectories and does not include dirs in result. Ignore .dotfiles
(local-file url)(local-file url local-file)Make a copy of contens of url in a local temp file or supplied filename
Make a copy of contens of url in a local temp file or supplied filename
(now)(open-url url)(parse-boolean-or-nil value)(parse-long-or-nil value)(pdoseq seqs & body)Like doseq but each iteration gets its own thread.
Like doseq but each iteration gets its own thread.
(pdoseq* seqs & body)Like doseq* but each iteration gets its own thread.
Like doseq* but each iteration gets its own thread.
(pmap-keys f hashmap)Map f over the kes of hashmap in parallel
Map f over the kes of hashmap in parallel
(pmap-values f hashmap)Map f over the values of hashmap in parallel
Map f over the values of hashmap in parallel
(process-file-lines f in out)(processors)Return the number of available processors
Return the number of available processors
(read-chars reader n)(read-csv-rows f)Read a csv file into vectors
Read a csv file into vectors
(read-tsv-maps f & [separator])Given a tsv file with a header line, returns seq where each elt is a map of field names to strings
Given a tsv file with a header line, returns seq where each elt is a map of field names to strings
(read-tsv-rows f & [separator])Read a tsv file into vectors
Read a tsv file into vectors
(reader file)Return a reader for a file, with homedir expansin
Return a reader for a file, with homedir expansin
(schpit f content & options)Like core/spit, but will do something sensible for lazy seqs.
Like core/spit, but will do something sensible for lazy seqs.
(schppit f content & options)Like schpit but will prettyprint.
Like schpit but will prettyprint.
(sh-errchecked & args)(sh-str s)Version of sh that takes a single string, which can include pipe operators etc. Also turns errors into exceptions
Version of sh that takes a single string, which can include pipe operators etc. Also turns errors into exceptions
(sh-template template params)Version of sh uses templating
Version of sh uses templating
(sleep n)(split-path path)Splits a path delimited with /
Splits a path delimited with /
(start-periodic-process! t f)Start a background process to execute thunk f every t mssc
Start a background process to execute thunk f every t mssc
(string-search-all string sub & [start])Return a sequence of all positions where sub is found in string
Return a sequence of all positions where sub is found in string
(substitute-file-lines map)(temp-dir-path)(temp-file)(temp-file-path)(timing-fn f)Returns a fn that acts like f, but return value is (time result), time in msec]
Returns a fn that acts like f, but return value is (time result), time in msec]
(warn s & args)(write-csv-maps f rows)(write-csv-rows f rows)(write-tsv-maps f rows & {:keys [separator cols] :or {separator \tab}})(write-tsv-rows f rows & [separator])(writer file)Return a writer for a file, with homedir expansin
Return a writer for a file, with homedir expansin
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |