This file contains hidden or 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
modulo - 'except' as in "modulo means an equivalence relation modulo its use by programmers" | |
orthogonal - 'unrelated' as in "the use of 'orthogonal' by programmers is orthogonal to its use by mathematicians" | |
land, landed - when a new feature is added to a library, it isn't mearly 'added', it 'lands' -- as if from the heavens, like a magical bird or an expensive jet | |
cut - when a new version of library is released it isn't mearly 'released' it is 'cut' -- like a sparkling diamond | |
curated - if you release a list that wasn't created by an algorithm, then say it's 'curated' as in "A curated list of programmer jargon" |
This file contains hidden or 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
(deftype Qp [] Q (q [this x] x)) | |
=> user.Qp | |
(def Qm {:q (fn [x] x)}) | |
=> #'user/Qm | |
(def Qp1 (Qp.)) | |
=> #'user/Qp1 | |
(c/quick-bench (q Qp1 7)) | |
Evaluation count : 150426264 in 6 samples of 25071044 calls. | |
Execution time mean : 2.073561 ns | |
Execution time std-deviation : 0.274594 ns |
This file contains hidden or 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 copy2clip [x] | |
(let [w (StringWriter.)] | |
(pprint x w) | |
(.. Toolkit getDefaultToolkit getSystemClipboard | |
(setContents (StringSelection. (.toString w)) nil)))) |
This file contains hidden or 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
'From Pharo3.0 of 18 March 2013 [Latest update: #30846] on 1 May 2017 at 5:58:40.759228 pm'! | |
Object subclass: #F | |
instanceVariableNames: '' | |
classVariableNames: '' | |
poolDictionaries: '' | |
category: 'fredkin'! | |
!F commentStamp: 'mjc 3/26/2015 10:19' prior: 0! | |
bits | |
! |
This file contains hidden or 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
; t a list of productions, a an initial sequence | |
; note this halts with a NPE - it should really | |
; check for (empty? a) and reduced | |
(defn g [t a] | |
(reductions | |
(fn [[g & t] a] | |
(if (== 1 g) (concat t a) t)) | |
a (cycle t))) | |
This file contains hidden or 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
(use 'criterium.core) | |
=> nil | |
(def v1 (vec (range 1000000))) | |
=> #'user/v1 | |
(def m1 (into {} (map vector (range 1000000) (range 1000000)))) | |
=> #'user/m1 | |
(quick-bench (get m1 71)) | |
Evaluation count : 9861456 in 6 samples of 1643576 calls. | |
Execution time mean : 60.482667 ns | |
Execution time std-deviation : 1.681717 ns |
This file contains hidden or 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
# https://query.wikidata.org/#PREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%0APREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0APREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0APREFIX%20p%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fstatement%2F%3E%0APREFIX%20pq%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fqualifier%2F%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX%20bd%3A%20%3Chttp%3A%2F%2Fwww.bigdata.com%2Frdf%23%3E%0A%0ASELECT%20%3Fitem%20%3FitemLabel%20%3Fcountry2Label%20%3FlinkTo%0AWHERE%0A%7B%0A%09%3Fitem%20wdt%3AP47%20%3Fcountry2.%0A%20%20%09%3Fcountry2%20wdt%3AP31%20wd%3AQ6256.%0A%20%20%09%3Fitem%20wdt%3AP47%20%3FlinkTo.%0A%20%20%09SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%7D%0A%7D | |
PREFIX wd: <http://www.wikidata.org/entity/> | |
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |
PREFI |
This file contains hidden or 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 '[criterium.core :as crit]) | |
=> nil | |
(defn Q ([x y z] [x y z]) ([{:keys [x y z]}] [x y z])) | |
=> #'repl/Q | |
(crit/quick-bench (Q 4 5 6)) | |
Evaluation count : 43141050 in 6 samples of 7190175 calls. | |
Execution time mean : 12.030810 ns | |
Execution time std-deviation : 0.313706 ns | |
Execution time lower quantile : 11.631011 ns ( 2.5%) | |
Execution time upper quantile : 12.336856 ns (97.5%) |
This file contains hidden or 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 lca | |
"Last common ancestor" | |
[db name1 name2] | |
(d/q '[ | |
:find [(pull ?anc [:db/id :name]) ...] | |
:in $ % ?name1 ?name2 | |
:where | |
(?node1 :name ?name1) | |
(?node2 :name ?name2) | |
(anc ?anc1 ?node1) |
This file contains hidden or 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
div::before { | |
width: 3em; | |
top: -2.6em; | |
height: 3em; | |
transform-origin: 50% 50%; | |
transform: rotate(-29deg); | |
position: relative; | |
z-index: 10000000; | |
margin-bottom: -3em; | |
content: url("data:image/svg+xml;utf8,<svg height='100%' viewBox='-8 -8 16 16' width='100%' xmlns='http://www.w3.org/2000/svg'><g><rect fill='white' height='5' stroke-width='0.25' stroke='black' transform='rotate(45) translate(8,8)' width='5' x='-10.5' y='-10.5'></rect><rect fill='white' height='5' stroke-width='0.25' stroke='black' width='15' x='-7.5' y='0'></rect><text font-family='monospace' font-size='2.5' x='-5' y='3.25'>CHEESE</text></g></svg>"); |