Liking cljdoc? Tell your friends :D

actionho-commons.util


aggregate-time-stats-strclj


all-columns-not-nil?clj

(all-columns-not-nil? rm column-keywords-seq)

Given an rm, ensures that all column-keywords specfied do not have nulls/nils in them.

Given an rm, ensures that all column-keywords specfied do not have nulls/nils in them.
raw docstring

convert-string-to-inputstreamclj

(convert-string-to-inputstream in-str)
From http://stackoverflow.com/questions/247161/how-do-i-turn-a-string-into-a-stream-in-java, http://stackoverflow.com/questions/7498067/why-does-bytearrayinputstream-doesnt-return-expected-results
Is a java.io.InputStream
raw docstring

copy-map-with-valuesclj

(copy-map-with-values m new-val-fn)

Recursively reates a copy of a map replacing the values with (new-val-fn v). Adapted from clojure.walk/keywordize-keys.

Recursively reates a copy of a map replacing the values with (new-val-fn v).
Adapted from clojure.walk/keywordize-keys.
raw docstring

count-stats-strclj


create-app-exceptionclj

(create-app-exception exception-name error-msg additional-info-map)

Is just a convenience constructor around ex-info for consistency

Is just a convenience constructor around ex-info for consistency
raw docstring

ds-processing-time-strclj


enable-enter-method-tracingclj

(enable-enter-method-tracing)

To add tracing to all app namespaces. Calling .toString on ns gives the name of namespace, https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Namespace.java

To add tracing to all app namespaces.  Calling .toString on ns gives the name of namespace, https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Namespace.java
raw docstring

enter-function-strclj


floats-equalclj

(floats-equal float-1 float-2)

Need to parse/cast just to be sure comparing apples to apples.

possibly alternative implementation if needed: http://gettingclojure.wikidot.com/cookbook:numbers

Need to parse/cast just to be sure comparing apples to apples.

possibly alternative implementation if needed: http://gettingclojure.wikidot.com/cookbook:numbers
raw docstring

get-local-date-ms-timestampclj

(get-local-date-ms-timestamp local-date)

Given a local date, returns the unix timestamp value for it for the beginning of the day in UTC. Timestamp is in milliseconds.

Given a local date, returns the unix timestamp value for it for the beginning of the day in UTC.  Timestamp is in milliseconds.
raw docstring

get-npprint-mapclj

(get-npprint-map in-map vals-fn)

A logging function for passing the vals of a map through a function.

vals-fn takes in 1 arg, the value of the kvp-pair of the map

A logging function for passing the vals of a map through a function.

vals-fn takes in 1 arg, the value of the kvp-pair of the map
raw docstring

get-stacktrace-strclj

(get-stacktrace-str e)

For printing out a stacktrace to a string. Output basically equivalent to (-> e (.printStackTrace)), except in REPL output is truncatd unless clicked on, in plain text no difference, so good enough. Can't use (-> e (.printStackTrace)) because it prints to err string, which capturing via http://stackoverflow.com/questions/17314128/get-stacktrace-as-string doesn't work. Alternatively, can use a full java way with either apache commons library or create and close a StringWriter and PrintWriter, http://stackoverflow.com/questions/1149703/how-can-i-convert-a-stack-trace-to-a-string

For printing out a stacktrace to a string.
Output basically equivalent to (-> e (.printStackTrace)), except in REPL output is truncatd unless clicked on, in plain text no difference, so good enough.
Can't use (-> e (.printStackTrace)) because it prints to err string, which capturing via http://stackoverflow.com/questions/17314128/get-stacktrace-as-string doesn't work.
Alternatively, can use a full java way with either apache commons library or create and close a StringWriter and PrintWriter, http://stackoverflow.com/questions/1149703/how-can-i-convert-a-stack-trace-to-a-string
raw docstring

get-utc-now-zoned-dtclj

(get-utc-now-zoned-dt)

