CMR-201: Added tests for collection search by spatial keywords.

error: pathspec 'test/cmr/system_int_test/search/collection_spatial_keyword_search_test.clj' did not match any file(s) known to git

--- test/cmr/system_int_test/search/collection_spatial_keyword_search_test.clj
+++ test/cmr/system_int_test/search/collection_spatial_keyword_search_test.clj
@@ -0,0 +1,62 @@
+(ns cmr.system-int-test.search.collection-spatial-keyword-search-test
+  "Integration test for CMR collection search by spatial keyword terms"
+  (:require [clojure.test :refer :all]
+            [cmr.system-int-test.utils.ingest-util :as ingest]
+            [cmr.system-int-test.utils.search-util :as search]
+            [cmr.system-int-test.utils.index-util :as index]
+            [cmr.system-int-test.data2.collection :as dc]
+            [cmr.system-int-test.data2.core :as d]))
+
+(use-fixtures :each (ingest/reset-fixture "CMR_PROV1" "CMR_PROV2"))
+
+(deftest search-by-spatial-keywords
+  (let [coll1 (d/ingest "CMR_PROV1" (dc/collection {}))
+        coll2 (d/ingest "CMR_PROV1" (dc/collection {:spatial-keywords []}))
+        coll3 (d/ingest "CMR_PROV1" (dc/collection {:spatial-keywords ["DC"]}))
+
+        coll4 (d/ingest "CMR_PROV2" (dc/collection {:spatial-keywords ["DC" "LA"]}))
+        coll5 (d/ingest "CMR_PROV2" (dc/collection {:spatial-keywords ["Detroit"]}))
+        coll6 (d/ingest "CMR_PROV2" (dc/collection {:spatial-keywords ["LL"]}))
+        coll7 (d/ingest "CMR_PROV2" (dc/collection {:spatial-keywords ["detroit"]}))]
+
+    (index/flush-elastic-index)
+
+    (testing "search by spatial keywords."
+      (are [spatial-keyword items] (d/refs-match? items (search/find-refs :collection {:spatial-keyword spatial-keyword}))
+           "DC" [coll3 coll4]
+           "LL" [coll6]
+           "LA" [coll4]
+           ["LL" "Detroit"] [coll5 coll6]
+           "BLAH" []))
+    (testing "search by spatial keywords using wildcard *."
+      (is (d/refs-match? [coll3 coll4 coll5]
+                         (search/find-refs :collection
+                                           {:spatial-keyword "D*"
+                                            "options[spatial-keyword][pattern]" "true"}))))
+    (testing "search by spatial keywords using wildcard ?."
+      (is (d/refs-match? [coll4 coll6]
+                         (search/find-refs :collection
+                                           {:spatial-keyword "L?"
+                                            "options[spatial-keyword][pattern]" "true"}))))
+    (testing "search by spatial keywords case not match."
+      (is (d/refs-match? [coll7]
+                         (search/find-refs :collection
+                                           {:spatial-keyword "detroit"}))))
+    (testing "search by spatial keywords ignore case false."
+      (is (d/refs-match? [coll7]
+                         (search/find-refs :collection
+                                           {:spatial-keyword "detroit"
+                                            "options[spatial-keyword][ignore-case]" "false"}))))
+    (testing "search by spatial keywords ignore case true."
+      (is (d/refs-match? [coll5 coll7]
+                         (search/find-refs :collection
+                                           {:spatial-keyword "detroit"
+                                            "options[spatial-keyword][ignore-case]" "true"}))))
+    (testing "search by spatial keywords, options :or."
+      (is (d/refs-match? [coll3 coll4]
+                         (search/find-refs :collection {"spatial-keyword[]" ["DC" "LA"]
+                                                        "options[spatial-keyword][or]" "true"}))))
+    (testing "search by spatial keywords, options :and."
+      (is (d/refs-match? [coll4]
+                         (search/find-refs :collection {"spatial-keyword[]" ["DC" "LA"]
+                                                        "options[spatial-keyword][and]" "true"}))))))


created a mongo group reduce command to count total distance and duration for a given condition

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

