First cut at a photo migrator old-embed -> hecuba.

Still has some issues, but the bones are there.

It seems that some of the paths in the existing data are invalid.

e.g.

select id, photos from entities where
id='adce5e2650f7532e26b969a3f8743fab3df7cadd';

the path to the photo doesn't exist.

error: pathspec 'dev/photo_migration.clj' did not match any file(s) known to git

--- dev/photo_migration.clj
+++ dev/photo_migration.clj
@@ -0,0 +1,52 @@
+(ns photo-migration
+  (:require [kixi.hecuba.data.entities        :as entities]
+            [kixi.hecuba.storage.db           :as db]
+            [kixipipe.storage.s3              :as s3]
+            [cheshire.core                    :as json]
+            [clojure.java.io                  :as io]
+            [kixipipe.ioplus                  :as ioplus]
+            [kixi.hecuba.data.entities.upload :as upload]
+            [clojure.tools.logging            :as log]
+            [kixi.hecuba.webutil              :refer (uuid)]))
+
+;; temp hack - we should put this in the config as a separate
+;; component, but this is a throwaway migration so fudge it for now.
+;; you need to fill this in.
+(def old-embed-s3-session (s3/mk-session {:access-key ""
+                                          :secret-key ""
+                                          :file-bucket "get-embed-data"
+                                          :download-dir "/tmp"}))
+
+(defn path-from [p]
+  (-> p
+      (json/parse-string keyword)
+      :path))
+
+;; TODO - need to look at the path things end up at in s3.
+(defn get-item-from-old-embed-bucket [key]
+  (let [outfile (ioplus/mk-temp-file! "photo-migration" "")]
+    (.deleteOnExit outfile)
+    (when (s3/item-exists? old-embed-s3-session key)
+      (with-open [in (s3/get-object-by-metadata old-embed-s3-session {:key key})]
+        (io/copy in outfile))
+      {:src-name  "uploads"
+       :feed-name "photo-migrations"
+       :uuid      (uuid)
+       :dir       (.getParent outfile)
+       :filename  (.getName outfile)})))
+
+(defn migrate-photos [{:keys [store]}]
+  (db/with-session [session (:hecuba-session store)]
+    (doseq [{:keys [id photos]} (entities/get-all session)]
+      (log/info "migrating photos for " id)
+      (entities/update session id {:photos []})
+      (doseq [item (keep get-item-from-old-embed-bucket (map path-from photos))]
+        (log/info "migrating path for " item)
+        (upload/image-upload store  (assoc item :entity_id id))))))
+
+(comment
+  ;; from 'user ns after (go)
+  (require '[photo-migration :refer (migrate-photos)])
+  (migrate-photos system)
+
+  )


test fix

test fix

--- src/metabase/driver/mongo/query_processor.clj
+++ src/metabase/driver/mongo/query_processor.clj
@@ -159,8 +159,10 @@
                  limit        (:limit (:query *query*))
                  keep-taking? (if limit (fn [_]
                                           (< (count values) limit))
-                                  (constantly true))]
-             (->> (i/field-values-lazy-seq @(ns-resolve 'metabase.driver.mongo 'driver) (sel :one field/Field :id (:field-id field))) ; resolve driver at runtime to avoid circular deps
+                                  (constantly true))
+                 field-id     (or (:field-id field)             ; Field
+                                  (:field-id (:field field)))]  ; DateTimeField
+             (->> (i/field-values-lazy-seq @(ns-resolve 'metabase.driver.mongo 'driver) (sel :one field/Field :id field)) ; resolve driver at runtime to avoid circular deps
                   (filter identity)
                   (map hash)
                   (map #(conj! values %))


Buffer for ui render tasks.

Buffer for ui render tasks.

error: pathspec 'src/fm/simrunner/gui/task_buffer.clj' did not match any file(s) known to git

--- src/fm/simrunner/gui/task_buffer.clj
+++ src/fm/simrunner/gui/task_buffer.clj
@@ -0,0 +1,31 @@
+(ns
+  ^{:doc
+
+  "A buffer for render tasks."
+
+    :author "Frank Mosebach"}
+  fm.simrunner.gui.task-buffer)
+
+(defn task-buffer []
+  [() ()])
+
+(defn submit [buffer task & tasks]
+  [(reduce (fn [tasks task]
+             (if (nil? task)
+               (throw (IllegalArgumentException. "A task must not be nil!"))
+               (cons task tasks)))
+           (first buffer)
+           (cons task tasks)) ()])
+
+(defn stage [buffer]
+  (let [[tasks] buffer]
+    [() (or tasks ())]))
+
+(defn staged [buffer]
+  (let [[_ staged] buffer]
+    (reverse staged)))
+
+(defn drain [buffer]
+  (let [[tasks] buffer]
+    [(or tasks ()) ()]))
+


GC now-unused code.

GC now-unused code.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/cstorey/nrod.git/'


[WM] leave the colons in keywords in CSV

This actually helps identify what things are programmatic rather than
read by a user.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/election-authority-works.git/'


Implicit do

Implicit do

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/michaelsbradleyjr/shen.clj.git/'


[WM] make email, citizenship, and DOB optional

We'll need to undo some of this and/or make it state-specific down the
road. But this will work for now.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/voter-registration-works.git/'


only animate glyphs on non-mobile devices (based on screen size)

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/clojurecup/cc2014-frontend.git/'


test runner for all tests

test runner for all tests

error: pathspec 'test/cljs/gc_api_browser/test_runner.cljs' did not match any file(s) known to git

--- test/cljs/gc_api_browser/test_runner.cljs
+++ test/cljs/gc_api_browser/test_runner.cljs
@@ -0,0 +1,16 @@
+(ns gc-api-browser.test-runner
+  (:require [cljs.test :refer-macros [run-tests]]
+            [gc-api-browser.history-test]
+            [gc-api-browser.json-pointer-test]
+            [gc-api-browser.json-schema-test]
+            [gc-api-browser.schema-example-test]
+            [gc-api-browser.schema-select-test]
+            [gc-api-browser.url-bar-test]))
+
+(run-tests
+  'gc-api-browser.history-test
+  'gc-api-browser.json-pointer-test
+  'gc-api-browser.json-schema-test
+  'gc-api-browser.schema-example-test
+  'gc-api-browser.schema-select-test
+  'gc-api-browser.url-bar-test)


Add stub for secret-handshake

Add stub for secret-handshake

error: pathspec 'exercises/secret-handshake/src/secret_handshake.clj' did not match any file(s) known to git

--- exercises/secret-handshake/src/secret_handshake.clj
+++ exercises/secret-handshake/src/secret_handshake.clj
@@ -0,0 +1,5 @@
+(ns secret-handshake)
+
+(defn commands [] ;; <- Arglist goes here
+      ;; your code goes here
+      )


Computing Möbius functions of concept lattices

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

error: pathspec 'src/conexp/contrib/experimental/moebius.clj' did not match any file(s) known to git

--- src/conexp/contrib/experimental/moebius.clj
+++ src/conexp/contrib/experimental/moebius.clj
@@ -0,0 +1,41 @@
+;; Copyright (c) Daniel Borchmann. 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)
+;; which can be found in the file LICENSE at the root of this distribution.
+;; By using this software in any fashion, you are agreeing to be bound by
+;; the terms of this license.
+;; You must not remove this notice, or any other, from this software.
+
+(ns conexp.contrib.experimental.moebius
+  (:use conexp.main))
+
+(ns-doc "Computing the Möbius function of concept lattices")
+
+;;;
+
+(defn moebius-function
+  "Returns the Möbius function of the concept lattice of the given
+  formal context ctx."
+  [ctx]
+  (let [objects   (objects ctx),
+        dprime    (fn [X]
+                    (context-object-closure ctx X)),
+        mf-helper (fn mf-helper [A B]
+                    (if (= A B)
+                      1
+                      (reduce (fn [sum X]
+                                (if (proper-subset? X B)
+                                  (+ sum (mf-helper A X))
+                                  sum))
+                              0
+                              (all-closed-sets-in-family (fn [X]
+                                                           (lectic-< objects X B))
+                                                         objects
+                                                         dprime
+                                                         A))))]
+    (fn [[A _] [B _]]
+      (mf-helper A B))))
+
+;;;
+
+nil


More testing arity for restart-subscription-by-phone

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/election-notification-works.git/'


Update to the latest Kehaar

Update to the latest Kehaar

Just pulls in a bug fix release

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/form-works.git/'


Remove figwheel nrepl port

Remove figwheel nrepl port

--- project.clj
+++ project.clj
@@ -63,7 +63,6 @@
                    :plugins [[lein-cljsbuild "1.1.2"]
                              [lein-doo "0.1.6"]
                              [lein-figwheel "0.5.0-6"]]
-                   :figwheel {:nrepl-port 7888}
                    :resource-paths ["test-resources" "target"]}
              :repl {:dependencies [[com.cemerick/piggieback "0.2.1"]]
                     :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}


don't customize target and compile paths


remove webgl dependency

remove webgl dependency

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/macrology-laboratory/gcljs.git/'


add compile configuration

add compile configuration

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/sbondaryev/cljs-worker.git/'


Revert back to clojure 1.9.0

Revert back to clojure 1.9.0

...going back to 1.8.0 didn't help

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/turbovote-http-api.git/'


Bump nrepl

Bump nrepl

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/terrancesnyder/engulf.git/'


Add some injections in development profile.

--- project.clj
+++ project.clj
@@ -9,15 +9,18 @@
   :deploy-repositories {"releases" :clojars
                         "snapshots" :clojars}
   :profiles
-  {:dev {:hooks [cljx.hooks
-                 leiningen.cljsbuild]
+  {:dev {:hooks [cljx.hooks]
          :jar-exclusions [#"\.cljx|\.swp|\.swo|\.DS_Store"]
          :dependencies [[org.clojure/clojurescript "0.0-2227"]
+                        [org.clojure/tools.namespace "0.2.4"]
                         [com.cemerick/clojurescript.test "0.3.1"]]
+         :prep-tasks ["cljx" "javac" "compile"]
          :plugins [[com.keminglabs/cljx "0.4.0"]
                    [com.cemerick/clojurescript.test "0.3.1"]
                    [lein-cljsbuild "1.0.3"]]
-         :prep-tasks ["cljx" "javac" "compile"]
+         :injections [(use '[clojure.tools.namespace.repl :only (refresh)])
+                      (require '[cats.types :as t])
+                      (require '[cats.core :as m])]
          :cljx {:builds [{:source-paths ["src/cljx"]
                           :output-path "target/classes"
                           :rules :clj}
@@ -29,13 +32,15 @@
                           :rules :clj}
                          {:source-paths ["tests"]
                           :output-path "target/testclasses"
-                          :rules :cljs}]}
-         :cljsbuild {:test-commands {"unit-tests" ["node" :node-runner
-                                                   "target/tests.js"]}
-                     :builds {:test {:source-paths ["target/testclasses"
-                                                    "target/classes"]
-                                     :compiler {:output-to "target/tests.js"
-                                                :optimizations :simple
-                                                :pretty-print true}}}}}})
+                          :rules :cljs}]}}
+
+   :test [:dev {:hooks [leiningen.cljsbuild]
+                :cljsbuild {:test-commands {"unit-tests" ["node" :node-runner
+                                                          "target/tests.js"]}
+                            :builds {:test {:source-paths ["target/testclasses"
+                                                           "target/classes"]
+                                            :compiler {:output-to "target/tests.js"
+                                                       :optimizations :simple
+                                                       :pretty-print true}}}}}]})


