This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compare perf of reduce and mapv on small vectors - testing worst case of size 6 | |
## 1.7.0 | |
vecperf.bench=> (def v [0 1 2 3 4 5]) | |
#'vecperf.bench/v | |
vecperf.bench=> (quick-bench (reduce + 0 v)) | |
WARNING: Final GC required 1.508801076780115 % of runtime | |
WARNING: Final GC required 13.47335649374595 % of runtime | |
Evaluation count : 11114412 in 6 samples of 1852402 calls. |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiled from "eclipse.clj" | |
public final class ccw.eclipse$goto_editor_line extends clojure.lang.AFunction { | |
public static final clojure.lang.Var const__0; | |
public static final clojure.lang.Var const__1; | |
public static final clojure.lang.Keyword const__2; | |
public static final clojure.lang.Keyword const__3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IFn findAndCacheBestMethod(Object dispatchVal) { | |
rw.readLock().lock(); | |
Object bestValue; // remember the best match IFn | |
IPersistentMap mt = methodTable; | |
IPersistentMap pt = preferTable; | |
Object ch = cachedHierarchy; | |
try | |
{ | |
Map.Entry bestEntry = null; | |
for(Object o : getMethodTable()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns fun-with-quil.breezy | |
(:use quil.core)) | |
(set! *unchecked-math* true) | |
(def ^:constant screen-w 1920) | |
(def ^:constant screen-h 1080) | |
(defn r ^double [^long x ^long y] | |
(loop [k 0 i 0.0 j 0.0)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn bar-chart-from-ranges-by-name | |
[data step-size] | |
{:pre [(not (nil? data)) | |
(not (empty? data)) | |
(> step-size 0)]} | |
(let [enc-begin (apply min (map first (vals data))) | |
enc-end (apply max (map second (vals data))) | |
enc-length (- enc-end enc-begin) | |
record-list (->> data | |
(map (fn [[k [b e]]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rm () { | |
local path | |
for path in "$@"; do | |
# ignore any arguments | |
if [[ "$path" = -* ]]; then : | |
else | |
local dst=${path##*/} | |
# append the time if necessary | |
while [ -e ~/.Trash/"$dst" ]; do | |
dst="$dst "$(date +%H-%M-%S) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Respondent ID | Text | Category | Sub | |
---|---|---|---|---|
61448432 | Local Adoption. The community is very much concentrated in the US, with the exception of London. In the rest of Europe, not so much. In Belgium we hardly get 6 to 10 people joining a meetup. You see it in conferences too: Clojure presence is much higher at US conferences. | adoption | ||
61454845 | Needs enterprise uptake and buy-in. | adoption | ||
61455773 | It's a fairly insular community. | adoption | ||
61463826 | In Japan... * Very little developer use with clojure. * it is too hard to find clojure developer. * it is too hard to find clojure documents for **non-lisp** programmer (I was non-lisp programmer before use clojure, but I am joyful **lisp style** programming with Clojure). | adoption | ||
61506717 | Not mature enough language yet to be mainstream in corporate datacenters who think .NET is all you need. | adoption |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rm () { | |
local path | |
for path in "$@"; do | |
# ignore any arguments | |
if [[ "$path" = -* ]]; then : | |
else | |
local dst=${path##*/} | |
# append the time if necessary | |
while [ -e ~/.Trash/"$dst" ]; do | |
dst="$dst "$(date +%H-%M-%S) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'clojure.core.async :refer :all) | |
(def MOVES [:rock :paper :scissors]) | |
(def BEATS {:rock :scissors, :paper :rock, :scissors :paper}) | |
(defn rand-player | |
"Create a named player and return a channel to report moves." | |
[name] | |
(let [out (chan)] | |
(go (while true (>! out [name (rand-nth MOVES)]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn mapmap | |
"Apply kf and vf to a sequence, s, and produce a map of (kf %) to (vf %)." | |
([vf s] | |
(mapmap identity vf s)) | |
([kf vf s] | |
(zipmap (map kf s) | |
(map vf s)))) | |
(defn mapmapmap | |
"Apply kf and vf to the keys and vals of a map and zip the results." |