scheduler:  Add unit test to make sure labels get populated.

--- scheduler/test/cook/test/mesos/api.clj
+++ scheduler/test/cook/test/mesos/api.clj
@@ -45,6 +45,8 @@
         uuid #uuid "386b374c-4c4a-444f-aca0-0c25384c6fa0"
         env {"MY_VAR" "one"
              "MY_OTHER_VAR" "two"}
+        labels {"key1" "value1"
+                "key2" "value2"}
         uris [{"value" "http://cool.com/data.txt"
                "extract" false}
               {"value" "ftp://bar.com/data.zip"
@@ -59,6 +61,7 @@
              "max_runtime" 1000000
              "uris" uris
              "env" env
+             "labels" labels
              "cpus" 2.0
              "mem" 2048.0}
         h (handler conn "my-framework-id" {:cpus 12 :memory-gb 100})]
@@ -74,6 +77,7 @@
           resources (util/job-ent->resources ent)]
       (is (= "hello world" (:job/command ent)))
       (is (= (util/job-ent->env ent) env))
+      (is (= (util/job-ent->label ent) labels))
       (is (= (:cpus resources) 2.0))
       (is (= (:mem resources) 2048.0))
       (is (compare-uris (map kw-keys uris) (:uris resources))))


removed unused nodoc metadata from tests

--- test/unit/utils.clj
+++ test/unit/utils.clj
@@ -2,7 +2,7 @@
   (:require [clj-fakes.macro :refer [-cljs-env?]]
             [clojure.string :as string]))

-(defmacro ^:no-doc -deftest
+(defmacro -deftest
   "The same as deftest but name is defined using a string.
   Inspired by: https://gist.github.com/mybuddymichael/4425558"
   [name-string & body]
@@ -16,7 +16,7 @@
                         symbol)]
     `(~deftest ~name-symbol ~@body)))

-(defmacro ^:no-doc -is-exception-thrown
+(defmacro -is-exception-thrown
   "(is (thrown-with-msg? ...)) for specified exceptions in Clojure/ClojureScript."
   [clj-exc-class cljs-exc-class re expr]
   (let [is (if (-cljs-env? &env) 'cljs.test/is
@@ -25,12 +25,12 @@
                                         clj-exc-class)]
     `(~is (~'thrown-with-msg? ~exc-class ~re ~expr))))

-(defmacro ^:no-doc -is-error-thrown
+(defmacro -is-error-thrown
   "(is (thrown-with-msg? ...)) for general exceptions in Clojure/ClojureScript."
   [re expr]
   `(-is-exception-thrown Exception js/Error ~re ~expr))

-(defmacro ^:no-doc -is-assertion-error-thrown
+(defmacro -is-assertion-error-thrown
   "(is (thrown-with-msg? ...)) for assert exceptions in Clojure/ClojureScript."
   [re expr]
   `(-is-exception-thrown AssertionError js/Error ~re ~expr))


adding receive

adding receive

--- phoenix-client/src/systems/casemgr/utils/phoenix_client/core.cljs
+++ phoenix-client/src/systems/casemgr/utils/phoenix_client/core.cljs
@@ -9,13 +9,14 @@

 (enable-console-print!)

+(println "starting...")
 ;(println "This text is printed from src/systems.casemgr.utils.phoenix-client/core.cljs. Go ahead and edit it and see reloading in action.")

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

 (defonce app-state (atom {:text "Hello world!"}))

-(def socket (js/Phoenix.Socket. "ws://localhost:4000/socket"  {:params {:userToken "123"}}))
+(def socket (js/Phoenix.Socket. "ws://localhost:4000/socket"  (clj->js {"params:" {"userToken:" "123"}})))
                                         ;(println (js-keys socket))
 (def connected-socket (. socket connect))

@@ -23,16 +24,23 @@
 (def channel (. socket channel "room:lobby" ))

 (defn receive [params]
+  (println "in receive:")
   (println (js-keys params))
   (println (aget params "token"))
   (println (aget params "path"))
+  (println (aget params "body"))
   )

 ;(. channel on )
 ;(doto (. channel join)
 ;  (events/listen "receive" receive))
-(def joined-channel (. channel join))
+;(def joined-channel (. channel join))
+;(-> channel .join (.receive "ok" #(js/console.log "ok" %)) (.receive "error" #(js/console.log "error" %)))
+(-> channel .join (.receive "ok" receive) )
 ;something like (-> channel .join (.receive "ok" #(js/console.log "meh" %))) should work
+;(-> channel .leave)
+
+(-> channel .canPush)

 (. channel push "new_msg" (clj->js {:token "hello world" :path "/shop1/cust1"}))
 (. channel on "new_msg" receive)


:bug: Fixed problem when create a shape with click

--- frontend/src/app/main/data/workspace/drawing.cljs
+++ frontend/src/app/main/data/workspace/drawing.cljs
@@ -80,6 +80,7 @@
                               (gpt/point v v))
                             scalev)]
               (-> shape
+                  (assoc ::click-draw? false)
                   (assoc-in [:modifiers :resize-vector] scalev)
                   (assoc-in [:modifiers :resize-origin] (gpt/point x y))
                   (assoc-in [:modifiers :resize-rotation] 0))))
@@ -112,7 +113,8 @@
                         (get-in [:workspace-drawing :object])
                         (geom/setup {:x (:x initial) :y (:y initial) :width 1 :height 1})
                         (assoc :frame-id fid)
-                        (assoc ::initialized? true))]
+                        (assoc ::initialized? true)
+                        (assoc ::click-draw? true))]
           (rx/concat
            ;; Add shape to drawing state
            (rx/of #(assoc-in state [:workspace-drawing :object] shape))
@@ -123,6 +125,7 @@
                           #(update-in % [:workspace-drawing :object] assoc :x x :y y))))

            (->> ms/mouse-position
+                (rx/filter #(> (gpt/distance % initial) 2))
                 (rx/with-latest vector ms/mouse-position-ctrl)
                 (rx/switch-map
                  (fn [[point :as current]]
@@ -269,15 +272,23 @@
         (rx/concat
          (rx/of dw/clear-drawing)
          (when (::initialized? shape)
-           (let [shape-min-width (case (:type shape)
-                                   :text 20
-                                   5)
-                 shape-min-height (case (:type shape)
-                                    :text 16
-                                    5)
+           (let [shape-click-width (case (:type shape)
+                                   :text 150
+                                   20)
+                 shape-click-height (case (:type shape)
+                                    :text 40
+                                    20)
+                 shape (if (::click-draw? shape)
+                         (-> shape
+                             (assoc-in [:modifiers :resize-vector]
+                                       (gpt/point shape-click-width shape-click-height))
+                             (assoc-in [:modifiers :resize-origin]
+                                       (gpt/point (:x shape) (:y shape))))
+                         shape)
                  shape (-> shape
                            geom/transform-shape
-                           (dissoc ::initialized?))                 ]
+                           (dissoc ::initialized?
+                                   ::click-draw?))]
              ;; Add & select the created shape to the workspace
              (rx/of dw/deselect-all
                     (dw/add-shape shape)))))))))


Une première solution à l'exercice Triangle d'Exercism dans la track Clojure

--- exercism/clojure/triangle/src/triangle.clj
+++ exercism/clojure/triangle/src/triangle.clj
@@ -1,5 +1,19 @@
 (ns triangle)

-(defn type [] ;; <- arglist goes here
-      ;; your code goes here
-)
+(defn type [side1 side2 side3]
+  (cond
+    (or
+     (or (<= (+ side2 side3) side1)
+         (<= (+ side1 side3) side2)
+         (<= (+ side1 side2) side3))
+     (or (= 0 side1)
+         (= 0 side2)
+         (= 0 side3))) :illogical
+    (and (= side1 side2)
+         (= side2 side3)) :equilateral
+    (or (= side1 side2)
+        (= side1 side3)
+        (= side2 side3)) :isosceles
+    :else :scalene
+    )
+  )


Add Other Orgs to cards

Add Other Orgs to cards

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -696,8 +696,7 @@
                                (filter #(= vcs-type (:vcs_type %)))
                                (map :name))
                               piggieback-orgs)]
-    ;; width has been set to 20% here
-    [:div.controls.col-md-3
+    [:div.controls
      [:h4 (str (utils/prettify-vcs_type vcs-type) " Organizations")]
      ;; orgs that this user can add to piggieback orgs and existing piggieback orgs
      (for [org-name (cond->> (disj (clojure.set/union vcs-org-names
@@ -736,35 +735,30 @@
                   (group-by :vcs_type))]
          [:div
           [:fieldset
-           [:legend "Extra organizations"]
            [:p
             "Your plan covers all projects (including forked repos) in the "
             [:strong org-name]
             " organization by default."]
            [:p "You can let any GitHub organization you belong to, including personal accounts, piggieback on your plan. Projects in your piggieback organizations will be able to run builds on your plan."]
-           [:p
-            [:span.label.label-info "Note:"]
-            " Members of the piggieback organizations will be able to see that you're paying for them, the name of your plan, and the number of containers you've paid for. They won't be able to edit the plan unless they are also admins on the " org-name " org."]
+           [:p "Members of the piggieback organizations will be able to see that you're paying for them, the name of your plan, and the number of containers you've paid for. They won't be able to edit the plan unless they are also admins on the " org-name " org."]
            (if-not (or gh-users-and-orgs bb-users-and-orgs)
              [:div "Loading organization list..."]
              [:form
-              [:div.container-fluid
-               [:div.row
-                (when (seq gh-users-and-orgs)
-                  (piggieback-org-list piggieback-orgs selected-piggieback-orgs gh-users-and-orgs owner))
-                (when (seq bb-users-and-orgs)
-                  (piggieback-org-list piggieback-orgs selected-piggieback-orgs bb-users-and-orgs owner))]
-               [:div.row
-                [:div.form-actions.span7
-                 (button/managed-button
-                  {:success-text "Saved"
-                   :loading-text "Saving..."
-                   :failed-text "Failed"
-                   :on-click #(raise! owner [:save-piggieback-orgs-clicked {:org-name org-name
-                                                                            :vcs-type org-vcs_type
-                                                                            :selected-piggieback-orgs selected-piggieback-orgs}])
-                   :kind :primary}
-                  "Save")]]]])]])))))
+              [:div.org-lists
+               (when (seq gh-users-and-orgs)
+                 (piggieback-org-list piggieback-orgs selected-piggieback-orgs gh-users-and-orgs owner))
+               (when (seq bb-users-and-orgs)
+                 (piggieback-org-list piggieback-orgs selected-piggieback-orgs bb-users-and-orgs owner))]
+              [:div
+               (button/managed-button
+                {:success-text "Saved"
+                 :loading-text "Saving..."
+                 :failed-text "Failed"
+                 :on-click #(raise! owner [:save-piggieback-orgs-clicked {:org-name org-name
+                                                                          :vcs-type org-vcs_type
+                                                                          :selected-piggieback-orgs selected-piggieback-orgs}])
+                 :kind :primary}
+                "Pay for organizations")]])]])))))

 (defn transfer-organizations-list [[{:keys [vcs_type]} :as users-and-orgs] selected-transfer-org owner]
   ;; split user-orgs from orgs and grab the first (and only) user-org
@@ -775,7 +769,7 @@
                               true (map :login)
                               true (sort-by string/lower-case)
                               user-login (cons user-login))]
