(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.
(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
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
(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.
(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
(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
(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
(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.
(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
(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
(get-utc-now-zoned-dt)
(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
(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)
(local-date-in-range? start-local-date end-local-date local-date)
(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.
(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.
(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.
(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.
(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.
(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
(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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close