Update to latest cheshire version (see also https://github.com/ring-clojure/ring-json/pull/42)

--- core/project.clj
+++ core/project.clj
@@ -23,7 +23,7 @@
                            ;; Authentication
                            [ring/ring-json "0.4.0"]
                            [buddy "0.13.0"]
-                           [cheshire "5.6.1"]  ;; fix a version (otherwise we have version clashes)
+                           [cheshire "5.6.3"]  ;; fix a version (otherwise we have version clashes)
                            [org.clojure/tools.reader "0.10.0"] ;; fix a version (otherwise we have version clashes)


replacing system by mount

replacing system by mount

--- resources/leiningen/new/closp/integtest/clj/web/setup.clj
+++ resources/leiningen/new/closp/integtest/clj/web/setup.clj
@@ -2,6 +2,7 @@
   (:require [clj-webdriver.taxi :as w]
             [joplin.core :as j]
             [taoensso.tower :as tower]
+            [mount.core :as mount]
             [{{ns}}.components.config]
             [{{ns}}.components.locale :refer [get-tconfig]]))


GAWB-1068: keep attrs-list updated in state when navigating through workspace tabs (#520)

GAWB-1068: keep attrs-list updated in state when navigating through workspace tabs

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/tab.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/tab.cljs
@@ -207,8 +207,10 @@
                    (swap! state dissoc :locking?)
                    (react/call :refresh this))}))
    :component-did-mount
-   (fn [{:keys [state refs locals this]}]
+   (fn [{:keys [state refs locals this props]}]
      (react/call :refresh this)
+     (swap! state assoc :attrs-list
+            (vec (dissoc (get-in props [:workspace "workspace" "attributes"]) "description")))
      (swap! locals assoc :scroll-handler
             (fn []
               (when-let [sidebar (@refs "sidebar")]


Updated call to pars-reference-response.

--- test/cmr/system_int_test/search/granule_search_format_test.clj
+++ test/cmr/system_int_test/search/granule_search_format_test.clj
@@ -93,6 +93,7 @@
            (d/refs-match?
              [g1-echo]
              (search/parse-reference-response
+               false
                (search/find-concepts-in-format
                  format-str
                  :granule


carry-schema: bump version

carry-schema: bump version

--- contrib/schema/project.clj
+++ contrib/schema/project.clj
@@ -1,5 +1,5 @@
 (defproject
-  carry-schema "0.3.0"
+  carry-schema "0.4.0"
   :description "Carry middleware for model validation using Schema."
   :url "https://github.com/metametadata/carry/tree/master/contrib/schema"
   :license {:name "MIT" :url "http://opensource.org/licenses/MIT"}


removed listeners from maqueta.input

removed listeners from maqueta.input

--- src/maqueta/input.clj
+++ src/maqueta/input.clj
@@ -2,9 +2,7 @@
   (:import (com.jme3.input KeyInput MouseInput)
            (com.jme3.input.controls Trigger
                                     KeyTrigger
-                                    MouseButtonTrigger
-                                    ActionListener
-                                    AnalogListener)))
+                                    MouseButtonTrigger)))

 (defmacro make-trigger
   [trigger-class input-class keyword]


Correct typo

Correct typo

--- src/naughtmq/core.clj
+++ src/naughtmq/core.clj
@@ -10,7 +10,7 @@
     (cond (and (.startsWith os-name "win") (= "x86" os-arch))
           (str "win-x86/" s ".dll")

-          (and (.startsWith os-name "max")) ; assume all macs are 64bits
+          (and (.startsWith os-name "mac")) ; assume all macs are 64bits
           (str "macosx/" s ".dylib")

           (and (.startsWith os-name "linux") (= "i386" os-arch))


node->channel function needed to return a channel

--- src/bitsplit_cli/core.cljs
+++ src/bitsplit_cli/core.cljs
@@ -17,8 +17,8 @@
                     (if-not (nil? err)
                         (put! return {:error err})
                         (put! return result)))]
-        (apply function (concat args [into-chan])))))
-
+        (apply function (concat args [into-chan]))
+        return)))

 (defn read-prompt [p]
     (let [return (chan 1)]


Goofed on some parens in the names-handler controller function

--- src/blaagh/controllers.clj
+++ src/blaagh/controllers.clj
@@ -19,4 +19,4 @@
     (render-file "templates/post-something.html" {:name name :comment comment})))

 (defn names-handler [request]
-    db/get-names)
+    (db/get-names))


Improve migrations listing.

Improve migrations listing.

--- src/cadence/views/user.clj
+++ src/cadence/views/user.clj
@@ -8,10 +8,13 @@
             [cadence.pattern-recognition :as patrec]
             (ragtime [core :as rag])
             [ring.util.anti-forgery :refer [anti-forgery-field]]
+            (clj-time [coerce :as time-coerce]
+                      [format :as time-format])
             [noir.validation :as vali]
             [noir.session :as sess]
             [noir.response :as resp])
-  (:use (hiccup page def element util)))
+  (:use (hiccup core page def element util))
+  (:import (org.bson.types ObjectId)))

 (defn profile [{{:keys [username]} :route-params :as request}]
   (if (= username (m/identity))
@@ -131,7 +134,42 @@
       ; and then load the page again.
       (signup user))))

-(defn migrations [request]
+(defhtml migration-row
+  "Convert a modified migration map to a table row."
+  [{:keys [id doc applied?]}]
+  [:tr
+   [:td.date (h (str (time-format/unparse
+                         (:rfc822 time-format/formatters)
+                         (time-coerce/from-long
+                           (.getTime (ObjectId. id))))))]
+   [:td.id [:code (h id)]]
+   [:td.doc [:p (h doc)]]
+   (let [badge-class (if applied? "label-success" "")
+         badge-icon (if applied? "icon-ok-sign" "icon-remove-sign")
+         badge-text (if applied? "Applied" "Not Applied")
+         button-class (if applied? "btn-inverse" "btn-primary")
+         button-text (if applied? "Rollback" "Apply")]
+     (html
+       [:td.applied [:span {:class (str "label " badge-class)}
+                     [:i {:class (str "icon-white " badge-icon)}]
+                     (str " " badge-text)]]
+
+       [:td.controls [:button {:data-object-id id
+                               :class (str "btn " button-class)}
+                      button-text]]))])
+
+(defn migrations
+  "A nice place to view migrations."
+  [request]
   (common/layout
     [:h2 "Migrations"]
-    [:pre [:code (escape-html (seq (migration/list-migrations)))]]))
+    [:table#migrations.table.table-striped.table-bordered
+     [:thead
+      [:tr
+       [:th.date "Timestamp"]
+       [:th.id "ObjectId"]
+       [:th.doc "Description"]
+       [:th.applied "Applied?"]
+       [:th.controls]]]
+     [:tbody
+      (map migration-row (migration/list-migrations))]]))


Pass fop.xconf as an URI to FopFactory/newInstance

That way it is also found when deploying as a war