-    [:div.controls.col-md-3
+    [:div.controls
      [:h4 (str (utils/prettify-vcs_type vcs_type) " Organizations")]
      (for [org-name sorted-org-names
            :let [org-map {:org-name org-name
@@ -803,55 +797,54 @@
                                                         (= (:vcs_type %) vcs_type)))
                                           (group-by :vcs_type))
           selected-transfer-org-name (:org-name selected-transfer-org)]
-      [:div.row-fluid
-       [:div.span8
-        [:fieldset
-         [:legend "Transfer plan to a different organization"]
-         [:div.alert.alert-warning
-          [:strong "Warning!"]
-          [:p "If you're not an admin on the "
-           (if selected-transfer-org-name
-             (str selected-transfer-org-name " organization,")
-             "organization you transfer to,")
-           " then you won't be able to transfer the plan back or edit the plan."]
-          [:p
-           "The transferred plan will be extended to include the "
-           org-name " organization, so your builds will continue to run. Only admins of the "
-           (if selected-transfer-org-name
-             (str selected-transfer-org-name " org")
-             "organization you transfer to")
-           " will be able to edit the plan."]]
-         (if-not user-orgs
-           [:div "Loading organization list..."]
-           [:div.container-fluid
-            [:form
-             [:div.row
-              (when gh-user-orgs
-                (transfer-organizations-list gh-user-orgs selected-transfer-org owner))
-              (when bb-user-orgs
-                (transfer-organizations-list bb-user-orgs selected-transfer-org owner))]
-             [:div.row
-              [:div.form-actions.span6
-               (button/managed-button
-                {:success-text "Transferred"
-                 :loading-text "Transferring..."
-                 :disabled? (not selected-transfer-org)
-                 :kind :primary
-                 :on-click #(raise! owner
-                                    [:transfer-plan-clicked
-                                     {:from-org {:org-name org-name
-                                                 :vcs-type vcs_type}
-                                      :to-org selected-transfer-org}])}
-                "Transfer Plan")]]]])]]]))))
+      [:div
+       [:fieldset
+        [:div.alert.alert-warning
+         [:p [:strong "Warning!"]]
+         [:p "If you're not an admin on the "
+          (if selected-transfer-org-name
+            (str selected-transfer-org-name " organization,")
+            "organization you transfer to,")
+          " then you won't be able to transfer the plan back or edit the plan."]
+         [:p
+          "The transferred plan will be extended to include the "
+          org-name " organization, so your builds will continue to run. Only admins of the "
+          (if selected-transfer-org-name
+            (str selected-transfer-org-name " org")
+            "organization you transfer to")
+          " will be able to edit the plan."]]
+        (if-not user-orgs
+          [:div "Loading organization list..."]
+          [:form
+           [:div.org-lists
+            (when gh-user-orgs
+              (transfer-organizations-list gh-user-orgs selected-transfer-org owner))
+            (when bb-user-orgs
+              (transfer-organizations-list bb-user-orgs selected-transfer-org owner))]
+           [:div
+            (button/managed-button
+             {:success-text "Transferred"
+              :loading-text "Transferring..."
+              :disabled? (not selected-transfer-org)
+              :kind :primary
+              :on-click #(raise! owner
+                                 [:transfer-plan-clicked
+                                  {:from-org {:org-name org-name
+                                              :vcs-type vcs_type}
+                                   :to-org selected-transfer-org}])}
+             "Transfer plan")]])]]))))

 (defn organizations [app owner]
   (om/component
    (html
     [:div.organizations
-     (om/build piggieback-organizations {:current-org (get-in app state/org-data-path)
-                                         :user-orgs (get-in app state/user-organizations-path)})
-     (om/build transfer-organizations {:current-org (get-in app state/org-data-path)
-                                       :user-orgs (get-in app state/user-organizations-path)})])))
+     (card/collection
+       [(card/titled {:title "Extra Organizations"}
+                     (om/build piggieback-organizations {:current-org (get-in app state/org-data-path)
+                                                         :user-orgs (get-in app state/user-organizations-path)}))
+        (card/titled {:title "Transfer plan to a different organization"}
+                     (om/build transfer-organizations {:current-org (get-in app state/org-data-path)
+                                                       :user-orgs (get-in app state/user-organizations-path)}))])])))

 (defn- billing-card [app owner]
   (reify


Removing the osx portion the from container price.

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -299,7 +299,8 @@
                                  80
                                  (let [n (* 2 selected-containers)] (+ n (- 10 (mod n 10)))))
             selected-paid-containers (max 0 (- selected-containers (pm/freemium-containers plan)))
-            old-total (pm/stripe-cost plan)
+            osx-total (or (some-> plan :osx :template :price) 0)
+            old-total (- (pm/stripe-cost plan) osx-total)
             new-total (pm/cost plan selected-containers)
             container-cost (pm/per-container-cost plan)
             piggiebacked? (pm/piggieback? plan org-name)


small QR code fix

small QR code fix

--- iwaswhere-web/src/cljs/iwaswhere_web/ui/menu.cljs
+++ iwaswhere-web/src/cljs/iwaswhere_web/ui/menu.cljs
@@ -45,7 +45,7 @@
                 reset-msg (merge msg {:reset-to false})]
             (put-fn [:cmd/schedule-new {:timeout 20000
                                         :message [:cmd/toggle-key reset-msg]}])
