Add inverse binary threshold filter.

Add inverse binary threshold filter.

error: pathspec 'src/videotest/blob/find_centroids_gauss.clj' did not match any file(s) known to git

--- src/videotest/blob/find_centroids_gauss.clj
+++ src/videotest/blob/find_centroids_gauss.clj
@@ -0,0 +1,124 @@
+(ns videotest.blob.find-centroids-cvgray
+  (:require
+   [quil.core :as q]
+   [quil.middleware :as m]
+   [videotest.blob.cv :as cv])
+  (:import
+   [org.opencv.core CvType Mat]
+   [org.opencv.imgproc Imgproc]
+   [java.nio ByteBuffer ByteOrder]
+   [blobscanner Detector]))
+
+;; Based on Blobscanner example sketch by Antonio Molinaro:
+;; https://github.com/robdanet/blobscanner/blob/master/examples/blob_centroid/findCentroids/findCentroids.pde
+;;
+;;
+
+(def CAM-SIZE (cv/camera-frame-size))
+(def WIDTH  (int (:width  CAM-SIZE)))
+(def HEIGHT (int (:height CAM-SIZE)))
+
+;; pixCnt1 is the number of bytes in the pixel buffer
+;; pixCnt2 is the number of integers in the PImage pixels buffer
+(def PIX-CNT1 (* WIDTH HEIGHT 4))
+(def PIX-CNT2 (* WIDTH HEIGHT))
+
+(def BW-THRESH 50) ; between 0-255 (gray -> BW cut-off)
+(def this (atom nil))
+
+;; bArray is the temporary byte array buffer for OpenCV cv::Mat.
+;; iArray is the temporary integer array buffer for PImage pixels.
+(defn setup []
+  (q/frame-rate 60)
+  {:b-array (byte-array PIX-CNT1)
+   :i-array (int-array PIX-CNT2)
+   :frame-mat (Mat. WIDTH HEIGHT CvType/CV_8UC3)
+   :output-mat (Mat. WIDTH HEIGHT CvType/CV_8UC4)
+   :gray-mat (Mat.)
+   :bw-mat (Mat.)
+   :camera (cv/camera 0)
+   :p-image (q/create-image WIDTH HEIGHT :rgb)
+   :detector (do
+               ; Applet must exist before Detector can be created
+               (Thread/sleep 1000)
+               (Detector. @this 255))})
+
+(defn gray-mat->bw-mat [gray-mat bw-mat]
+  (Imgproc/threshold gray-mat bw-mat BW-THRESH 255 Imgproc/THRESH_BINARY)
+  bw-mat)
+
+(defn gray-mat->inv-bw-mat [gray-mat bw-mat]
+  (Imgproc/threshold gray-mat bw-mat BW-THRESH 255 Imgproc/THRESH_BINARY_INV)
+  bw-mat)
+
+(defn update-gray-mat
+  [{:keys [frame-mat gray-mat bw-mat] :as state}]
+  (if frame-mat
+    (let [gray-mat (cv/BGR->GrayMat! frame-mat gray-mat)]
+      #_(assoc-in state [:gray-mat] (gray-mat->bw-mat gray-mat bw-mat))
+      (assoc-in state [:gray-mat] (gray-mat->inv-bw-mat gray-mat bw-mat)))
+    state))
+
+(defn update-gray-p-image
+  [{:keys [frame-mat gray-mat output-mat b-array i-array] :as state}]
+  (if frame-mat
+    (update-in state [:p-image] #(cv/gray-mat->p-img gray-mat output-mat b-array i-array %))
+    state))
+
+(defn update-blobs [{:keys [detector p-image] :as state}]
+  (when p-image
+    (.imageFindBlobs detector p-image)
+    (.loadBlobsFeatures detector)
+    (.findCentroids detector))
+  state)
+
+(defn update [state]
+  (-> state
+      (cv/update-frame)
+      (update-gray-mat)
+      (update-gray-p-image)
+      (update-blobs)))
+
+(defn draw-centroid [detector n]
+  (q/ellipse (.getCentroidX detector n)
+             (.getCentroidY detector n)
+             40 40))
+
+(defn draw-centroids [{:keys [detector]}]
+  (when (and detector
+             (< 0 (.getBlobsNumber detector)))
+    (q/push-style)
+    (q/no-stroke)
+    (q/fill 0 255 0 80)
+    (dorun
+     (map #(draw-centroid detector %)
+          (range 0 (.getBlobsNumber detector))))
+    (q/pop-style)))
+
+(defn draw [state]
+  (let [{:keys [p-image]} state]
+    (q/background 0)
+    (q/push-matrix)
+    (q/translate WIDTH 0)
+    (q/scale -1 1)
+    (when p-image
+      (q/image p-image 0 0)
+      (draw-centroids state))
+    (q/pop-matrix)))
+
+(defn on-close
+  ([{:keys [camera]}]
+     (println "closing sketch and releasing camera...")
+     (when-not (nil? camera)
+       (.release camera))))
+
+(q/defsketch videotest
+  :title "Video Test"
+  :size [WIDTH HEIGHT]
+  :setup setup
+  :update update
+  :draw draw
+  :on-close on-close
+  :middleware [m/fun-mode])
+
+(reset! this videotest)


this gets called for each user, it's messing with stats

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


Added frequencies

Added frequencies

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


Add vault.index.core ns with imported vars.

error: pathspec 'src/vault/index/core.clj' did not match any file(s) known to git

--- src/vault/index/core.clj
+++ src/vault/index/core.clj
@@ -0,0 +1,12 @@
+(ns vault.index.core
+  (:require
+    [potemkin :refer [import-vars]]
+    (vault.index
+      [engine :as engine])))
+
+
+(import-vars
+  (vault.index.engine
+    init!
+    update!
+    search))


new test where cider wants it

new test where cider wants it

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

--- test/kmp_search/test/core.clj
+++ test/kmp_search/test/core.clj
@@ -0,0 +1,39 @@
+(ns kmp-search.test.core
+  (:require [clojure.test :refer :all]
+            [kmp-search.core :refer :all]))
+
+(defn index-of-reducer
+  [[_ matcher] bytes]
+  (let [[index matcher] (search-bytes matcher bytes)]
+    (if index
+      (reduced [index matcher])
+      [index matcher])))
+
+(defn the-bytes [x]
+  (.getBytes x))
+
+(defn test-index [m x]
+  (let [[index _] (if (string? x)
+                    (search-bytes m (the-bytes x))
+                    (reduce index-of-reducer [0 m] (map the-bytes x)))]
+    index))
+
+(deftest a-test
+  (testing "failure generation"
+    (are [x y] (= (seq (:failure (matcher (.getBytes x)))) y )
+         "abcdabd" [0 0 0 0 1 2 0]
+         "participate in parachute"
+         [0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 1 2 3 0 0 0 0 0 0]
+         "ululation"
+         [0 0 1 2 0 0 0 0 0]
+         "rangerangles"
+         [0 0 0 0 0 1 2 3 4 0 0 0]))
+  (testing "matches"
+    (let [m (matcher (the-bytes "abc"))]
+      (are [x y] (= (test-index m x) y)
+           "" nil
+           "rogue" nil
+           "abc" 0
+           "1abc" 1
+           "ababc" 2
+           ["a" ""  "b" "a" "b" "c"] 2))))


Add settings module.

Add settings module.

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

--- src/clj/pfrt/settings.clj
+++ src/clj/pfrt/settings.clj
@@ -0,0 +1,5 @@
+(ns pfrt.settings
+  (:require [nomad :refer [defconfig]]
+            [clojure.java.io :as io]))
+
+(defconfig cfg (io/resource "config.edn"))


fixed up the propagation of a reading error

--- sidecar/src/figwheel_sidecar/config.clj
+++ sidecar/src/figwheel_sidecar/config.clj
@@ -807,13 +807,14 @@
                          (utils/slow-output
                           (print-validate-config-data config-data)))
                   (do
-                    (println "Figwheel: Configuration Valid :)")
+                    (println (color-text "Figwheel: Configuration Valid :)" :green))
                     config-data)
                   (do
                     (when (:read-exception config-data)
-                      (println "Could not read your configuraton file - "
-                               (:file config-data))
-                      (println (.getMessage (:read-exception config-data))))
+                      (println (color-text "------------------ File Read Error ----------------" :cyan))
+                      (println (str "Could not read your configuraton file - " (:file config-data)))
+                      (println "--> " (color-text (.getMessage (:read-exception config-data)) :yellow ))
+                      (println (color-text "---------------------------------------------------" :cyan)))
                     (println (color-text (str "Figwheel: There are errors in your configuration file - " (str file)) :red))
                     (let [choice (or (and (:once opts) "q")
                                      (and fix "f")


add ui/button component

add ui/button 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/starcity-properties/odin.git/'


Update NR agent to 4.0.1

Update NR agent to 4.0.1

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


Bump dep versions :joy: :yum:

Bump dep versions :joy: :yum:

--- project.clj
+++ project.clj
@@ -30,10 +30,10 @@
                  [com.h2database/h2 "1.4.187"]                        ; embedded SQL database
                  [com.mattbertolini/liquibase-slf4j "1.2.1"]
                  [com.novemberain/monger "2.1.0"]                     ; MongoDB Driver
-                 [compojure "1.3.3"]                                  ; HTTP Routing library built on Ring
+                 [compojure "1.3.4"]                                  ; HTTP Routing library built on Ring
                  [environ "1.0.0"]                                    ; easy environment management
                  [hiccup "1.0.5"]                                     ; HTML templating
-                 [korma "0.4.0"]                                      ; SQL lib
+                 [korma "0.4.1"]                                      ; SQL lib
                  [log4j/log4j "1.2.17"
                   :exclusions [javax.mail/mail
                                javax.jms/jms


bump teller

bump teller


Version 33-SNAPSHOT

Version 33-SNAPSHOT

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


Version 91-SNAPSHOT

Version 91-SNAPSHOT

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


[WM] update deps to latest versions

[WM] update deps to latest versions

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


Upgraded clj-http

Upgraded clj-http

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


tools.namespace gehitu REPL barnean refresh egiteko

fatal: unable to access 'https://github.com/lnmnd/magnet.zer.git/': The requested URL returned error: 403


Version 60

Version 60


project.clj with awful indentation and very incomplete stuff

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

--- project.clj
+++ project.clj
@@ -0,0 +1,13 @@
+(defproject cyberantelopescript "0.0.1"
+  :plugins [[lein-cljsbuild "1.1.1"]]
+  :cljsbuild {
+              :builds [{
+                        :source-paths ["src-cljs"]
+                        :compiler {
+                                   :output-to "war/javascript/main.js"
+                                   :optimizations :whitespace
+                                   :pretty-print true
+                                   }
+                        }]
+              })
+


Fix version in project.clj

Fix version in project.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/audiogum/picomock.git/'


Add stub for hexadecimal exercise

Add stub for hexadecimal exercise

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

--- exercises/hexadecimal/src/hexadecimal.clj
+++ exercises/hexadecimal/src/hexadecimal.clj
@@ -0,0 +1,5 @@
+(ns hexadecimal)
+
+(defn hex-to-int [] ;; <- arglist goes here
+  ;; your code goes here
+  )


tweak sel logging

tweak sel logging

--- src/metabase/db.clj
+++ src/metabase/db.clj
@@ -392,9 +392,9 @@
                                                             (default-fields entity#)))]
        (when (and (config/config-bool :mb-db-logging)
                   (not *sel-disable-logging*))
-         (log/debug "DB CALL : " (:name entity#) " " (or (:fields entity-select-form#) "*")
-                    ~(apply str (for [[form & args] forms]
-                                  (apply str " " (name form) " " (interpose " " args))))))
+         (log/debug "DB CALL:" (:name entity#) (or (:fields entity-select-form#) "*")
+                    ~(apply str (interpose " " (for [[form & args] forms]
+                                                 (apply str (name form) " " (interpose " " args)))))))
        (-sel-after entity# (select entity-select-form# ~@forms)))))


Solve Area of a Circle in clojure

Solve Area of a Circle in clojure

error: pathspec 'solutions/uri/1002/1002.clj' did not match any file(s) known to git

--- solutions/uri/1002/1002.clj
+++ solutions/uri/1002/1002.clj
@@ -0,0 +1,7 @@
+(ns main)
+
+(defn main []
+  (let [n (Double/parseDouble (read-line))]
+   (format "%.4f" (* (* n n) 3.14159))))
+
+(printf "A=%s%n" (main))


tart writing gamepad convenience functions

error: pathspec 'src/cljs/infinitelives/utils/gamepad.cljs' did not match any file(s) known to git

--- src/cljs/infinitelives/utils/gamepad.cljs
+++ src/cljs/infinitelives/utils/gamepad.cljs
@@ -0,0 +1,53 @@
+(ns infinitelives.utils.gamepad
+  (:require [infinitelives.utils.events :as events]))
+
+(defn axis
+  ([gamepad gamepad-num axis-num]
+   (aget (.-axes gamepad) axis-num))
+  ([gamepad-num axis-num]
+   (axis (aget (events/get-gamepads) gamepad-num) gamepad-num axis-num))
+  ([axis-num]
+   (axis 0 axis-num)))
+
+(def stick->axis
+  {[:left :x] 0
+   [:left :y] 1
+   [:right :x] 2
+   [:right :y] 3})
+
+(defn stick
+  [gamepad-num [stick-name axis-name]]
+  (axis gamepad-num (stick->axis [stick-name axis-name])))
+
+(def ->buttons
+  {
+   :a 0 :A 0
+   :b 1 :B 1
+   :x 2 :X 2
+   :y 3 :Y 3
+   :left-bumper 4 :bumper-left 4 :lb 4 :bl 4
+   :right-bumper 5 :bumper-right 5 :rb 5 :br 5
+   :left-trigger 6 :trigger-left 6 :lt 6 :tl 6
+   :right-trigger 7 :trigger-right 7 :rt 7 :tr 7
+   :back 8
+   :start 9
+   :dpad-up 12 :up-dpad 12 :dup 12 :up 12
+   :dpad-down 13 :down-dpad 13 :ddown 13 :down 13
+   :dpad-left 14 :left-dpad 14 :dleft 14 :left 14
+   :dpad-right 15 :right-dpad 15 :dright 15 :right 15
+   :xbox 16
+   })
+
+(defn button
+  ([gamepad gamepad-num button-num]
+   (aget (.-buttons gamepad)
+         (get ->buttons button-num button-num)))
+  ([gamepad-num button-num]
+   (button (aget (events/get-gamepads) gamepad-num) gamepad-num button-num))
+  ([button-num]
+   (button 0 button-num)))
+
+(defn pressed? [val]
+  (> val 0.1))
+
+(def button-pressed? (comp pressed? button))


Implement a connection component

Implement a connection component

error: pathspec 'src/com/farmlogs/messaging/connection.clj' did not match any file(s) known to git

--- src/com/farmlogs/messaging/connection.clj
+++ src/com/farmlogs/messaging/connection.clj
@@ -0,0 +1,21 @@
+(ns com.farmlogs.messaging.connection
+  (:require [com.stuartsierra.component :as component]
+            [clojure.tools.logging :as log]
+            [langohr.core :as rmq]))
+
+(defrecord RMQConnection
+    [conn uri]
+  component/Lifecycle
+  (start [this]
+    (log/info "Starting RMQ")
+    (assoc this
+           :conn (rmq/connect {:uri uri :automatically-recover true})))
+
+  (stop [this]
+    (log/info "Stopping RMQ")
+    (rmq/close conn)
+    (log/info "Stopped RMQ")))
+
+(defn connection
+  [uri]
+  (->RMQConnection nil uri))


work scheduler

work scheduler

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


treat UUID as an :UnknownField so it doesn't get checked for URL-ness (etc)

--- src/metabase/driver/postgres.clj
+++ src/metabase/driver/postgres.clj
@@ -62,7 +62,7 @@
    :tsquery       :UnknownField
    :tsvector      :UnknownField
    :txid_snapshot :UnknownField
-   :uuid          :TextField
+   :uuid          :UnknownField
    :varbit        :UnknownField
    :varchar       :TextField
    :xml           :TextField


[WM] make fields optional in schema

[WM] make fields optional in schema

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


1st version of html-renderer module

1st version of html-renderer module

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


remove unneeded newline in loggin

remove unneeded newline in loggin

--- src/metabase/driver/query_processor.clj
+++ src/metabase/driver/query_processor.clj
@@ -393,7 +393,7 @@
                                                  (for [row results]
                                                    (m/map-keys uncastify-fn row)))
           _                              (when-not *disable-qp-logging*
-                                           (log/debug (u/format-color 'magenta "\nDriver QP returned results with keys: %s." (vec (keys (first results))))))
+                                           (log/debug (u/format-color 'magenta "Driver QP returned results with keys: %s." (vec (keys (first results))))))
           join-table-ids                 (set (map :table-id join-tables))
           fields                         (field/unflatten-nested-fields (sel :many :fields [Field :id :table_id :name :description :base_type :special_type :parent_id], :table_id source-table-id, :active true))
           ordered-col-kws                (order-cols query results fields)]


A maybe monad transformer wraps a maybe in the given monad, not the other way around

--- src/cljx/cats/monad/maybe.cljx
+++ src/cljx/cats/monad/maybe.cljx
@@ -160,48 +160,48 @@
 ;; Monad transformer definition
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defn maybe-trans [inner-m]
+(defn maybe-trans [outer-monad]
   (reify
     proto/Functor
     (fmap [_ f fv]
-      (proto/fmap inner-m
+      (proto/fmap outer-monad
                   #(proto/fmap maybe-monad f %)
                   fv))

     proto/Monad
     (mreturn [m v]
-      (proto/mreturn inner-m (just v)))
+      (proto/mreturn outer-monad (just v)))

     (mbind [_ mv f]
-      (proto/mbind inner-m
+      (proto/mbind outer-monad
                    mv
                    (fn [maybe-v]
                      (if (just? maybe-v)
                        (f (from-maybe maybe-v))
-                       (proto/mreturn inner-m (nothing))))))
+                       (proto/mreturn outer-monad (nothing))))))

     proto/MonadZero
     (mzero [_]
-      (proto/mreturn inner-m (nothing)))
+      (proto/mreturn outer-monad (nothing)))

     proto/MonadPlus
     (mplus [_ mv mv']
-      (proto/mbind inner-m
+      (proto/mbind outer-monad
                    mv
                    (fn [maybe-v]
                      (if (just? maybe-v)
-                       (proto/mreturn inner-m maybe-v)
+                       (proto/mreturn outer-monad maybe-v)
                        mv'))))

     proto/MonadTrans
     (inner [_]
-      inner-m)
+      maybe-monad)

     (outer [_]
-      maybe-monad)
+      outer-monad)

     (lift [_ mv]
-      (proto/mbind inner-m
+      (proto/mbind outer-monad
                    mv
                    (fn [v]
-                     (proto/mreturn inner-m (just v)))))))
+                     (proto/mreturn outer-monad (just v)))))))


Implement MonadState in the state monad

Implement MonadState in the state monad

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


binary search (clojure)

binary search (clojure)

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

--- src/main/clojure/bsearch/bsearch4.clj
+++ src/main/clojure/bsearch/bsearch4.clj
@@ -0,0 +1,43 @@
+(ns bsearch.bsearch4
+  (:use clojure.test))
+
+(defn bsearch
+  ([value list] (bsearch value list 0))
+  ([value list shift]
+    (if (empty? list) -1
+      (let [mid-index (quot (count list) 2)
+            mid-value (nth list mid-index)]
+      (cond
+        (= value mid-value) (+ mid-index shift)
+        (< value mid-value) (bsearch value (take mid-index list) shift)
+        (> value mid-value) (bsearch value (drop (+ 1 mid-index) list) (+ 1 mid-index shift)))
+  )))
+)
+
+(deftest aa
+  (is (= -1 (bsearch 1 [])))
+
+  (is (= -1 (bsearch 0 [1])))
+  (is (= 0  (bsearch 1 [1])))
+  (is (= -1 (bsearch 2 [1])))
+
+  (is (= -1 (bsearch 0 [1, 2])))
+  (is (= 0  (bsearch 1 [1, 2])))
+  (is (= 1  (bsearch 2 [1, 2])))
+  (is (= -1 (bsearch 3 [1, 2])))
+
+  (is (= -1 (bsearch 0 [1, 2, 3])))
+  (is (= 0  (bsearch 1 [1, 2, 3])))
+  (is (= 1  (bsearch 2 [1, 2, 3])))
+  (is (= 2  (bsearch 3 [1, 2, 3])))
+  (is (= -1 (bsearch 4 [1, 2, 3])))
+
+  (is (= -1 (bsearch 0 [1, 2, 3, 4])))
+  (is (= 0  (bsearch 1 [1, 2, 3, 4])))
+  (is (= 1  (bsearch 2 [1, 2, 3, 4])))
+  (is (= 2  (bsearch 3 [1, 2, 3, 4])))
+  (is (= 3  (bsearch 4 [1, 2, 3, 4])))
+  (is (= -1 (bsearch 5 [1, 2, 3, 4])))
+)
+
+(run-tests)


docs and TODO clarifications

docs and TODO clarifications

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


Stub for importer module

Stub for importer module

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

--- src/clj_mrazik/importer.clj
+++ src/clj_mrazik/importer.clj
@@ -0,0 +1,6 @@
+(ns clj-mrazik.importer)
+
+(defn import-data
+    [datafile]
+    (println datafile))
+


Remove debug println

Remove debug println

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


Fix test failure caused by error flash change.

--- test/clojars/test/unit/web/common.clj
+++ test/clojars/test/unit/web/common.clj
@@ -16,7 +16,7 @@
 (deftest error-list-populates-errors-correctly
   (is (= nil (common/error-list nil)))
   (is (=
-        [:div.error [:strong "Blistering barnacles!"] "  Something's not shipshape:" [:ul '([:li "error"])]]
+        [:div#flash.error [:strong "Blistering barnacles!"] "  Something's not shipshape:" [:ul '([:li "error"])]]
         (common/error-list ["error"]))))

 (deftest user-link-works


(string)

(string)

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


more of the test reorg

more of the test reorg

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


Formatting

Formatting

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


Add tests over oxcart.passes.defs-test/*

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

--- test/oxcart/passes/defs_test.clj
+++ test/oxcart/passes/defs_test.clj
@@ -0,0 +1,44 @@
+;;   Copyright (c) Reid McKenzie, Rich Hickey & contributors. The use
+;;   and distribution terms for this software are covered by the
+;;   Eclipse Public License 1.0
+;;   (http://opensource.org/licenses/eclipse-1.0.php) which can be
+;;   found in the file epl-v10.html at the root of this distribution.
+;;   By using this software in any fashion, you are agreeing to be
+;;   bound by the terms of this license.  You must not remove this
+;;   notice, or any other, from this software.
+
+(ns oxcart.passes.defs-test
+  (:require [oxcart]
+            [oxcart.passes.defs :refer :all]
+            [oxcart.test-util :refer :all]
+            [clojure.set :refer :all]
+            [clojure.test :refer :all]))
+
+
+(def victim-ast
+  (let [forms (atom {})]
+    (oxcart/eval
+     '(do (def ^:private foo 3)
+          (def ^:const quxx 4)
+          (def bar 5)
+          (def ^:dynamic blat 6)
+          (defn baz [z]
+            (mod (+ foo quxx bar z) z)))
+     {:forms forms})
+    @forms))
+
+
+(deftest locate-defs-test
+  (let [annotated-ast (locate-defs victim-ast {})
+
+        {:keys [symbols public private const dynamic]}
+                      (get annotated-ast 'oxcart.passes.defs-test)]
+
+    (doseq [sym ['foo 'quxx 'bar 'baz]]
+      (is (contains? symbols sym)
+          (str sym "not found in the defs!")))
+
+    (is (= #{'foo} private))
+    (is (= #{'bar 'baz 'quxx 'blat} public))
+    (is (= #{'quxx 'foo 'bar 'baz} const))
+    (is (= #{'blat} dynamic))))


Environment for repl

Environment for repl

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

--- dev/user.clj
+++ dev/user.clj
@@ -0,0 +1,58 @@
+(ns user
+  (:require [clojure.java.io :as io]
+            [clojure.string :as str]
+            [clojure.pprint :refer (pprint)]
+            [clojure.repl :refer :all]
+            [clojure.test :as test]
+            [clojure.tools.namespace.repl :refer (refresh refresh-all)]
+            [clojure.tools.logging :refer (trace debug info warn error)]
+            [liber.system :as system]
+            [liber.lifecycle :as lifecycle]))
+
+;; see http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
+
+(def system nil)
+
+(defn init
+  "Constructs the current development system."
+  []
+  (alter-var-root #'system
+                  (constantly (system/create-system 9090))))
+
+(defn start
+  "Starts the current development system."
+  []
+  (try
+    (alter-var-root #'system lifecycle/start)
+    (catch Exception e (error "Failed to start system" e)
+      (throw e))))
+
+(defn stop
+  "Shuts down and destroys the current development system."
+  []
+  (try
+    (alter-var-root #'system
+                    (fn [s] (when s (lifecycle/stop s))))
+    (catch Exception e (error "Failed to stop system" e)
+      (throw e))))
+
+
+(defn go
+  "Initializes the current development system and starts it running."
+  []
+  (init)
+  (start))
+
+(defn reset []
+  (stop)
+  (info "Resetting...")
+  (refresh :after 'user/go)
+  (info "Reset complete")
+  :reset-complete)
+
+(defn wipe-database
+  "Clears database."
+  []
+  (liber.database.migration/migrate-backward (:migrator system))
+  (liber.database.migration/migrate-forward (:migrator system)))
+


Add Cursive start script

Add Cursive start script

--- dev/user.clj
+++ dev/user.clj
@@ -0,0 +1,2 @@
+(require '[figwheel.main.api :as fig])
+(fig/start "dev")


Add pprint and macroexpand-all requires to user.clj

--- dev/user.clj
+++ dev/user.clj
@@ -1,5 +1,7 @@
 (ns user
   (:require [clojure.tools.namespace.repl :as repl]
+            [clojure.walk :refer [macroexpand-all]]
+            [clojure.pprint :refer [pprint]]
             [clojure.test :as test]))

 (defonce ^:dynamic


provide default fields value when copying fields

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


We added some 'lein test'-able tests including selected Paul tests.

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

--- test/themis/core_test.clj
+++ test/themis/core_test.clj
@@ -0,0 +1,30 @@
+(ns themis.core-test
+  (:require [themis.core :as core]
+            [themis.predicates :as preds]
+            [themis.validators :refer [from-predicate presence]]
+            [clojure.test :refer :all]))
+
+(deftest simple-tests
+  (let [alice {:name "Alice"}
+        alice-rules [[[:name]
+                      (fn [_payload value opts]
+                        (when (not= value "Alice")
+                          {:error ":name not Alice"}))]]]
+
+    (testing "Alice's name should be Alice."
+      (is (= (core/validation alice alice-rules) {[:name] nil})))
+    (testing "Bob's name should not be Alice."
+      (is (not= (core/validation {:name "Bob"} alice-rules) {[:name] nil})))))
+
+(deftest pauls-tests
+  "These are selected tests are ported from Paul DeGrandis' comment tests."
+  (let [paul {:name {:first "Paul", :last "deGrandis"}
+              :has-pet true
+              :pets ["walter"]}
+        paul-rules [[[:name :first] [[presence {:response {:text "First name is not there"}}]
+                                     (fn [t-map data-point opt-map](Thread/sleep 500)(and (= data-point "Paul")
+                                                                                {:a 1 :b 2}))]]
+                    [[:pets 0] [(from-predicate preds/longer-than? 20 "Too short; Needs to be longer than 20")]]]]
+    (testing "Does validation work on paul-rules?"
+      (is (= (core/validation paul paul-rules)
+             {[:name :first]  '(nil  {:a 1, :b 2}), [:pets 0] "Too short; Needs to be longer than 20"})))))


Execute on-jsload callback outside of core.async context.

Otherwise the handling of the go block catches the exception.
This is annoying for debugging because:

1) You must enable "Break on uncaught exceptions"
2) Stack traces are frequently lost

--- support/src/figwheel/client.cljs
+++ support/src/figwheel/client.cljs
@@ -57,8 +57,8 @@
      (when (not-empty res)
        (.debug js/console "Figwheel: loaded these files")
        (.log js/console (prn-str (map :file res)))
-       (<! (timeout 10)) ;; wait a beat before callback
-       (apply on-jsload [res])))))
+       ;; wait a beat before running callback outside of go's exception handler.
+       (js/setTimeout #(apply on-jsload [res]) 10)))))

 ;; CSS reloading


better code style

better code style

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


Add :aot option to project.clj for creating jar

error: pathspec 'Living' did not match any file(s) known to git
error: pathspec 'Clojure/async-tea-party/project.clj' did not match any file(s) known to git


chore(response): change START_EXECUTION_TIMEOUT response status to 507

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


[EN] Revert not-empty -> seq

[EN] Revert not-empty -> seq

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


fix call

fix call

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


Simplify default configuration

Simplify default configuration

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


Add NCS forecast data for oil

Add NCS forecast data for oil

error: pathspec 'src/clj_simple_chart/ncs/oilforecast/forecastdata.clj' did not match any file(s) known to git

--- src/clj_simple_chart/ncs/oilforecast/forecastdata.clj
+++ src/clj_simple_chart/ncs/oilforecast/forecastdata.clj
@@ -0,0 +1,86 @@
+(ns clj-simple-chart.ncs.oilprognosis.forecastdata)
+
+(def data {
+           "2005"
+           ; Sokkelåret 2005 http://www.npd.no/no/Nyheter/Nyheter/2006/Sokkelaret-2005-/Sokkelaret-2005---petroleumsproduksjon-/
+           {:prfPrdOilNetMillSm3 [140.8 152.7 152.6 145.8 143.6]}
+
+           "2006"
+           ; Sokkelåret 2006 http://www.npd.no/no/Nyheter/Nyheter/2007/Sokkelaret-2006/Sokkelaret-2006---petroleumsproduksjon-/
+           {:prfPrdOilNetMillSm3 [129.4 130.0 126.5 120.6 119.0]}
+
+           "2007"
+           ; Sokkelåret 2007 http://www.npd.no/no/Nyheter/Nyheter/2008/Sokkelaret-2007/Sokkelaret-2007---Petroleumsproduksjon-/
+           {:prfPrdOilNetMillSm3 [117.9 115.3 114.3 112.9 110.3]}
+
+           "2008"
+           ; Sokkelåret 2008 http://www.npd.no/no/Nyheter/Nyheter/2009/Sokkelaret-2008/Sokkelaret-2008---Petroleumsproduksjon/
+           {:prfPrdOilNetMillSm3 [110.8 104.4 98.5 95.0 94.4]}
+
+           "2009"
+           ; Sokkelåret 2009 http://www.npd.no/no/Nyheter/Nyheter/2010/Sokkelaret-2009/Sokkelaret-2009---Petroleumsproduksjon/
+           {:prfPrdOilNetMillSm3 [108.7 100.1 97.6 93.0 91.6]}
+            ;:prfPrdGasNetBillSm3 [105.0 109.0 112.0 112.0 112.2]
+
+           "2010"
+           ; Sokkelåret 2010 http://www.npd.no/Global/Norsk/1-Aktuelt/Nyheter/Sokkel%C3%A5ret-2010/Tabell.pdf
+           {:prfPrdOilNetMillSm3 [98.3 94.0 91.9 89.8 88.9]}
+
+           "2011"
+           ; Sokkelåret 2011 http://www.npd.no/Global/Norsk/1-Aktuelt/Nyheter/Sokkelaret2011/Produksjon-tabell.pdf
+           {:prfPrdOilNetMillSm3 [93.8 92.7 90.8 90.6 90.2]}
+
+           "2012"
+           ; Sokkelåret 2012 http://www.npd.no/Nyheter/Nyheter/2013/Sokkelaret-2012---pressemeldinger/Petroleumsproduksjon/
+           {:prfPrdOilNetMillSm3 [85.5 88.3 90.7 90.1 91.0]}
+
+           "2013"
+           ; Sokkelåret 2013 http://www.npd.no/Global/Norsk/1-Aktuelt/Nyheter/Sokkelaret-2013/Datagrunnlag_til_nettpubl_alle.xlsx
+           {:prfPrdOilNetMillSm3 [85.50 86.50 86.70 86.98 85.94]}
+
+           "2014"
+           ; Sokkelåret 2014 http://www.npd.no/Global/Norsk/1-Aktuelt/Nyheter/Sokkelaaret-2014/Datagrunnlag-til-publisering.xlsx
+           {:prfPrdOilNetMillSm3 [86.31 86.62 85.68 82.41 80.68]}
+
+           "2015"
+           ; Sokkelåret 2015 http://www.npd.no/Global/Norsk/1-Aktuelt/Nyheter/Sokkelaret-2015/Sokkelaaret-figur-grunnlag.xlsx
+           {:prfPrdOilNetMillSm3 [89.04 87.25 81.96 80.21 81.67]}
+
+           "2016"
+           ; Sokkelåret 2016 http://www.npd.no/Global/Norsk/1-Aktuelt/Nyheter/Sokkelaret-2016/Figurgrunnlag-Sokkelaret-2016.xlsx
+           {:prfPrdOilNetMillSm3 [93.88 88.05 83.30 91.27 98.90]}
+            ;:prfPrdGasNetBillSm3 [114.47 114.54 114.46 114.34 113.76]
+
+           })
+
+(defn process-prediction-year [[yr values]]
+  (->>
+    (for [[resource vals] values]
+      (for [[idx val] (map-indexed (fn [idx x] [idx x]) vals)]
+        {:predictionYear (inc (read-string yr))
+         :prfYear        (+ 1 idx (read-string yr))
+         :offsetYear     (inc idx)
+         resource        val}))
+    (flatten)
+    (group-by :prfYear)
+    (vals)
+    (mapv #(reduce merge {} %))
+    (flatten)
+    (sort-by :prfYear)))
+
+(def pretty-data (flatten (mapv process-prediction-year data)))
+
+(def plus-5 (->> pretty-data
+                 (filter #(= 5 (:offsetYear %)))
+                 (sort-by :prfYear)
+                 (vec)))
+
+(def plus-1 (->> pretty-data
+                 (filter #(= 1 (:offsetYear %)))
+                 (sort-by :prfYear)
+                 (vec)))
+
+(def current-forecast (->> pretty-data
+                           (filter #(= 2017 (:predictionYear %)))
+                           (sort-by :prfYear)
+                           (vec)))


Wrap exposed services with error-handling

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 a range slider to set start/end times.

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


fix(handler): allow method OPTIONS in any resource-path


solution 8 clojure

solution 8 clojure

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


Added bacteria unit test

Added bacteria unit test

error: pathspec 'test/bluebell/utils/ebmd/bacteria_test.clj' did not match any file(s) known to git

--- test/bluebell/utils/ebmd/bacteria_test.clj
+++ test/bluebell/utils/ebmd/bacteria_test.clj
@@ -0,0 +1,45 @@
+(ns bluebell.utils.ebmd.bacteria-test
+  (:require [bluebell.utils.ebmd :as ebmd]
+            [clojure.test :refer :all]))
+
+(defn new-bacterium [starting-position]
+  {:mass 0
+   :position starting-position})
+
+(defn new-directed-bacterium [starting-position starting-directions]
+  (-> (new-bacterium starting-position)
+      (assoc :direction starting-directions)))
+
+(defn bacterium? [x]
+  (and (map? x)
+       (contains? x :position)))
+
+(defn directed-bacterium? [x]
+  (and (bacterium? x)
+       (contains? x :direction)))
+
+
+(ebmd/def-arg-spec ::bacterium {:pred bacterium?
+                                :pos [(new-bacterium [9 8])]
+                                :neg [3 4]})
+
+(ebmd/def-arg-spec ::directed-bacterium {:pred directed-bacterium?
+                                         :pos [(new-directed-bacterium [9 8] [3 4])]
+                                         :neg [(new-bacterium [3 4])]})
+
+
+
+
+(ebmd/declare-poly take-turn)
+
+(ebmd/def-poly take-turn [::bacterium x
+                          ::ebmd/any-arg world]
+  :aimless)
+
+(ebmd/def-poly take-turn [::directed-bacterium x
+                          ::ebmd/any-arg world]
+  :directed)
+
+(deftest take-turn-test
+  (is (= :aimless (take-turn (new-bacterium [3 4]) nil)))
+  (is (= :directed (take-turn (new-directed-bacterium [3 4] [1 0]) nil))))


add unit tests

add unit tests

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


Fix TXT record regex

Fix TXT record regex

This allows it to properly match a \- or \space, since folks use both.

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


Allow for API clients to pass any language preference they desire

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


The browser UI is in a separate file now.

error: pathspec 'nightweb-desktop/src/nightweb/browser.clj' did not match any file(s) known to git

--- nightweb-desktop/src/nightweb/browser.clj
+++ nightweb-desktop/src/nightweb/browser.clj
@@ -0,0 +1,48 @@
+(ns nightweb.browser
+  (:use splendid.jfx)
+  (:import javafx.scene.layout.VBox
+           javafx.scene.layout.HBox
+           javafx.scene.control.TabPane
+           javafx.scene.control.Tab
+           javafx.scene.web.WebView
+           javafx.scene.layout.Priority
+           javafx.scene.control.Button
+           javafx.scene.control.TextField
+           javafx.geometry.Insets
+           javafx.event.EventHandler))
+
+(defn create-tab
+  "Creates a new tab."
+  [tab-bar]
+  (let [new-tab (Tab. "Main Page")
+        tab-view (VBox.)
+        nav-bar (HBox.)
+        back-btn (Button. "<-")
+        for-btn (Button. "->")
+        reload-btn (Button. "Reload")
+        url-field (TextField.)
+        web-view (WebView.)
+        index (- (.size (.getTabs tab-bar)) 1)]
+    (.setPadding nav-bar (Insets. 4))
+    (.setSpacing nav-bar 2)
+    (add nav-bar [back-btn for-btn reload-btn url-field])
+    (HBox/setHgrow url-field Priority/ALWAYS)
+    (add tab-view [nav-bar web-view])
+    (.load (.getEngine web-view) "http://localhost:8080")
+    (.setContent new-tab tab-view)
+    (.add (.getTabs tab-bar) index new-tab)
+    (.select (.getSelectionModel tab-bar) index)))
+
+(defn start-browser
+  "Launch the JavaFX browser (non-blocking)."
+  []
+  (jfx (let [window (VBox.)
+             tab-bar (TabPane.)
+             add-tab (Tab. " + ")]
+         (.setClosable add-tab false)
+         (.add (.getTabs tab-bar) add-tab)
+         (defhandler :onSelectionChanged add-tab (create-tab tab-bar))
+         (create-tab tab-bar)
+         (VBox/setVgrow tab-bar Priority/ALWAYS)
+         (add window [tab-bar])
+         (show window))))


Ensure consumer output directories exist.


added file-hash back

added file-hash back

error: pathspec 'src/server/file-hash.cljs' did not match any file(s) known to git

--- src/server/file-hash.cljs
+++ src/server/file-hash.cljs
@@ -0,0 +1,69 @@
+(ns moomoo.file-hash
+  (:require [cljs.nodejs :as nodejs]
+            [clojure.string :as string]
+            [cognitect.transit :as transit]))
+
+(defonce redis-client (.createClient (nodejs/require "redis")))
+(defonce redis-lua-loader (nodejs/require "redis-lua-loader"))
+(defonce redis-lua (redis-lua-loader. redis-client #js {:src "./redis"}))
+(defonce mhash (nodejs/require "mhash"))
+(defonce mm (nodejs/require "musicmetadata"))
+(defonce fs (nodejs/require "fs"))
+(defonce album-art-directory "public/images/albums")
+
+(defn file-hash-exists? [file-hash callback]
+  ((.scriptWrap redis-lua "handleFileHash") 0 file-hash
+    (fn [err reply]
+      (println reply)
+      (if (nil? reply)
+        (do
+          (println "File hash not found")
+          (callback false))
+        (do
+          (println "File hash found!")
+          (callback true))))))
+
+(defn get-hash-from-buffer [buffer]
+  (mhash "md5" buffer))
+
+(defn handle-album-art [tags file-hash callback]
+  (let [pictures (get tags "picture")]
+    (if (empty? pictures)
+      (callback (dissoc tags "picture"))
+      (let [picture (first (get tags "picture"))
+            picture-format (get picture "format")
+            picture-data   (get picture "data")
+            filename  (subs file-hash 0 7)
+            file-path (str album-art-directory "/" filename "." picture-format)]
+        (println "Saving album art to:" file-path)
+        (.writeFile fs file-path picture-data)
+        (.set redis-client (str "file-hash:" file-hash ":picture") file-path
+          (fn []
+            (callback (merge {"picture" (string/replace file-path "public" "")}
+                             (dissoc tags "picture")))))))))
+
+(defn handle-new-file
+  ([file-path callback]
+    (.readFile fs file-path
+      (fn [err buf]
+        (let [file-hash (get-hash-from-buffer buf)]
+          (handle-new-file file-path file-hash "application/octet-stream" callback)))))
+
+  ([file-path file-hash mime-type callback]
+    (mm (.createReadStream fs file-path) #js {:duration true}
+      (fn [err tags]
+        (handle-album-art (js->clj tags) file-hash
+          (fn [tags-without-album-art]
+            (let [music-info {:tags tags-without-album-art
+                              :mime mime-type
+                              :filehash file-hash}
+                  writer (transit/writer :json)
+                  music-info-json (transit/write writer music-info)]
+              (.set redis-client (str "file-hash:" file-hash) music-info-json
+                (fn []
+                  (.set redis-client (str "file-hash:" file-hash ":file")
+                                     file-path
+                    (fn []
+                      (.incr redis-client (str "file-hash:" file-hash ":num-of-tracks")
+                        (fn []
+                          (callback file-hash music-info))))))))))))))


adding volumes ns

adding volumes ns

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

--- src/aws/volumes.clj
+++ src/aws/volumes.clj
@@ -0,0 +1,71 @@
+(comment
+  Celestial, Copyright 2012 Ronen Narkis, narkisr.com
+  Licensed under the Apache License,
+  Version 2.0  (the "License") you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.)
+
+(ns aws.volumes
+  (:require
+    [celestial.common :refer (import-logging )]
+    [celestial.provider :refer (wait-for)]
+    [aws.sdk.ebs :as ebs]
+    [aws.sdk.ec2 :as ec2]
+    [celestial.persistency.systems :as s]
+    [aws.common :refer (with-ctx instance-desc creds image-id)]
+    ))
+
+(import-logging)
+
+(defn image-desc [endpoint ami & ks]
+  (-> (ec2/describe-images (assoc (creds) :endpoint endpoint) (ec2/image-id-filter ami))
+      first (apply ks)))
+
+(defn wait-for-attach [endpoint instance-id timeout]
+  (wait-for {:timeout timeout}
+    #(= "attached" (instance-desc endpoint instance-id :block-device-mappings 0 :ebs :status))
+    {:type ::aws:ebs-attach-failed :message "Failed to wait for ebs root device attach"}))
+
+(defn handle-volumes
+   "attached and waits for ebs volumes"
+   [{:keys [aws machine] :as spec} endpoint instance-id]
+  (when (= (image-desc endpoint (image-id machine) :root-device-type) "ebs")
+    (wait-for-attach endpoint instance-id [10 :minute]))
+  (let [zone (instance-desc endpoint instance-id :placement :availability-zone)]
+    (doseq [{:keys [device size]} (aws :volumes)]
+      (let [{:keys [volumeId]} (with-ctx ebs/create-volume size zone)]
+        (wait-for {:timeout [10 :minute]} #(= "available" (with-ctx ebs/state volumeId))
+           {:type ::aws:ebs-volume-availability :message "Failed to wait for ebs volume to become available"})
+        (with-ctx ebs/attach-volume volumeId instance-id device)
+        (wait-for {:timeout [10 :minute]} #(= "attached" (with-ctx ebs/attachment-status volumeId))
+           {:type ::aws:ebs-volume-attach-failed :message "Failed to wait for ebs volume device attach"})))))
+
+(defn clear?
+   "is this ebs clearable"
+   [device-name system-id]
+  (let [{:keys [volumes]} ((s/get-system system-id) :aws)]
+    ((first (filter (fn [{:keys [device]}] (= device device-name)) volumes)) :clear)))
+
+(defn delete-volumes
+  "Clear instance volumes"
+  [endpoint instance-id system-id]
+  (doseq [{:keys [ebs device-name]} (-> (instance-desc endpoint instance-id) :block-device-mappings rest)]
+    (when (clear? device-name system-id)
+      (trace "deleting volume" ebs)
+      (with-ctx ebs/detach-volume (ebs :volume-id))
+      (wait-for {:timeout [10 :minute]}
+        #(= "available" (with-ctx ebs/state  (ebs :volume-id)))
+        {:type ::aws:ebs-volume-availability
+         :message "Failed to wait for ebs volume to become available"})
+      (with-ctx ebs/delete-volume (ebs :volume-id)))))
+
+(comment
+  (clojure.pprint/pprint
+    (celestial.model/set-env :dev
+                             (-> (instance-desc "ec2.eu-west-1.amazonaws.com" "i-a5a88de9") :block-device-mappings rest)
+                             ))
+  )


refactore: POST request using wrap-json-body

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


Formatting

Formatting

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


La til Clojure-løsning på Movie Bucket

La til Clojure-løsning på Movie Bucket

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

--- movie_bucket/larstvei.clj
+++ movie_bucket/larstvei.clj
@@ -0,0 +1,12 @@
+(require '[clojure.string :refer [split]]
+         '[clojure.java.io :refer [reader]])
+
+(defn operate [movies [op movie]]
+  (case op
+    "buys" (conj movies movie)
+    "watches" (conj (remove #{movie} movies) movie)
+    "sells" (remove #{movie} movies)))
+
+(let [data (map #(split % #" " 2) (line-seq (reader *in*)))
+      movies (reduce operate () data)]
+  (println (inc (.indexOf movies "Gone with the Wind"))))


Adding integration tests for search with page.

--- test/clojars/test/integration/search.clj
+++ test/clojars/test/integration/search.clj
@@ -16,6 +16,14 @@
         query
         (name fmt))
     (client/get opts)))
+
+(defn do-search-with-page [fmt query page & [opts]]
+  (-> (format "http://localhost:%s/search?q=%s&format=%s&page=%s"
+        help/test-port
+        query
+        (name fmt)
+        page)
+      (client/get opts)))

 (deftest search-test
   (let [base-data {:description "foo" :version "1.0"}
@@ -40,6 +48,16 @@
         (is (= 200 (:status resp)))
         (is (= "text/html" (help/get-content-type resp)))))

+    (testing "request with valid page returns data"
+      (let [resp (do-search-with-page "" "test" "1" {:throw-exceptions false})]
+        (is (= 200 (:status resp)))
+        (is (= "text/html" (help/get-content-type resp)))))
+
+    (testing "request with invalid page returns error"
+      (let [resp (do-search-with-page "" "test" "a" {:throw-exceptions false})]
+        (is (= 400 (:status resp)))
+        (is (= "text/html" (help/get-content-type resp)))))
+
     (testing "unknown format request returns html" ;; debatable behavior
       (let [resp (do-search :ham "test")]
         (is (= 200 (:status resp)))
@@ -52,6 +70,15 @@
         (is (= 2 (:count result)))
         (is (= search-data (:results result)))))

+    (testing "json request with invalid page returns error"
+      (let [resp (do-search-with-page :json "test" "a" {:throw-exceptions false})
+            result (json/parse-string (:body resp) true)]
+        (prn resp)
+        (is (= 400 (:status resp)))
+        (is (= "application/json" (help/get-content-type resp)))
+        (is (not (nil? (:error result))))
+        (is (not (nil? (:error-id result))))))
+
     (testing "invalid query syntax returns error"
       (let [resp (do-search :json "test+AND" {:throw-exceptions false})
             result (json/parse-string (:body resp) true)]


first integration tests

first integration tests

#44

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

--- test/clj/swarmpit/docker/client_test.clj
+++ test/clj/swarmpit/docker/client_test.clj
@@ -0,0 +1,46 @@
+(ns swarmpit.docker.client_test
+  (:require [clojure.test :refer :all]
+            [swarmpit.docker.client :refer :all]))
+
+(use-fixtures :once
+              (fn [test]
+                (swarmpit.config/update! {:docker-sock "http://localhost:12375"})
+                (test)))
+
+(def service-def
+  {:Name "alpine",
+   :Labels {:swarmpit.service.deployment.autoredeploy "false", :swarmpit.service.registry.name "dockerhub", :swarmpit.service.registry.user nil},
+   :TaskTemplate {:ContainerSpec {:Image "alpine:latest", :Mounts [], :Secrets [], :Env []},
+                  :RestartPolicy {:Condition "any", :Delay 5000000000, :MaxAttempts 0},
+                  :Placement {:Constraints []}, :ForceUpdate nil, :Networks []},
+   :Mode {:Replicated {:Replicas 1}},
+   :UpdateConfig {:Parallelism 1, :Delay 0, :FailureAction "pause"},
+   :RollbackConfig {:Parallelism 1, :Delay 0, :FailureAction "pause"},
+   :EndpointSpec {:Ports []}})
+
+(deftest ^:integration docker-client
+
+  (testing "get services"
+    (is (some? (services))))
+
+  (testing "get networks"
+    (is (some? (networks))))
+
+  (testing "get volumes"
+    (is (some? (volumes))))
+
+  (testing "get secrets"
+    (is (some? (secrets))))
+
+  (testing "get nodes"
+    (is (some? (nodes))))
+
+  (testing "get tasks"
+    (is (some? (tasks))))
+
+  (testing "create and delete service"
+    (let [service (create-service service-def)]
+      (is (some? service))
+      (is (some? (delete-service (service :ID)))))))
+
+


restore auth api call functionality

restore auth api call functionality

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


fix typo, remove error-handling as it is not used anyways


Add tests for xor

Add tests for xor

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

--- test/caesium/magicnonce/secretbox_test.clj
+++ test/caesium/magicnonce/secretbox_test.clj
@@ -0,0 +1,15 @@
+(ns caesium.magicnonce.secretbox-test
+  (:require [caesium.magicnonce.secretbox :as s]
+            [clojure.test :refer [deftest is]]
+            [caesium.util :as u]))
+
+(deftest xor-test
+  (let [one (byte-array [1 0 1])
+        two (byte-array [0 1 0])
+        out (byte-array [0 0 0])]
+    (is (identical? (#'s/xor! out one two) out))
+    (is (u/array-eq (byte-array [1 1 1]) out)))
+  (let [one (byte-array [1 0 1])
+        two (byte-array [0 1 0])]
+    (is (identical? (#'s/xor-inplace! one two) one))
+    (is (u/array-eq (byte-array [1 1 1]) one))))


have working implementation of code that fetches the deps from NPM and flattens the graph

error: pathspec 'src/sourceninja-node/core.cljs' did not match any file(s) known to git

--- src/sourceninja-node/core.cljs
+++ src/sourceninja-node/core.cljs
@@ -0,0 +1,78 @@
+(ns sourceninja-node.core
+  (:require  [clojure.set :as set]
+             [cljs.nodejs :as node]))
+
+(def npm
+  (node/require "npm"))
+
+(def test-deps
+  {
+   "npm"
+   { "version" "1.1.18"
+     "dependencies"
+     { "semver" { "version" "1.0.13" }
+       "ini" { "version" "1.0.2" }
+       "slide" { "version" "1.1.3"
+                 "dependencies" { "foo" {"version" "1.1.3"
+                                         "dependencies" { "bar" {"version" "1.1.3"}}}}}
+       "abbrev" { "version" "1.0.3" }
+       "graceful-fs" { "version" "1.1.8" }
+       "minimatch" { "version" "0.2.2" }
+       "nopt" { "version" "1.0.10" }
+       "node-uuid" { "version" "1.3.3" }
+       "proto-list" { "version" "1.0.0" }
+       "rimraf" { "version" "2.0.1" }
+       "request" { "version" "2.9.153" }
+       "which" { "version" "1.0.5" }
+       "tar" { "version" "0.1.13" }
+       "fstream" { "version" "0.1.18" }
+       "block-stream" { "version" "0.0.5" }
+       "inherits" { "version" "1.0.0" }
+       "mkdirp" { "version" "0.3.0" }
+       "read" { "version" "0.0.2" }
+       "lru-cache" { "version" "1.0.5" }
+       "node-gyp" { "version" "0.4.1" }
+       "fstream-npm" { "version" "0.0.6" }
+       "uid-number" { "version" "0.0.3" }
+       "archy" { "version" "0.0.2" }
+       "chownr" { "version" "0.0.1" } } }
+
+   "jcrawl"
+   { "version" "0.0.1",
+     "dependencies"
+     { "jquery" { "version" "1.6.3"}
+       "jsdom" { "version" "0.2.14"}
+       "request" { "version" "2.9.202" } } }
+   }
+  )
+
+(defn flatten-deps
+  [input]
+  (loop [output {}
+         input input]
+
+    (if-not (empty? input)
+
+      (let [notseen (remove (partial contains? output) (keys input))
+            newout (reduce #(assoc %1 %2 (get input %2)) output notseen)
+            ndeps (apply merge (map #(get (get input %1) "dependencies") notseen))]
+
+        (recur newout ndeps))
+      output)))
+
+(defn npm-ls-callback
+  [_ _ lite]
+  (let [deps (flatten-deps (js->clj (. js/lite -dependencies)))]
+    (println deps)))
+
+(defn load-npm-callback
+  [_ npm]
+  (.ls (. js/npm -commands) [] true npm-ls-callback))
+
+(defn print-deps
+  []
+  (println
+   (flatten-deps test-deps)))
+
+(set! *main-cli-fn* #(.load npm load-npm-callback))
+;;(set! *main-cli-fn* print-deps)


[WM EN] correct type of coerced validation errors

Without the empty map passed to the schema.macros/error! macro, it was
throwing RuntimeExceptions, which causes handle-errors to treat them as
"unknown server errors." By adding the empty map, we get
clojure.lang.ExceptionInfo exceptions, which get caught by handle-errors
as validation errors. That's probably a bit too broad, but that's a change
for another time.


Added shon table implementation

Added shon table implementation

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

--- src/cassidy/extensions.clj
+++ src/cassidy/extensions.clj
@@ -0,0 +1,19 @@
+(ns cassidy.extensions
+  "Extra SHONWriter implementations that may be of use."
+  (:require [cassidy.shon :refer [SHONWriter -get-class-attribute write-str]]
+            [hiccup.core :refer [html]]))
+
+(defrecord Table [recs caption column-order]
+  SHONWriter
+  (-get-class-attribute [_] "SHON.Table")
+  (-write-str [table el]
+    (let [{:keys [recs caption column-order :or {column-order (keys (first recs))}]} table
+          headers (keys (first recs))
+          row-data (map vals recs)]
+      (html [el {:class (-get-class-attribute table)}
+             [:table
+              [:caption caption]
+              [:tr (map #(html [:th %]) headers)]
+              (map #(html [:tr (map (fn [v] (html [:td (write-str v)])) %)]) row-data)]]))))
+
+(def tab (->Table [{:a 1 :b 2} {:a 10 :b 20}] "Simple Table" nil))


add missing delimiter

add missing delimiter

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


format time-picker in admin service order creation to use HH:mm

expecting that we won't need to do things down to the second

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


make reference-commented code consistent name-wise w.r.t. the newer impl in progress

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


Added Paired Digits problem

Added Paired Digits problem

error: pathspec 'src/clojush/problems/software/benchmarks_v2/paired_digits.clj' did not match any file(s) known to git

--- src/clojush/problems/software/benchmarks_v2/paired_digits.clj
+++ src/clojush/problems/software/benchmarks_v2/paired_digits.clj
@@ -0,0 +1,213 @@
+;; paired_digits.clj
+;; Tom Helmuth, thelmuth@hamilton.edu
+;;
+;; Problem inspired by: https://adventofcode.com/2017/day/1
+
+(ns clojush.problems.software.benchmarks-v2.paired-digits
+  (:use clojush.pushgp.pushgp
+        [clojush pushstate interpreter random util globals]
+        clojush.instructions.tag)
+  (:require [clojure.math.numeric-tower :as nt]))
+
+; Atom generators
+(def atom-generators
+  (make-proportional-atom-generators
+   (concat
+    (registered-for-stacks [:string :char :integer :boolean :exec])
+    (list (tag-instruction-erc [:string :char :integer :boolean :exec] 1000) ; tags
+          (tagged-instruction-erc 1000)))
+   (list 'in1) ; inputs
+   (list 0
+         (fn [] (lrand-nth "0123456789")) ;Char digit ERC
+         (fn [] (lrand-int 10)) ;Integer ERC
+         ) ; constants
+   {:proportion-inputs 0.15
+    :proportion-constants 0.05}))
+
+(defn paired-digits-input
+  "Creates a string of length len of digits.
+   Encourages repetition by choosing a random probability of repeating in
+   [0, 1], which holds for the whole string. So, if that probability is near
+   1, will almost always repeat. This will make some strings have a lot of
+   repeats, which is useful for this problem's testing"
+  [len]
+  (let [repeat-probability (lrand)
+        digits "0123456789"]
+    (loop [string (str (lrand-nth digits))]
+      (cond
+       (>= (count string) len) string
+       (< (lrand) repeat-probability) (recur (str string (last string))) ; repeat last digit
+       :else (recur (str string (lrand-nth digits)))))))
+
+;; A list of data domains. Each domain is a vector containing
+;; a "set" of inputs and two integers representing how many cases from the set
+;; should be used as training and testing cases respectively. Each "set" of
+;; inputs is either a list or a function that, when called, will create a
+;; random element of the set.
+(def data-domains
+  [[(list "99"
+          "88"
+          "77"
+          "55"
+          "44"
+          "22"
+          "00"
+          "83"
+          "38"
+          "71"
+          "90"
+          "32"
+          "05"
+          "64"
+          "42") 15 0] ; length-2 fixed strings
+   [(list "999"
+          "555"
+          "111"
+          "844"
+          "522"
+          "688"
+          "233"
+          "660"
+          "004"
+          "992"
+          "123"
+          "841"
+          "808"
+          "454"
+          "295") 15 0] ; length-3 fixed strings
+   [(list "99999999999999999999"
+          "88888888885555555555"
+          "85858585858585858585"
+          "00000000000000000000"
+          "11111111111111111111"
+          "11223344556677889900"
+          "11111888882222266666"
+          "91181171161151141131"
+          "77777377777377777377"
+          "09876543210987654321") 10 0] ; length-20 fixed strings
+   [(fn [] (paired-digits-input (+ 2 (lrand-int 19)))) 160 2000] ; random strings, length [2, 20]
+   ])
+
+;;Can make test data like this:
+(comment (test-and-train-data-from-domains data-domains))
+
+(defn get-digits
+  "Returns a list of digits of the string"
+  [input]
+  (map #(Integer/parseInt (str %))
+       input))
+
+(defn solve-paired-digits
+  "Solves the problem given the input."
+  [input]
+  (let [digs (get-digits input)]
+    (apply +
+           (map (fn [x y]
+                  (if (= x y)
+                    x
+                    0))
+                digs
+                (rest digs)))))
+
+; Helper function for error function
+(defn test-cases
+  "Takes a sequence of inputs and gives IO test cases of the form
+   [[input1 input2] output]."
+  [inputs]
+  (map (fn [in]
+         (vector in
+                 (solve-paired-digits in)))
+       inputs))
+
+(defn make-error-function-from-cases
+  "Creates and returns the error function based on the train/test cases."
+  [train-cases test-cases]
+  (fn the-actual-error-function
+    ([individual]
+      (the-actual-error-function individual :train))
+    ([individual data-cases] ;; data-cases should be :train or :test
+     (the-actual-error-function individual data-cases false))
+    ([individual data-cases print-outputs]
+      (let [behavior (atom '())
+            errors (doall
+                     (for [[input1 correct-output] (case data-cases
+                                                              :train train-cases
+                                                              :test test-cases
+                                                              [])]
+                       (let [final-state (run-push (:program individual)
+                                                   (->> (make-push-state)
+                                                        (push-item input1 :input)))
+                             result (top-item :integer final-state)]
+                         (when print-outputs
+                           (println (format "Correct output: %3d | Program output: %s" correct-output (str result))))
+                         ; Record the behavior
+                         (swap! behavior conj result)
+                         ; Error is integer difference
+                         (if (number? result)
+                           (nt/abs (- result correct-output)) ; distance from correct integer
+                           1000000) ; penalty for no return value
+                         )))]
+        (if (= data-cases :train)
+          (assoc individual :behaviors @behavior :errors errors)
+          (assoc individual :test-errors errors))))))
+
+(defn get-train-and-test
+  "Returns the train and test cases."
+  [data-domains]
+  (map test-cases
+       (test-and-train-data-from-domains data-domains)))
+
+; Define train and test cases
+(def train-and-test-cases
+  (get-train-and-test data-domains))
+
+(defn initial-report
+  [argmap]
+  (println "Train and test cases:")
+  (doseq [[i case] (map vector (range) (first train-and-test-cases))]
+    (println (format "Train Case: %3d | Input/Output: %s" i (str case))))
+  (doseq [[i case] (map vector (range) (second train-and-test-cases))]
+    (println (format "Test Case: %3d | Input/Output: %s" i (str case))))
+  (println ";;******************************"))
+
+(defn custom-report
+  "Custom generational report."
+  [best population generation error-function report-simplifications]
+  (let [best-test-errors (:test-errors (error-function best :test))
+        best-total-test-error (apply +' best-test-errors)]
+    (println ";;******************************")
+    (printf ";; -*- Find Pair problem report - generation %s\n" generation)(flush)
+    (println "Test total error for best:" best-total-test-error)
+    (println (format "Test mean error for best: %.5f" (double (/ best-total-test-error (count best-test-errors)))))
+    (when (zero? (:total-error best))
+      (doseq [[i error] (map vector
+                             (range)
+                             best-test-errors)]
+        (println (format "Test Case  %3d | Error: %s" i (str error)))))
+    (println ";;------------------------------")
+    (println "Outputs of best individual on training cases:")
+    (error-function best :train true)
+    (println ";;******************************")
+    )) ;; To do validation, could have this function return an altered best individual
+       ;; with total-error > 0 if it had error of zero on train but not on validation
+       ;; set. Would need a third category of data cases, or a defined split of training cases.
+
+
+; Define the argmap
+(def argmap
+  {:error-function (make-error-function-from-cases (first train-and-test-cases)
+                                                   (second train-and-test-cases))
+   :atom-generators atom-generators
+   :max-points 2000
+   :max-genome-size-in-initial-program 250
+   :evalpush-limit 2000
+   :population-size 1000
+   :max-generations 300
+   :parent-selection :lexicase
+   :genetic-operator-probabilities {:uniform-addition-and-deletion 1.0}
+   :uniform-addition-and-deletion-rate 0.09
+   :problem-specific-report custom-report
+   :problem-specific-initial-report initial-report
+   :report-simplifications 0
+   :final-report-simplifications 5000
+   :max-error 1000000})


Mild cleanup.

Mild cleanup.

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


transact appropriate events during payment creation


Add implementation in groups to accept a list of children

It can still accept individual ones, but taking a list makes using
it easier


Beginnings of complex map generator

Beginnings of complex map generator

error: pathspec 'src/hphelper/sectorgen/generator.clj' did not match any file(s) known to git

--- src/hphelper/sectorgen/generator.clj
+++ src/hphelper/sectorgen/generator.clj
@@ -0,0 +1,17 @@
+(ns hphelper.sectorgen.generator
+  (:require [hphelper.shared.sql :as sql]
+            ))
+
+(defn create-service-group
+  [sgId]
+  {sgId (sql/get-random-name "V")})
+
+(defn create-sector
+  "Creates the High Programmers and service group heads of a sector"
+  []
+  {
+   :sgheads (reduce merge
+                    (map (comp create-service-group :sg_id)
+                         (sql/query "SELECT * FROM sg;")))
+   :hps (reduce conj [] (repeatedly 6 (partial sql/get-random-name "U")))
+   })


Pack a Sequence in progress

Pack a Sequence in progress

error: pathspec 'src/4clojure/pack-seq.clj' did not match any file(s) known to git


fix(handler): change /health text

fix(handler): change /health text

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


More accurate label

More accurate label

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


db: added 'readed' attribute

db: added 'readed' attribute

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


Add state spec tests.

Add state spec tests.

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

--- spec/cats/monad/state_spec.cljx
+++ spec/cats/monad/state_spec.cljx
@@ -0,0 +1,107 @@
+(ns cats.monad.state-spec
+  #+cljs
+  (:require [speclj.core :as s :include-macros true]
+            [cats.builtin :as b]
+            [cats.protocols :as p]
+            [cats.data :as d]
+            [cats.monad.state :as state]
+            [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.data :as d]
+            [cats.monad.state :as state]
+            [cats.monad.maybe :as maybe]
+            [cats.core :as m]))
+
+(s/describe "state-monad"
+  (s/it "get-state should return the identity."
+    (let [computation (state/get-state)]
+      (s/should= :foo (state/exec-state computation :foo))))
+
+  (s/it "swap-state should apply function to state and return it."
+    (let [computation (state/swap-state inc)]
+      (s/should= 2 (state/exec-state computation 1))))
+
+  (s/it "put-state should override the state"
+    (let [computation (state/put-state 42)]
+      (s/should= 42
+             (state/exec-state computation 0))))
+
+  (s/it "State monad composition with mlet should return state"
+    (let [res (m/mlet [s (state/get-state)]
+                (m/return (inc s)))]
+      (s/should (state/state? res))
+      (let [res (state/run-state res 1)]
+        (s/should (d/pair? res))
+        (s/should= 2 (first res))
+        (s/should= 1 (second res)))))
+
+  (s/it "State monad computations can be mapped over"
+    (let [res (m/mlet [s (state/get-state)]
+                (m/return (inc s)))
+          res (m/fmap inc res)]
+      (s/should (state/state? res))
+      (let [res (state/run-state res 1)]
+        (s/should (d/pair? res))
+        (s/should= 3 (first res))
+        (s/should= 1 (second res))))))
+
+
+(def maybe-state-monad (state/state-transformer maybe/maybe-monad))
+
+(s/describe "state-transformer"
+  (s/it "get-state should return the identity wrapped in the inner monad's context."
+    (s/should= (maybe/just (d/pair :foo :foo))
+               (m/with-monad maybe-state-monad
+                 (state/run-state (state/get-state) :foo))))
+
+  (s/it "swap-state should should apply function to state and return it."
+    (s/should= (maybe/just (d/pair 1 2))
+               (m/with-monad maybe-state-monad
+                 (state/run-state (state/swap-state inc) 1))))
+
+  (s/it "put-state should override the state"
+    (s/should= (maybe/just (d/pair 0 42))
+               (m/with-monad maybe-state-monad
+                 (state/run-state (state/put-state 42) 0))))
+
+  (s/it "State monad composition with mlet should return state"
+    (let [res (m/mlet [s (state/get-state)]
+                (m/return (inc s)))]
+      (s/should (state/state? res))
+      (let [mres (m/with-monad maybe-state-monad
+                   (state/run-state res 1))
+            res  (maybe/from-maybe mres)]
+        (s/should (maybe/maybe? mres))
+        (s/should (d/pair? res))
+        (s/should= 2 (first res))
+        (s/should= 1 (second res)))))
+
+  (s/it "State monad computations can be mapped over"
+    (let [res (m/mlet [s (state/get-state)]
+                (m/return (inc s)))]
+      (s/should (state/state? res))
+      (let [mres (m/with-monad maybe-state-monad
+                   (state/run-state (m/fmap inc res) 1))
+            res (maybe/from-maybe mres)]
+        (s/should (maybe/maybe? mres))
+        (s/should (d/pair? res))
+        (s/should= 3 (first res))
+        (s/should= 1 (second res)))))
+
+  (s/it "Inner monad values can be lifted into the transformer"
+    (let [lifted-just (m/mlet [s (state/get-state)
+                               i (m/lift (maybe/just 3))]
+                        (m/return (+ i s)))
+          lifted-nothing (m/mlet [s (state/get-state)
+                                  i (m/lift (maybe/nothing))]
+                           (m/return (+ s i)))]
+      (s/should= (maybe/just (d/pair 45 42))
+                 (m/with-monad maybe-state-monad
+                   (state/run-state lifted-just 42)))
+      (s/should= (maybe/nothing)
+                 (m/with-monad maybe-state-monad
+                   (state/run-state lifted-nothing nil))))))


Update id counter after initial attribute declaration

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


filter results of graph traversal

filter results of graph traversal

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


Provide an ability to destructure intents and bundles

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

--- src/clojure/neko/data.clj
+++ src/clojure/neko/data.clj
@@ -0,0 +1,39 @@
+(ns neko.data
+  "Contains utilities to manipulate data that is passed between
+  Android entities via Bundles and Intents."
+  (:import android.os.Bundle android.content.Intent))
+
+(defprotocol GenericKey
+  "If given a string returns itself, otherwise transforms a argument
+  into a string."
+  (generic-key [key]))
+
+(extend-protocol GenericKey
+  String
+  (generic-key [s] s)
+
+  clojure.lang.Keyword
+  (generic-key [k] (.getName k)))
+
+(defprotocol MapLike
+  "Returns a wrapper of the provided object that allows to extract
+  values from it like from an ordinar map."
+  (like-map [this]))
+
+(extend-protocol MapLike
+  Bundle
+  (like-map [b]
+    (proxy [clojure.lang.APersistentMap] []
+      (containsKey [k] (.containsKey b (generic-key k)))
+      (valAt
+        ([k] (.get b (generic-key k)))
+        ([k default] (let [key (generic-key k)]
+                       (if (.containsKey b key)
+                         (.get b (generic-key key))
+                         default))))
+      (seq [] (map (fn [k] [k (.get b k)])
+                   (.keySet b)))))
+
+  Intent
+  (like-map [i]
+    (like-map (.getExtras i))))


remove unneeded imports

remove unneeded imports

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


Added one test to the polymorph suite (test name usage)

* added one tests that verifies that the diet function also
  accesses the name value of the map (before it was possible
  to just return "Bambi eats veggies." for the herbivore diet
* since this is not the main purpose of these specs added just
  this one and not extra specs for default/carnivore as I didn't
  want to bloat it, but could add those as well if desired

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/croeder/clojure-koans-work.git/'


Add a migration library, call it on startup

error: pathspec 'src/circle/db/migration_lib.clj' did not match any file(s) known to git

--- src/circle/db/migration_lib.clj
+++ src/circle/db/migration_lib.clj
@@ -0,0 +1,36 @@
+(ns circle.db.migration-lib
+  "Library for performing DB migrations in mongo"
+  (:require [somnium.congomongo :as mongo])
+  (:use [clojure.tools.logging :only (infof)])
+  (:use [arohner.utils :only (inspect)]))
+
+(defonce migrations (ref []))
+
+(defn clear-migrations []
+  (dosync
+   (alter migrations (constantly []))))
+
+(defn add-migration [m]
+  (dosync
+   (alter migrations conj m)))
+
+(defn def-migration
+  "Returns a new migration object. Query is the :where clause of a
+  congomongo query. transform is a fn of one argument, the old
+  row. transform should return the updated row."
+  [name & {:keys [coll query transform] :as args}]
+  (add-migration (merge args {:name name})))
+
+(defn run-migration [m]
+  (infof "starting migration %s" (-> m :name))
+  (doseq [row (mongo/fetch (-> m :coll) :where (-> m :query))
+          :let [coll (-> m :coll)
+                t (-> m :transform)]]
+    (mongo/update! coll row (t row)))
+  (infof "finished migration %s" (-> m :name)))
+
+(defn run-all-migrations []
+  (infof "starting migrations")
+  (doseq [m @migrations]
+    (run-migration m))
+  (infof "migrations finished"))


Permission adding participants to a conversation.

Can only add participants if you are the owner or a participant.


Improved logging pubsub

Improved logging pubsub

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


cleanup

cleanup

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


cells-in-range added to support ability to grab all cells within N range of a coordinate for checks.

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


Fixing bug introduced in boolean?

Fixing bug introduced in boolean?

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


Add orm mapping for EVENT_SESSION table. #40.

--- src/ruuvi_server/database/entities.clj
+++ src/ruuvi_server/database/entities.clj
@@ -11,6 +11,7 @@
 (declare tracker)
 (declare event-extension-type)
 (declare event-extension-value)
+(declare event-session)
 (declare event)

 (defdb db (:database conf/*config*))
@@ -22,6 +23,13 @@
   (entity-fields :id :tracker_code :name :latest_activity :shared_secret)
   )

+(defentity event-session
+  (table :event_sessions)
+  (pk :id)
+  (entity-fields :id :session_code :first_event_time :latest_event_time)
+  (belongs-to tracker {:fk :tracker_id})
+  )
+
 (defentity event-extension-type
   (table :event_extension_types)
   (pk :id)
@@ -46,6 +54,7 @@
   (pk :id)
   (entity-fields :event_time :created_on)
   (belongs-to tracker {:fk :tracker_id})
+  (belongs-to event-session {:fk :event_session_id})
   (has-many event-location {:fk :event_id})
   (has-many event-extension-value {:fk :event_id})
   )


Refactor: make the design even more declarative...

... by making the top-level content of the
horizontally-squishable-column viewable from the root of the
component tree, the home-page component. My hope is that this
gives a clearer top-down image of the app and its layout.

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


Cases that will fail if lazy evaluation isn't handled correctly.

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

--- test/behaviors/t_lazy_evaluation_cases.clj
+++ test/behaviors/t_lazy_evaluation_cases.clj
@@ -0,0 +1,81 @@
+;; -*- indent-tabs-mode: nil -*-
+
+(ns behaviors.t-lazy-evaluation-cases
+  (:use [midje.sweet]
+        [midje.util laziness thread-safe-var-nesting]
+        [midje.test-util]))
+
+(unfinished triple)
+
+(defn triple-sequence [n]
+  (map triple (range n)))
+
+(fact "triple-sequence returns a sequence of triples"
+  "basic case for lazy sequences"
+  (triple-sequence 4) => [0 3 6 9]
+  (provided
+    (triple 0) => 0
+    (triple 1) => 3
+    (triple 2) => 6
+    (triple 3) => 9))
+
+(fact "lazy sequences embedded within other structures"
+  [(triple-sequence 2) {:a (triple-sequence 3) }]
+  => [  [0 3]
+        {:a [0 3 6] }]
+  (provided
+    (triple 0) => 0
+    (triple 1) => 3
+    (triple 2) => 6))
+
+;; These cases explore lazy sequences with side effects
+
+(def output-device (atom []))
+
+(defn triple [n] (* 3 n))
+
+(defn output-triples [n]
+  (swap! output-device #(concat % (triple-sequence n))))
+
+(fact "output-triples appends to state"
+  (reset! output-device [])
+  (against-background
+    (triple 0) => 0
+    (triple 1) => 3
+    (triple 2) => 6
+    (triple 3) => 9)
+  (output-triples 4)
+  @output-device => [0 3 6 9])
+
+(defn doubly-output-triples [n]
+  (let [triples (triple-sequence n)]
+    (swap! output-device #(concat % triples))
+    triples))
+
+(fact "doubly-output-triples appends to state and returns value"
+  (reset! output-device [])
+  (against-background
+    (triple 0) => 0
+    (triple 1) => 3
+    (triple 2) => 6
+    (triple 3) => 9)
+  (output-triples 4) => [0 3 6 9]
+  @output-device => [0 3 6 9])
+
+(fact "a variant way of doing the same thing"
+  (reset! output-device [])
+  (output-triples 4) => [0 3 6 9]
+  (provided
+    (triple 0) => 0
+    (triple 1) => 3
+    (triple 2) => 6
+    (triple 3) => 9)
+  @output-device => [0 3 6 9])
+
+;; Exceptions generated by realizing lazy sequence.
+
+(unfinished exploder)
+
+(fact "exceptions are forced out in good time"
+  (exploder) => (throws Error)
+  (map exploder [1 2 3]) => (throws Error))


Should be a total of eight subs no matter what is signed 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/vincentstorme/clojureme.git/'


Fix issue where changing value of preview_display might not save

--- src/metabase/api/meta/field.clj
+++ src/metabase/api/meta/field.clj
@@ -39,10 +39,10 @@
   {field_type   FieldType
    special_type FieldSpecialType}
   (write-check Field id)
-  (check-500 (m/mapply upd Field id (merge {:description  description                                   ; you're allowed to unset description and special_type
-                                            :special_type special_type}                                 ; but field_type and preview_display must be replaced
-                                           (when field_type      {:field_type field_type})              ; with new non-nil values
-                                           (when preview_display {:preview_display preview_display}))))
+  (check-500 (m/mapply upd Field id (merge {:description  description                                                ; you're allowed to unset description and special_type
+                                            :special_type special_type}                                              ; but field_type and preview_display must be replaced
+                                           (when field_type                   {:field_type field_type})              ; with new non-nil values
+                                           (when (not (nil? preview_display)) {:preview_display preview_display}))))
   (sel :one Field :id id))

 (defendpoint GET "/:id/summary"


ugh interactive opengl is awesome, thank you for existing Clojure <3

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


Further refactoring of entity creation.

Further refactoring of entity creation.


Added fibonacci modified

Added fibonacci modified

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

--- clojure/src/hackerrank/fibonacci_modified.clj
+++ clojure/src/hackerrank/fibonacci_modified.clj
@@ -0,0 +1,19 @@
+(ns hackerrank.fibonacci-modified)
+
+(require '[clojure.string :as s])
+
+(let [line (read-line)
+      line-parsed (map #(Integer/parseInt %) (s/split line #" "))
+      a (first line-parsed)
+      b (second line-parsed)
+      n (last line-parsed)
+      memo (atom {})]
+  (doseq [i (range n)]
+    (cond
+      (= i 0) (swap! memo assoc 0 a)
+      (= i 1) (swap! memo assoc 1 b)
+      :else (swap! memo assoc i
+                   (bigint (+
+                            (.pow (java.math.BigInteger. (str (@memo (dec i)))) 2)
+                            (@memo (dec (dec i))))))))
+  (println (str (@memo (dec n)))))