Add a text formatting toolkit

Add a text formatting toolkit

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

--- src/detritus/text.clj
+++ src/detritus/text.clj
@@ -0,0 +1,181 @@
+(ns detritus.text
+  (:require [detritus.macros :refer [-<>]])
+  (:require [clojure.string :as c.s]))
+
+
+(defn words [text]
+  (c.s/split text #"\s+"))
+
+
+(defn lines [text]
+  (c.s/split text #"(\n\r?)+"))
+
+
+(defn trailing-newline?
+  [text]
+  {:pre [(string? text)]}
+  (= \newline (last text)))
+
+
+(defn ensure-trailing-newline
+  [text]
+  (if-not (trailing-newline? text)
+    (str text \newline)
+    text))
+
+
+(defn prefix-lines [prefix text]
+  (-<> (lines text)
+       (map str (repeat prefix) <>)
+       (interpose \newline <>)
+       (apply str <>)))
+
+
+(defn wrap-lines
+  "(λ Num → String) → String
+
+  Wraps the input text to the specified column width by words,
+  returning the wrapped text as a single string."
+  [size text]
+  (loop [left  size
+         line  []
+         lines []
+         words (words text)]
+    (if-let [word (first words)]
+      (let [wlen    (count word)
+            spacing (if (== left size) "" " ")
+            alen    (+ (count spacing) wlen)]
+        (if (<= alen left)
+          (recur (- left alen)
+                 (conj line spacing word)
+                 lines
+                 (next words))
+          (recur (- size wlen)
+                 [word]
+                 (conj lines (apply str line))
+                 (next words))))
+      (when (seq line)
+        (conj lines (apply str line))))))
+
+
+;; hiccup inspired plain text API
+;;--------------------------------------------------------------------
+
+(defn render-dispatch [f]
+  (cond (vector? f)
+        ,,(first f)
+
+        (seq? f)
+        ,,:seq
+
+        true
+        ,,:str))
+
+
+(defmulti render
+  render-dispatch)
+
+
+(defmethod render :seq
+  [forms]
+  (->> forms
+     (map render)
+     (apply str)))
+
+
+(defmethod render :str
+  [& xs]
+  (->> xs
+     (map str)
+     (apply str)))
+
+
+(defmethod render :indent
+  [[_ {width :width
+       :or {width 2}
+       :as opts} & text]]
+  (->> text
+     (map render)
+     (apply str)
+     (prefix-lines (apply str (repeat width \space)))))
+
+
+(defmethod render :prefix
+  [[_ {prefix :prefix :as opts} & text]]
+  (->> text
+     (prefix-lines prefix)))
+
+
+(defmethod render :wrap
+  [[_ {width :width
+       :or {width 80}
+       :as opts}
+    & text]]
+  (-<> text
+       (map render <>)
+       (apply str <>)
+       (c.s/replace <> #"\n" "")
+       (wrap-lines width <>)
+       (interpose "\n" <>)
+       (apply str <>)))
+
+
+(defmethod render :heading
+  [[_ opts & text]]
+  (str (apply str text) "\n"
+       (str (apply str (repeat 80 \-)) \newline)))
+
+
+(defmethod render :code
+  [[_ {lang :lang :as opts} & text]]
+  (-<> text
+       (map render <>)
+       (apply str <>)
+       (str "```" lang \newline
+            <> \newline
+            "```" \newline)
+       (ensure-trailing-newline <>)))
+
+
+(defmethod render :block
+  [[_ opts & text]]
+  (-<> text
+       (map render <>)
+       (apply str <>)
+       (str <> \newline \newline)))
+
+;; API to try and convert plain text into the above
+;;--------------------------------------------------------------------
+
+(defn text->indent
+  [text]
+  (let [indent (re-find #"\s\s+" text)]
+    (if indent
+      [:indent {:width (count indent)}
+       (c.s/replace text (re-pattern indent) "")]
+      [:str {} text])))
+
+
+(defn text->paragraph
+  [text]
+  (let [[op w text] (text->indent text)
+        text        (c.s/replace text #"\n\r?" " ")]
+    [:block {}
+     (case op
+       (:indent)
+       ,,[:indent w
+          [:wrap {} text]]
+
+       (:str)
+       ,,[:wrap {} text])]))
+
+
+(defn text->paragraphs
+  "(λ String) → (Seq String)
+
+  Walks the input string, attempting to detect breaks between
+  paragraphs and returning a sequence of strings representing
+  individual paragraphs."
+  [text]
+  (map text->paragraph
+       (c.s/split text #"\n\r?\s*\n\r?")))


add dotask to example

add dotask to example

--- examples/fowler.clj
+++ examples/fowler.clj
@@ -8,4 +8,6 @@
   (println "load the test data"))

 (deftask test [] compile data-load
-  (println "run the tests"))+  (println "run the tests"))
+
+(dotask test)


Some work on #6

Some work on #6

fatal: unable to access 'https://github.com/ivarref/clj-simple-chart.git/': The requested URL returned error: 403


removed subnav.cljs (again)

removed subnav.cljs (again)

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


Adding back button

Adding back button

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


whitespace

whitespace

--- sidecar/src/figwheel_sidecar/system.clj
+++ sidecar/src/figwheel_sidecar/system.clj
@@ -609,5 +609,3 @@
 (defn start-figwheel-and-cljs-repl! [autobuild-options]
   (when-let [system (start-figwheel! autobuild-options)]
     (cljs-repl (:figwheel-system system))))
-
-


[#110485090] Add google-analytics and hubspot tracking

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

--- src/homepage/integrations.clj
+++ src/homepage/integrations.clj
@@ -0,0 +1,23 @@
+(ns homepage.integrations)
+
+(defn hubspot-analytics []
+  [:script {:type "text/javascript"}
+   "(function(d,s,i,r) {
+   if (d.getElementById(i)){return;}
+   var n=d.createElement(s),e=d.getElementsByTagName(s)[0];
+   n.id=i;n.src='//js.hs-analytics.net/analytics/'+
+   (Math.ceil(new Date()/r)*r)+'/511335.js';
+   e.parentNode.insertBefore(n, e);
+   })(document,'script','hs-analytics',300000);"])
+
+(defn google-analytics []
+  [:script {:type "text/javascript"}
+     "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+     (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+     m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+     })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+     ga('create', 'UA-31491340-1', 'auto');
+     ga('require', 'displayfeatures');
+     ga('send', 'pageview');
+     ga('require', 'displayfeatures');"])


easy import for client

easy import for client

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

--- src/cljs/infinitelives/utils/async.cljs
+++ src/cljs/infinitelives/utils/async.cljs
@@ -0,0 +1,5 @@
+(ns infinitelives.utils.async
+  (:require [cljs.core.async :refer [<! >! timeout]])
+  (:require-macros [infinitelives.utils.async :refer
+                    [continue-while
+                     go-while]]))


Fix handling of default configuration values

`turbovote.resource-config/config` determines lookup success based on whether
keys exist, and so will not return default values when the key path exists but
the values are nil.

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


Clarify annotations DELETE return

Clarify annotations DELETE return

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 handlers module

add handlers module

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

--- src/om_next_e2e/handlers.clj
+++ src/om_next_e2e/handlers.clj
@@ -0,0 +1,11 @@
+(ns om-next-e2e.handlers)
+
+(defn action [{:keys [body]}]
+  {:status 200 :body {:action body}})
+
+(defn query [{:keys [body]}]
+  {:status 200 :body {:query body}})
+
+(defn not-found [_]
+  {:status 404 :body {:error "Not Found"}})
+


added test for rebalancing

added test for rebalancing

fatal: unable to access 'https://github.com/taoguan/storm-1.git/': The requested URL returned error: 403


Added request support.

Added request support.

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

--- src/cmr/opendap/http/request.clj
+++ src/cmr/opendap/http/request.clj
@@ -0,0 +1,35 @@
+(ns cmr.opendap.http.request
+  (:require
+   [cmr.opendap.const :as const]
+   [org.httpkit.client :as httpc]
+   [taoensso.timbre :as log]))
+
+(def default-options
+  {:user-agent const/user-agent
+   :insecure? true})
+
+(defn options
+  [request & opts]
+  (apply assoc (concat [request] opts)))
+
+(defn get-header
+  [request field]
+  (get-in request [:headers field]))
+
+(defn add-header
+  [request field value]
+  (assoc-in request [:headers field] value))
+
+(defn add-token-header
+  [request token]
+  (add-header request "Echo-Token" token))
+
+(defn add-form-ct
+  [request]
+  (add-header request "Content-Type" "application/x-www-form-urlencoded"))
+
+(defn add-client-id
+  [request]
+  (add-header request "Client-Id" "cmr-opendap-token-checker"))
+
+


skeleton files parsed with no work

skeleton files parsed with no work

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 initial (untested) version of padding algorithms.

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

--- src/buddy/core/padding.clj
+++ src/buddy/core/padding.clj
@@ -0,0 +1,71 @@
+;; Copyright (c) 2015 Andrey Antukh <niwi@niwi.be>
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License")
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;;     http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
+(ns buddy.core.padding
+  "Block padding algorithms."
+  (:require [buddy.core.bytes :as bytes])
+  (:import org.bouncycastle.crypto.paddings.ZeroBytePadding
+           org.bouncycastle.crypto.paddings.X923Padding
+           org.bouncycastle.crypto.paddings.PKCS7Padding
+           org.bouncycastle.crypto.paddings.TBCPadding
+           org.bouncycastle.crypto.paddings.ISO7816d4Padding
+           org.bouncycastle.crypto.paddings.ISO10126d2Padding
+           clojure.lang.Keyword))
+
+(defn padding-engine
+  "Create a padding enginde for given algorithm name."
+  [^Keyword alg]
+  (condp = alg
+    :zerobyte (ZeroBytePadding.)
+    :pkcs7 (PKCS7Padding.)
+    :tbc (TBCPadding.)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; High level api.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn pad!
+  "Add padding using one of supported padding algorithms."
+  ([^bytes input ^long offset] (pad input offset :zerobyte))
+  ([^bytes input ^long offset ^Keyword alg]
+   (let [engine (padding-engine alg)]
+     (.init engine (java.security.SecureRandom.))
+     (.addPadding engine input offset))))
+
+(defn pad
+  "Add padding using one of supported padding algorithms.
+  This is a side effect free version of pad! function."
+  ([^bytes input ^long offset] (pad input offset :zerobyte))
+  ([^bytes input ^long offset ^Keyword alg]
+   (let [^bytes input (bytes/copy input)]
+     (pad! input offset alg)
+     input)))
+
+(defn padded?
+  "Check if given byte array has padding using specified
+  padding algorithm. If no one is specified, :zerobyte
+  will be used."
+  ([^bytes input] (padded? input :zerobyte))
+  ([^bytes input ^Keyword alg]
+   (let [engine (padding-engine alg)]
+     (pos? (.padCount engine input)))))
+
+(defn unpad
+  "Remove padding from given byte array and return a new
+  byte array without padding."
+  ([^bytes input] (unpad input :zerobyte))
+  ([^bytes input ^Keyword alg]
+   (let [engine (padding-engine alg)
+         num (.padCount engine input)]
+     (bytes/slice input 0 (- (count input) num)))))


Add token link to top nav when logged in

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


getting weather data

getting weather data

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

--- src/dasha/widgets/test.clj
+++ src/dasha/widgets/test.clj
@@ -0,0 +1 @@
+(ns dasha.widgets.test)


add start of spark session biz

add start of spark session biz

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

--- src/clojure/flambo/session.clj
+++ src/clojure/flambo/session.clj
@@ -0,0 +1,33 @@
+;; Functions for creating and modifying `SparkSession` objects
+;;
+;; The functions are designed to be used with the threading macro `->` for building.
+;;
+;; (-> (spark-session)
+;;      (app-name "aname")
+;;      (master "local[2]"))
+;;
+(ns flambo.session
+  (:import [org.apache.spark.sql SparkSession SparkSession$Builder]))
+
+(defn session-builder []
+  (SparkSession/builder))
+
+(defn master
+  ([sb]
+   (master sb "local[*]"))
+  ([sb master]
+   (.master sb master)))
+
+(defn app-name
+  [sb name]
+  (.appName sb name))
+
+(defn config
+  ([sb spark-conf]
+   (.config sb spark-conf))
+  ([sb k v]
+   (.config sb k v)))
+
+(defn get-or-create
+  [sb]
+  (.getOrCreate sb))


added tutorial 2

added tutorial 2

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

--- src/maqueta/tutorials/node.clj
+++ src/maqueta/tutorials/node.clj
@@ -0,0 +1,28 @@
+(ns maqueta.tutorials.node
+  (:use (maqueta application assets))
+  (:import com.jme3.scene.shape.Box
+           (com.jme3.scene Geometry Node)
+           (com.jme3.math ColorRGBA Vector3f)))
+
+(defn setup-fn
+  [app]
+  (let [box1 (Box. (Vector3f. 1 -1 1) 1 1 1)
+        blue (Geometry. "Box" box1)
+        mat1 (load-material "Common/MatDefs/Misc/Unshaded.j3md")
+        box2 (Box. (Vector3f. 1 3 1) 1 1 1)
+        red (Geometry. "Box" box2)
+        mat2 (load-material "Common/MatDefs/Misc/Unshaded.j3md")
+        pivot (Node. "pivot")]
+    (.setColor mat1 "Color" ColorRGBA/Blue)
+    (.setMaterial blue mat1)
+    (.setColor mat2 "Color" ColorRGBA/Red)
+    (.setMaterial red mat2)
+    (.attachChild (.getRootNode app)
+                  (doto pivot
+                    (.attachChild blue)
+                    (.attachChild red)
+                    (.rotate 0.4 0.4 0)))))
+
+(defn -main
+  []
+  (.start (make-app :setup-fn setup-fn)))


Send redacted ex-info

Send redacted ex-info


Some deprecation tests.

Some deprecation tests.

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

--- test/behaviors/t_deprecation.clj
+++ test/behaviors/t_deprecation.clj
@@ -0,0 +1,29 @@
+;; -*- indent-tabs-mode: nil -*-
+
+(ns behaviors.t-deprecation
+  (:use [midje sweet test-util]))
+
+
+(unfinished g)
+(defn f [a] (g a))
+
+(let [messages (with-out-str
+                 (fact
+                   (f 1) => 1
+                   (provided (g odd?) => 1)))]
+  (println messages)
+  (future-facts
+    messages => (contains "a function named odd?")
+    messages => (contains "(t_deprecation.clj:13")))
+
+(let [messages (with-out-str
+                 (fact
+                   (f 1) => 1
+                   (provided (g (as-checker odd?)) => 1)
+
+                   ;; (f 1) => 1
+                   ;; (provided (g (checker [n] true)) => 1)
+
+                   (f 1) => 1
+                   (provided (g (exactly 1)) => 1)))]
+  (println messages))


Fixed test from api-key arg to dao/into-seq


add failing span test

add failing span test

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


Cleanup

Cleanup

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


upgrade handle-errors

upgrade handle-errors


Removed component debug flags from TopologyInfo ctor since its now optional

fatal: unable to access 'https://github.com/hmcl/storm-apache.git/': The requested URL returned error: 403


Add Vocabulary (prefixers) for ONS/ Statistical Geography

error: pathspec 'src/grafter/rdf/ontologies/ons_geography.clj' did not match any file(s) known to git

--- src/grafter/rdf/ontologies/ons_geography.clj
+++ src/grafter/rdf/ontologies/ons_geography.clj
@@ -0,0 +1,30 @@
+(ns grafter.rdf.ontologies.ons-geography
+  (:require [grafter.rdf.ontologies.util :refer :all]))
+
+(def statistical-entity (prefixer "http://statistics.data.gov.uk/def/statistical-entity#"))
+(def statistical-entity:name                 (statistical-entity "name"))
+(def statistical-entity:abbreviation         (statistical-entity "abbreviation"))
+(def statistical-entity:owner                (statistical-entity "owner"))
+(def statistical-entity:coverage             (statistical-entity "coverage"))
+(def statistical-entity:relatedentity        (statistical-entity "relatedentity"))
+(def statistical-entity:status               (statistical-entity "status"))
+(def statistical-entity:liveinstances        (statistical-entity "liveinstances"))
+(def statistical-entity:archivedinstances    (statistical-entity "archivedinstances"))
+(def statistical-entity:coverage             (statistical-entity "coverage"))
+(def statistical-entity:firstcode            (statistical-entity "firstcode"))
+(def statistical-entity:lastcode             (statistical-entity "lastcode"))
+(def statistical-entity:reservedcode         (statistical-entity "reservedcode"))
+(def statistical-entity:introduced           (statistical-entity "introduced"))
+(def statistical-entity:lastinstancechange   (statistical-entity "lastinstancechange"))
+(def statistical-entity:code                 (statistical-entity "code"))
+(def statistical-entity:crossborderinstances (statistical-entity "crossborderinstances"))
+
+(def statistical-geography (prefixer "http://statistics.data.gov.uk/def/statistical-geography#"))
+(def statistical-geography:officialname      (statistical-entity "officialname"))
+(def statistical-geography:status            (statistical-entity "status"))
+
+(def boundary-change (prefixer "http://statistics.data.gov.uk/def/boundary-change/"))
+(def boundary-change:operativedate           (boundary-change "operativedate"))
+(def boundary-change:originatingChangeOrder  (boundary-change "originatingChangeOrder"))
+(def boundary-change:terminateddate          (boundary-change "terminateddate"))
+(def boundary-change:changeOrderTitle        (boundary-change "changeOrderTitle"))


Add tests for image collections.

Add tests for image collections.

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

--- test/uxbox/tests/test_images.clj
+++ test/uxbox/tests/test_images.clj
@@ -0,0 +1,73 @@
+(ns uxbox.tests.test-images
+  (:require [clojure.test :as t]
+            [promesa.core :as p]
+            [suricatta.core :as sc]
+            [clj-uuid :as uuid]
+            [catacumba.testing :refer (with-server)]
+            [buddy.core.codecs :as codecs]
+            [uxbox.persistence :as up]
+            [uxbox.sql :as sql]
+            [uxbox.frontend.routes :as urt]
+            [uxbox.services.images :as images]
+            [uxbox.services :as usv]
+            [uxbox.tests.helpers :as th]))
+
+(t/use-fixtures :each th/database-reset)
+
+(t/deftest test-http-list-image-collections
+  (with-open [conn (up/get-conn)]
+    (let [user (th/create-user conn 1)
+          data {:user (:id user)
+                :name "coll1"}
+          coll (images/create-collection conn data)]
+      (with-server {:handler (urt/app)}
+        (let [uri (str th/+base-url+ "/api/library/image-collections")
+              [status data] (th/http-get user uri)]
+          (println "RESPONSE:" status data)
+          (t/is (= 200 status))
+          (t/is (= 1 (count data))))))))
+
+(t/deftest test-http-create-image-collection
+  (with-open [conn (up/get-conn)]
+    (let [user (th/create-user conn 1)]
+      (with-server {:handler (urt/app)}
+        (let [uri (str th/+base-url+ "/api/library/image-collections")
+              data {:user (:id user)
+                    :name "coll1"}
+              params {:body data}
+              [status data] (th/http-post user uri params)]
+          ;; (println "RESPONSE:" status data)
+          (t/is (= 201 status))
+          (t/is (= (:user data) (:id user)))
+          (t/is (= (:name data) "coll1")))))))
+
+(t/deftest test-http-update-image-collection
+  (with-open [conn (up/get-conn)]
+    (let [user (th/create-user conn 1)
+          data {:user (:id user)
+                :name "coll1"}
+          coll (images/create-collection conn data)]
+      (with-server {:handler (urt/app)}
+        (let [uri (str th/+base-url+ "/api/library/image-collections/" (:id coll))
+              params {:body (assoc coll :name "coll2")}
+              [status data] (th/http-put user uri params)]
+          ;; (println "RESPONSE:" status data)
+          (t/is (= 200 status))
+          (t/is (= (:user data) (:id user)))
+          (t/is (= (:name data) "coll2")))))))
+
+(t/deftest test-http-image-collection-delete
+  (with-open [conn (up/get-conn)]
+    (let [user (th/create-user conn 1)
+          data {:user (:id user)
+                :name "coll1"
+                :data #{1}}
+          coll (images/create-collection conn data)]
+      (with-server {:handler (urt/app)}
+        (let [uri (str th/+base-url+ "/api/library/image-collections/" (:id coll))
+              [status data] (th/http-delete user uri)]
+          (t/is (= 204 status))
+          (let [sqlv (sql/get-image-collections {:user (:id user)})
+                result (sc/fetch conn sqlv)]
+            (t/is (empty? result))))))))
+


Add a simple test for randombytes

Add a simple test for randombytes

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

--- test/caesium/randombytes_test.clj
+++ test/caesium/randombytes_test.clj
@@ -0,0 +1,7 @@
+(ns caesium.randombytes-test
+  (:require [caesium.randombytes :as r]
+            [clojure.test :refer [deftest is]]))
+
+(deftest randombytes-tests
+  (let [some-bytes (r/randombytes 10)]
+    (is (= 10 (alength some-bytes)))))


Add convergence testing functionality

Add convergence testing functionality

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

--- test/cortex/test_utils.clj
+++ test/cortex/test_utils.clj
@@ -0,0 +1,35 @@
+(ns cortex.test-utils
+  (:require [clojure.core.matrix :as m])
+  (:use [clojure.test]))
+
+(def DEFAULT-TOLERANCE 0.001)
+(def DEFAULT-MAX-TESTS 100)
+
+(defn converges?
+  "Tests if a sequence of array values converges to a target value, with a given tolerance.
+   Returns nil if convergence does not happen, the success value from the sequence if it does."
+  ([sequence target]
+    (converges? sequence target nil))
+  ([sequence target {:keys [tolerance max-tests test-fn hits-needed] :as options}]
+    (let [tolerance (or tolerance DEFAULT-TOLERANCE)
+          max-tests (long (or max-tests DEFAULT-MAX-TESTS))
+          test-fn (or test-fn identity)
+          hits-needed (long (or hits-needed 1))]
+      (loop [i 0
+             hits 0
+             sequence (seq sequence)]
+        (when (< i max-tests)
+          (if-let [v (first sequence)]
+             (if (m/equals target (test-fn v) tolerance) ;; equals with tolerance
+               (if (>= (inc hits) hits-needed)
+                 v
+                 (recur (inc i) (inc hits) (next sequence)))
+               (recur (inc i) 0 (next sequence)))))))))
+
+(deftest test-convergence
+  (is (converges? (range 10) 5))
+  (is (not (converges? [] 5)))
+  (is (not (converges? (range 10) 5 {:hits-needed 2})))
+  (is (converges? (range 10) 5 {:hits-needed 2 :tolerance 1}))
+  (is (not (converges? (range 10) 15)))
+  (is (converges? (range 10) 15 {:tolerance 10})))


tried using lein-npm

tried using lein-npm

... but there's a problem with placing `node_modules` in the target/
dir, since then its package are not found in figwheel.js

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


Basic test for scraped-content function.

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

--- test/clj/freestuffly/test/scraper.clj
+++ test/clj/freestuffly/test/scraper.clj
@@ -0,0 +1,41 @@
+(ns freestuffly.test.scraper
+  (:require [clojure.test :refer :all]
+            [freestuffly.scraper :refer :all]))
+
+(deftest scraped-content-test
+  (testing "Parse content"
+    (let [html "

+

+
+
+                        > OFFER
+
+
 Mon Jul 11 08:55:58 2016

+                      (#55415446)
+
+
+                      Spaypaint (Off East Street Old Kent Road end)

+
See details

+
+

+

+
+
+                      > OFFER
+
+
 Sun Jul 10 22:48:32 2016

+                      (#55410662)
+
+
+
+                        Shelving unit
+
+                      (london, SE1)

+

+                        See details
+

+
+

+
"
+          expected-result "FOUND\n\n\n\n({:href \"https://foo.com\"} [\"Spaypaint\"])"]
+      (is (= expected-result (scraped-content html))))))


Updated unknown gene type assertion rule

Cannot complete rule until I know what SO concept to subclass

error: pathspec 'resources/rules/post_identifier_merge/ice_to_bio/unknown_gene_type_assertions.clj' did not match any file(s) known to git

--- resources/rules/post_identifier_merge/ice_to_bio/unknown_gene_type_assertions.clj
+++ resources/rules/post_identifier_merge/ice_to_bio/unknown_gene_type_assertions.clj
@@ -0,0 +1,21 @@
+;; -----------------------------------------------
+;; --------- Unknown Gene Type Assertion ---------
+;; -----------------------------------------------
+`{:name "unknown-gene-type-assertion"
+  :description "This rule asserts unknown gene type"
+ :head ((?/gene rdfs/subClassOf obo/XXXXXXXXX)) ; unknown maps to kso:DNA_Sequence
+
+ :body ((?/record rdf/type ccp/IAO_EXT_0000681) ; ccp:NCBI_gene_info_record
+       (?/record obo/BFO_0000051 ?/dna_field_value) ; BFO:has_part
+       (?/gene_field_value rdf/type ccp/IAO_EXT_0000876) ; ccp:NCBI_gene_info_record__gene_identifier_field_value
+       (?/gene_field_value rdf/type ?/gene_ice_id)
+       (?/gene_ice_id obo/IAO_0000219 ?/gene) ; IAO:denotes
+
+       ;; retrieve gene type
+       (?/record obo/BFO_0000051 ?/type_field_value) ; BFO:has_part
+       (?/type_field_value rdf/type ccp/IAO_EXT_0000884) ; ccp:NCBI_gene_info_record__type_of_gene_field_value
+       (?/type_field_value rdf/type ?/type_ice_id)
+       (?/type_ice_id obo/IAO_0000219 ?/type) ; IAO:denotes
+
+       (= ?/type "unknown"))
+   }


smaller password reset confirm container

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


First pass at pallet spec for the DB instance

fatal: unable to access 'https://github.com/prathamesh-sonpatki/frontend.git/': The requested URL returned error: 403


new file

new file

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


make project.clj read a little more robust

fixes #379

--- sidecar/src/figwheel_sidecar/config.clj
+++ sidecar/src/figwheel_sidecar/config.clj
@@ -309,10 +309,14 @@
   "This loads the project map form project.clj without merging profiles."
   []
   (if (.exists (io/file "project.clj"))
-    (try
-      (into {} (map vec (partition 2 (drop 3 (read-string (slurp "project.clj"))))))
-      (catch Exception e
-        {}))
+    (->> (str "[" (slurp "project.clj") "]")
+         read-string
+         (filter #(= 'defproject (first %)))
+         first
+         (drop 3)
+         (partition 2)
+         (map vec)
+         (into {}))
     {}))

 (defn project-builds [project]


add reporting for bad-build-ids

add reporting for bad-build-ids

--- sidecar/src/figwheel_sidecar/config.clj
+++ sidecar/src/figwheel_sidecar/config.clj
@@ -627,6 +627,45 @@
   (-> (->lein-project-config-source)
       ->config-data
       all-builds))
+
+;; detect and report bad build ids
+
+(defn suggest-like [thing things]
+  (->> things
+       (map name)
+       (map (juxt #(fuz/ky-distance (name thing) %)
+                  identity))
+       (filter first)
+       (sort-by first)
+       first
+       second))
+
+(defn suggestion [thing things]
+  (when-let [suggest (suggest-like thing things)]
+    (str "  Perhaps you meant " (pr-str suggest))))
+
+#_(suggestion :hey [:heyy])
+
+(defn report-if-bad-build-id [known-build-ids build-id]
+  (when-not ((set (map name known-build-ids)) (name build-id))
+    (throw (ex-info
+            (str "Build Id Error: " (pr-str build-id)
+                 "  is not a build-id in your configuration. \n"
+                 "  Known build ids: " (pr-str (vec known-build-ids)) "\n"
+                 (suggestion build-id known-build-ids) "\n")
+            {:reason :bad-build-id :build-id build-id :known-build-ids known-build-ids}))
+    true))
+
+(defn report-if-bad-build-ids [known-build-ids build-ids]
+  {:pre [(every? (some-fn string? symbol? keyword?) known-build-ids)
+         (every? (some-fn string? symbol? keyword?) build-ids)]}
+  (doseq [build-id build-ids]
+    (report-if-bad-build-id known-build-ids build-id)))
+
+
+#_(report-if-bad-build-ids #{:asdf :a} [:asf])
+
+

 ;; I'm doing a slight adjustment here to make up for the
 ;; :compiler / :build-options ambiguity


major changes and additions

major changes and additions

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


anagrams (clojure); incorrect

anagrams (clojure); incorrect

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

--- src/main/clojure/anagrams/anagrams1.clj
+++ src/main/clojure/anagrams/anagrams1.clj
@@ -0,0 +1,55 @@
+(ns anagrams.anagrams1
+  (:use clojure.test))
+
+(defn read-dictionary-from [file-name]
+  (set (.split (.toLowerCase (slurp file-name)) "\n")))
+
+(defn char-frequencies-of [word]
+  (reduce
+    (fn [map letter] (assoc map letter (+ 1(get map letter 0))))
+    (hash-map)
+    (seq word)
+))
+(defn frequencies-map-of [words]
+  (reduce
+    (fn [map word]
+      (let [word-chars-map (char-frequencies-of word)]
+        (assoc map word-chars-map (cons word (get map word-chars-map (list))))
+    ))
+    (hash-map)
+    words
+))
+(defn find-anagrams-for [word frequencies-map]
+  (remove #(= % word)
+    (get frequencies-map (char-frequencies-of word) (list))
+))
+(defn do-find-anagrams-for [word]
+  (let [word-length (.length word)
+        filtered-words (filter #(= word-length (.length %)) (read-dictionary-from "/usr/share/dict/words"))]
+    (find-anagrams-for word (frequencies-map-of filtered-words))
+))
+
+;(println (count (read-dictionary-from "/usr/share/dict/words")))
+;(println (do-find-anagrams-for "fresher"))
+;(println (do-find-anagrams-for "refresh"))
+
+(deftest should-find-anagrams-using-real-dictionary
+  (is (= ["refresh"] (do-find-anagrams-for "fresher")))
+  (is (= ["fresher"] (do-find-anagrams-for "refresh"))) ; TODO this is broken!
+)
+(deftest should-find-anagrams-for-a-word
+  (is (= [] (find-anagrams-for "aaa" {})))
+  (is (= ["tac"] (find-anagrams-for "cat" (frequencies-map-of ["cat" "tac"]))))
+)
+(deftest should-map-of-words-by-their-frequencies
+  (is (= {} (frequencies-map-of [])))
+  (is (= {{\a 3} ["aaa"]} (frequencies-map-of ["aaa"])))
+  (is (= {{\a 3} ["aaa"], {\b 1 \a 2} ["baa", "aba"]} (frequencies-map-of ["aba" "aaa" "baa"])))
+)
+(deftest should-convert-word-into-char-frequencies
+  (is (= {} (char-frequencies-of "")))
+  (is (= {\a 1} (char-frequencies-of "a")))
+  (is (= {\a 3} (char-frequencies-of "aaa")))
+  (is (= {\a 2, \b 1} (char-frequencies-of "aba")))
+)
+(run-tests)


Add influxdb-9 tests.

Add influxdb-9 tests.

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

--- test/riemann/influxdb_9_test.clj
+++ test/riemann/influxdb_9_test.clj
@@ -0,0 +1,27 @@
+(ns riemann.influxdb-9-test
+  (:use riemann.influxdb-9
+        [riemann.time :only [unix-time]]
+        clojure.test)
+  (:require [riemann.logging :as logging]))
+
+(logging/init)
+
+(deftest ^:influxdb-9 ^:integration influxdb-test
+  (let [k (influxdb {:host (System/getenv "INFLUXDB_HOST")
+                     :database "riemann_test"})]
+    (k {:host "riemann.local"
+        :service "influxdb test"
+        :state "ok"
+        :description "all clear, uh, situation normal"
+        :metric -2
+        :time (unix-time)})
+    (k {:service "influxdb test"
+        :state "ok"
+        :description "all clear, uh, situation normal"
+        :metric 3.14159
+        :time (unix-time)})
+    (k {:host "no-service.riemann.local"
+        :state "ok"
+        :description "Missing service, not transmitted"
+        :metric 4
+        :time (unix-time)})))


create utility macro `defstate`

create utility macro `defstate`

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

--- src/clj/om_next_leaflet/parser.clj
+++ src/clj/om_next_leaflet/parser.clj
@@ -0,0 +1,37 @@
+(ns om-next-leaflet.parser
+  (:require [om.next :as om]))
+
+(defmacro defstate
+  [state-sym]
+  (let [state-name (name state-sym)
+        mutate-sym (symbol (str "app/update-" state-name))
+        new-value-param-sym (symbol (str "new-" state-name))
+        new-value-keyword (keyword (str "app/" state-name))
+        state-sym (symbol "state")
+        underscore (symbol "_")]
+    `(do
+       (defmethod mutate '~mutate-sym
+         [{:keys [~state-sym]} ~underscore {:keys [~new-value-param-sym]}]
+         {:value {:keys [~new-value-keyword]}
+          :action (fn [] (swap! ~state-sym assoc ~new-value-keyword ~new-value-param-sym))}))))
+
+#_"
+;; (defstate stations)
+;; =>
+(defmethod mutate 'app/update-stations
+  [{:keys [state]} _ {:keys [new-stations]}]
+  {:value {:keys [:app/stations]}
+   :action (fn [] (swap! state assoc :app/stations new-stations))})
+
+(defmethod read :app/stations
+  [{:keys [state] :as env} k params]
+  (if-let [v (get @state k)]
+    {:value v}
+    {}))
+"
+
+;; (defstate stations
+;;   :app/stations
+;;   [state state-key new-value]
+;;   {:mutate (swap! state assoc state-key new-value)
+;;    :read (get @state state-key)})


[TH] upgrade cli-time

[TH] upgrade cli-time

Was hoping this would solve an issue where
clj-time.core/equal? couldn't be resolved, it
didn't but left it in anyway


Add track-level project.clj

Add track-level project.clj

Add cheshire as a dependency to parse config.json,
and set `:test-paths` to "_test". The test directory
is prefixed with _ to make it stand out from exercise
directories.

See #64 for discussion.

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

--- project.clj
+++ project.clj
@@ -0,0 +1,6 @@
+(defproject xclojure "0.1.0"
+  :description  "Exercism Exercises in Clojure"
+  :url          "https://github.com/exercism/xclojure"
+  :test-paths   ["_test"]
+  :dependencies [[org.clojure/clojure "1.7.0"]
+                 [cheshire            "5.5.0"]])


removed prinln call

removed prinln call

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


refactor attributes

refactor attributes

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


Removed error logging.

Removed error logging.

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


bump reactor

bump reactor

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


buffering input

buffering input

--- src/sormilla/video.clj
+++ src/sormilla/video.clj
@@ -5,7 +5,7 @@
            [java.awt.image BufferedImage]
            [java.net Socket InetSocketAddress]
            [javax.imageio ImageIO]
-           [java.io InputStream OutputStream ByteArrayInputStream]
+           [java.io InputStream OutputStream ByteArrayInputStream BufferedInputStream]
            [org.apache.commons.io IOUtils])
   (:require [sormilla.bin :as bin]
             [sormilla.drone :as drone]
@@ -92,7 +92,7 @@
       (while (run?)
         (let [socket      (open-socket)
               out         (io/output-stream (io/file (str "sormilla-" (.format (java.text.SimpleDateFormat. "yyyyMMdd-HHmmss") (java.util.Date.)) ".h264")))
-              reader      (make-reader (.getInputStream socket))
+              reader      (make-reader (BufferedInputStream. (.getInputStream socket)))
               decoder     (make-decoder)]
           (try
             (doto (.getOutputStream socket)


Added docker component.

Added docker component.

error: pathspec 'src/cmr/dev/env/manager/components/common/docker.clj' did not match any file(s) known to git

--- src/cmr/dev/env/manager/components/common/docker.clj
+++ src/cmr/dev/env/manager/components/common/docker.clj
@@ -0,0 +1,59 @@
+(ns cmr.dev.env.manager.components.common.docker
+  (:require
+    [cmr.dev.env.manager.components.dem.messaging :as messaging]
+    [cmr.dev.env.manager.config :as config]
+    [cmr.dev.env.manager.process.docker :as docker]
+    [com.stuartsierra.component :as component]
+    [taoensso.timbre :as log]))
+
+(defrecord DockerRunner [
+  builder
+  process-keyword
+  opts-fn
+  opts]
+  component/Lifecycle
+
+  (start [component]
+    (let [cfg (builder (:process-keyword component))
+          component (assoc component :config cfg)
+          opts ((:opts-fn component) component)
+          process-key (:process-keyword component)
+          process-name (name process-key)]
+      (log/infof "Starting %s docker component ..." process-name)
+      (log/debug "Component keys:" (keys component))
+      (log/trace "Built configuration:" cfg)
+      (log/debug "Config:" (:config component))
+      (log/debug "Docker options:" opts)
+      (if (config/service-enabled? component process-key)
+        (do
+          (docker/pull opts)
+          (docker/run opts)
+          (assoc component :enabled true :opts opts))
+        (do
+          (log/debugf (str "Docker service %s not enabled; "
+                           "skipping component start-up.")
+                      process-key)
+          (assoc component :enabled false)))))
+
+  (stop [component]
+    (let [process-key (:process-keyword component)
+          process-name (name process-key)]
+      (log/debug "Process name:" process-name)
+      (log/infof "Stopping %s docker component ..." process-name)
+      (if (config/service-enabled? component process-key)
+        (do
+          (docker/stop (:opts component))
+          component)
+        (do
+          (log/debugf (str "Docker service %s not enabled; "
+                           "skipping component shut-down.")
+                      process-key)
+          component)))))
+
+(defn create-runner-component
+  ""
+  [config-builder-fn process-keyword docker-opts-fn]
+  (map->DockerRunner
+    {:builder config-builder-fn
+     :process-keyword process-keyword
+     :opts-fn docker-opts-fn}))


renamed - > _

renamed - > _

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

--- test/clj/fractals/datalog_text.clj
+++ test/clj/fractals/datalog_text.clj
@@ -0,0 +1,60 @@
+(ns fractals.datalog-test
+  (:require
+   [clojure.test :refer :all]
+   [com.stuartsierra.component :as component]
+   [system.components.datomic :refer [new-datomic-db]]
+   [datomic.api :as d]
+   [clojure.pprint :refer [pprint]]))
+
+(defrecord Datomic-Test [uri conn schema]
+  component/Lifecycle
+  (start [component]
+    (let [uri (str "datomic:mem://" (gensym))
+          db (d/create-database uri)
+          conn (d/connect uri)
+          ]
+      @(d/transact conn schema)
+      (-> component
+          (assoc  :conn conn)
+          (assoc  :uri uri)
+          (assoc :db (d/db conn)))))
+  (stop [component]
+    (when conn (d/release conn))
+    (d/delete-database uri)
+    (assoc component :conn nil)))
+
+(def datomic-mock-db
+  (map->Datomic-Test
+   {:schema
+    [{:db/ident             :todo/title
+      :db/valueType         :db.type/string
+      :db/cardinality       :db.cardinality/one
+      :db/doc               "This is the title of the todo item"}
+     {:db/ident             :todo/completed?
+      :db/valueType         :db.type/boolean
+      :db/cardinality       :db.cardinality/one
+      :db/doc               "if true, this item is done"}]}))
+
+(defn todo-new
+  [title]
+  [{:todo/title        title
+    :todo/completed?   false}])
+
+(defn todo-count
+  [db]
+  (count
+   (d/q '[:find ?t
+          :where [_ :todo/title ?t]]
+        db)))
+
+
+(deftest datomic-lifecycle-mock
+  (testing "Datomic lifecycle operations."
+    (alter-var-root #'datomic-mock-db component/start)
+    (is (= (type (:conn datomic-mock-db))
+           datomic.peer.LocalConnection))
+    (is (:conn datomic-mock-db))
+    (is (= 0 (todo-count (d/db (:conn datomic-mock-db)))))
+    (is (= 1 (let [t @(d/transact (:conn datomic-mock-db) (todo-new "hello world"))]
+               (todo-count (d/db (:conn datomic-mock-db))))))
+    (alter-var-root #'datomic-mock-db component/stop)))


Clean up spec imports.

Clean up spec imports.

--- spec/freefrog/rest_spec.clj
+++ spec/freefrog/rest_spec.clj
@@ -23,7 +23,7 @@
             [clj-http.client :as http-client]
             [freefrog.rest :as r]
             [freefrog.persistence :as p])
-  (:use [ring.adapter.jetty] [ring.util.codec :only [url-encode]])
+  (:use [ring.adapter.jetty])
   (:import [javax.persistence EntityNotFoundException]
            [org.apache.http HttpStatus]))


Add a whole bunch of pending test cases surrounding roles.

--- spec/freefrog/rest_spec.clj
+++ spec/freefrog/rest_spec.clj
@@ -40,9 +40,9 @@
    (http-put-request uri body nil))
   ([uri body options]
    (http-client/put (str "http://localhost:3000" uri)
-                     (merge {:throw-exceptions false
-                             :content-type :json
-                             :body body} options))))
+                    (merge {:throw-exceptions false
+                            :content-type :json
+                            :body body} options))))
 (defn http-post-request
   ([uri body]
    (http-post-request uri body nil))
@@ -127,12 +127,12 @@

       (context "with valid parameters"
         (with create-anchor-circle-response (http-post-request
-                         "/"
-                         (json/generate-string
-                           {:command "anchorCircle",
-                            :params {:name "Test Circle!"
-                                     :lead-link-name "Bill"
-                                     :lead-link-email "bfinn@example.com"}})))
+                                              "/"
+                                              (json/generate-string
+                                                {:command "anchorCircle",
+                                                 :params {:name "Test Circle!"
+                                                          :lead-link-name "Bill"
+                                                          :lead-link-email "bfinn@example.com"}})))
         (before @create-anchor-circle-response)

         (it "should return the location of the newly created resource"
@@ -173,34 +173,64 @@
             (xit "should return the location of the updated resource")))

         (context "with creating a role"
+          (context "with invalid parameters"
+            (xit "should return an error code"))
+
           (context "with valid parameters"
-            (with response (http-post-request
-                             "/"
-                             (json/generate-string
-                               {:command "addRole",
-                                :params {:name "Test Circle!"
-                                         :lead-link-name "Bill"
-                                         :lead-link-email "bfinn@example.com"}})))
+            (with create-role-response (http-post-request
+                                         "/"
+                                         (json/generate-string
+                                           {:command "addRole",
+                                            :params {:name "Test Circle!"
+                                                     :lead-link-name "Bill"
+                                                     :lead-link-email "bfinn@example.com"}})))
+            (before @create-role-response)
             (it "should return the location of the newly created resource"
-                 (should= 201 (:status @response))
-                 (should= (str "/" (url-encode "Test Circle!"))
-                          (get-location @response))))))
-
-      (should-return-4xx "with invalid paramaters"
-                         (fn [] "circles")
-                         (json/generate-string {:foo "Test Circle!"})
-                         400
-                         "IllegalArgumentException")
-      (should-return-4xx "with missing paramaters"
-                         (fn [] "circles")
-                         (json/generate-string {:name "Test Circle!"})
-                         400
-                         "IllegalArgumentException")
-      (should-return-4xx "with malformed JSON"
-                         (fn [] "circles")
-                         "{\"name\" :: \"Bill\""
-                         400
-                         "IOException"))
+              (should= 201 (:status @create-role-response))
+              (should= (str "/" (url-encode "Test Circle!"))
+                (get-location @create-role-response)))
+            (context "with deleting the role"
+              (with delete-response
+                    (http-client/delete (str "http://localhost:3000/"
+                                             (url-encode "Test Circle!"))
+                                        {:throw-exceptions false}))
+              (before @delete-response)
+              (xit "should return a valid response code")
+
+              (context "with requesting the deleted role"
+                (with deleted-get-response
+                      (http-get-request (str "/" (url-encode "Test Circle!"))))
+                (xit "should return a 404.")))
+
+            (context "with updating a role"
+              (with put-response
+                (http-put-request (str "/" (url-encode "Test Circle!"))))
+              (xit "should update the role accordingly"))
+
+            (context "with converting a role to a circle"
+              (with convert-response
+                    (http-post-request
+                      (str "/" (url-encode "Test Circle!"))
+                      (json/generate-string
+                        {:command "convertRoleToCircle"})))
+              (xit "should convert the role to a circle")))))
+
+
+(should-return-4xx "with invalid paramaters"
+                   (fn [] "circles")
+                   (json/generate-string {:foo "Test Circle!"})
+                   400
+                   "IllegalArgumentException")
+(should-return-4xx "with missing paramaters"
+                   (fn [] "circles")
+                   (json/generate-string {:name "Test Circle!"})
+                   400
+                   "IllegalArgumentException")
+(should-return-4xx "with malformed JSON"
+                   (fn [] "circles")
+                   "{\"name\" :: \"Bill\""
+                   400
+                   "IOException"))

 (context "with a created circle"
   (with location (get-location (http-post-request


Improved error reporting for Clojure reader exceptions

If a reader exceptions is thrown, instead of printing the
stack trace to console a easily readable error describing
the error and location is displayed.

--- sidecar/src/figwheel_sidecar/auto_builder.clj
+++ sidecar/src/figwheel_sidecar/auto_builder.clj
@@ -45,14 +45,25 @@
        new-mtimes
        additional-changed-ns))))

+(defmulti report-exception (fn [exception cause] (:type cause)))
+
+(defmethod report-exception :reader-exception [e {:keys [file line column]}]
+  (println (format "ERROR: %s on file %s, line %d, column %d"
+                   (some-> e (.getCause) (.getMessage))
+                   file line column)))
+
+(defmethod report-exception :default [e _]
+  (stack/print-stack-trace e 30))
+
 (defn handle-exceptions [figwheel-server {:keys [build-options exception id] :as build}]
   (println (auto/red (str "Compiling \"" (:output-to build-options) "\" failed.")))
-  (stack/print-stack-trace exception 30)
-  (flush)
-  #_(clj-stacktrace.repl/pst+ exception)
-  (fig/compile-error-occured
-   (merge-build-into-server-state figwheel-server build)
-   exception))
+  (let [cause (ex-data (.getCause exception))]
+    (report-exception exception cause)
+    (flush)
+    #_(clj-stacktrace.repl/pst+ exception)
+    (fig/compile-error-occured
+      (merge-build-into-server-state figwheel-server build)
+      exception)))

 (defn warning [builder warn-handler]
   (fn [build]


Fix the cljs server calls to use ajax.core :params

Instead of doing poor string interpolation, just use the library.

--- src/cljs/word_finder/actions/call_server.cljs
+++ src/cljs/word_finder/actions/call_server.cljs
@@ -3,17 +3,29 @@

 (def server "http://localhost:8080/api/words/")

-;;FIXME: the string interpolation can be easily broken.
-(defn find-words [input-string callback]
-  (GET (str server "find" "?find=" input-string)
-      {:handler       callback
+(defn find-words
+  "Call the server-side find-words, returning JSON"
+  [input-string callback]
+  (GET (str server "find")
+      {:params        {:find input-string}
+       :format        :json
+       :handler       callback
        :error-handler #(println "ERROR" %)}))

-(defn find-anagrams [input-string callback]
-  (GET (str server "anagrams" "?find=" input-string)
-      {:handler       callback
+(defn find-anagrams
+  "Call the server-side find-anangrams, returning JSON"
+  [input-string callback]
+  (GET (str server "anagrams")
+      {:params        {:find input-string}
+       :format        :json
+       :handler       callback
        :error-handler #(println "ERROR!" %)}))

-(defn find-sub-anagrams [input-string callback]
-  (GET (str server "sub-anagrams" "?find=" input-string)
-      {:handler callback}))
+(defn find-sub-anagrams
+  "Call the server-side find-sub-anagrams, returning JSON"
+  [input-string callback]
+  (GET (str server "sub-anagrams")
+      {:params        {:find input-string}
+       :format        :json
+       :handler       callback
+       :error-handler #(println "ERROR!" %)}))


Try blocking `pdoseq`

Try blocking `pdoseq`


Add a test for retry exceptions with no message

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


add ignored file under the  directory... maybe should be renamed

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

--- src/build/keras.clj
+++ src/build/keras.clj
@@ -0,0 +1,8 @@
+(ns build.keras)
+
+(def spec {:name "keras-with-ros"
+           :creator "Jason L. Owens <jason.l.owens.civ@mail.mil>"
+           :description "A Keras development environment with the following
+           additional packages: PCL, mlpack"
+           :base "nvidia/cuda:8.0-cudnn5-devel-ubuntu16.04"
+           :depends #{:keras :pcl :mlpack}})


Add awesome spyscope

Add awesome spyscope

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


Whoops, missed commit

Whoops, missed commit

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

--- src/irobot/io.clj
+++ src/irobot/io.clj
@@ -0,0 +1,10 @@
+(ns irobot.io
+  (:import [java.io InputStream StringWriter]))
+
+
+(defn string-from
+  "Read the contents of an InputStream into a String"
+  [^InputStream st]
+  (with-open [rdr (clojure.java.io/reader st)]
+    (clojure.string/join "\n" (line-seq rdr))))
+


tic tac toe game

tic tac toe game

error: pathspec 'src/tic-tac-toe.clj' did not match any file(s) known to git

--- src/tic-tac-toe.clj
+++ src/tic-tac-toe.clj
@@ -0,0 +1,37 @@
+(use '[clojure.pprint :only (pprint)])
+(use '[clojure.string :only (join)])
+
+;; 2 players: X, O
+
+;; 1 random how start: x or o
+;; 2 show clear table
+;; 3 get player input: where to put its char
+;; 4 check if player win
+
+(def array [[nil nil nil] [nil nil nil] [nil nil nil]])   ; todo - how to auto generate it
+;; (clojure.pprint/pprint arry)
+
+(def arry (make-array Integer/TYPE 3 3))
+;; (pprint arry)
+
+;; (for [_ (range 3)] [nil nil nil])
+(for [_ (range 3)] (for [_ (range 3)] nil))
+
+; o|o|o
+; -----
+; o|o|o
+; -----
+; o|o|o
+;; (defn print-tabl [table]
+;;   (doseq [row table]
+;;     (println
+;;       (join "|"
+;;             (map #(if (nil? %) " " %) row)))))
+
+(defn join-row [row]
+  (join "|" (map #(if (nil? %) " " %) row)))
+
+(defn print-tabl [table]
+  (map #(join "-----\n" (join-row %)) table))
+
+(print (print-tabl array))


Create aliases from a measurements file

Create aliases from a measurements file

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

--- src/kixi/hecuba/data/measurements/aliases.clj
+++ src/kixi/hecuba/data/measurements/aliases.clj
@@ -0,0 +1,19 @@
+(ns kixi.hecuba.data.measurements.aliases
+  (:require [clj-time.format :as tf]
+            [clojure.data.csv :as csv]
+            [clojure.java.io :as io]
+            [clojure.string :as str]
+            [kixi.hecuba.data.measurements.core :refer (transpose)]
+            [kixi.hecuba.data.measurements.upload :refer (date-parser)]))
+
+(defn from-file [filename date-format]
+  (let [blank-row?    (fn [cells] (every? #(re-matches #"\s*" %) cells))
+        date-parser   (fn [d] (try ((date-parser date-format) d) (catch Throwable t nil)))
+        invalid-date? (complement date-parser)
+        header-rows   (with-open [in (io/reader (io/file filename))]
+                        (->> in
+                             (csv/read-csv)
+                             (take-while (comp invalid-date? first))
+                             (remove blank-row?)
+                             (doall)))]
+    (mapv (partial str/join \|) (rest (transpose header-rows)))))


Correct URL.

Correct URL.

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


fix tests

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


Fix teams tests

Fix teams tests


Add tests over oxcart.passes/*

Add tests over oxcart.passes/*

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

--- test/oxcart/passes_test.clj
+++ test/oxcart/passes_test.clj
@@ -0,0 +1,87 @@
+(ns oxcart.passes-test
+  (:require [oxcart.passes :refer :all]
+            [clojure.test :refer :all]))
+
+
+(deftest whole-ast->modules-tests
+  (is (= [{:foo :bar}]
+         (-> {:modules [:baz]
+              :baz {:foo :bar}}
+             whole-ast->modules
+             vec))))
+
+
+(deftest whole-ast->forms-tests
+  (is (= [{:foo :bar}
+          {:foo :quxx}]
+         (-> {:modules [:baz]
+              :baz {:forms [{:foo :bar}
+                            {:foo :quxx}]}}
+             whole-ast->forms
+             vec))))
+
+
+(deftest update-forms-tests
+  (is (= {:modules [:baz]
+          :baz {:forms [2]}}
+         (-> {:modules [:baz]
+              :baz {:forms [1]}}
+             (update-forms inc)))))
+
+
+(defn pass-one [ast {:keys [log] :as options}]
+  (when log
+    (swap! log conj pass-one))
+
+  (-> ast
+      (update-forms inc)
+      (record-pass pass-one)))
+
+
+(deftest record-pass-tests
+  (is (= #{pass-one}
+         (-> {:modules [:baz]
+              :baz {:forms [1]}}
+             (pass-one {})
+             :passes))))
+
+
+(defn pass-two [ast {:keys [log] :as options}]
+  (when log
+    (swap! log conj pass-two))
+
+  (-> ast
+      (require-pass pass-one options)
+      (update-forms dec)
+      (record-pass pass-two)))
+
+
+(deftest require-pass-tests
+  (is (= #{pass-one
+           pass-two}
+         (-> {:modules [:baz]
+              :baz {:forms [1]}}
+             (pass-two {})
+             :passes))))
+
+
+(deftest do-passes-tests
+  (is (let [log (atom [])]
+        (= [pass-two pass-one]
+           (do (-> {:modules [:baz]
+                    :baz {:forms [1]}}
+                   (do-passes {:log log}
+                              pass-two
+                              pass-one))
+               (vec @log))))))
+
+
+(deftest clobber-passes-tests
+  (is (= #{}
+         (-> {:modules [:baz]
+              :baz {:forms [1]}}
+             (do-passes {}
+                        pass-two
+                        pass-one)
+             (clobber-passes)
+             :passes))))


Unit test

Unit test

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

--- test/transom/core_test.cljx
+++ test/transom/core_test.cljx
@@ -0,0 +1,26 @@
+(ns transom.core-test
+  (:require [transom.core :as transom]
+            [clojure.test :refer :all]
+            [clojure.test.check.clojure-test :refer [defspec]]
+            [clojure.test.check :as check]
+            [clojure.test.check.generators :as gen]
+            [clojure.test.check.properties :as prop]))
+
+(deftest compose-test
+  (let [doc {:strings ["a" "b" "c"]}
+        edit-1 {[:strings 0] [[:insert "yod"] [:retain 1]]}
+        edit-2 {[:strings 0] [[:retain 4] [:insert " is dead"]]}
+        edit-3 {[:strings 1] [[:delete 1]]}
+        edit-4 {[:strings] [[:delete 1] [:retain 2]]}
+        result-1 {[:strings 0] [[:insert "yod"] [:retain 1] [:insert " is dead"]]}]
+    (is (= (transom/compose doc edit-1 edit-2)
+           result-1))
+    (is (= (transom/compose doc edit-1 edit-3)
+           (merge edit-1 edit-3)))
+    (is (= (transom/compose doc edit-1 edit-2 edit-3)
+           (merge result-1 edit-3)))
+    (is (= (transom/compose doc edit-1 edit-4)
+           edit-4))
+    (is (= (transom/compose doc edit-3 edit-4)
+           {[:strings] [[:delete 1] [:retain 2]]
+            [:strings 0] [[:delete 1]]}))))


Rewrite design URIs for contents of js and for favicon.ico.

--- src/app/clj/one/sample/dev_server.clj
+++ src/app/clj/one/sample/dev_server.clj
@@ -47,9 +47,8 @@

 (defn- rewrite-design-uris [handler]
   (fn [{:keys [uri] :as request}]
-    (if (or (.startsWith uri "/design/css")
-            (.startsWith uri "/design/javascripts")
-            (.startsWith uri "/design/images"))
+    (if (some true? (map #(.startsWith uri (str "/design/" %))
+                         ["css" "javascripts" "images" "js" "favicon.ico"]))
       (handler (assoc request :uri (.substring uri 7)))
       (handler request))))


wrote a serial port communication module

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

--- src/kondo_lisp/serial.clj
+++ src/kondo_lisp/serial.clj
@@ -0,0 +1,91 @@
+;; -*- indent-tabs-mode: nil; mode: clojure  -*-
+
+(ns kondo-lisp.serial
+  (:use [clojure core]
+        [clojure.contrib str-utils java-utils pprint])
+  (:import (gnu.io CommPort
+                   CommPortIdentifier
+                   SerialPort)
+           (java.io FileDescriptor
+                    IOException
+                    InputStream
+                    OutputStream)))
+
+(def *serial* (ref nil))
+(def *serial-config* (ref {:port-name "/dev/ttyUSB0",
+                           :baud-rate 9600,
+                           :app-name "kondo-lisp"}))
+
+(defn set-serial-config [config]
+  (dosync
+   (ref-set *serial-config* (merge config *serial-config*))))
+
+(defn open-serial []
+  (let [serial-config @*serial-config*,
+        ident (CommPortIdentifier/getPortIdentifier (:port-name serial-config))]
+    (when (.isCurrentlyOwned ident)
+      (throw (IOException. (format "%s is busy" (:port-name serial-config)))))
+    (let [comm-port (.open ident (:app-name serial-config) 3000)]
+      (when (not (instance? SerialPort comm-port))
+        (throw (IOException. (format "%s is not a serial port" (:port-name serial-config)))))
+      (.setSerialPortParams comm-port,
+                            (:baud-rate serial-config),
+                            SerialPort/DATABITS_8,
+                            SerialPort/STOPBITS_1,
+                            SerialPort/PARITY_NONE)
+      (dosync (ref-set *serial* comm-port)))))
+
+(defn close-serial []
+  (let [serial @*serial*]
+    (when serial
+      (.close serial)
+      (dosync (ref-set *serial* nil)))))
+
+(defn read-serial [nbytes]
+  (let [serial @*serial*]
+    (when serial
+      (let [in (.getInputStream serial),
+            buf (make-array (. Byte TYPE) nbytes),
+            len (.read in buf)]
+        (if (> len -1)
+          [(String. buf, 0, len) len]
+          nil)))))
+
+(defn read-until [& rest]
+  (let [serial @*serial*,
+        term-byte (if (nil? rest)
+                    (byte 0)
+                    (byte (first rest)))]
+    (when serial
+      (let [in (.getInputStream serial)
+            ret (StringBuffer.)
+            buf (make-array (. Byte TYPE) 1024)]
+        (dorun
+         (take-while
+          #(not (nil? %))
+          (iterate
+           (fn [accum-len]
+             (let [len (.read in buf)]
+               (cond
+                (= len -1)	nil
+                (= len 0)	accum-len
+                true		(if (.equals term-byte (aget buf (- len 1)))
+                                  (do (.append ret (String. buf, 0, (- len 1)))
+                                      nil)
+                                  (do (.append ret (String. buf, 0, len))
+                                      (+ accum-len len))))))
+           0)))
+        (.toString ret)))))
+
+(defn to-byte-array [coll]
+  (let [bytes (map byte coll)
+        ret (make-array (. Byte TYPE) (count coll))]
+    (dotimes [i (count coll)]
+      (aset ret i (nth bytes i)))
+    ret))
+
+(defn write-serial [bytes]
+  (let [serial @*serial*]
+    (when serial
+      (let [out (.getOutputStream serial)]
+        (.write out (to-byte-array bytes))))))


profile modal

profile modal

error: pathspec 'src/cljs/salava/profile/ui/modal.cljs' did not match any file(s) known to git

--- src/cljs/salava/profile/ui/modal.cljs
+++ src/cljs/salava/profile/ui/modal.cljs
@@ -0,0 +1,104 @@
+(ns salava.profile.ui.modal
+ (:require [salava.core.ui.ajax-utils :as ajax]
+  [reagent.core :refer [atom cursor]]
+  [reagent.session :as session]
+  [salava.core.ui.error :as err]
+  [salava.core.ui.helper :refer [path-for hyperlink]]
+  [salava.profile.ui.profile :as p]
+  [salava.profile.ui.block :as b]
+  [salava.core.i18n :refer [t]]
+  [salava.profile.schemas :refer [additional-fields]]
+  [salava.profile.ui.helper :as ph]
+  [salava.admin.ui.reporttool :refer [reporttool1]]))
+
+(defn view-profile [state]
+ (let [blocks (cursor state [:blocks])
+       {badges :badges pages :pages owner? :owner? {first_name :first_name last_name :last_name profile_picture :profile_picture about :about} :user profile :profile user-id :user-id} @state
+       fullname (str first_name " " last_name)]
+   [:div {:id "profile"}
+    (if-not owner?
+      [:div.col-xs-12 [:div.pull-right
+                       (p/connect-user user-id)]])
+    [:div#page-view
+       [:div {:id (str "theme-" (or @(cursor state [:theme]) 0))
+              :class "page-content"}
+             [:div.panel-left
+              [:div.panel-right
+               [:div.panel-content
+                 [:div.panel-body
+                  [:div.col-xs-12
+                   [:h1.uppercase-header fullname]
+                   [:div.row.flip
+                    [:div {:class "col-md-3 col-sm-3 col-xs-12"}
+                     [:div.profile-picture-wrapper
+                      [:img.profile-picture {:src (b/profile-picture profile_picture)
+                                             :alt fullname}]]]
+                    [:div {:class "col-md-9 col-sm-9 col-xs-12"}
+                     (if (not-empty about)
+                       [:div {:class "row about"}
+                        [:div.col-xs-12 [:b (t :user/Aboutme) ":"]]
+                        [:div.col-xs-12 about]])
+                     (if (not-empty profile)
+                       [:div.row
+                        [:div.col-xs-12 [:b (t :user/Contactinfo) ":"]]
+                        [:div.col-xs-12
+                         [:table.table
+                          (into [:tbody]
+                                (for [profile-field (sort-by :order profile)
+                                      :let          [{:keys [field value]} profile-field
+                                                     key (->> additional-fields
+                                                              (filter #(= (:type %) field))
+                                                              first
+                                                              :key)]]
+                                  [:tr
+                                   [:td.profile-field (t key) ":"]
+                                   [:td.field-value (cond
+                                                     (or (re-find #"www." (str value)) (re-find #"^https?://" (str value)) (re-find #"^http?://" (str value))) (hyperlink value)
+                                                     (and (re-find #"@" (str value)) (= "twitter" field))                                                      [:a {:href (str "https://twitter.com/" value) :target "_blank" } (t value)]
+                                                     (and (re-find #"@" (str value)) (= "email" field))                                                        [:a {:href (str "mailto:" value)} (t value)]
+                                                     (and  (empty? (re-find #" " (str value))) (= "facebook" field))                                           [:a {:href (str "https://www.facebook.com/" value) :target "_blank" } (t value)]
+                                                     (= "twitter" field)                                                                                [:a {:href (str "https://twitter.com/" value) :target "_blank" } (t value)]
+                                                     (and  (empty? (re-find #" " (str value))) (= "pinterest" field))                                          [:a {:href (str "https://www.pinterest.com/" value) :target "_blank" } (t value)]
+                                                     (and  (empty? (re-find #" " (str value))) (= "instagram" field))                                          [:a {:href (str "https://www.instagram.com/" value) :target "_blank" } (t value)]
+                                                     (= "blog" field)                                                                                (hyperlink value)
+                                                     :else                                                                                (t value))]]))]]])]
+                    (into [:div#profile]
+                          (for [index (range (count @blocks))]
+                            [:div.row
+                             [:div.col-xs-12 (ph/block (cursor blocks [index]) state index)]]))]]]]]]]]
+    [:div.col-xs-12 {:style {:margin-top "10px"}} [reporttool1 user-id fullname "user"]]]))
+
+
+
+(defn content [state]
+  [view-profile state])
+
+(defn init-data [id state]
+ (ajax/GET
+  (path-for (str "/obpv1/profile/" id) true)
+  {:handler (fn [data]
+             (swap! state assoc :permission "success")
+             (swap! state merge data))}))
+
+
+(defn handler [params]
+  (let [user-id (:user-id params)
+        state (atom {:user-id (:user-id params)
+                     :permission "initial"
+                     :badge-small-view false
+                     :pages-small-view true
+                     :active-index 0})
+        user (session/get :user)]
+    (init-data user-id state)
+
+    (fn []
+      (cond
+        (= "initial" (:permission @state)) [:div ""]
+        (and user (= "error" (:permission @state)))(err/error-content)
+        (= "error" (:permission @state)) (err/error-content)
+        (= (:id user) (js/parseInt user-id)) (content state)
+        (and (= "success" (:permission @state)) user)(content state)
+        :else (content state)))))
+
+(def ^:export modalroutes
+ {:profile {:view handler}})


Fixed typo in docstring

Fixed typo in docstring

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


cleanup

cleanup

--- test/metabase/driver/query_processor_test.clj
+++ test/metabase/driver/query_processor_test.clj
@@ -999,36 +999,36 @@
     [[446
       {:mentions ["@cams_mexican_gastro_pub"], :tags ["#mexican" "#gastro" "#pub"], :service "twitter", :username "kyle"}
       "Cam's Mexican Gastro Pub is a historical and underappreciated place to conduct a business meeting with friends."
-      {:large "http://cloudfront.net/6e3a5256-275f-4056-b61a-25990b4bb484/large.jpg",
+      {:large  "http://cloudfront.net/6e3a5256-275f-4056-b61a-25990b4bb484/large.jpg",
        :medium "http://cloudfront.net/6e3a5256-275f-4056-b61a-25990b4bb484/med.jpg",
-       :small "http://cloudfront.net/6e3a5256-275f-4056-b61a-25990b4bb484/small.jpg"}
+       :small  "http://cloudfront.net/6e3a5256-275f-4056-b61a-25990b4bb484/small.jpg"}
       {:phone "415-320-9123", :name "Cam's Mexican Gastro Pub", :categories ["Mexican" "Gastro Pub"], :id "bb958ac5-758e-4f42-b984-6b0e13f25194"}]
      [230
       {:mentions ["@haight_european_grill"], :tags ["#european" "#grill"], :service "twitter", :username "kyle"}
       "Haight European Grill is a horrible and amazing place to have a birthday party during winter."
-      {:large "http://cloudfront.net/1dcef7de-a1c4-405b-a9e1-69c92d686ef1/large.jpg",
+      {:large  "http://cloudfront.net/1dcef7de-a1c4-405b-a9e1-69c92d686ef1/large.jpg",
        :medium "http://cloudfront.net/1dcef7de-a1c4-405b-a9e1-69c92d686ef1/med.jpg",
-       :small "http://cloudfront.net/1dcef7de-a1c4-405b-a9e1-69c92d686ef1/small.jpg"}
+       :small  "http://cloudfront.net/1dcef7de-a1c4-405b-a9e1-69c92d686ef1/small.jpg"}
       {:phone "415-191-2778", :name "Haight European Grill", :categories ["European" "Grill"], :id "7e6281f7-5b17-4056-ada0-85453247bc8f"}]
      [319
       {:mentions ["@haight_soul_food_pop_up_food_stand"], :tags ["#soul" "#food" "#pop-up" "#food" "#stand"], :service "twitter", :username "kyle"}
       "Haight Soul Food Pop-Up Food Stand is a underground and modern place to have breakfast on a Tuesday afternoon."
-      {:large "http://cloudfront.net/8f613909-550f-4d79-96f6-dc498ff65d1b/large.jpg",
+      {:large  "http://cloudfront.net/8f613909-550f-4d79-96f6-dc498ff65d1b/large.jpg",
        :medium "http://cloudfront.net/8f613909-550f-4d79-96f6-dc498ff65d1b/med.jpg",
-       :small "http://cloudfront.net/8f613909-550f-4d79-96f6-dc498ff65d1b/small.jpg"}
+       :small  "http://cloudfront.net/8f613909-550f-4d79-96f6-dc498ff65d1b/small.jpg"}
       {:phone "415-741-8726", :name "Haight Soul Food Pop-Up Food Stand", :categories ["Soul Food" "Pop-Up Food Stand"], :id "9735184b-1299-410f-a98e-10d9c548af42"}]
      [224
       {:mentions ["@pacific_heights_free_range_eatery"], :tags ["#free-range" "#eatery"], :service "twitter", :username "kyle"}
       "Pacific Heights Free-Range Eatery is a wonderful and modern place to take visiting friends and relatives Friday nights."
-      {:large "http://cloudfront.net/cedd4221-dbdb-46c3-95a9-935cce6b3fe5/large.jpg",
+      {:large  "http://cloudfront.net/cedd4221-dbdb-46c3-95a9-935cce6b3fe5/large.jpg",
        :medium "http://cloudfront.net/cedd4221-dbdb-46c3-95a9-935cce6b3fe5/med.jpg",
-       :small "http://cloudfront.net/cedd4221-dbdb-46c3-95a9-935cce6b3fe5/small.jpg"}
+       :small  "http://cloudfront.net/cedd4221-dbdb-46c3-95a9-935cce6b3fe5/small.jpg"}
       {:phone "415-901-6541", :name "Pacific Heights Free-Range Eatery", :categories ["Free-Range" "Eatery"], :id "88b361c8-ce69-4b2e-b0f2-9deedd574af6"}]]
   (Q run against geographical-tips using mongo
      return :data :rows
      aggregate rows of tips
      filter and = source...service "twitter"
-                = source...username "kyle"
+     = source...username "kyle"
      order venue...name))

 ;; Nested Field in AGGREGATION


Integration tests

Integration tests

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

--- test/ruuvi_server/integration_test/server.clj
+++ test/ruuvi_server/integration_test/server.clj
@@ -0,0 +1,72 @@
+(ns ruuvi-server.integration-test.server
+  (:require  [ruuvi-server.database.entities :as entities]
+             [ruuvi-server.configuration :as conf])
+  (:use [ruuvi-server.launcher :only (start-server migrate)]
+        [clojure.tools.logging :only (debug info warn error)]
+        [ruuvi-server.database.event-dao]
+        [midje.sweet :only (fact throws)]
+        )
+  )
+
+(def pre-config {:environment :dev
+
+             :database {:classname "org.h2.Driver"
+                        :subprotocol "h2"
+                        ;; DB_CLOSE_DELAY keeps db around until JVM
+                        ;; shuts down
+                        :subname "mem:integration_tests;DB_CLOSE_DELAY=-1"
+                        :user "sa"
+                        :password ""
+                        }
+             :server {
+                      :type :standalone
+                      :engine :aleph
+                      :port 8888
+                      :max-threads 80
+                      :enable-gzip true
+                      }
+             :tracker-api {:require-authentication false
+                           :allow-tracker-creation true
+                           }
+             :client-api {:default-max-search-results 100
+                          :allowed-max-search-results 1000
+                          }
+             }
+  )
+
+(def config (conf/post-process-config :dev pre-config))
+(conf/init-config config)
+
+(info "initializing Korma...")
+(entities/init config)
+(info "Korma initialized")
+
+(info "execute database migrations...")
+(migrate config [:forward])
+(info "database done")
+
+
+(info "fetching stuff from empty database should return empty results")
+(fact (get-trackers [1 2 3]) => '())
+(fact (get-all-trackers) => '())
+(fact (get-tracker 42) => nil)
+(fact (get-event-sessions {:tracker_ids [1 2 3] :event_session_ids [4 5 6]}) => '())
+(fact (get-extension-type-by-id 2) => nil)
+(fact (get-extension-type-by-name "name") => nil)
+(fact (get-event 2) => nil)
+(fact (get-events [1 2 3]) => '())
+(fact (get-all-events) => '())
+
+(fact (search-events {}) => '())
+
+
+;; return value of start-server, kills the server
+(info "starting server...")
+(def kill-server (start-server config))
+(info "server started")
+
+(info "stopping server...")
+@(kill-server)
+(info "server stopped")
+
+


Add Utils test file, don't have anything to put in it yet.

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

--- test/hydrofoil/expectations/utils.clj
+++ test/hydrofoil/expectations/utils.clj
@@ -0,0 +1,7 @@
+(ns hydrofoil.expectations.model
+  (:require [expectations :refer :all]
+            [hydrofoil.model :refer :all]
+            [hydrofoil.core :refer :all]
+            [hydrofoil.evolution :refer :all]))
+
+;;; --------- Utils Tests ------------


Add my test program

Add my test program

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

--- src/hello.clj
+++ src/hello.clj
@@ -0,0 +1,6 @@
+(ns hello)
+
+(defn -main []
+   (. (. System out)
+      (println "Hello, World!"))
+   (. System (exit (int 0))))


Alias pedestal.interceptor ns in user handlers

Trying to minimize the occurence of my :refer usage.

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


Test post-statements

Test post-statements

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


Add :take "method" to pod pool service (fixes #142)

--- boot/pod/src/boot/pod.clj
+++ boot/pod/src/boot/pod.clj
@@ -328,7 +328,10 @@
     (doto (Thread. fill) (.setDaemon true) (.setPriority pri) .start)
     (fn
       ([] (take))
-      ([op] (case op :refresh (do (swap) (take)) :shutdown (stop))))))
+      ([op] (case op
+              :shutdown (stop)
+              :take     @(.take q)
+              :refresh  (do (swap) (take)))))))

 (defn- init-pod!
   [env pod]


updated lein profiles

updated lein profiles

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


temporarily fix autopay determination

temporarily fix autopay determination

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


override bifrost's default timeout

override bifrost's default timeout

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


working async macros

working async macros

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

--- src/clj/infinitelives/utils/async.clj
+++ src/clj/infinitelives/utils/async.clj
@@ -0,0 +1,65 @@
+(ns infinitelives.utils.async
+  (:require [cljs.core.async.macros :as m]
+            [cljs.core.async.macros :refer [go]]))
+
+;; macros for more convenient game async
+(defmacro <!* [test & body]
+  `(let [result# (cljs.core.async/<! ~@body)]
+     (if ~test
+       result#
+       (throw (js/Error "go-while exit")))))
+
+(defmacro >!* [test & body]
+  `(let [result# (cljs.core.async/>! ~@body)]
+     (if ~test
+       result#
+       (throw (js/Error "go-while exit")))))
+
+(defn thread-test-around-sync-points [test body]
+  (if (sequential? body)
+    (let [[head & tail] body]
+      (condp = head
+        ;; thread test condition around <!
+        '<!
+        (thread-test-around-sync-points
+         test
+         (conj tail test 'infinitelives.utils.async/<!*))
+
+        ;; thread test condition around >!
+        '>!
+        (thread-test-around-sync-points
+         test
+         (conj tail test 'infinitelives.utils.async/>!*))
+
+        ;; other head
+        (for [form body]
+          (cond
+            ;; recurse through subforms of a vector
+            (vector? form)
+            (into []
+                  (thread-test-around-sync-points test form))
+
+            ;; recurse through this full s-exp form
+            (sequential? form)
+            (thread-test-around-sync-points test form)
+
+            ;; handle hashmap literals
+            (map? form)
+            (into {}
+                  (for [[k v] form]
+                   [(thread-test-around-sync-points test k)
+                    (thread-test-around-sync-points test v)]))
+
+            ;; default is leave code unchanged
+            :default form))))
+    body))
+
+(defmacro go-while [test & body]
+  `(go
+     ~(thread-test-around-sync-points test body)))
+
+(defmacro continue-while [test & body]
+  `(try
+     ~(thread-test-around-sync-points test body)
+     (catch js/Error e
+       (js/console.log "continue-while exit triggered by: " e))))


Port over built in attribute definitions

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


[EN] Add `testing` forms to tests for more information.

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


Fixed typesetting around terminating punctuation

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/hudren/ebook-novel.git/'


Revert "Remove unused schema definitions"

This reverts commit bf3a729a3eefd8ee07a0540d4b1408728d2dde6d.

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


added a wee bit of code

added a wee bit of code

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

--- code/clj/nihil.clj
+++ code/clj/nihil.clj
@@ -0,0 +1,10 @@
+(def x (set '(nil)))
+
+(defn test-null
+    [x]
+    (empty x)
+    (not-empty x)
+    (true? x)
+    (false? x))
+
+(test-null x)


test fix

test fix

--- src/metabase/models/hydrate.clj
+++ src/metabase/models/hydrate.clj
@@ -227,11 +227,11 @@
               (map var-get)
               (filter (u/fn-> type (= :korma.core/Entity)))
               (filter :hydration-keys)
-              (mapcat (fn [{:keys [batched-hydration-keys] :as entity}]
-                        (assert (and (set? batched-hydration-keys) (every? keyword? batched-hydration-keys))
+              (mapcat (fn [{:keys [hydration-keys] :as entity}]
+                        (assert (and (set? hydration-keys) (every? keyword? hydration-keys))
                                 (str ":hydration-keys should be a set of keywords. In: " entity))
                         (map (u/rpartial vector entity)
-                             batched-hydration-keys)))
+                             hydration-keys)))
               (into {}))))

 (def ^:private batched-hydration-keys
@@ -267,54 +267,23 @@
 ;; At a high level, these functions let you aggressively flatten a sequence of maps by a key
 ;; so you can apply some function across it, and then unflatten that sequence.
 ;;
-;; __In Depth__
-;;
-;; The basic principle is this: take a sequence like
-;;
-;;     (def results [{:a [{:b 1} {:b 2}], :c 2} ; :a is a sequence of maps
-;;                   {:a {:b 3}, :c 4}])        ; :a is a single map
-;;
-;; Then use `counts-of` to get a sequence that can remember how to unflatten it later:
-;;
-;;     (counts-of results :a) -> [2 :atom]
-;;
-;; Flatten the results with `counts-flatten` (notice how the sequence is totally flattened):
-;;
-;;     (counts-flatten results :a) -> [{:b 1} {:b 2} {:b 3}]
-;;
-;; Then modify the flattened results as needed
-;;
-;;     (def modified-results (update-in results [:b] (partial * 2)))
-;;       -> [{:b 2} {:b 4} {:b 6}])
-;;
-;;  Unflatten by passing the modified results and the sequence from `counts-of` to `counts-unflatten`:
-;;
-;;     (def unflattened-results
-;;       (counts-unflatten modified-results :a [2 :atom]))
-;;         -> [{:a [{:b 2} {:b 4}]}
-;;             {:a {:b 6}}]
-;;
-;; At which point you can `map merge` modifications with the original results:
-;;
-;;     (map merge results unflattened-results)
-;;       -> [{:a [{:b 2} {:b 4}], :c 2}
-;;           {:a {:b 3}, :c 4}]
-;;
-;; Which will give you the origin results.
-;; `counts-apply` conveniently combines all of these steps for you:
-;;
-;;     (counts-apply results :a #(update-in % [:b] (partial * 2)))
-;;       -> [{:a [{:b 2} {:b 4}], :c 2}
-;;           {:a {:b 3}, :c 4}]
+;; 1.  Get a value that can be used to unflatten a sequence later with `counts-of`.
+;; 2.  Flatten the sequence with `counts-flatten`
+;; 3.  Modify the flattened sequence as needed
+;; 4.  Unflatten the sequence by calling `counts-unflatten` with the modified sequence value from step 1
+;; 5.  `map merge` the original sequence and the unflattened sequence.
+;;
+;; For your convenience `counts-apply` combines these steps for you.

 (defn- counts-of
   "Return a sequence of counts / keywords that can be used to unflatten
    COLL later.

-    (counts-of [{:f [:a :b]}, {:f {:c 1}}, {:f nil}] :f)
-      -> [2 :atom nil]
-
-   For each `x` in return:
+    (counts-of [{:a [{:b 1} {:b 2}], :c 2}
+                {:a {:b 3}, :c 4}] :a)
+      -> [2 :atom]
+
+   For each `x` in COLL, return:

    *  `(count (k x))` if `(k x)` is sequential
    *  `:atom`         if `(k x)` is otherwise non-nil
@@ -330,7 +299,11 @@
        coll))

 (defn- counts-flatten
-  "Flatten COLL by K."
+  "Flatten COLL by K.
+
+    (counts-flatten [{:a [{:b 1} {:b 2}], :c 2}
+                     {:a {:b 3}, :c 4}] :a)
+      -> [{:b 1} {:b 2} {:b 3}]"
   [coll k]
   {:pre [(sequential? coll)
          (keyword? k)]}
@@ -340,22 +313,20 @@
                  (if (sequential? x)  x
                      [x])))))

-(defn- counts-unflatten-1
-  "Unflatten a single item in COLL using one count value.
-  (Recursively called by `counts-unflatten`)."
-  [coll count]
-  (condp = count
-    nil   [nil (rest coll)]
-    :atom [(first coll) (rest coll)]
-    :nil  [:nil (rest coll)]
-    (split-at count coll)))
-
 (defn- counts-unflatten
-  "Unflatten COLL by K using COUNTS from `counts-of`."
+  "Unflatten COLL by K using COUNTS from `counts-of`.
+
+    (counts-unflatten [{:b 2} {:b 4} {:b 6}] :a [2 :atom])
+      -> [{:a [{:b 2} {:b 4}]}
+          {:a {:b 6}}]"
   ([coll k counts]
    (counts-unflatten [] coll k counts))
   ([acc coll k [count & more]]
-   (let [[unflattend coll] (counts-unflatten-1 coll count)
+   (let [[unflattend coll] (condp = count
+                             nil   [nil (rest coll)]
+                             :atom [(first coll) (rest coll)]
+                             :nil  [:nil (rest coll)]
+                             (split-at count coll))
          acc (conj acc unflattend)]
      (if-not (seq more) (map (fn [x]
                                (when x
@@ -364,7 +335,14 @@
              (recur acc coll k more)))))

 (defn- counts-apply
-  "Apply F to values of COLL flattened by K, then return unflattened/updated results."
+  "Apply F to values of COLL flattened by K, then return unflattened/updated results.
+
+    (counts-apply [{:a [{:b 1} {:b 2}], :c 2}
+                   {:a {:b 3}, :c 4}]
+      :a #(update-in % [:b] (partial * 2)))
+
+      -> [{:a [{:b 2} {:b 4}], :c 2}
+          {:a {:b 3}, :c 4}]"
   [coll k f]
   (let [counts (counts-of coll k)
         new-vals (-> coll


Update defaults

Update defaults


new string funcs

new string funcs

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

--- src/cljs/infinitelives/utils/string.cljs
+++ src/cljs/infinitelives/utils/string.cljs
@@ -0,0 +1,10 @@
+(ns infinitelives.utils.string)
+
+(defn ends-with? [str end]
+  (let [len (.-length str)
+        end-len (.-length end)
+        pos (.indexOf str end)]
+    (= (+ pos end-len) len)))
+
+(defn starts-with? [str start]
+  (= 0 (indexOf str start)))


make full-width on non-desktop

make full-width on non-desktop


Ensure :boot.util/omit-stacktrace? is preserved

Merges the `ex-data` of the cause exception into the newly thrown exception to ensure exception data is preserved. In particular, ensures `:boot.util/omit-stacktrace?` is passed on through.

--- boot/core/src/boot/main.clj
+++ boot/core/src/boot/main.clj
@@ -219,4 +219,4 @@
                        c (.getCause cx)
                        m (.getMessage (or c cx))
                        x (or c cx)]
-                   (throw (ex-info m (sorted-map :line l) x))))))))))
+                   (throw (ex-info m (merge (sorted-map :line l) (ex-data c) x))))))))))


Mucking around with leiningen plugins, to no avail

error: pathspec 'reimann/leiningen/build.clj' did not match any file(s) known to git

--- reimann/leiningen/build.clj
+++ reimann/leiningen/build.clj
@@ -0,0 +1,7 @@
+(ns leiningen.build)
+
+(defn build [project & args]
+  "Build everything! Yay!"
+  (leiningen.compile/compile project)
+  (leiningen.protobuf/compile project)
+  (leiningen.javac/javac project))


clean up namespace

clean up namespace


create array that contains jewel types

create array that contains jewel types

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

--- src/bejeweled_bot/pixel_sampler.clj
+++ src/bejeweled_bot/pixel_sampler.clj
@@ -0,0 +1,34 @@
+(ns bejeweled-bot.pixel-sampler
+  (:import java.awt.Rectangle)
+  (:import java.awt.Image)
+  (:import java.awt.Robot)
+  (:import javax.imageio.ImageIO)
+  (:import java.io.File)
+  (:gen-class))
+
+(defn get-samples
+  "Gets pixel color from given coordinates"
+  [xy]
+  ;(def image (.createScreenCapture robo (Rectangle. xl yl xr yr)))
+  (def image (ImageIO/read (File. "resources/test-screenshot.png")))
+  (def color (.getRGB image (xy 0) (xy 1)))
+  (xy 0)(xy 1))
+
+(defn sample-pixels
+  ""
+  [xl yl xr yr]
+  (def robo (Robot.))
+  (def jewel-length 40)
+  (def offset-x 43)
+  (def offset-y 39)
+
+  (map-indexed
+    (fn
+      [idx item]
+      (map-indexed
+        (fn
+          [idxfdsa itemfdsa]
+          ([idx idxfdsa]))
+        (apply vector (range offset-x (+ offset-x (* 8 jewel-length)) jewel-length)))
+      (apply vector (range offset-y (+ offset-y (* 8 jewel-length)) jewel-length))
+      ))


require all state-defining namespaces in `user` namespace

otherwise mount will not start everything in the correct order


[experiment/util-test] Skeleton for testing utility functionality (including new infinite-dataset function).

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

--- experiment/test/cortex/experiment/util_test.clj
+++ experiment/test/cortex/experiment/util_test.clj
@@ -0,0 +1,9 @@
+(ns cortex.experiment.util-test
+  (:require [clojure.test :refer :all]
+            [cortex.experiment.util :as util]))
+
+(deftest infinite-dataset-test
+  (let [ds [{:a 1 :b 2} {:a 3 :b 4} {:a 5 :b 6}]
+        inf-ds (util/infinite-dataset ds)]
+    (is (< (count (take 10 ds)) 10))
+    (is (= (count (take 10 inf-ds)) 10))))


I miss clojure a bit

I miss clojure a bit

error: pathspec 'Add-Two-Numbers/ATN.clj' did not match any file(s) known to git

--- Add-Two-Numbers/ATN.clj
+++ Add-Two-Numbers/ATN.clj
@@ -0,0 +1,15 @@
+(defn add-two-number [x y]
+  (loop [a x
+         b y
+         re []]
+    (print x y re)
+    (cond (and (empty? a) (empty? b))
+          re
+          (empty? a)
+          (into [] (concat re b))
+          (empty? b)
+          (into [] (concat re b))
+          :else
+          (recur (into [] (rest a))
+                 (into [] (rest b))
+                 (conj re (+ (first a) (first b)))))))


bump version to 1.2.3

bump version to 1.2.3

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


Create answer.clj

Create answer.clj

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

--- POH6/tsubame/answer.clj
+++ POH6/tsubame/answer.clj
@@ -0,0 +1,10 @@
+;
+; 結果 https://paiza.jp/poh/joshibato/tsubame/result/24209bda
+;
+
+(let [n   (Integer/parseInt (read-line))
+      n1  (mod n 10)
+      n10 (/ (- n n1) 10)
+      r   (+ n n1 n10)
+      ]
+    (println r))


Use a set for upload-dirs

Use a set for upload-dirs

This prevents accumulating duplicate dirs in a list unnecessarily.

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


move in prefix-keys and slam

move in prefix-keys and slam

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

--- src/hatch.clj
+++ src/hatch.clj
@@ -0,0 +1,15 @@
+(ns hatch
+  ^{:author "David Zaharee <dzaharee@vlacs.org>"
+    :doc "Useful functions for working with Datomic and Schematode"}
+  (:require [datomic.api :as d]
+            [datomic-schematode.core :as schematode]))
+
+(defn slam
+  "Slams two keywords together into one namespaced keyword"
+  [ns n]
+  (keyword (name ns) (name n)))
+
+(defn prefix-keys
+  "Prefix all keys in a map with prefix"
+  [m prefix]
+  (into {} (for [[k v] m] [(slam prefix k) v])))