Liking cljdoc? Tell your friends :D

tupelo.misc

Miscellaneous functions.

Miscellaneous functions.
raw docstring

*os-shell*clj

source

byte-signed->hexclj/s

(byte-signed->hex signed-byte)

Inputs: [signed-byte] Returns: s/Str

Converts a sequence of unsigned bytes [0..255] to a hex string, where each byte becomes 2 hex digits.

Inputs: [signed-byte]
Returns: s/Str

Converts a sequence of unsigned bytes [0..255] to a hex string, where each byte becomes 2 hex digits.
sourceraw docstring

byte-signed->unsignedclj/s

(byte-signed->unsigned signed-byte)

Inputs: [signed-byte :- s/Int]

Converts a signed byte [-128..127] into an unsigned byte [0..255].

Inputs: [signed-byte :- s/Int]

Converts a signed byte [-128..127] into an unsigned byte [0..255].
sourceraw docstring

byte-unsigned->hexclj/s

(byte-unsigned->hex unsigned-byte)

Inputs: [unsigned-byte :- s/Int] Returns: s/Str

Converts a sequence of unsigned bytes [0..255] to a hex string, where each byte becomes 2 hex digits.

Inputs: [unsigned-byte :- s/Int]
Returns: s/Str

Converts a sequence of unsigned bytes [0..255] to a hex string, where each byte becomes 2 hex digits.
sourceraw docstring

byte-unsigned->signedclj/s

(byte-unsigned->signed unsigned-int)

Inputs: [unsigned-int :- s/Int]

Converts an unsigned int value [0..255] into a signed byte [-128..127].

Inputs: [unsigned-int :- s/Int]

Converts an unsigned int value [0..255] into a signed byte [-128..127].
sourceraw docstring

bytes-signed->hex-strclj/s

(bytes-signed->hex-str signed-bytes)

Inputs: [signed-bytes :- [s/Int]] Returns: s/Str

Converts a sequence of signed bytes [-128..127] to a hex string, where each byte becomes 2 hex digits.

Inputs: [signed-bytes :- [s/Int]]
Returns: s/Str

Converts a sequence of signed bytes [-128..127] to a hex string, where each byte becomes 2 hex digits.
sourceraw docstring

bytes-signed->unsignedclj/s

(bytes-signed->unsigned byte-vals)

Inputs: [byte-vals]

Converts a vector of signed byte values [-128..127] into one of unsigned byte values [0..255]

Inputs: [byte-vals]

Converts a vector of signed byte values [-128..127] into one of unsigned byte values [0..255] 
sourceraw docstring

bytes-unsigned->hex-strclj/s

(bytes-unsigned->hex-str unsigned-bytes)

Inputs: [unsigned-bytes :- [s/Int]] Returns: s/Str

Converts a sequence of unsigned bytes [0..255] to a hex string, where each byte becomes 2 hex digits.

Inputs: [unsigned-bytes :- [s/Int]]
Returns: s/Str

Converts a sequence of unsigned bytes [0..255] to a hex string, where each byte becomes 2 hex digits.
sourceraw docstring

bytes-unsigned->signedclj/s

(bytes-unsigned->signed byte-vals)

Inputs: [byte-vals]

Converts a vector of unsigned byte values [0..255] into one of signed byte values [-128..127]

Inputs: [byte-vals]

Converts a vector of unsigned byte values [0..255] into one of signed byte values [-128..127]
sourceraw docstring

caller-ns-funcclj

(caller-ns-func)

Returns a map with the caller's namespace and function names as strings, like: {:ns-name 'tst.demo.core' :fn-name 'funky'}

Returns a map with the caller's namespace and function names as strings, like:
{:ns-name 'tst.demo.core' :fn-name 'funky'} 
sourceraw docstring

dotclj

(dot)

Prints a single dot (flushed) to the console, keeping a running count of dots printed. Wraps to a newline when 100 dots have been printed. Displays the running dot count at the beginning of each line. Usage:

(ns xxx.core (:require [tupelo.misc :as tm])) (tm/dots-config! {:decimation 10} ) (tm/with-dots (doseq [ii (range 2345)] (tm/dot) (Thread/sleep 5)))

Prints a single dot (flushed) to the console, keeping a running count of dots printed.  Wraps to a
newline when 100 dots have been printed. Displays the running dot count at the beginning of each line.
Usage:

  (ns xxx.core
    (:require [tupelo.misc :as tm]))
  (tm/dots-config! {:decimation 10} )
  (tm/with-dots
    (doseq [ii (range 2345)]
      (tm/dot)
      (Thread/sleep 5)))
sourceraw docstring

dot-counter-watch-fnclj

(dot-counter-watch-fn key dot-counter-ref old-count new-count)
source

dots-config!clj

(dots-config! ctx)
source

factorialclj/s

(factorial n)

Inputs: [n :- s/Int] Returns: s/Int

