Added repl.clj

Added repl.clj

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

--- src/overtone/app/repl.clj
+++ src/overtone/app/repl.clj
@@ -0,0 +1,144 @@
+(ns overtone.app.repl
+  (:gen-class)
+  (:import
+     (java.awt Toolkit EventQueue Dimension Point)
+     (java.awt Dimension Color Font RenderingHints Point BasicStroke)
+     (java.awt.geom Ellipse2D$Float RoundRectangle2D$Float)
+     (javax.swing JFrame JPanel)
+     (com.sun.scenario.scenegraph JSGPanel SGText SGShape SGGroup SGAbstractShape$Mode SGComponent
+                                  SGTransform)
+     (com.sun.scenario.scenegraph.event SGMouseAdapter)
+     (com.sun.scenario.scenegraph.fx FXShape))
+
+  (:import
+   (javax.swing JFrame JEditorPane JScrollPane JPanel JTextField SwingUtilities JButton)
+   (java.io StringReader PushbackReader OutputStreamWriter PrintWriter)
+   (java.util.concurrent LinkedBlockingQueue)
+   (jsyntaxpane DefaultSyntaxKit)
+   (java.awt Dimension BorderLayout))
+
+  (:use [hiredman.hydra :only [hydra]])
+  (:require [clj_repl.core :as r]))
+
+
+;; Swing macros
+
+(defmacro EDT
+  "runs body on the Event-Dispatch-Thread (Swing)"
+  [& body]
+  `(SwingUtilities/invokeLater (fn [] ~@body)))
+
+(defmacro action-performed [component event & body]
+  `(. ~component addActionListener
+      (proxy [java.awt.event.ActionListener] []
+        (actionPerformed [~event] ~@body))))
+
+(defn -main []
+  (EDT
+   (let [frame      (JFrame.)
+         content    (.getContentPane frame)
+         editor     (JEditorPane.)
+         scroll     (JScrollPane. editor)
+         panel      (JPanel.)
+         prompt     (JTextField.)
+         text-field (JTextField.)
+
+         toolbar    (JPanel.)
+         tb-init    (JButton. "1. init")
+         tb-boot    (JButton. "2. boot")
+         tb-quit    (JButton. "5. quit")
+         tb-mn      (JButton. "4. make noise")
+         tb-slog    (JButton. "3. server log")
+         queue      (hydra)]
+
+     (DefaultSyntaxKit/initKit)
+
+     (doto tb-init
+       (action-performed event (do
+                                 (r/send-to-repl queue "(use 'overtone.live)(refer-ugens)")
+                                 (r/send-to-repl queue "(refer-ugens)")
+                                 (EDT (let [ doc (.getDocument editor)
+                                            length (.getLength doc)]
+                                        (.insertString doc length ";; Make sure jackd is started" nil)))
+                                 )))
+
+     (doto tb-boot
+       (action-performed event (r/send-to-repl queue "(boot)")))
+
+     (doto tb-quit
+       (action-performed event (r/send-to-repl queue "(quit)")))
+
+     (doto tb-mn
+       (action-performed event (do
+
+                                 (r/send-to-repl queue "(defsynth foo (sin-osc 440))")
+                                 (r/send-to-repl queue "(foo)")
+
+                                 )))
+
+     (doto tb-slog
+       (action-performed event (do
+                                 (r/send-to-repl queue "(print-server-log)")
+                                 (EDT (let [ doc (.getDocument editor)
+                                            length (.getLength doc)]
+                                        (.insertString doc length ";; No errors ? Now connect your jack ports and start transport and get ready to make some noise !" nil)))
+                                 )))
+
+     (doto toolbar
+       (.add tb-init)
+       (.add tb-boot)
+       (.add tb-slog)
+       (.add tb-mn)
+       (.add tb-quit))
+
+     (doto queue
+       (r/start-repl-thread (fn [q itm] (EDT
+                                         (let [ doc (.getDocument editor)
+                                               length (.getLength doc)]
+                                           (.insertString doc length itm nil))))
+
+                            (fn [q ns] (EDT
+                                        (.setText prompt (str ns))))))
+
+     (doto prompt
+       (.setEditable false)
+       (.setPreferredSize (Dimension. 150 20)))
+
+     (doto text-field
+       (action-performed event
+                         (EDT
+                          (r/send-to-repl queue (.getText text-field))
+                          (.setText text-field "")))
+       (.setPreferredSize (Dimension. 300 20)))
+
+     (doto panel
+       (.setPreferredSize (Dimension. 300 30))
+       (.add prompt)
+       (.add text-field)
+       (.doLayout))
+
+     (doto editor
+       (.setContentType "text/clojure")
+       (.setEditable false))
+
+     (doto content
+       (.setLayout  (BorderLayout.))
+       (.add scroll (BorderLayout/CENTER))
+       (.add panel  (BorderLayout/SOUTH))
+       (.add toolbar (BorderLayout/NORTH)))
+
+     (doto frame
+       (.pack)
+       (.setVisible true)
+
+       ;(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
+
+       )
+
+     (doto text-field
+       (.requestFocus)))))
+
+(comment
+  (-main)
+  )
+


Don't change ignore history when scrolling

--- src-cljs/pepa/workflows/dashboard.cljs
+++ src-cljs/pepa/workflows/dashboard.cljs
@@ -59,9 +59,10 @@
   [state]
   (or
    (try
-     (some-> state
-             :navigation :query-params :page
-             (js/parseInt 10))
+     (let [n (some-> state
+                     :navigation :query-params :page
+                     (js/parseInt 10))]
+       (and (integer? n) n))
      (catch js/Error e nil))
    1))

@@ -100,7 +101,7 @@
      "Dashboard")))

 ;;; Should be twice the document-height or so.