-            (put-fn [:cmd/toggle-key msg])))]
+            (put-fn [:cmd/toggle-key (merge msg {:reset-to true})])))]
     [:div
      [:span.fa.fa-thumbs-up.toggle
       {:class    (when-not sort-by-upvotes? "inactive")
@@ -54,7 +54,8 @@
        ^{:key (str "toggle" (:cls option))}
        [toggle-option-view option cfg put-fn])
      [:span.fa.fa-qrcode.toggle
-      {:on-click toggle-qr-code :class (when-not (:qr-code cfg) "inactive")}]
+      {:on-click toggle-qr-code
+       :class    (when-not (:qr-code cfg) "inactive")}]
      [:span.fa.fa-ellipsis-h.toggle
       {:on-click #(put-fn [:cmd/toggle-lines])}]]))


pass all tests

pass all tests

--- src/atom_finder/classifier/type-conversion.clj
+++ src/atom_finder/classifier/type-conversion.clj
@@ -15,8 +15,6 @@

 (s/defrecord TD ;TypeDescription
     [number-type :- s/Keyword bits :- s/Int])
-(def DeclSpec IASTSimpleDeclSpecifier)
-(def TypeKind IBasicType$Kind)

 (def type-components
   [
@@ -43,9 +41,25 @@
 (def decl-type (into {} (map #(into [] (vals (select-keys % [1 2]))) type-components)))
 (def intl-type (into {} (map #(into [] (vals (select-keys % [0 2]))) type-components)))

+(s/defn decl-spec-range :- [(s/one s/Int "lower") (s/one s/Int "upper")]
+  "Which values can safely be stored in a variable declared to this type"
+  [node :- IASTSimpleDeclSpecifier]
+
+  (let [unsigned (.isUnsigned node)
+        bits (->> node .getType decl-type :bits)
+        signed-range [(->> 8 dec (Math/pow 2) int -)
+                      (->> 8 dec (Math/pow 2) int dec)]
+        ]
+
+    (if unsigned
+      (map #(- % (first signed-range)) signed-range)
+      signed-range)))
+
 (s/defn coercing-declaration; :- CoercionContext
   [node :- IASTDeclaration]
-  (let [context-type (->> node .getDeclSpecifier .getType decl-type)
+  (let [context-spec (.getDeclSpecifier node)
+        context-type (->> context-spec .getType decl-type)
+        [context-lower context-upper] (decl-spec-range context-spec)
         arg-exprs (map #(->> % .getInitializer .getInitializerClause) (.getDeclarators node))
         arg-types (map #(->> % .getExpressionType .getKind intl-type) arg-exprs)]

@@ -58,7 +72,7 @@
       (any-pred? (fn [[type expr]]
                    (and (numeric-literal? expr)
                         (#{:int} (:number-type type))
-                        (< (:bits context-type) (number-bits (parse-numeric-literal (write-ast expr))))))
+                        (not (<= context-lower (parse-numeric-literal expr) context-upper))))
                  (map vector arg-types arg-exprs))
   )))

@@ -68,16 +82,14 @@
      )
 (numeric-literal? (parse-expr"261"))

-(->> "-0x235"
-     radix
-     )
-
-(->> "int *V1 = 1.99, v2 = -265"
+(->> "unsigned int *V1 = 1.99, v2 = -265"
      parse-expr
-     .getDeclarators
-     last
-     .getInitializer
-     .getInitializerClause
+     .getDeclSpecifier
+     ;public-methods
+     ;(map :name)
+     ;.getType
+     ;decl-type
+     ;.isUnsigned
      )

 ; https://www.safaribooksonline.com/library/view/c-in-a/0596006977/ch04.html


modify snippets to call construct-html so _include tags are processed

--- src/app/cljs-macros/one/sample/snippets.clj
+++ src/app/cljs-macros/one/sample/snippets.clj
@@ -1,11 +1,11 @@
 (ns one.sample.snippets
   "Macros for including HTML snippets in the ClojureScript application
   at compile time."
-  (:use [one.templates :only (render)])
+  (:use [one.templates :only (render construct-html)])
   (:require [net.cgrand.enlive-html :as html]))

 (defn- snippet [file id]
-  (render (html/select (html/html-resource file) id)))
+  (render (html/select (construct-html (html/html-resource file)) id)))

 (defmacro snippets
   "Expands to a map of HTML snippets which are extracted from the


[#2643] Fix tests

[#2643] Fix tests

--- backend/test/akvo/lumen/lib/aggregation_test.clj
+++ backend/test/akvo/lumen/lib/aggregation_test.clj
@@ -258,10 +258,10 @@
                                        :subBucketColumn   "c3"})]
         (is (= query-result
                {:series
-                [{:key 1.0, :label 1.0, :data '({:value 1.0} {:value 0} {:value 0})}
-                 {:key 2.0, :label 2.0, :data '({:value 0} {:value 2.0} {:value 0})}
-                 {:key 4.0, :label 4.0, :data '({:value 0} {:value 0} {:value 4.0})}
-                 {:key 3.0, :label 3.0, :data '({:value 0} {:value 0} {:value 3.0})}],
+                [{:key 1.0, :label 1.0, :data [{:value 1.0} {:value 0} {:value 0}]}
+                 {:key 2.0, :label 2.0, :data [{:value 0} {:value 2.0} {:value 0}]}
+                 {:key 3.0, :label 3.0, :data [{:value 0} {:value 0} {:value 3.0}]}
+                 {:key 4.0, :label 4.0, :data [{:value 0} {:value 0} {:value 4.0}]}],
                 :common
                 {:metadata {:type "text"},
                  :data


Use reify instead defrecord for session backend.

--- src/clojure/buddy/auth/backends/session.clj
+++ src/clojure/buddy/auth/backends/session.clj
@@ -18,25 +18,24 @@
             [clojure.string :refer [split]]
             [ring.util.response :refer [response response? header status]]))

-(defrecord SessionBackend [unauthorized-handler]
-  proto/Authentication
-  (parse [_ request]
-    (:identity (:session request)))
-  (authenticate [_ request data]
-    (assoc request :identity data))
-
-  proto/Authorization
-  (handle-unauthorized [_ request metadata]
-    (if unauthorized-handler
-      (unauthorized-handler request metadata)
-      (if (authenticated? request)
-        (-> (response "Permission denied")
-            (status 403))
-        (-> (response "Unauthorized")
-            (status 401))))))
-
 (defn session-backend
   "Given some options, create a new instance
   of HttpBasicBackend and return it."
   [& [{:keys [unauthorized-handler]}]]
-  (->SessionBackend unauthorized-handler))
+  (reify
+    proto/Authentication
+    (parse [_ request]
+      (:identity (:session request)))
+    (authenticate [_ request data]
+      (assoc request :identity data))
+
+    proto/Authorization
+    (handle-unauthorized [_ request metadata]
+      (if unauthorized-handler
+        (unauthorized-handler request metadata)
+        (if (authenticated? request)
+          (-> (response "Permission denied")
+              (status 403))
+          (-> (response "Unauthorized")
+              (status 401)))))))
+


ClojureScriptify Exceptions

ClojureScriptify Exceptions

--- modules/reitit-ring/src/reitit/ring/coercion.cljc
+++ modules/reitit-ring/src/reitit/ring/coercion.cljc
@@ -172,10 +172,10 @@
                        ([request]
                         (try
                           (handler request)
-                          (catch Exception e
+                          (catch #?(:clj Exception :cljs js/Error) e
                             (handle-coercion-exception e identity #(throw %)))))
                        ([request respond raise]
                         (try
                           (handler request respond (fn [e] (handle-coercion-exception e respond raise)))
-                          (catch Throwable e
+                          (catch #?(:clj Exception :cljs js/Error) e
                             (handle-coercion-exception e respond raise))))))))}))


Cut everything except some assertion macros from core ns

--- src/main/clojure/com/stuartsierra/lazytest.clj
+++ src/main/clojure/com/stuartsierra/lazytest.clj
@@ -1,28 +1,4 @@
-(ns com.stuartsierra.lazytest
-  (:use [com.stuartsierra.lazytest.contexts
-         :only (context?)]
-        [com.stuartsierra.lazytest.arguments
-         :only (or-nil)]))
-
-
-;;; Examples and ExampleGroups
-
-(defrecord ExampleGroup [contexts examples])
-
-(defn new-example-group
-  "Creates an ExampleGroup."
-  ([contexts examples] (new-example-group contexts examples nil))
-  ([contexts examples metadata]
-     {:pre [(or-nil vector? contexts)
-            (or-nil vector? examples)
-            (every? context? contexts)
-            (every? fn? examples)
-            (or-nil map? metadata)]
-      :post [(isa? (type %) ExampleGroup)]}
-     (ExampleGroup. contexts examples nil metadata)))
-
-
-;;; Public API
+(ns com.stuartsierra.lazytest)

 (defmacro thrown?
   "Returns true if body throws an instance of class c."


Parse all iso dates. For now only to undefined (UTC?) timezone. Can be used for datestrings to

--- src/main/clojure/pdok/featured/json_reader.clj
+++ src/main/clojure/pdok/featured/json_reader.clj
@@ -22,10 +22,10 @@
     (->NewFeature dataset collection id validity geom attributes)))

 ;; 2015-02-26T15:48:26.578Z
-(def ^{:private true} date-time-formatter (tf/formatters :date-time) )
+(def ^{:private true} date-time-formatter (tf/formatters :date-time-parser) )

 (defn- parse-time
-  "Parses a json date timestring: yyyy-MM-ddThh:mm:sss.mmmZ"
+  "Parses an ISO8601 date timestring to local date"
   [datetimestring]
   (tf/parse date-time-formatter datetimestring))


[PDOK-1592] do not delete current version

--- src/main/clojure/pdok/featured/timeline.clj
+++ src/main/clojure/pdok/featured/timeline.clj
@@ -311,9 +311,9 @@
   (try
     (let [transform-fn (juxt #(set (:_all_versions %)))
           records (map transform-fn features)
-          versions (mapcat
-                    (fn [f] (map #(vector (:_dataset f) (:_collection f) %) (:_all_versions f)))
-                    features)]
+          versions (mapcat (fn [f] (map #(vector (:_dataset f) (:_collection f) %) (filter #(not= % (:_version f)) (:_all_versions f))))
+                           features)
+          ]
       (j/execute! db (cons (delete-history-sql) records) :multi? true :transaction? false)
       (j/execute! db (cons (delete-history-delta-sql) versions) :multi? true :transaction? false))
      (catch java.sql.SQLException e


Allow to respond to screen mounting before updating the root query

--- src/main/workflo/macros/screen/om_next.cljs
+++ src/main/workflo/macros/screen/om_next.cljs
@@ -151,9 +151,9 @@
                                        [])})
                         (:layout screen))}]}]]
     (set-active-screen! screen params)
-    (om/set-query! c {:params params :query query})
     (some-> app :config :screen-mounted
-            (apply [app screen params]))))
+            (apply [app screen params]))
+    (om/set-query! c {:params params :query query})))

 ;;;; Application bootstrapping


Make code popup size not bigger than modal popup

--- src/webapp/framework/client/coreclient.cljs
+++ src/webapp/framework/client/coreclient.cljs
@@ -244,14 +244,14 @@
 ;                    <button type='button' class='btn btn-primary'>Save changes</button>

     (crate/raw "
-

+

                     <button type='button' class='close' data-dismiss='modal' aria-hidden='true'>×</button>

Modal title

-

+

                     <button type='button' class='btn btn-primary' data-dismiss='modal'>Close</button>
@@ -547,7 +547,7 @@
   (popup :title "Code"
          :body-html
          (str
-         "

"
+         "

"
          (get @gui-html (get @el-fn-mapping id))
          "

"
          )


added a skeleton for the rest of the analytics tests

--- test-cljs/frontend/analytics/test_core.cljs
+++ test-cljs/frontend/analytics/test_core.cljs
@@ -51,3 +51,23 @@
       (test-utils/fails-schema-validation #(analytics/track {:event-type :shibbity-ibbity-ima-fake-event
                                                              :owner (test-utils/owner data)})))))

+(deftest track-external-click-works
+  (testing "a valid external-click event is fired")
+  (testing "track :external-click is checking for valid event-data")
+  (testing "track :external-click is not allowing non-valid events")
+  )
+
+(deftest track-build-triggered-works
+  (testing "track :build-triggered adds the correct properties")
+  (testing "track :build-triggered is checking for valid event-data")
+  )
+
+(deftest track-view-build-works
+  (testing "track :view-build adds the correct properties")
+  (testing "track :view-build is checking for valid event-data")
+  )
+
+(deftest track-init-user-works
+  (testing "track :init-user adds the correct properties and calls segment/identify")
+  (testing "track :init-user is checking for valid event-data")
+  )


fixed auth tests

fixed auth tests

#51

--- test/clj/swarmpit/dockerhub/client_test.clj
+++ test/clj/swarmpit/dockerhub/client_test.clj
@@ -7,8 +7,5 @@

   (testing "error"
     (is (thrown-with-msg?
-          ExceptionInfo #":password"
-          (login {:username "fail" :password "pass"})))
-    (is (thrown-with-msg?
-          ExceptionInfo #"Dockerhub error: Incorrect authentication credentials."
-          (login {:username "fail" :password "incorrect"})))))
+          ExceptionInfo #"Dockerhub error: Not Found"
+          (info {:username (swarmpit.uuid/uuid)})))))


New tests: test-properties->map-3/4 and test-load-property-file

--- test/emender_jenkins/config_loader_test.clj
+++ test/emender_jenkins/config_loader_test.clj
@@ -192,4 +192,22 @@
                          (.setProperty "propertyB" "property_b"))]
         (is (= {:propertyA "property_a" :propertyB "property_b"} (properties->map property)))))

-
+(deftest test-properties->map-3
+    "Check the behaviour of function emender-jenkins/properties->map."
+    (let [property (doto (new java.util.Properties)
+                         (.setProperty "value1" "1")
+                         (.setProperty "value2" "2"))]
+        (is (= {:value1 "1" :value2 "2"} (properties->map property)))))
+
+(deftest test-properties->map-4
+    "Check the behaviour of function emender-jenkins/properties->map."
+    (let [property (doto (new java.util.Properties)
+                         (.setProperty "value1" "")
+                         (.setProperty "" "2"))]
+        (is (= {(keyword "") "2" :value1 ""} (properties->map property)))))
+
+(deftest test-load-property-file
+    "Check the behaviour of function emender-jenkins/load-property-file."
+    (let [property (load-property-file "test/test1.properties")]
+        (is (= {:value1 "value1" :value2 "42" :value.3 "3"} (properties->map property)))))
+


Removing accidentally committed code that left in an extra call to ECHO. This was likely a cause of performance problems.

