Add pubsub wrapper

Add pubsub wrapper

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

--- src/trak/pubsub.cljs
+++ src/trak/pubsub.cljs
@@ -0,0 +1,22 @@
+(ns trak.pubsub
+  (:require [cljs.core.async :as async :refer [<!]])
+  (:require-macros [cljs.core.async.macros :refer [go-loop]]))
+
+
+(defonce event-bus (async/chan))
+(defonce event-bus-pub (async/pub event-bus first))
+
+(defn publish [key message]
+  (async/put! event-bus [key message]))
+
+(defn subscribe [key callback]
+  (let [ch (async/chan)]
+    (async/sub event-bus-pub key ch)
+    (go-loop []
+             (let [[_ msg] (<! ch)]
+               (callback msg))
+             (recur))
+    ch))
+
+(defn unsubscribe [topic channel]
+  (async/unsub event-bus-pub topic channel))


Update src/speclj/core.clj

Update src/speclj/core.clj

fixing some more typos

--- src/speclj/core.clj
+++ src/speclj/core.clj
@@ -119,7 +119,7 @@
        (throw (SpecFailure. (str "Expected falsy but was: " (-to-s value#)))))))

 (defmacro should=
-  "Asserts that two forms evaluate to equal values, with the expexcted value as the first parameter."
+  "Asserts that two forms evaluate to equal values, with the expected value as the first parameter."
   ([expected-form actual-form]
     `(let [expected# ~expected-form actual# ~actual-form]
        (if (not (= expected# actual#))
@@ -130,21 +130,21 @@
          (throw (SpecFailure. (str "Expected: " (-to-s expected#) endl "     got: " (-to-s actual#) " (using delta: " delta# ")")))))))

 (defmacro should-not=
-  "Asserts that two forms evaluate to inequal values, with the unexpexcted value as the first parameter."
+  "Asserts that two forms evaluate to inequal values, with the unexpected value as the first parameter."
   [expected-form actual-form]
   `(let [expected# ~expected-form actual# ~actual-form]
      (if (= expected# actual#)
        (throw (SpecFailure. (str "Expected: " (-to-s expected#) endl "not to =: " (-to-s actual#)))))))

 (defmacro should-be-same
-  "Asserts that two forms evaluate to the same object, with the expexcted value as the first parameter."
+  "Asserts that two forms evaluate to the same object, with the expected value as the first parameter."
   [expected-form actual-form]
   `(let [expected# ~expected-form actual# ~actual-form]
      (if (not (identical? expected# actual#))
        (throw (SpecFailure. (str "         Expected: " (-to-s expected#) endl "to be the same as: " (-to-s actual#) " (using identical?)"))))))

 (defmacro should-not-be-same
-  "Asserts that two forms evaluate to different objects, with the unexpexcted value as the first parameter."
+  "Asserts that two forms evaluate to different objects, with the unexpected value as the first parameter."
   [expected-form actual-form]
   `(let [expected# ~expected-form actual# ~actual-form]
      (if (identical? expected# actual#)


fixing rabbitmq connection config

fixing rabbitmq connection config

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


don't show memberhsip action buttons if member has transition data

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


replace hardcoded data in service-detail view


added priority integer support. Not tested !!

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/tnteam/milestones-clojurecup2014.git/'


add string similarity measure

add string similarity measure

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

--- src/ceres/inspector.clj
+++ src/ceres/inspector.clj
@@ -0,0 +1,41 @@
+(ns ceres.inspector)
+
+;; from http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Clojure
+
+(defn nextelt
+  "Given two characters, the previous row, and a row we are
+  building, determine out the next element for this row."
+  [char1 char2 prevrow thisrow position]
+  (if (= char1 char2)
+    (prevrow (- position 1))
+    (+ 1 (min
+      (prevrow (- position 1))
+      (prevrow position)
+      (last thisrow))))
+  )
+
+(defn nextrow
+  "Based on the next character from string1 and the whole of string2
+  calculate the next row. Initially thisrow contains one number."
+  [char1 str2 prevrow thisrow]
+  (let [char2 (first str2)
+        position (count thisrow)]
+    (if (= (count thisrow) (count prevrow))
+      thisrow
+      (recur
+        char1
+        (rest str2)
+        prevrow
+        (conj thisrow (nextelt char1 char2 prevrow thisrow position))))))
+
+(defn levenshtein
+  "Calculate the Levenshtein distance between two strings."
+  ([str1 str2]
+  (let [row0 (vec (map first (map vector (iterate inc 1) str2)))]
+    (levenshtein 1 (vec (cons 0 row0)) str1 str2)))
+  ([row-nr prevrow str1 str2]
+    (let [next-row (nextrow (first str1) str2 prevrow (vector row-nr))
+          str1-remainder (.substring str1 1)]
+      (if (= "" str1-remainder)
+        (last next-row)
+        (recur (inc row-nr) next-row str1-remainder str2)))))


Working on problem 0066...

Working on problem 0066...

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

--- src/project_euler/problem_0066.clj
+++ src/project_euler/problem_0066.clj
@@ -0,0 +1,85 @@
+(ns project-euler.problem_0066)
+
+;; Consider quadratic Diophantine equations of the form:
+
+;; x^2 – Dy^2 = 1
+
+;; For example, when D=13, the minimal solution in x is 649^2 – 13×180^2 = 1.
+
+;; It can be assumed that there are no solutions in positive integers when D is square.
+
+;; By finding minimal solutions in x for D = {2, 3, 5, 6, 7}, we obtain the following:
+
+;; 3^2 – 2×2^2 = 1
+;; 2^2 – 3×1^2 = 1
+;; 9^2 – 5×4^2 = 1
+;; 5^2 – 6×2^2 = 1
+;; 8^2 – 7×3^2 = 1
+
+;; Hence, by considering minimal solutions in x for D ≤ 7, the largest x is obtained when D=5.
+
+;; Find the value of D ≤ 1000 in minimal solutions of x for which the largest value of x is obtained.
+
+;; from problem_0064
+
+(defn int-sqrt [x]
+  (let [r  (loop [r 1]
+             (if (> (* r r) x)
+               r
+               (recur (* 2 r)) ))]
+    (loop [l (quot r 2), r r]
+      (if (> (- r l) 1)
+        (let [m (/ (+ r l) 2)]
+          (if (> (* m m) x)
+            (recur l m)
+            (recur m r)))
+        l
+        ))
+    ))
+
+;;--------------------------------------------------------
+(defn sqr [x] (* x x))
+
+(defn is-square? [x2]
+  (let [x (int-sqrt x2)]
+    (== x2 (* x x))))
+
+(defn nearest-int-sqrt [x]
+  (let [a' (int-sqrt x)]
+    (if (< (- x (sqr a')) (- (sqr (+ 1 a')) x)) a' (+ 1 a'))))
+
+(defn diophantine-solution [d x]
+  (let [x2-1 (- (* x x) 1)]
+    (if (zero? (rem x2-1 d))
+      (let [y2 (/ x2-1 d)
+            y  (int-sqrt y2)]
+        (if (== y2 (* y y))
+          y
+          nil))
+      nil)))
+
+(defn diophantine-min-solution-in-x [d]
+  (->> (iterate inc 2)
+       (map (fn [x]
+              [x  (diophantine-solution d x)]))
+       (filter second)
+       (first)
+       ))
+
+(defn chakravala [d]
+  (let [a  (nearest-int-sqrt d)
+        b  1
+        k  (- (sqr a) d)]
+    (println "a b k : " a b k)
+
+    ))
+
+(defn solution []
+  (->> (range 2 1001)
+       (remove is-square?)
+       (map (fn [d] (let [[x y] (diophantine-min-solution-in-x d)]
+                      [x d])))
+       (sort)
+       (last)
+       (second)
+       ))


adding stub for hierarchy tests

adding stub for hierarchy tests

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

--- test/cljs/ohds/hierarchy_test.cljs
+++ test/cljs/ohds/hierarchy_test.cljs
@@ -0,0 +1,6 @@
+(ns ohds.hierarchy-test
+  (:require
+   [ohds.hierarchy.view :as view]
+   [ohds.hierarchy.messages :as m]
+   [cljs.test :refer-macros [deftest is testing run-tests]])
+


Adds dev-resources folder.

Adds dev-resources folder.

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

--- dev-resources/user.clj
+++ dev-resources/user.clj
@@ -0,0 +1,36 @@
+(ns user
+  (:require
+    [clj-spotify.core :as sptfy]
+    [clj-spotify.util :as util]
+    [loudmoauth.core :as lm]
+    [ring.adapter.jetty :as ringj]
+    [ring.util.response :as ringr]
+    [ring.middleware.params :as ringp]
+    [ring.middleware.keyword-params :as ringkp]
+    [clj-spotify.core :as sptfy]))
+
+(defn handler [request]
+  (prn request)
+  (condp = (:uri request)
+    "/oauth2" (lm/parse-params request)
+    "/interact"  (ringr/redirect (lm/user-interaction))
+    {:status 200
+     :body (:uri request)}))
+
+(def spotify-oauth2-params
+  {:base-url "https://accounts.spotify.com"
+   :auth-endpoint "/authorize"
+   :token-endpoint "/api/token"
+   :client-id (System/getenv "SPOTIFY_OAUTH2_CLIENT_ID")
+   :redirect-uri "http://localhost:3000/oauth2"
+   :scope "playlist-read-private playlist-modify-public playlist-modify-private ugc-image-upload user-follow-modify user-read-playback-state user-modify-playback-state user-read-currently-playing streaming"
+   :custom-query-params {:show-dialog "true"}
+   :client-secret (System/getenv "SPOTIFY_OAUTH2_CLIENT_SECRET")
+   :provider :spotify})
+
+(defn run
+  "Starts our test web server."
+  []
+  (future (ringj/run-jetty (ringp/wrap-params (ringkp/wrap-keyword-params handler))  {:port 3000}))
+ (lm/add-provider spotify-oauth2-params))
+


change move-out modal's ok-text to be more expressive


add a new namespace `metabase.email.messages` for collecting functions which handle templating of stock email messages.  added first function for (send-email-report) which takes appropriate data input and formats an email report message and sends it.

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

--- src/metabase/email/messages.clj
+++ src/metabase/email/messages.clj
@@ -0,0 +1,38 @@
+(ns metabase.email.messages
+  "Convenience functions for sending templated email messages.  Each function here should represent a single email.
+   NOTE: we want to keep this about email formatting, so don't put heavy logic here RE: building data for emails."
+  (:require [hiccup.core :refer [html]]
+            [metabase.email :as email]))
+
+
+;;; ### Public Interface
+
+(defn send-email-report
+  "Format and Send an `EmailReport` email."
+  [subject recipients query-result]
+  {:pre [(string? subject)
+         (vector? recipients)
+         (map? query-result)]}
+  (let [html-header-row (fn [cols]
+                          (into [:tr {:style "background-color: #f4f4f4;"}]
+                            (map (fn [col]
+                                   [:td {:style "text-align: left; padding: 0.5em; border: 1px solid #ddd; font-size: 12px;"} col]) cols)))
+        html-data-row (fn [row]
+                        (into [:tr]
+                          (map (fn [cell]
+                                 ;; TODO - format cell
+                                 ;; {{ cell|default_if_none:"N/A"|floatformat:"-2"|default:cell  }}
+                                 [:td {:style "border: 1px solid #ddd; padding: 0.5em;"} cell]) row)))]
+    (email/send-message
+      subject
+      (into {} (map (fn [email] {email email}) recipients))
+      :html (html [:html
+                   [:head]
+                   [:body {:style "font-family: Helvetica Neue, Helvetica, sans-serif; width: 100%; margin: 0 auto; max-width: 800px; font-size: 12px;"}
+                    [:div {:class "wrapper" :style "padding: 10px; background-color: #ffffff;"}
+                     (into [:table {:style "border: 1px solid #cccccc; width: 100%; border-collapse: collapse;"}]
+                       (vector
+                         ;; table header row
+                         (html-header-row (get-in query-result [:data :columns]))
+                         ;; actual data rows
+                         (map (fn [row] (html-data-row row)) (get-in query-result [:data :rows]))))]]]))))


Fix multiple html and body elements bug

Fix multiple html and body elements bug

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


Note TODO.

Note TODO.

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


add test

add test

error: pathspec 'clj-tcp/test/clj_tcp/codec_tests.clj' did not match any file(s) known to git

--- clj-tcp/test/clj_tcp/codec_tests.clj
+++ clj-tcp/test/clj_tcp/codec_tests.clj
@@ -0,0 +1,34 @@
+(ns clj-tcp.codec-tests
+  (require [clj-tcp.codec :refer :all])
+  (import [io.netty.buffer Unpooled])
+  (use midje.sweet))
+
+
+(facts "Test codecs"
+
+       (fact "Test default handlers"
+
+             (let [encoder (default-encoder)]
+               (let [buff (Unpooled/buffer 1)]
+                ;test send function
+                 (.encode encoder nil #(.writeInt % 1) buff)
+                 (.readInt buff) => 1)
+               (let [buff (Unpooled/buffer 1)
+                     arr (byte-array 1)]
+                     ;test write string
+                     (.encode encoder nil "H" buff)
+                     (.readBytes buff arr)
+                     (String. arr) => "H")
+               (let [buff (Unpooled/buffer 1)
+                     buff2 (Unpooled/buffer 4)]
+                   (.writeInt buff2 1)
+                   (.encode encoder nil buff2 buff)
+                   (.readInt buff) => 1)
+               (let [buff (Unpooled/buffer 4)
+                     arr (byte-array 4)
+                     buff2 (Unpooled/buffer 4)]
+
+                   (.writeInt buff2 3)
+                   (.readBytes buff2 arr)
+                   (.encode encoder nil arr buff)
+                   (.readInt buff) => 3))))


Apparently I forgot this file. Needed by nrod-schedules.tail-consumer.

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


tweak docs

tweak docs

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


Fix warning in test-static-children-as-arguments

--- test/sablono/interpreter_test.cljs
+++ test/sablono/interpreter_test.cljs
@@ -28,5 +28,5 @@

 (deftest test-static-children-as-arguments
   (testing "static children should interpret as direct React arguments"
-    (is (= (html-str (i/interpret [:div [:div] [:div]]))
+    (is (= (html-str (i/interpret [:div [:div {:key 1}] [:div {:key 2}]]))
            "

"))))


whitespace

whitespace

--- sidecar/src/figwheel_sidecar/build_hooks/clj_reloading.clj
+++ sidecar/src/figwheel_sidecar/build_hooks/clj_reloading.clj
@@ -113,4 +113,3 @@
                      concat
                      additional-changed-ns')))
         (build-fn build-state)))))
-


Removed unused code.

Removed unused code.

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


Allow Datomic & Rabbit config set w/ env vars

So you can point this at somewhere other than prod (like krakenstein).

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


lib.zerol.core/engine - Added optional goal parameter. If goal is reached engine will stop accepting any events

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


Initial solution to easy-197.

Initial solution to easy-197.

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

--- src/daily/easy-197.cljs
+++ src/daily/easy-197.cljs
@@ -0,0 +1,43 @@
+(ns daily.easy-197
+  "# [2015-01-12] Challenge #197 [Easy] ISBN Validator
+
+The challenge is to validate 10-digit ISBN numbers using the check digit.
+
+[Full Challenge Description](https://www.reddit.com/r/dailyprogrammer/comments/2s7ezp/20150112_challenge_197_easy_isbn_validator/)
+"
+  (:require
+    [dommy.core :as dommy :refer-macros [sel1]]
+    [reagent.core :as reagent :refer [atom]]
+    [ajax.core :refer [GET POST]]
+    [clojure.string :as string]))
+
+(defn validate-isbn-10
+  "# Solution
+
+  The magic function here is `map-indexed`, which applies a binary function to pairs of elements and their indicies. The
+  indicies are 0 to 9, so I subtract them from 10 to get 10 to 1.
+  "
+  [input]
+  (and (= 10 (count input))
+    (as-> input $                           ;; bind `$` to the return value of the last function
+          (map js/parseInt $)               ;; convert the sequence of characters into one of integers
+          (map-indexed #(* (- 10 %1) %2) $) ;; multiply each integer by its "weight"
+          (reduce + $)                      ;; sum the integers
+          (mod $ 11)
+          (= 0 $))))
+
+;; ## Result
+;;
+;; You can try it out with one input string at a time using the following field.
+(defn single-input []
+ (let [value (atom "0345302567")]
+   (fn []
+    [:div
+     [:p "Input: "
+      [:input {:type "text" :value @value
+               :on-change #(reset! value (-> % .-target .-value))}]
+      [:p "Output: " (str (validate-isbn-10 @value))]]])))
+;; <div id="single-input"></foo>
+(reagent/render-component [single-input] (sel1 :#single-input))
+
+;; <script>goog.require("daily.easy_197");</script>


Fix TeamMembership schema

Fix TeamMembership schema

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


Clean up logging

Clean up logging


Minor cleanup

Minor 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/michaelsbradleyjr/shen.clj.git/'


Starting with feedparser tests

Starting with feedparser tests

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

--- test/feedparser_test.clj
+++ test/feedparser_test.clj
@@ -0,0 +1,27 @@
+(import 'java.io.File)
+(require 'feedme)
+
+(defn file? [f]
+  (.isFile f))
+
+(defn abs-path [f]
+  (.getAbsolutePath f))
+
+(defn walk-tree [files]
+  (when-first [file files]
+    (if (file? file)
+      (lazy-cat (list file) (walk-tree (rest files)))
+      (lazy-cat (walk-tree (.listFiles file))
+                (walk-tree (rest files))))))
+
+(defn file-list [root]
+  (map abs-path (filter file? (walk-tree (.listFiles (new File root))))))
+
+(defn xml-files [root]
+  (filter #(.endsWith % ".xml") (file-list root)))
+
+(defn check []
+  (doseq [file (xml-files "test/feedparser/tests/wellformed/")]
+    (try
+      (feedme/parse (str "file://" file))
+    (catch Exception e (println file)))))


Unit tests lib for 'descriptions' module

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

--- test/clouseau/test_descriptions.clj
+++ test/clouseau/test_descriptions.clj
@@ -0,0 +1,42 @@
+;;;
+;;;   Clouseau
+;;;
+;;;    Copyright (C) 2017  Pavel Tisnovsky <ptisnovs@redhat.com>
+;;;
+;;; Clouseau is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2, or (at your option)
+;;; any later version.
+;;;
+;;; Clouseau is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with Clouseau; see the file COPYING.  If not, write to the
+;;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+;;; 02110-1301 USA.
+;;;
+;;; Linking this library statically or dynamically with other modules is
+;;; making a combined work based on this library.  Thus, the terms and
+;;; conditions of the GNU General Public License cover the whole
+;;; combination.
+;;;
+;;; As a special exception, the copyright holders of this library give you
+;;; permission to link this library with independent modules to produce an
+;;; executable, regardless of the license terms of these independent
+;;; modules, and to copy and distribute the resulting executable under
+;;; terms of your choice, provided that you also meet, for each linked
+;;; independent module, the terms and conditions of the license of that
+;;; module.  An independent module is a module which is not derived from
+;;; or based on this library.  If you modify this library, you may extend
+;;; this exception to your version of the library, but you are not
+;;; obligated to do so. If you do not wish to do so, delete this
+;;; exception statement from your version.
+;;;
+
+(ns clouseau.test-descriptions
+  (:require [clojure.test :refer :all]
+            [clouseau.descriptions :refer :all]))
+


CMR-4094 - Added missing unit tests for ingest site.

error: pathspec 'ingest-app/test/cmr/ingest/test/site/routes.clj' did not match any file(s) known to git

--- ingest-app/test/cmr/ingest/test/site/routes.clj
+++ ingest-app/test/cmr/ingest/test/site/routes.clj
@@ -0,0 +1,94 @@
+(ns cmr.ingest.test.site.routes
+  (:require [clojure.string :as string]
+            [clojure.test :refer :all]
+            [cmr.access-control.site.routes :as r]
+            [ring.mock.request :refer [request]]))
+
+(def ^:private scheme "https")
+(def ^:private host "cmr.example.com")
+(def ^:private base-path "")
+(def ^:private base-url (format "%s://%s%s" scheme host base-path))
+(def ^:private system {:public-conf
+                        {:protocol scheme
+                         :host host
+                         :relative-root-url base-path}})
+(def ^:private site (#'cmr.ingest.site.routes/build-routes system))
+
+(deftest ingest-welcome-page
+  (testing "visited on a path without a trailing slash"
+    (let [response (site (request :get base-url))]
+      (testing "produces a HTTP 200 success response"
+        (is (= 200 (:status response) )))
+      (testing "returns the welcome page HTML"
+        (is (string/includes?
+             (:body response)
+             "The Common Metadata Repository")))))
+  (testing "visited on a path with a trailing slash"
+    (let [response (site (request :get (str base-url "/")))]
+      (testing "produces a HTTP 200 success response"
+        (is (= 200 (:status response))))
+      (testing "returns the welcome page HTML"
+        (is (string/includes?
+             (:body response)
+             "The Common Metadata Repository"))))))
+
+(deftest test-404
+  (testing "a 404 is returned for a missing document"
+    (is (= 404
+           (->> "/site/NOT-A-PAGE.html"
+                (str base-url)
+                (request :get)
+                (site)
+                :status)))
+    (is (= 404
+           (->> "/site/docs/ingest/NOT-A-PAGE.html"
+                (str base-url)
+                (request :get)
+                (site)
+                :status)))))
+
+(deftest ingest-api-documentation-page
+  (let [response (site
+                   (request
+                     :get (str base-url "/site/docs/ingest/api.html")))]
+    (testing "uses the incoming host and scheme for the docs endpoint"
+      (is (= 200 (:status response)))
+      (is (string/includes? (:body response) "API Documentation")))))
+
+(deftest ingest-site-documentation-page
+  (let [response (site
+                   (request
+                     :get (str base-url "/site/docs/ingest/site.html")))]
+    (testing "uses the incoming host and scheme for the docs endpoint"
+      (is (= 200 (:status response)))
+      (is (string/includes?
+           (:body response)
+           "Site Routes & Web Resources Documentation")))))
+
+(deftest ingest-all-documentation-page
+  (let [response (site (request :get (str base-url "/site/docs/ingest")))]
+    (testing "all docs links appear here"
+      (is (= 200 (:status response)))
+      (is (string/includes? (:body response) "Documentation for CMR Ingest"))
+      (is (string/includes? (:body response) "site/docs/ingest/api"))
+      (is (string/includes? (:body response) "site/docs/ingest/site")))))
+
+(deftest ingest-url-reorg-redirects
+  (let [response (site (request :get (str base-url "/site/docs/ingest/api")))]
+    (testing "clean docs URL for api docs performs redirect"
+      (is (= 307 (:status response)))
+      (is (string/includes?
+           (get-in response [:headers "Location"])
+           "site/docs/ingest/api.html"))))
+  (let [response (site (request :get (str base-url "/site/docs/ingest/site")))]
+    (testing "clean docs URL for site docs performs redirect"
+      (is (= 307 (:status response)))
+      (is (string/includes?
+           (get-in response [:headers "Location"])
+           "site/docs/ingest/site.html"))))
+  (let [response (site (request :get (str base-url "/site/ingest_api_docs.html")))]
+    (testing "clean docs URL for api docs performs redirect"
+      (is (= 301 (:status response)))
+      (is (string/includes?
+           (get-in response [:headers "Location"])
+           "site/docs/ingest/api.html")))))


add a small bench

add a small bench

error: pathspec 'example/src/example/bench.cljs' did not match any file(s) known to git

--- example/src/example/bench.cljs
+++ example/src/example/bench.cljs
@@ -0,0 +1,44 @@
+(ns example.bench
+  (:require [rum.core :as rum]
+            [goog.dom :as gdom]
+            [cljss.core :refer [defstyles]]))
+
+(defstyles table []
+  {:display "flex"})
+
+(defstyles cell [row]
+  {:width            "32px"
+   :height           "32px"
+   :background-color (str "rgb(0, " row ", 0)")
+   :color            "#fff"
+   :font             "normal 16px sans-serif"
+   :border           "1px solid #fff"
+   :border-radius    "4px"
+   :display          "flex"
+   :justify-content  "center"
+   :align-items      "center"})
+
+(def state (atom 1))
+
+(rum/defc Test <
+  rum/reactive
+  []
+  (let [idx (rum/react state)]
+    [:div {:class (table)}
+     (for [a (range 10)]
+       [:div {:key a}
+        (for [b (range 10)]
+          [:div
+           {:key   b
+            :class (cell (int (* 255 (js/Math.abs (js/Math.sin idx)))))}
+           [:span {} ^String b]])])]))
+
+(rum/mount (Test) (gdom/getElement "app"))
+
+(defn run-bench! []
+  (js/requestAnimationFrame
+    #(when (< @state 100)
+       (swap! state inc)
+       (run-bench!))))
+
+(run-bench!)


No need to partition

No need to partition

No need to partition views — seems to work


commit new clojure.cli

commit new clojure.cli

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

--- clojure/hello.clj
+++ clojure/hello.clj
@@ -0,0 +1,2 @@
+(println "Hello, Clojure World !!")
+


Wrote the tokenizer for the language

Wrote the tokenizer for the language

error: pathspec 'src/cas/language.cljs' did not match any file(s) known to git

--- src/cas/language.cljs
+++ src/cas/language.cljs
@@ -0,0 +1,50 @@
+(ns cas.language)
+
+;;
+;; Defines the language that Robot programs are written in
+;;
+
+;; Tokenizes a splitted part of source, ie "124" or "KEYWORD"
+(defn tokenize-source-thing [obj]
+  (cond
+    (re-matches #"[0-9]+" obj) ;; literal int
+    (js/parseInt obj)
+
+    ;; keywords
+    (= 0 (compare obj "FOR"))
+    :for
+
+    (= 0 (compare obj "WHILE"))
+    :while
+
+    (= 0 (compare obj "INT"))
+    :int
+
+    (= 0 (compare obj "SUB"))
+    :sub
+
+    (= 0 (compare obj "{"))
+    :open-curly
+
+    (= 0 (compare obj "}"))
+    :close-curly
+
+    ;; otherwise, it's a user defined string
+    true
+    obj
+
+    )
+  )
+
+(defn- tokenize [text]
+  (map tokenize-source-thing (split text #" ")))
+
+(defn- parse-program [text])
+
+(defn- execuate-ast [ast state])
+
+(defn run [text state]
+  (let [ast (parse-program text)]
+    (execuate-ast ast state)
+    )
+  )


missing paren

missing paren

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


find orphaned notifications from phantom elections separately

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


updated dependencies

updated dependencies

--- src/leiningen/new/cryogen/project.clj
+++ src/leiningen/new/cryogen/project.clj
@@ -8,7 +8,7 @@
                  [selmer "0.7.3"]
                  [markdown-clj "0.9.57"
                   :exclusions [com.keminglabs/cljx]]
-                 [ring/ring-devel "1.1.0"]
+                 [ring/ring-devel "1.3.1"]
                  [compojure "1.2.1"]
                  [clj-text-decoration "0.0.2"]
                  [io.aviso/pretty "0.1.12"]


Add cleanup namespace

Add cleanup namespace

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

--- src/main/clojure/lazytest/cleanup.clj
+++ src/main/clojure/lazytest/cleanup.clj
@@ -0,0 +1,13 @@
+(ns lazytest.cleanup)
+
+(defn with-cleanup
+  "Set f as a cleanup function in x's metadata."
+  [x f]
+  {:pre [(fn? f)]}
+  (vary-meta x assoc ::cleanup f))
+
+(defn do-cleanup
+  "Execute all cleanup functions associated with x."
+  [x]
+  (when-let [f (::cleanup (meta x))]
+    (f)))


Added a version of records supporting Clojure specs.

error: pathspec 'src/active/clojure/record_spec.cljc' did not match any file(s) known to git

--- src/active/clojure/record_spec.cljc
+++ src/active/clojure/record_spec.cljc
@@ -0,0 +1,260 @@
+(ns ^{:doc "A re-implementation of `active.clojure.record` that makes use of
+Clojure's new spec library. Define records the same ways as in the old
+implemenation or use the new syntax to automatically generate specs.
+If a field has no explicit spec, defaults to `any?`."}
+    active.clojure.record-spec
+  (:require [clojure.spec.alpha :as s]
+            [active.clojure.condition :as c]
+            [clojure.spec.gen.alpha :as gen]))
+
+;; Only needed in ClojureScript, does nothing in Clojure
+(defn check-type
+  [type rec accessor]
+  #?(:clj (do))
+  #?(:cljs
+     (when-not (instance? type rec)
+       (throw (js/Error. (str "Wrong record type passed to accessor." rec type))))))
+
+
+(defn specs-vec
+  [spec &form]
+  (if-not (even? (count spec))
+    (IllegalArgumentException. (str "invalid field spec " spec " in " *ns* " " (meta &form)))
+    (let [[field accessor & mods] spec
+          mod-m (into {} (map vec (partition 2 mods)))]
+      [field accessor (if-let [spec (:spec (meta field))]
+                        (assoc mod-m :spec spec)
+                        (assoc mod-m :spec any?))])))
+
+
+(defn field-triples
+  "Takes a vector of specs and the `&form` variable and returns a vector of triples.
+  The specs are in one of two forms:
+  - a list, containing the field name (symbol), the accessor's name (symobl) and
+    optionally a key (`:spec|:lens`) followed by either the spec or the lens'
+    name
+  - two consecutive symbols (the field name (symbol) and the accessor's name
+    (symbol).
+  The `&form` is only used for reporting errors."
+  [specs &form]
+  (loop [specs (seq specs)
+         triples []]
+    (if (empty? specs)
+      (do
+        (println triples)
+        triples)
+      (let [spec (first specs)]
+        (cond
+          (list? spec)
+          (recur (rest specs) (conj triples (specs-vec spec &form)))
+
+          (symbol? spec)
+          (do
+            (when (empty? (rest specs))
+              (throw (IllegalArgumentException. (str "incomplete field spec for " spec " in " *ns* " " (meta &form)))))
+            (when-not (symbol? (fnext specs))
+              (throw (IllegalArgumentException. (str "invalid accessor " (fnext specs) " for " spec " in " *ns* " " (meta &form)))))
+            (println "spec:" (:spec (meta (fnext specs))))
+            (recur (nnext specs)
+                   (conj triples [spec (fnext specs) {:spec (or (:spec (meta spec)) any?)}])))
+          :else
+          (throw (IllegalArgumentException. (str "invalid field spec " spec " in " *ns* " " (meta &form)))))))))
+
+
+(defn ns-keyword
+  "Takes a symbol or string `the-name-sym` and returns a namespaces keyword
+  based on that symbol.
+
+  Example: `(ns-keyword 'foo) => :calling.name.space/foo`"
+  [the-name-sym]
+  (if the-name-sym
+    (keyword (str (ns-name *ns*)) (str the-name-sym))
+    (c/assertion-violation `ns-keyword "argument must not be nil" the-name-sym)))
+
+
+(defn define-spec-form
+  "Takes the name of a type and a predicate and returns the form for defining
+  the spec for this name using the predicate.
+
+  Example:
+
+  ```
+  (define-spec-form 'foo bar?)
+  => (clojure.spec.alpha/def :calling.name.space/foo bar?)
+  ```"
+  [the-name the-predicate]
+  (println "define-spec-form" the-name the-predicate)
+  (let [ns-key (ns-keyword the-name)]
+    `(s/def ~ns-key ~the-predicate)))
+
+
+(defn define-type-spec-form
+  "Takes a symbol `the-name` and a seq of symbols `the-keys` and returns a spec
+  form based on those values.
+
+  Example:
+  ```
+  (define-type-spec-form 'foo ['bar 'baz])
+  => (clojure.spec.alpha/def :calling.name.space/foo
+                             (s/and
+                               predicate
+                               (clojure.spec.alpha/keys :req-un
+                                                        [:calling.name.space/bar
+                                                         :calling.name.space/baz])))
+  ```"
+  [the-name constructor predicate the-keys]
+  (let [ns-key (ns-keyword the-name)
+        ks (mapv n-keyword the-keys)]
+    `(s/def ~ns-key
+       (s/spec (s/and ~predicate (s/keys :req-un ~ks))
+               :gen (fn []
+                      (->> (s/gen (s/keys :req-un ~ks))
+                           (gen/fmap (fn [ks#] (apply ~constructor
+                                                     (vals ks#))))))))))
+
+
+(defn define-constructor-spec-form
+  "Takes the name of a constructor `the-name`, a seq of arguments and a list of
+  specs and returns a spec-form for the constructor.
+
+  Example:
+  ```
+  (define-constructor-spec-form 'make-foo 'foo ['bar 'baz] ['foo-bar 'foo-baz])
+  => (clojure.spec.alpha/fdef make-foo
+                              :args (clojure.spec.alpha/cat :bar ::foo-bar :baz ::foo-baz)
+                              :ret ::foo)
+  ```"
+  [the-name the-ret-type the-args-list the-specs-list]
+  (let [key-args-list (map keyword the-args-list)
+        ns-spec-list (map ns-keyword the-specs-list)
+        the-args-entry (apply concat (map (fn [l r] [l r]) key-args-list ns-spec-list))]
+    `(s/fdef ~the-name
+             :args (s/cat ~@the-args-entry)
+             :ret ~(ns-keyword the-ret-type))))
+
+
+(defn define-accessor-spec-form
+  "Takes the name of a constructor `the-name`, a seq of arguments and a list of
+  specs and returns a spec-form for the constructor.
+
+  Example:
+  ```
+  (define-accessor-spec-form 'make-foo ['bar 'baz] ['foo-bar 'foo-baz])
+  => (clojure.spec.alpha/fdef make-foo
+                              :args (clojure.spec.alpha/cat :bar ::foo-bar :baz ::foo-baz)
+                              :ret ::foo)
+  ```"
+  [the-accessor-name the-type-name]
+  `(s/fdef ~the-accessor-name
+           :args (s/cat ~(keyword the-type-name) ~(ns-keyword the-type-name))
+           :res ~boolean?))
+
+
+#?(:clj
+(defmacro define-record-type
+  "Attach doc properties to the type and the field names to get reasonable docstrings."
+  [?type ?constructor-call ?predicate ?field-specs & ?opt+specs]
+  (when-not (and (list? ?constructor-call)
+                 (not (empty? ?constructor-call)))
+    (throw (IllegalArgumentException. (str "constructor call must be a list in " *ns* " " (meta &form)))))
+  (when-not (vector? ?field-specs)
+    (throw (IllegalArgumentException. (str "field specs must be a vector in " *ns* " " (meta &form)))))
+  (when-not (even? (count (remove seq? ?field-specs)))
+    (throw (IllegalArgumentException. (str "odd number of elements in field specs in " *ns* " " (meta &form)))))
+  (when-not (every? true? (map #(or (= 4 (count %1))
+                                    (= 6 (count %1))) (filter seq? ?field-specs)))
+    (throw (IllegalArgumentException. (str "wrong number of elements in field specs with lens in " *ns* " " (meta &form)))))
+
+  (let [?field-triples (field-triples ?field-specs &form)
+        ?constructor (first ?constructor-call)
+        ?constructor-args (rest ?constructor-call)
+        ?constructor-args-set (set ?constructor-args)
+        document (fn [n doc]
+                   (vary-meta n
+                              (fn [m]
+                                (if (contains? m :doc)
+                                  m
+                                  (assoc m :doc doc)))))
+        document-with-arglist (fn [n arglist doc]
+                                (vary-meta n
+                                           (fn [m]
+                                             (let [m (if (contains? m :doc)
+                                                       m
+                                                       (assoc m :doc doc))]
+                                               (if (contains? m :arglists)
+                                                 m
+                                                 (assoc m :arglists `'(~arglist)))))))
+        name-doc (fn [field]
+                    (if-let [doc (:doc (meta field))]
+                      (str " (" doc ")")
+                      ""))
+
+        ?field-names (map first ?field-triples)
+        reference (fn [name]
+                    (str "[[" (ns-name *ns*) "/" name "]]"))
+        ?docref (str "See " (reference ?constructor) ".")]
+    (let [?field-names-set (set ?field-names)]
+      (doseq [?constructor-arg ?constructor-args]
+        (when-not (contains? ?field-names-set ?constructor-arg)
+          (throw (IllegalArgumentException. (str "constructor argument " ?constructor-arg " is not a field in " *ns* " " (meta &form)))))))
+
+
+    `(do
+       (defrecord ~?type
+           [~@(map #(->> % first (str ?type "-") symbol) ?field-triples)]
+         ~@?opt+specs)
+       (def ~(document-with-arglist ?predicate '[thing] (str "Is object a `" ?type "` record? " ?docref))
+         (fn [x#]
+           (instance? ~?type x#)))
+       (def ~(document-with-arglist ?constructor
+                                    (vec ?constructor-args)
+                                    (str "Construct a `" ?type "`"
+                                         (name-doc ?type)
+                                         " record.\n"
+                                         (apply str
+                                                (map (fn [[?field ?accessor ?lens+spec]]
+                                                       (str "\n`" ?field "`" (name-doc ?field) ": access via " (reference ?accessor)
+                                                            (if (:lens ?lens+spec)
+                                                              (str ", lens " (reference (:lens ?lens+spec)))
+                                                              "")))
+                                                     ?field-triples))))
+         (fn [~@?constructor-args]
+           (new ~?type
+                ~@(map (fn [[?field _]]
+                         (if (contains? ?constructor-args-set ?field)
+                           `~?field
+                           `nil))
+                       ?field-triples))))
+       (declare ~@(map (fn [[?field ?accessor ?lens+spec]] ?accessor) ?field-triples))
+       ~@(mapcat (fn [[?field ?accessor ?lens+spec]]
+                   (let [?rec (with-meta `rec# {:tag ?type})]
+                     `((def ~(document-with-arglist ?accessor (vector ?type)  (str "Access `" ?field "` field"
+                                                                                (name-doc ?field)
+                                                                                " from a [[" ?type "]] record. " ?docref))
+                         (fn [~?rec]
+                           (check-type ~?type ~?rec ~?accessor)
+                           (. ~?rec ~(symbol (str ?type "-" ?field)))))
+                       ~@(when-let [?lens (:lens ?lens+spec)]
+                           (let [?data `data#
+                                 ?v `v#]
+                             `((def ~(document ?lens (str "Lens for the `" ?field "` field"
+                                                          (name-doc ?field)
+                                                          " from a [[" ?type "]] record." ?docref))
+                                 (active.clojure.lens/lens ~?accessor
+                                                           (fn [~?data ~?v]
+                                                             (~?constructor ~@(map
+                                                                               (fn [[?shove-field ?shove-accessor]]
+                                                                                (if (= ?field ?shove-field)
+                                                                                ?v
+                                                                                `(~?shove-accessor ~?data)))
+                                                                               ?field-triples))))))))
+                       ~@(when-let [?spec (:spec ?lens+spec)]))))
+                 ?field-triples)
+       ;; type-spec
+       ~(define-type-spec-form ?type ?constructor ?predicate (map second (filter (fn [[_ _ l+s]] (:spec l+s)) ?field-triples)))
+       ~(define-constructor-spec-form (first ?constructor-call) ?type (map first ?field-triples) (map second ?field-triples))
+       ;; field-specs
+       ~@(for [[_field ?accessor ?lens+spec] ?field-triples :when (:spec ?lens+spec)]
+           (define-spec-form ?accessor (:spec ?lens+spec)))
+       ~@(for [[_field ?accessor ?lens+spec] ?field-triples :when (:spec ?lens+spec)]
+           (define-accessor-spec-form ?accessor ?type))))))


Add assertions for simple describe/is tests

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

--- src/test/clojure/lazytest/describe_asserts.clj
+++ src/test/clojure/lazytest/describe_asserts.clj
@@ -0,0 +1,24 @@
+(ns lazytest.describe-asserts
+  (:use lazytest.describe
+	[lazytest.expect :only (expect)]
+	[lazytest.testable :only (get-tests)]
+	[lazytest.runnable-test :only (run-tests)]
+	[lazytest.test-result :only (success?)]))
+
+(remove-ns 'one)
+(create-ns 'one)
+(intern 'one 'a (describe "Addition"
+		  (it "adds"
+		    (expect (= 4 (+ 2 2))))))
+(let [result (first (map run-tests (get-tests (the-ns 'one))))]
+  (assert (success? result)))
+(remove-ns 'one)
+
+(remove-ns 'two)
+(create-ns 'two)
+(intern 'two 'b (describe "Addition"
+		  (it "adds"
+		    (expect (= 999 (+ 2 2))))))
+(let [result (first (map run-tests (get-tests (the-ns 'two))))]
+  (assert (not (success? result))))
+(remove-ns 'two)


Add tests for the flags->rvmrc function

Add tests for the flags->rvmrc function

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

--- test/circle/backend/test_pallet.clj
+++ test/circle/backend/test_pallet.clj
@@ -0,0 +1,7 @@
+(ns circle.backend.test-pallet
+  (:use midje.sweet)
+  (:require [circle.backend.pallet]))
+
+(fact "flags->rvmrc works"
+  (circle.backend.pallet/flags->rvmrc {:a 4 :b 6 :f "some string"})
+  => "export a=4\nexport b=6\nexport f=\"some string\"\n")


Walking the tree to symbolify it

Walking the tree to symbolify it


add solutions namespace

add solutions namespace

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

--- src/main/clojure/dojo/solutions.clj
+++ src/main/clojure/dojo/solutions.clj
@@ -0,0 +1,29 @@
+(ns dojo.solutions
+  (:use clojure.core.matrix)
+  (:use clojure.repl)
+  (:use dojo.data))
+
+;; There is no right answer.....
+;; But here are some suggested ideas / solutions for the challenge
+
+ ;; the list of teams. We'll use this to structure most results
+(def TEAMS dojo.data/TEAMS)
+
+;; a map of column names -> column data
+(def COLS (zipmap HEADINGS (for [h HEADINGS] (get-column RESULTS (COL-NUMS h)))))
+
+;; matrix of home games for each team: 1 = home game, 0 = otherwise
+(def HOME-GAMES (vec (for [team TEAMS] (mapv #(if (= team (mget % (COL-NUMS "HomeTeam"))) 1 0) (slices RESULTS)))))
+
+;; matrix of away games for each team: 1 = home game, 0 = otherwise
+(def AWAY-GAMES (vec (for [team TEAMS] (mapv #(if (= team (mget % (COL-NUMS "AwayTeam"))) 1 0) (slices RESULTS)))))
+
+;; vectors of result types for each match
+(def HWINS (mapv #(if (= "H" (mget % (COL-NUMS "FTR"))) 1 0) (slices RESULTS)))
+(def DRAWS (mapv #(if (= "D" (mget % (COL-NUMS "FTR"))) 1 0) (slices RESULTS)))
+(def AWINS (mapv #(if (= "A" (mget % (COL-NUMS "FTR"))) 1 0) (slices RESULTS)))
+
+(def HOME-WINS (mapv esum (slices (mul HWINS HOME-GAMES))))
+(def AWAY-WINS (mapv esum (slices (mul AWINS AWAY-GAMES))))
+(def DRAW-RESULTS (mapv esum (slices (add (mul DRAWS AWAY-GAMES) (mul DRAWS HOME-GAMES)))))
+


more optimization flags for benchmark build

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


starting work exploring spans in clojure

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

--- spans.clj
+++ spans.clj
@@ -0,0 +1,119 @@
+;
+; spans.clj
+; An exploration of spans of time in a calendar and relating them to
+; a model period or epoch where values are specified. Use the model
+; epoch as a source for data to populate other epochs through
+; a map of events to allow for changing event dates and durations.
+;
+;
+; notes
+; - julian numbers, not dates
+; - variable epoch length, "week" length
+' - fencepost spans indeces
+;
+; work log
+; 4-15 45 minutes in front of TV
+; 4-16 20 minutes en route to Louisville
+;
+
+(def epoch-length 100)
+(def week-length 7)
+(def months (list 31 28 31 30 31 30 31 31 30 31 30 31))
+
+(defn week-of
+"given a month and week, returns a span in day-of-year from the start  to the end of that week"
+[week month]
+	(println "week-of" month week)
+	(def months-part (+ (reduce + 0 (take month months) )))
+	(list
+	 	(+ months-part (* (- week 1) week-length))
+	 	(+ months-part (* week week-length))))
+
+(defn day-of-year
+"takes a traditional, 1-based, date and returns day of year - leap year notwithstanding"
+[month day]
+	(+ (reduce + (take (- month 1) months))
+		day))
+
+(defn julian
+"lame attempt at calculating julian day for demo purposes"
+[year month day]
+1)
+
+; name --> (start-julian, end-julian, year)
+(def events {
+	:new-years  (list (day-of-year 12 31) (day-of-year 1 2) 2012)
+	:mlk 		(list (day-of-year 1 13) (day-of-year 1 14) 2012)
+	:presidents (list (day-of-year 2 14) (day-of-year 2 15) 2012)
+	:spring-break (week-of 3 3)
+	:new-years  (list (day-of-year 12 31) (day-of-year 1 2) 2013)
+	:mlk 		(list (day-of-year 1 13) (day-of-year 1 14) 2013)
+	:presidents (list (day-of-year 2 14) (day-of-year 2 15) 2013)
+	:spring-break (week-of 3 3)
+	:new-years  (list (day-of-year 12 31) (day-of-year 1 2) 2014)
+	:mlk 		(list (day-of-year 1 13) (day-of-year 1 14) 2014)
+	:presidents (list (day-of-year 2 14) (day-of-year 2 15) 2014)
+	:spring-break (week-of 3 3)
+})
+
+; to create a multi-epoch list of daily values,
+; you need a way to collect events with the same name across epochs
+; and access them by an intra-epoch offset
+
+
+; julian --> (epoch-number, epoch-offset)
+(defn julian-to-epoch-pair
+"given a julian day number for a base-epoch start and an event day, returns an ep ch number and offset"
+[event-julian epoch-length  epoch-start-julian]
+	(assert (> event-julian epoch-start-julian) ; assert? TODO
+	(list (% (- event-julian epoch-start-julian) epoch-length)
+			(/ (- event-julian epoch-start-julian) epoch-length )))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; money ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defn mapping-span
+"creates a set of spans in the original epoch for an event instance in a future epoch"
+[orig-epoch  epoch-length event-epoch event-offset ]
+)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ --> (name, (epoch-number, epoch-offset))
+(defn make-event-map
+"maps events between epochs of the given length in preparation for epoch generation.
+the events may have different offsets for each epoch"
+[epoch-start epoch-length events]
+	(let [event-names (reduce assoc #{} (keys events)) ; keys? TODO
+			]
+		(map (fn [event-name]
+			; get the set of epoch/offset pairs for each holiday with this name and associate
+			; for each event after the original epoch calculate the spans back onto the original epoch
+				)
+			event-nams)
+
+;;;;;;; epoch ;;;;;;;;;;;;;;;
+
+(defn  make-epoch
+" creates a hash of date-to-date for the given length and start
+[start length val]
+	(loop [event-hash {} count 0]
+		(cond (< count length)
+			(recur (assoc event-hash (+ count + start) val ) (+ count 1))
+			:t event-hash)))
+
+(defn add-to-epoch
+"modifies (in the immutable sense) an existing events map by inserting values for the given event"
+[evens span value]
+	(loop [start (first span) loop-events events ]
+		(cond (= start (second span)) loop-events
+			:t (recur  (+ start 1) (assoc loop-events start value)))))
+
+(defn generate-epochs
+"takes a events map populated with a first epoch and "
+[])
+
+(def epoch (sort (add-to-epoch (make-epoch 100) (week-of 2 1)  10)))
+(println epoch)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+


longer connection timeout for Mongo to fix intermittent Test failure

--- src/metabase/driver/mongo/util.clj
+++ src/metabase/driver/mongo/util.clj
@@ -5,6 +5,16 @@
             [colorize.core :as color]
             [monger.core :as mg]
             [metabase.driver :as driver]))
+
+(def ^:const ^:private connection-timeout-ms
+  "Number of milliseconds to wait when attempting to establish a Mongo connection.
+   By default, Monger uses a 10-second timeout, which means `can/connect?` can take
+   forever, especially when called with bad details. This translates to our tests
+   taking longer and the DB setup API endpoints seeming sluggish.
+
+   Don't set the timeout too low -- I've have Circle fail when the timeout was 250ms
+   on one occasion."
+  1000)

 (defn- details-map->connection-string
   [{:keys [user pass host port dbname]}]
@@ -21,7 +31,8 @@
          (str ":" port))
        "/"
        dbname
-       "?connectTimeoutMS=250")) ; timeout after 250 ms instead of 10s so can-connect? doesn't take forever
+       "?connectTimeoutMS="
+       connection-timeout-ms))

 (def ^:dynamic *mongo-connection*
   "Connection to a Mongo database.


add host

add host

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


Clarify graphite-server docstring

Clarify graphite-server docstring

--- src/riemann/transport/graphite.clj
+++ src/riemann/transport/graphite.clj
@@ -99,7 +99,7 @@

   :host       \"127.0.0.1\"
   :port       2003
-  :protocol   tcp or udp (tcp is default)
+  :protocol   :tcp or :udp (default :tcp)
   :parser-fn  an optional function given to decode-graphite-line"
   ([] (graphite-server {}))
   ([opts]


Add unit test for Card dashboard_count :sweat:

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

--- test/metabase/models/card_test.clj
+++ test/metabase/models/card_test.clj
@@ -0,0 +1,19 @@
+(ns metabase.models.card-test
+  (:require [expectations :refer :all]
+            (metabase.api [card-test :refer [post-card]]
+                          [dash-test :refer [create-dash]])
+            [metabase.db :refer [ins]]
+            (metabase.models [card :refer [Card]]
+                             [dashboard-card :refer [DashboardCard]])
+            [metabase.test.util :refer [random-name]]))
+
+;; Check that the :dashboard_count delay returns the correct count of Dashboards a Card is in
+(expect [0 1 2]
+  (let [{card-id :id}       (post-card (random-name))
+        get-dashboard-count (fn [] @(:dashboard_count (Card card-id)))]
+
+    [(get-dashboard-count)
+     (do (ins DashboardCard :card_id card-id, :dashboard_id (:id (create-dash (random-name))))
+         (get-dashboard-count))
+     (do (ins DashboardCard :card_id card-id, :dashboard_id (:id (create-dash (random-name))))
+         (get-dashboard-count))]))


added the cs-timetable crawler

added the cs-timetable crawler

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

--- src/ubb_api/crawler/cs_timetable.clj
+++ src/ubb_api/crawler/cs_timetable.clj
@@ -0,0 +1,29 @@
+(ns crawler.cs-timetable
+  (:require [net.cgrand.enlive-html :as html])
+  (:import (java.net URL)))
+
+(def row-size 8)
+
+(defn row-to-schedule-entry
+  [data-row]
+  (let [[week-day time frequency location group type subject professor] data-row]
+    {:week-day  week-day
+     :time      time
+     :frequency frequency
+     :location  location
+     :group     group
+     :type      type
+     :subject   subject
+     :professor professor}))
+
+(defn build-schedule-structure
+  [table-cells]
+  (let [all-rows (partition row-size table-cells)
+        rows (distinct all-rows)]
+    (map to-schedule-object rows)))
+
+(defn schedule
+  [url]
+  (let [html-page (html/html-resource (URL. url))
+        table-cells (html/select html-page [:td html/text-node])]
+    (build-schedule-structure table-cells)))


allow overriding "all days in past" behavior

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


Formatting

Formatting

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


Gurasoen zerrenda

Gurasoen zerrenda

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


ttest

ttest

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


clojure solution 2

clojure solution 2

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

--- clojure/2.clj
+++ clojure/2.clj
@@ -0,0 +1,3 @@
+(defn fib []
+  (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1])))
+(println (reduce + (take-while #(< % 4000000) (filter #(= 0 (mod % 2)) (fib)))))


Revert "Add dispatcher"

Revert "Add dispatcher"

This reverts commit f84a71cf6f1ded8f394858576b95c24f47392e1f.

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


Upgrade cider

Upgrade cider

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


db-interface: ability to read product list and repo list

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

--- src/arachnida/db_interface.clj
+++ src/arachnida/db_interface.clj
@@ -0,0 +1,17 @@
+(ns arachnida.db-interface)
+
+(require '[clojure.java.jdbc :as jdbc])
+(require '[arachnida.db-spec :as db-spec])
+
+(defn read-product-list
+    []
+    (jdbc/query db-spec/data-db  "select id, name
+                                  from   products
+                                  order  by id;"))
+
+(defn read-repo-list
+    [product-id]
+    (jdbc/query db-spec/data-db ["select id, name, url
+                                  from   repos
+                                  where  product=? order by id;" product-id]))
+


added client ns

added client ns

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

--- src/chat_ui/client.clj
+++ src/chat_ui/client.clj
@@ -0,0 +1,10 @@
+(ns chat-ui.client
+  (:require [chat-client.core :as client]))
+
+(def chat-client (atom nil))
+
+(defn create [host port]
+  (reset! chat-client (client/create host port)))
+
+(defn close []
+  (client/close @chat-client))


Debugging send-message!

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


Added deverver.

Added deverver.

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

--- src/clj/devserver.clj
+++ src/clj/devserver.clj
@@ -0,0 +1,30 @@
+(ns devserver
+  (:require [clojure.string :as string]
+            [compojure.route :as route]
+            [compojure.core :refer [defroutes]]
+            [compojure.handler :refer [site]]
+            [org.httpkit.server :as httpd]))
+
+
+(defn- log [msg & vals]
+  (let [line (apply format msg vals)]
+    (locking System/out (println line))))
+
+(defn logging [handler]
+  (fn [{:keys [request-method uri] :as req}]
+    (let [start (System/currentTimeMillis)
+          resp (handler req)
+          finish (System/currentTimeMillis)
+          total (- finish start)
+          method (string/upper-case (name request-method))
+          now (java.util.Date.)]
+      (log "%s - %s - %s - (%dms) - %s" now method uri total resp)
+      resp)))
+
+(defroutes server-routes
+  (route/files "/" {:root "resources/public/"})
+  (route/not-found "404"))
+
+(defn run []
+  (httpd/run-server
+    (site (-> server-routes logging)) {:port 9999}))


add main.clj

add main.clj

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

--- src/main/clojure/dojo/main.clj
+++ src/main/clojure/dojo/main.clj
@@ -0,0 +1,3 @@
+(ns dojo.main
+  (:use clojure.core.matrix))
+


update dependencies

update dependencies

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


revised ns imports

revised ns imports

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


reorg

reorg


deploy

deploy


Stub for test module metadata-exporter

Stub for test module metadata-exporter

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

--- test/emender_jenkins/metadata_exporter_test.clj
+++ test/emender_jenkins/metadata_exporter_test.clj
@@ -0,0 +1,29 @@
+;
+;  (C) Copyright 2016  Pavel Tisnovsky
+;
+;  All rights reserved. This program and the accompanying materials
+;  are made available under the terms of the Eclipse Public License v1.0
+;  which accompanies this distribution, and is available at
+;  http://www.eclipse.org/legal/epl-v10.html
+;
+;  Contributors:
+;      Pavel Tisnovsky
+;
+
+(ns emender-jenkins.metadata-exporter
+  (:require [clojure.test :refer :all]
+            [emender-jenkins.metadata-exporter :refer :all]))
+
+;
+; Common functions used by tests.
+;
+
+(defn callable?
+    "Test if given function-name is bound to the real function."
+    [function-name]
+    (clojure.test/function? function-name))
+
+;
+; Tests for various function definitions
+;
+


Kilo : User resource : Adding .clj that defines Korma user entity.

--Tom

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

--- src/kilo/data/user.clj
+++ src/kilo/data/user.clj
@@ -0,0 +1,25 @@
+(ns kilo.data.user
+
+  (:require [korma.core :refer [defentity table where select update set-fields]]))
+
+(defentity user
+  (table :mdl_sis_user)
+  )
+
+(defn get-user-data
+  [id]
+  ;; need to convert string id to long
+  (let [id (Long/parseLong id)]
+    (select user
+          (where {:id id})))
+   )
+
+(defn set-user-data
+  [id fields]
+  (let [id (Long/parseLong id)]
+    (update user
+            (set-fields fields)
+            (where {:id id})))
+  )
+
+


Use string/join instead of apply str

Use string/join instead of apply str

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


modify the doc-string for on-receive, binary message supported.

--- src/org/httpkit/server.clj
+++ src/org/httpkit/server.clj
@@ -46,8 +46,10 @@
     and :status will be stripped for WebSockets and for HTTP streaming responses
     after the first.")
   (on-receive [ch callback]
-    "Sets handler (fn [message-string]) for notification of client WebSocket
-    messages. Message ordering is guaranteed by server.")
+    "Sets handler (fn [message]) for notification of client WebSocket
+    messages. Message ordering is guaranteed by server.
+
+    The message argument could be a string or a byte[].")
   (on-close [ch callback]
     "Sets handler (fn [status]) for notification of channel being closed by the
     server or client. Handler will be invoked at most once. Useful for clean-up.


Log the fail.

Log the fail.

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


Improve documentation for read-partner-site*

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


Update tests

Update tests

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


clean up docstr for site-url setting

clean up docstr for site-url setting

--- src/metabase/core.clj
+++ src/metabase/core.clj
@@ -28,7 +28,7 @@

 (defsetting site-name "The name used for this instance of Metabase." "Metabase")

-(defsetting site-url "The base URL used to access this metabase server, e.g. 'http://metabase.my-company.com'")
+(defsetting site-url "The base URL used to access this metabase instance, e.g. \"http://metabase.my-company.com\"")

 (def app
   "The primary entry point to the HTTP server"


lein figwheel works and zelkova does not error out

error: pathspec 'src/kushana/scene.cljs' did not match any file(s) known to git

--- src/kushana/scene.cljs
+++ src/kushana/scene.cljs
@@ -0,0 +1,12 @@
+(ns kushana.scene
+  (:require babylon))
+(def b js/BABYLON)
+
+(defrecord Scene [id scene-graph update-fn options])
+
+(let [ider (atom 0)]
+  (defn new-id [] (swap! ider inc)))
+
+(defn new [scene-graph update-fn & {:as options}]
+  (Scene. (new-id) scene-graph update-fn options))
+


Rough spinner-label.

Rough spinner-label.

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

--- src/overtone/gui/spinner_label.clj
+++ src/overtone/gui/spinner_label.clj
@@ -0,0 +1,86 @@
+(ns overtone.gui.spinner-label
+  (:use [seesaw.core]
+        [seesaw.behave :only [when-mouse-dragged]]
+        [seesaw.meta :only [get-meta put-meta!]]
+        [seesaw.options :only [apply-options option-map default-option]]
+        [seesaw.keymap :only [map-key]]
+        [seesaw.widget-options :only [WidgetOptionProvider]]
+        [seesaw.value :only [Value value* value!*]]
+        [seesaw.selection :only [Selection]])
+  (:require [seesaw.bind :as bind]))
+
+(defn spinner-label-proxy []
+  (proxy [javax.swing.JLabel] []))
+
+(def ^{:private true} SpinnerLabelClass (class (spinner-label-proxy)))
+
+(defn- make-state [this]
+  { :model (atom nil)
+    :unbind (atom (fn []))
+    :update (fn [v this] (.setText this (str v)))})
+
+(defn- get-model [this] @(:model (get-meta this ::state)))
+(defn- set-model [this m]
+  (let [{:keys [model unbind update]} (get-meta this ::state)]
+    (@unbind)
+    (reset! model m)
+    (reset! unbind (bind/bind m (bind/b-do* update this)))
+    (update (.getValue m) this)))
+
+(defn spinner-label
+  "Same API as #'seesaw.core/spinner, but only a label is displayed and the
+  current value is modified by dragging the mouse up and down over it."
+  [& opts]
+  (let [widget (spinner-label-proxy)
+        state  (make-state widget)]
+    (put-meta! widget ::state state)
+    (set-model widget (spinner-model 0.0))
+    (when-mouse-dragged
+      widget
+      :drag (fn [e [dx dy]]
+              (let [m @(:model state)
+                    next (.getNextValue m)
+                    prev (.getPreviousValue m)]
+                (cond
+                  (and next (neg? dy)) (.setValue m next)
+                  (and prev (pos? dy)) (.setValue m prev)))))
+    (apply-options
+      widget
+      (concat
+        []
+        opts))
+    widget))
+
+(def spinner-label-options
+  (merge
+    default-options
+    (option-map
+      (default-option :model
+        set-model
+        get-model
+        "A spinner-model"))))
+
+(extend-type (do SpinnerLabelClass)
+  WidgetOptionProvider
+    (get-widget-option-map* [this] [spinner-label-options])
+    (get-layout-option-map* [this] nil)
+
+  Value
+    (container?* [this] false)
+    ; TODO implement value for spinner models in Seesaw
+    (value* [this] (.getValue (config this :model)))
+    (value!* [this v] (.setValue (config this :model) v))
+  Selection
+    (get-selection [this] [(value this)])
+    (set-selection [this [v]] (value! this v))
+
+  bind/ToBindable
+    (to-bindable* [this] (config this :model)))
+
+(comment
+  (use 'overtone.gui.spinner-label 'seesaw.core 'seesaw.dev)
+  (def sl (spinner-label :id :my-spin-label :model (spinner-model 10.0 :from 0.0 :to 100.0 :by 0.5)))
+  (selection! sl 99.5)
+  (bind/bind sl (bind/b-do [v] (println "new value " (value sl) ", " (selection sl))))
+  (-> (frame :content sl) pack! show!))
+


xymon.clj: service->xymon: same as host->xymon but for service names.

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