The following compares the output of several creative hash functions designed for human readability.
sha1's are merely used as arbitrary, longer, distributed input values.
input | 1 word output | 2 word output | 3 word output |
---|
The following compares the output of several creative hash functions designed for human readability.
sha1's are merely used as arbitrary, longer, distributed input values.
input | 1 word output | 2 word output | 3 word output |
---|
See the question and discussion on StackOverflow: How to get the fundamental frequency using Harmonic Product Spectrum?.
We’re trying to estimate the fundamental frequency of a voiced A4 note (440 Hz). (See the question for link to audio clip.)
This is an attempt to make assert more friendly by including more details in the assertion error.
In other words, this should make assertion errors easier to reason about:
AssertionError Assert failed: Should be equal
{:user {:plugins [[lein-ancient "0.6.8"] | |
[lein-pprint "1.1.1"]] | |
:resource-paths ["user-resources/sqljdbc4.jar" | |
"user-resources/sqljdbc.jar" | |
"user-resources/ojdbc6.jar"] | |
:dependencies [[org.clojure/java.jdbc "0.3.7"] | |
[org.postgresql/postgresql "9.4.1208"] | |
[mysql/mysql-connector-java "5.1.38"] | |
[net.sourceforge.jtds/jtds "1.3.1"] | |
[org.xerial/sqlite-jdbc "3.8.11.2"] |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
Semantic history command for iTerm2 and Neovim.
In iTerm's Preferences > Profiles > Default > Advanced > Semantic History
, choose Run command...
and enter /your/path/to/iterm_open_with \5 \1 \2
.
(defn throttle [c ms] | |
(let [queued? (atom false)] | |
(with-let [ret (cell @c)] | |
(add-watch c (gensym) | |
#(when-not @queued? | |
(reset! queued? true) | |
(with-timeout ms | |
(reset! queued? false) | |
(reset! ret @c))))))) |
(defn my-get | |
"@param {*} m | |
@param {*} k | |
@return {nil|Object}" | |
[m k] | |
(get m k)) | |
(defn foo | |
"@param {!Object} x" ;; non-nullable | |
[x] x) |
(* -*- mode: ocaml; -*- *) | |
module type NEXT = | |
sig | |
type 'a t | |
exception Timing_error of int * int | |
val delay : (unit -> 'a) -> 'a t | |
val map : ('a -> 'b) -> 'a t -> 'b t | |
val zip : 'a t * 'b t -> ('a * 'b) t |
; compilers are cool | |
(when-let [missing-methods (->> possible-dispatch-values | |
(map #(when-not (get-method multimethod %) %)) | |
(filter identity) | |
seq)] | |
(throw (ex-info "Missing methods for `multimethod`" {:dispatch-vals missing-methods}))) |