--- transmit-lib/src/cmr/transmit/echo/rest.clj
+++ transmit-lib/src/cmr/transmit/echo/rest.clj
@@ -29,7 +29,6 @@
    (let [conn (config/context->app-connection context :echo-rest)
          url (format "%s%s" (conn/root-url conn) url-path)
          params (merge (request-options conn) options)
-         response (client/get url params)
          start (System/currentTimeMillis)
          response (client/get url params)
          _ (debug (format "Completed ECHO GET Request to %s in [%d] ms" url (- (System/currentTimeMillis) start)))


dependency upgrades: [org.clojure/clojure "1.7.0-alpha6"] [com.taoensso/carmine "2.9.2"]

--- Clojure-Websockets/TwitterClient/project.clj
+++ Clojure-Websockets/TwitterClient/project.clj
@@ -8,13 +8,13 @@
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [clojurewerkz/elastisch "2.2.0-beta2"]
                  [org.clojure/tools.logging "0.3.1"]
-                 [com.matthiasnehlsen/inspect "0.1.12"]
+                 [com.matthiasnehlsen/inspect "0.1.13"]
                  [matthiasn/systems-toolbox "0.1.23-SNAPSHOT"]
                  [ch.qos.logback/logback-classic "1.1.2"]
                  [org.clojure/core.match "0.3.0-alpha4"]
                  [clj-time "0.9.0"]
                  [clj-pid "0.1.1"]
-                 [com.taoensso/carmine "2.9.0" :exclusions [com.taoensso/encore]]
+                 [com.taoensso/carmine "2.9.2" :exclusions [com.taoensso/encore]]
                  [metrics-clojure "2.4.0"]]

   :source-paths ["src/clj/"]


insights: skip rendering empty graphs

insights: skip rendering empty graphs

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -251,26 +251,28 @@
        (map add-minute-measures)))

 (defn project-insights-bar [builds owner]
-  (let [chart-builds (chartable-builds builds)]
-    (reify
-      om/IDidMount
-      (did-mount [_]
-        (let [el (om/get-node owner)]
-          (insert-skeleton el)))
-      om/IDidUpdate
-      (did-update [_ prev-props prev-state]
-        (let [el (om/get-node owner)]
-          (visualize-insights-bar! el chart-builds)))
-      om/IRender
-      (render [_]
-        (html
-         [:div.build-time-visualization])))))
+  (reify
+    om/IDidMount
+    (did-mount [_]
+      (let [el (om/get-node owner)]
+        (insert-skeleton el)
+        (visualize-insights-bar! el builds)))
+    om/IDidUpdate
+    (did-update [_ prev-props prev-state]
+      (let [el (om/get-node owner)]
+        (visualize-insights-bar! el builds)))
+    om/IRender
+    (render [_]
+      (html
+       [:div.build-time-visualization]))))

 (defrender project-insights [{:keys [reponame username default_branch recent-builds]} owner]
-  (html
-   [:div.project-block
-    [:h1 (gstring/format "Build Status: %s/%s/%s" username reponame default_branch)]
-    (om/build project-insights-bar recent-builds)]))
+  (let [builds (chartable-builds recent-builds)]
+    (when (not-empty builds)
+      (html
+       [:div.project-block
+        [:h1 (gstring/format "Build Status: %s/%s/%s" username reponame default_branch)]
+        (om/build project-insights-bar builds)]))))

 (defrender build-insights [data owner]
   (let [projects (get-in data state/projects-path)]


insights: use new helpers to print duration

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -56,14 +56,6 @@
 (defn add-queued-time [build]
   (let [queued-time (max (build/queued-time build) 0)]
     (assoc build :queued_time_millis queued-time)))
-
-(defn add-minute-measures [build]
-  (let [key-mapping {:queued_time_minutes :queued_time_millis
-                     :build_time_minutes :build_time_millis}]
-    (reduce-kv (fn [accum new-key old-key]
-                 (assoc accum new-key (/ (old-key build) 1000 60)))
-               build
-               key-mapping)))

 (defn build-graphable [{:keys [outcome]}]
   (#{"success" "failed" "canceled"} outcome))
@@ -129,7 +121,7 @@
         (.text #(aget % "text")))))

 (defn visualize-insights-bar! [el builds]
-  (let [y-pos-max (apply max (map :build_time_minutes
+  (let [y-pos-max (apply max (map :build_time_millis
                                   builds))
         y-neg-max (apply max (map :queued_time_millis
                                   builds))
@@ -140,18 +132,20 @@
         y-neg-scale (-> (js/d3.scale.linear)
                         (.domain #js[0 y-neg-max])
                         (.range #js[y-zero (:height plot-info)]))
-        y-pos-tick-values (map js/Math.round
-                               [y-pos-max (* y-pos-max 0.5) 0])
-        y-neg-tick-values (map js/Math.round
-                               [y-neg-max])
+        y-pos-tick-values `(~@(map datetime/nice-floor-duration
+                                   [y-pos-max (* y-pos-max 0.5)])
+                            0)
+        y-neg-tick-values [(datetime/nice-floor-duration y-neg-max)]
         y-pos-axis (-> (js/d3.svg.axis)
                        (.scale y-pos-scale)
                        (.orient "left")
-                       (.tickValues (clj->js y-pos-tick-values)))
+                       (.tickValues (clj->js y-pos-tick-values))
+                       (.tickFormat #(first (datetime/millis-to-float-duration % {:decimals 0}))))
         y-neg-axis (-> (js/d3.svg.axis)
                        (.scale y-neg-scale)
                        (.orient "left")
-                       (.tickValues (clj->js y-neg-tick-values)))
+                       (.tickValues (clj->js y-neg-tick-values))
+                       (.tickFormat #(first (datetime/millis-to-float-duration % {:decimals 0}))))
         scale-filler (map (partial str "xx-") (range (- (:max-bars plot-info) (count builds))))
         x-scale (-> (js/d3.scale.ordinal)
                     (.domain (clj->js
@@ -191,12 +185,15 @@
     (-> bars-join
         (.select ".top")
         (.attr #js {"class" #(str "bar top " (aget % "outcome"))
-                    "y" #(y-pos-scale (aget % "build_time_minutes"))
+                    "y" #(y-pos-scale (aget % "build_time_millis"))
                     "x" #(x-scale (aget % "build_num"))
                     "width" (.rangeBand x-scale)
-                    "height" #(- y-zero (y-pos-scale (aget % "build_time_minutes")))})
+                    "height" #(- y-zero (y-pos-scale (aget % "build_time_millis")))})
         (.select "title")
-        (.text #(gstring/format "%s in %.1fm" (gstring/toTitleCase (aget % "outcome")) (aget % "build_time_minutes"))))
+        (.text #(let [[duration-str] (datetime/millis-to-float-duration (aget % "build_time_millis"))]
+                  (gstring/format "%s in %s"
+                                  (gstring/toTitleCase (aget % "outcome"))
+                                  duration-str))))

     ;; bottom bar enter and update
     (-> bars-join
@@ -206,7 +203,8 @@
                     "width" (.rangeBand x-scale)
                     "height" #(- (y-neg-scale (aget % "queued_time_millis")) y-zero)})
         (.select "title")
-        (.text #(gstring/format "Queue time %.1fm" (aget % "queued_time_millis"))))
+        (.text #(let [[duration-str] (datetime/millis-to-float-duration (aget % "queued_time_millis"))]
+                  (gstring/format "Queue time %s" duration-str))))

     ;; bars exit
     (-> bars-join
@@ -285,7 +283,6 @@
        (filter build-graphable)
        reverse
        (map add-queued-time)
-       (map add-minute-measures)
        (take (:max-bars plot-info))))

 (defn project-insights-bar [builds owner]


Ready to run first dm experiments

Ready to run first dm experiments

--- src/angelic/scripts/experiments_11aaai.clj
+++ src/angelic/scripts/experiments_11aaai.clj
@@ -43,8 +43,8 @@
 (defn make-dm-exp-set []
   (experiments/make-experiment-set "11aaai-dm"
     [:product
-     [:objects [1] #_ [1 2 3 4 5 6]]
-     [:rand    [1] #_ [1 2 3]]
+     [:objects [1 2 3 4 5 6]]
+     [:rand    [1 2 3]]
      [:alg     (keys alg-forms)]]
     (fn [m]
       `(dm/make-discrete-manipulation-hierarchy
@@ -61,7 +61,7 @@

 ;(use '[edu.berkeley.ai.util experiments cluster] 'angelic.scripts.experiments-11aaai)
-;(run-experiment-set-cluster (make-exp-set))
+;(run-experiment-set-cluster (make-dm-exp-set))

 ; (plot (ds->chart (experiment-set-results->dataset res) [:alg] :objects :ms {:key "top left" } {} first))


Fix run-after-load for retrieve of single entity

--- src/appengine_magic/services/datastore.clj
+++ src/appengine_magic/services/datastore.clj
@@ -362,10 +362,11 @@
         (let [key-object (make-key-from-value key-value-or-values parent)
               entity (.get (get-datastore-service) key-object)
               raw-properties (into {} (.getProperties entity))
-              entity-record (run-after-load (record entity-record-type))]
+              entity-record (record entity-record-type)]
           (with-meta
-            (merge entity-record (entity->properties raw-properties
-                                                     (get-clj-properties entity-record)))
+            (run-after-load
+              (merge entity-record (entity->properties raw-properties
+                                                      (get-clj-properties entity-record))))
             {:key (.getKey entity)})))))


only generate a root id for spout tuples participating in acking framework

--- src/clj/backtype/storm/daemon/executor.clj
+++ src/clj/backtype/storm/daemon/executor.clj
@@ -277,8 +277,8 @@
                                out-tasks (if out-task-id
                                            (tasks-fn out-task-id out-stream-id values)
                                            (tasks-fn out-stream-id values))
-                               root-id (MessageId/generateId)
                                rooted? (and message-id (has-ackers? storm-conf))
+                               root-id (if rooted? (MessageId/generateId))
                                out-ids (dofor [t out-tasks] (MessageId/generateId))
                                out-tuples (dofor [id out-ids]
                                             (let [tuple-id (if rooted?


Implemented returning of evaluated actions from backend to frontend.

--- src/clj_formal_specifications_app/core.clj
+++ src/clj_formal_specifications_app/core.clj
@@ -36,11 +36,20 @@
   [s]
   (re-find #"(?<=\(ns\s)[a-zA-Z0-9\.-]+(?=[\s\(\)])" s))

+(defn ns-actions
+  [ns]
+  (map key (filter #(:action (meta (val %))) (ns-publics (symbol ns)))))
+
+(defn ns-specification
+  [ns]
+  {:actions (ns-actions ns)})
+
 (defn compose
   [specification]
+  (let [ns-name (get-ns-name specification)]
   {:body (do
            (load-string specification)
-           (get-ns-name specification))})
+           (ns-specification ns-name))}))

 (defroutes api-routes
   (GET "/api/examples" [] (example-listing))


clean

clean

--- src/cljs/reagent_demo/views/home_page.cljs
+++ src/cljs/reagent_demo/views/home_page.cljs
@@ -42,12 +42,6 @@
   (js/clearTimeout @timeout-atom)
   (reset! timeout-atom (js/setTimeout note-off 300)))

-(defn rand-hex-char []
-  (char (rand-nth (concat (range 48 58) (range 66 72)))))
-
-(defn rand-hex []
-  (str "#" (rand-hex-char) (rand-hex-char) (rand-hex-char)))
-
 (defn hex-char [n]
   (let [chars (concat (range 48 58) (range 66 71))]
     (char (nth chars (quot n 5)))))
@@ -75,6 +69,12 @@
     [:br]
     (button-grid)])

+; (defn rand-hex-char []
+;   (char (rand-nth (concat (range 48 58) (range 66 72)))))
+;
+; (defn rand-hex []
+;   (str "#" (rand-hex-char) (rand-hex-char) (rand-hex-char)))
+
 ;
 ; (defn swap-color! [color]
 ;   (reset! color (rand-hex)))


A few more error message improvements in core.

--- src/clojure/uncomplicate/bayadera/core.clj
+++ src/clojure/uncomplicate/bayadera/core.clj
@@ -199,13 +199,15 @@
 (defn pdf [dist xs]
   (if (compatible? dist (p/data xs))
     (p/pdf (p/engine dist) (p/parameters dist) (p/data xs))
-    (format "Incompatible xs: %s." (type xs))))
+    (dragan-says-ex (format "Data type is incompatible with distribution engine"
+                            {:type (type dist) :factory (info (p/data xs))}))))

 ;;TODO rename to log-pd or log-density
 (defn log-pdf [dist xs]
   (if (compatible? dist (p/data xs))
     (p/log-pdf (p/engine dist) (p/parameters dist) (p/data xs))
-    (format "Incompatible xs: %s." (type xs))))
+    (dragan-says-ex (format "Data type is incompatible with distribution engine"
+                            {:type (type dist) :factory (info (p/data xs))}))))

 (defn likelihood [lik xs]
   (throw (UnsupportedOperationException. "TODO")))
@@ -213,7 +215,8 @@
 (defn evidence ^double [dist xs]
   (if (compatible? dist (p/data xs))
     (p/evidence (p/engine dist) (p/parameters dist) (p/data xs))
-    (format "Incompatible xs: %s." (type xs))))
+    (dragan-says-ex (format "Data type is incompatible with distribution engine"
+                            {:type (type dist) :factory (info (p/data xs))}))))

 ;; ================= Estimation ===============================================

@@ -226,13 +229,13 @@
 (defn sample!
   ([sampler]
    (p/sample! sampler))
-  ([sampler n]
+  ([sampler ^long n]
    (p/sample! sampler n)))

 (defn sample
   ([sampler]
    (p/sample sampler))
-  ([sampler n]
+  ([sampler ^long n]
    (p/sample sampler n)))

 (defn init!
@@ -242,7 +245,7 @@
    (p/init! samp (srand-int))))

 (defn histogram!
-  ([estimator n]
+  ([estimator ^long n]
    (p/histogram! estimator n)))

 (defn histogram


tidying up

tidying up

--- src-cljs/frontend/components/build_timings.cljs
+++ src-cljs/frontend/components/build_timings.cljs
@@ -58,10 +58,10 @@
   (let [root (.select js/d3 dom-root)]
     (-> root
         (.attr "width" (+ (timings-width)
-                         left-axis-width
-                         padding-right))
+                          left-axis-width
+                          padding-right))
         (.attr "height" (+ (timings-height number-of-containers)
-                          top-axis-height)))
+                           top-axis-height)))
     (-> root
         (.select "g")
         (.remove))
@@ -115,7 +115,7 @@
         (.selectAll "text")
         (.transition)
         (.duration 200)
-        (.attr "fill-opacity"   #(this-as element (fade-value element step-data))))))
+        (.attr "fill-opacity" #(this-as element (fade-value element step-data))))))

 (defn highlight-selected-step! [step selected]
   (-> step
@@ -151,10 +151,10 @@
                         (aget step "step")))

 (defn draw-containers! [build x-scale step]
-  (let [step-length         #(- (scaled-time x-scale % "end_time")
-                                (scaled-time x-scale % "start_time"))
-        step-start-pos      #(x-scale (js/Date. (aget % "start_time")))
-        step-duration       #(datetime/as-duration (duration (aget % "start_time") (aget % "end_time")))]
+  (let [step-start-pos #(scaled-time x-scale % "start_time")
+        step-length    #(- (scaled-time x-scale % "end_time")
+                           (step-start-pos %))
+        step-duration  #(datetime/as-duration (duration (aget % "start_time") (aget % "end_time")))]
     (-> step
         (.selectAll "rect")
           (.data #(aget % "actions"))


Update devcards copy

Update devcards copy

--- src-cljs/frontend/components/pieces/button.cljs
+++ src-cljs/frontend/components/pieces/button.cljs
@@ -173,7 +173,7 @@

     ## Widths
-    Button widths vary based on button text length and can have a **Fixed** attribute which if set to **true** will make the button fixed width for cases like modal footers where we want 2 buttons."
+    Button widths vary based on button text length and can have a **Fixed** attribute which if set to **true** will make the button fixed width for cases where we want buttons to be consistent."

     (button-display
      [;; Primary buttons
@@ -334,7 +334,7 @@
                   (icon/settings))]]))

   (defcard bordered-buttons
-    "Buttons with borders are used in the header. This is design debt."
+    "Buttons with borders are used in the header. This is design debt and will be addressed when we revisit the build/run page header."
     (button-display
      [
       [(managed-button {:bordered? true


Select image for drawing using simple click.

Instead of double click.

--- frontend/src/uxbox/main/ui/workspace/images.cljs
+++ frontend/src/uxbox/main/ui/workspace/images.cljs
@@ -92,7 +92,7 @@
 (mx/defc image-item
   {:mixins [mx/static]}
   [{:keys [thumbnail name id width height] :as image}]
-  (letfn [(on-double-click [event]
+  (letfn [(on-click [event]
             (let [shape {:type :image
                          :name name
                          :id (uuid/random)
@@ -102,7 +102,7 @@
               (st/emit! (udw/select-for-drawing shape))
               (udl/close!)))]
     [:div.library-item {:key (str id)
-                        :on-double-click on-double-click}
+                        :on-click on-click}
      [:div.library-item-th
       {:style {:background-image (str "url('" thumbnail "')")}}]
      [:span name]]))


close any opened shards during a failed retrieve

--- elephantdb-server/src/clj/elephantdb/common/domain.clj
+++ elephantdb-server/src/clj/elephantdb/common/domain.clj
@@ -195,12 +195,21 @@
                         (catch Throwable e
                           (log/error (format "Error opening shard %s of version %s for domain %s: %s"
                                              idx version domain e))
-                          (throw e))))]
+                          (throw e))))
+        close! (fn [idx]
+                 (let [shard (open-shard! local-store idx version
+                                          :allow-writes (.allowWrites domain))]
+                   (close-shard! shard)))]
     (assert (has-version? local-store version)
             (str version "  doesn't exist."))
-    (u/with-ret (->> (doall (map open! shards))
-                     (zipmap shards))
-      (log/info "Finished opening domain at " (.getRoot local-store)))))
+    (try
+      (u/with-ret (->> (doall (map open! shards))
+                       (zipmap shards))
+        (log/info "Finished opening domain at " (.getRoot local-store)))
+      (catch Exception e
+        (map close! shards)
+        (log/error (format "Error retrieving shards for version %s: %s" version e))
+        (throw e)))))

 (defn load-version!
   "Takes a domain, a version number (a long!), and a read-write lock,


Finish implementing git-branch/deploy.

Finish implementing git-branch/deploy.

--- src/incise/deploy/workflows/git_branch.clj
+++ src/incise/deploy/workflows/git_branch.clj
@@ -88,15 +88,17 @@

 (defn deploy
   "Deploy to the given branch. Follow options for commit and push behaviour."
-  [{:keys [path branch commit push]
+  [{:keys [path remote branch commit push]
     :or {path "."
+         remote "origin"
          branch "gh-pages"
          commit true
          push true}}]
-  {:pre [(string? branch)]}
+  {:pre [(string? branch) (string? remote)]}
   (with-repo path
     (let [{source-commit-hash :id} (head-info)
-          output-files (once-in-out-dir)]
+          output-files (once-in-out-dir)
+          start-branch (git-branch-current *repo*)]
       (setup-branch branch)
       (->> output-files
           (map move-to-work-dir)
@@ -104,6 +106,8 @@
       (when commit
         (git-commit *repo* (str "Built from " source-commit-hash
                                 " at " tc/now))
-        (when push nil)))))
+        (when push
+          (git-push remote branch)
+          (git-checkout *repo* start-branch))))))

 (register :git-branch deploy)


more explicit instructions on getting to issue from doc

--- src-cljs/frontend/components/canvas.cljs
+++ src-cljs/frontend/components/canvas.cljs
@@ -414,7 +414,7 @@
           (when-let [issue (issue-model/find-by-doc-id @issue-db document-id)]
             (dom/g #js {:className "layer"}
               (svg-element {:layer/type :layer.type/text
-                            :layer/text (str "Feature request -- " (gstring/truncate (:issue/title issue) 40))
+                            :layer/text (gstring/truncate (:issue/title issue) 40)
                             :layer/start-x 100
                             :layer/end-x 100
                             :layer/start-y 100
@@ -423,17 +423,18 @@
                             :key "issue-title"
                             :className "text-layer issue-layer"
                             :onClick #(cast! :issue-layer-clicked {:frontend/issue-id (:frontend/issue-id issue)})})
-              (when (= (:cust/email cust) (:issue/author issue))
-                (svg-element {:layer/type :layer.type/text
-                              :layer/text "Draw anything here to help illustrate your idea."
-                              :layer/start-x 100
-                              :layer/end-x 100
-                              :layer/start-y (+ 100 font-size)
-                              :layer/end-y (+ 100 font-size)
-                              :layer/font-size 16
-                              :key "doc-instructions"
-                              :className "text-layer issue-layer"
-                              :onClick #(cast! :issue-layer-clicked {:frontend/issue-id (:frontend/issue-id issue)})})))))))))
+              (svg-element {:layer/type :layer.type/text
+                            :layer/text (if (= (:cust/email cust) (:issue/author issue))
+                                          "Draw anything here to help illustrate your idea."
+                                          "(click to view issue)")
+                            :layer/start-x 100
+                            :layer/end-x 100
+                            :layer/start-y (+ 100 16)
+                            :layer/end-y (+ 100 16)
+                            :layer/font-size 12
+                            :key "doc-instructions"
+                            :className "text-layer issue-layer"
+                            :onClick #(cast! :issue-layer-clicked {:frontend/issue-id (:frontend/issue-id issue)})}))))))))

 (defn subscriber-cursor-icon [tool]
   (case (name tool)


Avoid write-batch accumulated time overflow.

--- src/onyx/monitoring/metrics_monitoring.clj
+++ src/onyx/monitoring/metrics_monitoring.clj
@@ -213,15 +213,15 @@
 (defn new-write-batch [reg tag lifecycle]
   (let [throughput (m/meter reg (conj tag (clojure.string/join "_" ["task-lifecycle" (name lifecycle) "throughput"])))
         timer ^com.codahale.metrics.Timer (t/timer reg (into tag ["task-lifecycle" (name lifecycle)]))
-        accum (volatile! (long 0))]
+        accum (AtomicLong. 0)]
     (fn [state latency-ns]
-      (vswap! accum (fn [a] (unchecked-add a latency-ns)))
-      (when (task/advanced? state)
-        (let [cnt (count-written-batch state)]
-          (when-not (zero? cnt)
-            (.update timer @accum TimeUnit/NANOSECONDS)
-            (vreset! accum (long 0))
-            (m/mark! throughput cnt)))))))
+      (let [total (.addAndGet accum latency-ns)]
+        (when (task/advanced? state)
+          (let [cnt (count-written-batch state)]
+            (.set accum 0)
+            (when-not (zero? cnt)
+              (.update timer total TimeUnit/NANOSECONDS)
+              (m/mark! throughput cnt))))))))

 (defn update-rv-epoch [^AtomicLong replica-version ^AtomicLong epoch epoch-rate]
   (fn [state latency-ns]


Add ns docstring

Add ns docstring

--- src/overtone/sc/machinery/ugen/sc_ugen.clj
+++ src/overtone/sc/machinery/ugen/sc_ugen.clj
@@ -1,4 +1,7 @@
-(ns overtone.sc.machinery.ugen.sc-ugen
+(ns
+    ^{:doc "Records and fns for representing SCUgens. These are to be distinguised with ugens which are Overtone functions which compile down into SCUGens. Trees of SCUGens can then, in turn, be compiled down into a binary synth format for shipping to SCServer."
+      :author "Sam Aaron"}
+    overtone.sc.machinery.ugen.sc-ugen
   (:use [overtone.sc.machinery.ugen defaults]
         [overtone.util lib]))


Added demo#.

Added demo#.

--- src/overtunes/songs/canone_alla_quarta.clj
+++ src/overtunes/songs/canone_alla_quarta.clj
@@ -8,6 +8,13 @@
 (defn play# [notes]
   (let [play-at# #(at (% 0) (piano# (% 1)))]
     (->> notes (map play-at#) dorun)))
+
+(defn demo# [pitches]
+  (let [start (now)
+        note-length 400
+        end (+ start (* note-length (count pitches)))
+        notes (map vector (range start end note-length) pitches)]
+    (play# notes)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Scale                                        ;;
@@ -20,10 +27,13 @@
      (=> % - (scale (reverse intervals)) -)))

 (def major (scale [2 2 1 2 2 2 1]))
+(def minor (scale [2 1 2 2 1 2 2]))
 (def g-major (comp (partial + 74) major))

-(def minor (scale [2 1 2 2 2 1 2]))
-(def a-minor (comp (partial + 76) minor))
+;(major 2)
+;(minor 2)
+;(demo# (let [key (comp (partial + 67) major), rest -100]
+;         (map key [0 1 2 0 0 1 2 0 2 3 4 rest 2 3 4 rest])))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Timing                                       ;;


demo# is neater with a loop.

demo# is neater with a loop.

--- src/overtunes/songs/canone_alla_quarta.clj
+++ src/overtunes/songs/canone_alla_quarta.clj
@@ -14,14 +14,14 @@
     (->> notes (map play-at#) dorun)))

 (defn demo# [pitches]
-  (let [start (now)
-        note-length 300
-        end (+ start (* note-length (count pitches)))
-        notes (map vector (range start end note-length) pitches)]
-    (play# notes)))
+  (loop [play-at (now), still-to-play pitches]
+    (if still-to-play (do
+      (at play-at (piano# (first still-to-play)))
+      (recur (+ 300 play-at) (next still-to-play))))))

 ;(piano# 50)
 ;(demo# (range 60 73))
+

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(maint) generate an id for associate_response

Messages of schema http://puppetlabs.com/associate_response were not supplying
a real uuid into the envelope's id field.

--- src/puppetlabs/cthun/connection_states.clj
+++ src/puppetlabs/cthun/connection_states.clj
@@ -212,7 +212,8 @@
                         (association-response ws request))]
     (s/validate AssociateResponse response)
     (let [message (-> (message/make-message)
-                      (assoc :message_type "http://puppetlabs.com/associate_response"
+                      (assoc :id (ks/uuid)
+                             :message_type "http://puppetlabs.com/associate_response"
                              :targets [ (:sender request) ]
                              :sender "cth:///server")
                       (message/set-expiry 3 :seconds)


(EZ-57) Changed not-found jar from warning to leiningen abort

This commit changes the behavior when a project jar is not found when
looking for the ezbake.conf file from having a warning logged to
a leiningen abort.

--- src/puppetlabs/ezbake/dependency_utils.clj
+++ src/puppetlabs/ezbake/dependency_utils.clj
@@ -130,7 +130,8 @@
         (if-let [project-jar-entry (find-file-in-jar project-jar
                                                      file-path)]
           (.getInputStream project-jar project-jar-entry)))
-      (log/warnf "Unable to find project jar file: '%s'" project-jar-file))))
+      (lein-main/abort
+       (format "Unable to find project jar file: '%s'" project-jar-file)))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Public


fix string funcs

fix string funcs

--- src/cljs/infinitelives/utils/string.cljs
+++ src/cljs/infinitelives/utils/string.cljs
@@ -2,9 +2,8 @@

 (defn ends-with? [str end]
   (let [len (.-length str)
-        end-len (.-length end)
-        pos (.indexOf str end)]
-    (= (+ pos end-len) len)))
+        end-len (.-length end)]
+    (not= -1 (.indexOf str end (- len end-len)))))

 (defn starts-with? [str start]
-  (= 0 (indexOf str start)))
+  (= 0 (.indexOf str start)))


Adapt websocket handler adapter to internal api changes.

--- src/clojure/catacumba/impl/websocket.clj
+++ src/clojure/catacumba/impl/websocket.clj
@@ -29,7 +29,7 @@
             [catacumba.utils :as utils]
             [catacumba.impl.context :as ctx]
             [catacumba.impl.helpers :as ch]
-            [catacumba.impl.handlers :as handlers])
+            [catacumba.impl.handlers :as hs])
   (:import ratpack.handling.Handler
            ratpack.handling.Context
            ratpack.func.Action
@@ -87,9 +87,9 @@
     (->> (WebSocketSession. in out ctrl context handler)
          (WebSockets/websocket ^Context (:catacumba/context context)))))

-(defmethod handlers/adapter :catacumba/websocket
+(defmethod hs/adapter :catacumba/websocket
   [handler]
   (reify Handler
     (^void handle [_ ^Context ctx]
-      (let [context (ctx/context ctx)]
-        (websocket context handler)))))
+      (hs/hydrate-context ctx (fn [^DefaultContext context]
+                             (websocket context handler))))))


CMR-203: Added more terms to keyword filters.

--- src/cmr/search/data/query_to_elastic.clj
+++ src/cmr/search/data/query_to_elastic.clj
@@ -1,7 +1,7 @@
 (ns cmr.search.data.query-to-elastic
   "Defines protocols and functions to map from a query model to elastic search query"
   (:require [clojurewerkz.elastisch.query :as q]
-            [clojure.string :as s]
+            [clojure.string :as str]
             [cmr.search.models.query :as qm]
             [cmr.search.data.datetime-helper :as h]
             [cmr.common.services.errors :as errors]
@@ -44,16 +44,64 @@
   (let [regex (str ".*" keyword ".*")]
     {:regexp {field regex}}))

-; (defn keywords->name-filter
-;   "Create a filter for keyword searches that checks long-name and short-name"
-;   (let [long-name-cond
-;         condition (qm/or-conds
+(defn keyword-term-filter
+  "Create a term filter for a given field/value"
+  [field keyword]
+  {:term {field keyword}})
+
+(defn keyword-exact-match-filter
+  "Create a filter that checks for an exact match"
+  [field keyword]
+  {:term {:field field
+          :value keyword}})
+
+(defn keywords->name-filter
+  "Create a filter for keyword searches that checks for a loose match on one field or and
+  exact match on another"
+  [regex-field exact-field keywords boost]
+  {:boost_factor boost
+   :filter {:or [{:and (map (partial keyword-regexp-filter regex-field) keywords)}
+                 {:or (map (partial keyword-exact-match-filter exact-field) keywords)}]}})
+
+(defn science-keywords-or-filter
+  "Create an or filter containig the science keyword fields related to keyword searches"
+  [keywd]
+  (map (fn [field] {:term {(keyword (str (name field) ".lowercase")) keywd}})
+       [:category :topic :term :variable-level-1 :variable-level-1 :variable-level3]))
+
+(defn keywords->sk-filter
+  "Create a filter for keyword searches that checks science keywords"
+  [keywords boost]
+  {:boost_factor boost
+   :filter {:nested {:path :science-keywords
+                     :filter {:or (science-keywords-or-filter (str/join " " keywords))}}}})
+
+(defn keywords->boosted-term-filter
+  "Crete a boosted term filter for keyword searches"
+  [field keywords boost]
+  (let [keyword (str/join " " keywords)]
+    {:boost_factor boost
+     :filter (keyword-term-filter field keyword)}))

 (defn keywords->elastic-filters
   "Create filters for keyword search"
   [keywords]
-  (into [] (when keywords
-             ())))
+  [;; entry-title, short-name
+   (keywords->name-filter :entry-title.lowercase :short-name.lowercase keywords 1.4)
+   ;; project (ECHO campaign)
+   (keywords->name-filter :project-ln.lowercase :project-sn.lowercase keywords 1.3)
+   ;; platform
+   (keywords->name-filter :platform-ln.lowercase :platform-sn.lowercase keywords 1.3)
+   ;; TODO - instrument
+   ;; need to add long name
+   ;; TODO - sensor
+   ;; need to add long name
+   ;; science keywords
+   (keywords->sk-filter keywords 1.2)
+   ;; spatial-keyword
+   (keywords->boosted-term-filter :spatial-keywords.lowercase keywords 1.1)
+   ;; TODO - temporal-keyword
+   ])

 (defn query->elastic
   "Converts a query model into an elastic search query"
@@ -61,7 +109,7 @@
   (let [{:keys [concept-type condition keywords]} query
         core-query (condition->elastic condition concept-type)]
     (if-let [keywords (:keywords query)]
-      {:function_score {:functions []
+      {:function_score {:functions (keywords->elastic-filters keywords)
                         :query {:filtered {:query (q/match-all)
                                            :filter core-query}}}}
       {:filtered {:query (q/match-all)
@@ -151,7 +199,7 @@
     [{:keys [field value case-sensitive? pattern?]} concept-type]
     (let [field (query-field->elastic-field field concept-type)
           field (if case-sensitive? field (str (name field) ".lowercase"))
-          value (if case-sensitive? value (s/lower-case value))]
+          value (if case-sensitive? value (str/lower-case value))]
       (if pattern?
         {:query {:wildcard {field value}}}
         {:term {field value}})))
@@ -161,7 +209,7 @@
     [{:keys [field values case-sensitive?]} concept-type]
     (let [field (query-field->elastic-field field concept-type)
           field (if case-sensitive? field (str (name field) ".lowercase"))
-          values (if case-sensitive? values (map s/lower-case values))]
+          values (if case-sensitive? values (map str/lower-case values))]
       {:terms {field values
                :execution "bool"}}))


- additional code restructuring

- additional code restructuring

--- src/app/cljs/one/sample/animation.cljs
+++ src/app/cljs/one/sample/animation.cljs
@@ -662,9 +662,8 @@
     actor))

 (defn animated-actor
-  [scene & {:keys [image animation-indices default-index key-frames frame-time draggable? thumbnail]
-               :or {image nil animation-indices [0] default-index 0 key-frames nil frame-time 150 draggable? false thumbnail nil}}]
-  (assert (scene? scene) "First arg must be a scene instance.")
+  [& {:keys [image animation-indices default-index key-frames frame-time draggable? thumbnail]
+      :or {image nil animation-indices [0] default-index 0 key-frames nil frame-time 150 draggable? false thumbnail nil}}]
   (log/info logger (str "Creating actor"))
   (let [image (->image image :thumbnail thumbnail)
         img (doto (CAAT/SpriteImage.)
@@ -944,21 +943,26 @@
               bookshelf (bookshelf scene)
               counter (count-actor 6 :on-total-reached (fn [e] (add! scene (winning-screen scene))))
               basket-objects (map
-                              #(make-draggable-into % basket scene
-                                                    (fn [] (throw-into-basket director scene basket % counter))
-                                                    :valid-fn (fn [] (and (not (.isOpened basket)) (not (.eating basket)))))
-                              [(animated-actor scene :image "football" :animation-indices [0] :draggable? true :thumbnail [60 60])
-                               (animated-actor scene :image "car" :animation-indices [0] :draggable? true :thumbnail [60 60])
-                               (animated-actor scene :image "blocks" :animation-indices [0] :draggable? true)
-                               (animated-actor scene :image "teddy" :animation-indices [0 1 0 2] :draggable? true)])
+                              #(let [actor (apply animated-actor (apply concat %))]
+                                 (make-draggable-into
+                                  actor
+                                  basket scene
+                                  (fn [] (throw-into-basket director scene basket actor counter))
+                                  :valid-fn (fn [] (and (not (.isOpened basket)) (not (.eating basket))))))
+                              [{:image "football" :animation-indices [0] :draggable? true :thumbnail [60 60]}
+                               {:image "car" :animation-indices [0] :draggable? true :thumbnail [60 60]}
+                               {:image "blocks" :animation-indices [0] :draggable? true}
+                               {:image "teddy" :animation-indices [0 1 0 2] :draggable? true}])
               bookshelf-objects (map
-                                 #(make-draggable-into % bookshelf scene
-                                                       (fn []
-                                                         (.setExpired % true)
-                                                         (. bookshelf (inc-book-count))
-                                                         (. counter (inc))))
-                                 [(animated-actor scene :image "book" :animation-indices [2] :default-index 2 :key-frames 3 :draggable? true)
-                                  (animated-actor scene :image "book" :animation-indices [0] :default-index 0 :key-frames 3 :draggable? true)])
+                                 #(let [actor (apply animated-actor (apply concat %))]
+                                    (make-draggable-into
+                                     actor bookshelf scene
+                                     (fn []
+                                       (.setExpired actor true)
+                                       (. bookshelf (inc-book-count))
+                                       (. counter (inc)))))
+                                 [{:image "book" :animation-indices [2] :default-index 2 :key-frames 3 :draggable? true}
+                                  {:image "book" :animation-indices [0] :default-index 0 :key-frames 3 :draggable? true}])
               objects (concat basket-objects bookshelf-objects)]
           (log/info logger " Displaying scene")
           (add! scene background)


Version 0.4.21

Version 0.4.21


(maint) Bump version to 5.2.12

(maint) Bump version to 5.2.12


Upgrade ClojureScript and figwheel, remove tether


Bumped up ClojureScript (-> 0.0.2740) and transit-cljs


Include new version of grafter-url.  With cannonicalise function.


Update ring/ring-json to 0.4.0

Update ring/ring-json to 0.4.0


final update to dependencies, for cake. For some reason, cake only expanded the dependencies for x86, not for x86_64 or i386. But it needed those to rungit status


Point to test-server instead of development server in new functional test to ensure tests can run without having the dev-server running (e.g. in CI)

--- test/clj/conference_rating/functional_test.clj
+++ test/clj/conference_rating/functional_test.clj
@@ -107,7 +107,7 @@
   (wait-for "page-conference-detail"))

 (defn go-create-new-random-past-conference []
-  (taxi/to "http://localhost:3000/#/add-conference")
+  (taxi/to "http://localhost:4000/#/add-conference")
   (wait-for "page-add-conference")
   (fill-input {"input-conference-series"      (str "some past unique series" (UUID/randomUUID))
                "input-conference-name"        (str "some past unique conference name" (UUID/randomUUID))


print macro

print macro

--- src/clj/algorithms_clj/print_macro.clj
+++ src/clj/algorithms_clj/print_macro.clj
@@ -5,6 +5,10 @@
   (println "Compiling:" code)
   code)

+(defn add-two
+  [a b]
+  (print-macro (+ a b)))
+
 (defn test-print-macro
   []
-  (print-macro (+ 1 2)))
+  (add-two 1 2))


missing pos binding

missing pos binding

--- src/cljs/infinitelives/utils/boid.cljs
+++ src/cljs/infinitelives/utils/boid.cljs
@@ -13,7 +13,7 @@
    :max-force 1.0
    :max-speed 4.0})

-(defn apply-steering [{:keys [mass vel max-speed] :as boid} steering]
+(defn apply-steering [{:keys [mass vel pos max-speed] :as boid} steering]
   (let [accel (vec2/scale steering (/ 1 mass))
         new-vel (-> accel
                     (vec2/add vel)


docstring

docstring

--- src/cljs/infinitelives/utils/vec2.cljs
+++ src/cljs/infinitelives/utils/vec2.cljs
@@ -117,8 +117,9 @@
   (Vec2/direction v0 v1 (make)))

 (defn rotate
-  "return a vector identical to v but rotated
-  ang radians"
+  "return a vector identical to v but rotated ang radians. On a maths
+  axis (+ve y points up) +ve ang rotation is anticlockwise. On a
+  screen axis (+ve y points down) +ve ang rotation is clockwise."
  [v ang]
   (let [cos (Math/cos ang)
         sin (Math/sin ang)]


Replace mapv-s with discarded values with doseqs

--- src/cljs/react_cljs_blogpost/core.cljs
+++ src/cljs/react_cljs_blogpost/core.cljs
@@ -26,13 +26,14 @@

 ; side effecting functions used for hiding/marking revealed cards
 (defn hide-nonmatch! []
-  (mapv #(swap! % assoc :visible false) (:cards @state))
+  (doseq [card-state (:cards @state)]
+    (swap! card-state assoc :visible false))
   (swap! state assoc :last-symbol ""))

 (defn mark-match! [symbol]
-  (mapv
-    #(swap! % assoc :matched true)
-    (filterv #(= (:symbol @%) symbol) (:cards @state))))
+  (doseq [matched-card (filterv #(= (:symbol @%) symbol)
+                                (:cards @state))]
+    (swap! matched-card assoc :matched true)))

 (defn reveal-card! [card-state] (swap! card-state assoc :visible true))


cosmetic

cosmetic

--- src/cljs/triboard/logic/constants.cljs
+++ src/cljs/triboard/logic/constants.cljs
@@ -8,7 +8,4 @@
 (def max-score (- (* board-width board-height) init-block-count))

 (def all-positions
-  (vec
-    (for [x (range board-width)
-          y (range board-height)]
-      [x y])))
+  (vec (for [x (range board-width) y (range board-height)] [x y])))


bring back :parser since need it for component creation with arguments

--- src/clojure/zensols/nlparse/config.clj
+++ src/clojure/zensols/nlparse/config.clj
@@ -66,23 +66,20 @@
    (tokenize "en"))
   ([lang-code]
    {:component :tokenize
-    :lang lang-code}))
+    :lang lang-code
+    :parser :stanford}))

 (defn sentence
   "Create annotator to group tokens into sentences per configured language."
   []
-  {:component :sents})
+  {:component :sents
+   :parser :stanford})

 (defn stopword
   "Create annotator to annotate stop words (boolean)."
   []
-  {:component :stopword})
-
-(defn morphology
-  "Create a morphology annotator, which adds the lemmatization of a word.  This
-  adds the `:lemma` keyword to each token.."
-  []
-  {:component :morph})
+  {:component :stopword
+   :parser :stanford})

 (defn part-of-speech
   "Create annotator to do part of speech tagging.  You can set the model with a
@@ -93,7 +90,8 @@
    (part-of-speech "english-left3words-distsim.tagger"))
   ([pos-model-resource]
    {:component :pos
-    :pos-model-resource pos-model-resource}))
+    :pos-model-resource pos-model-resource
+    :parser :stanford}))

 (defn named-entity-recognizer
   "Create annotator to do named entity recognition.  All models in the
@@ -105,7 +103,8 @@
     ["edu/stanford/nlp/models/ner/english.conll.4class.distsim.crf.ser.gz"]))
   ([paths]
    {:component :ner
-    :ner-model-paths paths}))
+    :ner-model-paths paths
+    :parser :stanford}))

 (defn token-regex
   "Create annotator to token regular expression.  You can configure an array of
@@ -116,22 +115,26 @@
    (token-regex ["token-regex.txt"]))
   ([paths]
    {:component :tok-re
-    :tok-re-resources paths}))
+    :tok-re-resources paths
+    :parser :stanford}))

 (defn parse-tree
   "Create annotator to create head and parse trees."
   []
-  {:component :parse-tree})
+  {:component :parse-tree
+   :parser :stanford})

 (defn dependency-parse-tree
   "Create an annotator to create a dependency parse tree."
   []
-  {:component :dependency-parse-tree})
+  {:component :dependency-parse-tree
+   :parser :stanford})

 (defn coreference
   "Create annotator to coreference tree structure."
   []
-  {:component :coref})
+  {:component :coref
+   :parser :stanford})

 (defn semantic-role-labeler
   "Create a semantic role labeler annotator.  You can configure the language
@@ -150,7 +153,8 @@
    {:component :srl
     :lang lang-code
     :model-type (format "general-%s" lang-code)
-    :first-label-token-threshold 3}))
+    :first-label-token-threshold 3
+    :parser :srl}))

 (defn register-library
   "Register plugin library **lib-name** with **lib-cfg** a map containing:
@@ -181,7 +185,8 @@
          (map (fn [parser]
                 (->> (get conf parser)
                      :component-fns
-                     (map #(assoc (%) :parser parser)))))
+                     ;(map #(assoc (%) :parser parser))
+                     (map #(%)))))
          (apply concat))))

 (defn create-parse-config
@@ -205,6 +210,24 @@
                    only-tokenize? [(tokenize) (sentence)]
                    :else (components-by-parsers parsers))})

+(create-parse-config :pipeline [(tokenize) (sentence)])
+
+(defn- registered-components
+  "Return all registered component functions.  This is the `:component-fns` key
+  in the registeration map provided by each parser."
+  []
+  (zipmap (->> @library-config-inst
+               vals
+               (map :component-fns)
+               (apply concat)
+               (map #(->> % pr-str (re-find #"\[[^/]+\/(.*)\]") second)))
+          (->> @library-config-inst
+               (map (fn [[k v]]
+                      (map #(%)
+                                        ;#(assoc (%) :parser k)
+                           (->> v :component-fns))))
+               (apply concat))))
+
 (defn create-parse-config-by-string
   "See [[create-context]]."
   [components]
@@ -248,21 +271,6 @@
             (into {})
             (merge {:parse-config parse-config}))))))

-(defn- registered-components
-  "Return all registered component functions.  This is the `:component-fns` key
-  in the registeration map provided by each parser."
-  []
-  (zipmap (->> @library-config-inst
-               vals
-               (map :component-fns)
-               (apply concat)
-               (map #(->> % pr-str (re-find #"\[[^/]+\/(.*)\]") second)))
-          (->> @library-config-inst
-               (map (fn [[k v]]
-                      (map #(assoc (%) :parser k)
-                           (->> v :component-fns))))
-               (apply concat))))
-
 (defn components-as-string
   "Return all available components as a string"
   []


Slight description tweak

Slight description tweak

--- src/clojush/problems/psb2/snow_day.clj
+++ src/clojush/problems/psb2/snow_day.clj
@@ -1,7 +1,7 @@
 ;; snow_day.clj
 ;; Peter Kelly, pxkelly@hamilton.edu
 ;;
-;; Problem inspired by our introductory level program languages course
+;; Problem inspired by our introductory level programming course

 (ns clojush.problems.software.benchmarks-v2.snow-day
   (:use clojush.pushgp.pushgp


add select producer buffer

add select producer buffer

--- kafka-clj/src/kafka_clj/client.clj
+++ kafka-clj/src/kafka_clj/client.clj
@@ -327,7 +327,7 @@
       (let [partition (select-rr-partition! topic state)
             msg (message topic partition bts)]
         (try
-          (send-to-buffer (exception-if-blacklisted  @(:blacklisted-producers-ref state)) msg)
+          (send-to-buffer (select-producer-buffer! connector topic partition state) msg)
           (catch Exception e
             (do
                 (warn "error while sending message")


No padding on left of x axis

No padding on left of x axis

--- src-cljs/frontend/components/insights/project.cljs
+++ src-cljs/frontend/components/insights/project.cljs
@@ -65,7 +65,8 @@
                                                    (concat ["Median Build Time"] (map last build-times))]}
                                   :legend {:hide true}
                                   :grid {:y {:show true}}
-                                  :axis {:x {:type "timeseries"
+                                  :axis {:x {:padding {:left "0"}
+                                             :type "timeseries"
                                              :tick {:format "%m/%d"}
                                                     :fit "true"}
                                          :y {:min 0


Replace Project Settings buttons

Replace Project Settings buttons

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -124,11 +124,11 @@
                "You can stop these any time from your "
                [:a {:href "/account"} "account settings"]
                "."]
-              (forms/managed-button
-                [:button.btn.btn-warning {:on-click #(raise! owner [:unfollowed-project {:vcs-url vcs-url
-                                                                                :project-id project-id}])
-                                          :data-loading-text "Unfollowing..."}
-                 "Unfollow"])
+              (button/managed-button
+               {:on-click #(raise! owner [:unfollowed-project {:vcs-url vcs-url :project-id project-id}])
+                :loading-text "Unfollowing..."
+                :primary? true}
+               "Unfollow")
                " "
                (forms/managed-button
                  [:button.btn.btn-danger {:on-click #(raise! owner [:stopped-building-project {:vcs-url vcs-url
@@ -141,11 +141,11 @@
               [:p
                "We can't update you with personalized build emails unless you follow this project. "
                "Projects are only tested if they have a follower."]
-              (forms/managed-button
-               [:button {:on-click #(raise! owner [:followed-project {:vcs-url vcs-url
-                                                                      :project-id project-id}])
-                         :data-loading-text "Following..."}
-                "Follow"])))]])))))
+              (button/managed-button
+               {:on-click #(raise! owner [:followed-project {:vcs-url vcs-url
+                                                             :project-id project-id}])
+                :loading-text "Following..."}
+               "Follow")))]])))))

 (defn overview [project-data owner]
   (reify
@@ -407,20 +407,20 @@

 (defn clear-cache-button
   [cache-type project-data owner]
-  (forms/managed-button
-    [:button.btn.btn-primary
-     {:data-loading-text "Clearing cache..."
-      :data-success-text "Cleared"
-      :data-failure-text "Clearing failed"
-      :on-click #(raise! owner
-                         [:clear-cache
-                          {:type cache-type
-                           :project-id (-> project-data
-                                           :project
-                                           project-model/id)}])}
-     (case cache-type
-       "build" "Clear Dependency Cache"
-       "source" "Clear Source Cache")]))
+  (button/managed-button
+    {:loading-text "Clearing cache..."
+     :success-text "Cleared"
+     :failure-text "Clearing failed"
+     :on-click #(raise! owner
+                        [:clear-cache
+                         {:type cache-type
+                          :project-id (-> project-data
+                                          :project
+                                          project-model/id)}])
+     :primary? true}
+    (case cache-type
+      "build" "Clear Dependencies"
+      "source" "Clear Sources")))

 (defn clear-caches
   [project-data owner]
@@ -674,11 +674,11 @@
                                              :value (str (:post_dependencies settings))
                                              :on-change #(utils/edit-input owner (conj state/inputs-path :post_dependencies) %)}]
                [:p "Run extra commands after the normal setup, these run after our inferred commands for dependency installation. Use this to run commands that rely on the installed dependencies."]]
