Tests for function yes-no-with-caution and print-field

--- test/clj_mrazik/dictionary_test.clj
+++ test/clj_mrazik/dictionary_test.clj
@@ -173,3 +173,15 @@
         (is (= java.lang.String (type (bold "string"))))
         (is (= (subs (bold "string") 1 7) "string"))))

+(deftest test-yes-no-with-caution
+    "Checks the function yes-no-with-caution"
+    (testing "the function yes-no-with-caution"
+        (is (= (yes-no-with-caution {:no 0 :yes 1 :with-caution 2} :no)           (red "no")))
+        (is (= (yes-no-with-caution {:no 0 :yes 1 :with-caution 2} :yes)          (green "yes")))
+        (is (= (yes-no-with-caution {:no 0 :yes 1 :with-caution 2} :with-caution) (yellow "with caution")))))
+
+(deftest test-print-field
+    "Checks the function print-field"
+    (testing "the function print-field"
+        (is (= (str (bold "title: ") " test ")) (print-field "title" {:term "term"} :term))))
+


use lexicon-for-generation for creating index

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -582,7 +582,7 @@
      :generate {:lexicon lexicon-for-generation}
      :grammar grammar
      :lexicon lexicon
-     :index (create-index grammar (flatten (vals lexicon)) head-principle)}))
+     :index (create-index grammar (flatten (vals lexicon-for-generation)) head-principle)}))

 (def medium
   ;; TODO: remove parse-lexicon.
@@ -610,7 +610,7 @@
      :enrich enrich
      :generate {:lexicon lexicon-for-generation}
      :grammar grammar
-     :index (create-index grammar (flatten (vals lexicon)) head-principle)
+     :index (create-index grammar (flatten (vals lexicon-for-generation)) head-principle)
      :language "it"
      :language-keyword :italiano
      :lexicon lexicon


fix typos in use of :reflexive

fix typos in use of :reflexive

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -164,8 +164,8 @@
       (new-entries ;; remove the second argument and semantic object to make verbs intransitive.
        {:synsem {:cat :verb
                  :aux false
-                 :reflexive false
-                 :sem {:obj {:top :top}}
+                 :sem {:obj {:top :top}
+                       :reflexive false}
                  :subcat {:2 {:cat :noun}
                           :3 '()}}}
        (fn [lexeme]
@@ -217,9 +217,9 @@
        {:synsem {:cat :verb
                  :essere false}})

-      (default ;; aux defaults to false.
-       {:synsem {:cat :verb
-                 :aux false}})
+      (default ;; reflexive defaults to false.
+       {:synsem {:cat :verb
+                 :sem {:reflexive false}}})

       (default ;; noun agreement
        (unify {:synsem {:cat :noun


Removed log-level-page

Removed log-level-page

--- storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -20,10 +20,7 @@
   (:use [ring.adapter.jetty :only [run-jetty]])
   (:import [org.slf4j LoggerFactory])
   (:import [ch.qos.logback.classic Logger])
-  (:import [org.apache.commons.logging LogFactory])
-  (:import [org.apache.commons.logging.impl Log4JLogger])
   (:import [ch.qos.logback.core FileAppender])
-  (:import [org.apache.log4j Level])
   (:import [java.io File])
   (:require [compojure.route :as route]
             [compojure.handler :as handler]
@@ -70,13 +67,6 @@
          (filter #(.contains % grep) (.split tail-string "\n")))
        (.replaceAll tail-string "\n" "\n<br>"))))

-(defn log-level-page [name level]
-  (let [log (LogFactory/getLog name)]
-    (if level
-      (if (instance? Log4JLogger log)
-        (.setLevel (.getLogger log) (Level/toLevel level))))
-    (str "effective log level for " name " is " (.getLevel (.getLogger log)))))
-
 (defn log-template [body]
   (html4
    [:head
@@ -95,8 +85,6 @@
 (defroutes log-routes
   (GET "/log" [:as req & m]
        (log-template (log-page (:file m) (:tail m) (:grep m) (:log-root req))))
-  (GET "/loglevel" [:as {cookies :cookies} & m]
-       (log-template (log-level-page (:name m) (:level m))))
   (route/resources "/")
   (route/not-found "Page not found"))


testing

testing

--- test/forma/trends/analysis_test.clj
+++ test/forma/trends/analysis_test.clj
@@ -71,7 +71,7 @@
  (- (hansen-stat (shift-down-end ndvi))
     (hansen-stat ndvi)) => pos?)

-(facts
+#_(facts
  "check that the appropriate number of periods are included in the
  results vector, after the appropriate number of intervals (strictly
  within the training period) are dropped.  Suppose, for example, that
@@ -119,14 +119,33 @@
 ;;         (dorun (telescoping-short-trend 140 271 23 30 10 ndvi reli))))
 ;; "Elapsed time: 5650.48 msecs"

-(defn extract-series
-  [{:keys [series]}]
-  series)
+(defn extract-ndvi
+  [{:keys [ndvi]}]
+  [ndvi])

-(defn test-long
-  [ndvi-tap (schema/timeseries-value ndvi)
-   reli-tap (schema/timeseries-value reli)
-   rain-tap (schema/timeseries-value rain)]
-  (?<- (stdout)
-       [?series]
-       (ndvi-tap )))
+(defn extract-reli
+  [{:keys [reli]}]
+  [reli])
+
+(defn extract-rain
+  [{:keys [rain]}]
+  [rain])
+
+(defn create-tap
+  [n ts]
+  (vec (repeat n (schema/timeseries-value 0 ts))))
+
+(defn myfunc [m]
+  (let [coll (vector (:series m))]
+    (hansen-stat (first coll))))
+
+(defn test-myfunc []
+  (?<- (stdout) [?han] (time-src ?series) (myfunc ?series :> ?han)))
+
+(defn total-tap
+  [n]
+  (repeat n {:start 0 :end 271 :ndvi ndvi :reli reli :rain rain}))
+
+(defmapcatop tele-wrap
+  [ndvi reli rain]
+  (telescoping-long-trend 23 100 110 ndvi reli rain))


add response to k8s malformed request (#669)

--- waiter/src/waiter/scheduler/kubernetes.clj
+++ waiter/src/waiter/scheduler/kubernetes.clj
@@ -261,8 +261,8 @@
                                       (and (not content-type) body) (assoc :content-type "application/json"))))]
       (scheduler/log "response from K8s API server:" result)
       result)
-    (catch [:status 400] _
-      (log/error "malformed K8s API request: " url options))
+    (catch [:status 400] response
+      (log/error "malformed K8s API request: " url options response))
     (catch [:client http-client] response
       (log/error "request to K8s API server failed: " url options body response)
       (ss/throw+ response))))


Check the encoding directly.

Check the encoding directly.

--- test/kolmogorov_music/test/song.clj
+++ test/kolmogorov_music/test/song.clj
@@ -2,6 +2,14 @@
   (:require [kolmogorov-music.song :as song]
             [midje.sweet :refer :all]
             [leipzig.melody :as leipzig]))
+
+(fact "code encodes each note of a melody into four digits that determine pitch and duration."
+  (->> (leipzig/phrase [2/3 1/3] [0 4]) song/code) => 23001322)
+
+(fact "Multiple parts are multiplexed, based on which part is furthest behind."
+  (->> (leipzig/phrase [1 1 1 1] [0 1 2 3])
+       (with (leipzig/phrase [2 2] [4 5]))
+       song/code) => 212211001101212311111112)

 (fact "(comp code decode) is an identity for a single part."
   (let [melody (leipzig/phrase [3/3 3/3 2/3 1/3 3/3]


Add a url->feed function to manga fox data

--- src/clj/comic_reader/scrape.clj
+++ src/clj/comic_reader/scrape.clj
@@ -1,23 +1,31 @@
 (ns comic-reader.scrape
-  (:require [clojure.string :refer [trim]]
+  (:require [clojure.string :as s]
             [net.cgrand.enlive-html :as html])
   (:import java.net.URL))

 (def sites
-  [{:name "Manga Fox"
-    :url "http://mangafox.me/manga/"
-    :selector [:div.manga_list :ul :li :a]
-    :normalize (fn [{[name] :content
-                     {url :href} :attrs}]
-                 {:name name
-                  :url url})}
+  [(let [canonical-url "http://mangafox.me"
+         manga-url (format "%s/manga/" canonical-url)
+         manga-pattern (re-pattern (str manga-url "(.*?)/"))]
+     {:name "Manga Fox"
+      :url manga-url
+      :selector [:div.manga_list :ul :li :a]
+      :normalize (fn [{[name] :content
+                       {url :href} :attrs}]
+                   {:name name
+                    :url url})
+      :url->feed (fn [url]
+                   (some->> url
+                            (re-matches manga-pattern)
+                            second
+                            (format "%s/rss/%s.xml" canonical-url)))})
    (let [canonical-url "http://www.mangareader.net/"]
      {:name "Manga Reader"
       :url (str canonical-url "alphabetical")
       :selector [:div.series_alpha :ul :li :a]
       :normalize (fn [{[name] :content
                        {url :href} :attrs}]
-                   {:name (trim name)
+                   {:name (s/trim name)
                     :url (str canonical-url url)})})])

 (defn fetch-feed [url]


Increase coconut supply

Increase coconut supply

--- src/cljc/robinson/worldgen.cljc
+++ src/cljc/robinson/worldgen.cljc
@@ -319,7 +319,7 @@
                         (= (rr/uniform-int 0 50) 0))
                    (and (= :palm-tree (get cell :type))
                         (= :jungle biome)
-                        (= (rr/uniform-int 0 50) 0))
+                        (= (rr/uniform-int 0 30) 0))
                    (and (contains? #{:gravel :tree :palm-tree :tall-grass} (get cell :type))
                         (= (rr/uniform-int 0 200) 0)))
              (assoc cell :harvestable true)


init-select2-element : add `element-id` param

This allows the function to be reused for other similar input boxes. One
will be added in an upcoming patch.

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/main.cljs
+++ src/cljs/cljs_nusmods/main.cljs
@@ -183,13 +183,13 @@
            ; no more results
            (js-obj "more" false, "context" ctx, "results" (array)))))))

-(defn- init-select2-input-box
-  "Initialize the Select2 `Select Modules for Timetable` input. This function
-   should only be called after the JavaScript global variable `ModulesMap` is
-   set"
-  []
-  (let [$searchModules ($ :#search-modules)]
-    (.select2 $searchModules
+(defn- init-select2-element
+  "Initialize the Select2 elements.
+   This function should only be called after the JavaScript global variable
+   `ModulesMap` is set"
+  [element-id]
+  (let [$element-id ($ element-id)]
+    (.select2 $element-id
               (js-obj "multiple"      true
                       "width"         "100%"
                       "placeholder"   "Type code/title to add mods"
@@ -289,7 +289,7 @@
                                "moduleType" (js-obj "valueType" "item"))
                 "items"      itemsArray))
       (.configureFromDOM myExhibit)
-      (init-select2-input-box)
+      (init-select2-element :#search-modules)
       (init-dom-clear-modules)
       (aset js/window "Exhibit3_Initialized" true))))


Add 'login to add note' for logged-out users

--- src/cljs/clojuredocs/notes.cljs
+++ src/cljs/clojuredocs/notes.cljs
@@ -110,7 +110,7 @@
           (str/replace #"
" "
")
           (str/replace #"
" "
"))}}]])

-(defn $notes [{:keys [notes var] :as app} owner]
+(defn $notes [{:keys [notes var user] :as app} owner]
   (reify
     om/IRender
     (render [_]
@@ -123,4 +123,7 @@
             [:ul
              (for [n notes]
                ($note n))])]
-         (om/build $add app)]))))
+         (if user
+           (om/build $add app)
+           [:div.login-required-message
+            "Log in to add a note"])]))))


Center and smallify the in-comic loading image

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -183,7 +183,11 @@
                          [img-component site location]
                          %)
                   comic-imgs))
-           [:img {:src "/img/loading.svg"}]])))))
+           [:img {:src "/img/loading.svg"
+                  :style {:margin-left "auto"
+                          :margin-right "auto"
+                          :width "40%"
+                          :display "block"}}]])))))

 (defn comic-reader []
   (let [page (rf/subscribe [:page])]


Add help about :lang modifier

Add help about :lang modifier

--- src/cljs/subman/components.cljs
+++ src/cljs/subman/components.cljs
@@ -16,7 +16,7 @@
                                    :href "#"}
                                [:i.fa.fa-chevron-left]])]
    [:input.form-control {:type "text"
-                         :placeholder "Type search query"
+                         :placeholder "Type search query. You can specifie language with :lang name, by default used english."
                          :on-change #(reset! value (-> % .-target .-value))
                          :value @value}]])