--- src/catalog/layout/fop.clj
+++ src/catalog/layout/fop.clj
@@ -827,7 +827,7 @@
   ;; generate PDF according to https://xmlgraphics.apache.org/fop/2.0/embedding.html#basics
   (with-open [out (io/output-stream out)]
     (let [;; Construct a FopFactory by specifying a reference to the configuration file
-          factory (FopFactory/newInstance (io/file (io/resource "fop.xconf")))
+          factory (FopFactory/newInstance (.toURI (io/resource "fop.xconf")))
           ;; get a user agent and add a listener to it that logs events
           user-agent (.newFOUserAgent factory)
           broadcaster (.getEventBroadcaster user-agent)


Remove unnecessary namespace

Remove unnecessary namespace

--- src/checkin_halake/sms.clj
+++ src/checkin_halake/sms.clj
@@ -1,24 +0,0 @@
-(ns checkin-halake.sms
-  (:require [twilio.core :as twilio]
-            [environ.core :refer [env]]
-            [clojure.string :as string]))
-
-(defonce account-sid (env :twilio-sid))
-
-(defonce auth-token (env :twilio-key))
-
-(defonce from (env :twilio-from))
-
-(defn- fix-tel [tel]
-  (-> tel
-      (string/replace #"\D" "")
-      (string/replace #"^0" "+81")))
-
-(defn send [to message]
-  (twilio/with-auth account-sid auth-token
-    (twilio/send-sms
-     {:From from
-      :To (fix-tel to)
-      :Body message})))
-
-;; (send "090-2586-0466" "認証番号:3344をアプリ画面で入力して下さい\n(30分間有効です)\nhttp://halake.com")


Remove debug output

Remove debug output

--- src/circle/backend/ec2.clj
+++ src/circle/backend/ec2.clj
@@ -308,7 +308,7 @@
      {:sleep sleep-interval
       :timeout timeout
       :error-hook (fn [e] (infof "block-until-running: caught %s %s" (class e) (.getMessage e)))
-      :success-fn (fn [inst] (inspect (= :running (-?> inst :state :name (keyword)))))}
+      :success-fn (fn [inst] (= :running (-?> inst :state :name (keyword))))}
      #(instance instance-id))
     (catch Exception e
       (errorf "instance %s didn't start within timeout" instance-id)


Pass next computed state into the next controller when executing :state events, fixes #23

--- src/citrus/reconciler.cljs
+++ src/citrus/reconciler.cljs
@@ -63,30 +63,28 @@
   (dispatch! [this cname event args]
     (queue-effects!
       queue
-      [cname #((get controllers cname) event args (get @state cname))])
+      [cname #((get controllers cname) event args (get % cname))])

     (schedule-update!
       batched-updates
       scheduled?
       (fn []
-        (let [effects
-              (map (fn [[cname ctrl]] [cname (ctrl)]) @queue)]
-          (clear-queue! queue)
-          (let [state-effects (filter (comp :state second) effects)
-                other-effects (->> effects
-                                   (map (fn [[cname effect]]
-                                          [cname (dissoc effect :state)]))
-                                   (filter (comp seq second)))]
-            (when (seq state-effects)
-              (swap! state
-                #(reduce (fn [agg [cname {cstate :state}]]
-                           (assoc agg cname cstate))
-                         % state-effects)))
-            (when (seq other-effects)
-              (m/doseq [[cname effects] effects]
-                (m/doseq [[id effect] effects]
-                  (when-let [handler (get effect-handlers id)]
-                    (handler this cname effect))))))))))
+        (let [events @queue
+              _ (clear-queue! queue)
+              next-state
+              (loop [st @state
+                     [event & events] events]
+                (if (seq event)
+                  (let [[cname ctrl] event
+                        effects (ctrl st)]
+                    (m/doseq [[id effect] (dissoc effects :state)]
+                             (when-let [handler (get effect-handlers id)]
+                               (handler this cname effect)))
+                    (if (contains? effects :state)
+                      (recur (assoc st cname (:state effects)) events)
+                      (recur st events)))
+                  st))]
+          (reset! state next-state)))))

   (dispatch-sync! [this cname event args]
     (let [effects ((get controllers cname) event args (get @state cname))]


fix delete user-connections

fix delete user-connections

--- src/clj/salava/user/db.clj
+++ src/clj/salava/user/db.clj
@@ -370,7 +370,8 @@
          (delete-user-badge-message-views! {:user_id user-id} {:connection tr-cn}) ;remove badge message views
          (delete-user-pending-badges! {:user_id user-id} {:connection tr-cn}) ;delete pending badges
          (delete-user-badge! {:user_id user-id} {:connection tr-cn}) ;remove user badge completely
-         (delete-social-connections-user-following! {:owner_id user-id} {:connection tr-cn} );remove social-connections-user
+         (if (some #(= % :extra/socialuser) (get-in ctx [:config :core :plugins]))
+           (delete-social-connections-user-following! {:owner_id user-id} {:connection tr-cn} )) ;remove social-connections-user
          (delete-user-social-events! {:owner user-id} {:connection tr-cn} );remove users social events
          (delete-all-user-events! {:subject user-id} {:connection tr-cn}) ;remove all user events
          (delete-social-connections-badge! {:user_id user-id} {:connection tr-cn} );remove social-connections-badge


test for refresh of recurring credits on cards hosted after install

--- src/clj/test/core-game.clj
+++ src/clj/test/core-game.clj
@@ -19,3 +19,26 @@
     (let [gord (get-in @state [:runner :rig :program 0])]
       (core/trash state :runner gord)
       (is (= 4 (:memory (get-runner))) "Trashing the program restored MU"))))
+
+(deftest refresh-recurring-credits-hosted
+  "host - Recurring credits on cards hosted after install refresh properly"
+  (do-game
+    (new-game (default-corp [(qty "Ice Wall" 3) (qty "Hedge Fund" 3)])
+              (default-runner [(qty "Compromised Employee" 1) (qty "Off-Campus Apartment" 1)]))
+    (play-from-hand state :corp "Ice Wall" "HQ")
+    (take-credits state :corp 2)
+    (play-from-hand state :runner "Off-Campus Apartment")
+    (play-from-hand state :runner "Compromised Employee")
+    (let [iwall (get-in @state [:corp :servers :hq :ices 0])
+          apt (get-in @state [:runner :rig :resource 0])]
+      (card-ability state :runner apt 1) ; use Off-Campus option to host an installed card
+      (prompt-select :runner (find-card "Compromised Employee" (get-in @state [:runner :rig :resource])))
+      (let [cehosted (first (:hosted (refresh apt)))]
+        (card-ability state :runner cehosted 0) ; take Comp Empl credit
+        (is (= 4 (:credit (get-runner))))
+        (is (= 0 (:rec-counter (refresh cehosted))))
+        (core/rez state :corp iwall)
+        (is (= 5 (:credit (get-runner))) "Compromised Employee gave 1 credit from ice rez")
+        (take-credits state :runner)
+        (take-credits state :corp)
+        (is (= 1 (:rec-counter (refresh cehosted))) "Compromised Employee recurring credit refreshed")))))


Add end submitting for form

Add end submitting for form

--- src/cljs/re_form/core.cljs
+++ src/cljs/re_form/core.cljs
@@ -106,6 +106,11 @@
  :re-form/start-submitting
  (fn [db [_ form-name]]
    (assoc-in db [:re-form form-name :submitting] true)))
+
+(rf/reg-event-db
+ :re-form/end-submitting
+ (fn [db [_ form-name]]
+   (update-in db [:re-form form-name] dissoc :submitting)))

 (defn process-class [class]
   (if (keyword? class)


tiny width change

tiny width change

--- src/cljs/tictag/views.cljs
+++ src/cljs/tictag/views.cljs
@@ -74,7 +74,7 @@
        :on-change #(dispatch [:debounced-update-ping-query %])]
       [re-com/box
        :child [:img {:src    @graph-src
-                     :width  "70%"
+                     :width  "100%"
                      :style {:margin :auto}}]]
       [re-com/box
        :child


add* is private

add* is private

--- src/cljx/commos/delta.cljx
+++ src/cljx/commos/delta.cljx
@@ -129,7 +129,7 @@
           (apply dissoc val (collect new-val))
           (difference val (collect new-val)))))

-(defn add*
+(defn- add*
   [val [op korks-or-new-val new-val :as delta]]
   (if (= 3 (count delta))
     (update-in val (collect korks-or-new-val)


fix empty content bug

fix empty content bug

--- src/codeitlater/format.clj
+++ src/codeitlater/format.clj
@@ -7,15 +7,16 @@
 (defn printline [filepath tuples]
   "tuple => ((linenum string)...) ;;from no keyword branch
 OR tuple => ((linenum [keyword content])...)"
-  (do
-    (printf "|-- %s\n" filepath)
-    (doall (map #(printf "  |-- Line %d: %s\n"
-                         (first %)
-                         (if (= java.lang.String (type (second %)))
-                           (second %)
-                           (clojure.string/join " " (second %))))
-                tuples))
-    (println)))
+  (if (not (empty? tuples))
+    (do
+      (printf "|-- %s\n" filepath)
+      (doall (map #(printf "  |-- Line %d: %s\n"
+                           (first %)
+                           (if (= java.lang.String (type (second %)))
+                             (second %)
+                             (clojure.string/join " " (second %))))
+                  tuples))
+      (println))))

 (defn split-keywords [keywords]


Added ISeq and InputStream response types

--- src/compojure/response.clj
+++ src/compojure/response.clj
@@ -1,8 +1,8 @@
 (ns compojure.response
   "Methods for generating Ring response maps"
   (:import java.util.Map
-           java.io.File
-           [clojure.lang IDeref IFn]))
+           [java.io File InputStream]
+           [clojure.lang IDeref IFn ISeq]))

 (defmulti render
   "Given the request map and an arbitrary value x, turn x into a valid HTTP
@@ -28,4 +28,10 @@
 (defmethod render File [_ file]
   {:status 200, :headers {}, :body file})

+(defmethod render ISeq [_ coll]
+  {:status 200, :headers {}, :body coll})
+
+(defmethod render InputStream [_ stream]
+  {:status 200, :headers {}, :body stream})
+
 (prefer-method render Map IFn)


lein: dep updates

lein: dep updates

--- lein_profiles.clj
+++ lein_profiles.clj
@@ -1,7 +1,7 @@
 {:user {:plugins [
-                  [lein-cljfmt "0.3.0" :exclusions [org.clojure/clojure]]
+                  [lein-cljfmt "0.4.1" :exclusions [org.clojure/clojure]]
                   [lein-ancient "0.6.8" :exclusions [org.clojure/clojure]]
                   [lein-cloverage "1.0.6"]
                   [org.clojure/tools.nrepl "0.2.12"]
-                  [cider/cider-nrepl "0.11.0-SNAPSHOT"]
+                  [cider/cider-nrepl "0.11.0"]
                   ]}}


Assert only wins in current playoff series information parsing tests

We will add another field to playoff series information, so refactor the
current tests so that they keep working regardless of other fields.

--- test/nhl_score_api/fetchers/nhlstats/game_scores_test.clj
+++ test/nhl_score_api/fetchers/nhlstats/game_scores_test.clj
@@ -372,40 +372,42 @@

 (deftest game-scores-parsing-playoff-series

-  (testing "Parsing pre-game playoff series information from playoff games"
+  (testing "Parsing pre-game playoff series wins from playoff games"
     (let [games (:games
                   (parse-game-scores
                     (filter-latest-games resources/playoff-games-finished-with-2nd-games)
                     (:records resources/standings)))
-          playoff-series (map #(:playoff-series (:pre-game-stats %)) games)]
-      (is (= [{:wins {"DET" 0 "TBL" 1}} {:wins {"NYI" 1 "FLA" 0}} {:wins {"CHI" 0 "STL" 1}} {:wins {"NSH" 0 "ANA" 0}}]
-             playoff-series) "Parsed pre-game playoff series information")))
-
-  (testing "Parsing current playoff series information from playoff games"
+          playoff-series (map #(:playoff-series (:pre-game-stats %)) games)
+          wins (map :wins playoff-series)]
+      (is (= [{"DET" 0 "TBL" 1} {"NYI" 1 "FLA" 0} {"CHI" 0 "STL" 1} {"NSH" 0 "ANA" 0}]
+             wins) "Parsed pre-game playoff series wins")))
+
+  (testing "Parsing current playoff series wins from playoff games"
     (let [games (:games
                   (parse-game-scores
                     (filter-latest-games resources/playoff-games-finished-with-2nd-games)
                     (:records resources/standings)))
-          playoff-series (map #(:playoff-series (:current-stats %)) games)]
-      (is (= [{:wins {"DET" 0 "TBL" 2}} {:wins {"NYI" 1 "FLA" 1}} {:wins {"CHI" 1 "STL" 1}} {:wins {"NSH" 1 "ANA" 0}}]
-             playoff-series) "Parsed current playoff series information")))
-
-  (testing "Parsing pre-game playoff series information from first playoff games"
+          playoff-series (map #(:playoff-series (:current-stats %)) games)
+          wins (map :wins playoff-series)]
+      (is (= [{"DET" 0 "TBL" 2} {"NYI" 1 "FLA" 1} {"CHI" 1 "STL" 1} {"NSH" 1 "ANA" 0}]
+             wins) "Parsed current playoff series wins")))
+
+  (testing "Parsing pre-game playoff series wins from first playoff games"
     (let [games (:games
                   (parse-game-scores
                     (filter-latest-games resources/playoff-games-live-finished-with-1st-games)
                     (:records resources/standings)))
-          playoff-series (map #(:playoff-series (:pre-game-stats %)) games)]
-      (is (= [{:wins {"NJD" 0 "TBL" 0}} {:wins {"TOR" 0 "BOS" 0}} {:wins {"CBJ" 0 "WSH" 0}}
-              {:wins {"COL" 0 "NSH" 0}} {:wins {"SJS" 0 "ANA" 0}}]
-             playoff-series) "Parsed pre-game playoff series information")))
-
-  (testing "Parsing current playoff series information from first playoff games"
+          playoff-series (map #(:playoff-series (:pre-game-stats %)) games)
+          wins (map :wins playoff-series)]
+      (is (= [{"NJD" 0 "TBL" 0} {"TOR" 0 "BOS" 0} {"CBJ" 0 "WSH" 0} {"COL" 0 "NSH" 0} {"SJS" 0 "ANA" 0}]
+             wins) "Parsed pre-game playoff series wins")))
+
+  (testing "Parsing current playoff series wins from first playoff games"
     (let [games (:games
                   (parse-game-scores
                     (filter-latest-games resources/playoff-games-live-finished-with-1st-games)
                     (:records resources/standings)))
-          playoff-series (map #(:playoff-series (:current-stats %)) games)]
-      (is (= [{:wins {"NJD" 0 "TBL" 1}} {:wins {"TOR" 0 "BOS" 1}} {:wins {"CBJ" 1 "WSH" 0}}
-              {:wins {"COL" 0 "NSH" 1}} {:wins {"SJS" 0 "ANA" 0}}]
-             playoff-series) "Parsed current playoff series information"))))
+          playoff-series (map #(:playoff-series (:current-stats %)) games)
+          wins (map :wins playoff-series)]
+      (is (= [{"NJD" 0 "TBL" 1} {"TOR" 0 "BOS" 1} {"CBJ" 1 "WSH" 0} {"COL" 0 "NSH" 1} {"SJS" 0 "ANA" 0}]
+             wins) "Parsed current playoff series wins"))))


Add gen test for scaling of :continue flux policy

--- test/onyx/scheduler/balanced_grouping_generative_test.clj
+++ test/onyx/scheduler/balanced_grouping_generative_test.clj
@@ -240,6 +240,65 @@
        (is (= 0 (count (get (get (:allocations replica) job-2-id) t4))))
        (is (= 0 (count (get (get (:allocations replica) job-2-id) t5))))
        (is (= 0 (count (get (get (:allocations replica) job-2-id) t6))))))))
+
+(deftest scale-continue-flux-policy
+  (let [continue-job-id "grouping-job-1"
+        grouping-slot-job
+        {:workflow [[:a :b] [:b :c]]
+         :catalog [{:onyx/name :a
+                    :onyx/plugin :onyx.test-helper/dummy-input
+                    :onyx/type :input
+                    :onyx/medium :dummy
+                    :onyx/batch-size 20}
+
+                   {:onyx/name :b
+                    :onyx/fn :mock/fn
+                    :onyx/type :function
+                    :onyx/group-by-kw :mock-key
+                    :onyx/flux-policy :continue
+                    :onyx/batch-size 20}
+
+                   {:onyx/name :c
+                    :onyx/plugin :onyx.test-helper/dummy-output
+                    :onyx/type :output
+                    :onyx/medium :dummy
+                    :onyx/batch-size 20}]
+         :task-scheduler :onyx.task-scheduler/balanced}
+        job-1-rets (api/create-submit-job-entry
+                     continue-job-id
+                     peer-config
+                     grouping-slot-job
+                     (planning/discover-tasks (:catalog grouping-slot-job) (:workflow grouping-slot-job)))]
+    (checking
+     "Checking grouping task recovers slots, and job1 continues running when peers leave, and job2 is killed"
+     (times 50)
+     [{:keys [replica log peer-choices]}
+      (log-gen/apply-entries-gen
+       (gen/return
+        {:replica {:job-scheduler :onyx.job-scheduler/balanced
+                   :messaging {:onyx.messaging/impl :dummy-messenger}}
+         :message-id 0
+         :entries (-> (log-gen/generate-join-queues (log-gen/generate-peer-ids 16))
+                      (assoc :job-1 {:queue [job-1-rets]})
+                      (assoc :leave-1 {:predicate (fn [replica entry]
+                                                    (some #{:p1} (:peers replica)))
+                                       :queue [{:fn :leave-cluster :args {:id :p1}}]})
+                      (assoc :leave-2 {:predicate (fn [replica entry]
+                                                    (some #{:p2} (:peers replica)))
+                                       :queue [{:fn :leave-cluster :args {:id :p2}}]})
+                      (assoc :leave-3 {:predicate (fn [replica entry]
+                                                    (some #{:p3} (:peers replica)))
+                                       :queue [{:fn :leave-cluster :args {:id :p3}}]})
+                      (assoc :leave-4 {:predicate (fn [replica entry]
+                                                    (some #{:p4} (:peers replica)))
+                                       :queue [{:fn :leave-cluster :args {:id :p4}}]}))
+         :log []
+         :peer-choices []}))]
+     (let [[t1 t2 t3] (:tasks (:args job-1-rets))]
+       (is (= 12 (count (:peers replica))))
+       (is (= 4 (count (get (get (:allocations replica) continue-job-id) t1))))
+       (is (= 4 (count (get (get (:allocations replica) continue-job-id) t2))))
+       (is (= 4 (count (get (get (:allocations replica) continue-job-id) t3))))))))

 (deftest recover-slots
   (let [grouping-slot-job-id "grouping-job-1"


Turn outer back on in om

Turn outer back on in om

--- frontend/components/app.cljs
+++ frontend/components/app.cljs
@@ -66,8 +66,7 @@
                (om/build aside/aside app)])
             [:main.app-main {:tab-index 1}
              (om/build header/header app)
-             (when inner? ;; XXX: remove when outer is built out
-               [:div.main-body
-                (om/build dom-com app)])
+             [:div.main-body
+              (om/build dom-com app)]
              [:footer.main-foot
               (footer/footer)]]]))))))


added -p option to ss-config to list persisted resources.

--- ssclj/tools/src/com/sixsq/slipstream/tools/cli/ssconfig.clj
+++ ssclj/tools/src/com/sixsq/slipstream/tools/cli/ssconfig.clj
@@ -10,7 +10,8 @@
     [com.sixsq.slipstream.ssclj.resources.configuration-slipstream :as cfg-s]
     [com.sixsq.slipstream.ssclj.resources.configuration-template :as cfgt]
     [com.sixsq.slipstream.ssclj.resources.connector :as conn]
-    [com.sixsq.slipstream.ssclj.resources.connector-template :as cont])
+    [com.sixsq.slipstream.ssclj.resources.connector-template :as cont]
+    [com.sixsq.slipstream.ssclj.resources.connector :as con])
   (:gen-class))

 (def connector-resource conn/resource-url)
@@ -333,6 +334,40 @@
         (do
           (println "WARNING: Resource" rname "not found."))))))