Computes the factorial of N

Inputs: [n :- s/Int]
Returns: s/Int

Computes the factorial of N
sourceraw docstring

find-patternclj/s

(find-pattern pattern-vec data-vec)

Inputs: [pattern-vec :- tsk/List data-vec :- tsk/List] Returns: [s/Int]

Searches for pattern-vec within data-vec, returning a lazy seq of indexes into data-vec.

Inputs: [pattern-vec :- tsk/List data-vec :- tsk/List]
Returns: [s/Int]

Searches for pattern-vec within data-vec, returning a lazy seq of indexes into data-vec.
sourceraw docstring

get-osclj

(get-os)
source

get-pathclj

(get-path path-str)

Wrapper for Java Paths/get to work around the varargs strangeness

Wrapper for Java Paths/get to work around the varargs strangeness
sourceraw docstring

hex->intclj/s

source

hex-charsclj/s

source

hex-str->signed-bytesclj/s

(hex-str->signed-bytes hex-str)

Inputs: [hex-str :- s/Str]

Converts a hex string to a vector of unsigned bytes

Inputs: [hex-str :- s/Str]

Converts a hex string to a vector of unsigned bytes
sourceraw docstring

hex-str->unsigned-bytesclj/s

(hex-str->unsigned-bytes hex-str)

Inputs: [hex-str :- s/Str]

Converts a hex string to a vector of unsigned bytes

Inputs: [hex-str :- s/Str]

Converts a hex string to a vector of unsigned bytes
sourceraw docstring

HIDclj/s

source

hid->widclj

(hid->wid hid)

Inputs: [hid :- HID] Returns: s/Keyword

Uses an HID to look up a human-friendly Word-ID (WID) from an English dictionary. Useful for debugging purposes.

Inputs: [hid :- HID]
Returns: s/Keyword

Uses an HID to look up a human-friendly Word-ID (WID) from an English dictionary.
     Useful for debugging purposes.
sourceraw docstring

hid?clj/s

(hid? arg)

Inputs: [arg] Returns: s/Bool

Returns true if the arg is a legal HexID

Inputs: [arg]
Returns: s/Bool

Returns true if the arg is a legal HexID
sourceraw docstring

int->hexclj/s

source

log-uncaught-exceptionsclj

(log-uncaught-exceptions)
source

new-hidclj/s

(new-hid)

Inputs: [] Returns: HID

Returns a new HexID

Inputs: []
Returns: HID

Returns a new HexID
sourceraw docstring

round-powclj

(round-pow val pow)

Round a floating point number to 2 decimal places

Round a floating point number to 2 decimal places
sourceraw docstring

sha-uuidclj/s

(sha-uuid)

Inputs: [] Returns: s/Str

Returns a string that is the SHA-1 hash of the Clojure: (clj-uuid/v1) ClojureScript: (cljs.core/random-uuid)

Inputs: []
Returns: s/Str

Returns a string that is the SHA-1 hash of the
  Clojure:         (clj-uuid/v1)
  ClojureScript:   (cljs.core/random-uuid)  
sourceraw docstring

shell-cmdclj

(shell-cmd cmd-str)

Runs a command string in the default OS shell (/bin/bash); returns result in a Clojure map. Example:

(shell-cmd "ls -ldF *")

;=> {:exit 0 ; unix exit status (0 -> normal) :err '' ; text from any errors :out '...' ; text output as would printed to console }

Runs a command string in the default OS shell (/bin/bash); returns result in a Clojure map.
 Example:

(shell-cmd "ls -ldF *")

  ;=>   {:exit    0     ; unix exit status (0 -> normal)
         :err    ''     ; text from any errors
         :out    '...'  ; text output as would printed to console
        } 
sourceraw docstring

str->byte-arrayclj/s

(str->byte-array str-val)

Inputs: [str-val :- s/Str]

Inputs: [str-val :- s/Str]
sourceraw docstring

str->shaclj/s≠

clj

Returns the SHA-1 hex string for a string

Returns the SHA-1 hex string for a string
cljs
(str->sha str-val)

Inputs: [str-val :- s/Str]

Inputs: [str-val :- s/Str]
source (clj)source (cljs)raw docstring

take-distclj/s

(take-dist n coll)

Returns a sequence of n items from a collection, distributed evenly between first & last elements, which are always included.

Returns a sequence of n items from a collection, distributed
evenly between first & last elements, which are always included.
sourceraw docstring

uuid->shaclj/s

(uuid->sha uuid)

Returns the SHA-1 hex string for a UUID's string representation

Returns the SHA-1 hex string for a UUID's string representation
sourceraw docstring

with-dotsclj/smacro

(with-dots & body)

Increments indentation level of all spy, spyx, or spyxx expressions within the body.

Increments indentation level of all spy, spyx, or spyxx expressions within the body.
sourceraw docstring

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

× close