Restored additional navigation items

Restored additional navigation items

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


Add get-output-media-file.

Add get-output-media-file.

error: pathspec 'src/clojure/com/dankee/camera_spike/saving_media.clj' did not match any file(s) known to git

--- src/clojure/com/dankee/camera_spike/saving_media.clj
+++ src/clojure/com/dankee/camera_spike/saving_media.clj
@@ -0,0 +1,32 @@
+(ns com.dankee.camera_spike.saving-media)
+
+; Port of https://developer.android.com/guide/topics/media/camera.html#saving-media
+
+(def media-type-image 1)
+(def media-type-video 2)
+
+(defn create-media-file [type media-storage-dir]
+  (let [timestamp (.. (new java.text.SimpleDateFormat "yyyyMMdd_HHmmss")
+                      (format (new java.util.Date)) )]
+    (case type
+      media-type-image (new java.io.File (str (.getPath media-storage-dir)
+                                              java.io.File/separator
+                                              "IMG_" timestamp ".jpg"))
+      media-type-video (new java.io.File (str (.getPath media-storage-dir)
+                                              java.io.File/separator
+                                              "VID_" timestamp ".mp4"))
+      nil ) ) )
+
+(defn get-output-media-file [type]
+  (let [media-storage-dir (new java.io.File
+                               (android.os.Environment/getExternalStoragePublicDirectory
+                                android.os.Environment/DIRECTORY_PICTURES )
+                               "Camera Spike" )]
+    (if (and (not (.exists media-storage-dir))
+             (not (.mkdirs media-storage-dir)) )
+      (android.util.Log/d "Camera Spike" "failed to create directory")
+      (create-media-file type media-storage-dir) ) ) )
+
+(defn get-output-media-file-uri [type]
+  (android.net.Uri/fromFile (get-output-media-file type)) )
+


Add some src

Add some src

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

--- src/foo/bar.cljs
+++ src/foo/bar.cljs
@@ -0,0 +1,4 @@
+(ns foo.bar
+  (:require ActionSheetIOS))
+
+(defn square [x] (* x x))


basic docker testing

basic docker testing

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

--- test/celestial/test/docker.clj
+++ test/celestial/test/docker.clj
@@ -0,0 +1,15 @@
+(ns celestial.test.docker
+  "Docker construction"
+ (:require
+  [clojure.core.strint :refer (<<)]
+  [celestial.model :refer (vconstruct)]
+  [celestial.fixtures.data :refer [redis-docker-spec]]
+  [celestial.fixtures.core :refer [with-conf with-m?]]
+  )
+ (:use midje.sweet))
+
+
+(with-conf
+  (fact "basic creation"
+     (vconstruct redis-docker-spec) => (contains {})))
+


lortu-erabiltzailea ez deitu

lortu-erabiltzailea ez deitu

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


Fix test errors & indentation

Fix test errors & 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/democracyworks/voter-registration-works.git/'


a start on the ranking

a start on the ranking

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

