Add test for session window merging

Add test for session window merging

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


[WM] add tests for voter reg status endpoints

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


Add tests for auth code

Add tests for auth code

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

--- test/time_tracker/auth/core_test.clj
+++ test/time_tracker/auth/core_test.clj
@@ -0,0 +1,77 @@
+(ns time-tracker.auth.core-test
+  (:require [clojure.test :refer :all]
+            [time-tracker.auth.core :as auth]
+            [ring.util.response :as res]))
+
+(def bad-google-api-call (constantly {:status 400}))
+
+(defn good-google-api-call
+  [credentials]
+  (constantly {:status 200
+               :body credentials}))
+
+
+(deftest token->credentials
+  (testing "Valid token"
+    (with-redefs [auth/call-google-tokeninfo-api
+                  (good-google-api-call {:aud "test"})]
+      (testing "Valid client id"
+        (is (= {:aud "test"}
+               (auth/token->credentials ["test"] "token"))))
+
+      (testing "Invalid client id"
+        (is (nil? (auth/token->credentials ["foo" "goo"] "token"))))))
+
+  (testing "Invalid token"
+    (with-redefs [auth/call-google-tokeninfo-api bad-google-api-call]
+      (is (nil? (auth/token->credentials ["foo" "goo"] "token"))))))
+
+
+(deftest token-from-headers
+  (testing "Header absent"
+    (is (nil? (auth/token-from-headers {"content-type" "application/json"}))))
+
+  (testing "Header with different scheme"
+    (is (nil? (auth/token-from-headers {"authorization" "Digest a3451cbd4520e0ff02d"}))))
+
+  (testing "Correct header"
+    (is (= "token"
+           (auth/token-from-headers {"authorization" "Bearer token"})))))
+
+
+(deftest auth-credentials
+  (testing "Properly authenticated request"
+    (with-redefs [auth/call-google-tokeninfo-api
+                  (good-google-api-call {:aud "test"
+                                         :username "sandy"})]
+      (let [valid-request {:headers {"content-type" "application/json"
+                                     "authorization" "Bearer token"}}]
+        (is (= {:aud "test"
+                :username "sandy"}
+               (auth/auth-credentials ["test" "test2"] valid-request))))))
+
+  (testing "Bad request"
+    (with-redefs [auth/call-google-tokeninfo-api bad-google-api-call]
+      (let [invalid-request {:headers {"authorization" "Digest token"}}]
+        (is (nil? (auth/auth-credentials ["test" "test2"] invalid-request)))))))
+
+
+(deftest wrap-google-authenticated
+  (let [handler (fn [request]
+                  (res/response "Here is your response. Share it with all your friends."))
+        wrapped-handler (auth/wrap-google-authenticated ["test" "test2"] handler)
+        user-creds {:aud "test"
+                    :username "sandy"}]
+
+    (testing "Handle an authenticated request"
+      (with-redefs [auth/call-google-tokeninfo-api
+                    (good-google-api-call user-creds)]
+        (let [valid-request {:headers {"authorization" "Bearer token"}}]
+          (is (= 200
+                 (:status (wrapped-handler valid-request)))))))
+
+    (testing "Handle an unauthenticated request"
+      (with-redefs [auth/call-google-tokeninfo-api bad-google-api-call]
+        (let [request {:headers {"authorization" "Bearer token"}}]
+          (is (= 403
+                 (:status (wrapped-handler request)))))))))


Footer: link to NEWS.md and about wiki page. #70

fatal: unable to access 'https://github.com/clojars/clojars-web.git/': The requested URL returned error: 403


db/content.clj: created lib for handling content storage

fatal: unable to access 'https://github.com/stuartsierra/altlaw-backend.git/': The requested URL returned error: 403


Doing some manual coaching (with some useful saved responses)

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


remove some debug code

remove some debug code

--- src/metabase/driver/postgres.clj
+++ src/metabase/driver/postgres.clj
@@ -134,6 +134,3 @@
     :database->connection-details        database->connection-details
     :sql-string-length-fn                :CHAR_LENGTH
     :timezone->set-timezone-sql          timezone->set-timezone-sql}))
