nrepl server/client experiment

nrepl server/client experiment

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

--- src-clj/cljs_workspace/nrepl_backlink.clj
+++ src-clj/cljs_workspace/nrepl_backlink.clj
@@ -0,0 +1,122 @@
+(ns cljs-workspace.nrepl-backlink
+; (ns user
+  (:require [clojure.tools.nrepl.server :as server]
+            [clojure.tools.nrepl :as nrepl]
+            [cider.nrepl]
+            [cemerick.piggieback]))
+
+; (defonce server (server/start-server :port 7888))
+
+(def default-env {:port 7888
+                  :client-port 9000
+                  :server nil
+                  :conn nil
+                  :session nil
+                  :browser-repl-enabled false})
+
+(defn- reset-env
+  [env]
+  (reset! env default-env))
+
+(defn running?
+  [env]
+  (let [{server :server} @env]
+    (not (or
+          (nil? server)
+          (.isClosed (:server-socket server))))))
+
+(defn start-server
+  [env]
+  (when (running? env) (throw (Exception. "Server already running")))
+  (let [{port :port} @env
+        server (server/start-server
+                :port port
+                :handler (apply server/default-handler
+                                #'cemerick.piggieback/wrap-cljs-repl
+                                (map resolve cider.nrepl/cider-middleware)))
+        conn (nrepl/connect :port port)
+        session (nrepl/client-session (nrepl/client conn Long/MAX_VALUE))]
+    (.setReuseAddress (:server-socket server) true)
+    (swap! env #(assoc % :server server :conn conn :session session))))
+
+(defn stop-server
+  [env]
+  (when-not (running? env) (throw (Exception. "Server not running")))
+  (let [{server :server conn :conn} @env]
+   (.close conn)
+   (server/stop-server server)))
+
+(defn cljs-eval
+  [env form]
+  (when-not (running? env) (throw (Exception. "Server not running")))
+  (let [{session :session} @env
+        result (doall (nrepl/message session {:op "eval" :code (str form)}))]
+    result))
+
+(defn start-browser-repl-default
+  [env]
+  (let [port (:client-port env)]
+   (cljs-eval env `(do (require 'cljs.repl.browser)
+                  (cemerick.piggieback/cljs-repl
+                   :repl-env (cljs.repl.browser/repl-env :port ~port)))))
+  (swap! env #(assoc % :browser-repl-enabled true)))
+
+(defn start-browser-repl
+  [env]
+  (start-browser-repl-default env))
+
+(defn stop-browser-repl
+  [env]
+  (cljs-eval env :cljs/quit)
+  (swap! env #(assoc % :browser-repl-enabled false)))
+
+
+(defn stop
+  [env]
+  (try (stop-browser-repl env)
+       (catch Exception e
+         (println "Could not stop the browser repl: " e)))
+  (stop-server env)
+  @(future (loop []
+             (Thread/sleep 100)
+             (when-not (.isClosed (:server-socket (:server @env)))
+               (recur))))
+  env)
+
+(defn start-with-env
+  [env & {:keys [cljs-connect] :or {cljs-connect true} :as options}]
+  (when (running? env) (stop env))
+  (try
+   (start-server env)
+   (when cljs-connect (start-browser-repl env))
+   (catch Exception err
+     (do
+       (try (stop-server env) (catch Exception _))
+       (throw err))))
+  env)
+
+(defn start
+  [& options]
+  (apply start-with-env (atom default-env) options))
+
+(defonce repl-runtime (start))
+
+; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+(defn -main [& args]
+  (println "started"))
+
+(comment
+
+  (require '[clojure.tools.nrepl :as repl])
+  (require '[clojure.tools.nrepl.server :as server])
+  (require '[cljs-workspace.nrepl-backlink :as nrepl-local])
+  (server/stop-server nrepl-local/server)
+
+  ; (doc repl/client)
+
+  (with-open [conn (repl/connect :port 7888)]
+     (-> (repl/client conn 1000)
+       (repl/message {:op :eval :code "(+ 1 1)"})
+        repl/response-values))
+)


bootstrap stuff

bootstrap stuff

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

--- src/metabase/bootstrap.clj
+++ src/metabase/bootstrap.clj
@@ -0,0 +1,66 @@
+(ns metabase.bootstrap
+  "Functions for creating new Orgs/Users from the command-line / REPL."
+  (:require (metabase [db :refer :all]
+                      [test-data :as data])
+            (metabase.models [database :refer [Database]]
+                             [org :refer [Org]]
+                             [org-perm :refer [OrgPerm]]
+                             [user :refer [User]])))
+
+(declare bootstrap-user
+         prompt-read-line
+         prompt-read-line-boolean)
+
+;; # BOOTSTRAPPING
+
+(defn bootstrap
+  "Create a User for development purposes. This will load the test data and create permissions for the Test Org."
+  []
+  @data/test-db ; migrate our DB + load the test data
+  (bootstrap-user))
+
+
+;; # (INTERNAL)
+
+(defn- bootstrap-user
+  "Create a new User (creating a new Org too if needed)."
+  []
+  (let [email (prompt-read-line "User email" "cam@metabase.com")
+        ;; create User if needed
+        user (or (sel :one User :email email)
+                 (ins User
+                      :email email
+                      :first_name (prompt-read-line "User first name" "Cam")
+                      :last_name (prompt-read-line "User last name" "Saul")
+                      :password (-> (prompt-read-line "User password" "password")
+                                    cemerick.friend.credentials/hash-bcrypt)))]
+    ;; create OrgPerm if needed
+    (or (sel :one OrgPerm :organization_id @data/org-id :user_id (:id user))
+        (let [admin? (prompt-read-line-boolean "Make user an admin?" "true")]
+          (ins OrgPerm
+               :organization_id @data/org-id
+               :user_id (:id user)
+               :admin admin?)))
+    user))
+
+(defn- prompt-read-line
+  "Prompt for input from stdin with PROMPT, returning DEFAULT if user hits return. Optionally, recurse until the returned value is in set VALID-VALUES."
+  ([prompt default]
+   (println prompt (str "[\"" default "\"]:"))
+   (let [line (read-line)]
+     (if (empty? line) default
+         line)))
+  ([prompt default valid-values]
+   {:pre [(set? valid-values)]}
+   (let [val (prompt-read-line prompt default)]
+     (if (contains? valid-values val) val
+         (do (println "Must be one of:" (map str valid-values))
+             (recur prompt default valid-values))))))
+
+(defn- prompt-read-line-boolean
+  "Prompt user for true/false and return a boolean."
+  [prompt default]
+  {:pre [(contains? #{"true" "false"} default)]}
+  (case (prompt-read-line prompt default #{"true" "false"})
+    "true" true
+    "false" false))


remove 'curren_user' middleware namespace.  we folded those couple functions into the auth middleware.

--- src/metabase/middleware/current_user.clj
+++ src/metabase/middleware/current_user.clj
@@ -1,23 +0,0 @@
-(ns metabase.middleware.current-user
-  "Middleware to make accessing user associated with a request easier."
-  (:require [korma.core :refer :all]
-            [metabase.db :refer [sel]]
-            [metabase.api.common :refer [*current-user* *current-user-id*]]
-            [metabase.models.user :refer [User current-user-fields]]))
-
-(defmacro sel-current-user [current-user-id]
-  `(sel :one [User ~@current-user-fields]
-        :id ~current-user-id))
-
-(defn bind-current-user
-  "Middleware that binds `metabase.api.common/*current-user*` and `*current-user-id*`
-
-   *current-user-id* int ID or nil of user associated with request
-   *current-user*    delay that returns current user (or nil) from DB"
-  [handler]
-  (fn [request]
-    (let [current-user-id 1] ; TODO - Placeholder value
-         (binding [*current-user-id* current-user-id
-                   *current-user* (if-not current-user-id (atom nil)
-                                          (delay (sel-current-user current-user-id)))]
-           (handler request)))))


add migrate-all-licenses-on-autopay

add migrate-all-licenses-on-autopay

Co-authored-by: humbamp123 <65d95376b628b531e429c2ca1f9be9019b5406a1@student.42.us.org>
Co-authored-by: tdiede <ef65042b5cd8cc926c830b14296fb6da2c648f70@gmail.com>

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


Add link to "our values"

Add link to "our values"


solved

solved

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

--- src/4clojure/indexing_seq.clj
+++ src/4clojure/indexing_seq.clj
@@ -0,0 +1,37 @@
+;; Indexing Sequences
+;; http://www.4clojure.com/problem/157
+;; Difficulty:	Easy
+;; Topics:	seqs
+
+
+;; Transform a sequence into a sequence of pairs containing the original elements along with their index.
+
+
+(defn __ [coll]
+  (map-indexed #(vector %2 %1) coll))
+
+
+(= (__ [:a :b :c]) [[:a 0] [:b 1] [:c 2]])
+
+(= (__ [0 1 3]) '((0 0) (1 1) (3 2)))
+
+(= (__ [[:foo] {:bar :baz}]) [[[:foo] 0] [{:bar :baz} 1]])
+
+
+// 4clojure copy paste
+(fn [l] (map-indexed #(vector %2 %1) l))
+
+;; _artem_uv's solution:
+#(map vector % (range))
+
+;; _pcl's solution:
+map-indexed #(vector %2 %1)
+
+;; aceeca1's solution:
+map-indexed #(list %2 %1)
+
+;; adereth's solution:
+#(map vector % (range))
+
+;; 0x89's solution:
+(fn [xs] (map-indexed (comp reverse vector) xs))


get the app environment and the auth token from the env vars

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/nilenso/finenso-time-tracker.git/'


Add explanatory comment

Add explanatory comment

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/bsmr-clojure/Nightcode.git/'


Introduce the Scale data type.

Introduce the Scale data type.

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


read config from .conf.edn files in settings dir

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


Remove commited whitespace

Remove commited whitespace

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


added tutorial 5 (incomplete)

added tutorial 5 (incomplete)

I am not able to map several inputs to one action,
and I don't have access to the app's speed protected field.

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

--- src/maqueta/hello/input_system.clj
+++ src/maqueta/hello/input_system.clj
@@ -0,0 +1,47 @@
+(ns maqueta.hello.input-system
+  (:use (maqueta application assets))
+  (:import (com.jme3.math ColorRGBA Vector3f)
+           com.jme3.scene.Geometry
+           com.jme3.scene.shape.Box))
+
+(def player (let [b (Box. Vector3f/ZERO 1 1 1)
+                  geo (Geometry. "Player" b)
+                  mat (load-material "Common/MatDefs/Misc/Unshaded.j3md")]
+              (.setColor mat "Color" ColorRGBA/Blue)
+              (.setMaterial geo mat)
+              geo))
+
+(def is-running (atom true))
+
+(defn toggle-pause
+  [app key-pressed tpf]
+  (if (not key-pressed)
+    (reset! is-running (not @is-running))))
+
+(defn rotate
+  [app value tpf]
+  (if @is-running
+    (.rotate player 0 value 0)
+    (println "Press P to unpause")))
+
+(defn right
+  [app value tpf]
+  (if @is-running
+    (let [v (.getLocalTranslation player)]
+      (.setLocalTranslation player (+ (.getX v) value) (.getY v) (.getZ v)))
+    (println "Press P to unpause")))
+
+(defn left
+  [app value tpf]
+  (if @is-running
+    (let [v (.getLocalTranslation player)]
+      (.setLocalTranslation player (- (.getX v) value) (.getY v) (.getZ v)))
+    (println "Press P to unpause")))
+
+(defn -main
+  []
+  (.start (make-app :root-node player
+                    :on-action {:key-p toggle-pause}
+                    :on-analog {:key-j left
+                                :key-k right
+                                :key-space rotate})))


Add a main template for Clojure

Add a main template for Clojure

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

--- Clojure/main.clj
+++ Clojure/main.clj
@@ -0,0 +1,7 @@
+(defn main
+  "Main function"
+  [args]
+  (println "Hello World!")
+  <+CURSOR+>)
+
+(main *command-line-args*)


Add profiles.clj

Add profiles.clj

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

--- profiles.clj
+++ profiles.clj
@@ -0,0 +1,5 @@
+{:user {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]
+                  [refactor-nrepl "0.3.0-SNAPSHOT"]
+                  [lein-kibit "0.1.2"]]
+        :dependencies [[alembic "0.3.2"]
+                       [org.clojure/tools.nrepl "0.2.7"]]}}


feat(headers): add outbound-headers from hook to request (#101)

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


Début d'un pong avec les collisions avec les pads et les murs

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

--- examples/yaw/pad_ball_4.clj
+++ examples/yaw/pad_ball_4.clj
@@ -0,0 +1,392 @@
+(ns yaw.pad-ball-4
+  (:require
+   [clojure.set :as set]
+   [yaw.world :as world]
+   [yaw.reaction :as react]
+   [yaw.render :as render]))
+
+(def +myctrl+ (world/start-universe!))
+
+(declare pad2-input)
+(declare pad1-input)
+(declare update-ball-state)
+
+;;; =====================
+;;; The state part
+;;; =====================
+
+(react/register-state ::pad1-state {:pos [3 0 -5]
+                                    :delta [0 0.05 0]})
+
+(react/register-state ::pad2-state {:pos [-3 0 -5]
+                                    :delta [0 0.05 0]})
+
+(react/register-state ::ball-state {:pos [-2 0 -5]
+                                    :delta [0.02 0 0]})
+
+(def init-pad1-state
+  {:pos [3 0 -5]
+   :delta [0 0.04 0]})
+
+(def init-pad2-state
+  {:pos [-3 0 -5]
+   :delta [0 0.04 0]})
+
+(def init-ball-state
+  {:pos [-2 0 -5]
+   :delta [0.04 0 0]})
+
+;;; =====================
+;;; Subscription(s)
+;;; =====================
+
+(react/register-subscription
+ ::pad1-changed
+ (fn [db]
+   (::pad1-state  db)))
+
+(react/register-subscription
+ ::pad2-changed
+ (fn [db]
+   (::pad2-state  db)))
+
+(react/register-subscription
+ ::ball-changed
+ (fn [db]
+   (::ball-state  db)))
+
+;;; ====================
+;;; Event handlers
+;;; ====================
+
+(react/register-event
+ :react/initialize
+ (fn []
+   (react/init-state ::pad1-state init-pad1-state)
+   (react/init-state ::pad2-state init-pad2-state)
+   (react/init-state ::ball-state init-ball-state)))
+
+(react/register-event
+ :react/frame-update
+ (fn []
+   (do
+     (react/dispatch [::move-ball])
+     (cond
+       (= @pad1-input :up) (react/dispatch [::move-up-pad1])
+       (= @pad1-input :down) (react/dispatch [::move-down-pad1]))
+     (cond
+       (= @pad2-input :up) (react/dispatch [::move-up-pad2])
+       (= @pad2-input :down) (react/dispatch [::move-down-pad2])))))
+
+(react/register-event
+ ::move-up-pad1
+ (fn []
+   (react/update-state ::pad1-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos (mapv + pos delta)
+                          :delta delta}))))
+
+(react/register-event
+ ::move-down-pad1
+ (fn []
+   (react/update-state ::pad1-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos (mapv - pos delta)
+                          :delta delta}))))
+
+(react/register-event
+ ::move-up-pad2
+ (fn []
+   (react/update-state ::pad2-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos (mapv + pos delta)
+                          :delta delta}))))
+
+(react/register-event
+ ::move-down-pad2
+ (fn []
+   (react/update-state ::pad2-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos (mapv - pos delta)
+                          :delta delta}))))
+
+(react/register-event
+ ::move-ball
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos (mapv + pos delta) :delta delta}))))
+
+;;=======================
+;;Hitbox collision events
+;;=======================
+
+;;Event called when the ball collide with the upper part of Pad 1
+(react/register-event
+ ::ball-collision-top1
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         (let [delta' (assoc delta 0 (- (Math/abs (get delta 0))))
+                               delta' (assoc delta' 1 0.01)]
+                           {:pos pos :delta delta'})))))
+
+;;Event called when the ball collide with the middle part of Pad 1
+(react/register-event
+ ::ball-collision-middle1
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos pos :delta (assoc delta 0 (- (Math/abs (get delta 0))))}))))
+
+;;Event called when the ball collide with the lower part of Pad 1
+(react/register-event
+ ::ball-collision-bottom1
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         (let [delta' (assoc delta 0 (- (Math/abs (get delta 0))))
+                               delta' (assoc delta' 1 -0.01)]
+                           {:pos pos :delta delta'})))))
+
+;;Event called when the ball collide with the upper part of Pad 2
+(react/register-event
+ ::ball-collision-top2
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         (let [delta' (assoc delta 0 (Math/abs (get delta 0)))
+                               delta' (assoc delta' 1 0.01)]
+                           {:pos pos :delta delta'})))))
+
+;;Event called when the ball collide with the middle part of Pad 2
+(react/register-event
+ ::ball-collision-middle2
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos pos :delta (assoc delta 0 (Math/abs (get delta 0)))}))))
+
+;;Event called when the ball collide with the bottom part of Pad 2
+(react/register-event
+ ::ball-collision-bottom2
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         (let [delta' (assoc delta 0 (Math/abs (get delta 0)))
+                               delta' (assoc delta' 1 -0.01)]
+                           {:pos pos :delta delta'})))))
+
+;;Event called when the ball collide with the upper wall
+(react/register-event
+ ::ball-collision-wall1
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         (let [delta' (assoc delta 1 (- (Math/abs (get delta 1))))]
+                           {:pos pos :delta delta'})))))
+
+;;Event called when the ball collide with the bottom wall
+(react/register-event
+ ::ball-collision-wall2
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         (let [delta' (assoc delta 1 (Math/abs (get delta 1)))]
+                           {:pos pos :delta delta'})))))
+
+;;==============
+;;Keyboard input
+;;==============
+
+(defonce pad2-input (atom :nil))
+(defonce pad1-input (atom :nil))
+
+;;{
+;; How to handle the keyboard input:
+;; * The pad at the right side move with the up and down arrow
+;; * The pad at the left side move with Z and S
+;;
+;; The inputs only change the atoms "pad2-input" and "pad1-input"
+;; who can contain :up, :down or :nil
+;; When pressing the key to move up (resp. move down), the atom becomes :up (resp. down)
+;; until the key is released or when the key to move down (resp. move up) is pressed.
+;; If it's released, the atom become :nil and if the key to move down (resp. move up) is pressed, it becomes :down (resp :up).
+;; If the atom contains :up (resp. :down) and the key to move down (resp. move up) is released, the atom doesn't change.
+;;
+;; The event frame-update move the pads following the values of the atoms
+;;}
+(world/register-input-callback! (:world @+myctrl+)
+                                (fn [key _ action _]
+                                  (cond
+
+                                    ;;Pad1 Move Up
+                                    (and (= key 265) ; HACK: GLFW constant for up arrow!
+                                         (= action 1)) ; HACK: GLFW_PRESS
+                                    (swap! pad1-input (fn [_] :up))
+                                    (and (= key 265) ; HACK: GLFW constant for up arrow!
+                                         (= action 0)) ; HACK: GLFW_RELEASE
+                                    (swap! pad1-input (fn [old]
+                                                             (if (= old :up)
+                                                               :nil
+                                                               old)))
+
+                                    ;;Pad1 Move Down
+                                    (and (= key 264) ; HACK: GLFW constant for down arrow!
+                                         (= action 1)) ; HACK: GLFW_PRESS
+                                    (swap! pad1-input (fn [_] :down))
+                                    (and (= key 264) ; HACK: GLFW constant for down arrow!
+                                         (= action 0)) ; HACK: GLFW_RELEASE
+                                    (swap! pad1-input (fn [old]
+                                                             (if (= old :down)
+                                                               :nil
+                                                               old)))
+
+                                    ;;Pad2 Move Up
+                                    (and (= key 87) ; HACK: GLFW constant for Z!
+                                         (= action 1)) ; HACK: GLFW_PRESS
+                                    (swap! pad2-input (fn [_] :up))
+                                    (and (= key 87) ; HACK: GLFW constant for Z!
+                                         (= action 0)) ; HACK: GLFW_RELEASE
+                                    (swap! pad2-input (fn [old]
+                                                            (if (= old :up)
+                                                              :nil
+                                                              old)))
+
+                                    ;;Pad2 Move Down
+                                    (and (= key 83) ; HACK: GLFW constant for down arrow!
+                                         (= action 1)) ; HACK: GLFW_PRESS
+                                    (swap! pad2-input (fn [_] :down))
+                                    (and (= key 83) ; HACK: GLFW constant for down arrow!
+                                         (= action 0)) ; HACK: GLFW_RELEASE
+                                    (swap! pad2-input (fn [old]
+                                                            (if (= old :down)
+                                                              :nil
+                                                              old))))))
+
+;;; =====================
+;;; The view part
+;;; =====================
+
+(defn the-pad1
+  [state]
+  [:group :test/pad-group-1
+   {:pos (:pos @state)
+    :rot [0 0 0]
+    :scale 1}
+   [:item :test/pad-item-1
+    {:mesh :mesh/cuboid
+     :pos [0 0 0]
+     :rot [0 0 0]
+     :mat :red
+     :scale 0.3}]
+   [:hitbox :test/pad-hitbox-top-1
+    {:pos [0 0.6 0]
+     :scale 0.6
+     :length [1 1 1]}]
+   [:hitbox :test/pad-hitbox-middle-1
+    {:pos [0 0 0]
+     :scale 0.6
+     :length [1 1 1]}]
+   [:hitbox :test/pad-hitbox-bottom-1
+    {:pos [0 -0.6 0]
+     :scale 0.6
+     :length [1 1 1]}]])
+
+(defn the-pad2
+  [state]
+  [:group :test/pad-group-2
+   {:pos (:pos @state)
+    :rot [0 0 0]
+    :scale 1}
+   [:item :test/pad-item-2
+    {:mesh :mesh/cuboid
+     :pos [0 0 0]
+     :rot [0 0 0]
+     :mat :red
+     :scale 0.3}]
+   [:hitbox :test/pad-hitbox-top-2
+    {:pos [0 0.6 0]
+     :scale 0.6
+     :length [1 1 1]}]
+   [:hitbox :test/pad-hitbox-middle-2
+    {:pos [0 0 0]
+     :scale 0.6
+     :length [1 1 1]}]
+   [:hitbox :test/pad-hitbox-bottom-2
+    {:pos [0 -0.6 0]
+     :scale 0.6
+     :length [1 1 1]}]])
+
+(defn the-ball
+  [state]
+  [:group :test/ball {:pos (:pos @state)
+                      :rot [0 0 0]
+                      :scale 1}
+   [:item :test/box {:mesh :mesh/box
+                     :pos [0 0 0]
+                     :rot [0 0 0]
+                     :mat :yellow
+                     :scale 0.2}]
+   [:hitbox :test/ball-hitbox {:pos [0 0 0]
+                               :scale 0.4
+                               :length [1 1 1]}
+    [{:group-id :test/pad-group-1 :hitbox-id :test/pad-hitbox-top-1 :collision-handler #(react/dispatch [::ball-collision-top1])}
+     {:group-id :test/pad-group-1 :hitbox-id :test/pad-hitbox-middle-1 :collision-handler #(react/dispatch [::ball-collision-middle1])}
+     {:group-id :test/pad-group-1 :hitbox-id :test/pad-hitbox-bottom-1 :collision-handler #(react/dispatch [::ball-collision-bottom1])}
+     {:group-id :test/pad-group-2 :hitbox-id :test/pad-hitbox-top-2 :collision-handler #(react/dispatch [::ball-collision-top2])}
+     {:group-id :test/pad-group-2 :hitbox-id :test/pad-hitbox-middle-2 :collision-handler #(react/dispatch [::ball-collision-middle2])}
+     {:group-id :test/pad-group-2 :hitbox-id :test/pad-hitbox-bottom-2 :collision-handler #(react/dispatch [::ball-collision-bottom2])}
+     {:group-id :test/wall-group-1 :hitbox-id :test/wall-hitbox-1 :collision-handler #(react/dispatch [::ball-collision-wall1])}
+     {:group-id :test/wall-group-2 :hitbox-id :test/wall-hitbox-2 :collision-handler #(react/dispatch [::ball-collision-wall2])}
+     ]]])
+
+(defn the-wall
+  [state id]
+  [:group (keyword "test" (str "wall-group-" id)) {:pos (:pos state)
+                                                   :rot [0 0 0]
+                                                   :scale 1}
+   [:item (keyword "test" (str "wall-" id)) {:mesh :mesh/cuboid
+                                             :pos [0 0 0]
+                                             :rot (:rot state)
+                                             :mat :white
+                                             :scale (:scale state)}]
+   [:hitbox (keyword "test" (str "wall-hitbox-" id)) {:pos [0 0 0]
+                                                      :rot (:rot state)
+                                                      :scale (* 2 (:scale state))
+                                                      :length [0.99 2.99 0.99]}]
+   ])
+
+(defn scene []
+  [:scene
+   [:ambient {:color :white :i 0.4}]
+   [:sun {:color :red :i 1 :dir [-1 0 0]}]
+   [:light ::light {:color :yellow :pos [0.5 0 -4]}]
+   [the-wall {:pos [0 4.5 -5] :rot [0 0 90] :scale 2} 1]
+   [the-wall {:pos [0 -4.5 -5] :rot [0 0 90] :scale 2} 2]
+   (let [pad-state1 (react/subscribe +myctrl+ [::pad1-changed])]
+     [the-pad1 pad-state1])
+   (let [pad-state2 (react/subscribe +myctrl+ [::pad2-changed])]
+     [the-pad2 pad-state2])
+   (let [ball-state (react/subscribe +myctrl+ [::ball-changed])]
+     [the-ball ball-state])
+   ])
+
+;;; =====================
+;;; The main part
+;;; =====================
+
+(react/activate! +myctrl+ [scene])


window

window

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

--- src/cljx/jamesmacaulay/zelkova/window.cljx
+++ src/cljx/jamesmacaulay/zelkova/window.cljx
@@ -0,0 +1,46 @@
+#+clj
+(ns jamesmacaulay.zelkova.window
+  (:refer-clojure :exclude [meta])
+  (:require [jamesmacaulay.zelkova.signal :as z]
+            [clojure.core.async :as async]))
+
+#+cljs
+(ns jamesmacaulay.zelkova.window
+  (:refer-clojure :exclude [meta])
+  (:require [jamesmacaulay.zelkova.signal :as z]
+            [jamesmacaulay.async-tools.core :as tools]
+            [goog.events :as events]
+            [cljs.core.async :as async :refer [>! <!]])
+  (:require-macros [cljs.core.async.macros :refer [go go-loop]]))
+
+#+cljs
+(defn- listen
+  [el type & args]
+  (let [out (apply async/chan 1 args)]
+    (events/listen el type (fn [e] (async/put! out e)))
+    out))
+
+(defn- get-size
+  [opts]
+  #+cljs
+  (let [node (or (:dom-node opts) (.-body js/document))
+        w (.-clientWidth node)
+        h (.-clientHeight node)]
+    [w h])
+  #+clj
+  [500 500])
+
+(defn dimensions-channel
+  [graph opts]
+  #+cljs
+  (tools/concat (async/to-chan [(get-size opts)])
+                (listen js/window "resize" (map #(get-size opts))))
+  #+clj
+  (async/chan))
+
+(def dimensions
+  (z/input [0 0] ::dimensions dimensions-channel))
+
+(def width (z/lift first dimensions))
+
+(def height (z/lift second dimensions))


WEASEL-49: Weasel should defer to REPL infrastructure for dealing with upstream deps

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


add a bunch of type hints in the consumer.


[#2080] Relates 31665903d5476e0b62c0cfa60a7b80facfe48e0e

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

--- backend/specs/akvo/lumen/specs/raster.clj
+++ backend/specs/akvo/lumen/specs/raster.clj
@@ -0,0 +1,13 @@
+(ns akvo.lumen.specs.raster
+  (:require [clojure.tools.logging :as log]
+            [akvo.lumen.specs.db :as db.s]
+            [akvo.lumen.specs :as lumen.s]
+            [clojure.spec.alpha :as s]))
+
+(def ^:dynamic *id?*  lumen.s/str-uuid?)
+
+(s/def ::id? #'*id?*)
+
+(s/def ::id  (s/with-gen
+               ::id?
+               lumen.s/str-uuid-gen))


Add continuation spec tests.

Add continuation spec tests.

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

--- spec/cats/monad/continuation_spec.cljx
+++ spec/cats/monad/continuation_spec.cljx
@@ -0,0 +1,53 @@
+(ns cats.monad.continuation-spec
+  #+cljs
+  (:require [speclj.core :as s :include-macros true]
+            [cats.builtin :as b]
+            [cats.protocols :as p]
+            [cats.monad.continuation :as cont]
+            [cats.monad.maybe :as maybe]
+            [cats.core :as m :include-macros true])
+  #+clj
+  (:require [speclj.core :as s]
+            [cats.builtin :as b]
+            [cats.protocols :as p]
+            [cats.monad.continuation :as cont]
+            [cats.monad.maybe :as maybe]
+            [cats.core :as m]))
+
+(def cont-42 (cont/continuation (fn [c] (c 42))))
+(def inc-cont-fn (fn [x]
+                   (cont/continuation (fn [c] (c (inc x))))))
+
+(s/describe "continuation-monad"
+  (s/it "The first monad law: left identity"
+    (s/should= (cont/run-cont cont-42)
+               (cont/run-cont (m/with-monad cont/continuation-monad
+                                (m/>>= (m/return 42)
+                                       (fn [v] (cont/continuation (fn [c] c v))))))))
+
+
+  (s/it "The second monad law: right identity"
+    (s/should= (cont/run-cont cont-42)
+               (cont/run-cont
+                (m/>>= cont-42 m/return))))
+
+  (s/it "The third monad law: associativity"
+    (s/should= (cont/run-cont
+                (m/>>= (m/mlet [x  cont-42
+                                y  (inc-cont-fn x)]
+                         (m/return y))
+                       inc-cont-fn))
+               (cont/run-cont
+                (m/>>= cont-42
+                       (fn [x] (m/>>= (cont/continuation (fn [c] (c (inc x))))
+                                      inc-cont-fn))))))
+
+  (s/it "call-cc allows the creation of resumable computations."
+    (let [cc (atom nil)]
+      (s/should= 44 (cont/run-cont (m/mlet [x cont-42
+                                            y (cont/call-cc (fn [k]
+                                                              (reset! cc k)
+                                                              (k 2)))]
+                                     (m/return (+ x y)))))
+      (s/should= 45 (cont/run-cont (@cc 3)))
+      (s/should= 46 (cont/run-cont (@cc 4))))))


only hide REPL if :repl is false

only hide REPL if :repl is false

--- sidecar/src/figwheel_sidecar/repl.clj
+++ sidecar/src/figwheel_sidecar/repl.clj
@@ -431,8 +431,7 @@
 (defn run-autobuilder [{:keys [figwheel-options all-builds build-ids] :as options}]
   (binding [*autobuild-env* (create-autobuild-env options)]
     (start-nrepl-server figwheel-options *autobuild-env*)
-    (if (or (false? (:repl figwheel-options))
-            (not (nil? (:nrepl-port figwheel-options))))
+    (if (false? (:repl figwheel-options))
       (when (figwheel-sidecar.auto-builder/autobuild-ids *autobuild-env*)
         (loop [] (Thread/sleep 30000) (recur)))
       (repl-switching-loop))))


adding back missing dep

adding back missing dep

--- sidecar/src/figwheel_sidecar/repl.clj
+++ sidecar/src/figwheel_sidecar/repl.clj
@@ -8,6 +8,7 @@
    [clojure.string :as string]
    [clojure.core.async :refer [chan <!! <! put! alts!! timeout close! go go-loop]]

+   [clojure.tools.nrepl.middleware.interruptible-eval :as nrepl-eval]
    [figwheel-sidecar.core :as fig]
    [figwheel-sidecar.config :as config]))


Escape card and column titles to prevent XSS

--- src/metabase/pulse.clj
+++ src/metabase/pulse.clj
@@ -1,5 +1,5 @@
 (ns metabase.pulse
-  (:require [hiccup.core :refer [html]]
+  (:require [hiccup.core :refer [html h]]
             [clj-time.core :as t]
             [clj-time.coerce :as c]
             [clj-time.format :as f]
@@ -9,6 +9,8 @@
             (metabase.models [setting :refer [defsetting] :as setting])
             [metabase.util :as u]))

+;; NOTE: hiccup does not escape content by default so be sure to use "h" to escape any user-controlled content :-/
+
 ;;; ## CONFIG

 (defsetting slack-token "Slack API bearer token obtained from https://api.slack.com/web#authentication")
@@ -53,8 +55,8 @@
 (defn render-table-row
   [index row bar-column max-value]
   [:tr {:style (if (odd? index) "color: rgb(189,193,191);" "color: rgb(124,131,129);")}
-    [:td {:style bar-td-style} (format-cell (first row))]
-    [:td {:style (str bar-td-style "font-weight: 700;")} (format-cell (second row))]
+    [:td {:style bar-td-style} (-> row first format-cell h)]
+    [:td {:style (str bar-td-style "font-weight: 700;")} (-> row second format-cell h)]
     (if bar-column [:td {:style (str bar-td-style "width: 99%;")}
       [:div {:style (str "background-color: rgb(135, 93, 175); height: 20px; width: " (float (* 100 (/ (bar-column row) max-value))) "%")} " "]])])

@@ -65,22 +67,22 @@
       [:thead
         [:tr
           [:th {:style (str bar-td-style bar-th-style "min-width: 60px;")}
-            (-> cols first :display_name upper-case)]
+            (-> cols first :display_name upper-case h)]
           [:th {:style (str bar-td-style bar-th-style "min-width: 60px;")}
-            (-> cols second :display_name upper-case)]
+            (-> cols second :display_name upper-case h)]
           (if bar-column [:th {:style (str bar-td-style bar-th-style "width: 99%;")}])]]
       [:tbody
         (map-indexed #(render-table-row %1 %2 bar-column max-value) rows)]]))

 (defn render-bar-chart
   [data]
-  [:div {:style ""}
+  [:div
     (render-table data second)])

 (defn render-scalar
   [data]
   [:div {:style scalar-style}
-    (-> data :rows first first format-cell)])
+    (-> data :rows first first format-cell h)])

 (def ^:private sparkline-dot-radius 6)
 (def ^:private sparkline-thickness 4)
@@ -144,7 +146,8 @@
   [card data include-title]
   [:div {:style (str section-style "margin: 16px;")}
     (if include-title [:div {:style "margin-bottom: 16px;"}
-      [:a {:style header-style :href (str (setting/get :-site-url) "/card/" (:id card) "?clone")} (:name card)]] nil)
+      [:a {:style header-style :href (h (str (setting/get :-site-url) "/card/" (:id card) "?clone"))}
+        (-> card :name h)]])
     (cond
       (and (= (-> data :cols count) 1) (= (-> data :rows count) 1)) (render-scalar data)
       (and (= (-> data :cols count) 2) (= (-> data :cols first :base_type) :DateTimeField)) (render-sparkline data)
@@ -159,7 +162,7 @@
 (defn render-pulse
   [pulse results]
   [:div
-    [:h1 {:style (str section-style "margin: 16px; color: rgb(57,67,64);")} (:name pulse)]
+    [:h1 {:style (str section-style "margin: 16px; color: rgb(57,67,64);")} (-> pulse :name h)]
     (apply vector :div (mapv render-pulse-section results))])

 ; ported from https://github.com/radkovo/CSSBox/blob/cssbox-4.10/src/main/java/org/fit/cssbox/demo/ImageRenderer.java


Add meta viewport tag for mobile

Add meta viewport tag for mobile

More info:
- http://getbootstrap.com/css/#overview-mobile
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta

--- src/clojars/web/common.clj
+++ src/clojars/web/common.clj
@@ -17,6 +17,7 @@
             :href "/opensearch.xml"
             :rel "search"}]
     [:meta {:charset "utf-8"}]
+    [:meta {:name "viewport" :content "width=device-width,initial-scale=1"}]
     [:title
      (when title
        (str title " - "))


Delete db-props.clj

Delete db-props.clj

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


added core.match dependency to webrepl.

added core.match dependency to webrepl.

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


Solve Simple Product in clojure

Solve Simple Product in clojure

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

--- solutions/uri/1004/1004.clj
+++ solutions/uri/1004/1004.clj
@@ -0,0 +1,8 @@
+(ns main)
+
+(defn main []
+  (let [a (Integer/parseInt (read-line))
+        b (Integer/parseInt (read-line))]
+    (* a b)))
+
+(println "PROD =" (main))


make payment descriptions more informative

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


Add early-voting as a valid voting-method

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


Initial commit of rule to create AllDisjointClasses in bio world

error: pathspec 'kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/post-identifier-merge/step_b-ontology_to_ice/step_a/copy_owl_alldisjointclasses_to_bio.clj' did not match any file(s) known to git

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/post-identifier-merge/step_b-ontology_to_ice/step_a/copy_owl_alldisjointclasses_to_bio.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/post-identifier-merge/step_b-ontology_to_ice/step_a/copy_owl_alldisjointclasses_to_bio.clj
@@ -0,0 +1,13 @@
+`{:name "copy-owl-alldisjointclasses-to-bio"
+  :description "This rule makes a copy of all owl:AllDisjointClasses instances and connects the copy to a generated AllDisjointClasses Record (ccp:IAO_EXT_0000319) instance."
+  :head ((?/adc_record obo/IAO_0000219 ?/adc) ;; obo:denotes
+  	(?/adc_record rdf/type obo/IAO_EXT_0000319) ;; ccp:OWL AllDisjointClasses record
+  	(?/adc_record obo/IAO_0000219 ?/bio_adc) ;; obo:denotes
+  	(?/bio_adc rdf/type owl/AllDisjointClasses))
+  :reify ([?/adc_record {:ln (:sha-1 ?/adc)
+                     :ns "ccp" :prefix "R_"}]
+          [?/bio_adc {:ln (:sha-1 ?/adc)
+                  :ns "ccp" :prefix "ADC_"}])
+  :sparql-string "select ?adc {
+                    ?adc rdf:type owl:AllDisjointClasses ."
+  }


Day 10

Day 10

error: pathspec 'src/advent_2017/day_10.cljc' did not match any file(s) known to git

--- src/advent_2017/day_10.cljc
+++ src/advent_2017/day_10.cljc
@@ -0,0 +1,39 @@
+(ns advent-2017.day-10
+  (:require
+   [clojure.string :as str]))
+
+(def data [129,154,49,198,200,133,97,254,41,6,2,1,255,0,191,108])
+
+(defn round [lengths [xs current-pos skip-size]]
+  (reduce (fn [[xs current-pos skip-size] length]
+            (let [reversed (reverse (take length (drop current-pos (cycle xs))))
+                  after    (take (- 256 length) (drop (+ current-pos length) (cycle xs)))]
+              [(take 256 (drop (- 256 current-pos) (cycle (concat reversed after))))
+               (mod (+ current-pos length skip-size) 256)
+               (mod (inc skip-size) 256)]))
+    [xs current-pos skip-size]
+    lengths))
+
+(defn part-1 []
+  (->> [(range 256) 0 0]
+    (round data)
+    first
+    (take 2)
+    (apply *)))
+
+(defn xs->ascii [xs]
+  (->> xs (str/join ",") (mapv #?(:clj int :cljs #(.charCodeAt % 0)))))
+
+(defn hex [n]
+  (let [nybble (fn [n] (nth "0123456789abcdef" n))]
+    (str (nybble (bit-and (bit-shift-right n 4) 0xF)) (nybble (bit-and n 0xF)))))
+
+(defn part-2 []
+  (->> [(range 256) 0 0]
+    (iterate (partial round (into (xs->ascii data) [17, 31, 73, 47, 23])))
+    (drop 64)
+    ffirst
+    (partition 16)
+    (map #(reduce bit-xor %))
+    (map hex)
+    (apply str)))


In order to solve puzzle #23, it seems I should have done #12 first. Implementing parsing.

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

--- src/adventofcode1/twelf.clj
+++ src/adventofcode1/twelf.clj
@@ -0,0 +1,140 @@
+(ns adventofcode1.twelf
+  "http://adventofcode.com/2016/day/12"
+  (:require
+   [clojure.spec :as s]
+   [clojure.spec.gen :as gen]
+   [clojure.spec.test :as stest]
+   [com.gfredericks.test.chuck.generators :as gen']
+   [clojure.test.check :as tc]
+   [clojure.test.check.generators :as tcgen]
+   [clojure.test.check.properties :as tcprop]
+
+   [clojure.core.match :refer [match]]
+   [clojure.math.combinatorics :as combo]
+   [clojure.string :as str]
+
+   spyscope.core
+   mw.utils
+   adventofcode1.spec-test-instrument-debug))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; computer definition
+
+;; Initially, only "a" to "d"
+(s/def ::regs (s/map-of string? integer?))
+
+(s/def ::computer (s/keys :req-un [::regs]))
+
+(s/fdef init-computer
+        :args (s/cat)
+        :ret  ::computer)
+
+(defn init-computer
+  []
+  {:regs {"a" 0 "b" 0 "c" 0 "d" 0}})
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; helpers
+
+(defn parse-int
+  [s]
+  (int (bigint s)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; parse instructions
+
+(defn parse-cpy-value
+  [cmd]
+  (if-let [[_ x y] (re-find (re-matcher #"^cpy (-?\d+) ([a-z]+)$" cmd))]
+    {:cmd :cpy-value :x x :y y}))
+
+(defn parse-cpy-reg
+  [cmd]
+  (if-let [[_ x y] (re-find (re-matcher #"^cpy ([a-z]+) ([a-z]+)$" cmd))]
+    {:cmd :cpy-reg :x x :y y}))
+
+(defn parse-inc
+  [cmd]
+  (if-let [[_ x] (re-find (re-matcher #"^inc ([a-z]+)$" cmd))]
+    {:cmd :inc :x x}))
+
+(defn parse-dec
+  [cmd]
+  (if-let [[_ x] (re-find (re-matcher #"^dec ([a-z]+)$" cmd))]
+    {:cmd :dec :x x}))
+
+;; does this instruction exists? yes!
+(defn parse-jnz-value
+  [cmd]
+  (if-let [[_ x y] (re-find (re-matcher #"^jnz (-?\d+) (-?\d+)$" cmd))]
+    {:cmd :jnx-value :x x :y y}))
+
+;; do we know the 2nd arg is always a number? Yes, at least in my sample
+(defn parse-jnz-x-reg
+  [cmd]
+  (if-let [[_ x y] (re-find (re-matcher #"^jnz ([a-z]+) (-?\d+)$" cmd))]
+    {:cmd :jnx-x-reg :x x :y y}))
+
+
+(defn parse-cmd
+  [cmd]
+  (let [ret (or (parse-cpy-value cmd)
+                (parse-cpy-reg cmd)
+                (parse-inc cmd)
+                (parse-dec cmd)
+                (parse-jnz-value cmd)
+                (parse-jnz-x-reg cmd))]
+    (if (nil? ret)(assert false {:error :not-a-command :data cmd})
+        ret)))
+
+;; testdata defined further down
+(declare puzzle-input-a)
+
+(defn parse-cmds
+  ([](parse-cmds (str/split-lines puzzle-input-a)))
+  ([cmds]
+   (map parse-cmd cmds)))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; execution
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; sample data
+
+(def sample-data
+  "cpy 41 a
+inc a
+inc a
+dec a
+jnz a 2
+dec a")
+
+(def puzzle-input-a
+  "cpy 1 a
+cpy 1 b
+cpy 26 d
+jnz c 2
+jnz 1 5
+cpy 7 c
+inc d
+dec c
+jnz c -2
+cpy a c
+inc a
+dec b
+jnz b -2
+cpy c b
+dec d
+jnz d -6
+cpy 14 c
+cpy 14 d
+inc a
+dec d
+jnz d -2
+dec c
+jnz c -5")


Test Validation with generative tests

Test Validation with generative 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/tcsavage/cats.git/'


term-local/? marker,test

term-local/? marker,test

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


wrap the def of warp, *metawarp* in functions, invoked at the very end


Note to self.

Note to self.

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


better test configs

better test configs


Returned type,helper,loop logic

Returned type,helper,loop logic


add antd-ptm to cooper watch

add antd-ptm to cooper watch


Adding some functions that are helpful in searching ES directly

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

--- dev/user.clj
+++ dev/user.clj
@@ -0,0 +1,219 @@
+(ns user
+  (:require [cheshire.core :as json]
+            [clj-http.client :as http]
+            [clj-momo.lib.time :as time]
+            [ctim.schemas.vocabularies :as vocab]))
+
+(defn- judgement-search-url
+  ([]
+   (judgement-search-url "https://tenzin-beta.amp.cisco.com/elasticsearch/"
+                         "ctia_judgement"))
+  ([url-prefix index]
+   (str url-prefix index "/_search")))
+
+(defn- query-es-observables [& {:keys [auth-str max-per-type search-url]
+                                :or {max-per-type 1000
+                                     search-url (judgement-search-url)}}]
+  (assert (re-matches #"\w+:\w+" auth-str) "Bad auth string")
+
+  (-> (http/post
+       search-url
+       {:basic-auth auth-str
+        :headers {"kbn-xsrf" ""}
+        :as :json
+        :content-type :json
+        :throw-exceptions false
+        :body (json/generate-string
+               {:aggs
+                {:types
+                 {:terms {:field "observable.type"
+                          :size (count vocab/observable-type-identifier)}
+                  :aggs {:values
+                         {:terms {:field "observable.value"
+                                  :size max-per-type}}}}}
+                :size 0})})
+      :body))
+
+(defn- fixup-observables [query-response]
+  (for [{obs-type :key, :as type-bucket} (get-in query-response
+                                                 [:aggregations :types :buckets])
+        {obs-value :key :as value-bucket} (get-in type-bucket [:values :buckets])]
+    {:type obs-type
+     :value obs-value}))
+
+(defn find-observables [auth-str max-per-type]
+  (-> (query-es-observables :auth-str auth-str
+                            :max-per-type max-per-type)
+      fixup-observables))
+
+(defn find-judgement-for-verdict [{:keys [type value] :as _observable_}
+                                  & {:keys [auth-str search-url]
+                                     :or {search-url (judgement-search-url)}}]
+  (assert (re-matches #"\w+:\w+" auth-str) "Bad auth string")
+
+  (let [now (time/now)]
+    (->> (http/post
+          search-url
+          {:basic-auth auth-str
+           :headers {"kbn-xsrf" ""}
+           :as :json
+           :content-type :json
+           :throw-exceptions false
+           :body (json/generate-string
+                  {:query
+                   {:bool
+                    {:must [{:term {"observable.type" type}}
+                            {:term {"observable.value" value}}]
+                     :filter [{:range {"valid_time.start_time"
+                                       {"lte" (time/format-date-time now)}}}
+                              {:range {"valid_time.end_time"
+                                       {"gt" (time/format-date-time now)}}}]}}
+                   :sort
+                   [{:priority "desc"}
+                    {:disposition "asc"}
+                    {"valid_time.start_time" "asc"}]
+                   :size 1})})
+         :body
+         :hits
+         :hits
+         first
+         :_source)))
+
+(defn find-all-judgements [{:keys [type value] :as _observable_}
+                           & {:keys [auth-str search-url size]
+                              :or {search-url (judgement-search-url)
+                                   size 1000}}]
+  (assert (re-matches #"\w+:\w+" auth-str) "Bad auth string")
+
+  (let [now (time/now)]
+    (->> (http/post
+          search-url
+          {:basic-auth auth-str
+           :headers {"kbn-xsrf" ""}
+           :as :json
+           :content-type :json
+           :throw-exceptions false
+           :body (json/generate-string
+                  {:query
+                   {:bool
+                    {:must [{:term {"observable.type" type}}
+                            {:term {"observable.value" value}}]}}
+                   :sort
+                   [{:priority "desc"}
+                    {:disposition "asc"}
+                    {"valid_time.start_time" "asc"}]
+                   :size size})})
+         :body
+         :hits
+         :hits
+         (map :_source))))
+
+(defn- ctia-verdict-url [{:keys [type value] :as _observable_}]
+  (str "https://tenzin-beta.amp.cisco.com/ctia/" type "/" value "/verdict"))
+
+#_(defn- get-ctia-verdict [observable & {:keys [auth-str]}]
+  (clojure.pprint/pprint ['observable observable])
+  (assert (re-matches #"\w+:\w+" auth-str) "Bad auth string")
+
+  (let [{:keys [body status]}
+        (loop [tries 3]
+          (when (< tries 3)
+            (Thread/sleep (+ 1 (rand-int 1000))))
+          (clojure.pprint/pprint ['try tries])
+          (when (< 0 tries)
+            (let [{:keys [status] :as response}
+                  (http/get
+                   (ctia-verdict-url observable)
+                   {:basic-auth auth-str
+                    :as :json
+                    :content-type :json
+                    :throw-exceptions false})]
+              (if (= status 200)
+                response
+                (recur (dec tries))))))]
+    (assert (= 200 status))
+    body))
+
+(defn- verdict-search-url
+  ([]
+   (judgement-search-url "https://tenzin-beta.amp.cisco.com/elasticsearch/"
+                         "ctia_verdict"))
+  ([url-prefix index]
+   (str url-prefix index "/_search")))
+
+(defn find-verdict [{:keys [type value] :as _observable_}
+                     & {:keys [auth-str search-url]
+                        :or {search-url (verdict-search-url)}}]
+  (assert (re-matches #"\w+:\w+" auth-str) "Bad auth string")
+
+  (let [now (time/now)]
+    (-> (http/post
+         search-url
+         {:basic-auth auth-str
+          :headers {"kbn-xsrf" ""}
+          :as :json
+          :content-type :json
+          :throw-exceptions false
+          :body (json/generate-string
+                 {:query
+                  {:bool
+                   {:must [{:term {"observable.type" type}}
+                           {:term {"observable.value" value}}]
+                    :filter [{:range {"valid_time.start_time"
+                                      {"lte" (time/format-date-time now)}}}
+                             {:range {"valid_time.end_time"
+                                      {"gt" (time/format-date-time now)}}}]}}
+                  :sort {:created "desc"}
+                  :size 1})})
+        :body
+        :hits
+        :hits
+        first
+        :_source)))
+
+(defn find-all-verdicts [{:keys [type value] :as _observable_}
+                         & {:keys [auth-str search-url size]
+                            :or {search-url (verdict-search-url)
+                                 size 1000}}]
+  (assert (re-matches #"\w+:\w+" auth-str) "Bad auth string")
+
+  (let [now (time/now)]
+    (->> (http/post
+          search-url
+          {:basic-auth auth-str
+           :headers {"kbn-xsrf" ""}
+           :as :json
+           :content-type :json
+           :throw-exceptions false
+           :body (json/generate-string
+                  {:query
+                   {:bool
+                    {:must [{:term {"observable.type" type}}
+                            {:term {"observable.value" value}}]}}
+                   :sort {:created "desc"}
+                   :size size})})
+         :body
+         :hits
+         :hits
+         (map :_source))))
+
+(defn- bad-verdict? [expected-judgement actual-verdict]
+  (not= (:judgement_id actual-verdict) (:id expected-judgement)))
+
+(defn find-bad-verdicts [observables & {:keys [auth-str]}]
+  (letfn [(lz:find-bad-verdicts [observables]
+            (if (seq observables)
+              (let [observable (first observables)
+                    judgement (find-judgement-for-verdict observable
+                                                          :auth-str auth-str)
+                    verdict (find-verdict observable
+                                          :auth-str auth-str)]
+                (println "Testing" observable)
+                (if (bad-verdict? judgement verdict)
+                  (cons observable
+                        (lazy-seq
+                         (lz:find-bad-verdicts (rest observables))))
+                  (lazy-seq
+                   (lz:find-bad-verdicts (rest observables)))))
+              observables))]
+    (lz:find-bad-verdicts observables)))


fix issue where unit test causes setup-token to be recreated on namespace reload, which is annoying in dev.

--- test/metabase/api/setup_test.clj
+++ test/metabase/api/setup_test.clj
@@ -12,14 +12,13 @@

 ;; ## POST /api/setup/user
 ;; Check that we can create a new superuser via setup-token
-(let [setup-token (setup/token-create)
-      user-name (random-name)]
+(let [user-name (random-name)]
   (expect-eval-actual-first
     (match-$ (->> (sel :one User :email (str user-name "@metabase.com"))
                (:id)
                (sel :one Session :user_id))
       {:id $id})
-    (let [resp (http/client :post 200 "setup" {:token setup-token
+    (let [resp (http/client :post 200 "setup" {:token (setup/token-create)
                                                :prefs {:site_name "Metabase Test"}
                                                :user  {:first_name user-name
                                                        :last_name  user-name


Add helpful comment

Add helpful comment

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


Refactor: parametrize vertical spacer

Refactor: parametrize vertical spacer


handler-ekoak pribatu egin

handler-ekoak pribatu egin

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


Creating an all-in GUI namespace.

Creating an all-in GUI namespace.

(use 'overtone.gui) to pull in gui widgets.

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

--- src/overtone/gui.clj
+++ src/overtone/gui.clj
@@ -0,0 +1,17 @@
+(ns overtone.gui
+  (:use [overtone.util ns])
+  (:require [overtone.gui control
+             info mixer transport
+             stepinator sequencer pianoroll
+             surface wavetable]))
+
+(immigrate
+  'overtone.gui.control
+  'overtone.gui.info
+  'overtone.gui.mixer
+  'overtone.gui.transport
+  'overtone.gui.stepinator
+  'overtone.gui.sequencer
+  'overtone.gui.pianoroll
+  'overtone.gui.surface
+  'overtone.gui.wavetable)


Simplified config for NOTIFICATIONS_SERVER

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


Resize diagram when window changes size.

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


Refactoring

Refactoring

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/DajanaStiberova/green-recipes.git/'


[WM] define authority level schema enum once

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


fib sums (clojure)

fib sums (clojure)

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

--- src/main/clojure/fibonacci_sums/sums0.clj
+++ src/main/clojure/fibonacci_sums/sums0.clj
@@ -0,0 +1,64 @@
+(ns fibonacci_sums.sums0
+  (:use clojure.test)
+  (:require clojure.string))
+
+(defn calculate-fibonacci [count]
+  (list 1 2 3 5 8 13 21 34 55 89)
+)
+
+(defn combinations [fibs number]
+  (let [filtered-fibs (take-while #(<= % number) fibs)
+        last-number (last filtered-fibs)]
+    (cond
+      (= number 0) (list(list))
+      (empty? filtered-fibs) (list)
+      :else (concat
+              (map #(cons last-number %) (combinations (drop-last filtered-fibs) (- number last-number)))
+              (combinations (drop-last filtered-fibs) number)
+      )
+)))
+
+(defn combination-as-string [fib-combination]
+  (let [fibs-reverse (reverse (calculate-fibonacci 10))
+        combination-as-string (map #(if (.contains fib-combination %) "1" "0") fibs-reverse)]
+      (clojure.string/join (drop-while #(= "0" %) combination-as-string))
+))
+
+(defn fibonacci-representations-of [number]
+  (let [fibs (calculate-fibonacci 10)]
+    (map #(combination-as-string %) (combinations fibs number))
+))
+
+(deftest given-a-number-should-find-its-fibonacci-representations
+  (let [fibs (calculate-fibonacci 10)]
+    (is (= (fibonacci-representations-of 0) (list "")))
+    (is (= (fibonacci-representations-of 1) (list "1")))
+    (is (= (fibonacci-representations-of 2) (list "10")))
+    (is (= (fibonacci-representations-of 3) (list "100" "11")))
+    (is (= (fibonacci-representations-of 4) (list "101")))
+    (is (= (fibonacci-representations-of 5) (list "1000" "110")))
+))
+
+(deftest given-a-combination-should-conver-it-to-string
+  (is (= (combination-as-string (list)) ""))
+  (is (= (combination-as-string (list 1)) "1"))
+  (is (= (combination-as-string (list 2)) "10"))
+  (is (= (combination-as-string (list 3)) "100"))
+  (is (= (combination-as-string (list 3 1)) "101"))
+)
+
+(deftest given-a-number-should-find-combinations-of-fibonnaci-numbers-with-sum-equal-to-it
+  (let [fibs (calculate-fibonacci 10)]
+    (is (= (combinations fibs 0) (list(list))))
+    (is (= (combinations fibs 1) (list(list 1))))
+    (is (= (combinations fibs 2) (list(list 2))))
+    (is (= (combinations fibs 3) (list(list 3)(list 2 1))))
+    (is (= (combinations fibs 4) (list(list 3 1))))
+    (is (= (combinations fibs 5) (list(list 5) (list 3 2))))
+))
+
+(deftest should-calculate-fibonacci-sequence
+  (is (= (calculate-fibonacci 10) (list 1 2 3 5 8 13 21 34 55 89)))
+)
+
+(run-tests)


Removed "we don't get opinionated" language.

--- spec/freefrog/governance_roles_spec.clj
+++ spec/freefrog/governance_roles_spec.clj
@@ -1,7 +1,7 @@
 ;;; # Role Manipulation Spec #
 ;;; Defines how all roles can be manipulated, both through governance
 ;;; (maintenance and elections) and through the normal business of
-;;; appointment/removal.Removed
+;;; appointment/removal.
 (ns freefrog.governance-roles-spec
   (:require [clojure.set :as s]
             [freefrog.governance :as g]


Reformat: indent colorscheme map

Reformat: indent colorscheme map


tweak log messages for papertrail / grep

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


Add names to utility interceptors

Add names to utility interceptors

This makes debugging easier since interceptor names are included in
pedestal exceptions

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


Chi square varied dims

Chi square varied dims

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


chore(request): keep alive config

chore(request): keep alive 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/B2W-Digital/pdg-core.git/'


Added test file to check travis-ci

Added test file to check travis-ci

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


Include team_groups in tests

Include team_groups in tests


Fix test

Fix test


benchmark project.clj indentation

benchmark project.clj indentation

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


Fix unexpected behavior on pair-monoid on cljs.

--- src/cats/builtin.cljc
+++ src/cats/builtin.cljc
@@ -358,8 +358,8 @@
     p/Semigroup
     (-mappend [_ sv sv']
       (d/pair
-       (p/-mappend inner-monoid (.fst sv) (.fst sv'))
-       (p/-mappend inner-monoid (.snd sv) (.snd sv'))))
+       (p/-mappend inner-monoid (.-fst sv) (.-fst sv'))
+       (p/-mappend inner-monoid (.-snd sv) (.-snd sv'))))

     p/Monoid
     (-mempty [_]
@@ -370,5 +370,5 @@
 (extend-type cats.data.Pair
   p/Context
   (-get-context [data]
-    (let [first' (.fst data)]
+    (let [first' (.-fst data)]
       (pair-monoid (p/-get-context first')))))


rearrange tests in main in groups

rearrange tests in main in groups


Move the sanity checking out of the way.

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


Catch and log future errors.

Catch and log future errors.


post/makecontent.clj: added job

post/makecontent.clj: added job

error: pathspec 'src/org/altlaw/jobs/post/makecontent.clj' did not match any file(s) known to git

--- src/org/altlaw/jobs/post/makecontent.clj
+++ src/org/altlaw/jobs/post/makecontent.clj
@@ -0,0 +1,33 @@
+(ns org.altlaw.jobs.post.content
+  (:require [org.altlaw.util.hadoop :as h]
+            [org.altlaw.util.log :as log]
+            [org.altlaw.util.context :as context]
+            [org.altlaw.db.content :as content])
+  (:import (org.apache.commons.codec.digest DigestUtils)))
+
+(h/setup-mapreduce)
+
+(defn my-map [docid doc]
+  (if-let [html (:html doc)]
+    (let [filename (str "sha1/" (DigestUtils/shaHex html))]
+      [filename html])
+    (do (h/counter "No HTML")
+        (log/warn "No HTML for docid " docid)
+        nil)))
+
+(defn mapper-map [this wkey wvalue output reporter]
+  (let [[key value] (my-map (read-string (str wkey))
+                            (read-string (str wvalue)))]
+    (.collect output (Text. key) (Text. value))))
+
+(defn tool-run [this args]
+  (let [job (h/default-jobconf this)
+        outpath (Path. (h/job-path :post :content))]
+    (.setJobName job "post.content")
+    (FileInputFormat/setInputPaths job (h/job-path :analyze :merge))
+    (FileOutputFormat/setOutputPath job outpath)
+    (.delete (FileSystem/get job) outpath true)
+    (.setMapperClass job org.altlaw.jobs.post.content_mapper)
+    (.setReducerClass job IdentityReducer)
+    (JobClient/runJob job))
+  0)


first-principles midi

first-principles midi

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

--- src/midi.clj
+++ src/midi.clj
@@ -0,0 +1,46 @@
+(ns midi
+  (:import (javax.sound.midi MidiSystem
+                             ShortMessage)))
+
+(defn note-on
+  "Make a note-on midi message, suitable to send to a receiver."
+  [note vel]
+  (ShortMessage. ShortMessage/NOTE_ON note vel))
+
+(defn note-off
+  "Make a note-off midi message, suitable to send to a receiver.
+   (when you're feeling too pure to just do (note-on note 0))"
+  [note]
+  (ShortMessage. ShortMessage/NOTE_OFF note 0))
+
+(defn control-change
+  "Make a control-change midi message, suitable to send to a receiver."
+  [controller value]
+  (ShortMessage. ShortMessage/CONTROL_CHANGE controller value))
+
+(defn find-devices
+  "Return the devices whose names match the regex.
+   They may already be open, but this code doesn't open them."
+  [re]
+  (let [infos (MidiSystem/getMidiDeviceInfo)]
+    (map #(MidiSystem/getMidiDevice %)
+         (filter #(re-find (re-pattern re) (.getName %))
+                 infos))))
+
+(defn get-receiver
+  "Return a new opened receiver for the first device whose name matches the
+  given regex. The device will also be opened, and they should both be closed
+  when you're done with them. (But if you only open one receiver and don't
+  close it and its device, I won't tell.)"
+  [re]
+  (let [devices (find-devices re)
+        devices (filter #(not (= 0 (.getMaxReceivers %))) devices)
+        device (first devices)]
+    (do
+      (when (not (.isOpen device))
+        (.open device))
+      (.getReceiver device))))
+
+(defn send
+  "Send a message to a receiver"
+  [rx msg] (.send rx msg -1))


comments

comments

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/shaunlebron/atom-parinfer.git/'


Added detail comment about data flow

Added detail comment about data flow

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


Adding example for computing free distributive lattices

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

error: pathspec 'doc/examples/free-distributive-lattice.clj' did not match any file(s) known to git

--- doc/examples/free-distributive-lattice.clj
+++ doc/examples/free-distributive-lattice.clj
@@ -0,0 +1,11 @@
+(use 'conexp.main)
+
+(defn number-of-elements-in-FCD
+  "For a given number `n', returns the number of elements in the free distributive lattice
+  of n generators."
+  [n]
+  ;; we *could* do the indictive construction, but for the values where `intents' works,
+  ;; the direct contextual construction works as well
+  (count (intents (reduce-context (make-context (subsets (set-of-range n))
+                                                (subsets (set-of-range n))
+                                                (comp not superset?))))))


Minor tweak.

Minor tweak.


Move chat plugins out to their own ns

Move chat plugins out to their own ns

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

--- src/omchaya/plugins.cljs
+++ src/omchaya/plugins.cljs
@@ -0,0 +1,125 @@
+(ns omchaya.plugins
+  (:require [clojure.string :as string]
+            [omchaya.emoticons :as emoticons]))
+
+(defn mention [name]
+  [:span [:span.mention name] " "])
+
+(defn mentions [activity-pieces current-user-email users settings author]
+  (map (fn [piece]
+         (let [[_ pre username post] (re-find #"(.*)@(\w+)(.*)" piece)]
+           (if-let [at (and (string? piece)
+                            (some #{username} (map (comp :username second) users)))]
+             (list pre (mention username) post)
+             piece)))
+       activity-pieces))
+
+(defn emoticon [emoji]
+  [:img.emoticon-embed.small {:src   (:src emoji)
+                              :class (:css emoji)
+                              :title (:title emoji)}])
+
+(defn emoticons [activity-pieces]
+  (let [helper (fn [piece]
+                 (if (string? piece)
+                   (if-let [emoji (get emoticons/known-emoticons (string/trim piece))]
+                     (emoticon emoji)
+                     piece)
+                   piece))]
+    (map helper activity-pieces)))
+
+(defn links [activity-pieces]
+  (let [helper (fn [piece]
+                 (if-let [link (and (string? piece)
+                                    (re-find #"https?://.*" piece))]
+                   [:a.href {:target "_blank"
+                             :href link} link]
+                   piece))]
+    (map helper activity-pieces)))
+
+(defn pastie [activity-pieces]
+  (let [max-preview-length 300
+        max-preview-lines  4
+        original           (string/join " " activity-pieces)]
+    (if (re-find #"\n.*\n" original)
+      [[:pre.pastie
+        [:a.pastie-link {:href "#"
+                         :on-click (constantly false)} "View pastie"]
+        [:br]
+        (let [preview (as-> original preview
+                            (if (> (count (string/split #"\n" preview)) max-preview-lines)
+                              (string/join "\n" (take max-preview-lines (string/split #"\n" preview)))
+                              preview)
+                            (if (> (count preview) max-preview-length)
+                              (subs preview 0 max-preview-length)
+                              preview))]
+          (list preview (when (not= (count preview) (count original)) "...")))]]
+      activity-pieces)))
+
+(defn slash-me [activity-pieces current-user-email users]
+  (if (= (first activity-pieces) "/me")
+    (let [user (get users current-user-email)]
+      (assoc-in activity-pieces [0] (:username user)))
+    activity-pieces))
+
+(defn slash-play [activity-pieces]
+  ;; Should actually insert a audio player component
+  (let [[command url & rest] activity-pieces]
+    (if (= command "/play")
+      (concat [[:strong
+                [:a.audio-play "Playing "
+                 [:a {:target "_blank"
+                      :href url} url]]]] rest)
+      activity-pieces)))
+
+(defn rgb-embed [activity-pieces]
+  (map (fn [piece]
+         (if-let [[_ pre r g b post] (re-find #"(.*)rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)(.*)" piece)]
+           (list pre
+                 [:span.color-preview
+                  {:style #js {:background-color (str "rgb(" r "," g "," b ")")}}]
+                 post)
+           piece)) activity-pieces))
+
+(defn hex-embed [activity-pieces]
+  (map (fn [piece]
+         (if-let [[_ pre hex post] (re-find #"(.*)#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})(.*)" piece)]
+           (list pre
+                 [:span.color-preview
+                  {:style #js {:background-color (str "#" hex)}}]
+                 post)
+           piece)) activity-pieces))
+
+(defn image-embed [activity-pieces]
+  (map (fn [piece]
+         (if (re-find #"http.*\.(jpg|jpeg|gif|png)" piece)
+           [:div.image-preview
+            [:a {:target "_blank"
+                 :href piece}
+             [:img.image-embed {:src piece}]]]
+           piece)) activity-pieces))
+
+(defn youtube-embed [activity-pieces]
+  (map (fn [piece]
+         (if-let [[_ video-id] (and (re-find #"https?.+www.youtube.com.+watch" piece)
+                                    (re-find #"\Wv=([\w|\-]*)" piece))]
+           [:div.youtube-preview
+            [:iframe {:width "560"
+                      :height "315"
+                      :src (str "http://www.youtube.com/embed/" video-id)
+                      :frameBorder 0
+                      :allowFullScreen true}]]
+           piece)) activity-pieces))
+
+(defn vimeo-embed [activity-pieces]
+  (map (fn [piece]
+         (if-let [[_ video-id] (re-find #"^https?://vimeo.com/(\d+)" piece)]
+           [:div.vimeo-preview
+            [:iframe {:width "500"
+                      :height "281"
+                      :src (str "http://player.vimeo.com/video/" video-id)
+                      :frameBorder 0
+                      :webkitAllowFullScreen true
+                      :mozAllowFullScreen true
+                      :allowFullScreen true}]]
+           piece)) activity-pieces))


STORM-205. Add REST API to Storm UI. fixed typo.

--- storm-core/src/clj/backtype/storm/ui/core.clj
+++ storm-core/src/clj/backtype/storm/ui/core.clj
@@ -288,7 +288,7 @@
      (select-keys agg-spout-stats [:emitted :transferred :acked :failed :complete-latencies])
      )))

-(Defn stats-times [stats-map]
+(defn stats-times [stats-map]
   (sort-by #(Integer/parseInt %)
            (-> stats-map
                clojurify-structure


Eliminate state machine indirection since the try/catch is encoded in the macro expansion

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


Stub for db_spec_test.clj

Stub for db_spec_test.clj

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

--- test/zg/db_spec_test.clj
+++ test/zg/db_spec_test.clj
@@ -0,0 +1,13 @@
+(ns zg.db-spec-test
+  (:require [clojure.test :refer :all]
+            [zg.db-spec :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))
+


Update deps

Update deps

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


move lein down to 2.4.1 (latest on homebrew).

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/nilenso/finenso-time-tracker.git/'


Upgrade to next version

Upgrade to next version

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 ;; Copyright © 2015, JUXT LTD.

-(defproject yada "1.1.2"
+(defproject yada "1.1.3"
   :description "A powerful Clojure web library, full HTTP, full async"
   :url "http://github.com/juxt/yada"
   :license {:name "The MIT License"


Update version number for packaging

Update version number for packaging

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


Update to latest 3scale client lib

Update to latest 3scale client lib

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


change mesos version

change mesos version

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


Update lein-bikeshed to latest.

Update lein-bikeshed to latest.

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


Releasing improvements to 304

Releasing improvements to 304

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 ;; Copyright © 2015, JUXT LTD.

-(defproject yada "1.1.21"
+(defproject yada "1.1.22"
   :description "A powerful Clojure web library, full HTTP, full async"
   :url "http://github.com/juxt/yada"
   :license {:name "The MIT License"


Release new version

Release new version

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 ;; Copyright © 2015, JUXT LTD.

-(defproject yada "1.1.1"
+(defproject yada "1.1.2"
   :description "A powerful Clojure web library, full HTTP, full async"
   :url "http://github.com/juxt/yada"
   :license {:name "The MIT License"


Update clj-time to 0.9.0

Update clj-time to 0.9.0

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


remove dev dependencies that are specific to Emacs because they cause issues with the REPL on Intellij.

--- project.clj
+++ project.clj
@@ -67,15 +67,13 @@
                                   [org.clojure/tools.reader "0.10.0"] ; Need to explictly specify this dep otherwise expectations doesn't seem to work right :'(
                                   [expectations "2.1.3"]              ; unit tests
                                   [ring/ring-mock "0.3.0"]]
-                   :plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]    ; Interactive development w/ cider NREPL in Emacs
-                             [jonase/eastwood "0.2.1"]                ; Linting
+                   :plugins [[jonase/eastwood "0.2.1"]                ; Linting
                              [lein-ancient "0.6.7"]                   ; Check project for outdated dependencies + plugins w/ 'lein ancient'
                              [lein-bikeshed "0.2.0"]                  ; Linting
                              [lein-environ "1.0.0"]                   ; Specify env-vars in project.clj
                              [lein-expectations "0.0.8"]              ; run unit tests with 'lein expectations'
                              [lein-instant-cheatsheet "2.1.4"]        ; use awesome instant cheatsheet created by yours truly w/ 'lein instant-cheatsheet'
-                             [michaelblume/lein-marginalia "0.9.0"]   ; generate documentation with 'lein marg'
-                             [refactor-nrepl "2.0.0-SNAPSHOT"]]       ; support for advanced refactoring in Emacs/LightTable
+                             [michaelblume/lein-marginalia "0.9.0"]]  ; generate documentation with 'lein marg'
                    :global-vars {*warn-on-reflection* true}           ; Emit warnings on all reflection calls
                    :env {:mb-run-mode "dev"}
                    :jvm-opts ["-Dlogfile.path=target/log"


Bump NSFW

Bump NSFW

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


Update Codox plugin to 0.8.12

Update Codox plugin to 0.8.12

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


chore: upgrade deps and reorganize project.clj (#94)

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


Bump for lein2 compatibility

Bump for lein2 compatibility

closes #28


Changed project name

Changed project name

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojurescript-starter-kit "1.0.0-SNAPSHOT"
+(defproject one "1.0.0-SNAPSHOT"
   :description "Getting Started with ClojureScript."
   :dependencies [[org.clojure/clojure "1.3.0"]
                  [ring "1.0.0-RC1"]


Version 1.6.2-SNAPSHOT

Version 1.6.2-SNAPSHOT

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


clojurescript.test plugin

clojurescript.test plugin

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


Switch to Clojure 1.6.0.

Switch to Clojure 1.6.0.

--- project.clj
+++ project.clj
@@ -7,7 +7,7 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[com.facebook/react "0.9.0.1"]
-                 [org.clojure/clojure "1.5.1"]
+                 [org.clojure/clojure "1.6.0"]
                  [org.clojure/clojurescript "0.0-2197"]]
   :cljsbuild {:builds []}
   :profiles {:dev {:dependencies [[reagent "0.4.2"]


Version 0.3.3-SNAPSHOT

Version 0.3.3-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject sablono "0.3.2"
+(defproject sablono "0.3.3-SNAPSHOT"
   :description "Lisp style templating for Facebook's React."
   :url "http://github.com/r0man/sablono"
   :author "r0man"


Fix dependencies in lein profile

Fix dependencies in lein profile

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


Fix images url

Fix images 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/nvbn/rerenderer.git/'


remove default value from price/cost fields


add dummy test

add dummy test

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

--- test/puppetlabs/jdbc-util/core_test.clj
+++ test/puppetlabs/jdbc-util/core_test.clj
@@ -0,0 +1,6 @@
+(ns puppetlabs.jdbc-util.core-test
+  (:require [clojure.test :refer :all]))
+
+(deftest "foo"
+  (testing "simple math"
+    (is (= 2 (+ 1 1)))))


comically inefficient vector games

comically inefficient vector games

error: pathspec 'statspop/src/statspop/math/regression.cljs' did not match any file(s) known to git

--- statspop/src/statspop/math/regression.cljs
+++ statspop/src/statspop/math/regression.cljs
@@ -0,0 +1,12 @@
+(ns statspop.math.regression)
+
+(defn add-intercept
+  "WARNING: this is criminally inefficient. If anyone other than me is reading this code:
+  a) I know how inefficient it is.
+  b) I can get away with it here because I don't expect to be dealing w/ data any bigger than
+  ~ 500 rows and ~100 columns.
+  c) Don't ever do this.
+
+  vector of numeric vectors -> vector of numeric vectors"
+  [vv]
+  (map #(concat [1] %) vv))


Add tests for addtup.

Add tests for addtup.

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

--- test/little_clojurer/chapter4_test.clj
+++ test/little_clojurer/chapter4_test.clj
@@ -0,0 +1,14 @@
+(ns little-clojurer.chapter4_test
+  (:require [clojure.test :refer :all]
+            [little-clojurer.chapter4 :refer :all]))
+
+(deftest addtup-test
+  (testing
+    (is (= 0 (addtup '())))
+    (is (= 0 (addtup '(0))))
+    (is (= 0 (addtup '(0 0))))
+    (is (= 0 (addtup '(-1 1 0 -5 2 3))))
+    (is (= 1 (addtup '(1))))
+    (is (= -10 (addtup '(1 -11))))
+    (is (= -2 (addtup '(-1 -1))))
+    (is (= 0 (addtup '(-1 1 0))))))


Assert for clearer error msg

Assert for clearer error msg


RR: add tags helpers

RR: add tags helpers

error: pathspec 'src/clj/ona/viewer/helpers/tags.clj' did not match any file(s) known to git

--- src/clj/ona/viewer/helpers/tags.clj
+++ src/clj/ona/viewer/helpers/tags.clj
@@ -0,0 +1,24 @@
+(ns ona.viewer.helpers.tags)
+
+(defn image
+  "Return a path to a local image."
+  [path]
+  (str "/img/" path))
+
+(defn include-js
+  "Incude a path to a JavaScript file."
+  [path & opts]
+  (let [{:keys [no-prefix] :as opts-hash} (apply hash-map opts)
+        src (if no-prefix path (str "/js/" path))]
+    [:script (merge {:src src :type "text/javascript"}
+                    (dissoc opts-hash :no-prefix))]))
+
+(defn js-tag
+  "Create a JavaScript tag with content."
+  [content]
+  [:script {:type "text/javascript"} content])
+
+(defn js-submit
+  "Build string to submit form via JavaScript."
+  [form-id]
+  (str "javascript:document.forms[\"" form-id "\"].submit();"))


Removes unneded event

Removes unneded event


remove total from checkout button

remove total from checkout button

it could lead to confusion regarding what is being paid for and when


Add some functions to query dtbs

Add some functions to query dtbs

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

--- src/mdr2/dtb.clj
+++ src/mdr2/dtb.clj
@@ -0,0 +1,24 @@
+(ns mdr2.dtb
+  "Functions to query DAISY Talking Books"
+  (:require [clojure.data.xml :as xml]
+            [clojure.java.io :refer [file]])
+  (:import javax.sound.sampled.AudioSystem))
+
+(defn file-audio-length [file]
+  (let [stream (AudioSystem/getAudioInputStream file)
+        format (.getFormat stream)
+        frameRate (.getFrameRate format)
+        frames (.getFrameLength stream)
+        durationInSeconds (/ frames frameRate)]
+    durationInSeconds))
+
+(defn audio-file? [file]
+  (and (.isFile file)
+       (.endsWith ".wav" (.getName file))))
+
+(defn audio-length [dtb]
+  (let [audio-files (filter audio-file? (file-seq (file dtb)))]
+    (reduce + (map file-audio-length audio-files))))
+
+
+


add draft for comprehensive usage example

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


Create core.clj

Create core.clj

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

--- src/cloprand/core.clj
+++ src/cloprand/core.clj
@@ -0,0 +1,32 @@
+(ns cloprand.core)
+
+(defn return-raw-value [value]
+  value)
+(defn is-date-time? [value]
+  true)
+
+(def data-types {:text       {:generator "" :validator true :editor return-raw-value :renderer return-raw-value}
+                 :text-lines {:generator "" :validator true :editor return-raw-value :renderer return-raw-value}
+                 :boolean    {:generator true :validator true :editor return-raw-value :renderer return-raw-value}
+                 :number     {:generator 0 :validator true :editor return-raw-value :renderer return-raw-value}
+                 :enum       {:generator nil :validator true :editor nil :renderer return-raw-value}
+                 :datetime   {:generator nil :validator is-date-time? :editor return-raw-value :renderer return-raw-value}
+                 :binary     {:generator nil :validator true :editor return-raw-value :renderer return-raw-value}})
+
+(defn deffield [name data-type & options]
+  ;;; Check the 'data-type' exists in 'data-types' array.
+  (let [base-options (data-types data-type)
+        base-config  {:name name
+                      :data-type data-type
+                      :generator (base-options :generator)
+                      :validator (base-options :validator)
+                      :editor    (base-options :editor)
+                      :renderer  (base-options :renderer) }]
+    (loop [config base-config
+           item   (take 2 options)
+           dst    (drop 2 options)]
+      (if (< (count item) 2)
+          config
+          (let [k (first item)
+                v (second item)]
+            (recur (assoc config k v) (take 2 dst) (drop 2 dst)))))))


java/install options

java/install options

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


Use schema to check for i18n-maps

Use schema to check for i18n-maps

...instead of just looking for an `:en` key.

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


[EN] Replace s/either with s/conditional

s/either was deprecated so let's upgrade.


removed redundent file

removed redundent file

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


Remove the vestigial populatemq CLI

Remove the vestigial populatemq CLI

It's been obsolete for quite some time.

Signed-off-by: Deepak Giridharagopal <d11186354d1ef01ca06ae37d7e23e827da13e85f@puppetlabs.com>

--- src/com/puppetlabs/cmdb/cli/populatemq.clj
+++ src/com/puppetlabs/cmdb/cli/populatemq.clj
@@ -1,40 +0,0 @@
-(ns com.puppetlabs.cmdb.cli.populatemq
-  (:require
-            [clojure.tools.logging :as log]
-            [clojure.java.jdbc :as sql]
-            [cheshire.core :as json]
-            [clojure.contrib.duck-streams :as ds]
-            [clamq.activemq :as activemq]
-            [clamq.protocol.producer :as mq-producer]
-            [clamq.protocol.connection :as mq-conn])
-  (:use [com.puppetlabs.utils :only (cli! ini-to-map)]
-        [com.puppetlabs.cmdb.scf.migrate :only [migrate!]]))
-
-
-(defn populate-mq
-  [mq mq-endpoint dirname]
-  (with-open [conn (activemq/activemq-connection mq)]
-    (let [producer (mq-conn/producer conn)]
-      (doseq [file (.listFiles (ds/file-str dirname))]
-        (let [content (json/parse-string (slurp file) true)
-              msg {:command "replace catalog" :version 1 :payload content}
-              msg (json/generate-string msg)]
-          (mq-producer/publish producer mq-endpoint msg)
-          (log/info (format "Published %s" file)))))))
-
-(defn -main
-  [& args]
-  (let [[options _] (cli! args
-                          ["-c" "--config" "Path to config.ini"]
-                          ["-d" "--dir" "Directory containing catalogs"])
-        config      (ini-to-map (:config options))
-
-        db          (:database config)
-        dir         (:dir config)
-
-        mq          (get-in config [:mq :connection_string])
-        mq-endpoint (get-in config [:mq :endpoint])]
-
-    (sql/with-connection db
-      (migrate!))
-    (populate-mq mq mq-endpoint dir)))