Minor cleanup.

Minor cleanup.

--- src/clojure/clj_chess/game.cljc
+++ src/clojure/clj_chess/game.cljc
@@ -68,6 +68,11 @@
   [game]
   (-> game :current-node :board))

+(defn current-node-id
+  "Returns the node id of the current node."
+  [game]
+  (-> game :current-node :node-id))
+
 (defn find-node-matching
   "Finds the first (as found by a depth-first search) game tree node
   matching the given predicate. If no such node is found, returns nil."
@@ -174,9 +179,10 @@
   id. The move is added as the last child. If no node id is supplied,
   the current node of the game is used. If remove-existing-moves? is true,
   any previously existing moves at the point of insertion are removed."
-  [game san-move & {:keys [node-id remove-existing-moves?]}]
+  [game san-move & {:keys [node-id remove-existing-moves?]
+                    :or {node-id (current-node-id game)}}]
   (add-move game board/move-from-san san-move
-            (or node-id (-> game :current-node :node-id))
+            node-id
             remove-existing-moves?))

@@ -185,9 +191,10 @@
   added as the last child. If no node id is supplied, the current node of the
   game is used. If remove-existing-moves? is true, any previously existing
   moves at the point of insertion are removed."
-  [game uci-move & {:keys [node-id remove-existing-moves?]}]
+  [game uci-move & {:keys [node-id remove-existing-moves?]
+                    :or {node-id (current-node-id game)}}]
   (add-move game board/move-from-uci uci-move
-            (or node-id (-> game :current-node :node-id))
+            node-id
             remove-existing-moves?))

@@ -196,9 +203,10 @@
   game at a given node id. The move is added as the last child. If no node id
   is supplied, the current node of the game is used. If remove-existing-moves?
   is true, any previously existing moves at the point of insertion are removed."
-  [game map-move & {:keys [node-id remove-existing-moves?]}]
+  [game map-move & {:keys [node-id remove-existing-moves?]
+                    :or {node-id (current-node-id game)}}]
   (add-move game board/move-from-map map-move
-            (or node-id (-> game :current-node :node-id))
+            node-id
             remove-existing-moves?))

@@ -221,9 +229,10 @@
   have to unzip and zip the tree for each added move. If
   remove-existing-moves? is true, any previously existing moves at the point
   of insertion are removed."
-  [game san-moves & {:keys [node-id remove-existing-moves?]}]
+  [game san-moves & {:keys [node-id remove-existing-moves?]
+                     :or {node-id (current-node-id game)}}]
   (add-move-sequence game board/move-from-san san-moves
-                     (or node-id (-> game :current-node :node-id))
+                     node-id
                      remove-existing-moves?))

@@ -233,20 +242,21 @@
   have to unzip and zip the tree for each added move. If
   remove-existing-moves? is true, any previously existing moves at the point
   of insertion are removed."
-  [game uci-moves & {:keys [node-id remove-existing-moves?]}]
+  [game uci-moves & {:keys [node-id remove-existing-moves?]
+                     :or {node-id (current-node-id game)}}]
   (add-move-sequence game board/move-from-uci uci-moves
-                     (or node-id (-> game :current-node :node-id))
+                     node-id
                      remove-existing-moves?))

 (defn add-key-value-pair
   "Adds a key value pair to the map at the given node id of the game. If no
   node id is supplied, the key value pair is added at the current node."
-  [game key value & {:keys [node-id]}]
-  (let [z (-> (game-zip game (or node-id (-> game :current-node :node-id)))
+  [game key value & {:keys [node-id] :or {node-id (current-node-id game)}}]
+  (let [z (-> (game-zip game node-id)
               (zip-add-key-value-pair key value))
         g (assoc game :root-node (zip/root z))]
-    (assoc g :current-node (find-node g (-> g :current-node :node-id)))))
+    (assoc g :current-node (find-node g (current-node-id game)))))

 (defn add-comment
@@ -272,9 +282,8 @@
   "Removes a node (by default, the current node) from the game, and returns
   a modified game with the current node set to the parent of the deleted
   node."
-  [game & {:keys [node-id]}]
-  (let [node-id (or node-id (-> game :current-node :node-id))
-        z (game-zip game node-id)
+  [game & {:keys [node-id] :or {node-id (current-node-id game)}}]
+  (let [z (game-zip game node-id)
         zr (zip/remove z)]
     (assoc game :root-node (zip/root zr)
                 :current-node (if (= (zip/up z) (zip/prev z))
@@ -286,7 +295,7 @@
   "Removes all child nodes of a node (by default, the current node), and
   returns a modified game with the current node set to the node whose
   children we just removed."
-  [game & {:keys [node-id] :or {node-id (-> game :current-node :node-id)}}]
+  [game & {:keys [node-id] :or {node-id (current-node-id game)}}]
   (assoc game
     :root-node (-> (game-zip game node-id) zip-remove-children zip/root)
     :current-node node-id))


add cognician logo to common/icon

add cognician logo to common/icon


Write a config to a given file.

Write a config to a given file.

--- src/fm/simrunner/config.clj
+++ src/fm/simrunner/config.clj
@@ -103,6 +103,8 @@
     (throw (IllegalArgumentException.
              (format "Undefined config parameter: '%s'!" param-id)))))

-;; TODO: implement.
-(defn write-config-file [config file])
+(defn write-config-file [config file]
+  (with-open [writer (jio/writer file)]
+    (doseq [value (map #(str (get config %)) param-ids)]
+      (doto writer (.write value) .newLine))))


limiting gear shifts to max-gear:5

limiting gear shifts to max-gear:5

--- sr-client/app/src/sr_client/behavior.clj
+++ sr-client/app/src/sr_client/behavior.clj
@@ -6,15 +6,14 @@

 (def max-rpm 15000)
 (def race-distance-meters 402)
-
-
+(def max-gear 5)

 (defn shift-gear-transform [{:keys [gear rpm speed distance]} _]
-;  (.log js/console "PRINTING"  gear rpm old_value)
-  {:gear ((fnil inc 0) gear)
-   :rpm 0
-   :speed speed
-   :distance distance})
+  (let [new-gear ((fnil inc 0) gear)]
+    {:gear (if (> new-gear max-gear) gear new-gear)
+     :rpm 0
+     :speed speed
+     :distance distance}))

 (defn publish-player [player]
   [{msg/type :swap msg/topic [:other-players] :value player}])
@@ -22,8 +21,6 @@
 (defn swap-transform [_ message]
   (:value message))

-;msg
-;{msg/type :shift-gear msg/topic [:my-car :gear]}
 (defn total-count [_ nums]
   (do
     ;(.log js/console "!!!!!!!!!!" nums)


GUI now shows a tooltip when you mouseover a move/attack selection.

--- src-browser/simplestrat/renderstate.cljs
+++ src-browser/simplestrat/renderstate.cljs
@@ -107,6 +107,11 @@
          findspriteforcharacter
          rebuildoverlay)

+(defn setcanvascaption [renderstate caption]
+  (let [stage (:stage renderstate)
+        canvas (.-canvas stage)]
+    (aset canvas "title" caption)))
+
 (defn- highlightcharacter
   "Highlights current character. Doesn't modify the clojure-side renderstate"
   [character]
@@ -114,6 +119,7 @@
     (doto renderstate
       (highlightcharacteronmap character)
       (highlightcharacterinroster character)
+      (setcanvascaption (:name character))
       (redraw))))

 (defn- unhighlightcharacter [character]
@@ -121,6 +127,7 @@
     (doto renderstate
       (unhighlightcharacteronmap character)
       (unhighlightcharacterinroster character)
+      (setcanvascaption "")
       (redraw))))

 (defn getclickablesfor
@@ -306,25 +313,32 @@
   (let [rostercontainer (get-in renderstate [:teamGUIs (:team character) :container])
         sprite-path [:sprites (:team character)]
         panel (createjs/Container.)
+        charactername (createjs/Text.)
         healthtext (createjs/Text. "Health: 0")
         actionsavailabletext (createjs/Text. "Actions Available: ")
         oldspritemap (get-in renderstate sprite-path)
         newspritemap (addcharactersprite oldspritemap character)
         charactersprite (get newspritemap (:uniqueid character))]
+    (doto charactername
+      (aset "text" (:name character))
+      (aset "x" 30)
+      (aset "y" -24))
     (doto charactersprite
       (aset "x" 0)
       (aset "y" 0)
-      (aset "name" "sprite"))
+      (aset "name" "sprite")
+      (scalesprite rostertilescale))
     (doto healthtext
       (aset "x" 30)
       (aset "y" -12)
       (aset "name" "healthtext"))
     (doto actionsavailabletext
       (aset "x" 30)
-      (aset "y" 8)
+      (aset "y" 0)
       (aset "name" "actiontext"))
     (doto panel
       (aset "name" (:uniqueid character))
+      (.addChild charactername)
       (.addChild charactersprite)
       (.addChild healthtext)
       (.addChild actionsavailabletext)
@@ -492,12 +506,30 @@
             ]
       (renderfunc px py))))

+(defn- overlaymouseover [event]
+  (let [renderstate @displayed-renderstate
+        overlay (:overlay renderstate)
+        gamestate (:gamestate renderstate)
+        mouseoverpx (- (aget event "stageX") (.-x overlay))
+        mouseoverpy (- (aget event "stageY") (.-y overlay))
+        [tilex tiley] (pixelsxy->tilexy [mouseoverpx mouseoverpy])
+        ;; keys in clickables are of the form [x y]
+        mouseoverdata (:overlaymouseoverdata renderstate)
+        mouseondata (mouseoverdata [tilex tiley])
+        ]
+    (when mouseondata
+      (setcanvascaption renderstate mouseondata))))
+
+(defn- overlaymouseout [event]
+  (let [renderstate @displayed-renderstate]
+    (setcanvascaption renderstate "")))
+
 (defn- overlayclicked [event]
   (let [renderstate @displayed-renderstate
         overlay (:overlay renderstate)
         gamestate (:gamestate renderstate)
-        clickpx (- (.-stageX event) (.-x overlay))
-        clickpy (- (.-stageY event) (.-y overlay))
+        clickpx (- (aget event "stageX") (.-x overlay))
+        clickpy (- (aget event "stageY") (.-y overlay))
         [tilex tiley] (pixelsxy->tilexy [clickpx clickpy])
         ;; keys in clickables are of the form [x y]
         clickcallbacks (:overlayclickables renderstate)
@@ -537,6 +569,25 @@
     (merge
       (reduce addmovecallback {} moves)
       (reduce addattackcallback {} attacks))))
+
+(defn- buildmouseoverdata
+  [renderstate actiondata]
+  (let [{:keys [moves attacks]} actiondata
+        {:keys [gamestate selectedcharacterid selectedaction]} renderstate
+        character (world/get-character gamestate selectedcharacterid)
+        addmovedata (fn [mouseoverdata [action location]]
+                          (assoc mouseoverdata location (string/join ["Move here using '" (:name action) "'"])))
+        addattackdata (fn [mouseoverdata [action target]]
+                            (let [{:keys [x y]} target
+                                  location [x y]]
+                              (assoc mouseoverdata location (string/join ["Attack here using '" (:name action) "'"]))))
+        ]
+    ;; each callback is a function with parameters [gamestate character action targetx targety]
+    ;; convert move data into clickcallbacks
+    (merge
+      (reduce addmovedata {} moves)
+      (reduce addattackdata {} attacks))))
+

 (defn rebuildoverlay
   "Render the overlay which shows the current selected character and possible move/attack
@@ -556,7 +607,9 @@
       (rendermovelocations overlay movelocations))
     (when (not-nil? attacktargets)
       (renderattacktargets overlay attacktargets))
-    (assoc renderstate :overlayclickables (buildclickcallbacks renderstate actiondata))))
+    (-> renderstate
+      (assoc :overlayclickables (buildclickcallbacks renderstate actiondata))
+      (assoc :overlaymouseoverdata (buildmouseoverdata renderstate actiondata)))))

 ;;
 ;; text log window