-              (forms/managed-button
-               [:input.btn.btn-primary {:value "Next, set up your tests",
-                                        :type "submit"
-                                        :data-loading-text "Saving..."
-                                        :on-click #(raise! owner [:saved-dependencies-commands {:project-id project-id}])}])]]]]])))))
+              (button/managed-button
+               {:loading-text "Saving..."
+                :on-click #(raise! owner [:saved-dependencies-commands {:project-id project-id}])
+                :primary? true}
+               "Next, set up your tests")]]]]])))))

 (defn tests [project-data owner]
   (reify
@@ -715,13 +715,12 @@
                                             :value (str (:extra settings))
                                             :on-change #(utils/edit-input owner (conj state/inputs-path :extra) %)}]
               [:p "Run extra test commands after the others finish. Extra test commands run after our inferred commands. Add extra tests that we haven't thought of yet."]]
-
-             (forms/managed-button
-              [:input.btn.btn-primary {:name "save",
-                                       :data-loading-text "Saving...",
-                                       :value "Save commands",
-                                       :type "submit"
-                                       :on-click #(raise! owner [:saved-test-commands {:project-id project-id}])}])
+             (button/managed-button
+              {:loading-text "Saving..."
+               :success-text "Saved"
+               :on-click #(raise! owner [:saved-test-commands {:project-id project-id}])
+               :primary? true}
+              "Save commands")
              [:div.try-out-build
               (om/build branch-picker
                         project-data
@@ -1022,17 +1021,16 @@
                                                          :value private-key
                                                          :on-change #(utils/edit-input owner (conj state/project-data-path :new-ssh-key :private-key) %)}))
                     :actions [(button/button {:on-click close-fn} "Cancel")
-                              (forms/managed-button
-                               [:input.btn.btn-primary
-                                {:data-failed-text "Failed"
-                                 :data-success-text "Saved"
-                                 :data-loading-text "Saving..."
-                                 :value "Add SSH Key"
-                                 :type "submit"
-                                 :on-click #(raise! owner [:saved-ssh-key {:project-id project-id
-                                                                           :ssh-key {:hostname hostname
-                                                                                :private_key private-key}
-                                                                           :on-success close-fn}])}])]
+                              (button/managed-button
+                               {:failed-text "Failed"
+                                :success-text "Saved"
+                                :loading-text "Saving..."
+                                :on-click #(raise! owner [:saved-ssh-key {:project-id project-id
+                                                                          :ssh-key {:hostname hostname
+                                                                                :private_key private-key}
+                                                                          :on-success close-fn}])
+                                :primary? true}
+                               "Add SSH Key")]
                     :close-fn close-fn})))
               (when-let [ssh-keys (seq (:ssh_keys project))]
                 (let [remove-key-button
@@ -1101,11 +1099,9 @@
            (if-not (user-model/public-key-scope? user)
              (list
               [:p "In order to do so, you'll need to grant authorization from GitHub to the \"admin:public_key\" scope. This will allow us to add a new authorized public key to your GitHub account."]
-              [:a.btn.ghu-authorize
-               {:href (gh-utils/auth-url :scope ["admin:public_key" "user:email" "repo"])
-                :title "Grant admin:public_key authorization so that we can add a new SSH key to your GitHub account"}
-               "Authorize w/ GitHub " [:i.fa.fa-github]])
-
+              (button/link {:href (gh-utils/auth-url :scope ["admin:public_key" "user:email" "repo"])
+                            :primary? true}
+                           "Authorize with GitHub"))
              [:div.request-user
               (forms/managed-button
                [:input.btn
@@ -1231,17 +1227,14 @@
                   [:p
                    "Deploy keys are the best option for most projects: they only have access to a single " vcs-name " repository."]
                   [:div.request-user
-                   (forms/managed-button
-                    [:input.btn
-                     {:type "submit"
-                      :on-click #(raise! owner
-                                         [:new-checkout-key-clicked {:project-id project-id
-                                                                     :project-name project-name
-                                                                     :key-type "deploy-key"}])
-                      :title "Create a new deploy key, with access only to this project."
-                      :value (str "Create and add " project-name " deploy key")
-                      :data-loading-text "Saving..."
-                      :data-success-text "Saved"}])]])
+                   (button/managed-button
+                    {:on-click #(raise! owner
+                                        [:new-checkout-key-clicked {:project-id project-id
+                                                                    :project-name project-name
+                                                                    :key-type "deploy-key"}])
+                     :loading-text "Saving..."
+                     :success-text "Saved"}
+                    "Add deploy key")]])
                (when-not (some #{"github-user-key" "bitbucket-user-key"} (map :type checkout-keys))
                  (om/build add-user-key-section data))
                (when-let [bb-user-key (first (filter (fn [key] (and
@@ -1345,16 +1338,16 @@
                                                                                :label "Token Label"}))])
                                        :close-fn close-fn
                                        :actions [(button/button {:on-click close-fn} "Cancel")
-                                                 (forms/managed-button
-                                                  [:input.btn.btn-primary {:data-failed-text "Failed" ,
-                                                                           :data-success-text "Added" ,
-                                                                           :data-loading-text "Adding..." ,
-                                                                           :value "Create Token" ,
-                                                                           :type "submit"
-                                                                           :on-click #(raise! owner [:saved-project-api-token {:project-id project-id
-                                                                                :api-token {:scope scope
-                                                                                :label label}
-                                                                                :on-success close-fn}])}])]})))
+                                                 (button/managed-button
+                                                  {:failed-text  "Failed"
+                                                   :success-text "Added"
+                                                   :loading-text "Adding..."
+                                                   :on-click #(raise! owner [:saved-project-api-token {:project-id project-id
+                                                                                :api-token {:scope scope
+                                                                                :label label}
+                                                                                :on-success close-fn}])
+                                                   :primary? true}
+                                                  "Add Token")]})))
               (when-let [tokens (seq (:tokens project-data))]
                 (om/build table/table
                           {:rows tokens
@@ -1421,14 +1414,13 @@
                   :value "Remove Heroku Deploy User",
                   :type "submit"}])