--- src/ontrail/queries.clj
+++ src/ontrail/queries.clj
@@ -0,0 +1,17 @@
+(ns ontrail.queries
+  (:use [monger.core :only [command]]
+        [monger.result :only [ok?]]
+        [monger.conversion :only [from-db-object]]))
+
+(use 'ontrail.mongodb)
+
+(def js-reduce "function(obj, prev) { prev.totaldistance += obj.distance; prev.totalduration += obj.duration }")
+
+;; Example of db.group -command
+;; db.exercise.group({cond: {user: "username"}, reduce: function(obj, prev) { prev.csum += obj.distance }, initial: {csum: 0 }});
+;; condition e.g. :user user
+(defn get-total-distance-and-time [condition]
+  (from-db-object (command {:group {:ns "exercise"
+                                    :cond condition
+                                    :$reduce js-reduce
+                                    :initial {:totaldistance 0 :totalduration 0}}}))


Symbolic differentiation

Symbolic differentiation

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

--- src/clj/algorithms_clj/derivative.clj
+++ src/clj/algorithms_clj/derivative.clj
@@ -0,0 +1,66 @@
+(ns algorithms-clj.derivative)
+
+
+
+;; ---------------------------------------------------------------
+
+(defn rotations
+  "Generates all the rotations of an input sequence"
+  [inputs]
+  (let [n (count inputs)
+        xf (comp (map #(take n %)) (take n))]
+    (eduction xf
+      (iterate #(drop 1 %) (concat inputs inputs)))
+    ))
+
+;; ---------------------------------------------------------------
+
+(defn prod?
+  [expr]
+  (or
+    (= (first expr) '*) ;; Works with simple quote
+    (= (first expr) `*) ;; Works with ` quote
+    ))
+
+(defn sum?
+  [expr]
+  (or
+    (= (first expr) '+) ;; Works with simple quote
+    (= (first expr) `+) ;; Works with ` quote
+    ))
+
+(declare derivative)
+
+(defn derivative-prod
+  [terms var]
+  (for [r (rotations terms)]
+    (list* '* (derivative (first r) var) (rest r))
+    ))
+
+(defn derivative
+  "Compute the partial derivative of the provided expression"
+  [expr var]
+  (cond
+    (number? expr) 0
+    (symbol? expr) (if (= expr var) 1 0)
+    (sum? expr) (list* '+ (map  #(derivative % var) (rest expr)))
+    (prod? expr) (list* '+ (derivative-prod (rest expr) var))
+    ))
+
+;; ---------------------------------------------------------------
+
+(def x 5)
+(def y 2)
+
+(defn tests
+  "Some basics tests (for the REPL)"
+  []
+  (prn (derivative 'x 'x))
+  (prn (derivative 'x 'y))
+  (prn (derivative `x `x))
+
+  (prn (derivative (list '+ 'x 1) 'x))
+  (prn (derivative `(+ x 1) `x))
+  (prn (derivative `(* x 2) `x))
+  )
+


use better mechanism for finding connect account id

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


Adapted play-clj's TextureRegion draw! method for use with all records (which aren't TextureRegion types)

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


test fix

test fix

--- test/metabase/api/common/internal_test.clj
+++ test/metabase/api/common/internal_test.clj
@@ -113,10 +113,10 @@

 ;; TESTS FOR LET-FORM-FOR-ARG

-(expect '[id (when id (Integer/parseInt id))]
+(expect '[id (clojure.core/when id (Integer/parseInt id))]
   (let-form-for-arg 'id))

-(expect '[org_id (when org_id (Integer/parseInt org_id))]
+(expect '[org_id (clojure.core/when org_id (Integer/parseInt org_id))]
   (let-form-for-arg 'org_id))

 (expect nil


Add some more false positives to test

Add some more false positives to test

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


Generator context and properties for laws

error: pathspec 'src/cats/labs/test.cljc' did not match any file(s) known to git

--- src/cats/labs/test.cljc
+++ src/cats/labs/test.cljc
@@ -0,0 +1,162 @@
+;; Copyright (c) 2015 Andrey Antukh <niwi@niwi.nz>
+;; Copyright (c) 2015 Alejandro Gómez <alejandro@dialelo.com>
+;; All rights reserved.
+;;
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions
+;; are met:
+;;
+;; 1. Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 2. Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;;
+;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+;; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+;; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+;; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(ns cats.labs.test
+  (:require [cats.context :as ctx :include-macros true]
+            [cats.core :as m]
+            [cats.protocols :as p]
+            [clojure.test.check.generators :as gen]
+            [clojure.test.check.properties :as prop]))
+
+;; Generator context
+
+(def gen-context
+  (reify
+     p/Context
+     (-get-level [_] ctx/+level-default+)
+
+     p/Functor
+     (-fmap [_ f mv]
+       (gen/fmap f mv))
+
+     p/Applicative
+     (-pure [_ v]
+       (gen/return v))
+     (-fapply [_ gf gv]
+       (m/mlet [f gf
+                v gv]
+         (m/return (f v))))
+
+     p/Monad
+     (-mreturn [_ v]
+       (gen/return v))
+
+     (-mbind [_ mv f]
+       (gen/bind mv f))))
+
+(extend-type clojure.test.check.generators.Generator
+  p/Contextual
+  (-get-context [_] gen-context))
+
+;; Semigroup
+
+(defn semigroup-associativity [{:keys [ctx gen]}]
+  (prop/for-all [x gen
+                 y gen
+                 z gen]
+    (ctx/with-context ctx
+      (= (m/mappend (m/mappend x y) z)
+         (m/mappend x (m/mappend y z))))))
+
+;; Monoid
+
+(defn monoid-identity-element [{:keys [ctx gen empty] :or {:empty (m/mempty ctx)}}]
+  (prop/for-all [x gen]
+      (= x
+         (m/mappend x empty)
+         (m/mappend empty x))))
+
+;; Functor laws
+
+(defn first-functor-law [{:keys [gen]}]
+  (prop/for-all [fa gen]
+    (= fa
+       (m/fmap identity fa))))
+
+(defn second-functor-law [{:keys [gen f g]}]
+  (prop/for-all [fa gen]
+    (= (m/fmap (comp g f) fa)
+       (m/fmap g (m/fmap f fa)))))
+
+;; Applicative laws
+
+(defn applicative-identity-law [{:keys [ctx gen]}]
+  (prop/for-all [app gen]
+    (= app
+       (m/fapply (m/pure ctx identity) app))))
+
+(defn applicative-homomorphism [{:keys [ctx gen f]}]
+  (prop/for-all [x gen]
+    (= (m/pure ctx (f x))
+       (m/fapply (m/pure ctx f) (m/pure ctx x)))))
+
+(defn applicative-interchange [{:keys [ctx gen appf]}]
+  (prop/for-all [x gen]
+    (= (m/fapply appf (m/pure ctx x))
+       (m/fapply (m/pure ctx (fn [f] (f x))) appf))))
+
+(defn applicative-composition [{:keys [ctx gen appf appg]}]
+  (prop/for-all [x gen]
+    (= (m/fapply appg
+                 (m/fapply appf (m/pure ctx x)))
+       (m/fapply (m/pure ctx (m/curry 2 comp))
+                 appf
+                 appg
+                 (m/pure ctx x)))))
+
+;; Monad laws
+
+(defn first-monad-law [{:keys [ctx mf]}]
+  (prop/for-all [a gen/any]
+    (= (mf a)
+       (m/>>= (m/return ctx a) mf))))
+
+(defn second-monad-law [{:keys [ctx]}]
+  (prop/for-all [a gen/any]
+    (let [m (m/return ctx a)]
+      (= m
+         (m/>>= m m/return)))))
+
+(defn third-monad-law [{:keys [ctx f g]}]
+  (prop/for-all [a gen/any]
+    (let [m (m/return ctx a)]
+      (= (m/>>= (m/>>= m f) g)
+         (m/>>= m (fn [x] (m/>>= (f x) g)))))))
+
+;; MonadPlus
+
+(defn monadplus-associativity [{:keys [ctx gen]}]
+  (prop/for-all [x gen
+                 y gen
+                 z gen]
+    (ctx/with-context ctx
+      (= (m/mplus (m/mplus x y) z)
+         (m/mplus x (m/mplus y z))))))
+
+;; MonadZero
+
+(defn monadzero-identity-element [{:keys [ctx gen]}]
+  (prop/for-all [x gen]
+    (ctx/with-context ctx
+      (= x
+         (m/mplus x (m/mzero ctx))
+         (m/mplus (m/mzero ctx) x)))))
+
+(defn monadzero-bind [{:keys [ctx gen]}]
+  (prop/for-all [m gen]
+    (ctx/with-context ctx
+      (= (m/mzero)
+         (m/>>= (m/mzero) (fn [v] (m/return v)))
+         (m/>> m (m/mzero))))))


Added tests for com.numergent.url-tools

Added tests for com.numergent.url-tools

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

--- test/com/numergent/url_tools_test.clj
+++ test/com/numergent/url_tools_test.clj
@@ -0,0 +1,26 @@
+(ns com.numergent.url-tools-test
+  (:require [clojure.test :refer :all]
+            [com.numergent.url-tools :refer :all]))
+
+(deftest if-empty-tests
+  (testing "Test cases for if-empty"
+    (is (= (if-empty nil "b")   "b"))
+    (is (= (if-empty "" "b")    "b"))
+    (is (= (if-empty "a" "b")   "a"))))
+
+
+(deftest if-nil-tests
+  (testing "Test cases for if-nil"
+    (is (= (if-nil nil "b")       "b"))
+    (is (= (if-nil {} {:a 1})     {}))
+    (is (= (if-nil {:a 2} {:a 1}) {:a 2}))
+    (is (= (if-nil nil {:a 1})    {:a 1}))))
+
+
+(deftest host-string-of-tests
+  (testing "Basic test cases for host-string-of"
+    (is (= (host-string-of "http://tvtropes.org")               "http://tvtropes.org/"))
+    (is (= (host-string-of "http://tvtropes.org/")              "http://tvtropes.org/"))
+    (is (= (host-string-of "http://tvtropes.org/somePath")      "http://tvtropes.org/"))
+    (is (= (host-string-of "http://tvtropes.org/somePath?q=1")  "http://tvtropes.org/"))
+    (is (= (host-string-of "https://tvtropes.org/somePath?q=1") "https://tvtropes.org/"))))


Don't put a function on the queue -- put the event.

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


Ugh, back to println

Ugh, back to println

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


cleanup and update

cleanup and update

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


Add net imports diagram

Add net imports diagram

error: pathspec 'src/clj_simple_chart/bp/diagrams/oil_net_imports.clj' did not match any file(s) known to git

--- src/clj_simple_chart/bp/diagrams/oil_net_imports.clj
+++ src/clj_simple_chart/bp/diagrams/oil_net_imports.clj
@@ -0,0 +1,114 @@
+(ns clj-simple-chart.bp.diagrams.oil-net-imports
+  (:require [clj-simple-chart.bp.bpdata2 :as bpdata]
+            [clj-simple-chart.core :refer :all]
+            [clj-simple-chart.opentype :as opentype]
+            [clj-simple-chart.translate :refer :all]
+            [clj-simple-chart.csv.csvmap :as csv]
+            [clj-simple-chart.axis.core :as axis]
+            [clj-simple-chart.rect :as rect]
+            [clj-simple-chart.chart :as chart]
+            [clj-simple-chart.bp.units :as units]
+            [clj-simple-chart.colors :as colors]
+            [clojure.test :as test])
+  (:import (java.time Year)))
+
+(def num-days (.length (Year/of bpdata/max-year)))
+
+(def missing-oil-consumption (->> bpdata/most-recent-data-countries
+                                  (remove :oil_consumption_kbd)))
+
+(def data (->> bpdata/most-recent-data-countries
+               (filter :oil_consumption_kbd)
+               (filter :population)
+               (mapv #(update % :oil_production_kbd (fn [o] (or o 0))))
+               (csv/keep-columns [:population :oil_consumption_kbd :oil_production_kbd :country :country_code])
+               (mapv #(assoc % :total ( / (- (:oil_consumption_kbd %) (:oil_production_kbd %))
+                                          1000.0)))
+               (csv/drop-columns [:oil_consumption_kbd :oil_production_kbd])
+               (sort-by :total)
+               (take-last 20)))
+
+(def marg 10)
+(def two-marg (* 2 marg))
+
+; https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
+; iPhone 4, 4s
+(def svg-width 320)
+(def svg-height 480)
+
+(def available-width (- svg-width two-marg))
+
+(def domain (mapv :country data))
+
+(def header (opentype/stack
+              {}
+              [{:text (str "Biggest " (count data) " Net Oil Importers*") :font "Roboto Black" :font-size 20}
+               {:text "Million Barrels Per Day" :font "Roboto Regular" :font-size 14 :margin-bottom 0}]))
+
+(def footer (opentype/stack
+              {:width available-width}
+              [{:margin-top 10 :text "*Consumption - production. See BP for details." :font "Roboto Regular" :font-size 14}
+               ;{:margin-top 2 :text "of coal and natural gas." :font "Roboto Regular" :font-size 14}
+               {:margin-top 2
+                :text       "Sources: BP (2017)." :font "Roboto Regular" :font-size 14}
+               {:valign :bottom :align :right :text "© refsdal.ivar@gmail.com" :font "Roboto Regular" :font-size 14}
+               ]))
+
+(def available-height (- svg-height (+ two-marg
+                                       (:height (meta header))
+                                       (:height (meta footer)))))
+
+(def xx {:type        :linear
+         :axis        :x
+         :orientation :top
+         :ticks       5
+         :domain      [0 10]})
+
+(def yy {:type          :ordinal
+         :axis          :y
+         :domain        domain
+         :orientation   :left
+         :round         true
+         :padding-inner 0.4
+         :padding-outer 0.3})
+
+(def c (chart/chart {:width  available-width
+                     :height available-height
+                     :x      xx
+                     :y      yy}))
+(def x (:x c))
+(def y (:y c))
+
+(def rect (rect/scaled-rect x y))
+
+(defn make-rect [{country :country
+                  coal    :coal
+                  total   :total
+                  :as     item}]
+  {:p country :h total :fill colors/green})
+
+(defn total-text [{country :country
+                   total   :total}]
+  (opentype/text {:x  (point x total)
+                  :dx ".20em"
+                  :y  (center-point y country)
+                  :dy ".32em"}
+                 (format "%.2f" total)))
+
+(defn diagram []
+  [:svg {:xmlns "http://www.w3.org/2000/svg" :width svg-width :height svg-height}
+   [:g {:transform (translate marg marg)}
+    header
+    [:g {:transform (translate (:margin-left c) (+ (:height (meta header)) (:margin-top c)))}
+     (rect (mapv make-rect data))
+     (map total-text data)
+     (axis/render-axis y)
+     (axis/render-axis x)
+     #_[:g {:transform (translate-y (- (:plot-height c) (:height (meta legend))))}
+        #_legend]]
+    [:g {:transform (translate-y (+ (:height (meta header)) available-height))} footer]
+    ]])
+
+(defn render-self []
+  (render "./img/bp-svg/oil-net-imports.svg"
+          "./img/bp-png/oil-net-imports.png" (diagram)))


more tests

more tests

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


Add variable sized display sketch.

Add variable sized display sketch.

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

--- src/videotest/opti_flow_vari_cam.clj
+++ src/videotest/opti_flow_vari_cam.clj
@@ -0,0 +1,213 @@
+(ns videotest.opti-flow-vari-cam
+  (:require
+   [quil.core :as q]
+   [quil.middleware :as m]
+   [clojure.set :as cset])
+  (:import
+   [org.opencv.highgui Highgui VideoCapture]
+   [org.opencv.core CvType Mat MatOfByte MatOfFloat MatOfPoint MatOfPoint2f Size TermCriteria]
+   [org.opencv.imgproc Imgproc]
+   [org.opencv.video Video]
+   [java.nio ByteBuffer ByteOrder]))
+
+(def MAX-CORNERS 800)
+(def BLANK-MASK (Mat.))
+(def WIN-SIZE-W 10)
+(def WIN-SIZE (Size. WIN-SIZE-W WIN-SIZE-W))
+(def NEG-ONE-SIZE (Size. -1 -1))
+(def TERM-CRITERIA (TermCriteria. (+ TermCriteria/EPS TermCriteria/COUNT) 20 0.03))
+
+(def RESET-FRAMES 4)
+(def PT-D 10)
+
+
+;; OpenCV Implementation Wrapper - Will move to separate NS.
+(defn camera [dev]
+  (VideoCapture. dev))
+
+(defn is-opened? [cam]
+  (.isOpened cam))
+
+(defn grab-frame!
+  "Updates a CV Mat with image from camera."
+  [cam frame]
+  (.read cam frame)
+  frame)
+
+;; <--End OpenCV Implementation Wrapper
+
+
+(defn camera-frame-size []
+  (let [cam (camera 0)
+        s (-> (grab-frame! cam (Mat.))
+              (.size))]
+    (.release cam)
+    {:width (.width s) :height (.height s)}))
+
+(def CAM-SIZE (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))
+
+
+;; 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)
+   :old-gray-mat nil
+   :old-corners nil
+   :new-gray-mat (Mat.)
+   :new-corners (MatOfPoint2f.)
+   :lk-status (MatOfByte.)
+   :lk-err (MatOfFloat.)
+   :camera (camera 0)
+   :p-image (q/create-image WIDTH HEIGHT :rgb)})
+
+(defn update-frame [state]
+  (let [{:keys [camera]} state]
+    (cond-> state
+            (is-opened? camera)
+            (update-in [:frame-mat] (partial grab-frame! camera) ))))
+
+(defn mat->p-img [in-mat out-mat b-array i-array p-img]
+  (Imgproc/cvtColor in-mat out-mat Imgproc/COLOR_RGB2RGBA 4)
+  (.get out-mat 0 0 b-array)
+  (-> (ByteBuffer/wrap b-array)
+      (.order ByteOrder/LITTLE_ENDIAN)
+      (.asIntBuffer)
+      (.get i-array))
+  (.loadPixels p-img)
+  (set! (.pixels p-img) (aclone i-array))
+  (.updatePixels p-img)
+  p-img)
+
+(defn update-p-image [state]
+  (let [{:keys [frame-mat output-mat b-array i-array]} state]
+    (update-in state [:p-image] #(mat->p-img frame-mat output-mat b-array i-array %))))
+
+(defn BGR->GrayMat! [m gray-mat]
+  (Imgproc/cvtColor m gray-mat Imgproc/COLOR_BGR2GRAY)
+  gray-mat)
+
+(defn update-corners!
+  ([gray-mat]
+     (let [corners (MatOfPoint2f.)]
+       (update-corners! gray-mat corners)))
+  ([gray-mat corners]
+     (let [max-corners MAX-CORNERS
+           quality-level 0.01
+           min-dist 5.0
+           mask BLANK-MASK
+           block-size 3
+           use-harris-detector false
+           k 0.04
+           pts (MatOfPoint.)]
+       (Imgproc/goodFeaturesToTrack gray-mat pts max-corners quality-level min-dist mask block-size use-harris-detector k)
+       (.convertTo pts corners CvType/CV_32FC2)
+       #_(Imgproc/cornerSubPix gray-mat corners WIN-SIZE NEG-ONE-SIZE TERM-CRITERIA)
+       corners)))
+
+(defn valid-pts [pts pt-status]
+  (let [p-s (filter (fn [[_ s]] (= 1 s))
+                    (map vector pts pt-status))]
+    (doall
+     (map (fn [[p _]] p) p-s))))
+
+(defn refresh-corners! [gray-mat lk-status remaining-corners old-corners]
+  (let [valid-remaining (valid-pts (.toList remaining-corners)
+                                   (.toList lk-status))
+        new-corners (.toList (update-corners! gray-mat))
+        union (vec
+               (cset/union (set valid-remaining) (set new-corners)))]
+    (.fromList old-corners (take MAX-CORNERS union))))
+
+(defn init-gray-mat [{:keys [frame-mat old-gray-mat] :as state}]
+  (if (nil? old-gray-mat)
+    (let [old-gray-mat (BGR->GrayMat! frame-mat (Mat.))]
+      (-> state
+          (assoc-in [:old-gray-mat] old-gray-mat)
+          (assoc-in [:old-corners] (update-corners! old-gray-mat (MatOfPoint2f.)))))
+    (let [{:keys [old-gray-mat old-corners new-gray-mat new-corners lk-status]} state]
+      (.copyTo new-gray-mat old-gray-mat)
+      (if (= 0 (mod (q/frame-count) RESET-FRAMES))
+        (do
+          ;; Reuse existing valid corners (still detected):
+          (refresh-corners! new-gray-mat lk-status new-corners old-corners)
+
+          ;; Brute-Force reset of corners:
+          #_(update-corners! new-gray-mat old-corners))
+        (do
+          (.copyTo new-corners old-corners)))
+      state)))
+
+(defn update-optical-flow [state]
+  (let [{:keys [frame-mat new-gray-mat new-corners old-gray-mat old-corners lk-status lk-err]} state]
+    (BGR->GrayMat! frame-mat new-gray-mat)
+    (update-corners! new-gray-mat new-corners)
+    (let [max-level 5
+          flags 0
+          min-eig-threshold 0.001]
+      (Video/calcOpticalFlowPyrLK old-gray-mat new-gray-mat old-corners new-corners lk-status lk-err
+                                  WIN-SIZE max-level TERM-CRITERIA flags min-eig-threshold))
+    (-> state
+        (assoc-in [:lk-status] lk-status)
+        (assoc-in [:lk-err] lk-err))))
+
+(defn update [state]
+  (-> state
+      (update-frame)
+      #_(update-p-image)
+      (init-gray-mat)
+      (update-optical-flow)))
+
+(defn draw-pt
+  ([pt rgba]
+    (let [x (.x pt)
+          y (.y pt)]
+       (q/push-style)
+       (q/no-stroke)
+       (apply q/fill rgba)
+       (q/ellipse x y PT-D PT-D)
+       (q/pop-style)) )
+  ([pt]
+     (draw-pt pt [0 255 0 80])))
+
+(defn draw-flow [{:keys [new-corners old-corners lk-status] :as state}]
+  (let [pts (.toList new-corners)
+        old-pts (.toList old-corners)]
+    (when (< 0 (count old-pts))
+      (dorun
+       (map #(draw-pt % [0 0 255 60]) old-pts)))
+    (when (< 0 (count pts))
+      (let [v-pts (valid-pts pts (.toList lk-status))]
+        (dorun
+         (map draw-pt v-pts))))))
+
+(defn draw [state]
+  (let [{:keys [p-image]} state]
+    (q/background 0)
+    #_(q/image p-image 0 0)
+    (draw-flow state)))
+
+(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])


finish perspective-matrix example

finish perspective-matrix example

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


update

update

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


better parameter naming

better parameter naming

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


TODO: multipart tests

TODO: multipart tests

error: pathspec 'test/clj/reitit/ring/middleware/multipart_test.clj' did not match any file(s) known to git

--- test/clj/reitit/ring/middleware/multipart_test.clj
+++ test/clj/reitit/ring/middleware/multipart_test.clj
@@ -0,0 +1,3 @@
+(ns reitit.ring.middleware.multipart-test)
+
+;; TODO


Stub for tests for the config module

Stub for tests for the config module

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

--- test/emender_service/config_test.clj
+++ test/emender_service/config_test.clj
@@ -0,0 +1,7 @@
+(ns emender-service.config-test
+  (:require [clojure.test :refer :all]
+            [emender-service.config :refer :all]))
+
+(deftest a-test
+  (testing "FIXME, I fail."
+    (is (= 0 1))))


The sample puzzle if solved

The sample puzzle if solved

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

--- src/adventofcode1/eighteen.clj
+++ src/adventofcode1/eighteen.clj
@@ -0,0 +1,65 @@
+(ns adventofcode1.eighteen
+  "http://adventofcode.com/2016/day/4"
+  (:require
+   [clojure.spec :as s]
+   [clojure.spec.gen :as gen]
+   [clojure.spec.test :as stest]
+   [com.gfredericks.test.chuck.generators :as gen']
+   [clojure.test.check :as tc]
+   [clojure.test.check.generators :as tcgen]
+   [clojure.test.check.properties :as tcprop]
+
+   [clojure.core.match :refer [match]]
+
+   spyscope.core
+   adventofcode1.spec-test-instrument-debug))
+
+
+(s/def ::cell #{\^ \.})
+(s/def ::parents (s/coll-of ::cell :count 3))
+(s/def ::row (s/coll-of ::cell))
+
+(s/fdef next-char
+  :args (s/cat :parents ::parents)
+  :ret  ::cell)
+
+(defn next-char
+  [parents]
+  (cond
+    (= parents [\^ \^ \.]) \^
+    (= parents [\. \^ \^]) \^
+    (= parents [\^ \. \.]) \^
+    (= parents [\. \. \^]) \^
+    :else \.))
+
+(s/fdef next-row-1
+        :args (s/cat :row ::row)
+        :ret ::row)
+
+
+(defn next-row-1
+  [row]
+  (if (< (count row) 3) []
+      (concat [(next-char (take 3 row))]
+              (next-row-1 (rest row)))))
+
+(s/fdef next-row
+        :args (s/cat :row ::row)
+        :ret ::row)
+
+(defn next-row
+  [row]
+  (->> (concat [\.] row [\.])
+       next-row-1))
+
+(defn main
+  ([s](main 10 (seq s)))
+  ([n row]
+   (println (clojure.string/join row))
+   (if (< n 2) (clojure.string/join row)
+       (let [res (next-row row)]
+         (recur (dec n) res)))))
+
+
+
+(clojure.spec.test/instrument)


CMR-7048 fixed formatting problems

CMR-7048 fixed formatting problems

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

--- metadata-db-app/src/cmr/metadata_db/migrations/077_remove_subscriptions_email_column.clj
+++ metadata-db-app/src/cmr/metadata_db/migrations/077_remove_subscriptions_email_column.clj
@@ -0,0 +1,15 @@
+(ns cmr.metadata-db.migrations.077-remove-subscriptions-email-column
+  (:require
+   [config.mdb-migrate-helper :as h]))
+
+(defn up
+  "Migrates the database up to version 77"
+  []
+  (println "cmr.metadata-db.migrations.077-remove-subscriptions-email-column up...")
+  (h/sql "alter table METADATA_DB.cmr_subscriptions drop column EMAIL_ADDRESS"))
+
+(defn down
+  "Migrates the database down from version 77."
+  []
+  (println "cmr.metadata-db.migrations.077-remove-subscriptions-email-column down...")
+  (h/sql "alter table METADATA_DB.cmr_subscriptions add EMAIL_ADDRESS VARCHAR(255) NOT NULL"))


use (update-in) to make (query-with-inside-filter) more concise and readable.

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


Added mirror image problem

Added mirror image problem

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

--- src/clojush/problems/software/mirror_image.clj
+++ src/clojush/problems/software/mirror_image.clj
@@ -0,0 +1,185 @@
+;; mirror_image.clj
+;; Tom Helmuth, thelmuth@cs.umass.edu
+;;
+;; Problem Source: iJava (http://ijava.cs.umass.edu/)
+;;
+;; Given two lists of integers of the same length <= 50, return true if one
+;; list is the reverse of the other, and false otherwise.
+;;
+;; input stack has 2 input vectors of integers
+
+(ns clojush.problems.software.mirror-image
+  (:use clojush.pushgp.pushgp
+        [clojush pushstate interpreter random util globals]
+        clojush.instructions.tag
+        [clojure.math numeric-tower combinatorics]
+        ))
+
+; Atom generators
+(def mirror-image-atom-generators
+  (concat (list
+            (fn [] (lrand-nth (list true false))) ;Boolean
+            ;;; end ERCs
+            (tag-instruction-erc [:integer :boolean :vector_integer :exec] 1000)
+            (tagged-instruction-erc 1000)
+            ;;; end tag ERCs
+            'in1
+            'in2
+            ;;; end input instructions
+            )
+          (registered-for-stacks [:integer :boolean :vector_integer :exec])))
+
+
+;; Define test cases
+(defn mirror-image-input
+  "Makes a Mirror Image input vector of length len."
+  [len]
+  (vec (repeatedly len
+                   #(- (lrand-int 2001) 1000))))
+
+(defn change-a-few-elements
+  "Takes a vector and changes from 1 to 5 elements in the vector."
+  ([in-vec]
+    (change-a-few-elements in-vec (inc (lrand-int 5))))
+  ([in-vec num-to-change]
+    (if (>= 0 num-to-change)
+      in-vec
+      (change-a-few-elements (assoc in-vec (lrand-int (count in-vec)) (- (lrand-int 2001) 1000))
+                             (dec num-to-change)))))
+
+;; A list of data domains for the problem. 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 mirror-image-data-domains
+  [[(list [[] []]) 1 0] ;; Empty vectors
+   [(list [[1] [1]]
+          [[1] [0]]
+          [[0] [1]]
+          [[16] [-44]]
+          [[-12] [-13]]) 5 0] ;; Length 1 vectors
+   [(list [[1 2] [2 1]]
+          [[1 1] [0 1]]
+          [[7 0] [0 7]]
+          [[5 8] [5 8]]
+          [[34 12] [34 12]]
+          [[456 456] [456 456]]
+          [[-431 -680] [40 831]]) 7 0] ;; Length 2 vectors
+   [(list [[1 2 1] [1 2 1]]
+          [[1 2 3 4 5 4 3 2 1] [1 2 3 4 5 4 3 2 1]]
+          [[45 99 0 12 44 7 7 44 12 0 99 45] [45 99 0 12 44 7 7 44 12 0 99 45]]
+          [(vec (concat (reverse (range 25)) (range 25))) (vec (concat (reverse (range 25)) (range 25)))]) 4 0] ;; Equal Palindromes
+   [(map #(vector [33 45 -941] (vec %))
+         (permutations [33 45 -941])) 6 0] ;; Permutations of a 3 item vector
+   [(fn [] (let [inA (mirror-image-input (inc (lrand-int 50)))]
+             (vector inA (vec (reverse inA))))) 38 500] ;; true cases
+   [(fn [] (let [inA (mirror-image-input (inc (lrand-int 50)))]
+             (vector inA inA))) 10 100] ;; equal vector cases
+   [(fn [] (let [inA (mirror-image-input (inc (lrand-int 50)))]
+             (vector inA (change-a-few-elements (vec (reverse inA)))))) 20 200] ;; close calls cases (change a few elements at most)
+   [(fn [] (let [inA (mirror-image-input (inc (lrand-int 50)))]
+             (vector inA (mirror-image-input (count inA))))) 10 200] ;; totally random cases
+   ])
+
+;;Can make Mirror Image test data like this:
+;(test-and-train-data-from-domains mirror-image-data-domains)
+
+; Helper function for error function
+(defn mirror-image-test-cases
+  "Takes a sequence of inputs and gives IO test cases of the form
+   [input output]."
+  [inputs]
+  (map #(vector %
+                (= (first %) (vec (reverse (second %)))))
+       inputs))
+
+; Define error function. For now, each run uses different random inputs
+(defn mirror-image-error-function
+  "Returns the error function for the mirror-image problem. Takes as
+   input Mirror Image data domains."
+  [data-domains]
+  (let [[train-cases test-cases] (map mirror-image-test-cases
+                                      (test-and-train-data-from-domains data-domains))]
+    (when true ;; Change to false to not print test cases
+      (doseq [[i case] (map vector (range) train-cases)]
+        (println (format "Train Case: %3d | Input/Output: %s" i (str case))))
+      (doseq [[i case] (map vector (range) test-cases)]
+        (println (format "Test Case: %3d | Input/Output: %s" i (str case)))))
+    (fn the-actual-mirror-image-error-function
+      ([program]
+        (the-actual-mirror-image-error-function program :train))
+      ([program data-cases] ;; data-cases should be :train or :test
+        (the-actual-mirror-image-error-function program data-cases false))
+      ([program data-cases print-outputs]
+        (let [behavior (atom '())
+              errors (doall
+                       (for [[[input1 input2] correct-output] (case data-cases
+                                                                           :train train-cases
+                                                                           :test test-cases
+                                                                           [])]
+                         (let [final-state (run-push program
+                                                     (->> (make-push-state)
+                                                       (push-item input2 :input)
+                                                       (push-item input1 :input)))
+                               result (top-item :boolean final-state)]
+                           (when print-outputs
+                             (println (format "Correct output: %5b | Program output: %5b" correct-output result)))
+                           ; Record the behavior
+                           (when @global-print-behavioral-diversity
+                             (swap! behavior conj result))
+                           ; Error is boolean error
+                           (if (= result correct-output)
+                             0
+                             1))))]
+          (when @global-print-behavioral-diversity
+            (swap! population-behaviors conj @behavior))
+          errors)))))
+
+(defn mirror-image-report
+  "Custom generational report."
+  [best population generation error-function report-simplifications]
+  (let [best-program (not-lazy (:program best))
+        best-test-errors (error-function best-program :test)
+        best-total-test-error (apply +' best-test-errors)]
+    (println ";;******************************")
+    (printf ";; -*- Mirror Image 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: %d" i error))))
+    (println ";;------------------------------")
+    (println "Outputs of best individual on training cases:")
+    (error-function best-program :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 (mirror-image-error-function mirror-image-data-domains)
+   :atom-generators mirror-image-atom-generators
+   :max-points 300
+   :max-points-in-initial-program 150
+   :evalpush-limit 600
+   :population-size 1000
+   :max-generations 300
+   :parent-selection :lexicase
+   :genetic-operator-probabilities {:alternation 0.2
+                                    :uniform-mutation 0.2
+                                    :uniform-close-mutation 0.1
+                                    [:alternation :uniform-mutation] 0.5
+                                    }
+   :alternation-rate 0.01
+   :alignment-deviation 10
+   :uniform-mutation-rate 0.01
+   :problem-specific-report mirror-image-report
+   :print-behavioral-diversity true
+   :report-simplifications 0
+   :final-report-simplifications 5000
+   })


Added clojure file for functions related to examples.

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

--- src/clj_formal_specifications_app/examples.clj
+++ src/clj_formal_specifications_app/examples.clj
@@ -0,0 +1 @@
+(ns clj-formal-specifications-app.examples)


Add main file for listener to track slack-rtm events

error: pathspec 'src/in/co/sdslabs/slack_lens/listener/main.clj' did not match any file(s) known to git

--- src/in/co/sdslabs/slack_lens/listener/main.clj
+++ src/in/co/sdslabs/slack_lens/listener/main.clj
@@ -0,0 +1,11 @@
+(ns in.co.sdslabs.slack-lens.listener.main
+  (:require [in.co.sdslabs.slack-lens.lib.slack-rtm :as rtm]))
+
+(defn- message-handler
+  [& [args]]
+  (println args))
+
+(defn start
+  [options]
+  (let [rtm-conn (rtm/connect (:url options) (:token options))]
+    rtm-conn))


[Fix #15] Test examples as part of CI.

[Fix #15] Test examples as part of CI.

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

--- test/caesium/examples_test.clj
+++ test/caesium/examples_test.clj
@@ -0,0 +1,10 @@
+(ns caesium.examples-test
+  (:require  [clojure.test :refer [deftest]]
+             [clojure.java.io :as io]))
+
+(deftest examples-test
+  (let [examples (->> (io/file "examples")
+                      (file-seq)
+                      (filter #(.isFile %)))]
+    (doseq [example examples]
+      (load-file (.getAbsolutePath example)))))


keyboard

keyboard

error: pathspec 'src/cljx/jamesmacaulay/zelkova/keyboard.cljx' did not match any file(s) known to git

--- src/cljx/jamesmacaulay/zelkova/keyboard.cljx
+++ src/cljx/jamesmacaulay/zelkova/keyboard.cljx
@@ -0,0 +1,114 @@
+#+clj
+(ns jamesmacaulay.zelkova.keyboard
+  (:refer-clojure :exclude [meta])
+  (:require [jamesmacaulay.zelkova.signal :as z]
+            [clojure.core.async :as async]))
+
+#+cljs
+(ns jamesmacaulay.zelkova.keyboard
+  (:refer-clojure :exclude [meta])
+  (:require [jamesmacaulay.zelkova.signal :as z]
+            [goog.events :as events]
+            [cljs.core.async :as async :refer [>! <!]])
+  (:require-macros [cljs.core.async.macros :refer [go go-loop]]))
+
+#+cljs
+(defn- listen
+  [el type & args]
+  (let [out (apply async/chan 1 args)]
+    (events/listen el type (fn [e] (async/put! out e)))
+    out))
+
+(defn keydown-channel
+  [graph opts]
+  #+cljs
+  (listen js/document "keydown")
+  #+clj
+  (async/chan))
+
+(defn keyup-channel
+  [graph opts]
+  #+cljs
+  (listen js/document "keyup")
+  #+clj
+  (async/chan))
+
+(defn blur-channel
+  [graph opts]
+  #+cljs
+  (listen js/window "blur")
+  #+clj
+  (async/chan))
+
+(def down-events
+  (z/input 0 ::down-events keydown-channel))
+
+(def up-events
+  (z/input 0 ::up-events keyup-channel))
+
+(def blur-events
+  (z/input 0 ::blur-events blur-channel))
+
+(def ^:private empty-state {:alt-key false :meta-key false :key-codes #{}})
+
+(defmulti event-action (fn [state event] (.-type event)))
+
+(defmethod event-action "keydown"
+  [state event]
+  (-> state
+      (update-in [:key-codes] conj (.-keyCode event))
+      (assoc :alt (.-altKey event)
+             :meta (.-metaKey event))))
+
+(defmethod event-action "keyup"
+  [state event]
+  (-> state
+      (update-in [:key-codes] disj (.-keyCode event))
+      (assoc :alt (.-altKey event)
+             :meta (.-metaKey event))))
+
+(defmethod event-action "blur"
+  [state event]
+  empty-state)
+
+(def ^:private key-merge
+  (->> (z/merge down-events up-events blur-events)
+       (z/reducep event-action empty-state)))
+
+(defn- key-signal
+  [f]
+  (z/drop-repeats (z/lift f key-merge)))
+
+(def keys-down (key-signal :key-codes))
+
+(defn directions
+  [up down left right]
+  (key-signal (fn [{:keys [key-codes]}]
+                {:x (+ (if (key-codes right) 1 0)
+                       (if (key-codes left) -1 0))
+                 :y (+ (if (key-codes up) 1 0)
+                       (if (key-codes down) -1 0))})))
+
+(def arrows (directions 38 40 37 39))
+
+(def wasd (directions 87 83 65 68))
+
+(defn down?
+  [code]
+  (key-signal (fn [{:keys [key-codes]}]
+                (boolean (key-codes code)))))
+
+(def alt (key-signal :alt))
+
+(def meta (key-signal :meta))
+
+(def ctrl (down? 17))
+
+(def shift (down? 16))
+
+(def space (down? 32))
+
+(def enter (down? 13))
+
+(def last-pressed
+  (z/lift #(.-keyCode %) down-events))


Typo fix

Typo fix

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


added sighting ES Store

added sighting ES Store

error: pathspec 'src/cia/stores/es/sighting.clj' did not match any file(s) known to git

--- src/cia/stores/es/sighting.clj
+++ src/cia/stores/es/sighting.clj
@@ -0,0 +1,57 @@
+(ns cia.stores.es.sighting
+  (:import java.util.UUID)
+  (:require
+   [schema.core :as s]
+   [clj-time.core :as t]
+   [cia.schemas.sighting :refer [Sighting
+                                 NewSighting
+                                 realize-sighting]]
+   [cia.schemas.indicator :refer [Indicator]]
+   [cia.stores.es.document :refer [create-doc
+                                   update-doc
+                                   get-doc
+                                   delete-doc
+                                   search-docs
+                                   raw-search-docs]]))
+
+(def ^{:private true} mapping "sighting")
+
+(defn- make-id [schema j]
+  (str "sighting" "-" (UUID/randomUUID)))
+
+(defn handle-create-sighting [state login new-sighting]
+  (let [id (make-id Sighting new-sighting)
+        realized (realize-sighting new-sighting id login)]
+
+    (create-doc (:conn state)
+                (:index state)
+                mapping
+                realized)))
+
+(defn handle-update-sighting [state login id new-sighting]
+  (update-doc (:conn state)
+              (:index state)
+              mapping
+              id
+              new-sighting))
+
+(defn handle-read-sighting [state id]
+  (get-doc (:conn state)
+           (:index state)
+           mapping
+           id))
+
+(defn handle-delete-sighting [state id]
+  (delete-doc (:conn state)
+              (:index state)
+              mapping
+              id))
+
+(defn handle-list-sightings [state filter-map]
+  (search-docs (:conn state)
+               (:index state)
+               mapping
+               filter-map))
+
+(defn handle-list-sightings-by-indicators [state indicators]
+  (println indicators))


CMR-563: Added mime type helper functions.

error: pathspec 'src/cmr/common/mime_types.clj' did not match any file(s) known to git

--- src/cmr/common/mime_types.clj
+++ src/cmr/common/mime_types.clj
@@ -0,0 +1,48 @@
+(ns cmr.common.mime-types
+  "Provides functions for handling mime types."
+  (:require [pantomime.media :as mt]
+            [cmr.common.services.errors :as errors]))
+
+(def default-result-format :json)
+
+(def base-mime-type-to-format
+  "A map of base mime types to the format symbols supported"
+  {"*/*" default-result-format
+   "application/json" :json
+   "application/xml" :xml
+   "application/echo10+xml" :echo10
+   "application/iso_prototype+xml" :iso-prototype
+   "application/iso:smap+xml" :iso-smap
+   "application/iso19115+xml" :iso19115
+   "application/dif+xml" :dif})
+
+(def format->mime-type
+  {:json "application/json"
+   :xml "application/xml"
+   :echo10 "application/echo10+xml"
+   :iso-prototype "application/iso_prototype+xml"
+   :iso-smap "application/iso:smap+xml"
+   :iso19115 "application/iso19115+xml"
+   :dif "application/dif+xml"})
+
+(defn mime-type->format
+  "Converts a mime-type into the format requested."
+  [mime-type]
+  (if mime-type
+    (get base-mime-type-to-format
+         (str (mt/base-type (mt/parse mime-type))))
+    default-result-format))
+
+(defn validate-request-mime-type
+  "Validates the requested mime type is supported."
+  [mime-type supported-types]
+  (when-not (get supported-types mime-type)
+    (errors/throw-service-error
+      :bad-request (format "The mime type [%s] is not supported." mime-type))))
+
+(defn get-request-format
+  "Returns the requested format parsed from headers"
+  [headers supported-types]
+  (let [mime-type (get headers "accept")]
+    (validate-request-mime-type mime-type supported-types)
+    (mime-type->format mime-type)))


added higher-order fns

added higher-order fns

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

--- src/higher_order_functions.clj
+++ src/higher_order_functions.clj
@@ -0,0 +1,101 @@
+(ns higher-order-functions
+  (require [clojure.pprint :refer [pprint]]))
+
+;;;;;;;;;;;;;;;
+;; basic
+
+(defn present [gift]
+  (fn [] gift))
+
+(def green-box (present "clockwork beetle"))
+(def red-box (present "plush tiger"))
+
+(comment "repl"
+         (red-box))
+
+;;;;;;;;;
+;; map
+
+(map inc [1 2 3 4 5])
+
+;; map can be used with multiple collections that're passed to the mapping fn in parallel:
+(map + [1 2 3] [4 5 6])
+
+;; When map is passed more than one collection, the mapping function will
+;; be applied until one of the collections runs out:
+(map + [1 2 3] (iterate inc 1))
+
+;; map is often used with closures
+(map #(str "Hello " % "!" ) ["Ford" "Jose" "Patel"])
+
+;; Pull "columns" out of a collection of collections.
+(map vector [:a :b :c] {:one 1 :two 2 :three 3} [:g :h :i])
+(apply map vector [[:a :b :c]
+                   {:one 1 :two 2 :three 3}
+                   [:g :h :i]])
+
+(map #(vector (first %) (* 2 (second %)))
+     {:a 1 :b 2 :c 3})
+
+;; applies fn (list) to first element of each collection as (fn 1 a 10)
+;; applies fn to second ...
+;; ignores unmatched columns
+
+(map list [1 2 3] '(a b c) [10 6])
+
+(def d1 [:a :b :c])
+(#(map list % (range)) d1)
+
+;; Q: return a collection with the max within each collection
+;; [[1 2 3][4 5 6][7 8 9]]
+
+;; You can use map and apply together to drill one level deep in a collection of
+;; colls, in this case returning a collection of the max of each nested coll
+
+(map #(apply max %)
+     [[1 2 3][4 5 6][7 8 9]])
+
+;;;;;;;;;
+;; filter
+
+(filter even? (range 10))
+
+(filter #(= (count %) 1)
+        ["a" "aa" "b" "n" "f" "lisp" "clojure" "q" ""])
+
+;; When coll is a map, pred is called with key/value pairs.
+(filter #(> (second %) 100)
+        {:a 1
+         :b 2
+         :c 101
+         :d 102
+         :e -1})
+
+;;(into {} *1)
+
+(filter #(if (odd? %) %) (range 10))
+
+;; Use a hash-map as a function to translate values in a collection from the
+;; given key to the associated value; then use (filter identity... to remove the nils
+(filter not-empty (map {2 "two" 3 "three"} [1 2 3 4 5]))
+
+
+;;;;;;;;;;
+;; reduce
+
+(reduce + [1 2 3 4 5])
+
+;; converting a vector to a set
+(reduce conj #{} [:a :b :c])
+
+;; word frequency
+(def text
+  "Clojure is a concise, powerful, and performant general-purpose programming
+  language that runs on the JVM, CLR, Node.js, and modern mobile and desktop web
+  browsers. It's based on Lisp, the most powerful programming language in the
+  world.")
+
+(defn word-frequency [s]
+  (reduce #(assoc %1 %2 (inc (%1 %2 0)))
+          {}
+          (re-seq #"\w+" s)))


Added clojush.problems.boolean.rule30-dynamic.

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

--- src/clojush/problems/boolean/rule30_dynamic.clj
+++ src/clojush/problems/boolean/rule30_dynamic.clj
@@ -0,0 +1,123 @@
+;; rule30_dynamic.clj
+;; Lee Spector, lspector@hampshire.edu
+;;
+;; Problem Source: iJava (http://ijava.cs.umass.edu/)
+;;
+;; Given an integer, return a boolean indicating whether the location indexed
+;; by the integer in the output of a rule 30 cellular automation is 1.
+;; The automaton is started in the state ...00000100000..., and indexing starts
+;; at the single "1" in the first row (which has index 0) and then proceeds to
+;; subsequent rows, always covering only the triangle of influence of the
+;; original "1". Graphically, the indices are laid out as:
+
+;; ..........0..........
+;; .........123.........
+;; ........45678........
+;; etc.
+
+;; The problem is dymanic in the sense that a new set of test points is used
+;; each generation. A negagive error-threshold is used to prevent the genetic
+;; programming system from terminating until the generation limit is reached.
+
+(ns clojush.problems.boolean.rule30-dynamic
+  (:use [clojush.ns]))
+
+;; Allow access to all clojush namespaces (except for examples/* and experimental/*)
+(use-clojush)
+
+(def number-of-rule30-datapoints 1024)
+
+(def number-of-rule30-datapoints-per-generation 32)
+
+(defn next-row ;; of Rule 30 Cellular Automaton: http://mathworld.wolfram.com/Rule30.html
+  [row]
+  (let [windows (partition 3 1 (concat [false false] row [false false]))]
+    (mapv (fn [window]
+            (case window
+              [true true true] false
+              [true true false] false
+              [true false true] false
+              [true false false] true
+              [false true true] true
+              [false true false] true
+              [false false true] true
+              [false false false] false))
+          windows)))
+
+(def rule30-data
+  (loop [rows [[true]]
+         number-so-far 1]
+    (if (>= number-so-far number-of-rule30-datapoints)
+      (mapv vector
+            (range number-of-rule30-datapoints)
+            (take number-of-rule30-datapoints (flatten rows)))
+      (let [row (next-row (last rows))]
+        (recur (conj rows row)
+               (+ number-so-far (count row)))))))
+
+(def rule30-data-this-generation ;; dynamic, initialized to a random subset
+  (atom (vec (take number-of-rule30-datapoints-per-generation
+                   (lshuffle rule30-data)))))
+
+;; print the initial data subset, which will be used in the first generation
+(println "rule30-data-this-generation:" @rule30-data-this-generation)
+
+(defn rule30-program-output
+  [program input]
+  (top-item :boolean
+            (run-push program
+                      (push-item input :input
+                                 (make-push-state)))))
+
+(def argmap
+  {:error-function (fn [program]
+                     (doall
+                       (for [[input output] @rule30-data-this-generation]
+                         (if (= (rule30-program-output program input)
+                                output)
+                           0
+                           1))))
+   :atom-generators (concat (list (fn [] (- (lrand-int 5) 2))
+                                  ;(tag-instruction-erc [:exec :integer :boolean] 1000)
+                                  ;(tagged-instruction-erc 1000)
+                                  'in1)
+                            (registered-for-stacks [:integer :boolean :exec]))
+
+   :max-points 512
+   :max-genome-size-in-initial-program 128
+   :evalpush-limit 512
+   :genetic-operator-probabilities {:alternation 0.2
+                                    :uniform-mutation 0.2
+                                    :uniform-close-mutation 0.1
+                                    [:alternation :uniform-mutation] 0.5
+                                    }
+   :alternation-rate 0.01
+   :alignment-deviation 10
+   :uniform-mutation-rate 0.01
+   :parent-selection :lexicase
+   :error-threshold -1 ;; never stop
+   :problem-specific-report (fn [best population generation error-function report-simplifications]
+                              ;; reset the data set to be used
+                              ;; (done here because this is called between generations)
+                              (reset! rule30-data-this-generation
+                                      (vec (take number-of-rule30-datapoints-per-generation
+                                                 (lshuffle rule30-data))))
+                                (println "rule30-data-this-generation:" @rule30-data-this-generation))
+   })
+
+(defn total-error-on-all-rule30-data ;; for validation
+  [program]
+  (load-push-argmap argmap)
+  (reset-globals)
+  (reduce +
+          (for [[input output] rule30-data]
+            (if (= (rule30-program-output program input)
+                   output)
+              0
+              1))))
+
+
+
+
+
+


aoc2020 day15

aoc2020 day15

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


[#2212] An experimental variant on variants

error: pathspec 'backend/src/akvo/lumen/endpoint/commons/taxa.clj' did not match any file(s) known to git

--- backend/src/akvo/lumen/endpoint/commons/taxa.clj
+++ backend/src/akvo/lumen/endpoint/commons/taxa.clj
@@ -0,0 +1,99 @@
+(ns akvo.lumen.endpoint.commons.taxa
+  "An experiment of taxonomic variants with the goal to express business logic
+  via variants and hierarchies.
+
+  A taxon is a variant with a classified key
+
+  taxon taxa")
+
+(defn taxon? [t]
+  (and
+   (map? t)
+   (= 1 (count t))
+   (let [tag (-> t keys first)]
+     (and (keyword? tag)
+          (boolean (namespace tag))))))
+
+(defn tag [t]
+  #_{:pre [(taxon? t)]}
+  (-> t keys first))
+
+(defn value [t]
+  #_{:pre [(taxon? t)]}
+  (-> t vals first))
+
+(defn ok? [t]
+  (isa? (tag t) ::ok))
+
+(comment
+  (taxon? {::a {}}) ;; true
+  (tag {::a {:k "V"}}) ;; :akvo.lumen.endpoint.commons.taxa/a
+  (value {::a {:k "V"}}) ;; {:k "V"}
+  (ok? {::ok {}}) ;; true
+  )
+
+(derive ::okish ::ok)
+
+(defn f1 [t]
+  (let [v (value t)]
+    {::okish (assoc v :f1 "f1")}))
+
+(defn f2
+  ([t]
+   (f2 t "f2"))
+  ([t a]
+   (let [v (value t)]
+     {::ok (assoc v :f2 a)}))
+  ([t a b]
+   (let [v (value t)]
+     {::ok (-> v
+               (assoc :f2a a)
+               (assoc :f2b b))})))
+
+(defn f3 [t]
+  {::err (-> {}
+             (assoc :stack (value t))
+             (assoc :f3 "f3"))})
+
+
+(defn cond-thread
+  [expr clauses]
+  (reduce (fn [previous {:keys [f args]}]
+            (if (ok? previous)
+              (if args
+                (apply f previous args)
+                (f previous))
+              previous))
+          {::ok expr}
+          clauses))
+
+(defmacro ?>
+  "Takes a value and thread trough forms. Short circut if taxon returned from
+  forms is not a child of ::ok"
+  [expr & forms]
+  (loop [clauses []
+         forms forms]
+    (if forms
+      (let [form (first forms)
+            clause (if (seq? form)
+                     (hash-map :f (resolve (first form))
+                               :args (next form))
+                     (hash-map :f (resolve form)))]
+        (recur (conj clauses clause) (next forms)))
+      (cond-thread expr clauses))))
+
+(comment
+  (?> nil) ;; #:akvo.lumen.endpoint.commons.taxa{:ok nil}
+  (?> {:k :v}) ;; #:akvo.lumen.endpoint.commons.taxa{:ok {:k :v}}
+  (?> {:k :v} f1);; #:akvo.lumen.endpoint.commons.taxa{:ok {:k :v}, :okish {:f1 "f1"}}
+
+  (?> {:k :v}
+      f1
+      (f2 "F2" "F22")) ;; #:akvo.lumen.endpoint.commons.taxa{:ok {:k :v, :f1 "f1", :f2a "F2", :f2b "F22"}}
+
+  (?> {:k :v}
+      f1
+      f3
+      (f2 "F2" "F22")) ;; #:akvo.lumen.endpoint.commons.taxa{:err {:stack {:k :v, :f1 "f1"}, :f3 "f3"}}
+
+  )


Handle auth host from env in tests

Handle auth host from env in 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/physion/ovation-webapi.git/'


Add tests for parkour.toolbox functions.

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

--- test/parkour/toolbox_test.clj
+++ test/parkour/toolbox_test.clj
@@ -0,0 +1,46 @@
+(ns parkour.toolbox-test
+  (:require [clojure.test :refer :all]
+            [clojure.string :as str]
+            [clojure.java.io :as io]
+            [clojure.core.reducers :as r]
+            [parkour (conf :as conf) (fs :as fs) (cstep :as cstep)
+             ,       (wrapper :as w) (mapreduce :as mr) (toolbox :as ptb)
+             ,       (reducers :as pr) (graph :as pg)]
+            [parkour.io (text :as text)]
+            [parkour.util :refer [ignore-errors returning]]
+            [parkour.test-helpers :as th])
+  (:import [org.apache.hadoop.io Text NullWritable]
+           [org.apache.hadoop.mapreduce Job Partitioner]))
+
+(deftest test-by-p
+  (th/with-config
+    (let [job (mr/job), klass (mr/partitioner! job #'ptb/by-p #'pr/nth1)
+          p ^Partitioner (w/new-instance job klass)
+          np 10, modn #(mod % np), ->part #(.getPartition p % nil np)
+          records (map #(-> [(gensym) %]) (range 100))]
+      (is (= (->> records (group-by (comp modn pr/nth1)) vals set)
+             (->> records (group-by ->part) vals set))))))
+
+(deftest test-nth0-p
+  (th/with-config
+    (let [job (mr/job), klass (mr/partitioner! job #'ptb/nth0-p)
+          p ^Partitioner (w/new-instance job klass)
+          np 10, modn #(mod % np), ->part #(.getPartition p % nil np)
+          records (map #(-> [% (gensym)]) (range 100))]
+      (is (= (->> records (group-by (comp modn pr/nth0)) vals set)
+             (->> records (group-by ->part) vals set))))))
+
+(defn words-m
+  {::mr/sink-as :keys}
+  [coll] (r/mapcat #(str/split % #"\s+") coll))
+
+(deftest test-identity-t
+  (th/with-config
+    (is (= #{"apple" "banana" "carrot"}
+           (-> (pg/input (text/dseq (io/resource "word-count-input.txt")))
+               (pg/map #'words-m)
+               (pg/partition [Text NullWritable])
+               (pg/combine #'ptb/identity-t :keygroups :keys)
+               (pg/output (text/dsink))
+               (pg/fexecute (conf/ig) `test-identity-t)
+               (->> (into #{})))))))


Corrected example code

Corrected example code

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


add in transients namespace

add in transients namespace

error: pathspec 'src/clj/com/rpl/specter/transients.cljx' did not match any file(s) known to git

--- src/clj/com/rpl/specter/transients.cljx
+++ src/clj/com/rpl/specter/transients.cljx
@@ -0,0 +1,91 @@
+(ns com.rpl.specter.transients
+  #+cljs
+  (:require-macros [com.rpl.specter.macros
+                    :refer
+                    [defnav
+                     defpathedfn]])
+  (:use #+clj
+        [com.rpl.specter.macros :only
+         [defnav
+          defpathedfn]])
+  (:require [com.rpl.specter.impl :as i]
+            [com.rpl.specter :refer [subselect selected?]]))
+
+(defnav
+  ^{:doc "Navigates to the specified key of a transient collection,
+          navigating to nil if it doesn't exist."}
+  keypath!
+  [key]
+  (select* [this structure next-fn]
+    (next-fn (get structure key)))
+  (transform* [this structure next-fn]
+    (assoc! structure key (next-fn (get structure key)))))
+
+(def END!
+  "Navigates to an empty (persistent) vector at the end of a transient vector."
+  (i/comp-paths* (i/->TransientEndNavigator)))
+
+(defn- t-get-first
+  [tv]
+  (nth tv 0))
+
+(defn- t-get-last
+  [tv]
+  (nth tv (dec (i/transient-vec-count tv))))
+
+(defn- t-update-first
+  [tv next-fn]
+  (assoc! tv 0 (next-fn (nth tv 0))))
+
+(defn- t-update-last
+  [tv next-fn]
+  (let [i (dec (i/transient-vec-count tv))]
+    (assoc! tv i (next-fn (nth tv i)))))
+
+(def FIRST!
+  "Navigates to the first element of a transient vector."
+  (i/->PosNavigator t-get-first t-update-first))
+
+(def LAST!
+  "Navigates to the last element of a transient vector."
+  (i/->PosNavigator t-get-last t-update-last))
+
+#+clj
+(defn- select-keys-from-transient-map
+  "Selects keys from transient map, because built-in select-keys uses
+  `find` which is unsupported."
+  [m m-keys]
+  (loop [result {}
+         m-keys m-keys]
+    (if-not (seq m-keys)
+      result
+      (let [k (first m-keys)
+            ;; support Clojure 1.6 where contains? is broken on transients
+            item (get m k ::not-found)]
+        (recur (if-not (identical? item ::not-found)
+                 (assoc result k item)
+                 result)
+               (rest m-keys))))))
+
+#+cljs
+(defn- select-keys-from-transient-map
+  "Uses select-keys on a transient map."
+  [m m-keys]
+  (select-keys m m-keys))
+
+(defnav
+  ^{:doc "Navigates to the specified persistent submap of a transient map."}
+  submap!
+  [m-keys]
+  (select* [this structure next-fn]
+    (next-fn (select-keys-from-transient-map structure m-keys)))
+  (transform* [this structure next-fn]
+    (let [selected (select-keys-from-transient-map structure m-keys)
+          res (next-fn selected)]
+      (as-> structure %
+        (reduce (fn [m k]
+                  (dissoc! m k))
+                % m-keys)
+        (reduce-kv (fn [m k v]
+                     (assoc! m k v))
+                   % res)))))


add strategy implementation

add strategy implementation

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

--- src/sandbox/strategy/strategy.clj
+++ src/sandbox/strategy/strategy.clj
@@ -0,0 +1,17 @@
+(ns sandbox.strategy.strategy)
+
+(defn first-name-valid? [person]
+  (not (nil? (:first-name person))))
+
+(defn full-name-valid? [person]
+  (and
+   (not (nil? (:first-name person)))
+   (not (nil? (:middle-name person)))
+   (not (nil? (:last-name person)))))
+
+(defn person-collector [valid?]
+  (let [valid-people (atom [])]
+    (fn [person]
+      (if (valid? person)
+        (swap! valid-people conj person))
+      @valid-people)))


table rendering works

table rendering works

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


remove sample data

remove sample data

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


API for column scanning name

API for column scanning name

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


Add profiles api functions

Add profiles api functions

error: pathspec 'src/kixi/hecuba/api/profiles.clj' did not match any file(s) known to git

--- src/kixi/hecuba/api/profiles.clj
+++ src/kixi/hecuba/api/profiles.clj
@@ -0,0 +1,163 @@
+(ns kixi.hecuba.api.profiles
+  (:require
+   [bidi.bidi :as bidi]
+   [cheshire.core :as json]
+   [clojure.tools.logging :as log]
+   [kixi.hecuba.protocols :as hecuba]
+   [kixi.hecuba.security :as sec]
+   [kixi.hecuba.webutil :as util]
+   [kixi.hecuba.webutil :refer (decode-body authorized? stringify-values sha1-regex)]
+   [liberator.core :refer (defresource)]
+   [liberator.representation :refer (ring-response)]))
+
+(defn index-exists? [querier ctx]
+  (let [request       (:request ctx)
+        method        (:request-method request)
+        route-params  (:route-params request)
+        entity-id     (:entity-id route-params)
+        entity        (hecuba/item querier :entity entity-id)
+        _ (println "Looking for entity" entity)]
+    (case method
+      :post (not (nil? entity))
+      :get (let [items (hecuba/items querier :profile [[= :entity-id entity-id]])]
+             {::items items}))))
+
+(defn index-malformed? [ctx]
+  (let [request (:request ctx)
+        {:keys [route-params request-method]} request
+        entity-id (:entity-id route-params)]
+    (case request-method
+      :post (let [body (decode-body request)]
+              ;; We need to assert a few things
+              (if
+                (or
+                  (not= (:entity-id body) entity-id))
+                true                  ; it's malformed, game over
+                [false {:body body}]  ; it's not malformed, return the body now we've read it
+                ))
+      false)))
+
+(defn index-post! [querier commander ctx]
+  (let [{:keys [request body]} ctx
+        entity-id     (-> request :route-params :entity-id)
+        [username _]  (sec/get-username-password request querier)
+        user-id       (-> (hecuba/items querier :user [[= :username username]]) first :id)]
+
+    (when-not (empty? (first (hecuba/items querier :entity [[= :id entity-id]])))
+      (let [profile   (-> body
+                          (assoc :user-id user-id)
+                          ;; here goes the list of "stuff" associated with profiles
+                          ;(update-in [:thermal-images] json/encode)
+                          ;(update-in [:storeys] json/encode)
+                          ;(update-in [:walls] json/encode)
+                          ;(update-in [:roofs] json/encode)
+                          stringify-values)
+            profile-id (hecuba/upsert! commander :profile profile)]
+        {:profile-id profile-id}))))
+
+(defn index-handle-ok [ctx]
+  (let [{items ::items
+         {mime :media-type} :representation
+         {routes :modular.bidi/routes
+          route-params :route-params} :request} ctx]
+    (util/render-items ctx (->> items
+                                (map #(dissoc % :user-id))
+                                (map #(update-in % [:thermal-images] json/decode))
+                                (map #(update-in % [:storeys] json/decode))
+                                (map #(update-in % [:walls] json/decode))
+                                (map #(update-in % [:roofs] json/decode))
+                                (map util/downcast-to-json)
+                                (map util/camelify)
+                                json/encode))))
+
+(defn index-handle-created [handlers ctx]
+  (let [{{routes :modular.bidi/routes {entity-id :entity-id} :route-params} :request
+         profile-id :profile-id} ctx]
+    (if-not (empty? profile-id)
+      (let [location
+            (bidi/path-for routes (:profile @handlers)
+                           :entity-id entity-id
+                           :profile-id profile-id)]
+        (when-not location
+          (throw (ex-info "No path resolved for Location header"
+                          {:entity-id entity-id
+                           :profile-id profile-id})))
+        (ring-response {:headers {"Location" location}
+                        :body (json/encode {:location location
+                                            :status "OK"
+                                            :version "4"})}))
+      (ring-response {:status 422
+                      :body "Provide valid projectId and propertyCode."}))))
+
+(defn resource-exists? [querier ctx]
+  (let [{{{:keys [entity-id profile-id]} :route-params} :request} ctx
+        item (hecuba/item querier :profile profile-id)]
+    (if-not (empty? item)
+      {::item (-> item
+                  (assoc :profile-id profile-id)
+                  (dissoc :id))}
+      false)))
+
+(defn resource-delete-enacted? [commander ctx]
+  (let [{item ::item} ctx
+        device-id (:device-id item)
+        entity-id (:entity-id item)
+        response1 (hecuba/delete! commander :device [[= :id device-id]])
+        response2 (hecuba/delete! commander :sensor [[= :device-id device-id]])
+        response3 (hecuba/delete! commander :sensor-metadata [[= :device-id device-id]])
+        response4 (hecuba/delete! commander :entity {:devices device-id} [[= :id entity-id]])]
+    (every? empty? [response1 response2 response3 response4])))
+
+(defn resource-put! [commander querier ctx]
+  (let [{request :request} ctx]
+    (if-let [item (::item ctx)]
+      (let [body          (decode-body request)
+            entity-id     (-> item :entity-id)
+            [username _]  (sec/get-username-password request querier)
+            user-id       (-> (hecuba/items querier :user [[= :username username]]) first :id)
+            profile-id     (-> item :profile-id)]
+        (hecuba/upsert! commander :profile (-> body
+                                               (assoc :id profile-id)
+                                               (assoc :user-id user-id)
+                                               ;; TODO: add storeys, walls, etc.
+                                               stringify-values)))
+      (ring-response {:status 404 :body "Please provide valid entityId and timestamp"}))))
+
+(defn resource-handle-ok [querier ctx]
+  (let [{item ::item} ctx]
+    (-> item
+        (dissoc :user-id)
+        ;; TODO add storeys, walls, etc.
+        util/downcast-to-json
+        util/camelify
+        json/encode)))
+
+(defn resource-respond-with-entity [ctx]
+  (let [request (:request ctx)
+        method  (:request-method request)]
+    (cond
+     (= method :delete) false
+      :else true)))
+
+(defresource index [{:keys [commander querier]} handlers]
+  :allowed-methods #{:get :post}
+  :available-media-types #{"application/json"}
+  :known-content-type? #{"application/json"}
+  :authorized? (authorized? querier :profile)
+  :exists? (partial index-exists? querier)
+  :malformed? index-malformed?
+  :post! (partial index-post! querier commander)
+  :handle-ok (partial index-handle-ok)
+  :handle-created (partial index-handle-created handlers))
+
+(defresource resource [{:keys [commander querier]} handlers]
+  :allowed-methods #{:get :delete :putj}
+  :available-media-types #{"application/json"}
+  :authorized? (authorized? querier :profile)
+  :exists? (partial resource-exists? querier)
+  :delete-enacted? (partial resource-delete-enacted? commander)
+  :respond-with-entity? (partial resource-respond-with-entity)
+  :new? (constantly false)
+  :can-put-to-missing? (constantly false)
+  :put! (partial resource-put! commander querier)
+  :handle-ok (partial resource-handle-ok querier))


[WM] add more logging to handle-errors

[WM] add more logging to handle-errors

This was silently swallowing a bug that took us way too long to
find. This logging would have made it obvious right away.

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


refactor

refactor

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


More convenient way to use mlet with monad transformers

I also thought about making an optional first argument for mlet so we
could write

    (mlet (maybe-trans vector-monad)
       [a [(just 1)]
        b [(just (inc a))]]
      (return (* b 2)))

instead of the slightly uglier

    (mlet-with (maybe-trans vector-monad)
       [a [(just 1)]
        b [(just (inc a))]]
      (return (* b 2)))

--- src/cljx/cats/core.cljx
+++ src/cljx/cats/core.cljx
@@ -203,6 +203,29 @@
                    `(bind ~r (fn [~l] ~acc))))
                `(do ~@body))))

+(defmacro mlet-with
+  "A helper macro for using monad transformers, is the
+  same as mlet but specifying the monadic context.
+  So, instead of writing:
+
+    (with-monad (maybe-trans vector-monad)
+      (mlet [a [(just 1) (just 2)]
+             b [(just (inc a))]]
+        (return (* b 2))))
+    ;=> [#<Just [4]> #<Just [6]>]
+
+  You can just write:
+
+    (mlet-with (maybe-trans vector-monad)
+      [a [(just 1) (just 2)]
+       b [(just (inc a))]]
+      (return (* b 2)))
+    ;=> [#<Just [4]> #<Just [6]>]
+  "
+  [monad bindings & body]
+  `(with-monad ~monad
+     (mlet ~bindings ~@body)))
+
 #+clj
 (defmacro lift-m
   "Lifts a function with the given fixed number of arguments to a


Execute continuation monad computations in the Continuation context

--- src/cljx/cats/core.cljx
+++ src/cljx/cats/core.cljx
@@ -267,4 +267,6 @@
   [cont]
   "Given a Continuation instance, execute the
   wrapped computation and return its value."
-  (cont identity))
+  (#+clj  with-context
+   #+cljs cm/with-context cont
+    (cont identity)))


Avoid losing the producer on stop.

Avoid losing the producer on stop.

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


Added ns

Added ns

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


Update to ClojureScript 0.0-3211

Update to ClojureScript 0.0-3211

--- Clojure/project.clj
+++ Clojure/project.clj
@@ -4,7 +4,7 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [org.clojure/clojurescript "0.0-3196"]
+                 [org.clojure/clojurescript "0.0-3211"]
                  [com.github.rickyclarkson/jmdns "3.4.2-r353-1"]]
   :source-paths ["src"]
   :main ambly.repl.jsc)


add simple alert create test

add simple alert create test

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


fix cljs keywords

fix cljs keywords

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


Cancel running animations before starting a new one

We store the animation id at every step of the animation and cancel the
currently stored animation before starting a new one. This fixes a
glitch where changing data during an animation would start a second
animation loop that competes with the original one.

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/dignati/om-charts.git/'


Make it just a debug log

Make it just a debug log


fix nimbus_test.clj

fix nimbus_test.clj

--- storm-core/test/clj/org/apache/storm/nimbus_test.clj
+++ storm-core/test/clj/org/apache/storm/nimbus_test.clj
@@ -1411,8 +1411,6 @@
           cluster-utils (Mockito/mock ClusterUtils)]
       (with-open [_ (ConfigUtilsInstaller. fake-cu)
                   _ (UtilsInstaller. fake-utils)
-                  _ (proxy [ConfigUtils] []
-                      (nimbusTopoHistoryStateImpl [conf] nil))
                   zk-le (MockedZookeeper. (proxy [Zookeeper] []
                           (zkLeaderElectorImpl [conf] nil)))
                   mocked-cluster (MockedCluster. cluster-utils)]


Controller for standings

Controller for standings

error: pathspec 'src/shl/controllers/standings.clj' did not match any file(s) known to git

--- src/shl/controllers/standings.clj
+++ src/shl/controllers/standings.clj
@@ -0,0 +1,24 @@
+(ns shl.controllers.standings
+  (:use [compojure.core])
+  (:use [ring.util.response])
+  (:require [clojure.string :as str]
+            [ring.util.response :as ring]
+            [clojure.data.json :as json]
+            [clj-time.format :as time]
+            [shl.utils.time :as time-utils]
+            [shl.service.statistics :as service]))
+
+(defn get-tournament-standings [tournamentid]
+  (response (service/get-tournament-standings (Integer/parseInt tournamentid))))
+
+(defn get-conference-standings [conferenceid]
+  (response (service/get-conference-standings (Integer/parseInt conferenceid))))
+
+(defn get-player-standings [playerid]
+  (response (service/get-player-standings (Integer/parseInt playerid))))
+
+(defroutes app-routes
+  (context "/standings" [] (defroutes standings-routes
+    (GET ["/tournament/:id/" :id #"[0-9]+"] [id] (get-tournament-standings id))
+    (GET ["/conference/:id/" :id #"[0-9]+"] [id] (get-conference-standings id))
+    (GET ["/player/:id/" :id #"[0-9]+"] [id] (get-player-standings id)))))


clarify authorized keys thing

clarify authorized keys thing

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


Update {bi,left-,right-}map docstrings

Update {bi,left-,right-}map docstrings

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


note what each train movement code is .

note what each train movement code is .


Fix get-next-community in community/select


number display component

number display component

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

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


CMR-1580: Added code for converting a UMM record to JSON.

error: pathspec 'umm-spec-lib/src/cmr/umm_spec/umm_to_json.clj' did not match any file(s) known to git

--- umm-spec-lib/src/cmr/umm_spec/umm_to_json.clj
+++ umm-spec-lib/src/cmr/umm_spec/umm_to_json.clj
@@ -0,0 +1,43 @@
+(ns cmr.umm-spec.umm-to-json
+  "Contains functions for converting a UMM record into JSON"
+  (:require [cheshire.core :as json]
+            [cheshire.generate :as json-gen]))
+
+;; Adds the ability for Joda DateTimes to be converted to JSON.
+(json-gen/add-encoder
+  org.joda.time.DateTime
+  (fn [c jsonGenerator]
+    (.writeString jsonGenerator (str c))))
+
+
+(defprotocol ToJsonAble
+  "A function for converting data into data that can easily be converted to JSON"
+  (to-jsonable
+    [o]
+    "Takes in object and returns a new object that can be converted to JSON"))
+
+
+(extend-protocol ToJsonAble
+
+  ;; Records contain every key with a value of nil. We don't want the JSON to contain that.
+  ;; This converts them into a standard map without the nil keys.
+  clojure.lang.IRecord
+  (to-jsonable
+    [r]
+    (into {}
+          (for [[k v] r
+                :when (some? v)]
+            [(to-jsonable k) (to-jsonable v)])))
+
+
+  ;; Default implementations
+  Object
+  (to-jsonable [o] o)
+
+  nil
+  (to-jsonable [o] o))
+
+(defn umm->json
+  "Converts the UMM record to JSON."
+  [umm-record]
+  (json/generate-string (to-jsonable umm-record)))


cleanup for asset node

cleanup for asset node

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


Add file that interfaces with javascript files

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

--- src/storemi/js.clj
+++ src/storemi/js.clj
@@ -0,0 +1,35 @@
+(ns storemi.js
+  (:require
+    [clj-rhino :as js]
+    [clojure.walk :refer [keywordize-keys]]))
+
+(def parser-scope
+  (doto (js/new-safe-scope)
+    (js/eval (slurp "resources/public/js/underscore-min.js"))
+    (js/eval (slurp "resources/public/js/parser.js"))))
+
+(defn parse-script [script]
+  (let [sc (js/new-scope nil parser-scope)]
+    (js/set! sc "script" script)
+    (-> (js/eval sc "parseScript(script)")
+        js/from-js)))
+
+(def react-scope
+  (let [scripts ["resources/public/js/underscore-min.js"
+                 "resources/public/js/react.min.js"
+                 "resources/public/js/parser.js"
+                 "resources/public/js/react/story-ui.react.js"]
+        scope (js/new-scope)]
+    (js/eval scope "var global = this")
+    (doseq [s scripts]
+      (js/eval scope (slurp s)))
+    scope))
+
+(defn render-story-component [data]
+  (let [sc (js/new-scope nil react-scope)]
+    (js/set! sc "data" (js/to-js data sc))
+    (-> (js/eval sc "React.renderComponentToString(Story({data: data}))")
+        )))
+
+
+


whitespace

whitespace

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


Added the beginnings of key compression

Added the beginnings of key compression

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/qu-platform/qu-core.git/'


fix lines display in doc info table to work for single line

--- cljs-server/cljsinfo_server/html.cljs
+++ cljs-server/cljsinfo_server/html.cljs
@@ -402,7 +402,7 @@
       (when-let [lines (-> docs :source :lines)]
         [:tr
           [:td.label-8bc3b "Lines"]
-          [:td (str (first lines) " - " (second lines))]])]])
+          [:td (join " - " lines)]])]])

 (defn- github-link [src]
   (let [filename (:filename src)


add core test file

add core test file

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

--- test/test_core.clj
+++ test/test_core.clj
@@ -0,0 +1,32 @@
+(ns test-core
+  (:use clojure.test cake))
+
+(defmacro project-let [bindings & body]
+  `(binding [project {:name "project-stub", :version "0.0.0", :root "/home/project"}]
+     (let ~bindings
+       ~@body)))
+
+(deftest file-fn
+  (testing "single string"
+    (project-let [s "foo/bar/baz"]
+      (is (= (str (:root project) "/" s)
+             (.toString (file s))))))
+
+  (testing "multiple strings"
+    (project-let [a "foo", b "bar"]
+      (is (= (str (:root project) "/" a "/" b)
+             (.toString (file a b))))))
+
+  ;; working here
+  (comment testing "single file"
+    (project-let [s "foo", f (java.io.File. s)]
+      (is (= (str (:root project) "/" s)
+             (.toString (file f))))))
+
+  (testing "file and string")
+
+  (testing "tilde expansion")
+
+  (testing "home directory"))
+
+


lint free, project sync

lint free, project sync

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


version 0.1.0-SNAPSHOT

version 0.1.0-SNAPSHOT

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


Remove unnecessary dependency.

Remove unnecessary dependency.

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


Add description & URL to project.clj

Add description & URL to 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/democracyworks/electorate-works.git/'


Upgrade to latest digest (1.4.10)

Upgrade to latest digest (1.4.10)

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


Version 117

Version 117


Update deps to latest

Update deps to latest

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


Upgrade libraries

Upgrade libraries

--- project.clj
+++ project.clj
@@ -3,21 +3,22 @@
   :dependencies
   [
    [org.clojure/clojure "1.3.0"]
-   [compojure "1.0.2"]
+   [compojure "1.1.0"]
    [ring-json-params "0.1.3"]
    [clj-json "0.5.0"]
-   [ring "1.0.2"]
-   [ring/ring-servlet "1.0.2"]
-   [ring/ring-jetty-adapter "1.0.2"]
+   [ring/ring-core "1.1.0"]
+   [ring/ring-servlet "1.1.0"]
+   [ring/ring-jetty-adapter "1.1.0"]
    ;; [sandbar "0.4.0-SNAPSHOT"]
    ;; [enlive "1.0.0"]
-   [org.clojure/tools.logging "0.2.3" :exclusions [log4j/log4j
-                                                   commons-logging/commons-logging
-                                                   org.slf4j/slf4j-api
-                                                   org.slf4j/slf4j-log4j12]]
+   [org.clojure/tools.logging "0.2.3"
+    :exclusions [log4j/log4j
+                 commons-logging/commons-logging
+                 org.slf4j/slf4j-api
+                 org.slf4j/slf4j-log4j12]]
    ;;; java deps
-   [joda-time/joda-time "2.0"]
-   [ch.qos.logback/logback-classic "1.0.0"]
+   [joda-time/joda-time "2.1"]
+   [ch.qos.logback/logback-classic "1.0.3"]
    [org.slf4j/log4j-over-slf4j "1.6.4"]
    [commons-codec/commons-codec "1.6"]
    ;;[org.clojure/math.numeric-tower "0.0.1"]
@@ -30,7 +31,7 @@
    ]
   :dev-dependencies
   [
-   [ring/ring-devel "1.0.1"]
+   [ring/ring-devel "1.1.0"]
    [lein-ring "0.6.1"]
    [midje "1.3.1"]
    [lein-midje "1.0.8"]


Update to new version of teller

Update to new version of teller

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


Version 1.7.0-SNAPSHOT

Version 1.7.0-SNAPSHOT


release 0.15.3

release 0.15.3

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


Initial project.clj, just to hold it together

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

--- project.clj
+++ project.clj
@@ -0,0 +1,13 @@
+(defproject clojurescript-terra "0.1.0-SNAPSHOT"
+  :description "ClojureScript running on Terra"
+  :url "https://github.com/ohpauleez/cljs-terra"
+  :license {:name "Eclipse Public License"
+            :url "http://www.eclipse.org/legal/epl-v10.html"}
+  :dependencies [[org.clojure/clojure "1.6.0-beta1"]
+                 [org.clojure/clojurescript "0.0-2156" :exlusions [org.clojure/tools.reader]]
+                 [org.clojure/tools.reader "0.8.3"]
+                 [org.clojure/data.json "0.2.4"]
+                 ;; Experiment with mapping an EDN AST, to a Terra.list AST,
+                 ;;  then using the Terra language/compiler tooling
+                 [org.clojure/tools.analyzer "0.1.0-beta4"]])
+


Version 99-SNAPSHOT

Version 99-SNAPSHOT


Version 30-SNAPSHOT

Version 30-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojars-web "29"
+(defproject clojars-web "30-SNAPSHOT"
   :min-lein-version "2.0.0"
   :dependencies [[org.clojure/clojure "1.7.0"]
                  [org.clojure/tools.cli "0.2.1"]


Bump version

Bump version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojars-web "0.6.4"
+(defproject clojars-web "0.7.0-SNAPSHOT"
   :aot [clojars.scp]
   :main clojars.main
   :dependencies [[org.clojure/clojure "1.2.1"]


fix project.clj

fix 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/physion/ovation-webapi.git/'


basic client poc

basic client poc

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

--- src/celestial/client.clj
+++ src/celestial/client.clj
@@ -0,0 +1,23 @@
+(ns celestial.client
+  "celestial clojure client"
+  (:require
+    [clojure.core.strint :refer (<<)]
+    [clj-http.client :as client]))
+
+(def auth-store (atom ["user" "password"]))
+(def root "https://localhost:8443/")
+
+(defn with-auth
+  "perform verb with basic auth"
+  [verb url & args]
+  (:body (verb (<< "~{root}/~{url}")
+    (merge args {:insecure? true :basic-auth @auth-store :as :json}))))
+
+(defn system
+  "get system"
+  [id]
+  (with-auth client/get "systems/1"))
+
+(comment
+  (reset! auth-store ["admin" "changeme"])
+  (system 1))


Don't need to validate username on profile-update

Conflicts:

	src/clojars/web/user.clj

--- src/clojars/web/user.clj
+++ src/clojars/web/user.clj
@@ -49,10 +49,11 @@
       (conj-when (blank? password) "Password can't be blank")
       (conj-when (not= password confirm)
                  "Password and confirm password must match")
-      (conj-when (or (reserved-names user)    ; "I told them we already
-                     (and (not= account user) ; got one!"
-                          (find-user user))
-                     (seq (group-members user)))
+      (conj-when (and (nil? account) ; only check username on register
+                      (or (reserved-names user)  ; "I told them we already
+                          (and (not= account user) ; got one!"
+                               (find-user user))
+                          (seq (group-members user))))
                  "Username is already taken")
       (conj-when (not (re-matches #"[a-z0-9_-]+" user))
                  (str "Usernames must consist only of lowercase "


Add cljfmt to profile

Add cljfmt to profile

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


kata4: Hand over line to parse-line in parse-day

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/schaueho/clojure-codekata.git/'