+(defn get-connector-resources
+  []
+  (let [cs (-> (con/query-impl (sci/connector-as-request configuration-resource))
+               :body
+               :connectors)]
+    (map #(:id %) cs)))
+
+(defn get-configuration-resources
+  []
+  (let [cs (-> (cfg/query-impl (sci/configuration-as-request connector-resource))
+               :body
+               :configurations)]
+    (map #(:id %) cs)))
+
+(defn get-persisted-resources
+  [name]
+  (cond
+    (= name configuration-resource) (get-configuration-resources)
+    (= name connector-resource) (get-connector-resources)
+    :else (do (println "WARNING: Don't know how to get resources for" name))))
+
+(defn list-persisted-resources
+  [name]
+  (doseq [r (get-persisted-resources name)]
+    (println r)))
+
+(defn list-resources
+  []
+  (init-db-client)
+  (println "List of persisted resources.")
+  (doseq [r resource-types]
+    (println (format "- resources for '%s'" r))
+    (list-persisted-resources r)))
+
 ;;
 ;; Command line options processing.
 ;;
@@ -356,8 +391,9 @@

 (def cli-options
   [["-t" "--template TEMPLATE" "Prints out registered template by name."]
-   ["-l" "--list" "List available templates."]
-   ["-r" "--resource RESOURCE" "Prints out resource document(s) by name."
+   ["-l" "--list" "Lists available templates."]
+   ["-p" "--persisted" "Lists resources persisted in DB."]
+   ["-r" "--resource RESOURCE" "Prints out peristed resource document(s) by name."
     :id :resources
     :default #{}
     :assoc-fn cli-parse-sets]
@@ -395,8 +431,8 @@
     (cond
       (:help options) (exit 0 (usage summary))
       errors (exit 1 (error-msg errors)))
-    (init-namespaces)
     (when (not (empty? arguments))
+      (init-namespaces)
       (run arguments)
       (System/exit 0))
     (when (seq (:resources options))
@@ -404,7 +440,11 @@
       (print-resources)
       (System/exit 0))
     (when (:list options)
+      (init-namespaces)
       (list-tempates)
       (System/exit 0))
     (when (not (s/blank? (:template options)))
-      (print-template (:template options)))))+      (init-namespaces)
+      (print-template (:template options)))
+    (when (:persisted options)
+      (list-resources))))


(SERVER-86) Better testing of signed certificate

Improve the test to verify that the certificate was signed with the
public key from the CA certificate.

--- test/puppetlabs/puppetserver/certificate_authority_test.clj
+++ test/puppetlabs/puppetserver/certificate_authority_test.clj
@@ -307,13 +307,19 @@

 (deftest autosign-without-capub
   (testing "The CA public key file is not necessary to autosign"
-    (let [settings (testutils/ca-sandbox! cadir)
-          csr      (-> (:csrdir settings)
-                       (path-to-cert-request "test-agent")
-                       (utils/pem->csr))]
+    (let [settings  (testutils/ca-sandbox! cadir)
+          csr       (-> (:csrdir settings)
+                        (path-to-cert-request "test-agent")
+                        (utils/pem->csr))
+          cert-path (path-to-cert (:signeddir settings) "test-agent")]
       (fs/delete (:capub settings))
       (autosign-certificate-request! "test-agent" csr settings)
-      (is (true? (fs/exists? (path-to-cert (:signeddir settings) "test-agent")))))))
+      (is (true? (fs/exists? cert-path)))
+      (let [cert  (utils/pem->cert cert-path)
+            capub (-> (:cacert settings)
+                      (utils/pem->cert)
+                      (.getPublicKey))]
+        (is (nil? (.verify cert capub)))))))

 (deftest revoke-without-capub
   (testing "The CA public key file is not necessary to revoke"


forever

forever

--- src/nn/core.clj
+++ src/nn/core.clj
@@ -20,7 +20,7 @@
     ]
    [:body {:style "display: flex; justify-content: center; align-items: center; height: 100%; background: black; flex-flow: column;"}
     [:video {:autoplay "autoplay" :src "/nnphone.mp4"}]
-    [:span {:style "color: white"} "coming in terms eventual"]]))
+    [:span {:style "color: white"} "coming in terms eventual forever"]]))

 (defroutes nroutes
   (GET "/" [] (resp/response (main-page)))


carry-debugger: update deps

carry-debugger: update deps

--- contrib/debugger/project.clj
+++ contrib/debugger/project.clj
@@ -9,10 +9,9 @@

                  [carry-schema "0.1.0"]
                  [carry-reagent "0.1.0"]
-                 [reagent "0.6.0-alpha" :exclusions [cljsjs/react]]
-                 [cljsjs/react-with-addons "15.0.2-0"]

                  [org.clojure/core.match "0.3.0-alpha4"]
+                 [reagent "0.6.0-alpha2"]
                  [prismatic/schema "1.1.0"]
                  [com.rpl/specter "0.10.0"]
                  [cljsjs/jquery-ui "1.11.4-0"]


Provide a cleaner way to wrap screen functions

--- src/play_clj/core.clj
+++ src/play_clj/core.clj
@@ -40,6 +40,11 @@
   (when (not= e-old e-new)
     (compare-and-set! e-atom e-old e-new)))

