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
local function delta(t0, t1) | |
return ((t1[1] - t0[1]) * 1000000) + (t1[2] - t0[2]) | |
end | |
local t0,t1 | |
local s1 = redis.call("get", KEYS[1]) | |
local s2 = ARGV[1] | |
if s1 == false then | |
redis.call("set", KEYS[1], s2) |
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
package compression; | |
import java.lang.Exception; | |
import java.nio.ByteBuffer; | |
import java.nio.DoubleBuffer; | |
public class FPC { | |
// adapted from http://users.ices.utexas.edu/~burtscher/papers/tr08.pdf | |
private static final int PREDICT_TABLE_SIZE = 32768; |
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
(ns virgil | |
(:require | |
[clojure.java.io :as io] | |
[clojure.string :as str] | |
[filevents.core :as fe]) | |
(:import | |
[javax.tools | |
DiagnosticCollector | |
ForwardingJavaFileManager | |
JavaCompiler |
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
> lein with-profile 1.7:1.8:1517 test | |
Performing task 'test' with profile(s): '1.7' | |
lein test tuple-benchmark.core-test | |
*** clojure-version {:major 1, :minor 7, :incremental 0, :qualifier nil} | |
(conj v 5) 32.262823 ns 0.809081 ns | |
(assoc v 1 3) 22.337496 ns 0.749503 ns | |
(assoc {} :v1 v :v2 v :v3 v) 213.185788 ns 11.127241 ns | |
(subvec v 1 3) 18.584434 ns 0.897182 ns | |
[x y z] 17.703774 ns 0.465559 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
lein test cambrian-collections.vector-test | |
** get persistent hash-map list 1 | |
WARNING: Final GC required 8.313098701152553 % of runtime | |
Evaluation count : 4993110 in 6 samples of 832185 calls. | |
Execution time mean : 120.369962 ns | |
Execution time std-deviation : 5.099541 ns | |
Execution time lower quantile : 115.928642 ns ( 2.5%) | |
Execution time upper quantile : 126.928900 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
lein test cambrian-collections.map-test | |
** get-last key map 1 | |
WARNING: Final GC required 1.013166376278823 % of runtime | |
WARNING: Final GC required 11.57603480504833 % of runtime | |
Evaluation count : 49920990 in 6 samples of 8320165 calls. | |
Execution time mean : 9.931904 ns | |
Execution time std-deviation : 0.359356 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
(defprotocol RingStream | |
(synchronous? [_])) | |
(defprotocol RingWritableStream | |
(put! [_ x cb]) | |
(put-sync! [_ x])) | |
(defprotocol RingReadableStream | |
(take! [_ cb]) | |
(take-sync! [_])) |
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
(ns aleph-test.core | |
(:require [aleph.http :as aleph] | |
[manifold.stream :as stream] | |
[manifold.deferred :as deferred] | |
[compojure.core :as compojure] | |
[compojure.route :as compojure-route] | |
[ring.middleware.params :as ring-params])) | |
(def not-websocket |
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
(ns aleph.websocket-test | |
(:use | |
[clojure test]) | |
(:require | |
[manifold.deferred :as d] | |
[manifold.stream :as s] | |
[aleph.netty :as netty] | |
[byte-streams :as bs] | |
[aleph.http :as http])) |
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 possible-shrinks [s] | |
(let [cnt (count s)] | |
(concat | |
(->> (iterate #(* % 2) 1) | |
(take-while #(< % cnt)) | |
reverse | |
(map #(drop % s))) | |
(->> (iterate #(* % 2) 1) | |
(take-while #(< % cnt)) | |
(map #(take % s))) |