@@ -612,12 +665,17 @@
 (defn updategamestate! [gamestate]
   (let [oldrenderstate @displayed-renderstate
         renderstate (assoc oldrenderstate :gamestate gamestate)
+        selectedcharacterid (:selectedcharacterid renderstate)
+        gamestate (:gamestate renderstate)
+        overlaydata (if selectedcharacterid
+                      (getclickablesfor gamestate (world/get-character gamestate selectedcharacterid) nil)
+                      nil)
         newrenderstate (-> renderstate
             (rebuildmapdisplaylist oldrenderstate)
             (rebuildcharacterdisplaylist)
             (rebuildteamdisplaylist :team1)
             (rebuildteamdisplaylist :team2)
-            (rebuildoverlay nil)
+            (rebuildoverlay overlaydata)
             (updatemessagelog))]
     (if (compare-and-set! displayed-renderstate oldrenderstate newrenderstate)
       nil ; updated renderstate
@@ -639,7 +697,7 @@
         tilemap (createeaseljscontainer "tilemap" mapoffsetpixels)
         characters (createeaseljscontainer "characters" mapoffsetpixels)
         leftRoster (createcharacterroster "team1Roster" :team1 [30 100])
-        rightRoster (createcharacterroster "team2Roster" :team2 [440 100])
+        rightRoster (createcharacterroster "team2Roster" :team2 [400 100])
         overlayshape (createjs/Shape.)
         controlpanel (createcontrolpanel [50 300])
         messagelog (createmessagelog [520 0])]
@@ -655,7 +713,10 @@
     (doto overlayshape
       (aset "x" (get mapoffsetpixels 0))
       (aset "y" (get mapoffsetpixels 1))
-      (.addEventListener "click" overlayclicked))
+      (aset "mouseEnabled" true)
+      (.addEventListener "click" overlayclicked)
+      (.addEventListener "mouseover" overlaymouseover)
+      (.addEventListener "mouseout" overlaymouseout))
     ;; embed direct references to the map and character containers for
     ;; easy manipulation later
     (swap! displayed-renderstate assoc :stage-map tilemap :stage-characters characters)


say how many characters have been typed

say how many characters have been typed

--- src-cljs/frontend/components/issues.cljs
+++ src-cljs/frontend/components/issues.cljs
@@ -34,7 +34,8 @@
                     :required "true"
                     :data-adaptive ""
                     :onChange #(om/set-state! owner :issue-title (.. % -target -value))}]
-           [:label {:data-placeholder (str "Sounds good" "; 100 characters left")
+           [:label {:data-placeholder (gstring/format "Sounds good; %s characters so far"
+                                                      (count issue-title))
                     :data-placeholder-nil "How can we improve Precursor?"
                     :data-placeholder-busy "Your idea in less than 140 characters?"}]])))))


CMR-804: Added test for concept with nil delete-time but expired delete-time in xml

--- test/cmr/system_int_test/bootstrap/bulk_index_test.clj
+++ test/cmr/system_int_test/bootstrap/bulk_index_test.clj
@@ -54,7 +54,18 @@
                      :provider-id "PROV1"
                      :native-id "coll3"
                      :short-name "coll3"}
-          coll3 (ingest/save-concept coll3-map)]
+          coll3 (ingest/save-concept coll3-map)
+          ;; a granule saved with a nil delete time but an expired delete time in the xml
+          gran1 {:granule-ur "gran1" :delete-time "2000-01-01T12:00:00Z"}
+          ummg1 (dg/granule coll1 gran1)
+          xmlg1 (echo10/umm->echo10-xml ummg1)
+          gran1-map {:concept-type :granule
+                     :provider-id "PROV1"
+                     :native-id "gran1"
+                     :format "application/echo10+xml"
+                     :metadata xmlg1
+                     :extra-fields {:parent-collection-id (:concept-id umm1)}}
+          gran1 (ingest/save-concept gran1-map)]
       (ingest/tombstone-concept coll2-tombstone)

       (index/bulk-index-provider "PROV1")
@@ -62,11 +73,12 @@

       (testing "Expired documents are not indexed during bulk indexing and deleted documents
                get deleted."
-               (are [search expected]
-                    (d/refs-match? expected (search/find-refs :collection search))
-                    {:concept-id (:concept-id coll1)} [umm1]
-                    {:concept-id (:concept-id coll2)} []
-                    {:concept-id (:concept-id coll3)} [])))))
+               (are [search concept-type expected]
+                    (d/refs-match? expected (search/find-refs concept-type search))
+                    {:concept-id (:concept-id coll1)} :collection [umm1]
+                    {:concept-id (:concept-id coll2)} :collection []
+                    {:concept-id (:concept-id coll3)} :collection []
+                    {:concept-id (:concept-id umm1)} :granule [])))))


Add lein-try

Add lein-try

--- roles/clojure/files/profiles.clj
+++ roles/clojure/files/profiles.clj
@@ -18,7 +18,8 @@
                   [lein-kibit "0.0.8"]
                   [lein-marginalia "0.7.1"]
                   [lein-pprint "1.1.1"]
-                  [lein-swank "1.4.4"]]
+                  [lein-swank "1.4.4"]
+                  [lein-try "0.4.3"]]

         :injections [(require
                       '[alembic.still :refer [distill]]


s/irregular-(present|future|imperfect)/irregular/

--- src/babel/italiano/morphology/verbs.cljc
+++ src/babel/italiano/morphology/verbs.cljc
@@ -409,56 +409,9 @@
                   :agr {:number :plur
                         :person :3rd}}})}])