+(defn ^:private wrapper
+  "Internal use only"
+  [screen f]
+  (f))
+
 (defn defscreen*
   "Internal use only"
   [{:keys [screen entities
@@ -48,7 +53,8 @@
   (let [execute-fn! (fn [func & {:keys [] :as options}]
                       (when func
                         (let [old-entities @entities]
-                          (some->> (func (merge @screen options) old-entities)
+                          (some->> #(func (merge @screen options) old-entities)
+                                   (wrapper screen)
                                    list
                                    flatten
                                    (remove nil?)
@@ -115,9 +121,13 @@
   [n & {:keys [] :as options}]
   `(defonce ~n (defgame* ~options)))

-(defn set-screen-with-options!
-  "Internal use only"
-  [^Game game screens & {:keys [wrap]}]
+(defn set-screen!
+  "Creates a [Screen](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Screen.html)
+object, sets it as the screen for the `game`, and runs the functions from
+`screens` in the order they are provided in
+
+    (set-screen! hello-world main-screen text-screen)"
+  [^Game game & screens]
   (let [add-inputs! (fn []
                       (input! :set-input-processor (InputMultiplexer.))
                       (doseq [{:keys [input-listeners]} screens]
@@ -125,9 +135,7 @@
                           (add-input! listener))))
         run-fn! (fn [k & args]
                   (doseq [screen screens]
-                    (if wrap
-                      (wrap screen k args)
-                      (apply (get screen k) args))))]
+                    (apply (get screen k) args)))]
     (.setScreen game (reify Screen
                        (show [this] (add-inputs!) (run-fn! :show))
                        (render [this d] (run-fn! :render d))
@@ -137,15 +145,6 @@
                        (resume [this] (run-fn! :resume))
                        (dispose [this])))))

-(defn set-screen!
-  "Creates a [Screen](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Screen.html)
-object, sets it as the screen for the `game`, and runs the functions from
-`screens` in the order they are provided in
-
-    (set-screen! hello-world main-screen text-screen)"
-  [game & screens]
-  (set-screen-with-options! game screens))
-
 (defn update!
   "Runs the equivalent of `(swap! screen-atom assoc ...)`, where `screen-atom`
 is the atom storing the screen map behind the scenes, and returns the new screen


DSDEEPB-2238: preserve whitespace in description paragraph

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/tab.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/tab.cljs
@@ -153,7 +153,7 @@
                                                               :defaultValue description
                                                               :style {:width 400}
                                                               :rows 5}))
-                description description
+                description [:div {:style {:whiteSpace "pre-wrap"}} description]
                 :else [:span {:style {:fontStyle "oblique"}} "No description provided"])))
       (attributes/view-attributes state refs)]
      [:div {:style {:flex "1 1 50%" :paddingLeft 10}}


Correct help message for nashorn

Correct help message for nashorn

--- library/src/doo/core.clj
+++ library/src/doo/core.clj
@@ -254,7 +254,7 @@
                error-msg (format cmd-not-found js-path
                            (cond
                             (= js-env :rhino) "rhino -help"
-                            (= js-env :nashorn) "jrunscript -help"
+                            (= js-env :nashorn) "jjs -h"
                             :else (str js-path " -v"))
                            js-path)]
            (when (:verbose doo-opts)


Trying symbolic differentiation

Trying symbolic differentiation

--- src/main/cljc/clojure_club/x121_universal_computation_engine/mgrimm.cljc
+++ src/main/cljc/clojure_club/x121_universal_computation_engine/mgrimm.cljc
@@ -1,15 +1,27 @@
 (ns clojure-club.x121-universal-computation-engine.mgrimm)
+
+(defn f' [e dv]
+  (cond
+    (list? e)
+    (let [[op & os] e]
+
+      )
+    (number? e) 0
+    (and (symbol? e) (= e dv)) 1
+    :else 0))

 (defn calc [formula]
   (fn [smap]
-    (clojure.walk/postwalk
+    (clojure.walk/prewalk
       #(if (list? %)
-         (let [[op & os] (replace (merge smap {'/ / '* * '+ + '- -}) %)]
+         (let [[op & os] (replace (merge smap {'/ / '* * '+ + '- - 'f' f'}) %)]
            (apply op os))
          %)
       formula)))

 ;; -----------------------------------------------------------------------------
+
+((calc '(f' x :dv)) '{a 2 :dv x})

 (assert (= 2 ((calc '(/ a b))
               '{b 8 a 16})))


Updated collection_search_format_test due to umm-lib DIF changes.

--- test/cmr/system_int_test/search/collection_search_format_test.clj
+++ test/cmr/system_int_test/search/collection_search_format_test.clj
@@ -15,34 +15,27 @@

 (use-fixtures :each (ingest/reset-fixture "PROV1" "PROV2"))

-;; FIXME Leo Make it so we don't need this anymore
-(defn temp-fix-dif-problem
-  "Difs don't contain the insert time and last update. This removes them so that we get echo10 XML
-  back with nils"
-  [coll]
-  (-> coll
-      (assoc-in [:data-provider-timestamps :insert-time] nil)
-      (assoc-in [:data-provider-timestamps :update-time] nil)))
-
 ;; Tests that we can ingest and find items in different formats
 (deftest multi-format-search-test
-  (let [c1-echo (d/ingest "PROV1" (temp-fix-dif-problem (dc/collection {:short-name "S1"
-                                                                        :version-id "V1"
-                                                                        :entry-title "ET1"}))
+  (let [c1-echo (d/ingest "PROV1" (dc/collection {:short-name "S1"
+                                                  :version-id "V1"
+                                                  :entry-title "ET1"})
                           :echo10)
-        c2-echo (d/ingest "PROV2" (temp-fix-dif-problem (dc/collection {:short-name "S2"
-                                                                        :version-id "V2"
-                                                                        :entry-title "ET2"}))
+        c2-echo (d/ingest "PROV2" (dc/collection {:short-name "S2"
+                                                  :version-id "V2"
+                                                  :entry-title "ET2"})
                           :echo10)
-        c3-dif (d/ingest "PROV1" (temp-fix-dif-problem (dc/collection {:short-name "S3"
-                                                                       :version-id "V3"
-                                                                       :entry-title "ET3"
-                                                                       :long-name "ET3"}))
+        c3-dif (d/ingest "PROV1" (dc/collection {:entry-id "S3"
+                                                 :short-name "S3"
+                                                 :version-id "V3"
+                                                 :entry-title "ET3"
+                                                 :long-name "ET3"})
                          :dif)
-        c4-dif (d/ingest "PROV2" (temp-fix-dif-problem (dc/collection {:short-name "S4"
-                                                                       :version-id "V4"
-                                                                       :entry-title "ET4"
-                                                                       :long-name "ET4"}))
+        c4-dif (d/ingest "PROV2" (dc/collection {:entry-id "S4"
+                                                 :short-name "S4"
+                                                 :version-id "V4"
+                                                 :entry-title "ET4"
+                                                 :long-name "ET4"})
                          :dif)
         all-colls [c1-echo c2-echo c3-dif c4-dif]]
     (index/refresh-elastic-index)


(SERVER-862) Readded JRuby waits to a couple of lock tests

This commit readds wait-for-jrubies calls to a couple of
`jruby-locking-tests`.  Those had erroneously been removed in a prior
commit in the PR.  The waits need to be there to ensure that the JRuby
pool is populated with an instance before the test tries to exercise
further code that borrows instances.

--- test/integration/puppetlabs/services/jruby/jruby_locking_test.clj
+++ test/integration/puppetlabs/services/jruby/jruby_locking_test.clj
@@ -32,6 +32,7 @@
     [jruby-service/jruby-puppet-pooled-service
      profiler/puppet-profiler-service]
     (jruby-service-test-config 1)
+    (jruby-testutils/wait-for-jrubies app)
     (let [jruby-service (tk-app/get-service app :JRubyPuppetService)]
       (testing "initial state of write lock is unlocked"
         (is (can-borrow-from-different-thread? jruby-service))
@@ -47,6 +48,7 @@
     [jruby-service/jruby-puppet-pooled-service
      profiler/puppet-profiler-service]
     (jruby-service-test-config 1)
+    (jruby-testutils/wait-for-jrubies app)
     (let [jruby-service (tk-app/get-service app :JRubyPuppetService)]

       (testing "initial state of write lock is unlocked"


Fixed spelling mistakes

Fixed spelling mistakes

--- src/riemann/druid.clj
+++ src/riemann/druid.clj
@@ -30,7 +30,7 @@

 (defn druid
   "Returns a function which accepts single events or batches of
-   events in a vectorand send them to Druid Tranquility Server.
+   events in a vector and sends them to the Druid Tranquility Server.

    Usage:
    (druid {:host \"druid.example.com\"})
@@ -47,7 +47,7 @@
        :druid-async          ; A name for the forwarder
        {:queue-size     1e4  ; 10,000 events max
         :core-pool-size 5    ; Minimum 5 threads
-        :max-pools-size 100} ; Maxium 100 threads
+        :max-pools-size 100} ; Maximum 100 threads
         (druid {:host \"localhost\"}))))
   "
   [opts]


fixing pathnames

fixing pathnames

--- src/sledge/server.clj
+++ src/sledge/server.clj
@@ -12,6 +12,7 @@
             )
   (:import [org.apache.commons.codec.binary Base64 Hex]))

+#_#_
 (defonce enable-brepl (System/getProperty "enable_brepl"))
 (when enable-brepl
   (require '[simple-brepl.service ])
@@ -122,27 +123,19 @@
    :headers {"Content-type" "text/json"}
    :body (json/write-str (tracks-data req))})

-(def scripts
-  {:dev ["out/main.js"]
-   :production ["production-out/main.js"]
-   })
-
 (defn front-page-view [req]
   [:html
    [:head
     [:title "Sledge"]
     [:meta {:name "viewport" :content "initial-scale=1.0"}]
-    [:script (if enable-brepl
-               ((ns-resolve 'simple-brepl.service 'brepl-js))
-               "/* no brepl */")]
     [:link {:rel "stylesheet"
             :type "text/css"
-            :href "/css/sledge.css"
+            :href "/assets/css/sledge.css"
             }]]
    [:body
     [:div {:id "om-app"}]
     (map (fn [url] [:script {:src url :type "text/javascript"}])
-         (get scripts (if enable-brepl :dev :production)))
+         ["/assets/js/main.js"])
     ]])

 (defn ringo [view]


better doc

better doc

--- src/such/metadata.clj
+++ src/such/metadata.clj
@@ -14,7 +14,7 @@
   "Merge the maps onto the metadata of `o`, creating a new object
   equal to `o` but with the merged metadata.

-      (meta/merge o {:meta-a 1})
+      (meta/merge o {:author \"Brian\" :lang :en-ca})
 "
   [o & maps]
   (let [all (apply clojure.core/merge maps)]
@@ -22,7 +22,10 @@

 (defn assoc
   "`assoc` the key-value pairs onto the metadata of `o`, creating a
-  new object equal to `o` but with the new metadata."
+  new object equal to `o` but with the new metadata.
+
+      (meta/assoc o :author \"Brian\" :lang :en-ca)
+"
   [o & kvs]
   (let [all (apply hash-map kvs)]
     (merge o all)))


CMR-2011: Addressed review comments

CMR-2011: Addressed review comments

--- system-int-test/test/cmr/system_int_test/virtual_product_test.clj
+++ system-int-test/test/cmr/system_int_test/virtual_product_test.clj
@@ -335,7 +335,18 @@
             response (vp/translate-granule-entries invalid-json)
             errors (:errors (json/parse-string (:body response) true))]
         (and (= 400 (:status response))
-             (= ["/1 object has missing required properties ([\"concept-id\"])"] errors))))))
+             (= ["/1 object has missing required properties ([\"concept-id\"])"] errors))))
+
+    (testing "If virtual products is disabled, there should be no translation"
+      (try (dev-sys-util/eval-in-dev-sys
+             `(cmr.virtual-product.config/set-virtual-products-enabled! false))
+        (let [request-json [source-granule non-virtual-granule1 virtual-granule1 non-virtual-granule2
+                            non-virtual-granule3 non-virtual-granule4 virtual-granule2 virtual-granule3]
+              response (vp/translate-granule-entries
+                         (json/generate-string request-json))]
+          (= request-json (json/parse-string (:body response) true)))
+        (finally (dev-sys-util/eval-in-dev-sys
+                   `(cmr.virtual-product.config/set-virtual-products-enabled! true)))))))

 (deftest virtual-product-non-cmr-only-provider-test
   (let [_ (ingest/update-ingest-provider {:provider-id "LPDAAC_ECS"


adding functionality to template core

adding functionality to template core

--- src/template/core.clj
+++ src/template/core.clj
@@ -1,4 +1,6 @@
 (ns template.core)
+
+(defn- default-ops {'entry-set (fn [my-map] (mapv (fn [[k v]] {:k k :v v}) (sorted-map my-map)))})

 (defn- resolve-tpl [op-map data out-data tpl]
   (cond
@@ -15,7 +17,8 @@
     (list? tpl) (let [[op & args] tpl]
                   (cond
                     (map? op) (let [[label col] (first op)
-                                    col (data col)
+                                    col (if (keyword? col) (data col) col)
+                                    col (if (list? col) (resolve-tpl op-map data [] col) col)
                                     results (reduce (fn [out elem]
                                                       (let [new-data (if (map? elem)
                                                                        (reduce (fn [obj [k v]]
@@ -39,4 +42,4 @@
 (defn build-template-factory [op-map]
   (fn build-template [tpl]
     (fn resolve-template [data]
-      (resolve-tpl op-map data [] tpl))))
+      (resolve-tpl (merge op-map default-ops) data [] tpl))))


Allow policy action to be a sequence

Allow policy action to be a sequence

--- src/eulalie/util/query.clj
+++ src/eulalie/util/query.clj
@@ -50,7 +50,7 @@
                 (if (map? principal)
                   (util/mapkeys name principal)
                   (name principal)))
-         (update-in [:action] xform-value)
+         (update-in [:action] (partial functor/fmap xform-value))
          (update-in [:effect] xform-value)))))

 (defn policy-json-out [policy]


Prevent weasel from undoing the enable-console-print

--- src/leiningen/new/chestnut/env/dev/cljs/chestnut/dev.cljs
+++ src/leiningen/new/chestnut/env/dev/cljs/chestnut/dev.cljs
@@ -10,6 +10,6 @@
   :websocket-url "ws://localhost:3449/figwheel-ws"
   :jsload-callback (fn [] (core/main)))

-(weasel/connect "ws://localhost:9001" :verbose true)
+(weasel/connect "ws://localhost:9001" :verbose true :print #{:repl :console})

 (core/main)


renamed div

renamed div

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -46,6 +46,6 @@
         (dom/span nil (str (:upload-progress data) "%"))))))

 (om/root users-list-view core/app-state {:target (. js/document (getElementById "userslist"))})
-(om/root messages-view core/app-state {:target (. js/document (getElementById "app"))})
+(om/root messages-view core/app-state {:target (. js/document (getElementById "messages-window"))})
 (om/root file-upload-progress-view core/app-state {:target (. js/document (getElementById "progress"))})


Let simple exeucte its jobs from the repl.

--- dev/user.clj
+++ dev/user.clj
@@ -1,6 +1,7 @@
 (ns user
   (:require [clojure.tools.namespace.repl :as repl]
-            [clojure.test :as t]))
+            [clojure.test :as t]
+            [fhofherr.simple.engine :as engine]))

 (defn- do-run-unit-tests
   []
@@ -17,3 +18,21 @@
 (defn run-integration-tests
   []
   (repl/refresh :after 'user/do-run-integration-tests))
+
+(def simple-engine nil)
+
+(defn start-simple-ci
+  []
+  (when-not simple-engine
+    (alter-var-root #'simple-engine (constantly (engine/load-engine "." "simple.clj")))))
+
+(defn stop-simple-ci
+  []
+  (when simple-engine
+    (alter-var-root #'simple-engine (constantly nil))))
+
+(defn run-simple-test-job
+  []
+  (if simple-engine
+    (engine/start-job! simple-engine 'test-simple-ci)
+    (println "Call 'start-simple-ci' first!")))


RR: pass current language on sg-init

RR: pass current language on sg-init

--- src/hatti/views/table.cljs
+++ src/hatti/views/table.cljs
@@ -129,10 +129,10 @@
   "Creates a Slick.Grid backed by Slick.Data.DataView from data and fields.
    Most events are handled by slickgrid. On double-click, event is put on chan.
    Returns [grid dataview]."
-  [data form is-filtered-dataview? {:keys [grid-event-handlers
-                                           dataview-event-handlers]}]
-  (let [columns (flat-form->sg-columns
-                  form true nil :is-filtered-dataview? is-filtered-dataview?)
+  [data form  current-language is-filtered-dataview?
+   {:keys [grid-event-handlers dataview-event-handlers]}]
+  (let [columns (flat-form->sg-columns form true current-language
+                  :is-filtered-dataview? is-filtered-dataview?)
         SlickGrid (.. js/Slick -Grid)
         DataView (.. js/Slick -Data -DataView)
         dataview (DataView.)
@@ -285,7 +285,13 @@
   "Initializes grid + dataview, and stores them in owner's state."
   (when (seq data)
     (let [{:keys [flat-form is-filtered-dataview?]} (om/get-shared owner)
-          [grid dataview] (sg-init data flat-form is-filtered-dataview? slick-grid-event-handlers)]
+          current-language (:current
+                             (om/observe owner (shared/language-cursor)))
+          [grid dataview] (sg-init data
+                                   flat-form
+                                   current-language
+                                   is-filtered-dataview?
+                                   slick-grid-event-handlers)]
       (om/set-state! owner :grid grid)
       (om/set-state! owner :dataview dataview)
       [grid dataview])))


CMR-2201: Removed call to side api in test.

--- acl-lib/test/cmr/acl/test/umm_matchers.clj
+++ acl-lib/test/cmr/acl/test/umm_matchers.clj
@@ -2,7 +2,6 @@
   (:require [clojure.test :refer :all]
             [cmr.acl.umm-matchers :as a]
             [cmr.common.util :refer [are2]]
-            [cmr.common-app.test.side-api :as side]
             [cmr.common.test.time-util :as tu]
             [cmr.common.time-keeper :as tk]))

@@ -168,7 +167,7 @@
       :ending-date-time (tu/n->date-time end-n)}]}})

 (deftest collection-applicable-temporal-acl-test
-  (side/eval-form `(tk/set-time-override! ~(tu/n->date-time now-n)))
+  (tk/set-time-override! (tu/n->date-time now-n))
   (are2 [applicable? tf coll]
         (= applicable? (boolean (a/coll-applicable-acl?
                                   "PROV1" coll


링크정보 못찾을 때 원문 그대로 출력

링크정보 못찾을 때 원문 그대로 출력

--- src/tufdown/core.cljc
+++ src/tufdown/core.cljc
@@ -17,7 +17,7 @@

 (defn- extract [elements keyword]
   (->> elements
-       (filter vector?)
+       (filter) vector?
        (filter #(= keyword (first %)))))

 (def ^:private extract-first
@@ -38,14 +38,14 @@
                                                   :타이틀 (es :링크타이틀)}}))
                         reflinks))}))

-#_(extract-references
- (parse "[링크]: http://test.com\n[링크2]: http://test2.com \"title\"\n"))
+(extract-references

-(def ^:dynamic *doc-refs* {})
+ (def ^:dynamic *doc-refs* {})
+ (def ^:dynamic *doc-text* "")

 (declare render-html)

-(defn- render-element [[태그 & 내용]]
+(defn- render-element [[태그 & 내용 :as 요소]]
   (let [태그맵 {:큰제목 "h2", :작은제목 "h3", :일반목록 "ul", :숫자목록 "ol"
                 :항목 "li", :인용 "blockquote", :원문 "pre", :문단 "p"
                 :기울임 "i", :굵게 "em"}
@@ -65,14 +65,16 @@
            (render-html (추출 :텍스트))
            "")

-      :참조링크 ; TODO: 링크 매칭 실패시 원본을 보이는 방법 필요.
+      :참조링크
       (if-let [링크정보 (get-in *doc-refs* [:링크 (문자열 :참조이름)])]
         (str ""
              (render-html (or (문자열 :텍스트)
                               (문자열 :참조이름)
                               (링크정보 :타이틀)))
              "")
-        "링크 못찾음")
+        ;; 링크정보 매칭 실패시 원본 그대로 출력
+        (let [[s e] (insta/span 요소)]
+          (.substring *doc-text* s e)))

       :각주링크
       "" ; skip
@@ -92,9 +94,13 @@

 (defn parse-and-render [text]
   (let [tree (parse text)]
-    (binding [*doc-refs* (extract-references tree)]
+    (binding [*doc-text* text
+              *doc-refs* (extract-references tree)]
       (render-html tree))))

+;; (map insta/span (parse "[링크][]\n\n[링크]: http://test.com\n"))
+;; (.substring "test" 1 3)
+
 ;; (extract-references (parse "[링크][]\n\n[링크]: http://test.com\n"))
-;; (parse-and-render "[링크][]\n\n[링크]: http://test.com\n")
+;; (parse-and-render "[링크][]\n\n[링크1]: http://test.com\n")
 ;; (render-html (parse "[*링*크](http://test.com)"))


removed commented out code

removed commented out code

--- src/io/aviso/rook/core.clj
+++ src/io/aviso/rook/core.clj
@@ -55,79 +55,10 @@
     (when (symbol-for-function? f) ;it has to be a function all right
       f)))

-;(defn- ns-validation
-;  "Return the validation for the given namespance and action keyword (:create, :update).
-;   Disables :required validations for :update actions"
-;  [namespace action]
-;  (when-let [v (ns-resolve namespace (symbol "validation"))]
-;    (condp = action
-;      :create (deref v)
-;      :update (walk/postwalk-replace {[:required true] [:required false]} (deref v)))))
-
-;(defn route-function-wrapper
-;  [processors arg-resolvers namespace f]
-;  (fn [request]
-;    (if-let [processor (first processors)]
-;      ((mw namespace (meta f) (processors-wrapper (rest processors) arg-resolvers namespace f))
-;        request)
-;      (invoke-handler-function f (-> f meta :arglists first)  request))))
-
-;(defn create-function-route-handler
-;  "Create a handler for a route which invokes function <f> after parsing and validation of request data (if :validate? metadata is true)
-;   The function is invoked with arguments as determined by extract-param-value.
-;   The request is augmented with an :env entry containing a map of :mode, :service and :services."
-;  [namespace f default-middlewares default-arg-resolvers]
-;  (let [{:keys [middlewares arg-resolvers arglists] :as meta-data} (meta f)]
-;    (fn [request]
-;      (let [request (assoc request
-;                      :rook {:namespace namespace
-;                             :function f
-;                             :metadata meta-data
-;                             :arg-resolvers (concat default-arg-resolvers arg-resolvers)})
-;            rook-wrapper (route-function-wrapper (concat default-middlewares middlewares))]
-;        (rook-wrapper request)))))
-
-;    (fn [request]
-;      (l/debugf "Request %s: %s" (:request-method request) (:uri request))
-;          (v/validate-and-process request validation
-                                  ; Add data (transformed and validated) as another option for params
-;                                  (partial invoke-handler-function f (first arglists) request))
-;          (invoke-handler-function f (first arglists) request nil))))))

 (defn- success?
   [{:keys [status]}]
   (<= 200 status 399))
-
-;(defn wrap-auth
-;  "Ring middleware which authorizes the request by calling <auth-fn> with the request and <permissions> (a collections of permission strings or a function of the request, returning same)
-;    * <handler> is called if auth is successful (auth-fn returns a 2xx status response)
-;    * Otherwise the response from the auth-fn is returned as-is
-;   If <auth-fn> is nil then handler is always invoked."
-;  [handler auth-fn permissions]
-;  (fn [request]
-;    (if auth-fn
-;      (let [permissions (if (fn? permissions) (permissions request) permissions)
-;            auth-response (auth-fn request permissions)]
-;        (if (success? auth-response)
-;          (handler request)
-;          auth-response))
-;      (handler request))))
-
-;(defn make-function-route
-;  "Create function route from route-mapping and namespace."
-;  [namespace [path-spec function-key] default-processors default-arg-resolvers]
-;  (when-let [f (ns-function namespace function-key)]
-;    (let [[method path] path-spec
-;;          permissions (:permissions (meta f))
-;;          auth (or (:auth (meta f)) :default)
-;;          auth-fn (get auths auth)
-;          handler (create-function-route-handler namespace f default-processors default-arg-resolvers)]
-;;      (l/infof "Building route for %s with %s" [path-spec function-key] (l/pprint-str (select-keys (meta f) [:auth :permissions :path-spec :name])))
-;      (compojure/make-route method path
-;;                                 (wrap-auth handler auth-fn permissions)
-;                                 handler
-;                                 ))))
-

 (defn function-entry
   "Create function entry if it has :path-spec defined in its metadata, for example:
@@ -156,17 +87,6 @@
                  (filter symbol-for-function? (map second (ns-publics namespace)))))
     DEFAULT-MAPPINGS))

-;(defn- scan-namespace
-;  "Build a seq of routes for namespace by adding custom routes (for fns with :path-spec metadata) to DEFAULT_MAPPINGS"
-;  [namespace]
-;  (let [paths (ns-paths namespace)]
-;    (l/infof "Setting route mappings for %s to %s" namespace (l/pprint-str paths))
-;    (remove nil?
-;            (map #(make-function-route namespace auths env service services %) (ns-paths namespace)))))
-
-;cache seems unnecessary as we build the list once per handler
-;(def scan-namespace (memo/memo scan-namespace-uncached))
-
 (defn get-function-meta
   "Get meta for route-mapping and namespace."
   [namespace [path-spec function-key]]
@@ -179,68 +99,6 @@
   [namespace]
   (remove nil?
           (map #(get-function-meta namespace %) (ns-paths namespace))))
-
-;(defn describe-context [context-path [path args namespace & contexts]]
-;  (let [new-context-path (str context-path path)
-;        handlers (scan-namespace-for-doc namespace)]
-;    (cons
-;      (desc/resource new-context-path namespace (ns-validation namespace) handlers)
-;      (map (partial describe-context new-context-path) contexts))))
-;
-;(defn doc-route-uncached [service contexts]
-;  (compojure/make-route :get "/"
-;                             (fn [request]
-;                               (let [html (desc/resource-page service
-;                                                              (map (partial describe-context "") contexts))]
-;                                 {:body html}))))
-;
-;(def doc-route (memo/memo doc-route-uncached))
-;
-;;if we want to namespace-specific for the cache, we will require a newer version of clojure.core.memoize
-;(defn clear-namespace-cache!
-;  "Clear namespace cache, forcing a re-scan of every namespace checked."
-;  []
-;  (memo/memo-clear! scan-namespace)
-;  (memo/memo-clear! doc-route))
-
-;(defn make-namespace-handler
-;  "Create a namespace handler, which will scan a namespace (cached) for functions matching the naming convention.
-;   <auths> should be a map of auth types to functions of request and permissions returning a ring response map."
-;  [namespace auths env service services]
-;  (fn [request]
-;    (apply compojure/routing request (scan-namespace namespace auths env service services))))
-;
-;(defn make-doc-handler
-;  "Create a namespace documention handler, which will scan namespaces (cached) for functions matching the naming convention."
-;  [service & contexts]
-;  (fn [request]
-;    (compojure/routing request (doc-route service contexts))))
-;
-;(defn resources [env service services auths contexts]
-;  (when (seq contexts)
-;    (doall (map (fn [[path args namespace & contexts]]
-;                  `(compojure/context ~path ~args
-;                                 (make-namespace-handler ~namespace ~auths ~env ~service ~services)
-;                                 ~@(resources env service services auths contexts)))
-;                contexts))))
-;
-;(defmacro routes
-;  "Creates compojure routes for the given <contexts>
-;   Each context should be of the form [<path> <args> <namespace> <context>*] where:
-;    * path is the context path (string) as supplied to compojure.core/context
-;    * args is a set of bindings as supplied to compojure.core/context
-;    * namespace is the namespace to scan for handlers
-;    * context is zero or more nested contexts
-;   <env> :environment setting from main conf
-;   <service> keyword identifying specific map in services
-;   <services> map of services, used to determine how to connect to other services
-;   <auths> should be a map of auth types to functions of request and permissions returning a ring response map
-;
-;   If :auth is specified in handler metadata it is used to lookup the auth function in <auths>, otherwise :default is used."
-;  [env service services auths & contexts]
-;  `(compojure/routes
-;     (make-doc-handler ~service ~@contexts)
-;     ~@(resources env service services auths contexts)))

 (defn build-map-arg-resolver [& kvs]
   (let [arg-map (apply hash-map kvs)]


[clojure] fix reload issues

[clojure] fix reload issues

--- etc/repl.clj
+++ etc/repl.clj
@@ -1,15 +1,21 @@
 (ns R
   (:refer-clojure :exclude [find-ns])
-  (:require [clojure.test :as test]
-            [clojure.repl :as repl]
-            [kaocha.repl]
-            clojure.pprint
-            [clojure.tools.namespace.find :as ns.find]
-            [clojure.tools.namespace.repl :as ns.repl]
-            [clojure.java.io :as io])
-  (:import (java.io File)))
+  (:require
+    [clojure.java.io :as io]
+    [clojure.pprint]
+    [clojure.repl :as repl]
+    [clojure.test :as test]
+    [clojure.tools.namespace.find :as ns.find]
+    [clojure.tools.namespace.repl :as ns.repl]
+    [kaocha.repl])
+  (:import
+    (java.io
+      File)))
+

 (ns.repl/disable-reload! *ns*)
+(def ^{:doc "Pretty print a thing"} pp clojure.pprint/pprint)
+

 (defn help [& n]
   (println (str ">>> in ns " 'R))
@@ -17,10 +23,12 @@
           (println v)) (ns-publics 'R))
   ::ok)

+
 (defn init! []
   (ns.repl/disable-reload! *ns*)
   (ns.repl/set-refresh-dirs "src" "test")
   (help))
+

 (defn list-ns
   "Return list of symbols of namespaces found in src dir"
@@ -29,33 +37,42 @@
   ([]
    (list-ns "./src/")))

+
 (defn find-ns
   "Find namespace vars by a regex"
   [re]
   (filter #(re-find re (str %)) (list-ns)))
+

 (defn find-test-ns
   "Find test namespace vars by a regex"
   [re]
   (filter #(re-find re (str %)) (list-ns "./test/")))

-(defn t
-  "Run tests via kaocha - either all or a list of vars"
-  ([]
-   (kaocha.repl/run :unit))
-  ([ns-list]
-   (apply kaocha.repl/run ns-list)))
-
-(defn t!
-  "Run tests via kaocha, but refresh first - runs all tests or a list of vars"
-  ([]
-   (refresh)
-   (kaocha.repl/run :unit))
-  ([ns-list]
-   (refresh)
-   (apply kaocha.repl/run ns-list)))

 (def system-status (atom {}))
+
+
+(defn safe-to-refresh? []
+  (or (empty? @system-status)
+      (= #{false} (-> @system-status vals set))))
+
+
+(defn  refresh
+  "Refresh changed namespaces"
+  []
+  (if (safe-to-refresh?)
+    (ns.repl/refresh)
+    ::system-running!))
+
+
+(defn refresh-all
+  "Refresh everything"
+  []
+  (if (safe-to-refresh?)
+    (ns.repl/refresh-all)
+    ::system-running!))
+

 (defn start-system!
   "Given a namespace, usually some-service, do the following:
@@ -75,33 +92,36 @@
      (require an-ns)
      (start-system! an-ns)))
   ([an-ns]
-  (do
-    (printf "!! Starting %s\n" an-ns)
-    (if (get @system-status an-ns)
-      (println "!! System possibly running" an-ns)
-      (do
-        (println "!! Refreshing and reloading " an-ns)
-        (remove-ns an-ns)
-        (refresh)
-        (require [an-ns] :reload)
-        (if-let [f (ns-resolve an-ns 'start)]
-          (do
-            (f)
-            (swap! system-status (fn [s] (assoc s an-ns true))))))))))
+   (do
+     (printf "!! Starting %s\n" an-ns)
+     (if (get @system-status an-ns)
+       (println "!! System possibly running" an-ns)
+       (do
+         (println "!! Refreshing and reloading " an-ns)
+         (remove-ns an-ns)
+         (refresh)
+         (require [an-ns] :reload)
+         (if-let [f (ns-resolve an-ns 'start)]
+           (do
+             (f)
+             (swap! system-status (fn [s] (assoc s an-ns true))))))))))
+

 (defn stop-system!
   "Given a namespace, usually some-service.user, stop the system. If not passed, stops currently running system"
   ([]
    (stop-system! (first (keys @system-status))))
   ([an-ns]
-  (let [f (ns-resolve an-ns 'stop)]
-    (f)
-    (swap! system-status (fn [s] (assoc s an-ns false))))))
+   (let [f (ns-resolve an-ns 'stop)]
+     (f)
+     (swap! system-status (fn [s] (assoc s an-ns false))))))
+

 (defn sys
   "Pull out the system for passing around"
   []
-   (var-get (ns-resolve (first (keys @system-status)) 'SYS)))
+  (var-get (ns-resolve (first (keys @system-status)) 'SYS)))
+

 (defn c
   "Pul out a compont from a running system"
@@ -109,25 +129,24 @@
   (let [sys (sys)]
     (get sys component-name)))

-(defn safe-to-refresh? []
-(or (empty? @system-status)
-    (= #{false} (-> @system-status vals set))))

-(defn  refresh
-  "Refresh changed namespaces"
-  []
-  (if (safe-to-refresh?)
-    (ns.repl/refresh)
-    ::system-running!))

-(defn refresh-all
-  "Refresh everything"
-  []
-  (if (safe-to-refresh?)
-    (ns.repl/refresh-all)
-    ::system-running!))
+(defn t
+  "Run tests via kaocha - either all or a list of vars"
+  ([]
+   (kaocha.repl/run :unit))
+  ([ns-list]
+   (apply kaocha.repl/run ns-list)))

-(def ^{:doc "Pretty pretint a thing"} pp clojure.pprint/pprint)
+
+(defn t!
+  "Run tests via kaocha, but refresh first - runs all tests or a list of vars"
+  ([]
+   (refresh)
+   (kaocha.repl/run :unit))
+  ([ns-list]
+   (refresh)
+   (apply kaocha.repl/run ns-list)))

 (init!)


Remove stuff that is now in nomis-clj-repl-tools


make cycling configurable, default to not cycle

--- src/cljs/org/broadinstitute/firecloud_ui/common/components.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/components.cljs
@@ -124,7 +124,8 @@
 (react/defc Dialog
   {:get-default-props
    (fn []
-     {:blocking? true})
+     {:blocking? true
+      :cycle-focus? false})
    :render
    (fn [{:keys [props state]}]
      (let [content (:content props)
@@ -157,9 +158,13 @@
        (common/focus-and-select (get-first))
        (when-let [get-last (:get-last-element-dom-node props)]
          (.addEventListener (get-first) "keydown" (common/create-key-handler [:tab] #(.-shiftKey %)
-                                                    (fn [e] (.preventDefault e) (.focus (get-last)))))
+                                                    (fn [e] (.preventDefault e)
+                                                      (when (:cycle-focus? props)
+                                                        (.focus (get-last))))))
          (.addEventListener (get-last) "keydown" (common/create-key-handler [:tab] #(not (.-shiftKey %))
-                                                   (fn [e] (.preventDefault e) (.focus (get-first)))))))
+                                                   (fn [e] (.preventDefault e)
+                                                     (when (:cycle-focus? props)
+                                                       (.focus (get-first))))))))
      (set! (.-onKeyDownHandler this)
            (common/create-key-handler [:esc] #((:dismiss-self props))))
      (.addEventListener js/window "keydown" (.-onKeyDownHandler this)))


Add refresh to user ns

Add refresh to user ns

--- dev/user.clj
+++ dev/user.clj
@@ -1,6 +1,7 @@
 (ns user
   (:require [jugsclojure.server :refer [restart-server]]
             [ring.middleware.reload :refer [wrap-reload]]
+            [clojure.tools.namespace.repl :refer [refresh]]
             [figwheel-sidecar.repl-api :as figwheel]))

 ;; Let Clojure warn you when it needs to reflect on types, or when it does math
@@ -25,4 +26,4 @@

   (go)
 ;;
-)+)


Version 0.1.2

Version 0.1.2

--- metlog-agent/project.clj
+++ metlog-agent/project.clj
@@ -1,4 +1,4 @@
-(defproject metlog-agent "0.1.2-SNAPSHOT"
+(defproject metlog-agent "0.1.2"
   :description "Metlog agent - polls data sources for upload to vault."

   :license {:name "Eclipse Public License"


Fixed the nesting and added the needed tbodys to the radio-buttons page. For #23.

--- src/cljs/reagent_toolbox_docs/components/radio_buttons.cljs
+++ src/cljs/reagent_toolbox_docs/components/radio_buttons.cljs
@@ -41,132 +41,134 @@
                                             :on-change #(select %)}]]])))

 [radio-buttons-test]"]
-
      [:section
       [:h1 "Radio Group"]
       [:p "A radio selector is mean to get a value from a set of choices, that 's why a radio "
        "group is needed. It can take some properties and actions that will be transferred to "
-       "the children, but they also can behave independently."]]
-     [:section
-      [:h2 "Properties"]
-      [:table
-       [:thead
-        [:tr
-         [:th "Name"]
-         [:th "Type"]
-         [:th "Default"]
-         [:th "Description"]]]
-       [:tr
-        [:td [:code "class-name"]]
-        [:td [:code "string"]]
-        [:td [:code "\"\""]]
-        [:td "Set a class to give custom styles to the group."]]
-       [:tr
-        [:td [:code "disabled"]]
-        [:td [:code "boolean"]]
-        [:td [:code "false"]]
-        [:td "If true, the group will be displayed as disabled."]]
-       [:tr
-        [:td [:code "name"]]
-        [:td [:code "string"]]
-        [:td]
-        [:td "Name for the input element group."]]
-       [:tr
-        [:td [:code "on-change"]]
-        [:td [:code "function"]]
-        [:td]
-        [:td "Callback function that will be invoked when the value changes."]]
-       [:tr
-        [:td [:code "value"]]
-        [:td [:code "any"]]
-        [:td]
-        [:td "Default value selected in the radio group."]]]]
+       "the children, but they also can behave independently."]
+      [:section
+       [:h2 "Properties"]
+       [:table
+        [:thead
+         [:tr
+          [:th "Name"]
+          [:th "Type"]
+          [:th "Default"]
+          [:th "Description"]]]
+        [:tbody
+         [:tr
+          [:td [:code "class-name"]]
+          [:td [:code "string"]]
+          [:td [:code "\"\""]]
+          [:td "Set a class to give custom styles to the group."]]
+         [:tr
+          [:td [:code "disabled"]]
+          [:td [:code "boolean"]]
+          [:td [:code "false"]]
+          [:td "If true, the group will be displayed as disabled."]]
+         [:tr
+          [:td [:code "name"]]
+          [:td [:code "string"]]
+          [:td]
+          [:td "Name for the input element group."]]
+         [:tr
+          [:td [:code "on-change"]]
+          [:td [:code "function"]]
+          [:td]
+          [:td "Callback function that will be invoked when the value changes."]]
+         [:tr
+          [:td [:code "value"]]
+          [:td [:code "any"]]
+          [:td]
+          [:td "Default value selected in the radio group."]]]]]]
      [:section
       [:h1 "Radio Button"]
       [:p "The inner component to compose radio selectors. They will be rendered as radio input elements of HTML "
-       "transferring the given properties that concerns to them."]]
-     [:section
-      [:h2 "Properties"]
-      [:table
-       [:thead
-        [:tr
-         [:th "Name"]
-         [:th "Type"]
-         [:th "Default"]
-         [:th "Description"]]]
-       [:tr
-        [:td [:code "checked"]]
-        [:td [:code "boolean"]]
-        [:td [:code "false"]]
-        [:td "If true, the input element will be selected by default. Transferred from the parent."]]
-       [:tr
-        [:td [:code "class-name"]]
-        [:td [:code "string"]]
-        [:td [:code "\"\""]]
-        [:td "Set a class to give custom styles to the radio button."]]
-       [:tr
-        [:td [:code "disabled"]]
-        [:td [:code "boolean"]]
-        [:td [:code "false"]]
-        [:td "If true, the item will be displayed as disabled."]]
-       [:tr
-        [:td [:code "label"]]
-        [:td [:code "string"] "or reagent component"]
-        [:td [:code "\"\""]]
-        [:td "Label for the radio button."]]
-       [:tr
-        [:td [:code "name"]]
-        [:td [:code "string"]]
-        [:td]
-        [:td "Name for the input element."]]
-       [:tr
-        [:td [:code "on-blur"]]
-        [:td [:code "function"]]
-        [:td]
-        [:td "Callback function that will be invoked when the input is blurred."]]
-       [:tr
-        [:td [:code "on-change"]]
-        [:td [:code "function"]]
-        [:td]
-        [:td "Callback function that will be invoked when the value changes."]]
-       [:tr
-        [:td [:code "on-focus"]]
-        [:td [:code "function"]]
-        [:td]
-        [:td "Callback function that will be invoked when the input is focused."]]
-       [:tr
-        [:td [:code "value"]]
-        [:td [:code "any"]]
-        [:td]
-        [:td "Value for the radio button."]]]]
-     [:section
-      [:h2 "Theming"]
-      [:table
-       [:thead
-        [:tr
-         [:th "Name"]
-         [:th "Description"]]]
-       [:tr
-        [:td [:code "disabled"]]
-        [:td "Added to the root of the Radio in case it's disabled."]]
-       [:tr
-        [:td [:code "field"]]
-        [:td "Used as the root class of the component."]]
-       [:tr
-        [:td [:code "input"]]
-        [:td "Used for the input element."]]
-       [:tr
-        [:td [:code "radio"]]
-        [:td "Used to for the radio element."]]
-       [:tr
-        [:td [:code "radio-checked"]]
-        [:td "Used for the radio element when it's checked."]]
-       [:tr
-        [:td [:code "ripple"]]
-        [:td "To provide styles for the ripple."]]
-       [:tr
-        [:td [:code "text"]]
-        [:td "Used to style the text label element."]]]]]))
+       "transferring the given properties that concerns to them."]
+      [:section
+       [:h2 "Properties"]
+       [:table
+        [:thead
+         [:tr
+          [:th "Name"]
+          [:th "Type"]
+          [:th "Default"]
+          [:th "Description"]]]
+        [:tbody
+         [:tr
+          [:td [:code "checked"]]
+          [:td [:code "boolean"]]
+          [:td [:code "false"]]
+          [:td "If true, the input element will be selected by default. Transferred from the parent."]]
+         [:tr
+          [:td [:code "class-name"]]
+          [:td [:code "string"]]
+          [:td [:code "\"\""]]
+          [:td "Set a class to give custom styles to the radio button."]]
+         [:tr
+          [:td [:code "disabled"]]
+          [:td [:code "boolean"]]
+          [:td [:code "false"]]
+          [:td "If true, the item will be displayed as disabled."]]
+         [:tr
+          [:td [:code "label"]]
+          [:td [:code "string"] "or reagent component"]
+          [:td [:code "\"\""]]
+          [:td "Label for the radio button."]]
+         [:tr
+          [:td [:code "name"]]
+          [:td [:code "string"]]
+          [:td]
+          [:td "Name for the input element."]]
+         [:tr
+          [:td [:code "on-blur"]]
+          [:td [:code "function"]]
+          [:td]
+          [:td "Callback function that will be invoked when the input is blurred."]]
+         [:tr
+          [:td [:code "on-change"]]
+          [:td [:code "function"]]
+          [:td]
+          [:td "Callback function that will be invoked when the value changes."]]
+         [:tr
+          [:td [:code "on-focus"]]
+          [:td [:code "function"]]
+          [:td]
+          [:td "Callback function that will be invoked when the input is focused."]]
+         [:tr
+          [:td [:code "value"]]
+          [:td [:code "any"]]
+          [:td]
+          [:td "Value for the radio button."]]]]]
+      [:section
+       [:h2 "Theming"]
+       [:table
+        [:thead
+         [:tr
+          [:th "Name"]
+          [:th "Description"]]]
+        [:tbody
+         [:tr
+          [:td [:code "disabled"]]
+          [:td "Added to the root of the Radio in case it's disabled."]]
+         [:tr
+          [:td [:code "field"]]
+          [:td "Used as the root class of the component."]]
+         [:tr
+          [:td [:code "input"]]
+          [:td "Used for the input element."]]
+         [:tr
+          [:td [:code "radio"]]
+          [:td "Used to for the radio element."]]
+         [:tr
+          [:td [:code "radio-checked"]]
+          [:td "Used for the radio element when it's checked."]]
+         [:tr
+          [:td [:code "ripple"]]
+          [:td "To provide styles for the ripple."]]
+         [:tr
+          [:td [:code "text"]]
+          [:td "Used to style the text label element."]]]]]]]))

 (defmethod layout/pages :radio-buttons [_]
   [view])


inline source maps appear to work fine in Node.js actually

--- src/main/cljs/cljs/js.cljs
+++ src/main/cljs/cljs/js.cljs
@@ -734,8 +734,7 @@
      source name opts cb)))

 (comment
-  (ns cljs.js.test
-    (:require [cljs.js :as cljs]))
+  (require '[cljs.js :as cljs])

   (def vm (js/require "vm"))
   (def fs (js/require "fs"))
@@ -751,7 +750,7 @@
   (defn node-load [{:keys [name macros]} cb]
     (if (contains? libs name)
       (let [path (str "src/test/" (cljs/ns->relpath name)
-                   "." (cljs.core/name (get libs name)))]
+                      "." (cljs.core/name (get libs name)))]
         (.readFile fs path "utf-8"
           (fn [err src]
             (cb (if-not err
@@ -854,4 +853,19 @@
           (println error)
           (println (.. error -cause -stack)))
         (println res))))
+
+  ;; inline source maps work under Node.js
+  (cljs/eval-str st
+    "(ns foo.bar)\n(ffirst [1 2 3])"
+    'foo.bar
+    {:verbose true
+     :source-map false
+     :eval node-eval
+     :load node-load}
+    (fn [{:keys [error] :as res}]
+      (if error
+        (do
+          (println error)
+          (println (.. error -cause -stack)))
+        (println res))))
   )


Removed the pojo subsystem to fix [IMMUTANT-144]

The pojo subsystem apparently tries to deploy beans it finds in any
jboss-beans.xml file it finds on the classpath. The netty jar has one,
of course, but it references a bean that's already installed in the
AS, because it depends on netty, too.

A side benefit of removing the pojo subsystem is the disappearance of
this annoying log message: "Found legacy bean/pojo namespace:
urn:jboss:bean-deployer:2.0 - might be missing some xml
features (potential exceptions)."

It remains to be seen whether Immutant users will rely on this
now-missing feature. I kinda doubt it. :)

--- support/build-support/src/main/clojure/immutant/build/tools.clj
+++ support/build-support/src/main/clojure/immutant/build/tools.clj
@@ -225,6 +225,16 @@
 (defn fix-extensions [loc]
   (add-extensions (append-system-properties loc)))

+(defn fix-extension [loc]
+  (if (= "org.jboss.as.pojo" (-> loc zip/node :attrs :module))
+    (zip/remove loc)
+    loc))
+
+(defn fix-subsystem [loc]
+  (if (re-find #"pojo" (-> loc zip/node :attrs :xmlns))
+    (zip/remove loc)
+    loc))
+
 (defn prepare-zip
   [file]
   (zip/xml-zip (xml/parse file)))
@@ -235,6 +245,8 @@
     (recur (zip/next
             (cond
              (looking-at? :extensions loc) (fix-extensions loc)
+             (looking-at? :extension loc) (fix-extension loc)
+             (looking-at? :subsystem loc) (fix-subsystem loc)
              (looking-at? :profile loc) (fix-profile loc)
              (looking-at? :periodic-rotating-file-handler loc) (add-logger-levels loc)
              (looking-at? :virtual-server loc) (set-welcome-root loc)


filtering rules works, folks!

filtering rules works, folks!

--- src/babel/italiano/lab.cljc
+++ src/babel/italiano/lab.cljc
@@ -292,59 +292,38 @@
                         babel.generate/grammar grammar]
                 (time (generate spec model))))))))

-
-
-(def verbcoach-grammar
-  #{
-    ;;    "adjective-phrase"
-    ;;    "intensifier-phrase"
-    ;;    "nbar1"
-    ;;    "nbar2"
-    ;;    "noun-phrase1"
-    ;;    "noun-phrase2"
-    ;;    "np-to-n-pp"
-    ;;    "prepositional-phrase"
-    ;;    "s-aux"
-    ;;    "s-modified-modifier-first"
-    ;;    "s-modified-modifier-last"
-    ;;    "s-modifier"
-    ;;    "sentence-nonphrasal-head"
-    "sentence-phrasal-head"
-    ;;    "vp"
-    ;;    "vp-32"
-    "vp-aux-22-nonphrasal-comp"
-    "vp-aux-22-phrasal-comp"
-    "vp-aux-nonphrasal-complement"
+(def future-grammar
+  #{"sentence-phrasal-head"
+    "vp-pronoun-nonphrasal"})
+
+(def present-perfect-grammar
+  #{"s-aux"
     "vp-aux-phrasal-complement"
-    "vp-aux-phrasal-complement-essere-false"
-    "vp-infinitive"
-    ;;    "vp-past"
-    "vp-present"
     "vp-pronoun-nonphrasal"})
-;;    "vp-pronoun-phrasal"
-
-
-
-(def verbcoach-pronouns
-  (fn [v]
-    (or
-     (and (= :noun (u/get-in v [:synsem :cat]))
-          (not (= :acc (u/get-in v [:synsem :case]))))
-     (and (= :noun (u/get-in v [:synsem :cat]))
-          (= :acc (u/get-in v [:synsem :case]))
-          (= true (u/get-in v [:synsem :reflexive]))))))
-
-(def
-  verbcoach-index-paths
-  [[:italiano :italiano]
-   [:synsem :aux]
-   [:synsem :cat]
-   [:synsem :essere]
-   [:synsem :infl]
-   [:synsem :sem :pred]])

 (defn create-index-fn [verb-set grammar]
-  (let [lexicon
+  (let [future-grammar
+        #{"sentence-phrasal-head"
+          "vp-pronoun-nonphrasal"}
+
+        verbcoach-pronouns
+        (fn [v]
+          (or
+           (and (= :noun (u/get-in v [:synsem :cat]))
+                (not (= :acc (u/get-in v [:synsem :case]))))
+           (and (= :noun (u/get-in v [:synsem :cat]))
+                (= :acc (u/get-in v [:synsem :case]))
+                (= true (u/get-in v [:synsem :reflexive])))))
+
+        verbcoach-index-paths
+        [[:italiano :italiano]
+         [:synsem :aux]
+         [:synsem :cat]
+         [:synsem :essere]
+         [:synsem :infl]
+         [:synsem :sem :pred]]
+
+        lexicon
         (into {}
               (for [[k vals] (:lexicon model)]
                 (let [filtered-vals
@@ -390,30 +369,50 @@
   "generate arrabiarsi sentences with a grammar subset."
   []
   (let [verb-set #{"arrabbiarsi" "fermarsi" "parlare" "sedersi"}
-        grammar
-        (filter
-         #(contains? verbcoach-grammar (u/get-in % [:rule]))
-         (:grammar model))
+        grammar (filter
+                 #(contains? verbcoach-grammar (u/get-in % [:rule]))
+                 (:grammar model))
         specs [{:root {:italiano {:italiano "arrabbiarsi"}}
                 :synsem {:cat :verb
-                         :modified false
-                         :sem {:tense :past
-                               :aspect :progressive}
+                         :sem {:tense :present
+                               :aspect :perfect}
                          :subcat []}}
-
                {:root {:italiano {:italiano "sedersi"}}
                 :synsem {:cat :verb
-                         :modified false
                          :sem {:tense :future}
-                         :subcat []}}]
-        index-fn (create-index-fn verb-set grammar)]
+                         :subcat []}}]]
     (repeatedly
      #(println
-       (morph (binding [babel.generate/println? false
-                        babel.generate/truncate? true
-                        babel.generate/grammar grammar
-                        babel.generate/index-fn index-fn]
-                (time (generate (first (shuffle specs)) model))))))))
+       (let [chosen-spec
+             (first (shuffle specs))]
+         (let [generate-with-grammar
+               (cond
+                 (not (= :fail
+                         (unify (u/get-in chosen-spec [:synsem :sem])
+                                {:tense :present
+                                 :aspect :perfect})))
+                 (filter (fn [rule-structure]
+                           (contains? present-perfect-grammar
+                                      (u/get-in rule-structure [:rule])))
+                         (:grammar model))
+
+                 (not (= :fail
+                         (unify (u/get-in chosen-spec [:synsem :sem])
+                                {:tense :future})))
+
+                 (filter (fn [rule-structure]
+                           (contains? future-grammar
+                                      (u/get-in rule-structure [:rule])))
+                         (:grammar model))
+                 true
+                 ;; else use entire model
+                 (do
+                   (log/warn "using entire model: will be slow.")
+                   (:grammar model)))]
+           (morph (binding [babel.generate/println? false
+                            babel.generate/truncate? true
+                            babel.generate/grammar generate-with-grammar]
+                    (time (generate chosen-spec model))))))))))

 (defn stampare
   "generate arrabiarsi sentences with a grammar subset."


throw exception when filesystem section is missing

previously we died with a NullPointerException

--- src/brainbot/nozzle/vfs.clj
+++ src/brainbot/nozzle/vfs.clj
@@ -51,7 +51,9 @@
   "create filesystem from ini config section"
   [iniconfig section-name]
   (let [section (iniconfig section-name)
-        fstype (section "type")]
+        fstype (get section "type")]
+    (when-not section
+      (throw (ex-info (format "no filesystem %s declared, section missing" section-name) {:section-name section-name})))
     (if-let [create-fs (get-create-fs-fn fstype)]
       (assoc (create-fs section) :fsid section-name)
       (throw (Exception. (str "unknown filesystem type " fstype))))))


Fixed issue #4

Fixed issue #4

--- src/branch_handler/core.clj
+++ src/branch_handler/core.clj
@@ -233,8 +233,9 @@

 (def ring-app
   "Definition of a Ring-based application behaviour."
-  (-> http-request-handler      ; handle all events
-      http-params/wrap-params)) ; and process request parameters, of course
+  ; handle all events
+  ; and process request parameters, of course
+  (http-params/wrap-params http-request-handler))

 (defn start-server
   "Start the service on regular machine."


fix recur across try in bake.find-namespaces

--- bake/bake/find_namespaces.clj
+++ bake/bake/find_namespaces.clj
@@ -51,10 +51,10 @@
   cannot be found.  The ns declaration must be the first Clojure form
   in the file, except for (comment ...)  forms."
   [#^PushbackReader rdr]
-  (try (let [form (read rdr)]
+  (try (loop [form (read rdr)]
          (cond
            (ns-decl? form) form
-           (comment? form) (recur rdr)
+           (comment? form) (recur (read rdr))
            :else nil))
        (catch Exception e nil)))


An ADD with non-zero CAS always errors.

An ADD with non-zero CAS always errors.

--- src/cbfg/world-storage.cljs
+++ src/cbfg/world-storage.cljs
@@ -24,49 +24,51 @@

 (defn storage-set [actx storage opaque key cas-old val op]
   (ago storage-set actx
-       (let [res (atom nil)]
-         (swap! storage
-                #(let [s1 (assoc % :next-sq (max (:next-sq %)
-                                                 (inc (:max-deleted-sq %))))
-                       sq-new (:next-sq s1)
-                       sq-old (get-in s1 [:keys key])]
-                   (if (and (= op :add) sq-old)
-                     (do (reset! res {:opaque opaque :status :exists
-                                      :key key})
-                         s1)
-                     (let [cas-check (and cas-old (not (zero? cas-old)))
-                           prev-change (when (or cas-check
-                                                 (= op :append)
-                                                 (= op :prepend))
-                                         (get-in s1 [:changes sq-old]))]
-                       (if (and cas-check (not= cas-old (:cas prev-change)))
-                         (do (reset! res {:opaque opaque :status :wrong-cas
+       (let [cas-check (and cas-old (not (zero? cas-old)))]
+         (if (and cas-check (= op :add))
+           {:opaque opaque :status :wrong-cas :key key}
+           (let [res (atom nil)]
+             (swap! storage
+                    #(let [s1 (assoc % :next-sq (max (:next-sq %)
+                                                     (inc (:max-deleted-sq %))))
+                           sq-new (:next-sq s1)
+                           sq-old (get-in s1 [:keys key])]
+                       (if (and (= op :add) sq-old)
+                         (do (reset! res {:opaque opaque :status :exists
                                           :key key})
                              s1)
-                         (if (and (or (= op :replace)
-                                      (= op :append)
-                                      (= op :prepend))
-                                  (not sq-old))
-                           (do (reset! res {:opaque opaque :status :not-found
-                                            :key key})
-                               s1)
-                           (let [cas-new (gen-cas)
-                                 val-new (case op
-                                           :add val
-                                           :replace val
-                                           :append (str (:val prev-change) val)
-                                           :prepend (str val (:val prev-change))
-                                           val)]
-                             (reset! res {:opaque opaque :status :ok
-                                          :key key :sq sq-new :cas cas-new})
-                             (-> s1
-                                 (dissoc-in [:changes sq-old])
-                                 (assoc-in [:keys key] sq-new)
-                                 (assoc-in [:changes sq-new]
-                                           {:key key :sq sq-new :cas cas-new
-                                            :val val-new})
-                                 (update-in [:next-sq] inc)))))))))
-         @res)))
+                         (let [prev-change (when (or cas-check
+                                                     (= op :append)
+                                                     (= op :prepend))
+                                             (get-in s1 [:changes sq-old]))]
+                           (if (and cas-check (not= cas-old (:cas prev-change)))
+                             (do (reset! res {:opaque opaque :status :wrong-cas
+                                              :key key})
+                                 s1)
+                             (if (and (or (= op :replace)
+                                          (= op :append)
+                                          (= op :prepend))
+                                      (not sq-old))
+                               (do (reset! res {:opaque opaque :status :not-found
+                                                :key key})
+                                   s1)
+                               (let [cas-new (gen-cas)
+                                     val-new (case op
+                                               :add val
+                                               :replace val
+                                               :append (str (:val prev-change) val)
+                                               :prepend (str val (:val prev-change))
+                                               val)]
+                                 (reset! res {:opaque opaque :status :ok
+                                              :key key :sq sq-new :cas cas-new})
+                                 (-> s1
+                                     (dissoc-in [:changes sq-old])
+                                     (assoc-in [:keys key] sq-new)
+                                     (assoc-in [:changes sq-new]
+                                               {:key key :sq sq-new :cas cas-new
+                                                :val val-new})
+                                     (update-in [:next-sq] inc)))))))))
+             @res)))))

 (defn storage-del [actx storage opaque key]
   (ago storage-del actx


speed optim

speed optim

--- src/clj/datasplash/core.clj
+++ src/clj/datasplash/core.clj
@@ -218,10 +218,11 @@
                                        *coerce-to-clj* (not without-coercion-to-clj)
                                        *side-inputs* side-ins
                                        *main-output* (when side-outputs (first (sort side-outputs)))
-                                       *extra* (reduce
-                                                (fn [acc [k v]]
-                                                  (assoc acc (keyword k) v))
-                                                {} extra)]
+                                       *extra* (persistent!
+                                                (reduce
+                                                 (fn [acc [k v]]
+                                                   (assoc! acc (keyword k) v))
+                                                 (transient {}) extra))]
                                (f context)))))
          args {"dofn" process-ctx-fn
                "window-fn" window-fn


Fix search filters parsing

Fix search filters parsing

--- src/cljs/subman/search.cljs
+++ src/cljs/subman/search.cljs
@@ -16,7 +16,7 @@

 (defn ?-query-part
   [part-name part-formatter [api-query query]]
-  (let [pattern (re-pattern (str " :" part-name " (\\w*)"))
+  (let [pattern (re-pattern (str ":" part-name " (\\w*)"))
         search-result (re-find pattern query)]
     (if search-result
       (let [value (last search-result)


Refactoring

Refactoring

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -57,18 +57,14 @@
 ;; IDENTIFY CONVERTIBLE CELLS
 ;; -----------------------------------------

-(defn range-single-coord
-  "Creates a range along one coordinate"
-  [x dx max-val]
-  (let [end-range (if (neg? dx) -1 max-val)]
-    (range x end-range dx)))
-
 (defn range-coord
   "Give all the coordinate in the provided direction"
   [[xi yi] [dx dy]]
-  (map vector
-    (range-single-coord xi dx board-width)
-    (range-single-coord yi dy board-height)))
+  (loop [x xi, y yi, res []]
+    (if (or (neg? x) (neg? y) (> x board-width) (> y board-height))
+      res
+      (recur (+ x dx) (+ y dy) (conj res [x y])))
+    ))

 (defn ^boolean is-cell-owned?
   "Indicates whether a cell is owned by any player"
@@ -134,11 +130,12 @@
        :taken [[0 4]]})}}"
   [{:keys [board] :as game}]
   (assoc game :moves
-    (transduce
-      (available-moves-xf board)
-      #(update-in %1 [(:winner %2) (:move %2)] conj %2)
-      {}
-      all-positions) ;; TODO - To optimize, just consider the move of the current player?
+    (time
+      (transduce
+        (available-moves-xf board)
+        #(update-in %1 [(:winner %2) (:move %2)] conj %2)
+        {}
+        all-positions)) ;; TODO - To optimize, just consider the move of the current player?
     ))


Plug the restart game button

Plug the restart game button

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -235,7 +235,7 @@
   [scores player]
   [:div.scores
    (concat
-     [[top-panel-button #(swap! app-state update :help not) (special-char "↻")]]
+     [[top-panel-button #(reset! app-state (new-game)) (special-char "↻")]]
      (show-scores scores player)
      [[top-panel-button #(swap! app-state update :help not) "?"]]
      )])