Version 1.15.0-SNAPSHOT

Version 1.15.0-SNAPSHOT

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/starcity-properties/odin.git/'


call the field for current page current-page


finish clojure version

finish clojure version

error: pathspec 'Perfect-Number/PN.clj' did not match any file(s) known to git

--- Perfect-Number/PN.clj
+++ Perfect-Number/PN.clj
@@ -0,0 +1,12 @@
+(defn checkPerfectNumber [num]
+  (cond (<= num 1) false
+        :else
+        (let [upper (-> num (Math/sqrt) (Math/floor) (+ 1))
+              sumNum (atom 0)]
+          (doseq [i (range 1 upper)
+                :when (= (mod num i) 0)
+                :let [ii (/ num i)]]
+            (swap! sumNum + i ii))
+          (if (= num (- @sumNum num))
+            true
+            false))))


Made an image endpoint.

Made an image endpoint.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/jagtalon/what-the-fuck-do-you-want-to-listen-to.git/'


fix iOS strangeness with glyphs

fix iOS strangeness with glyphs


Refactor: put item-details background color in...

... colorscheme, and remove redundant :color attribute.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Reefersleep/sleepydo.git/'


Add test for to-primitives namespace.

Add test for to-primitives namespace.

error: pathspec 'test/berry/converter/to_primitives_test.clj' did not match any file(s) known to git

--- test/berry/converter/to_primitives_test.clj
+++ test/berry/converter/to_primitives_test.clj
@@ -0,0 +1,30 @@
+(ns berry.converter.to-primitives-test
+  (:require [berry.converter.to-primitives :refer :all]
+            [clojure.test :refer :all]))
+
+(deftest primitive-types-conversion
+  (let [options {}]
+
+    (testing "to-boolean"
+
+             (is (and
+                   (= "true" (to-boolean true options)))
+                 (= "false" (to-boolean false options))))
+
+    (testing "to-null"
+
+             (is (= "null" (to-null nil options))))
+
+    (testing "to-number"
+
+             (testing "Floating-point numbers"
+
+                      (is (= "15.3" (to-number 15.3 options))))
+
+             (testing "Integers."
+
+                      (is (= "21" (to-number 21 options)))))
+
+    (testing "to-string"
+
+             (is (= "\"hello\"" (to-string "hello" options))))))


fix issue after merge from master where colored messaging is done a different way now.

--- src/metabase/driver/sync.clj
+++ src/metabase/driver/sync.clj
@@ -96,7 +96,7 @@
   [driver active-tables]

   ;; make sure table has :display_name
