Update to dev/setup.clj to work on Windows.

--- src/clojars/dev/setup.clj
+++ src/clojars/dev/setup.clj
@@ -57,6 +57,12 @@
      (doto (-> .getVersioning (.addVersion version)))
      (write-metadata md-file))))

+; TODO: If there are more places that require this, move to a utility location.
+(defn get-path
+  "Ensures that / is used as separator when regex depends on it."
+  [file]
+  (str/replace (.getPath file) (java.io.File/separator) "/"))
+
 (defn import-repo
   "Builds a dev db from the contents of the repo."
   [db repo stats-dir users]
@@ -70,7 +76,7 @@
             :when (and (.isDirectory version-dir)
                     (re-find #"^[0-9]\." (.getName version-dir)))
             :let [parent (.getParentFile version-dir)
-                  [_ group-path artifact-id] (re-find group-artifact-pattern (.getPath parent))
+                  [_ group-path artifact-id] (re-find group-artifact-pattern (get-path parent))
                   version (.getName version-dir)
                   group-id (str/lower-case (str/replace group-path "/" "."))
                   user (or (first (db/group-membernames db group-id)) (rand-nth users))]]


Add tool to set up dev env from existing repo.

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

--- src/clojars/dev/setup.clj
+++ src/clojars/dev/setup.clj
@@ -0,0 +1,101 @@
+(ns clojars.dev.setup
+  "Tools to setup a dev db."
+  (:require [clojars.config :refer [config]]
+            [clojars.db :as db]
+            [clojars.search :as search]
+            [clojure.java.io :as io]
+            [clojure.string :as str]
+            [korma.core :refer [delete]])
+  (:import [org.apache.maven.artifact.repository.metadata Metadata Versioning]
+           [org.apache.maven.artifact.repository.metadata.io.xpp3
+            MetadataXpp3Reader
+            MetadataXpp3Writer]))
+
+(defn reset-db! []
+  (delete db/jars)
+  (delete db/groups)
+  (delete db/users))
+
+(defn add-test-users
+  "Adds n test users of the form test0/test0."
+  [n]
+  (mapv #(let [name (str "test" %)]
+           (if (db/find-user name)
+             (println "User" name "already exists")
+             (do
+               (printf "Adding user %s/%s\n" name name)
+               (db/add-user (str name "@example.com") name name "" "")))
+           name)
+    (range n)))
+
+(defn write-metadata [md file]
+  (with-open [w (io/writer file)]
+    (.write (MetadataXpp3Writer.) w md)))
+
+(defn read-metadata [file]
+  (.read (MetadataXpp3Reader.) (io/input-stream file)))
+
+(defn create-metadata [md-file group-id artifact-id version]
+  (write-metadata
+    (doto (Metadata.)
+      (.setGroupId group-id)
+      (.setArtifactId artifact-id)
+      (.setVersioning
+        (doto (Versioning.)
+          (.addVersion version))))
+    md-file))
+
+(defn update-metadata
+  ([dir group-id artifact-id version]
+   (let [md-file (io/file dir "maven-metadata.xml")]
+     (if (.exists md-file)
+       (update-metadata md-file version)
+       (create-metadata md-file group-id artifact-id version))))
+  ([md-file version]
+   (-> md-file
+     read-metadata
+     (doto (-> .getVersioning (.addVersion version)))
+     (write-metadata md-file))))
+
+(defn import-repo
+  "Builds a dev db from the contents of the repo."
+  [repo users]
+  (let [group-artifact-pattern (re-pattern (str repo "/(.*)/([^/]*)$"))]
+    (doseq [version-dir (file-seq (io/file repo))
+            :when (and (.isDirectory version-dir)
+                    (re-find #"^[0-9]\." (.getName version-dir)))
+            :let [parent (.getParentFile version-dir)
+                  [_ group-path artifact-id] (re-find group-artifact-pattern (.getPath parent))
+                  version (.getName version-dir)
+                  group-id (str/lower-case (str/replace group-path "/" "."))
+                  user (or (first (db/group-membernames group-id)) (rand-nth users))]]
+      (when-not (db/find-jar group-id artifact-id version)
+        (printf "Importing %s/%s %s (user: %s)\n" group-id artifact-id version user)
+        (db/add-jar user {:group group-id
+                          :name artifact-id
+                          :version version
+                          :description (format "Description for %s/%s" group-id artifact-id)
+                          :homepage (format "http://example.com/%s/%s" group-id artifact-id)
+                          :authors ["Foo" "Bar" "Basil"]})
+        (update-metadata parent group-id artifact-id version)))))
+
+(defn -main []
+  (let [db (-> config :db :subname)
+        repo (:repo config)]
+    (println "NOTE: this will clear the contents of" db
+      "and import all of the projects in" repo "into the db.\n")
+    (print "Are you sure you want to continue? [y/N] ")
+    (flush)
+    (when-not (= "y" (.toLowerCase (read-line)))
+      (println "Aborting.")
+      (System/exit 1))
+    (println "==> Clearing the" db "db...")
+    (reset-db!)
+    (println "==> Creating 10 test users...")
+    (let [test-users (add-test-users 10)]
+      (println "==> Importing" repo "into the db...")
+      (import-repo repo test-users))
+    (println "==> Indexing" repo "...")
+    (search/index-repo repo))
+  ;; something (korma's thread pool?) keeps us from exiting normally
+  (System/exit 0))


Indentation

Indentation

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


Moving the port info into the compiled shen.clj


Embedding Swank in the Shen REPL

Embedding Swank in the Shen REPL


The beginnings of a color processing ns.

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


Added some useful examples

Added some useful examples

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

--- test/clj3D/examples/examples.clj
+++ test/clj3D/examples/examples.clj
@@ -0,0 +1,35 @@
+(ns clj3D.examples
+  (:use
+   [clj3D fenvs viewer] :reload))
+
+
+;;Display a 1x1x1 cube
+(view (cube 1))
+
+;;view is a multimethod inherited from Incanter,
+;;you can visualize data structures as well
+(view (matrix [[0 1 2] [3 4 5]]))
+
+;;You can use almost all Plasm's functions
+;;Apply to all
+(aa #(* %1 %1) [1 2 3])
+
+;;Almost all functions are currified and high order
+((aa #(* %1 %1)) [1 2 3])
+
+;;Struct2 is similar to Plasm STRUCT, but it merge
+;;geometries into one, so you will lose informations
+;;about materials; use mk-node to view an arbitrary number of geometries
+
+;;Creates a green torus
+(def green-torus (color :green (torus 0.5 1.0)))
+
+;;Creates a red torus rotated by PI/2 on X axes and translated on X by -1.0
+(def red-torus (struct2 (t 1 -1.0) (r 1 (/ PI 2.0)) (color :red) (torus 0.5 1.0)))
+
+(view (struct2 green-torus red-torus))
+(view (mk-node green-torus red-torus)) ;;Check the difference!
+
+
+;; Affine trasnformation are supported as well! t,r,s
+;;This is only the tip of iceberg! clj3D is still under development! Have fun!


test for POST /api/query/:id/csv

test for POST /api/query/:id/csv

--- test/metabase/api/query_test.clj
+++ test/metabase/api/query_test.clj
@@ -213,3 +213,12 @@
       (create-query)
       (create-query)
       ((user->client :rasta) :get 200 "query" :org (:id @test-org))))
+
+;; ## POST /api/query/:id/csv
+(expect-eval-actual-first
+    "count(*)\n100\n"
+  (let [{query-id :id} (create-query)]
+    ((user->client :rasta) :post 200 (format "query/%d" query-id))
+    ;; 50ms should be long enough for query to finish
+    (Thread/sleep 50)
+    ((user->client :rasta) :get 200 (format "query/%d/csv" query-id))))


Issue #5: add component tests

Issue #5: add component tests

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


hydrate table :db on fk origin & destination.  there is still some frontend code reliant on these values.

--- src/metabase/api/meta/table.clj
+++ src/metabase/api/meta/table.clj
@@ -50,7 +50,7 @@
   (let-404 [field-ids (sel :many :id Field :table_id id)]
     (-> (sel :many ForeignKey :destination_id [in field-ids])
         ;; TODO - it's a little silly to hydrate both of these table objects
-        (hydrate [:origin :table] [:destination :table]))))
+        (hydrate [:origin [:table :db]] [:destination :table]))))

 (defendpoint POST "/:id/sync" [id]
   (let-404 [table (sel :one Table :id id)]


Add collection category to all collection commands

--- src/yetibot/core/commands/collections.clj
+++ src/yetibot/core/commands/collections.clj
@@ -41,7 +41,7 @@
 (defn random
   "random <list> # returns a random item from <list>
    random # generate a random number"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{items :opts}]
   (if (not (empty? items))
     (rand-nth (ensure-items-collection items))
@@ -76,13 +76,13 @@
 ; head
 (defn head-1
   "head <list> # returns the first item from the <list>"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [cmd-args]
   (head 1 cmd-args))

 (defn head-n
   "head <n> <list> # return the first <n> items from the <list>"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{[_ n] :match :as cmd-args}]
   (head (read-string n) cmd-args))

@@ -96,12 +96,12 @@
 ; tail
 (defn tail-1
   "tail <list> # returns the last item from the <list>"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [cmd-args] (tail 1 cmd-args))

 (defn tail-n
   "tail <n> <list> # returns the last <n> items from the <list>"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{[_ n] :match :as cmd-args}]
   (tail (read-string n) cmd-args))

@@ -129,7 +129,7 @@
 ; example usage: !users | xargs attack
 (defn xargs
   "xargs <cmd> <list> # run <cmd> for every item in <list> in parallel; behavior is similar to xargs(1)'s xargs -n1"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{:keys [args opts user] :as cmd-params}]
   (if (s/blank? args)
     opts ; passthrough if no args
@@ -165,7 +165,7 @@
 ; join
 (defn join
   "join <list> <separator> # joins list with optional <separator> or no separator if not specified. See also `unwords`."
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{match :match items :opts :as cmd-args}]
   (let [coll-or-error (ensure-coll cmd-args)
         join-char (if (empty? match) "" match)]
@@ -180,7 +180,7 @@
 ; split
 (defn split
   "split <pattern> <string> # split string with <pattern>"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{[_ split-by-str to-split] :match}]
   (let [split-by (re-pattern split-by-str)]
     (s/split to-split split-by)))
@@ -191,7 +191,7 @@
 ; trim
 (defn trim
   "trim <string> # remove whitespace from both ends of <string>"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{args :args}]
   (s/trim args))

@@ -201,7 +201,7 @@
 ; words
 (defn words
   "words <string> # split <string> by spaces into a list"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{args :args}]
   (s/split args #" "))

@@ -211,7 +211,7 @@
 ; unwords
 (defn unwords
   "unwords <list> # join <list> with a single space"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{args :args opts :opts}]
   (if (nil? opts)
     args ; no collection, return the value as-is
@@ -223,7 +223,7 @@
 ; flatten
 (defn flatten-cmd
   "flatten <nested list> # completely flattens a nested data struture after splitting on newlines"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{args :args opts :opts :as cmd-args}]
   (let [error-or-coll (ensure-coll cmd-args)]
     (if (error? error-or-coll)
@@ -236,7 +236,7 @@
 ; letters
 (defn letters
   "letters <string> # turn <string> into a sequence of individual letters"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{args :args}]
   (map str (seq args)))

@@ -293,7 +293,7 @@
 ; sort
 (defn sort-cmd
   "sort <list> # sort a list"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{items :opts}]
   (sort (ensure-items-collection items)))

@@ -343,7 +343,7 @@
 (defn grep-cmd
   "grep <pattern> <list> # filters the items in <list> by <pattern>
    grep -C <n> <pattern> <list> # filter items in <list> by <patttern> and include <n> items before and after each matched item"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{:keys [match opts args]}]
   (let [[n p] (if (sequential? match) (rest match) ["0" args])
         pattern (re-pattern (str "(?i)" p))
@@ -360,7 +360,7 @@
 ; tee
 (defn tee-cmd
   "tee <list-or-args> # output <list-or-args> to chat then return it (useful for pipes)"
-  {:yb/cat #{:util}}
+  {:yb/cat #{:util :collection}}
   [{:keys [opts args]}]
   (chat-data-structure (or opts args))
   (or opts args))


always default to json mime type for 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/nilenso/finenso-time-tracker.git/'


[WM] s/remove-internal-attrs/select-external-keys/ fn in core

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


add better card placement

add better card placement

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


New module dyncfg

New module dyncfg

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

--- src/clj_mrazik/dyncfg.clj
+++ src/clj_mrazik/dyncfg.clj
@@ -0,0 +1,29 @@
+;
+;  (C) Copyright 2016  Pavel Tisnovsky
+;
+;  All rights reserved. This program and the accompanying materials
+;  are made available under the terms of the Eclipse Public License v1.0
+;  which accompanies this distribution, and is available at
+;  http://www.eclipse.org/legal/epl-v10.html
+;
+;  Contributors:
+;      Pavel Tisnovsky
+;
+
+(ns clj-mrazik.dyncfg)
+
+(def schedule
+    (atom nil))
+
+(def configuration
+    (atom nil))
+
+(def sleep-amount
+    10000)
+
+(def connection
+    (atom nil))
+
+(def bot-nick
+    (atom nil))
+


use static-fns optimization

use static-fns optimization

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


lein try seems useful

lein try seems useful

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


remove midje plugin.

remove midje plugin.

Conflicts:
	.lein/profiles.clj


Remove obsolete test.

Remove obsolete 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/cstorey/nrod.git/'


in progress

in progress

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


spatiu alb

spatiu alb


Add stub for scrabble score

Add stub for scrabble score

error: pathspec 'exercises/scrabble-score/src/scrabble_score.clj' did not match any file(s) known to git

--- exercises/scrabble-score/src/scrabble_score.clj
+++ exercises/scrabble-score/src/scrabble_score.clj
@@ -0,0 +1,9 @@
+(ns scrabble-score)
+
+(defn score-letter [] ;; <- Arglist goes here
+      ;; your code goes here
+      )
+
+(defn score-word [] ;; <- Arglist goes here
+  ;; your code goes here
+  )


clean up old notes and experimental code

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


Add repl environment to connect to docker postgres

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

--- src/honeysql_talk/repl.clj
+++ src/honeysql_talk/repl.clj
@@ -0,0 +1,25 @@
+(ns honeysql-talk.repl
+  (:refer-clojure :exclude [format update cast])
+  (:require [system.components.postgres :refer [new-postgres-database]]
+            [com.stuartsierra.component :as component]
+            [clj-time.core :as t]
+            clj-time.jdbc
+            [honeysql.core :refer [call format raw]]
+            [honeysql.helpers :refer :all]
+            [honeysql-talk.extra :refer :all]))
+
+(def db (-> (new-postgres-database {:classname "org.postgresql.Driver"
+                                    :subprotocol "postgresql"
+                                    :subname "//127.0.0.1:5432/exercises"
+                                    :user "honeysql"
+                                    :password "honeysql"})
+            (component/start)))
+
+(comment
+
+  (query-runner db (-> (select :*)
+                       (from :cd.members)
+                       (limit 1)))
+
+  )
+


dbtik-jaso kendu

dbtik-jaso kendu

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


cleaning up for release

cleaning up for release

--- sidecar/src/figwheel_sidecar/config_check/type_check.clj
+++ sidecar/src/figwheel_sidecar/config_check/type_check.clj
@@ -54,11 +54,6 @@
 (defn empty?? [x]
   (and (or (map?? x) (list?? x))
        (empty? (rest x))))
-
-#_(defn complex-value? [v]
-    (or (list?? v) (map?? v) (fn? v) (-> v meta :ref)))
-
-#_(def simple-value? (complement complex-value?))

 (defn prep-key [k]
   (if (fn? k)
@@ -138,29 +133,12 @@
 (defn assert-not-empty [root & key-list]
   (mapv (fn [k] [root :not-empty k]) key-list))

-#_(required-keys 'FigOpts :hello :goodbye)
-
-#_(defn doc-type? [x]
-  (and (map? x)
-       (= #{:content :example} (set (keys x)))
-       (let [{:keys [example content]} x]
-         (or (fn? example)
-             (string? example)))))
-
 (defn doc
   ([root type-doc kd]
    (cons [root :doc-type type-doc]
          (mapv (fn [[k d]] [root :doc-key k d]) kd)))
   ([root type-doc]
    (doc root type-doc [])))
-
-#_(index-spec
- (doc 'FigOpts "This is a cool option"
-      {
-       :hello ":hello is needed to say hello"
-       :good ":good is needed to say goodbye"
-       :hey-there {:content "This is docs"
-                   :example "This is an example"}}))

 ;; Direct Implementation
 ;; this is still squirrely
@@ -211,20 +189,6 @@
 (defn all-predicates [parent-type]
   (keep identity (mapcat leaf-pred? (cons parent-type (descendent-typs parent-type)))))

-#_(with-schema (index-spec (spec 'Integer integer?)
-                         (spec 'AnotherInt string?)
-                         (spec 'AnotherInt (ref-schema 'Integer))
-                         (spec 'AndAnotherInt (ref-schema 'AnotherInt)))
-    (doall (all-predicates 'AndAnotherInt))
-    #_(doall (predicate-rules-for-type 'AndAnotherInt))
-  #_(leaf-pred? 'AnotherInt)
-  #_(all-types 'AndAnotherInt)
-  #_(all-types 'AndAnotherInt)
-  #_(to-leaf-types 'AAnotherInt)
-  #_(to-leaf-types 'AnotherInt)
-    )
-
-#_(ns-unmap *ns* 'apply-pred)
 (defmulti apply-pred (fn [f v] (second f)))
 (defmethod apply-pred :== [[t _ pred] value] (= value pred))
 (defmethod apply-pred :=  [[t _ pred] value] (pred value))
@@ -247,28 +211,10 @@
            error)])
       {:success-type typ})))

-#_(with-schema (index-spec
-                (spec 'String string?)
-                (spec 'Integer integer?)
-                (spec 'Five 5)
-                (spec 'Map {})
-                (spec 'AnotherInt (ref-schema 'Integer))
-                (spec 'Cljsbuild {:server-port integer?
-                                  :server-ip string?})
-                (or-spec 'IntOrBool
-                      boolean?
-                      (ref-schema 'AnotherInt))
-                (or-spec 'IntOrBoolOrCljs
-                      (ref-schema 'IntOrBool)
-                      (ref-schema 'Cljsbuild))
-                )
-  (all-predicates 'IntOrBool)
-
-  )
-
 ;; TODO this allows a OR reloationship??
 ;; lets formalize this as an and relationship
 ;; the or-spec handles the OR relationship
+
 (defn type-check-value [parent-type value state]
   (if-let [preds (all-predicates parent-type)]
     (let [errors   (map #(type-check-pred % value state) preds)
@@ -394,6 +340,8 @@

 (defn anything? [x] true)

+;; my take on the degreee of difference in config spelling errors
+
 (defn step-log [thresh val]
   (if (< thresh val)
     (+ thresh (/ (- val thresh ) 2.0))
@@ -414,6 +362,7 @@
           0.51)))

 (comment
+
   (metrics/dice "GSF" "GFS")

   (metrics/levenshtein "GSFD" "GFSD")
@@ -422,6 +371,8 @@

   (ky-distance :figwheel :figwheeler)
   )
+
+

 (defn complexity [c]
   (if (coll? c)
@@ -526,7 +477,6 @@

 (defn error-parent-value [{:keys [path orig-config]}]
   (get-in orig-config (reverse (rest path))))
-

 ;; analyzing the analysis results
 ;; This is where the real smarts come in
@@ -1254,20 +1204,11 @@
                     (rest (rest path))
                     (rest path)))
                  leaf-node
-                 orig-config)
-     :break]
+                 orig-config)]
+    :break
     (print-document document)])
   ([error leaf]
    (print-path-error error leaf "")))
-
-(pprint-document [:group
- [:group
-  "-- Docs for key "
-  [:span [:pass ""] ":figwheel" [:pass ""]]
-  " --"
-  :break
-  "A map of options for the Figwheel system and server."
-  :break]] {})

 #_(gen-path [:cljsbuild :builds 0 :compiler :closure-warnings :const] 5)
 #_(pp)
@@ -1298,6 +1239,7 @@
                      (summerize-value value)]
                     :line]
                    (gen-path (first correct-paths) value)))]
+    :break
     (print-document document)])
   ([error leaf]
    (print-path-error error leaf "")))
