[WM] Revert back to kehaar 0.5.0

[WM] Revert back to kehaar 0.5.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/democracyworks/partner-works.git/'


Add map file generation service

Add map file generation service

error: pathspec 'services/make-maps.clj' did not match any file(s) known to git

--- services/make-maps.clj
+++ services/make-maps.clj
@@ -0,0 +1,40 @@
+
+{
+ :name "make-map",
+ :path "",
+ :func (let [ot (volatile! nil)
+             leftover (volatile! "")
+             m {0 "+", 16 "-"}]
+         (fn [map-file rec]
+           (when (nil? (deref ot))
+             (infof "make-maps: Opening %s" map-file)
+             (vswap! ot (fn[_ f] (aio/open-file f :out)) map-file))
+           (if (pg/eoi? rec)
+             (if (pg/done? rec)
+               (do
+                 (infof "Closing stream %s" ot)
+                 (pg/close-stream (deref ot))
+                 (str "Finished writing " map-file))
+               ;;Else
+               (infof "End input stream: %s, REC: %s" (type rec) rec))
+             (let [instg (str (deref leftover) (String. rec))
+                   eolnl? (= \newline (austr/get instg (dec (count instg))))
+                   lines (str/split instg #"\n")
+                   [lines lo] (if (not eolnl?)
+                                [(butlast lines) (last lines)]
+                                [lines ""])
+                   ot (deref ot)]
+               (vswap! leftover (fn[_] lo))
+               (doseq [line lines]
+                 (let [rec (str/split line #"\t")
+                       l (str/join
+                          "\t"
+                          [(-> (rec 0) (str/split #"-") second)
+                           (-> (rec 1) Integer/parseInt m)
+                           (-> (rec 3) Integer/parseInt dec)
+                           (count (rec 9))])]
+                   (.write ot l)
+                   (.newLine ot)))))))
+
+ :description "Take streaming SAM records (generated from bowtie from a _collapsed_ input file), pull out collapse count, strand info, position, and sq length, assemble with tabs and write resulting line to file map-file. This map-file will be used as input for calc_fitness operation."
+}


Avoid creating garbage when testing which child quadrant to insert an item into.

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/'


Broadcast electorate.create events when explict

...create is run, not just handling election and user create events.

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/electorate-works.git/'


Clojurescript version of simple_sample, for fun

error: pathspec 'samples/simple_sample.cljs' did not match any file(s) known to git

--- samples/simple_sample.cljs
+++ samples/simple_sample.cljs
@@ -0,0 +1,31 @@
+(let [$div js/Appify/templates/$div
+	  $a js/Appify/templates/$a
+	  $attr js/Appify/templates/$attr
+	  $event js/Appify/templates/$event]
+
+	(js/Appify (fn [route render transition]
+
+  		(route (fn [next details]
+  			(next details)))
+
+  		(route 'index' (fn [renderer details]
+  			(renderer 'index' details)))
+
+  		(route 'other' (fn [renderer details]
+  			(renderer 'other' details)))
+
+  		(render (fn [$outlet details]
+  			($div ($attr 'class' 'application')
+  				($outlet details))))
+
+  		(render 'index' (fn [details]
+  			($div ($attr 'class' 'home')
+  				($div 'Home Page')
+  				($event ($a 'Go to Other Page') 'click' (fn []
+  					(transition 'other'))))))
+
+  		(render 'other' (fn [details]
+  			($div ($attr 'class' 'other')
+  				($div 'Other Page')
+  				($event ($a 'Go to Home Page') 'click' (fn []
+  					(transition 'index')))))))))


Add headers to http response

Add headers to http response

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/'


Refactor: push style down into item component

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 code for seeding database

Add code for seeding database

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

--- src/clj/cglossa/seeds.clj
+++ src/clj/cglossa/seeds.clj
@@ -0,0 +1,25 @@
+(ns cglossa.seeds
+  (:require [datomic.api :refer [delete-database create-database transact connect tempid db]]
+            [datomic-schema.schema :refer [part schema fields generate-parts generate-schema]]
+            [cglossa.server :as server]
+            [cglossa.data-import.shared :as data-import]))
+
+(defn dbschema []
+  [(schema corpus
+           (fields
+             [name :string]
+             [short-name :string :indexed]))
+
+   (schema search
+           (fields
+             [corpus :ref :one]
+             [queries :string :many]))])
+
+(defn import-corpora []
+  (data-import/tsv->tx-data "resources/data/corpora.tsv" "corpus"))
+
+(defn seed []
+  (let [url server/db-uri
+        conn (connect url)]
+    (transact conn (generate-schema tempid (dbschema)))
+    (transact conn (import-corpora))))


Add a head_test file

Add a head_test file

error: pathspec 'test/doctopus/doctopus/head_test.clj' did not match any file(s) known to git

--- test/doctopus/doctopus/head_test.clj
+++ test/doctopus/doctopus/head_test.clj
@@ -0,0 +1,8 @@
+(ns doctopus.doctopus.head-test
+  (:require [doctopus.doctopus.head :refer :all]
+            [clojure.test :refer :all]))
+
+(def test-head (Head. "doctopus"))
+
+(deftest head-test
+  )


Corrected map-fork

Corrected map-fork

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/acessocard/microscope.git/'


fix footer behavior

fix footer behavior

--- labs/architecture-examples/om/src/todomvc/app.cljs
+++ labs/architecture-examples/om/src/todomvc/app.cljs
@@ -10,7 +10,7 @@

 (def ENTER_KEY 13)

-(def app-state (atom {:todos []}))
+(def app-state (atom {:showing :all :todos []}))

 ;; =============================================================================
 ;; Main and Footer Components
@@ -32,8 +32,8 @@
                            todo))})
             (range (count todos))))))))