get-zoned-date-time-ms-timestampclj

(get-zoned-date-time-ms-timestamp zoned-date-time)

Returns unix timestamp, to get Instant from unix timestamp in milliseconds, use Instant/ofEpochMilli

Returns unix timestamp, to get Instant from unix timestamp in milliseconds, use Instant/ofEpochMilli
raw docstring

http-time-strclj


json-response-ok?clj

(json-response-ok? ring-response-map)

For standard http get returning json using clj-http's (get)

For standard http get returning json using clj-http's (get)
raw docstring

local-date-in-range?clj

(local-date-in-range? start-local-date end-local-date local-date)

parse-floatclj

(parse-float in-str)

Returns nil if in-str is nil, also works for numbers.

Returns nil if in-str is nil, also works for numbers.
raw docstring

parse-intclj

(parse-int in-str)

Returns nil if in-str is nil, also works for numbers.

Returns nil if in-str is nil, also works for numbers.
raw docstring

parse-iso-8601-str-to-zdtclj

(parse-iso-8601-str-to-zdt iso-dt-str)

Need to add UTC timezone for it to be equality compatible other zoned dts that have the zone id set.

Need to add UTC timezone for it to be equality compatible other zoned dts that have the zone id set.
raw docstring

parse-longclj

(parse-long in-str)

Returns nil if in-str is nil, also works for numbers.

Returns nil if in-str is nil, also works for numbers.
raw docstring

parse-shortclj

(parse-short in-str)

Returns nil if in-str is nil, also works for numbers.

Returns nil if in-str is nil, also works for numbers.
raw docstring

round-to-num-decimal-placesclj

(round-to-num-decimal-places n num-decimal-places)
(round-to-num-decimal-places n num-decimal-places rounding-mode)

Convenience method for rounding numbers, dynamically creates (DecimalFormat.) so can make that instantiate at run-time if need more speed.

Probably supeceded by apache commons math (Precision/round) now, with -ve decimal places mean 10, 100, etc. https://stackoverflow.com/questions/5775866/how-to-round-integer-in-java

Convenience method for rounding numbers, dynamically creates (DecimalFormat.) so can make that instantiate at run-time if need more speed.

Probably supeceded by apache commons math (Precision/round) now, with -ve decimal places mean 10, 100, etc. https://stackoverflow.com/questions/5775866/how-to-round-integer-in-java
raw docstring

section-start-strclj


section-time-strclj


trace-nsclj

(trace-ns ns)

For adding a logging statement to the beginning to each function call, for a given namespace, most clj functions that are useful here are on a per-name space basis, so use that Replaces each function from the given namespace with a version wrapped in a tracing call. Can be undone with untrace-ns. ns should be a namespace object or a symbol.

From http://stackoverflow.com/questions/3346382/clojure-adding-a-debug-trace-to-every-function-in-a-namespace, https://gist.github.com/michalmarczyk/492764 Is now actually part of clojure.tools.trace, but I have version here both for own logging and for betting commenting.

Unfortunately, doesn't work with prismatic schema defn functions, so useless for now.

For adding a logging statement to the beginning to each function call, for a given namespace, most clj functions that are useful here are on a per-name space basis, so use that
Replaces each function from the given namespace with a version wrapped
in a tracing call. Can be undone with untrace-ns.  ns should be a namespace object or a symbol.

From http://stackoverflow.com/questions/3346382/clojure-adding-a-debug-trace-to-every-function-in-a-namespace, https://gist.github.com/michalmarczyk/492764
Is now actually part of clojure.tools.trace, but I have version here both for own logging and for betting commenting.

Unfortunately, doesn't work with prismatic schema defn functions, so useless for now.
raw docstring

untrace-nsclj

(untrace-ns ns)

Reverses the effect of trace-ns, replacing each traced function from the given namespace with the original, untraced version.

Reverses the effect of trace-ns, replacing each traced function from the
given namespace with the original, untraced version.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close