I hereby claim:
- I am akeboshiwind on github.
- I am olivermarshall (https://keybase.io/olivermarshall) on keybase.
- I have a public key ASDLJs6hPFndnzWlsd3LtY9n4d0Pa18vZtsF-TzHF7ZIzQo
To claim this, I am signing this object:
| # Run the docker container w/ /tmp/xtdb-data-dir as the data folder | |
| docker run --pull=always -tip 6543:3000 -v /tmp/xtdb-data-dir:/var/lib/xtdb ghcr.io/xtdb/xtdb-standalone-ea | |
| # Verify the initial size: | |
| du -h /tmp/xtdb-data-dir | |
| # (should be 0B) | |
| # Construct a large input file (around 1MB) | |
| echo -n '{"txOps":[{"putDocs":[{"xt/id":1,"doc":"' > /tmp/file | |
| dd if=/dev/urandom bs=786438 count=1 | base64 >> /tmp/file |
| ; Add some sensor readings for sensor :a | |
| (xt/submit-tx xtdb-node | |
| [; Day 1: You get a reading of 1 | |
| [::xt/put | |
| {:xt/id :a :value 1} | |
| #inst "2024-01-01"] | |
| ; Day 2: You get a reading of 2 | |
| [::xt/put | |
| {:xt/id :a :value 2} | |
| #inst "2024-01-02"] |
| ; Source: https://github.com/xtdb/sakila-playground/tree/a5a202364b023bac7de17c9a4acf820423a4d22c | |
| [:put-docs :actor {:first_name "PENELOPE", :last_name "GUINESS", :xt/id 1}] | |
| [:put-docs :actor {:first_name "NICK", :last_name "WAHLBERG", :xt/id 2}] | |
| [:put-docs :actor {:first_name "ED", :last_name "CHASE", :xt/id 3}] | |
| [:put-docs :actor {:first_name "JENNIFER", :last_name "DAVIS", :xt/id 4}] | |
| [:put-docs :actor {:first_name "JOHNNY", :last_name "LOLLOBRIGIDA", :xt/id 5}] | |
| [:put-docs :actor {:first_name "BETTE", :last_name "NICHOLSON", :xt/id 6}] | |
| [:put-docs :actor {:first_name "GRACE", :last_name "MOSTEL", :xt/id 7}] | |
| [:put-docs :actor {:first_name "MATTHEW", :last_name "JOHANSSON", :xt/id 8}] | |
| [:put-docs :actor {:first_name "JOE", :last_name "SWANK", :xt/id 9}] |
| ;; >> No errors | |
| ;; Works as expected | |
| (defn ^:gen foo [] | |
| (js-yield 1) | |
| (js-yield* [2 3]) | |
| (let [x (do (js-yield 4) | |
| 5)] | |
| (js-yield x))) |
| +reddit.com/comments | |
| +reddit.com/gallery | |
| +reddit.com/message | |
| +reddit.com/r/*/comments | |
| +reddit.com/r/*/wiki | |
| reddit.com | |
| youtube.com |
I hereby claim:
To claim this, I am signing this object:
| (ns clojupyter.echarts | |
| (:require [clojupyter.misc.display :as display] | |
| [cheshire.core :as json] | |
| [cuerdas.core :as str])) | |
| (defn init [] | |
| (let [code " | |
| require.config({ | |
| paths: { |
| ;; gorilla-repl.fileformat = 1 | |
| ;; ** | |
| ;;; # LastFM Analysis | |
| ;; ** | |
| ;; @@ | |
| (ns lastfm-analysis | |
| (:require [gorilla-plot.core :as plot])) |
| ;; Todo: write as a transducer | |
| (defn reservoir-sample | |
| "Uniformly choose a sample of k elements from lst" | |
| [k lst] | |
| (first | |
| (reduce | |
| (fn [[sample length] next] | |
| (let [r (rand-int length)] | |
| [(if (< r k) | |
| (assoc sample r next) |
| (defn heavy-hitter | |
| "Output the lement in the list that came up more than 50% of the time, nil otherwise." | |
| [lst] | |
| (let [heavy (heavy-hitter* lst)] | |
| (when (->> lst | |
| (filter (partial = heavy)) | |
| (count) | |
| (<= (/ (count lst) 2))) | |
| heavy))) |