-  (log/debug (color/green "Checking table display names..."))
+  (log/debug (u/format-color 'green "Checking table display names..."))
   (doseq [table active-tables]
     (u/try-apply update-table-display-name! table))

@@ -140,7 +140,7 @@
     (when (nil? (:display_name table))
       (upd Table (:id table) :display_name (common/name->human-readable-name (:name table))))
     (catch Throwable e
-      (log/error (color/red (format "Unable to update display_name for %s: %s" (:name table) (.getMessage e)))))))
+      (log/error (u/format-color 'red "Unable to update display_name for %s: %s" (:name table) (.getMessage e))))))

 ;; ### 1) update-table-row-count!


improve wording around surrounding move-out date


clarify copy

clarify copy


update book services copy

update book services copy


うーん、なんかスッキリしない

うーん、なんかスッキリしない

error: pathspec 'POH6/kirishima/answer.clj' did not match any file(s) known to git

--- POH6/kirishima/answer.clj
+++ POH6/kirishima/answer.clj
@@ -0,0 +1,21 @@
+;
+; 結果 https://paiza.jp/poh/joshibato/kirishima/result/ef4cc2c8
+;
+
+(let [  n (Integer/parseInt (read-line))
+        t (map #(Integer/parseInt %) (clojure.string/split (read-line) #" "))
+        m (Integer/parseInt (read-line))
+        ]
+    (println (clojure.string/join "\n"
+        (for [i (range m)]
+            (loop [d (Integer/parseInt (read-line)) tf () tb t]
+                (let [f (first tf) fs (rest tf) b (first tb) bs (rest tb)]
+                    (cond
+                        (and (< d 1) (empty? tf)) "No"
+                        (empty? bs) (if (> d 0) "No" "Yes")
+                        (> d 0) (recur (dec d) (cons b tf) bs)
+                        (< d 0) (recur (inc d) fs (cons f tb))
+                        :else (if (= b 0) "No" (recur b tf (cons 0 bs)))
+                    ))))))
+    )
+


gehitu-erabiltzailea! atera

gehitu-erabiltzailea! atera

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/lnmnd/magnet.zer.git/'


First cut of TAP reporter plugin

First cut of TAP reporter plugin

The basic functionality is there. Some tests on Midje fail and future
facts are not supported, yet.

* src/midje/emission/plugins/tap.clj:

error: pathspec 'src/midje/emission/plugins/tap.clj' did not match any file(s) known to git

--- src/midje/emission/plugins/tap.clj
+++ src/midje/emission/plugins/tap.clj
@@ -0,0 +1,78 @@
+(ns ^{:doc "TAP output. See http://testanything.org"}
+    midje.emission.plugins.tap
+  (:use midje.emission.util)
+  (:require [midje.data.fact :as fact]
+            [midje.emission.state :as state]
+            [midje.emission.plugins.util :as util]
+            [midje.emission.plugins.silence :as silence]
+            [midje.emission.plugins.default-failure-lines :as lines]
+            [clojure.string :as str]))
+
+(def fact-counter (atom 0))
+
+(defn- format-failure-summary [failure-map]
+  (let [[_ _ & more] (lines/summarize failure-map)]
+    (map #(str "# " %) (conj more (apply str (:position failure-map))))))
+
+(defn fail [failure-map]
+  (do
+    (swap! fact-counter inc)
+    (util/emit-lines (format-failure-summary failure-map))
+    (util/emit-one-line
+     (str "not ok " @fact-counter))))
+
+(defn pass []
+  (do
+    (swap! fact-counter inc)
+    (util/emit-one-line (str "ok " @fact-counter))))
+
+(def last-namespace-shown (atom nil))
+
+(defn set-last-namespace-shown! [string]
+  (reset! last-namespace-shown string))
+
+(defn possible-new-namespace [namespace-symbol]
+  (when (not= namespace-symbol @last-namespace-shown)
+    (util/emit-one-line (str "# Namespace " namespace-symbol))
+    (set-last-namespace-shown! namespace-symbol)))
+
+(defn starting-fact-stream []
+  (set-last-namespace-shown! nil))
+
+(defn starting-to-check-fact [fact]
+  (util/emit-one-line (str "# Checking "
+                           (or (fact/name fact)
+                               (fact/description fact)
+                               (str "fact at " (midje-position-string
+                                                [(fact/file fact)
+                                                 (fact/line fact)]))))))
+
+
+(defn finishing-fact-stream [midje-counters clojure-test-map]
+  (let [passes-and-failures (+ (:midje-passes midje-counters) (:midje-failures midje-counters))]
+    (util/emit-one-line (str 1 ".." passes-and-failures
+                             (when-not passes-and-failures
+                               "# No facts were checked. Is that what you wanted?")))))
+
+(defn future-fact [description-list position]
+  (util/emit-one-line "")
+  (util/emit-one-line (str "WORK TO DO" " "
+                           (when-let [doc (util/format-nested-descriptions description-list)]
+                             (str (pr-str doc) " "))
+                           "at " (util/filename-lineno position))))
+
+(defn make-map [& keys]
+  (zipmap keys
+          (map #(ns-resolve *ns* (symbol (name %))) keys)))
+
+
+(def emission-map (merge silence/emission-map
+                         (make-map :fail
+                                   :pass
+                                   :future-fact
+                                   :starting-to-check-fact
+                                   :possible-new-namespace
+                                   :finishing-fact-stream
+                                   :starting-fact-stream)))
+
+(state/install-emission-map emission-map)


Add more tests

Add more tests

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/leif47/immutabledb-experimental.git/'


clarify dox and switch `map` to `mapv` to avoid lazy sequence closed conn issues

--- src/metabase/models/table.clj
+++ src/metabase/models/table.clj
@@ -10,12 +10,13 @@
   (table :metabase_table))

 (defn jdbc-columns
+  "Fetch information about the various columns for Table with TABLE-NAME by getting JDBC metadata for DATABASE."
   [database table-name]
   (with-jdbc-metadata database
     (fn [md] (->> (-> md
                      (.getColumns nil nil table-name nil) ; ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
                      jdbc/result-set-seq)
-                 (map #(select-keys % [:column_name :type_name]))))))
+                 (mapv #(select-keys % [:column_name :type_name]))))))

 (defmethod post-select Table [_ {:keys [id db_id name] :as table}]
   (util/assoc* table


added datastore

added datastore

error: pathspec 'src/datasplash/datastore.clj' did not match any file(s) known to git

--- src/datasplash/datastore.clj
+++ src/datasplash/datastore.clj
@@ -0,0 +1,16 @@
+(ns datasplash.datastore
+  (:require [datasplash.core :refer :all])
+  (:import [com.google.cloud.dataflow.sdk.io DatastoreIO Write]
+           [com.google.cloud.dataflow.sdk Pipeline]
+           [com.google.cloud.dataflow.sdk.values PBegin PCollection]))
+
+(defn write-datastore-raw
+  [{:keys [dataset host] :as options} p]
+  (let [opts (assoc options :label :write-datastore)
+        ptrans (-> (DatastoreIO/sink)
+                   (.withDataset dataset)
+                   (cond-> host (.withHost host))
+                   (Write/to))]
+    (-> p
+        (cond-> (instance? Pipeline p) (PBegin/in))
+        (apply-transform ptrans named-schema opts))))


Fix cyclic dependency error

Fix cyclic dependency error

...I hope


misc hackery to deal with file paths vs. classpaths, etc

--- clojure/src/main/clj/cucumber/runtime/clj.clj
+++ clojure/src/main/clj/cucumber/runtime/clj.clj
@@ -15,12 +15,11 @@

 (defn load-script [path]
   (try
-    (RT/load (.replaceAll path ".clj$" "") true)
+    (RT/load (str "cucumber/" (.replaceAll path ".clj$" "")) true)
     (catch Throwable t
       (throw (CucumberException. t)))))

 (defn- -init [resource-loader]
-  (load-script "cucumber/runtime/clojure/dsl")
   [[] (atom {:resource-loader resource-loader})])

 (defn- -buildWorld [cljb glue-paths a-world]


removing extra paren

removing extra paren

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/micbie/evemm.git/'


[WM] remove :status from error responses too

The status should be indicated by the HTTP status on the response, so it should be redundantly encoded in the response data structure. That was happening correctly for successful /registrations requests, but not when they were errors. This commit fixes that.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/voter-registration-http-api.git/'


set default property when adding credit card in onboarding


*-entzun funtzioetan *funtzioa* parametroa aukeran

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/lnmnd/magnet.bez.git/'


Update play-clj template

Update play-clj template

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/bsmr-clojure/Nightcode.git/'


bump version to 3.7.4 and core version to 3.8.1

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/B2W-BIT/restQL-server.git/'


main ezarri

main ezarri


Next development iteration

Next development iteration

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject lein-droid/lein-droid "0.1.0-beta1"
+(defproject lein-droid/lein-droid "0.1.0-SNAPSHOT"
   :description "Plugin for easy Clojure/Android development and deployment"
   :url "https://github.com/alexander-yakushev/lein-droid"
   :license {:name "Eclipse Public License"


Update deps

Update deps

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/partner-works.git/'


chore(core): update core version to 2.8.19


microbench profile should load YourKit agent on startup

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/michaelsbradleyjr/transwarp.git/'


Version 1.15.11

Version 1.15.11

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/starcity-properties/odin.git/'


Version 156-SNAPSHOT

Version 156-SNAPSHOT

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/tobias/clojars-web.git/'


Update all the libraries to make `lein-ancient` happy.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/couragelabs/crispy-tatertot.git/'


Version bump

Version bump

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/xcthulhu/clj-bitauth.git/'


Added database dependencies

Added database dependencies

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/amedw/mud-server.git/'


Exclude org.apache.httpcomponents/httpclient

See: https://github.com/aws/aws-sdk-java/issues/1919

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/scheduled-message-works.git/'


version bumps

version bumps

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/CraZySacX/nitelens.git/'


OK, let's try with the old deps

OK, let's try with the old deps

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/physion/ovation-webapi.git/'


Add lein docker foo

Add lein docker foo

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/MitchellJThomas/medir.git/'


Clean up clojars.web namespace.

Clean up clojars.web namespace.

--- src/clojars/web.clj
+++ src/clojars/web.clj
@@ -1,15 +1,20 @@
 (ns clojars.web
-  (:require [clojure.contrib.sql :as sql])
-  (:use [clojars.db]
-        [clojars.web dashboard group jar login search user common]
-        [hiccup.core]
-        [hiccup.page-helpers]
-        [hiccup.form-helpers]
-        [ring.middleware.session]
-        [ring.middleware.session.store]
-        [ring.middleware.file]
-        [ring.util.response]
-        [compojure.core]))
+  (:use [clojars.db :only [with-db group-members find-user add-member
+                           find-jar find-canon-jar db-middleware]]
+        [clojars.web.dashboard :only [dashboard index-page]]
+        [clojars.web.search :only [search]]
+        [clojars.web.user :only [profile-form update-profile show-user
+                                 register register-form]]
+        [clojars.web.group :only [show-group]]
+        [clojars.web.jar :only [show-jar]]
+        [clojars.web.common :only [html-doc]]
+        [clojars.web.login :only [login login-form]]
+        [hiccup.core :only [html h]]
+        [ring.middleware.session :only [wrap-session]]
+        [ring.middleware.file :only [wrap-file]]
+        [ring.util.response :only [redirect]]
+        [compojure.core :only [defroutes GET POST ANY]])
+  (:require [clojure.contrib.sql :as sql]))

 (defn not-found-doc []
   (html [:h1 "Page not found"]
@@ -17,12 +22,12 @@

 (defmacro with-account [body]
   `(if-let [~'account (~'session :account)]
-     (do ~body)
+     ~body
      (redirect "/login")))

 (defmacro try-account [body]
   `(let [~'account (~'session :account)]
-     (do ~body)))
+     ~body))

 (defroutes main-routes
   (GET "/search" {session :session params :params}
@@ -32,7 +37,7 @@
     (with-account
      (profile-form account)))
   (POST "/profile" {session :session params :params}
-    (with-account
+    (with-account
       (update-profile account params)))
   (GET "/login" {params :params}
     (login-form))
@@ -98,22 +103,16 @@
   (ANY "*" {session :session}
     (html-doc (session :account) "Page not found" (not-found-doc))))

-
 (def clojars-app
    (-> main-routes
        wrap-session
        (wrap-file "public")
        db-middleware))

-;(require 'swank.swank)
-;(swank.swank/start-server "/dev/null" :port 4005)
+(comment
+  (require 'swank.swank)
+  (swank.swank/start-repl)

-
-;(use 'clojure.contrib.repl-utils)
-;(show server)
-;(.stop server)
-
-;(with-db (find-jar "leiningen"))
-
-
-;(def server (run-server {:port 8000} "/*" (servlet clojars-app)))
+  (with-db (find-jar "leiningen"))
+  (def server (run-server {:port 8000} "/*" (servlet clojars-app)))
+  (.stop server))


cleanup

cleanup

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/clojure-ml/cml.git/'


refactor watchers

refactor watchers

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/JetBrains/imperative-nodejs.git/'


Problem 0093.

Problem 0093.

error: pathspec 'src/project_euler/problem_0093.clj' did not match any file(s) known to git

--- src/project_euler/problem_0093.clj
+++ src/project_euler/problem_0093.clj
@@ -0,0 +1,66 @@
+(ns project-euler.problem_0093
+  (:require [clojure.math.combinatorics :as combo]))
+
+;; By using each of the digits from the set, {1, 2, 3, 4}, exactly once,
+;; and making use of the four arithmetic operations (+, −, *, /) and brackets/parentheses,
+;; it is possible to form different positive integer targets.
+
+;; For example,
+
+;; 8 = (4 * (1 + 3)) / 2
+;; 14 = 4 * (3 + 1 / 2)
+;; 19 = 4 * (2 + 3) − 1
+;; 36 = 3 * 4 * (2 + 1)
+
+;; Note that concatenations of the digits, like 12 + 34, are not allowed.
+
+;; Using the set, {1, 2, 3, 4},
+;; it is possible to obtain thirty-one different target numbers of which 36 is the maximum,
+;; and each of the numbers 1 to 28 can be obtained before encountering the first non-expressible number.
+
+;; Find the set of four distinct digits, a < b < c < d,
+;; for which the longest set of consecutive positive integers, 1 to n,
+;; can be obtained, giving your answer as a string: abcd.
+
+
+(def expressions
+  [
+   (fn [[op1 op2 op3] [a b c d]]
+     (try
+       (op1 a (op2 b (op3 c d)))
+       (catch ArithmeticException e nil))
+     )
+
+   (fn [[op1 op2 op3] [a b c d]]
+     (try
+       (op1 (op2 (op3  a b) c) d)
+       (catch ArithmeticException e nil))
+     )
+   ])
+
+
+(defn target-numbers [ds]
+  (->> (combo/combinations [+ + + - - - * * * / / /] 3)
+       (mapcat combo/permutations)
+       (mapcat (fn [ops] (map (fn [xs] [ops xs]) (combo/permutations ds))))
+       (mapcat (fn [[ops xs]] (map (fn [ex] (ex ops xs)) expressions)))
+       (filter (fn [y] (and (integer? y) (> y 0))))
+       (set)
+       ))
+
+(defn n-of-consecutive [xs]
+  (->> (drop-while (fn [x] (xs x)) (iterate inc 1))
+       (first)))
+
+(defn solution []
+  (->> (combo/combinations (range 1 10) 4)
+       (map (fn [ds] [ds (n-of-consecutive (target-numbers ds))]))
+       (reduce (fn [ds-l-max ds-l] (if (> (second ds-l) (second ds-l-max))
+                                     ds-l
+                                     ds-l-max))
+               [nil 0])
+       (first)
+       (apply str)
+       ))
+
+;;-> 1258


[TH] add more auth commands

[TH] add more auth commands

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/s3-ftp.git/'


Losing sequential checks in favor of backgrounding table creation in yet another attempt at test passage.

--- mysql/test/finagle_clojure/mysql/integration_test.clj
+++ mysql/test/finagle_clojure/mysql/integration_test.clj
@@ -1,6 +1,5 @@
 (ns finagle-clojure.mysql.integration-test
-  (:import (com.twitter.util Future)
-           (java.sql Date Timestamp)
+  (:import (java.sql Date Timestamp)
            (java.util TimeZone))
   (:require [midje.sweet :refer :all]
             [finagle-clojure.mysql.client :refer :all]
@@ -10,42 +9,42 @@
 (System/setProperty "java.net.preferIPv4Stack" "true")
 (TimeZone/setDefault (TimeZone/getTimeZone "UTC"))

-(facts "integrating the MySQL client"
-  (let [db (-> (mysql-client)
-               (with-credentials "finagle" "finagle")
-               (with-database "finagle_clojure_test")
-               (rich-client "localhost:3306"))]
+(defn create-table [db]
+  (f/await
+    (query db "CREATE TABLE IF NOT EXISTS widgets (
+                     id INT AUTO_INCREMENT PRIMARY KEY,
+                     sprockets SMALLINT,
+                     sproings FLOAT,
+                     sprattles BIGINT,
+                     name VARCHAR(255),
+                     blank VARCHAR(255),
+                     description TEXT,
+                     price DECIMAL(10,2),
+                     mfd_on DATE,
+                     in_stock BOOLEAN,
+                     part_number CHAR(10),
+                     created_at TIMESTAMP
+                   )")))

-    (fact "it can ping the database"
+(defn drop-table [db]
+  (f/await
+    (query db "DROP TABLE widgets")))
+
+(let [db (-> (mysql-client)
+             (with-credentials "finagle" "finagle")
+             (with-database "finagle_clojure_test")
+             (rich-client "localhost:3306"))]
+
+  (against-background [(before :contents (create-table db))
+                       (after  :contents (drop-table db))]
+
+    (fact :mysql "it can ping the database"
       (-> (ping db)
           (f/map* ok?)
           (f/await))
       => true)

-    (fact "it can create and update a table"
-      (-> (query db "DROP TABLE IF EXISTS widgets")
-          (f/map* ok?)
-          (f/await))
-      => true
-
-      (-> (query db "CREATE TABLE widgets (
-                       id INT AUTO_INCREMENT PRIMARY KEY,
-                       sprockets SMALLINT,
-                       sproings FLOAT,
-                       sprattles BIGINT,
-                       name VARCHAR(255),
-                       blank VARCHAR(255),
-                       description TEXT,
-                       price DECIMAL(10,2),
-                       mfd_on DATE,
-                       in_stock BOOLEAN,
-                       part_number CHAR(10),
-                       created_at TIMESTAMP
-                     )")
-          (f/map* ok?)
-          (f/await))
-      => true
-
+    (fact :mysql "it can create and update a table"
       (-> (prepare db "INSERT INTO widgets (name, description, sprockets, sproings, sprattles, price, mfd_on, blank, in_stock, part_number, created_at)
                        VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
           (exec
@@ -65,7 +64,7 @@
           (f/await))
       => 1)

-    (fact "it understands how to unbox a wide range of data types"
+    (fact :mysql "it understands how to unbox a wide range of data types"
       (let [rows (-> (prepare db "SELECT * FROM WIDGETS")
                      (exec)
                      (f/map* ResultSet->vec)
@@ -123,7 +122,7 @@
         => (Timestamp/valueOf "2014-12-24 10:11:12")
         ))

-    (fact "it can select from the table using the rich client"
+    (fact :mysql "it can select from the table using the rich client"
       (let [rows (-> (select-sql db "SELECT * FROM widgets" Row->map)
                      (f/await))]
         (count rows)
@@ -139,7 +138,7 @@
           (select-keys [:id :name]))
       => {:id 1 :name "fizzbuzz"})

-    (fact "it can select from the table using a prepared statement"
+    (fact :mysql "it can select from the table using a prepared statement"
       (let [rows (-> (prepare db "SELECT * FROM widgets")
                      (select-stmt [] Row->map)
                      (f/await))]
@@ -157,10 +156,4 @@
           (select-keys [:id :name]))
       => {:id 1 :name "fizzbuzz"})

-    (fact "it can clean up after the tests by deleting a table"
-      (-> (query db "DROP TABLE widgets")
-          (f/map* ok?)
-          (f/await))
-      => true)
-
     ))


[WM] exclude 'send' in notification handler ns

We have a fn named 'send' in here, so exclude Clojure's version.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/notification-works.git/'


Wrote simple benchmarks comparing TransactionalMap with ConcurrentMap.

error: pathspec 'src/test/java/cern/entwined/demo/clojure_benchmarks.clj' did not match any file(s) known to git

--- src/test/java/cern/entwined/demo/clojure_benchmarks.clj
+++ src/test/java/cern/entwined/demo/clojure_benchmarks.clj
@@ -0,0 +1,41 @@
+(ns cern.entwined.demo.clojure-benchmarks
+  (:require [cern.entwined.core :as stm]))
+
+(def pool (java.util.concurrent.Executors/newFixedThreadPool 11))
+(defn schedule-update [update-fn]
+  (.execute pool update-fn))
+
+(def start-latch (promise))
+(def barrier (java.util.concurrent.CyclicBarrier. 11)) ;;10 threads in thread pool and one main thread
+
+(defn make-update-fn [m key]
+  (fn []
+    @start-latch
+    (doseq [x (range 1000)]
+      (.put m key (inc (or (.get m key) 1))))
+    (.await barrier)))
+
+(defn run-concurrent-map []
+  (let [m (java.util.concurrent.ConcurrentHashMap.)]
+    (doseq [i (range 10)]
+      (schedule-update (make-update-fn m (* i 13))))
+    (deliver start-latch :ok)
+    (.await barrier)
+    m))
+
+(defn make-trupdate-fn [memory key]
+  (fn []
+    @start-latch
+    (doseq [x (range 1000)]
+      (stm/intrans memory m
+                   (.put m key (inc (or (.get m key) 1)))
+                   true))
+    (.await barrier)))
+
+(defn run-transactional-map []
+  (let [memory (cern.entwined.Memory. (stm/create-map))]
+    (doseq [i (range 10)]
+      (schedule-update (make-trupdate-fn memory (* i 13))))
+    (deliver start-latch :ok)
+    (.await barrier)
+    (stm/intrans memory data (apply str (for [k (.keySet data)] [k (.get data k)])))))


Report script

Report script

error: pathspec 'backend/src/akvo/lumen/admin/stats/report.clj' did not match any file(s) known to git

--- backend/src/akvo/lumen/admin/stats/report.clj
+++ backend/src/akvo/lumen/admin/stats/report.clj
@@ -0,0 +1,60 @@
+(ns akvo.lumen.admin.stats.report
+  "Same env vars as the rest of admin scripts
+  report
+  report \"2017-04-01\"
+  report \"now\" \"t1\"
+  report \"2017-04-01\" \"t1,t2\"
+  "
+  (:require [akvo.lumen.admin.util :as util]
+            [cheshire.core :as json]
+            [clojure.java.jdbc :as jdbc]
+            [clojure.pprint :refer [pprint]]
+            [clojure.string :as s]))
+
+(defn number-of-datasets [uris date]
+  (let [query (format "SELECT COUNT(id) FROM history.data_source WHERE lower(_validrange) < '%s'::DATE AT TIME ZONE 'UTC';" date)
+        r (for [{:keys [db-uri tenant-label]} uris]
+            (jdbc/with-db-transaction [conn db-uri {:read-only? true}]
+              (jdbc/query conn [query])))]
+    {:number-of-datasets (reduce (fn [n v]
+                                   (+ n (-> v first :count)))
+                                 0 r)}))
+
+(defn number-of-dashboards [uris date]
+  (let [query (format "SELECT COUNT(id) FROM history.dashboard WHERE lower(_validrange) < '%s'::DATE AT TIME ZONE 'UTC';" date)
+        r (for [{:keys [db-uri tenant-label]} uris]
+            (jdbc/with-db-transaction [conn db-uri {:read-only? true}]
+              (jdbc/query conn [query])))]
+    {:number-of-dashboards (reduce (fn [n v]
+                                     (+ n (-> v first :count)))
+                                   0 r)}))
+
+(defn fetch-uris
+  ([date]
+   (fetch-uris date (constantly true)))
+  ([date filter-fn]
+   (->> (format "SELECT DISTINCT ON (label) label as \"tenant-label\", db_uri as \"db-uri\", _validrange FROM history.tenants WHERE lower(_validrange) < '%s'::DATE AT TIME ZONE 'UTC' ORDER BY label, _validrange DESC;" date)
+        (jdbc/query (util/db-uri {:database "lumen"}))
+        (filter filter-fn))))
+
+(defn stats [date filter-fn]
+  (let [date (if (= date "now")
+               (.format (java.text.SimpleDateFormat. "yyyy-MM-dd") (new java.util.Date))
+               date)
+        uris (fetch-uris date filter-fn)]
+    (merge {:at-date date}
+           {:number-of-tenants (count uris)}
+           (number-of-datasets uris date)
+           (number-of-dashboards uris date))))
+
+(defn -main
+  ([]
+   (-main "now"))
+  ([date]
+   (let [filter-fn (constantly true)]
+     (prn (stats date filter-fn))))
+  ([date tenant-labels]
+   (let [filter-fn (fn [{:keys [tenant-label]}]
+                     (contains? (set (s/split tenant-labels #","))
+                                tenant-label))]
+     (prn (stats date filter-fn)))))


Add comment

Add comment

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/leif47/immutabledb-experimental.git/'


Saioa hasi edo amaitzean url-ra ez joan

Saioa hasi edo amaitzean url-ra ez joan

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/lnmnd/magnet.bez.git/'


Debug

Debug


day 10

day 10

error: pathspec 'src/adventofcode/day10.clj' did not match any file(s) known to git

--- src/adventofcode/day10.clj
+++ src/adventofcode/day10.clj
@@ -0,0 +1,20 @@
+(ns adventofcode.day10)
+
+(defn look-and-say [s]
+  (->> s
+       (partition-by identity)
+       (mapcat (juxt count first))
+       (apply str)))
+
+(defn length-for-iteration [start n]
+  (->> start
+       (iterate look-and-say)
+       (drop n)
+       first
+       count))
+
+(defn part-one [] (length-for-iteration "1113122113" 40))
+(defn part-two [] (length-for-iteration "1113122113" 50))
+
+
+


Consolidating eval stuff

Consolidating eval stuff

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/michaelsbradleyjr/shen.clj.git/'


Tidy.

Tidy.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/cstorey/nrod.git/'


Introducing hashes.clj

Introducing hashes.clj

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/xcthulhu/clj-bitauth.git/'


Rename exception handlers

Rename exception handlers

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Yleisradio/rabid.git/'


clean up old helper impls

clean up old helper impls

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/michaelsbradleyjr/transwarp.git/'


views: KNF

views: KNF

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/pyr/bundes.git/'


number display component

number display component

error: pathspec 'src/clojurescript/nossal/shop/components.cljs' did not match any file(s) known to git

--- src/clojurescript/nossal/shop/components.cljs
+++ src/clojurescript/nossal/shop/components.cljs
@@ -0,0 +1,17 @@
+(ns nossal.shop.components
+  (:require [clojure.string :as string]))
+
+(defn digit [number]
+  [:div.digit {:style {:height "1.2em" :overflow "hidden"}}
+   [:ul {:style {:margin-top "1.5em" :animation (str "number-" number " " (+ 500 (* number 60)) "ms 80ms normal forwards ease-in-out")}}
+    (for [n (range 10)]
+      ^{:key (str "d-" number "-" n)} [:li n])]])
+
+(defn number-display [number]
+  [:div.display {:style {:display "-webkit-box" :justify-content ""}}
+    (for [n (map str number)]
+     ^{:key (str "d-" n)} (digit n))])
+  ; [:div (map #(vector :span %) (string/split number #""))])
+
+
+; (:margin-top (str (* number 1.5 -1) "em"))


Rename update-context -> swap-context!

Rename update-context -> swap-context!


Version 183

Version 183

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/tobias/clojars-web.git/'


Kehaar 0.7.0 with bounded thread pools

Kehaar 0.7.0 with bounded thread pools

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/form-works.git/'


[WM] update immutant to 2.0.2

[WM] update immutant to 2.0.2


Bumping to version 0.1.4

Bumping to version 0.1.4


Fixing duplicate requests #17

Fixing duplicate requests #17

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/B2W-BIT/restQL-server.git/'


adding chesire

adding chesire

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/narkisr/cloujsearch.git/'


bumping version again. alpha6 couldn't be published because the whole semantic-ui sourcecode was included in the published jar, making it too large

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/tobiasbayer/lambdacd.git/'


Updating core version for bug fixing

Updating core version for bug fixing


Add :pedantic? :abort

Add :pedantic? :abort

--- project.clj
+++ project.clj
@@ -67,4 +67,5 @@
              :repl {:dependencies [[com.cemerick/piggieback "0.2.1"]]
                     :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}
   :test-selectors {:benchmark :benchmark
-                   :default (complement :benchmark)})
+                   :default (complement :benchmark)}
+  :pedantic? :abort)


Version 0.17.3-SNAPSHOT

Version 0.17.3-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojars-web "0.17.2"
+(defproject clojars-web "0.17.3-SNAPSHOT"
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/tools.cli "0.2.1"]
                  [yeller-clojure-client "1.2.1"]


Add project.cljı

Add project.cljı

error: pathspec 'project.clj' did not match any file(s) known to git

--- project.clj
+++ project.clj
@@ -0,0 +1,27 @@
+(defproject data-drill-reagent "0.1.0-SNAPSHOT"
+  :description "Drilling EDN since 2016!"
+  :url "http://github.com/odinodin/data-drill-reagent"
+  :license {:name "MIT"
+            :url "https://opensource.org/licenses/MIT"}
+  :min-lein-version "2.6.1"
+  :dependencies [[org.clojure/clojure "1.8.0"]
+                 [org.clojure/clojurescript "1.7.228"]
+                 [reagent "0.6.0-alpha"]]
+  :plugins [[lein-figwheel "0.5.2"]
+            [lein-cljsbuild "1.1.3" :exclusions [[org.clojure/clojure]]]]
+  :source-paths ["src"]
+
+  :figwheel {:http-server-root "public"}
+
+  :profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.1"]
+                                  [figwheel-sidecar "0.5.2"]]
+                   :source-paths ["src" "dev"]
+                   :cljsbuild {
+                               :builds [{:id "dev"
+                                         :source-paths ["src/"]
+                                         :figwheel {:on-jsload "datadrill.core/on-js-reload"}
+                                         :compiler {:main "datadrill.core"
+                                                    :asset-path "js/out"
+                                                    :output-to "resources/public/js/main.js"
+                                                    :output-dir "resources/public/js/out"}}]}}}
+  :clean-targets ^{:protect false} ["resources/public/js" "target"])


experiment w/ various jvm opts related (more or less) to gc


bump version to 2.8.11

bump version to 2.8.11

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/B2W-Digital/pdg-core.git/'


chore(core): update core version to 2.9.1


Version 1.5.1

Version 1.5.1

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/starcity-properties/odin.git/'


:arrow_up: Update dependencies

:arrow_up: Update dependencies

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/maoo/bot-unfurl.git/'


Releasing 1.1.0

Releasing 1.1.0

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 ;; Copyright © 2015, JUXT LTD.

-(defproject yada "1.1.0-SNAPSHOT"
+(defproject yada "1.1.0"
   :description "A powerful Clojure web library, full HTTP, full async"
   :url "http://github.com/juxt/yada"
   :license {:name "The MIT License"


A basic project.clj added to move back to lein

--- project.clj
+++ project.clj
@@ -0,0 +1,149 @@
+(defproject codamic/hellhound "0.13.0-SNAPSHOT"
+  :description "A simple full-stack web framework for clojure"
+  :license     {"GPLv3"
+                "https://www.gnu.org/licenses/gpl.html"}
+  :url         "http://github.com/Codamic/hellhound"
+  :scm         {:url "https://github.com/Codamic/hellhound"}
+
+  :dependencies [[org.clojure/clojure        "1.9.0-alpha14"]
+                 [org.clojure/clojurescript  "RELEASE"]
+                 [bidi                       "2.0.14"]
+                 [reagent                    "0.6.0"]
+                 [ring                       "1.5.1"]
+                 [ring/ring-defaults         "0.3.0-beta1"]
+                 [re-frame                   "0.8.0"]
+                 [secretary                  "1.2.3"]
+                 [com.stuartsierra/component "0.3.1"]
+                 [com.taoensso/tempura       "1.0.0-RC3"]
+                 [codamic/sente              "1.11.1"]
+                 [com.taoensso/timbre        "4.7.4"]
+                 [org.danielsz/system        "0.3.2-SNAPSHOT"]
+                 [environ                    "1.1.0"]
+                 [environ                    "1.0.3"]
+                 [com.cemerick/friend        "0.2.3"]
+                 [ring-logger                "0.7.6"]
+                 [bk/ring-gzip               "0.1.1"]
+                 [org.immutant/immutant      "2.1.5"
+                  :exclusions [ch.qos.logback/logback-classic]]
+                 [com.fzakaria/slf4j-timbre  "0.3.2"]
+                 [potemkin                   "0.4.3"]
+                 [com.cognitect/transit-clj  "RELEASE"]
+                 [com.cognitect/transit-cljs "RELEASE"]
+                 [colorize                   "0.1.1"
+                  :exclusions [org.clojure/clojure]]
+                 [ring/ring-anti-forgery     "1.1.0-beta1"]
+                 [clj-http                   "2.3.0"]
+                 [re-frisk "0.3.2"]
+                 [selmer                     "1.0.9"]
+                 [cheshire                   "5.7.0"]
+                 [cljsjs/jquery              "2.2.4-0"]
+
+                 ;; Testing tasks
+
+
+                 ;; Cljs repl dependencies ----------------------------
+                 ;; ---------------------------------------------------
+                 [funcool/codeina            "0.5.0"          :scope "test"]]
+
+  :plugins [[lein-cljsbuild "1.1.3"]
+            [lein-environ "1.0.3"]]
+
+  :min-lein-version "2.6.1"
+
+  :source-paths ["src/clj" "src/cljs" "src/cljc"]
+
+  :test-paths ["test/clj" "test/cljc"]
+  :clean-targets ^{:protect false} [:target-path :compile-path "resources/public/js"]
+
+  :uberjar-name "hellhound.jar"
+
+  ;; nREPL by default starts in the :main namespace, we want to start in `user`
+  ;; because that's where our development helper functions like (run) and
+  ;; (browser-repl) live.
+  :repl-options {:init-ns user}
+
+  :cljsbuild {:builds
+              [{:id "app"
+                :source-paths ["src/cljs" "src/cljc"]
+
+                :figwheel true
+
+                ;; Alternatively, you can configure a function to run every time figwheel reloads.
+                ;; :figwheel {:on-jsload "hellhound.core/on-figwheel-reload"}
+
+                :compiler {:main hellhound.core
+                           :asset-path "js/compiled/out"
+                           :output-to "resources/public/js/compiled/hellhound.js"
+                           :output-dir "resources/public/js/compiled/out"
+                           :source-map-timestamp true}}
+
+               {:id "test"
+                :source-paths ["src/cljs" "test/cljs" "src/cljc" "test/cljc"]
+                :compiler {:output-to "resources/public/js/compiled/testable.js"
+                           :main hellhound.test-runner
+                           :optimizations :none}}
+
+               {:id "min"
+                :source-paths ["src/cljs" "src/cljc"]
+                :jar true
+                :compiler {:main hellhound.core
+                           :output-to "resources/public/js/compiled/hellhound.js"
+                           :output-dir "target"
+                           :source-map-timestamp true
+                           :optimizations :advanced
+                           :pretty-print false}}]}
+
+  ;; When running figwheel from nREPL, figwheel will read this configuration
+  ;; stanza, but it will read it without passing through leiningen's profile
+  ;; merging. So don't put a :figwheel section under the :dev profile, it will
+  ;; not be picked up, instead configure figwheel here on the top level.
+
+  :figwheel {;; :http-server-root "public"       ;; serve static assets from resources/public/
+             ;; :server-port 3449                ;; default
+             ;; :server-ip "127.0.0.1"           ;; default
+             :css-dirs ["resources/public/css"]  ;; watch and update CSS
+
+             ;; Instead of booting a separate server on its own port, we embed
+             ;; the server ring handler inside figwheel's http-kit server, so
+             ;; assets and API endpoints can all be accessed on the same host
+             ;; and port. If you prefer a separate server process then take this
+             ;; out and start the server with `lein run`.
+             :ring-handler user/http-handler
+
+             ;; Start an nREPL server into the running figwheel process. We
+             ;; don't do this, instead we do the opposite, running figwheel from
+             ;; an nREPL process, see
+             ;; https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl
+             ;; :nrepl-port 7888
+
+             ;; To be able to open files in your editor from the heads up display
+             ;; you will need to put a script on your path.
+             ;; that script will have to take a file path and a line number
+             ;; ie. in  ~/bin/myfile-opener
+             ;; #! /bin/sh
+             ;; emacsclient -n +$2 $1
+             ;;
+             ;; :open-file-command "myfile-opener"
+
+             :server-logfile "log/figwheel.log"}
+
+  :doo {:build "test"}
+
+  :profiles {:dev
+             {:dependencies [[figwheel "0.5.4-4"]
+                             [figwheel-sidecar "0.5.4-4"]
+                             [com.cemerick/piggieback "0.2.1"]
+                             [org.clojure/tools.nrepl "0.2.12"]]
+
+              :plugins [[lein-figwheel "0.5.4-4"]
+                        [lein-doo "0.1.6"]]
+
+              :source-paths ["dev"]
+              :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}
+
+             :uberjar
+             {:source-paths ^:replace ["src/clj" "src/cljc"]
+              :prep-tasks ["compile" ["cljsbuild" "once" "min"]]
+              :hooks []
+              :omit-source true
+              :aot :all}})


[NO TESTS] WIP

[NO TESTS] WIP

error: pathspec 'src/detritus/multi.clj' did not match any file(s) known to git

--- src/detritus/multi.clj
+++ src/detritus/multi.clj
@@ -0,0 +1,33 @@
+(ns detritus.multi
+  "Tools for working with multimethods."
+  {:authors ["Reid \"arrdem\" McKenzie <me@arrdem.com>"]
+   :license "https://www.eclipse.org/legal/epl-v10.html"}
+  (:refer-clojure :exclude [type]))
+
+(defn type
+  "Dispatch function for switching on, in order
+   - The declared `:type` of an object
+   - The `:type` metadata
+   - The Java type
+
+  The logical extension of Clojure's `#'type` operator to the `:type` pattern."
+  [x]
+  (:type x (clojure.core/type x)))
+
+(defn make-prefix-dispatch
+  "Make a function which dispatches on the `#'type` tuple of the first N arguments, silently absorbing
+  the rest."
+  (fn [n]
+    (fn [& xs]
+      (mapv type (take n xs)))))
+
+(defn derive!
+  "Although hierarchies are mostly used by indirection as vars (`defmulti` supports the `:hierarchy`
+  argument for using hierarchies other than the default global one), and although `(derive child
+  parent)` implicitly side-effects the global hierarchy, `(derive h child parent)` is a pure
+  function of a hierarchy as a map structure which doesn't behave nicely when given a var.
+
+  Wrap it up with an alter-var-root so it makes sense."
+  [h child parent]
+  {:pre [(var? h)]}
+  (alter-var-root h derive child parent))


link to maven.org if jar not found on clojars.org

--- src/clojars/web/jar.clj
+++ src/clojars/web/jar.clj
@@ -4,10 +4,17 @@
             [hiccup.core :refer [h]]
             [hiccup.page-helpers :refer [link-to]]
             [clojars.promote :refer [file-for]]
-            [clojars.maven :refer [pom-to-map]]))
+            [clojars.maven :refer [pom-to-map]]
+            [clojars.db :refer [find-jar]]
+            [ring.util.codec :refer [url-encode]]))

 (defn url-for [jar]
   (str (jar-url jar) "/versions/" (:version jar)))
+
+(defn maven-jar-url [jar]
+ (str "http://search.maven.org/#"
+   (url-encode (apply format "artifactdetails|%s|%s|%s|jar"
+        ((juxt :group_name :jar_name :version) jar)))))

 (defn jar-to-pom-map [jar]
   (let [pom-file (apply file-for (conj ((juxt :group_name :jar_name :version) jar) "pom"))]
@@ -50,7 +57,9 @@
                  [:h3 "dependencies"]
                  [:ul#dependencies
                   (for [d dependencies]
-                    [:li (link-to (url-for d) (jar-name d))])])))
+                    [:li (link-to
+                           (if (find-jar (:group_name d) (:jar_name d)) (url-for d) (maven-jar-url d))
+                           (jar-name d))])])))

              [:p (link-to (str (jar-url jar) "/versions")
                           (str "show all versions (" count " total)"))]]))


divisors

divisors

fatal: unable to access 'https://github.com/hellonico/maths.git/': The requested URL returned error: 403


Make organization-membership/last_name optional

fatal: unable to access 'https://github.com/physion/ovation-webapi.git/': The requested URL returned error: 403


Added code for looking up FAA records.

Added code for looking up FAA records.

error: pathspec 'src/com/lemondronor/orbital_detector/faa.clj' did not match any file(s) known to git

--- src/com/lemondronor/orbital_detector/faa.clj
+++ src/com/lemondronor/orbital_detector/faa.clj
@@ -0,0 +1,29 @@
+(ns com.lemondronor.orbital-detector.faa
+  ""
+  (:require [clojure.string :as string]
+            [net.cgrand.enlive-html :as html]))
+
+(set! *warn-on-reflection* true)
+
+
+(defn fetch-url [url]
+  (html/html-resource (java.net.URL. url)))
+
+
+(defn faa-lookup-url [n-number]
+  (str "http://registry.faa.gov/aircraftinquiry/NNum_Results.aspx?NNumbertxt="
+       n-number))
+
+
+(defn lookup-registration [n-number]
+  (let [result (fetch-url (faa-lookup-url n-number))
+        lookup (fn [sel] (as-> result $
+                           (html/select $ sel)
+                           (map html/text $)
+                           (string/join "" $)
+                           (string/trim $)))]
+    {:owner
+     {:name (lookup [:span#content_lbOwnerName])
+      :street (lookup [:span#content_lbOwnerStreet])
+      :city (lookup [:span#content_lbOwnerCity])
+      :state (lookup [:span#content_lbOwnerState])}}))


add unit test for price fetch

add unit test for price fetch

error: pathspec 'test/clj_money/models/prices/api_client_test.clj' did not match any file(s) known to git

--- test/clj_money/models/prices/api_client_test.clj
+++ test/clj_money/models/prices/api_client_test.clj
@@ -0,0 +1,67 @@
+(ns clj-money.models.prices.api-client-test
+  (:require [clojure.test :refer :all]
+            [clojure.pprint :refer [pprint]]
+            [clojure.data :refer [diff]]
+            [clj-time.core :as t]
+            [clj-http.client :as client]
+            [clj-money.models.prices.api-client :as prices-client]))
+
+(def ^:private raw-response
+ {:request-time 201
+ :repeatable? false
+ :protocol-version  {:name "HTTP"
+                     :major 1
+                     :minor 1}
+ :streaming? true
+ :chunked? false
+ :cookies {"3481%5F0"
+           {:discard true
+            :path "/"
+            :secure false
+            :value "F8B99CEB9F3EF617384253F9E2BE529C0D4FF51257DBA979309EA21E77694DB7"
+            :version 0}
+           "GZIP"
+           {:discard false
+            :expires #inst "2022-05-18T00:59:49.000-00:00"
+            :path "/"
+            :secure false
+            :value "1"
+            :version 0}}
+ :reason-phrase "OK"
+ :headers {"Server" ""
+           "Content-Type" "text/javascript; charset=UTF-8"
+           "Connection" "close"
+           "P3P" "CP=\"NON PHY ONL UNI PUR FIN COM NAV INT DEM STA HEA CUR ADM DEV OUR IND\"policyref=\"/w3c/p3p.xml\""
+           "X-AspNet-Version" ""
+           "Date" "Fri19 May 2017 00:59:48 GMT"
+           "Vary" "Accept-Encoding"
+           "X-Powered-By" "ASP.NET"
+           "Cache-Control" "private"}
+ :orig-content-encoding nil
+ :status 200
+ :length -1
+ :body
+ {:MarketCap 795319153600
+  :MSDate 42873
+  :Low 151.13
+  :Volume 33429851
+  :Change 2.28999999999999
+  :High 153.34
+  :ChangeYTD 115.82
+  :ChangePercentYTD 31.7043688482127
+  :Name "Apple Inc"
+  :Timestamp "Thu Mar 2 00:00:00 UTC-04:00 2017"
+  :LastPrice 123.45
+  :ChangePercent 1.52412645590682
+  :Symbol "AAPL"
+  :Open 151.27
+  :Status "SUCCESS"}
+ :trace-redirects []})
+
+(deftest fetch-latest-price
+  (with-redefs [client/get (fn [url options]
+                             raw-response)]
+  (let [expected {:price 123.45M
+                  :trade-date (t/local-date 2017 3 2)}
+        actual (prices-client/fetch {:symbol "AAPL"})]
+    (is (= expected actual) "The correct information is returned"))))


fix reassignment

fix reassignment


cleanup

cleanup


Use throw-response-error in sched. noty search

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/election-notification-works.git/'


training for macro in Lisp vs metaprogramming in C++

error: pathspec 'src/clj/algorithms_clj/macro_initiation.clj' did not match any file(s) known to git

--- src/clj/algorithms_clj/macro_initiation.clj
+++ src/clj/algorithms_clj/macro_initiation.clj
@@ -0,0 +1,163 @@
+(ns algorithms-clj.macro-initiation)
+
+
+;; --------------------------------------------------------
+;; Example 1: equivalent with constexpr
+;; --------------------------------------------------------
+
+(defn add
+  "Summing two integers known at runtime"
+  [a b]
+  (+ a b))
+
+(defmacro add-m
+  "Summing two integers known at compile time"
+  [a b]
+  (+ a b))
+
+(defmacro add-m-2
+  "Summing two integers known at compile time"
+  [a b]
+  `(+ ~a ~b))
+
+(defn test-add
+  []
+  (let [x 1
+        y 2]
+    (println (add x y))
+    (println (add-m 1 2))
+    (println (add-m-2 1 2))
+
+    ;; Does not compile: cannot add symbols (explain this)
+    ;; (println (add-m x y))
+    ;; (println (add-m-2 x y))
+
+    ;; This however works, but only with add-m-2
+    (defmacro x1 [] 1)
+    (defmacro x2 [] 2)
+    ;; (println (add-m (x1) (x2)))
+    (println (add-m-2 (x1) (x2)))
+    ))
+
+
+;; --------------------------------------------------------
+;; Example 2-a: average at compile time
+;; - Show how we can do it in C++ with fold expressions C++17
+;; --------------------------------------------------------
+
+(defn average
+  "Average of numbers known at runtime"
+  [coll]
+  (/ (reduce + coll) (count coll)))
+
+(defmacro average-m
+  "Average of numbers known at compile time"
+  [coll]
+  `(average ~coll))
+
+(defn test-average
+  []
+  (let [coll [1 2 3]]
+    (println (average coll))
+    ;; (println (average-m coll)) ;; Would not compile
+    (println (average-m [1 2 3]))
+
+    ;; This however works
+    (defmacro coll-m [] [1 2 3])
+    (println (average-m (coll-m)))
+    ))
+
+
+;; --------------------------------------------------------
+;; Example 2-b: Compute frequency map at compile time
+;;
+;; TODO - Ok, collections, but also maps
+;; And there you are in troube with C++ constexpr
+;; And that's the thing: 1 language to learn, not 2
+;; --------------------------------------------------------
+
+;; TODO
+
+
+;; --------------------------------------------------------
+;; Example 3-a: repeat a side-effectful call 3 times
+;; --------------------------------------------------------
+
+(defmacro times-3
+  [body]
+  `(do
+     ~body
+     ~body
+     ~body))
+
+(defmacro times-3-2
+  [body]
+  (let [bodies (repeat 3 body)]
+    `(do ~@bodies)))
+
+(defn print-3 [] (times-3 (println "1")))
+(defn print-3-2 [] (times-3-2 (println "1")))
+
+
+;; --------------------------------------------------------
+;; Example 3-b: repeat a side-effectful call N times
+;; --------------------------------------------------------
+
+(defmacro times
+  [n body]
+  (let [bodies (for [i (range n)] (list body i))]
+    `(do ~@bodies)))
+
+(defn time-n [] (times 3 println))
+
+
+;; --------------------------------------------------------
+;; Example 3-c: unroll a side-effect loop by chunk of 4
+;; --------------------------------------------------------
+
+(defmacro unrolled-loop
+  [n body]
+  (let [bodies (repeat n body)
+        chunks (partition 4 bodies)
+        chunk-nb (count chunks)
+        remaining (drop (* 4 chunk-nb) bodies)]
+    `(do
+       (dotimes [i# ~chunk-nb]
+         (println (str "Chunk:" i#))
+         ~@(first chunks))
+       (println (str "Chunk:" ~chunk-nb))
+       ~@remaining)))
+
+(defn test-unroll-loop []
+  ;; Use Ctrl-Alt-M (on Mac) to show full expand
+  (unrolled-loop 10 (println "Yoh")))
+
+
+;; --------------------------------------------------------
+;; Example 4-a: Adding logs around functions
+;; --------------------------------------------------------
+
+;; TODO
+
+;; --------------------------------------------------------
+;; Example 4-b: Adding logs based on compile time option (no overhead)
+;; --------------------------------------------------------
+
+;; TODO
+
+;; --------------------------------------------------------
+;; Example 5: DFS to do a topological sort
+;; - You list a bunch of dependencies
+;; - You get a list of tasks to run
+;; Result:
+;; 1. Simple (re-use topological sort runtime)
+;; 2. Explicit ordering (not implicit positioning)
+;; --------------------------------------------------------
+
+;; TODO
+
+;; --------------------------------------------------------
+;; Example 6: Generating some code based on data structure
+;; --------------------------------------------------------
+
+;; TODO


add currency functions

add currency functions

fatal: unable to access 'https://github.com/sbondaryev/ca-recipe.git/': The requested URL returned error: 403


Make *m-context* dynamic var public.

Make *m-context* dynamic var public.

--- src/cljx/cats/core.cljx
+++ src/cljx/cats/core.cljx
@@ -5,7 +5,7 @@
   (:require-macros [cats.core :as cm]))

-(def ^{:dynamic true :private true} *m-context*)
+(def ^{:dynamic true} *m-context*)

 #+clj
 (defmacro with-context


Add block to present Gradle syntax for dependency

fatal: unable to access 'https://github.com/clojars/clojars-web.git/': The requested URL returned error: 403


Checking in backends file so I can test different backends

error: pathspec 'src/cortex/backends.clj' did not match any file(s) known to git

--- src/cortex/backends.clj
+++ src/cortex/backends.clj
@@ -0,0 +1,15 @@
+(ns cortex.backends
+  (require [clojure.core.matrix :as m]))
+
+
+(def ^:dynamic *current-matrix-implementation* :vectorz)
+
+(defn set-current-matrix-implementation!
+  [new-impl]
+  (alter-var-root #'*current-matrix-implementation* (constantly new-impl)))
+
+
+(defn impl [] *current-matrix-implementation*)
+
+(defn array [data] (m/array (impl) data))
+(defn new-array [shape] (m/new-array (impl) shape))


Bump restQl-core version

Bump restQl-core version

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/B2W-BIT/restQL-server.git/'


0.2.2-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject riemann "0.2.1"
+(defproject riemann "0.2.2-SNAPSHOT"
   :description
 "A network event stream processor. Intended for analytics, metrics, and alerting; and to glue various monitoring systems together."
   :url "http://github.com/aphyr/riemann"


nashorn

nashorn

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/tiagoantao/turtle.git/'


project file

project file

--- project.clj
+++ project.clj
@@ -0,0 +1,24 @@
+(defproject infinitelives.utils "0.1.0-SNAPSHOT"
+  :description "Support utilities for cljs games"
+  :url "https://github.com/infinitelives"
+  :license {:name "Eclipse Public License"
+            :url "http://www.eclipse.org/legal/epl-v10.html"}
+  :dependencies [[org.clojure/clojure "1.7.0"]
+                 [org.clojure/clojurescript "0.0-3308"]]
+
+  :plugins [[lein-cljsbuild "1.0.6"]]
+
+  :source-paths ["src/cljs"]
+  :test-paths ["test"]
+
+  :cljsbuild
+  {
+   :builds {:test
+            {:source-paths ["src" "test"]
+             :notify-command []
+             :compiler {:output-to "resources/test/compiled.js"
+                        :optimizations :whitespace
+                        :pretty-print true}}}
+   :test-commands {"test" ["phantomjs"
+                           "resources/test/test.js"
+                           "resources/test/test.html"]}})


bump blueprints

bump blueprints


Version 1.9.0

Version 1.9.0


:arrow_up: Update dependencies

:arrow_up: Update dependencies

fatal: unable to access 'https://github.com/maoo/bot-unfurl.git/': The requested URL returned error: 403


Upgrade to latest bidi that handles nil patterns

fatal: unable to access 'https://github.com/juxt/yada.git/': The requested URL returned error: 403


fixed typo

fixed typo

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Zallin/fhirvc.git/'


Version 29

Version 29


Version 1.9.4-SNAPSHOT

Version 1.9.4-SNAPSHOT

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/starcity-properties/odin.git/'


Update to datomic-toolbox 2.0.5

Update to datomic-toolbox 2.0.5

...to get transact-async-based swap-tx!

fatal: unable to access 'https://github.com/democracyworks/election-notification-works.git/': The requested URL returned error: 403


upgrade postal dependency to latest and greatest version

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/vincentstorme/clojureme.git/'


project file

project file

error: pathspec 'project.clj' did not match any file(s) known to git

--- project.clj
+++ project.clj
@@ -0,0 +1,24 @@
+(defproject infinitelives.pixi "0.1.0-SNAPSHOT"
+  :description "2D pixi library for cljs games"
+  :url "https://github.com/infinitelives"
+  :license {:name "Eclipse Public License"
+            :url "http://www.eclipse.org/legal/epl-v10.html"}
+  :dependencies [[org.clojure/clojure "1.7.0"]
+                 [org.clojure/clojurescript "0.0-3308"]
+                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]]
+
+  :plugins [[lein-cljsbuild "1.0.6"]]
+
+  :source-paths ["src/cljs"]
+  :test-paths ["test"]
+
+  :cljsbuild
+  {
+   :builds {:test
+            {:source-paths ["src" "test"]
+             :compiler {:output-to "resources/test/compiled.js"
+                        :optimizations :whitespace
+                        :pretty-print true}}}
+   :test-commands {"test" ["phantomjs"
+                           "resources/test/test.js"
+                           "resources/test/test.html"]}})


Bump to 0.3.3

Bump to 0.3.3

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/nvbn/rerenderer.git/'


Start to increment version number to keep track of releases, generate Marginalia documentation in a specific order

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/magoyette/marcandregoyette.com.git/'


Nuke spare file

Nuke spare file

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/ben-biddington/solace.git/'


added p16.clj

added p16.clj

fatal: unable to access 'https://github.com/drcabana/euler-fp.git/': The requested URL returned error: 403


Version 147

Version 147

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/tobias/clojars-web.git/'


Add source paths.

Add source paths.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/exupero/doo-macro-example.git/'


Back to snapshot.

Back to snapshot.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojars-web "0.15.15"
+(defproject clojars-web "0.15.16-SNAPSHOT"
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/tools.cli "0.2.1"]
                  [org.apache.maven/maven-model "3.0.4"


Version to 0.1.0

Version to 0.1.0

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/colophon/clarango.git/'


[WM] update datomic library to latest version

This is what we're running in production now.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/election-notification-works.git/'


Upgrade to cheshire 5.7.1 (#15)

Upgrade to cheshire 5.7.1 (#15)

fatal: unable to access 'https://github.com/acessocard/microscope.git/': The requested URL returned error: 403


bump to 0.6.5-SNAPSHOT

bump to 0.6.5-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clj-http "0.6.4"
+(defproject clj-http "0.6.5-SNAPSHOT"
   :description "A Clojure HTTP library wrapping the Apache HttpComponents client."
   :url "https://github.com/dakrone/clj-http/"
   :license {:name "The MIT License"


Update dependencies

Update dependencies

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/ballot-notification-works.git/'


Version 111

Version 111

fatal: unable to access 'https://github.com/tobias/clojars-web.git/': The requested URL returned error: 403


Update ClojureScript

Update ClojureScript

--- project.clj
+++ project.clj
@@ -7,7 +7,7 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[cljsjs/react "0.12.2-5"]
                  [org.clojure/clojure "1.6.0"]
-                 [org.clojure/clojurescript "0.0-2727" :scope "provided"]]
+                 [org.clojure/clojurescript "0.0-2760" :scope "provided"]]
   :aliases {"cleantest" ["do" "clean," "cljx" "once," "test," "cljsbuild" "test"]
             "deploy" ["do" "clean," "cljx" "once," "deploy" "clojars"]}
   :cljsbuild {:builds [{:id "dev"


Use core.async as a developer dependency

fatal: unable to access 'https://github.com/dignati/om-charts.git/': The requested URL returned error: 403


release 0.8.0

release 0.8.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject storm "0.8.0-SNAPSHOT"
+(defproject storm "0.8.0"
   :source-path "src/clj"
   :test-path "test/clj"
   :java-source-path "src/jvm"


Version 1.14.1-SNAPSHOT

Version 1.14.1-SNAPSHOT


updating dependencies

updating dependencies

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/scheduled-message-works.git/'


Add `ss-200-refer-all-demo`

Add `ss-200-refer-all-demo`

error: pathspec 'test/com/nomistech/clojure_the_language/c_950_tools_stuff/s_100_linting/ss_0200_refer_all_demo.clj' did not match any file(s) known to git

--- test/com/nomistech/clojure_the_language/c_950_tools_stuff/s_100_linting/ss_0200_refer_all_demo.clj
+++ test/com/nomistech/clojure_the_language/c_950_tools_stuff/s_100_linting/ss_0200_refer_all_demo.clj
@@ -0,0 +1,20 @@
+(ns com.nomistech.clojure-the-language.c-950-tools-stuff.s-100-linting.ss-0200-refer-all-demo
+  (:require
+   [clojure.test :refer :all]
+   [midje.sweet :refer :all]))
+
+(deftest some-test
+  (is (= 1 (inc 0))))
+
+(fact
+  (testing "plop"
+    (+ 1 2) => 3))
+
+(fact
+  (comment
+    undefined-thing-1 ; Not OK
+    =>                ; OK
+    undefined-thing-2 ; Not OK
+    )
+  (testing "plop"
+    (+ 1 2) => 3))


core.async: Add stuff about no more than 1024 operations.

error: pathspec 'test/com/nomistech/clojure_the_language/core_async_1024_pending_ops.clj' did not match any file(s) known to git

--- test/com/nomistech/clojure_the_language/core_async_1024_pending_ops.clj
+++ test/com/nomistech/clojure_the_language/core_async_1024_pending_ops.clj
@@ -0,0 +1,16 @@
+(ns com.nomistech.clojure-the-language.core-async-1024-pending-ops
+  (:require
+   ;; [com.nomistech.clojure-the-language.core-async-1024-pending-ops :refer :all]
+   [clojure.core.async :as a
+    :exclude [map into reduce merge partition partition-by take]]
+   [midje.sweet :refer :all]))
+
+(fact "About pending operations"
+
+  (fact "No more than 1024 pending puts"
+    (let [c (a/chan)] (dotimes [i 1025] (a/put! c i)))
+    => (throws AssertionError #"No more than 1024 pending puts"))
+
+  (fact "No more than 1024 pending takes"
+    (let [c (a/chan)] (dotimes [i 1025] (a/take! c #(do 42))))
+    => (throws AssertionError #"No more than 1024 pending takes")))


Update the docs for tagged-* & where about test exprs

Note that tagged-any & tagged-all can be used in where
test expressions, but only the single tag form.

Testing for a collection of tags is not supported yet.

--- src/riemann/streams.clj
+++ src/riemann/streams.clj
@@ -1081,6 +1081,9 @@
   "Passes on events where all tags are present. This stream returns true if an
   event it receives matches those tags, nil otherwise.

+  Can be used as a predicate in a where form, but only for
+  testing a single tag.
+
   (tagged-all \"foo\" prn)
   (tagged-all [\"foo\" \"bar\"] prn)"
   [tags & children]
@@ -1098,6 +1101,9 @@
 (defn tagged-any
   "Passes on events where any of tags are present. This stream returns true if
   an event it receives matches those tags, nil otherwise.
+
+  Can be used as a predicate in a where form, but only for
+  testing a single tag.

   (tagged-any \"foo\" prn)
   (tagged-all [\"foo\" \"bar\"] prn)"
@@ -1448,7 +1454,9 @@

   The streams generated by (where) return the value of expr: truthy if expr
   matched the given event, and falsey otherwise. This means (where (metric 5))
-  tests events and returns true if their metric is five."
+  tests events and returns true if their metric is five.
+
+  Note that tagged, tagged-all & tagged-any can only be used with a single tag."
   [expr & children]
   (let [p (where-rewrite expr)
         [true-kids else-kids] (where-partition-clauses children)]


WIP: streams/part-time-simple.

WIP: streams/part-time-simple.

Intended for wall-clock timed reducers which should *not* use
periodically-until-expired. No tests yet; I need to write tests and have
it take over for throttle, rollup, and friends.

--- src/riemann/streams.clj
+++ src/riemann/streams.clj
@@ -482,6 +482,53 @@
           (setup)
           (recur event))))))

+(defn part-time-simple
+  "Divides wall clock time into discrete windows. Returns a stream. Whenever
+  events arrive in a given window, calls (create) to generate some initial
+  state for that window, and uses (add state event) to combine events with that
+  state. At the end of the window, calls (finish state).
+
+  Does not treat expired events differently; ticks will still be scheduled even
+  if an expired event arrives. When no events arrive in a given window, does
+  nothing. (create) may be invoked partway through a window, and should be
+  idempotent, as it will be run inside of (swap!).
+
+  Concurrency guarantees:
+
+  (create) may be called multiple times for a given time slice.
+  (add)    when called, will receive exactly one distinct bucket in each time
+           slice.
+  (finish) will be called *exactly once* for each time slice."
+  [dt create add finish]
+  (let [anchor (unix-time)
+        ; Whether or not the next tick has been scheduled, and the current
+        ; window.
+        state (atom [nil nil])
+
+        ; Called every dt seconds to flush the window.
+        tick (fn tick []
+               (let [last-window (atom nil)]
+                 ; Reset the state to nil.
+                 (swap! state (fn [[_ window]]
+                                (reset! last-window window)
+                                [nil nil]))
+
+                 ; And finalize the last window
+                 (finish @last-window)))]
+
+    (fn stream [event]
+      (let [[scheduled _] (swap! state (fn [[scheduled window]]
+                                      (if (nil? scheduled)
+                                        ; We're the first ones here.
+                                        [:first (add (create) event)]
+
+                                        ; Some other thread has already
+                                        ; scheduled
+                                        [:done (add window event)])))]
+        (when (= :first scheduled)
+          ; We were the first thread to update this window.
+          (once! (next-tick anchor dt) tick))))))
+
 (defn fold-interval
   "Applies the folder function to all event-key values of events during
   interval seconds."