-(def +scroll-margin+ 400)
+(def +scroll-margin+ 500)

 (defn on-documents-scroll [state owner e]
   (let [container e.currentTarget
@@ -110,11 +111,12 @@
         bottom-distance (Math/abs (- scroll-height
                                      (+ scroll-top outer-height)))]
     (when (< bottom-distance +scroll-margin+)
-      (let [page (parse-page state)]
-        (nav/navigate! (-> (:navigation state)
-                           (assoc-in [:query-params :page] (inc page))
-                           (nav/nav->route)
-                           (nav/navigate!)))))))
+      (let [state @state
+            page (or (parse-page state) 0)]
+        (-> (:navigation state)
+            (assoc-in [:query-params :page] (str (inc page)))
+            (nav/nav->route)
+            (nav/navigate! :ignore-history))))))

 (defn dashboard [state owner]
   (reify


stuff

stuff

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

--- profiles.clj
+++ profiles.clj
@@ -0,0 +1,20 @@
+{:user {:dependencies [[org.clojure/clojure "1.9.0-beta1"]
+                       #_[im.chit/lucid.git "1.3.13"]
+                       #_[im.chit/lucid.graph "1.3.13"]
+                       [im.chit/lucid.mind "1.3.13"]
+                       #_[im.chit/lucid.query "1.3.13"]
+                       #_[im.chit/lucid.system "1.3.13"]
+                       #_[im.chit/lucid.package "1.3.13"]
+                       [org.clojure/core.typed "0.4.3"]
+                       [org.sonatype.aether/aether-util "1.13.1"]]
+        :plugins      [[lein-ancient "0.6.10"]
+                       #_[lein-voom "0.1.0-20170920_222746-ga58a315"]
+                       [cider/cider-nrepl "0.15.1"]
+                       [refactor-nrepl "2.3.1"]
+                       [lein-pprint "1.1.2"]]
+        :injections   [#_(require '[lucid.git :as lgit])
+                       #_(require '[lucid.graph :as lgraph])
+                       (require '[lucid.mind :as lm])
+                       #_(require '[lucid.package :as lpkg])
+                       #_(require '[lucid.query :as lq])
+                       #_(require '[lucid.system :as lsys])]}}


do not show logout when not logged in

do not show logout when not logged in

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


authorization ns -> owner + distribution access

#46

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

--- src/clj/swarmpit/authorization.clj
+++ src/clj/swarmpit/authorization.clj
@@ -0,0 +1,80 @@
+(ns swarmpit.authorization
+  (:require [buddy.auth :refer [authenticated?]]
+            [buddy.auth.accessrules :refer [success error wrap-access-rules]]
+            [swarmpit.handler :refer [resp-error]]
+            [swarmpit.couchdb.client :as cc]))
+
+(defn- authenticated-access
+  [request]
+  (if (authenticated? request)
+    true
+    (error {:code    401
+            :message "Authentication failed"})))
+
+(defn- any-access
+  [_]
+  true)
+
+(defn- admin-access
+  [request]
+  (let [role (get-in (:identity request) [:usr :role])]
+    (if (= "admin" role)
+      true
+      (error {:code    403
+              :message "Unauthorized admin access"}))))
+
+(defn- owner-access
+  [{:keys [path-params] :as request}]
+  (let [user (get-in (:identity request) [:usr :username])
+        entity (cc/get-doc (:id path-params))]
+    (if (= (:owner entity) user)
+      true
+      (error {:code    403
+              :message "Unauthorized owner access"}))))
+
+(defn- distribution-access
+  [{:keys [path-params] :as request}]
+  (let [user (get-in (:identity request) [:usr :username])
+        entity (cc/get-doc (:id path-params))]
+    (if (or (= (:owner entity) user)
+            (:public entity))
+      true
+      (error {:code    403
+              :message "Unauthorized distribution access"}))))
+
+(def rules [{:pattern #"^/admin/.*"
+             :handler {:and [authenticated-access admin-access]}}
+            {:pattern #"^/login$"
+             :handler any-access}
+            {:pattern #"^/$"
+             :handler any-access}
+            {:pattern        #"^/distribution/registries/[a-zA-Z0-9]*/repositories$"
+             :request-method :get
+             :handler        {:and [authenticated-access distribution-access]}}
+            {:pattern        #"^/distribution/registries/[a-zA-Z0-9]*/tags$"
+             :request-method :get
+             :handler        {:and [authenticated-access distribution-access]}}
+            {:pattern        #"^/distribution/registries/[a-zA-Z0-9]*$"
+             :request-method #{:get :delete}
+             :handler        {:and [authenticated-access owner-access]}}
+            {:pattern        #"^/distribution/dockerhub/[a-zA-Z0-9]*/repositories$"
+             :request-method :get
+             :handler        {:and [authenticated-access distribution-access]}}
+            {:pattern        #"^/distribution/dockerhub/[a-zA-Z0-9]*/tags$"
+             :request-method :get
+             :handler        {:and [authenticated-access distribution-access]}}
+            {:pattern        #"^/distribution/dockerhub/[a-zA-Z0-9]*$"
+             :request-method #{:get :delete}
+             :handler        {:and [authenticated-access owner-access]}}
+            {:pattern #"^/.*"
+             :handler {:and [authenticated-access]}}])
+
+(defn- rules-error
+  [_ val]
+  (resp-error (:code val)
+              (:message val)))
+
+(defn wrap-authorization
+  [handler]
+  (wrap-access-rules handler {:rules    rules
+                              :on-error rules-error}))


Added version of RSWN with silence EHC

Added version of RSWN with silence EHC

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

--- src/clojush/problems/software/replace_space_with_newline_EHC.clj
+++ src/clojush/problems/software/replace_space_with_newline_EHC.clj
@@ -0,0 +1,192 @@
+;; replace_space_with_newline.clj
+;; Tom Helmuth, thelmuth@cs.umass.edu
+;;
+;; Problem Source: iJava (http://ijava.cs.umass.edu/)
+;;
+;; Given a string input, print the string, replacing spaces with newlines.
+;; The input string will not have tabs or newlines, but may have multiple spaces
+;; in a row. It will have maximum length of 20 characters. Also, the program
+;; should return the integer count of the non-whitespace characters.
+;;
+;; input stack has the input string
+
+(ns clojush.problems.software.replace-space-with-newline-EHC
+  (:use clojush.pushgp.pushgp
+        [clojush pushstate interpreter random util globals]
+        clojush.instructions.tag
+        clojure.math.numeric-tower)
+    (:require [clojure.string :as string]))
+
+;; Define test cases
+(defn replace-space-input
+  "Makes a Replace Space With Newline input of length len."
+  [len]
+  (apply str
+         (repeatedly len
+                     (fn []
+                       (if (< (lrand) 0.2)
+                         \space
+                         (lrand-nth (map char (range 32 127))))))))
+
+; Atom generators
+(def replace-space-atom-generators
+  (concat (list
+            \space
+            \newline
+            ;;; end constants
+            (fn [] (lrand-nth (concat [\newline \tab] (map char (range 32 127))))) ;Visible character ERC
+            (fn [] (replace-space-input (lrand-int 21))) ;String ERC
+            ;;; end ERCs
+            (tag-instruction-erc [:exec :integer :boolean :string :char] 1000)
+            (tagged-instruction-erc 1000)
+            ;;; end tag ERCs
+            'in1
+            ;;; end input instructions
+            )
+          (registered-for-stacks [:integer :boolean :string :char :exec :print])))
+
+
+;; A list of data domains for the problem. Each domain is a vector containing
+;; a "set" of inputs and two integers representing how many cases from the set
+;; should be used as training and testing cases respectively. Each "set" of
+;; inputs is either a list or a function that, when called, will create a
+;; random element of the set.
+(def replace-space-data-domains
+  [[(list "", "A", "*", " ", "s", "B ", "  ", " D", "ef", "!!", " F ", "T L", "4ps", "q  ", "   ", "  e", "hi ",
+          "  $  ", "      9",
+          (apply str (take 13 (cycle (list \i \space \!))))
+          (apply str (repeat 20 \8))
+          (apply str (repeat 20 \space))
+          (apply str (repeat 20 \s))
+          (apply str (take 20 (cycle (list \1 \space))))
+          (apply str (take 20 (cycle (list \space \v))))
+          (apply str (take 20 (cycle (list \H \a \space))))
+          (apply str (take 20 (cycle (list \x \space \y \!))))
+          (apply str (take 20 (cycle (list \G \5))))
+          (apply str (take 20 (cycle (list \> \_ \= \]))))
+          (apply str (take 20 (cycle (list \^ \_ \^ \space))))) 30 0] ;; "Special" inputs covering some base cases
+   [(fn [] (replace-space-input (+ 2 (lrand-int 19)))) 70 1000]
+   ])
+
+;;Can make Replace Space With Newline test data like this:
+;(test-and-train-data-from-domains replace-space-data-domains)
+
+; Helper function for error function
+(defn replace-space-test-cases
+  "Takes a sequence of inputs and gives IO test cases of the form
+   [input output]."
+  [inputs]
+  (map (fn [in]
+         (vector in
+                 [(string/replace in \space \newline)
+                  (count (filter #(not= \space %) in))]))
+       inputs))
+
+; Define error function. For now, each run uses different random inputs
+(defn replace-space-error-function
+  "Returns the error function for the Replace Space With Newline problem. Takes as
+   input Replace Space With Newline data domains."
+  [data-domains]
+  (let [[train-cases test-cases] (map #(sort-by (comp count first) %)
+                                      (map replace-space-test-cases
+                                           (test-and-train-data-from-domains data-domains)))]
+    (when true ;; Change to false to not print test cases
+      (doseq [[i case] (map vector (range) train-cases)]
+        (println (format "Train Case: %3d | Input/Output: %s" i (str case))))
+      (doseq [[i case] (map vector (range) test-cases)]
+        (println (format "Test Case: %3d | Input/Output: %s" i (str case)))))
+    (fn the-actual-replace-space-error-function
+      ([program]
+        (the-actual-replace-space-error-function program :train))
+      ([program data-cases] ;; data-cases should be :train or :test
+        (the-actual-replace-space-error-function program data-cases false))
+      ([program data-cases print-outputs]
+        (let [behavior (atom '())
+              errors (flatten
+                       (doall
+                         (for [[input [correct-output correct-int]] (case data-cases
+                                                                      :train train-cases
+                                                                      :test test-cases
+                                                                      [])]
+                           (let [final-state (run-push program
+                                                       (->> (make-push-state)
+                                                         (push-item input :input)
+                                                         (push-item "" :output)))
+                                 printed-result (stack-ref :output 0 final-state)
+                                 int-result (stack-ref :integer 0 final-state)]
+                             (when print-outputs
+                               (println (format "\n| Correct output: %s\n| Program output: %s" (pr-str correct-output) (pr-str printed-result)))
+                               (println (format "| Correct integer: %2d | Program integer: %s" correct-int (str int-result))))
+                             ; Record the behavior
+                             (when @global-print-behavioral-diversity
+                               (swap! behavior conj [printed-result int-result]))
+                             ; Error is Levenshtein distance for printed string and
+                             ; integer distance for returned integer
+                             (vector
+                               (levenshtein-distance correct-output printed-result)
+                               (if (number? int-result)
+                                 (abs (- int-result correct-int)) ;distance from correct integer
+                                 1000) ;penalty for no return value
+                               )))))]
+          (when @global-print-behavioral-diversity
+            (swap! population-behaviors conj @behavior))
+          errors)))))
+
+(defn replace-space-report
+  "Custom generational report."
+  [best population generation error-function report-simplifications]
+  (let [best-program (not-lazy (:program best))
+        best-test-errors (error-function best-program :test)
+        best-total-test-error (apply +' best-test-errors)]
+    (println ";;******************************")
+    (printf ";; -*- Replace Space With Newline problem report - generation %s\n" generation)(flush)
+    (println "Test total error for best:" best-total-test-error)
+    (println (format "Test mean error for best: %.5f" (double (/ best-total-test-error (count best-test-errors)))))
+    (when (zero? (:total-error best))
+      (doseq [[i error] (map vector
+                             (range)
+                             best-test-errors)]
+        (println (format "Test Case  %3d | Error: %s" i (str error)))))
+    (println ";;------------------------------")
+    (println "Outputs of best individual on training cases:")
+    (error-function best-program :train true)
+    (println ";;******************************")
+    )) ;; To do validation, could have this function return an altered best individual
+       ;; with total-error > 0 if it had error of zero on train but not on validation
+       ;; set. Would need a third category of data cases, or a defined split of training cases.
+
+
+; Define the argmap
+(def argmap
+  {:error-function (replace-space-error-function replace-space-data-domains)
+   :atom-generators replace-space-atom-generators
+   :max-points 800
+   :max-points-in-initial-program 400
+   :evalpush-limit 1600
+   :population-size 1000
+   :max-generations 10e100
+   :max-point-evaluations (* 1000 1000 100 300) ;; popsize (1000) * #points per eval (1000) * #test cases (100) * max gens (300)
+   :parent-selection :lexicase
+;   :genetic-operator-probabilities {:alternation 0.2
+;                                    :uniform-mutation 0.2
+;                                    :uniform-close-mutation 0.1
+;                                    [:alternation :uniform-mutation] 0.5
+;                                    }
+   :epigenetic-markers [:close :silent]
+   :genetic-operator-probabilities {[:alternation :make-next-operator-revertable :uniform-silence-mutation] 0.2
+                                    [:uniform-mutation :make-next-operator-revertable :uniform-silence-mutation] 0.2
+                                    [:uniform-close-mutation :make-next-operator-revertable :uniform-silence-mutation] 0.1
+                                    [:alternation :uniform-mutation :make-next-operator-revertable :uniform-silence-mutation] 0.5
+                                    }
+   :silent-instruction-probability 0.5
+   :uniform-silence-mutation-rate 0.1
+   :alternation-rate 0.01
+   :alignment-deviation 10
+   :uniform-mutation-rate 0.01
+   :problem-specific-report replace-space-report
+   :print-behavioral-diversity true
+   :print-homology-data true
+   :report-simplifications 0
+   :final-report-simplifications 5000
+   :max-error 5000
+   })


Update to core.logic 0.8.5.

Update to core.logic 0.8.5.

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


another named integer

another named integer

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


Kibit cleanup

Kibit cleanup

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


More test coverage

More test coverage

--- jvm-runner/test/codewars/runner/java_test.clj
+++ jvm-runner/test/codewars/runner/java_test.clj
@@ -30,6 +30,19 @@
         :solution "public class Hello {public static void main() {System.out.print(\"Hellooo!\");}}"})
       (is (= "Hellooo!" (with-java-out-str (-main)))))))

+(deftest java-setup-code
+  (testing "-main can handle a java solution and setup code"
+    (with-in-str
+      (json/generate-string
+       {:language "java"
+        :setup "import java.lang.String;
+                public class Beatles {public static String sayHello() {
+                  return \"Hello, hello!\";}}"
+        :solution "public class HelloAgain {
+                     public static void main() {
+                         System.out.print(Beatles.sayHello());}}"})
+      (is (= "Hello, hello!" (with-java-out-str (-main)))))))
+
 (deftest java-test-fixture
   (testing "-main can handle a junit test"
     (with-in-str
@@ -51,3 +64,51 @@
         (is (.contains test-out-string "<DESCRIBE::>myTestFunction(TestFixture)"))
         (is (.contains test-out-string "test out"))
         (is (.contains test-out-string "<PASSED::>Test Passed<:LF:>"))))))
+
+(deftest java-sad-path
+  (testing "-main can handle a failing junit test"
+    (with-in-str
+      (json/generate-string
+       {:language "java"
+        :solution "public class Foo {
+                     public Foo(){}
+                     public int testthing(){return 3;}
+                     public static void main(String[] args){System.out.println(\"42\");}}"
+        :fixture "import static org.junit.Assert.assertEquals;
+                  import org.junit.Test;
+                  import org.junit.runners.JUnit4;
+                  public class TestForFailure {
+                    public TestForFailure(){}
+                    @Test public void sadPath(){
+                      Foo s = new Foo();
+                      assertEquals(\"Failed Message\", 5, s.testthing());
+                      System.out.println(\"Shouldn't get here\");}}"})
+      (let [test-out-string (with-java-out-str (-main))]
+        (is (.contains test-out-string "<DESCRIBE::>sadPath(TestForFailure)<:LF:>"))
+        (is (.contains test-out-string "<FAILED::>Failed Message expected:"))
+        (is (.contains test-out-string "<5> but was:<3>"))
+        (is (not (.contains test-out-string "Shouldn't get here")))
+        (is (not (.contains test-out-string "<PASSED::>Test Passed<:LF:>")))))))
+
+(deftest java-nine-yards
+  (testing "-main can setup, solution, and test fixture code for java"
+    (with-in-str
+      (json/generate-string
+       {:language "java"
+        :setup "public class Setupp { public static int three() {return 3;}}"
+        :solution "public class Sollution {
+                   public Sollution(){}
+                   public int testthingy(){return Setupp.three();}}",
+        :fixture "import static org.junit.Assert.assertEquals;
+                  import org.junit.Test;
+                  import org.junit.runners.JUnit4;
+                  public class NineYards {
+                     public NineYards(){}
+                     @Test public void solutionAndSetupAndFixture(){
+                         Sollution s = new Sollution();
+                         assertEquals(\"wow\", 3, s.testthingy());
+                         System.out.println(\"test out\");}}"})
+      (let [test-out-string (with-java-out-str (-main))]
+        (is (.contains test-out-string "<DESCRIBE::>solutionAndSetupAndFixture(NineYards)<:LF:>"))
+        (is (.contains test-out-string "test out"))
+        (is (.contains test-out-string "<PASSED::>Test Passed<:LF:>"))))))


Add confirmation when importing election authorities to prod

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


Add mirrors project attribute to subproject map if it exists

see:
https://github.com/emezeske/lein-cljsbuild/commit/51465ed685c8ba7121337970fc711ad4369a2163

--- plugin/src/leiningen/figwheel.clj
+++ plugin/src/leiningen/figwheel.clj
@@ -17,6 +17,7 @@
                             :local-repo
                             :dependencies
                             :repositories
+                            :mirrors
                             :resource-paths])
       {:local-repo-classpath true
        :source-paths (concat


Add first example from chapter 9

Add first example from chapter 9

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

--- src/clojure/clojure_walkthrough/cjia/ch09_xx.clj
+++ src/clojure/clojure_walkthrough/cjia/ch09_xx.clj
@@ -0,0 +1,40 @@
+(ns clojure-walkthrough.cjia.ch09-xx
+  (:import [java.text SimpleDateFormat]))
+
+(defn new-expense [date-string dollars cents category merchant-name]
+  {:date (.parse (SimpleDateFormat. "yyyy-MM-dd") date-string)
+   :amount-dollars dollars
+   :amount-cents cents
+   :category category
+   :merchant-name merchant-name})
+
+(defn total-cents [e]
+  (-> (:amount-dollars e)
+      (* 10)
+      (+ (:amount-cents e))))
+
+;; Adding some functions
+(defn total-amount
+  ([expenses-list]
+   (total-amount (constantly true) expenses-list))
+  ([pred expenses-list]
+   (->> expenses-list
+        (filter pred)
+        (map total-cents)
+        (apply +))))
+
+(defn is-category? [e some-category]
+  (= (:category e) some-category))
+
+(defn category-is [category]
+  #(is-category? % category))
+
+;; Let's test it in the new namespaces
+(ns clojure-walkthrough.cjia.ch09-xx-test
+  (:require [clojure-walkthrough.cjia.ch09-xx :refer :all]
+            [clojure.test :refer :all]))
+
+;; (defn clj-expenses [(new-expense "2009-8-20" 21 95 "books" "Amazon.com")
+;;                     (new-expense "2009-8-21" 72 43 "food"  "Mollie-Stones")
+;;                     (new-expense "2009-8-22" 315 71 "car-rental" "Avis")
+;;                     (new-expense "2009-8-23" 15 68  "books" "Borders")])


Prob 153: first exploration

Prob 153: first exploration

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

--- src/project_euler/problem_0153.clj
+++ src/project_euler/problem_0153.clj
@@ -0,0 +1,67 @@
+(ns project-euler.problem-0153
+  (:require [clojure.math.combinatorics :as combo]))
+
+;; As we all know the equation x^2=-1 has no solutions for real x.
+;; If we however introduce the imaginary number i this equation has two solutions: x=i and x=-i.
+;; If we go a step further the equation (x-3)^2=-4 has two complex solutions: x=3+2i and x=3-2i.
+;; x=3+2i and x=3-2i are called each others' complex conjugate.
+;; Numbers of the form a+bi are called complex numbers.
+;; In general a+bi and a−bi are each other's complex conjugate.
+
+;; A Gaussian Integer is a complex number a+bi such that both a and b are integers.
+;; The regular integers are also Gaussian integers (with b=0).
+;; To distinguish them from Gaussian integers with b ≠ 0 we call such integers "rational integers."
+;; A Gaussian integer is called a divisor of a rational integer n if the result is also a Gaussian integer.
+;; If for example we divide 5 by 1+2i we can simplify ￼ in the following manner:
+;; Multiply numerator and denominator by the complex conjugate of 1+2i: 1−2i.
+;; The result is ￼.
+;; So 1+2i is a divisor of 5.
+;; Note that 1+i is not a divisor of 5 because ￼.
+;; Note also that if the Gaussian Integer (a+bi) is a divisor of a rational integer n,
+;; then its complex conjugate (a−bi) is also a divisor of n.
+
+;; In fact, 5 has six divisors such that the real part is positive: {1, 1 + 2i, 1 − 2i, 2 + i, 2 − i, 5}.
+;; The following is a table of all of the divisors for the first five positive rational integers:
+
+;; n	Gaussian integer divisors
+;; with positive real part	Sum s(n) of
+;; these divisors
+;; 1	1	1
+;; 2	1, 1+i, 1-i, 2	5
+;; 3	1, 3	4
+;; 4	1, 1+i, 1-i, 2, 2+2i, 2-2i,4	13
+;; 5	1, 1+2i, 1-2i, 2+i, 2-i, 5	12
+;; For divisors with positive real parts, then, we have: ￼.
+
+;; For 1 ≤ n ≤ 105, ∑ s(n)=17924657155.
+
+;; What is ∑ s(n) for 1 ≤ n ≤ 108?
+
+(defn prime-factors [x]
+  (letfn [(next-fact [n] (if (== n 2) 3 (+ n 2)))]
+    (loop [x x, p 2, pfs {}]
+      (cond (== 1 x)          pfs
+            (> (* p p) x)     (update pfs x #(if %1 (inc %1) 1))
+            (zero? (rem x p)) (recur (quot x p) p (update pfs p #(if %1 (inc %1) 1)))
+            :else             (recur x (next-fact p) pfs)
+            ))))
+
+(defn count-real-gaussian-div [x]
+  (->> (prime-factors x)
+       vals
+       (map inc)
+       (reduce * 1)))
+
+(def lim 100)
+(defn sum-of-squares
+  ([a]
+   (let [bmax (int (Math/sqrt (- lim (* a a))))]
+     (->> (range 1 (inc bmax))
+          (map (fn [b] [a b]))
+          (reduce (fn [m [a b]] (update m (+ (* a a) (* b b)) #(conj (or %1 []) [a b])))
+                  {})
+          )))
+  ([]
+   (let [amax (int (Math/sqrt lim))]
+     (->> (range 1 amax)
+          (map sum-of-squares)))))


solved closures

solved closures

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

--- src/4clojure/closure.clj
+++ src/4clojure/closure.clj
@@ -0,0 +1,48 @@
+;; Simple closures
+
+;; Difficulty:	Easy
+;; Topics:	higher-order-functions math
+
+
+;; Lexical scope and first-class functions are two of the most basic building blocks of a functional language like Clojure. When you combine the two together, you get something very powerful called lexical closures. With these, you can exercise a great deal of control over the lifetime of your local bindings, saving their values for use later, long after the code you're running now has finished.
+
+;; It can be hard to follow in the abstract, so let's build a simple closure. Given a positive integer n, return a function (f x) which computes xn. Observe that the effect of this is to preserve the value of n for use outside the scope in which it is defined.
+
+
+(defn __ [n]
+  #(int (Math/pow % n)))
+
+(int (Math/pow 2 2))
+
+;; ((partial (memfn Math/pow) 2) 2)
+
+;; (letfn [f [a] (Math/pow a)]
+
+(((fn [a]
+  (fn [b]
+    (Math/pow b a))) 2) 16)
+
+(= 256 ((__ 2) 16),
+       ((__ 8) 2))
+
+(= [1 8 27 64] (map (__ 3) [1 2 3 4]))
+
+(= [1 2 4 8 16] (map #((__ %) 2) [0 1 2 3 4]))
+
+
+;; copy paste
+(fn [n] #(int (Math/pow % n)))
+
+
+;; others
+;; _artem_uv's solution:
+(fn [x] #(apply * (repeat x %)))
+
+;; _pcl's solution:
+partial #(Math/pow %2 %1)
+
+;; aceeca1's solution:
+partial (fn [n x] (apply * (repeat n x)))
+
+;; adereth's solution:
+(fn [n] (fn [x] (reduce * (repeat n x))))


Start work on position scoring.

Start work on position scoring.

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/craigy/chess-cljs.git/'


add data websocket

add data websocket

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

--- src/clj/gauguin/core.clj
+++ src/clj/gauguin/core.clj
@@ -0,0 +1,52 @@
+(ns gauguin.core
+  (:gen-class :main true)
+  (:require [clojure.java.io :as io]
+            [compojure.route :refer [resources]]
+            [compojure.core :refer [GET POST defroutes]]
+            [compojure.handler :refer [site api]]
+            [org.httpkit.server :refer [with-channel on-receive on-close run-server]]))
+
+
+(defn read-graph
+  "Read data from edn file"
+  [graph]
+  (->> (str "data/" (name graph) ".edn")
+            slurp
+            read-string))
+
+
+(defn dispatch-request
+  "Dispatch incoming requests"
+  [{:keys [topic data]}]
+  (case topic
+    :graph (read-graph data)
+    :unrelated))
+
+
+(defn ws-handler
+  "Handle incoming websocket requests"
+  [request]
+  (with-channel request channel
+    (on-close channel (fn [msg] (println "Channel closed!")))
+    (on-receive channel (fn [msg]
+                          (read-graph (dispatch-request (read-string msg)))))))
+
+
+(defroutes handler
+  (resources "/")
+  (GET "/data/ws" [] ws-handler)
+  (GET "/*" [] (io/resource "public/index.html")))
+
+
+(defn -main [& args]
+  (run-server (site #'handler) {:port 8091 :join? false})
+  (println "Server up and running!")
+  (println  "Visit http://localhost:8091"))
+
+
+(comment
+
+  (dispatch-request {:topic :graph :data :graph-3})
+
+
+  )


Let's grab our ClojureScript version like this for now

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


testing failed

testing failed

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

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


Added messages namespace for common message handling.

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

--- src/cmr/common/services/messages.clj
+++ src/cmr/common/services/messages.clj
@@ -0,0 +1,6 @@
+(ns cmr.common.services.messages
+  (:require [clojure.string :as str]
+            [cmr.common.services.errors :as errors]))
+
+(defn data-error [error-type msg-fn & args]
+  (errors/throw-service-error error-type (apply msg-fn args)))


riemann.test-utils: you know, for mocks

riemann.test-utils: you know, for mocks

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

--- test/riemann/test_utils.clj
+++ test/riemann/test_utils.clj
@@ -0,0 +1,24 @@
+(ns riemann.test-utils
+  "Utilities for writing tests.")
+
+(defn stub
+  "Returns a fn that records its arguments in an atom, using conj. Always
+  returns ::stub."
+  [a]
+  (fn [& args]
+    (swap! a conj args)
+    ::stub))
+
+(defmacro with-mock
+  "For the duration of the body, turns var-symbol into a stub which simply
+  records its arguments as a seq in an atom. That atom is bound to `a-sym` for
+  the duration of the body. You can deref `a-sym` at any point to find a vector
+  of argument lists, one for each call made to the var. Calls to var will
+  return ::stub.
+
+  (with-mock [x class] (class 3 5) (class 6) @x)
+  ; => [(3 5) (6)]"
+  [[a-sym var-symbol] & body]
+  `(let [~a-sym (atom [])]
+     (with-redefs [~var-symbol (stub ~a-sym)]
+       ~@body)))


Removed unsupported render modes test.

Removed unsupported render modes test.

--- test/sablono/core_test.cljs
+++ test/sablono/core_test.cljs
@@ -107,21 +107,6 @@
           foo #(swap! times-called inc)]
       (html [:div (foo)])
       (is (= @times-called 1)))))
-
-;; ;; (deftest render-modes
-;; ;;   (testing "closed tag"
-;; ;;     (is (= (html [:br]) "
"))
-;; ;;     (is (= (html {:mode :xml} [:br]) "
"))
-;; ;;     (is (= (html {:mode :sgml} [:br]) "
"))
-;; ;;     (is (= (html {:mode :html} [:br]) "
")))
-;; ;;   (testing "boolean attributes"
-;; ;;     (is (= (html {:mode :xml} [:input {:type "checkbox" :checked true}])
-;; ;;            "<input checked=\"checked\" type=\"checkbox\" />"))
-;; ;;     (is (= (html {:mode :sgml} [:input {:type "checkbox" :checked true}])
-;; ;;            "<input checked type=\"checkbox\">")))
-;; ;;   (testing "laziness and binding scope"
-;; ;;     (is (= (html {:mode :sgml} [:html [:link] (list [:link])])
-;; ;;            "<link><link>"))))

 ;; (deftest include-js-test
 ;;   (is (= (html/include-js "foo.js")


Add untested column scan code

Add untested column scan code

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


Start on example tests

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


Baliozko erabiltzailea sinplifikatu

Baliozko erabiltzailea sinplifikatu

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


Azala fitxategia

Azala fitxategia

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


Remove :data from schema validation errors

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


Add bookkeeper server component

Add bookkeeper server component

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

--- src/onyx/state/bookkeeper.clj
+++ src/onyx/state/bookkeeper.clj
@@ -0,0 +1,44 @@
+(ns onyx.state.bookkeeper
+  (:require [taoensso.timbre :refer [info error warn trace fatal] :as timbre]
+            [taoensso.nippy :as nippy]
+            [onyx.log.curator :as zk]
+            [onyx.log.zookeeper :as ozk]
+            [com.stuartsierra.component :as component])
+  (:import [org.apache.bookkeeper.client LedgerHandle BookKeeper BookKeeper$DigestType AsyncCallback$AddCallback]
+           [org.apache.bookkeeper.proto BookieServer]
+           [org.apache.bookkeeper.conf ServerConfiguration]
+           [org.apache.bookkeeper.conf ClientConfiguration]
+           [org.apache.bookkeeper.zookeeper ZooKeeperClient]
+           [onyx.log.zookeeper]
+           [org.apache.curator.framework CuratorFramework CuratorFrameworkFactory]))
+
+(def password (.getBytes "somepass"))
+
+(def bookie-server
+  {:zookeeper/address "127.0.0.1:2181"
+   :zookeeper/timeout 20000
+   :onyx/id (java.util.UUID/randomUUID)
+   :bookie/ledger-directories ["/tmp/bk-data996"]
+   :bookie/journal-directory "/tmp/bk-txn996"
+   :bookie/port 3196})
+
+(defrecord Bookie [conf]
+  component/Lifecycle
+  (component/start [component]
+    (let [ledgers-path (ozk/ledgers-path (:onyx/id conf))
+          ledgers-available-path (ozk/ledgers-available-path (:onyx/id conf))
+          conn (zk/connect (:zookeeper/address conf))
+          _ (zk/create-all conn ledgers-available-path :persistent? true)
+          server-conf (doto (ServerConfiguration.)
+                        (.setZkServers (:zookeeper/address conf))
+                        (.setZkLedgersRootPath ledgers-path)
+                        (.setBookiePort (:bookie/port conf))
+                        (.setJournalDirName (:bookie/journal-directory conf))
+                        (.setLedgerDirNames (into-array String (:bookie/ledger-directories conf)))
+                        (.setAllowLoopback true))
+          server (BookieServer. server-conf)]
+      (.start server)
+      (assoc component :server server)))
+  (component/stop [component]
+    (.stop (:server component))
+    (assoc component :server nil)))


implement GET /api/meta/dataset/csv/

implement GET /api/meta/dataset/csv/

--- src/metabase/api/meta/dataset.clj
+++ src/metabase/api/meta/dataset.clj
@@ -1,12 +1,30 @@
 (ns metabase.api.meta.dataset
   "/api/meta/dataset endpoints."
-  (:require [compojure.core :refer [POST]]
+  (:require [clojure.data.csv :as csv]
+            [compojure.core :refer [GET POST]]
             [metabase.api.common :refer :all]
-            [metabase.driver :as driver]))
+            [metabase.driver :as driver]
+            [metabase.util :as u]))

 (defendpoint POST "/" [:as {:keys [body]}]
   (let [{:keys [status] :as response} (driver/dataset-query body {:executed_by *current-user-id*})]
     {:status (if (= status :completed) 200 400)
      :body response}))

+(defendpoint GET "/csv/"
+  "Execute an MQL query and download the results as a CSV file."
+  [query]
+  {query [Required String->Dict]}
+  (let [{{:keys [columns rows]} :data :keys [status] :as response} (driver/dataset-query query {:executed_by *current-user-id*})]
+    (if (= status :completed)
+      ;; successful query, send CSV file
+      {:status 200
+       :body (with-out-str
+               (csv/write-csv *out* (into [columns] rows)))
+       :headers {"Content-Type" "text/csv"
+                 "Content-Disposition" (str "attachment; filename=\"query_result_" (u/now-iso8601) ".csv\"")}}
+      ;; failed query, send error message
+      {:status 500
+       :body response})))
+
 (define-routes)


Updated the benchmark short options.

Updated the benchmark short 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/altamiracorp/honeycomb.git/'


fix not closed bracket

fix not closed bracket

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


Implemented cosine similarity algorithm

Implemented cosine similarity algorithm

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

--- src/seminarski/similarity.clj
+++ src/seminarski/similarity.clj
@@ -0,0 +1,24 @@
+(ns seminarski.similarity)
+
+(defn get-cosine-similarity-values [val1 val2]
+  {:dot (* val1 val2), :mag1 (Math/pow val1 2), :mag2 (Math/pow val2 2)})
+
+(defn sum [map1 map2]
+  (let [dotv1 (:dot map1)
+        dotv2 (:dot map2)
+        mag1v1 (:mag1 map1)
+        mag1v2 (:mag1 map2)
+        mag2v1 (:mag2 map1)
+        mag2v2 (:mag2 map2)]
+    {:dot (+ dotv1 dotv2)
+     :mag1 (+ mag1v1 mag1v2)
+     :mag2 (+ mag2v1 mag2v2)}))
+
+(defn calculate-parameters-for-cosine-similarity [v1 v2]
+  (reduce sum (map get-cosine-similarity-values v1 v2)))
+
+(defn calculate-cosine-similarity [v1 v2]
+  (let [ {:keys[dot mag1 mag2]} (calculate-parameters-for-cosine-similarity v1 v2)]
+    (if (or (= mag1 0.0) (= mag2 0.0))
+      0
+      (/ dot (* (Math/sqrt mag1) (Math/sqrt mag2))))))


Update `clj-aws-s3` to 0.4.2

Update `clj-aws-s3` to 0.4.2

This uses the Java AWS SJD 1.4.7 which eliminates some of the connection
reset errors we were seeing.

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


don't call warp-rf-nometa

don't call warp-rf-nometa

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


Remove Google Analytics

Remove Google Analytics

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


Passing vm test.

Passing vm test.

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

--- test/onyx/hornetq/vm_test.clj
+++ test/onyx/hornetq/vm_test.clj
@@ -0,0 +1,118 @@
+(ns onyx.hornetq.vm-test
+  (:require [com.stuartsierra.component :as component]
+            [onyx.system :refer [onyx-development-env]]
+            [onyx.peer.pipeline-extensions :as p-ext]
+            [midje.sweet :refer :all]
+            [onyx.queue.hornetq-utils :as hq-util]
+            [onyx.api]))
+
+(def n-messages 2600)
+
+(def batch-size 1320)
+
+(def echo 100)
+
+(defn my-inc [{:keys [n] :as segment}]
+  (assoc segment :n (inc n)))
+
+(def catalog
+  [{:onyx/name :in
+    :onyx/ident :mem/read-segments
+    :onyx/type :input
+    :onyx/medium :memory
+    :onyx/consumption :concurrent
+    :onyx/bootstrap? true
+    :onyx/batch-size batch-size}
+
+   {:onyx/name :inc
+    :onyx/fn :onyx.hornetq.vm-test/my-inc
+    :onyx/type :function
+    :onyx/consumption :concurrent
+    :onyx/batch-size batch-size}
+
+   {:onyx/name :out
+    :onyx/ident :mem/write-segments
+    :onyx/type :output
+    :onyx/medium :memory
+    :onyx/consumption :concurrent
+    :onyx/batch-size batch-size}])
+
+(def workflow {:in {:inc :out}})
+
+(def input (map (fn [x] {:n x}) (range n-messages)))
+
+(def output (atom []))
+
+(defmethod p-ext/apply-fn [:input :memory]
+  [event] {:onyx.core/results input})
+
+(defmethod p-ext/apply-fn [:output :memory]
+  [{:keys [onyx.core/decompressed]}]
+  {:onyx.core/results decompressed})
+
+(defmethod p-ext/compress-batch [:output :memory]
+  [{:keys [onyx.core/results]}]
+  {:onyx.core/compressed results})
+
+(defmethod p-ext/write-batch [:output :memory]
+  [{:keys [onyx.core/compressed]}]
+  (doseq [segment compressed]
+    (swap! output conj segment))
+  {})
+
+(defmethod p-ext/seal-resource [:output :memory]
+  [_]
+  (swap! output conj :done)
+  {})
+
+(def id (java.util.UUID/randomUUID))
+
+(def config (read-string (slurp (clojure.java.io/resource "test-config.edn"))))
+
+(def env-config
+  {:hornetq/mode :vm
+   :hornetq/server? true
+   :hornetq.server/type :vm
+   :zookeeper/address "127.0.0.1:2185"
+   :zookeeper/server? true
+   :zookeeper.server/port 2185
+   :onyx/id id
+   :onyx.coordinator/revoke-delay 5000})
+
+(def peer-config
+  {:hornetq/mode :vm
+   :zookeeper/address "127.0.0.1:2185"
+   :onyx/id id
+   :onyx.peer/inbox-capacity (:inbox-capacity (:peer config))
+   :onyx.peer/outbox-capacity (:outbox-capacity (:peer config))
+   :onyx.peer/job-scheduler :onyx.job-scheduler/round-robin})
+
+(def dev (onyx-development-env env-config))
+
+(def env (component/start dev))
+
+(def v-peers (onyx.api/start-peers! 1 peer-config))
+
+(onyx.api/submit-job
+ peer-config {:catalog catalog :workflow workflow
+              :task-scheduler :onyx.task-scheduler/round-robin})
+
+(def p (promise))
+
+(add-watch output :count
+           (fn [_ _ _ state]
+             (when (= (count state) (inc n-messages))
+               (deliver p true))))
+
+@p
+
+(let [results @output
+      expected (set (map (fn [x] {:n (inc x)}) (range n-messages)))]
+  (fact (set (butlast results)) => expected)
+  (fact (last results) => :done))
+
+(doseq [v-peer v-peers]
+  ((:shutdown-fn v-peer)))
+
+(component/stop env)
+


dubious unit tests

dubious unit tests

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


More precise logging for user list.

More precise logging for user list.

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


update

update

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

--- src/main/clj/learnclojure/ch11/value_equality.clj
+++ src/main/clj/learnclojure/ch11/value_equality.clj
@@ -0,0 +1,89 @@
+(ns learnclojure.ch11.value-equality
+  (:import (java.util HashMap)))
+
+;clojure有三种用于判断相等性的方式
+;1.对象相同,即两个对象指向的是同一个实例,等价于Java的==(当比较对象时)
+(identical? "foot" (str "fo" "ot"))
+;false
+(let [a (range 10)]
+  (identical? a a))
+;true
+;一般来说,相同的数字从来不会是identical的,即使是字面量的比较
+(identical? 5/4 (+ 1/2 3/4))
+;false
+;但有一个例外,Java对于一些常用的整数会做一些缓存以重用,返回时-128~127
+;所以在这个范围之内的比较的结果会是true
+(identical? 127 (dec 128))
+;true
+(identical? 128 (dec 129))
+;false
+;总之,不要使用identical?去比较数字
+
+;2.引用相等,但对类型不像Java那么敏感
+;clojure在比较集合的时候可能会忽视集合的具体类型,但绝不会让不同类别的集合相等(如序列绝不会等于某个set或map)
+(= {:a 1 :b ["1"]}
+   (into (sorted-map) [[:b ["1"]] [:a 1]])
+   (doto (HashMap.)
+     (.put :a 1)
+     (.put :b ["1"])))
+;true
+;同样的,这种比较只有在两个数字的类别相同的情况下才会相同(short byte integer,long,BigInt都算是一个类别的)
+(= 1 1N (Integer. 1) (Short. (short 1)) (Byte. (byte 1)))
+;true
+(= 1.25 (Float. 1.25))
+;true
+;不同类型的数字即使数值相等也不算相等(如整数绝不会相等某个整数)
+(= 1 1.0)
+;false
+(= 1N 1M)
+;false
+(= 1.25 5/4)
+;false
+
+;3.数字等值,这种比较的结果和直觉理解的相符,不受我们用来划分数字表示的人为类别的影响
+(== 0.125 0.125M 1/8)
+;true
+(== 4 4N 4.0 4.0M)
+;true
+;有理数和小数比较也支持
+(== 1/4 0.25)
+;true
+;==要求参与比较的都是数字,否则会抛出异常.
+;所以如果不确定是否是数字,有两种选择：
+;1.使用=
+;2.如果确实需要==的语义,那么要先用number?检查参数
+(defn equiv?
+  [& args]
+  (and (every? number? args)
+       (apply == args)))
+(equiv? "foo" 1)
+;false
+(equiv? 4N 4 4.0 4.0M)
+;true
+
+;在异质类型的数字用于集合的时候,Java的数字相等的概念让人难受,因为Java的集合实现依赖与每个成员对相等的定义,所以可能会出现下面的情况
+(doto (HashMap.)
+  (.put (int 1) "integer")
+  (.put (long 1) "long")
+  (.put (BigInteger. "1") "bigint"))
+;{1 "integer", 1 "long", 1 "bigint"}
+;这种情况我们肯定是希望这三个键hash值一致,但Java中却不是这样的
+;clojure的集合类对数字键和成员归属使用数字等值定义来确定
+(into #{} [1 1N (Integer. 1) (Short. (short 1))])
+;#{1}
+(into {}
+      [[1 :long]
+       [1N :bigint]
+       [(Integer. 1) :integer]])
+;{1 :integer}
+
+;对于浮点数,要特别小心
+(+ 0.1 0.2)
+;0.30000000000000004
+;不同类型的小数的相等比较也可能出问题,及时使用的是类型不敏感的==
+(== 1.1 (float 1.1))
+;false
+;原因是比较的时候把后面的float扩展成了double类型,而这对于1.1无法做到精确
+(double (float 1.1))
+;1.100000023841858
+;这一行为在java中也同样会复现,根源是IEEE浮点数规范.


more sanitizing

more sanitizing

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


Initial metered block store implementation.

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

--- src/blocks/store/meter.clj
+++ src/blocks/store/meter.clj
@@ -0,0 +1,236 @@
+(ns blocks.store.meter
+  "Meta block store which instruments another backing store to measure the data
+  flows, call latencies, and other metrics.
+
+  The logic in this store is built around the notion of a _metric event_ and an
+  associated _recording function_ which the events are passed to. Each event
+  has at least a namespaced `:type` keyword, a `:label` associated with the
+  store, and a numeric `:value`.
+
+  Events may contain other information like the block id or method name as
+  well, and it is up to the receiver to interpret them."
+  (:require
+    [blocks.core :as block]
+    [blocks.data :as data]
+    [blocks.store :as store]
+    [clojure.string :as str]
+    [clojure.tools.logging :as log]
+    [multihash.core :as multihash])
+  (:import
+    (java.io
+      InputStream
+      OutputStream)
+    (org.apache.commons.io.input
+      ProxyInputStream)
+    (org.apache.commons.io.output
+      ProxyOutputStream)))
+
+
+; TODO: dynamic context var
+
+
+;; ## Stream Metering
+
+(def ^:dynamic *io-report-period*
+  "Record incremental IO metrics every N seconds."
+  10)
+
+
+(defn- format-bytes
+  "Format a byte value as a string with the given suffix."
+  [value unit]
+  (loop [prefixes ["" "K" "M" "G"]
+         value value]
+    (if (and (< 1024 value) (seq prefixes))
+      (recur (/ value 1024) (next prefixes))
+      (if (integer? value)
+        (format "%d %s%s" value (first prefixes) unit)
+        (format "%.1f %s%s" (double value) (first prefixes) unit)))))
+
+
+(defn- metering-input-stream
+  "Wrap the given input stream in a proxy which will call the given
+  `record-io!` function with the number of bytes read."
+  [^InputStream input-stream record-io!]
+  (let [meter (volatile! [(System/nanoTime) 0])]
+    (letfn [(flush!
+              []
+              (let [[last-time sum] @meter
+                    elapsed (/ (- (System/nanoTime) last-time) 1e9)]
+                (when (pos? sum)
+                  ; TODO: wire up label
+                  (log/tracef "Transferred %s of block %s (%s)"
+                              (format-bytes sum "B")
+                              (format-bytes (/ sum elapsed) "Bps"))
+                  (record-io! sum))
+                (vreset! [(System/nanoTime) 0])))]
+      (proxy [ProxyInputStream] [input-stream]
+
+        (afterRead
+          [n]
+          (let [[last-time sum] (vswap! meter update 1 + n)
+                elapsed (/ (- (System/nanoTime) last-time) 1e9)]
+            (when (<= *io-report-period* elapsed)
+              (flush!))))
+
+        (close
+          []
+          (flush!)
+          (.close input-stream))))))
+
+
+(deftype MeteredContentReader
+  [content record-io!]
+
+  data/ContentReader
+
+  (read-all
+    [this]
+    (metering-input-stream (data/read-all content) record-io!))
+
+
+  (read-range
+    [this start end]
+    (metering-input-stream (data/read-range content start end) record-io!)))
+
+
+(alter-meta! #'->MeteredContentReader assoc :private true)
+
+
+(defn- metered-block
+  "Wrap the given block with a lazy constructor for a metered input stream
+  which will report metrics to the given function."
+  [store metric-type block]
+  (when block
+    (letfn [(record-io!
+              [value]
+              (let [record! (:record-event store)
+                    event {:type metric-type
+                           :block (:id block)
+                           :value value}]
+                (record! store event)))]
+      (data/wrap-block block #(->MeteredContentReader % record-io!)))))
+
+
+
+;; ## Latency Measurement
+
+(defn- stopwatch
+  "Creates a delay expression which will return the number of milliseconds
+  elapsed between its creation and dereference."
+  []
+  (let [start (System/nanoTime)]
+    (delay (/ (- (System/nanoTime) start) 1e6))))
+
+
+(defmacro ^:private measure-method
+  "Anaphoric macro to wrap a form in metric recording."
+  [[method-kw args] & body]
+  `(let [elapsed# (stopwatch)]
+     (try
+       ~@body
+       (finally
+         (log/tracef "Store " )
+         (~'record-event
+           ~'this
+           {:type ::method-time
+            :method ~method-kw
+            :value @elapsed#})))))
+
+
+
+;; ## Store Record
+
+;; One downside of the approach taken here is that if a store which does _not_
+;; implement the more efficient batch protocols is wrapped, the resulting
+;; composition will appear to be efficient. This may change program behavior in
+;; some cases if care is not taken.
+
+(defrecord MeteredBlockStore
+  [store label record-event]
+
+  store/BlockStore
+
+  (-stat
+    [this id]
+    (measure-method [:stat id]
+      (store/-stat store id)))
+
+
+  (-list
+    [this opts]
+    (measure-method [:list opts]
+      (store/-list store opts)))
+
+
+  (-get
+    [this id]
+    (measure-method [:get id]
+      (metered-block this ::read-bytes (store/-get store id))))
+
+
+  (-put!
+    [this block]
+    (measure-method [:put! (:id block)]
+      (->> block
+           (metered-block this ::write-bytes)
+           (store/-put! store)
+           (metered-block this ::read-bytes))))
+
+
+  (-delete!
+    [this id]
+    (measure-method [:delete! id]
+      (store/-delete! store id)))
+
+
+  store/BatchingStore
+
+  (-get-batch
+    [this ids]
+    (measure-method [:get-batch ids]
+      (->> ids
+           (block/get-batch store)
+           (map (partial metered-block this ::read-bytes)))))
+
+
+  (-put-batch!
+    [this blocks]
+    (measure-method [:put-batch! (mapv :id blocks)]
+      (->> blocks
+           (map (partial metered-block this ::write-bytes))
+           (block/put-batch! store)
+           (map (partial metered-block this ::read-bytes)))))
+
+
+  (-delete-batch!
+    [this ids]
+    (measure-method [:delete-batch! ids]
+      (block/delete-batch! store ids)))
+
+
+  store/ErasableStore
+
+  (-erase!
+    [this]
+    (measure-method [:erase! nil]
+      (block/erase!! store))))
+
+
+
+;; ## Store Construction
+
+(store/privatize-constructors! MeteredBlockStore)
+
+
+(defn metered-block-store
+  "Creates a new metered block store. The `record-event` function will be
+  called once for each measurement, with the meter store record and a map
+  containing the metric name string, a numeric value, and possibly other data."
+  [record-event & {:as opts}]
+  (when-not (fn? record-event)
+    (throw (IllegalArgumentException.
+             (str "First argument must be a metric recording function: "
+                  (pr-str record-event)))))
+  (map->MeteredBlockStore
+    (assoc opts :record-event record-event)))


A means to create/start a daemon sharing the lifecycle of your app

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

--- modules/daemons/src/main/clojure/immutant/daemons.clj
+++ modules/daemons/src/main/clojure/immutant/daemons.clj
@@ -0,0 +1,27 @@
+;; Copyright 2008-2011 Red Hat, Inc, and individual contributors.
+;;
+;; This is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU Lesser General Public License as
+;; published by the Free Software Foundation; either version 2.1 of
+;; the License, or (at your option) any later version.
+;;
+;; This software is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; Lesser General Public License for more details.
+;;
+;; You should have received a copy of the GNU Lesser General Public
+;; License along with this software; if not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+(ns immutant.daemons
+  (:require [immutant.registry :as lookup]))
+
+(defn start [name start-fn & [stop-fn]]
+  "Start a service asynchronously, creating an MBean named by name,
+   and registering an optional stop function to be called at
+   undeployment/shutdown"
+  (if-let [daemonizer (lookup/fetch "daemonizer")]
+    (.deploy daemonizer name start-fn stop-fn)))
+


Fix bugs in column scans

Fix bugs in column scans

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


Add animation for drag and drop between searched..

... lists. Not sure that this is desireable, but the fix included using the
same metadata :keys for each found list, which seems to be an idiomatic
solution - and if I then want to remove animations, it should work with this
more idiomatic solution.

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


Add helper for printing threaded arg

Add helper for printing threaded arg

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

--- src/subman/helpers.clj
+++ src/subman/helpers.clj
@@ -0,0 +1,5 @@
+(ns subman.helpers)
+
+(defn print-first [arg fnc & args]
+  (println arg)
+  (apply fnc arg args))


init (and A (not B)).clj

init (and A (not B)).clj

/bin/sh: 1: Syntax error: "(" unexpected


cleaning up ununsed variables

cleaning up ununsed variables

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/wild-endeavor/cljalgos.git/'


Fixes #4 by making a correct assertion.

Fixes #4 by making a correct assertion.

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


Break up Swagger API into sections

Break up Swagger API into sections

Creating top-level, entities, and views sections to make the docs
clearer.

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


Enable wrap-json-response middleware

Enable wrap-json-response middleware


Added bullet to end punc

Added bullet to end punc

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


[#2262] Create akvo.lumen.db.transformation ns to wrap hugsql

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

--- backend/src/akvo/lumen/db/transformation.clj
+++ backend/src/akvo/lumen/db/transformation.clj
@@ -0,0 +1,4 @@
+(ns akvo.lumen.db.transformation
+  (:require [hugsql.core :as hugsql]))
+
+(hugsql/def-db-fns "akvo/lumen/lib/transformation.sql")


Add a chore for replaying failed messages if they occur

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


Leader fixer

Leader fixer

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/just-cloud/uxtweet-client.git/'


Make upload files input pretty

Make upload files input pretty

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


bump example clojurescript version

bump example clojurescript version

--- example/project.clj
+++ example/project.clj
@@ -5,7 +5,7 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [
                  [org.clojure/clojure "1.7.0"]
-                 [org.clojure/clojurescript "1.7.122"]
+                 [org.clojure/clojurescript "1.7.170"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [sablono "0.3.5"]
                  [org.omcljs/om "0.8.8"]


Refactoring

Refactoring

--- jvm-runner/src/clojure/codewars/runner/java.clj
+++ jvm-runner/src/clojure/codewars/runner/java.clj
@@ -1,7 +1,7 @@
 (ns codewars.runner
   (:require [codewars.runner :refer [run]]
             [clojure.java.io :as io]
-            [codewars.util :as util])
+            [codewars.util :refer [write-code!]])
   (:import [codewars.java TempDir]
            [java.net URLClassLoader]
            [javax.tools ToolProvider]
@@ -32,14 +32,17 @@
     (.addListener runner (CwRunListener.))
     (.run runner (into-array [fixture-class]))))

+(defn- file-names [files]
+  (for [{:keys [:file-name]} files
+        :when (not (nil? file-name))]
+    file-name))
+
 (defmethod solution-only "java"
   [{:keys [:setup :solution]}]
   (let [dir (TempDir/create "java")
-        setup (when (not (empty? setup)) (util/write-code! "java" dir setup))
-        solution (util/write-code! "java" dir solution)
-        files (for [{:keys [:file-name]} [setup solution]
-                    :when (not (nil? file-name))]
-                file-name)]
+        setup (when (not (empty? setup)) (write-code! "java" dir setup))
+        solution (write-code! "java" dir solution)
+        files (file-names [setup solution])]
     (apply compile! files)
     (-> solution
         :class-name
@@ -50,11 +53,9 @@
 (defmethod full-project "java"
   [{:keys [:fixture :setup :solution]}]
   (let [dir (TempDir/create "java")
-        fixture (util/write-code! "java" dir fixture)
-        setup (when (not (empty? setup)) (util/write-code! "java" dir setup))
-        solution (util/write-code! "java" dir solution)
-        files (for [{:keys [:file-name]} [fixture setup solution]
-                    :when (not (nil? file-name))]
-                file-name)]
+        fixture (write-code! "java" dir fixture)
+        setup (when (not (empty? setup)) (write-code! "java" dir setup))
+        solution (write-code! "java" dir solution)
+        files (file-names [fixture setup solution])]
     (apply compile! files)
     (->> fixture :class-name (load-class dir) run-junit-tests)))


This is bound to not work, but it's a start.

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/screen6/bigquery-clj.git/'


leiningen: add simpleton.

leiningen: add simpleton.

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

--- lein_profiles.clj
+++ lein_profiles.clj
@@ -0,0 +1,3 @@
+{:user {:plugins [
+                  [lein-simpleton "1.0.1"]
+                  ]}}


added tests for the markdown plugin

added tests for the markdown plugin

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

--- test/blog/article_plugin/markdown_impl_test.clj
+++ test/blog/article_plugin/markdown_impl_test.clj
@@ -0,0 +1,16 @@
+(ns blog.article-plugin.markdown-impl-test
+  (:use blog.article-plugin.plugin
+        blog.article-plugin.markdown)
+  (:require [clojure.test :refer :all]
+            [blog.article-plugin.markdown-impl :refer :all]))
+
+(def markdown-plugin (map->MarkdownPlugin {}))
+
+(deftest markdown
+  (testing "process"
+    (is (= (process markdown-plugin "")
+           ""))
+    (is (= (process markdown-plugin "# Heading")
+           "
Heading
"))
+    (is (= (process markdown-plugin "text")
+           "
text
"))))


Bump aeron version

Bump aeron version

--- project.clj
+++ project.clj
@@ -28,7 +28,7 @@
                  [com.stuartsierra/component "0.3.1"]
                  [com.taoensso/timbre "4.1.4"]
                  [com.taoensso/nippy "2.10.0"]
-                 [uk.co.real-logic/aeron-all "0.2.3"]
+                 [uk.co.real-logic/aeron-all "0.9"]
                  [prismatic/schema "1.0.3"]
                  [log4j/log4j "1.2.17"]
                  [clj-tuple "0.2.2"]


add logback dependency

add logback dependency

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


Production => services.ovation.io

Production => services.ovation.io


Changed project.clj to remove unrelated class files

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


Update cljs compiler to 1.7.170.

Update cljs compiler to 1.7.170.

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


Updated httpclient dependency version

Updated httpclient dependency version

--- project.clj
+++ project.clj
@@ -8,8 +8,8 @@
   :min-lein-version "2.0.0"
   :exclusions [org.clojure/clojure]
   :dependencies [[org.apache.httpcomponents/httpcore "4.3.1"]
-                 [org.apache.httpcomponents/httpclient "4.3.1"]
-                 [org.apache.httpcomponents/httpmime "4.3.1"]
+                 [org.apache.httpcomponents/httpclient "4.3.2"]
+                 [org.apache.httpcomponents/httpmime "4.3.2"]
                  [commons-codec "1.9"]
                  [commons-io "2.4"]
                  [slingshot "0.10.3"]


rollback

rollback

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


Bump kehaar to 0.10.1

Bump kehaar to 0.10.1


Exclude org.apache.httpcomponents/httpclient

See: https://github.com/aws/aws-sdk-java/issues/1919

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


kata4: add some docstrings and remove a superfluous local variable.

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


util/http_client.clj: copied from v4

util/http_client.clj: copied from v4

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

--- src/org/altlaw/util/http_client.clj
+++ src/org/altlaw/util/http_client.clj
@@ -0,0 +1,24 @@
+(ns org.altlaw.util.http-client
+  (:import (org.restlet Client)
+           (org.restlet.data Request Protocol MediaType Method)
+           (org.restlet.resource StringRepresentation)))
+
+(def *client-base-uri* nil)
+
+(defn http-get [uri]
+  (.handle (Client. Protocol/HTTP)
+           (Request. Method/GET (str *client-base-uri* uri))))
+
+(defn http-put [uri content]
+  (.handle (Client. Protocol/HTTP)
+           (Request. Method/PUT (str *client-base-uri* uri)
+                     (StringRepresentation. content))))
+
+(defn http-post [uri content]
+  (.handle (Client. Protocol/HTTP)
+           (Request. Method/POST (str *client-base-uri* uri)
+                     (StringRepresentation. content))))
+
+(defn http-delete [uri]
+  (.handle (Client. Protocol/HTTP)
+           (Request. Method/DELETE (str *client-base-uri* uri))))