-               (forms/managed-button
-                [:input.btn.btn-primary.set-user
-                 {:data-success-text "Saved",
-                  :data-loading-text "Saving...",
-                  :on-click #(raise! owner [:set-heroku-deploy-user {:project-id project-id
-                                                                     :login login}])
-                  :value (str "Set user to " (:login user)),
-                  :type "submit"}]))]]
+               (button/managed-button
+                {:success-text "Saved"
+                 :loading-text "Saving..."
+                 :on-click #(raise! owner [:set-heroku-deploy-user {:project-id project-id
+                                                                    :login login}])
+                 :primary? true}
+                (str "Set user to " (:login user))))]]
            [:div.heroku-step
             [:h4
              "Step 3: Add deployment settings to your "
@@ -1753,8 +1745,7 @@
           [:span " has no "]
           [:span.highlight "Apple Code Signing Identities"]
           [:span "  yet"]]
-         [:a.btn.upload-key-button {:on-click add-key}
-          "Upload Key"]
+         (button/button {:on-click add-key :primary? true} "Upload Key")
          [:div.sub-info "Apple Code Signing requires a valid Code Signing Identity (p12) file"]]))))

@@ -1820,8 +1811,10 @@
           [:article
            [:div.header
             [:div.title "Apple Code Signing Keys"]
-            [:a.btn.upload-key-button {:on-click #(om/set-state! owner :show-modal? true)}
-             "Upload Key"]]
+            (button/button
+             {:on-click #(om/set-state! owner :show-modal? true)
+              :primary? true}
+             "Upload Key")]
            [:hr.divider]
            [:div.info "The following code-signing identities will be added to the system keychain when your build
                         begins, and will be available to sign iOS and OS X apps. For more information about code-signing


updating name of local var

updating name of local var

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -514,9 +514,9 @@
                                                                                :on-success close-fn}])}
                                                                         "Add Variable")]
                                        :close-fn close-fn})))