--- src/app/scores.clj
+++ src/app/scores.clj
@@ -0,0 +1,37 @@
+(ns app.scores)
+
+(defn sample-score [name v1 v2]
+  {
+   :name name
+   :scores [
+            {:priority :time
+             :value v1
+             }
+            {
+             :priority :task
+             :value v2
+             }
+            {
+             :priority :time
+             :value nil
+             }
+            ]
+   }
+  )
+
+; :time sorts <
+; :task sorts >
+; nil value is always last
+(defn rank [scores index]
+  ;sort-by key-fn comparison collection
+  (let [scores-to-rank (map #(get-in % [:scores index]) scores)]
+    (sort-by :value > scores-to-rank)
+    )
+  )
+
+
+(defn sample-scores []
+  [(sample-score "Jeff Vanlandinghame" 22 450) (sample-score "Jeremy Kampen" 20 225)])
+
+(sample-scores)
+(rank (sample-scores) 0)


Changed the report filename

Changed the report filename


Fixin'

Fixin'

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


Lowercase constant variable

Lowercase constant variable

--- src/clojars/web/dashboard.clj
+++ src/clojars/web/dashboard.clj
@@ -7,14 +7,14 @@
 (defn recent-jar [jar-map]
   (let [stats (stats/all)
         description (:description jar-map)
-        TRUNCATE_LENGTH 120]
+        truncate-length 120]
     [:li.col-md-4.col-sm-6.col-xs-12.col-lg-4
      [:div.recent-jar
       [:h3.recent-jar-title
        (jar-link jar-map)]
       [:p.recent-jar-description
-       (if (> (.length description) TRUNCATE_LENGTH)
-         (str (subs description 0 TRUNCATE_LENGTH) "...")
+       (if (> (.length description) truncate-length)
+         (str (subs description 0 truncate-length) "...")
          description)]
       [:p.hint.total-downloads "Downloads: " (stats/download-count stats
                                                                    (:group_name jar-map)


cookie secret generator! just do lein run -m strifescript.scripts.generate-cookie-secret

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

--- src/strifescript/scripts/generate_cookie_secret.clj
+++ src/strifescript/scripts/generate_cookie_secret.clj
@@ -0,0 +1,9 @@
+(ns strifescript.scripts.generate-cookie-secret
+  (:import javax.xml.bind.DatatypeConverter
+           java.security.SecureRandom))
+
+
+(defn -main [& m]
+  (let [seed (byte-array 16)]
+    (.nextBytes (SecureRandom/getInstance "SHA1PRNG") seed)
+    (println (str "COOKIE_SECRET=" (DatatypeConverter/printHexBinary seed)))))


Test for the module db-interface + basic checks

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

--- test/clj_mrazik/db_interface_test.clj
+++ test/clj_mrazik/db_interface_test.clj
@@ -0,0 +1,64 @@
+;
+;  (C) Copyright 2017  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.db-interface-test
+  (:require [clojure.test :refer :all]
+            [clj-mrazik.db-interface :refer :all]))
+
+;
+; Common functions used by tests.
+;
+
+(defn callable?
+    "Test if given function-name is bound to the real function."
+    [function-name]
+    (clojure.test/function? function-name))
+
+;
+; Tests for various functions
+;
+
+(deftest test-select-word-class-id-existence
+    "Check that the clj-mrazik.db-interface/select-word-class-id definition exists."
+    (testing "if the clj-mrazik.db-interface/select-word-class-id definition exists."
+        (is (callable? 'clj-mrazik.db-interface/select-word-class-id))))
+
+
+(deftest test-select-source-id-existence
+    "Check that the clj-mrazik.db-interface/select-source-id definition exists."
+    (testing "if the clj-mrazik.db-interface/select-source-id definition exists."
+        (is (callable? 'clj-mrazik.db-interface/select-source-id))))
+
+
+(deftest test-insert-word-into-dictionary-existence
+    "Check that the clj-mrazik.db-interface/insert-word-into-dictionary definition exists."
+    (testing "if the clj-mrazik.db-interface/insert-word-into-dictionary definition exists."
+        (is (callable? 'clj-mrazik.db-interface/insert-word-into-dictionary))))
+
+
+(deftest test-select-words-existence
+    "Check that the clj-mrazik.db-interface/select-words definition exists."
+    (testing "if the clj-mrazik.db-interface/select-words definition exists."
+        (is (callable? 'clj-mrazik.db-interface/select-words))))
+
+
+(deftest test-select-word-count-existence
+    "Check that the clj-mrazik.db-interface/select-word-count definition exists."
+    (testing "if the clj-mrazik.db-interface/select-word-count definition exists."
+        (is (callable? 'clj-mrazik.db-interface/select-word-count))))
+
+
+(deftest test-all-words-count-existence
+    "Check that the clj-mrazik.db-interface/all-words-count definition exists."
+    (testing "if the clj-mrazik.db-interface/all-words-count definition exists."
+        (is (callable? 'clj-mrazik.db-interface/all-words-count))))
+


dox fix

dox fix

--- src/metabase/api/common/internal.clj
+++ src/metabase/api/common/internal.clj
@@ -80,7 +80,7 @@
   "Expand a ROUTE string like \"/:id\" into a Compojure route form that uses regexes to match
    parameters whose name matches a regex from `*auto-parse-arg-name-patterns*`.

-    (typify-route \"/:id/card\") -> [\"/:id/card\" :id #\"[0-9]+\""
+    (typify-route \"/:id/card\") -> [\"/:id/card\" :id #\"[0-9]+\"]"
   [route]
   (if (vector? route) route
       (let [arg-types (->> (route-arg-keywords route)


Add Post and PostMetadata records, improve posts 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/magoyette/marcandregoyette.com.git/'


Code to create SVG from area data

Code to create SVG from area data

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

--- src/acfe/svg.clj
+++ src/acfe/svg.clj
@@ -0,0 +1,25 @@
+(ns acfe.svg
+  "Helper to turn areas into SVG. Not used in final product.")
+
+
+(defn- render-one
+  [area]
+  (let [f #(* -100 (+ % 39))
+		g #(* 100 (- % 143))
+		fill (get {"Grampians" "#ffeeee" "Barwon South West" "#eeeeff"} (:region area))]
+	(str
+	 "<polygon "
+	 "style=\"fill:" fill ";stroke:#000000;stroke-width:0.1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\" "
+	 "points=\""
+	 (apply str
+			(for [{:keys [lat lng]} (:boundary area)]
+			  (str (g lng) "," (f lat) " ")
+			  ))
+	 "\" />")))
+
+
+(defn render
+  [areas]
+  (map render-one areas))
+
+


indentation fix

indentation fix

--- test/metabase/util/password_test.clj
+++ test/metabase/util/password_test.clj
@@ -43,5 +43,5 @@
 ;; Do some tests with the default (:normal) password requirements
 (expect false (is-complex? "ABC"))
 (expect false (is-complex? "ABCDEF"))
-(expect true (is-complex? "ABCDE1"))
-(expect true (is-complex? "123456"))
+(expect true  (is-complex? "ABCDE1"))
+(expect true  (is-complex? "123456"))


adding test helper to reset redis before each test

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

--- test/snap_spot/test_helper.clj
+++ test/snap_spot/test_helper.clj
@@ -0,0 +1,7 @@
+(ns snap-spot.test-helper
+  (:require [snap-spot.redis :as redis]
+            [taoensso.carmine :as car :refer (wcar)]))
+
+(defn stateless-redis-fixture [f]
+  (redis/wcar* (car/flushdb))
+  (f))


I don't think we need to do this TODO

I don't think we need to do this TODO

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


Initial commit of wordcount example for trident DSL

error: pathspec 'src/clj/marceline/storm/testing/trident_wordcount.clj' did not match any file(s) known to git

--- src/clj/marceline/storm/testing/trident_wordcount.clj
+++ src/clj/marceline/storm/testing/trident_wordcount.clj
@@ -0,0 +1,97 @@
+(ns marceline.storm.testing.trident-wordcount
+  (:import [backtype.storm.tuple Values Fields]
+           storm.trident.TridentTopology
+           [storm.trident.operation.builtin MapGet FilterNull Sum Count]
+           storm.trident.state.StateType
+           [storm.trident.testing MemoryMapState$Factory FixedBatchSpout]
+           [backtype.storm LocalDRPC LocalCluster StormSubmitter]
+           [java.util ArrayList List])
+  (:require [marceline.storm.trident :as t]
+            [clojure.string :as string :only [join split]])
+  (:use [backtype.storm clojure config]))
+
+(defn mk-fixed-spout [max-batch-size]
+  (FixedBatchSpout.
+   (Fields. "sentence")
+   max-batch-size
+;   (ArrayList. (into [] (doall (map t/values '("the cow jumped over the moon"
+;                                               "the man went to the store and bought some candy"
+;                                               "four score and seven years ago"
+;                                               "how many can you eat"
+;                                               "to be or not to be the person")))))
+   (Values. "the cow jumped over the moon")
+   ))
+
+(t/defcombineraggregator
+  count-words
+  ([] 0)
+  ([tuple] 1)
+  ([t1 t2] (+ t1 t2)))
+
+(t/deftridentfn split-args
+  [tuple coll]
+  (when-let [args (t/first tuple)]
+    (let [words (string/split args #" ")]
+      (doseq [word words]
+        (t/emit-fn coll word)))))
+
+(defn build-topology [drpc]
+  (let [spout (mk-fixed-spout 3)
+        _ (.setCycle spout true)
+        word-state-factory (MemoryMapState$Factory.)
+        trident-topology (TridentTopology.)
+        word-counts (-> (t/new-stream* trident-topology "word-counts" spout)
+                        (t/parallelism-hint* 16)
+                        (t/each* ["sentence"]
+                                 split-args
+                                 ["word"])
+                        (t/group-by* ["word"])
+                        (t/persistent-aggregate* word-state-factory
+                                                 ["word"]
+                                                 (Count.)
+                                                 ["count"])
+                        (t/parallelism-hint* 16))
+        count-query (-> (t/drpc-stream* trident-topology "words" drpc)
+                        (t/each* ["args"]
+                                 split-args
+                                 ["word"])
+                        (t/group-by* ["word"])
+                        (t/state-query* word-counts
+                                        ["word"]
+                                        (MapGet.)
+                                        ["count"])
+                        (t/each* ["count"] (FilterNull.))
+                        (t/aggregate* ["count"]
+                                      (Sum.)
+                                      ["sum"]))]
+    trident-topology))
+
+(defn run-local! []
+  (let [cluster (LocalCluster.)
+        local-drpc (LocalDRPC.)]
+    (.submitTopology cluster "wordcounter"
+                     {}
+                     (.build
+                      (build-topology local-drpc)))
+    (Thread/sleep 1000)
+    (.execute local-drpc "words" "cat the dog jumped")
+    (.shutdown cluster)
+    (System/exit 0)))
+
+(defn submit-topology! [env]
+  (let [name "wordcounter"
+        conf {TOPOLOGY-WORKERS 6
+              TOPOLOGY-MAX-SPOUT-PENDING 20
+              TOPOLOGY-MESSAGE-TIMEOUT-SECS 60
+              TOPOLOGY-STATS-SAMPLE-RATE 1.00}]
+    (StormSubmitter/submitTopology
+     name
+     conf
+     (.build (build-topology
+              nil)))))
+
+(defn -main
+  ([]
+     (run-local!))
+  ([env & args]
+     (submit-topology! (keyword env))))


Added first working bits of literate tests experiment

error: pathspec 'lib/compojure/literate_tests/literate_tests.clj' did not match any file(s) known to git

--- lib/compojure/literate_tests/literate_tests.clj
+++ lib/compojure/literate_tests/literate_tests.clj
@@ -0,0 +1,65 @@
+(ns compojure.literate-tests
+  (:import (java.io BufferedReader
+                    PushbackReader
+                    StringReader
+                    Reader)
+           (java.util.regex Pattern)))
+
+(defstruct result
+  :expr
+  :success
+  :actual
+  :expected)
+
+(defn- test-pair
+  "Parse and evaluate an expression, and compare the output to an expected
+   value."
+  [[expr expected]]
+  (let [expected (.trim expected)
+        capture #(.trim (with-out-str (prn (eval %))))]
+    (try
+      (let [value (capture expr)]
+        (struct result
+          expr (= value expected)
+          value expected))
+      (catch Exception value
+        (struct result
+          expr (.startsWith (str value) expected)
+          value expected)))))
+
+(defn literate-test
+  "Run a series of tests extracted from a literate file."
+  [tests]
+  (map test-pair tests))
+
+(defn slurp-reader
+  "Returns a string of the contents of the reader."
+  [#^Reader reader]
+  (with-open br (new BufferedReader reader)
+    (let [sb (new StringBuilder)]
+      (loop [c (.read br)]
+        (if (neg? c)
+          (str sb)
+          (do (.append sb (char c))
+              (recur (.read br))))))))
+
+(defn read-str
+  "Parse a string into a vector containing a Clojure expression and the text
+  left over after the end of the expression."
+  [expr]
+  (let [reader (new PushbackReader (new StringReader expr))]
+    [(read reader)
+     (slurp-reader reader)]))
+
+(defn tests-from-text
+  [text]
+  (if text
+    (let [dot-all     (.DOTALL Pattern)
+          re-expr     (.compile Pattern "=>(.*)$" dot-all)
+          re-expected (.compile Pattern "(.*?)(\n\n.*)?$" dot-all)]
+      (if-let next-test (re-find re-expr text)
+        (let [[expr text]       (read-str (next-test 1))
+              [_ expected text] (re-matches re-expected text)]
+          (lazy-cons
+            [expr expected]
+            (tests-from-text text)))))))


added p14.clj

added p14.clj

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


include id read & write

include id read & write

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


Reshape database handling in train movement feed to record per action db timings.

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


added dummy db

added dummy db

error: pathspec 'api/ringo/db.clj' did not match any file(s) known to git

--- api/ringo/db.clj
+++ api/ringo/db.clj
@@ -0,0 +1,31 @@
+(ns ringo.db
+  (:require [environ.core :refer [env]]
+            [clojure.java.io :as io]))
+
+;; Dummy Database
+
+(def data {:authors [{:name "Chris Granger" :known-for #{:sqlkorma :clojurescript :lighttable }}
+                      {:name "David Nolen"   :known-for #{:clojurescript :core-logic :om}}
+                      {:name "James Reeves"  :known-for #{:ring :compojure :hiccup}}]
+
+            :libraries #{:ring :clojure :hiccup :om :sablono :bootstrap}
+
+            :devices [{:id "01"
+                       :type "electricityConsumption"
+                       :description "I'm a device with id 01"
+                       :unit "kWh"}
+                      {:id "02"
+                       :type "gasConsumption"
+                       :description "I'm a device with id 02"
+                       :unit "kWh"}]
+
+            :measurements [{:id "01" :type "electricityConsumption" :timestamp "01/01/2011" :value 0.2}
+                           {:id "01" :type "electricityConsumption" :timestamp "01/02/2011" :value 0.3}
+                           {:id "01" :type "electricityConsumption" :timestamp "01/03/2011" :value 0.2}
+                           {:id "01" :type "electricityConsumption" :timestamp "01/04/2011" :value 0.25}
+                           {:id "01" :type "electricityConsumption" :timestamp "01/05/2011" :value 0.95}
+                           {:id "02" :type "gasConsumption" :timestamp "01/01/2011" :value 6}
+                           {:id "02" :type "gasConsumption" :timestamp "01/02/2011" :value 10}
+                           {:id "02" :type "gasConsumption" :timestamp "01/03/2011" :value 12}
+                           {:id "02" :type "gasConsumption" :timestmap "01/04/2011" :value 15}
+                           {:id "02" :type "gasConsumption" :timestamp "01/05/2011" :value 18}]})


Added the Collatz Numbers problem

Added the Collatz Numbers problem

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

--- src/clojush/problems/software/collatz_numbers.clj
+++ src/clojush/problems/software/collatz_numbers.clj
@@ -0,0 +1,159 @@
+;; collatz_numbers.clj
+;; Tom Helmuth, thelmuth@cs.umass.edu
+;;
+;; Problem Source: iJava (http://ijava.cs.umass.edu/)
+;;
+;; Given an integer in the range [1,10000], find the number of terms in the
+;; Collatz sequence starting from that integer.
+;;
+;; input stack has integer n
+
+(ns clojush.problems.software.collatz-numbers
+  (:use clojush.pushgp.pushgp
+        [clojush pushstate interpreter random util globals]
+        clojush.instructions.tag
+        [clojure.math numeric-tower]
+        ))
+
+; Atom generators
+(def collatz-numbers-atom-generators
+  (concat (list
+            0
+            1
+            ;;; end constants
+            (fn [] (- (lrand-int 201) 100)) ;Integer ERC [-100,100]
+            ;;; end ERCs
+            (tag-instruction-erc [:integer :float :boolean :exec] 1000)
+            (tagged-instruction-erc 1000)
+            ;;; end tag ERCs
+            'in1
+            ;;; end input instructions
+            )
+          (registered-for-stacks [:integer :float :boolean :exec])))
+
+
+;; A list of data domains for the problem. Each domain is a vector containing
+;; a "set" of inputs and two integers representing how many cases from the set
+;; should be used as training and testing cases respectively. Each "set" of
+;; inputs is either a list or a function that, when called, will create a
+;; random element of the set.
+(def collatz-numbers-data-domains
+  [[(concat (range 1 11) '(9999 10000)) 12 0] ; Small and large cases
+   [(list 6171 6943 7963 9257) 4 0] ; Cases with the largest answers in range: ([6171 262] [6943 257] [7963 252] [9257 260])
+   [(fn [] (+ 11 (lrand-int 9988))) 184 2000] ; Random cases [11,9998]
+   ])
+
+;;Can make Collatz Numbers test data like this:
+;(test-and-train-data-from-domains collatz-numbers-data-domains)
+
+; Helper function for error function
+(defn tail-collatz-sequence
+  "Given a starting integer n, gives the number of steps in the Collatz sequence
+   starting at n."
+  [n]
+  (loop [n n
+         len 1]
+    (if (>= 1 n)
+      len
+      (if (even? n)
+        (recur (/ n 2) (inc len))
+        (recur (inc (* 3 n)) (inc len))))))
+
+(defn collatz-numbers-test-cases
+  "Takes a sequence of inputs and gives IO test cases of the form
+   [input output]."
+  [inputs]
+  (map (fn [in]
+         (vector in
+                 (tail-collatz-sequence in)))
+       inputs))
+
+; Define error function. For now, each run uses different random inputs
+(defn collatz-numbers-error-function
+  "Returns the error function for the Collatz Numbers problem. Takes as
+   input Collatz Numbers data domains."
+  [data-domains]
+  (let [[train-cases test-cases] (map sort (map collatz-numbers-test-cases
+                                                (test-and-train-data-from-domains data-domains)))]
+    (when true ;; Change to false to not print test cases
+      (doseq [[i case] (map vector (range) train-cases)]
+        (println (format "Train Case: %3d | Input/Output: %s" i (str case))))
+      (doseq [[i case] (map vector (range) test-cases)]
+        (println (format "Test Case: %3d | Input/Output: %s" i (str case)))))
+    (fn the-actual-collatz-numbers-error-function
+      ([program]
+        (the-actual-collatz-numbers-error-function program :train))
+      ([program data-cases] ;; data-cases should be :train or :test
+        (the-actual-collatz-numbers-error-function program data-cases false))
+      ([program data-cases print-outputs]
+        (let [behavior (atom '())
+              errors (doall
+                       (for [[input1 correct-output] (case data-cases
+                                                                  :train train-cases
+                                                                  :test test-cases
+                                                                  [])]
+                         (let [final-state (run-push program
+                                                     (->> (make-push-state)
+                                                       (push-item input1 :input)))
+                               result (stack-ref :integer 0 final-state)]
+                           (when print-outputs
+                             (println (format "Correct output: %3d | Program output: %s" correct-output (str result))))
+                           ; Record the behavior
+                           (when @global-print-behavioral-diversity
+                             (swap! behavior conj result))
+                           ; Error is Levenshtein distance of printed strings
+                           (if (number? result)
+                             (abs (- result correct-output)) ;distance from correct integer
+                             1000000) ;penalty for no return value
+                           )))]
+          (when @global-print-behavioral-diversity
+            (swap! population-behaviors conj @behavior))
+          errors)))))
+
+(defn collatz-numbers-report
+  "Custom generational report."
+  [best population generation error-function report-simplifications]
+  (let [best-program (not-lazy (:program best))
+        best-test-errors (error-function best-program :test)
+        best-total-test-error (apply +' best-test-errors)]
+    (println ";;******************************")
+    (printf ";; -*- Collatz Numbers problem report - generation %s\n" generation)(flush)
+    (println "Test total error for best:" best-total-test-error)
+    (println (format "Test mean error for best: %.5f" (double (/ best-total-test-error (count best-test-errors)))))
+    (when (zero? (:total-error best))
+      (doseq [[i error] (map vector
+                             (range)
+                             best-test-errors)]
+        (println (format "Test Case  %3d | Error: %d" i error))))
+    (println ";;------------------------------")
+    (println "Outputs of best individual on training cases:")
+    (error-function best-program :train true)
+    (println ";;******************************")
+    )) ;; To do validation, could have this function return an altered best individual
+       ;; with total-error > 0 if it had error of zero on train but not on validation
+       ;; set. Would need a third category of data cases, or a defined split of training cases.
+
+
+; Define the argmap
+(def argmap
+  {:error-function (collatz-numbers-error-function collatz-numbers-data-domains)
+   :atom-generators collatz-numbers-atom-generators
+   :max-points 600
+   :max-points-in-initial-program 300
+   :evalpush-limit 4000
+   :population-size 1000
+   :max-generations 300
+   :parent-selection :lexicase
+   :genetic-operator-probabilities {:alternation 0.2
+                                    :uniform-mutation 0.2
+                                    :uniform-close-mutation 0.1
+                                    [:alternation :uniform-mutation] 0.5
+                                    }
+   :alternation-rate 0.01
+   :alignment-deviation 10
+   :uniform-mutation-rate 0.01
+   :problem-specific-report collatz-numbers-report
+   :print-behavioral-diversity true
+   :report-simplifications 0
+   :final-report-simplifications 5000
+   })


Updated dependencies

Updated dependencies

--- src/leiningen/new/cryogen/project.clj
+++ src/leiningen/new/cryogen/project.clj
@@ -5,11 +5,11 @@
                       :url "http://www.eclipse.org/legal/epl-v10.html"}
             :dependencies [[org.clojure/clojure "1.6.0"]
                            [hiccup "1.0.5"]
-                           [selmer "0.7.5"]
+                           [selmer "0.7.7"]
                            [markdown-clj "0.9.58"
                             :exclusions [com.keminglabs/cljx]]
-                           [ring/ring-devel "1.3.1"]
-                           [compojure "1.2.1"]
+                           [ring/ring-devel "1.3.2"]
+                           [compojure "1.2.2"]
                            [clj-text-decoration "0.0.3"]
                            [io.aviso/pretty "0.1.13"]
                            [ring-server "0.3.1"]


update deps

update deps

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


starting to think through replacement for background

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

--- test/as_documentation/t_assumptions.clj
+++ test/as_documentation/t_assumptions.clj
@@ -0,0 +1,166 @@
+(ns as-documentation.t-assumptions
+  (:use midje.sweet
+        midje.test-util))
+
+                ;;; Checkers that do not take arguments
+
+;; A checker can be any predicate you define.
+
+(defn even-length [actual-result]
+  (even? (count actual-result)))
+
+(fact [0 1 2 1 3] =not=> even-length)
+
+;; Such a checker works fine, so long as you use it on the
+;; right-hand-side of an arrow. However, checkers are sometimes also
+;; used in the argument list of prerequisites. So consider this
+;; contrived example
+
+(unfinished utility-function)
+
+(defn function-under-test [sequence]
+  (if (utility-function sequence) 1 2))
+
+
+(run-silently
+ (fact
+   (function-under-test [:a :b]) => 2
+   (provided
+     (utility-function even-length) => false)))
+
+(fact @reported => has-bad-result)
+
+;; The provided statement does NOT fake out the value of a call to
+;; `utility-function` that gives it an even-length sequence. Instead,
+;; it fakes out a call to `utility-function` that gives it the
+;; **function** even-length. This behavior has proven to be less
+;; confusing to people testing functions that take functions as
+;; arguments.
+;;
+;; To get `even-length` to behave as a checker in prerequisites, you
+;; need to define it specially:
+
+(defchecker even-length [actual-result]
+  (even? (count actual-result)))
+
+(run-silently
+ (fact
+   (function-under-test [:a :b]) => 2
+   (provided
+     (utility-function even-length) => false))
+)
+(fact @reported => passes)
+
+
+                ;;; Checkers that do take arguments
+
+;; Consider a checker that requires a collection to have only
+;; certain elements. That's defined like this:
+
+(defchecker only-these [& expected-elements]
+  (checker [actual]
+           (every? (set expected-elements) actual)))
+
+;; This is a function that generates a checker function. The `checker`
+;; on the second line is just like `fn` but additionally marks the
+;; generated function as a checker, so that it can be used in
+;; prerequisite argument lists.
+
+(run-silently
+ (fact
+   [1 2 3] => (only-these 1 2 3)
+   [1 2 3] => (only-these 1))
+)
+(fact @reported => (just [pass checker-fails]))
+
+
+                ;;; Chatty checkers
+
+;; Suppose your function-under-test produces a map that must contain
+;; the key `:foo` and must have the value of the key `:bar` be a
+;; string with a given number of characters. You could easily check
+;; one call of that function like this:
+
+(defn function-under-test []
+  {:foo 1, :bar "foo"})
+
+(fact
+  (let [actual (function-under-test)]
+    (contains? actual :foo) => truthy
+    (:bar actual) => string?
+    (count (:bar actual)) => 3))
+
+;; But suppose these checks were ones you'd want to apply to many
+;; different calls of many different functions, not just this
+;; one. It'd be tedious and perhaps misleading to repeat the three
+;; checks over and over. So you might produce a checker:
+
+(defchecker foobared [expected-count]
+  (checker [actual-map]
+    (and (contains? actual-map :foo)
+         (string? (:bar actual-map))
+         (= (count (:bar actual-map)) expected-count))))
+
+(run-silently
+ (fact
+   (function-under-test) => (foobared 30000))
+)
+(fact @reported => (just [checker-fails]))
+
+;; This fails with this message (as of April 2012):
+;;
+;;   FAIL at (t_defining_checkers.clj:105)
+;;   Actual result did not agree with the checking function.
+;;           Actual result: {:foo 1, :bar "foo"}
+;;       Checking function: (foobared 30000)
+;;
+;; That's not so helpful. You'd rather it told you *which* clause of
+;; the `and` failed. You can accomplish that with a one-token change
+;; to the definition:
+;;
+
+(defchecker foobared [expected-count]
+  (chatty-checker [actual-map]         ; <<== on this line
+    (and (contains? actual-map :foo)
+         (string? (:bar actual-map))
+         (= (count (:bar actual-map)) expected-count))))
+
+;; Running this function appends some "chattier" output:
+;;
+;;   FAIL at (t_defining_checkers.clj:129)
+;;   Actual result did not agree with the checking function.
+;;           Actual result: {:foo 1, :bar "foo"}
+;;       Checking function: (foobared 30000)
+;;       During checking, these intermediate values were seen:
+;;          (contains? actual-map :foo) => true
+;;          (string? (:bar actual-map)) => true
+;;          (= (count (:bar actual-map)) expected-count) => false
+
+(run-silently
+ (fact
+   (function-under-test) => (foobared 30000))
+)
+(fact @reported => (just [checker-fails]))
+
+;; If you want a simpler checker that doesn't take arguments, just use
+;; `chatty-checker` with `def`:
+
+(def one-or-two
+     (chatty-checker [actual]
+       (or (= actual 1)
+           (= actual 2))))
+
+(run-silently
+ (fact
+   3 => one-or-two)
+ )
+
+;;    FAIL at (t_defining_checkers.clj:155)
+;;    Actual result did not agree with the checking function.
+;;            Actual result: 3
+;;        Checking function: one-or-two
+;;        During checking, these intermediate values were seen:
+;;           (= actual 1) => false
+;;           (= actual 2) => false
+
+(fact @reported => (just [checker-fails]))


CMR-8766: Change CMR_GENERIC_DOCUMENTS DOCUMENT_NAME column size from 20 to 1020.

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

--- metadata-db-app/src/cmr/metadata_db/migrations/087_update_generic_document_name_length.clj
+++ metadata-db-app/src/cmr/metadata_db/migrations/087_update_generic_document_name_length.clj
@@ -0,0 +1,16 @@
+(ns cmr.metadata-db.migrations.087-update-generic-document-name-length
+  (:require
+   [config.mdb-migrate-helper :as h]))
+
+(defn up
+  "Migrates the database up to version 87."
+  []
+  (println "cmr.metadata-db.migrations.087-update-generic-document-name-length up...")
+  (h/sql "alter table METADATA_DB.CMR_GENERIC_DOCUMENTS modify document_name VARCHAR(1020)"))
+
+
+(defn down
+  "Migrates the database down from version 87."
+  []
+  ;; do nothing as we don't want to truncate the document name
+  (println "cmr.metadata-db.migrations.087-update-generic-document-name-length down..."))


formatting

formatting

--- test/clj/backtype/storm/nimbus_test.clj
+++ test/clj/backtype/storm/nimbus_test.clj
@@ -482,6 +482,4 @@
        (advance-time-secs! 5)
        (nimbus/clean-inbox dir-location 10)
        (assert-files-in-dir [])
-       )))
-
-  )
+       ))))


Copy voter reg. service tests

Copy voter reg. service tests

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


Recursively call through the protocol method itself when inserting into quadtrees.


Implementing Clojure threading

Implementing Clojure threading

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/skprasadu/crud-ui-framework.git/'


Apparently the concept of "within" is harder than I realised.


provide compiler env to figwheel core

provide compiler env to figwheel core

--- sidecar/src/figwheel_sidecar/auto_builder.clj
+++ sidecar/src/figwheel_sidecar/auto_builder.clj
@@ -33,12 +33,13 @@

 (defn check-changes [figwheel-server build]
   (let [{:keys [additional-changed-ns build-options id old-mtimes new-mtimes]} build]
-    (fig/check-for-changes (merge figwheel-server
-                                  (if id {:build-id id} {})
-                                  (select-keys build-options [:output-dir :output-to]))
-                           old-mtimes
-                           new-mtimes
-                           additional-changed-ns)))
+    (binding [cljs.env/*compiler* (:compiler-env build)]
+      (fig/check-for-changes (merge figwheel-server
+                                    (if id {:build-id id} {})
+                                    (select-keys build-options [:output-dir :output-to]))
+                             old-mtimes
+                             new-mtimes
+                             additional-changed-ns))))

 (defn handle-exceptions [figwheel-server {:keys [build-options exception]}]
   (println (auto/red (str "Compiling \"" (:output-to build-options) "\" failed.")))
@@ -281,14 +282,14 @@
                                       (cljs.env/default-compiler-env
                                         (:compiler b))))
                         builds))
-
+
   (def figwheel-server (fig/start-server))
-
+
   (fig/stop-server figwheel-server)

   (def bb (autobuild* {:builds env-builds
-                             :figwheel-server figwheel-server}))
-
+                       :figwheel-server figwheel-server}))
+
   (auto/stop-autobuild! bb)

   (fig-repl/eval-js figwheel-server "1 + 1")


Add problem69.clj

Add problem69.clj

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

--- euler_clojure/src/euler/problem69.clj
+++ euler_clojure/src/euler/problem69.clj
@@ -0,0 +1,21 @@
+(ns euler.problem69
+  "https://projecteuler.net/problem=69
+
+  Euler's Totient function, φ(n) [sometimes called the phi function], is used
+  to determine the number of numbers less than n which are relatively prime to
+  n. For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and
+  relatively prime to nine, φ(9)=6.
+
+  It can be seen that n=6 produces a maximum n/φ(n) for n ≤ 10. Find the value
+  of n ≤ 1,000,000 for which n/φ(n) is a maximum."
+  (:require [euler.toolset :refer [prime? get-primes]]))
+
+;; Note that the phi function multiplies n by (1 - (1/p)) for every p in its
+;; unique prime factors. Therefore, phi(n) will diminish as n has a greater
+;; number of small unique prime factors. Since we are seeking the largest value
+;; for n/phi(n), we want to minimize phi(n). We are therefore looking for the
+;; largest number <= 1e6 which is the product of the smallest unique prime
+;; factors, i.e successive prime numbers starting from 2.
+
+(defn problem69 []
+  (apply max (take-while #(< % 1e6) (reductions * (get-primes)))))


Serve `index.html` from subdirs when `clean-urls?` true.

Also redirects / to /blog-prefix/ when true, /blog-prefix/index.html
otherwise.

--- src/leiningen/new/cryogen/src/cryogen/server.clj
+++ src/leiningen/new/cryogen/src/cryogen/server.clj
@@ -1,10 +1,12 @@
 (ns cryogen.server
   (:require [compojure.core :refer [GET defroutes]]
             [compojure.route :as route]
-            [ring.util.response :refer [redirect]]
+            [ring.util.response :refer [redirect resource-response]]
+            [ring.util.codec :refer [url-decode]]
             [cryogen-core.watcher :refer [start-watcher!]]
             [cryogen-core.plugins :refer [load-plugins]]
-            [cryogen-core.compiler :refer [compile-assets-timed read-config]]))
+            [cryogen-core.compiler :refer [compile-assets-timed read-config]]
+            [cryogen-core.io :refer [path]]))

 (defn init []
   (load-plugins)
@@ -12,7 +14,19 @@
   (let [ignored-files (-> (read-config) :ignored-files)]
     (start-watcher! "resources/templates" ignored-files compile-assets-timed)))

+(defn wrap-subdirectories
+  [handler]
+  (fn [request]
+    (let [req-uri (.substring (url-decode (:uri request)) 1)
+          res-path (path req-uri (when (:clean-urls? (read-config)) "index.html"))]
+      (or (resource-response res-path {:root "public"})
+          (handler request)))))
+
 (defroutes handler
-  (GET "/" [] (redirect (str (:blog-prefix (read-config)) "/index.html")))
+  (GET "/" [] (redirect (let [config (read-config)]
+                          (path (:blog-prefix (read-config)) "/"
+                                (when-not (:clean-urls? config) "index.html")))))
   (route/resources "/")
   (route/not-found "Page not found"))
+
+(def app (wrap-subdirectories handler))


Canvas rendering geometry functions

Canvas rendering geometry functions

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

--- src/cljs/db_quiz/geometry.cljs
+++ src/cljs/db_quiz/geometry.cljs
@@ -0,0 +1,68 @@
+(ns db-quiz.geometry)
+
+(defn path-segment-distances
+  "Computes distances between [x, y] points on a path segment."
+  [path-segment]
+  (map (fn [[ax ay] [bx by]]
+            (js/Math.sqrt (+ (js/Math.pow (- ax bx) 2)
+                             (js/Math.pow (- ay by) 2))))
+       path-segment
+       (rest path-segment)))
+
+(defn path-segment-length
+  "Compute the length of a path segment.
+  Path segment is a vector of [x y] coordinates."
+  [path-segment]
+  (apply + (path-segment-distances path-segment)))
+
+(defn path-length
+  "Total path length. Path consists of segments (vectors) consisting of [x, y] points.
+  For example [[[10 10] [20 20]] [[80 80] [90 90]]] is a path, where [[10 10] [20 20]] is
+  the first segment and [[80 80] [90 90]] is the second segment."
+  [path]
+  (apply + (map path-segment-length path)))
+
+(defn intercept-coords
+  "Computes [x, y] coordinates of an intercept of the line between A and B,
+  where length is the distance between A and the intercept."
+  [[ax ay] [bx by] length]
+  (let [angle (js/Math.atan (/ (js/Math.abs (- ay by))
+                               (js/Math.abs (- ax bx))))]
+    [((if (< ax bx) + -) ax (* length (js/Math.sin angle)))
+     ((if (< ay by) + -) ay (* length (js/Math.cos angle)))]))
+
+(defn path-travelled
+  "Returns points up to distance travelled."
+  ; FIXME: Refactor nasty sequence manipulations.
+  ; TODO: Add test (= (path-length *result*) distance-travelled)
+  [path distance-travelled]
+  {:pre [; Every path segment needs to have at least 2 points.
+         (every? (partial < 1) (map count path))
+         ; Distance travelled must be shorter than the path length.
+         (>= (path-length path) distance-travelled)]}
+  (let [[travelled-segments [[_ current-segment] & _]] (split-with (comp (partial > distance-travelled) first)
+                                                                   (map vector
+                                                                        (reductions +
+                                                                                (map path-segment-length path))
+                                                                        path))
+        segment-distance (- distance-travelled (or (first (last travelled-segments)) 0))
+        [visited-points [[_ next-point] & _]] (split-with (comp (partial > segment-distance) first)
+                                                          (map vector
+                                                               (cons 0
+                                                                     (reductions + (path-segment-distances
+                                                                                current-segment)))
+                                                               current-segment))
+        [point-distance last-visited-point] (last visited-points)
+        intercept-distance (- segment-distance point-distance)
+        intercept (intercept-coords last-visited-point
+                                    next-point
+                                    intercept-distance)]
+    (conj (vec (map second travelled-segments))
+          (conj (vec (map second visited-points))
+                intercept))))
+
+(defn relative-to-absolute-coords
+  "Convert relative coordinates in path to absolute coordinates
+  bounded by width and height."
+  [[width height] path]
+  (map (partial map (fn [[x y]] [(* width x) (* height y)])) path))


Fix error message

Fix error 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/aaronlahey/coconut.git/'


Use the correct var name for the artifact

See #682

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/tobias/clojars-web.git/'


working on functional programming chapter

error: pathspec 'brave-true/clojure-noob/src/clojure_noob/fun-prog.clj' did not match any file(s) known to git

--- brave-true/clojure-noob/src/clojure_noob/fun-prog.clj
+++ brave-true/clojure-noob/src/clojure_noob/fun-prog.clj
@@ -0,0 +1,138 @@
+(ns clojure-noob.fun-prog
+  (:require [midje.sweet :refer :all]))
+
+(facts  "pure functions:"
+  (fact (get [:chumbawumba] 0)
+    => :chumbawumba)
+  (fact (reduce + [1 10 5])
+    => 16)
+  (fact (str "wax on " "wax off")
+    => "wax on wax off"))
+
+(facts "pure functions are refentially transparent"
+  (fact (+ 1 2)
+    => 3))
+
+(defn wisdom
+  [words]
+  (str words ", Daniel-san"))
+
+(fact (wisdom "Always bathe on Fridays")
+  => "Always bathe on Fridays, Daniel-san")
+
+;; always gives a differen result so not referntially transperent
+(defn year-end-evaluation
+  []
+  (if (> (rand) 0.5)  ;; rand is not a function.
+    "You get a raise!"
+    "Better luck next year!"))
+
+(defn analysis
+  "analysis is a function"
+  [text]
+  (str "Character count: " (count text)))
+
+(defn analyze-file
+  "but analyze-file isn't"
+  [filename]
+  (analysis (slurp filename)))  ;; slurp is not a function
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; living with immutable data structures
+
+(defn no-mutation
+  [x]
+  (println x)
+
+  ;; let creates a new scope
+  (let [x "Kafka Human"]
+    (println x))
+
+  ;; outside of the let scope
+  (println x))
+
+(no-mutation "Existential Angst Person")
+;; =>
+;;Existential Angst Person
+;;Kafka Human
+;;Existential Angst Person
+
+(defn sum
+  ([vals] (sum vals 0))
+  ([vals accumulating-total]
+    (if (empty? vals)
+      accumulating-total
+      (sum (rest vals) (+ (first vals) accumulating-total)))))
+
+  (fact "test sum"
+    (sum []) => 0
+    (sum [1]) => 1
+    (sum [39 5 1]) => 45)
+
+
+;;;;;;;;;;
+;; function compostion instead of attribute mutation
+
+(require '[clojure.string :as s])
+
+(defn clean
+  [text]
+  (s/replace (s/trim text) #"lol" "LOL"))
+
+(fact (clean "My boa constrictor is so sassy lol!  ")
+  => "My boa constrictor is so sassy LOL!")
+
+(fact "pretty common style"
+  ((comp s/lower-case s/trim) " Unclean string ")
+  => "unclean string")
+
+
+(defn two-comp
+  [f g]
+  (fn [& args]
+    (f (apply g args))))
+
+(def my-lower-trim (two-comp s/lower-case s/trim))
+
+(fact (my-lower-trim " Unclean string  ")
+  => "unclean string")
+
+(def sum-times2 (two-comp  #(* 2 %) +))
+
+(fact (sum-times2 1 2 3)
+  => 12)
+
+;; define a new version of 'comp'
+(defn my-comp
+  [f & funs]
+  (if (empty? funs) f
+      (recur (fn [& args]
+                 (f (apply (first funs) args)))
+               (rest funs))))
+
+(fact ((my-comp s/lower-case s/trim) " Unclean string ")
+  => "unclean string")
+(fact ((my-comp s/reverse s/lower-case s/trim) " Unclean string ")
+  => "gnirts naelcnu")
+
+(def sum-times2' (two-comp  #(* 2 %) +))
+
+(fact (sum-times2' 1 2 3)
+  => 12)
+
+;;;;;;;;;;;;;;;;;;;;
+;; memoization
+
+(defn sleepy-identity
+  "returns the given value after a 1 second 'calculation'"
+  [x]
+  (Thread/sleep 1000)
+  x)
+
+(sleepy-identity "Mr. Fantatstico")
+
+(def memo-sleepy-identity
+  "does calculation once, then returns imediatly"
+  (memoize sleepy-identity))
+
+(memo-sleepy-identity "Mr. Fantatstico")


chamber WIP

chamber WIP

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 stub for trinary

Add stub for trinary

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

--- exercises/trinary/src/trinary.clj
+++ exercises/trinary/src/trinary.clj
@@ -0,0 +1,5 @@
+(ns trinary)
+
+(defn to-decimal [] ;; <- Arglist goes here
+      ;; your code goes here
+      )


Add colorscheme to re-lorean

Add colorscheme to re-lorean

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


Added new scene namespace containing code to handle scene graphs

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

--- src/retro_fever/scene.cljs
+++ src/retro_fever/scene.cljs
@@ -0,0 +1,131 @@
+(ns retro-fever.scene
+  (:refer-clojure :exclude [update remove])
+  (:require [clojure.walk :as walk]
+            [retro-fever.sprite :as sprite]
+            [retro-fever.util :as util]))
+
+(defprotocol INode
+  (add-child-id [this id])
+  (get-children-ids [this])
+  (remove-child-id [this id]))
+
+(defprotocol IScene
+  (add [this element] [this id element])
+  (add-to [this destination-id element] [this destination-id id element])
+  (remove [this id])
+  (move-to [this id destination-id])
+  (get-root [this])
+  (get-element [this element-id])
+  (get-elements [this element-ids])
+  (get-elements-at [this node-id]))
+
+(defrecord Scene []
+  IScene
+  (add [this element]
+    (add this (keyword (gensym "se-")) element))
+  (add [this id element]
+    (add-to this :se-root id element))
+  (add-to [this destination-id element]
+    (add-to this destination-id (keyword (gensym "se-")) element))
+  (add-to [this destination-id id element]
+    (-> this
+        (assoc id (with-meta element {:se-id id :parent destination-id}))
+        (update-in [destination-id] add-child-id id)))
+  (remove [this id]
+    (-> this
+        (update-in [(:parent (meta (id this)))] remove-child-id id)
+        (dissoc this id)))
+  (move-to [this id destination-id]
+    (-> this
+        (update-in [(:parent (meta (id this)))] remove-child-id id)
+        (update-in [id] with-meta (assoc (meta (get-element this id)) :parent destination-id))
+        (update-in [destination-id] add-child-id id)))
+  (get-root [this]
+    (:se-root this))
+  (get-element [this element-id]
+    (get this element-id))
+  (get-elements [this element-ids]
+    (map #(get-element this %) element-ids))
+  (get-elements-at [this node-id]
+    (get-elements this (get-children-ids (get-element this node-id)))))
+
+(defn get-id [element]
+  (:se-id (meta element)))
+
+(defrecord Node [children]
+  INode
+  (add-child-id [this id]
+    (update-in this [:children] conj id))
+  (get-children-ids [this]
+    (:children this))
+  (remove-child-id [this id]
+    (update-in this [:children] disj id)))
+
+(defn group
+  ([]
+    (Node. #{}))
+  ([update-fn]
+     (assoc (group) :update-fn update-fn)))
+
+(defn layer
+  ([order]
+    (layer order nil))
+  ([order update-fn]
+     (assoc (group update-fn) :order order)))
+
+(defn scene []
+  (assoc (Scene.) :se-root (with-meta (group)  {:se-id :se-root})))
+
+(derive sprite/ImageSprite ::sprite)
+(derive sprite/SpritesheetSprite ::sprite)
+(derive sprite/AnimatedSprite ::sprite)
+
+(defmulti render type)
+
+(defn render-node [node scene context]
+  (doall (map #(if (= (type %) Node)
+                 (render-node % scene context)
+                 (render % context))
+              (sort-by :order (get-elements scene (get-children-ids node))))))
+
+(defmethod render Scene
+  [scene context]
+  (render-node (get-root scene) scene context))
+
+(defmethod render ::sprite
+  [element context]
+  (sprite/render element context))
+
+(defmethod render sprite/Image
+  [element context]
+  (sprite/render-image context element 0 0))
+
+(defmethod render nil
+  [element context]
+  nil)
+
+(defmethod render :default
+  [element context]
+  (throw "Unknown render element"))
+
+(defmulti update type)
+
+(defmethod update Scene
+  [scene]
+  (update (get-root scene) scene))
+
+(defmethod update Node
+  [node scene]
+  (reduce #(update %2 %1)
+    (if-let [update-fn (:update-fn node)]
+      (update-fn node scene)
+      scene)
+    (sort-by :order (get-elements scene (get-children-ids node)))))
+
+(defmethod update ::sprite
+  [sprite scene]
+  (sprite/update sprite scene))
+
+(defmethod update :default
+  [element scene]
+  scene)


test coffeescript log with exceptions

test coffeescript log with exceptions

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


document get-state-authority function

document get-state-authority function

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


Adds snackbar page.

Adds snackbar page.

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

--- src/cljs/reagent_toolbox_docs/components/snackbar.cljs
+++ src/cljs/reagent_toolbox_docs/components/snackbar.cljs
@@ -0,0 +1,36 @@
+;;;; Copyright © 2017 Flexpoint Tech Ltd
+
+(ns reagent-toolbox-docs.components.snackbar
+  (:require [reagent-toolbox-docs.layout :as layout]
+            [reagent-toolbox-docs.ui :as ui]))
+
+(defn view
+  []
+  (fn []
+    [:article
+     [:h1 "Snackbar"]
+
+     [:p "Snackbars provide lightweight feedback about an operation by showing a brief "
+      "message at the bottom of the screen. Snackbars can contain an action."]
+
+     [ui/display-and-eval-code
+      "(defn snackbar-test
+         []
+         (let [snackbar (reagent.ratom/atom {:active false})]
+         (fn []
+           [:section
+            [reagent-toolbox.core/button {:label \"Show Snackbar\"
+                                          :raised true
+                                          :on-click #(swap! snackbar assoc :active true)}]
+             [reagent-toolbox.core/snackbar {:action \"Nice\"
+                                             :active (:active @snackbar)
+                                             :label \"A new developer started using Reagent Toolbox\"
+                                             :on-click #(swap! snackbar assoc :active false)
+                                             :ref \"snackbar\"
+                                             :type \"accept\"}]])))
+
+       [snackbar-test]"]
+     ]))
+
+(defmethod layout/pages :snackbar [_]
+  [view])


add graphite client and server test code

--- test/riemann/test/graphite.clj
+++ test/riemann/test/graphite.clj
@@ -2,9 +2,39 @@
   (:use riemann.graphite
         [riemann.time :only [unix-time]]
         clojure.test)
-  (:require [riemann.logging :as logging]))
+  (:require [riemann.logging :as logging]
+            [riemann.client :as client]
+            [riemann.index :as index]
+            [riemann.core :refer [transition! core stop!]]
+            [riemann.transport.tcp :refer [tcp-server]]
+            [riemann.transport.graphite :refer [graphite-server]]))

 (logging/init)
+
+(deftest graphite-server-test
+  (logging/suppress
+   ["riemann.transport" "riemann.core" "riemann.pubsub" "riemann.graphite"]
+   (let [s1       (graphite-server)
+         s2       (tcp-server)
+         index    (index/index)
+         core     (transition!
+                   (core)
+                   {:index    index
+                    :services [s1 s2]
+                    :streams  [(partial index/update index)]})
+         sendout! (graphite {:path graphite-path-basic})
+         client   (client/tcp-client)]
+     (try
+       (sendout! {:service "service1" :metric 1.0 :time 0})
+       (sendout! {:service "service2" :metric 1.0 :time 0})
+       (Thread/sleep 100)
+       (let [[r1 r2] (client/query client "true")]
+         (is (and (#{"service1" "service2"} (:service r1))
+                  (= 1.0 (:metric r1))))
+         (is (and (#{"service1" "service2"} (:service r2))
+                  (= 1.0 (:metric r2)))))
+       (finally
+         (stop! core))))))

 (deftest percentiles
          (is (= (graphite-path-percentiles


add some simple database tests

add some simple database tests

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

--- test/subrosa/test/database.clj
+++ test/subrosa/test/database.clj
@@ -0,0 +1,23 @@
+(ns subrosa.test.database
+  (:require [subrosa.database :as db])
+  (:use [clojure.test]))
+
+(use-fixtures :each
+              (fn [f]
+                (dosync (ref-set db/db {}))
+                (f)))
+
+(defn =* [m1 m2]
+  (= (dissoc m1 :id)
+     (dissoc m2 :id)))
+
+(deftest basic-database-operations
+  (let [m {:foo 42 :nick "dan"}]
+    (db/put :foo m)
+    (is (=* (db/get :foo :foo 42)
+            m))
+    (is (=* (db/get :foo :nick "dan")
+            m))
+    (db/delete :foo (:id (db/get :foo :foo 42)))
+    (is (nil? (db/get :foo :foo 42)))
+    (is (nil? (db/get :foo :nick "dan")))))


started external config

started external config

error: pathspec 'integration/dda/pallet/dda_managed_vm/app/external_config.clj' did not match any file(s) known to git


clj translation of the algorithm

clj translation of the algorithm

error: pathspec 'cljx/plongeur-clj/test/plongeur_clj/covering_test.clj' did not match any file(s) known to git

--- cljx/plongeur-clj/test/plongeur_clj/covering_test.clj
+++ cljx/plongeur-clj/test/plongeur_clj/covering_test.clj
@@ -0,0 +1 @@
+(ns plongeur-clj.covering-test)


user namespace for exploration

user namespace for exploration

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

--- dev/src/user.clj
+++ dev/src/user.clj
@@ -0,0 +1,16 @@
+(ns user
+  (:refer-clojure :exclude [dec < range <= min long int > - time / >= inc + max complement])
+  (:require
+   [tick.alpha.api :refer :all]
+   [tick.deprecated.cal :refer [holidays-in-england-and-wales weekend?]]
+   [tick.viz :refer [show-canvas view label]]
+   [tick.deprecated.schedule :as s :refer [schedule]]
+   [tick.deprecated.clock :refer [clock-ticking-in-seconds]]
+   clojure.test
+   tick.alpha.api-test
+   tick.core-test
+   tick.interval-test)
+  (:import [java.time DayOfWeek]))
+
+(defn test-all []
+  (clojure.test/run-all-tests #"(tick).*test$"))


commit

commit

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


Add a test for new hiccup/prxml/sexp-based xml style

error: pathspec 'modules/xml/src/test/clojure/clojure/data/xml/test_sexp.clj' did not match any file(s) known to git

--- modules/xml/src/test/clojure/clojure/data/xml/test_sexp.clj
+++ modules/xml/src/test/clojure/clojure/data/xml/test_sexp.clj
@@ -0,0 +1,27 @@
+;   Copyright (c) Rich Hickey. 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 ^{:doc "Tests for reading [:tag {:attr 'value} body*] as XML."
+      :author "Alan Malloy"}
+  clojure.data.xml.test-sexp
+  (:use [clojure.test :only [deftest is are]]
+        [clojure.data.xml :as xml :only [sexp-as-element
+                                         sexps-as-fragment element]]))
+
+(deftest as-element
+  (let [xml-input "<tag attr=\"value\"><body /></tag>"
+        sexp-input [:tag {:attr "value"} :body]]
+    (is (= (with-in-str xml-input (xml/parse *in*))
+           (sexp-as-element sexp-input)))))
+
+(deftest as-fragment
+  (let [input (list [:tag1 "stuff"]
+                    [:tag2 "other"])]
+    (is (= (sexps-as-fragment input)
+           (map sexp-as-element input)))
+    (is (thrown? Exception (sexp-as-element input)))))


enabled some more tests.

enabled some more 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/ddosic/neanderthal-clblast.git/'


[NH] Add PASV for regular passive mode.

[NH] Add PASV for regular passive mode.

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


Cider upgrade

Cider upgrade

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/scott-abernethy/dot-files.git/'


La til Clojure-løsning på Sums is a Circle

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

--- sums_in_a_circle/larstvei.clj
+++ sums_in_a_circle/larstvei.clj
@@ -0,0 +1,30 @@
+(declare solutions)
+
+(def pmapcat (comp (partial apply concat) pmap))
+
+(defn check [n v]
+  (let [y (+ (v (- n 2)) (v 0))]
+    (when (and ((complement (set v)) y) (< y n))
+      (list (assoc v (dec n) y)))))
+
+(defn generate [n v]
+  (let [m (-> (take-nth 2 v) (.indexOf nil) (* 2))
+        xs (filter (complement (set v)) (range 1 (dec n)))]
+    (mapcat (fn [x]
+              (let [y (+ x (v (- m 2)))]
+                (when (and ((complement (set v)) y) (< y n))
+                  (-> v (assoc m x) (assoc (dec m) y) solutions))))
+            xs)))
+
+(defn solutions [v]
+  (let [n (count v)]
+    (if (every? identity (take-nth 2 v))
+      (check n v)
+      (generate n v))))
+
+(defn solve [n]
+  (and (mod n 2)
+       (pmapcat #(solutions (into [(- n %) n %] (repeat (- n 3) nil)))
+                (range 2 (/ n 2)))))
+
+(->> 20 solve count println)


defun and (a simple) cond

defun and (a simple) cond

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


Listen on 0.0.0.0 instead of localhost by default

I usually run Figwheel from the [clojure](https://hub.docker.com/_/clojure/) docker image. Listening on `localhost` doesn't work, so I'd have to override this for every project. [http-kit](http://www.http-kit.org/server.html) uses 0.0.0.0 by default, and I would argue it is preferred.

--- sidecar/src/figwheel_sidecar/components/figwheel_server.clj
+++ sidecar/src/figwheel_sidecar/components/figwheel_server.clj
@@ -157,7 +157,7 @@
         :unique-id (or unique-id (.getCanonicalPath (io/file ".")))
         :http-server-root (or http-server-root "public")
         :server-port (or server-port 3449)
-        :server-ip (or server-ip "localhost")
+        :server-ip (or server-ip "0.0.0.0")
         :ring-handler ring-handler
         ;; TODO handle this better
         :resolved-ring-handler (or resolved-ring-handler


[WM] give timeout errors a type

[WM] give timeout errors a type

To match the shape of these data structures used elsewhere.

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


Function rename

Function rename

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


Add a test runner for doo

Add a test runner for doo

error: pathspec 'test/desdemona/ui/runner.cljs' did not match any file(s) known to git

--- test/desdemona/ui/runner.cljs
+++ test/desdemona/ui/runner.cljs
@@ -0,0 +1,7 @@
+(ns desdemona.ui.runner
+  (:require
+   [doo.runner :refer-macros [doo-tests]]
+   [desdemona.ui.core-test]))
+
+(doo-tests
+ 'desdemona.ui.core-test)


adding user tests

adding user tests

error: pathspec 'resources/leiningen/new/closp/integtest/clj/web/user.clj' did not match any file(s) known to git

--- resources/leiningen/new/closp/integtest/clj/web/user.clj
+++ resources/leiningen/new/closp/integtest/clj/web/user.clj
@@ -0,0 +1,27 @@
+(ns {{ns}}.web.user
+  (:require [clojure.test :refer :all]
+            [clj-webdriver.taxi :refer :all]
+            [{{ns}}.web.setup :as s]))
+
+(use-fixtures :each s/browser-setup)
+(use-fixtures :once s/server-setup)
+
+(deftest ^:integration login-invalid-username
+  (to s/test-base-url)
+  (quick-fill-submit {"#upper_email" "foo"}
+                     {"#upper_password" submit})
+  (is (.contains (text "body") (s/t :en :user/username_wrong))))
+
+(deftest ^:integration login-invalid-password
+  (to s/test-base-url)
+  (quick-fill-submit {"#upper_email" "admin@localhost.de"}
+                     {"#upper_password" "uiatern"}
+                     {"#upper_password" submit})
+  (is (.contains (text "body") (s/t :en :user/pass_correct))))
+
+(deftest ^:integration login-and-forward
+  (to (str s/test-base-url "admin/users"))
+  (quick-fill-submit {"#upper_email" "admin@localhost.de"}
+                     {"#upper_password" "admin"}
+                     {"#upper_password" submit})
+  (is (.contains (text "body") "Users")))


Fix false positive connection error identification

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


allow custom port, fix #1

allow custom port, fix #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/modnakasta/weasel.git/'


Add testing facilities for catacumba.

Add testing facilities for catacumba.

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


unit test of POST /api/meta/table/:id/reorder

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


Messaging namespace added in order to make the communication easier

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

--- src/clj/hellhound/messaging.clj
+++ src/clj/hellhound/messaging.clj
@@ -0,0 +1,8 @@
+(ns hellhound.messaging
+  "This namespace contains all the necessary means to handle client
+  side events.")
+
+(defmacro defrouter
+  "Create an event router to be used for dispatching client events"
+  [name body]
+  `(def ~name ~body))


numberfacts

numberfacts

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


Fix url building: seq creates sequence over collection. If the collection is empty, returns nil.  (seq nil) returns nil.

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/max-neverov/ads-client.git/'


initial stub at find-methods-by-signature

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

--- src/app/find.clj
+++ src/app/find.clj
@@ -0,0 +1,30 @@
+(ns ns ^{:author "Federico Tomassetti"
+         :doc "This namespace contains methods to find elements in a collection of compilation units"}
+  app.find
+  (:use [app.model.protocols])
+  (:use [app.model.javaparser])
+  (:use [app.javaparser.navigation])
+  (:use [app.operations])
+  (:use [app.itemsOnLifecycle])
+  (:use [app.utils])
+  (:require [instaparse.core :as insta])
+  (:import [app.operations Operation]))
+
+(defn param-match-type? [pair]
+  (let [[param expected-type] pair]))
+
+(defn method-match-exactly-parameters? [param-expected-types method]
+  (let [params (.getParameters method)
+        pairs (map vector params param-expected-types)]
+  (and
+    (= (count params) (count param-expected-types))
+    (every? (map param-match-type? pairs)))))
+
+(defn find-methods-by-signature
+  "Find all the methods in the given CUs which has the given names and have parameter types exactly equals to the one given"
+  [cus name param-types]
+  (let [ all-types (flatten (map allTypes cus))
+         all-methods (flatten (map getMethods all-types))
+         methods (filter (partial = name) all-methods)
+         methods' (filter (partial method-match-exactly-parameters? param-types) methods)]
+    methods'))


Missed one over zealous trace

Missed one over zealous trace

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


reactor code

reactor code

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@9471 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

error: pathspec 'plugins/SlideExplorer2/src/slide_explorer/reactors.clj' did not match any file(s) known to git

--- plugins/SlideExplorer2/src/slide_explorer/reactors.clj
+++ plugins/SlideExplorer2/src/slide_explorer/reactors.clj
@@ -0,0 +1,69 @@
+(ns slide-explorer.reactors
+  (:import (java.util.concurrent Executors)
+           (java.util UUID)
+           (clojure.lang IRef)))
+
+(defn add-watch-simple
+  "Adds a watch, automatically generating a key that is
+   attached to the reference as metadata. The function
+   should have arguments [old-state new-state]."
+  [reference function]
+  (let [key (UUID/randomUUID)]
+    (add-watch reference key
+               (fn [_ _ old-state new-state]
+                 (function old-state new-state)))))
+
+(defn single-threaded-executor []
+  "A single-threaded Executor. Call .submit to add Runnables or Callables."
+  (Executors/newFixedThreadPool 1))
+
+(defn add-reactive-watch
+  "Adds a watch that submits a function to run on a java executor
+   whenever the value of a reference changes. The function's arguments
+   should be [old-state new-state]. If executor arg is omitted, a new
+   single-threaded executor is created."
+  ([reference function executor]
+    (add-watch-simple reference
+                      (fn [old-state new-state]
+                        (when-not (= old-state new-state)
+                          (.submit executor #(function old-state new-state))))))
+  ([reference function]
+    (add-reactor-watch reference function (single-threaded-executor))))
+
+(defn remove-watches
+  "Removes all watches from a reference (ref/atom/agent)."
+  ([^IRef reference]
+    (doseq [key (keys (.getWatches reference))]
+      (remove-watch reference key)))
+  ([^IRef reference & more-references]
+    (doseq [each-ref (cons reference more-references)]
+      (remove-watches each-ref))))
+
+(defn diff-coll
+  "Returns the set of all items in coll1 but not in coll2."
+  [coll1 coll2]
+  (when-not (identical? coll1 coll2)
+    (let [diff
+          (clojure.set/difference
+            (set coll1)
+            (set coll2))]
+      (when-not (empty? diff)
+        diff))))
+
+(defn added-items-reactor
+  "Attaches a single-threaded reactive watch that applies a function to
+   the set of all items added to a coll inside reference (a ref/atom/agent/var)."
+  [reference function]
+  (add-reactor-watch reference
+                     (fn [old-state new-state]
+                       (when-let [diff (diff-coll new-state old-state)]
+                           (function diff)))))
+
+(defn removed-items-reactor
+  "Attaches a single-threaded reactive watch that applies a function to
+   the set of all items removed from a coll inside reference (a ref/atom/agent/var)."
+  [reference function]
+  (add-reactor-watch reference
+                     (fn [old-state new-state]
+                       (when-let [diff (diff-coll old-state new-state)]
+                           (function diff)))))


Data Browser in progress

Data Browser in progress

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@7003 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

error: pathspec 'plugins/DataBrowser/src/org/micromanager/browser/core.clj' did not match any file(s) known to git

--- plugins/DataBrowser/src/org/micromanager/browser/core.clj
+++ plugins/DataBrowser/src/org/micromanager/browser/core.clj
@@ -0,0 +1,150 @@
+(ns org.micromanager.browser.core
+  (:import [javax.swing JButton JFrame JLabel JPanel JScrollPane
+                        JTable JTextField RowFilter SpringLayout SwingUtilities]
+           [javax.swing.table AbstractTableModel TableRowSorter]
+           [javax.swing.event DocumentListener]
+           [java.io BufferedReader File FileReader]
+           [java.util Vector]
+           [java.awt Color Dimension Font Insets]
+           [java.awt.event KeyAdapter MouseAdapter]
+           [com.swtdesigner SwingResourceManager])
+  (:use [clooj.utils :only (constrain-to-parent attach-action-key)]
+        [clojure.contrib.json :only (read-json)]
+        [org.micromanager.mm :only (load-mm gui)]))
+
+(load-mm)
+
+(defn get-search-icon []
+  (SwingResourceManager/getIcon
+    org.micromanager.MMStudioMainFrame "icons/zoom.png"))
+
+(defn set-model [table m]
+  (.setModel table m)
+  (.setRowSorter table (TableRowSorter. m)))
+
+(defn set-filter [table text]
+  (let [sorter (.getRowSorter table)]
+      (do (.setRowFilter sorter (RowFilter/regexFilter text (int-array 0))))))
+
+(defn connect-search [search-field table]
+  (let [d (.getDocument search-field)
+        f (fn [] (SwingUtilities/invokeLater
+                   #(do (set-filter table (.getText d 0 (.getLength d)))
+                        (.setBackground search-field
+                          (if (zero? (.getRowCount table))
+                            Color/PINK Color/WHITE)))))]
+    (.addDocumentListener d
+      (reify DocumentListener
+        (insertUpdate [_ _] (f))
+        (changedUpdate [_ _] (f))
+        (removeUpdate [_ _] (f))))))
+
+(defn listen-to-open [table]
+  (.addMouseListener table
+    (proxy [MouseAdapter] []
+      (mouseClicked [e]
+        (if (= 2 (.getClickCount e))
+          (. gui openAcquisitionData (.getValueAt table (.getSelectedRow table) -1)))))))
+
+(defn create-browser [model]
+  (let [f (JFrame. "Micro-Manager Data Set Browser")
+        p (JPanel.)
+        t (proxy [JTable] [] (isCellEditable [_ _] false))
+        sc (JScrollPane. t)
+        tf (JTextField.)
+        search-label (JLabel.)
+        font-height (.getFont tf)
+        index-button (JButton. "Add folder...")
+        columns-button (JButton. "Columns...")]
+    (set-model t model)
+    (doto p (.add sc) (.add tf) (.add index-button)
+            (.add columns-button) (.add search-label))
+    (doto t (.setAutoCreateRowSorter true)
+            (.setShowVerticalLines true)
+            (.setShowGrid false)
+            (.setGridColor Color/LIGHT_GRAY)
+            (.setShowVerticalLines true))
+    (doto search-label (.setIcon (get-search-icon)))
+    (.setFont tf (.getFont t))
+    (.setLayout p (SpringLayout.))
+    (constrain-to-parent sc :n 32 :w 5 :s -5 :e -5)
+    (constrain-to-parent tf :n 5 :w 25 :n 28 :w 200)
+    (constrain-to-parent index-button :n 5 :w 205 :n 28 :w 330)
+    (constrain-to-parent columns-button :n 5 :w 330 :n 28 :w 450)
+    (constrain-to-parent search-label :n 5 :w 5 :n 28 :w 25)
+    (.setEnabled columns-button false)
+    (connect-search tf t)
+    (listen-to-open t)
+    (attach-action-key tf "ESCAPE" #(.setText tf ""))
+    (doto f (.. getContentPane (add p))
+       (.setBounds 50 50 500 500)
+       (.setVisible true))
+    {:frame f :table t :scroll-pane sc :index-button index-button
+     :columns-button columns-button :search-field tf}))
+
+(defn find-data-sets [root-dir]
+  (map #(.getParent %)
+    (->> (File. root-dir)
+      file-seq
+      (filter #(= (.getName %) "metadata.txt")))))
+
+(defn get-frame-index [file-name]
+  (try (Integer/parseInt (second (.split file-name "_")))
+     (catch Exception e nil)))
+
+(defn count-frames [data-set]
+  (inc
+    (apply max -1
+      (filter identity
+        (map #(get-frame-index (.getName %))
+             (.listFiles (File. data-set)))))))
+
+(defn get-display-and-comments [data-set]
+  (let [f (File. data-set "display_and_comments.txt")]
+    (if (.exists f) (read-json (slurp f) false) nil)))
+
+(defn read-summary-map [data-set]
+  (-> (->> (File. data-set "metadata.txt")
+           FileReader. BufferedReader. line-seq
+           (take-while #(not (.startsWith % "},")))
+           (apply str))
+      (.concat "}}") (read-json false) (get "Summary")))
+
+(defn get-summary-map [data-set]
+  (merge (read-summary-map data-set)
+    (if-let [frames (count-frames data-set)]
+      {"Frames" frames})
+    (if-let [d+c (get-display-and-comments data-set)]
+      {"Comment" (get-in d+c ["Comments" "Summary"])
+       "FrameComments" (dissoc (get d+c "Comments") "Summary")})
+    (let [data-dir (File. data-set)]
+      {"CurrentPath" (.getAbsolutePath data-dir)
+       "CurrentName" (.getName data-dir)})))
+
+(defn get-summary-maps [root-dir]
+  (map get-summary-map (find-data-sets root-dir)))
+
+(defn create-table-model [summary-maps headings]
+  (proxy [AbstractTableModel] []
+    (getRowCount [] (count summary-maps))
+    (getColumnCount [] (count headings))
+    (getValueAt [row col]
+      (get (nth summary-maps row)
+        (if (neg? col) "CurrentPath" (nth headings col))))
+    (getColumnName [col] (get headings col))))
+
+(def default-headings ["CurrentPath" "Time" "Frames" "Comment"])
+
+(defn start-browser []
+  (-> (get-summary-maps "/Users/arthur/qqq")
+    (create-table-model default-headings)
+    create-browser))
+
+;(defn update-browser [dir headings]
+;  (.setModel (:table browser)
+;             (create-table-model
+;               (swap! sm concat (get-summary-maps dir)) headings)))
+;
+
+
+


keywords as comments

keywords as comments


atoms section / tooltip placeholders

atoms section / tooltip placeholders

--- cljs-server/cljsinfo_server/pages/cheatsheet.cljs
+++ cljs-server/cljsinfo_server/pages/cheatsheet.cljs
@@ -5,8 +5,12 @@
     [cljsinfo-server.util :refer [js-log log]]))

 ;;------------------------------------------------------------------------------
-;; Function Lists
+;; Helpers
 ;;------------------------------------------------------------------------------
+
+(hiccups/defhtml tt-icon [tt-id]
+  [:i.fa.fa-info-circle.tooltip-link-0e91b
+    {:data-tooltip-id tt-id}])

 (hiccups/defhtml fn-link [nme href]
   [:a.fn-a8476 #_{:href href} nme])
@@ -20,8 +24,7 @@

 (hiccups/defhtml basics-section []
   [:div.section-31efe
-    [:h3.section-title-8ccf5 "Basics"
-      [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "basics"}]]
+    [:h3.section-title-8ccf5 "Basics" (tt-icon "basics")]
     [:table.tbl-902f0
       [:tbody
         [:tr.odd-372e6
@@ -48,8 +51,7 @@

 (hiccups/defhtml functions-section []
   [:div.section-31efe
-    [:h3.section-title-8ccf5 "#( ) Functions"
-      [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "functions"}]]
+    [:h3.section-title-8ccf5 "#( ) Functions" (tt-icon "functions")]
     [:table.tbl-902f0
       [:tbody
         [:tr.odd-372e6
@@ -84,8 +86,7 @@

 (hiccups/defhtml numbers-section []
   [:div.section-31efe
-    [:h3.section-title-8ccf5 "Numbers"
-      [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "numbers"}]]
+    [:h3.section-title-8ccf5 "Numbers" (tt-icon "numbers")]
     [:table.tbl-902f0
       [:tbody
         [:tr.odd-372e6
@@ -119,8 +120,7 @@

 (hiccups/defhtml strings-section []
   [:div.section-31efe
-    [:h3.section-title-8ccf5 "\" \" Strings"
-      [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "strings"}]]
+    [:h3.section-title-8ccf5 "\" \" Strings" (tt-icon "strings")]
     [:table.tbl-902f0
       [:tbody
         [:tr.odd-372e6
@@ -177,6 +177,36 @@
             [:span.literal-c3029 "(clojure.string/)"]
             [:a.fn-a8476 "blank?"]]]]]])

+(hiccups/defhtml atoms-section []
+  [:div.section-31efe
+    [:h3.section-title-8ccf5 "Atoms / State" (tt-icon "atoms")]
+    [:table.tbl-902f0
+      [:tbody
+        [:tr.odd-372e6
+          [:td.label-9e0b7 "Create"]
+          [:td.body-885f4
+            [:a.fn-a8476 "atom"]]]
+        [:tr.even-ff837
+          [:td.label-9e0b7 "Get Value"]
+          [:td.body-885f4
+            [:span.literal-c3029 "@my-atom → (" [:span.inside-fn-c7607 "deref"] " my-atom)"]]]
+        [:tr.odd-372e6
+          [:td.label-9e0b7 "Set Value"]
+          [:td.body-885f4
+            [:a.fn-a8476 "swap!"]
+            [:a.fn-a8476 "reset!"]
+            [:a.fn-a8476 "compare-and-set!"]]]
+        [:tr.even-ff837
+          [:td.label-9e0b7 "Watch for Changes"]
+          [:td.body-885f4
+            [:a.fn-a8476 "add-watch"]
+            [:a.fn-a8476 "remove-watch"]]]
+        [:tr.odd-372e6
+          [:td.label-9e0b7 "Validators"]
+          [:td.body-885f4
+            [:a.fn-a8476 "set-validator!"]
+            [:a.fn-a8476 "get-validator"]]]]]])
+
 (hiccups/defhtml js-interop-section []
   [:div.section-31efe
     [:h3.section-title-8ccf5 "JavaScript Interop"]
@@ -233,8 +263,7 @@

 (hiccups/defhtml collections-section []
   [:div.section-31efe
-    [:h3.section-title-8ccf5 "Collections"
-      [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "collections"}]]
+    [:h3.section-title-8ccf5 "Collections" (tt-icon "collections")]
     [:table.tbl-902f0
       [:tbody
         [:tr.odd-372e6
@@ -275,8 +304,7 @@

 (hiccups/defhtml lists-section []
   [:div.section-31efe
-    [:h3.section-title-8ccf5 "( ) Lists"
-      [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "lists"}]]
+    [:h3.section-title-8ccf5 "( ) Lists" (tt-icon "lists")]
     [:table.tbl-902f0
       [:tbody
         [:tr.odd-372e6
@@ -301,8 +329,7 @@

 (hiccups/defhtml vectors-section []
   [:div.section-31efe
-    [:h3.section-title-8ccf5 "[ ] Vectors"
-      [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "vectors"}]]
+    [:h3.section-title-8ccf5 "[ ] Vectors" (tt-icon "vectors")]
     [:table.tbl-902f0
       [:tbody
         [:tr.odd-372e6
@@ -316,7 +343,7 @@
           [:td.body-885f4
             [:div.row-5dec8
               "(my-vec idx) → (" [:a.inside-fn-c7607 "nth"] " my-vec idx)"
-              [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "vector-as-fn"}]]
+              (tt-icon "vector-as-fn")]
             [:a.fn-a8476 "get"]
             [:a.fn-a8476 "peek"]]]
         [:tr.odd-372e6
@@ -337,8 +364,7 @@

 (hiccups/defhtml sets-section []
   [:div.section-31efe
-    [:h3.section-title-8ccf5 "#{ } Sets"
-      [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "sets"}]]
+    [:h3.section-title-8ccf5 "#{ } Sets" (tt-icon "sets")]
     [:table.tbl-902f0
       [:tbody
         [:tr.odd-372e6
@@ -354,7 +380,7 @@
           [:td.body-885f4
             [:div.row-5dec8
               "(my-set itm) → (" [:a.inside-fn-c7607 "get"] " my-set itm)"
-              [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "set-as-fn"}]]
+              (tt-icon "set-as-fn")]
             [:a.fn-a8476 "contains?"]]]
         [:tr.odd-372e6
           [:td.label-9e0b7 "'Change'"]
@@ -378,8 +404,7 @@

 (hiccups/defhtml maps-section []
   [:div.section-31efe
-    [:h3.section-title-8ccf5 "{ } Maps"
-      [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "maps"}]]
+    [:h3.section-title-8ccf5 "{ } Maps" (tt-icon "maps")]
     [:table.tbl-902f0
       [:tbody
         [:tr.odd-372e6
@@ -398,7 +423,7 @@
           [:td.body-885f4
             [:div.row-5dec8
               "(:key my-map) → (" [:a.inside-fn-c7607 "get"] " my-map :key)"
-              [:i.fa.fa-info-circle.tooltip-link-0e91b {:data-tooltip-id "keywords-as-fn"}]]
+              (tt-icon "keywords-as-fn")]
             [:a.fn-a8476 "get-in"]
             [:a.fn-a8476 "contains?"]
             [:a.fn-a8476 "find"]
@@ -611,6 +636,22 @@
 ;; You're welcome.

 (hiccups/defhtml tooltips []
+
+  [:div#tooltip-basics.tooltip-53dde {:style "display:none"}
+    [:i.fa.fa-thumb-tack.pin-0ad63]
+    [:p.info-2e4f9
+      "TODO: basics tooltip content"]]
+
+  [:div#tooltip-functions.tooltip-53dde {:style "display:none"}
+    [:i.fa.fa-thumb-tack.pin-0ad63]
+    [:p.info-2e4f9
+      "TODO: functions tooltip content"]]
+
+  [:div#tooltip-atoms.tooltip-53dde {:style "display:none"}
+    [:i.fa.fa-thumb-tack.pin-0ad63]
+    [:p.info-2e4f9
+      "TODO: atoms tooltip content"]]
+
   [:div#tooltip-numbers.tooltip-53dde {:style "display:none"}
     [:i.fa.fa-thumb-tack.pin-0ad63]
     [:p.info-2e4f9
@@ -627,6 +668,21 @@
     [:p.info-2e4f9
       "The " [:code "clojure.string"] " namespace provides many useful "
       "functions for dealing with strings."]]
+
+  [:div#tooltip-collections.tooltip-53dde {:style "display:none"}
+    [:i.fa.fa-thumb-tack.pin-0ad63]
+    [:p.info-2e4f9
+      "TODO: collections tooltip content"]]
+
+  [:div#tooltip-lists.tooltip-53dde {:style "display:none"}
+    [:i.fa.fa-thumb-tack.pin-0ad63]
+    [:p.info-2e4f9
+      "TODO: lists tooltip content"]]
+
+  [:div#tooltip-sets.tooltip-53dde {:style "display:none"}
+    [:i.fa.fa-thumb-tack.pin-0ad63]
+    [:p.info-2e4f9
+      "TODO: sets tooltip content"]]

   [:div#tooltip-vectors.tooltip-53dde {:style "display:none"}
     [:i.fa.fa-thumb-tack.pin-0ad63]
@@ -683,11 +739,12 @@
     [:h2.group-title-68f3c "Basics"]
     [:div.col-left-d5f6d
       (basics-section)
-      (numbers-section)]
+      (functions-section)]
     [:div.col-mid-bb1aa
-      (functions-section)
+      (numbers-section)
       (strings-section)]
     [:div.col-right-0f4a3
+      (atoms-section)
       (js-interop-section)]

     [:h2.group-title-68f3c "Collections"]


add simple internal metro example

add simple internal metro example

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

--- test/example/internal_metro.clj
+++ test/example/internal_metro.clj
@@ -0,0 +1,34 @@
+(ns scratch.internal-metro
+  (:use [overtone.live]))
+
+;; A basic demo of how you can use internal impulses to drive the rhythm of a synth
+
+(demo 5
+     (let [src1      (sin-osc 440)
+           src2      (sin-osc 880)
+           root-trig (impulse:kr 100)
+           t1        (pulse-divider:kr root-trig 20)
+           t2        (pulse-divider:kr root-trig 10)]
+  (+ (* (decay t1 0.1) src1)
+     (* (decay t2 0.1) src2))))
+
+
+;; Here's how you can separate the impulses out across synths and connect them
+;; together with a control bus
+
+(def c-bus (control-bus))
+
+(defsynth root-trig [rate 100]
+ (out c-bus (impulse:kr rate)))
+
+(definst pingr [freq 440 div 20]
+ (let [src1 (sin-osc freq)
+       t1 (pulse-divider:kr (in:kr c-bus) div)]
+   (* (decay t1 0.1) src1)))
+
+(def r-trig (root-trig))
+(pingr)
+(pingr 440 50)
+(pingr 990 40)
+(ctl r-trig :rate 50)
+(stop)


Fix indentation.

Fix indentation.

--- test/start/test/integration.clj
+++ test/start/test/integration.clj
@@ -17,7 +17,7 @@
          {:state :greeting, :name "Ted", :exists false}))
   (is (true? (contains? @database "Ted"))))

-  (deftest test-enter-existing-name
+(deftest test-enter-existing-name
   (reset! database #{"Ted"})
   (cljs-eval start.view
              (dispatch/fire :form)


Stub for tests for the config-loader module

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

--- test/cloverage_jenkins_reporter/config_loader_test.clj
+++ test/cloverage_jenkins_reporter/config_loader_test.clj
@@ -0,0 +1,56 @@
+;;;
+;;;   Statistic about code coverage measured by Cloverage reporter.
+;;;
+;;; Copyright (c) 2015, 2016, 2017  Pavel Tisnovsky, Red Hat
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions are met:
+;;;     * Redistributions of source code must retain the above copyright
+;;;       notice, this list of conditions and the following disclaimer.
+;;;     * Redistributions in binary form must reproduce the above copyright
+;;;       notice, this list of conditions and the following disclaimer in the
+;;;       documentation and/or other materials provided with the distribution.
+;;;     * Neither the name of the Red Hat nor the
+;;;       names of its contributors may be used to endorse or promote products
+;;;       derived from this software without specific prior written permission.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+;;; DISCLAIMED. IN NO EVENT SHALL Pavel Tisnovsky BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+;;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+;;; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(ns cloverage-jenkins-reporter.config-loader-test
+  (:require [clojure.test :refer :all]
+            [cloverage-jenkins-reporter.config :refer :all]))
+
+;
+; Common functions used by tests.
+;
+
+(defn callable?
+    "Test if given function-name is bound to the real function."
+    [function-name]
+    (clojure.test/function? function-name))
+
+;
+; Tests for various defs and functions
+;
+
+(deftest test-properties->map-existence
+    "Check that the cloverage-jenkins-reporter.config-loader/properties->map definition exists."
+    (testing "if the cloverage-jenkins-reporter.config-loader/properties->map definition exists."
+        (is (callable? 'cloverage-jenkins-reporter.config-loader/properties->map))))
+
+
+(deftest test-load-configuration-file-existence
+    "Check that the cloverage-jenkins-reporter.config-loader/load-configuration-file definition exists."
+    (testing "if the cloverage-jenkins-reporter.config-loader/load-configuration-file definition exists."
+        (is (callable? 'cloverage-jenkins-reporter.config-loader/load-configuration-file))))
+


add basic functions for file processing.

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


Elide :column metadata too

Elide :column metadata too

--- src/leiningen/droid/compile.clj
+++ src/leiningen/droid/compile.clj
@@ -119,7 +119,7 @@
                       :neko.init/nrepl-middleware (list 'quote nrepl-middleware)
                       :neko.init/package-name (get-package-name manifest-path)}
                      (not dev-build) (assoc :elide-meta
-                                       [:doc :file :line :added :arglists]))]
+                                       [:doc :file :line :column :added :arglists]))]
     (info (format "Build type: %s, dynamic compilation: %s, remote REPL: %s."
                   (if dev-build "debug" "release")
                   (if (or dev-build start-nrepl-server


tweak

tweak

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


add member and take

add member and take

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


Add queries namespace

Add queries namespace

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

--- src/clj/gtfve/data/queries.clj
+++ src/clj/gtfve/data/queries.clj
@@ -0,0 +1,37 @@
+(ns gtfve.data.queries
+  (:require [datomic.api :as d]
+            [gtfve.data.connection :refer [conn uri feed]]))
+
+(defn trips []
+  (let [db (d/db conn)]
+    (->> (d/datoms db :aevt :trip/id)
+         (map :e)
+         (map (partial d/entity db))
+         (map d/touch))))
+
+(defn routes
+  ([]
+   (let [db (d/db conn)]
+     (->> (d/datoms db :aevt :route/id)
+          (map :e)
+          (map (partial d/entity db))
+          (map d/touch))))
+  ([id]
+   (let [db (d/db conn)]
+     (->> (d/q {:find ['?r]
+                :in ['$ '?id]
+                :where [['?r :route/id '?id]]}
+               db id)
+          (map first)
+          (map (partial d/entity db))
+          (map d/touch)))))
+
+(defn haversine
+  [{lon1 :longitude lat1 :latitude} {lon2 :longitude lat2 :latitude}]
+  (let [R 6372.8
+        dlat (Math/toRadians (- lat2 lat1))
+        dlon (Math/toRadians (- lon2 lon1))
+        lat1 (Math/toRadians lat1)
+        lat2 (Math/toRadians lat2)
+        a (+ (* (Math/sin (/ dlat 2)) (Math/sin (/ dlat 2))) (* (Math/sin (/ dlon 2)) (Math/sin (/ dlon 2)) (Math/cos lat1) (Math/cos lat2)))]
+    (* R 2 (Math/asin (Math/sqrt a)))))


Clojure Collector: do not allow dependencies requiring an HTTP repository (closes #3559)

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/liveintent-berlin/snowplow.git/'