-(defn irregular-future [word]
+(defn irregular [word exception-map]
   (let [person (get-in word [:agr :person])
-        number (get-in word [:agr :number])
-        exception-map (get-in word [:future])]
-    (cond
-      (and (= person :1st) (= number :sing))
-      (get-in exception-map [:1sing])
-      (and (= person :2nd) (= number :sing))
-      (get-in exception-map [:2sing])
-      (and (= person :3rd) (= number :sing))
-      (get-in exception-map [:3sing])
-      (and (= person :1st) (= number :plur))
-      (get-in exception-map [:1plur])
-      (and (= person :2nd) (= number :plur))
-      (get-in exception-map [:2plur])
-      (and (= person :3rd) (= number :plur))
-      (get-in exception-map [:3plur])
-
-      true ;; failthrough: should usually not get here:
-      ;; TODO: describe when it might be ok, i.e. why log/warn not log/error.
-      (throw (Exception. (str "irregular-future could not match: " word))))))
-
-;; TODO: convert to (defn irregular-imperfect [word])
-;; as above with (defn irregular-future [word])
-(defn irregular-imperfect [word]
-  (let [person (get-in word [:agr :person])
-        number (get-in word [:agr :number])
-        exception-map (get-in word [:imperfect])]
-    (cond
-      (and (= person :1st) (= number :sing))
-      (get-in exception-map [:1sing])
-      (and (= person :2nd) (= number :sing))
-      (get-in exception-map [:2sing])
-      (and (= person :3rd) (= number :sing))
-      (get-in exception-map [:3sing])
-      (and (= person :1st) (= number :plur))
-      (get-in exception-map [:1plur])
-      (and (= person :2nd) (= number :plur))
-      (get-in exception-map [:2plur])
-      (and (= person :3rd) (= number :plur))
-      (get-in exception-map [:3plur])
-
-      true ;; failthrough: should usually not get here:
-      ;; TODO: describe when it might be ok, i.e. why log/warn not log/error.
-      (throw (Exception. (str "irregular-imperfect could not match: " word))))))
-
-(defn irregular-present [word]
-  (let [person (get-in word [:agr :person])
-        number (get-in word [:agr :number])
-        exception-map (get-in word [:present])]
+        number (get-in word [:agr :number])]
     (cond
       (and (= person :1st) (= number :sing)
            (get-in exception-map [:1sing]))
@@ -508,7 +461,6 @@
   (and (= :past (get-in word '(:infl)))
        (get-in word '(:passato))))

-
 (defn suffix-of [word]
   "compute the final character given a lexical entry and agreement info in :agr."
   ;; TODO: convert to .edn
@@ -582,21 +534,23 @@
 (defn conjugate [word]
   (cond
     (and
-     (= (get-in word '(:infl)) :future)
-     (map? (get-in word '(:future))))
-    (irregular-future word)
+     (= (get-in word [:infl]) :future)
+     (map? (get-in word [:future])))
+    (or (irregular word (get-in word [:future]))
+        (regular-future word))

     (= (get-in word [:infl]) :future)
     (regular-future word)

     (= (get-in word [:infl]) :conditional)
     (regular-conditional word)
-
+
     (and
-     (= (get-in word '(:infl)) :imperfect)
-     (map? (get-in word '(:imperfect))))
-    (irregular-imperfect word)
-
+     (= (get-in word [:infl]) :imperfect)
+     (map? (get-in word [:imperfect])))
+    (or (irregular word (get-in word [:imperfect]))
+        (regular-imperfect word))
+
     (= (get-in word [:infl]) :imperfect)
     (regular-imperfect word)

@@ -606,19 +560,16 @@
     (irregular-passato? word)
     (irregular-passato word)

-    (irregular-passato? word)
-    (irregular-passato word)
-
-    (= :past (get-in word '(:infl)))
+    (= :past (get-in word [:infl]))
     (regular-passato word)

     (and
-     (= (get-in word '(:infl)) :present)
-     (map? (get-in word '(:present)))
-     (not (nil? (irregular-present word))))
-    (irregular-present word)
-
-    (= (get-in word '(:infl)) :present)
+     (= (get-in word [:infl]) :present)
+     (map? (get-in word [:present])))
+    (or (irregular word (get-in word [:present]))
+        (regular-present word))
+
+    (= (get-in word [:infl]) :present)
     (regular-present word)

     (irregular-gerund? word)


add (defn new expand-replace-patterns); use with present tense

--- src/babel/italiano/morphology/verbs.cljc
+++ src/babel/italiano/morphology/verbs.cljc
@@ -13,10 +13,10 @@
       (nth remaining 1)]
      (group-by-two (rest (rest remaining))))))

-(def replace-patterns-future
+(defn expand-replace-patterns [unify-with patterns]
   (mapcat (fn [x]
             (map (fn [pair]
-                   {:u (unify {:synsem {:infl :future}}
+                   {:u (unify unify-with
                               (:agr x))
                     :p (:p pair)})
                  (map (fn [p]
@@ -24,151 +24,156 @@
                                                            :person :1st}}}}}
                          :p p})
                       (group-by-two (:p x)))))
-
-          [{:agr {:synsem {:subcat {:1 {:agr {:number :sing
-                                              :person :1st}}}}}
-            :p [
-                #"^([^ ]+)erò"     "$1are"
-                #"^([^ ]+)cherò"   "$1care" ;; cercherò -> cercare
-                #"^([^ ]+)chò"     "$1care" ;; carichò -> caricare
-                #"^([^ ]+)erò"     "$1arsi"
-                #"^([^ ]+)er[r]?ò" "$1ere"
-                #"^([^ ]+)erò"     "$1ersi"
-                #"^([^ ]+)erò"     "$1iare"
-                #"^([^ ]+)errò"    "$1ere"
-                #"^([^ ]+)errò"    "$1enere" ;; otterrò -> ottenere
-                #"^([^ ]+)irò"     "$1ire"
-                #"^([^ ]+)irò"     "$1irsi"
-                #"^([^ ]+)drò"     "$1dare"
-                #"^([^ ]+)drò"     "$1dere"
-                #"^([^ ]+)rò"      "$1re"
-                #"^([^ ]+)rò"      "$1ere" ;; potrò -> potere
-                #"^([^ ]+)trò"     "$1tere"
-                #"^([^ ]+)vrò"     "$1vere"
-                #"^([^ ]+)rrò"     "$1lere" ;; vorrò -> volere
-                #"^([^ ]+)rrò"     "$1nire" ;; verrò -> venire
-                       #"^([^ ]+)gherò"   "$1gare" ;; piegherò -> piegare
-                #"^([^ ]+)rrò"     "$1nere" ;; rimarrò -> rimanere
-                ]}
+          patterns))
+
+(def replace-patterns-future
+  (expand-replace-patterns
+   {:synsem {:infl :future}}
+   [{:agr {:synsem {:subcat {:1 {:agr {:number :sing
+                                       :person :1st}}}}}
+     :p [
+         #"^([^ ]+)erò"     "$1are"
+         #"^([^ ]+)cherò"   "$1care" ;; cercherò -> cercare
+         #"^([^ ]+)chò"     "$1care" ;; carichò -> caricare
+         #"^([^ ]+)erò"     "$1arsi"
+         #"^([^ ]+)er[r]?ò" "$1ere"
+         #"^([^ ]+)erò"     "$1ersi"
+         #"^([^ ]+)erò"     "$1iare"
+         #"^([^ ]+)errò"    "$1ere"
+         #"^([^ ]+)errò"    "$1enere" ;; otterrò -> ottenere
+         #"^([^ ]+)irò"     "$1ire"
+         #"^([^ ]+)irò"     "$1irsi"
+         #"^([^ ]+)drò"     "$1dare"
+         #"^([^ ]+)drò"     "$1dere"
+         #"^([^ ]+)rò"      "$1re"
+         #"^([^ ]+)rò"      "$1ere" ;; potrò -> potere
+         #"^([^ ]+)trò"     "$1tere"
+         #"^([^ ]+)vrò"     "$1vere"
+         #"^([^ ]+)rrò"     "$1lere" ;; vorrò -> volere
+         #"^([^ ]+)rrò"     "$1nire" ;; verrò -> venire
+         #"^([^ ]+)gherò"   "$1gare" ;; piegherò -> piegare
+         #"^([^ ]+)rrò"     "$1nere" ;; rimarrò -> rimanere
+         ]}

-           {:agr {:synsem {:subcat {:1 {:agr {:number :sing
-                                              :person :2nd}}}}}
-            :p [
-                #"^([^ ]+)ai"       "$1e" ;; farai -> fare
-                #"^([^ ]+)erai"     "$1are"
-                #"^([^ ]+)erai"     "$1arsi"
-                #"([^ ]+)cherai"    "$1care" ;; cercherai -> cercare
-                #"^([^ ]+)drai"     "$1dare"
-                #"^([^ ]+)erai"     "$1ersi"
-                #"^([^ ]+)errai"    "$1enere" ;; otterrai -> ottenere
-                #"^([^ ]+)er[r]?ai" "$1ere"
-                #"^([^ ]+)erai"     "$1iare"
-                #"^([^ ]+)errai"    "$1edere" ;; verrà -> vedere
-                #"^([^ ]+)gherai"   "$1gare" ;; piegherai -> piegare
-                #"^([^ ]+)ichai"    "$1icare"
-                #"^([^ ]+)irai"     "$1ire"
-                #"^([^ ]+)irai"     "$1irsi"
-                #"^([^ ]+)errai"    "$1enire" ;; sverrai -> svenire
-                #"^([^ ]+)rai"      "$1ere" ;; potrai -> potere
-                #"^([^ ]+)vrai"     "$1vere"
-                #"^([^ ]+)rrai"     "$1lere"  ;; vorrai -> volere
-                #"^([^ ]+)rrai"     "$1nere"  ;; rimarrai -> rimanere
-                ]}
-
-           {:agr {:synsem {:subcat {:1 {:agr {:number :sing
-                                              :person :3rd}}}}}
-            :p [
-                #"^([^ ]+)chà"     "$1care"
-                #"^([^ ]+)cherà"   "$1care"
-                #"^([^ ]+)drà"     "$1dare"
-                #"^([^ ]+)vrà"     "$1vere"
-                #"^([^ ]+)erà"     "$1are"
-                #"^([^ ]+)erà"     "$1arsi"
-                #"^([^ ]+)er[r]?à" "$1ere"
-                #"^([^ ]+)erà"     "$1ersi"
-                #"^([^ ]+)erà"     "$1iare"
-                #"^([^ ]+)errà"    "$1edere" ;; verrà -> vedere
-                #"^([^ ]+)errà"    "$1enere" ;; otterrà -> ottenere
-                #"^([^ ]+)gherà"   "$1gare" ;; piegherà -> piegare
-                #"^([^ ]+)irà"     "$1ire"
-                #"^([^ ]+)irà"     "$1irsi"
-                #"^([^ ]+)rà"      "$1re"
-                #"^([^ ]+)errà"    "$1enire" ;; sverrà -> svenire
-                #"^([^ ]+)rà"      "$1ere" ;; potrà -> potere
-                #"^([^ ]+)rrà"     "$1lere"  ;; vorrà -> volere
-                #"^([^ ]+)rrà"     "$1nere" ;; rimarrà -> rimanere
-                ]}
-
-           {:agr {:synsem {:subcat {:1 {:agr {:number :plur
-                                              :person :1st}}}}}
-            :p [
-                #"^([^ ]+)cheremo"   "$1care" ;; giocheremo -> giocare
-                #"^([^ ]+)eramo"     "$1ere"
-                #"^([^ ]+)eremo"     "$1are"
-                #"^([^ ]+)erremo"    "$1enere" ;; otterremo -> ottenere
-                #"([^ ]+)ichemo"     "$1icare" ;; carichemo -> caricare
-                #"^([^ ]+)remo"      "$1are" ;; "andremo" -> "andare"
-                #"^([^ ]+)remo"      "$1ere" ;; "avremo" -> "avere"
-                #"^([^ ]+)rremo"     "$1nere" ;; "terremo" -> "tenere"
-                #"^([^ ]+)emo"       "$1e" ;; "daremo" -> "dare"
-                #"^([^ ]+)gheremo"   "$1gare" ;; piegherete -> piegare
-                #"^([^ ]+)iremo"     "$1ire"
-                #"^([^ ]+)iremo"     "$1irsi"
-                #"^([^ ]+)erremo"    "$1edere" ;; verremo -> vedere
-                #"^([^ ]+)erremo"    "$1enire" ;; sverremo -> svenire
-                #"^([^ ]+)eremo"     "$1arsi"
-                #"^([^ ]+)eremo"     "$1ersi"
-                #"^([^ ]+)er[r]?emo" "$1ere"
-                #"^([^ ]+)rremo"     "$1lere"  ;; vorremo -> volere
-                #"^([^ ]+)eremo"     "$1iare"
-                ]}
-
-           {:agr {:synsem {:subcat {:1 {:agr {:number :plur
-                                              :person :2nd}}}}}
-            :p [
-                #"^([^ ]+)arete"     "$1are"
-                #"^([^ ]+)chete"     "$1care" ;; carichete -> caricare
-                #"^([^ ]+)cherete"   "$1care" ;; giocherete -> giocare
-                #"^([^ ]+)drete"     "$1dare"
-                #"^([^ ]+)erete"     "$1are"
-                #"^([^ ]+)erete"     "$1arsi"
-                #"^([^ ]+)erete"     "$1ersi"
-                #"^([^ ]+)erete"     "$1irsi"
-                #"^([^ ]+)gherete"   "$1gare" ;; piegherete -> piegare
-                #"^([^ ]+)er[r]?ete" "$1ere"
-                #"^([^ ]+)erete"     "$1iare"
-                #"^([^ ]+)errete"    "$1enere" ;; otterrete -> ottenere
-                #"^([^ ]+)irete"     "$1ire"
-                #"^([^ ]+)irete"     "$1irsi"
-                #"^([^ ]+)vrete"     "$1vere"
-                #"^([^ ]+)rete"      "$1ere" ;; potrete -> potere
-                #"^([^ ]+)rrete"     "$1lere"  ;; vorrete -> volere
-                #"^([^ ]+)rrete"     "$1nere" ;; rimarrete -> rimanere
-                #"^([^ ]+)rrete"     "$1nire" ;; verrete -> venire
-                ]}
-
-           {:agr {:synsem {:subcat {:1 {:agr {:number :plur
-                                              :person :3rd}}}}}
-            :p [
-                #"^([^ ]+)channo"     "$1care"
-                #"^([^ ]+)cheranno"   "$1care"
-                #"^([^ ]+)dranno"     "$1dare"
-                #"^([^ ]+)dranno"     "$1edere" ;; vedranno -> vedere
-                #"^([^ ]+)eranno"     "$1are"
-                #"^([^ ]+)eranno"     "$1iare"
-                #"^([^ ]+)eranno"     "$1arsi"
-                #"^([^ ]+)eranno"     "$1ersi"
-                #"^([^ ]+)erranno"    "$1enire"
-                #"^([^ ]+)erranno"    "$1enere" ;; otterranno -> ottenere
-                #"^([^ ]+)er[r]?anno" "$1ere"
-                #"^([^ ]+)gheranno"   "$1gare" ;; piegherete -> piegare
-                #"^([^ ]+)iranno"     "$1ire"
-                #"^([^ ]+)iranno"     "$1irsi"
-                #"^([^ ]+)ranno"      "$1re"
-                #"^([^ ]+)ranno"      "$1ere" ;; potranno -> potere
-                #"^([^ ]+)vranno"     "$1vere"
-                #"^([^ ]+)rranno"     "$1lere"  ;; vorranno -> volere
-                ]}]))
+    {:agr {:synsem {:subcat {:1 {:agr {:number :sing
+                                       :person :2nd}}}}}
+     :p [
+         #"^([^ ]+)ai"       "$1e" ;; farai -> fare
+         #"^([^ ]+)erai"     "$1are"
+         #"^([^ ]+)erai"     "$1arsi"
+         #"([^ ]+)cherai"    "$1care" ;; cercherai -> cercare
+         #"^([^ ]+)drai"     "$1dare"
+         #"^([^ ]+)erai"     "$1ersi"
+         #"^([^ ]+)errai"    "$1enere" ;; otterrai -> ottenere
+         #"^([^ ]+)er[r]?ai" "$1ere"
+         #"^([^ ]+)erai"     "$1iare"
+         #"^([^ ]+)errai"    "$1edere" ;; verrà -> vedere
+         #"^([^ ]+)gherai"   "$1gare" ;; piegherai -> piegare
+         #"^([^ ]+)ichai"    "$1icare"
+         #"^([^ ]+)irai"     "$1ire"
+         #"^([^ ]+)irai"     "$1irsi"
+         #"^([^ ]+)errai"    "$1enire" ;; sverrai -> svenire
+         #"^([^ ]+)rai"      "$1ere" ;; potrai -> potere
+         #"^([^ ]+)vrai"     "$1vere"
+         #"^([^ ]+)rrai"     "$1lere"  ;; vorrai -> volere
+         #"^([^ ]+)rrai"     "$1nere"  ;; rimarrai -> rimanere
+         ]}
+
+    {:agr {:synsem {:subcat {:1 {:agr {:number :sing
+                                       :person :3rd}}}}}
+     :p [
+         #"^([^ ]+)chà"     "$1care"
+         #"^([^ ]+)cherà"   "$1care"
+         #"^([^ ]+)drà"     "$1dare"
+         #"^([^ ]+)vrà"     "$1vere"
+         #"^([^ ]+)erà"     "$1are"
+         #"^([^ ]+)erà"     "$1arsi"
+         #"^([^ ]+)er[r]?à" "$1ere"
+         #"^([^ ]+)erà"     "$1ersi"
+         #"^([^ ]+)erà"     "$1iare"
+         #"^([^ ]+)errà"    "$1edere" ;; verrà -> vedere
+         #"^([^ ]+)errà"    "$1enere" ;; otterrà -> ottenere
+         #"^([^ ]+)gherà"   "$1gare" ;; piegherà -> piegare
+         #"^([^ ]+)irà"     "$1ire"
+         #"^([^ ]+)irà"     "$1irsi"
+         #"^([^ ]+)rà"      "$1re"
+         #"^([^ ]+)errà"    "$1enire" ;; sverrà -> svenire
+         #"^([^ ]+)rà"      "$1ere" ;; potrà -> potere
+         #"^([^ ]+)rrà"     "$1lere"  ;; vorrà -> volere
+         #"^([^ ]+)rrà"     "$1nere" ;; rimarrà -> rimanere
+         ]}
+
+    {:agr {:synsem {:subcat {:1 {:agr {:number :plur
+                                       :person :1st}}}}}
+     :p [
+         #"^([^ ]+)cheremo"   "$1care" ;; giocheremo -> giocare
+         #"^([^ ]+)eramo"     "$1ere"
+         #"^([^ ]+)eremo"     "$1are"
+         #"^([^ ]+)erremo"    "$1enere" ;; otterremo -> ottenere
+         #"([^ ]+)ichemo"     "$1icare" ;; carichemo -> caricare
+         #"^([^ ]+)remo"      "$1are" ;; "andremo" -> "andare"
+         #"^([^ ]+)remo"      "$1ere" ;; "avremo" -> "avere"
+         #"^([^ ]+)rremo"     "$1nere" ;; "terremo" -> "tenere"
+         #"^([^ ]+)emo"       "$1e" ;; "daremo" -> "dare"
+         #"^([^ ]+)gheremo"   "$1gare" ;; piegherete -> piegare
+         #"^([^ ]+)iremo"     "$1ire"
+         #"^([^ ]+)iremo"     "$1irsi"
+         #"^([^ ]+)erremo"    "$1edere" ;; verremo -> vedere
+         #"^([^ ]+)erremo"    "$1enire" ;; sverremo -> svenire
+         #"^([^ ]+)eremo"     "$1arsi"
+         #"^([^ ]+)eremo"     "$1ersi"
+         #"^([^ ]+)er[r]?emo" "$1ere"
+         #"^([^ ]+)rremo"     "$1lere"  ;; vorremo -> volere
+         #"^([^ ]+)eremo"     "$1iare"
+         ]}
+
+    {:agr {:synsem {:subcat {:1 {:agr {:number :plur
+                                       :person :2nd}}}}}
+     :p [
+         #"^([^ ]+)arete"     "$1are"
+         #"^([^ ]+)chete"     "$1care" ;; carichete -> caricare
+         #"^([^ ]+)cherete"   "$1care" ;; giocherete -> giocare
+         #"^([^ ]+)drete"     "$1dare"
+         #"^([^ ]+)erete"     "$1are"
+         #"^([^ ]+)erete"     "$1arsi"
+         #"^([^ ]+)erete"     "$1ersi"
+         #"^([^ ]+)erete"     "$1irsi"
+         #"^([^ ]+)gherete"   "$1gare" ;; piegherete -> piegare
+         #"^([^ ]+)er[r]?ete" "$1ere"
+         #"^([^ ]+)erete"     "$1iare"
+         #"^([^ ]+)errete"    "$1enere" ;; otterrete -> ottenere
+         #"^([^ ]+)irete"     "$1ire"
+         #"^([^ ]+)irete"     "$1irsi"
+         #"^([^ ]+)vrete"     "$1vere"
+         #"^([^ ]+)rete"      "$1ere" ;; potrete -> potere
+         #"^([^ ]+)rrete"     "$1lere"  ;; vorrete -> volere
+         #"^([^ ]+)rrete"     "$1nere" ;; rimarrete -> rimanere
+         #"^([^ ]+)rrete"     "$1nire" ;; verrete -> venire
+         ]}
+
+    {:agr {:synsem {:subcat {:1 {:agr {:number :plur
+                                       :person :3rd}}}}}
+     :p [
+         #"^([^ ]+)channo"     "$1care"
+         #"^([^ ]+)cheranno"   "$1care"
+         #"^([^ ]+)dranno"     "$1dare"
+         #"^([^ ]+)dranno"     "$1edere" ;; vedranno -> vedere
+         #"^([^ ]+)eranno"     "$1are"
+         #"^([^ ]+)eranno"     "$1iare"
+         #"^([^ ]+)eranno"     "$1arsi"
+         #"^([^ ]+)eranno"     "$1ersi"
+         #"^([^ ]+)erranno"    "$1enire"
+         #"^([^ ]+)erranno"    "$1enere" ;; otterranno -> ottenere
+         #"^([^ ]+)er[r]?anno" "$1ere"
+         #"^([^ ]+)gheranno"   "$1gare" ;; piegherete -> piegare
+         #"^([^ ]+)iranno"     "$1ire"
+         #"^([^ ]+)iranno"     "$1irsi"
+         #"^([^ ]+)ranno"      "$1re"
+         #"^([^ ]+)ranno"      "$1ere" ;; potranno -> potere
+         #"^([^ ]+)vranno"     "$1vere"
+         #"^([^ ]+)rranno"     "$1lere"  ;; vorranno -> volere
+
+         ]}]))

 (def replace-patterns-past-tense
   [


CMR-204: modified unit test

CMR-204: modified unit test

--- test/cmr/indexer/test/services/index_service.clj
+++ test/cmr/indexer/test/services/index_service.clj
@@ -25,7 +25,7 @@
                      :entry-title dataset-id
                      :product {:short-name short-name
                                :version-id version-id}
-                     :revision-date  "2014-04-30T10:32:30.000Z"
+                     :revision-date  nil
                      :temporal {:range-date-times [{:beginning-date-time (t/date-time 1996 2 24 22 20 41)
                                                     :ending-date-time (t/date-time 1997 3 25 23 23 43 123)}]}
                      :projects projects
@@ -41,7 +41,7 @@
                   :short-name.lowercase "minimal"
                   :version-id version-id
                   :version-id.lowercase "1"
-                  :revision-date  "2014-04-30T10:32:30.000Z"
+                  :revision-date  nil
                   :start-date "1996-02-24T22:20:41.000Z"
                   :end-date "1997-03-25T23:23:43.123Z"
                   :project-sn ["ESI" "EVI" "EPI"]


meaningless comment removed

meaningless comment removed

--- src/clj/backtype/storm/daemon/nimbus.clj
+++ src/clj/backtype/storm/daemon/nimbus.clj
@@ -783,7 +783,6 @@
                                     (get conf k)))))]
     ;; topology level serialization registrations take priority
     ;; that way, if there's a conflict, a user can force which serialization to use
-    ;; ABA = AB
     ;; append component conf to storm-conf
     (merge storm-conf
            {TOPOLOGY-KRYO-DECORATORS (get-merged-conf-val TOPOLOGY-KRYO-DECORATORS distinct)


use update-fn in reconciliations

use update-fn in reconciliations

--- src/clj_money/models/reconciliations.clj
+++ src/clj_money/models/reconciliations.clj
@@ -66,8 +66,7 @@
   ([reconciliation]
    (before-save nil reconciliation))
   ([_ reconciliation]
-   (-> reconciliation
-       (update-in [:status] name))))
+   (update-in reconciliation [:status] name)))

 (defn- append-transaction-item-refs
   [reconciliation storage]
@@ -230,15 +229,28 @@
        before-validation
        (validation/validate spec rules)))

+(defn- item-refs->date-range
+  [item-refs]
+  (when (seq item-refs)
+    ((juxt first last) (->> item-refs
+                            (map second)
+                            sort))))
+
 (defn- after-save
-  [storage {item-refs :item-refs :as reconciliation}]
+  [storage {:keys [id item-refs] :as reconciliation}]
   ; Set reconciled flag on specified transaction items
-  (when (and item-refs (seq item-refs))
-    (doseq [[item-ref transaction-date] item-refs]
-      (set-transaction-item-reconciled storage
-                                       (:id reconciliation)
-                                       item-ref
-                                       transaction-date)))
+  (let [date-range (item-refs->date-range item-refs)]
+    (when date-range
+      (unreconcile-transaction-items-by-reconciliation-id
+        storage
+        id
+        date-range))
+    (when (and item-refs (seq item-refs))
+      (doseq [[item-ref transaction-date] item-refs]
+        (set-transaction-item-reconciled storage
+                                         id
+                                         item-ref
+                                         transaction-date))))
   reconciliation)

 (defn- create*
@@ -266,32 +278,20 @@
   (let [existing (find-by-id storage (Integer. (:id reconciliation)))]
     (assoc reconciliation :account-id (:account-id existing))))

-(defn- item-refs->date-range
-  [item-refs]
-  (when (seq item-refs)
-    ((juxt first last) (->> item-refs
-                            (map second)
-                            sort))))
-
-(defn update
-  "Updates the specified reconciliation"
-  [storage-spec reconciliation]
-  (with-storage [s storage-spec]
-    (let [validated (->> reconciliation
-                         (set-account-id s)
-                         (validate ::existing-reconciliation (validation-rules s)))]
-      (if (validation/valid? validated)
-        (let [date-range (item-refs->date-range (:item-ds validated))]
-          (->> validated
-               before-save
-               (update-reconciliation s))
-          (when date-range
-            (unreconcile-transaction-items-by-reconciliation-id s (:id validated) date-range))
-          (when (and (:item-refs validated) (seq (:item-refs validated))) ; TODO: remove this redundancy wth create
-            (doseq [[item-ref date] (:item-refs validated)]
-              (set-transaction-item-reconciled s (:id validated) item-ref date)))
-          (reload s validated))
-        validated))))
+(defn- update*
+  [storage reconciliation]
+  )
+
+(def update
+  (update-fn {:spec ::existing-reconciliation
+              :before-validation before-validation
+              :update update-reconciliation
+              :before-save before-save
+              :after-save after-save
+              :rules-fn validation-rules
+              :after-read after-read
+              :coercion-rules coercion-rules
+              :reload reload}))

 (defn delete
   "Removes the specified reconciliation from the system. (Only the most recent may be deleted.)"


tilemap generation can include offsets

tilemap generation can include offsets

--- src/cljs/infinitelives/pixi/tilemap.cljs
+++ src/cljs/infinitelives/pixi/tilemap.cljs
@@ -21,20 +21,30 @@

 (defn make-tile-sprites [{texture-map :texture-map
                           [tile-width tile-height] :tile-size}
-                         tile-map]
+                         tile-map
+                         & {:keys [xoffset yoffset] :or {xoffset 0 yoffset 0}}
+                         ]
   (into
    {}
    (filter identity
            (for [row (range (count tile-map))
                  col (range (count (first tile-map)))]
              (let [char (nth (tile-map row) col)]
-               (when char [[col row]
+               (when char [[(+ xoffset col) (+ yoffset row)]
                            (s/make-sprite (texture-map char)
-                                          :x (* tile-width col) :y (* tile-height row)
+                                          :x (* tile-width (+ xoffset col)) :y (* tile-height (+ yoffset row))
                                           :xhandle 0 :yhandle 0)]))))))

-(defn make-tile-map [tile-mapping tile-map-chars]
-  (strs->keymap tile-mapping tile-map-chars))
+(defn make-tile-map [tile-mapping tile-map-chars & {:keys [xoffset yoffset] :or {xoffset 0 yoffset 0}}]
+  (let [orig
+        (strs->keymap tile-mapping tile-map-chars)
+        height (count orig)
+        width (count (first orig))
+        empty-line (into [] (repeat width nil))
+        padded (concat (repeat yoffset empty-line) orig)
+        padded2 (for [line padded] (concat (repeat xoffset nil) line))
+        ]
+    (mapv vec padded2)))

 (defn make-tilemap [sprite-set & opts]
   (apply s/make-container


logging

logging

--- src/clojure/zensols/nlparse/stanford.clj
+++ src/clojure/zensols/nlparse/stanford.clj
@@ -250,11 +250,11 @@
       (swap! pipeline-inst
              (fn [pl]
                (if pl
-                 (do (log/infof "reusing pipeline <%s>" (trunc pl))
+                 (do (log/debugf "reusing pipeline <%s>" (trunc pl))
                      pl)
                  (let [pl (->> (map make-pipeline-component pipeline-config)
                                (remove nil?))]
-                   (log/infof "creating new pipeline <%s>" (trunc pl))
+                   (log/debugf "creating new pipeline <%s>" (trunc pl))
                    pl)))))))


Added note that fotd-autoconstruction is a historical artifact.

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -1019,7 +1019,7 @@
     argmap))

 (defn fotd-autoconstruction
-  "The current 'flavor of the day' version of autoconstruction, used by specifying
+  "A historical 'flavor of the day' version of autoconstruction, used by specifying
   :autoconstructive-fotd true in the arguments to pushgp. Expect changes. Other
   autoconstruction-related parameters may or may not have any effect when using the
   fotd."


Updated definition of protocol.

Updated definition of protocol.

Also pulled in implementation for use as API.

--- src/cmr/dev/env/manager/watcher/core.clj
+++ src/cmr/dev/env/manager/watcher/core.clj
@@ -3,11 +3,24 @@
     [cmr.dev.env.manager.watcher.impl.darwin :as darwin]
     [cmr.dev.env.manager.watcher.impl.hawk :as hawk]
     [cmr.dev.env.manager.watcher.impl.linux :as linux]
-    [cmr.dev.env.manager.watcher.impl.nio :as nio]))
+    [cmr.dev.env.manager.watcher.impl.nio :as nio])
+  (:import
+    (cmr.dev.env.manager.watcher.impl.hawk HawkWatcher)))
+
+(def default-watcher-type :hawk)

 (defprotocol Watcher
-  (add [this type coll])
-  (add-dir [this dir])
-  (add-dirs [this dirs])
-  (add-file [this file])
-  (add-files [this files]))
+  (add-path [this path])
+  (add-paths [this paths])
+  (handle-event [this event]))
+
+(extend HawkWatcher
+        Watcher
+        hawk/behaviour)
+
+(defn create-watcher
+  ([service-key messenger]
+    (create-watcher default-watcher-type service-key messenger))
+  ([type service-key messenger]
+    (case type
+      :hawk (hawk/create-watcher service-key messenger))))


(maint) test: Use node_state = any to query for all data

--- test/puppetlabs/puppetdb/acceptance/node_ttl.clj
+++ test/puppetlabs/puppetdb/acceptance/node_ttl.clj
@@ -98,9 +98,7 @@
                nodes (fn []
                        (->> {:query ["from" "nodes"
                                      ["extract" ["certname" "expired"]
-                                      ["or"
-                                       ["=" "node_state" "active"]
-                                       ["=" "node_state" "inactive"]]]]}
+                                      ["=" "node_state" "any"]]]}
                             (svc-utils/post (svc-utils/query-url-str ""))
                             :body
                             slurp
@@ -109,9 +107,7 @@
                facts (fn []
                        (->> {:query ["from" "factsets"
                                      ["extract" ["certname" "facts"]
-                                      ["or"
-                                       ["=" "node_state" "active"]
-                                       ["=" "node_state" "inactive"]]]]}
+                                      ["=" "node_state" "any"]]]}
                             (svc-utils/post (svc-utils/query-url-str ""))
                             :body
                             slurp


Remove health column

Remove health column

--- frontend/src/cruncher/views.cljs
+++ frontend/src/cruncher/views.cljs
@@ -129,7 +129,6 @@
               (dom/td nil (:name pokemon))
               (dom/td nil (:nickname pokemon))
               (dom/td nil (:cp pokemon))
-              (dom/td nil (:health pokemon))
               (dom/td nil (:individual_percentage pokemon))
               (dom/td nil (:individual_attack pokemon))
               (dom/td nil (:individual_defense pokemon))
@@ -159,7 +158,6 @@
                                            (vlib/sortable-table-header :name "Name")
                                            (vlib/sortable-table-header :nickname "Nickname")
                                            (vlib/sortable-table-header :cp "CP")
-                                           (vlib/sortable-table-header :health "Health")
                                            (vlib/sortable-table-header :individual_percentage "IV % Perfect")
                                            (vlib/sortable-table-header :individual_attack "IV Attack")
                                            (vlib/sortable-table-header :individual_defense "IV Defense")


Use set instead of distinct

Use set instead of distinct

--- scheduler/src/cook/scheduler/constraints.clj
+++ scheduler/src/cook/scheduler/constraints.clj
@@ -80,9 +80,8 @@
   [job]
   (->> (:job/instance job)
        (remove #(true? (:instance/preempted? %)))
-       (mapv :instance/hostname)
-       distinct
-       doall))
+       (map :instance/hostname)
+       set))

 (defn build-novel-host-constraint
   "Constructs a novel-host-constraint.


refactored challenge response into separate functions

--- src/credo/api/database/init.clj
+++ src/credo/api/database/init.clj
@@ -137,14 +137,16 @@
 (issue-invite 17592186045425 17592186045426 17592186045428 "try some science in your diet")
 (issue-invite 17592186045426 17592186045427 17592186045428 "you won't make it")

-(defn respond-to-invite [invite response]
-  (let [t [{:db/id invite
-            :invite/status
-            (cond (= response "accept") :invite.status/accepted
-                  (= response "decline") :invite.status/declined)}]
+(defn accept-invite [invite]
+  (let [t [{:db/id invite :invite/status :invite.status/accepted}]
         tx @(d/transact conn t)]
     (str tx)))

-(respond-to-invite 17592186045448 "accept")
-(respond-to-invite 17592186045454 "decline")
+(defn decline-invite [invite]
+  (let [t [{:db/id invite :invite/status :invite.status/declined}]
+        tx @(d/transact conn t)]
+    (str tx)))

+(accept-invite 17592186045448)
+(decline-invite 17592186045454)
+


Renamed client endpoint

Renamed client endpoint

--- src/cylon/oauth/impl/client.clj
+++ src/cylon/oauth/impl/client.clj
@@ -63,7 +63,7 @@

   WebService
   (request-handlers [this]
-    {::grant
+    {::redirection-endpoint
      (->
       (fn [req]
         (let [params (:query-params req)
@@ -134,7 +134,7 @@
                  :body "You have logged out"
                  })})

-  (routes [this] ["/" {"oauth/grant" {:get ::grant}
+  (routes [this] ["/" {"oauth/grant" {:get ::redirection-endpoint}
                        "logout" {:get ::logout}}])
   (uri-context [this] "")


response header objects

response header objects

--- src/ardoq/swagger/map_openapi_3_spec.clj
+++ src/ardoq/swagger/map_openapi_3_spec.clj
@@ -44,7 +44,7 @@
     spec-map))

-(declare transform-schema-map transform-schema-list)
+(declare transform-schema-map transform-schema-list transform-parameter-objects)

 (def schema-table-fields
   [:format
@@ -110,7 +110,7 @@
           (update-in [:swagger-object key] assoc :parent parent-key)
           (update-in [:swagger-object key] assoc :type :OpenAPI-Response)
           (update-in [:swagger-object key] assoc :description (:description response-object-spec))
-          ))))
+          (transform-parameter-objects (:headers response-object-spec) key :OpenAPI-Header)))))

 (defn transform-responses-map [data response-specs parent-key]
@@ -136,30 +136,30 @@
    :allowReserved
    :example])

-(defn transform-parameter-object [parameter-name parent-key data parameter-object-spec]
+
+(defn transform-parameter-object [parameter-name parent-key data parameter-object-spec spec-type]
   (if-let [ref (:$ref parameter-object-spec)]
     (-> data
         (update-in [:references] conj {:source-path parent-key :target-path ref}))
-    (let [key (str parent-key "/" parameter-name)
-          data (-> data
-                   (update-in [:swagger-object key] assoc :name (:name parameter-object-spec))
-                   (update-in [:swagger-object key] assoc :type :OpenAPI-Parameter)
-                   (update-in [:swagger-object key] assoc :parent parent-key)
-                   (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/parameter-object.tpl" parameter-object-spec parameter-table-fields)))]
-
-      (if-let [schema-object-spec (:schema parameter-object-spec)]
-        (transform-schema-object :schema key data (:schema parameter-object-spec))
-        data))))
-
-
-(defn transform-parameter-objects [data spec parent-key]
+    (let [key (str parent-key "/" parameter-name)]
+      (-> data
+          (update-in [:swagger-object key] assoc :name parameter-name)
+          (update-in [:swagger-object key] assoc :type spec-type)
+          (update-in [:swagger-object key] assoc :parent parent-key)
+          (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/parameter-object.tpl" parameter-object-spec parameter-table-fields))
+          (#(if-let [schema-object-spec (:schema parameter-object-spec)]
+              (transform-schema-object :schema key % (:schema parameter-object-spec))
+              %))))))
+
+
+(defn transform-parameter-objects [data param-spec parent-key spec-type]
   (reduce
     (fn [data parameter-object-spec]
       (if (map-entry? parameter-object-spec)
-        (transform-parameter-object (key parameter-object-spec) parent-key data (val parameter-object-spec))
-        (transform-parameter-object (:name parameter-object-spec) parent-key data parameter-object-spec)))
-    data
-    (:parameters spec)))
+        (transform-parameter-object (name (key parameter-object-spec)) parent-key data (val parameter-object-spec) spec-type)
+        (transform-parameter-object (:name parameter-object-spec) parent-key data parameter-object-spec spec-type)))
+    data
+    param-spec))

 (defn transform-operation-object [parent-key data [operation-object-key operation-object-spec]]
@@ -169,7 +169,7 @@
         (update-in [:swagger-object key] assoc :type :OpenAPI-Operation)
         (update-in [:swagger-object key] assoc :parent parent-key)
         (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/operation-object.tpl" operation-object-spec [:tags :operationId]))
-        (transform-parameter-objects operation-object-spec key))))
+        (transform-parameter-objects (:parameters operation-object-spec) key :OpenAPI-Parameter))))

 (defn transform-operation-objects [data path-spec parent-key]
@@ -188,7 +188,7 @@
                  (update-in [:swagger-object key] assoc :parent parent-key)
                  (update-in [:swagger-object key] assoc :description (common/render-resource-strings "templates/path-object.tpl" path-object-spec))
                  (transform-operation-objects path-object-spec key)
-                 (transform-parameter-objects path-object-spec key))]
+                 (transform-parameter-objects (:parameters path-object-spec) key :OpenAPI-Parameter))]
     (name path-object-key)
     (if-let [ref (:$ref path-object-spec)]
       (-> data
@@ -210,7 +210,8 @@
     (-> data
         (transform-schema-map (:schemas components-spec) "#/components/schemas")
         (transform-responses-map (:responses components-spec) "#/components/responses")
-        (transform-parameter-objects components-spec "#/components/parameters")
+        (transform-parameter-objects (:parameters components-spec) "#/components/parameters" :OpenAPI-Parameter)
+        (transform-parameter-objects (:headers components-spec) "#/components/headers" :OpenAPI-Header)

         )))


