z->c for -zar verbs for preterito with 1st person singular.

--- src/babel/espanol/morphology/verbs.cljc
+++ src/babel/espanol/morphology/verbs.cljc
@@ -515,11 +515,15 @@
                                vosotros :vosotros
                                ustedes :ustedes}]
   (let [infinitive (reflexive-to-infinitive (get-in word '(:espanol)))
+        person (get-in word '(:agr :person))
+        number (get-in word '(:agr :number))
         ar-type (try (re-find #"ar$" infinitive)
                      (catch Exception e
                        (exception (str "Can't regex-find on non-string: " infinitive " from word: " word))))
         er-type (re-find #"er$" infinitive)
         ir-type (re-find #"ir$" infinitive)
+
+        zar-type (re-find #"zar$" infinitive)

         ;; default stem: will be used except under certain conditions, as described in next check.
         stem (string/replace infinitive #"[iae]r$" "")
@@ -527,14 +531,18 @@
         stem (if (get-in word [:preterito-stem])
                (get-in word [:preterito-stem])
                stem)
+
+        stem (if (and zar-type ;; z->c for -zar verbs with 1st person singular.
+                      (= person :1st)
+                      (= number :sing))
+               (string/replace infinitive #"zar$" "c")
+               stem)

         last-stem-char-is-i (re-find #"ir$" infinitive)
         last-stem-char-is-e (re-find #"er$" infinitive)
         is-care-or-gare? (re-find #"[cg]ar$" infinitive)
         vosotros (if vosotros vosotros true)
-        ustedes (if ustedes ustedes false)
-        person (get-in word '(:agr :person))
-        number (get-in word '(:agr :number))]
+        ustedes (if ustedes ustedes false)]

     (cond
      (and (= person :1st) (= number :sing) ar-type)


add more analysis of :future

add more analysis of :future

--- src/babel/italiano/morphology/verbs.clj
+++ src/babel/italiano/morphology/verbs.clj
@@ -13,6 +13,11 @@
                                     :person :1st}}}
                  :infl :future}}}

+   {:p [#"^([^ ]+)vrò" "$1vere"]
+    :u {:synsem {:subcat {:1 {:agr {:number :sing
+                                    :person :1st}}}
+                 :infl :future}}}
+
    {:p [#"^([^ ]+)erò" "$1arsi"]
     :u {:synsem {:subcat {:1 {:agr {:number :sing
                                     :person :1st}}}
@@ -69,6 +74,16 @@
                                     :person :2nd}}}
                  :infl :future}}}

+   {:p [#"([^ ]+)ichai" "$1icare"]
+    :u {:synsem {:subcat {:1 {:agr {:number :sing
+                                    :person :2nd}}}
+                 :infl :future}}}
+
+   {:p [#"([^ ]+)cherai" "$1are"] ;; cercherai -> cercare
+    :u {:synsem {:subcat {:1 {:agr {:number :sing
+                                    :person :2nd}}}
+                 :infl :future}}}
+
    {:p [#"^([^ ]+)erà" "$1are"]
     :u {:synsem {:subcat {:1 {:agr {:number :sing
                                     :person :3rd}}}
@@ -94,12 +109,31 @@
                                     :person :3rd}}}
                  :infl :future}}}

+   {:p [#"^([^ ]+)eramo" "$1ere"]
+    :u {:synsem {:subcat {:1 {:agr {:number :plur
+                                    :person :1st}}}
+                 :infl :future}}}

    {:p [#"^([^ ]+)eremo" "$1are"]
     :u {:synsem {:subcat {:1 {:agr {:number :plur
                                     :person :1st}}}
                  :infl :future}}}

+   {:p [#"([^ ]+)ichemo" "$1icare"]
+    :u {:synsem {:subcat {:1 {:agr {:number :plur
+                                    :person :1st}}}
+                 :infl :future}}}
+
+   {:p [#"^([^ ]+)remo" "$1ere"] ;; "avremo" -> "avere"
+    :u {:synsem {:subcat {:1 {:agr {:number :plur
+                                    :person :1st}}}
+                 :infl :future}}}
+
+   {:p [#"^([^ ]+)iremo" "$1ire"]
+    :u {:synsem {:subcat {:1 {:agr {:number :plur
+                                    :person :1st}}}
+                 :infl :future}}}
+
    {:p [#"^([^ ]+)iremo" "$1irsi"]
     :u {:synsem {:subcat {:1 {:agr {:number :plur
                                     :person :1st}}}
@@ -110,6 +144,11 @@
                                     :person :1st}}}
                  :infl :future}}}

+   {:p [#"^([^ ]+)eremo" "$1ersi"]
+    :u {:synsem {:subcat {:1 {:agr {:number :plur
+                                    :person :1st}}}
+                 :infl :future}}}
+
    {:p [#"^([^ ]+)er[r]?emo" "$1ere"]
     :u {:synsem {:subcat {:1 {:agr {:number :plur
                                     :person :1st}}}
@@ -149,6 +188,16 @@
     :u {:synsem {:subcat {:1 {:agr {:number :plur
                                     :person :2nd}}}
                  :infl :future}}}
+
+   {:p [#"^([^ ]+)irete" "$1ire"]
+    :u {:synsem {:subcat {:1 {:agr {:number :plur
+                                    :person :2nd}}}
+                 :infl :future}}}
+
+   {:p [#"^([^ ]+)irete" "$1irsi"]
+    :u {:synsem {:subcat {:1 {:agr {:number :plur
+                                    :person :2nd}}}
+                 :infl :future}}}

    {:p [#"^([^ ]+)eranno" "$1are"]
     :u {:synsem {:subcat {:1 {:agr {:number :plur
@@ -170,6 +219,21 @@
                                     :person :3rd}}}
                  :infl :future}}}

+   {:p [#"^([^ ]+)eranno" "$1ersi"]
+    :u {:synsem {:subcat {:1 {:agr {:number :plur
+                                    :person :3rd}}}
+                 :infl :future}}}
+
+   {:p [#"^([^ ]+)iranno" "$1ire"]
+    :u {:synsem {:subcat {:1 {:agr {:number :plur
+                                    :person :3rd}}}
+                 :infl :future}}}
+
+   {:p [#"^([^ ]+)iranno" "$1irsi"]
+    :u {:synsem {:subcat {:1 {:agr {:number :plur
+                                    :person :3rd}}}
+                 :infl :future}}}
+
    ])

 (def replace-patterns-past-tense


Une première solution à l'exercice Bob soumise dans la track Clojure.

--- exercism/clojure/bob/src/bob.clj
+++ exercism/clojure/bob/src/bob.clj
@@ -1,5 +1,11 @@
 (ns bob)

-(defn response-for [s] ;; <- arglist goes here
-  ;; your code goes here
+(defn response-for [s]
+  (cond
+    (or (= 0 (count s)) (re-matches #"\s+" s)) "Fine. Be that way!"
+    (re-matches #"([A-Z]|\s)+\?" s) "Calm down, I know what I'm doing!"
+    (re-matches #"([1-9,]|\s)+" s) "Whatever."
+    (re-matches #"([1-9A-Z]|\s|[,%\^\*@#\$\(\)\!])+\!?" s) "Whoa, chill out!"
+    (re-matches #"([1-9a-zA-Z,]|\s)+\?" s) "Sure."
+    :else "Whatever.")
 )


tighten up

tighten up

--- src/cljs/infinitelives/pixi/canvas.cljs
+++ src/cljs/infinitelives/pixi/canvas.cljs
@@ -305,7 +305,7 @@
         img (dom/create-element :img)]
     (dom/append! div img)
     (set! (.-src img) "http://runrunitshim.com/images/fullscreenIcon.png")
-    (.setAttribute img "style" "bottom: 0; position: absolute; padding-bottom: 20px; padding-left: 20px; z-index: 200;")
+    (.setAttribute img "style" "bottom: 0; position: absolute; padding-bottom: 0px; padding-left: 0px; z-index: 200;")
     (.setAttribute div "style" "bottom: 0; position: absolute; padding-bottom: 0px; padding-left: 0px; z-index: 200;")
     (.addEventListener img "click" #(fullscreen-fn true))
     (dom/append! (.-body js/document) div)


Read logfile and set that to the listing at start.

--- src/clojure/my/stuff/fitlogger/main.clj
+++ src/clojure/my/stuff/fitlogger/main.clj
@@ -161,6 +161,7 @@
   (onCreate [this bundle]
     (.superOnCreate this bundle)
     (neko.debug/keep-screen-on this)
+    (reset! listing (csv->listing (split-lines (read-logfile (*a)))))
     (on-ui
      (set-content-view! (*a) (main-layout (*a)))
      (set-elmt (*a) ::listing (format-listing @listing)))))


Temporarily hardcode doulble bias now for OLD in possibly-just-young-or-old.

--- src/clojush/pushgp/parent_selection.clj
+++ src/clojush/pushgp/parent_selection.clj
@@ -50,7 +50,7 @@
   [pop {:keys [lexicase-youth-segregation]}]
   (if lexicase-youth-segregation
     (let [age-limit (lrand-nth (distinct (map :age pop)))
-          criterion (lrand-nth [<= <= >=])]
+          criterion (lrand-nth [<= >= >=])]
       (filter (fn [ind] (criterion (:age ind) age-limit))
               pop))
     pop))


helps if I don't mistype

helps if I don't mistype

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/lt/objs/sidebar/clients.cljs
+++ src/lt/objs/sidebar/clients.cljs
@@ -36,7 +36,7 @@
   (let [actives (:active clients)
         found? (first (filter #(= cur (val %)) actives))
         connected? (:connected @cur)]
-    (if (and found? connected)
+    (if (and found? connected?)
       (str "active client-" (name (first found?)))
       "")))


update clojure.org syntax ref links

update clojure.org syntax ref links

--- src/main/cljs_api_gen/syntax.clj
+++ src/main/cljs_api_gen/syntax.clj
@@ -9,14 +9,14 @@
 ;;   - syntax (from `clojure.lang/LispReader`)
 ;;--------------------------------------------------------------------------------

-(def doc-url "http://clojure.org/reader")
+(def doc-url "http://clojure.org/reference/reader")

-(def doc1 (str doc-url "#toc1")) ;; Reader forms
-(def doc2 (str doc-url "#toc2")) ;; Macro characters
-(def doc4 (str doc-url "#toc4")) ;; Tagged literals
-(def doc5 (str doc-url "#toc5")) ;; Reader conditionals
+(def doc1 (str doc-url "#_reader_forms")) ;; Reader forms
+(def doc2 (str doc-url "#macrochars")) ;; Macro characters
+(def doc4 (str doc-url "#_tagged_literals")) ;; Tagged literals
+(def doc5 (str doc-url "#_reader_conditionals")) ;; Reader conditionals

-(def doc-destruct (str "http://clojure.org/special_forms#toc18")) ;; Destructuring
+(def doc-destruct (str "http://clojure.org/reference/special_forms#binding-forms")) ;; Destructuring

 (def undoc (str doc-url "#undocumented")) ;; not real url, just a note

@@ -25,7 +25,7 @@
 (def doc-shebang  (str doc-lispreader "#L114"))
 (def doc-unread   (str doc-lispreader "#L115"))

-(def doc-interop "http://clojure.org/java_interop#toc6")
+(def doc-interop "http://clojure.org/reference/java_interop#_the_dot_special_form")

 (def doc-clj-tags
   "https://github.com/clojure/clojure/blob/clojure-1.6.0/src/clj/clojure/core.clj#L6947")
@@ -34,8 +34,8 @@
   [name-]
   (str "https://github.com/edn-format/edn#" name-))

-(def doc-cheatsheet "http://clojure.org/cheatsheet")
-(def doc-syntax-quote "http://clojure.org/reader#syntax-quote")
+(def doc-cheatsheet "http://clojure.org/api/cheatsheet")
+(def doc-syntax-quote "http://clojure.org/reference/reader#syntax-quote")
 (def doc-ampersand "http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/&")

 ;; an edn doc (there is no clojure doc on whitespace)


Fix thin wall

Fix thin wall

--- src/dactyl_keyboard/dactyl-manuform.clj
+++ src/dactyl_keyboard/dactyl-manuform.clj
@@ -122,7 +122,7 @@
                           (translate column-offset))]
     (->> placed-shape
          (rotate (/ π 12) [0 1 0])
-         (translate [0 0 23]))))
+         (translate [0 0 25]))))

 (def key-holes
   (apply union
@@ -196,7 +196,7 @@
 ;;;;;;;;;;;;
 ;; Thumbs ;;
 ;;;;;;;;;;;;
-(def thumborigin [-23 -34 45])
+(def thumborigin [-23 -34 48])

 (defn deg2rad [degrees]
   (* (/ degrees 180) pi))
@@ -392,13 +392,13 @@
       (place2 (translate [(* dx2 5) (* dy2 5) -15] post2))
       )
     ;  (hull
-    ;   (translate [0 0 -19] (key-place x1 y1 (translate [0         0         -15] post1)))
-    ;   (translate [0 0 -19] (key-place x2 y2 (translate [0         0         -15] post2)))
-    ;   (key-place x1 y1 (translate [(* dx1 5) (* dy1 5) -15] post1))
-    ;   (key-place x1 y1 (translate [0         0         -15] post1))
-    ;   (key-place x1 y1 (translate [(* dx1 5) (* dy1 5) -15] post1))
-    ;   (key-place x2 y2 (translate [0         0         -15] post2))
-    ;   (key-place x2 y2 (translate [(* dx1 5) (* dy1 5) -15] post2))
+    ;   (translate [0 0 -19] (place1 (translate [0         0         -15] post1)))
+    ;   (translate [0 0 -19] (place2 (translate [0         0         -15] post2)))
+    ;   (place1 (translate [(* dx1 5) (* dy1 5) -15] post1))
+    ;   (place1 (translate [0         0         -15] post1))
+    ;   (place1 (translate [(* dx1 5) (* dy1 5) -15] post1))
+    ;   (place2 (translate [0         0         -15] post2))
+    ;   (place2 (translate [(* dx1 5) (* dy1 5) -15] post2))
     ))

 (defn key-wall-brace [x1 y1 dx1 dy1 post1 x2 y2 dx2 dy2 post2] (wall-brace (partial key-place x1 y1) dx1 dy1 post1 (partial key-place x2 y2) dx2 dy2 post2))
@@ -419,11 +419,11 @@
    (for [y (range 1 3)] (key-wall-brace 0 (dec y) -1 0 web-post-bl 0 y -1 0 web-post-tl))
    ; front wall
   ;  (key-wall-brace 2 3 0 -1 web-post-bl 2 3 0 -1 web-post-br)
-   (key-wall-brace 3 3 0 -1 web-post-bl 3 3 0 -1 web-post-br)
+   (key-wall-brace 3 3 0 -1 web-post-bl 3 3 0.5 -1 web-post-br)
    (key-wall-brace 4 2 0 -1 web-post-bl 4 2 0 -1 web-post-br)
    (key-wall-brace 5 2 0 -1 web-post-bl 5 2 0 -1 web-post-br)
   ;  (key-wall-brace 2 3 0 -1 web-post-br 3 3 0 -1 web-post-bl)
-   (key-wall-brace 3 3 0 -1 web-post-br 4 2 0 -1 web-post-bl)
+   (key-wall-brace 3 3 0.5 -1 web-post-br 4 2 1 -1 web-post-bl)
    (key-wall-brace 4 2 0 -1 web-post-br 5 2 0 -1 web-post-bl)
    ; thumb walls
    (wall-brace thumb-mr-place  0 -1 web-post-br thumb-tr-place  0 -1 thumb-post-br)


Added function to compute adjacency maps.

The new functionality allows to compute graphs from contexts,
represented by adjacency-maps.

--- src/main/clojure/conexp/fca/applications/socialanalytics.clj
+++ src/main/clojure/conexp/fca/applications/socialanalytics.clj
@@ -9,7 +9,8 @@
 (ns conexp.fca.applications.socialanalytics
   "Provides some functionallity for Socialanalytics."
   (:require [conexp.fca.contexts :refer :all]
-            [clojure.set :refer [intersection]]))
+            [clojure.set :refer [intersection
+                                 union]]))

 ;;;;Functions to compute adjacency-matricies

@@ -93,6 +94,119 @@
          (nth attribute-derivations-of-context %)
          (drop % attribute-derivations-of-context))
       (range 0 n))))
+
+;;; Functions to compute adjacency-maps.
+;;; The following functions take a context as argument and return
+;;; graphs, represented by adjacency-maps in the form
+;;; {node1 set-of-neighbours, node2 set-of-neighbours...}.
+
+(defn object-and-attribute-projection
+  "Computes for a given `context' the adjacency-map
+  of the graph, which has as verticies the objects
+  and attributes and in which the edges are defined
+  through the incidence-relation.
+  As it is possible for an object and an attribute
+  to have the same name, the verticies belonging to objects
+  are renamed from object1, object2 to
+  obj-object1, obj-object2,... and verticies belonging to
+  attributes are renamed from attribute1,attribute2 to
+  atr-attribute1,atr-attribute2..."
+  [context]
+  (let [object-nodes
+        ;; Computes the successors
+        ;; for all verticies, which
+        ;; correspond to objects.
+        (reduce
+          (fn [hmap obj]
+            (assoc hmap (str 'obj- obj)
+                   (set
+                     (map
+                       #(str 'atr- %)
+                       (object-derivation context #{obj})))))
+          {}
+          (objects context))
+        attribute-nodes
+        ;; Computes the successors
+        ;; for all verticies, which
+        ;; correspond to attributes.
+        (reduce
+          (fn [hmap atr]
+            (assoc hmap (str 'atr- atr)
+                   (set
+                     (map
+                       #(str 'obj- %)
+                       (attribute-derivation context #{atr})))))
+          {}
+          (attributes context))]
+    (merge object-nodes attribute-nodes)))
+
+(defn- add-edges
+  "This is a helper-function to compute
+  the objects-projection and the attributes-projection
+  of a context.
+
+  It takes a map `hmap' and a `set' and adds all elements
+  of set to all those keys of hmap, whose are elements of
+  set themselves."
+  [hmap set]
+  (reduce
+    (fn [currenthmap element]
+      (update-in currenthmap
+                 [element]
+                 union
+                 set))
+    hmap
+    set))
+
+(defn object-projection
+  "Computes for a `context' the adjacency-map
+  of the graph which has as verticies
+  the objects of a context and in which
+  two objects share an edge if they share an
+  attribute."
+  [context]
+  (let [init-verticies
+        ;; We initialize all objects
+        ;; of the context as verticies
+        ;; without edges.
+        (reduce
+          (fn [hmap object]
+            (assoc hmap object #{}))
+          {}
+          (objects context))]
+    ;; Iterate through all attributes `attribute' to
+    ;; add the edges o1<->02 for all objects
+    ;; o1,o2 that have the `attribute'.
+    (reduce
+      (fn [hmap attribute]
+        (add-edges hmap (attribute-derivation context #{attribute})))
+      init-verticies
+      (attributes context))))
+
+(defn attribute-projection
+  "Computes for a `context' the adjacency-map
+  of the graph which has as verticies
+  the attributes of a context and in which
+  two attributes share an edge if they share an
+  object."
+  [context]
+  (let [init-verticies
+        ;; We initialize all attributes
+        ;; of the context as verticies
+        ;; without edges.
+        (reduce
+          (fn [hmap attribute]
+            (assoc hmap attribute #{}))
+          {}
+          (attributes context))]
+    ;; Iterate through all objects `object' to
+    ;; add the edges a1<->a2 for all attributes
+    ;; a1,a2 that this `object' has.
+    (reduce
+      (fn [hmap object]
+        (add-edges hmap (object-derivation context #{object})))
+      init-verticies
+      (objects context))))

 ;;; Average-shortest-path


Fix component-path on React 16 + advanced optimized built

--- src/reagent/impl/component.cljs
+++ src/reagent/impl/component.cljs
@@ -285,16 +285,21 @@

 (defn component-path [c]
   ;; Alternative branch for React 16
-  (if-let [fiber (some-> c ($ :_reactInternalFiber))]
+  ;; Try both original name (for UMD foreign-lib) and manged name (property access, for Closure optimized React)
+  (if-let [fiber (or (some-> c ($ :_reactInternalFiber))
+                     (some-> c (.-_reactInternalFiber)))]
     (fiber-component-path fiber)
-    (let [elem (or (some-> (or (some-> c ($ :_reactInternalInstance))
-                               c)
-                           ($ :_currentElement)))
+    (let [instance (or (some-> c ($ :_reactInternalInstance))
+                       (some-> c (.-_reactInternalInstance))
+                       c)
+          elem (or (some-> instance ($ :_currentElement))
+                   (some-> instance (.-_currentElement)))
           name (some-> elem
                        ($ :type)
                        ($ :displayName))
-          path (some-> elem
-                       ($ :_owner)
+          owner (or (some-> elem ($ :_owner))
+                    (some-> elem (.-_owner)))
+          path (some-> owner
                        component-path
                        (str " > "))
           res (str path name)]


Change ctor for lifecycle.

Change ctor for lifecycle.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -496,7 +496,7 @@

     component))

-(defn task-lifecycle [id log queue job task err-ch opts]
+(defn task-lifecycle [args {:keys [id log queue job task err-ch opts]}]
   (map->TaskLifeCycle {:id id :log log :queue queue :job job
                        :task task :err-ch err-ch :opts opts}))


Latest Om

Latest Om

--- ClojureScript/project.clj
+++ ClojureScript/project.clj
@@ -2,7 +2,7 @@
   :description "React Native tic-tac-toe in ClojureScript"
   :dependencies [[org.clojure/clojure "1.7.0-beta1"]
                  [org.clojure/clojurescript "0.0-3211"]
-                 [org.omcljs/om "0.8.6"]
+                 [org.omcljs/om "0.8.8"]
                  [org.omcljs/ambly "0.1.0-SNAPSHOT"]]
   :plugins [[lein-cljsbuild "1.0.5"]]
   :source-paths ["src"]


Fixed an error with test.

Fixed an error with test.

--- test/fx_clj/example_enlive.clj
+++ test/fx_clj/example_enlive.clj
@@ -7,7 +7,7 @@
 (defn test-view []
   (let [view (FXMLLoader/load
                (io/resource "fx_clj/example_enlive.fxml"))]
-    (fx/at view
+    (fx/at! view
            "#my-btn"
            {:on-action
              (fn [e] (println "Got clicked!"))})


Update to hickory 0.5.4

Update to hickory 0.5.4

Removes a dependency on clojurescript.test

--- example-web-app/project.clj
+++ example-web-app/project.clj
@@ -34,7 +34,7 @@
                  [ring "1.3.0"]
                  [ring/ring-headers "0.1.0"]
                  [ring/ring-anti-forgery "1.0.0"]
-                 [hickory "0.5.3"]
+                 [hickory "0.5.4"]
                  [cheshire "5.3.1"]
                  [com.taoensso/timbre "3.2.1"]]


Add test to prove an existing ref will produce the right value when the obj referred to is changed.

--- test/isla/test/interpreter.clj
+++ test/isla/test/interpreter.clj
@@ -18,6 +18,11 @@
     (is (= (get (:ctx result) "isla")
            1))))

+(deftest test-existing-obj-assignment-to-var
+  (let [env (interpret (parse "isla is a person\nfriend is isla\nisla age is 1")
+                       (library/get-initial-env extra-types))]
+    (is (= (lookup-ref "friend" env)
+           (new isla.test.interpreter.Person 1 "" :undefined)))))

 ;; invocation


Add newline.

Add newline.

--- src/lib/cljs/one/browser/animation.cljs
+++ src/lib/cljs/one/browser/animation.cljs
@@ -788,3 +788,4 @@
   ([f delay]
      (play-animation (fn [] (goog.Timer. delay))
                      {:before f})))
+


return system fron stop-datomic! so reset works

--- test/navigator/test_config.clj
+++ test/navigator/test_config.clj
@@ -11,7 +11,8 @@

 (defn stop-datomic! [system]
   (dissoc system :db-conn)
-  (d/delete-database datomic-uri))
+  (d/delete-database datomic-uri)
+  system)

 (defn start!
   "Starts the current development system."


(TK-309) Schemafy TK service macro

(TK-309) Schemafy TK service macro

--- src/puppetlabs/trapperkeeper/services_internal.clj
+++ src/puppetlabs/trapperkeeper/services_internal.clj
@@ -87,64 +87,36 @@
             optional-form (array-map dep optional-dep-default)]
         (recur (rest optional) (conj output optional-form))))))

-;; TODO Not converting to use schema since this fn's behavior should literally
-;; be a schema
-(defn validate-fn-forms!
-  "Validate that all of the fn forms in the service body appear to be
-  valid fn definitions.  Throws `IllegalArgumentException` otherwise."
-  [fns]
-  {:pre [(seq? fns)]
-   :post [(map? %)
-          (= #{:fns} (set (keys %)))]}
-  (if (every? seq? fns)
-    {:fns fns}
-    (throw (IllegalArgumentException.
-            (format
-             "Invalid service definition; expected function definitions following dependency list, invalid value: '%s'"
-             (pr-str (first (filter #(not (seq? %)) fns))))))))
-
-;; TODO Not converting to use schema since this fn's behavior should literally
-;; be a schema
-(defn validate-deps-form!
-  "Validate that the service body has a valid dependency specification.
-  Throws `IllegalArgumentException` otherwise."
-  [forms]
-  {:pre [(seq? forms)]
-   :post [(map? %)
-          (= #{:fns :dependencies} (set (keys %)))]}
-  (let [f (first forms)
-        deps (cond
-               (vector? f) f
-               (map? f) (transform-deps-map f)
-               :else (throw (IllegalArgumentException.
-                             (format
-                              "Invalid service definition; expected dependency list following protocol, found: '%s'"
-                              (pr-str f)))))]
-    (merge {:dependencies deps} (validate-fn-forms! (rest forms)))))
-
-;; TODO Not converting to use schema since this fn's behavior should literally
-;; be a schema
-(defn find-prot-and-deps-forms!
+(schema/defn ^:always-validate find-prot-and-deps-forms!
+  :- {:fns (schema/pred seq?) :dependencies (schema/pred vector?) :service-protocol-sym (schema/maybe Symbol)}
   "Given the forms passed to the service macro, find the service protocol
   (if one is provided), the dependency list, and the function definitions.
   Throws `IllegalArgumentException` if the forms do not represent a valid service.
   Returns a map containing the protocol, dependency list, and fn forms."
-  [forms]
-  {:pre [(seq? forms)]
-   :post [(map? %)
-          (= #{:fns :dependencies :service-protocol-sym} (set (keys %)))
-          ((some-fn nil? symbol?) (:service-protocol-sym %))
-          (vector? (:dependencies %))
-          (seq? (:fns %))]}
-  (let [f (first forms)]
-    (cond
-      (symbol? f) (merge {:service-protocol-sym f} (validate-deps-form! (rest forms)))
-      (map? f) (merge {:service-protocol-sym nil} (validate-deps-form! forms))
-      (vector? f) (merge {:service-protocol-sym nil} (validate-deps-form! forms))
-      :else (throw (IllegalArgumentException.
+  [forms :- (schema/pred seq?)]
+  (let [f (if (some true? ((juxt symbol? map? vector?) (first forms)))
+            (first forms)
+            (throw (IllegalArgumentException.
                     (format
                      "Invalid service definition; first form must be protocol or dependency list; found '%s'"
-                     (pr-str f)))))))
+                     (pr-str (first forms))))))
+        service-protocol-sym (if (symbol? f) f nil)
+        forms (if (nil? service-protocol-sym) forms (rest forms))
+        ff (first forms)
+        deps (cond (vector? ff) ff
+                   (map? ff) (transform-deps-map ff)
+                   :else (throw (IllegalArgumentException.
+                                 (format
+                                  "Invalid service definition; expected dependency list following protocol, found: '%s'"
+                                  (pr-str ff)))))]
+    (if (every? seq? (rest forms))
+      {:service-protocol-sym service-protocol-sym
+       :dependencies deps
+       :fns (rest forms)}
+      (throw (IllegalArgumentException.
+              (format
+               "Invalid service definition; expected function definitions following dependency list, invalid value: '%s'"
+               (pr-str (first (filter #(not (seq? %)) (rest forms))))))))))

 (schema/defn ^:always-validate validate-protocol-sym! :- Protocol
   "Given a var, validate that the var exists and that its value is a protocol.


Take into account wrong input formatting from the websocket

--- src-cljs/photon/ui/ws.cljs
+++ src-cljs/photon/ui/ws.cljs
@@ -60,7 +60,7 @@
         (do
           (>! ws-channel {:ok true})
           (loop [elem (<! ws-channel)]
-            (when-not (nil? elem)
+            (when-not (or (nil? elem) (nil? (:projections (:message elem))))
               (if (contains? elem :error)
                 (do
                   #_(.log js/console (pr-str elem)))


fix something we were experimenting with.

--- src/metabase/models/query_execution.clj
+++ src/metabase/models/query_execution.clj
@@ -14,7 +14,7 @@
 (defentity QueryExecution
   (table :query_queryexecution))

-(def all-fields [`QueryExecution
+(def all-fields [QueryExecution
                  :id
                  :uuid
                  :version


add dashboard tests back in

add dashboard tests back in


add withjsonschema in bq

add withjsonschema in bq

--- src/clj/datasplash/bq.clj
+++ src/clj/datasplash/bq.clj
@@ -181,6 +181,8 @@
    base-schema
    {:schema {:docstr "Specifies bq schema."
              :action (fn [transform schema] (.withSchema transform (->schema schema)))}
+    :json-schema {:docstr "Specifies bq schema in json"
+                  :action (fn [transform schema] (.withJsonSchema transform schema))}
     :write-disposition {:docstr "Choose write disposition."
                         :enum write-disposition-enum
                         :action (select-enum-option-fn


Move version to :should part of query

Move version to :should part of query

--- src/clj/subman/models.clj
+++ src/clj/subman/models.clj
@@ -68,12 +68,12 @@
         {:query (q/bool :must (concat [(q/fuzzy-like-this
                                         :like_text prepared
                                         :fields [:show :name]
-                                        :boost const/show-name-boost)
-                                       (q/fuzzy-like-this
-                                        :like_text prepared
-                                        :fields [:version]
-                                        :boost const/version-boost)]
-                                      (get-season-episode prepared)))
+                                        :boost const/show-name-boost)]
+                                      (get-season-episode prepared))
+                        :should (q/fuzzy-like-this
+                                 :like_text prepared
+                                 :fields [:version]
+                                 :boost const/version-boost))
          :filter (q/term :lang lang)
          :size const/result-size})
       vec


allow for commodity account not to be found

--- src/clj_money/trading.clj
+++ src/clj_money/trading.clj
@@ -63,11 +63,11 @@

 (defn- find-commodity-account
   [storage parent commodity]
-  (->> {:parent-id (:id parent)
-            :commodity-id (:id commodity)}
-       (accounts/search storage)
-       first
-       (ensure-tag storage :tradable)))
+  (when-let [result (->> {:parent-id (:id parent)
+                          :commodity-id (:id commodity)}
+                         (accounts/search storage)
+                         first)]
+    (ensure-tag storage :tradable result)))

 (defn- create-commodity-account
   [storage parent commodity]


Refactoring: update-server-configuration and update-bot-configuration

--- src/clj_mrazik/config.clj
+++ src/clj_mrazik/config.clj
@@ -17,25 +17,39 @@
 (require '[clojure-ini.core :as clojure-ini])

 (defn parse-int
+    "Parse the given string as an integer number."
     [string]
     (java.lang.Integer/parseInt string))

 (defn parse-hh-mm-time-as-minutes
+    "Parse the given string that has to have format 'HH:mm' and returns
+     the time in minutes."
     [string]
     (let [time (-> (java.text.SimpleDateFormat. "HH:mm")
                (.parse string))]
          (+ (.getMinutes time)
             (* 60 (.getHours time)))))

+(defn update-server-configuration
+    "Update server configuration from the loaded data."
+    [configuration]
+    (update-in configuration [:server :port] parse-int))
+
+(defn update-bot-configuration
+    "Update bot configuration from the loaded data."
+    [configuration]
+    (-> configuration
+        (update-in [:bot :start]     parse-hh-mm-time-as-minutes)
+        (update-in [:bot :end]       parse-hh-mm-time-as-minutes)
+        (update-in [:bot :frequency] parse-hh-mm-time-as-minutes)
+        (update-in [:bot :duration]  parse-hh-mm-time-as-minutes)))
+
 (defn load-configuration
     "Load configuration from the provided INI file."
     [ini-file-name]
     (-> (clojure-ini/read-ini ini-file-name :keywordize? true)
-        (update-in [:server :port]   parse-int)
-        (update-in [:bot :start]     parse-hh-mm-time-as-minutes)
-        (update-in [:bot :end]       parse-hh-mm-time-as-minutes)
-        (update-in [:bot :frequency] parse-hh-mm-time-as-minutes)
-        (update-in [:bot :duration]  parse-hh-mm-time-as-minutes)))
+        update-server-configuration
+        update-bot-configuration))

 (defn print-configuration
     "Print actual configuration to the output."


Support for default tag parser

Support for default tag parser

If tag is not found in *tag-table* looks for *default-data-reader-fn* which is
a function of 2 arguments: tag and value
Helper functions register-default-tag-parser! and deregister-default-tag-parser!
(akin to register-tag-parser! and deregister-tag-parser!)

--- src/cljs/cljs/reader.cljs
+++ src/cljs/cljs/reader.cljs
@@ -527,14 +527,20 @@
                         "uuid"  read-uuid
                         "queue" read-queue}))

+(def *default-data-reader-fn*
+  (atom nil))
+
 (defn maybe-read-tagged-type
   [rdr initch]
-  (let [tag  (read-symbol rdr initch)]
-    (if-let [pfn (get @*tag-table* (str tag))]
-      (pfn (read rdr true nil false))
-      (reader-error rdr
-                    "Could not find tag parser for " (str tag)
-                    " in " (pr-str (keys @*tag-table*))))))
+  (let [tag (read-symbol rdr initch)
+        pfn (get @*tag-table* (str tag))
+        dfn @*default-data-reader-fn*]
+    (cond
+     pfn (pfn (read rdr true nil false))
+     dfn (dfn tag (read rdr true nil false))
+     :else (reader-error rdr
+                         "Could not find tag parser for " (str tag)
+                         " in " (pr-str (keys @*tag-table*))))))

 (defn register-tag-parser!
   [tag f]
@@ -549,3 +555,15 @@
         old-parser (get @*tag-table* tag)]
     (swap! *tag-table* dissoc tag)
     old-parser))
+
+(defn register-default-tag-parser!
+  [f]
+  (let [old-parser @*default-data-reader-fn*]
+    (swap! *default-data-reader-fn* (fn [_] f))
+    old-parser))
+
+(defn deregister-default-tag-parser!
+  []
+  (let [old-parser @*default-data-reader-fn*]
+    (swap! *default-data-reader-fn* (fn [_] nil))
+    old-parser))


Remove comment with debug prn

Remove comment with debug prn

--- src/cljs/fatlip/core.cljs
+++ src/cljs/fatlip/core.cljs
@@ -489,6 +489,5 @@
                                   sparse-graph)
                                 (update-in [:layers 0] assoc :ordered seed-order)
                                 order-graph-once)]
-          ;; (println c (:crossings ordered-graph) (-> ordered-graph :layers peek :ordered))
           (recur (-> ordered-graph :layers peek :ordered)
                  (conj orderings (if reverse? (reverse-graph ordered-graph) ordered-graph))))))))


Set a default ttl on respond responses, and allow it to be overridden [IMMUTANT-210]

--- modules/messaging/src/main/clojure/immutant/messaging.clj
+++ modules/messaging/src/main/clojure/immutant/messaging.clj
@@ -248,13 +248,18 @@
   "Listen for messages on queue sent by the request function and
    respond with the result of applying f to the message. queue can
    either be the name of the queue, a javax.jms.Queue, or the result
-   of as-queue. Accepts the same options as listen."
-  [queue f & {:keys [decode?] :or {decode? true} :as opts}]
+   of as-queue. Accepts the same options as listen, along with [default]:
+
+     :ttl  time for the response mesage to live, in ms [60000, 1 minute]"
+  [queue f & {:keys [decode? ttl]
+              :or {decode? true, ttl 60000} ;; 1m
+              :as opts}]
   {:pre [(queue? queue)]}
   (letfn [(respond* [^javax.jms.Message msg]
             (publish (.getJMSDestination msg)
                      (f (codecs/decode-if decode? msg))
                      :correlation-id (.getJMSMessageID msg)
+                     :ttl ttl
                      :encoding (codecs/get-encoding msg)))]
     (mapply listen queue respond*
             (assoc (update-in opts [:selector]


Listen should return the group on success [IMMUTANT-156]

--- modules/messaging/src/main/clojure/immutant/messaging.clj
+++ modules/messaging/src/main/clojure/immutant/messaging.clj
@@ -142,9 +142,9 @@
     (if-let [izer (reg/fetch "message-processor-groupizer")]

       ;; in-container
-      (let [p (promise)
-            dest-name (destination-name name-or-dest)]
-        (.createGroup izer
+      (let [complete (promise)
+            dest-name (destination-name name-or-dest)
+            group (.createGroup izer
                       dest-name
                       false ;; TODO: singleton
                       concurrency
@@ -152,8 +152,9 @@
                       (.toString f)
                       connection
                       setup-fn
-                      #(deliver p true))
-        (when-not (deref p 5000 nil)
+                      #(deliver complete true))]
+        (if (deref complete 5000 nil)
+          group
           (log/error "Failed to setup listener for" dest-name)))

       ;; out of container


Fixed message-seq options and added some doc

--- modules/messaging/src/main/clojure/immutant/messaging.clj
+++ modules/messaging/src/main/clojure/immutant/messaging.clj
@@ -29,17 +29,15 @@
     (apply start-queue name opts)
     (apply start-topic name opts)))

-(defn stop
-  "Destroy a message destination. Typically not necessary since it
-  will be done for you when your app is undeployed. This will fail
-  with a warning if any handlers are listening"
-  [name]
-  (if (or (queue? name) (topic? name))
-    (stop-destination name)
-    (throw (Exception. "Illegal destination name"))))
+(defn publish
+  "Send a message to a destination

-(defn publish
-  "Send a message to a destination"
+   The following options are supported [default]:
+    :encoding     :clojure :json or :text [:clojure]
+    :priority     0-9 or :low :normal :high :critical [4]
+    :ttl          time to live, in ms [0=forever]
+    :persistent   whether undelivered messages survive restarts [true]
+    :properties   a hash to which selectors may be applied"
   [dest-name message & {:as opts}]
   (with-session (fn [session]
                   (let [destination (destination session dest-name)
@@ -50,7 +48,11 @@
                     (.send producer encoded delivery priority ttl)))))

 (defn receive
-  "Receive a message from a destination"
+  "Receive a message from a destination
+
+   The following options are supported [default]:
+    :timeout    time in ms, after which nil is returned [10000]
+    :selector   A JMS (SQL 92) expression matching message properties"
   [dest-name & {:keys [timeout selector]}]
   (with-session (fn [session]
                   (let [destination (destination session dest-name)
@@ -59,12 +61,15 @@
                     (and encoded (codecs/decode encoded))))))

 (defn message-seq
-  "A lazy sequence of messages received from a destination"
-  [dest-name]
-  (lazy-seq (cons (receive dest-name :timeout 0) (message-seq dest-name))))
+  "A lazy sequence of messages received from a destination. Accepts same options as receive"
+  [dest-name & opts]
+  (lazy-seq (cons (apply receive dest-name opts) (message-seq dest-name))))

 (defn listen
-  "The handler function, f, will receive any messages sent to dest-name."
+  "The handler function, f, will receive any messages sent to dest-name.
+
+   The following options are supported [default]:
+    :concurrency   the number of threads handling messages [1]"
   [dest-name f & {:keys [concurrency] :or {concurrency 1}}]
   (let [connection (.createConnection connection-factory)]
     (try
@@ -87,4 +92,14 @@
   only need to do this if you wish to stop the handler's destination
   before your app is undeployed"
   [listener]
-  (.close listener))+  (.close listener))
+
+(defn stop
+  "Destroy a message destination. Typically not necessary since it
+  will be done for you when your app is undeployed. This will fail
+  with a warning if any handlers are listening"
+  [name]
+  (if (or (queue? name) (topic? name))
+    (stop-destination name)
+    (throw (Exception. "Illegal destination name"))))
+


CMR-1340: Remove unused parameter

CMR-1340: Remove unused parameter

--- common-app-lib/src/cmr/common_app/api_docs.clj
+++ common-app-lib/src/cmr/common_app/api_docs.clj
@@ -87,7 +87,7 @@
                              :body (slurp (io/resource welcome-page-location))}))

     ;; Static HTML resources, typically API documentation which needs endpoint URLs replaced
-    (GET ["/site/:resource", :resource #".*\.html$"] {scheme :scheme headers :headers {resource :resource} :params}
+    (GET ["/site/:resource", :resource #".*\.html$"] {headers :headers {resource :resource} :params}
       (let [cmr-root (str public-protocol "://" (headers "host") relative-root-url)]
         {:status 200
          :body (-> (str "public/site/" resource)


Print debug output only in development mode

--- src/sweng_hw6_grader/tidbits.clj
+++ src/sweng_hw6_grader/tidbits.clj
@@ -27,7 +27,7 @@
                               :as :json
                               :headers user-agent} params)
            response (method full-url full-params)]
-       (pprint/pprint response)
+       (if (not (System/getenv "LEIN_NO_DEV")) (pprint/pprint response))
        response))))
 (def g (github-helper client/get))
 (def p (github-helper client/post))
@@ -81,7 +81,7 @@
                               :as :json
                               :headers user-agent} params)
            response (method full-url full-params)]
-       (pprint/pprint response)
+       (if (not (System/getenv "LEIN_NO_DEV")) (pprint/pprint response))
        response))))
 (def sg (sonar-helper client/get))
 (def sp (sonar-helper client/post))


Fix IngressBackendPort

Fix IngressBackendPort

--- src/puppeteer/domain/usecase/deploy.clj
+++ src/puppeteer/domain/usecase/deploy.clj
@@ -1,5 +1,6 @@
 (ns puppeteer.domain.usecase.deploy
-  (:import (io.fabric8.kubernetes.api.model.extensions IngressRule HTTPIngressRuleValue HTTPIngressPath IngressBackend))
+  (:import (io.fabric8.kubernetes.api.model IntOrString)
+           (io.fabric8.kubernetes.api.model.extensions IngressRule HTTPIngressRuleValue HTTPIngressPath IngressBackend))
   (:require [com.stuartsierra.component :as component]
             [flatland.ordered.map :refer [ordered-map]]
             [puppeteer.infra.repository.deploy :as deployrepo]))
@@ -79,7 +80,7 @@
                     [(HTTPIngressPath.
                        (IngressBackend.
                          service-name
-                         (int 80))
+                         (-> 80 int IntOrString.))
                        "/*")])))))))
     ingress))


Fix Cannot cast java.lang.Boolean to java.util.List

--- src/puppeteer/domain/usecase/deploy.clj
+++ src/puppeteer/domain/usecase/deploy.clj
@@ -69,19 +69,21 @@
                   (.setHosts tls
                     (if (some #(= % host) hosts)
                       hosts
-                      (.add hosts host)))))
+                      (doto hosts
+                        (.add host))))))
               tls))
           (.setRules
             (if (some #(= (:host %) host) rules)
               rules
-              (.add rules
-                (IngressRule. host
-                  (HTTPIngressRuleValue.
-                    [(HTTPIngressPath.
-                       (IngressBackend.
-                         service-name
-                         (-> 80 int IntOrString.))
-                       "/*")])))))))
+              (doto rules
+                (.add
+                  (IngressRule. host
+                    (HTTPIngressRuleValue.
+                      [(HTTPIngressPath.
+                         (IngressBackend.
+                           service-name
+                           (-> 80 int IntOrString.))
+                         "/*")]))))))))
     ingress))

 (defn apply


(PDB-3723) Clean up additional vestigial pre-jsonb facts bits

--- src/puppetlabs/puppetdb/scf/storage.clj
+++ src/puppetlabs/puppetdb/scf/storage.clj
@@ -977,96 +977,6 @@
       :stable
       str
       json/parse-string))
-
-(pls/defn-validated add-facts-jsonb
-  "Given a certname and a map of fact names to values, store records for those
-  facts associated with the certname."
-  ([fact-data] (add-facts-jsonb fact-data true))
-  ([{:keys [certname values environment timestamp producer_timestamp producer package_inventory]
-     :as fact-data} :- facts-schema
-    include-hash? :- s/Bool]
-   (jdbc/with-db-transaction []
-     (jdbc/insert! :factsets
-                   (merge
-                    {:certname certname
-                     :timestamp (to-timestamp timestamp)
-                     :environment_id (ensure-environment environment)
-                     :producer_timestamp (to-timestamp producer_timestamp)
-                     :producer_id (ensure-producer producer)
-                     :stable (sutils/munge-jsonb-for-storage values)
-                     :stable_hash (hash values)
-                     ;; need at least an empty map for the jsonb || operator
-                     :volatile (sutils/munge-jsonb-for-storage {})}
-                    (when include-hash?
-                      {:hash (sutils/munge-hash-for-storage
-                              (shash/fact-identity-hash fact-data))})))
-
-     (let [paths-and-valuemaps (facts/facts->paths-and-valuemaps values)
-           pathstrs (map (comp facts/factpath-to-string first) paths-and-valuemaps)]
-       (realize-paths! pathstrs))
-
-     (when (seq package_inventory)
-       (insert-packages certname package_inventory)))))
-
-(s/defn update-facts-jsonb
-  "Given a certname, querys the DB for existing facts for that
-   certname and will update, delete or insert the facts as necessary
-   to match the facts argument. (cf. add-facts!)"
-  [{:keys [certname values environment timestamp producer_timestamp producer package_inventory] :as fact-data}
-   :- facts-schema]
-  (jdbc/with-db-transaction []
-    (let [{:keys [package_hash certname_id factset_id stable_hash volatile_fact_names]}
-          (certname-factset-metadata certname)
-
-          ;; split facts into stable and volatile maps. Everything that was
-          ;; previously volatile stays that way. Any stable value that changes
-          ;; becomes volatile. Newly volatile facts are removed from the stable
-          ;; map.
-          current-volatile-fact-keys (volatile-fact-keys-for-factset factset_id)
-          incoming-volatile-facts (select-keys values current-volatile-fact-keys)
-          incoming-stable-facts (apply dissoc values current-volatile-fact-keys)
-          incoming-stable-fact-hash (hash incoming-stable-facts)
-          fact-json-updates (if (not= stable_hash incoming-stable-fact-hash)
-                              ;; stable facts are different; load the json and move the ones that
-                              ;; changed into volatile
-                              (let [current-stable-facts (load-stable-facts factset_id)
-                                    changed-facts (->> incoming-stable-facts
-                                                       (filter (fn [[fact new-value]]
-                                                                 (when-let [current (get current-stable-facts fact)]
-                                                                   (not= new-value current))))
-                                                       (into {}))
-                                    new-stable-facts (->> incoming-stable-facts
-                                                          (remove (fn [[fact _]] (get changed-facts fact)))
-                                                          (into {}))
-                                    new-volatile-facts (merge incoming-volatile-facts
-                                                              changed-facts)]
-                                {:stable (sutils/munge-jsonb-for-storage new-stable-facts)
-                                 :stable_hash (hash new-stable-facts)
-                                 :volatile (sutils/munge-jsonb-for-storage new-volatile-facts)})
-
-                              ;; no change to stable facts, so just update volatile
-                              {:volatile (sutils/munge-jsonb-for-storage incoming-volatile-facts)})]
-
-      (when (or package_hash (seq package_inventory))
-        (update-packages certname_id package_hash package_inventory))
-
-     (let [paths-and-valuemaps (facts/facts->paths-and-valuemaps values)
-           pathstrs (map (comp facts/factpath-to-string first) paths-and-valuemaps)]
-       (realize-paths! pathstrs))
-
-      (jdbc/update! :factsets
-                    (merge
-                     {:timestamp (to-timestamp timestamp)
-                      :environment_id (ensure-environment environment)
-                      :producer_timestamp (to-timestamp producer_timestamp)
-                      :hash (-> fact-data
-                                shash/fact-identity-hash
-                                sutils/munge-hash-for-storage)
-                      :producer_id (ensure-producer producer)}
-                     fact-json-updates)
-                    ["id=?" factset_id]))))
-
-;;; Classic Facts

 (def ps-chunksize 6000)

@@ -1437,9 +1347,6 @@
    received-timestamp :- pls/Timestamp]
   (add-report!* report received-timestamp true))

-(def ^:dynamic *orphaned-path-gc-limit* 200)
-(def ^:dynamic *orphaned-value-gc-limit* 200)
-
 (defn garbage-collect!
   "Delete any lingering, unassociated data in the database"
   [db]


(PDB-5548) Wait for bulldozer connection before dropping partitions

Have the bulldozer keep the same connection across all of its
attempts, and don't attempt to drop partitions during gc until the
bulldozer thread has obtained a connection to the database, so that it
has the full pg deadlock_timeout interval to clear the way.

cf. https://www.postgresql.org/docs/current/runtime-config-locks.html

--- src/puppetlabs/puppetdb/scf/storage.clj
+++ src/puppetlabs/puppetdb/scf/storage.clj
@@ -1558,7 +1558,7 @@
    until the bulldozer thread is interrupted or receives confirmation from the
    GC thread via the gc-finished? atom that the GC thread has dropped the
    partition."
-  [db gc-pid gc-finished?]
+  [db gc-pid connected gc-finished?]
   (let [bulldoze-blocking-qs
         (fn [gc-pid]
           (jdbc/query-to-vec
@@ -1571,16 +1571,20 @@
     (Thread.
      #(with-noisy-failure
         (try
-          ;; you can't use *db* value from the GC thread because the connection
-          ;; it has may already be blocked attempting to drop the partition.
-          ;; Binding *db* to the passed in db var will cause the bulldozer thread
-          ;; to get a new Hikari connection
-          (binding [jdbc/*db* db]
+          ;; The bulldozer must have its own connection so it can act
+          ;; independenly of the (potentially blocked) gc connection,
+          ;; i.e. (sql/db-find-connection db) should be false at this
+          ;; point.
+          (jdbc/with-db-connection db
+            (deliver connected true)
             (while (not @gc-finished?)
               (maybe-log-query-termination (bulldoze-blocking-qs gc-pid))
               (Thread/sleep 1000)))
           (catch InterruptedException _
-            true))))))
+            true)
+          (finally
+            (when-not (realized? connected)
+              (deliver connected false))))))))

 (def gc-query-bulldozer-timeout-ms
   (env-config-for-db-ulong "PDB_GC_QUERY_BULLDOZER_TIMEOUT_MS"
@@ -1594,11 +1598,15 @@
                      first
                      :pg_backend_pid)
           gc-finished? (atom false)
-          gc-bulldozer (query-bulldozer db gc-pid gc-finished?)]
+          bulldozer-connected (promise)
+          gc-bulldozer (query-bulldozer db gc-pid bulldozer-connected gc-finished?)]
       (try
         (.start gc-bulldozer)
-        (drop-one candidate)
+        (when @bulldozer-connected
+          (drop-one candidate))
         (finally
+          (when-not @bulldozer-connected
+            (log/error (trs "Partition GC bulldozer could not connect to the database")))
           (reset! gc-finished? true)
           ;; make sure the gc-bulldozer thread has broken out of its loop
           (.interrupt gc-bulldozer)


Log proxied requests

Log proxied requests

--- src/puppetlabs/ring_middleware/core.clj
+++ src/puppetlabs/ring_middleware/core.clj
@@ -1,6 +1,7 @@
 (ns puppetlabs.ring-middleware.core
   (:require [ring.middleware.cookies :refer [wrap-cookies]]
             [clojure.string :refer [join split]]
+            [clojure.tools.logging :as log]
             [puppetlabs.http.client.sync :refer [request]]
             [puppetlabs.ring-middleware.common :refer [prepare-cookies]])
   (:import (java.net URI)))
@@ -22,17 +23,19 @@
                                (str (.getPath uri)
                                     (subs (:uri req) (.length proxied-path)))
                                nil
-                               nil)]
-          (-> (merge {:method (:request-method req)
-                      :url (str remote-uri "?" (:query-string req))
-                      :headers (dissoc (:headers req) "host" "content-length")
-                      :body (let [body (slurp (:body req))]
-                              (if-not (empty? body)
-                                body
-                                nil))
-                      :as :stream
-                      :force-redirects true
-                      :decompress-body false} http-opts)
-              request
-              prepare-cookies))
+                               nil)
+              response (-> (merge {:method (:request-method req)
+                                   :url (str remote-uri "?" (:query-string req))
+                                   :headers (dissoc (:headers req) "host" "content-length")
+                                   :body (let [body (slurp (:body req))]
+                                           (if-not (empty? body)
+                                             body
+                                             nil))
+                                   :as :stream
+                                   :force-redirects true
+                                   :decompress-body false} http-opts)
+                           request
+                           prepare-cookies)]
+          (log/debug "Proxying request to" (:uri req) "to remote url" (str remote-uri) ". Remote server responded with status" (:status response))
+          response)
         (handler req)))))


Fetch can't handle Timespan form

Fetch can't handle Timespan form

--- src/wishlistd/views/wishlist.clj
+++ src/wishlistd/views/wishlist.clj
@@ -6,17 +6,24 @@
 (defn main-page []
   (common/new-layout))

+(defn dissoc-date [wl]
+  (dissoc wl :created_at))
+
 (defremote create-wishlist [wishlist]
-  (model/create-wishlist wishlist))
+  (dissoc-date
+    (model/create-wishlist wishlist)))

 (defremote update-wishlist [wishlist]
-  (model/update-wishlist wishlist))
+  (dissoc-date
+    (model/update-wishlist wishlist)))

-(defremote read-wishlist [code]
-  (model/read-wishlist code))
+(defremote read-wishlist [code] ; doesn't need dissoc date
+    (model/read-wishlist code))

 (defremote update-wish [wish]
-  (model/update-wish wish))
+  (dissoc-date
+    (model/update-wish wish)))

 (defremote delete-wish [id]
-  (model/delete-wish id))
+  (dissoc-date
+    (model/delete-wish id)))


use locals for worker starter

use locals for worker starter

--- worker/src/worker/worker.cljs
+++ worker/src/worker/worker.cljs
@@ -64,3 +64,8 @@

     (.postMessage w nil)
     ))
+(defn do-some [wrk]
+  (let [a (worker-body (full-func-name wrk))
+        b (js/Blob. (clj->js [a]))
+        w (js/Worker. (.createObjectURL js/URL b))]
+    (.postMessage w nil)))


In depth docstring for syllabize fn

In depth docstring for syllabize fn

--- src/hangul_utils/core.clj
+++ src/hangul_utils/core.clj
@@ -78,7 +78,16 @@
   (apply str (flatten (deconstruct-str s))))

 (defn syllabize
-  "Takes a string of Korean alphabets, and reconstructs Korean text."
+  "Takes a string of Korean alphabets, and reconstructs Korean text. The initial
+  value for the reduce fn is a vector containing the accumulated result, the
+  current syllable under consideration, and the most recent consonant in
+  limbo (to be classified as initial or final).
+
+  Each new char read in from the input string is either added to the current
+  syllable vector or sent into limbo, and can trigger the syllable to be conj'd
+  onto the accumulator once it's fully constructed.
+
+  The cond branches could use more cleanup."
   [s]
   (let [[acc syl limbo]
         (reduce


Build travis

Build travis

--- backend/src/akvo/lumen/component/flow.clj
+++ backend/src/akvo/lumen/component/flow.clj
@@ -26,6 +26,7 @@
   {"Authorization" (format "Bearer %s" token)
    "User-Agent" "lumen"
    "Accept" "application/vnd.akvo.flow.v2+json"})
+

 (defn check-permissions
   [flow-api token body]


Allow parameterizing the ClojureScript version

--- planck-cljs/project.clj
+++ planck-cljs/project.clj
@@ -1,6 +1,6 @@
 (defproject planck "0.1.0"
   :profiles {:dev
-             {:dependencies [[org.clojure/clojurescript "1.9.660"]
+             {:dependencies [[org.clojure/clojurescript ~(or (System/getenv "CLOJURESCRIPT_VERSION") "1.9.660")]
                              [org.clojure/test.check "0.10.0-alpha1"]
                              [tubular "1.0.0"]]
               :source-paths ["dev"]}
@@ -9,7 +9,7 @@
              :build-commit
              {}}
   :dependencies [[org.clojure/clojure "1.8.0"]
-                 [org.clojure/clojurescript "1.9.660"]
+                 [org.clojure/clojurescript ~(or (System/getenv "CLOJURESCRIPT_VERSION") "1.9.660")]
                  [org.clojure/test.check "0.10.0-alpha1"]
                  [org.clojure/tools.reader "1.0.0"]
                  [com.cognitect/transit-clj "0.8.300"]


fix #600

fix #600

--- src/status_im/components/main_tabs.cljs
+++ src/status_im/components/main_tabs.cljs
@@ -71,23 +71,28 @@
         n (get-tab-index view-id)]
     (- n p)))

-(defn on-scroll-end [swiped? dragging? scroll-ended]
+(defonce scrolling? (atom false))
+
+(defn on-scroll-end [swiped? scroll-ended view-id]
   (fn [_ state]
-    (a/put! scroll-ended true)
-    (when @dragging?
-      (reset! dragging? false)
-      (let [{:strs [index]} (js->clj state)]
+    (when @scrolling?
+      (a/put! scroll-ended true))
+    (let [{:strs [index]} (js->clj state)
+          new-view-id (index->tab index)]
+      (when-not (= view-id new-view-id)
         (reset! swiped? true)
-        (dispatch [:navigate-to-tab (index->tab index)])))))
+        (dispatch [:navigate-to-tab new-view-id])))))

 (defn start-scrolling-loop
   "Loop that synchronizes tabs scrolling to avoid an inconsistent state."
   [scroll-start scroll-ended]
   (am/go-loop [[swiper to] (a/<! scroll-start)]
     ;; start scrolling
+    (reset! scrolling? true)
     (.scrollBy swiper to)
     ;; lock loop until scroll ends
-    (a/<! scroll-ended)
+    (a/alts! [scroll-ended (a/timeout 2000)])
+    (reset! scrolling? false)
     (recur (a/<! scroll-start))))

 (defn main-tabs []
@@ -95,7 +100,6 @@
         prev-view-id (subscribe [:get :prev-view-id])
         main-swiper  (r/atom nil)
         swiped?      (r/atom false)
-        dragging?    (r/atom false)
         scroll-start (a/chan 10)
         scroll-ended (a/chan 10)]
     (r/create-class
@@ -120,8 +124,7 @@
                        {:index                  (get-tab-index @view-id)
                         :loop                   false
                         :ref                    #(reset! main-swiper %)
-                        :onScrollBeginDrag      #(reset! dragging? true)
-                        :on-momentum-scroll-end (on-scroll-end swiped? dragging? scroll-ended)})
+                        :on-momentum-scroll-end (on-scroll-end swiped? scroll-ended @view-id)})
               [chats-list]
               [discover (= @view-id :discover)]
               [contact-list (= @view-id :contact-list)]]


Quick follow-up.

Quick follow-up.

Condense test-merge-env-2.  I'm still getting the hang of this Clojure deal.

--- src/test/clj/com/climate/shell_test.clj
+++ src/test/clj/com/climate/shell_test.clj
@@ -39,17 +39,15 @@
                   :env (merge-env {:FOO "bar"}))))))

 (deftest test-merge-env-2
-  (is (let [java-home (get (System/getenv) "JAVA_HOME")]
-        (and
-          (not-empty java-home)
-          (.startsWith
-            (:out (sh "java" "-cp" (clj-main-jar) "clojure.main" "-e"
-                  "(vector
-                     (get (System/getenv) \"JAVA_HOME\")
-                     (get (System/getenv) \"FOO\"))"
-                  :err :pass
-                  :env (merge-env {:FOO "bar"})))
-            (str "[" (pr-str java-home) " \"bar\"]"))))))
+  (is (when-let [java-home (not-empty (get (System/getenv) "JAVA_HOME"))]
+        (.startsWith
+          (:out (sh "java" "-cp" (clj-main-jar) "clojure.main" "-e"
+                "(vector
+                   (get (System/getenv) \"JAVA_HOME\")
+                   (get (System/getenv) \"FOO\"))"
+                :err :pass
+                :env (merge-env {:FOO "bar"})))
+          (str "[" (pr-str java-home) " \"bar\"]")))))

 (deftest test-sh-with-files
   (let [txt "some test text"


update version and release

update version and release

--- kafka-clj/project.clj
+++ kafka-clj/project.clj
@@ -1,4 +1,4 @@
-(defproject kafka-clj "2.4.1-SNAPSHOT"
+(defproject kafka-clj "2.4.1"
   :description "fast kafka library implemented in clojure"
   :url "https://github.com/gerritjvv/kafka-fast"
   :license {:name "Eclipse Public License"
@@ -27,7 +27,7 @@
                  [org.clojure/tools.trace "0.7.6"]
                  [org.xerial.snappy/snappy-java "1.1.1-M1"]
                  [org.clojure/tools.logging "0.3.0"]
-                 [clj-tcp "0.4.2-SNAPSHOT"]
+                 [clj-tcp "0.4.2"]
                  [fmap-clojure "LATEST" :exclusions [org.clojure/tools.logging]]
                  [fun-utils "LATEST" :exclusions [org.clojure/tools.logging]]
                  [clj-tuple "0.1.6"]


Fix upsert query

Fix upsert query

--- src/karmanaut/crawler.clj
+++ src/karmanaut/crawler.clj
@@ -23,14 +23,14 @@
         secs (utils/seconds-since-midnight (utils/utcnow))
         stats {(str "link_karma." secs) (:link-karma user-map),
                (str "comment_karma." secs) (:comment-karma user-map)}]
-    {:user (:username user-map),
-     :timestamp mn,
-     "$set" stats}))
+    {"$set" stats}))
+
+(defn create-query-document [user-map]
+  {:user (:username user-map),
+   :timestamp (utils/midnight (utils/utcnow))})

 (defn create-sample! [user-map]
-  (let [q {:user (:username user-map),
-           :timestamp (utils/midnight (utils/utcnow))}]
-    (mc/upsert db/db "samples" q (create-sample-document user-map) {:upsert true})))
+  (mc/upsert db/db "samples" (create-query-document user-map) (create-sample-document user-map) {:upsert true}))

 (defn insert-samples! [user-maps]
   (dorun (map create-sample! user-maps)))


Fix Issue #1

Fix Issue #1

--- src/leiningen/ancient.clj
+++ src/leiningen/ancient.clj
@@ -149,7 +149,7 @@
         (when-let [latest (latest-version mta)]
           (when (version-outdated? version latest)
             (println
-              (str "[" (:dependency-str dep) " \"" (:version-str version) "\"]")
+              (str "[" (:dependency-str dep) " \"" (:version-str latest) "\"]")
               "is available but we use"
               (str "\"" (:version-str version) "\""))))))))


Let 'lein control show' includes addresses in cluster

--- src/leiningen/control.clj
+++ src/leiningen/control.clj
@@ -1,7 +1,7 @@
 (ns leiningen.control
   (:use [control.core :only [do-begin clusters]]
-           [leiningen.help :only [help-for]]
-           [clojure.java.io :only [file]]))
+        [leiningen.help :only [help-for]]
+        [clojure.java.io :only [file]]))

 (defn- get-config [project key]
   (get-in project [:control key]))
@@ -15,10 +15,10 @@
       (refer-clojure)
       (use '[control core commands])
       (load-file
-        (or
-          (get-config project :control-file)
-          "./control.clj")))
-  (catch java.io.FileNotFoundException e (println "control file not found."))))
+       (or
+        (get-config project :control-file)
+        "./control.clj")))
+    (catch java.io.FileNotFoundException e (println "control file not found."))))

 (defn- run-control [project args]
   (do
@@ -31,15 +31,15 @@
   (let [control-file (file "." "control.clj")]
     (if-not (.exists control-file)
       (spit control-file
-        (str
-          "(defcluster :default-cluster\n"
-          "  :clients [\n"
-          "    {:host \"localhost\" :user \"root\"}\n"
-          "  ])\n"
-          "\n"
-          "(deftask :date \"echo date on cluster\""
-          "  []\n"
-          "  (ssh \"date\"))\n")))))
+            (str
+             "(defcluster :default-cluster\n"
+             "  :clients [\n"
+             "    {:host \"localhost\" :user \"root\"}\n"
+             "  ])\n"
+             "\n"
+             "(deftask :date \"echo date on cluster\""
+             "  []\n"
+             "  (ssh \"date\"))\n")))))

 (defn run
   "Run user-defined clojure-control tasks against certain cluster"
@@ -53,20 +53,22 @@
     (load-control-file project)
     (if-let [cluster-name (first args)]
       (doseq
-        [c (:clients ((keyword cluster-name) @clusters))]
-        (println (str (:user c) "@" (:host c)))))))
+          [c (:clients ((keyword cluster-name) @clusters))
+           a (:addresses ((keyword cluster-name) @clusters))]
+        (println (str (:user c) "@" (:host c)))
+        (println (str (:user @clusters) "@" a))))))

 (defn control
   "Leiningen plugin for Clojure-Control"
   {:help-arglists '([subtask [cluster task [args...]]])
    :subtasks [#'init #'run #'show]}
   ([project]
-    (println (help-for "control")))
+     (println (help-for "control")))
   ([project subtask & args]
-    (case subtask
-      "init" (apply init project args)
-      "run" (apply run project args)
-      "show" (apply show project args)
-      (println (help-for "control")))))
+     (case subtask
+           "init" (apply init project args)
+           "run" (apply run project args)
+           "show" (apply show project args)
+           (println (help-for "control")))))


added degrees and radians

added degrees and radians


adding player dots

adding player dots

--- cartagena-web/src/cartagena_web/core.cljs
+++ cartagena-web/src/cartagena_web/core.cljs
@@ -17,11 +17,11 @@
    [:h1 "CARTAGENA"
     [:div
      [:svg
-      {:view-box "0 0 1000 800"
+      {:view-box "0 0 1000 750"
        :width 1000
-       :height 800}
+       :height 750}
       ;; play mat
-      [:rect {:x 0 :y 0 :width 1000 :height 800 :stroke "black" :stroke-width "1" :fill "tan"}]
+      [:rect {:x 0 :y 0 :width 1000 :height 750 :stroke "black" :stroke-width "1" :fill "tan"}]

       ;; board
       [:rect {:x 0 :y 0 :width (to-scale 500) :height (to-scale 400) :stroke "black" :stroke-width "0.5" :fill "burlywood"}]
@@ -30,21 +30,44 @@
       [:rect {:x 0 :y 0 :width (to-scale 50) :height (to-scale 90) :stroke "black" :fill "darkgray"}]
       [:text {:x 0 :y (to-scale 15) :style {:text-anchor "start" :stroke "none" :fill "black" :font-size "smaller"}} "jail"]

+      ;; players in jail
+      [:circle {:cx (to-scale 5) :cy (to-scale 35) :r (to-scale 4) :fill "orange"}]
+      [:circle {:cx (to-scale 5) :cy (to-scale 45) :r (to-scale 4) :fill "orange"}]
+      [:circle {:cx (to-scale 15) :cy (to-scale 35) :r (to-scale 4) :fill "green"}]
+      [:circle {:cx (to-scale 15) :cy (to-scale 45) :r (to-scale 4) :fill "green"}]
+      [:circle {:cx (to-scale 15) :cy (to-scale 55) :r (to-scale 4) :fill "green"}]
+      [:circle {:cx (to-scale 15) :cy (to-scale 65) :r (to-scale 4) :fill "green"}]
+      [:circle {:cx (to-scale 15) :cy (to-scale 75) :r (to-scale 4) :fill "green"}]
+      [:circle {:cx (to-scale 15) :cy (to-scale 85) :r (to-scale 4) :fill "green"}]
+      [:circle {:cx (to-scale 25) :cy (to-scale 35) :r (to-scale 4) :fill "black"}]
+      [:circle {:cx (to-scale 25) :cy (to-scale 45) :r (to-scale 4) :fill "black"}]
+      [:circle {:cx (to-scale 25) :cy (to-scale 55) :r (to-scale 4) :fill "black"}]
+      [:circle {:cx (to-scale 25) :cy (to-scale 65) :r (to-scale 4) :fill "black"}]
+
+
       ;; space 1: bottle
       [:rect {:x (to-scale 50) :y (to-scale 60) :width (to-scale 40) :height (to-scale 30) :stroke "black" :stroke-width "0.5" :fill "lightgray"}]
       [:text {:x (to-scale 50) :y (to-scale 75) :style {:text-anchor "start" :stroke "none" :fill "black" :font-size "small"}} "bottle"]

+
       ;; space 2: gun
       [:rect {:x (to-scale 90) :y (to-scale 60) :width (to-scale 40) :height (to-scale 30) :stroke "black" :stroke-width "0.5" :fill "lightgray"}]
       [:text {:x (to-scale 90) :y (to-scale 75) :style {:text-anchor "start" :stroke "none" :fill "black" :font-size "small"}} "gun"]
+      [:circle {:cx (to-scale 85) :cy (to-scale 65) :r (to-scale 4) :fill "orange"}]
+      [:circle {:cx (to-scale 85) :cy (to-scale 75) :r (to-scale 4) :fill "black"}]

       ;; space 3: hat
       [:rect {:x (to-scale 130) :y (to-scale 60) :width (to-scale 40) :height (to-scale 30) :stroke "black" :stroke-width "0.5" :fill "lightgray"}]
       [:text {:x (to-scale 130) :y (to-scale 75) :style {:text-anchor "start" :stroke "none" :fill "black" :font-size "small"}} "hat"]
+      [:circle {:cx (to-scale 125) :cy (to-scale 65) :r (to-scale 4) :fill "orange"}]

       ;; space 4: key
       [:rect {:x (to-scale 170) :y (to-scale 60) :width (to-scale 40) :height (to-scale 30) :stroke "black" :stroke-width "0.5" :fill "lightgray"}]
       [:text {:x (to-scale 170) :y (to-scale 75) :style {:text-anchor "start" :stroke "none" :fill "black" :font-size "small"}} "key"]
+      [:circle {:cx (to-scale 165) :cy (to-scale 65) :r (to-scale 4) :fill "orange"}]
+      [:circle {:cx (to-scale 165) :cy (to-scale 75) :r (to-scale 4) :fill "orange"}]
+      [:circle {:cx (to-scale 165) :cy (to-scale 85) :r (to-scale 4) :fill "black"}]
+

       ;; space 5: knife
       [:rect {:x (to-scale 210) :y (to-scale 60) :width (to-scale 40) :height (to-scale 30) :stroke "black" :stroke-width "0.5" :fill "lightgray"}]


use hard-coded atom for now, replace text with images

--- cartagena-web/src/cartagena_web/main.cljs
+++ cartagena-web/src/cartagena_web/main.cljs
@@ -142,23 +142,30 @@
                          :discard-pile []}
   )

-(defonce app-state (atom nil))
+(defonce app-state (atom initial-game-state))

 (defn to-scale [n]
-  (* 1.5 n))
+  (* 1.8 n))
+
+(def icon-images {:jail "img/jail.png"
+                  :ship "img/ship.png"
+                  :bottle "img/bottle.png"
+                  :gun "img/gun.jpg"
+                  :hat "img/hat.png"
+                  :key "img/key.png"
+                  :knife "img/knife.png"
+                  :skull "img/skull.png"})

 (defn static-board []
   [;; board
    [:rect {:x 0 :y 0 :width (to-scale 500) :height (to-scale 300) :stroke "black" :stroke-width "0.5" :fill "burlywood"}]
    ;; jail
    [:rect {:x 0 :y 0 :width (to-scale 50) :height (to-scale 90) :stroke "black" :fill "darkgray"}]
-   [:g {:dangerouslySetInnerHTML {:__html "<image xlink:href=\"img/jail.png\" x=0 y=0 height=\"50px\" width=\"50px\" />"}}]
+   [:g {:dangerouslySetInnerHTML {:__html (str "<image xlink:href=\"img/jail.png\" x=0 y=0 width=\"" (to-scale 30) "\" height=\"" (to-scale 30) "\" />")}}]
    ;; ship
    [:rect {:x (to-scale 400) :y (to-scale 240) :width (to-scale 90) :height (to-scale 50) :stroke "black" :fill "sienna"}]
-   [:text {:x (to-scale 400) :y (to-scale 255) :style {:text-anchor "start" :stroke "none" :fill "black" :font-size "smaller"}} "ship"]
+   [:g {:dangerouslySetInnerHTML {:__html (str "<image xlink:href=\"img/ship.png\" x=\"" (to-scale 400) "\" y=\"" (to-scale 240) "\" width=\"" (to-scale 30) "\" height=\"" (to-scale 30) "\" />")}}]
    ])
-
-

 (def piece-positions
   [
@@ -241,8 +248,9 @@
 (defn normal-space [x y]
   [:rect {:x (to-scale x) :y (to-scale y) :width (to-scale 40) :height (to-scale 30) :stroke "black" :stroke-width "0.5" :fill "lightgray"}])

-(defn space-text [x y s]
-  [:text {:x (to-scale x) :y (to-scale y) :style {:text-anchor "start" :stroke "none" :fill "black" :font-size "small"}} s])
+(defn space-image [x y icon]
+  [:g {:dangerouslySetInnerHTML {:__html (str "<image xlink:href=\"" (icon icon-images) "\" x=\"" (to-scale x) "\" y=\"" (to-scale y) "\" width=\"" (to-scale 30) "\" height=\"" (to-scale 30) "\" />")}}]
+  )

 (defn normal-spaces []
   (apply concat
@@ -250,8 +258,8 @@
            (when-let [space-data (get-in @app-state [:board i])]
              (let [position (get piece-positions i)
                    space (normal-space (:x position) (:y position))
-                   text (space-text (:text-x position) (:text-y position) (name (:icon space-data)))]
-               [space text]
+                   image (space-image (:x position) (:y position) (:icon space-data))]
+               [space image]
                )))))

 (defn main-view []
@@ -285,7 +293,6 @@

 (defn ^:export main []
   (when-let [app (. js/document (getElementById "app"))]
-    (new-game!)
     (reagent/render-component [main-view] app)))

 (main)


Upgrade day8/lein-git-inject to 0.0.14

Upgrade day8/lein-git-inject to 0.0.14

--- examples/todomvc/project.clj
+++ examples/todomvc/project.clj
@@ -11,7 +11,7 @@
                  [day8.re-frame/re-frame-10x "0.6.0"]
                  [secretary "1.2.3"]]

-  :plugins      [[day8/lein-git-inject "0.0.6"]
+  :plugins      [[day8/lein-git-inject "0.0.14"]
                  [lein-shadow          "0.1.6"]]

   :middleware   [leiningen.git-inject/middleware]


core.async: Add note about dealing with closed channels.

--- test/com/nomistech/clojure_the_language/core_async_101_basics.clj
+++ test/com/nomistech/clojure_the_language/core_async_101_basics.clj
@@ -206,3 +206,11 @@
   ;; Use `sliding-buffer` to drop oldest values when the buffer is full:
   (chan (sliding-buffer 10))
   )
+
+;;;; ___________________________________________________________________________
+;;;; Dealing with closed channels
+
+(comment
+  ;; Use this pattern when taking from a possibly-closed channel:
+  (when-let [v (a/<! c)]
+    ... v ...))


update self-trashing ICE to only adjust run position if being encountered

prevents a bug when Corp fires subroutine of self-trashing ICE after Runner has already passed it

--- src/clj/game/cards-ice.clj
+++ src/clj/game/cards-ice.clj
@@ -190,8 +190,9 @@
    "Data Mine"
    {:abilities [{:msg "do 1 net damage"
                  :effect (req (damage state :runner :net 1 {:card card})
-                              (trash state side card)
-                              (trash-ice-in-run state))}]}
+                              (when (= current-ice card)
+                                (trash-ice-in-run state))
+                              (trash state side card))}]}

    "Datapike"
    {:abilities [{:msg "force the Runner to pay 2 [Credits] if able"
@@ -402,8 +403,9 @@
    "Its a Trap!"
    {:expose {:msg "do 2 net damage" :effect (effect (damage :net 2 {:card card}))}
     :abilities [(assoc trash-installed :effect (req (trash state side target {:cause :subroutine})
-                                                    (trash state side card)
-                                                    (trash-ice-in-run state)))]}
+                                                    (when (= current-ice card)
+                                                      (trash-ice-in-run state))
+                                                    (trash state side card)))]}

    "Janus 1.0"
    {:abilities [{:msg "do 1 brain damage" :effect (effect (damage :brain 1 {:card card}))}]}
@@ -423,8 +425,9 @@
                                       :player :runner
                                       :msg (msg "force the Runner to trash " (:title target))
                                       :effect (req (trash state side target)
-                                                   (trash state side card)
-                                                   (trash-ice-in-run state)))]}
+                                                   (when (= current-ice card)
+                                                     (trash-ice-in-run state))
+                                                   (trash state side card)))]}

    "Lancelot"
    {:abilities [trash-program
@@ -698,8 +701,9 @@
    "Special Offer"
    {:abilities [{:label "Gain 5 [Credits] and trash Special Offer"
                  :effect (req (gain state :corp :credit 5)
+                              (when (= current-ice card)
+                                (trash-ice-in-run state))
                               (trash state side card)
-                              (trash-ice-in-run state)
                               (system-msg state side (str "gains 5 [Credits] and trashes Special Offer")))}]}

    "Spiderweb"
@@ -830,8 +834,9 @@
                                          (> (count (concat (:ices (card->server state card))
                                                            (:content (card->server state card)))) 1))
                                 (prevent-jack-out state side))
-                              (trash state side card)
-                              (trash-ice-in-run state))}]}
+                              (when (= current-ice card)
+                                (trash-ice-in-run state))
+                              (trash state side card))}]}

    "Woodcutter"
    {:advanceable :while-rezzed


Basic websocket and ring handler implementation has been done, close #23, #10

--- src/clj/hellhound/http.clj
+++ src/clj/hellhound/http.clj
@@ -8,6 +8,11 @@
    [hellhound.http.websocket :as ws]
    [hellhound.http.handlers  :as handlers]))

+;; hellhound.http.route shortcuts --------------------------
+(def router route/router)
+(def expand-routes route/expand-routes)
+
+;; The default routes for a hellhound application.
 (def default-routes
   (route/router
    (route/expand-routes
@@ -18,3 +23,6 @@
       [(hh/get-config :http :websocket-endpoint)
        :get
        (ws/interceptor-factory)]})))
+
+;; hellhound.http.websocket shortcuts ----------------------
+(def ws-interceptors (ws/interceptor-factory))


Actually save/load the slot

Actually save/load the slot

--- src/clj/schedule/types.clj
+++ src/clj/schedule/types.clj
@@ -8,6 +8,13 @@
    [org.optaplanner.core.api.score.buildin.hardsoft HardSoftScore]
    [schedule HardSoftSolution]
    [java.util ArrayList]))
+
+(defn- getValue [this k]
+  (let [state (.state this)] (.get @state k)))
+
+(defn- setValue [this k v]
+  (let [state (.state this)]
+    (dosync (alter state assoc k v)) v))

 (gen-class
  :name ^{PlanningSolution {}} schedule.types.ScheduleSolution
@@ -27,13 +34,6 @@
 (defn solution-getProblemFacts [this]
   (ArrayList.))

-(defn- getValue [this k]
-  (let [state (.state this)] (.get @state k)))
-
-(defn- setValue [this k v]
-  (let [state (.state this)]
-    (dosync (alter state assoc k v)) v))
-
 (defn solution-setScore [this score]
   (setValue this :score score))

@@ -46,8 +46,16 @@
 (gen-class
  :name ^{PlanningEntity {}} schedule.types.Event
  :prefix "event-"
+ :init init
+ :state state
  :methods [[^{PlanningVariable {"valueRangeProviderRefs" ["slotRange"]}} getSlot [] Object]
            [setSlot [Object] void]])

+(defn event-init []
+  [[] (ref {})])
+
 (defn event-getSlot [this]
-  nil)+  (getValue this :slot))
+
+(defn event-setSlot [this item]
+  (setValue this :slot item))


Formatting

Formatting

--- src/cljs/cglossa/core.cljs
+++ src/cljs/cglossa/core.cljs
@@ -10,16 +10,16 @@

 (def state {:showing-results? false
             :showing-sidebar? false
-            :search-view :simple
-            :search-queries [{:query "[word=\"han\" %c] [word=\"er\" %c]"}
-                             {:query "[word=\"de\" %c] [word=\"sa\" %c]"}]})
+            :search-view      :simple
+            :search-queries   [{:query "[word=\"han\" %c] [word=\"er\" %c]"}
+                               {:query "[word=\"de\" %c] [word=\"sa\" %c]"}]})

-(def data {:corpus {:name "Leksikografisk bokmålskorpus"
-                    :code "bokmal"
+(def data {:corpus {:name     "Leksikografisk bokmålskorpus"
+                    :code     "bokmal"
                     :encoding "iso-8859-1"
-                    :logo "book-clip-art-3.png"
-                    :langs [{:lang   :no
-                             :tagger :obt_bm_lbk}]}})
+                    :logo     "book-clip-art-3.png"
+                    :langs    [{:lang   :no
+                                :tagger :obt_bm_lbk}]}})

 (defonce app-state (into {} (map-vals atom state)))
 (defonce app-data (into {} (map-vals atom data)))


word-map, fix subset bug

word-map, fix subset bug

--- src/cljs/unfolds/core.cljs
+++ src/cljs/unfolds/core.cljs
@@ -1,6 +1,7 @@
 (ns unfolds.core
   (:require-macros [cljs.core.async.macros :refer [go]])
-  (:require [om.core :as om :include-macros true]
+  (:require [clojure.set :refer [union]]
+            [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
             [cljs.core.async :refer [put! chan <!]]))

@@ -104,19 +105,31 @@
 ;; before items looked like this
 ;; :items [{:id "foo" :text "bar"}] ;; dammit!

+;; util fn
+(defn in?
+  "true if seq contains elm"
+  [seq elm]
+  (some #(= elm %) seq))
+
 (def id-atom (atom -1))
 (swap! id-atom inc) ;; first item, 0
 (swap! id-atom inc) ;; second item, 1
 (swap! id-atom inc) ;; third item, 2

+;; Let's just start with all the words. Leaving freqs in.
+(defn make-word-map [[id str]]
+  (zipmap (map first
+               (frequencies (split-words str)))
+          (repeat [id])))
+
 (defn add-item [app owner]
   (let [new-item-text (-> (om/get-node owner "new-item")
                      .-value)
-        new-item {:id (swap! id-atom inc) :text new-item-text}]
+        new-item [(swap! id-atom inc) new-item-text]]
     (when new-item
+      (om/transact! app :word-map #(merge-with union % (make-word-map new-item)))
       (om/transact! app :items #(conj % new-item)))))
-;; Do this when adding
-;;(str (naive-key-extractor item) ", ")
+

 (defn search [app owner]
   (let [search (-> (om/get-node owner "search")
@@ -158,17 +171,22 @@
 ;; now with basic-list! (or not, does that help here - more like remove those?)
 ;; and go to lower-case?
 ;; should also have id in it
-(defn naive-key-extractor [str]
+
+;; This is a problem: right now it measures rareness based on its own
+;; note, rather than compared to the universe. You filter out lame
+;; words, but also words like 'English' in an article about Basic
+;; English.
+#_(defn naive-key-extractor [str]
     (vec (map first
               (filter #(= (second %) 1)
                       (frequencies (split-words (:text str)))))))

-(defn make-word-map [str id]
-  (zipmap (map first
-               (filter #(= (second %) 1)
-                       (frequencies (split-words str)))) (repeat id)))
-;; then merge
-;; should be elsewhere?
+#_(defn get-words [item]
+  (vec (map first
+            (frequencies (split-words (second item))))))
+
+
+;;(merge-with union wm1 wm2)

 #_(defn item-view [item owner]
   (reify
@@ -210,7 +228,7 @@
                (apply dom/ul nil
                       (om/build-all visible-item-view
                                     ;; into vec?
-                                    (filter (fn [[i _]] (contains? (:visible app) i)) (:items app))))))))
+                                    (filter (fn [[i _]] (in? (:visible app) i)) (:items app))))))))

 (defn main []
   (om/root app-view


Prettier button

Prettier button

--- src/lolitemsets/core.cljs
+++ src/lolitemsets/core.cljs
@@ -88,8 +88,8 @@
              :value (key @app)
              :on-change #(swap! app assoc key (int (-> % .-target .-value)))}]]])

-(defn needlesly-large-button []
-  [:button {:on-click recommend} "Recommend"])
+(defn needlessly-large-button []
+  [:button.btn.btn-info {:on-click recommend} "Generate build"])

 (defn app-component []
   [:div.container
@@ -103,7 +103,7 @@
     [objective-checkbox "Effective Health (AD)" algo/build-hp-ad] [:br]
     [number-selector "Champion level" :champ-level 18 1]
     [number-selector "Number of items" :num-items 6 1] [:br]
-    [needlesly-large-button] [:br]]
+    [needlessly-large-button] [:br]]
    [:div.container.col-sm-6 [item-recommendation]]])

 (reagent/render-component [app-component]


Fix number selector

Fix number selector

--- src/lolitemsets/core.cljs
+++ src/lolitemsets/core.cljs
@@ -326,7 +326,7 @@
                           :when optimizable]
                       [objective-checkbox (:props state) name calc]))
        [number-selector (:champ-level state) "Champion level" :champ-level 18 1]
-       [number-selector (:champ-level state) "Number of items" :num-items 6 1] [:br]
+       [number-selector (:num-items state) "Number of items" :num-items 6 1] [:br]
        [:div.btn-group.btn-group-justified.visible-lg-block
         [button-of-command (:generating state)] ; generate
         [dorans-button (:trolling state)] ; troll


print dereferenced metrics every so often

--- Clojure-Websockets/MainApp/src/clj/birdwatch/metrics/component.clj
+++ Clojure-Websockets/MainApp/src/clj/birdwatch/metrics/component.clj
@@ -2,28 +2,44 @@
   (:gen-class)
   (:require
    [metrics.core :refer [new-registry]]
-   [metrics.meters :refer [meter]]
+   [metrics.meters :refer [meter mark! rates]]
    [clojure.core.match :as match :refer (match)]
    [clojure.pprint :as pp]
    [clojure.tools.logging :as log]
    [com.stuartsierra.component :as component]
-   [clojure.core.async :as async :refer [chan go-loop <! put!]]))
+   [clojure.core.async :as async :refer [chan go-loop <! put! timeout]]))
+
+(defn get-rates
+  "Returns map with the actual rates stored in  metrics-map."
+  [metrics-map]
+  (into {} (for [[k v] @metrics-map] [k (rates v)])))
+
+(defn print-metrics-loop
+  "Print dereferenced metrics with current rates."
+  [metrics-map]
+  (go-loop [] (<! (timeout 10000))
+           (pp/pprint (get-rates metrics-map))
+           (recur)))

 (defn metrics-loop
   "run loop, call f with message on channel"
-  [metrics-chan reg]
+  [metrics-chan reg metrics-map-atom]
   (go-loop []
-           (let [[ev-type ev] (<! metrics-chan)]
-             (pp/pprint ev-type))
-           (recur)))
+           (let [[ev-type ev] (<! metrics-chan)
+                 ev-type-name (name ev-type)]
+             (when-not (contains? @metrics-map-atom ev-type)
+               (swap! metrics-map-atom conj [ev-type (meter reg ev-type-name)]))
+             (mark! (meter reg ev-type-name))
+           (recur))))

 (defrecord Metrics [channels chsk-router]
   component/Lifecycle
   (start [component] (log/info "Starting Metrics Component")
          (let [reg (new-registry)
-               redis-received (meter reg "redis-received")
+               metrics-map-atom (atom {})
                metrics-chan (:events channels)]
-           (metrics-loop metrics-chan reg)
+           (metrics-loop metrics-chan reg metrics-map-atom)
+           (print-metrics-loop metrics-map-atom)
            (assoc component :registry reg)))
   (stop [component] (log/info "Stopping Metrics Component")
         (assoc component :registry nil)))


add support for :fingerprint compiler option (#737)

--- sidecar/src/figwheel_sidecar/schemas/cljs_options.clj
+++ sidecar/src/figwheel_sidecar/schemas/cljs_options.clj
@@ -670,6 +670,13 @@
 This setting does not apply if :optimizations is set to :advanced.

   :checked-arrays :warn")
+
+(def-key ::fingerprint boolean?
+  "Append content SHA to output file names.
+A manifest.edn file is emitted to :output-dir for mapping to fingerprinted filenames.
+Defaults to false.
+
+  :fingerprint true")

 ;; ** ClojureScript Compiler Warnings

@@ -1115,6 +1122,7 @@
      ::rewrite-polyfills
      ::checked-arrays
      ::aot-cache
+     ::fingerprint

      ;; these need definitions above
      ::closure-variable-map-out


fixing reset function

fixing reset function

--- resources/leiningen/new/closp/clj/user.clj
+++ resources/leiningen/new/closp/clj/user.clj
@@ -1,8 +1,13 @@
 (ns {{ns}}.user
-  (:require [system.repl :refer [set-init! start reset]]
+  (:require [system.repl :as sr]
+            [clojure.tools.namespace.repl :as tn]
             [{{ns}}.components.components :refer [dev-system]]))

 (defn start-dev-system []
-  (start))
+  (sr/start))

-(set-init! #'dev-system)
+(defn reset []
+  (tn/refresh)
+  (sr/reset))
+
+(sr/set-init! #'dev-system)


Fix test for 0.8

Fix test for 0.8

--- test/onyx/metrics/send_test.clj
+++ test/onyx/metrics/send_test.clj
@@ -60,7 +60,7 @@
                            :onyx.peer/job-scheduler :onyx.job-scheduler/greedy
                            :onyx.messaging/impl :aeron
                            :onyx.messaging/allow-short-circuit? true
-                           :onyx.messaging/peer-port-range [40200 40260]
+                           :onyx.messaging/peer-port 40200
                            :onyx.messaging/bind-addr "localhost"}]
           (with-test-env [test-env [3 env-config peer-config]]
             (let [batch-size 20


Specification for completing an existing segment.


Typo in rule name fix.

Typo in rule name fix.

--- EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
+++ EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
@@ -1089,7 +1089,7 @@

 (defn-
-  advice-poincut|raw
+  advice-pointcut|raw
   "Relation between an Advice ?advice and its raw, implementation-level Pointcut ?pointcut.
    These are conjunctions of the user-defined Pointcut and one synthetic Pointcut corresponding
    to its aspect's PerClause (cflow, super, object, singleton, typewithin)."


Fix off by one in restart index Use input record for input segments

--- src/onyx/plugin/kafka.clj
+++ src/onyx/plugin/kafka.clj
@@ -7,6 +7,7 @@
             [cheshire.core :refer [parse-string]]
             [zookeeper :as zk]
             [onyx.static.default-vals :refer [arg-or-default]]
+            [onyx.types :as t]
             [onyx.peer.pipeline-extensions :as p-ext]
             [onyx.peer.function :as function]
             [onyx.peer.operation :refer [kw->fn]]
@@ -44,7 +45,7 @@
   (if (:kafka/force-reset? task-map)
     (read-from-bound consumer topic kpartition task-map)
     (if-let [x (kzk/committed-offset m group-id topic kpartition)]
-      x
+      (inc x)
       (read-from-bound consumer topic kpartition task-map))))

 (defn highest-offset-to-commit [offsets]
@@ -60,7 +61,6 @@
     (loop []
       (Thread/sleep commit-interval)
       (when-let [offset (highest-offset-to-commit @pending-commits)]
-        (log/info "Writing offset to ZooKeeper: " offset)
         (kzk/set-offset! m group-id topic kpartition offset)
         (swap! pending-commits (fn [coll] (remove (fn [k] (<= k offset)) coll))))
       (recur))
@@ -92,8 +92,9 @@
                   (Thread/sleep empty-read-back-off)
                   (recur fetched head-offset))
                 (let [next-offset (.offset ^int (first ms))]
-                  (>!! ch {:message (deserializer-fn (.value ^KafkaMessage (first ms)))
-                           :offset next-offset})
+                  (>!! ch (assoc (t/input (java.util.UUID/randomUUID)
+                                          (deserializer-fn (.value ^KafkaMessage (first ms))))
+                                 :offset next-offset))
                   (recur (rest ms) (inc next-offset)))))
             (finally
              (future-cancel commit-fut))))
@@ -136,16 +137,11 @@
                      (map (fn [_]
                             (let [result (first (alts!! [read-ch timeout-ch] :priority true))]
                               (if (= (:message result) :done)
-                                {:id (java.util.UUID/randomUUID)
-                                 :input :kafka
-                                 :message :done}
-                                {:id (java.util.UUID/randomUUID)
-                                 :input :kafka
-                                 :message (:message result)
-                                 :offset (:offset result)}))))
+                                (t/input (java.util.UUID/randomUUID) :done)
+                                result))))
                      (filter :message))]
       (doseq [m batch]
-        (swap! pending-messages assoc (:id m) (select-keys m [:message :offset])))
+        (swap! pending-messages assoc (:id m) m))
       (when (and (= 1 (count @pending-messages))
                  (= (count batch) 1)
                  (= (:message (first batch)) :done))
@@ -163,7 +159,8 @@
     [_ _ message-id]
     (when-let [msg (get @pending-messages message-id)]
       (swap! pending-messages dissoc message-id)
-      (>!! read-ch msg)))
+      (>!! read-ch (t/input (java.util.UUID/randomUUID)
+                            (:message msg)))))

   (pending?
     [_ _ message-id]


throw nicer exception if the user attempts to define a synth without a name

--- src/overtone/sc/synth.clj
+++ src/overtone/sc/synth.clj
@@ -388,6 +388,8 @@
   "Internal function used to prepare synth meta-data."
   [s-name s-form]
   (let [[s-name s-form] (name-with-attributes s-name s-form)
+        _               (when (not (symbol? s-name))
+                          (throw (Exception. (str "You need to specify a name for your synth using a symbol"))))
         params          (first s-form)
         params          (parse-params params)
         ugen-form       (second s-form)


Allow shape position to be changed

Allow shape position to be changed

--- src/play_clj/entities.clj
+++ src/play_clj/entities.clj
@@ -83,7 +83,8 @@
           x (float (or x 0))
           y (float (or y 0))
           z (float (or z 0))]
-      (.setTranslation m x y z))
+      (.setTranslation m x y z)
+      (.setTransformMatrix object m))
     (when batch
       (.end ^SpriteBatch batch))
     (when camera


More exhaustive tests of either predicates

--- test/cats/monad/either_spec.cljx
+++ test/cats/monad/either_spec.cljx
@@ -21,9 +21,12 @@
   (t/is (= 1 @(either/right 1))))

 (t/deftest predicates-test
-  (let [m1 (either/right 1)]
+  (let [m1 (either/right 1)
+        m2 (either/left 42)]
     (t/is (either/either? m1))
-    (t/is (either/right? m1))))
+    (t/is (either/either? m2))
+    (t/is (either/right? m1))
+    (t/is (either/left? m2))))

 (t/deftest functor-test
   (let [m1 (either/right 1)


more generative tests attempts

more generative tests attempts

--- test/kacurez/generative_test.clj
+++ test/kacurez/generative_test.clj
@@ -47,4 +47,4 @@

 (deftest generative-test
   (testing "generative tests"
-    (is (test-and-check `pexecute-gen 3))))
+    (is (test-and-check `pexecute-gen 20))))


Finish test.

Finish test.

--- test/onyx/log/greedy_multi_job_test.clj
+++ test/onyx/log/greedy_multi_job_test.clj
@@ -57,16 +57,62 @@

 (extensions/write-log-entry (:log env) entry)

-(loop [replica replica]
-  (let [position (<!! ch)
-        entry (extensions/read-log-entry (:log env) position)
-        new-replica (extensions/apply-log-entry entry replica)]
-    (if (and (= (count (:b (get (:allocations new-replica) j1))) 40)
-             (zero? (apply + (map count (vals (get (:allocations new-replica) j2))))))
-      new-replica
-      (recur new-replica))))
+(def replica-2
+  (loop [replica replica]
+    (let [position (<!! ch)
+          entry (extensions/read-log-entry (:log env) position)
+          new-replica (extensions/apply-log-entry entry replica)]
+      (if (and (= (count (:b (get (:allocations new-replica) j1))) 40)
+               (zero? (apply + (map count (vals (get (:allocations new-replica) j2))))))
+        new-replica
+        (recur new-replica)))))

 (fact "All peers were reallocated to job 1, task B" true => true)
+
+(def entry (create-log-entry :complete-task {:job j1 :task :b}))
+
+(extensions/write-log-entry (:log env) entry)
+
+(def replica-3
+  (loop [replica replica-2]
+    (let [position (<!! ch)
+          entry (extensions/read-log-entry (:log env) position)
+          new-replica (extensions/apply-log-entry entry replica)]
+      (if (= (count (:c (get (:allocations new-replica) j2))) 40)
+        new-replica
+        (recur new-replica)))))
+
+(fact "All peers were reallocated to job 2, task C" true => true)
+
+(def entry (create-log-entry :complete-task {:job j2 :task :c}))
+
+(extensions/write-log-entry (:log env) entry)
+
+(def replica-4
+  (loop [replica replica-3]
+    (let [position (<!! ch)
+          entry (extensions/read-log-entry (:log env) position)
+          new-replica (extensions/apply-log-entry entry replica)]
+      (if (= (count (:d (get (:allocations new-replica) j2))) 40)
+        new-replica
+        (recur new-replica)))))
+
+(fact "All peers were reallocated to job 2, task D" true => true)
+
+(def entry (create-log-entry :complete-task {:job j2 :task :d}))
+
+(extensions/write-log-entry (:log env) entry)
+
+(def replica-5
+  (loop [replica replica-4]
+    (let [position (<!! ch)
+          entry (extensions/read-log-entry (:log env) position)
+          new-replica (extensions/apply-log-entry entry replica)]
+      (if (zero? (apply + (map count (vals (get (:allocations new-replica) j2)))))
+        new-replica
+        (recur new-replica)))))
+
+(fact "No peers are executing any tasks" true => true)

 (doseq [v-peer v-peers]
   (try


Bump up test timeouts.

Bump up test timeouts.

--- test/onyx/log/greedy_multi_job_test.clj
+++ test/onyx/log/greedy_multi_job_test.clj
@@ -115,17 +115,17 @@
         v-peers (onyx.api/start-peers n-peers peer-group)
         ch (chan n-peers)

-        replica-1 (playback-log (:log env) (extensions/subscribe-to-log (:log env) ch) ch 2000)
+        replica-1 (playback-log (:log env) (extensions/subscribe-to-log (:log env) ch) ch 6000)
         counts-1 (get-counts replica-1 [j1 j2])
         _ (>!! a-chan :done)
         _ (close! a-chan)

-        replica-2 (playback-log (:log env) replica-1 ch 2000)
+        replica-2 (playback-log (:log env) replica-1 ch 6000)
         counts-2 (get-counts replica-2 [j1 j2])
         _ (>!! c-chan :done)
         _ (close! c-chan)

-        replica-3 (playback-log (:log env) replica-2 ch 2000)
+        replica-3 (playback-log (:log env) replica-2 ch 6000)
         counts-3 (get-counts replica-3 [j1 j2])
         _ (close! b-chan)
         _ (close! d-chan)]


Fixed test

Fixed test

--- test/trumpet_server/web_test.clj
+++ test/trumpet_server/web_test.clj
@@ -17,12 +17,12 @@
                      (after :facts (do (.stop @server)
                                        (reset! server nil)))]
                     (fact "Entry point returns the correct resources"
-                          (def href-for-rel (->> (client/get "http://127.0.0.1:5000" {:query-params {"latitude" 22.2 "longtiude" 21.2} :as :json})
+                          (def href-for-rel (->> (client/get "http://127.0.0.1:5000" {:query-params {"latitude" 22.2 "longitude" 21.2} :as :json})
                                                  :body
                                                  find-href-in-response))
-                          (href-for-rel "subscribe") => (just #"^http://127.0.0.1:5000/clients/\w.+/subscribe")
-                          (href-for-rel "location") => (just #"^http://127.0.0.1:5000/clients/\w.+/location")
-                          (href-for-rel "trumpet") => (just #"^http://127.0.0.1:5000/clients/\w.+/trumpet")
+                          (href-for-rel "subscribe") => (just #"^http://127.0.0.1:5000/trumpeters/\d/subscribe")
+                          (href-for-rel "location") => (just #"^http://127.0.0.1:5000/trumpeters/\d/location")
+                          (href-for-rel "trumpet") => (just #"^http://127.0.0.1:5000/trumpeters/\d/trumpet")
                           (href-for-rel "self") => "http://127.0.0.1:5000"))