Fiction
- Fictions and The Aleph by Borges
- Invisible Cities by Calvino
More Technical
- An Introduction to General Systems Thinking by Weinberg
- Data and Reality by Kent
- Patterns of Software by Gabriel
| (require | |
| '[clojure.string as str] | |
| '[manifold.stream :as s] | |
| '[byte-streams :as bs]) | |
| ;; approach #1 | |
| (defn handler [s _] | |
| (s/connect | |
| (s/map #(str/upper-case (bs/to-string %))) | |
| s)) |
Fiction
More Technical
| (ns foami.core | |
| "FOreign Asynchronous Mechanism Interop" | |
| (:require [clojure.core.async :as async])) | |
| (defn put! | |
| "Takes a `ch`, a `msg`, a single arg function that when passed `true` enables backpressure | |
| and when passed `false` disables it, and a no-arg function which, when invoked, closes the | |
| upstream source." | |
| [ch msg backpressure! close!] | |
| (let [status (atom :sending] |
I hereby claim:
To claim this, I am signing this object:
| diff --git a/src/jvm/clojure/lang/PersistentUnrolledMap.java b/src/jvm/clojure/lang/PersistentUnrolledMap.java | |
| new file mode 100644 | |
| index 0000000..c5b401c | |
| --- /dev/null | |
| +++ b/src/jvm/clojure/lang/PersistentUnrolledMap.java | |
| @@ -0,0 +1,3292 @@ | |
| +/** | |
| + * Copyright (c) Rich Hickey. All rights reserved. | |
| + * The use and distribution terms for this software are covered by the | |
| + * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) |
| (future | |
| (loop [next-update (+ (System/currentTimeMillis) 1e3)] | |
| (with-open [w (io/writer path)] | |
| (.write w (str (.time ^PartialFlake @f)))) | |
| ;; sleep for a second before writing the next timestamp | |
| (Thread/sleep (- next-update (System/currentTimeMillis))) | |
| (recur (+ next-update 1e3)))) |
| (deftest test-let-flow | |
| (is (= 5 | |
| @(let [z (future 1)] | |
| (let-flow [x (future (future z)) | |
| y (future (+ z x))] | |
| (future (+ x x y z))))))) |
| (ns trice.stack | |
| (:require | |
| [clj-radix :as r]) | |
| (:import | |
| [java.lang.reflect | |
| Array] | |
| [java.lang.management | |
| ThreadMXBean | |
| ManagementFactory | |
| ThreadInfo] |
| (def ^ThreadLocal stack-depth (ThreadLocal.)) | |
| (def ^Executor overflow-protection-pool | |
| (let [cnt (atom 0)] | |
| (Executors/newCachedThreadPool | |
| (thread-factory #(str "manifold-overflow-protection-pool-" (swap! cnt inc)))))) | |
| (def ^:const max-depth 50) | |
| (defmacro without-overflow [& body] |
| (def b (->> "a-file" | |
| java.io.File. | |
| java.io.FileInputStream. | |
| aleph.formats/bytes->byte-array)) | |
| (use 'aleph.http) | |
| (def s | |
| (start-http-server | |
| (wrap-ring-handler |