@@ -1410,11 +1352,6 @@
                       (if (fn? example) (example) example))
       (contains? ky :example-construct-from)
       (construct-example (next-parent-type parent-type k) ky)
-      #_(into {}
-            (filter
-             (complement (comp nil? second))
-             (mapv (juxt identity (partial get-example-for-key ))
-                  (:example-construct-from ky))))
       :else nil)))

 (defn print-key-doc [parent-type k key-doc]
@@ -1441,7 +1378,6 @@
     (if ky
       [:group
        "-- Docs for key " (color (pr-str k) :bold) " --"
-       :break
        (print-key-doc parent-type k ky)
        :break]
       "")))
@@ -1485,8 +1421,6 @@
     (seq? v) (summerize-seq v)
     :else (pr-str v)))

-#_ (pp)
-
 (defn format-key
   ([k] (pr-str k))
   ([k colr] (color (format-key k) colr)))
@@ -1515,7 +1449,6 @@
                                       (str "^ key " (pr-str key) " not recognized")))
                    {:width 40}))

-#_(pp)
 (defmethod print-error :missing-required-key [{:keys [path value type-sig] :as error}]
   (pprint-document (print-path-error error
                                      [:group
@@ -1527,12 +1460,6 @@
                                      (document-key (first type-sig) (first path))
                                      )
                    {:width 40}))
-
-
-
-#_(pp)
-
-

 (defn failed-predicate [{:keys [path value type-sig orig-config] :as error}]
   (if (parent-is-sequence? error)
@@ -1562,25 +1489,21 @@
                                         (format-value value :red)
                                         (str "^ key " (pr-str (first path)) " has wrong value"))
                                        (document-key (first (rest type-sig)) (first path)))
-                     {:width 40}))
-  )
+                     {:width 40})))

 (defmethod print-error :failed-predicate [error] (failed-predicate error))
 (defmethod print-error :combined-failed-predicate [error] (failed-predicate error))