Add more paths to :clean-targets for simple example

--- examples/simple/project.clj
+++ examples/simple/project.clj
@@ -9,7 +9,12 @@

   :plugins [[lein-shadow "0.1.5"]]

-  :clean-targets ^{:protect false} ["resources/public/js"]
+  :clean-targets ^{:protect false} [:target-path
+                                    ".shadow-cljs"
+                                    "shadow-cljs.edn"
+                                    "package.json"
+                                    "package-lock.json"
+                                    "resources/public/js"]

   :shadow-cljs {:nrepl  {:port 8777}


Upgrade simple example ClojureScript to 1.10.597

--- examples/simple/project.clj
+++ examples/simple/project.clj
@@ -1,7 +1,7 @@
 (defproject simple "lein-git-inject/version"

   :dependencies [[org.clojure/clojure       "1.10.1"]
-                 [org.clojure/clojurescript "1.10.520"
+                 [org.clojure/clojurescript "1.10.597"
                   :exclusions [com.google.javascript/closure-compiler-unshaded
                                org.clojure/google-closure-library
                                org.clojure/google-closure-library-third-party]]


Use the navigation data to derive the settings route

This is the same technique the V1 UI uses in `settings-link` in
`src-cljs/frontend/components/header.cljs`

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -1537,7 +1537,6 @@
            (when has-write-settings?
              (om/build rebuild-actions-v2 {:build build :project project}))
            [:a.build-action
-            {:href (routes/v1-project-settings {:org  (get-in data (conj state/project-plan-path :org_name))
-                                                :repo (get-in data (conj state/project-path :reponame))})}
+            {:href (routes/v1-project-settings (:navigation-data data))}
             [:img.dashboard-icon {:src (common/icon-path "QuickLink-Settings")}]
             "Project Settings"]])))))