-
-(use 'metabase.db)
-(use 'metabase.models.database)


qa connect.cljs

qa connect.cljs

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


filepaths are prefixed

filepaths are prefixed

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


Revisited the override API, used lists instead of HashMap

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


Support reading/writing to a filename not in env.

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


specifying slave resources in mesos

specifying slave resources in mesos

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


Entzutean erroreak tratatzeko aukera

Entzutean erroreak tratatzeko aukera

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


println-a kendu

println-a kendu


Failing validation test.

Failing validation test.

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

--- test/onyx/validation_test.clj
+++ test/onyx/validation_test.clj
@@ -0,0 +1,252 @@
+(ns onyx.validation-test
+  (:require [com.stuartsierra.component :as component]
+            [onyx.system :refer [onyx-development-env]]
+            [onyx.peer.pipeline-extensions :as p-ext]
+            [onyx.peer.task-lifecycle-extensions :as l-ext]
+            [midje.sweet :refer :all]
+            [onyx.queue.hornetq-utils :as hq-util]
+            [onyx.api]))
+
+(def id (java.util.UUID/randomUUID))
+
+(def config (read-string (slurp (clojure.java.io/resource "test-config.edn"))))
+
+(def env-config
+  {:hornetq/mode :udp
+   :hornetq/server? true
+   :hornetq.server/type :embedded
+   :hornetq.udp/cluster-name (:cluster-name (:hornetq config))
+   :hornetq.udp/group-address (:group-address (:hornetq config))
+   :hornetq.udp/group-port (:group-port (:hornetq config))
+   :hornetq.udp/refresh-timeout (:refresh-timeout (:hornetq config))
+   :hornetq.udp/discovery-timeout (:discovery-timeout (:hornetq config))
+   :hornetq.embedded/config (:configs (:hornetq config))
+   :zookeeper/address (:address (:zookeeper config))
+   :zookeeper/server? true
+   :zookeeper.server/port (:spawn-port (:zookeeper config))
+   :onyx/id id})
+
+(def peer-config
+  {:hornetq/mode :udp
+   :hornetq.udp/cluster-name (:cluster-name (:hornetq config))
+   :hornetq.udp/group-address (:group-address (:hornetq config))
+   :hornetq.udp/group-port (:group-port (:hornetq config))
+   :hornetq.udp/refresh-timeout (:refresh-timeout (:hornetq config))
+   :hornetq.udp/discovery-timeout (:discovery-timeout (:hornetq config))
+   :zookeeper/address (:address (:zookeeper config))
+   :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 workflow {:in-bootstrapped {:inc :out}})
+
+(def illegal-catalog ["not" "a" "catalog"])
+
+(def illegal-input-catalog
+  [{:onyx/name :in-bootstrapped
+    :onyx/type :input
+    :onyx/consumption :concurrent
+    :onyx/bootstrap? true
+    :onyx/batch-size 2}])
+
+(def illegal-output-catalog
+  [{:onyx/name :in-bootstrapped
+    :onyx/type :output
+    :onyx/consumption :concurrent
+    :onyx/bootstrap? true
+    :onyx/batch-size 2}])
+
+(def illegal-function-catalog
+  [{:onyx/name :inc
+    :onyx/type :function
+    :onyx/consumption :concurrent
+    :onyx/batch-size 5}])
+
+(def illegal-dispatch-catalog
+  [{:onyx/name :input
+    :onyx/type :input
+    :onyx/medium :core.async
+    :onyx/consumption :concurrent
+    :onyx/batch-size 5}])
+
+(def illegal-grouper-catalog
+  [{:onyx/name :inc
+    :onyx/type :grouper
+    :onyx/consumption :concurrent
+    :onyx/batch-size 5}])
+
+(def illegal-aggregator-catalog
+  [{:onyx/name :inc
+    :onyx/type :aggregator
+    :onyx/consumption :concurrent
+    :onyx/batch-size 5}])
+
+(def incomplete-catalog
+  [{:onyx/name :in-bootstrapped
+    :onyx/type :input
+    :onyx/medium :onyx-memory-test-plugin
+    :onyx/consumption :concurrent
+    :onyx/bootstrap? true
+    :onyx/batch-size 2}])
+
+(fact (onyx.api/submit-job peer-config {:catalog illegal-catalog :workflow workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin}) => (throws Exception))
+
+(fact (onyx.api/submit-job peer-config {:catalog illegal-input-catalog :workflow workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin}) => (throws Exception))
+
+(fact (onyx.api/submit-job peer-config {:catalog illegal-output-catalog :workflow workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin}) => (throws Exception))
+
+(fact (onyx.api/submit-job peer-config {:catalog illegal-function-catalog :workflow workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin}) => (throws Exception))
+
+(fact (onyx.api/submit-job peer-config {:catalog illegal-dispatch-catalog :workflow workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin}) => (throws Exception))
+
+(fact (onyx.api/submit-job peer-config {:catalog illegal-grouper-catalog :workflow workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin}) => (throws Exception))
+
+(fact (onyx.api/submit-job peer-config {:catalog illegal-aggregator-catalog :workflow workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin}) => (throws Exception))
+
+(fact (onyx.api/submit-job peer-config {:catalog incomplete-catalog :workflow workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin}) => (throws Exception))
+
+(def workflow-tests-catalog
+  [{:onyx/name :in
+    :onyx/type :input
+    :onyx/medium :core.async
+    :onyx/consumption :concurrent
+    :onyx/batch-size 5}
+   {:onyx/name :intermediate
+    :onyx/fn :test-fn
+    :onyx/type :function
+    :onyx/consumption :concurrent
+    :onyx/batch-size 5}
+   {:onyx/name :out
+    :onyx/type :output
+    :onyx/medium :core.async
+    :onyx/consumption :concurrent
+    :onyx/batch-size 5}])
+
+(def illegal-incoming-inputs-workflow
+  [[:intermediate :in]])
+
+(def illegal-outgoing-outputs-workflow
+  [[:out :intermediate]])
+
+(def illegal-edge-nodes-count-workflow
+  [[:in :intermediate]
+   [:intermediate]])
+
+(def illegal-intermediate-nodes-workflow
+  [[:in :intermediate]
+   [:in :out]])
+
+(fact (onyx.api/submit-job peer-config {:catalog workflow-tests-catalog
+                                        :workflow illegal-incoming-inputs-workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin})
+      => (throws Exception))
+
+(fact (onyx.api/submit-job peer-config {:catalog workflow-tests-catalog
+                                        :workflow illegal-outgoing-outputs-workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin})
+      => (throws Exception))
+
+(fact (onyx.api/submit-job peer-config {:catalog workflow-tests-catalog
+                                        :workflow illegal-edge-nodes-count-workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin})
+      => (throws Exception))
+
+(fact (onyx.api/submit-job peer-config {:catalog workflow-tests-catalog
+                                        :workflow illegal-intermediate-nodes-workflow
+                                        :task-scheduler :onyx.task-scheduler/round-robin})
+      => (throws Exception))
+
+(component/stop env)
+
+(fact (unpack-map-workflow {:a :b}) => [[:a :b]])
+(fact (unpack-map-workflow {:a {:b :c}}) => [[:a :b] [:b :c]])
+(fact (unpack-map-workflow {:a {:b {:c :d}}}) => [[:a :b] [:b :c] [:c :d]])
+(fact (unpack-map-workflow {:a {:b :c :d :e}}) => [[:a :b] [:a :d] [:b :c] [:d :e]])
+
+
+(fact (sort (onyx.api/map-set-workflow->workflow {:a #{:b :c}
+                                                  :b #{:d}
+                                                  :c #{:d :e}}))
+      =>
+      (sort [[:a :b]
+             [:a :c]
+             [:b :d]
+             [:c :d]
+             [:c :e]]))
+
+
+(fact (into #{} (unpack-map-workflow {:a {:b :c} :d {:e :f :g :h}}))
+      => #{[:a :b]
+           [:b :c]
+           [:d :e]
+           [:d :g]
+           [:e :f]
+           [:g :h]})
+
+(let [catalog
+      [{:onyx/name :a
+        :onyx/type :input
+        :onyx/medium :hornetq
+        :onyx/consumption :concurrent}
+
+       {:onyx/name :b
+        :onyx/type :input
+        :onyx/consumption :concurrent}
+
+       {:onyx/name :c
+        :onyx/type :function
+        :onyx/consumption :concurrent}
+
+       {:onyx/name :d
+        :onyx/type :function
+        :onyx/consumption :concurrent}
+
+       {:onyx/name :e
+        :onyx/type :function
+        :onyx/consumption :concurrent}
+
+       {:onyx/name :f
+        :onyx/type :function
+        :onyx/consumption :concurrent}
+
+       {:onyx/name :g
+        :onyx/type :output
+        :onyx/medium :hornetq
+        :onyx/consumption :concurrent}]
+      workflow [[:a :f] [:b :c] [:c :d] [:d :e] [:e :f] [:f :g]]
+      tasks (onyx.coordinator.planning/discover-tasks catalog workflow)
+
+      [a b c d e f g :as sorted-tasks]
+      (reduce (fn [all next]
+                (conj all (first (filter #(= (:name %) next) tasks))))
+              [] [:a :b :c :d :e :f :g])]
+
+  (fact "There are 7 tasks"
+        (count tasks) => 7)
+
+  (fact "The tasks are topologically sorted into phases"
+        (map :phase sorted-tasks) => (range 7))
+
+  (fact (:f (:egress-queues a)) => (:a (:ingress-queues f)))
+  (fact (:c (:egress-queues b)) => (:b (:ingress-queues c)))
+  (fact (:d (:egress-queues c)) => (:c (:ingress-queues d)))
+  (fact (:e (:egress-queues d)) => (:d (:ingress-queues e)))
+  (fact (:f (:egress-queues e)) => (:e (:ingress-queues f)))
+  (fact (:g (:egress-queues f)) => (:f (:ingress-queues g)))
+
+  (fact ":a has an ingress queue" (:ingress-queues a) =not=> nil?)
+  (fact ":b has an ingress queue" (:ingress-queues b) =not=> nil?)
+  (fact ":g has an egress queue" (:egress-queues g) =not=> empty?))


Fixin'

Fixin'

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


smaller signup confirm container

smaller signup confirm container

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


Clean up window listener code and make sure it works on OS X

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


Added stub for HTML renderer

Added stub for HTML renderer

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

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


Fix TrashedEntityUpdate schema

Fix TrashedEntityUpdate schema


Make Team role :links optional

Make Team role :links optional


require core as t

require core as t

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


Add extensions.clj for tests of stencil extensions to mustache.

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

--- test/stencil/test/extensions.clj
+++ test/stencil/test/extensions.clj
@@ -0,0 +1,34 @@
+(ns stencil.test.extensions
+  (:use clojure.test
+        stencil.core))
+
+;; Test case to make sure we can run a lambda with the :stencil/pass-context
+;; option in all the places a lambda can be used (escaped interpolation,
+;; unescaped interpolation, and sections).
+
+(deftest extension-pass-context-test
+  ;; This calls an escaped interpolation lambda that returns some
+  ;; mustache code based on the current context.
+  (is (= "things"
+         (render-string "{{lambda}}"
+                        {:stuff "things"
+                         :tag "stuff"
+                         :lambda ^{:stencil/pass-context true}
+                         (fn [ctx] (str "{{" (:tag ctx) "}}"))})))
+  ;; This calls an unescaped interpolation lambda that returns some mustache
+  ;; code based on the current context.
+  (is (= "things"
+         (render-string "{{{lambda}}}"
+                        {:stuff "things"
+                         :tag "stuff"
+                         :lambda ^{:stencil/pass-context true}
+                         (fn [ctx] (str "{{" (:tag ctx) "}}"))})))
+  ;; This calls a section lambda that returns some mustache code based on the
+  ;; current context.
+  (is (= "peanut butter jelly time"
+         (render-string "{{#lambda}}{{thing1}}{{/lambda}} time"
+                        {:thing1 "peanut butter"
+                         :thing2 "jelly"
+                         :new-tag "thing2"
+                         :lambda ^{:stencil/pass-context true}
+                         (fn [src ctx] (str src " {{" (:new-tag ctx) "}}"))}))))


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


Fix test that was working by accident before

Definitely already needed this. Not sure why it was passing before.

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


[P056] Clojure solution

[P056] Clojure solution

My clojure Hello World

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

--- Problem056/Clojure/solution_1.clj
+++ Problem056/Clojure/solution_1.clj
@@ -0,0 +1,15 @@
+;Author: tkovs
+
+(defn exp [x n]
+   (reduce *' (repeat n x)))
+
+(defn sum [x]
+    (apply + (map #(Integer. (str %)) (str x))))
+
+(defn solve []
+    (let [list (range 1 100)
+          numbers (mapcat (fn [x] (map (fn [y] (exp x y)) list)) list)
+          sumDigits (map sum numbers)]
+            (apply max sumDigits) ))
+
+(println (solve))


CMR-2372: Adds a migration to update collection transaction-ids.

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

--- metadata-db-app/src/migrations/030_assign_transaction_ids_to_collections.clj
+++ metadata-db-app/src/migrations/030_assign_transaction_ids_to_collections.clj
@@ -0,0 +1,31 @@
+(ns migrations.030-assign-transaction-ids-to-collections
+  (:require [clojure.java.jdbc :as j]
+            [config.migrate-config :as config]
+            [config.mdb-migrate-helper :as h]))
+
+(defn up
+  "Migrates the database up to version 30."
+  []
+  (println "migrations.030-assign-transaction-ids-to-collections up...")
+  (j/db-do-commands (config/db) false "SET TRANSACTION READ WRITE")
+  ;; Must lock table to avoid new data being written which might get lower transaction-ids
+  (j/db-do-commands (config/db) false "LOCK TABLE small_prov_collections IN EXCLUSIVE MODE")
+  (h/query "SELECT id FROM small_prov_collections ORDER BY concept_id ASC, revision_id ASC FOR UPDATE")
+  (j/db-do-commands (config/db) false "UPDATE small_prov_collections SET transaction_id=GLOBAL_TRANSACTION_ID_SEQ.NEXTVAL")
+  (j/db-do-commands (config/db) false "COMMIT")
+  (doseq [table (h/get-all-concept-tablenames :collection)]
+    (println (str "Updating transaction_id in table " table))
+    (j/db-do-commands (config/db) false "SET TRANSACTION READ WRITE")
+    (j/db-do-commands (config/db) false "LOCK TABLE small_prov_collections IN EXCLUSIVE MODE")
+    (doseq [row (h/query (format "SELECT id FROM %s WHERE 1=1 ORDER BY concept_id ASC, revision_id ASC FOR UPDATE" table))]
+      (j/db-do-commands (config/db) false (format "UPDATE %s SET transaction_id=GLOBAL_TRANSACTION_ID_SEQ.NEXTVAL WHERE id=%d" table (long (:id row)))))
+   (j/db-do-commands (config/db) false "COMMIT")))
+
+
+(defn down
+  "Migrates the database down from version 30."
+  []
+  (println "migrations.030-assign-transaction-ids-to-collections down...")
+  (doseq [table (h/get-all-concept-tablenames :collection)]
+    (h/sql (format "UPDATE %s SET transaction_id=0" table)))
+  (h/sql "UPDATE small_prov_collections SET transaction_id=0"))


Most evil parser

Most evil parser


Command line option parsing

Command line option parsing

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


Test the GETs with bodies actually get the body

--- test/clj_http/test/core.clj
+++ test/clj_http/test/core.clj
@@ -37,7 +37,7 @@
     [:post "/multipart"]
     {:status 200 :body (:body req)}
     [:get "/get-with-body"]
-    {:status 200 :body "get-with-body"}))
+    {:status 200 :body (:body req)}))

 (defn run-server
   []
@@ -194,7 +194,8 @@
   (let [resp (client/get "http://localhost:18080/redirect"
                {:max-redirects 2 :throw-exceptions false})]
     (is (= 302 (:status resp)))
-    (is (= (apply vector (repeat 3 "http://localhost:18080/redirect")) (:trace-redirects resp))))
+    (is (= (apply vector (repeat 3 "http://localhost:18080/redirect"))
+           (:trace-redirects resp))))
   (is (thrown-with-msg? Exception #"Too many redirects: 3"
         (client/get "http://localhost:18080/redirect"
                     {:max-redirects 2 :throw-exceptions true}))))
@@ -203,4 +204,5 @@
   (run-server)
   (let [resp (request {:request-method :get :uri "/get-with-body"
                        :body (.getBytes "foo bar")})]
-    (is (= 200 (:status resp)))))
+    (is (= 200 (:status resp)))
+    (is (= "foo bar" (String. (:body resp))))))


Minor refactoring for Advent of Code day 1

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


Sample base

Sample base

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


Matt's solution

Matt's solution

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

--- src/main/clj/clojure_club/x113_making_data_dance/mgrimm.clj
+++ src/main/clj/clojure_club/x113_making_data_dance/mgrimm.clj
@@ -0,0 +1,18 @@
+(ns clojure-club.x113-making-data-dance.mgrimm
+  (:require [clojure.string :as s]))
+
+(defn dance [& xs]
+  (reify
+    clojure.lang.Seqable
+    (toString [_] (s/join ", " (sort xs)))
+    (seq [_] (when xs (distinct xs)))))
+
+;; -----------------------------------------------------------------------------
+
+(assert (= "1, 2, 3" (str (dance 2 1 3))))
+(assert (= '(2 1 3) (seq (dance 2 1 3))))
+(assert (= '(2 1 3) (seq (dance 2 1 3 3 1 2))))
+(assert (= '(1) (seq (apply dance (repeat 5 1)))))
+(assert (= "1, 1, 1, 1, 1" (str (apply dance (repeat 5 1)))))
+(assert (and (= nil (seq (dance)))
+             (= "" (str (dance)))))


Add in-browser storage.

Add in-browser storage.

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

--- src/cljs/nonojure/storage.cljs
+++ src/cljs/nonojure/storage.cljs
@@ -0,0 +1,69 @@
+(ns nonojure.storage
+  (:require [jayq.util :refer [log]]))
+
+(defprotocol Storage
+  (load-progress [this])
+  (load-progress-for-puzzle [this id])
+  (save-auto! [this id progress])
+  (save-manual! [this id progress])
+  (solved! [this id solution]))
+
+(defn to-str [data]
+  (.stringify js/JSON (clj->js data)))
+
+(defn from-str [str]
+  (js->clj (.parse js/JSON str) :keywordize-keys true))
+
+(defn get-item [storage key]
+  (from-str (.getItem storage key)))
+
+(defn set-item [storage key data]
+  (.setItem storage key (to-str data)))
+
+(defn- update-progress [storage id progress status]
+  (let [all (or (get-item storage "progressAll") {})]
+    (set-item storage "progressAll" (assoc all id status)))
+  (set-item storage id
+            (if-let [existing (get-item storage  id)]
+              (merge existing progress)
+              progress)))
+
+(extend-protocol Storage
+  js/Storage
+  (load-progress [this]
+    (get-item this "progressAll"))
+  (load-progress-for-puzzle [this id]
+    (get-item this id))
+  (save-auto! [this id progress]
+    (update-progress this id {:auto progress} :in-progress))
+  (save-manual! [this id progress]
+    (update-progress this id {:manual progress} :in-progress))
+  (solved! [this id solution]
+    (update-progress this id {:solution solution} :solved)))
+
+(defn ^:export init []
+  (let [log #(log (clj->js %))
+        storage window/localStorage]
+    (log (load-progress storage))
+
+    (log "Save auto mar")
+    (save-auto! storage "mar" {:left [[1] [2]] :top [[1]]})
+    (log (load-progress storage))
+    (log (load-progress-for-puzzle storage "mar"))
+
+    (log "Save auto asf")
+    (save-auto! storage "asf" {:left [[1] [2]] :top [[1]]})
+    (log (load-progress storage))
+    (log (load-progress-for-puzzle storage "asf"))
+
+    (log "Save manual mar")
+    (save-manual! storage "mar" {:left [[1] [2]] :top [[1]]})
+    (log (load-progress storage))
+    (log (load-progress-for-puzzle storage "mar"))
+
+    (log "Solving asf")
+    (solved! storage "asf" {:left [] :right []})
+    (log (load-progress storage))
+    (log (load-progress-for-puzzle storage "asf"))
+
+    ))


update dox

update dox

--- src/metabase/util/password.clj
+++ src/metabase/util/password.clj
@@ -3,7 +3,12 @@
             [metabase.config :as config]))

-(defn- count-occurrences [password]
+(defn- count-occurrences
+  "Return a map of the counts of each class of character for PASSWORD.
+
+    (count-occurrences \"GoodPw!!\")
+      -> {:total  8, :lower 4, :upper 2, :letter 6, :digit 0, :special 2}"
+  [password]
   (loop [[^Character c & more] password, {:keys [total, lower, upper, letter, digit, special], :as counts} {:total 0, :lower 0, :upper 0, :letter 0, :digit 0, :special 0}]
     (if-not c counts
             (recur more (merge (update counts :total inc)
@@ -14,7 +19,7 @@
                                  :else                     {:special (inc special)}))))))

 (def ^:private ^:const complexity->char-type->min
-  "Minimum number of characters of each type a password must have to satisfy a given password complexity."
+  "Minimum counts of each class of character a password should have for a given password complexity level."
   {:weak   {:total   6} ; total here effectively means the same thing as a minimum password length
    :normal {:total   6
             :digit   1}
@@ -24,11 +29,18 @@
             :digit   1
             :special 1}})

-(defn- password-has-char-counts? [char-type->min password]
+(defn- password-has-char-counts?
+  "Check that PASSWORD satisfies the minimum count requirements for each character class.
+
+    (password-has-char-counts? {:total 6, :lower 1, :upper 1, :digit 1, :special 1} \"abc\")
+      -> false
+    (password-has-char-counts? {:total 6, :lower 1, :upper 1, :digit 1, :special 1} \"passworD1!\")
+      -> true"
+  [char-type->min password]
   {:pre [(map? char-type->min)
          (string? password)]}
-  (boolean (let [occurances (count-occurrences password)]
-             (loop [[[char-type min-count] & more] (seq char-type->min)]
+  (let [occurances (count-occurrences password)]
+    (boolean (loop [[[char-type min-count] & more] (seq char-type->min)]
                (if-not char-type
                  true
                  (when (>= (occurances char-type) min-count)


Fix retry-handler to be added in correct place

All non-integration tests pass now! \o/

--- src/clj_http/core2.clj
+++ src/clj_http/core2.clj
@@ -60,10 +60,20 @@
     nil (DefaultRedirectStrategy/INSTANCE)
     (DefaultRedirectStrategy/INSTANCE)))

-(defn http-client [conn-mgr redirect-strategy]
+(defn add-retry-handler [builder handler]
+  (when handler
+    (.setRetryHandler
+     builder
+     (proxy [HttpRequestRetryHandler] []
+       (retryRequest [e cnt context]
+         (handler e cnt context)))))
+  builder)
+
+(defn http-client [conn-mgr redirect-strategy retry-handler]
   (-> (HttpClients/custom)
       (.setConnectionManager conn-mgr)
       (.setRedirectStrategy (get-redirect-strategy redirect-strategy))
+      (add-retry-handler retry-handler)
       (.build)))

 (defn http-get []
@@ -154,18 +164,15 @@
                                           (.setConnectTimeout (or conn-timeout -1))
                                           (.setSocketTimeout (or socket-timeout -1))
                                           (.build))
-        ^CloseableHttpClient client (http-client conn-mgr redirect-strategy)
+        ^CloseableHttpClient client (http-client conn-mgr
+                                                 redirect-strategy
+                                                 retry-handler)
         ^HttpClientContext context (http-context request-config)
         ^HttpRequest http-req (http-request-for request-method http-url body)]
     (when-not (conn/reusable? conn-mgr)
       (.addHeader http-req "Connection" "close"))
     (when cookie-store
       (.setCookieStore context cookie-store))
-    (when retry-handler
-      (.setRetryHandler client
-                        (proxy [HttpRequestRetryHandler] []
-                          (retryRequest [e cnt context]
-                            (retry-handler e cnt context)))))
     (if multipart
       (.setEntity ^HttpEntityEnclosingRequest http-req
                   (mp/create-multipart-entity multipart))


remove debug logs

remove debug logs

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/wilkerlucio/youtube-looper.git/'


Don't run find function when shift is pressed


And put the hdate parsing back in too.

And put the hdate parsing back in too.

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


Clean up clojars.scp namespace.

Clean up clojars.scp namespace.

--- src/clojars/scp.clj
+++ src/clojars/scp.clj
@@ -3,8 +3,8 @@
                     FileOutputStream)
            com.martiansoftware.nailgun.NGContext)
   (:use [clojars.config :only [config]])
-  (:require [clojars.maven   :as maven]
-            [clojars.db      :as db])
+  (:require [clojars.maven :as maven]
+            [clojars.db :as db])
   (:gen-class
    :methods [#^{:static true}
              [nailMain [com.martiansoftware.nailgun.NGContext] void]]))
@@ -12,8 +12,6 @@
 (def *max-line-size* 4096)
 (def *max-file-size* 20485760)
 (def *allowed-suffixes* #{"pom" "xml" "jar" "sha1" "md5"})
-
-(set! *warn-on-reflection* true)

 (defn safe-read-line
   ([#^InputStream stream #^StringBuilder builder]
@@ -67,8 +65,7 @@
       (.deleteOnExit f)
       (send-okay ctx)
       (with-open [fos (FileOutputStream. f)]
-        (let [bytes (copy-limit (.in ctx) fos
-                                size)]
+        (let [bytes (copy-limit (.in ctx) fos size)]
           (if (>= bytes size)
             {:name (.getName fn), :file f, :size size, :suffix suffix
              :mode mode}
@@ -86,8 +83,8 @@
 (defn jar-names
   "Construct a few possible name variations a jar might have."
   [jarmap]
-  [ (str (:name jarmap) "-" (:version jarmap) ".jar")
-    (str (:name jarmap) ".jar")])
+  [(str (:name jarmap) "-" (:version jarmap) ".jar")
+   (str (:name jarmap) ".jar")])

 (defn finish-deploy [#^NGContext ctx, files]
   (let [account (first (.getArgs ctx))
@@ -104,10 +101,10 @@
         (do
           (.println *err* (str "\nDeploying " (:group jarmap) "/"
                                (:name jarmap) " " (:version jarmap)))
-          (db/add-jar (first (.getArgs ctx)) jarmap true)
+          (db/add-jar account jarmap true)
           (maven/deploy-model jarfile model
                               (str "file://" (:repo config)))
-          (db/add-jar (first (.getArgs ctx)) jarmap))
+          (db/add-jar account jarmap))
         (throw (Exception. (str "You need to give me one of: " names)))))
     (.println *err* (str "\nSuccess! Your jars are now available from "
                          "http://clojars.org/"))
@@ -139,9 +136,10 @@
          (let [cmd (.read in)]
            (if (= -1 cmd)
              (finish-deploy ctx files)
-             (let [cmd (char cmd)]
+             (let [cmd (char cmd)]
+               ;; TODO: use core.match
                (condp = cmd
-                   (char 0)      (do (recur files false))
+                   (char 0)      (recur files false)
                    \C            (recur (conj files (scp-copy ctx)) true)
                    \D            (do (safe-read-line in) (recur files true))
                    \T            (do (safe-read-line in) (recur files true))
@@ -150,7 +148,7 @@
                                              (int cmd) "'")))))))))

      (catch Throwable t
-                                        ;(.printStackTrace t *err*)
+       ;; (.printStackTrace t *err*)
        (.println (.err ctx) (str "Error: " (.getMessage t)))
        (.flush (.err ctx))
        (throw t))


Accept signatures over scp upload.

Accept signatures over scp upload.

--- src/clojars/scp.clj
+++ src/clojars/scp.clj
@@ -12,7 +12,7 @@

 (def max-line-size 4096)
 (def max-file-size 20485760)
-(def allowed-suffixes #{"pom" "xml" "jar" "sha1" "md5"})
+(def allowed-suffixes #{"pom" "xml" "jar" "sha1" "md5" "asc"})

 (defn safe-read-line
   ([#^InputStream stream #^StringBuilder builder]


revert accidental indentation change

revert accidental indentation change

--- src/metabase/driver.clj
+++ src/metabase/driver.clj
@@ -79,10 +79,10 @@

   Possible caller-options include:

-  :executed_by [int]               (user_id of caller)
-  :saved_query [{}]                (dictionary representing Query model)
-  :synchronously [true|false]      (default true)
-  :cache_result [true|false]       (default false)"
+    :executed_by [int]               (user_id of caller)
+    :saved_query [{}]                (dictionary representing Query model)
+    :synchronously [true|false]      (default true)
+    :cache_result [true|false]       (default false)"
   {:arglists '([query caller-options])}
   [query {:keys [executed_by synchronously saved_query]
           :or {synchronously true}


blind: added tests

blind: added tests

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

--- test/blind/core.clj
+++ test/blind/core.clj
@@ -0,0 +1,133 @@
+(ns blind.core
+  (:refer-clojure :exclude [read-string])
+  (:require [blind.reader :refer [read-string]]
+            [clojure.test :refer [deftest is]]))
+
+(deftest read-integer
+  (is (== 42 (read-string "42")))
+  (is (== +42 (read-string "+42")))
+  (is (== -42 (read-string "-42")))
+
+  (is (== 42 (read-string "42N")))
+  (is (== +42 (read-string "+42N")))
+  (is (== -42 (read-string "-42N")))
+
+  (is (== 0 (read-string "0")))
+  (is (== 0N (read-string "0N")))
+
+  (is (== 042 (read-string "042")))
+  (is (== +042 (read-string "+042")))
+  (is (== -042 (read-string "-042")))
+
+  (is (== 0x42e (read-string "0x42e")))
+  (is (== +0x42e (read-string "+0x42e")))
+  (is (== -0x42e (read-string "-0x42e"))))
+
+(deftest read-floating
+  (is (== 42.23 (read-string "42.23")))
+  (is (== +42.23 (read-string "+42.23")))
+  (is (== -42.23 (read-string "-42.23")))
+
+  (is (== 42.23M (read-string "42.23M")))
+  (is (== +42.23M (read-string "+42.23M")))
+  (is (== -42.23M (read-string "-42.23M")))
+
+  (is (== 42.2e3 (read-string "42.2e3")))
+  (is (== +42.2e+3 (read-string "+42.2e+3")))
+  (is (== -42.2e-3 (read-string "-42.2e-3")))
+
+  (is (== 42.2e3M (read-string "42.2e3M")))
+  (is (== +42.2e+3M (read-string "+42.2e+3M")))
+  (is (== -42.2e-3M (read-string "-42.2e-3M"))))
+
+(deftest read-ratio
+  (is (== 4/2 (read-string "4/2")))
+  (is (== +4/2 (read-string "+4/2")))
+  (is (== -4/2 (read-string "-4/2"))))
+
+(deftest read-keyword
+  (is (= :foo-bar (read-string ":foo-bar")))
+  (is (= :foo/bar (read-string ":foo/bar")))
+  (is (= :user/foo-bar (read-string "::foo-bar")))
+  (is (= :clojure.core/foo-bar
+         (do (alias 'core 'clojure.core)
+             (read-string "::core/foo-bar")))))
+
+(deftest read-symbol
+  (is (= 'foo (read-string "foo")))
+  (is (= 'foo/bar (read-string "foo/bar")))
+  (is (= "foo//" (str (read-string "foo//")))) ;; the clojure reader can't read this
+  (is (= (str 'NaN) (str (read-string "NaN")))) ;; the clojure reader can't read this
+  (is (= Double/POSITIVE_INFINITY (read-string "Infinity"))) ;; the clojure reader can't read this
+  (is (= Double/POSITIVE_INFINITY (read-string "+Infinity"))) ;; the clojure reader can't read this
+  (is (= Double/NEGATIVE_INFINITY (read-string "-Infinity")))) ;; the clojure reader can't read this
+
+(deftest read-char
+  (is (= \f (read-string "\\f")))
+  (is (= \u0194 (read-string "\\u0194")))
+  (is (= \a (read-string "\\x61"))) ;; the clojure reader can't read this
+  (is (= \o123 (read-string "\\o123")))
+  (is (= \newline (read-string "\\newline"))))
+
+(deftest read-string*
+  (is (= "foo bar" (read-string "\"foo bar\"")))
+  (is (= "foo\\bar" (read-string "\"foo\\\\bar\"")))
+  (is (= "foo\000bar" (read-string "\"foo\\000bar\"")))
+  (is (= "foo\u0194bar" (read-string "\"foo\\u0194bar\"")))
+  (is (= "fooabar" (read-string "\"foo\\x61bar\""))) ;; the clojure reader can't read this
+  (is (= "foo\123bar" (read-string "\"foo\\123bar\""))))
+
+(deftest read-regex
+  (is (= (str #"\[\]?(\")\\")
+         (str (read-string "#\"\\[\\]?(\\\")\\\\\"")))))
+
+(deftest read-list
+  (is (= '() (read-string "()")))
+  (is (= '(foo bar) (read-string "(foo bar)")))
+  (is (= '(foo (bar) baz) (read-string "(foo (bar) baz)"))))
+
+(deftest read-vector
+  (is (= '[] (read-string "[]")))
+  (is (= '[foo bar] (read-string "[foo bar]")))
+  (is (= '[foo [bar] baz] (read-string "[foo [bar] baz]"))))
+
+(deftest read-map
+  (is (= '{} (read-string "{}")))
+  (is (= '{foo bar} (read-string "{foo bar}")))
+  (is (= '{foo {bar baz}} (read-string "{foo {bar baz}}"))))
+
+(deftest read-set
+  (is (= '#{} (read-string "#{}")))
+  (is (= '#{foo bar} (read-string "#{foo bar}")))
+  (is (= '#{foo #{bar} baz} (read-string "#{foo #{bar} baz}"))))
+
+(deftest read-metadata
+  (is (= {:foo true} (meta (read-string "^:foo 'bar"))))
+  (is (= {:foo 'bar} (meta (read-string "^{:foo bar} 'baz"))))
+  (is (= {:tag "foo"} (meta (read-string "^\"foo\" 'bar"))))
+  (is (= {:tag 'String} (meta (read-string "^String 'x")))))
+
+(deftest read-quote
+  (is (= ''foo (read-string "'foo"))))
+
+(deftest read-syntax-quote
+  (is (= '`user/foo (read-string "`foo")))
+  (is (= '`+ (read-string "`+")))
+  (is (= '`foo/bar (read-string "`foo/bar")))
+  (is (= '`1 (read-string "`1")))
+  (is (= '`(1 (~2 ~@(3))) (read-string "`(1 (~2 ~@(3)))"))))
+
+(deftest read-deref
+  (is (= '@foo (read-string "@foo"))))
+
+(deftest read-var
+  (is (= '(var foo) (read-string "#'foo"))))
+
+(deftest read-fn
+  (is (= '(fn* [] (foo bar baz)) (read-string "#(foo bar baz)"))))
+
+(deftest read-arg
+  (is (= 14 ((eval (read-string "#(apply + % %1 %3 %&)")) 1 2 3 4 5))))
+
+(deftest read-eval
+  (is (= 3 (read-string "#=(+ 1 2)"))))


Switch to release version of Clojure 1.6.

--- project.clj
+++ project.clj
@@ -9,7 +9,7 @@
   :source-paths ["src/clojure"]
   :java-source-paths ["src/java"]
   :javac-options ["-target" "1.6" "-source" "1.6"]
-  :dependencies [[org.clojure/clojure "1.5.1"]
+  :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.apache.avro/avro "1.7.5"]
                  [cheshire/cheshire "5.2.0"]]
   :plugins [[codox/codox "0.6.4"]]
@@ -23,4 +23,4 @@
              :clojure-1-5 {:dependencies
                            [[org.clojure/clojure "1.5.1"]]}
              :clojure-1-6 {:dependencies
-                           [[org.clojure/clojure "1.6.0-alpha3"]]}})
+                           [[org.clojure/clojure "1.6.0"]]}})


Upgrade to latest newrelic-agent

Upgrade to latest newrelic-agent

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


[WM] Revert back to kehaar 0.5.0

[WM] Revert back to kehaar 0.5.0

NewRelic transactions didn't show up for some reason.

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


Bump version to 0.8.6-SNAPSHOT.

Bump version to 0.8.6-SNAPSHOT.

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


Removed deprecated gem.

Removed deprecated gem.

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


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


Include Immutant dependency and plugin

Include Immutant dependency and plugin

Immutant/WildFly deployment is as simple as:

> lein immutant war -o /path/to/wildlfy

OR

> lein immutant war
> cp target/path-to-war.war /path/to/wildfly/standalone/deployments

I ran both of these and confirmed that they ran.

Documentation:

http://immutant.org/documentation/2.0.0-beta2/apidoc/guide-wildfly.html
http://immutant.org/documentation/2.0.0-beta2/apidoc/guide-installation.html

The org.immutant/immutant dependency is required to build the war.

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


project: add "min" profile to compile a minified JS

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


Working on slope-one algorithm

Working on slope-one algorithm

Making function to produce
a mathematical model from the data to use for slope one algorithm,
basicly finds the differences between
the ratings of all the items in the model

error: pathspec 'src/blog/routes/slope-one.clj' did not match any file(s) known to git

--- src/blog/routes/slope-one.clj
+++ src/blog/routes/slope-one.clj
@@ -0,0 +1,42 @@
+(ns blog.routes.slope-one)
+(use 'blog.models.formatted-data)
+(use 'blog.routes.helper)
+
+(defn slope-one
+  "function to produce
+   a mathematical model from the data to use for slope one algorithm,
+    basicly finds the differences between
+   the ratings of all the items in the model using the for macro"
+  [data]
+  (let [diff-map (for [[user preferences] data]
+                   (for [[i u-i] preferences
+                         [j u-j] preferences
+                         :when (and (not= i j)
+                                    u-i u-j)]
+                     [[i j] (- u-i u-j)]))
+        diff-vec (flat-vec diff-map)
+        update-fn (fn [[freqs-so-far diffs-so-far]
+                       [item-pair diff]]
+                    [(update-in
+                      "replace the value of a key
+                       in a map"
+                        freqs-so-far
+                        item-pair (fnil inc 0))
+                     (update-in diffs-so-far
+                                item-pair (fnil + 0) diff)])
+        [freqs
+         total-diffs] (reduce update-fn
+                              [{} {}] diff-vec)
+        differences (map-nested-vals
+                     (fn [item-pair diff]
+                       (/ diff (get-in freqs item-pair)))
+                     total-diffs)]
+    {:freqs freqs
+     :differences differences}))
+
+
+
+
+
+
+


introduce methods for other http verbs in core-utility

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


Update clojure profile plugins

Update clojure profile plugins

Removed test-refresh and redl

Added ancient and marginalia

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


[WM JE] catch S3, SQS, and file deletion exceptions separately

This allows better error messages when something goes wrong. But I hate the nesting (specifically how the relevant catch is pushed farther from its try). Does anyone know of a better 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/democracyworks/s3-ftp.git/'


[NH] Allow setting transfer mode (ascii/binary).


Show how to page through search results up to a limit

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

--- test/layzee/integration/paging_search_examples.clj
+++ test/layzee/integration/paging_search_examples.clj
@@ -0,0 +1,17 @@
+(ns layzee.integration.paging-search-examples
+  (:use midje.sweet)
+  (:require [clojure.test :refer :all]
+            [clojure.data.json :as json :refer [write-str]]
+            [layzee.adapters.settings :refer :all :as settings]
+            [layzee.adapters.twitter.api :as api]
+            [layzee.adapters.twitter.search :as search]
+            [layzee.adapters.twitter.replies :as replies]
+            [layzee.adapters.logging :refer :all]))
+
+(facts "How to collect search results in pages"
+       (fact "for example, searching for mentions in small pages"
+             (let [search-results (search/by-keyword settings/twitter-bearer-token "@iamkey" {:count 20 :page-size 5})]
+               (println search-results)
+               (count search-results) => 20)
+             )
+       )


refactor prompt time, extract time->seconds function out


initial spike to develop user api

initial spike to develop user api

error: pathspec 'src/credo/api/spike/adherence.clj' did not match any file(s) known to git

--- src/credo/api/spike/adherence.clj
+++ src/credo/api/spike/adherence.clj
@@ -0,0 +1,22 @@
+(ns credo.api.spike.adherence
+  (:require [datomic.api :as d]
+            [credo.api.database.init :as init :refer [conn]]))
+
+;;user api
+
+;;given a user id, return all info about user, challenges, invites etc.
+
+(defn user [id]
+  (d/pull (d/db conn) '[* {:person/adherence
+                           [{:adherence.header/challenge  [:challenge/id :challenge/startDate]}]}] id))
+
+(defn invites [id]
+  (d/pull-many (d/db conn) '[*]
+               (flatten
+                (seq
+                 (d/q '[:find ?e :in $ ?id :where [?e :invite/challengee ?id]] (d/db conn) id)))))
+
+
+
+(defn full [id]
+  {:user (user id) :invites (invites id)})


[WM] sort existing electorates by election date

I didn't notice the 2 separate code paths before. Now they should always
be sorted by election date whether they are existing or new.

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 toppers diagram

Add toppers diagram

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

--- src/clj_simple_chart/bp/bp_toppers.clj
+++ src/clj_simple_chart/bp/bp_toppers.clj
@@ -0,0 +1,145 @@
+(ns clj-simple-chart.bp.bp-toppers
+  (:require [clj-simple-chart.bp.bpdata :as bpdata]
+            [clj-simple-chart.core :refer :all]
+            [clj-simple-chart.opentype :as opentype]
+            [clj-simple-chart.translate :refer :all]
+            [clj-simple-chart.axis.core :as axis]
+            [clj-simple-chart.rect :as rect]
+            [clj-simple-chart.chart :as chart]
+            [clojure.test :as test]))
+
+(def translate-countries {"Russian Federation" "Russia"
+                          "Total Middle East" "Middle East"
+                          "Total Africa" "Africa"
+                          "Total Asia-Pacific" "Asia-Pacific"})
+
+(def remove-countries ["Total North America"])
+
+(def resource-to-fill {:coal             "gray"
+                       :oil              "rgb(24, 116, 24)"
+                       :gas              "rgb(254, 24, 24)"
+                       :nuclear          "cyan"
+                       :hydro            "rgb(51, 102, 255)"
+                       :other_renewables "darkorange"})
+
+(def resource-to-name {:coal             "Coal"
+                       :oil              "Oil"
+                       :gas              "Gas"
+                       :nuclear          "Nuclear"
+                       :hydro            "Hydro"
+                       :other_renewables "Other renewables"})
+
+(def per-capita-properties [:coal :oil :gas :nuclear :hydro :other_renewables])
+(def one-million 1000000)
+
+(def data (->> bpdata/data
+               (filter #(= "2016" (:year %)))
+               (mapv #(update % :country (fn [c] (get translate-countries c c))))
+               (remove #(some #{(:country %)} remove-countries))
+               (mapv #(assoc % :total (reduce + 0 (mapv (fn [x] (get % x)) per-capita-properties))))
+               (mapv (fn [x] (reduce (fn [o [k v]]
+                                       (if (some #{k} (conj per-capita-properties :total))
+                                         (assoc o k (/ (* one-million v) (:population x)))
+                                         (assoc o k v))) {} x)))
+               (sort-by :total)
+               (take-last 10)
+               ))
+
+;(test/is (= (count select-countries) (count data)))
+
+(def marg 10)
+(def two-marg (* 2 marg))
+
+; https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
+; iPhone 4, 4s
+(def svg-width 320)
+(def svg-height 480)
+
+(def available-width (- svg-width two-marg))
+
+(def domain (mapv :country data))
+
+(def header (opentype/stack
+              {}
+              [{:text "Primary Energy Consumption" :font "Roboto Black" :font-size 22}
+               ;{:text "Selected nations and groups of nations" :font "Roboto Bold" :font-size 16}
+               {:text "Tonnes of oil equivalents per capita per year" :font-size 14
+                :margin-bottom 0}]))
+
+(def footer (opentype/stack
+              {:width available-width}
+              [{:margin-top 10 :text "Sources: BP (2017), World Bank (2016)" :font "Roboto Regular" :font-size 14}
+               {:text "Diagram © Refsdal.Ivar@gmail.com" :font "Roboto Regular" :font-size 14}
+               ]))
+
+(def available-height (- svg-height (+ two-marg
+                                       (:height (meta header))
+                                       (:height (meta footer)))))
+
+(def xx {:type        :linear
+         :axis        :x
+         :orientation :top
+         :ticks       5
+         :domain      [0 25]})
+
+(def yy {:type          :ordinal
+         :axis          :y
+         :domain        domain
+         :sub-domain    per-capita-properties
+         :orientation   :left
+         :round         true
+         :padding-inner 0.4
+         :padding-outer 0.3})
+
+(def c (chart/chart {:width  available-width
+                     :height available-height
+                     :x      xx
+                     :y      yy}))
+(def x (:x c))
+(def y (:y c))
+
+(def legend (opentype/stack
+              {:width (:plot-width c)}
+              (mapv (fn [resource]
+                      {:align :right
+                       :fill  (get resource-to-fill resource)
+                       :text  (get resource-to-name resource)}) per-capita-properties)))
+
+(def rect (rect/scaled-rect x y))
+
+(defn make-rect [{country :country
+                  coal    :coal
+                  total   :total
+                  :as     item}]
+  #_(mapv (fn [resource]
+            {:p    country
+             :h    (get item resource)
+             :c    resource
+             :fill (get resource-to-fill resource)})
+          per-capita-properties)
+  {:p country :h total :fill "steelblue"})
+
+(defn total-text [{country :country
+                   total   :total}]
+  (opentype/text {:x  (point x total)
+                  :dx ".20em"
+                  :y  (center-point y country)
+                  :dy ".32em"}
+                 (format "%.1f" total)))
+
+(defn diagram []
+  [:svg {:xmlns "http://www.w3.org/2000/svg" :width svg-width :height svg-height}
+   [:g {:transform (translate marg marg)}
+    header
+    [:g {:transform (translate (:margin-left c) (+ (:height (meta header)) (:margin-top c)))}
+     (rect (mapv make-rect data))
+     (map total-text data)
+     (axis/render-axis y)
+     (axis/render-axis x)
+     [:g {:transform (translate-y (- (:plot-height c) (:height (meta legend))))}
+      #_legend]]
+    [:g {:transform (translate-y (+ (:height (meta header)) available-height))} footer]
+    ]])
+
+(defn render-self []
+  (render "./img/energy-per-capita-top.svg" "./img/energy-per-capita-top.png" (diagram)))


[TH] use consistent naming

[TH] use consistent naming

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


Adding a small example implementation of Steve Reich's, Piano Phase.

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

--- examples/piano_phase.clj
+++ examples/piano_phase.clj
@@ -0,0 +1,18 @@
+(ns examples.piano-phase
+  (:use overtone.live
+        overtone.inst.sampled-piano))
+
+(def piece [:E4 :F#4 :B4 :C#5 :D5 :F#4 :E4 :C#5 :B4 :F#4 :D5 :C#5])
+
+(defn player
+  [metro beat notes]
+  (let [n     (first notes)
+        notes (next notes)
+        b     (inc beat)]
+    (when n
+      (at (metro beat)
+          (sampled-piano (note n)))
+      (apply-at (metro b) #'player [metro b (next notes)]))))
+
+(def m (metronome 140))
+(player m (m) piece)


added p27.clj

added p27.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/drcabana/euler-fp.git/'


added delete operation for users

added delete operation for users

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


Working on 0104...

Working on 0104...

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

--- src/project_euler/problem_0104.clj
+++ src/project_euler/problem_0104.clj
@@ -0,0 +1,60 @@
+(ns project-euler.problem-0104)
+
+;; The Fibonacci sequence is defined by the recurrence relation:
+
+;; Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.
+;; It turns out that F541, which contains 113 digits,
+;; is the first Fibonacci number for which the last nine digits are 1-9 pandigital
+;; (contain all the digits 1 to 9, but not necessarily in order).
+;; And F2749, which contains 575 digits,
+;; is the first Fibonacci number for which the first nine digits are 1-9 pandigital.
+
+;; Given that Fk is the first Fibonacci number for which the first nine digits
+;; AND the last nine digits are 1-9 pandigital, find k.
+
+(defn lz-digits [x]
+  (lazy-seq
+   (let [d  (rem x 10)
+         x' (quot x 10)]
+     (if (zero? x')
+       [d]
+       (cons d (lz-digits x'))))))
+
+(defn lz-fibo-seq []
+  (iterate
+   (fn [[f-0 f-1 n]]
+     [(+' f-0 f-1) f-0 (inc n)])
+   [1 1 2]
+   ))
+
+(def the-digits-1-to-9 (set (range 1 10)))
+
+(def phi (/ (+ (Math/sqrt 5) 1) 2))
+(def log-phi (Math/log10 phi))
+
+(def sqrt5 (Math/sqrt 5))
+(def log-sqrt5 (Math/log10 sqrt5))
+
+(defn solution []
+  (->> (iterate inc 1)
+       (map (fn [n]
+                 (-> (- (* log-phi n) log-sqrt5)
+                     (#(+ 10 (- % (int %))))
+                     (Math/pow 10)
+                     )))
+       (take 10)
+       ))
+
+
+;; (defn solution []
+;;   (->> (lz-fibo-seq)
+;;        (filter (fn [[f _ n]]
+;;                  (let [ds (lz-digits f)]
+;;                    (and (= the-digits-1-to-9
+;;                            (set (take 9 ds)))
+;;                         (= the-digits-1-to-9
+;;                            (set (take-last 9 ds))))
+;;                    )))
+;;        (first)
+;;        (last)
+;;        ))


Problem 0122.

Problem 0122.

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

--- src/project_euler/problem_0122.clj
+++ src/project_euler/problem_0122.clj
@@ -0,0 +1,62 @@
+(ns project-euler.problem_0122
+  (:require [clojure.set :as set])
+  (:require [clojure.math.combinatorics :as combo]))
+
+;; The most naive way of computing n15 requires fourteen multiplications:
+
+;; n × n × ... × n = n^15
+
+;; But using a "binary" method you can compute it in six multiplications:
+
+;; n × n = n^2
+;; n^2 × n^2 = n^4
+;; n^4 × n^4 = n^8
+;; n^8 × n^4 = n^12
+;; n^12 × n^2 = n^14
+;; n^14 × n = n^15
+
+;; However it is yet possible to compute it in only five multiplications:
+
+;; n × n = n^2
+;; n^2 × n = n^3
+;; n^3 × n^3 = n^6
+;; n^6 × n^6 = n^12
+;; n^12 × n^3 = n^15
+
+;; We shall define m(k) to be the minimum number of multiplications to compute n^k;
+;; for example m(15) = 5.
+
+;; For 1 ≤ k ≤ 200, find ∑ m(k).
+
+
+(def intermediate-steps
+  (memoize
+   (fn [k]
+     (if (== 1 k)
+       [0 [#{}]]
+       (->> (range 1 (inc (quot k 2)))
+            (mapcat (fn [a]
+                      (let [[s1 pss1] (intermediate-steps a)
+                            [s2 pss2] (intermediate-steps (- k a))]
+                        (->> (combo/cartesian-product pss1 pss2)
+                             (map (fn [[ps1 ps2]] (set/union ps1 ps2 #{k})))
+                             ))))
+            (reduce
+             (fn [[best-score best-paths] path]
+               (let [s (count path)]
+                 (cond (> s best-score) [best-score best-paths]
+                       (< s best-score) [s          [path]]
+                       :else            [best-score (conj best-paths path)]
+                       )))
+             [1000 nil])
+            )))))
+
+;; Very slow !!!!
+(defn solution []
+  (->> (range 1 201)
+       (map intermediate-steps)
+       (map first)
+       (reduce +)))
+
+;;-> 1582
+


Adding port to base url

Adding port to base 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/B2W-BIT/restQL-server.git/'


Add missing file

Add missing file

error: pathspec 'src/circle/web/middleware/logging.clj' did not match any file(s) known to git

--- src/circle/web/middleware/logging.clj
+++ src/circle/web/middleware/logging.clj
@@ -0,0 +1,8 @@
+(ns circle.web.middleware.logging
+  (:use [clojure.tools.logging :only (infof)]))
+
+(defn wrap-log [handler]
+  (fn [request]
+    (let [resp (handler request)]
+      (infof "request %s -> %s" (-> request :uri) resp)
+      resp)))


add 005.clj

add 005.clj

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


Implemented Clojure day 2 homework

Implemented Clojure day 2 homework

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

--- clojure/day2.clj
+++ clojure/day2.clj
@@ -0,0 +1,19 @@
+; whee, even an recursive macro because we can
+; and with wariable number of arguments, because that's what 'if' does
+(defmacro unless
+  ;([test iffalse] (list 'if (list 'not test) iffalse))
+  ([test iffalse] (list 'unless test iffalse 'nil))
+  ([test iffalse iftrue] (list 'if (list 'not test) iffalse iftrue)))
+
+(defprotocol Rating
+  (rating-of [thing])
+  (complain [thing]))
+
+(def ratings {:ruby :meh, :io :awesome,
+              :prolog :meh, :scala :meh
+              :erlang :meh, :clojure :awesome})
+
+(defrecord Rater [thing]
+  Rating
+  (rating-of [_] (ratings thing))
+  (complain [_] (str "Wow, " (clojure.string/capitalize (name thing)) " sucks")))


add test case

add test case

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/carolove/clojure-ring-app.git/'


Added an example script

Added an example script

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

--- examples/simple.clj
+++ examples/simple.clj
@@ -0,0 +1,55 @@
+;; processing test
+;; http://groups.google.com/group/clojure/browse_thread/thread/84eefbde46bffec8
+
+
+;; you can add processing's JAR via add-classpath
+(add-classpath "file:///h:/bin/dev/processing/lib/core.jar")
+
+(clojure/ns p5-example
+			(:use rosado.processing)
+			(:import (javax.swing JFrame JLabel JTextField JButton))
+			(:import (processing.core PApplet)))
+
+
+;; here's a function which will be called by Processing's (PApplet)
+;; draw method every frame. Place your code here. If you eval it
+;; interactively, you can redefine it while the applet is running and
+;; see effects immediately
+
+(defn fancy-draw [dst]
+  "An example of a function which does *something*."
+  (background-float (rand-int 256) (rand-int 256) (rand-int 256))
+  (fill-float (rand-int 125) (rand-int 125) (rand-int 125))
+  (ellipse 100 100 (rand-int 90) (rand-int 90))
+  (stroke-float 10)
+  (line 10 10 (rand-int 150) (rand-int 150))
+  (no-stroke)
+  (filter-kind INVERT)
+  (framerate 10))
+
+;; below, we create an PApplet proxy and override setup() and draw()
+;; methods. Then we put the applet into a window and display it.
+
+(def p5-applet
+	 (proxy [PApplet] []
+	   (setup []
+			  (binding [*applet* this]
+				(size 200 200)
+				(smooth)
+				(no-stroke)
+				(fill 226)
+				(framerate 10)))
+	   (draw []
+			 (binding [*applet* this]
+			   (fancy-draw this)))))
+
+(.init p5-applet)
+
+(def swing-frame (JFrame. "Processing with Clojure"))
+(doto swing-frame
+	(setDefaultCloseOperation (. JFrame EXIT_ON_CLOSE))
+	(setSize 200 200)
+	(add p5-applet)
+	(pack)
+	(show))
+


rays for generateme

rays for generateme

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

--- generateme/rays.clj
+++ generateme/rays.clj
@@ -0,0 +1,101 @@
+(ns generateme.rays2
+  (:require [clojure2d.core :refer :all]
+            [clojure2d.math :as m]
+            [clojure2d.math.random :as r]
+            [clojure2d.math.vector :as v]
+            [clojure2d.math.joise :as j]
+            [clojure2d.extra.variations :as vr]
+            [clojure2d.pixels :as p]
+            [clojure2d.extra.glitch :as g]
+            [clojure2d.color :as c]
+            [clojure.pprint :refer [pprint]])
+  (:import [clojure2d.math.vector Vec2 Vec3 Vec4]
+           [clojure2d.pixels BinPixels]))
+
+(set! *warn-on-reflection* true)
+(set! *unchecked-math* :warn-on-boxed)
+
+(def ^:const ^int width 2048)
+(def ^:const ^int height 2048)
+(def ^:const ^int half (int (/ width 2)))
+(def ^:const ^int border (int (* 0.9 half)))
+
+(defn rays-config
+  ""
+  []
+  (binding [vr/*skip-random-variations* true]
+    (let [var1-conf (vr/make-random-configuration (r/irand 4))
+          palseq (filter #(< 120 (c/get-luma (first %)) 230) (repeatedly #(:palette (g/color-reducer-machine))))
+          curl (+ m/TWO_PI ^double (r/drand (- m/PI) m/PI))
+          scale-down (m/norm curl m/PI (+ m/PI m/TWO_PI) 100.0 1000.0) ]
+      {:noise1 (if (r/brand 0.2) (j/make-random-fractal) (r/make-perlin-noise (r/irand) (r/irand 1 4)))
+       :var1-conf var1-conf
+       :var1 (vr/make-combination var1-conf)
+       :ray-length 5000
+       :angle-step (/ m/TWO_PI 15432.0)
+       :col1 (ffirst palseq)
+       :curl curl
+       :scale-up (r/drand 0.5 4)
+       :scale-down scale-down
+       :col2 (first (second palseq))})))
+
+(def config (rays-config))
+
+(def canvas (create-canvas width height))
+(def binpixels (p/make-binpixels [(- half) half (- half) half] width height))
+
+(defn draw-on-canvas
+  "Render BinPixels to canvas."
+  [canvas fc state]
+  (p/set-canvas-pixels canvas (p/to-pixels binpixels
+                                           (Vec4. 15 5 5 255)
+                                           {:alpha-gamma 1.5 :color-gamma 0.8 :intensity 0.5}))  )
+
+(def window (show-window canvas "Rays" (* 0.4 width) (* 0.4 height) 1 #(draw-on-canvas %1 %2 %3)))
+
+(defmethod key-pressed ["Rays" \space] [_]
+  (save-canvas canvas (next-filename "generateme/rays/" ".jpg")))
+
+(defn make-point
+  ""
+  [^double angle]
+  (Vec3. (r/grand 20.0) (r/grand 20.0) (+ ^double (r/grand 0.01) angle)))
+
+(defn make-do-step
+  ""
+  [{:keys [var1 noise1 ^Var4 col1 ^Var4 col2 ^double scale-up ^double scale-down ^double curl]}]
+  (fn [^Vec3 v]
+    (let [^Vec2 v1 (v/mult (var1 (v/div (Vec2. (.x v) (.y v)) scale-down)) scale-up)
+          n1 (* curl ^double (noise1 (.x v1)))
+          n2 (* curl ^double (noise1 (.y v1)))
+          s (m/sin (+ n1 (.z v)))
+          c (m/cos (+ n2 (.z v)))
+          ^Vec4 col (v/interpolate col1 col2 (m/abs (* s c)))
+          nx (+ (.x v) s)
+          ny (+ (.y v) c)]
+      (p/add-pixel-bilinear binpixels nx ny (.x col) (.y col) (.z col))
+      (if (and (< (m/abs nx) border)
+               (< (m/abs ny) border))
+        (Vec3. nx ny (.z v))
+        (make-point (r/drand m/TWO_PI))))))
+
+(defn render-rays
+  ""
+  []
+  (let [rays (map make-point (range 0 m/TWO_PI (:angle-step config)))
+        step-fn (make-do-step config)
+        stop (int (:ray-length config))]
+
+    (pprint config)
+
+    (loop [s rays
+           iter (int 0)]
+      (if (and @(window 1) (< iter stop))
+        (do
+          (when (zero? ^long (mod iter 100))
+            (println iter)
+            (println (first s)))
+          (recur (mapv step-fn s) (inc iter)))
+        (println :done)))))
+
+(render-rays)


Fancy Fibonacci number generator.

Fancy Fibonacci number generator.

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


Team tag description

Team tag description

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


Removes default fail test

Removes default fail 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/govindkrjoshi/minesweeper.git/'


more and better stats

more and better stats

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/burner-432e4b5d76/scrapefruit.git/'


start moving common funcs to util

start moving common funcs to util

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

--- src/mekena/utils.clj
+++ src/mekena/utils.clj
@@ -0,0 +1,23 @@
+(ns mekena.utils)
+
+(defn rpartial
+  "right currying"
+  ([f & args]
+     (fn [& prefix-args]
+       (apply f (concat prefix-args args)))))
+
+(defn normalize
+  "normalize a feature by subtracting the mean and scale by the std dev"
+  [mtrx]
+  (let [mean (stats/mean mtrx)
+        sd (stats/sd mtrx)]
+    (vec (map (comp (fn [n] (/ n sd)) (fn [n] (- n mean))) mtrx))))
+
+(defn prepare-features
+  "append a column of 1s as feature 0"
+  [xs]
+  (-> xs
+      i/nrow
+      (repeat 1)
+      (i/bind-columns xs)))
+


BOOLEAN is a synonym of TINYINT(1)

BOOLEAN is a synonym of TINYINT(1)

--- test/metabase/test/data/mysql.clj
+++ test/metabase/test/data/mysql.clj
@@ -13,7 +13,7 @@

 (def ^:private ^:const field-base-type->sql-type
   {:BigIntegerField "BIGINT"
-   :BooleanField    "BIT" ; There's no boolean type in MySQL (!)
+   :BooleanField    "BOOLEAN" ; Synonym of TINYINT(1)
    :CharField       "VARCHAR(254)"
    :DateField       "DATE"
    :DateTimeField   "TIMESTAMP"


transmission bidez partekatu

transmission bidez partekatu

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


Add log.cljx. No idea why it wasn't added yet. :-/

error: pathspec 'src/cljx/robinson/log.cljx' did not match any file(s) known to git

--- src/cljx/robinson/log.cljx
+++ src/cljx/robinson/log.cljx
@@ -0,0 +1,59 @@
+(ns robinson.log
+  (:require
+            #+clj
+            [taoensso.timbre :as log]
+            #+cljs
+            [shodan.console :as log :include-macros true]))
+
+
+(def ^:private log-levels
+  {:none -1
+   :trace 0
+   :debug 1
+   :info  2
+   :warn  3
+   :error 4})
+
+(def ^:private log-level (atom :info :validator (fn [level] (contains? log-levels level))))
+
+(defn set-log-level! [level]
+  (reset! log-level level))
+
+(defn log-level-sufficient? [level]
+  (>= (get log-levels level) (get log-levels @log-level)))
+
+(defn trace [& more]
+  (when (log-level-sufficient? :trace)
+    #+clj
+    (log/trace more)
+    #+cljs
+    (log/info (str more))))
+
+(defn debug [& more]
+  (when (log-level-sufficient? :debug)
+    #+clj
+    (log/debug more)
+    #+cljs
+    (log/debug (str more))))
+
+(defn info [& more]
+  (when (log-level-sufficient? :info)
+    #+clj
+    (log/info more)
+    #+cljs
+    (log/info (str more))))
+
+(defn warn [& more]
+  (when (log-level-sufficient? :warn)
+    #+clj
+    (log/warn more)
+    #+cljs
+    (log/warn (str more))))
+
+(defn error [& more]
+  (when (log-level-sufficient? :error)
+    #+clj
+    (log/error more)
+    #+cljs
+    (log/error (str more))))
+


Add contributors to sponsor section of footer

--- src/clojars/web/common.clj
+++ src/clojars/web/common.clj
@@ -21,7 +21,9 @@
    (link-to "/security" "security")
    (link-to "https://github.com/clojars/clojars-web/wiki/" "help")
    [:div.row.sponsors
-    [:div "sponsored by"]
+    [:div "sponsored by"
+     (link-to "https://www.bountysource.com/teams/clojars/backers" "individual contributors")
+     "and"]
     [:div
      (link-to {:target "_blank"}
        "http://www.redhat.com/"


[WM] throw IllegalArgumentException for unsupported reg. method

This turns it into a semantic error, and is the more appropriate
exception type here.

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


Added a new file MARC source

Added a new file MARC source

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

--- src/marcgrep/backends/file.clj
+++ src/marcgrep/backends/file.clj
@@ -0,0 +1,23 @@
+(ns marcgrep.backends.file
+  (:use [marcgrep.core :only [MarcSource]]
+        [clojure.java.io])
+  (:import [org.marc4j MarcXmlReader]
+           [java.io FileInputStream]
+           [org.marc4j.marc Record VariableField]
+           [java.io BufferedReader ByteArrayInputStream]))
+
+(deftype MarcFile [^{:unsynchronized-mutable true :tag String} filename
+                   ^{:unsynchronized-mutable true :tag MarcXmlReader} rdr]
+  MarcSource
+  (init [this]
+    (set! rdr (MarcXmlReader. (FileInputStream. filename))))
+  (next [this]
+    (when (.hasNext rdr)
+      (.next rdr)))
+  (close [this]))
+
+
+(defn all-marc-records [config]
+  (let [marc-records (MarcFile. (:marc-file @config) nil)]
+    (.init marc-records)
+    marc-records))


Added wrap-params middleware

Added wrap-params middleware

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


quick one

quick one

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


Fix :keys as well

Fix :keys as well

The defn specs don't catch keywords given for :keys, but the type
mismatch between the keys in :keys and :or prevents the :ors from being
used.

--- test/clojars/test/test_helper.clj
+++ test/clojars/test/test_helper.clj
@@ -87,7 +87,7 @@

 (defn app
   ([] (app {}))
-  ([{:keys [:storage :db :error-reporter :stats :search :mailer]
+  ([{:keys [storage db error-reporter stats search mailer]
      :or {db *db*
           storage (storage/fs-storage (:repo test-config))
           error-reporter (quiet-reporter)


adjusting function ordering a bit.

adjusting function ordering a bit.

--- test/metabase/api/org_test.clj
+++ test/metabase/api/org_test.clj
@@ -168,6 +168,15 @@

 ;; # MEMBERS ENDPOINTS

+;; ## Helper Fns
+
+(defn org-perm-exists? [org-id user-id]
+    (exists? OrgPerm :organization_id org-id :user_id user-id))
+
+(defn create-org-perm [org-id user-id]
+    ((user->client :crowberto) :post 200 (format "org/%d/members/%d" org-id user-id) {:admin false}))
+
+
 ;; ## GET /api/org/:id/members
 (expect
     #{(match-$ (user->org-perm :crowberto)
@@ -228,13 +237,6 @@
                   :email "rasta@metabase.com"})})}
   (set ((user->client :rasta) :get 200 (format "org/%d/members" @org-id))))

-;; ## Helper Fns
-
-(defn org-perm-exists? [org-id user-id]
-  (exists? OrgPerm :organization_id org-id :user_id user-id))
-
-(defn create-org-perm [org-id user-id]
-  ((user->client :crowberto) :post 200 (format "org/%d/members/%d" org-id user-id) {:admin false}))

 ;; ## POST /api/org/:id/members/:user-id
 ;; Check that we can create an OrgPerm between existing User + Org


Fix eclipsed negotiation test

Fix eclipsed negotiation 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/delitescere/yada.git/'


Update groovy_test.clj

Update groovy_test.clj

--- jvm-runner/test/codewars/runners/groovy_test.clj
+++ jvm-runner/test/codewars/runners/groovy_test.clj
@@ -1,8 +1,10 @@
 (ns codewars.runners.groovy-test
   (:require [clojure.test :refer :all]
+            [clojure.test.junit :refer [with-junit-output]]
             [cheshire.core :as json]
             [codewars.core :refer [-main] :as core]
-            [codewars.utils :refer [with-java-out-str]]))
+            [codewars.utils :refer [with-java-out-str]]
+  )

 (deftest groovy-code-only
   (testing "-main can handle a groovy code with no fixture"
@@ -10,12 +12,39 @@
       (json/generate-string
        {:language "groovy"
         :code "1 + 1"})
-      (is (= 2 (-main))))))
+      (is (= 2 (-main)))
+    )
+  )
+)

 (deftest groovy-java-out
   (testing "-main can handle a groovy code with no setup code but no fixture"
     (with-in-str
       (json/generate-string
        {:language "groovy"
-        :code "print 'Hello Groovy!'"})
-      (is (= "Hello Groovy!" (with-java-out-str (-main)))))))
+        :code "print 'Hello Groovy!'"}
+      )
+      (is (= "Hello Groovy!" (with-java-out-str (-main))) )
+    )
+  )
+)
+
+(deftest groovy-java-fixt
+  (testing "-main can handle a groovy code with no setup code but no fixture"
+    (with-in-str
+      (json/generate-string
+       {:language "groovy"
+        :code "class Greeter { static greet = { name -> 'Hello '+name } }"
+        :fixture "class MyTestCase extends GroovyTestCase { void testGreet(){def result = Greeter.greet('Ruslan');assert result == 'Hello Ruslan'}}"}
+      )
+      ;(with-java-out-str (run-all-tests))
+
+     (let [test-out-string (with-java-out-str (-main))]
+        (is (.contains test-out-string "<DESCRIBE::>testGreet(MyTestCase)"))
+        ;(is (.contains test-out-string "test out"))
+        (is (.contains test-out-string "<PASSED::>Test Passed<:LF:>"))
+     )
+
+    )
+  )
+)


Added first tutorial example

Added first tutorial 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/'


remove code duplication from benchmarks

remove code duplication from benchmarks

Extract shared implementation for callback logs

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


unelte http

unelte http

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/kokosro/kokos-crawler.git/'


Added missing namespaces to wrap-reload middleware.

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


Better naming.

Better naming.

--- src/sablono/compiler.clj
+++ src/sablono/compiler.clj
@@ -5,8 +5,8 @@
             [sablono.util :refer [normalize-element react-symbol]])
   (:import cljs.tagged_literals.JSValue))

-(defprotocol HtmlRenderer
-  (render-html [this] "Compile a Clojure data structure into a React fn call."))
+(defprotocol ICompile
+  (compile-react [this] "Compile a Clojure data structure into a React fn call."))

 (defprotocol IJSValue
   (to-js [x]))
@@ -29,12 +29,12 @@
            (assoc attrs :className)
            (to-js)))))

-(defn render-element
+(defn compile-react-element
   "Render an element vector as a HTML element."
   [element]
   (let [[tag attrs content] (normalize-element element)]
     (if content
-      `(~(react-symbol tag) ~(compile-attrs attrs) ~@(render-html content))
+      `(~(react-symbol tag) ~(compile-attrs attrs) ~@(compile-react content))
       `(~(react-symbol tag) ~(compile-attrs attrs)))))

 (defn- unevaluated?
@@ -120,7 +120,7 @@

 (defmethod compile-element ::all-literal
   [element]
-  (render-element (eval element)))
+  (compile-react-element (eval element)))

 (defmethod compile-element ::literal-tag-and-attributes
   [[tag attrs & content]]
@@ -181,21 +181,18 @@
   (.write w "#js ")
   (.write w (pr-str (.val v))))

-(defn- render-seq [s]
-  (into-array (map render-html s)))
-
-(extend-protocol HtmlRenderer
+(extend-protocol ICompile
   clojure.lang.IPersistentVector
-  (render-html [this]
-    (render-element this))
+  (compile-react [this]
+    (compile-react-element this))
   clojure.lang.ISeq
-  (render-html [this]
-    (map render-html this))
+  (compile-react [this]
+    (map compile-react this))
   Object
-  (render-html [this]
+  (compile-react [this]
     this)
   nil
-  (render-html [this]
+  (compile-react [this]
     nil))

 (defn- to-js-map [x]


Forgot to uncomment a line resulting in a lot of things breaking.

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


get rid of commented out code

get rid of commented out code

--- sidecar/src/figwheel_sidecar/config_check/type_check.clj
+++ sidecar/src/figwheel_sidecar/config_check/type_check.clj
@@ -548,13 +548,6 @@
        :key bad-key
        :corrections potential-keys
        :confidence :high})))
-
-#_(defn misplaced-key? [parent-type parent-config-value bad-key analysis]
-  (let [child-analysis            (detailed-config-analysis (get parent-config-value bad-key))
-
-        actual-parent-type?       (analysis-type-matches parent-type analysis)]
-
-    ))

 #_(misspelled-key? 'Fig { }
                    :figg [['Fig [:subst :figg :figwheel] 'Yep]


updating deps for example

updating deps for example

--- example/project.clj
+++ example/project.clj
@@ -4,9 +4,10 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [
-                 [org.clojure/clojure "1.8.0-RC2"]
+                 [org.clojure/clojure "1.8.0"]
                  [org.clojure/clojurescript "1.7.228"]
-                 [org.clojure/core.async "0.2.374"]
+                 [org.clojure/core.async "0.2.374"
+                  :exclusions [org.clojure/tools.reader]]
                  [sablono "0.3.5"]
                  [org.omcljs/om "0.8.8"]
                  [ankha "0.1.4"]
@@ -15,8 +16,8 @@
                  [cljs-http "0.1.35"]]

   :plugins [[lein-ring "0.8.13"]
-            #_[lein-cljsbuild "1.1.1"]
-            [lein-figwheel "0.5.0-4"]
+            #_[lein-cljsbuild "1.1.2"]
+            [lein-figwheel "0.5.0-5"]
             [lein-npm "0.4.0"]]

   :node-dependencies [[source-map-support "0.2.8"]
@@ -98,7 +99,7 @@
                                     }}]}

   :profiles { :dev { :dependencies [[com.cemerick/piggieback "0.2.1"]
-                                    [figwheel-sidecar "0.5.0-4"]
+                                    [figwheel-sidecar "0.5.0-5"]
                                     [org.clojure/tools.namespace "0.2.11"]
                                     [org.clojure/tools.nrepl "0.2.12"]]
                     :source-paths ["src" "dev"]


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


notes re: nested-rf-plan difficulty and an alt. idea

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


added check-and-add-group to the other route in repo.clj

--- src/clojars/routes/repo.clj
+++ src/clojars/routes/repo.clj
@@ -89,6 +89,7 @@
          (put-req
           groupname
           (let [file (io/file (config :repo) group artifact file)]
+            (db/check-and-add-group account groupname)
             (try-save-to-file file body))
             )))
   (PUT ["/:group/:artifact/:version/:filename"


tick: remove extraneous log

tick: remove extraneous log

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


Fixing async request.

Fixing async request.

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


Don't show widget bar if there aren't any widgets

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


[WM] set all outgoing emails as UTF-8 HTML

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


Added levels back.

Added levels back.

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


complexities

complexities

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


replacing require with use

replacing require with use

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


Add cycle-fn - a mini automata functional state machine

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

--- src/overtone/algo/fn.clj
+++ src/overtone/algo/fn.clj
@@ -0,0 +1,39 @@
+(ns
+    ^{:doc "Handy fn generators"
+      :author "Sam Aaron"}
+  overtone.algo.fn)
+
+(defn cycle-fn
+  "Returns a fn which will cycle between each of the fns specified. The
+   first time the fn is called, the first fn in fns will be called, the
+   second time, the second fn in fns etc, cycling around indefinitely.
+
+   The args passed into the returned fn will be passed through to the
+   appropriate inner fn. Additionally, the result of the inner fn will
+   be returned as the result of the outer fn.
+
+   Will catch any exceptions generated by the internal fns and print a
+   stacktrace to stdout.
+
+   (def f (cycle-fn (fn [st] (println \"hi\" st))
+                    (fn [st] (println \"yo\" st))
+                    (fn [st] (println \"ho ho\" st))))
+
+   (f \"there\") ;=> \"hi there\"
+   (f \"bro\")   ;=> \"yo bro\"
+   (f \"santa\") ;=> \"ho ho santa\"
+   (f \"again\") ;=> \"hi again\""
+  [& fns]
+  (let [stored-fns (agent (cycle fns))]
+    (fn [& args]
+      (let [res-prom (promise)]
+        (send-off stored-fns
+                  (fn [v]
+                    (try
+                      (let [res (apply (first v) args)]
+                        (deliver res-prom res))
+                      (catch Exception e
+                        (.printStackTrace e)
+                        (deliver res-prom nil)))
+                    (rest v)))
+        @res-prom))))