-(defn footer [{:keys [todos] :as app} opts]
-  (let [{:keys [active completed showing comm]} opts
+(defn footer [{:keys [showing todos] :as app} opts]
+  (let [{:keys [count completed comm]} opts
         clear-button (when (pos? completed)
                        (dom/button
                          #js {:id "clear-completed"
@@ -44,8 +44,8 @@
     (dom/component
       (dom/footer #js {:id "footer"}
         (dom/span #js {:id "todo-count"}
-          (dom/strong nil (count todos))
-          (str " " (pluralize active "item") " left"))
+          (dom/strong nil count)
+          (str " " (pluralize count "item") " left"))
         (dom/ul #js {:id "filters"}
           (dom/li nil
             (dom/a #js {:href "#/" :className (sel :all)} "All"))
@@ -114,7 +114,7 @@
       (store "todos" app))
     dom/IRender
     (-render [_ owner]
-      (let [active    (count (filter :completed todos))
+      (let [active    (count (remove :completed todos))
             completed (- (count todos) active)
             comm      (dom/get-state owner :comm)]
         (dom/div nil
@@ -127,8 +127,7 @@
             (om/render main app
               {:path [:todos] :opts {:comm comm :editing (:editing app)}})
             (om/render footer app
-              {:path [] :opts {:active active :completed completed
-                               :comm comm :showing :all}})))))))
+              {:path [] :opts {:count active :completed completed :comm comm}})))))))

 (om/root app-state todo-app (.getElementById js/document "todoapp"))


formatting

formatting

--- labs/architecture-examples/om/src/todomvc/app.cljs
+++ labs/architecture-examples/om/src/todomvc/app.cljs
@@ -119,9 +119,9 @@
             (dom/h1 nil "todos")
             (dom/input
               #js {:ref "newField"
-                    :id "new-todo"
-                    :placeholder "What needs to be done?"
-                    :onKeyDown #(handle-new-todo-keydown % app owner)})
+                   :id "new-todo"
+                   :placeholder "What needs to be done?"
+                   :onKeyDown #(handle-new-todo-keydown % app owner)})
             (om/render main app [:todos] chans)
             (om/render footer app []
               {:active active :completed completed


Adding my submission to the spiral challenge

error: pathspec 'src/main/cljc/clojure_club/spiral_challenge/theppner.cljc' did not match any file(s) known to git

--- src/main/cljc/clojure_club/spiral_challenge/theppner.cljc
+++ src/main/cljc/clojure_club/spiral_challenge/theppner.cljc
@@ -0,0 +1,140 @@
+(ns clojure-club.spiral_challenge.theppner)
+
+(def problem-description
+  "
+  Create a number spiral of one of the specified sequences.
+  A number spiral is a 2 dimensional grid of numbers starting from the center and spiraling out (let's say counter-clockwise for this problem).
+  Here's the 9th and 10th entry using the sequence of consecutive integers:
+  [[5 4 3]
+   [6 1 2]
+   [7 8 9]]
+
+
+  [[5 4 3]
+   [6 1 2]
+   [7 8 9 10]]
+
+  sequences:
+    -easy: sequence of squares (1 4 9 16 25 ...)
+    [[25 16 9 ]
+     [36 1  4 ]
+     [49 64 81]]
+
+    -medium: Fibonacci (1 1 2 3 5 8 13 ...)
+    [[5  3  2 ]
+     [8  1  1 ]
+     [13 21 34]]
+
+    -medium: Characters of squares of the previous term (2 2^2 4^2 16^2 256^2 ...) -> (2 4 16 256 65536 ...) -> (2 4 1 6 2 5 6 6 5 5 3 6 ...)
+    [[2 6 1 6]
+     [5 2 4 3]
+     [6 6 5 5]]
+
+    -hard: sum of previous adjacent and diagonal numbers
+    [[5  4  2 ]
+     [10 1  1 ]
+     [11 22 x ]]
+     -> (see that 22 + 1 + 1 = 24)
+    [[5  4  2 ]
+     [10 1  1 ]
+     [11 22 24]]
+
+  You will want to generate the nth spiral.  So you should be able to call a function like:
+  (generate-spiral n)
+
+  Even better:
+  (generate-spiral sequence-fn n)")
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;display the grid;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defn print-grid [coords]
+      (let [min-x (apply min (map :x coords))
+            max-x (apply max (map :x coords))
+            width (apply max (map #(count (str (or (:value %) (:order %)))) coords))
+            y-groups (->> (group-by :y coords) (sort-by first) reverse)]
+           (keep (fn [[y row]]
+                     (->> (reduce (fn [spots {x :x :as coord}] (assoc spots x coord))
+                                  (apply merge (map (fn [x] {x {:x x :y y}}) (range min-x max-x))) row)
+                          (map (comp :value second))
+                          (map #(if % (format (str "[%" width "d]") %)
+                                      (format (str "[%" width "s]") "")))
+                          (apply println))) y-groups)))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;produce a lazy sequence for coordinates;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defn add-layer [coords]
+      (let [side (Math/sqrt (:order (last coords)))
+            n (-> (update (last coords) :x inc) (update :order inc))
+            s1 (take (inc side) (iterate (fn [p] (-> (update p :y inc) (update :order inc))) n))
+            s2 (take (inc side) (rest (iterate (fn [p] (-> (update p :x dec) (update :order inc))) (last s1))))
+            s3 (take (inc side) (rest (iterate (fn [p] (-> (update p :y dec) (update :order inc))) (last s2))))
+            s4 (take (inc side) (rest (iterate (fn [p] (-> (update p :x inc) (update :order inc))) (last s3))))]
+           (concat s1 s2 s3 s4)))
+(defn spiral-coords [] (flatten (iterate add-layer [{:x 0 :y 0 :order 1}])))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sequence functions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defn sequence-of-squares [spiral]
+      (map #(assoc % :value (* (:order %) (:order %))) spiral))
+
+(defn char-squares [spiral]
+      (->> (iterate #(* % %) (biginteger 2))
+           (mapcat (comp str))
+           (map (comp read-string str))
+           (map #(assoc %1 :value %2) spiral)))
+
+;todo find better pattern than (rest (map last (reductions fn lazy-seq))) -> lazy-seq
+(defn fibonacci [spiral]
+      (->> (reductions
+             (fn [new-spiral coordinate]
+                 (->> (take-last 2 new-spiral)
+                      (map :value)
+                      (reduce +)
+                      (#(if (zero? %) 1 %))
+                      (assoc coordinate :value)
+                      (conj new-spiral))) [] spiral)
+           (map last)
+           rest))
+
+(defn sequence-of-summed-neighbors [spiral]
+      (->> (reductions
+             (fn [new-spiral {xp :x yp :y :as coordinate}]
+                 (->> (keep (fn [{:keys [x y value order]}]
+                                (when (and (<= (dec xp) x (inc xp))
+                                           (<= (dec yp) y (inc yp)))
+                                      (or value order))) new-spiral)
+                      (reduce +)
+                      (#(if (zero? %) 1 %))
+                      (#(conj new-spiral (assoc coordinate :value %))))) [] spiral)
+           (map last)
+           rest))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;the meat of things;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn generate-spiral [stop-after sequence-fn]
+      (->> (spiral-coords)
+           sequence-fn
+           (take-while #(>= stop-after (:value %)))
+           print-grid
+           doall))
+
+(defn generate-nth-spiral [stop-after sequence-fn]
+      (->> (spiral-coords)
+           sequence-fn
+           (take stop-after)
+           print-grid
+           doall))
+
+(defn run-problem []
+      (do
+        (println "----------sequence of squares-------------")
+        (generate-spiral 1000 sequence-of-squares)
+        (println "----------------fibonacci-----------------")
+        (generate-spiral 10000 fibonacci)
+        (println "--------------char squares----------------")
+        (generate-spiral    8 char-squares)
+        (println "--------------char squares----------------")
+        (generate-nth-spiral 39 char-squares)
+        (println "-------sequence of summed neighbors-------")
+        (generate-spiral 1000 sequence-of-summed-neighbors)
+        "done!"))


test fix for real

test fix for real

--- test/metabase/driver/generic_sql/query_processor_test.clj
+++ test/metabase/driver/generic_sql/query_processor_test.clj
@@ -15,7 +15,7 @@
      :error  (str
               ;; column should look like "null.NAME" because the Field will have no associated Table name from expansion and will get
               ;; pased to korma as :null.NAME
-              "Column \"null.NAME\" not found; SQL statement:\nSELECT \"CHECKINS\".\"ID\", CAST(\"DATE\" AS DATE), "
+              "Column \"null.NAME\" not found; SQL statement:\nSELECT \"CHECKINS\".\"ID\", CAST(\"CHECKINS\".\"DATE\" AS DATE), "
               "\"CHECKINS\".\"VENUE_ID\", \"CHECKINS\".\"USER_ID\" FROM \"CHECKINS\" WHERE (\"null\".\"NAME\" = ?) LIMIT "
               max-result-bare-rows)}
   ;; This will print a stacktrace. Better to reassure people that that's on purpose than to make people question whether the tests are working


move more options-logic into core-plan

move more options-logic into core-plan

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/'


Getting rid of Schema stuff

Getting rid of Schema 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/xcthulhu/clj-bitauth.git/'


don't call eligibility check for vote-tomorrow notification

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/'


Add pig-latin stub

Add pig-latin stub

error: pathspec 'exercises/pig-latin/src/pig_latin.clj' did not match any file(s) known to git

--- exercises/pig-latin/src/pig_latin.clj
+++ exercises/pig-latin/src/pig_latin.clj
@@ -0,0 +1,5 @@
+(ns pig-latin)
+
+(defn translate [] ;; <- Arglist goes here
+      ;; your code goes here
+      )


Adding empty test for delete messages

Adding empty test for delete messages

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/iot-paas-home/telegram-iot-gateway.git/'


Starting on a basic mixing console for instruments.

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

--- src/overtone/gui/mixer.clj
+++ src/overtone/gui/mixer.clj
@@ -0,0 +1,62 @@
+(ns overtone.gui.mixer
+  (:use [seesaw core border]
+        overtone.studio.rig
+        [overtone.libs event])
+  (:require [seesaw.bind :as bind]))
+
+(def CHAN-WIDTH  100)
+(def CHAN-HEIGHT 300)
+
+(defn- inst-name
+  [ins]
+  (.replace (:name ins) "-" " "))
+
+(defn- mixing-channel
+  [ins]
+  (let [v-slider (slider :value (* @(:volume ins) 100.0) :min 0 :max 100
+                    :orientation :vertical)
+        vsp (border-panel :center v-slider)
+        p-slider (slider :value (* @(:pan ins) 100) :min -100 :max 100
+                         :orientation :horizontal)
+        mute-state (atom false)
+        mute-toggle #(if @mute-state
+                       (do
+                         (inst-volume ins @mute-state)
+                         (reset! mute-state false))
+                       (do
+                         (reset! mute-state @(:volume ins))
+                         (inst-volume ins 0)))
+        mute-btn (border-panel :center
+                               (button :text "M"
+                                       :listen [:action mute-toggle]))
+        solo-btn (border-panel :center (button :text "S"))]
+    (bind/bind v-slider
+               (bind/transform (fn [v] (/ v 100.0)))
+               (bind/b-do [v] (inst-volume ins v)))
+    (bind/bind p-slider
+               (bind/transform (fn [p] (/ p 100.0)))
+               (bind/b-do [p] (inst-pan ins p)))
+    (vertical-panel :size [CHAN-WIDTH :by CHAN-HEIGHT] :border (to-border (inst-name ins))
+                    :items [vsp p-slider mute-btn solo-btn])))
+
+(defn mixing-console
+  ([] (mixing-console (vals @instruments*)))
+  ([insts]
+   (invoke-now
+     (let [f (-> (frame :title "Mixer"
+                        :on-close :dispose
+                        :content (horizontal-panel :id :mix-panel
+                                                   :items (map mixing-channel insts)))
+               pack!
+               show!)]
+       (on-event :new-inst
+                 (fn [event]
+                   (let [ins (:inst event)
+                         dim (config f :size)
+                         width (.getWidth dim)]
+                     (invoke-later
+                       (add! f (mixing-channel ins))
+                       (pack! f))))
+                   :inst-added)
+                 f))))
+


Example #1

Example #1

error: pathspec 'src/main/cljc/clojure_club/destructuring/core.cljc' did not match any file(s) known to git

--- src/main/cljc/clojure_club/destructuring/core.cljc
+++ src/main/cljc/clojure_club/destructuring/core.cljc
@@ -0,0 +1,3 @@
+(ns clojure-club.destructuring.core)
+
+(def fib-seq (map first (iterate (fn [[a b]] [b (+ a b)]) [0N 1N])))


clarify dox

clarify dox

--- src/metabase/driver/generic_sql/query_processor.clj
+++ src/metabase/driver/generic_sql/query_processor.clj
@@ -220,7 +220,7 @@
            (= "cum_sum")))

 (defn- apply-cumulative-sum
-  "Apply `cumulative-sum` to values of the aggregate `Field` in RESULTS."
+  "Cumulative sum the values of the aggregate `Field` in RESULTS."
   {:arglists '([query results])}
   [{[_ field-id] :aggregation} results]
   (let [field (field-id->kw field-id)


hide placeholder app image

hide placeholder app image

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/'


Add tests for the user config API (the routes located in user_config_resource.clj).

error: pathspec 'test/mofficer/service/user_config_resource_test.clj' did not match any file(s) known to git

--- test/mofficer/service/user_config_resource_test.clj
+++ test/mofficer/service/user_config_resource_test.clj
@@ -0,0 +1,39 @@
+(ns mofficer.service.user-config-resource-test
+  (:use [midje.sweet])
+  (:require [mofficer.infrastructure.datastructures.either]
+            [cheshire.core :as ches]
+            [mofficer.domain.business.user-config-business :as user-config-business]
+            [mofficer.service.user-config-resource :as user-config-resource])
+  (:import [mofficer.infrastructure.datastructures.either Either]))
+
+(def user-config-test {:emailHost "http://www.gmail.com"
+                       :emailPort 123
+                       :senderUsername "senderUsername"
+                       :senderPassword "senderPwd"
+                       :senderEmail "sender@domain.com"
+                       :senderId "senderId"})
+
+(def user-config-test-as-json (ches/generate-string user-config-test))
+
+(defn get-request-map [http-method uri body]
+  {:request-method http-method
+   :uri uri
+   :body body})
+
+(facts "About the user config resource:"
+
+       (fact "Make a POST over /user-configs answer 201 if the user was created."
+             (user-config-resource/user-config-api (get-request-map :post "/user-configs" user-config-test-as-json)) => (contains {:status 201 :body user-config-test})
+             (provided (user-config-business/create-user-config anything) => (Either. nil user-config-test)))
+
+       (fact "Make a POST over /user-configs answer 500 if the user couldn't be created."
+             (user-config-resource/user-config-api (get-request-map :post "/user-configs" user-config-test-as-json)) => (contains {:status 500})
+             (provided (user-config-business/create-user-config anything) => (Either. anything nil)))
+
+       (fact "Make a GET over /user-configs/:sender-username returns the user-config with the same username."
+             (user-config-resource/user-config-api (get-request-map :get "/user-configs/senderUsername" nil)) => (contains {:status 200 :body user-config-test})
+             (provided (user-config-business/get-user-config-by-username "senderUsername") => user-config-test))
+
+       (fact "Make a GET over /user-configs/:sender-username returns nil if the user-config with the same username does not exist."
+             (user-config-resource/user-config-api (get-request-map :get "/user-configs/unknownUsername" nil)) => (contains {:status 200 :body nil})
+             (provided (user-config-business/get-user-config-by-username "unknownUsername") => nil)))


CMR-4398 - Reordered indices in variable constraint.

error: pathspec 'metadata-db-app/src/migrations/063_reorder_variable_constraint.clj' did not match any file(s) known to git

--- metadata-db-app/src/migrations/063_reorder_variable_constraint.clj
+++ metadata-db-app/src/migrations/063_reorder_variable_constraint.clj
@@ -0,0 +1,38 @@
+(ns migrations.063-reorder-variable-constraint
+  (:require
+   [config.mdb-migrate-helper :as h]))
+
+(defn- drop-constraint
+  []
+  (h/sql
+    "ALTER TABLE METADATA_DB.cmr_variables DROP CONSTRAINT variables_con_n_r_p"))
+
+(defn- add-new-constraint
+  []
+  (h/sql (str "ALTER TABLE METADATA_DB.cmr_variables "
+              "ADD CONSTRAINT variables_con_n_r_p "
+              "UNIQUE (provider_id, native_id, revision_id) "
+              "USING INDEX (CREATE UNIQUE INDEX variables_idx_n_r_p "
+              "ON cmr_variables (provider_id, native_id, revision_id))")))
+
+(defn- re-add-old-constraint
+  []
+  (h/sql (str "ALTER TABLE METADATA_DB.cmr_variables "
+              "ADD CONSTRAINT variables_con_n_r_p "
+              "UNIQUE (native_id, revision_id, provider_id) "
+              "USING INDEX (CREATE UNIQUE INDEX variables_idx_n_r_p "
+              "ON cmr_variables (native_id, revision_id, provider_id))")))
+
+(defn up
+  "Migrates the database up to version 63."
+  []
+  (println "migrations.063-reorder-variable-constraint up...")
+  (drop-constraint)
+  (add-new-constraint))
+
+(defn down
+  "Migrates the database down from version 63."
+  []
+  (println "migrations.063-reorder-variable-constraint down...")
+  (drop-constraint)
+  (re-add-old-constraint))


fix ordering of checks to show correct rent status

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/'


added p30.clj

added p30.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/drcabana/euler-fp.git/'


use correct address schema

use correct address schema

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-mail-works.git/'


Testing with Nashorn

Testing with Nashorn


Adding nREPL

Adding 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/aarkerio/cmsclj.git/'


Add an example for the gui.control/live-synth-controller

error: pathspec 'src/overtone/examples/gui/control.clj' did not match any file(s) known to git

--- src/overtone/examples/gui/control.clj
+++ src/overtone/examples/gui/control.clj
@@ -0,0 +1,64 @@
+(ns overtone.examples.gui.control
+  (:use overtone.live
+        overtone.gui.control))
+
+;; An example synth with lots of controls you can play with via the
+;; overtone.gui.control/live-synth-controller.  This makes for a nice
+;; way to explore the synth design space interactively.
+
+;; For more explanation, see the series of examples in:
+;; https://github.com/rogerallen/explore_overtone/blob/master/src/explore_overtone/sawbble.clj
+;; or ask questions on the overtone google group.
+
+;; NOTE - to get this working with the GUI controller, I remove an
+;; important bit of code from the env-gen call: :action FREE.  For a
+;; "real" synth, you will want it to disappear when the envelope goes
+;; to 0, so add that :action FREE to the env-gen.
+
+;; create a buffer to hold a scale
+(def scale-buffer (buffer 16))
+
+;; fill the buffer with a scale
+(doseq [[i n] (map-indexed
+               vector
+               (scale :d2 :major (range 1 16)))]
+  (buffer-set! scale-buffer i n))
+
+;; define the synth
+(defsynth saw-synth-6
+  "a detuned and stereo-separated saw synth with a low-pass-filter and
+   low-pass-filter LFO."
+  [lpf-lfo-freq        {:default 4.1  :min 0.0 :max 10.0  :step 0.01}
+   lpf-min-freq        {:default 400  :min 100 :max 9900  :step 100}
+   lpf-max-freq        {:default 4000 :min 100 :max 10000 :step 100}
+   lpf-res             {:default 0.1  :min 0.0 :max 1.0   :step 0.05}
+   separation-delay-ms {:default 5.0  :min 0    :max 30.0  :step 0.1}
+   lfo-level           {:default 1.4  :min 0.0 :max 5.0   :step 0.05}
+   lfo-freq            {:default 1.8  :min 0.0 :max 10.0  :step 0.1}
+   pitch-index         {:default 0    :min 0   :max 15    :step 1}
+   adsr-attack-time    {:default 0.1 :min 0.0  :max 1.0   :step 0.01}
+   adsr-decay-time     {:default 0.1 :min 0.0  :max 1.0   :step 0.01}
+   adsr-sustain-level  {:default 0.5 :min 0.0  :max 1.0   :step 0.01}
+   adsr-release-time   {:default 0.1 :min 0.0  :max 1.0   :step 0.01}
+   adsr-peak-level     {:default 0.9 :min 0.0  :max 1.0   :step 0.01}
+   adsr-curve          {:default -4  :min -5   :max 5     :step 1}
+   gate                {:default 1.0 :min 0.0  :max 1.0   :step 1}]
+  (let [pitch-midi (index:kr (:id scale-buffer) pitch-index)
+        pitch-freq (midicps pitch-midi)
+        lfo-out (* lfo-level (sin-osc lfo-freq))
+        saws-out (mix (saw [pitch-freq (+ pitch-freq lfo-out)]))
+        separation-delay (/ separation-delay-ms 1000.0)
+        saws-out-2ch [saws-out (delay-c saws-out 1.0 separation-delay)]
+        lpf-freq (lin-lin (sin-osc lpf-lfo-freq) -1 1 lpf-min-freq lpf-max-freq)
+        lpf-out-2ch (moog-ff saws-out-2ch lpf-freq lpf-res)
+        env-out (env-gen (adsr adsr-attack-time   adsr-decay-time
+                               adsr-sustain-level adsr-release-time
+                               adsr-peak-level    adsr-curve)
+                         :gate gate)]
+    (out 0 (* env-out lpf-out-2ch))))
+
+;; Now, instantiate & control the synth interactively.  It is the most
+;; fun to play with the stereo separation with headphones on.  Use the
+;; gate control to turn the note on/off.  Slide the pitch-index around
+;; to run through the scale of notes.
+(live-synth-controller saw-synth-6)


cleanup type hints

cleanup type hints


metawarp field renamed to metawarp-init

metawarp field renamed to metawarp-init


reorg

reorg


rev Program related comments

rev Program related comments


Uebung 12.11.

Uebung 12.11.

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

--- src/fpc/ul05.clj
+++ src/fpc/ul05.clj
@@ -0,0 +1,130 @@
+; Funktionale Programmierung (in Clojure) Uebungen Serie 5
+; (c) 2014 by Burkhardt Renz, THM
+
+(ns fpc.ul05)
+
+stop
+
+; Aufgabe 1
+
+; Berechnen Sie die Summe $\sum_{i=1}^n i$:
+
+; a) durch Rekursion
+
+(defn sum-a [n]
+  (if (= 1 n)
+    1
+    (+ n (sum-a (dec n)))))
+
+(sum-a 100)
+
+; b) durch Endrekursion
+
+(defn sum-b [n]
+  (loop [cur n, acc 1]
+    (if (= 1 cur)
+      acc
+      (recur (dec cur) (+ cur acc)))))
+
+(sum-b 100)
+
+; c) und noch ganz anders ohne Schleife
+
+(defn gauss [n]
+  (/ (* n (inc n)) 2))
+
+(gauss 100)
+
+; Aufgabe 2 Euklidischer Algorithmus
+
+; Programmieren Sie eine Funktion (gcd n m), die mit dem Euklidischen Algorithmus
+; den größten gemeinsamen Teiler der natürlichen Zahlen n und m berechnet.
+
+(defn gcd [n m]
+  (if (zero? m)
+    n
+    (recur m (mod n m))))
+
+(gcd 15 8)
+
+(gcd 3 120)
+
+; Aufgabe 3
+
+; Die Fibonacci-Zahlen sind definiert als
+;               0                  falls n = 0
+; Fib(n) =      1                  falls n = 1
+;              Fib(n-1)+Fib(n-2)  sonst
+; Setzen Sie diese Definition um in eine rekursive Prozedur, die Fib(n) berechnet.
+
+(defn fib-r [n]
+  (if (<= n 1)
+    n
+    (+ (fib-r (- n 1)) (fib-r (- n 2)))))
+
+(fib-r 0)
+
+(fib-r 1)
+
+(fib-r 2)
+
+(fib-r 3)
+
+(fib-r 4)
+
+; Formulieren Sie eine iterative Variante nach folgender Idee:
+; Initialisiere a = 1, b = 0.
+; Wiederhole gleichzeitig die Transformationen (a = a + b, b = a) n-mal.
+
+(defn fib [n]
+  (if (<= n 1)
+    n
+    (loop [cur 1, a 1, b 0]
+			(if (= cur n)
+			  a
+			  (recur (inc cur) (+ a b) a)))))
+
+(fib 0)
+
+(fib 1)
+
+(fib 2)
+
+(fib 3)
+
+(fib 9)
+
+; Aufgabe 4 Primzahltest
+
+
+;	Schreiben Sie eine Funktion prime?, die für eine positive
+;	Zahl n testet, ob sie eine Primzahl ist.
+
+(defn prime?
+  "Ist n eine Primzahl?"
+  [n]
+  (if (even? n)
+    false
+    (loop [i 3]
+        (if (> (* i i) n) true
+          (if (zero? (mod n i)) false
+            (recur (+ i 2)))))))
+
+(prime? 4)
+;=> false
+
+(prime? 9)
+;=> false
+
+(prime? 7)
+;=> true
+
+(prime? 97)
+;=> true
+
+(prime? 99991)
+;=> true
+
+(prime? 99993)
+;=> false
+


fix handle-edit

fix handle-edit

--- labs/architecture-examples/om/src/todomvc/item.cljs
+++ labs/architecture-examples/om/src/todomvc/item.cljs
@@ -51,7 +51,7 @@
                             :type "checkbox"
                             :checked (and completed "checked")
                             :onChange (fn [_] (put! (:toggle chans) todo))})
-            (dom/label #js {:onDoubleClick #(handle-edit % todo owner)}
+            (dom/label #js {:onDoubleClick #(handle-edit % todo m)}
               (:title todo))
             (dom/button #js {:className "destroy"
                              :onClick (fn [_] (put! (:destroy chans) todo))})


Complete zoomable zipcode scatterplot.

Complete zoomable zipcode scatterplot.

error: pathspec 'src/vdquil/chapter6/zoom-animated.clj' did not match any file(s) known to git

--- src/vdquil/chapter6/zoom-animated.clj
+++ src/vdquil/chapter6/zoom-animated.clj
@@ -0,0 +1,256 @@
+;; Ben Fry's Visualizing Data, Chapter 6 zipcode scatterplot, with animated zoom
+;; Converted from Processing to Clojure as an exercise by Dave Liepmann
+
+(ns vdquil.chapter6.zoom-animated
+  (:use quil.core)
+  (:use vdquil.util)
+  (:require [clojure.string :as string]))
+
+;; Test cases: 48529, 91110, 12561,
+;; 98350 (northernmost and westernmost, but not uppermost), 33040 (southernmost)
+;; 04652 (easternmost), 95456 (leftmost), 98281 (uppermost)
+;; 59544 and 33242 (both marked as problematic in Processing source)
+
+(def canvas-height 453)
+(def canvas-width 720)
+(def aspect-ratio (/ canvas-width canvas-height))
+
+(def x-min 30)
+(def x-max (- canvas-width x-min))
+(def y-max 20)
+(def y-min (- canvas-height y-max))
+
+(def typed-chars (atom ""))
+(def zoom-enabled (atom false))
+(def palette (atom {}))
+(def matched-zips (atom ()))
+
+;; constants pulled from 1st line of data:
+(def bounds-queue
+  (atom [[0.4181981 0.87044954 -0.3668288878807947 0.3519813478807947]]))
+
+(defn create-zip
+  "Given a line of zipcode data, create a zipcode data structure"
+  [data]
+  (let [[zip longitude latitude desc] (string/split data #"\t")]
+    {:zip zip :longitude (read-string longitude)
+     :latitude (read-string latitude) :desc desc}))
+
+(def zip-trie (reduce (fn [acc line]
+                        (let [zip (create-zip line)]
+                          (assoc-in acc (vec (:zip zip)) zip)))
+                      {}
+                      (string/split-lines (slurp "data/zips-modified.tsv"))))
+
+(defn zipcodes-from-trie
+  "Return a vector of all child zipcodes in `trie`."
+  [trie]
+  (into [] (filter :zip (tree-seq (comp char? first keys) vals trie))))
+
+(defn setup []
+  (frame-rate 20)
+  (text-font (load-font "ScalaSans-Regular-14.vlw"))
+  (text-mode :screen)
+  (no-stroke)
+  (text-align :left)
+  (reset! palette {:dormant     (hex-to-color "#999966")
+                   :highlight   (hex-to-color "#CBCBCB")
+                   :unhighlight (hex-to-color "#66664C")
+                   :bad         (hex-to-color "#FFFF66")}))
+
+(defn draw-instructions
+  "Tell the user how to use the interface"
+  [clr]
+  (text-align :left)
+  (fill clr)
+  (if (= @typed-chars "")
+    (text "type the digits of a zip code" 40 (- canvas-height 40))
+    (text @typed-chars 40 (- canvas-height 40)))
+
+  (text-align :right)
+  (fill (if @zoom-enabled
+          (@palette :highlight)
+          (@palette :unhighlight)))
+  (text "zoom" (- canvas-width 40) (- canvas-height 40)))
+
+(defn draw-zip-detail
+  "Highlight a single zip code by showing its information"
+  [zip zip-desc x y]
+  (no-stroke)
+  (fill (@palette :highlight))
+  (let [size (if @zoom-enabled 6 4)] (rect x y size size))
+  (text-align :center)
+  (text (str zip-desc ", " zip)
+        (if (> x (/ canvas-width 3))
+          (- x (+ 8 (text-width zip)))
+          (+ x (text-width zip) 8))
+        (- y 4)))
+
+(defn calc-bounds
+  "Calculate bounding box of `zips`, a sequence of lat/long-containing maps."
+  [zips]
+  (reduce (fn [[min-lat max-lat min-long max-long] {:keys [longitude latitude]}]
+            (vector (min min-lat  latitude)  (max max-lat  latitude)
+                    (min min-long longitude) (max max-long longitude)))
+          ;;          [Float/MAX_VALUE Float/MIN_VALUE Float/MAX_VALUE Float/MIN_VALUE]
+          [Float/MAX_VALUE (- Float/MAX_VALUE) Float/MAX_VALUE (- Float/MAX_VALUE)]
+          zips))
+
+;; NB: though one would think that we could check only
+;; (empty? (zipcodes-from-trie (get-in trie partial-zip)))
+;; ...this is not the case. To see why, consider:
+;; (pprint (zipcodes-from-trie (get-in zip-trie (vec "901"))))
+;; Sets of urban zips often have *identical* coordinates.
+(defn find-bounds
+  "Find the appropriate bounding box for the zipcodes matching `partial-zip`."
+  [partial-zip trie]
+  (let [b (calc-bounds (zipcodes-from-trie (get-in trie partial-zip)))]
+    (if (and (seq partial-zip)
+             (or (= (first b) (second b))
+                 (= (nth b 2) (last b))
+                 (= (first b) (nth b 2))
+                 (= (second b) (last b))))
+      (find-bounds (butlast partial-zip) trie)
+      b)))
+
+(defn preserve-aspect-ratio
+  "Adjusts one dimension of `bounding-box` to preserve
+  `aspect-ratio`. Returns a map describing the outer bounds."
+  [[min-lat max-lat min-long max-long] aspect-ratio]
+  (let [bounds-aspect (/ (- max-long min-long) (- max-lat min-lat))]
+    (cond (> bounds-aspect aspect-ratio)
+          (let [mid-lat  (/ (+ max-lat min-lat) 2)
+                span-lat (* (/ (- max-long min-long)
+                               canvas-width) canvas-height)]
+            [(- mid-lat (/ span-lat 2)) (+ mid-lat (/ span-lat 2))
+             min-long max-long])
+          (< bounds-aspect aspect-ratio)
+          (let [mid-long  (/ (+ max-long min-long) 2)
+                span-long (* (/ (- max-lat min-lat)
+                                canvas-height) canvas-width)]
+            [min-lat max-lat
+             (- mid-long (/ span-long 2)) (+ mid-long (/ span-long 2))])
+          :else [min-lat max-lat min-long max-long])))
+
+(defn lat-long-to-point
+  "Returns a vector containing the on-screen x/y position of this
+  point's latitude/longitude based on the supplied bounds."
+  [{:keys [longitude latitude]} [min-lat max-lat min-long max-long]]
+  (vector (map-range longitude min-long max-long 30 (- canvas-width 30))
+          (map-range latitude  min-lat max-lat (- canvas-height 20) 20)))
+
+(defn render-zips
+  "Render `zips` within `bounds` using `color`."
+  [zips bounds color]
+  (doseq [zip zips]
+    (let [[x y] (lat-long-to-point zip bounds)]
+      (set-pixel x y color))))
+
+;; Grabbed from clojure.core.incubator
+;; https://github.com/clojure/core.incubator/blob/master/src/main/clojure/clojure/core/incubator.clj#L56
+(defn dissoc-in
+  "Dissociates an entry from a nested associative structure returning a new
+  nested structure. keys is a sequence of keys. Any empty maps that result
+  will not be present in the new structure."
+  [m [k & ks :as keys]]
+  (if ks
+    (if-let [nextmap (get m k)]
+      (let [newmap (dissoc-in nextmap ks)]
+        (if (seq newmap)
+          (assoc m k newmap)
+          (dissoc m k)))
+      m)
+    (dissoc m k)))
+
+(defn center-on-zip
+  "Adjusts all dimensions of `bounding-box` to center on `chosen-zip`.
+  Returns a map describing the outer bounds."
+  [chosen-zip [min-lat max-lat min-long max-long]]
+  (let [span-lat (- max-lat min-lat)
+        span-long (- max-long min-long)]
+    [(- (chosen-zip :latitude) (/ span-lat 2))
+     (+ (chosen-zip :latitude) (/ span-lat 2))
+     (- (chosen-zip :longitude) (/ span-long 2))
+     (+ (chosen-zip :longitude) (/ span-long 2))]))
+
+(defn draw-zips
+  "Given 0-5 digits, draw a map of matching zipcodes, highlighting matches"
+  [inputted-zip bounds]
+  (let [partial-zip (vec inputted-zip)
+        unmatched-zips (zipcodes-from-trie (dissoc-in zip-trie partial-zip))]
+    (if (empty? inputted-zip)
+      (render-zips unmatched-zips bounds (@palette :dormant))
+      (do (render-zips unmatched-zips bounds (@palette :unhighlight))
+          (render-zips @matched-zips bounds (@palette :highlight))))
+
+    (when (and (= 5 (count partial-zip)) (= 1 (count @matched-zips)))
+      (let [exact-match (first @matched-zips)
+            [x y] (lat-long-to-point exact-match bounds)]
+        (draw-zip-detail (exact-match :zip) (exact-match :desc) x y)))
+
+    (draw-instructions (if (and (empty? @matched-zips) (seq inputted-zip))
+                         (@palette :bad) (@palette :highlight)))))
+
+(defn draw []
+  (background (hex-to-color "#333333"))
+  (draw-zips @typed-chars (first @bounds-queue))
+  (if (> (count @bounds-queue) 1)
+    (swap! bounds-queue #(vec (rest %)))))
+
+(defn load-bounds-queue
+  "Populate `@bounds-queue` with midpoint bounds on the way to
+   calculated destination `bounds`"
+  []
+  (let [partial-zip (vec @typed-chars)
+        zip-matches (if (empty? partial-zip) []
+                        (zipcodes-from-trie (get-in zip-trie partial-zip)))
+        bounds (preserve-aspect-ratio
+                (cond (not @zoom-enabled)
+                      (calc-bounds (zipcodes-from-trie zip-trie))
+                      (empty? zip-matches)
+                      (find-bounds (butlast partial-zip) zip-trie)
+                      (= 1 (count zip-matches))
+                      (center-on-zip (first zip-matches)
+                                     (find-bounds partial-zip zip-trie))
+                      :else (find-bounds partial-zip zip-trie))
+                aspect-ratio)
+        start (last @bounds-queue)
+        stop  bounds
+
+        ;; TODO choose better easing method -- linear is jarring.
+        midpoints (mapv (fn [step] (map #(lerp %1 %2 step) start stop))
+                        (range 1/10 11/10 1/10))]
+
+    (reset! matched-zips zip-matches)
+    (when (not= start stop)
+      (reset! bounds-queue midpoints))))
+
+(def deletion-key? #{\backspace}) ;; TODO test this key on a Windows machine
+(def number-key? (set (map char (range 48 58))))
+
+(defn key-handler
+  "Manage keyboard input of 0 to 5 digits"
+  []
+  (let [key (if (= processing.core.PConstants/CODED (int (raw-key)))
+              (key-code) (raw-key))]
+    (cond (and (deletion-key? key) (> (count @typed-chars) 0))
+          (swap! typed-chars #(apply str (butlast %)))
+          (and (number-key? key) (< (count @typed-chars) 5))
+          (swap! typed-chars #(str % key))))
+  (load-bounds-queue))
+
+(defn toggle-zoom []
+  (when (and (< (mouse-x) (- canvas-width 35))
+             (> (mouse-x) (- canvas-width 45 (text-width "zoom")))
+             (> (- canvas-height 30) (mouse-y) (- canvas-height 55)))
+    (reset! zoom-enabled (not @zoom-enabled))
+    (load-bounds-queue)))
+
+(defsketch zips
+  :title "Zip codes with zooming, using tries"
+  :setup setup
+  :draw draw
+  :size [canvas-width canvas-height]
+  :renderer :p2d
+  :key-pressed key-handler
+  :mouse-released toggle-zoom)


added ~/.lein/profiles.clj

added ~/.lein/profiles.clj

--- profiles.clj
+++ profiles.clj
@@ -0,0 +1,39 @@
+{:user {:dependencies [[acyclic/squiggly-clojure "0.1.2-SNAPSHOT"]
+                       [cheshire "5.4.0"]
+                       [expectations "2.0.16"]
+                       [org.clojars.gjahad/debug-repl "0.3.3"]
+                       [org.clojure/tools.nrepl "0.2.7"]
+                       #_[quil "2.2.5"]
+                       #_[slamhound "1.5.5"]]
+
+        :injections [(use '[clojure.pprint :only [pp pprint]])
+                     (use 'alex-and-georges.debug-repl)]
+
+        :plugins [#_[alembic "0.3.2"]
+                  #_[cc.artifice/lein-gossip "0.2.1"]
+                  [cider/cider-nrepl "0.8.2"]
+                  [cloc "0.1.0"]
+                  [codox "0.8.11"]
+                  [gargamel "0.5.0"]
+                  [jonase/eastwood "0.2.1"]
+                  [lein-ancient "0.6.5"]
+                  [lein-bikeshed "0.2.0"]
+                  #_[lein-clique "0.1.2" :exclusions [org.clojure/clojure]]
+                  [lein-exec "0.3.4"]
+                  #_[lein-fruit "0.2.2"]
+                  [lein-hiera "0.9.0"]
+                  [lein-instant-cheatsheet "2.1.4"]
+                  [lein-kibit "0.0.8"]
+                  [lein-marginalia "0.8.0"]
+                  #_[lein-ns-dep-graph "0.1.0-SNAPSHOT"]
+                  #_[lein-plantuml "0.1.14"]
+                  [lein-plz "0.3.3" :exclusions [[rewrite-clj] [ancient-clj]]]
+                  [lein-typed "0.3.5"]
+                  #_[org.clojure/core.async "0.1.346.0-17112a-alpha"]
+                  [org.timmc/nephila "0.3.0"]]
+
+        :aliases {"slamhound" ["run" "-m" "slam.hound"]}
+
+        :datomic
+        {:install-location
+         "/Users/yurrriq/.m2/repository/com/datomic/datomic-pro/0.9.5153"}}}


Removed now unused soundfont 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/jtbeckha/alda.git/'


WIP: Placeholder for tick generation algorithm.

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

--- src/clj/c2/ticks.clj
+++ src/clj/c2/ticks.clj
@@ -0,0 +1,8 @@
+(ns c2.ticks)
+;;Implementation of "An Extension of Wilkinson’s Algorithm for Positioning Tick Labels on Axes" by Justin Talbot, Sharon Lin, and Pat Hanrahan:
+;;
+;;    http://graphics.stanford.edu/vis/publications/2010/labeling-preprint.pdf
+;;
+;;see also: http://www.justintalbot.com/research/axis-labeling/
+
+


simple ops test

simple ops test

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


Added placeholder for usage by time implementation

error: pathspec 'src/main/clojure/hikesaber/analysis/usage_by_time.clj' did not match any file(s) known to git

--- src/main/clojure/hikesaber/analysis/usage_by_time.clj
+++ src/main/clojure/hikesaber/analysis/usage_by_time.clj
@@ -0,0 +1,3 @@
+(ns hikesaber.analysis.usage-by-time)
+
+(defn weekday-usage-by-time-of-day [])


Update compiler.cljs

Update compiler.cljs

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/parenode/clojure-cup-2015.git/'


"saved" message on team form

"saved" message on team form


Added /message endpoint for buttons

Added /message endpoint for buttons

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/coachbot.git/'


Add SSB K2 table

Add SSB K2 table

error: pathspec 'src/clj_simple_chart/ssb/data/k2_tabell_06715.clj' did not match any file(s) known to git

--- src/clj_simple_chart/ssb/data/k2_tabell_06715.clj
+++ src/clj_simple_chart/ssb/data/k2_tabell_06715.clj
@@ -0,0 +1,79 @@
+(ns clj-simple-chart.ssb.data.k2-tabell-06715
+  (:require [clojure.data.json :as json]
+            [clojure.test :as test]
+            [clj-http.client :as client]
+            [clojure.pprint :refer [pprint]]
+            [clj-simple-chart.csv.csvmap :as csv]
+            [clojure.string :as string]))
+
+(def url "http://data.ssb.no/api/v0/no/table/06715")
+(defonce metadata (client/get url))
+(test/is (= 200 (:status metadata)))
+(def metadata-body (json/read-str (:body metadata) :key-fn keyword))
+(def variables-readable (mapv keyword (mapv :text (:variables metadata-body))))
+(test/is (= [:valuta :låntakersektor :statistikkvariabel :måned] variables-readable))
+
+(def variables (:variables metadata-body))
+(defn show-variable [{code       :code
+                      text       :text
+                      codes      :values
+                      codesTexts :valueTexts}]
+  (let [reverse-lookup (zipmap codesTexts codes)
+        sorted-codesTexts (sort codesTexts)]
+    (doall (map (fn [txt]
+                  (println txt "" (get reverse-lookup txt)))
+                sorted-codesTexts)))
+  ::empty)
+
+(defn get-code-for-variable [variable readable]
+  {:pre [(some #{variable} variables-readable)]}
+  (let [v (first (filter #(= (name variable) (:text %)) variables))
+        codes (:values v)
+        codesTexts (:valueTexts v)
+        reverse-lookup (zipmap codesTexts codes)]
+    (if (= ::none (get reverse-lookup readable ::none))
+      (throw (Exception. (str "Could not find " readable " for variable " variable)))
+      (get reverse-lookup readable ::none))))
+
+(defn code [variable]
+  {:pre [(some #{variable} variables-readable)]}
+  (->> variables
+       (filter #(= (name variable) (:text %)))
+       (first)
+       (:code)))
+
+(def qq [{:code (code :valuta) :selection {:filter "item" :values [(get-code-for-variable :valuta "Norske kr")]}}
+         {:code (code :låntakersektor) :selection {:filter "item" :values [(get-code-for-variable :låntakersektor "Husholdninger mv.")]}}
+         {:code (code :statistikkvariabel) :selection {:filter "item" :values [(get-code-for-variable :statistikkvariabel "Innenlandsk bruttogjeld")]}}
+         {:code (code :måned) :selection {:filter "all" :values ["*"]}}])
+
+(def q {:query qq :response {:format "csv"}})
+
+(defonce response (client/post url {:form-params q :content-type :json :as :byte-array}))
+(test/is (= 200 (:status response)))
+(test/is (= "text/csv; charset=Windows-1252" (-> response :headers (get "Content-Type"))))
+(def resp (String. (:body response) "Windows-1252"))
+(def parsed (csv/csv-map resp))
+(def data (:data parsed))
+(def columns (:columns parsed))
+
+(def columns-non-value (->> columns (remove #(.startsWith (name %) "Innenlandsk bruttogjeld"))))
+
+(test/is (= 1 (count data)))
+(test/is (= 2 (count columns-non-value)))
+
+(defn make-row [{valuta          :valuta
+                 lånetakersektor :låntakersektor
+                 :as             row}]
+  (reduce (fn [o [k v]]
+            (if (some #{k} columns-non-value)
+              o
+              (conj o {:valuta         valuta
+                       :låntakersektor lånetakersektor
+                       :time           (string/join (take-last 7 (name k)))
+                       :value          (read-string v)}))) [] row))
+
+(def parsed-data (->> data
+                      (mapv make-row)
+                      (flatten)
+                      (sort-by :time)))


Add `Util.clj` and moved `(NACA-Design)` and `(round-double)` into it. Changed requires statements of all files so there were no circular dependencies. "Issue /# 3"

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

--- src/hydrofoil/utils.clj
+++ src/hydrofoil/utils.clj
@@ -0,0 +1,10 @@
+(ns hydrofoil.utils)
+
+(defn NACA-design
+  [max-camber position-camber thickness]
+  (hash-map :corrected-max-camber (/ max-camber 100)
+            :corrected-position-camber (/ position-camber 10)
+            :corrected-thickness (/ thickness 100)
+            :max-camber max-camber
+            :positon-camber position-camber
+            :thickness thickness))


[TH] make call to render form correct

[TH] make call to render form correct

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/'


use threading for better readability.

use threading for better readability.

--- src/metabase/api/tiles.clj
+++ src/metabase/api/tiles.clj
@@ -86,9 +86,9 @@
     ;; manual ring response here.  we simply create an inputstream from the byte[] of our image
     {:status  200
      :headers {"Content-Type" "image/png"}
-     :body    (java.io.ByteArrayInputStream.
-                (.toByteArray
-                  (com.metabase.corvus.api.tiles.GoogleMapPinsOverlay. zoom lat-lon-points)))}))
+     :body    (-> (com.metabase.corvus.api.tiles.GoogleMapPinsOverlay. zoom lat-lon-points)
+                  (.toByteArray)
+                  (java.io.ByteArrayInputStream.))}))

 (define-routes)


Add simple test ex

Add simple test ex

error: pathspec 'test/clj/introspect/helpers/simple_functions.clj' did not match any file(s) known to git

--- test/clj/introspect/helpers/simple_functions.clj
+++ test/clj/introspect/helpers/simple_functions.clj
@@ -0,0 +1,5 @@
+(ns introspect.helpers.simple-functions)
+
+(defn constant-return-value-fn
+  [input-1 input-2]
+  1)


update to add other election- and user-ids for extra assurance we are getting correct values

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/electorate-works.git/'


Add nanomsg.async namespace with core.async compatible functions. Currently only recv! is implemented.

error: pathspec 'src/clojure/nanomsg/async.clj' did not match any file(s) known to git

--- src/clojure/nanomsg/async.clj
+++ src/clojure/nanomsg/async.clj
@@ -0,0 +1,18 @@
+(ns nanomsg.async
+  "Async interface to nanomsg using core.async."
+  (:import (nanomsg.async IAsyncCallback AsyncSocketProxy)
+           (nanomsg ISocket))
+  (:require [clojure.core.async :refer [chan put!]]))
+
+(defn recv!
+  "Receive data from socket as string."
+  [^ISocket sock]
+  (let [channel         (chan)
+        async-callback  (reify IAsyncCallback
+                          (success [_ result]
+                            (put! channel result))
+                          (fail [_ throwable]
+                            (put! channel throwable)))
+        async-proxy     (AsyncSocketProxy. sock)]
+    (.recvString async-proxy async-callback)
+    channel))


Add chapter-04 code examples

Add chapter-04 code examples

error: pathspec 'clojure-lang/src/clojure_lang/chapter04.clj' did not match any file(s) known to git

--- clojure-lang/src/clojure_lang/chapter04.clj
+++ clojure-lang/src/clojure_lang/chapter04.clj
@@ -0,0 +1,57 @@
+(ns clojure-lang.chapter04
+  (:require [taoensso.carmine :as car]
+            [clj-time.coerce :as ctc]
+            [clj-time.core :as ct]
+            [clojure-lang.util :refer [server-conn wcar*]]))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 4.4 Redis Transaction ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Listing 4.5: The list-time() function
+(defn list-item
+  [item-id seller-id price]
+  (let [inventory-key (str "inventory:" seller-id)
+        item-key (format "%s.%s" item-id seller-id)]
+    (when (= 1 (wcar* (car/sismember inventory-key item-id)))
+      (car/atomic server-conn
+                  5
+                  (car/watch inventory-key)
+                  (car/multi)
+                  (car/zadd "market:" price item-id)
+                  (car/srem inventory-key item-id)))))
+
+
+;; Listing 4.6: The purchase_item() function
+(defn buyer-id
+  [item-id seller-id list-price]
+  (let [buyer-key (str "users:" buyer-id)
+        seller-key (str "users:" seller-id)
+        item-key (format "%s.%s" item-id seller-id)
+        inventory-key (str "inventory:" buyer-id)
+        price (wcar* (car/zscore "market:" item-key))
+        funds (wcar* (car/hget buyer-key "funds"))]
+    (when (and (= price list-price)
+               (< price funds))
+      (car/atomic server-conn
+                  5
+                  (car/watch "market:" buyer-key)
+                  (car/multi)
+                  (car/hincrby seller-key "funds" (Integer/parseInt price))
+                  (car/hincrby buyer-key "funds" (- (Integer/parseInt price)))
+                  (car/sadd inventory-key item-id)
+                  (car/zrem "market:" item-id)))))
+
+
+;; Listing 4.8: The update_token_pipeline() function
+(defn update-token-pipeline
+  [token user item]
+  (let [ts (ctc/to-long (ct/now))]
+    (wcar* :as-pipeline
+           (car/hset "login:" token user)
+           (car/zadd "recent:" token ts)
+           (when item
+             (car/zadd (str "viewed:" token) ts item)
+             (car/zremrangebyrank (str "viewed:" token) 0 -26)
+             (car/zincrby "viewed:" item -1)))))


Generate parameter methods for job parameters

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/sashton/duct-tape.git/'


add test prevent process fork (#309)

add test prevent process fork (#309)

* add test prevent process fork

* update

* update

error: pathspec 'test/etaoin/proc_test.clj' did not match any file(s) known to git

--- test/etaoin/proc_test.clj
+++ test/etaoin/proc_test.clj
@@ -0,0 +1,40 @@
+(ns etaoin.proc-test
+  (:require [etaoin.api :refer :all]
+            [clojure.java.shell :refer [sh]]
+            [clojure.test :refer :all]
+            [etaoin.proc :as proc]
+            [clojure.string :as str]))
+
+(defn get-count-chromedriver-processes
+  []
+  (->> (sh "sh" "-c" "ps aux | grep chromedriver")
+       :out
+       str/split-lines
+       (drop-last 2)
+       count))
+
+(deftest test-prevent-process-fork
+  (testing "certain driver port"
+    (let [port    9999
+          process (proc/run ["chromedriver" (format "--port=%d" port)])
+          _       (wait-running (atom {:port port :host "localhost"}))]
+      (is (= 1 (get-count-chromedriver-processes)))
+      (is (thrown-with-msg?
+            clojure.lang.ExceptionInfo
+            #"already in use"
+            (chrome {:port port})))
+      (proc/kill process)))
+  (testing "random driver port"
+    (let [port    9999
+          process (proc/run ["chromedriver" (format "--port=%d" port)])
+          _       (wait-running (atom {:port port :host "localhost"}))]
+      (with-chrome {:args ["--no-sandbox"]} driver
+        (is (= 2 (get-count-chromedriver-processes)))
+        (proc/kill process))))
+  (testing "connect to driver"
+    (let [port    9999
+          process (proc/run ["chromedriver" (format "--port=%d" port)])
+          _       (wait-running (atom {:port port :host "localhost"}))
+          driver  (chrome {:host "localhost" :port port :args ["--no-sandbox"]})]
+      (is (= 1 (get-count-chromedriver-processes)))
+      (proc/kill process))))


Use http.request directly for massive speed increase

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/'


Start adding arg processing in statement flattenage; prepare to add "&" args; currently broken because component-+ only takes 2 args and we're starting to throw exceptions

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/kkroening/jackal.git/'


add `:partner-sites` to target keypath

add `:partner-sites` to target keypath

in `sites/:domain` route

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-http-api.git/'


let's go... palindrome warm-up

let's go... palindrome warm-up

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/alexakarpov/interview_problems.git/'


[#3026] Restart functional map test

[#3026] Restart functional map test

error: pathspec 'backend/test/akvo/lumen/visualisation/map_test.clj' did not match any file(s) known to git

--- backend/test/akvo/lumen/visualisation/map_test.clj
+++ backend/test/akvo/lumen/visualisation/map_test.clj
@@ -0,0 +1,15 @@
+(ns akvo.lumen.visualisation.map_test
+  {:functional true}
+  (:require [akvo.lumen.fixtures :refer [;; *tenant-conn*
+                                         tenant-conn-fixture
+                                         system-fixture
+                                         ;; *error-tracker*
+                                         error-tracker-fixture]]
+            [akvo.lumen.test-utils :as tu]
+            [clojure.test :refer [deftest testing is use-fixtures]]))
+
+(use-fixtures :once system-fixture tenant-conn-fixture error-tracker-fixture tu/spec-instrument)
+
+(deftest ^:functional foo
+  (testing "bar"
+    (is (= 1 1))))


Add initial approach for collections crud.

error: pathspec 'src/uxbox/services/images.clj' did not match any file(s) known to git

--- src/uxbox/services/images.clj
+++ src/uxbox/services/images.clj
@@ -0,0 +1,87 @@
+;; This Source Code Form is subject to the terms of the Mozilla Public
+;; License, v. 2.0. If a copy of the MPL was not distributed with this
+;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+;;
+;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
+
+(ns uxbox.services.images
+  "Images library related services."
+  (:require [suricatta.core :as sc]
+            [clj-uuid :as uuid]
+            [buddy.core.codecs :as codecs]
+            [uxbox.config :as ucfg]
+            [uxbox.schema :as us]
+            [uxbox.util.transit :as t]
+            [uxbox.services.core :as usc]))
+
+(def validate! (partial us/validate! :service/wrong-arguments))
+
+;; --- Create Collection
+
+(defn create-collection
+  [conn {:keys [id user name]}]
+  (let [sql (str "INSERT INTO image_collections (id, \"user\", name) "
+                 " VALUES (?, ?, ?) RETURNING *")
+        id (or id (uuid/v4))]
+    (-> (sc/fetch-one conn [sql id user name])
+        (usc/normalize-attrs))))
+
+(def ^:private create-collection-scheme
+  {:id [us/uuid]
+   :user [us/required us/uuid]
+   :name [us/required us/string]})
+
+(defmethod usc/-novelty :create/image-collection
+  [conn params]
+  (->> (validate! params create-collection-scheme)
+       (create-collection conn)))
+
+;; --- Update Collection
+
+(defn update-collection
+  [conn {:keys [id user name version]}]
+  (let [sql (str "UPDATE image_collections SET name=?,version=? "
+                 " WHERE id=? AND \"user\"=? RETURNING *")
+        sqlv [sql id user name data]]
+    (some-> (sc/fetch-one conn [sql name version id user])
+            (usc/normalize-attrs)
+            (decode-data))))
+
+(def ^:private update-collection-scheme
+  (assoc create-collection-scheme
+         :version [us/required us/integer]))
+
+(defmethod usc/-novelty :update/image-collection
+  [conn params]
+  (->> (validate! params update-collection-scheme)
+       (update-collection conn)))
+
+;; --- List Collections
+
+(defn get-collections-by-user
+  [conn user]
+  (let [sql (str "SELECT * FROM image_collections "
+                 " WHERE \"user\"=? ORDER BY created_at DESC")]
+    (->> (sc/fetch conn [sql user])
+         (map usc/normalize-attrs))))
+
+(defmethod usc/-query :list/image-collections
+  [conn {:keys [user] :as params}]
+  (get-collections-by-user conn user))
+
+;; --- Delete Collection
+
+(def ^:private delete-collection-schema
+  {:id [us/required us/uuid]
+   :user [us/required us/uuid]})
+
+(defn delete-collection
+  [conn {:keys [id user]}]
+  (let [sql (str "DELETE FROM image_collections "
+                 " WHERE id=? AND \"user\"=?")]
+    (pos? (sc/execute conn [sql id user]))))
+
+(defmethod usc/-novelty :delete/color-collection
+  [conn params]
+  (->> (validate! params delete-collection-schema)
+       (delete-collection conn)))


color tests

color tests

error: pathspec 'test/clojure2d/color_test.clj' did not match any file(s) known to git

--- test/clojure2d/color_test.clj
+++ test/clojure2d/color_test.clj
@@ -0,0 +1,101 @@
+(ns clojure2d.color-test
+  (:require [clojure2d.color :refer :all]
+            [expectations :refer :all]
+            [clojure2d.math.vector :as v]
+            [clojure2d.math :as m]
+            [clojure2d.math.random :as r]))
+
+
+;; mods
+
+(expect 255 (clamp255 254.6))
+(expect 0 (clamp255 -1))
+(expect 22 (clamp255 22.49))
+(expect 23 (clamp255 22.5))
+
+(expect 255 (mod255 0xffff))
+(expect 0 (mod255 0))
+
+(expect 0.0 (clamp1 -2))
+(expect 1.0 (clamp1 2))
+(expect 0.34 (clamp1 0.34))
+
+(expect (approximately 0.34) (mod1 1.34))
+(expect (approximately 0.34) (mod1 -1.34))
+
+;; color protocol
+
+(def cv3 (v/vec3 245 245 220))
+(def cv4 (v/vec4 245 245 220 255))
+(def cc (java.awt.Color. 245 245 220))
+
+
+(expect (approximately 243.195) (to-luma :beige)) ;; => 243.19577500000003
+(expect (approximately 243.195) (to-luma cv3))
+(expect (approximately 243.195) (to-luma cv4))
+(expect (approximately 243.195) (to-luma cc))
+
+(expect cv4 (to-color :beige))
+(expect cv4 (to-color cv3))
+(expect cv4 (to-color cc))
+
+(expect cc (to-awt-color :beige))
+(expect cc (to-awt-color cv3))
+(expect cc (to-awt-color cv4))
+
+;; alpha
+(expect (v/vec4 245 245 220 100) (set-alpha cv4 100))
+(expect (v/vec4 245 245 220 100) (to-color (set-awt-alpha cc 100)))
+
+;; make-color
+(expect cc (make-awt-color cv3 255))
+(expect cc (make-awt-color 245 245 220))
+(expect cc (make-awt-color 245 245 220 255))
+(expect cv4 (make-color cv3 255))
+(expect cv4 (make-color 245 245 220))
+(expect cv4 (make-color 245 245 220 255))
+
+;; hue
+(expect (double (m/round (/ (* 255 60) 360))) (get-hue (make-color :beige)))
+
+;; double array
+(let [r (r/irand 256)]
+  (expect (/ r 255.0) (get-r255 r)))
+
+;; test blends
+(def c50 (get-r255 50))
+(def c100 (get-r255 100))
+(def c200 (get-r255 200))
+
+(expect c100 (blend-none c100 1))
+(expect c200 (blend-none c200 0))
+(expect 0.0 (blend-none 0 1))
+(expect 1.0 (blend-none 1 0))
+
+(expect 1.0 (blend-add c100 c200))
+(expect (get-r255 150) (blend-add c50 c100))
+(expect 1.0 (blend-add 0 1))
+(expect 1.0 (blend-add 1 0))
+
+(expect (m/frac (+ c100 c200)) (blend-madd c100 c200))
+(expect (get-r255 150) (blend-madd c50 c100))
+(expect 0.0 (blend-madd 0 1))
+(expect 0.0 (blend-madd 1 0))
+
+(expect 0.0 (blend-subtract c100 c200))
+(expect c50 (blend-subtract c100 c50))
+(expect 0.0 (blend-subtract 0 1))
+(expect 1.0 (blend-subtract 1 0))
+
+(expect (m/frac (- c100 c200)) (blend-msubtract c100 c200))
+(expect c50 (blend-msubtract c100 c50))
+(expect 0.0 (blend-msubtract 0 1))
+(expect 0.0 (blend-msubtract 1 0))
+
+;; test color converters
+
+;; test iq palette generator
+
+;; test paletton generator
+
+;; test nearest color distance


Add optimiser test namespace

Add optimiser test namespace

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

--- test/cortex/optimise_test.clj
+++ test/cortex/optimise_test.clj
@@ -0,0 +1,5 @@
+(ns cortex.optimise-test
+  (:use [clojure.test])
+  (:use [cortex core optimise])
+  (:require [clojure.core.matrix :as m]))
+


refactor fetch-pred

refactor fetch-pred

--- sidecar/src/figwheel_sidecar/config_check/type_check.clj
+++ sidecar/src/figwheel_sidecar/config_check/type_check.clj
@@ -158,9 +158,11 @@
      (group-by (fn [x] [:parent (second x) (first (nth x 2))]) (filter #(#{:?- :-} (second %)) spc))
      (group-by (juxt second first) spc))))

+
+
 (defn fetch-pred [pred-type parent-type]
-  (if-let [res (not-empty (map last (schema-rules [pred-type parent-type])))]
-    [pred-type (first res) parent-type] ))
+  (first (not-empty (schema-rules [pred-type parent-type])))
+)

 (defn leaf-pred? [parent-type]
   (or (fetch-pred :=  parent-type)
@@ -202,35 +204,40 @@
                          (spec 'AnotherInt string?)
                          (spec 'AnotherInt (ref-schema 'Integer))
                          (spec 'AndAnotherInt (ref-schema 'AnotherInt)))
-  (doall (all-predicates 'AndAnotherInt))
+    (doall (all-predicates 'AndAnotherInt))
+    #_(doall (predicate-rules-for-type 'AndAnotherInt))
   #_(leaf-pred? 'AnotherInt)
   #_(all-types 'AndAnotherInt)
   #_(all-types 'AndAnotherInt)
   #_(to-leaf-types 'AAnotherInt)
   #_(to-leaf-types 'AnotherInt)
   )
-
-(defmulti apply-pred (fn [f v] (first f)))
-(defmethod apply-pred :== [[_ pred] value] (= value pred))
-(defmethod apply-pred := [[_ pred] value] (pred value))
-(defmethod apply-pred :=> [[_ pred] value] (= (cond
-                                                (map? value) :MAPP
-                                                (sequence-like? value) :SEQQ
-                                                :else :_____BAD)
-                                              pred))
+(ns-unmap *ns* 'apply-pred)
+(defmulti apply-pred (fn [f v] (second f)))
+(defmethod apply-pred :== [[t _ pred] value] (= value pred))
+(defmethod apply-pred :=  [[t _ pred] value] (pred value))
+(defmethod apply-pred :=> [[t _ pred] value] (= (cond
+                                                  (map? value) :MAPP
+                                                  (sequence-like? value) :SEQQ
+                                                  :else :_____BAD)
+                                                pred))

 (defn type-check-pred [pred value state]
-  (if-not (apply-pred pred value)
-    (let [error {:Error-type :failed-predicate
-                 :not (second pred)
-                 :value value
-                 :type-sig (:type-sig state)
-                 :path     (:path state)}]
-      [(if (not= (-> state :type-sig first)
-                 (last pred))
-         (assoc error :sub-type (last pred)) error)])
-    {:success-type (last pred)}))
-
+  (let [[typ _ pred-op] pred]
+    (if-not (apply-pred pred value)
+      (let [error {:Error-type :failed-predicate
+                   :not pred-op
+                   :value value
+                   :type-sig (:type-sig state)
+                   :path     (:path state)}]
+        [(if (not= (-> state :type-sig first)
+                   typ)
+           (assoc error :sub-type typ) error)])
+      {:success-type typ})))
+
+;; TODO this allows a OR reloationship??
+;; lets formalize this as an and relationship
+;; the or-spec handles the OR relationship
 (defn type-check-value [parent-type value state]
   (if-let [preds (all-predicates parent-type)]
     (let [errors   (map #(type-check-pred % value state) preds)
@@ -241,7 +248,7 @@
     (throw (Exception. (str "parent-type " parent-type "has no predicate.")))))

 (defn compound-type? [parent-type]
-  (#{:SEQQ :MAPP} (second (fetch-pred :=> parent-type))))
+  (#{:SEQQ :MAPP} (last (fetch-pred :=> parent-type))))

 (defn get-types-from-key-parent [parent-type ky]
   (map (comp last last)
@@ -402,6 +409,7 @@
       (empty? errors) complex
       (empty? filtered-errors) (/ complex 2.0)
       :else false)))
+

 (defn ancester-key-rules
   "Returns all the key terminal ancester rules for a given type."
@@ -851,10 +859,10 @@
 }}))
   )

-
-
 ;; spiking on yet another way of analyzing a configuration for errors

+;; TODO ignores descendent relationships, only works for the immediate
+;; type
 (defn predicate-rules-for-type [parent-type]
   (let [f (if parent-type #(vector % parent-type) identity)]
     (apply concat (mapv schema-rules (map f [:= :== :=>])))))
@@ -867,12 +875,6 @@
       [typ simple-exp])))
   ([simple-exp]
    (pred-type-help simple-exp nil)))
-
-
-
-
-
-

 #_(with-schema
   (index-spec


color the misplaced value on its new path

--- sidecar/src/figwheel_sidecar/config_check/type_check.clj
+++ sidecar/src/figwheel_sidecar/config_check/type_check.clj
@@ -1139,9 +1139,10 @@
    :break
    [:nest 2
     (print-path correct-path
-                (if (empty? correct-path)
-                  (summarize-value-unwrap-top value)
-                  (summarize-value value)))]
+                (color (if (empty? correct-path)
+                         (summarize-value-unwrap-top value)
+                         (summarize-value value))
+                       :bold))]
    :break
    (print-document document)])


Spec out incise.utils/remove-prefix-from-path.

error: pathspec 'spec/incise/utils_spec.clj' did not match any file(s) known to git

--- spec/incise/utils_spec.clj
+++ spec/incise/utils_spec.clj
@@ -0,0 +1,13 @@
+(ns incise.utils-spec
+  (:require [incise.utils :refer :all]
+            [stefon.util :refer [temp-dir]]
+            [clojure.java.io :refer [file]]
+            [speclj.core :refer :all]))
+
+(describe "remove-prefix-from-path"
+  (with dir (file "/hey/there/"))
+  (with afile (file "/hey/there/pants/party"))
+  (it "returns a relative path from the given directory"
+    (should= "pants/party" (remove-prefix-from-path @dir @afile))))
+
+(run-specs)


Add leiningen profiles.clj

Add leiningen profiles.clj

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

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -0,0 +1,16 @@
+{:user
+  {:plugins [
+    [lein-pprint "1.1.1"]
+    [lein-assoc "0.1.0"]
+    [jonase/eastwood "0.0.2"]
+    [lein-expectations "0.0.7"]
+    [lein-autoexpect "0.2.5"]
+    [lein-ancient "0.4.2"]]
+;  :dependencies [[clj-stacktrace "0.2.5"]]
+;  :injections [(let [orig (ns-resolve (doto 'clojure.stacktrace require)
+;                                       'print-cause-trace)
+;                      new (ns-resolve (doto 'clj-stacktrace.repl require)
+;                                      'pst)]
+;                 (alter-var-root orig (constantly @new)))]
+   }
+ }


add doc-strings

add doc-strings

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/'


"repack" helper

"repack" helper

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/'


monday

monday

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

--- src/maths/bronkerbosch.clj
+++ src/maths/bronkerbosch.clj
@@ -0,0 +1,58 @@
+(ns maths.bronkerbosh
+  (:require [clojure.set :as s]))
+
+(defn empty-graph [n]
+ (vec (repeat n #{})))
+
+(defn add-directed-edge [g n1 n2]
+ (let [n1-neighbors (g n1)]
+   (assoc g n1 (conj n1-neighbors n2))))
+
+(defn add-edge [g [n1 n2]]
+ (-> g
+     (add-directed-edge n1 n2)
+     (add-directed-edge n2 n1)))
+
+;The random generation is easy:
+(defn random-edge [n]
+  (vector (rand-int n) (rand-int n)))
+
+;(add-edge (empty-graph 5) (random-edge 5))
+;;=> [#{} #{} #{4} #{} #{2}]
+
+(defn add-rand-edge [g]
+    (add-edge g (random-edge (count g))))
+; A lazy sequence of an
+; evolving random graph:
+(take 5 (iterate add-rand-edge (empty-graph 5)))
+;([#{} #{} #{} #{} #{}   [#{} #{} #{} #{4} #{3}]
+; [#{0} #{} #{} #{4} #{3}]  [#{0} #{} #{4} #{4} #{2 3}]
+; [#{0} #{} #{4} #{4} #{2 3}])
+
+(defn random-graph-a [n e]
+     (last (take e (iterate add-rand-edge (empty-graph n)))))
+
+(random-graph-a 10 15)
+
+
+(defn BK4 [r p x graph]
+  (if (and (empty? p) (empty? x))
+    [r] ;; r is already a set
+    (loop [p p, x x, cliques []]
+      (if (empty? p)
+        cliques
+        (let [v (first p) ;; p is a set, first is not necessary the next in sequence
+              nv (graph v) ;; take v-th set from graph
+              cliques (concat cliques
+                            (BK4 (conj r v) ;; add v to the set r
+                                 (s/intersection p nv)
+                                 (s/intersection x nv)
+                                 graph))]
+          (recur (disj p v) (conj x v) cliques))))))
+
+(defn get-BK4 [graph]
+  (BK4 #{} (set (range (count graph))) #{} graph))
+
+(let [graph (doall (random-graph-a 1000 1000))
+      bk4 (time (get-BK4 graph))]
+  bk4)


Fixed a potential timing issue in a test case

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/dillius/peak-tolerable-stupidity.git/'


Separate status-not-ineligible? from user-not-ineligible?

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/'


Card list

Card list

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

--- src/clj/funstructor/cards.clj
+++ src/clj/funstructor/cards.clj
@@ -0,0 +1,85 @@
+(ns funstructor.cards)
+
+;; List of cards
+
+(def cards
+  {
+
+   :terminal-left-paren
+   {:name "LEFT PAREN"
+    :description
+    "Fill the gap with left parenthesis"
+    :value :left-paren
+    :target :self
+    :type :terminal}
+
+   :terminal-right-paren
+   {:name "RIGHT PAREN"
+    :description
+    "Fill the gap with right parenthesis"
+    :value :right-paren
+    :target :self
+    :type :terminal}
+
+   :terminal-left-square
+   {:name "LEFT SQUARE"
+    :description
+    "Fill the gap with left square bracket"
+    :value :left-square
+    :target :self
+    :type :terminal}
+
+   :terminal-right-square
+   {:name "RIGHT SQUARE"
+    :description
+    "Fill the gap with right square bracket"
+    :value :right-square
+    :target :self
+    :type :terminal}
+
+   :terminal-id
+   {:name "ID"
+    :description
+    "Fill the gap with identifier, enter the name"
+    :value :id
+    :target :self
+    :type :terminal}
+
+   :terminal-num
+   {:name "NUM"
+    :description
+    "Fill the gap with number, enter the number"
+    :value :num
+    :target :self
+    :type :terminal}
+
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   ;; Mutators
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+   :mutator-left-gap
+   {:name "Left Gap"
+    :description
+    "Add gap to the leftmost position"
+    :target :self
+    :type :mutator}
+
+   :mutator-right-gap
+   {:name "Right Gap"
+    :description
+    "Add gap to the rightmost position"
+    :target :self
+    :type :mutator}
+
+   :mutator-position-gap
+   {:name "Position Gap"
+    :description
+    "Add gap to the specific position, select position"
+    :target :self
+    :type :mutator}
+
+
+   })
+
+(defn next-card []
+  (rand-nth (keys cards)))


adding pubsub and 10k code

adding pubsub and 10k code

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

--- examples/src/examples/pubsub.clj
+++ examples/src/examples/pubsub.clj
@@ -0,0 +1,25 @@
+(ns examples.pubsub
+  (:require
+    [clojure.core.async :refer (<!! >!! chan pub sub go <! >! close!)])
+ )
+
+(def to-pub (chan 1))
+(def p (pub to-pub :type))
+
+(let [c (chan 1)]
+  (sub p :error c)
+  (go
+    (while true
+      (when-let [e (<! c)]
+       (println "got an error" e)))))
+
+(let [c (chan 1)]
+  (sub p :warn c)
+  (go
+    (while true
+      (when-let [w (<! c)]
+       (println "got a warning" w)))))
+
+(>!! to-pub {:type :error :msg "bad thing"})
+
+(close! to-pub)


parse and import alternate-hostnames from the partner csv


def core-plan maps

def core-plan maps


Add loading indicator toggle on update and step advance

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/'


All members of a quadtree should fall within bounds.

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/'


Plugin hooks are activated when they live in the right src/ path.

<sheepish>

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

--- src/lein_voom/plugin.clj
+++ src/lein_voom/plugin.clj
@@ -0,0 +1,23 @@
+(ns lein-voom.plugin
+  (:require [leiningen.core.classpath :as lcp]
+            [robert.hooke :as hooke]))
+
+(set! *warn-on-reflection* true)
+
+;; == Hooke hooks ==
+
+(defn checkout-deps-paths
+  "Checkout dependencies are used to place source for a dependency
+  project directly on the classpath rather than having to install the
+  dependency and restart the dependent project."
+  [project & args]
+  (prn "Calling hook" args)
+  [])
+
+
+(defn hooks []
+  (prn "Activating voom hook")
+  (hooke/add-hook #'lcp/checkout-deps-paths
+                  #'checkout-deps-paths))
+
+(prn "loading hooks namespace")


Self-contained file with the ability to play a couple of chords.

error: pathspec 'src/overtunes/songs/at_all.clj' did not match any file(s) known to git

--- src/overtunes/songs/at_all.clj
+++ src/overtunes/songs/at_all.clj
@@ -0,0 +1,34 @@
+(ns overtunes.songs.at-all
+  (:use
+    [overtone.live :exclude [scale octave sharp flat sixth unison play]]
+    [overtone.inst.sampled-piano :only [sampled-piano]]))
+
+(def scale 66)
+(defn ground [note] (+ scale note))
+
+(def note# (comp sampled-piano ground))
+(defn chord# [chord] (doseq [note (vals chord)] (note# note)))
+
+(def ionian {:i 0, :ii 2, :iii 4, :iv 5, :v 7, :vi 9, :vii 11, :viii 12})
+(def i (select-keys ionian [:i :iii :v]))
+(def ii (select-keys ionian [:ii :iv :vi]))
+
+(chord# ii)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


Added low-level CRC-32 implementation.

Added low-level CRC-32 implementation.

error: pathspec 'src/pandect/checksum/crc32.clj' did not match any file(s) known to git

--- src/pandect/checksum/crc32.clj
+++ src/pandect/checksum/crc32.clj
@@ -0,0 +1,49 @@
+(ns ^ {:doc "CRC32 Implementation"
+       :author "Yannick Scherer"}
+  pandect.checksum.crc32)
+
+(set! *unchecked-math* true)
+
+;; ## Reference Implementation
+;;
+;; Based on the Reference Implementation given here:
+;; http://www.w3.org/TR/PNG-CRCAppendix.html
+
+;; ## Implementation
+
+(def ^:private ^"[J" CRC_TABLE
+  "CRCs for all 8-bit messages."
+  (let [C (long 0xEDB88320)]
+    (->>
+      (for [n (range 256)]
+        (reduce
+          (fn [c k]
+            (if (not= (bit-and c 1) 0)
+              (bit-xor C (bit-shift-right c 1))
+              (bit-shift-right c 1)))
+          n (range 8)))
+      (long-array))))
+
+(defn crc-update
+  "Update a CRC-32 checksum with the contents of the given Buffer."
+  (^long [^long crc ^"[B" buffer]
+   (crc-update crc buffer (count buffer)))
+  (^long [^long crc ^"[B" buffer ^long length]
+   (loop [n 0
+          c crc]
+     (if (< n length)
+       (recur
+         (inc n)
+         (bit-xor
+           (bit-shift-right c 8)
+           (aget CRC_TABLE
+                 (bit-and 0xFF (bit-xor c (aget buffer n))))))
+       c))))
+
+(defn crc32
+  "Create the CRC-32 checksum of the given Buffer."
+  ([^"[B" buffer] (crc32 buffer (count buffer)))
+  ([^"[B" buffer ^long length]
+  (bit-xor
+    (long 0xFFFFFFFF)
+    (crc-update (long 0xFFFFFFFF) buffer length))))


added tests for article sql datastore

added tests for article sql datastore

error: pathspec 'test/blog/article/article_sql_datastore_impl_test.clj' did not match any file(s) known to git

--- test/blog/article/article_sql_datastore_impl_test.clj
+++ test/blog/article/article_sql_datastore_impl_test.clj
@@ -0,0 +1,126 @@
+(ns blog.article.article-sql-datastore-impl-test
+  (:require [clojure.test :refer :all]
+            [blog.article.article-sql-datastore-impl :refer :all]
+            [clojure.java.jdbc :as jdbc]))
+
+
+(deftest sql-datastore
+  (let [db-spec {:subprotocol "hsqldb"
+                 :subname (str "mem:testdb"
+                               ";shutdown=true"
+                               ";sql.syntax_pgs=true")
+                 :user "SA"
+                 :password ""}]
+    (jdbc/with-db-connection [con db-spec]
+      (let [com {:db con
+                 :articles-per-page 5
+                 :recent-articles 10}]
+
+        (testing "create-article-table"
+          (is (= (create-article-table com)
+                 :ok)))
+
+        (testing "add-article"
+          (is (= (add-article com {:name "2014-06-02-title"
+                                   :date (.getTime (java.util.GregorianCalendar. 2014 (dec 6) 2))
+                                   :body "body"})
+                 :ok)))
+
+        (testing "article-page"
+          (is (= (article-page com 0)
+                 {:current-page 0,
+                  :items [{:body "body",
+                           :code "2014-06-02-title",
+                           :title "Title",
+                           :month-name "June",
+                           :day "02",
+                           :month "06",
+                           :year "2014"}]})))
+
+        (testing "article-month-page"
+          (is (= (article-month-page com "2014-06" 0)
+                 {:current-page 0,
+                  :items [{:body "body",
+                           :code "2014-06-02-title",
+                           :title "Title",
+                           :month-name "June",
+                           :day "02",
+                           :month "06",
+                           :year "2014"}]})))
+
+        (testing "article"
+          (is (= (article com "2014-06-02-title")
+                 {:current-page 0
+                  :items [{:body "body",
+                           :code "2014-06-02-title",
+                           :title "Title",
+                           :month-name "June",
+                           :day "02",
+                           :month "06",
+                           :year "2014"}]})))
+
+        (testing "article-impl"
+          (is (= (article-impl com "2014-06-02-title")
+                 {:archive-months [{:code "2014-06",
+                                    :title "",
+                                    :month-name "June",
+                                    :month "06",
+                                    :year "2014"}],
+                  :recent-articles [{:code "2014-06-02-title",
+                                     :title "Title",
+                                     :month-name "June",
+                                     :day "02",
+                                     :month "06",
+                                     :year "2014"}],
+                  :items [{:body "body",
+                           :code "2014-06-02-title",
+                           :title "Title",
+                           :month-name "June",
+                           :day "02",
+                           :month "06",
+                           :year "2014"}],
+                  :current-page 0})))
+
+          (testing "article-page-impl"
+            (is (= (article-page-impl com 0)
+                   {:archive-months [{:code "2014-06",
+                                      :title "",
+                                      :month-name "June",
+                                      :month "06",
+                                      :year "2014"}],
+                    :recent-articles [{:code "2014-06-02-title",
+                                       :title "Title",
+                                       :month-name "June",
+                                       :day "02",
+                                       :month "06",
+                                       :year "2014"}],
+                    :current-page 0,
+                    :items [{:body "body",
+                             :code "2014-06-02-title",
+                             :title "Title",
+                             :month-name "June",
+                             :day "02",
+                             :month "06",
+                             :year "2014"}]})))
+
+          (testing "article-month-page-impl"
+            (is (= (article-month-page-impl com "2014-06" 0)
+                   {:archive-months [{:code "2014-06",
+                                      :title "",
+                                      :month-name "June",
+                                      :month "06",
+                                      :year "2014"}],
+                    :recent-articles [{:code "2014-06-02-title",
+                                       :title "Title",
+                                       :month-name "June",
+                                       :day "02",
+                                       :month "06",
+                                       :year "2014"}],
+                    :current-page 0,
+                    :items [{:body "body",
+                             :code "2014-06-02-title",
+                             :title "Title",
+                             :month-name "June",
+                             :day "02",
+                             :month "06",
+                             :year "2014"}]})))))))


Add builtin spec tests.

Add builtin spec tests.

error: pathspec 'spec/cats/builtin_spec.cljx' did not match any file(s) known to git

--- spec/cats/builtin_spec.cljx
+++ spec/cats/builtin_spec.cljx
@@ -0,0 +1,86 @@
+(ns cats.builtin-spec
+  #+cljs
+  (:require [speclj.core :as s :include-macros true]
+            [cats.builtin :as b]
+            [cats.protocols :as p]
+            [cats.monad.maybe :as maybe]
+            [cats.core :as m :include-macros true])
+  #+clj
+  (:require [speclj.core :as s]
+            [cats.builtin :as b]
+            [cats.protocols :as p]
+            [cats.monad.maybe :as maybe]
+            [cats.core :as m]))
+
+(s/describe "test-nil-as-maybe"
+  (s/it "Nil works like nothing (for avoid unnecesary null pointers)."
+    (s/should= (m/>>= nil (fn [_] (m/return 1))) nil)
+    (s/should= (m/fmap inc nil) nil)
+    (s/should (maybe/nothing? nil))
+    (s/should (maybe/maybe? nil)))
+
+  (s/it "get-value function"
+    (s/should= (p/get-value nil) nil)))
+
+(s/describe "vector-monad"
+  (s/it "The first monad law: left identity"
+    (s/should= [1 2 3 4 5]
+               (m/>>= [0 1 2 3 4]
+                      (fn [x] [(inc x)]))))
+
+  (s/it "The second law: right identity"
+    (s/should= [1 2 3]
+               (m/>>= [1 2 3]
+                      m/return)))
+
+  (s/it "The third law: associativity"
+    (s/should= (m/>>= (m/mlet [x [1 2 3 4 5]
+                               y [(inc x)]]
+                        (m/return y))
+                      (fn [z] [(inc z)]))
+               (m/>>= [1 2 3 4 5]
+                      (fn [x] (m/>>= [(inc x)]
+                                     (fn [y] [(inc y)])))))))
+
+(s/describe "sequence-monad"
+  (let [val->lazyseq (fn [x] (lazy-seq [x]))
+        s (val->lazyseq 2)]
+
+    (s/it "The first monad law: left identity"
+      (s/should= s (m/with-monad b/sequence-monad
+                     (m/>>= (m/return 2)
+                            val->lazyseq))))
+
+    (s/it "The second monad law: right identity"
+      (s/should= s (m/>>= s m/return)))
+
+    (s/it "The third monad law: associativity"
+      (s/should= (m/>>= (m/mlet [x s
+                                 y  (val->lazyseq (inc x))]
+                          (m/return y))
+                        (fn [y] (val->lazyseq (inc y))))
+                 (m/>>= s
+                        (fn [x]
+                          (m/>>= (val->lazyseq (inc x))
+                                 (fn [y] (val->lazyseq (inc y))))))))))
+
+
+(s/describe "set-monad"
+  (s/it "The first monad law: left identity"
+    (s/should= #{2} (m/with-monad b/set-monad
+                      (m/>>= (m/return 2)
+                             (fn [x] #{x})))))
+
+  (s/it "The second monad law: right identity"
+    (s/should= #{2} (m/>>= #{2} m/return)))
+
+  (s/it "The third monad law: associativity"
+    (s/should= (m/>>= (m/mlet [x #{2}
+                               y #{(inc x)}]
+                        (m/return y))
+                      (fn [y] #{(inc y)}))
+               (m/>>= #{2}
+                      (fn [x]
+                        (m/>>= #{(inc x)}
+                               (fn [y] #{(inc y)})))))))
+