Point chevrons right instead of up when artifacts are closed

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -392,7 +392,7 @@
                                :display "inline"}
                     :on-click toggler}
                    [:i.fa.artifact-toggle-caret
-                    {:class (if closed? "fa-angle-up" "fa-angle-down")}]
+                    {:class (if closed? "fa-angle-right" "fa-angle-down")}]
                    " "
                    tag]
                   tag)


Fixing #27: all fns have unqiue class names now

--- src/main/clojure/powderkeg/ouroboros.clj
+++ src/main/clojure/powderkeg/ouroboros.clj
@@ -125,13 +125,86 @@
     (.accept rdr class-visitor 0)
     (.toByteArray cw)))

-(def var-transform
+(defmacro ^:private proxy-unique-fns-method-visitor [mv]
+  (let [methods+arglists
+        (into [] (keep #(when (and (.startsWith (.getName %) "visit") (= Void/TYPE (.getReturnType %)))
+                          [(.getName %) (repeatedly (count (.getParameterTypes %)) gensym)]))
+          (.getMethods clojure.asm.MethodVisitor))
+        sm (gensym "sm")]
+    `(let [insns# ~(into #{}
+                     (comp (map first) (filter #(.endsWith % "Insn")) (map keyword))
+                     methods+arglists)
+           mv# ^clojure.asm.MethodVisitor ~mv
+           q# (java.util.ArrayDeque.)
+           meths# ~(into {}
+                     (for [[name arglist] methods+arglists]
+                       [(keyword name)
+                        `(fn [mv# [~@arglist]]
+                           (~(symbol (str \. name)) mv# ~@arglist))]))
+           flush!# (fn flush!#
+                     ([] (flush!# #{}))
+                     ([black-list#]
+                       (when-some [[meth# args#] (.poll q#)]
+                         (when-not (black-list# meth#) ((meths# meth#) mv# args#))
+                         (recur black-list#))))
+           ~sm (fn [meth# args#]
+                 (->
+                   (->> q# (map first) (keep insns#) count)
+                   (case
+                     0 (and (= meth# :visitVarInsn)
+                         (let [[op# idx#] args#]
+                           (and (= op# clojure.asm.Opcodes/ALOAD)
+                             (= idx# 7)))) ; brittle
+                     1 (or (not (insns# meth#))
+                         (and (= meth# :visitJumpInsn)
+                          (let [[op# label#] args#]
+                            (= op# clojure.asm.Opcodes/IFNULL))))
+                     2 (or (not (insns# meth#))
+                         (when
+                           (and (= meth# :visitTypeInsn)
+                             (let [[op# type#] args#]
+                               (and (= op# clojure.asm.Opcodes/NEW)
+                                 (= type# "java/lang/StringBuilder"))))
+                           :done))
+                     nil)
+                   (case
+                     (nil false) (do
+                                   (flush!#)
+                                   ((meths# meth#) mv# args#))
+                     :done (do (flush!# insns#) ((meths# meth#) mv# args#))
+                     true (.add q# [meth# args#]))))]
+       (proxy [clojure.asm.MethodVisitor] [clojure.asm.Opcodes/ASM4 mv#]
+         ~@(for [[name arglist] methods+arglists]
+             `(~(symbol name) [~@arglist]
+                (~sm ~(keyword name) [~@arglist])))))))
+
+(defn unique-fns [bytes]
+  (let [rdr (clojure.asm.ClassReader. bytes)
+        cw (clojure.asm.ClassWriter. 0)
+        class-visitor
+        (proxy [clojure.asm.ClassVisitor] [clojure.asm.Opcodes/ASM4 cw]
+          (visitMethod [access method-name mdesc sig exs]
+            (let [mv (.visitMethod cw access method-name mdesc sig exs)]
+              (if (= method-name "parse")
+                (proxy-unique-fns-method-visitor mv)
+                mv))))]
+    (.accept rdr class-visitor 0)
+    (.toByteArray cw)))
+
+(defn transform-classes-once
+  "Runs a transformation (function from bytes to bytes) on the specified classes once."
+  [instrumentation classes bytes-transform]
   "ClassFileTransfomer which instruments clojure.lang.Var."
-  (reify java.io.Serializable
-    java.lang.instrument.ClassFileTransformer
-    (transform [_ loader classname class domain bytes]
-      (when (= "clojure/lang/Var" classname)
-        (watch-vars bytes)))))
+  (let [classes (set classes)
+        transformer (reify java.io.Serializable
+                      java.lang.instrument.ClassFileTransformer
+                      (transform [_ loader classname class domain bytes]
+                        (when (classes class) (bytes-transform bytes))))]
+    (.addTransformer instrumentation transformer true)
+    (try
+      (.retransformClasses instrumentation (into-array classes))
+      (finally
+        (.removeTransformer instrumentation transformer)))))

 (defn ^java.util.jar.Manifest manifest
   "Creates an MANIFEST.MF out of a map"
@@ -206,6 +279,9 @@
        (println "done!"))

      (print "Instrumenting clojure.lang.Var... ")
-     (.addTransformer powderkeg.Agent/instrumentation var-transform true)
-     (.retransformClasses powderkeg.Agent/instrumentation (into-array [clojure.lang.Var]))
+     (transform-classes-once powderkeg.Agent/instrumentation [clojure.lang.Var] watch-vars)
+     (println "done!")
+
+     (print "Patching clojure.lang.Compiler... ")
+     (transform-classes-once powderkeg.Agent/instrumentation [clojure.lang.Compiler$FnExpr] unique-fns)
      (println "done!")))


Add more actions and objects.

Add more actions and objects.

--- src/mermaid_ldjam/core.cljs
+++ src/mermaid_ldjam/core.cljs
@@ -6,9 +6,16 @@
   ; Set frame rate to 30 frames per second.
   (q/frame-rate 30)
   {:entities
-    {:bucket {:x 50 :y 150 :width 20 :height 50}
-     :window {:x 10 :y 10 :width 50 :height 50}
+    {;objects
+     :bucket {:x 50 :y 150 :width 20 :height 50}
+     :window {:x 400 :y 50 :width 50 :height 50}
+     :window-open {:x 460 :y 50 :width 50 :height 50 :hidden true}
      :stone {:x 200 :y 100 :width 20 :height 40 :hidden true}
+     :broom {:x 300 :y 100 :width 20 :height 40 :hidden true}
+     :starfish {:x 200 :y 200 :width 20 :height 40}
+     :bottle {:x 300 :y 300 :width 20 :height 40}
+     :seagull {:x 400 :y 200 :width 20 :height 40 :hidden true}
+     ;actions
      :look {:x 10 :y (- (q/height) 20) :width 50 :height 20 :label "Look"}
      :flap {:x 60 :y (- (q/height) 20) :width 50 :height 20 :label "Flap"}}
    :current-status "Hello little mermaid."
@@ -22,15 +29,34 @@
         new-entity (dissoc entity :hidden)]
     (assoc-in state [:entities hidden-entity] new-entity)))

+(defn win-game [state]
+  (q/background 90 200 21)
+  state)
+
 (def actions-map
   {[:look :window] {:text "You look outside the window and see your home, the mighty ocean." :action []}
    [:look :bucket] {:text "You see a bucket. Maybe there is something inside." :action []}
-   [:flap :window] {:text "You're too far away for that"}
+   [:look :stone] {:text "There are stones on the floor. You can easily reach them" :action []}
+   [:look :bottle] {:text "There is a bottle of wine on the floor. You can't get drunk by yourself." :action []}
+   [:look :seagull] {:text "It's a seagull looking for company!"}
+   [:look :broom] {:text "There is a broom. You wonder if it was there this whole time."}
+   [:look :window-open] {:text "The window is open. You can see the sea. You can feel the breeze."}
+   [:flap :window] {:text "You're too far away. You can't reach the window."}
    [:flap :bucket] {:text "You flap against the bucket. BÄM. The bucket falls over and stones spill on the floor." :action [unhide :stone]}
-   [:look :stone] {:text "There are stones on the floor. You can easily reach them" :action []}})
+   [:flap :stone] {:text "You flap frustratedly against the stones. That's no use."}
+   [:flap :starfish] {:text "You flap against the starfish. 'Ouch!' - it cries."}
+   [:stone :window] {:text "You throw a stone against the window. Crash! The window shatters in tiny pieces." :action [unhide :window-open]}
+   [:starfish :window] {:text "You throw the starfish against the window. It bounces back and gives you a disappointed look."}
+   [:starfish :window-open] {:text "You throw the starfish out the window." :action [unhide :seagull]}
+   [:bottle :seagull] {:text "You start drinking with the seagull. The seagull drunkenly points in the corner." :action [unhide :broom]}
+   [:bottle :starfish] {:text "You hand the bottle to the starfish. It takes a sip of wine, but it's more of a whiskey person."}
+   [:broom :window-open] {:text "You catapult yourself out of the room. FREEDOM! You won." :action [win-game]}
+   [:broom :bucket] {:text "You try to put the broom in the bucket. That's where the broom belongs, but you're not here to clean up."}
+   })

 (defn point-in-rect? [entity mx my]
   (and
+   (not (:hidden entity))
    (> mx (:x entity))
    (< mx (+ (:x entity) (:width entity)))
    (> my (:y entity))
@@ -62,13 +88,15 @@

 (defn update-current-action [state]
   (let [last-clicked (:last-clicked state)
-        todo (get actions-map last-clicked)]
+        todo (get actions-map last-clicked)
+        actions-count (count (:action todo))]
     (if (and (= (count last-clicked) 2) todo)
       (let [new-state
             (assoc state :current-status (:text todo))]
-        (if (> (count (:action todo)) 0)
-          ((first (:action todo)) new-state (last (:action todo)))
-          new-state))
+        (cond
+          (= actions-count 1) ((first (:action todo)) new-state)
+          (= actions-count 2) ((first (:action todo)) new-state (last (:action todo)))
+          :else new-state))
       state)))

 (defn update-state [state]
@@ -89,6 +117,7 @@
           :else (q/fill 255))
         (q/rect (:x entity) (:y entity) (:width entity) (:height entity))
         (q/fill 0)
+        (q/text-align :left)
         (q/text (:label entity) (:x entity) (+ (:y entity) (:height entity))))))

 (defn draw-entities [state]


Correctly decompile :num-outs mode args (which are absent in the compiled arg-list) in unified synthdef structure.

--- src/overtone/repl/debug.clj
+++ src/overtone/repl/debug.clj
@@ -76,17 +76,25 @@
                             input-specs input-specs]
                        (if (empty? input-specs)
                          res
-                         (if (or (ugen-sequence-mode? (:mode (first input-specs)))
-                                 (= true (:array (first input-specs))))
-                           (let [arg-seq (drop (dec (count input-specs)) inputs)
-                                 inputs  (drop-last (count arg-seq) inputs)]
-                             (recur (assoc res (keyword (:name (first input-specs))) (vec arg-seq))
-                                    inputs
-                                    (rest input-specs)))
-
-                           (recur (assoc res (keyword (:name (first input-specs))) (first inputs))
-                                  (rest inputs)
-                                  (rest input-specs))))))))
+                         (let [in-spec (first input-specs )]
+                           (cond
+                            (or (ugen-sequence-mode? (:mode in-spec))
+                                (= true (:array in-spec)))
+                            (let [arg-seq (drop (dec (count input-specs)) inputs)
+                                  inputs  (drop-last (count arg-seq) inputs)]
+                              (recur (assoc res (keyword (:name in-spec)) (vec arg-seq))
+                                     inputs
+                                     (rest input-specs)))
+
+                            (= :num-outs (:mode in-spec))
+                            (recur (assoc res (keyword (:name in-spec)) (:n-outputs ug))
+                                   inputs
+                                   (rest input-specs))
+
+                            :else
+                            (recur (assoc res (keyword (:name in-spec)) (first inputs))
+                                   (rest inputs)
+                                   (rest input-specs)))))))))
        ugens
        (range)))


oh, you print statements

oh, you print statements

--- src/overtone/sc/sc_lang.clj
+++ src/overtone/sc/sc_lang.clj
@@ -61,8 +61,7 @@
   (z/root (zip-map
             #(if-let [op ({"add:" "+",  "mul:" "*"} (z/node %))]
                (let  [right (z/node (z/right %))
-                      left (z/lefts %)
-                      _ (println op left right)]
+                      left (z/lefts %)]
                  (-> %
                    z/up
                    (z/replace (list op left right))))


cleanup nimbus code

cleanup nimbus code

--- src/clj/backtype/storm/daemon/nimbus.clj
+++ src/clj/backtype/storm/daemon/nimbus.clj
@@ -255,12 +255,12 @@
        )))

 (defn- available-slots
-  [nimbus callback topologies]
+  [nimbus topologies]
   (let [storm-cluster-state (:storm-cluster-state nimbus)
         ^INimbus inimbus (:inimbus nimbus)

-        supervisor-ids (.supervisors storm-cluster-state callback)
-        supervisor-infos (all-supervisor-info storm-cluster-state callback)
+        supervisor-ids (.supervisors storm-cluster-state nil)
+        supervisor-infos (all-supervisor-info storm-cluster-state nil)
         existing-slots (assigned-slots storm-cluster-state)

         supervisor-details (for [[id info] supervisor-infos]
@@ -367,6 +367,8 @@
              "Assignment: " (pr-str existing-assignment) "\n"
              "Heartbeat cache: " (pr-str (@(:heartbeats-cache nimbus) (.getId topology-details)))
              )
+  ;; TODO: need to consider all executors associated with a dead executor (in same slot) dead as well,
+  ;; don't just rely on heartbeat being the same
   (let [conf (:conf nimbus)
         storm-id (.getId topology-details)
         executor-start-times (:executor->start-time-secs existing-assignment)
@@ -511,6 +513,16 @@

 ;; TODO: slots that have dead executor should be reused as long as supervisor is active

+
+;; (defn- assigned-slots-from-scheduler-assignments [topology->assignment]
+;;   (->> topology->assignment
+;;        vals
+;;        (map (fn [^SchedulerAssignment a] (.getExecutorToSlot a)))
+;;        (mapcat vals)
+;;        (map (fn [^WorkerSlot s] {(.getNodeId s) #{(.getPort s)}}))
+;;        (apply merge-with set/union)
+;;        ))
+
 ;; public so it can be mocked out
 (defn compute-new-topology->executor->node+port [nimbus existing-assignments topologies scratch-topology-id]
   (let [conf (:conf nimbus)
@@ -531,7 +543,7 @@
                                                                                existing-assignments
                                                                                topology->alive-executors)
         available-slots (->> topologies
-                             (available-slots nimbus nil)
+                             (available-slots nimbus)
                              (map (fn [[node-id port]] {node-id #{port}}))
                              (apply merge-with set/union))
         assigned-slots (assigned-slots storm-cluster-state)


Added another core generator function.

Added another core generator function.

--- src/clj/mx/roads/forgotten/blog/core.clj
+++ src/clj/mx/roads/forgotten/blog/core.clj
@@ -36,6 +36,11 @@
   []
   (web (generate)))

+(defn log+generate
+  []
+  (set-log-level)
+  (generate))
+
 (defn log+generate+web
   []
   (set-log-level)


message to 3.x

message to 3.x

--- src/cljs/swarmpit/component/message.cljs
+++ src/cljs/swarmpit/component/message.cljs
@@ -1,6 +1,8 @@
 (ns swarmpit.component.message
-  (:require [material.component :as comp]
+  (:require [material.icon :as icon]
+            [material.component :as comp]
             [swarmpit.component.state :as state]
+            [sablono.core :refer-macros [html]]
             [rum.core :as rum]))

 (enable-console-print!)
@@ -45,20 +47,24 @@
   (show text :error))

 (rum/defc info-message < rum/reactive [text opened?]
-  (comp/mui
-    (comp/snackbar {:bodyStyle        message-info-body-style
-                    :contentStyle     message-info-content-style
-                    :autoHideDuration 5000
-                    :message          text
-                    :open             opened?})))
+  (comp/snackbar
+    {:autoHideDuration 5000
+     :anchorOrigin     {:vertical   "bottom"
+                        :horizontal "center"}
+     :open             opened?}
+    (comp/snackbar-content
+      {:aria-describedby "client-snackbar"
+       :message          (html [:span#client-snackbar icon/info text])})))

 (rum/defc error-message < rum/reactive [text opened?]
-  (comp/mui
-    (comp/snackbar {:bodyStyle        message-error-body-style
-                    :contentStyle     message-error-content-style
-                    :autoHideDuration 300000
-                    :message          text
-                    :open             opened?})))
+  (comp/snackbar
+    {:autoHideDuration 300000
+     :anchorOrigin     {:vertical   "bottom"
+                        :horizontal "center"}
+     :open             opened?}
+    (comp/snackbar-content
+      {:aria-describedby "client-snackbar"
+       :message          (html [:span#client-snackbar icon/error text])})))

 (rum/defc message < rum/reactive []
   (let [{:keys [open type text]} (state/react message-cursor)]


Turned off padding during alternation

Turned off padding during alternation

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -152,12 +152,12 @@
                            max-points maintain-ancestors] :as argmap}]
   (let [g1 (:genome parent1)
         g2 (:genome parent2)
-        s1 (vec (if (>= (count g1) (count g2))
-                  g1
-                  (concat g1 (repeat (- (count g2) (count g1)) 'alternation-padding))))
-        s2 (vec (if (>= (count g2) (count g1))
-                  g2
-                  (concat g2 (repeat (- (count g1) (count g2)) 'alternation-padding))))
+        s1 g1 #_(vec (if (>= (count g1) (count g2))
+                      g1
+                      (concat g1 (repeat (- (count g2) (count g1)) 'alternation-padding))))
+        s2 g2 #_(vec (if (>= (count g2) (count g1))
+                      g2
+                      (concat g2 (repeat (- (count g1) (count g2)) 'alternation-padding))))
         new-genome (remove-alternation-padding
                      (loop [i 0
                             use-s1 (lrand-nth [true false])


Added :si-and-mate-use diversification test.

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -966,14 +966,42 @@
   [g argmap]
   (let [mate (vec (repeat (count g) {:instruction :from-mate}))
         c1 (produce-child-genome-by-autoconstruction g mate false argmap)
-        c1-from-mate (count (filter #(= (:instruction %) :from-mate) c1))]
-    (if (> c1-from-mate 0)
+        c1-from-mate-count (count (filter #(= (:instruction %) :from-mate) c1))]
+    (if (> c1-from-mate-count 0)
       (let [c2 (produce-child-genome-by-autoconstruction g mate false argmap)
-            c2-from-mate (count (filter #(= (:instruction %) :from-mate) c2))]
-        (and (> c2-from-mate 0)
-             (not= c1-from-mate c2-from-mate)))
+            c2-from-mate-count (count (filter #(= (:instruction %) :from-mate) c2))]
+        (and (> c2-from-mate-count 0)
+             (not= c1-from-mate-count c2-from-mate-count)))
       false)))
-
+
+(defn si-and-mate-use-diversifying?
+  "Returns true iff genome g passes the diversification test."
+  [g argmap]
+  (let [mate (vec (repeat (count g) {:instruction :from-mate}))
+        c1 (produce-child-genome-by-autoconstruction g mate false argmap)
+        c1-from-mate-count (count (filter #(= (:instruction %) :from-mate) c1))]
+    (if (> c1-from-mate-count 0)
+      (let [c1-not-from-mate (filter #(not= (:instruction %) :from-mate) c1)
+            c1-not-from-mate-count (count c1-not-from-mate)
+            g-count (count g)
+            c1-instructions (set (distinct (map :instruction c1-not-from-mate)))
+            g-instructions (set (distinct (map :instruction g)))]
+        (if (and (not= c1-instructions g-instructions)
+                 (not= c1-not-from-mate-count g-count))
+          (let [c2 (produce-child-genome-by-autoconstruction g mate false argmap)
+                c2-from-mate-count (count (filter #(= (:instruction %) :from-mate) c2))]
+            (if (and (> c2-from-mate-count 0)
+                     (not= c1-from-mate-count c2-from-mate-count))
+              (let [c2-not-from-mate (filter #(not= (:instruction %) :from-mate) c2)
+                    c2-not-from-mate-count (count c2-not-from-mate)
+                    c2-instructions (set (distinct (map :instruction c2-not-from-mate)))]
+                (and (not= c2-instructions g-instructions)
+                     (not= c2-instructions c1-instructions)
+                     (not= c2-not-from-mate-count g-count)
+                     (not= c2-not-from-mate-count c1-not-from-mate-count)))
+              false))
+          false))
+      false)))

 (defn diversifying?
   "Returns true iff genome g passes the diversification test."
@@ -988,6 +1016,7 @@
      :diffmeans diffmeans-diversifying?
      :minimal-reproductive-difference minimal-reproductive-difference-diversifying?
      :use-mate-differently use-mate-differently-diversifying?
+     :si-and-mate-use si-and-mate-use-diversifying?
      :no-clones no-clones-diversifying?
      :none (fn [genome argmap] true))
     g
@@ -1093,10 +1122,14 @@
                         (and autoconstructive-improve-or-diversify
                              (some (fn [[child-error parent1-error parent2-error]]
                                      (< child-error (min parent1-error parent2-error)))
-                                   (mapv vector child-errors (:errors parent1) (:errors parent2)))))
+                                   (mapv vector
+                                         child-errors
+                                         (:errors parent1)
+                                         (:errors parent2)))))
           new-genome (if use-child
                        child-genome
-                       (random-plush-genome max-genome-size-in-initial-program atom-generators argmap))]
+                       (random-plush-genome
+                         max-genome-size-in-initial-program atom-generators argmap))]
       (assoc (make-individual :genome (if (or use-child (diversifying? new-genome argmap))
                                         new-genome
                                         [])
@@ -1114,5 +1147,3 @@
         (if use-child false true)))))

-
-


Add case clauses for new diversification tests

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -1711,6 +1711,8 @@
                 :reproductive-change reproductive-change-diversifying?
                 :symbolic-reproductive-divergence symbolic-reproductive-divergence-diversifying?
                 :reproductive-divergence reproductive-divergence-diversifying?
+                :three-way-symbolic-reproductive-divergence symbolic-reproductive-divergence-diversifying?
+                :three-way-reproductive-divergence reproductive-divergence-diversifying?
                 :reproductive-change-changes reproductive-change-changes-diversifying?
                 :reproductive-change-changes-differently reproductive-change-changes-differently-diversifying?
                 :use-mate use-mate-diversifying?


Add arity do dealer-send

Add arity do dealer-send

Because I don't want to specify the flags argument
if I'm not using it

--- src/com/frereth/common/communication.clj
+++ src/com/frereth/common/communication.clj
@@ -137,21 +137,24 @@
 (s/defn dealer-send!
   "For the very simplest scenario, just mimic the req/rep empty address frames"
   ;; TODO: Add an arity that defaults to nil flags
-  [s :- mq/Socket
-   frames :- fr-sch/byte-arrays
-   flags :- fr-sch/korks]
-  (let [more-flags (conj flags :send-more)]
-    ;; Separator frame
-    ;; In theory, this could just be acting as a
-    ;; proxy and forwarding along messages.
-    ;; In practice, I don't see that use case
-    ;; ever happening here.
-    (mq/send! s (byte-array 0) more-flags)
-    (doseq [frame (butlast frames)]
-      (mq/send! s frame more-flags))
-    (log/debug "Wrapping up dealer send w/ final frame:\n" (last frames)
-               "\na " (class (last frames)))
-    (mq/send! s (last frames) flags)))
+  ([s :- mq/Socket
+    frames :- fr-sch/byte-arrays
+    flags :- fr-sch/korks]
+   (let [more-flags (conj flags :send-more)]
+     ;; Separator frame
+     ;; In theory, this could just be acting as a
+     ;; proxy and forwarding along messages.
+     ;; In practice, I don't see that use case
+     ;; ever happening here.
+     (mq/send! s (byte-array 0) more-flags)
+     (doseq [frame (butlast frames)]
+       (mq/send! s frame more-flags))
+     (log/debug "Wrapping up dealer send w/ final frame:\n" (last frames)
+                "\na " (class (last frames)))
+     (mq/send! s (last frames) flags)))
+  ([s :- mq/Socket
+    frames :- fr-sch/byte-arrays]
+   (dealer-send! s frames [])))

 (s/defn router-send!
   ([msg :- router-message]


pass storm.home property into workers

pass storm.home property into workers

--- src/clj/backtype/storm/daemon/supervisor.clj
+++ src/clj/backtype/storm/daemon/supervisor.clj
@@ -376,6 +376,7 @@
           command (str "java -server " childopts
                        " -Djava.library.path=" (conf JAVA-LIBRARY-PATH)
                        " -Dlogfile.name=" logfilename
+                       " -Dstorm.home=" (System/getProperty "storm.home")
                        " -Dlog4j.configuration=storm.log.properties"
                        " -cp " classpath " backtype.storm.daemon.worker "
                        storm-id " " supervisor-id " " port " " worker-id)]


Changed reference to use cmr-elastic-utils-lib.

--- src/cmr/search/data/elastic_search_index.clj
+++ src/cmr/search/data/elastic_search_index.clj
@@ -7,7 +7,7 @@
             [cmr.common.log :refer (debug info warn error)]
             [cmr.common.lifecycle :as lifecycle]
             [cmr.common.cache :as cache]
-            [cmr.transmit.elasticsearch :as es]
+            [cmr.elastic-utils.elasticsearch :as es]
             [cmr.transmit.index-set :as index-set]
             [cmr.search.models.results :as results]
             [cmr.search.data.query-to-elastic :as q2e]


Return debug data again.

Return debug data again.

--- src/forces_assemble/handler.clj
+++ src/forces_assemble/handler.clj
@@ -122,8 +122,7 @@
   :known-content-type? #(check-content-type % [application-json])
   :malformed? #(parse-json % ::data)
   :put! (fn [context]
-          (refresh-user-token user-id (:token (::data context)))
-          {}))
+          (refresh-user-token user-id (:token (::data context)))))

 (defresource channel-events [channel-id]
   :allowed-methods [:post]
@@ -131,8 +130,7 @@
   :known-content-type? #(check-content-type % [application-json])
   :malformed? #(parse-json % ::data)
   :post! (fn [context]
-           (add-event-to-channel channel-id (::data context))
-           {}))
+           (add-event-to-channel channel-id (::data context))))

 (defresource channel-subscribers [channel-id]
   :allowed-methods [:post]
@@ -140,8 +138,7 @@
   :known-content-type? #(check-content-type % [application-json])
   :malformed? #(parse-json % ::data)
   :post! (fn [context]
-           (subscribe-to-channel channel-id (:username (::data context)))
-           {}))
+           (subscribe-to-channel channel-id (:username (::data context)))))

 (defroutes assemble-routes
   (GET "/" [] "Hello World2")