Never return the recent activity sort link for the drafts board, not in the single board response, not in the boards list response.

--- src/oc/storage/representations/board.clj
+++ src/oc/storage/representations/board.clj
@@ -70,10 +70,12 @@
 (defn- board-collection-links [board org-slug draft-count]
   (let [board-slug (:slug board)
         options (if (zero? draft-count) {} {:count draft-count})
+        is-draft-board? (= board-slug "drafts")
         links [(self-link org-slug board-slug :recently-posted options)
-               (self-link org-slug board-slug :recent-activity options)]
+               (when-not is-draft-board?
+                 (self-link org-slug board-slug :recent-activity options))]
         full-links (if (or (= :author (:access-level board))
-                           (= board-slug "drafts"))
+                           is-draft-board?)
           ;; Author gets create link
           (conj links (create-entry-link org-slug board-slug))
           ;; No create link
@@ -86,9 +88,11 @@
         is-drafts-board? (= slug "drafts")
         pagination-links (if is-drafts-board? [] (pagination-links org-slug slug sort-type params board))
         ;; Everyone gets these
-        links (concat pagination-links [(self-link org-slug slug :recently-posted)
-                                        (self-link org-slug slug :recent-activity)
-                                        (up-link org-slug)])
+        links (remove nil?
+               (concat pagination-links [(self-link org-slug slug :recently-posted)
+                                         (when-not is-drafts-board?
+                                            (self-link org-slug slug :recent-activity))
+                                        (up-link org-slug)]))
         ;; Authors get board management links
         full-links (if (= access-level :author)
                      (concat links [(create-entry-link org-slug slug)


makecontent.clj: fix *reporter* binding

makecontent.clj: fix *reporter* binding

--- src/org/altlaw/jobs/post/makecontent.clj
+++ src/org/altlaw/jobs/post/makecontent.clj
@@ -16,9 +16,10 @@
         nil)))

 (defn mapper-map [this wkey wvalue output reporter]
-  (let [[key value] (my-map (read-string (str wkey))
-                            (read-string (str wvalue)))]
-    (.collect output (Text. key) (Text. value))))
+  (binding [h/*reporter* reporter]
+   (let [[key value] (my-map (read-string (str wkey))
+                             (read-string (str wvalue)))]
+     (.collect output (Text. key) (Text. value)))))

 (defn tool-run [this args]
   (let [job (h/default-jobconf this)


remove unused nml-add

remove unused nml-add

--- src/nml/core.clj
+++ src/nml/core.clj
@@ -46,14 +46,6 @@
   (System/exit 0))

 ;; nml private defns
-
-(defn- nml-add [tree parent child match proxy]
-  (let [missing  (fn [children] (not-any? #(= (nml-name %) match) children))
-        vnew    #(nml-parse proxy child)
-        f        (fn [& children] (if (missing children)
-                                    (into [parent (vnew)] children)
-                                    (into [parent       ] children)))]
-    (if (nil? tree) [parent (vnew)] (insta/transform {parent f} tree))))

 (defn- nml-gets [m gets no-prefix]
   (let [f (fn [[nml key]]


change ruler degrees

change ruler degrees

--- src/uxbox/ui/workspace/canvas/ruler.cljs
+++ src/uxbox/ui/workspace/canvas/ruler.cljs
@@ -83,8 +83,8 @@
 (def ^:private ^:static +immanted-zones+
   (let [transform #(vector (- % 7) (+ % 7) %)]
     (concat
-     (mapv transform (range 0 181 10))
-     (mapv (comp transform -) (range 0 181 10)))))
+     (mapv transform (range 0 181 15))
+     (mapv (comp transform -) (range 0 181 15)))))

 (defn- overlay-will-mount
   [own local]


Increase the HTTP thread count to allow Jetty to startup.

--- metlog-vault/src-server/metlog_vault/core.clj
+++ metlog-vault/src-server/metlog_vault/core.clj
@@ -16,7 +16,7 @@
             [metlog-vault.data :as data]
             [hiccup.core :as hiccup]))

-(def http-thread-count 4)
+(def http-thread-count 8)

 (defmacro get-version []
   ;; Capture compile-time property definition from Lein


Try using a different version of devcards

--- build.boot
+++ build.boot
@@ -69,7 +69,7 @@

                             [ring/ring-mock "0.3.0" :scope "test"]
                             [figwheel-sidecar "0.5.9" :scope "test"]
-                            [devcards "0.2.2" :scope "test"]
+                            [devcards "0.2.1-7" :scope "test"]
                             [com.cemerick/piggieback "0.2.1" :scope "test"]
                             [weasel "0.7.0"     :scope "test"]
                             [org.clojure/tools.nrepl "0.2.12" :scope "test"]


Add/Update travis targets

Add/Update travis targets

--- build.boot
+++ build.boot
@@ -48,3 +48,11 @@

 (deftask release []
   (comp (pom) (jar) (push)))
+
+;; Travis Only stuff
+(deftask travis []
+  (testing)
+  (t/test))
+
+(deftask travis-installdeps []
+  (testing) identity)


Fix indentations

Fix indentations

--- build.boot
+++ build.boot
@@ -63,17 +63,17 @@
 ;;; Building

 (task-options!
-  pom {:project     'pva-parrot
-       :version     (:version project)
-       :description (:description project)})
+ pom {:project     'pva-parrot
+      :version     (:version project)
+      :description (:description project)})

 (task-options!
-  apidoc {:version     (:version project)
-          :title       (:title project)
-          :sources     (:sources project)
-          :description (:description project)
-          :src-uri     "https://github.com/PVA-Parrot/PVA-Parrot/tree/master/"
-          :target      "target/doc"})
+ apidoc {:version     (:version project)
+         :title       (:title project)
+         :sources     (:sources project)
+         :description (:description project)
+         :src-uri     "https://github.com/PVA-Parrot/PVA-Parrot/tree/master/"
+         :target      "target/doc"})

 (deftask build []
   (comp (notify)


added backward compatibility with old txlog format

--- core/src/samsara_core/kernel2.clj
+++ core/src/samsara_core/kernel2.clj
@@ -252,6 +252,16 @@
   (kv/restore (or kvstore (kv/make-in-memory-kvstore)) txlog-events))

+(defn- normalize-kvstore-events [events]
+  (map (fn [event]
+         (if (map? event)
+           event
+           {:timestamp 0 :eventName kv/EVENT-STATE-UPDATED
+            :sourceId (first event) :version (second event)
+            :value (last event)}))
+       events))
+
+

 (defn global-kv-restore
   "Takes a bunch of tx-log events and restores them in the global-stores"
@@ -261,7 +271,7 @@
    (swap! global-stores
           update
           stream-id
-          kv-restore events)
+          kv-restore (normalize-kvstore-events events))
    []))

@@ -278,7 +288,8 @@
   ([{:keys [component stream-id events]}]
    (let [kv-store (:local-store (stream-config component stream-id))]
      (var-set kv-store
-              (kv-restore (var-get kv-store) events)))))
+              (kv-restore (var-get kv-store)
+                          (normalize-kvstore-events events))))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -367,24 +378,15 @@
          (partition-filter-wrapper input-partitions))))

-(defn- tx-log->formatter
-  "Return a function which turns the tx-log into a a triplet of
-
-   [topic partition-key json-data]"
-  [kvstore-topic]
-  (fn [txlog]
-    (->> txlog
-         (map (fn [[k ver v]]
-                [kvstore-topic k (to-json [k ver v])])))))
-
-;; TODO: change txlog format look like events
 ;; TODO: support dispatch-fn and  format fn
 (defn topic-process-wrapper [component stream-id pipeline]
   (let [{:keys [local-store state-topic
                 output-topic-partition-fn output-topic ]
          } (stream-config component stream-id)
         output-collector (:output-collector component)
-        tx-log->messages (tx-log->formatter state-topic)
+        tx-log->messages (fn [event] [state-topic
+                                     (:sourceId event)
+                                     (to-json event)])
         out-dispatch (fn [event] [output-topic
                                  (output-topic-partition-fn event)
                                  (to-json event)])]
@@ -392,7 +394,7 @@
       (let [state    (var-get local-store)
             [new-state rich-events] (pipeline state events)
             txlog     (kv/tx-log new-state)
-            txlog-msg (tx-log->messages txlog)
+            txlog-msg (map tx-log->messages txlog)
             output-events (map out-dispatch events)
             all-output (concat txlog-msg output-events)]

@@ -630,115 +632,3 @@
           (build-routes cmp)) events))

   )
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-(defn rand-topic []
-  (rand-nth ["ingestion" "ingestion-kv" "vod-programme" "brands" "matrix"]))
-
-(defn rand-partition []
-  (rand-int 5))
-
-(defn rand-key []
-  (str "key-" (rand-int 100)))
-
-(defn rand-msg []
-  (to-json
-   {:a (rand-nth ["hi" "hola" "ciao" "sia" "czesc" "salut"])
-    :b (rand-int 100)
-    :c (rand-int 100)}))
-
-(defn rand-element []
-  {:topic     (rand-topic)
-   :partition (rand-partition)
-   :key       (rand-key)
-   :message   (rand-msg)})
-
-(defn rand-stream []
-  (repeatedly rand-element))
-
-(defonce values (take 30 (rand-stream)))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(def global (atom []))
-
-(def dispatchers
-  [[(where [:or [:topic = "ingestion"] [:topic = "ingestion-kv"]])
-    (->> (dispatch-group-by
-          [[(where :topic = "ingestion-kv") (message-only-wrapper (fn [v] [{:kv v}]))]
-           [:default (message-only-wrapper
-                      (topic-dispatcher
-                       #(if (even? (:b %)) "even" "odd") :a
-                       (to-json-format-wrapper
-                        (fn [v] [{:stream v}]))))]])
-         from-json-format-wrapper
-         (partition-filter-wrapper [1 2]))
-    ]
-
-   [(where :topic = "vod-programme")
-    (fn [values]
-      (->> values
-           (map (comp from-json :message))
-           (swap! global into))
-      [])]
-
-   [(where :topic = "brands")
-    (fn [values]
-      (->> values
-           (map (comp from-json :message))
-           (swap! global into))
-      [])]
-
-   [:default (fn [v])]])
-
-(comment
-  (->> values
-       ((process (dispatch-group-by dispatchers))))
-
-
-  )
-
-
-(comment
-
-  (require '[clj-kafka.producer :as kp])
-  (let [brokers "localhost:9092"
-        topic  "ingestion"
-        prodx  (kp/producer
-                {"metadata.broker.list" brokers
-                 "request.required.acks"  "-1"
-                 "producer.type" "sync"
-                 "serializer.class" "kafka.serializer.StringEncoder"
-                 "partitioner.class" "kafka.producer.DefaultPartitioner"})
-        now     (System/currentTimeMillis)
-        event   (fn [i] {:timestamp (+ now i) :eventName "test" :sourceId (str "d" i)})
-        events  (partition-all 1000 (take (* 5 1000 1000) (map event (range))))
-        ->msg   (fn [{:keys [sourceId] :as e}]
-                 (kp/message topic sourceId (to-json e)))]
-    (doseq [batch events]
-      (kp/send-messages prodx (map ->msg batch)))
-    :all-done)
-
-
-  (let [brokers "localhost:9092"
-        topic  "vod-programme"
-        prodx  (kp/producer
-                {"metadata.broker.list" brokers
-                 "request.required.acks"  "-1"
-                 "producer.type" "sync"
-                 "serializer.class" "kafka.serializer.StringEncoder"
-                 "partitioner.class" "kafka.producer.DefaultPartitioner"})
-        now     (System/currentTimeMillis)
-        kv      (kv/make-in-memory-kvstore)
-        kvx   (fn [kv i] (kv/set kv (str "d" (mod i 100)) :key i))
-        events  (partition-all 1000
-                               (kv/tx-log (reduce kvx kv (take (* 5 1000 1000) (range)))))
-        ->msg   (fn [[key :as tx]] (kp/message topic (str key) (to-json tx)))]
-    (doseq [batch events]
-      (kp/send-messages prodx (map ->msg batch)))
-    :all-done)
-  )


Fix source mapping of exceptions

Fix source mapping of exceptions

The lines near the beginning of the source
(the comment and goog. directives)
mess up the source map line mappings.
Split out the source and evaluate separately.

--- planck-cljs/src/planck/repl.cljs
+++ planck-cljs/src/planck/repl.cljs
@@ -503,6 +503,15 @@
   [path]
   (str "file:///" path))

+(defn- split-source
+  "Splits a JavaScript source file into
+  the goog directives and the remainder."
+  [source]
+  (->> (s/split source "\n")
+    rest
+    (split-with #(s/starts-with? % "goog."))
+    (mapv #(s/join "\n" %))))
+
 (defn- caching-js-eval
   [{:keys [path name source cache]}]
   (let [source (str (form-compiled-by-string (form-build-affecting-options)) "\n" source)]
@@ -513,9 +522,11 @@
         (cljs->transit-json (get-in @planck.repl/st [:source-maps name]))))
     (if (and (not (empty? path))
           (not= "Expression" path))
-      (let [exception (js/PLANCK_EVAL (str "\n" source) (file-url (js-path-for-name name)))]
-        (when exception
-          (throw exception)))
+      (let [[pre post] (split-source source)]
+        (js/eval pre)
+        (let [exception (js/PLANCK_EVAL post (file-url (js-path-for-name name)))]
+          (when exception
+            (throw exception))))
       (js/eval source))))

 (defn- extension->lang
@@ -580,7 +591,9 @@
       (when (and sourcemap-json name)
         (swap! st assoc-in [:source-maps name] (transit-json->cljs sourcemap-json)))
       (when-not (skip-load-js? name)
-        (js/PLANCK_EVAL (str "\n" js-source) (file-url (add-suffix path ".js"))))
+        (let [[pre post] (split-source js-source)]
+          (js/eval pre)
+          (js/PLANCK_EVAL post (file-url (add-suffix path ".js")))))
       (merge {:lang   :js
               :source ""}
         (when cache-json


Format project.clj

Format project.clj

--- frontend/project.clj
+++ frontend/project.clj
@@ -2,7 +2,7 @@
   :description "FIXME: write this!"
   :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"
-            :url "http://www.eclipse.org/legal/epl-v10.html"}
+            :url  "http://www.eclipse.org/legal/epl-v10.html"}

   :min-lein-version "2.6.1"

@@ -27,39 +27,39 @@
   :clean-targets ^{:protect false} ["resources/public/js/compiled" "target"]

   :cljsbuild {:builds
-              [{:id "dev"
+              [{:id           "dev"
                 :source-paths ["src/cruncher"]
-                :figwheel {:on-jsload "cruncher.core/on-js-reload"
-                           :open-urls ["http://localhost:3449/index.html"]}
-                :compiler {:main cruncher.core
-                           :preloads [devtools.preload]
-                           :asset-path "js/compiled/out"
-                           :output-to "resources/public/js/compiled/cruncher.js"
-                           :output-dir "resources/public/js/compiled/out"
-                           :source-map-timestamp true}}
-               {:id "devcards"
+                :figwheel     {:on-jsload "cruncher.core/on-js-reload"
+                               :open-urls ["http://localhost:3449/index.html"]}
+                :compiler     {:main                 cruncher.core
+                               :preloads             [devtools.preload]
+                               :asset-path           "js/compiled/out"
+                               :output-to            "resources/public/js/compiled/cruncher.js"
+                               :output-dir           "resources/public/js/compiled/out"
+                               :source-map-timestamp true}}
+               {:id           "devcards"
                 :source-paths ["src/cruncher" "src/devcards"]
-                :figwheel {:devcards true}
-                :compiler {:main cruncher.devcards.core
-                           :asset-path "js/compiled/devcards/out"
-                           :output-to "resources/public/js/compiled/cruncher.js"
-                           :output-dir "resources/public/js/compiled/devcards/out"
-                           :source-map-timestamp true}}
+                :figwheel     {:devcards true}
+                :compiler     {:main                 cruncher.devcards.core
+                               :asset-path           "js/compiled/devcards/out"
+                               :output-to            "resources/public/js/compiled/cruncher.js"
+                               :output-dir           "resources/public/js/compiled/devcards/out"
+                               :source-map-timestamp true}}
                ;; This next build is an compressed minified build for
                ;; production. You can build this with:
                ;; lein cljsbuild once min
-               {:id "min"
+               {:id           "min"
                 :source-paths ["src"]
-                :compiler {:output-to "resources/public/js/compiled/cruncher.js"
-                           :main cruncher.core
-                           :optimizations :advanced
-                           :pretty-print false}}]}
+                :compiler     {:output-to     "resources/public/js/compiled/cruncher.js"
+                               :main          cruncher.core
+                               :optimizations :advanced
+                               :pretty-print  false}}]}

   :figwheel {;; :http-server-root "public" ;; default and assumes "resources"
              ;; :server-port 3449 ;; default
              ;; :server-ip "127.0.0.1"

-             :css-dirs ["resources/public/css"] ;; watch and update CSS
+             :css-dirs ["resources/public/css"]             ;; watch and update CSS

              ;; Start an nREPL server into the running figwheel process
              ;; :nrepl-port 7888
@@ -103,7 +103,7 @@
                    ;; for CIDER
                    ;; :plugins [[cider/cider-nrepl "0.12.0"]]
                    :repl-options {; for nREPL dev you really need to limit output
-                                  :init (set! *print-length* 50)
+                                  :init             (set! *print-length* 50)
                                   :nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}

-)
+  )


CMR-1600: Additional nested query tests

CMR-1600: Additional nested query tests

--- system-int-test/test/cmr/system_int_test/search/collection_identifier_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_identifier_search_test.clj
@@ -95,7 +95,7 @@
            all-prov1-colls "pRoV1" {:ignore-case true}
            [] "prov1" {:ignore-case false}))

-    (testing "provider with JSON parameters"
+    (testing "Provider search using JSON query"
       (are [items json-search]
            (d/refs-match? items (search/find-refs-with-json-query :collection {} json-search))

@@ -258,7 +258,7 @@
            [c1-p1 c1-p2] "S1_v1" {:ignore-case true}
            [] "S1_v1" {:ignore-case false}))

-    (testing "Entry id search using JSON"
+    (testing "Entry id search using JSON Query"
       (are [items json-search]
            (d/refs-match? items (search/find-refs-with-json-query :collection {} json-search))

@@ -273,6 +273,16 @@
                                            {:entry-id "S2_V2"}]}
            [] {:and [{:entry-id "S1_V1"}
                      {:entry-id "S2_V2"}]}
+
+           ;; Not with multiple entry-ids
+           [c3-p1 c3-p2 c4-p1 c4-p2] {:not {:or [{:entry-id "S2_V2"}
+                                                 {:entry-id "S1_V1"}]}}
+
+           ;; Not with multiple entry-ids and provider
+           [c3-p1 c4-p1] {:not {:or [{:entry-id "S2_V2"}
+                                     {:entry-id "S1_V1"}
+                                     {:provider "PROV2"}]}}
+
            ))
            ;; TODO
            ;; Wildcards
@@ -319,7 +329,7 @@
             (search/find-refs :collection {:dataset-id "ET1"}))
           "dataset_id should be an alias for entry title."))

-    (testing "Entry title search using JSON"
+    (testing "Entry title search using JSON Query"
       (are [items json-search]
            (d/refs-match? items (search/find-refs-with-json-query :collection {} json-search))


trying small tweak around lib64 for js on linux

--- config/software/spidermonkey.clj
+++ config/software/spidermonkey.clj
@@ -22,7 +22,7 @@
        {:command "make" :args ["BUILD_OPT=1" "JS_DIST=/opt/opscode/embedded" "-f" "Makefile.ref" "export"]}]
       steps
       (cond
-       (is-machine? "x86_64")
+       (and (is-os? "linux") (is-machine? "x86_64"))
        (concat
         initial-steps
         [{:command "mv" :args ["/opt/opscode/embedded/lib64/libjs.a" "/opt/opscode/embedded/lib"]}


Log audio beats.

Log audio beats.

--- config.clj
+++ config.clj
@@ -57,7 +57,7 @@
         :code [:A :A :A :A :X :Y :start]
         :mode :bombs)
       (handler/buffer-keys 20)
-      (handler/log-events (comp #{:button/press} :type))
+      (handler/log-events (comp #{:audio/beat :button/press} :type))
       (handler/system-reset)))


Test to check for excessive temp-file-store threads

--- ring-core/test/ring/middleware/multipart_params/test/temp_file.clj
+++ ring-core/test/ring/middleware/multipart_params/test/temp_file.clj
@@ -25,3 +25,15 @@
     (is (.exists (:tempfile result)))
     (Thread/sleep 2500)
     (is (not (.exists (:tempfile result))))))
+
+(defn all-threads []
+  (.keySet (Thread/getAllStackTraces)))
+
+(deftest test-temp-file-threads
+  (let [store (temp-file-store)]
+    (dotimes [_ 200]
+      (store {:filename "foo.txt"
+              :content-type "text/plain"
+              :stream (string-input-stream "foo")}))
+    (is (< (count (all-threads))
+           100))))


CMR-3560: Fixing group crud test organization.

--- access-control-app/int_test/cmr/access_control/int_test/access_control_group_crud_test.clj
+++ access-control-app/int_test/cmr/access_control/int_test/access_control_group_crud_test.clj
@@ -358,17 +358,17 @@

     (u/wait-until-indexed)

-    (testing "We should now successfully update groups with a legacy_guid, without specifying the legacy_guid in the updated group")
-    (is (= {:status 200 :concept_id concept-id :revision_id 2}
-           response-no-legacy))
-    (u/assert-group-saved (assoc no-legacy-group :legacy_guid "legacy_guid_1") "user1" concept-id 2)
-
-    (testing "Specifying the same legacy_guid should also successfully update the group")
-    (is (= {:status 200 :concept_id concept-id :revision_id 3}
-           response-same-legacy))
-    (u/assert-group-saved same-legacy-group "user1" concept-id 3)
-
-    (testing "When specifying a different legacy_guid, an error message should be received")
-    (is (= {:status 400,
-            :errors ["Legacy Guid cannot be modified. Attempted to change existing value [legacy_guid_1] to [wrong_legacy_guid]"]}
-           response-diff-legacy))))
+    (testing "We should now successfully update groups with a legacy_guid, without specifying the legacy_guid in the updated group"
+      (is (= {:status 200 :concept_id concept-id :revision_id 2}
+             response-no-legacy))
+      (u/assert-group-saved (assoc no-legacy-group :legacy_guid "legacy_guid_1") "user1" concept-id 2))
+
+    (testing "Specifying the same legacy_guid should also successfully update the group"
+      (is (= {:status 200 :concept_id concept-id :revision_id 3}
+             response-same-legacy))
+      (u/assert-group-saved same-legacy-group "user1" concept-id 3))
+
+    (testing "When specifying a different legacy_guid, an error message should be received"
+      (is (= {:status 400,
+              :errors ["Legacy Guid cannot be modified. Attempted to change existing value [legacy_guid_1] to [wrong_legacy_guid]"]}
+             response-diff-legacy)))))


fixed *skip* for tests when not *dry-run*

--- src/yar/core.clj
+++ src/yar/core.clj
@@ -9,9 +9,9 @@

 (def ^:dynamic *timestamp* nil)
-(def ^:dynamic *dry-run* nil)
-(def ^:dynamic *skip* nil)
-(def ^:dynamic *log-script* nil)
+(def ^:dynamic *dry-run* false)
+(def ^:dynamic *skip* false)
+(def ^:dynamic *log-script* false)
 (def this-ns *ns*)
 (def genv (atom {}))

@@ -218,8 +218,8 @@

 (defn run-test
   [t]
-  (binding [*dry-run* (or *dry-run* (:skip t))
-            *skip* (or *skip* (:skip t))]
+  (binding [*skip* (or *skip* (:skip t))
+            *dry-run* (or *dry-run* *skip*)]
     (let [test-invocation-string (lsh/stream-to-string
                                    (apply lsh/proc ["bash" "-c" (str "printf \"" (:invocation t) "\"") :env @genv])
                                    :out)]
@@ -230,10 +230,10 @@
               err (lsh/stream-to-string proc :err)]

           (when-not (zero? (count out))
-            (log {:stdout (str "\t" test-invocation-string ": " out)}))
+            (log {:stdout (str (when *skip* "# ") "\t" test-invocation-string ": " out)}))

           (when-not (zero? (count err))
-            (log {:stdout (str "\t" test-invocation-string)})
+            (log {:stdout (str (when *skip* "# ") "\t" test-invocation-string)})
             (log {:stdout ""
                   :stderr err}))


Use symbols for Thymine and Uracil

Use symbols for Thymine and Uracil

--- clojure/rna-transcription/dna.clj
+++ clojure/rna-transcription/dna.clj
@@ -1,7 +1,12 @@
 (ns dna)

+(def Thymine \T)
+(def Uracil  \U)
+
 (defn- strand-convert [ch]
-    (if (= \T ch) \U ch)
+    (if (= Thymine ch)
+        Uracil
+        ch)
 )

 (defn to-rna [dna]


[#1441] Adapt to PR review

[#1441] Adapt to PR review

--- backend/src/akvo/lumen/specs/components/caddisfly.clj
+++ backend/src/akvo/lumen/specs/components/caddisfly.clj
@@ -13,9 +13,3 @@

 (defmethod integrant-key ::caddisfly/local [_]
   (s/cat :kw keyword? :config (s/keys :req-un [::caddisfly/config])))
-
-(s/explain :integrant/component-args [::caddisfly/local
-                                      {:config {:caddisfly {:local-schema-uri "./caddisfly/tests-schema.json"}}}])
-
-
-#_(ig/init-key ::caddisfly/local {:config {:caddisfly {:local-schema-uri "./caddisfly/tests-schema.json"}}})


Pin org.clojure/tools.nrepl to 0.2.7

Pin org.clojure/tools.nrepl to 0.2.7

--- roles/clojure/files/profiles.clj
+++ roles/clojure/files/profiles.clj
@@ -6,6 +6,7 @@
                        [cljfmt "0.1.7"]
                        [criterium "0.4.2"]
                        [org.clojure/tools.namespace "0.2.5"]
+                       [org.clojure/tools.nrepl "0.2.7"]
                        [slamhound "1.5.3"]
                        [spyscope "0.1.5"]]


update lein

update lein

--- extra/profiles.clj
+++ extra/profiles.clj
@@ -1,10 +1,5 @@
 {:user
- {:plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]
-            [lein-plz "0.2.1"]
+ {:plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]
             [lein-pprint "1.1.1"]
-            [codox "0.8.10"]
             [refactor-nrepl "2.0.0-SNAPSHOT"]]
-  :dependencies [[alembic "0.2.1"]
-                 [slamhound "1.5.5"]
-                 [org.clojure/tools.nrepl "0.2.12"]]
-  :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}
+  :dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}


Pixels correctly converted to box2d world units

It's not the best practice to have 1 pixel equivalent to 1 meter
in box2d so we need to perform some conversions to display the box2d
bodies.

--- box2d-physics-basic/desktop/src-common/box2d_physics_basic/core.clj
+++ box2d-physics-basic/desktop/src-common/box2d_physics_basic/core.clj
@@ -6,12 +6,18 @@
   (:import [com.badlogic.gdx.physics.box2d Box2DDebugRenderer]))

 (def ^:const pixels-per-meter 30)
+(def ^:const game-w (/ 800 pixels-per-meter))
+(def ^:const game-h (/ 600 pixels-per-meter))
+
+(defn screen-to-world
+  [px]
+  (float (/ px pixels-per-meter)))

 (defn create-ball-body!
   [screen radius]
   (let [body (add-body! screen (body-def :dynamic))]
     (->> (circle-shape :set-radius radius
-                       :set-position (vector-2 400 500))
+                       :set-position (vector-2 (/ game-w 2) (screen-to-world 500)))
          (fixture-def :density 0.5 :friction 0.4 :restitution 0.6 :shape)
          (body! body :create-fixture))
     body))
@@ -19,7 +25,7 @@
 (defn create-rect-body!
   [screen width height]
   (let [body (add-body! screen (body-def :static))]
-    (->> (polygon-shape :set-as-box width height (vector-2 400 10) 0)
+    (->> (polygon-shape :set-as-box width height (vector-2 (/ game-w 2) 1) 0)
          (fixture-def :density 1 :shape)
          (body! body :create-fixture))
     body))
@@ -29,19 +35,17 @@
   (fn [screen entities]
     (let [screen (update! screen
                     :renderer (stage)
-                    :camera (orthographic :set-to-ortho false
-                                          (/ (game :width) pixels-per-meter)
-                                          (/ (game :height) pixels-per-meter))
+                    :camera (orthographic :set-to-ortho false game-w game-h)
                     :world (box-2d 0 -10)
                     :debug-renderer (Box2DDebugRenderer.))
-          ball (doto {:body (create-ball-body! screen 15)})
-          floor (doto {:body (create-rect-body! screen (/ (game :width) 2) 10)})]
-      (width! screen 20)
+          ball (doto {:body (create-ball-body! screen 1)})
+          floor (doto {:body (create-rect-body! screen (/ game-w 2) 1)})]
+      (width! screen game-w)
       [entities]))

   :on-resize
   (fn [screen entities]
-    (height! screen 600))
+    (height! screen game-h))

   :on-render
   (fn [screen entities]


Extend topology test function to support variable topic names.

--- clstreams/test/clstreams/examples/count_words_prc/topology_test.clj
+++ clstreams/test/clstreams/examples/count_words_prc/topology_test.clj
@@ -28,10 +28,14 @@
                                string-deserializer string-deserializer)]
     (lazy-seq (cons [(.key record) (.value record)] (read-output driver topic)))))

-(defn through-kstreams-topology [^KStreamBuilder builder msgs]
-  (with-open [driver (test-driver builder)]
-    (process driver "input" msgs)
-    (read-output driver "output")))
+(defn through-kstreams-topology
+  ([^KStreamBuilder builder msgs]
+   (through-kstreams-topology builder msgs "input" "output"))
+  ([^KStreamBuilder builder msgs input-topic output-topic]
+   (with-open [driver (test-driver builder)]
+     (process driver input-topic msgs)
+     (read-output driver output-topic))))
+

 (defn single-processor-topology [^Processor processor]
   (let [builder (TopologyBuilder.)]


CMR-1024: Fixed 500 error during orbit swath calculation when granule temporal info is absent.

--- search-app/src/cmr/search/results_handlers/atom_results_handler.clj
+++ search-app/src/cmr/search/results_handlers/atom_results_handler.clj
@@ -177,16 +177,17 @@
                         atom-links)
         orbit-calculated-spatial-domains (map orbit-swath-helper/ocsd-json->map
                                               orbit-calculated-spatial-domains-json)
-        shapes (concat (srl/ords-info->shapes ords-info ords)
+        shapes (when (and start-date end-date)
+                 (concat (srl/ords-info->shapes ords-info ords)
                        (orbit-swath-helper/elastic-result->swath-shapes
-                         orbits-by-collection elastic-result))]
+                         orbits-by-collection elastic-result)))]
     {:id concept-id
      :title granule-ur
      :collection-concept-id collection-concept-id
      :updated update-time
      :dataset-id entry-title
      :producer-gran-id producer-gran-id
-     :size (str size)
+     :size (when size (str size))
      :original-format (metadata-format->atom-original-format metadata-format)
      :data-center provider-id
      :start-date start-date
@@ -196,7 +197,7 @@
      :online-access-flag downloadable
      :browse-flag browsable
      :day-night day-night
-     :cloud-cover (str cloud-cover)
+     :cloud-cover (when cloud-cover (str cloud-cover))
      :coordinate-system coordinate-system
      :shapes shapes


Version 0.1.3-SNAPSHOT

Version 0.1.3-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject day8.re-frame/trace "0.1.2"
+(defproject day8.re-frame/trace "0.1.3-SNAPSHOT"
   :description "Tracing and developer tools for re-frame apps"
   :url         "https://github.com/Day8/re-frame-trace"
   :license     {:name "MIT"}


Bump up library version

Bump up library version

--- project.clj
+++ project.clj
@@ -1,5 +1,5 @@
 ;
-;  (C) Copyright 2015, 2016  Pavel Tisnovsky
+;  (C) Copyright 2015, 2016, 2017, 2018  Pavel Tisnovsky
 ;
 ;  All rights reserved. This program and the accompanying materials
 ;  are made available under the terms of the Eclipse Public License v1.0
@@ -10,7 +10,7 @@
 ;      Pavel Tisnovsky
 ;

-(defproject org.clojars.tisnik/clj-fileutils "0.2.0-SNAPSHOT"
+(defproject org.clojars.tisnik/clj-fileutils "0.3.0-SNAPSHOT"
     :description "Set of functions for manipulating with files and directories."
     :url "http://example.com/FIXME"
     :license {:name "Eclipse Public License"


Version 0.4.4

Version 0.4.4

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject day8.re-frame/re-frame-10x "0.4.4-SNAPSHOT"
+(defproject day8.re-frame/re-frame-10x "0.4.4"
   :description "Become 10x more productive when developing and debugging re-frame applications."
   :url "https://github.com/Day8/re-frame-10x"
   :license {:name "MIT"}


CMR-Hotfix: Updated config component to override new general config.

Also:
 * Updated project.clj to always run with security profile enabled.

--- project.clj
+++ project.clj
@@ -30,7 +30,7 @@
     [gov.nasa.earthdata/cmr-authz "0.1.1-SNAPSHOT"]
     [gov.nasa.earthdata/cmr-exchange-common "0.2.0-SNAPSHOT"]
     [gov.nasa.earthdata/cmr-exchange-query "0.2.0-SNAPSHOT"]
-    [gov.nasa.earthdata/cmr-http-kit "0.1.2-SNAPSHOT"]
+    [gov.nasa.earthdata/cmr-http-kit "0.1.3-SNAPSHOT"]
     [gov.nasa.earthdata/cmr-jar-plugin "0.1.0-SNAPSHOT"]
     [gov.nasa.earthdata/cmr-mission-control "0.1.0-SNAPSHOT"]
     [gov.nasa.earthdata/cmr-site-templates "0.1.0-SNAPSHOT"]
@@ -238,5 +238,7 @@
       ["ubercompile"]
       ["uberjar"]]
     ;; Application
+    "run" ["with-profile" "+system,+security" "run"]
+    "trampoline" ["with-profile" "+system,+security" "trampoline"]
     "start-cmr-opendap"
       ["trampoline" "run"]})


Add SPIN dependency

Add SPIN dependency

--- project.clj
+++ project.clj
@@ -26,8 +26,10 @@
                  [org.apache.jena/jena-arq "3.1.0"]
                  [cheshire "5.6.3"]
                  [stencil "0.5.0"]
-                 [com.cemerick/url "0.1.1"]]
+                 [com.cemerick/url "0.1.1"]
+                 [org.topbraid/spin "2.0.0"]]

+  :repositories [["org.topbraid" "http://topquadrant.com/repository/spin"]]
   :min-lein-version "2.0.0"

   :jvm-opts ["-server" "-Dconf=.lein-env"]


upgraded tools.reader

upgraded tools.reader

To the beta3 version

--- project.clj
+++ project.clj
@@ -30,7 +30,7 @@

                   [org.webjars/codemirror "5.8"]

-                  [org.clojure/tools.reader "1.0.0-alpha3"]
+                  [org.clojure/tools.reader "1.0.0-beta3"]
                   [lein-figwheel "0.5.0-6"]

                   [bk/ring-gzip "0.1.1"]


(maint) Bump Puppet Server version to 5.3.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(def ps-version "5.2.1-master-SNAPSHOT")
+(def ps-version "5.3.0")
 (def jruby-1_7-version "1.7.27-1")
 (def jruby-9k-version "9.1.15.0-2")


lein-release plugin: bumped version from 0.1.1 to 0.1.2-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject prismatic/om-tools "0.1.1"
+(defproject prismatic/om-tools "0.1.2-SNAPSHOT"
   :description "Tools for building expressive Om applications"
   :url "http://github.com/prismatic/om-tools"
   :license {:name "Eclipse Public License - v 1.0"


2.1.0-beta1

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojurewerkz/cassaforte "2.1.0-SNAPSHOT"
+(defproject clojurewerkz/cassaforte "2.1.0-beta1"
   :min-lein-version "2.5.1"
   :description "A Clojure client for Apache Cassandra"
   :url "http://clojurecassandra.info"


Prepare for next release cycle.

Prepare for next release cycle.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.onyxplatform/onyx-dashboard "0.8.10.0"
+(defproject org.onyxplatform/onyx-dashboard "0.8.10.1-SNAPSHOT"
   :description "Dashboard for the Onyx distributed computation system"
   :url "http://github.com/lbradstreet/onyx-dashboard"
   :license {:name "Eclipse Public License"


Version 1.0.0

Version 1.0.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject puppetlabs/http-client "1.0.0-SNAPSHOT"
+(defproject puppetlabs/http-client "1.0.0"
   :description "HTTP client wrapper"
   :license {:name "Apache License, Version 2.0"
             :url "http://www.apache.org/licenses/LICENSE-2.0.html"}


0.8.0-RC19

--- project.clj
+++ project.clj
@@ -39,7 +39,7 @@
        (vec (set (concat (get JVMOPTS :any)
                          (get JVMOPTS os))))))

-(defproject overtone "0.8.0-RC18"
+(defproject overtone "0.8.0-RC19"
   :description "Collaborative Programmable Music. (http://overtone.github.com)"
   :url "http://overtone.github.com/"
   :dependencies [[org.clojure/clojure "1.3.0"]


lein-release plugin: preparing 0.1.4 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject racehub/stripe-clj "0.1.4-SNAPSHOT"
+(defproject racehub/stripe-clj "0.1.4"
   :description "Schemafied Stripe bindings for Clojure."
   :url "https://github.com/racehub/stripe-clj"
   :license {:name "Eclipse Public License"


crate jdbc: version bump to 2.1.6

crate jdbc: version bump to 2.1.6

--- project.clj
+++ project.clj
@@ -71,7 +71,7 @@
                  [org.yaml/snakeyaml "1.17"]                          ; YAML parser (required by liquibase)
                  [org.xerial/sqlite-jdbc "3.8.11.2"]                  ; SQLite driver !!! DO NOT UPGRADE THIS UNTIL UPSTREAM BUG IS FIXED -- SEE https://github.com/metabase/metabase/issues/3753 !!!
                  [postgresql "9.3-1102.jdbc41"]                       ; Postgres driver
-                 [io.crate/crate-jdbc "2.1.5"]                        ; Crate JDBC driver
+                 [io.crate/crate-jdbc "2.1.6"]                        ; Crate JDBC driver
                  [prismatic/schema "1.1.3"]                           ; Data schema declaration and validation library
                  [ring/ring-jetty-adapter "1.5.1"]                    ; Ring adapter using Jetty webserver (used to run a Ring server for unit tests)
                  [ring/ring-json "0.4.0"]                             ; Ring middleware for reading/writing JSON automatically


[WM] set version to 0.2.3-SNAPSHOT

[WM] set version to 0.2.3-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject kraken-works/lein-template "0.2.2"
+(defproject kraken-works/lein-template "0.2.3-SNAPSHOT"
   :description "Leiningen template for kraken-works components"
   :url "https://github.com/democracyworks/kraken-works-lein-template"
   :license {:name "Eclipse Public License"


add explicit exclusion for datomic's aws sdk

--- project.clj
+++ project.clj
@@ -54,9 +54,9 @@

   :min-lein-version "2.5.0"

-  :profiles {:dev {:dependencies [[com.datomic/datomic-free "0.9.5201" :exclusions [joda-time]]
+  :profiles {:dev {:dependencies [[com.datomic/datomic-free "0.9.5201" :exclusions [joda-time com.amazonaws/aws-java-sdk]]
                                   [figwheel-sidecar "0.4.0"]]}
-             :prod {:dependencies [[com.datomic/datomic-pro "0.9.5201" :exclusions [joda-time]]
+             :prod {:dependencies [[com.datomic/datomic-pro "0.9.5201" :exclusions [joda-time com.amazonaws/aws-java-sdk]]
                                    [org.postgresql/postgresql "9.3-1103-jdbc4"]
                                    [org.clojure/tools.nrepl "0.2.10"]]}
              :test [:dev]


cljsjs pixi

cljsjs pixi

--- project.clj
+++ project.clj
@@ -9,6 +9,9 @@

                  ;; depend on utils
                  [infinitelives.utils/infinitelives.utils "0.1.0-SNAPSHOT"]
+
+                 ;; we need pixi
+                 [cljsjs/pixi "3.0.7-0"]

                  ;; should we depend on this? maybe its better without?
                  [prismatic/dommy "1.1.0"]


update dependencies

update dependencies

--- project.clj
+++ project.clj
@@ -9,13 +9,13 @@
                    :focused :focused}

   :dependencies [[org.clojure/clojure "1.8.0"]
-                 [org.clojure/math.combinatorics "0.1.1"]
+                 [org.clojure/math.combinatorics "0.1.3"]
                  [com.sun.jna/jna "3.0.9"]
                  [com.github.jnr/jnr-posix "3.0.29"]
                  [digest "1.4.4"]
-                 [org.clojure/tools.cli "0.3.3"]]
+                 [org.clojure/tools.cli "0.3.5"]]

   :profiles {:uberjar {:aot :all}
              :test    {:resource-paths ["test-resources"]}
-             :dev     {:dependencies [[pjstadig/humane-test-output "0.7.0"]]
+             :dev     {:dependencies [[pjstadig/humane-test-output "0.8.0"]]
                        :plugins      [[lein-cljfmt "0.5.3"]]}})


Release version 0.12.6.0.

Release version 0.12.6.0.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.onyxplatform/onyx-metrics "0.12.5.1-SNAPSHOT"
+(defproject org.onyxplatform/onyx-metrics "0.12.6.0"
   :description "Instrument Onyx workflows"
   :url "https://github.com/onyx-platform/onyx-metrics"
   :license {:name "Eclipse Public License"
@@ -11,7 +11,7 @@
                              :username :env
                              :password :env
                              :sign-releases false}}
-  :dependencies [[org.onyxplatform/onyx "0.12.5"]
+  :dependencies [[org.onyxplatform/onyx "0.12.6"]
                  ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                  [org.clojure/clojure "1.8.0"]
                  [metrics-clojure "2.8.0"]]


Update Cassandra to 2.2.9

Update Cassandra to 2.2.9

--- project.clj
+++ project.clj
@@ -16,7 +16,7 @@
                  [joda-time "2.8.1"]
                  [http-kit "2.2.0"]
                  [org.apache.httpcomponents/httpclient "4.5"]
-                 [org.apache.cassandra/cassandra-all "2.2.8"
+                 [org.apache.cassandra/cassandra-all "2.2.9"
                   :exclusions [com.google.guava/guava com.thinkaurelius.thrift/thrift-server org.yaml/snakeyaml io.netty/netty io.dropwizard.metrics/metrics-core]]
                  ;[com.google.guava/guava "15.0"] ;; Cassandra still requires Guava 15
                  [org.yaml/snakeyaml "1.15"] ; >=1.11 required by r18n, used by some of our apps


Updating deps.

Updating deps.

--- project.clj
+++ project.clj
@@ -15,11 +15,11 @@
                  ;; http
                  [ring/ring-core "1.3.2"]
                  [http-kit "2.1.19"]
-                 [compojure "1.3.1"]
+                 [compojure "1.3.2"]
                  [enlive "1.1.5"]]
   :main ^:skip-aot ranked-choice.core
   :target-path "target/%s"
   :uberjar-name "ranked-choice.jar"
   :profiles {:uberjar {:aot :all}
-             :dev {:dependencies [[org.clojure/tools.namespace "0.2.8"]]
+             :dev {:dependencies [[org.clojure/tools.namespace "0.2.9"]]
                    :source-paths ["dev"]}})


Fixed typo in project.clj.

Fixed typo in project.clj.

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 (defproject com.lemondronor/turboshrimp-h264j "0.2.1-SNAPSHOT"
   :description (str "An AR.Drone video decoder for the turboshrimp library "
-                    "that uses the h264j H.264 decoder."
+                    "that uses the h264j H.264 decoder.")
   :url "https://github.com/wiseman/turboshrimp-h264j"
   :license {:name "MIT License"
             :url "http://opensource.org/licenses/MIT"}


show us occupied documents

show us occupied documents

--- src/pc/server.clj
+++ src/pc/server.clj
@@ -83,6 +83,22 @@
                             (format "
%s
" doc-id doc-id)))
                      ["Nothing interesting today :("]))
                 "</html")})
+
+   (GET "/occupied" []
+        ;; TODO: fix whatever is causing this :(
+        (swap! sente/document-subs (fn [ds]
+                                     (reduce (fn [acc1 [k s]]
+                                               (assoc acc1 k (dissoc s "dummy-ajax-post-fn")))
+                                             {} ds)))
+        {:status 200
+         :body (str
+                ""
+                (clojure.string/join
+                 " "
+                 (or (seq (for [[doc-id subs] (sort-by first @sente/document-subs)]
+                            (format "
%s with %s users
" doc-id doc-id (count subs))))
+                     ["Nothing occupied right now :("]))
+                "</html")})
    (compojure.route/resources "/" {:root "public"
                                    :mime-types {:svg "image/svg"}})
    (GET "/chsk" req ((:ajax-get-or-ws-handshake-fn sente-state) req))


upgrade to mranderson 0.4.5

upgrade to mranderson 0.4.5

--- project.clj
+++ project.clj
@@ -12,7 +12,7 @@
                  ^:source-dep [org.clojure/tools.reader "0.8.12"]
                  ^:source-dep [org.clojure/java.classpath "0.2.2"]
                  ^:source-dep [me.raynes/fs "1.4.6"]]
-  :plugins [[thomasa/mranderson "0.4.4"]]
+  :plugins [[thomasa/mranderson "0.4.5"]]
   :filespecs [{:type :bytes :path "refactor-nrepl/refactor-nrepl/project.clj" :bytes ~(slurp "project.clj")}]
   :profiles {:provided {:dependencies [[cider/cider-nrepl "0.9.0"]]}
              :test {:dependencies [[print-foo "1.0.1"]]


Prepare for next release cycle.

Prepare for next release cycle.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.onyxplatform/onyx-sql "0.7.3-beta6"
+(defproject org.onyxplatform/onyx-sql "0.7.3-SNAPSHOT"
   :description "Onyx plugin for JDBC-backed SQL databases"
   :url "https://github.com/MichaelDrogalis/onyx-sql"
   :license {:name "Eclipse Public License"


Version 2.1.11

Version 2.1.11

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject grafter/grafter "2.1.11-SNAPSHOT"
+(defproject grafter/grafter "2.1.11"
   :description "Tools for the hard graft of linked data processing"
   :url "http://grafter.org/"
   :license {:name "Eclipse Public License - v1.0"


[NH] Bump version and SNAPSHOT

[NH] Bump version and SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject turbovote.imbarcode "0.1.0"
+(defproject turbovote.imbarcode "0.1.1-SNAPSHOT"
   :description "Generate USPS Intelligent Mail Barcodes"
   :url "https://github.com/turbovote/imbarcode"
   :license {:name "Eclipse Public License"


bump version to 0.5.x

bump version to 0.5.x

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject info.sunng/papaline "0.4.1-SNAPSHOT"
+(defproject info.sunng/papaline "0.5.0-SNAPSHOT"
   :description "Clojure concurrent pipeline on core.async"
   :url "http://github.com/sunng87/papaline"
   :license {:name "Eclipse Public License"


Update min lein to match Travis CI's current version.

--- project.clj
+++ project.clj
@@ -4,7 +4,7 @@
   :license {:name "Mozilla Public License v2.0"
             :url "http://www.mozilla.org/MPL/2.0/"}

-  :min-lein-version "2.3.4" ;; highest version supported by Travis-CI as of 1/14/2014
+  :min-lein-version "2.4.2" ;; highest version supported by Travis-CI as of 8/7/2014

   :dependencies [
     [org.clojure/clojure "1.6.0"] ; Lisp on the JVM http://clojure.org/documentation


added yesql dependency

added yesql dependency

--- project.clj
+++ project.clj
@@ -4,4 +4,6 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [enlive "1.1.5"]])
+                 [enlive "1.1.5"]
+                 [yesql "0.4.0"]
+                 [org.postgresql/postgresql "9.3-1102-jdbc41"]])


Add more examples of `defrecord`.

Add more examples of `defrecord`.

--- test/com/nomistech/clojure_the_language/protocols_and_records_test.clj
+++ test/com/nomistech/clojure_the_language/protocols_and_records_test.clj
@@ -27,6 +27,39 @@
 (fact "map->xxx factory function"
   (map->MyRecord {:x 1 :y 2})
   => (MyRecord. 1 2))
+
+;;; #### Question: When to use `MyRecord.` and when to use `->MyRecord`?
+
+;;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+;;;; You can override (some) methods of java.lang.Object
+
+(defrecord MyRecord2 [x y]
+  Object
+  (toString [this]
+    (format "==== MyRecord2 [%s, %s] ====" x y)))
+
+(fact
+  (str (->MyRecord2 1 2))
+  => "==== MyRecord2 [1, 2] ====")
+
+;;;; ...but not all of them; this gives an error:
+
+;; (defrecord MyRecord3 [x y]
+;;   Object
+;;   (equals [_ other]
+;;     false))
+
+;;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+;;;; Type hints
+
+(defrecord MyRecord3 [^String x ^String y]
+  Object
+  (toString [this]
+    (format "==== MyRecord3 [%s, %s] ====" (.length x) (.length y))))
+
+(fact
+  (str (->MyRecord3 "plop" "plop plop"))
+  => "==== MyRecord3 [4, 9] ====" )

 ;;;; ___________________________________________________________________________
 ;;;; ---- Confusing stuff about protocols and inheritance ----


More robust channel handling in the modal container

--- src/alder/views/modal_container.cljs
+++ src/alder/views/modal_container.cljs
@@ -1,42 +1,55 @@
 (ns alder.views.modal-container
   (:require [om.core :as om :include-macros true]
             [sablono.core :refer-macros [html]]
+            [taoensso.timbre :refer-macros [debug]]
+            [cljs.core.async :refer [<! >! chan]]

             [alder.modal :as modal]
             [alder.views.share :refer [share-component]]
             [alder.views.source-export :refer [source-export-component]])

-  (:require-macros [cljs.core.async.macros :refer [go-loop]]))
+  (:require-macros [cljs.core.async.macros :refer [go go-loop alt!]]))

 (def modal-component-map
   {:export (fn [] source-export-component)
    :share (fn [] share-component)})

 (defn modal-container-component [data owner]
-  (reify
-    om/IDisplayName
-    (display-name [_] "ModalContainer")
+  (let [internal-chan (chan)]
+    (reify
+      om/IDisplayName
+      (display-name [_] "ModalContainer")

-    om/IInitState
-    (init-state [_]
-      {:window-key nil})
+      om/IInitState
+      (init-state [_]
+        {:window-key nil})

-    om/IWillMount
-    (will-mount [_]
-      (go-loop []
-        (when-let [[event value] (<! (:modal-window-chan data))]
-          (case event
-            :show (om/set-state! owner :window-key value)
-            :hide (om/set-state! owner :window-key nil))
-          (recur))))
+      om/IWillMount
+      (will-mount [_]
+        (go-loop []
+          (alt!
+            [(:modal-window-chan data)]
+            ([msg]
+             (when-let [[event value] msg]
+               (case event
+                 :show (om/set-state! owner :window-key value)
+                 :hide (om/set-state! owner :window-key nil))
+               (recur)))

-    om/IRenderState
-    (render-state [_ state]
-      (if-let [window-key (:window-key state)]
-        (let [component ((modal-component-map window-key))]
-          (html
-           [:div.modal-underlay
-            [:div.modal-underlay__dialog
-             (om/build component data
-                       {:opts {:on-close (partial modal/hide-modal-window data)}})]]))
-        (html [:div])))))
+            ;; Break go-loop/recur when a message arrives on the internal channel
+            internal-chan nil)))
+
+      om/IWillUnmount
+      (will-unmount [_]
+        (go (>! internal-chan :terminate)))
+
+      om/IRenderState
+      (render-state [_ state]
+        (if-let [window-key (:window-key state)]
+          (let [component ((modal-component-map window-key))]
+            (html
+             [:div.modal-underlay
+              [:div.modal-underlay__dialog
+               (om/build component data
+                         {:opts {:on-close (partial modal/hide-modal-window data)}})]]))
+          (html [:div]))))))


fix spacing in customer section for small screens

--- frontend/components/landing_b.cljs
+++ frontend/components/landing_b.cljs
@@ -282,7 +282,6 @@
                   ;; "Continue" ; hold off on this line of copy, it's cleanr w/o
                   (common/ico :chevron-down)]]]
                [:section.home-practice
-                [:div.home-top-shelf]
                 (let [hovered-customer (:hovered-customer state)
                       tools (get-in customer-brands [hovered-customer :tools] #{})]
                  [:div.practice-tools


Update ecoregions, discount factor

Update ecoregions, discount factor


change query to select shortname from mines

--- src/cljs/gointermod/utils/comms.cljs
+++ src/cljs/gointermod/utils/comms.cljs
@@ -16,7 +16,7 @@

 (defn make-base-query [identifier organism]
-  (str "<query model=\"genomic\" view=\"Gene.symbol Gene.secondaryIdentifier Gene.primaryIdentifier Gene.organism.name Gene.organism.taxonId Gene.homologues.homologue.primaryIdentifier Gene.homologues.homologue.secondaryIdentifier Gene.homologues.homologue.symbol Gene.homologues.homologue.organism.name Gene.homologues.homologue.organism.taxonId Gene.homologues.dataSets.name Gene.homologues.dataSets.url Gene.goAnnotation.evidence.code.code Gene.goAnnotation.evidence.publications.pubMedId Gene.goAnnotation.evidence.publications.title Gene.goAnnotation.ontologyTerm.identifier Gene.goAnnotation.ontologyTerm.name Gene.goAnnotation.ontologyTerm.namespace\" sortOrder=\"Gene.symbol ASC\" constraintLogic=\"B and C and D and  A\" name=\"intermod_go\" >
+  (str "<query model=\"genomic\" view=\"Gene.symbol Gene.secondaryIdentifier Gene.primaryIdentifier Gene.organism.name Gene.organism.taxonId Gene.homologues.homologue.primaryIdentifier Gene.homologues.homologue.secondaryIdentifier Gene.homologues.homologue.symbol Gene.homologues.homologue.organism.shortName Gene.homologues.homologue.organism.taxonId Gene.homologues.dataSets.name Gene.homologues.dataSets.url Gene.goAnnotation.evidence.code.code Gene.goAnnotation.evidence.publications.pubMedId Gene.goAnnotation.evidence.publications.title Gene.goAnnotation.ontologyTerm.identifier Gene.goAnnotation.ontologyTerm.name Gene.goAnnotation.ontologyTerm.namespace\" sortOrder=\"Gene.symbol ASC\" constraintLogic=\"B and C and D and  A\" name=\"intermod_go\" >
     <constraint path=\"Gene.goAnnotation.qualifier\" op=\"IS NULL\" code=\"B\" />
     <constraint path=\"Gene.goAnnotation.ontologyTerm.obsolete\" op=\"=\" value=\"false\" code=\"C\" />
     <constraint path=\"Gene.homologues.homologue.organism.shortName\" code=\"D\" op=\"=\" value=\"H. sapiens\"/>


Removed all but the most basic easing functions and will recommend people use an external lib such as bardo

--- src/clojure/freactive/animation.cljs
+++ src/clojure/freactive/animation.cljs
@@ -76,41 +76,6 @@
       (when callback
         (callback)))))

-;(deftype AnimationReactiveExpression [state f active]
-;  IWatchable
-;  (-add-watch [this key cb]
-;    (when active
-;      (cb key this nil state)))
-;  (-remove-watch [this key])
-;  (-notify-watches [this oldval newval] )
-;
-;  r/IInvalidates
-;  (-add-invalidation-watch [this key cb]
-;    (when active
-;      (cb key this)))
-;  (-remove-invalidation-watch [this key])
-;  (-notify-invalidation-watches [this])
-;
-;  IDeref
-;  (-deref [_]
-;    (when (and active r/*invalidate-rx*)
-;      (r/*invalidate-rx*))
-;    state))
-;
-;(defn animation-rx* [f]
-;  (let [r (AnimationReactiveExpression. nil f true)]
-;    (add-watch dom/frame-time r (fn [_ _ _ _] (set! (.-state r) (f))))
-;    r))
-
-;; Easing functions
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Adapted from https://github.com/danielytics/ominate
-; Who adapted it from https://github.com/warrenm/AHEasing
-; And probably ultimately from Robert Penner
-
-(def PI   (.-PI js/Math))
-(def PI_2 (/ (.-PI js/Math) 2))
-
 (def linear identity)

 (defn quad-in
@@ -122,226 +87,3 @@
   "Modeled after the parabola y = -x^2 + 2x"
   [p]
   (- (* p (- p 2))))
-
-(defn quad-in-out
-  "Modeled after the piecewise quadratic
-   y = (1/2)((2x)^2)               [0, 0.5)
-   y = -(1/2)((2x-1)*(2x-3) - 1)   [0.5, 1]"
-  [p]
-  (if (< p 0.5)
-    (* 2 p p)
-    (+ (* 4 p) (* -2 p p) -1)))
-
-(defn cube-in
-  "Modeled after the cubic y = x^3"
-  [p]
-  (* p p p))
-
-(defn cube-out
-  "Modeled after the cubic y = (x - 1)^3 + 1"
-  [p]
-  (let [f (dec p)]
-    (inc (* f f f))))
-
-(defn cube-in-out
-  "Modeled after the piecewise cubic
-   y = (1/2)((2x)^3)         [0, 0.5)
-   y = (1/2)((2x-2)^3 + 2)   [0.5, 1]"
-  [p]
-  (if (< p 0.5)
-    (* p p p 4)
-    (let [f (- (* 2 p) 2)]
-      (inc (* 0.5 f f f)))))
-
-(defn quart-in
-  "Modeled after the quartic x^4"
-  [p]
-  (* p p p p))
-
-(defn quart-out
-  "Modeled after the quartic y = 1 - (x - 1)^4"
-  [p]
-  (let [f (dec p)]
-    (inc (* f f f (- 1 p)))))
-
-(defn quart-in-out
-  "Modeled after the piecewise quartic
-   y = (1/2)((2x)^4)          [0, 0.5)
-   y = -(1/2)((2x-2)^4 - 2)   [0.5, 1]"
-  [p]
-  (if (< p 0.5)
-    (* p p p p 8)
-    (let [f (dec p)]
-      (inc (* -8 f f f f)))))
-
-(defn quint-in
-  "Modeled after the quintic y = x^5"
-  [p]
-  (* p p p p p))
-
-(defn quint-out
-  "Modeled after the quintic y = (x - 1)^5 + 1"
-  [p]
-  (let [f (dec p)]
-    (inc (* f f f f f))))
-
-(defn quint-in-out
-  "Modeled after the piecewise quintic
-   y = (1/2)((2x)^5)         [0, 0.5)
-   y = (1/2)((2x-2)^5 + 2)   [0.5, 1]"
-  [p]
-  (if (< p 0.5)
-    (* 16 p p p p p)
-    (let [f (- (* 2 p) 2)]
-      (inc (* 0.5 f f f f f)))))
-
-(defn sine-in
-  "Modeled after quarter-cycle of sine wave"
-  [p]
-  (inc (.sin js/Math (* (dec p) PI_2))))
-
-(defn sine-out
-  "Modeled after quarter-cycle of sine wave (different phase)"
-  [p]
-  (.sin js/Math (* p PI_2)))
-
-(defn sine-in-out
-  "Modeled after half sine wave"
-  [p]
-  (* 0.5 (- 1 (.cos js/Math (* p PI)))))
-
-(defn circular-in
-  "Modeled after shifted quadrant IV of unit circle"
-  [p]
-  (- 1 (.sqrt js/Math (- 1 (* p p)))))
-
-(defn circular-out
-  "Modeled after shifted quadrant II of unit circle"
-  [p]
-  (.sqrt js/Math (* (- 2 p) p)))
-
-(defn circular-in-out
-  "Modeled after the piecewise circular function
-   y = (1/2)(1 - sqrt(1 - 4x^2))             [0, 0.5)
-   y = (1/2)(sqrt(-(2x - 3)*(2x - 1)) + 1)   [0.5, 1]"
-  [p]
-  (if (< p 0.5)
-    (* 0.5 (- 1 (.sqrt js/Math (- 1 (* 4 (* p p))))))
-    (* 0.5 (inc (.sqrt js/Math (- (* (- (* 2 p) 3) (dec (* 2 p)))))))))
-
-(defn exp-in
-  "Modeled after the exponential function y = 2^(10(x - 1))"
-  [p]
-  (if (= p 0)
-    p
-    (.pow js/Math 2 (* 10 (dec p)))))
-
-(defn exp-out
-  "Modeled after the exponential function y = -2^(-10x) + 1"
-  [p]
-  (if (= p 1)
-    p
-    (- 1 (.pow js/Math 2 (* -10 p)))))
-
-(defn exp-in-out
-  "Modeled after the piecewise exponential
-   y = (1/2)2^(10(2x - 1))           [0,0.5)
-   y = -(1/2)*2^(-10(2x - 1))  + 1   [0.5,1]"
-  [p]
-  (if (or (= p 0) (= p 1))
-    p
-    (if (< p 0.5)
-      (* 0.5 (.pow js/Math 2 (- (* 20 p) 10)))
-      (inc (* -0.5 (.pow js/Math 2 (+ (* -20 p) 10)))))))
-
-(defn elastic-in
-  "Modeled after the damped sine wave y = sin(13PI_2*x)*pow(2, 10 * (x - 1))"
-  [p]
-  (* (.sin js/Math (* 13 PI_2 p))
-     (.pow js/Math 2 (* 10 (dec p)))))
-
-(defn elastic-out
-  "Modeled after the damped sine wave y = sin(-13PI_2*(x + 1))*pow(2, -10x) + 1"
-  [p]
-  (inc (* (.sin js/Math (* -13 PI_2 (inc p)))
-          (.pow js/Math 2 (* -10 p)))))
-
-(defn elastic-in-out
-  "Modeled after the piecewise exponentially-damped sine wave:
-   y = (1/2)*sin(13PI_2*(2*x))*pow(2, 10 * ((2*x) - 1))        [0,0.5)
-   y = (1/2)*(sin(-13PI_2*((2x-1)+1))*pow(2,-10(2*x-1)) + 2)   [0.5, 1]"
-  [p]
-  (if (< p 0.5)
-    (* 0.5
-       (.sin js/Math (* 13 PI_2 2 p))
-       (.pow js/Math 2 (* 10 (dec (* 2 p)))))
-    (* 0.5
-       (+ (* (.sin js/Math (* -13 PI_2 (* 2 p)))
-             (.pow js/Math 2 (* -10 (inc (* 2 p)))))
-          2))))
-
-(defn back-in
-  "Modeled after the overshooting cubic y = x^3-x*sin(x*pi)"
-  [p]
-  (- (* p p p)
-     (* p (.sin js/Math (* p PI)))))
-
-(defn back-out
-  "Modeled after overshooting cubic y = 1-((1-x)^3-(1-x)*sin((1-x)*pi))"
-  [p]
-  (let [f (- 1 p)]
-    (- 1 (- (* f f f)
-            (.sin js/Math (* f PI))))))
-
-(defn back-in-out
-  "Modeled after the piecewise overshooting cubic function:
-   y = (1/2)*((2x)^3-(2x)*sin(2*x*pi))             [0, 0.5)
-   y = (1/2)*(1-((1-x)^3-(1-x)*sin((1-x)*pi))+1)   [0.5, 1]"
-  [p]
-  (if (< p 0.5)
-    (let [f (* 2 p)]
-      (* 0.5 (- (* f f f)
-                (.sin js/Math (* f PI)))))
-    (let [f (- 1 (dec (* 2 p)))]
-      (+ (* 0.5 (- 1 (- (* f f f)
-                        (* f (.sin js/Math (* f PI))))))
-         0.5))))
-
-(defn bounce-out [p]
-  (cond
-    (< p (/ 1 2.75))    (* 7.5625 p p)
-    (< p (/ 2 2.75))    (+ (* 7.5625
-                              (- p (/ 1.5 2.75))
-                              (- p (/ 1.5 2.75)))
-                           0.75)
-    (< p (/ 2.5 2.75))  (+ (* 7.5625
-                              (- p (/ 2.5 2.75))
-                              (- p (/ 2.5 2.75)))
-                           0.9375)
-    :else               (+ (* 7.5625
-                              (- p (/ 2.625 2.75))
-                              (- p (/ 2.625 2.75)))
-                           0.984375)))
-
-(defn bounce-in [p]
-  (- 1 (bounce-out (- 1 p))))
-
-(defn bounce-in-out [p]
-  (if (< p 0.5)
-    (* 0.5 (bounce-in (* p 2)))
-    (+ (* 0.5 (bounce-out (dec (* p 2)))) 0.5)))
-
-
-;TERMS OF USE - EASING EQUATIONS
-;
-;Open source under the BSD License.
-;
-;Copyright © 2001 Robert Penner
-;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 author nor the names of 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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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.


Tweak.

Tweak.

--- clojure/src/advent2016/day18.clj
+++ clojure/src/advent2016/day18.clj
@@ -10,9 +10,8 @@

 (defn rows [previous]
   (lazy-seq
-   (let [[[_ b] :as xs] (partition 3 1 (repeat false) previous)
-         next-tiles     (cons b (map trap? xs))]
-     (cons (count (remove identity previous)) (rows next-tiles)))))
+   (let [xs (partition 3 1 (repeat false) (cons false previous))]
+     (cons (count (remove identity previous)) (rows (map trap? xs))))))

 (defn parse [s]
   (map (partial = \^) s))


Fix polling with reload

Fix polling with reload

--- app/pyrexia/src/pyrexia/core.cljs
+++ app/pyrexia/src/pyrexia/core.cljs
@@ -1,5 +1,6 @@
 (ns ^:figwheel-always pyrexia.core
     (:require
+        [clojure.walk :refer [keywordize-keys]]
         [goog.Timer :as timer]
         [goog.events :as events]
         [cognitect.transit :as t])
@@ -10,6 +11,7 @@

 (defonce app-state (atom {
     :nodes []
+    :timer nil
 }))

 (def r (t/reader :json))
@@ -33,17 +35,18 @@
        (send "http://localhost:9200/temperature-2015.09.08/_search" "POST" payload))))

 (defn fetch-events []
-    (retrieve search-query #() #() ))
+    (retrieve search-query #(.log js/console (-> % keywordize-keys :aggregations :group_by_state :buckets pr-str)) #() ))

 (defn poll
   []
-  (let [timer (goog.Timer. 24000)]
-    (do (fetch-events)
+  (let [timer (goog.Timer. 5000)]
+    (do
+        (fetch-events)
         (. timer (start))
+        (swap! app-state assoc :timer timer)
         (events/listen timer goog.Timer/TICK fetch-events))))

-(defn start-app
-  []
-  (do (poll))
+(if (-> (:timer @app-state) nil? not)
+    (.stop (:timer @app-state))
 )
-(start-app)
+(poll)


Update hello-world version.

Update hello-world version.

--- examples/hello-world/project.clj
+++ examples/hello-world/project.clj
@@ -1,6 +1,6 @@
-(defproject hello-world "0.27.0"
+(defproject hello-world "0.30.0"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.10.1"]
-                 [uncomplicate/neanderthal "0.27.0"]]
+                 [uncomplicate/neanderthal "0.30.0"]]
   :jvm-opts ^:replace [#_"--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"])


Add comment.

Add comment.

--- src/cavm/h2.clj
+++ src/cavm/h2.clj
@@ -822,6 +822,13 @@

 ; XXX performance of the :in clause?
 ; XXX make a prepared statement
+; One would hope that an array could be passed in the for IN
+; clause, since an array can be passed in elsewhere, but that
+; doesn't appear to be the case. At least, I haven't found an
+; incantation that works. h2 complains about the syntax. Maybe
+; if it were written as a subquery? Would need to do an
+; explain analyze if trying this. Meanwhile, we have to dynamically
+; build the query to paste in the right number of ?.
 (def ^:private dataset-fields-query
   "SELECT name, i, scores
    FROM (SELECT  `field`.`name`, `field`.`id`


clean up :require, add doc

clean up :require, add doc

--- src/gangway/web.clj
+++ src/gangway/web.clj
@@ -1,6 +1,9 @@
-(ns gangway.web
-  (:require [helmsman]
-            [ring.middleware.params :refer [wrap-params]]
+(ns ^{:doc
+      "Gangway is for queueing and (minimal, queue-wrapping) REST
+       endpoints for data entering or leaving Galleon. Nothing from
+       outside enters or leaves Galleon except by the Gangway."}
+  gangway.web
+  (:require [ring.middleware.params :refer [wrap-params]]
             [liberator.dev :refer [wrap-trace]]
             [gangway.publish :as gw-publish]))


Improve multi-method fn signature.

Improve multi-method fn signature.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -310,8 +310,11 @@

   Takes a zookeeper address, a peer-config, or an already started Onyx client."
   ^{:added "0.10.0"}
-  (fn [connector & rst]
-    (type connector)))
+  (fn
+    ([connector tenancy-id job-id]
+     (type connector))
+    ([connector job-name]
+     (type connector))))

 (defmethod job-snapshot-coordinates org.apache.curator.framework.imps.CuratorFrameworkImpl
   ([conn tenancy-id job-id]


For project-insights, only fetch current project

--- src-cljs/frontend/controllers/navigation.cljs
+++ src-cljs/frontend/controllers/navigation.cljs
@@ -273,11 +273,9 @@
                                     :project repo}])))

 (defmethod post-navigated-to! :project-insights
-  [history-imp navigation-point _ previous-state current-state]
-  (let [api-ch (get-in current-state [:comms :api])]
-    (api/get-projects api-ch :then (fn [new-state]
-                                     (let [build-ids (map api/project-build-id (get-in new-state state/projects-path))]
-                                       (api/get-projects-builds build-ids 100 api-ch))))
+  [history-imp navigation-point args previous-state current-state]
+  (let [api-ch (get-in current-state [:comms :api])]
+    (api/get-projects api-ch :then #(api/get-projects-builds [(select-keys args [:org :repo])] 100 api-ch))
     (api/get-user-plans api-ch))
   (set-page-title! "Insights"))


Correct base-case to default mine to 'false'

--- src-cljs/frontend/controllers/navigation.cljs
+++ src-cljs/frontend/controllers/navigation.cljs
@@ -14,6 +14,7 @@
             [frontend.stefon :as stefon]
             [frontend.utils.ajax :as ajax]
             [frontend.utils.docs :as doc-utils]
+            [frontend.utils.launchdarkly :as ld]
             [frontend.utils.state :as state-utils]
             [frontend.utils.vcs-url :as vcs-url]
             [frontend.utils.vcs :as vcs]


rewrote the concat test to avoid flaky failures (#14049)

ran 10000 times with no failures

--- contrib/clojure-package/test/org/apache/clojure_mxnet/operator_test.clj
+++ contrib/clojure-package/test/org/apache/clojure_mxnet/operator_test.clj
@@ -51,33 +51,16 @@
         (is (= out-grad grad))))))

 (deftest test-concat
-  (let [shape-vecs [[2 2] [3 2]]
-        x (sym/variable "x")
-        y (sym/variable "y")
-        out (sym/concat "conc" nil [x y] {:dim 0})
-        arr (mapv #(ndarray/empty %) shape-vecs)
-        arr-np (mapv #(ndarray/copy %) arr)
-        arr-grad (map #(ndarray/empty %) shape-vecs)
-        arg-names (sym/list-arguments out)
-        grad-map (zipmap arg-names arr-grad)
-        args (sym/list-arguments out)
-        [arg-shapes out-shapes aux-shapes] (sym/infer-shape out (zipmap args shape-vecs))
-        out-shape-vec (first out-shapes)
-        out-grad (ndarray/empty out-shape-vec)
-        exec1 (sym/bind out (context/default-context) arr grad-map)
-        out1 (-> (executor/forward exec1)
+  (let [a (sym/variable "a")
+      b (sym/variable "b")
+      c (sym/concat "conc" nil [a b] {:dim 0})
+      exec (sym/bind c (context/default-context) {"a" (ndarray/array [1 2] [2 1])
+                                                  "b" (ndarray/array [3 4] [2 1])})
+      output (-> (executor/forward exec)
                  (executor/outputs)
-                 (first))
-        ret (ndarray/concatenate arr)]
-    (is (= out1 ret))
-
-    ;;backward
-    (ndarray/copy-to out1 out-grad)
-    (ndarray/+= out-grad 1)
-    (executor/backward exec1 out-grad)
-    (let [grads arr-grad
-          np-grads arr-np]
-      (is (= grads (mapv #(ndarray/+ % 1) np-grads))))))
+                 (first))]
+    (is (= [1.0 2.0 3.0 4.0] (ndarray/->vec output)))
+    (is (= [4 1] (ndarray/shape-vec output)))))

 (defn check-regression [model forward-fn backward-fn]
   (let [shape-vec [3 1]


link to a type's thing page from a type listing

--- app/src/semtag_web/rendering.cljs
+++ app/src/semtag_web/rendering.cljs
@@ -375,7 +375,13 @@
   (let [{:keys [things tags type]} new-value]
     (set-page-title (format "
Type %s %s
"
                             (:name type)
-                            (if (:desc type) (str "— " (:desc type) "") "")))
+                            (format "— %s %s"
+                                    (if (:desc type) (str (:desc type) "—") "")
+                                    (format "%s"
+                                            (:name type)
+                                            (if (:read-only config/config) "Show type" "Edit")))))
+    (enable-clickable-links-on "#page_title" input-queue)
+
     (dom/set-html!
      (dom/by-id "content")
       (html


Tweak show/move

Tweak show/move

--- src/chessground/ctrl.cljs
+++ src/chessground/ctrl.cljs
@@ -52,10 +52,10 @@
                             (assoc-in [:movable :dests] nil))]
           [new-state
            (fn [root chans]
-             (show/move root orig dest)
              (show/selected root nil (:selected state))
              (show/dests root nil (:shown-dests state))
              (show/last-move root orig dest (:last-move state))
+             (show/move root orig dest)
              (callback (-> new-state :movable :events :after) orig dest new-chess))])))
     ; destination is not available, move is canceled but there are different cases:
     (if (= orig dest)


Improve phone-number test suite

Improve phone-number test suite

Previous tests didn't force a fully generalized solution

--- phone-number/phone_number_test.clj
+++ phone-number/phone_number_test.clj
@@ -7,10 +7,10 @@
   (is (= "1234567890" (phone-number/number "(123) 456-7890"))))

 (deftest cleans-number-with-dots
-  (is (= "1234567890" (phone-number/number "123.456.7890"))))
+  (is (= "5558675309" (phone-number/number "555.867.5309"))))

 (deftest valid-when-11-digits-and-first-is-1
-  (is (= "1234567890" (phone-number/number "11234567890"))))
+  (is (= "9876543210" (phone-number/number "19876543210"))))

 (deftest invalid-when-11-digits
   (is (= "0000000000" (phone-number/number "21234567890"))))
@@ -21,10 +21,22 @@
 (deftest area-code
   (is (= "123" (phone-number/area-code "1234567890"))))

+(deftest area-code-with-dots
+  (is (= "555" (phone-number/area-code "555.867.5309"))))
+
+(deftest area-code-with-parentheses
+  (is (= "987" (phone-number/area-code "(987) 654-3210"))))
+
+(deftest area-code-with-full-us-phone-number
+  (is (= "123" (phone-number/area-code "11234567890"))))
+
 (deftest pretty-print
   (is (= "(123) 456-7890" (phone-number/pretty-print "1234567890"))))

+(deftest pretty-print-with-dots
+  (is (= "(555) 867-5309" (phone-number/pretty-print "555.867.5309"))))
+
 (deftest pretty-print-with-full-us-phone-number
-  (is (= "(123) 456-7890" (phone-number/pretty-print "11234567890"))))
+  (is (= "(987) 654-3210" (phone-number/pretty-print "19876543210"))))

 (run-tests)


fix munging, reserve boolean

fix munging, reserve boolean

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -19,7 +19,7 @@
 (def js-reserved #{"new" "debugger" "enum" "default" "private" "finally" "in" "import" "package" "with" "throw"
                    "continue" "var" "for" "public" "do" "delete" "instanceof" "yield" "static" "protected" "return"
                    "case" "implements" "typeof" "while" "void" "switch" "export" "class" "function" "extends" "else"
-                   "interface" "try" "let" "catch" "super" "if" "this" "break"})
+                   "interface" "try" "let" "catch" "super" "if" "this" "break" "boolean"})

 (defonce namespaces (atom '{cljs.core {:name cljs.core}
                             cljs.user {:name cljs.user}}))
@@ -40,7 +40,7 @@
 cljs.lang = {}
 //cljs.user = {}
 //goog.provide('cljs.core');
-//goog.provide('cljs.user');
+goog.provide('cljs.user');
 cljs.lang.truth_ = function(x){return x != null && x !== false;}
 cljs.lang.fnOf_ = function(f){return (f instanceof Function?f:f.cljs$core$Fn$invoke);}
 cljs.lang.original_goog_require = goog.require;
@@ -75,7 +75,7 @@
                          (if (get (:defs (@namespaces 'cljs.core)) sym)
                            'cljs.core
                            (-> env :ns :name))
-                         "." (name sym)))))]
+                         "." (munge (name sym))))))]
     {:name nm}))

 (defn- comma-sep [xs]
@@ -709,6 +709,7 @@
           js (emits ast)]
       (try
         (let [ret (.eval jse js)]
+          ;;(prn js)
           ret)
         (catch Throwable ex
           ;;we eat ns errors because we know goog.provide() will throw when reloaded


Throw FileNotFoundException when input file does not exist instead of silently creating an empty output file.

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -886,12 +886,13 @@
      (let [dest (clojure.string/replace src #".cljs$" ".js")]
        (compile-file src dest)))
   ([src dest]
-     (with-open [out ^java.io.Writer (io/make-writer (io/file dest) {})]
-       (binding [*out* out
-                 *cljs-ns* 'cljs.user]
-         (doseq [form (forms-seq src)]
-           (let [env {:ns (@namespaces *cljs-ns*) :context :statement :locals {}}]
-             (emit (analyze env form))))))))
+     (let [forms (forms-seq src)]
+       (with-open [out ^java.io.Writer (io/make-writer (io/file dest) {})]
+         (binding [*out* out
+                   *cljs-ns* 'cljs.user]
+           (doseq [form forms]
+             (let [env {:ns (@namespaces *cljs-ns*) :context :statement :locals {}}]
+               (emit (analyze env form)))))))))

 (comment
   ;; flex compile-file


add file-commit-pair, update churn

add file-commit-pair, update churn

--- src/clj/gitomic/query.clj
+++ src/clj/gitomic/query.clj
@@ -22,19 +22,15 @@
        :where [?c :commit/sha ?sha]]
      db sha))

-(defn file-by-path [db p]
-  (q '[:find ?f .
-       :in $ ?p
-       :where [?f :file/path ?p]]
-     db p))
-
-(defn commits-by-file-path [db r path]
+(defn commits-by-path [db r path]
   (q '[:find [?c ...]
        :in $ ?r ?p
        :where
        [?f :file/path ?p]
-       [?c :commit/files ?f]
-       [?c :commit/merge? false]]
+       [?ch :change/path ?f]
+       [?c :commit/changes ?ch]
+       [?c :commit/merge? false]
+       [?r :repo/commits ?c]]
      db r path))

 (defn files-in-repo [db repo]
@@ -42,24 +38,46 @@
        :in $ ?r
        :where
        [?r :repo/commits ?c]
-       [?c :commit/files ?f]]
+       [?c :commit/changes ?ch]
+       [?ch :change/path ?f]]
      db repo))

-(defn churn-on-path [db path]
-  (q '[:find [?c ...]
-       :in $ ?p
-       :where
-       [?f :file/path ?p]
-       [?c :commit/files ?f]
-       [?c :commit/merge? false]]
-     db path))
+(defn weight [max n]
+  (float (/ n max)))

 (defn churn [db r]
-  (q '[:find ?n (count ?c)
-       :in $ ?r
-       :where
-       [?r :repo/commits ?c]
-       [?c :commit/files ?f]
-       [?c :commit/merge? false]
-       [?f :file/path ?n]]
-     db r))+  (let [pairs (reverse
+                (sort-by second
+                         (q '[:find ?p (count ?c)
+                              :in $ ?r
+                              :where
+                              [?r :repo/commits ?c]
+                              [?c :commit/merge? false]
+                              [?c :commit/changes ?ch]
+                              [?ch :change/path ?f]
+                              [?f :file/path ?p]
+                              ;[(.endsWith ?p ".rb")]
+                              ]
+                            db r)))
+        m (-> pairs first second)]
+    (mapv (fn [[p n]]
+            [p n (weight m n)])
+          pairs)))
+
+(defn file-commit-pair [db r file-path]
+  (reverse
+    (sort-by second
+                     (q '[:find ?p2 (count ?c)
+                                 :in $ ?r ?p
+                                 :where
+                                 [?f1 :file/path ?p]
+                                 [?ch1 :change/path ?f1]x
+                                 [?c :commit/changes ?ch1]
+                                 [?r :repo/commits ?c]
+                                 [?c :commit/changes ?ch2]
+                                 [(!= ?ch1 ?ch2)]
+                                 [?ch2 :change/path ?f2]
+                                 [?f2 :file/path ?p2]
+                          ;[(.endsWith ?p2 ".rb")]
+                                 ]
+                               db r file-path))))


Add a debounce utility

Add a debounce utility

--- src/cljs/gtfve/utils.cljs
+++ src/cljs/gtfve/utils.cljs
@@ -4,6 +4,19 @@
             [cljs.core.async :as async :refer [put! chan <! close! >!]]
             [goog.events :as gevents])
   (:import [goog.events EventType]))
+
+(defn debounce [in ms]
+  (let [out (chan)]
+    (go-loop [last-val nil]
+      (let [val (if (nil? last-val) (<! in) last-val)
+            timer (async/timeout ms)
+            [new-val ch] (alts! [in timer])]
+        (condp = ch
+          timer (do
+                  (>! out val)
+                  (recur nil))
+          in (recur new-val))))
+    out))

 (defn mutation-listen
   ([el config]


Show when columns and cards are in editing mode

--- src/cljs/kanban/core.cljs
+++ src/cljs/kanban/core.cljs
@@ -11,22 +11,27 @@
               {:title "Tell my friends about Lambda Island"}]}
      {:title "Doing"
       :cards [{:title "Following the Reagent tutorial"}
-              {:title "Using Evil mode badly"}]}]}))
+              {:title "Using Evil mode badly"
+               :editing true}]
+      :editing true}]}))

 ;; (defn greeting []
 ;;   [:h1 (:text @app-state)])

 (defn Card [card]
-  [:div.card
-   (:title card)])
+  (if (:editing card)
+    [:div.card.editing [:input {:type "text" :value (:title card)}]]
+    [:div.card (:title card)]))

 (defn NewCard []
   [:div.new-card
    "+ add new card"])

-(defn Column [{:keys [title cards]}]
+(defn Column [{:keys [title cards editing]}]
   [:div.column
-   [:h2 title]
+   (if editing
+     [:input {:type "text" :value title}]
+     [:h2 title])
    (for [c cards]
      [Card c])
    [NewCard]])


Undid change that might break push-item if stack is not a list.

--- src/clojush/pushstate.clj
+++ src/clojush/pushstate.clj
@@ -60,7 +60,7 @@
   "Returns a copy of the state with the value pushed on the named stack. This is a utility,
    not for use in Push programs."
   [value type state]
-  (update state type conj value))
+  (assoc state type (cons value (type state))))

 (defn top-item
   "Returns the top item of the type stack in state. Returns :no-stack-item if called on


Drop complicating sin-oscs that do nothing.

--- src/african_polyphony_and_polyrhythm/talk.clj
+++ src/african_polyphony_and_polyrhythm/talk.clj
@@ -90,8 +90,8 @@
 (definst horn [freq 440 vol 0.5 pan 0]
   (-> (sin-osc freq)
       (+ (* 1/2 (sin-osc 3) (sin-osc (* 3.01 freq))))
-      (+ (* 1/5 (sin-osc 3) (sin-osc (* 2 freq))))
-      (+ (* 1/8 (sin-osc 9) (sin-osc (* 4.99 freq))))
+      (+ (* 1/5 (sin-osc (* 2 freq))))
+      (+ (* 1/8 (sin-osc (* 4.99 freq))))
       (+ (* 1/8 (sin-osc (* 7.01 freq))))
       (clip2 0.8)
       (rlpf (line:kr (* 2 freq) (* 7 freq) 0.8))


Commented out unnecessary routes

Commented out unnecessary routes

--- src/capstone_demo_clj_api/routes/services.clj
+++ src/capstone_demo_clj_api/routes/services.clj
@@ -18,17 +18,17 @@
   (context* "/api" []
             :tags ["thingie"]

-            (GET* "/plus" []
-                  :return       Long
-                  :query-params [x :- Long, {y :- Long 1}]
-                  :summary      "x+y with query-parameters. y defaults to 1."
-                  (ok (+ x y)))
+            ;; (GET* "/plus" []
+            ;;       :return       Long
+            ;;       :query-params [x :- Long, {y :- Long 1}]
+            ;;       :summary      "x+y with query-parameters. y defaults to 1."
+            ;;       (ok (+ x y)))

-            (POST* "/minus" []
-                   :return      Long
-                   :body-params [x :- Long, y :- Long]
-                   :summary     "x-y with body-parameters."
-                   (ok (- x y)))
+            ;; (POST* "/minus" []
+            ;;        :return      Long
+            ;;        :body-params [x :- Long, y :- Long]
+            ;;        :summary     "x-y with body-parameters."
+            ;;        (ok (- x y)))

             (GET* "/times/:x/:y" []
                   :return      Long
@@ -36,29 +36,35 @@
                   :summary     "x*y with path-parameters"
                   (ok (* x y)))

-            (POST* "/divide" []
-                   :return      Double
-                   :form-params [x :- Long, y :- Long]
-                   :summary     "x/y with form-parameters"
-                   (ok (/ x y)))
+            ;; (POST* "/divide" []
+            ;;        :return      Double
+            ;;        :form-params [x :- Long, y :- Long]
+            ;;        :summary     "x/y with form-parameters"
+            ;;        (ok (/ x y)))

-            (GET* "/power" []
-                  :return      Long
-                  :header-params [x :- Long, y :- Long]
-                  :summary     "x^y with header-parameters"
-                  (ok (long (Math/pow x y))))
+            ;; (GET* "/power" []
+            ;;       :return      Long
+            ;;       :header-params [x :- Long, y :- Long]
+            ;;       :summary     "x^y with header-parameters"
+            ;;       (ok (long (Math/pow x y))))

-            (PUT* "/echo" []
-                  :return   [{:hot Boolean}]
-                  :body     [body [{:hot Boolean}]]
-                  :summary  "echoes a vector of anonymous hotties"
-                  (ok body))
+            ;; (PUT* "/echo" []
+            ;;       :return   [{:hot Boolean}]
+            ;;       :body     [body [{:hot Boolean}]]
+            ;;       :summary  "echoes a vector of anonymous hotties"
+            ;;       (ok body))

             (POST* "/echo" []
-                   :return   (s/maybe Thingie)
-                   :body     [thingie (s/maybe Thingie)]
+                   :return   String
+                   :body-params  [thingie :- String]
                    :summary  "echoes a Thingie from json-body"
                    (ok thingie)))
+
+            ;; (POST* "/echo" []
+            ;;        :return   (s/maybe Thingie)
+            ;;        :body     [thingie (s/maybe Thingie)]
+            ;;        :summary  "echoes a Thingie from json-body"
+            ;;        (ok thingie)))

   (context* "/context" []
             :tags ["context*"]


Use defn not def

Use defn not def

--- src/clj/freestuffly/notifier.clj
+++ src/clj/freestuffly/notifier.clj
@@ -7,7 +7,9 @@

 (def my-group-urls "https://groups.freecycle.org/group/southwark-freecycle/posts/offer?page=1&resultsperpage=3&showall=off&include_offers=off&include_wanteds=off&include_receiveds=off&include_takens=off")

-(def site-tree (-> (client/get my-group-urls) :body h/parse h/as-hickory))
+(defn site-tree
+  []
+  (client/get my-group-urls) :body h/parse h/as-hickory)

 (defn parsed-html [html]
   (-> (s/select
@@ -19,10 +21,9 @@
           )
         site-tree)))

-(def rubbish-value?
-  (fn
-    [content-values]
-    (not= (content-values :content) ["See details"])))
+(defn rubbish-value?
+  [content-values]
+  (not= (content-values :content) ["See details"]))

 (defn content-for
   [html-vector]


If you change the api also change all the calling instances

I thought I had this under control

--- src/clj/hyphen_keeper/export.clj
+++ src/clj/hyphen_keeper/export.clj
@@ -37,7 +37,7 @@
    ;; filter the ones that aren't hyphenated correctly
    (remove
     (fn [{:keys [word hyphenation]}]
-      (= (hyphenate/hyphenate spelling word) hyphenation)))
+      (= (hyphenate/hyphenate word spelling) hyphenation)))
    (map :hyphenation)
    (remove string/blank?) ; drop empty ones
    (filter #(string/includes? % "-")) ; drop hyphenations w/o a hyphen


gzip output files

gzip output files

--- src/clj_money/import/gnucash.clj
+++ src/clj_money/import/gnucash.clj
@@ -11,8 +11,10 @@
             [clj-money.util :refer [pprint-and-return
                                     pprint-and-return-l]]
             [clj-money.import :refer [read-source]])
-  (:import java.util.zip.GZIPInputStream
-           [java.io File FileInputStream]))
+  (:import [java.util.zip GZIPInputStream
+                          GZIPOutputStream]
+           [java.io File FileInputStream
+                         FileOutputStream]))

 (defn- parse-date
   [string-date]
@@ -291,19 +293,17 @@
 (defn- process-output
   [{:keys [verbose records output-folder file-name output-paths] :as context}]
   (if (seq records)
-    (let [output-path (format "%s/%s_%s.edn"
+    (let [output-path (format "%s/%s_%s.edn.gz"
                               output-folder
                               file-name
                               (count output-paths))]

-      (when verbose
-        (println "Writing" (count records) "to" output-path))
-
-      (with-open [writer (io/writer output-path)]
+      (log/info "Writing" (count records) "records to" output-path)
+
+      (with-open [writer (io/writer (GZIPOutputStream. (FileOutputStream. output-path)))]
         (.write writer (prn-str records)))

-      (when verbose
-        (println "Done."))
+      (log/info "Finished writing" output-path)

       (-> context
           (assoc :records [])


Move difficulty picker to basic options

Move difficulty picker to basic options

--- src/cljs/db_quiz/components.cljs
+++ src/cljs/db_quiz/components.cljs
@@ -114,9 +114,11 @@

 (defn menu
   "Fixed information & navigazion menu"
-  []
+  [& {:keys [home?]
+      :or {home? false}}]
   [:div#info-menu.btn-group {:role "group"}
-   [:a.btn.btn-default {:href "#"} [:span.glyphicon.glyphicon-home.glyphicon-start] (t :labels/home)]
+   (when-not home?
+     [:a.btn.btn-default {:href "#"} [:span.glyphicon.glyphicon-home.glyphicon-start] (t :labels/home)])
    [:button.btn.btn-default {:on-click #(reagent-modals/modal! (modals/game-info) {:size :lg})}
     [:span.glyphicon.glyphicon-info-sign.glyphicon-start] (t :labels/about)]])

@@ -320,8 +322,7 @@

 (defn dbpedia-options
   []
-  [:div [selector-picker]
-        [difficulty-picker]])
+  [:div [selector-picker]])

 (def advanced-options
   (let [id [:options :data-source]
@@ -352,7 +353,8 @@
   [:div
    [language-picker]
    [player-form-field :player-1 :home/player-1]
-   [player-form-field :player-2 :home/player-2]])
+   [player-form-field :player-2 :home/player-2]
+   [difficulty-picker]])

 (def start-menu
   (let [options-hidden (atom true)]
@@ -390,7 +392,7 @@
   (fn []
     [:div.container-fluid
      [loading-indicator]
-     [menu]
+     [menu :home? true]
      [:div#logo [:img {:alt (t :labels/logo)
                        :src "img/logo.svg"}]]
      [start-menu]


Change destination page for redirection after posting article

--- src/clojournal/routes/author.clj
+++ src/clojournal/routes/author.clj
@@ -18,7 +18,7 @@
 (defn post-article [author-id title content tags]
   (let [tags' (clojure.string/split tags #"\s*,\s*")]
     (article/add-article! :title title :content content :author author-id :tags tags')
-    (response/redirect "/")))
+    (response/redirect "/author")))

 (defn wrap-auth [app]
   (fn [req]


Beginning to get frustrated with dokku.

Beginning to get frustrated with dokku.

--- src/clojure/staircase/config.clj
+++ src/clojure/staircase/config.clj
@@ -28,9 +28,15 @@
 (defn config [k]
   (k @configuration))

+(defn- parse-url
+  [url]
+  (let [parsed (java.net.URI. url)
+        [user password] (.split (.getUserInfo parsed) ":")]
+    (str "jdbc:postgresql://" (.getHost parsed) ":" (.getPort parsed) (.getPath parsed) "?user=" user "&password=" password)))
+
 (defn db-options [opts]
-  (if-let [uri (:database-url opts)]
-    {:connection-uri uri}
+  (if-let [url (:database-url opts)]
+    (parse-url url)
     (options opts "db-")))

 (defn app-options [opts]


Added content-type utility function.

Added content-type utility function.

--- src/cmr/opendap/http/request.clj
+++ src/cmr/opendap/http/request.clj
@@ -41,11 +41,17 @@
   ([req]
     (add-header req "User-Agent" const/user-agent)))

+(defn add-content-type
+  ([ct]
+    (add-content-type {}))
+  ([req ct]
+    (add-header req "Content-Type" ct)))
+
 (defn add-form-ct
   ([]
     (add-form-ct {}))
   ([req]
-    (add-header req "Content-Type" "application/x-www-form-urlencoded")))
+    (add-content-type req "application/x-www-form-urlencoded")))

 (defn add-client-id
   ([]
@@ -65,7 +71,8 @@
                      (add-client-id)
                      (add-user-agent)
                      (merge req)
-                     (assoc :url url :method method))
+                     (assoc :url url :method method)
+                     ((fn [x] (log/trace "Options to httpc:" x) x)))
                   callback))

 (defn async-get


Include progress bar in views

Include progress bar in views

--- frontend/src/cruncher/views.cljs
+++ frontend/src/cruncher/views.cljs
@@ -18,7 +18,7 @@
              (dom/span #js {:className "pull-right"} (vlib/loader (om/props this)))
              (vlib/button-primary #(com/route :get-all-pokemon) "Get all Pokemon")
              " "
-             (vlib/button-primary #(shredder/power-on) (vlib/fa-icon "fa-eraser") " Crunch selected Pokemon"))))
+             (vlib/button-primary #(shredder/power-on this) (vlib/fa-icon "fa-eraser") " Crunch selected Pokemon"))))
 (def controls (om/factory Controls))

@@ -123,7 +123,6 @@
                              (dom/strong nil "there is no possibility to get them back!!!"))
                      (dom/li nil "Enter a location near you to prevent a softban.")
                      (dom/li nil "Automated Pokemon crunching takes between 2 and 3 seconds per pokemon to prevent robotic behaviour."))
-             (dom/div nil (progress/progress-bar (om/props this)))
              (dom/hr nil))))
 (def header (om/factory Header))

@@ -204,6 +203,7 @@
              (dom/div nil (header (om/props this)))
              (dom/div nil (error-message (om/props this)))
              (dom/div nil (info-message (om/props this)))
+             (dom/div nil (progress/progress-bar (om/props this)))
              (view-dispatcher this)
              #_(dom/div nil (poketable (om/props this)))
              #_(dom/div nil (login)))))


refactored exercise acronym: using thread-last macro

--- exercises/acronym/src/example.clj
+++ exercises/acronym/src/example.clj
@@ -2,4 +2,7 @@
   (:require [clojure.string :as str]))

 (defn acronym [text]
-  (apply str (map str/upper-case (map first (re-seq #"[A-Z]+[a-z]*|[a-z]+" text)))))
+  (->> (re-seq #"[A-Z]+[a-z]*|[a-z]+" text)
+       (map first)
+       (map str/upper-case)
+       (apply str)))


Factor out make-route-param-resolver

Factor out make-route-param-resolver

--- src/io/aviso/rook/dispatcher.clj
+++ src/io/aviso/rook/dispatcher.clj
@@ -350,6 +350,20 @@
           ;; unsupported method for path
           nil)))))

+(defn make-route-param-resolver
+  "Compiles a function that resolves the given route-params very
+  efficiently."
+  [route-params]
+  (eval (let [req (gensym "request__")]
+          `(fn [kw# ~req]
+             (case kw#
+               ~@(mapcat
+                   (fn [sym]
+                     (let [k (keyword sym)]
+                       [k `(-> ~req :route-params ~k)]))
+                   route-params)
+               nil)))))
+
 (defn map-traversal-dispatch-map
   "Returns a dispatch-map for use with map-traversal-dispatcher."
   [{:keys [routes handlers middleware]} apply-middleware]
@@ -363,15 +377,7 @@

                   route-param-resolver
                   (if (seq route-params)
-                    [(eval (let [req (gensym "request__")]
-                             `(fn [kw# ~req]
-                                (case kw#
-                                  ~@(mapcat
-                                      (fn [sym]
-                                        (let [k (keyword sym)]
-                                          [k `(-> ~req :route-params ~k)]))
-                                      route-params)
-                                  nil))))])
+                    [(make-route-param-resolver route-params)])

                   mw (get middleware middleware-sym)
                   mw (ensure-fn mw)


fixed bug when pausing upload

fixed bug when pausing upload

--- src/frontend/uploads.cljs
+++ src/frontend/uploads.cljs
@@ -135,7 +135,9 @@
                                        (.unpipe blob-stream)
                                        (let [first-inactive-upload-id (first (filter #(unpaused-and-not-started? (uploads %)) uploads-order))
                                              first-inactive-upload    (uploads first-inactive-upload-id)]
-                                         (if-not (nil? first-inactive-upload)
+                                         (if (and (not (nil? first-inactive-upload))
+                                                  (> (count (active-uploads uploads-order uploads))
+                                                     upload-slots))
                                            (swap! app-state/app-state
                                                   assoc
                                                   :uploads
@@ -146,8 +148,8 @@
                                         (:started? upload))
                                      (do
                                        (.pipe blob-stream stream)
-                                       (if (>  (count (active-uploads uploads-order uploads))
-                                               upload-slots)
+                                       (if (> (count (active-uploads uploads-order uploads))
+                                              upload-slots)
                                          (let [uploads-order-after-id (uploads-after-id uploads-order upload-id)
                                                upload-to-stop-id (last (active-uploads uploads-order uploads))]
                                            (if-let [upload-to-stop (uploads upload-to-stop-id)]


Typo: if rather than is

Typo: if rather than is

--- src/leiningen/jupyter/kernel.clj
+++ src/leiningen/jupyter/kernel.clj
@@ -71,7 +71,7 @@
        (-> os (get-platform-specific-kernel-dir (System/getenv)) install-kernel)))))

 (defn kernel-installed?
-  "return true is it is sensible to believe that kernel has properly been installed"
+  "return true if it is sensible to believe that kernel has properly been installed"
   []
   (let [kernel-dir (get-platform-specific-kernel-dir (get-os) (System/getenv))]
     (.exists kernel-dir)))


Render a list of items in om/root.

Render a list of items in om/root.

Render a list of animals (with no attributes) in the render loop of the
om/root.

--- basic/om-tut/src/om_tut/core.cljs
+++ basic/om-tut/src/om_tut/core.cljs
@@ -8,11 +8,13 @@

 ;; define your app data so that it doesn't get over-written on reload

-(defonce app-state (atom {:text "Hello Om Basic Tutorial World!"}))
+(defonce app-state (atom {:list ["Lion" "Zebra" "Buffalo" "Antelope"]}))

 (om/root
  (fn [data owner]
-   (om/component (dom/h2 nil (:text data))))
+   (om/component
+    (apply dom/ul nil
+           (map (fn [text] (dom/li nil text)) (:list data)))))
  app-state
  {:target (. js/document (getElementById "app0"))})


Yes, found the bug! :-)  Streaming queries are up.

--- src/plasma/peer.clj
+++ src/plasma/peer.clj
@@ -290,7 +290,7 @@
   (lamina/receive-all (request-channel con)
                       (partial request-handler peer))
   (lamina/receive-all (stream-channel con)
-                      (partial stream-handler peer)))
+                      (partial stream-request-handler peer)))

 (defn peer
   "Create a new peer using a graph database located at path, optionally