-(defmethod print-error :should-not-be-empty [error] (failed-predicate error))
-
-#_(with-schema
-  (index-spec (concat
-               (assert-not-empty 'RootMap :hey)
-               (spec 'RootMap {:hey {}})))
-    (print-error (first (type-check 'RootMap {:hey {}})))
-
-  )
-
-
-
-
-#_(pp)
+
+(defmethod print-error :should-not-be-empty [{:keys [path value type-sig orig-config] :as error}]
+  (pprint-document (print-path-error error
+                                     (format-key-value
+                                      (first path)
+                                      (format-key (first path) :bold)
+                                      (format-value value :red)
+                                      (str "^ key " (pr-str (first path)) " should not be empty"))
+                                     (document-key (first type-sig) (first path)))
+                   {:width 40}))
+
 (defmethod print-error :misplaced-key [{:keys [key correct-paths correct-type orig-error orig-config type-sig] :as error}]
   (pprint-document (print-wrong-path-error
                     error
@@ -1603,16 +1526,6 @@
                     (document-key (first correct-type) correction))
                    {:width 40}))

-#_{:path (:five),
-   :value 5,
-   :current-path (),
-   :type-sig (RootMap),
-   :suggested-path-for-value [:figwheel],
-   :expected-type RootMap,
-   :actual-type FigOpts,
-   :Error :wrong-position-for-value,
-}
-
 (defmethod print-error :wrong-position-for-value [{:keys [key value correct-paths correct-type orig-error orig-config type-sig] :as error}]
   (pprint-document (print-wrong-path-error
                     (assoc error :correction (first (first correct-paths)))
@@ -1664,12 +1577,10 @@
       single-error)))

 (defn print-errors-test [config]
-  #_(type-check 'RootMap config)
   (mapv #(print-error (assoc % :orig-config config))
         (type-check 'RootMap config)))

 (defn print-errors-test-first [config]
-  #_(type-check 'RootMap config)
   (mapv #(print-error (assoc % :orig-config config))
         (take 1 (type-check 'RootMap config))))


add config.clj.

add config.clj.

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

--- src/dokkaa_builder/config.clj
+++ src/dokkaa_builder/config.clj
@@ -0,0 +1,8 @@
+(ns dokkaa-builder.config
+  (:require [environ.core :refer [env]]))
+
+(defn hipache-redis-host []
+  "localhost")
+
+(defn domain-name []
+  "dokkaa.io")


New module: exec

New module: exec

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

--- src/arachnida/exec.clj
+++ src/arachnida/exec.clj
@@ -0,0 +1,30 @@
+(ns arachnida.exec)
+
+(defn exec
+    "Execute external command and pass given number of parameters to it."
+    ; command called without parameters
+    ([command]
+     (doto (. (Runtime/getRuntime) exec command)
+           (.waitFor)
+           (.destroy)))
+    ; command called with one parameter
+    ([command param1]
+     (doto (. (Runtime/getRuntime) exec (str command " " param1))
+           (.waitFor)
+           (.destroy)))
+    ; command called with two parameters
+    ([command param1 param2]
+     (doto (. (Runtime/getRuntime) exec (str command " " param1 " " param2))
+           (.waitFor)
+           (.destroy)))
+    ; command called with three parameters
+    ([command param1 param2 param3]
+     (doto (. (Runtime/getRuntime) exec (str command " " param1 " " param2 " " param3))
+           (.waitFor)
+           (.destroy)))
+    ; command called with four parameters
+    ([command param1 param2 param3 param4]
+     (doto (. (Runtime/getRuntime) exec (str command " " param1 " " param2 " " param3 " " param4))
+           (.waitFor)
+           (.destroy))))
+


Initial commit of a rule to copy OWL restrictions from OBO world to BIO world

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

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/post-identifier-merge/step_a-ontology_to_ice/copy_owl_restriction_to_bio.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/post-identifier-merge/step_a-ontology_to_ice/copy_owl_restriction_to_bio.clj
@@ -0,0 +1,26 @@
+;; ------------------------------------------------------------------------
+;; --------- Copy Owl Restriction to Bio ---------
+;; ------------------------------------------------------------------------
+`{:name "copy-owl-restriction-to-bio"
+  :description "This rule makes a copy of all owl:Restriction instances and connects the copy to a generated Restriction Record instance."
+  :head ((?/restriction_record obo/IAO_0000219 ?/obo_restriction) ;; obo:denotes
+         (?/restriction_record rdf/type ccp/IAO_EXT_0000305) ;; ccp:OWL restriction record
+         (?/restriction_record obo/IAO_0000219 ?/bio_restriction) ;; obo:denotes
+         (?/bio_restriction rdf/type owl/Restriction)
+         (?/bio_restriction owl/onProperty ?/bio_property))
+  :reify ([?/bio_restriction {:ln (:restriction)
+                     :ns "ccp" :prefix "RS_"}]
+          [?/restriction_record {:ln (:sha-1 ?/obo_restriction)
+                     :ns "ccp" :prefix "R_"}])
+  :sparql-string "prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                  prefix owl: <http://www.w3.org/2002/07/owl#>
+                  prefix obo: <http://purl.obolibrary.org/obo/>
+                  select ?obo_restriction ?bio_property where {
+                  ?obo_restriction rdf:type owl:Restriction .
+                  filter(contains(str(?obo_restriction), '/bnode/'))
+                  ?obo_restriction owl:onProperty ?property .
+                  ?property_id obo:IAO_0000219 ?property .
+                  ?property_id obo:IAO_0000219 ?bio_property .
+                  filter (?property != ?bio_property)
+                  }"
+  }


adds query to get frequencies of hostnames per log entries with a sent-ts value

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


Add 'move-ns': refactoring tool to rename a namespace (alpha)

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

--- src/main/clojure/clojure/tools/namespace/move.clj
+++ src/main/clojure/clojure/tools/namespace/move.clj
@@ -0,0 +1,77 @@
+;; Copyright (c) Stuart Sierra, 2012. All rights reserved. The use and
+;; distribution terms for this software are covered by the Eclipse
+;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+;; which can be found in the file epl-v10.html at the root of this
+;; distribution. By using this software in any fashion, you are
+;; agreeing to be bound by the terms of this license. You must not
+;; remove this notice, or any other, from this software.
+
+(ns clojure.tools.namespace.move
+  (:require [clojure.string :as str]
+            [clojure.java.io :as io])
+  (:import (java.io File)))
+
+(defn- update-file
+  "Read file as a string, call f on file plus any args, then write out
+  return value of f as the new contents of file."
+  [file f & args]
+  (spit file (str (apply f (slurp file) args))))
+
+(defn- ns-file-name [sym]
+  (str (-> (name sym)
+           (str/replace #"-" "_")
+           (str/replace #"\." File/separator))
+       ".clj"))
+
+(defn- clojure-source-files [dirs]
+  (->> dirs
+       (map io/file)
+       (filter #(.exists %))
+       (mapcat file-seq)
+       (filter #(and (.isFile %) (.endsWith (.getName %) ".clj")))
+       (map #(.getCanonicalFile %))))
+
+(def ^:private symbol-regex
+  ;; LispReader.java uses #"[:]?([\D&&[^/]].*/)?([\D&&[^/]][^/]*)" but
+  ;; that's too broad; we don't want a whole namespace-qualified symbol,
+  ;; just each part individually.
+  #"[a-zA-Z0-9$%*+=?!<>_-]['.a-zA-Z0-9$%*+=?!<>_-]*")
+
+(defn replace-ns-symbol
+  "ALPHA: subject to change. Given Clojure source as a string, replaces
+  all occurances of the namespace name old-sym with new-sym and
+  returns modified source as a string."
+  [source old-sym new-sym]
+  (let [old-name (name old-sym)
+        new-name (name new-sym)]
+    ;; A lossless parser would be better, but this is adequate
+    (str/replace source symbol-regex
+                 (fn [match]
+                   (if (= match old-name)
+                     new-name
+                     match)))))
+
+(defn move-ns-file
+  "ALPHA: subject to change. Moves the .clj source file (found relative
+  to source-path) for the namespace named old-sym to a file for a
+  namespace named new-sym."
+  [old-sym new-sym source-path]
+  (let [old-file (io/file source-path (ns-file-name old-sym))
+        new-file (io/file source-path (ns-file-name new-sym))]
+    (.mkdirs (.getParentFile new-file))
+    (io/copy old-file new-file)
+    (.delete old-file)
+    (loop [dir (.getParentFile old-file)]
+      (when (empty? (.listFiles dir))
+        (.delete dir)
+        (recur (.getParentFile dir))))))
+
+(defn move-ns
+  "ALPHA: subject to change. Moves the .clj source file (found relative
+  to source-path) for the namespace named old-sym to new-sym
+  and replace all occurances of the old name with the new
+  name in all Clojure source files found in dirs."
+  [old-sym new-sym source-path dirs]
+  (move-ns-file old-sym new-sym source-path)
+  (doseq [file (clojure-source-files dirs)]
+    (update-file file replace-ns-symbol old-sym new-sym)))


[WM] indentation fix

[WM] indentation fix

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


Scale all periods from minutes.

Scale all periods from minutes.


updated for dev work

updated for dev work

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


Added some (initial) code for clojure speed tests

error: pathspec 'src/net/slreynolds/ds/speedtest.clj' did not match any file(s) known to git

--- src/net/slreynolds/ds/speedtest.clj
+++ src/net/slreynolds/ds/speedtest.clj
@@ -0,0 +1,21 @@
+(ns net.slreynolds.ds.speedtest)
+
+(defn measure-space[setup dowork]
+
+        (let [computation 7
+              o (setup)]
+          (System/gc)
+          (System/gc)
+          (System/gc)
+          (let [runt (Runtime/getRuntime)
+                before (. runt totalMemory)
+                res (dowork o)
+                (System/gc)
+                (System/gc)
+                (System/gc)
+                after (. runt totalMemory)
+                otherComp (+ computation (. res getIntParam))]
+            (Math/max 0 (- after before)))))
+
+
+


Adding doo runner

Adding doo runner

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/xcthulhu/clj-bitauth.git/'


adding a CSS class to aside menu, for assistance in mobile styling

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


added traversal algorithm for breadth and depth first

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

--- src/clj/owl/graph.clj
+++ src/clj/owl/graph.clj
@@ -0,0 +1,26 @@
+(ns owl.graph
+  (:require
+   [clojure.set :as set]))
+
+(defn traverse
+  ([structure f initial graph]
+     (traverse structure f initial graph (rand-nth (keys graph))))
+  ([structure f initial graph start]
+     (loop [structure (conj structure start)
+            visited #{start}
+            result initial]
+       (if-let [node (first structure)]
+         (let [shrink (pop structure)
+               neighbors (get graph node)
+               unvisited (remove visited neighbors)
+               expanded (reduce
+                         (fn [structure neighbor]
+                           (conj structure neighbor))
+                         shrink unvisited)
+               visited (set/union visited (set neighbors))
+               iteration (f result node)]
+           (recur expanded visited iteration))
+         result))))
+
+(def breadth-first (partial traverse (clojure.lang.PersistentQueue/EMPTY)))
+(def depth-first (partial traverse nil))


Add support for proxy-user and proxy-pass to authenticate to proxies

See: #153

--- src/clj_http/core.clj
+++ src/clj_http/core.clj
@@ -35,9 +35,9 @@
 (defn parse-headers
   "Takes a HeaderIterator and returns a map of names to values.

-   If a name appears more than once (like `set-cookie`) then the value
-   will be a vector containing the values in the order they appeared
-   in the headers."
+  If a name appears more than once (like `set-cookie`) then the value
+  will be a vector containing the values in the order they appeared
+  in the headers."
   [^HeaderIterator headers & [use-header-maps-in-response?]]
   (if-not use-header-maps-in-response?
     (->> (headers/header-iterator-seq headers)
@@ -204,14 +204,15 @@

 (defn request
   "Executes the HTTP request corresponding to the given Ring request map and
-   returns the Ring response map corresponding to the resulting HTTP response.
-
-   Note that where Ring uses InputStreams for the request and response bodies,
-   the clj-http uses ByteArrays for the bodies."
+  returns the Ring response map corresponding to the resulting HTTP response.
+
+  Note that where Ring uses InputStreams for the request and response bodies,
+  the clj-http uses ByteArrays for the bodies."
   [{:keys [request-method scheme server-name server-port uri query-string
            headers body multipart socket-timeout conn-timeout proxy-host
-           proxy-ignore-hosts proxy-port as cookie-store retry-handler
-           response-interceptor digest-auth connection-manager client-params]
+           proxy-ignore-hosts proxy-port proxy-user proxy-pass as cookie-store
+           retry-handler response-interceptor digest-auth connection-manager
+           client-params]
     :as req}]
   (let [^ClientConnectionManager conn-mgr
         (or connection-manager
@@ -241,6 +242,11 @@
        (.getCredentialsProvider http-client)
        (AuthScope. nil -1 nil)
        (UsernamePasswordCredentials. user pass)))
+    (when (and proxy-user proxy-pass)
+      (let [authscope (AuthScope. proxy-host proxy-port)
+            creds (UsernamePasswordCredentials. proxy-user proxy-pass)]
+        (.setCredentials (.getCredentialsProvider http-client)
+                         authscope creds)))
     (let [http-url (str scheme "://" server-name
                         (when server-port (str ":" server-port))
                         uri


Add reg-deadline and type to context

Add reg-deadline and type to context

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


Iteració 5 - Eliminar duplicat de server.clj

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


Spelling matters

Spelling matters


Minor test cleanup

Minor test cleanup

--- test/riemann/streams_test.clj
+++ test/riemann/streams_test.clj
@@ -1104,27 +1104,14 @@
            (em 12 200)))

 (deftest changed-test
-         (let [output (atom [])
-               r (changed :state (append output))
-               r2 (changed :state {:init :ok}
-                           (append output))
-               states [:ok :bad :bad :ok :ok :ok :evil :bad]]
-
-           ; Apply states
-           (doseq [state states]
-             (r {:state state}))
-
-           ; Check output
-           (is (= [:ok :bad :ok :evil :bad]
-                  (vec (map (fn [s] (:state s)) (deref output)))))
-
-           ; Test with init
-           (reset! output [])
-           (doseq [state states]
-             (r2 {:state state}))
-
-           (is (= [:bad :ok :evil :bad]
-                  (vec (map (fn [s] (:state s)) (deref output)))))))
+  (let [states (partial map (partial hash-map :state))]
+    (test-stream (changed :state)
+                 (states [:ok :bad :bad :ok :ok :ok :evil :bad])
+                 (states [:ok :bad :ok :evil :bad]))
+
+    (test-stream (changed :state {:init :ok})
+                 (states [:ok :bad :bad :ok :ok :evil :bad])
+                 (states [:bad :ok :evil :bad]))))

 (deftest changed-with-previous-test
          (let [output (atom [])
@@ -1185,7 +1172,9 @@
            (doseq [event events]
              (s event))
            (is (= 6 (deref i)))))
+
 (deftest within-test
+(logging/suppress ["riemann.streams"]
          (let [output (ref [])
                r (within [1 2]
                          (fn [e] (dosync (alter output conj e))))
@@ -1193,9 +1182,10 @@
                expect [1 1.5 2]]

            (doseq [m metrics] (r {:metric m}))
-           (is (= expect (vec (map (fn [s] (:metric s)) (deref output)))))))
+           (is (= expect (vec (map (fn [s] (:metric s)) (deref output))))))))

 (deftest without-test
+(logging/suppress ["riemann.streams"]
          (let [output (ref [])
                r (without [1 2]
                          (fn [e] (dosync (alter output conj e))))
@@ -1203,9 +1193,10 @@
                expect [0.5 2.5]]

            (doseq [m metrics] (r {:metric m}))
-           (is (= expect (vec (map (fn [s] (:metric s)) (deref output)))))))
+           (is (= expect (vec (map (fn [s] (:metric s)) (deref output))))))))

 (deftest over-test
+(logging/suppress ["riemann.streams"]
          (let [output (ref [])
                r (over 1.5
                          (fn [e] (dosync (alter output conj e))))
@@ -1213,9 +1204,10 @@
                expect [2 2.5]]

            (doseq [m metrics] (r {:metric m}))
-           (is (= expect (vec (map (fn [s] (:metric s)) (deref output)))))))
+           (is (= expect (vec (map (fn [s] (:metric s)) (deref output))))))))

 (deftest under-test
+(logging/suppress ["riemann.streams"]
          (let [output (ref [])
                r (under 1.5
                          (fn [e] (dosync (alter output conj e))))
@@ -1223,7 +1215,7 @@
                expect [0.5 1]]

            (doseq [m metrics] (r {:metric m}))
-           (is (= expect (vec (map (fn [s] (:metric s)) (deref output)))))))
+           (is (= expect (vec (map (fn [s] (:metric s)) (deref output))))))))

 (deftest ewma-timeless-test
          (test-stream (ewma-timeless 0)


Remove :focus from streams test.

Remove :focus from streams test.

--- test/riemann/test/streams.clj
+++ test/riemann/test/streams.clj
@@ -649,7 +649,7 @@

              )))

-(deftest ^:focus rate-threaded
+(deftest rate-threaded
          (let [output (atom nil)
                interval 5/2
                total 10000


capitalize metabase

capitalize metabase

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

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

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

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


Etiketak egileen paralelo

Etiketak egileen paralelo

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


Functional annotations API

Functional annotations API

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


Add components.cljs

Add components.cljs

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

--- app/src/cljs/app/components.cljs
+++ app/src/cljs/app/components.cljs
@@ -0,0 +1,15 @@
+(ns app.components)
+
+(defn section-component
+  [content]
+  [:div.ressection
+   content])
+
+(defn about-component
+  [description]
+  [:div
+   [section-component
+    [:div.aboutheader
+     [:h3 "Profile"]]
+    [:div.aboutdescription
+     description]]])


add lib of helpful fns

add lib of helpful fns

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

--- test/testlib.clj
+++ test/testlib.clj
@@ -0,0 +1,21 @@
+(ns navigator.testslib)
+
+(defmacro should-throw
+  "Borrowed from https://github.com/Datomic/day-of-datomic .
+   Runs forms, expecting an exception. Returns exception message if an
+   exception occurred, and false if no exception occurred."
+  [& forms]
+  `(try
+     ~@forms
+     false
+     (catch Exception t#
+       (str "Got expected exception:\n\t" (.getMessage t#)))))
+
+(defn ensure-tx [tx]
+  (= '(:db-before :db-after :tx-data :tempids) (keys @tx)))
+
+(defn ensure-seq-txs [txs]
+  (every? ensure-tx txs))
+
+(defn predict-entity-map [e]
+  (merge (into {} e) {:db/id -1}))


fic repository namespace

fic repository namespace

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/Yleisradio/yle-api-template.git/'


Persistance related to gov logs.

Persistance related to gov logs.

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

--- src/clj/freefrog/persistence.clj
+++ src/clj/freefrog/persistence.clj
@@ -0,0 +1,41 @@
+;
+; Copyright © 2014 Courage Labs
+;
+; This file is part of Freefrog.
+;
+; Freefrog is free software: you can redistribute it and/or modify
+; it under the terms of the GNU Affero General Public License as published by
+; the Free Software Foundation, either version 3 of the License, or
+; (at your option) any later version.
+;
+; Freefrog 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 Affero General Public License for more details.
+;
+; You should have received a copy of the GNU Affero General Public License
+; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;
+
+(ns freefrog.persistence)
+
+(defn new-governance-log
+  "Creates a new governance log for the circle using the given input log. The
+  path given is a series of role names starting with the anchor circle. Returns
+  the unique ID of this newly created governance log."
+  [circle-path log])
+
+(defn get-governance-log
+  "Return the specified governance log for the circle. Throws
+  EntityNotFoundException if the specified log or circle does not exist."
+  [circle-path log-id])
+
+(defn put-governance-log
+  "Store the governance log for the specified circle and ID. Throws
+  EntityNotFoundException if the specified log or circle does not exist."
+  [circle-path log-id log])
+
+(defn get-all-governance-logs
+  "Return a collection of all of the governance logs for the circle. Throws
+  EntityNotFoundException if the circle does not exist."
+  [circle-path])


Fixed loading of book dictionary

Fixed loading of book dictionary

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


wip: pdfa

wip: pdfa

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

--- examples/src/worksheets/pdfa.clj
+++ examples/src/worksheets/pdfa.clj
@@ -0,0 +1,139 @@
+;; gorilla-repl.fileformat = 1
+
+;; **
+;;; # Probabilistic Deterministic Finite Automata
+;; **
+
+;; @@
+(ns pdfa
+  (:require anglican.infcomp.csis
+            anglican.smc
+            anglican.infcomp.core
+            [anglican.infcomp.network :refer :all]
+            [anglican.inference :refer [infer]]
+            [anglican.stat :refer [empirical-distribution collect-predicts collect-by collect-results]]
+            [helpers.gmm :refer [normalize]])
+  (:use [anglican emit runtime]
+        [gorilla-plot core]))
+
+(anglican.infcomp.core/reset-infcomp-addressing-scheme!)
+;; @@
+;; =>
+;;; {"type":"html","content":"#function[anglican.infcomp.core/reset-infcomp-addressing-scheme!$fn--27417$fn--27418]","value":"#function[anglican.infcomp.core/reset-infcomp-addressing-scheme!$fn--27417$fn--27418]"}
+;; <=
+
+;; **
+;;; ## Model
+;; **
+
+;; @@
+(with-primitive-procedures [normalize]
+  (defquery pdfa [observedsequence alphabet]
+    (let [K (sample (uniform-discrete 1 5))
+          nextstatedist (discrete (repeat K 1))
+          emissionprior (fn [] (normalize (repeatedly (count alphabet) (fn [] (sample (uniform-continuous 0 1))))))
+          transition (mem (fn [state symbol] (sample nextstatedist)))
+          emissiondist (mem (fn [state] (categorical (zipmap alphabet (emissionprior)))))
+          N (count observedsequence)]
+      (loop [obs observedsequence
+             state [0]]
+        (if (not (empty? obs))
+          (let [currentstate (peek state)
+                _ (observe (emissiondist currentstate) (first obs))
+                nextstate (transition currentstate (first obs))]
+            (recur (rest obs)
+                   (conj state nextstate)))
+          {:statesequence state})))))
+;; @@
+;; =>
+;;; {"type":"html","content":"#'pdfa/pdfa","value":"#'pdfa/pdfa"}
+;; <=
+
+;; **
+;;; ## Train a compilation artifact
+;; **
+
+;; @@
+(def alphabet [0 1 2 3 4])
+(sample-observes-from-prior pdfa [(repeat 10 nil) alphabet])
+;; @@
+;; =>
+;;; {"type":"list-like","open":"[","close":"]","separator":" ","items":[{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":time-index","value":":time-index"},{"type":"html","content":"0","value":"0"}],"value":"[:time-index 0]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-address","value":":observe-address"},{"type":"html","content":"O11","value":"O11"}],"value":"[:observe-address O11]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-instance","value":":observe-instance"},{"type":"html","content":"0","value":"0"}],"value":"[:observe-instance 0]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":value","value":":value"},{"type":"html","content":"4","value":"4"}],"value":"[:value 4]"}],"value":"{:time-index 0, :observe-address O11, :observe-instance 0, :value 4}"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":time-index","value":":time-index"},{"type":"html","content":"1","value":"1"}],"value":"[:time-index 1]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-address","value":":observe-address"},{"type":"html","content":"O11","value":"O11"}],"value":"[:observe-address O11]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-instance","value":":observe-instance"},{"type":"html","content":"1","value":"1"}],"value":"[:observe-instance 1]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":value","value":":value"},{"type":"html","content":"2","value":"2"}],"value":"[:value 2]"}],"value":"{:time-index 1, :observe-address O11, :observe-instance 1, :value 2}"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":time-index","value":":time-index"},{"type":"html","content":"2","value":"2"}],"value":"[:time-index 2]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-address","value":":observe-address"},{"type":"html","content":"O11","value":"O11"}],"value":"[:observe-address O11]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-instance","value":":observe-instance"},{"type":"html","content":"2","value":"2"}],"value":"[:observe-instance 2]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":value","value":":value"},{"type":"html","content":"0","value":"0"}],"value":"[:value 0]"}],"value":"{:time-index 2, :observe-address O11, :observe-instance 2, :value 0}"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":time-index","value":":time-index"},{"type":"html","content":"3","value":"3"}],"value":"[:time-index 3]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-address","value":":observe-address"},{"type":"html","content":"O11","value":"O11"}],"value":"[:observe-address O11]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-instance","value":":observe-instance"},{"type":"html","content":"3","value":"3"}],"value":"[:observe-instance 3]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":value","value":":value"},{"type":"html","content":"1","value":"1"}],"value":"[:value 1]"}],"value":"{:time-index 3, :observe-address O11, :observe-instance 3, :value 1}"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":time-index","value":":time-index"},{"type":"html","content":"4","value":"4"}],"value":"[:time-index 4]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-address","value":":observe-address"},{"type":"html","content":"O11","value":"O11"}],"value":"[:observe-address O11]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-instance","value":":observe-instance"},{"type":"html","content":"4","value":"4"}],"value":"[:observe-instance 4]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":value","value":":value"},{"type":"html","content":"3","value":"3"}],"value":"[:value 3]"}],"value":"{:time-index 4, :observe-address O11, :observe-instance 4, :value 3}"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":time-index","value":":time-index"},{"type":"html","content":"5","value":"5"}],"value":"[:time-index 5]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-address","value":":observe-address"},{"type":"html","content":"O11","value":"O11"}],"value":"[:observe-address O11]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-instance","value":":observe-instance"},{"type":"html","content":"5","value":"5"}],"value":"[:observe-instance 5]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":value","value":":value"},{"type":"html","content":"3","value":"3"}],"value":"[:value 3]"}],"value":"{:time-index 5, :observe-address O11, :observe-instance 5, :value 3}"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":time-index","value":":time-index"},{"type":"html","content":"6","value":"6"}],"value":"[:time-index 6]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-address","value":":observe-address"},{"type":"html","content":"O11","value":"O11"}],"value":"[:observe-address O11]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-instance","value":":observe-instance"},{"type":"html","content":"6","value":"6"}],"value":"[:observe-instance 6]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":value","value":":value"},{"type":"html","content":"3","value":"3"}],"value":"[:value 3]"}],"value":"{:time-index 6, :observe-address O11, :observe-instance 6, :value 3}"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":time-index","value":":time-index"},{"type":"html","content":"7","value":"7"}],"value":"[:time-index 7]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-address","value":":observe-address"},{"type":"html","content":"O11","value":"O11"}],"value":"[:observe-address O11]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-instance","value":":observe-instance"},{"type":"html","content":"7","value":"7"}],"value":"[:observe-instance 7]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":value","value":":value"},{"type":"html","content":"0","value":"0"}],"value":"[:value 0]"}],"value":"{:time-index 7, :observe-address O11, :observe-instance 7, :value 0}"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":time-index","value":":time-index"},{"type":"html","content":"8","value":"8"}],"value":"[:time-index 8]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-address","value":":observe-address"},{"type":"html","content":"O11","value":"O11"}],"value":"[:observe-address O11]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-instance","value":":observe-instance"},{"type":"html","content":"8","value":"8"}],"value":"[:observe-instance 8]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":value","value":":value"},{"type":"html","content":"1","value":"1"}],"value":"[:value 1]"}],"value":"{:time-index 8, :observe-address O11, :observe-instance 8, :value 1}"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":time-index","value":":time-index"},{"type":"html","content":"9","value":"9"}],"value":"[:time-index 9]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-address","value":":observe-address"},{"type":"html","content":"O11","value":"O11"}],"value":"[:observe-address O11]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":observe-instance","value":":observe-instance"},{"type":"html","content":"9","value":"9"}],"value":"[:observe-instance 9]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":value","value":":value"},{"type":"html","content":"0","value":"0"}],"value":"[:value 0]"}],"value":"{:time-index 9, :observe-address O11, :observe-instance 9, :value 0}"}],"value":"[{:time-index 0, :observe-address O11, :observe-instance 0, :value 4} {:time-index 1, :observe-address O11, :observe-instance 1, :value 2} {:time-index 2, :observe-address O11, :observe-instance 2, :value 0} {:time-index 3, :observe-address O11, :observe-instance 3, :value 1} {:time-index 4, :observe-address O11, :observe-instance 4, :value 3} {:time-index 5, :observe-address O11, :observe-instance 5, :value 3} {:time-index 6, :observe-address O11, :observe-instance 6, :value 3} {:time-index 7, :observe-address O11, :observe-instance 7, :value 0} {:time-index 8, :observe-address O11, :observe-instance 8, :value 1} {:time-index 9, :observe-address O11, :observe-instance 9, :value 0}]"}
+;; <=
+
+;; @@
+(defn combine-observes-fn [observes]
+  (map :value observes))
+;; @@
+;; =>
+;;; {"type":"html","content":"#'pdfa/combine-observes-fn","value":"#'pdfa/combine-observes-fn"}
+;; <=
+
+;; @@
+(def torch-connection (start-torch-connection pdfa [(repeat 10 nil) alphabet] combine-observes-fn))
+;; @@
+;; =>
+;;; {"type":"html","content":"#'pdfa/torch-connection","value":"#'pdfa/torch-connection"}
+;; <=
+
+;; @@
+;; Stop the Torch connection
+(stop-torch-connection torch-connection)
+;; @@
+;; =>
+;;; {"type":"html","content":""Torch connection terminated."","value":"\"Torch connection terminated.\""}
+;; <=
+
+;; **
+;;; ## Inference
+;; **
+
+;; @@
+(def test-observations
+  (combine-observes-fn (sample-observes-from-prior pdfa [(repeat 10 nil) alphabet])))
+test-observations
+;; @@
+;; =>
+;;; {"type":"list-like","open":"(","close":")","separator":" ","items":[{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"1","value":"1"},{"type":"html","content":"1","value":"1"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"1","value":"1"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"}],"value":"(0 0 1 1 0 1 0 0 0 0)"}
+;; <=
+
+;; **
+;;; ### Infcomp
+;;;
+;;; First, run the inference server from torch-infcomp:
+;;;
+;;; `python -m infcomp.infer`
+;;;
+;;; Then run the query, specifying number of particles:
+;; **
+
+;; @@
+(def num-particles 1000)
+(def csis-states (take num-particles (infer :csis pdfa [test-observations alphabet])))
+(repeatedly 1 #(sample* (categorical (vec (empirical-distribution (collect-results csis-states))))))
+;; @@
+;; =>
+;;; {"type":"list-like","open":"(","close":")","separator":" ","items":[{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":statesequence","value":":statesequence"},{"type":"list-like","open":"[","close":"]","separator":" ","items":[{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"}],"value":"[0 0 0 0 0 0 0 0 0 0 0]"}],"value":"[:statesequence [0 0 0 0 0 0 0 0 0 0 0]]"}],"value":"{:statesequence [0 0 0 0 0 0 0 0 0 0 0]}"}],"value":"({:statesequence [0 0 0 0 0 0 0 0 0 0 0]})"}
+;; <=
+
+;; @@
+(def num-particles 1000)
+(def is-states (take num-particles (infer :importance pdfa [test-observations alphabet])))
+(repeatedly 1 #(sample* (categorical (vec (empirical-distribution (collect-results is-states))))))
+;; @@
+;; =>
+;;; {"type":"list-like","open":"(","close":")","separator":" ","items":[{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":statesequence","value":":statesequence"},{"type":"list-like","open":"[","close":"]","separator":" ","items":[{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"}],"value":"[0 0 0 0 0 0 0 0 0 0 0]"}],"value":"[:statesequence [0 0 0 0 0 0 0 0 0 0 0]]"}],"value":"{:statesequence [0 0 0 0 0 0 0 0 0 0 0]}"}],"value":"({:statesequence [0 0 0 0 0 0 0 0 0 0 0]})"}
+;; <=
+
+;; @@
+(def num-particles 1000)
+(def smc-states (take num-particles (infer :smc pdfa [test-observations alphabet] :number-of-particles 1000)))
+(repeatedly 1 #(sample* (categorical (vec (empirical-distribution (collect-results smc-states))))))
+;; @@
+;; =>
+;;; {"type":"list-like","open":"(","close":")","separator":" ","items":[{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":statesequence","value":":statesequence"},{"type":"list-like","open":"[","close":"]","separator":" ","items":[{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"},{"type":"html","content":"0","value":"0"}],"value":"[0 0 0 0 0 0 0 0 0 0 0]"}],"value":"[:statesequence [0 0 0 0 0 0 0 0 0 0 0]]"}],"value":"{:statesequence [0 0 0 0 0 0 0 0 0 0 0]}"}],"value":"({:statesequence [0 0 0 0 0 0 0 0 0 0 0]})"}
+;; <=
+
+;; @@
+
+;; @@


start on high-level integration test

start on high-level integration test

hoping to walk through the entire process of generating
and transferring outputs between a pair of keys.

hoping to get this to a point that it can
rebuild a simple chain from scratch each
time so that we don't have to rely on a serialized
static chain for testing

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

--- test/block_chain/integration_test.clj
+++ test/block_chain/integration_test.clj
@@ -0,0 +1,67 @@
+(ns block-chain.integration-test
+  (:require [clojure.test :refer :all]
+            [clojure.tools.namespace.repl :refer [refresh]]
+            [clojure.math.numeric-tower :as math]
+            [block-chain.chain :as bc]
+            [block-chain.utils :refer :all]
+            [block-chain.wallet :as wallet]
+            [block-chain.pem :as pem]
+            [block-chain.blocks :as blocks]
+            [block-chain.miner :as miner]))
+
+
+(def key-a (wallet/generate-keypair 512))
+(def pem-a (pem/public-key->pem-string (.getPublic key-a)))
+(def key-b (wallet/generate-keypair 512))
+(def pem-b (pem/public-key->pem-string (.getPublic key-b)))
+
+(def easy-difficulty-target (hex-string (math/expt 2 243)))
+
+(deftest generating-coinbase
+  (let [cb (miner/coinbase pem-a)]
+    (is (= [:inputs :outputs :timestamp :hash] (keys cb)))
+    (is (= (:hash cb)
+           (get-in cb [:outputs 0 :coords :transaction-id])))))
+
+(deftest test-generating-block
+  (let [cb (miner/coinbase pem-a)
+        block (blocks/generate-block
+               [cb]
+               {:target easy-difficulty-target
+                :chain []})]
+    (is (= [:header :transactions] (keys block)))
+    (is (= [:parent-hash :transactions-hash
+            :target :timestamp :nonce] (keys (:header block))))
+    (is (nil? (:hash block)))
+    (is (= (hex-string 0) (get-in block [:header :parent-hash])))
+    ))
+
+(deftest test-hashing-block
+  (let [block (blocks/hashed
+               (blocks/generate-block
+                [(miner/coinbase pem-a)]
+                {:target easy-difficulty-target}))]
+    (is (get-in block [:header :hash]))
+    (is (= 0 (get-in block [:header :nonce])))
+    (is (not (blocks/meets-target? block)))))
+
+(deftest test-mining-block
+  (let [block (miner/mine
+               (blocks/hashed
+                (blocks/generate-block
+                 [(miner/coinbase pem-a)]
+                 {:target easy-difficulty-target})))]
+    (is (blocks/meets-target? block))
+    (is (> (get-in block [:header :nonce]) 0))))
+
+(deftest test-committing-block-to-chain
+  (let [b (blocks/generate-block
+           [(miner/coinbase pem-a)]
+           {:target easy-difficulty-target})
+        chain (atom [])]
+    (miner/mine-and-commit chain b)
+    (is (= 1 (count @chain)))))
+
+
+(deftest test-mining-multiple-blocks
+  )


Add snippets for Shape - 3D Primitives category. Issue #87.

error: pathspec 'test/snippets/shape/3d_primitives.clj' did not match any file(s) known to git

--- test/snippets/shape/3d_primitives.clj
+++ test/snippets/shape/3d_primitives.clj
@@ -0,0 +1,26 @@
+(ns snippets.shape.3d-primitives
+  (:require [quil.snippet :refer [defsnippet]]
+            [quil.core :refer :all]))
+
+(defsnippet box-s {:renderer :p3d}
+  (camera 200 200 200 0 0 0 0 0 -1)
+  (with-translation [100 0 0]
+    (box 70))
+  (with-translation [0 100 0]
+    (box 70 100 50)))
+
+(defsnippet sphere-s {:renderer :p3d}
+  (camera 200 200 200 0 0 0 0 0 -1)
+  (sphere 150))
+
+(defsnippet sphere-detail-s {:renderer :p3d}
+  (camera 200 200 200 0 0 0 0 0 -1)
+  (sphere-detail 30) ; default
+  (with-translation [0 0 100]
+    (sphere 70))
+  (sphere-detail 15)
+  (with-translation [100 0 0]
+    (sphere 70))
+  (sphere-detail 30 5)
+  (with-translation [0 100 0]
+    (sphere 70)))


Added a very basic integration test (needs 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/lshift/event-framework.git/'


sorting users my achievements amount

sorting users my achievements amount

--- src-cljs/acha.cljs
+++ src-cljs/acha.cljs
@@ -125,7 +125,7 @@
     (s/html
       [:.window
         (header)
-        (users-pane (u/qes-by db :user/id))
+        (users-pane (->> (u/qes-by db :user/id) (sort-by :user/ach) reverse))
         (repo-pane  (u/qes-by db :repo/name))])))

 (r/defc repo-page [db id]


configuration update

configuration update

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


friendlier fully booked message

friendlier fully booked message

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


fixed example

fixed example

--- example/src/example/cube.cljs
+++ example/src/example/cube.cljs
@@ -3,8 +3,7 @@
    [sablono.core :as sab :include-macros true]
    [cljs.core.async :as async])
   (:require-macros
-   [cljs.core.async.macros :refer [go-loop]]
-   [figwheel.client :refer [defonce]]))
+   [cljs.core.async.macros :refer [go-loop]]))

 ;; A more advanced example using React and Sablono
 ;; you can edit any of this live


Log moar

Log moar


Start an examples directory

Start an examples directory

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

--- examples/simple.clj
+++ examples/simple.clj
@@ -0,0 +1,7 @@
+(def greet
+  (fn [name]
+    (console.log "hey" name)))
+
+(def user "honza")
+
+(greet user)


Spike.

Spike.

error: pathspec 'src/cljs/idealist/event-bus.cljs' did not match any file(s) known to git

--- src/cljs/idealist/event-bus.cljs
+++ src/cljs/idealist/event-bus.cljs
@@ -0,0 +1,5 @@
+(ns idealist.event-bus
+  (:require [om.core :as om :include-macros true]
+            [om.dom :as dom :include-macros true]
+            [cljs.core.async :as async :refer [<! >!]])
+  (:require-macros [cljs.core.async.macros :refer [go go-loop]]))


Add namespace for common command fx

Add namespace for common command fx

error: pathspec 'src/braid/base/server/cqrs_fx.clj' did not match any file(s) known to git

--- src/braid/base/server/cqrs_fx.clj
+++ src/braid/base/server/cqrs_fx.clj
@@ -0,0 +1,12 @@
+(ns braid.base.server.cqrs-fx
+  "Namespace that collects common CQRS command fx"
+  (:require
+    [braid.base.server.socket :as socket]
+    [braid.core.server.sync-helpers :as helpers]
+    [braid.core.server.db :as db]))
+
+(def run-txns! db/run-txns! )
+
+(def chsk-send! socket/chsk-send!)
+
+(def group-broadcast! helpers/broadcast-group-change)


move sequential partition much further up, set a saner split between scalars and aggregates

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


Added a go loop to listen to events and log them

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

--- src/ctia/logging.clj
+++ src/ctia/logging.clj
@@ -0,0 +1,13 @@
+(ns ctia.logging
+  (:require [clojure.tools.logging :as log]
+            [clojure.core.async :as a :refer [go <!]]
+            [ctia.events :as e]
+            [schema.core :as s])
+  (:import [clojure.core.asyc.impl.protocols Channel]))
+
+(s/defn log-channel :- Channel
+  "Logging an event channel indefinitely. Returns the channel for a go loop that never ends."
+  [{m :mult :as ev} :- e/EventChannel]
+  (go (loop [ev (<! m)]
+        (log/info ev)
+        (recur (<! m)))))


Output final state from eval-component

Output final state from eval-component

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


Cleanup.

Cleanup.

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


replace assert to when in Syncat.nio/rm.

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


Mount API endpoints via context

Mount API endpoints via context

--- src/clj/clojuredocs/entry.clj
+++ src/clj/clojuredocs/entry.clj
@@ -21,7 +21,7 @@
             [clojuredocs.pages.common :as common]
             [clojuredocs.pages :as pages]
             [clojure.pprint :refer (pprint)]
-            [clojuredocs.api :as api]
+            [clojuredocs.api.server :as api.server]
             [somnium.congomongo :as mon]
             [clojure.edn :as edn]
             [clojuredocs.search :as search]))
@@ -79,7 +79,7 @@
   (GET "/clojure_core" [] {:status 301 :headers {"Location" "/"}}))

 (defroutes _routes
-  (context "/api" [] api/routes)
+  (context "/api" [] api.server/routes)
   (var pages/routes)
   ;; Redirect old urls
   (var old-url-redirects)


[WM CS] log file sizes on upload & warn when zero bytes

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


[WM] Bump election-authority-works timeout to 10s

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


Commited core.cljs

Commited core.cljs

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

--- src/cljs/quiz/core.cljs
+++ src/cljs/quiz/core.cljs
@@ -0,0 +1,76 @@
+(ns quiz.core
+  (:use-macros [dommy.macros :only [node sel sel1]])
+  (:require clojure.browser.repl
+            clojure.set
+            [cljs.quiz.questions :as q]
+            [dommy.core :as dommy]
+            ))
+
+(defn set-content [s]
+  (dommy/replace! (sel1 :#app) [:div#app s]))
+
+(defn choice-fn [name choice]
+  [:div [:label.radio
+         {:onclick "quiz.core.able_button()"}
+         [:input {:type    "radio"
+                  :name     name
+                  :value    choice
+                  :data-toggle "radio"}] choice]])
+
+(defn able-button []
+  (if (= (dec (count q/questions))
+         (->> ["input:checked"] sel count))
+    (js/alert "able-now")))
+
+(defn ->question-snippet [q]
+  [:li
+   [:span (:question q)]
+   [:div
+    (map (partial choice-fn (:question q)) (:choices q))]])
+
+(defn count-correct [answers]
+  (let [ans  (set answers)
+        cor  (set (map :answer q/questions))
+        both (clojure.set/intersection ans cor)]
+    (count both)))
+
+(defn end-message [score]
+  (cond
+   (= score 0) "0/18: Wow, go signup for a job at amazon.com"
+   (<= 1 score 5) "1"
+   (<= 6 score 10) "2"
+   (<= 11 score 18) "3"
+   :else "you da man!"))
+
+(defn tally-score []
+  (let [checked-buttons (->> ["input:checked"] sel)
+        given-answers (map #(.-value %) checked-buttons)
+        number-correct (count-correct given-answers)]
+    (set-content
+     [:div
+      [:h2 (end-message number-correct)]
+
+      [:button.btn.btn-hg.btn-primary.btn-embossed.btn-danger
+       {:type "button"
+        :onclick "history.go(0)"}
+       "Let's Try Again"]])))
+
+(defn make-questions []
+  (set-content
+   [:div
+    [:h1 "Hitchhiker's Guide Quiz To The Galaxy!"]
+    [:form
+     [:ol (map ->question-snippet q/questions)]]
+    [:button.btn.btn-hg.btn-primary.btn-embossed.btn-danger
+     {:type "button"
+      :onclick "quiz.core.tally_score()"}
+     "Submit"]]))
+
+(make-questions)
+
+(comment
+
+
+
+  (defn sayhi [] (js/alert "Hello"))
+  (defn whoami [] (.-userAgent js/navigator)))


A bit easier to define event handlers.

A bit easier to define event handlers.


fix tests

fix tests

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


Attepmting to clean up some conds to avoid doing the real work

fatal: unable to access 'https://github.com/michaelsbradleyjr/shen.clj.git/': The requested URL returned error: 403


Add test for complicated pipelines

Add test for complicated pipelines

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

--- test/dataframe/pipeline_test.clj
+++ test/dataframe/pipeline_test.clj
@@ -0,0 +1,22 @@
+(ns dataframe.pipeline-test
+  (:require [dataframe.core :refer :all]
+            [expectations :refer [expect]]))
+
+
+(expect (frame {:a [1 2 3]
+                :b [10 20 30]
+                :c [6 7 8]
+                :d [16 27 38]})
+        (with-> (frame {:a [1 2 3] :b [10 20 30]})
+                (assoc-col :c (add $a 5))
+                (assoc-col :d (add $b $c))))
+
+
+(expect (frame {:c [3 6] :b [2 4] :a [1 2]} [:x :y])
+        (let [df (frame [[:x {:a 1 :b 2}]
+                         [:y {:a 2 :b 4}]
+                         [:z {:a 3 :b 8}]])]
+          (with-> df
+                  (select (lte $a 2))
+                  (assoc-col :c (add $a $b))
+                  (sort-rows :c :b))))


dot3 confusingly has four elements, heh

dot3 confusingly has four elements, heh

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


Leverage new cljs.repl capabilities

Leverage new cljs.repl capabilities

* Make Weasel startup nearly instantly
* Remove flaky server-side tracking of loaded libraries in favor of
  client-side.
* Lean on `goog.require` in the client for loading namespaces.

Weasel is now essentially a dumb pipe between the client and piggieback
with some evaluation and compilation, respectively, on either end.

There may be some issues with leaning on `goog.require` in certain
environments, however.  See Mike Fikes's comment here:

https://github.com/tomjakubowski/weasel/issues/37#issuecomment-68725379

cc #47 #28 (which I believe these changes could fix)

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


Highlight the currently indicated train schedule.

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


declare in right file

declare in right file

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

--- src/clj/just_married/payment.clj
+++ src/clj/just_married/payment.clj
@@ -0,0 +1,3 @@
+(ns just-married.payment)
+
+(declare handle-payment)


removing and updating some comments

removing and updating some comments

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


Write the simplest test I can think of

Write the simplest test I can think of

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

--- test/desdemona/query_test.clj
+++ test/desdemona/query_test.clj
@@ -0,0 +1,9 @@
+(ns desdemona.query-test
+  (:require
+   [desdemona.query :as q]
+   [clojure.test :refer [deftest is]]))
+
+(deftest query-tests
+  (is (= [{:ip "10.0.0.1"}]
+         (q/query '(== (:ip entry) "10.0.0.1")
+                  [{:ip "10.0.0.1"}]))))


Go back to providing completions for all Clojure files

fatal: unable to access 'https://github.com/bsmr-clojure/Nightcode.git/': The requested URL returned error: 403


fix typo

fix typo

--- src/metabase/driver/postgres.clj
+++ src/metabase/driver/postgres.clj
@@ -107,7 +107,7 @@
                                                   {(keyword k) v})))
                                          (reduce conj {}))]
     (cond-> details
-      (string? port) (update-in :port (Integer/parseInt port)))))
+      (string? port) (assoc :port (Integer/parseInt port)))))

 (defn- database->connection-details [{:keys [details]}]
   (let [{:keys [host port] :as details} (if (is-legacy-conn-details? details) (parse-legacy-conn-str (:conn_str details))


[WM] make queue ns look more like ballot-notification-works

Getting a ClassDefNotFound error on incoming message in prod. Not sure
what the cause is, so I'm just trying to eliminate differences from a
working component.

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


For the moment use forward declarations to work around the cyclic dependencies

Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>

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

--- Clojure/src/snake/player_decl.clj
+++ Clojure/src/snake/player_decl.clj
@@ -0,0 +1,5 @@
+(ns snake.player)
+
+(declare
+  set-game-master
+  game-over)


Add bimap to cats.core

Add bimap to cats.core

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


Better find in all-identifier-keys? gives the answer directly

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


fix naming post merge

fix naming post merge

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


source reorg

source reorg

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


remove nrepl

remove nrepl

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


Updating core.async version

Updating core.async version

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


Upgrade to clojure 1.2.1

Upgrade to clojure 1.2.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/terrancesnyder/engulf.git/'


Upgrade Clojure to 1.9

Upgrade Clojure to 1.9

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


Update dependencies

Update dependencies

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


Increase Datomic transaction timeout to 60s

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


Purged unused import.

Purged unused import.

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


Move the views into a separate namespace

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

--- src/mdr2/views.clj
+++ src/mdr2/views.clj
@@ -0,0 +1,33 @@
+(ns mdr2.views
+  (:require [clojure.string :as str]
+            [mdr2.db :as db]
+            [mdr2.layout :as layout]))
+
+(defn home []
+  (layout/common
+   [:h1 "Productions"]
+   [:table.table.table-striped
+    [:thead [:tr [:th "Title"] [:th "State"] [:th "Action"]]]
+    [:tbody
+     (for [p (db/get-productions)]
+       [:tr
+        [:td (:title p)]
+        [:td (:state p)]
+        [:td
+         [:div.btn-toolbar {:role "toolbar"}
+          [:div.btn-group
+           [:button.btn.btn-default {:type "button"}
+            [:span.glyphicon.glyphicon-headphones]]
+           [:button.btn.btn-default {:type "button"}
+            [:span.glyphicon.glyphicon-forward]]
+           [:button.btn.btn-default {:type "button"}
+            [:span.glyphicon.glyphicon-wrench]]
+           [:button.btn.btn-default {:type "button"}
+            [:span.glyphicon.glyphicon-trash]]]]]])]]))
+
+(defn production [id]
+  (let [p (db/get-production id)]
+    (layout/common
+     [:h1 (str "Production: " (:title p))]
+     [:p (:author p)])))
+


use new overdue? api

use new overdue? api

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


Remove unused requires

Remove unused requires


Refactor release task to simplify usage as a library

fatal: unable to access 'https://github.com/kenrestivo/lein-droid.git/': The requested URL returned error: 403


Fixed DELETE relationship

Fixed DELETE relationship

fatal: unable to access 'https://github.com/physion/ovation-webapi.git/': The requested URL returned error: 403


Delete unused worker.clj

Delete unused worker.clj

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


Create resource.clj

Create resource.clj

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

--- src/iyye/bios/resource.clj
+++ src/iyye/bios/resource.clj
@@ -0,0 +1,119 @@
+; Iyye - AI agent
+; Copyright (C) 2016-2017  Sasha Yumzya
+
+; This program is free software: you can redistribute it and/or modify
+; it under the terms of the GNU Affero General Public License as
+; published by the Free Software Foundation, either version 3 of the
+; License, or (at your option) any later version.
+
+; This program 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 Affero General Public License for more details.
+
+; You should have received a copy of the GNU Affero General Public License
+; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+(ns iyye.bios.resource
+  (:require
+    [iyye.bios.task :refer [start-task stop-task]]
+    [iyye.bios.persistence :as persistence]
+    [clojure.tools.logging :as log]))
+
+(defprotocol Resource
+  (get-current-percentage [this]))
+
+; Simple time, e.g. for 30 minutes "day"
+(def thirty-minute-day 1000000)
+
+(defrecord TimeResource [start-time end-time])
+
+(extend-type TimeResource
+  Resource
+  (get-current-percentage [this]
+    (- 100 (float (* 100 (/ (- (System/currentTimeMillis) (:start-time this))
+                            (- (:end-time this) (:start-time this))))))))
+
+(def ^:private all-day-resources (ref ()))
+(def ^:private all-night-resources (ref ()))
+
+(defn register-day-resource [resource]
+  (dosync (alter all-day-resources conj resource)))
+
+(defn register-night-resource [resource]
+  (dosync (alter all-night-resources conj resource)))
+
+(defn are-resources-exhausted? [day]
+  "Returns true if there is a Resource that has left with less than Threshold capacity"
+  (let [start-time (:day-start day)
+        threshold (:threshold day)
+        time-since-start (- (System/currentTimeMillis) start-time)
+        day-time (:day-time day)
+        time-ratio (/ time-since-start day-time)]
+    (if (> (count @all-day-resources) 0)
+      (< (* (reduce + (map get-current-percentage @all-day-resources)) time-ratio) threshold)
+      (< (- 1 time-ratio) threshold))))
+
+(defn are-resources-ok? [day]
+  "Returns if day resources are ok"
+  (if (> (count @all-day-resources) 0)
+    (> (reduce + (map get-current-percentage @all-day-resources)) (- 1 (:threshold day)))
+    true))
+
+(defn are-resources-replenished? [night]
+  "Returns true if all Resources have more than Threshold capacity"
+  (let [threshold (:threshold night)
+        day-resources-ok (are-resources-ok? (:day night))]
+    (if (> (count @all-night-resources) 0)
+      (< (first (sort (map get-current-percentage @all-night-resources))) threshold)
+      day-resources-ok)))
+
+(def num-days (ref 0))
+
+(defrecord DayRoutine [day-start day-time threshold function task-future])
+(defrecord NightRoutine [day night-start night-time threshold function task-future])
+
+(def awake-or-sleep (ref false))
+(defn is-awake? [] @awake-or-sleep)
+(defn is-asleep? []
+  (not is-awake?))
+
+(def DAY_TIME thirty-minute-day)
+(def DAY_THRESHOLD 0.1)
+
+(defn create-day []
+  (DayRoutine. (System/currentTimeMillis) DAY_TIME DAY_THRESHOLD #(Thread/sleep 1000) (ref 0)))
+
+(defn create-night [day]
+  (NightRoutine. day (System/currentTimeMillis) DAY_TIME DAY_THRESHOLD #(Thread/sleep 1000) (ref 0)))
+
+(defn start-day [day]
+  (doall
+    [(start-task day)
+     (dosync ref-set (:day-start day) (System/currentTimeMillis))
+     (dosync ref-set awake-or-sleep true)
+     (dosync (alter num-days inc))
+     (persistence/record-day @num-days)
+     (log/info "next day: " @num-days)]))
+
+(defn is-day-over? [day] (are-resources-exhausted? day))
+
+(defn is-night-over? [night] (are-resources-replenished? night))
+
+(defn start-night [night]
+  (doall
+    [(start-task night)
+     (persistence/record-night @num-days)
+     (dosync ref-set (:night-start night) (System/currentTimeMillis))]))
+
+(defn stop-day [day]
+  (dorun
+    [(stop-task day)
+     (dosync ref-set awake-or-sleep false)]))
+
+(defn stop-night [night]
+  (dorun
+    [(stop-task night)]))
+
+(defn load-day! []
+  (dosync (ref-set num-days (persistence/load-days))))


Update the tests in order to check that the function get-service-by-name function only returns the first matching element.

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