-              (when-let [envvars-seq (seq (:envvars project-data))]
+              (when-let [env-vars-entries (seq (:envvars project-data))]
                 (om/build table/table
-                          {:rows envvars-seq
+                          {:rows env-vars-entries
                            :key-fn key
                            :columns [{:header "Name"
                                       :cell-fn key}


Fixed handling of field projections

Fixed handling of field projections

--- pigpen-cascading/src/main/clojure/pigpen/cascading.clj
+++ pigpen-cascading/src/main/clojure/pigpen/cascading.clj
@@ -88,7 +88,7 @@
   {:pre [expr args]}
   (let [{:keys [init func]} expr
         fields (if field-projections
-                 (Fields. (into-array (map #(cascading-field %) field-projections)))
+                 (Fields. (into-array (map #(cascading-field (:alias %)) field-projections)))
                  Fields/UNKNOWN)
         get-group-info #(cond (instance? CoGroup %) {:num-streams (alength (.getPrevious %))
                                                      :type        (if (.startsWith (.getName %) "join") :join :group)}
@@ -127,7 +127,7 @@
 (defmethod command->flowdef :projection-flat
   [{:keys [code alias pipe field-projections]} flowdef]
   {:pre [code alias]}
-  (command->flowdef (assoc code :pipe pipe :field-projections (or field-projections [alias])) flowdef))
+  (command->flowdef (assoc code :pipe pipe :field-projections (or field-projections [{:alias alias}])) flowdef))

 (defmethod command->flowdef :generate
   [{:keys [id ancestors projections field-projections opts]} flowdef]


Add tests for singular->plural

Add tests for singular->plural

--- src/devcards/discuss/devcards/lib.cljs
+++ src/devcards/discuss/devcards/lib.cljs
@@ -43,4 +43,13 @@
            (is (not= (lib/get-unique-key) (lib/get-unique-key))))

          (testing "Add :react-key to given dictionary with a unique key."
-           (is (not (nil? (:react-key (lib/merge-react-key {:foo "bar"})))))))+           (is (not (nil? (:react-key (lib/merge-react-key {:foo "bar"})))))))
+
+(deftest string-conversions
+         (testing "Pluralize words if input is greater one."
+           (is (= "entries" (lib/singular->plural 2 "entry")))
+           (is (= "entry" (lib/singular->plural 1 "entry")))
+           (is (= "entry" (lib/singular->plural -1 "entry")))
+           (is (= "may-the-force-be-with-you" (lib/singular->plural 1 "may-the-force-be-with-you")))
+           (is (= "may-the-force-be-with-yous" (lib/singular->plural 101000 "may-the-force-be-with-you"))) ;; Strange :D
+           (is (= nil (lib/singular->plural -1 -1)))))


revert startup message for nREPL since cider looks for it

fixes #320

--- src/main/shadow/cljs/devtools/server.clj
+++ src/main/shadow/cljs/devtools/server.clj
@@ -368,7 +368,8 @@
        (println (str "shadow-cljs - server version: " version))
        (println (str "shadow-cljs - server running at http" (when ssl-context "s") "://" http-host ":" (:port http)))
        (println (str "shadow-cljs - socket REPL running on port " (:port socket-repl)))
-       (println (str "shadow-cljs - nREPL server running on port " (:port nrepl)))
+       ;; must keep this message since cider looks for it
+       (println (str "shadow-cljs - nREPL server started on port " (:port nrepl)))

        ::started
        ))))


clarify dox

clarify dox

--- src/metabase/middleware/current_user.clj
+++ src/metabase/middleware/current_user.clj
@@ -6,10 +6,10 @@
             [metabase.models.user :refer [User]]))

 (defn wrap-current-user
-  "Middleware that binds `metabase.api.context`
+  "Middleware that binds `metabase.api.common/*current-user*` and `*current-user-id*`

-   :current-user-id int ID or nil of user associated with request
-   :current-user    memoized fn that fetches current user (or nil) from DB"
+   *current-user-id* int ID or nil of user associated with request
+   *current-user*    memoized fn that returns current user (or nil) from DB"
   [handler]
   (fn [request]
     (let [current-user-id 1] ; TODO - Placeholder value