cleanup attribute_editor

cleanup attribute_editor

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/attribute_editor.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/attribute_editor.cljs
@@ -76,64 +76,46 @@
     [orig-keys (mapv first (:orig-attrs @state))
      curr-keys (mapv first (:attrs-list @state))
      curr-vals (mapv second (:attrs-list @state))
-     valid-keys? (every? pos? (map count curr-keys))
-     valid-vals? (every? pos? (map count curr-vals))
-     to-delete (vec (clojure.set/difference
-                      (set orig-keys)
-                      (set curr-keys)))
-     workspace-id (:workspace-id props)
-     make-delete-map-fn (fn [k]
-                          {:op "RemoveAttribute"
-                           :attributeName k})
-     make-update-map-fn (fn [p]
-                          {:op "AddUpdateAttribute"
-                           :attributeName (first p)
-                           :addUpdateAttribute (second p)})
-     del-mapv (mapv make-delete-map-fn to-delete)
-     up-mapv (mapv make-update-map-fn (:attrs-list @state))
+     del-mapv (mapv (fn [k] {:op "RemoveAttribute" :attributeName k})
+                (clojure.set/difference (set orig-keys) (set curr-keys)))
+     up-mapv (mapv (fn [[name attr]] {:op "AddUpdateAttribute" :attributeName name :addUpdateAttribute attr})
+               (:attrs-list @state))
      update-orch-fn (fn [add-update-ops]
                       (swap! state assoc :updating-attrs? true)
                       (endpoints/call-ajax-orch
-                        {:endpoint (endpoints/update-workspace-attrs
-                                     workspace-id)
+                        {:endpoint (endpoints/update-workspace-attrs (:workspace-id props))
                          :payload add-update-ops
                          :headers {"Content-Type" "application/json"}
                          :on-done (fn [{:keys [success? xhr]}]
                                     (swap! state dissoc :updating-attrs?)
-                                    (if-not success?
-                                      (do
-                                        (js/alert (str "Exception:\n"
-                                                    (.-statusText xhr)))
-                                        (swap! state dissoc :orig-attrs)
-                                        (react/call :load-workspace this))))}))
+                                    (when-not success?
+                                      (js/alert (str "Exception:\n" (.-statusText xhr)))
+                                      (swap! state dissoc :orig-attrs)
+                                      (react/call :load-workspace this)))}))
      del-orch-fn (fn [del-ops]
                    (swap! state assoc :deleting-attrs? true)
                    (endpoints/call-ajax-orch
-                     {:endpoint (endpoints/update-workspace-attrs
-                                  workspace-id)
+                     {:endpoint (endpoints/update-workspace-attrs (:workspace-id props))
                       :payload del-ops
                       :headers {"Content-Type" "application/json"}
                       :on-done (fn [{:keys [success? xhr]}]
                                  (swap! state dissoc :deleting-attrs?)
                                  (if-not success?
                                    (do
-                                     (js/alert (str "Exception:\n"
-                                                 (.-statusText xhr)))
-                                     (swap! state assoc
-                                       :attrs-list (:orig-attrs @state))
+                                     (js/alert (str "Exception:\n" (.-statusText xhr)))
+                                     (swap! state assoc :attrs-list (:orig-attrs @state))
                                      (swap! state dissoc :orig-attrs)
                                      (react/call :load-workspace this))
                                    (when-not (empty? up-mapv)
-                                     (update-orch-fn  up-mapv))))}))
-     uniq-keys? (or (empty? curr-keys) (apply distinct? curr-keys))]
+                                     (update-orch-fn up-mapv))))}))]
     (cond
-      (not valid-keys?) (js/alert "Empty attribute keys are not allowed!")
-      (not valid-vals?) (js/alert "Empty attribute values are not allowed!")
-      (not uniq-keys?) (js/alert "Unique keys must be used!")
+      (some empty? curr-keys) (js/alert "Empty attribute keys are not allowed!")
+      (some empty? curr-vals) (js/alert "Empty attribute values are not allowed!")
+      (not (or (empty? curr-keys) (apply distinct? curr-keys))) (js/alert "Unique keys must be used!")
       :else (do
-              (if (empty? to-delete)
+              (if (empty? del-mapv)
                 (when-not (empty? up-mapv)
-                  (update-orch-fn  up-mapv))
+                  (update-orch-fn up-mapv))
                 (del-orch-fn del-mapv))
               (swap! state assoc :editing? false)))))


Removing :iso from listed mime types as :iso19115 should be sufficient.

--- src/cmr/common/mime_types.clj
+++ src/cmr/common/mime_types.clj
@@ -19,7 +19,6 @@
   {:json "application/json"
    :xml "application/xml"
    :echo10 "application/echo10+xml"
-   :iso "application/iso19115+xml"
    :iso-smap "application/iso-smap+xml"
    :iso19115 "application/iso19115+xml"
    :dif "application/dif+xml"


Remove (text ch) and (text str) methods as they were deleted in processing 2.0.

--- src/quil/core.clj
+++ src/quil/core.clj
@@ -3677,7 +3677,6 @@
   text-char
   "Draws a char to the screen in the specified position. See text fn
   for more details."
-  ([c] (.text (current-surface) (char c)))
   ([c x y] (.text (current-surface) (char c) (float x) (float y)))
   ([c x y z] (.text (current-surface) (char c) (float x) (float y) (float z))))

@@ -3714,7 +3713,6 @@

   Use the text-mode function with the :screen parameter to display text
   in 2D at the surface of the window."
-  ([^String s] (.text (current-surface) s))
   ([^String s x y] (.text (current-surface) s (float x) (float y)))
   ([^String s x y z] (.text (current-surface) s (float x) (float y) (float z)))
   ([^String s x1 y1 x2 y2] (.text (current-surface) s (float x1) (float y1) (float x2) (float y2)))
@@ -4232,7 +4230,7 @@
   original Processing API and returns a map of orig/new-name pairs"
   [orig-name]
   (let [metas   (processing-fn-metas-with-orig-method-name)
-        matches (filter #(.startsWith (:processing-name %) orig-name) metas)]
+        matches (filter #(.startsWith (str (:processing-name %)) orig-name) metas)]
     (into {} (map (fn [{:keys [name processing-name]}]
                     [(str processing-name) (str name)])
                   matches))))


update IAM PowerUser policy

update IAM PowerUser policy

--- src/aws_overlord/tasks/saml.clj
+++ src/aws_overlord/tasks/saml.clj
@@ -44,6 +44,10 @@
                            "iam:AddRoleToInstanceProfile"
                            "iam:PassRole"
                            "iam:ListServerCertificates"
+                           "iam:ListRoles"
+                           "iam:ListRolePolicies"
+                           ; FIXME: PutRolePolicy allows privilege escalation!
+                           "iam:PutRolePolicy"
                            ]
                  "Resource" "*"
                  }
@@ -203,4 +207,4 @@
   (create-role "Shibboleth-ReadOnly" aws-id)
   (create-role-policy "Shibboleth-Administrator" admin-policy)
   (create-role-policy "Shibboleth-PowerUser" power-user-policy)
-  (create-role-policy "Shibboleth-ReadOnly" read-only-policy))+  (create-role-policy "Shibboleth-ReadOnly" read-only-policy))


added étreindre

added étreindre

--- src/babel/francais/lexicon.cljc
+++ src/babel/francais/lexicon.cljc
@@ -291,7 +291,7 @@
                                  :1plur "étions"
                                  :2plur "étiez"
                                  :3plur "étaient"}
-                     :futuro {:1sing "serai"
+                     :future {:1sing "serai"
                               :2sing "seras"
                               :3sing "sera"
                               :1plur "serons"
@@ -303,6 +303,20 @@
    ;; ^^ in auxiliary form, "être" only allows essere=true verbs.
    ;; compare with "avoir", which only allows essere=false verbs.

+   "étreindre" {:synsem {:cat :verb
+                         :sem {:pred :hug}
+                         :essere false}
+                :français {:future-stem "étreind"
+                           :infinitive "étreindre"
+                           :present {:1sing "étreins"
+                                     :2sing "étreins"
+                                     :3sing "étreint"
+                                     :1plur "étreignons"
+                                     :2plur "étreignez"
+                                     :3plur "étreignent"}
+                          :past-participle "étreint"
+                          :imperfect-stem "étreindr"}}
+
    "étudier" {:synsem {:cat :verb
                        :sem {:pred :study}}}


fix typo: s/italian/italiano/

fix typo: s/italian/italiano/

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -526,7 +526,7 @@
          :synsem {:sem {:pred (keyword pred)}
                   :agr {:gender :fem
                         :number :plur}}
-         :italian {:plur (clojure.string/replace surface #"o$" "a")}}]}
+         :italiano {:plur (clojure.string/replace surface #"o$" "a")}}]}

       (= vocab-cat "nounsingm")
       {surface


fixed bug

fixed bug

--- src/evalback/core.clj
+++ src/evalback/core.clj
@@ -146,7 +146,7 @@
 (defn debug-path []
   (let [b (io/file ".")
         files (file-seq b)
-        files (map (fn [f] (.getAbsolutePath f)))]
+        files (map (fn [f] (.getAbsolutePath f)) files)]
         (clojure.string/join "\n" files)))

 (defn provide-examples []


Remove outdated comment

Remove outdated comment

--- src/frontend/core.clj
+++ src/frontend/core.clj
@@ -114,9 +114,6 @@
       :else {:proto "http" :host "dev.circlehost:8080"})))

 (def proxy-config
-  ;; Incomplete lists of routes to proxy. Unfortunately duplicated knowledge between
-  ;; here and various places in the backend. Ultimately, this will get cleaned up
-  ;; once we have production web servers separate from backend API servers.
   {:backend-lookup-fn backend-lookup})

 (defn start-server []


Refactor this puppy to use protocols

Refactor this puppy to use protocols

--- src/tobias/cv.clj
+++ src/tobias/cv.clj
@@ -12,36 +12,53 @@

 (def sightcorp-creds (:sightcorp config))

-(defn post-sightcorp [tempfile creds]
-  (http/post "http://api.sightcorp.com/api/detect/"
-             {:multipart [{:name "img" :content tempfile}
-                          {:name "app_key" :content (creds :app_key)}
-                          {:name "client_id" :content (creds :client_id)}]}))

-(defn post-microsoft [tempfile creds]
-  (http/post (str "https://api.projectoxford.ai/face/v0/detections"
-                  "?analyzesFaceLandmarks=false"
-                  "&analyzesAge=true"
-                  "&analyzesGender=true"
-                  "&analyzesHeadPose=false")
-             {:headers {"Content-Type" "application/octet-stream"
-                        "Ocp-Apim-Subscription-Key" (creds :key)}
-              :body tempfile}))
+(defprotocol CvProvider
+  "Encapsulates a CV provider"
+  (post-image [this image]  "Posts an image")
+  (normalize  [this result] "Normalizes a result"))
+
+(def microsoft
+  (reify CvProvider
+    (post-image [_ image] (http/post (str "https://api.projectoxford.ai/face/v0/detections"
+                                          "?analyzesFaceLandmarks=false"
+                                          "&analyzesAge=true"
+                                          "&analyzesGender=true"
+                                          "&analyzesHeadPose=false")
+                                     {:headers {"Content-Type" "application/octet-stream"
+                                                "Ocp-Apim-Subscription-Key" (microsoft-creds :key)}
+                                      :body image}))
+
+    (normalize [_ result] (map (fn [r]
+                                 {:age    (age->sym (get-in r [:attributes :age]))
+                                  :gender (str->kw  (get-in r [:attributes :gender]))})
+                               result))))
+
+(def sightcorp
+  (reify CvProvider
+    (post-image [_ image] (http/post "http://api.sightcorp.com/api/detect/"
+                                     {:multipart [{:name "img" :content image}
+                                                  {:name "app_key" :content (sightcorp-creds :app_key)}
+                                                  {:name "client_id" :content (sightcorp-creds :client_id)}]}))
+
+    (normalize [_ result] (map (fn [r]
+                                 {:age       (age->sym (get-in r [:age :value]))
+                                  :gender    (str->kw  (get-in r [:gender :value]))
+                                  :ethnicity (str->kw  (get-in r [:ethnicity :value]))
+                                  :clothing  (get r :clothingcolors [])})
+                               (:persons result)))))

 (defn post-faceplus [tempfile creds]
   (http/post "http://apius.faceplusplus.com/detection/detect"
              {:multipart [{:name "img" :content tempfile}
-                                  {:name "api_key" :content (creds :api_key)}
-                                  {:name "api_secret" :content (creds :api_secret)}]}))
+                          {:name "api_key" :content (creds :api_key)}
+                          {:name "api_secret" :content (creds :api_secret)}]}))

-(defn post-cv
-  [c                                  ; out channel
-   f                                  ; a function that POSTs to a cv provider
-   image                              ; image on which to run cv
-   creds]                             ; creds for the cv api
-  (thread                             ; gets its own thread because we're blocking
-    (let [res (timed (f image creds))]        ; call f to POST
-      (>!! c (json/read-str (:body res) :key-fn keyword))))) ; parse result as json, put it in c
+(defn normalize-faceplus [result]
+  (map (fn [r]
+         {:age    (age->sym (get-in r [:attribute :age :value]))
+          :gender (str->kw  (get-in r [:attribute :gender :value]))})
+       (:face result)))

 (defn- age->sym [n]
   (let [age (if (string? n)
@@ -55,39 +72,22 @@
 (defn- str->kw [str]
   (-> str (.toLowerCase) (keyword)))

-
-(defn normalize-sightcorp [result]
-  (map (fn [r]
-         {:age       (age->sym (get-in r [:age :value]))
-          :gender    (str->kw  (get-in r [:gender :value]))
-          :ethnicity (str->kw  (get-in r [:ethnicity :value]))
-          :clothing  (get r :clothingcolors [])})
-       (:persons result)))
-
-(defn normalize-microsoft [result]
-  (map (fn [r]
-         {:age    (age->sym (get-in r [:attributes :age]))
-          :gender (str->kw  (get-in r [:attributes :gender]))})
-       result))
-
-(defn normalize-faceplus [result]
-  (map (fn [r]
-         {:age    (age->sym (get-in r [:attribute :age :value]))
-          :gender (str->kw  (get-in r [:attribute :gender :value]))})
-       (:face result)))
+(defn- extract-json-body [body]
+  (json/read-str (:body body) :key-fn keyword))

 (defn get-features
   "Returns a normalized response for the features in the image"
-  [image]
-  (let [sightcorp-chan (chan)
-        microsoft-chan (chan)
-        faceplus-chan  (chan)]
-    (post-cv microsoft-chan post-microsoft image microsoft-creds)
-    (post-cv faceplus-chan  post-faceplus  image faceplus-creds)
-    (post-cv sightcorp-chan post-sightcorp image sightcorp-creds)
-    (let [[result channel] (alts!! [sightcorp-chan microsoft-chan faceplus-chan])]
-      (condp = channel
-             sightcorp-chan :>> (fn [_] (prn :sightcorp) (normalize-sightcorp result))
-             microsoft-chan :>> (fn [_] (prn :microsoft) (normalize-microsoft result))
-             faceplus-chan  :>> (fn [_] (prn :faceplus)  (normalize-faceplus result))
-             :dunno))))
+  ([image]
+   (get-features image [sightcorp microsoft]))
+
+  ([image providers]
+   (let [results (map (fn [provider]
+                        (thread
+                          (timed
+                            (->> image
+                                 (post-image provider)
+                                 (extract-json-body)
+                                 (normalize provider)))))
+                      providers)
+         [first-result _] (alts!! results)]
+     first-result)))


use 'cake install' for subprojects rather than copying the jar over manually. thanks lrenn

--- src/cake/tasks/dependencies.clj
+++ src/cake/tasks/dependencies.clj
@@ -62,9 +62,6 @@
   (when *config*
     (*config* (str "subproject." (name dep)))))

-(defn subproject? [[dep version & opts]]
-  (not (nil? (subproject-path dep))))
-
 (defn add-jarset [task path exclusions]
   (let [exclusions (map #(re-pattern (str % "-\\d.*")) exclusions)]
     (doseq [jar (fileset-seq {:dir path :includes "*.jar"}) :let [name (.getName jar)]]
@@ -76,18 +73,13 @@
         match?  #(re-matches pattern (.getName %))]
     (filter match? (.listFiles (File. dir)))))

-(defn fetch-subprojects [deps dest]
-  (doseq [[dep _ & opts] deps :let [opts (apply array-map opts)]]
-    (when-let [path (subproject-path dep)]
+(defn install-subprojects []
+  (seq (doall
+    (for [type [:dependencies :dev-dependencies]
+          [dep _ & opts] (*project* type)
+          :let [opts (apply array-map opts), path (subproject-path dep)] :when path]
       (binding [cake/*root* path]
-        (cake-exec "deps")
-        (cake-exec "jar" "--clean"))
-      (let [jar (first (glob path (str (name dep) "-.*jar")))]
-        (when-not (.exists jar)
-          (throw (Exception. (str "unable to locate subproject jar: " (.getPath jar)))))
-        (ant Copy {:todir dest}
-             (add-fileset {:file jar})
-             (add-jarset (File. path "lib") (concat *exclusions* (:exclusions opts))))))))
+        (cake-exec "install" "--clean"))))))

 (defn extract-native [jars dest]
   (doseq [jar jars]
@@ -95,8 +87,7 @@
          (add-zipfileset {:src jar :includes (format "native/%s/%s/*" (os-name) (os-arch))}))))

 (defn fetch [deps dest]
-  (fetch-subprojects deps dest)
-  (when-let [deps (seq (remove subproject? deps))]
+  (when (seq deps)
     (let [ref-id (str "cake.deps.fileset." (.getName dest))]
       (ant DependenciesTask {:fileset-id ref-id :path-id (:name *project*)}
            (add-repositories (into repositories (:repositories *project*)))
@@ -137,7 +128,7 @@
   "Fetch dependencies and dev-dependencies. Use 'cake deps force' to refetch."
   (let [deps-str  (prn-str (into (sorted-map) (select-keys *project* [:dependencies :dev-dependencies])))
         deps-file (file "lib" "deps.clj")]
-    (if (or (stale-deps? deps-str deps-file) (= ["force"] (:deps *opts*)))
+    (if (or (install-subprojects) (stale-deps? deps-str deps-file) (= ["force"] (:deps *opts*)))
       (do (fetch-deps)
           (spit deps-file deps-str))
       (when (= ["force"] (:compile *opts*))


use secure fonts

use secure fonts

--- src/clj/starcity/pages/base.clj
+++ src/clj/starcity/pages/base.clj
@@ -22,8 +22,8 @@
   (map css-path ["bootstrap.css"]))

 (def ^{:private true} HEAD-FONTS
-  ["http://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"
-   "http://fonts.googleapis.com/css?family=Roboto+Condensed:400,300"])
+  ["https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"
+   "https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300"])

 (def ^{:private true} BODY-JS
   (map js-path


cjl - Remove unused fn

cjl - Remove unused fn

--- src/icfp2015/cell.clj
+++ src/icfp2015/cell.clj
@@ -1,7 +1,4 @@
 (ns icfp2015.cell)
-
-(defn translate [di dj]
-  (fn [[i j]] [(+ i di) (+ j dj)]))

 (defn offset->cube
   "Convert offset coordinate plane into cube coordinate plane"


count yelp biz and hard-code destinations

--- src/cljs/montheway/mmodern.cljs
+++ src/cljs/montheway/mmodern.cljs
@@ -223,7 +223,8 @@
            numbered-biz (map #(assoc %1 :id %2)
                              relevant-biz
                              (iterate inc 1))]
-       (dommy/append! (sel1 :body) [:p "Fetched yelp data"])
+       (dommy/append! (sel1 :body)
+                      [:p (str "Fetched yelp data: " (count numbered-biz))])
        (dommy/append! (sel1 :#biz-container)
                       (biz-template start-point end-point numbered-biz))
        (dommy/append! (sel1 :body) [:p "Done with yelp data"])
@@ -233,5 +234,6 @@
   (go (while true
         (<! clicks) ;; wait for a click
         (dommy/append! (sel1 :body) [:p "Hi there"])
-        (direction-steps nil (from-query) (to-query)) ;; draw map's directions
+        (direction-steps nil "1200 NW Marshall Street, Portland, OR"
+                         "1005 W Burnside St Portland, OR") ;; draw map's directions
         )))


Buy building

Buy building

--- src/cljs/puertorico/client.cljs
+++ src/cljs/puertorico/client.cljs
@@ -47,7 +47,7 @@
 (defn bank-buildings []
   (into {}
         (for [[bname bdesc] common/initial-buildings]
-          [bname (select-keys bdesc [:count :column])])))
+          [bname (select-keys bdesc [:count :cost :column])])))

 (swap! estream conj
        [:good :bank :coffee 9]
@@ -82,7 +82,7 @@
 (defmethod transition :gold [etype state [dest amount]]
   (update-in state [dest etype] + amount))
 (defmethod transition :building [etype state [dest buildings]]
-  (assoc-in state [dest] buildings))
+  (assoc-in state [dest :building] buildings))
 (defmethod transition :add-player [etype state [pname]]
   (-> state
       (update-in [:order] conj pname)
@@ -90,7 +90,9 @@
       (assoc-in [pname] {:name pname :worker 0 :gold 0 :vp 0 :field {} :building {}})))

 (defmethod transition :rolepick [etype state [role]]
-  (assoc state :current-role role))
+  (-> state
+      (assoc-in [((:order state) (:role-picker state)) :role] role)
+      (assoc :current-role role)))

 (defmethod transition :actiondone [etype state]
   (update-in state [:action-picker] next-player state))
@@ -177,17 +179,12 @@
 (defn add-to-turn [event]
   (swap! game update-in [:turns] add-event-to-turn event))

-(defn do-mayor [cstate]
-  (swap! estream conj
-         [:rolepick :mayor]
-         [:worker :bank -1]
-         [:worker (nth (:order cstate) (:role-picker cstate)) 1])
-  )
+

 (defn action-done []
   (swap! estream conj [:actiondone]))

-(defn do-settler [field-type i]
+(defn do-settler-action [field-type i]
   (when true
     (swap! game update-in [:players 0 :fields] conj field-type)
     (if (= field-type :quarry)
@@ -200,11 +197,19 @@
     (or (nil? current-turn)
         (= :end (first current-turn)))))

-(defn player-pick-role [role]
-  (case role
-    :mayor (do-mayor (calc-state))
-    nil)
-  )
+(defmulti player-pick-role identity)
+(defmethod player-pick-role :mayor [role cstate]
+  (swap! estream conj
+         [:rolepick :mayor]
+         [:worker :bank -1]
+         [:worker (nth (:order cstate) (:role-picker cstate)) 1]))
+
+(defmethod player-pick-role :builder [role cstate]
+  (swap! estream conj
+    [:rolepick :builder]))
+
+(defmethod player-pick-role :default [role cstate]
+  nil)

 (defn whose-turn []
   (let [current-turn (peek (:turns @game))
@@ -213,15 +218,30 @@
       [player-picked-role :bonus])
   ))

-
-
-(defn buy-building [b-name]
-  (println "Trying to buy " b-name))
+(defn num-quarries [pname cstate]
+  0)
+
+(defn buy-building [b-name cstate]
+  (println "Trying to buy " b-name)
+  (let [apicker (:action-picker cstate)
+        building (get-in cstate [:bank :building b-name])
+        discount (max (:column building) (num-quarries (:action-picker cstate)))
+        cost (:cost building)
+        cost (if (= apicker (:role-picker cstate))
+               (dec cost)
+               cost)
+        cost (max 0 (- cost discount))
+        ]
+    (swap! estream conj
+           [:buy-building b-name apicker]
+           [:gold ((:order cstate) apicker) (- cost)]
+           )
+  ))

 (defn building-tile [b-name]
   (let [building (b-name (:buildings @game))]
     [:div.building {:class [(:resource building)]
-                    :on-click #(buy-building b-name)}
+                    :on-click #(buy-building b-name (calc-state))}
      [:h5.pull-left (name b-name)]

      [:span.pull-right (gold (:cost building))]
@@ -311,7 +331,7 @@
 (defn render-roles []
   [:div
    (for [role (:roles @game)]
-     [:button.btn.btn-default.rolecard {:on-click #(player-pick-role role)}
+     [:button.btn.btn-default.rolecard {:on-click #(player-pick-role role (calc-state))}
       (name role)
       [:span " - " (role role-descriptions)]])])


changed access to alternate phrases and words of result sequence according to data structure documentation

--- src/distillery/processing.clj
+++ src/distillery/processing.clj
@@ -80,20 +80,16 @@
       :confidence
       (>= cfg/good-confidence)))

-(defn best-alternate-phrase
-  "Returns the best alternate phrase of a recgnition result."
-  [result]
-  (apply max-key :confidence (:alternates result)))
+(defn alternate-phrases
+  "Returns alternate phrases of the recognition results."
+  [results]
+  (mapcat :alternates results))

-(defn- words
+(defn words
   "Returns words without statistic infos from a result sequence."
-  [results & {:keys [predicate best-phrases]}]
-  (let [predicate    (or predicate (fn [x] true))
-        phrase-src   (if best-phrases
-                       (partial map best-alternate-phrase)
-                       (partial mapcat :alternates))]
-    (->> results
-         (phrase-src)
+  [phrases & {:keys [predicate]}]
+  (let [predicate (or predicate (fn [x] true))]
+    (->> phrases
          (mapcat :words)
          (filter predicate))))


Add generic documentation about the project to the devcards

--- src/docs/om_mantras/docs.cljs
+++ src/docs/om_mantras/docs.cljs
@@ -7,4 +7,57 @@

 (start-devcard-ui!)

-(defcard "# Hello again")
+(defcard
+  "# Om Mantras
+
+  Om Mantras are a collection of truly reusable, generic components for
+  Om (Next). Often, generic components are released with predefined styles,
+  expectations on what the data should look like, or even assumptions about
+  your app state and its structure.
+
+  Om Mantras make none of these assumptions. They follow three principles:
+
+  1. They come unstyled by default, but provide logical CSS classes to give
+     you full freedom to style them the way you want.
+  2. They accept generic data (either single data items or collections of them)
+     and allow you to extract the bits needed for items to be identified and
+     rendered via your own functions.
+  3. They operate in isolation from your app state but allow you to integrate
+     them into your apps by defining callbacks that can then mutate your app
+     state.
+
+  ## Example interface
+
+  ```
+  (sortable {:items <any ordered collection of arbitary data>
+             :key-fn (fn [item] <code to return a unique key for the item>)
+             :element-fn (fn [item] <code to return a React element for the item>)
+             :change-fn (fn [items] <code to do something with the reordered items>)})
+  ```
+
+  ## Usage
+
+  First, you have to add the following dependency to your project, e.g.
+  in `project.clj` or `build.boot`:
+
+  ```
+  [\"om-mantras\" \"0.1.0-SNAPSHOT\"]
+  ```
+
+  To use the components in your app, require `om-mantras.<component>` and
+  create components just like you would do with any other components written
+  using Om (Next):
+
+  ```
+  (ns yourapp.some-ns
+    (:require [om-mantras.sortable :refer [sortable]]))
+
+  (defui YourComponent
+    Object
+    (render [this]
+      (dom/div nil
+        (sortable {:items ...
+                   :key-fn ...
+                   :element-fn ...
+                   :change-fn ...}))))
+  ```")


adjusting test

adjusting test

--- test/celestial/integration/aws.clj
+++ test/celestial/integration/aws.clj
@@ -1,7 +1,10 @@
-(ns aws.provider
+(ns celestial.integration.aws
   "Tests ec2, requires access key and secret key to be defined in ~/.celestial.edn"
+  (:require aws.provider)
+  (:import clojure.lang.ExceptionInfo)
   (:use
-     celestial.integration.aws clojure.test
+    [celestial.model :only (vconstruct)]
+     clojure.test
      [celestial.fixtures :only (redis-ec2-spec)]))

@@ -13,6 +16,6 @@
       (.stop instance)
       (is (= (.status instance) "stopped"))
       (.delete instance)
-      (is (= (.status instance) "terminated"))))
+      (is (thrown? ExceptionInfo (.status instance)))))


show the list table of the sync namespace with more details


fixed midje fact that always passed

fixed midje fact that always passed

This test was always passing no matter what was contained in the vectors.
Now its actually asserting the result of the computation.

--- test/uncomplicate/neanderthal/examples/guides/tutorial_opencl_test.clj
+++ test/uncomplicate/neanderthal/examples/guides/tutorial_opencl_test.clj
@@ -133,7 +133,7 @@
       (facts
        "Create a vector on the device, write into it the data from the host vector
 and compute the sum of absolute values."
-       (asum gpu-x))) => 6.0))
+       (asum gpu-x) => 6.0))))

 "$text


Reformat

Reformat

--- test/icecap/handlers/http_test.clj
+++ test/icecap/handlers/http_test.clj
@@ -11,56 +11,56 @@
 (deftest schema-tests
   (testing "valid steps"
     (are [s] (nil? (check-plan s))
-         simple-http-step
-         (merge simple-http-step {:method :HEAD})
-         (merge simple-http-step {:method :POST})
-         (merge simple-http-step {:method :DELETE})
-         (merge simple-http-step {:method :PUT})
-         simple-https-step
-         (merge simple-https-step {:method :HEAD})
-         (merge simple-https-step {:method :POST})
-         (merge simple-https-step {:method :DELETE})
-         (merge simple-https-step {:method :PUT})))
+      simple-http-step
+      (merge simple-http-step {:method :HEAD})
+      (merge simple-http-step {:method :POST})
+      (merge simple-http-step {:method :DELETE})
+      (merge simple-http-step {:method :PUT})
+      simple-https-step
+      (merge simple-https-step {:method :HEAD})
+      (merge simple-https-step {:method :POST})
+      (merge simple-https-step {:method :DELETE})
+      (merge simple-https-step {:method :PUT})))
   (testing "invalid steps"
     (are [s expected]  (= (check-plan (merge {:type :http} s))
                           expected)

-         {}
-         '{:url missing-required-key
-           :method missing-required-key}
+      {}
+      '{:url missing-required-key
+        :method missing-required-key}

-         {:uri (:url simple-http-step)}
-         '{:uri disallowed-key
-           :url missing-required-key
-           :method missing-required-key}
+      {:uri (:url simple-http-step)}
+      '{:uri disallowed-key
+        :url missing-required-key
+        :method missing-required-key}

-         {:url 1}
-         '{:url (throws? (URI 1))
-           :method missing-required-key}
+      {:url 1}
+      '{:url (throws? (URI 1))
+        :method missing-required-key}

-         {:url (:url simple-http-step)
-          :method :BOGUS}
-         '{:method (not (#{:DELETE
-                           :HEAD
-                           :GET
-                           :PATCH
-                           :POST
-                           :PUT}
-                         :BOGUS))}
+      {:url (:url simple-http-step)
+       :method :BOGUS}
+      '{:method (not (#{:DELETE
+                        :HEAD
+                        :GET
+                        :PATCH
+                        :POST
+                        :PUT}
+                      :BOGUS))}

-         {:url "bogus://example.test"
-          :method :GET}
-         '{:url (not (valid-scheme? a-java.lang.String))})))
+      {:url "bogus://example.test"
+       :method :GET}
+      '{:url (not (valid-scheme? a-java.lang.String))})))

 (deftest valid-scheme?-tests
   (testing "valid schemes"
     (are [url] (valid-scheme? url)
-         "http://example.test"
-         "https://example.test"))
+      "http://example.test"
+      "https://example.test"))
   (testing "invalid schemes"
     (are [url] (not (valid-scheme? url))
-         "bogus://example.test"
-         "ftp://example.test")))
+      "bogus://example.test"
+      "ftp://example.test")))

 (def fake-response
   ::my-fake-response)
@@ -71,7 +71,7 @@

 (deftest execute-tests
   (with-redefs
-    [h/request fake-request]
+   [h/request fake-request]
     (is (let [ch (execute simple-http-step)
               [result] (a/<!! (a/into [] ch))]
           (= result fake-response)))))


default wb-db-uri

default wb-db-uri

--- src/wb_es/env.clj
+++ src/wb_es/env.clj
@@ -1,7 +1,7 @@
 (ns wb-es.env
   (:require [environ.core :refer [env]]))

-(def datomic-uri (env :wb-db-uri))
+(def datomic-uri (or (env :wb-db-uri) "datomic:ddb://us-east-1/WS261/wormbase"))

 (def es-base-url
   (or (env :es-base-uri) "http://localhost:9200"))


reorder navbar

reorder navbar

--- src/foosball/views/layout.clj
+++ src/foosball/views/layout.clj
@@ -9,10 +9,10 @@
   [:div.navbar.navbar-static-top
    [:a.navbar-brand {:href "/"} "Foosball"]
    [:ul.nav.navbar-nav.pull-left
+    [:li (link-to "/matchup"       "Matchup")]
+    [:li (link-to "/report/match"  "Report Match Result")]
     [:li (link-to "/stats/players" "Player Statistics")]
     [:li (link-to "/stats/teams"   "Team Statistics")]
-    [:li (link-to "/matchup"       "Matchup")]
-    [:li (link-to "/report/match"  "Report Match Result")]
     [:li (link-to "/matches"       "Played Matches")]
     [:li (link-to "/player/log"    "Player Log")]
     [:li (link-to "/about"         "About")]]


A lovely test

A lovely test


OO: Remove subset count indication

OO: Remove subset count indication

--- src/hatti/views/dataview.cljs
+++ src/hatti/views/dataview.cljs
@@ -69,8 +69,6 @@
           [:div#data-status
            [:span.rec
             (when loading? [:i.fa.fa-spinner.fa-pulse])
-            (when (and total-records (not= total-records num_of_submissions))
-              (str " " total-records " / "))
             (pluralize-number num_of_submissions " Record")]]
           [:div.divider]
           (om/build dataview-actions dataset-id)])))))


Add lein-pprint to config

Add lein-pprint to config

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -1,3 +1,4 @@
 {:user {:plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]
-                  [refactor-nrepl "1.2.0-SNAPSHOT"]]
+                  [refactor-nrepl "1.2.0-SNAPSHOT"]
+                  [lein-pprint "1.1.1"]]
         :dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}


lein-ring 0.8.13

lein-ring 0.8.13

--- lein_profiles.clj
+++ lein_profiles.clj
@@ -1,5 +1,5 @@
 {:user {:plugins [
-                  [lein-ring "0.8.12"]
+                  [lein-ring "0.8.13"]
                   [lein-ancient "0.5.5"]
                   [jonase/eastwood "0.1.4"]
                   [cider/cider-nrepl "0.7.0"]


Formatting change

Formatting change

--- src/io/aviso/rook/swagger.clj
+++ src/io/aviso/rook/swagger.clj
@@ -15,9 +15,9 @@
   "A base skeleton for a Swagger Object (as per the Swagger 2.0 specification), that is further populated from Rook namespace
   and schema data."
   {
-   :swagger     "2.0"
-   :info        {:title   "<UNSPECIFIED>"
-                 :version "<UNSPECIFIED>"}})
+   :swagger "2.0"
+   :info    {:title   "<UNSPECIFIED>"
+             :version "<UNSPECIFIED>"}})

 (defn keyword->path?
   [v]


store.pure: let normalize assume a single resolution for now.

--- src/io/cyanite/store/pure.clj
+++ src/io/cyanite/store/pure.clj
@@ -21,7 +21,13 @@

 (defn normalize
   [data]
-  data)
+  (vector
+   (some-> data
+           first
+           :id
+           (get "resolution")
+           (get "precision"))
+   data))

 (defn empty-series
   [min-point max-point precision]


Indulge pedantry about ordering in a let

--- test/cljs/fatlip/core_test.cljs
+++ test/cljs/fatlip/core_test.cljs
@@ -64,12 +64,12 @@
 ;; Fine-grained ESK
 (deftest replace-ps
   (let [p (f/Node. :0-0 0 #{:a})
+        p-succ (f/Node. :1-0 0 #{:a})
+        p-edge (f/Edge. p p-succ #{:a})
         not-p (f/Node. :0-1 0 #{:b})
-        p-succ (f/Node. :1-0 0 #{:a})
         not-p-succ (f/Node. :1-0 0 #{:b})
         seg-c-edge (f/Edge. (f/Node. :-1:55 -1 #{:c}) (f/Node. :3-99 3 #{:c}) #{:c})
         seg-c (f/SegmentContainer. [seg-c-edge])
-        p-edge (f/Edge. p p-succ #{:a})
         graph {:p #{p}
                :succs {p #{p-edge}, not-p #{(f/Edge. not-p not-p-succ #{:b})}}}
         layer (-> (f/Layer. 0 0 [p seg-c not-p])


bumped up lein

bumped up lein

--- src/leiningen/new/reagent.clj
+++ src/leiningen/new/reagent.clj
@@ -39,7 +39,7 @@
     [compojure "1.3.1"]
     [selmer "0.7.9"]
     [environ "1.0.0"]
-    [leiningen "2.5.0"]
+    [leiningen "2.5.1"]
     [figwheel "0.1.6-SNAPSHOT"]])

 (def lib-or-app-plugins


Fixed missing overtone.studio.wavetable require. Caused (use 'overtone.core) to fail.

--- src/overtone/core.clj
+++ src/overtone/core.clj
@@ -9,7 +9,7 @@
             [overtone.sc buffer bus envelope example gens info
                          mixer node sample server synth trigger]
             [overtone.music rhythm pitch tuning time]
-            [overtone.studio mixer util fx]
+            [overtone.studio mixer util fx wavetable]
             [overtone.repl ugens examples shell]
             [overtone.libs asset event freesound]
             [overtone.version]


Fix up radio buttons

Fix up radio buttons

--- src/app/core.cljs
+++ src/app/core.cljs
@@ -119,15 +119,18 @@
               [:input {:type "text", :class "guestname", :value name}]
               [:fieldset
                [:div
-                (map (fn [[label for-str val]]
-                       [:div
-                        [:input {:type "radio"
-                                 :name (str "guest" (inc n) "rsvp")
-                                 :onChange #(om/update! card [:rsvps name] val)}]
-                        [:label {:for (str "guest" (inc n) for-str)}
-                         label]])
-                     (partition 3 ["Will attend"   "yes" true
-                                   "Sends regrets" "no" false]))]]])
+                (let [radio-name (str "guest" (inc n) "rsvp")]
+                  (map (fn [[label for-str val]]
+                         (let [input-id (str "guest" (inc n) for-str)]
+                           [:div
+                            [:input {:type "radio"
+                                     :id input-id
+                                     :name radio-name
+                                     :onChange #(om/update! card [:rsvps name] val)}]
+                            [:label {:for input-id}
+                             label]]))
+                       (partition 3 ["Will attend"   "yes" true
+                                     "Sends regrets" "no" false])))]]])
            results)
           [:p {:class "small"}
            "(If we've gotten anyone's name wrong, we apologize! Please correct it here so that we can stop embarrassing ourselves.)"]]


(TK-473) Stop reporting jetty version in responses

Previously, responses from jetty included a `Server` header with the
jetty version. Because we package applications as uberjars, making the
jetty manifest inaccessible, the server version was imprecise (ie.
9.4.z-SNAPSHOT vs. 9.4.11.v20180605). That fact makes the version header
not particularly useful and can also confuse security scanners, which
can't determine whether the server is patched for a particular
vulnerability.

This commit disables sending the `Server` header in responses. It also
prevents default HTML responses from including the server version. No
option is provided to reenable the header, since it's not really useful
and there's presently no reason to include it.

--- src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
+++ src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
@@ -242,7 +242,8 @@
 (defn- http-configuration
   [request-header-size]
   (let [http-config (doto (HttpConfiguration.)
-                      (.setSendDateHeader true))]
+                      (.setSendDateHeader true)
+                      (.setSendServerVersion false))]
     (if request-header-size
       (.setRequestHeaderSize http-config request-header-size))
     http-config))


don't show the refresh error for private docs that the user doesn't have access to

--- src/pc/http/sente.clj
+++ src/pc/http/sente.clj
@@ -246,7 +246,11 @@
 ;; TODO: subscribe should be the only function you need when you get to a doc, then it should send
 ;;       all of the data asynchronously
 (defmethod ws-handler :frontend/subscribe [{:keys [client-id ?data ?reply-fn] :as req}]
-  (check-document-access (-> ?data :document-id) req :admin)
+  (try+
+   (check-document-access (-> ?data :document-id) req :admin)
+   (catch :status t
+     (?reply-fn [:subscribe/error])
+     (throw+)))
   (let [document-id (-> ?data :document-id)
         send-fn (:send-fn @sente-state)
         _ (log/infof "subscribing %s to %s" client-id document-id)


Use doseq for a sequence of side effects

--- src/playmary/one.cljs
+++ src/playmary/one.cljs
@@ -64,9 +64,9 @@

 (defn draw-notes
   [draw-ctx instrument]
-  (dorun (map (partial draw-note draw-ctx instrument)
-              (filter (partial on-screen? instrument)
-                      (-> instrument :notes)))))
+  (doseq [note (filter (partial on-screen? instrument)
+                       (-> instrument :notes))]
+    (draw-note draw-ctx instrument note)))

 (defn draw-piano-keys
   [draw-ctx {w :w h :h playhead :playhead :as instrument}]


Added '&' parameter binding syntax

Added '&' parameter binding syntax

--- src/compojure.clj
+++ src/compojure.clj
@@ -7,6 +7,7 @@
 ;; this software.

 (ns compojure
+  "A concise syntax for generating Ring handlers."
   (:use clout))

 (defn method-matches
@@ -36,14 +37,21 @@
   (merge-with merge request {:route-params params, :params params}))

 (defmacro bind-request
-  "Bind a request to a collection of symbols."
+  "Bind a request to a collection of symbols. The collection can be a Clojure
+  map destructuring binding for the request map, or it can be a vector of
+  parameter bindings."
   [request bindings & body]
   (cond
     (map? bindings)
       `(let [~bindings ~request] ~@body)
     (vector? bindings)
-      `(let [{:keys ~bindings} (~request :params)]
-         ~@body)))
+      (let [[args more] (split-with #(not= % '&) bindings)
+            rest-args   (second more)]
+        `(let [{:keys ~(vec args)} (~request :params)
+               ~@(if rest-args
+                   [rest-args `(dissoc (~request :params)
+                                       ~@(map keyword args))])]
+           ~@body))))

 (defn compile-route
   "Compile a route in the form (method path & body) into a function."


removed unused declare

removed unused declare

--- src/selmer/parser.clj
+++ src/selmer/parser.clj
@@ -18,7 +18,7 @@

 ;; Ahead decl because some fns call into each other.

-(declare parse parse-file expr-tag tag-content)
+(declare parse parse-file tag-content)

 ;; Memoization atom for templates. If you pass a filepath instead
 ;; of a string, we'll use the last-modified timestamp to cache the


added declare for specify-files

added declare for specify-files

--- src/duffel/fs.clj
+++ src/duffel/fs.clj
@@ -121,6 +121,7 @@
     [file-map]
     (map #(narrow-group (val %)) file-map))

+(declare specify-files)
 (defn directory-consolidate
     "If file-struct has :dir-ls then it is a directory. Call specify-files
     on the value at :dir-ls, then cons the file-struct (with :dir-ls dissociated)


remove some hardcoded values

remove some hardcoded values

--- src/terraboot/vpc.clj
+++ src/terraboot/vpc.clj
@@ -5,8 +5,6 @@
             [terraboot.elasticsearch :refer [elasticsearch-cluster]]
             [clojure.string :as string]))

-(def vpc-name "sandpit")
-
 (defn cidr-start
   [cidr-block]
   (first (string/split cidr-block #"/")))
@@ -27,14 +25,6 @@
     (reconstitute-ip (conj (vec (drop-last parsed-ip)) second))))

 (def subnet-types [:public :private])
-
-(def cidr-block {:public {:a "172.20.0.0/24"
-                          :b "172.20.1.0/24"
-                          :c "172.20.2.0/24"}
-                 :private {:a "172.20.8.0/24"
-                           :b "172.20.9.0/24"
-                           :c "172.20.10.0/24"}
-                 })

 (defn vpn-user-data [vars]
   (cloud-config {:package_update true


Fix minor test failure in collection delete

--- test/fcms/integration/rest_api/collection/collection_delete.clj
+++ test/fcms/integration/rest_api/collection/collection_delete.clj
@@ -37,7 +37,7 @@
     ;; curl -i -X DELETE http://localhost:3000/not-here
     (let [response (api-request :delete "/not-here" {:headers {}})]
       (:status response) => 404
-      (body-from-response response) => nil)
+      (body-from-response response) => "Collection not found.")
       ;; Check that the other collection wasn't deleted
       (collection/collection-count) => 1
       (collection/get-collection e) => (contains {


CMR-3680 pr comments

CMR-3680 pr comments

--- umm-spec-lib/src/cmr/umm_spec/test/expected_conversion_util.clj
+++ umm-spec-lib/src/cmr/umm_spec/test/expected_conversion_util.clj
@@ -149,7 +149,7 @@
              url-type
              (-> related-url
                  (update-in [:URL] #(url/format-url % true))
-                 (dissoc :URLContentType :Type :Subtype :Relation :FileSize :MimeType :GetService :GetData))))))))
+                 (dissoc :URLContentType :Type :Subtype :Relation :FileSize :MimeType :GetData))))))))

 (def bounding-rectangles-path
   "The path in UMM to bounding rectangles."


up lang

up lang

--- src/ysmiraak/lang.clj
+++ src/ysmiraak/lang.clj
@@ -1,5 +1,147 @@
-(ns ysmiraak.lang)
+(ns ysmiraak.lang
+  (:require [clojure.core.match :refer [match]]))

+;; goals
+;; 1. unify terms and types (basic constructors shared by types and data)
+;; 2. unify composition and application (????)
+;; 3. compositional lambda calculus (variables and their evaluation rules)
+;; 4. asap beta reduction (partial evaluation)
+
+;; val  = data                -- what evaluates to itself
+;; var  = symbol              -- what serves as a placeholder
+;; expr = val | var | [expr]  -- what can be (partially) evaluated
+;; form = expr | term
+;; term = expr & vars
+;; vars = set var
+
+(defrecord Term   [expr vars])
+(defrecord Forall [expr args])
+
+(defn forms->term
+  "merges multiple forms into a single term"
+  [forms]
+  (loop [forms (seq forms)  expr []  vars #{}]
+    (if-let [[form & forms] forms]
+      (if (instance? Term form) ; build expr & collect vars
+        (recur forms (conj expr (:expr form)) (into vars (:vars form)))
+        (recur forms (conj expr        form)        vars))
+      (Term. (seq expr) vars))))
+
+(defn subst
+  "substitutes all keys in expr to vals in env"
+  [env expr]
+  (cond ; todo use a better data structure (lens?) for this
+    (seq? expr)             (map (partial subst env) expr)
+    (instance? Forall expr) (assoc expr :expr (subst (reduce dissoc env (:args expr)) (:expr expr)))
+    :else                   (env expr expr)))
+
+(defn beta
+  "beta-reduces a term whose expr has a Forall as head"
+  [{[{:keys [expr args]} & vals] :expr vars :vars}]
+  (loop [rgs (seq args)  als (seq vals)  env {}]
+    (match [rgs als]
+           [nil nil] (Term. (subst env expr) (reduce disj vars (keys env)))
+           [_   nil] (Term. (Forall. (subst env expr) rgs) (reduce disj vars (keys env)))
+           [nil   _] (throw (ex-info "arity error" {:args args :vals vals}))
+           :else (let [[a & rgs] rgs
+                       [v & als] als]
+                   (recur rgs als (assoc env a v))))))
+
+(defn ?
+  "funcall, the counit of product-exponential adjunction"
+  ([& forms]
+   (as-> (forms->term forms) {:keys [expr vars] :as term}
+     (cond-> term (instance? Forall (first expr)) beta)
+     (if (seq vars) term (eval expr))))
+  ([]))
+
+(defn %
+  "forall"
+  [form & args] ; currently args can only be var terms
+  (let [term (if (instance? Term form) form (Term. form #{}))
+        expr (:expr term)
+        args (map :expr args)]
+    (Term.
+     (if (instance? Forall expr)
+       (Forall. (:expr expr) (concat args (:args expr)))
+       (Forall.        expr          args))
+     (reduce disj (:vars term) args))))
+
+(defn !
+  "produces a fresh or named var term"
+  ([name] (Term. name #{name}))
+  ([] (! (gensym "!"))))
+
+(comment
+
+  (def a (! 'a))
+  (def b (! 'b))
+  (def c (! 'c))
+
+  (? inc 0)
+  ;; 1
+  (? inc a)
+  ;; Term {
+  ;;  :expr (inc a)
+  ;;  :vars #{a}
+  ;; }
+  (? + (inc 0) a)
+  ;; Term {
+  ;;   :expr (+ 1 a)
+  ;;   :vars #{a}
+  ;; }
+  (? inc (? inc a))
+  ;; Term {
+  ;;   :expr (inc (inc a))
+  ;;   :vars #{a}
+  ;; }
+
+  (def phi (? + a b))
+  ;; Term {
+  ;;   :expr (+ a b)
+  ;;   :vars #{a b}
+  ;; }
+  (def chi (% phi b))
+  ;; Term {
+  ;;   :expr Forall {
+  ;;           :term (+ a b)
+  ;;           :args [b]
+  ;;         }
+  ;;   :vars #{a}
+  ;; }
+  (def psi (% chi a))
+  ;; Term {
+  ;;   :expr Forall {
+  ;;           :term (+ a b)
+  ;;           :args [a b]
+  ;;         }
+  ;;   :vars #{}
+  ;; }
+
+  ;; binding
+  (= (-> phi (% b) (% a))
+     (-> phi (% a b)))
+
+  ;; currying
+  (= 4 (? psi 2 2))
+  (= 4 (? (? psi 2) 2))
+
+  ;; partial eval
+  (=    (? + a 2)          (? chi 2))
+  (= (% (? + a 2) a)    (% (? chi 2) a))
+  (=    (? + 2 2)    (? (% (? chi 2) a) 2))
+
+  (= 1 (? (% (? (% a a) 1) a) 0))
+  (= 4 (? (% (? apply ? chi [2]) a) 2))
+
+  ;; non-terminating term
+  (? (% (? ? a a) a) (% (? ? a a) a))
+
+  ;; todo test recursion
+
+  )
+
+;; todo goal 1
 (comment

   ;; let
@@ -51,133 +193,3 @@
      nil)

   )
-
-;; goal
-;; - unify terms and types (basic constructors shared by types and data)
-;; - compositional lambda calculus (variables and their evaluation rules)
-;; - no closure (asap beta reduction)
-;; - unify composition and application (????)
-
-(defrecord Term [form vars])
-
-(defn ! []
-  (as-> (gensym "!") v
-    (Term. v #{v})))
-
-(defrecord Forall [form args])
-
-(defn % [term & args]
-  (let [term (if (instance? Term term) term (Term. term #{}))
-        {:keys [form vars]} term
-        args (map :form args)]
-    (Term.
-     (if (instance? Forall form)
-       (Forall. (:form form) (concat args (:args form)))
-       (Forall.        form          args))
-     (clojure.set/difference vars (set args)))))
-
-(defn subst [env form]
-  (if (seq? form)
-    (map (partial subst env) form)
-    (if (instance? Forall form)
-      (assoc form :form (subst (apply dissoc env (:args form)) (:form form)))
-      (get env form form))))
-
-(defn ? [& expr]
-  ;; val = anything that evaluates to itself
-  ;; expr = val | [val] | term
-  ;; term = form & vars
-  ;; form = val | var | [form]
-  ;; vars = set var
-  ;; var = symbol (or any val, currently)
-  (let [[[head & vals] vars] ; build compound form & collect free vars
-        , (loop [expr (seq expr)  form []  vars #{}]
-            (if-let [[x & expr] expr]
-              (if (instance? Term x)
-                (recur expr  (conj form (:form x))  (into vars (:vars x)))
-                (recur expr  (conj form        x)         vars))
-              [form vars]))
-        [form vars] ; beta reduction
-        , (if (instance? Forall head)
-            (let [{:keys [form args]} head]
-              (loop [args' (seq args) vals' (seq vals)  env {}]
-                (if-let   [[a & rgs] args']
-                  (if-let [[v & als] vals']
-                    (recur rgs als (assoc env a v))
-                    [(Forall. (subst env form) args') (clojure.set/difference vars (set (keys env)))])
-                  (if vals'
-                    (throw (ex-info "arity error" {:args args :vals vals}))
-                    [(subst env form) (clojure.set/difference vars (set (keys env)))]))))
-            [(cons head vals) vars])]
-    (if (seq vars)
-      (Term. form vars)
-      (eval form))))
-
-(comment
-
-  (def a (!))
-  (def b (!))
-  (def c (!))
-
-  (? inc 0)
-  ;; 1
-  (? inc a)
-  ;; Term {
-  ;;  :form (inc a)
-  ;;  :vars #{a}
-  ;; }
-  (? + (inc 0) a)
-  ;; Term {
-  ;;   :form (+ 1 a)
-  ;;   :vars #{a}
-  ;; }
-  (? inc (? inc a))
-  ;; Term {
-  ;;   :form (inc (inc a))
-  ;;   :vars #{a}
-  ;; }
-
-  (def phi (? + a b))
-  ;; Term {
-  ;;   :form (+ a b)
-  ;;   :vars #{a b}
-  ;; }
-  (def chi (% phi b))
-  ;; Term {
-  ;;   :form Forall {
-  ;;           :term (+ a b)
-  ;;           :args [b]
-  ;;         }
-  ;;   :vars #{a}
-  ;; }
-  (def psi (% chi a))
-  ;; Term {
-  ;;   :form Forall {
-  ;;           :term (+ a b)
-  ;;           :args [a b]
-  ;;         }
-  ;;   :vars #{}
-  ;; }
-
-  ;; binding
-  (= (-> phi (% b) (% a))
-     (-> phi (% a b)))
-
-  ;; currying
-  (= 4 (? psi 2 2))
-  (= 4 (? (? psi 2) 2))
-
-  ;; partial eval
-  (=    (? + a 2)          (? chi 2))
-  (= (% (? + a 2) a)    (% (? chi 2) a))
-  (=    (? + 2 2)    (? (% (? chi 2) a) 2))
-
-  (= 1 (? (% (? (% a a) 1) a) 0))
-  (= 4 (? (% (? apply ? chi [2]) a) 2))
-
-  ;; non-terminating form
-  (? (% (? ? a a) a) (% (? ? a a) a))
-
-  ;; todo test recursion
-
-  )


fix classpath require exception using unresolved paths

--- src/main/shadow/build/npm.clj
+++ src/main/shadow/build/npm.clj
@@ -172,7 +172,7 @@
                 (json/read-str))

             package-dir
-            (.getParentFile file)
+            (.getAbsoluteFile (.getParentFile file))

             content
             (-> {:package-name name


Add mapping for OrthographicCamera

Add mapping for OrthographicCamera

--- src/blue_salamander/r3elements.cljs
+++ src/blue_salamander/r3elements.cljs
@@ -27,6 +27,7 @@
 (abbrev/defn-r3-element Mesh)
 (abbrev/defn-r3-element Object3D)
 (abbrev/defn-r3-element PerspectiveCamera)
+(abbrev/defn-r3-element OrthographicCamera)
 (abbrev/defn-r3-element HemisphereLight)
 (abbrev/defn-r3-element DirectionalLight)
 (abbrev/defn-r3-element AmbientLight)


Fix email on copyright notice on session ns.

--- src/buddy/auth/backends/session.clj
+++ src/buddy/auth/backends/session.clj
@@ -1,4 +1,4 @@
-;; Copyright 2013-2015 Andrey Antukh <niwi@niwi.be>
+;; Copyright 2013-2015 Andrey Antukh <niwi@niwi.nz>
 ;;
 ;; Licensed under the Apache License, Version 2.0 (the "License")
 ;; you may not use this file except in compliance with the License.


no need for join true since its default

no need for join true since its default

--- src/celestial/puppet_standalone.clj
+++ src/celestial/puppet_standalone.clj
@@ -72,8 +72,7 @@
   Provision
   (apply- [this]
     (let [puppet-std (type :puppet-std) module (puppet-std :module)]
-        (execute puppet-provision {:module module :type type} :web :join true :env {:roles {:web #{remote}}})
-      )))
+        (execute puppet-provision {:module module :type type} :web :env {:roles {:web #{remote}}}))))

 (defmethod pconstruct :puppet-std [type {:keys [machine] :as spec}]


Pass pikaday an ratom, and use the pikaday on-select

Pikaday really wants a ratom (I also tried reactions
but with little success). The thing returned by
the subscribe doesn't work as is, but wrapping it
up as a ratom when we hand it over to pikaday does
work.

Next, I hooked into the pikaday-attrs, and there
I was able to set the `:on-select` handler that it
normally defaults to push data back into the ratom.
Now it does the normal dispatch, which updates the
db, which then triggers a re-render because the
subscribed to value changes.

--- src/cljs/early_vote_site/views.cljs
+++ src/cljs/early_vote_site/views.cljs
@@ -2,6 +2,7 @@
   (:require [re-frame.core :as re-frame]
             [cljs-pikaday.reagent :as pikaday]
             [reagent.core :as reagent]
+            [reagent.ratom :as ratom]
             [early-vote-site.constants :as constants]))

 (defn state-select-row
@@ -22,8 +23,9 @@
       [:div {:class "form-group mx-sm-3"}
        [:label {:for "date" :style {:padding-right 10}} "Date"]
        [pikaday/date-selector {:class "form-control"
-                               :date-atom date
-                               :on-change #(re-frame/dispatch [:date-selected (-> % .-target .-value)])}]]
+                               :date-atom (ratom/atom (some-> @date js/Date.))
+                               :pikaday-attrs
+                               {:on-select #(re-frame/dispatch [:date-selected %])}}]]
       [:button.button "add"]]
       [:p @state]
       [:p (some-> @date (js/Date.) .toString)]]))


Implemented the experiments of step 2

Implemented the experiments of step 2

--- src/cljs/reagent_phonecat/core.cljs
+++ src/cljs/reagent_phonecat/core.cljs
@@ -31,10 +31,44 @@
    (for [phone @phones]
      [phone-component phone])])

+;; experiments
+(def name (rc/atom "World"))
+(defn hello-cpnt []
+  [:p (str "Hello, " @name "!")])
+
+(defn simple-table []
+  [:table
+   [:tr [:th "row number"]]
+   (for [i (range 8)]
+     [:tr [:td (inc i)]])
+   ])
+
+(defn less-simple-table []
+  [:table
+   (for [i (range 8)]
+     [:tr (for [j (range 8)]
+            [:td (inc i) (inc j)])])
+   ])
+
 ;; -------------------------
 ;; Initialize app
+(defn top-cpnt []
+  [:div
+   [phones-list]
+
+   [:h2 "Experiments"]
+   [:h4 "Hello World"]
+   [hello-cpnt]
+
+   [:h4 "Simple table"]
+   [simple-table]
+
+   [:h4 "Less simple table"]
+   [less-simple-table]
+   ])
+
 (defn init! []
-  (rc/render-component [phones-list] (.getElementById js/document "app")))
+  (rc/render-component [top-cpnt] (.getElementById js/document "app")))

 ;; -------------------------


Move planning fns up in connect ns

Move planning fns up in connect ns

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -343,6 +343,108 @@
 (defn- cache-batch [env resolver-sym linked-results]
   (doseq [[input value] linked-results]
     (p/cached env [resolver-sym input] value)))
+
+;; resolve plan
+
+(defn output->provides [output]
+  (let [ast (p/query->ast output)]
+    (into #{} (map :key) (:children ast))))
+
+(defn compute-paths* [index-oir keys bad-keys attr pending]
+  (if (contains? index-oir attr)
+    (reduce-kv
+      (fn [paths input resolvers]
+        (if (or (some input pending) (some bad-keys input))
+          paths
+          (let [new-paths (into #{} (map #(vector [attr %])) resolvers)
+                missing   (set/difference input keys)]
+            (if (seq missing)
+              (let [missing-paths (->> missing
+                                       (into #{} (map #(compute-paths* index-oir keys bad-keys % (into pending missing))))
+                                       (apply combo/cartesian-product)
+                                       (mapv #(into (first %) (second %))))]
+                (if (seq missing-paths)
+                  (into paths (->> (combo/cartesian-product new-paths missing-paths)
+                                   (mapv #(into (first %) (second %)))))
+                  paths))
+              (into paths new-paths)))))
+      #{}
+      (get index-oir attr))
+    #{}))
+
+(defn compute-paths
+  "This function will return a set of possible paths given a set of available keys to reach some attribute. You also
+  send a set of bad keys, bad keys mean information you cannot use (maybe they already got an error, or you known will
+  not be available)."
+  [index-oir keys bad-keys attr]
+  (into #{} (map rseq) (compute-paths* index-oir keys bad-keys attr #{attr})))
+
+(defn split-good-bad-keys [entity]
+  (let [{bad-keys  true
+         good-keys false} (group-by #(contains? p/break-values (second %)) entity)
+        good-keys (into #{} (map first) good-keys)
+        bad-keys  (into #{} (map first) bad-keys)]
+    [good-keys bad-keys]))
+
+(defn path-cost [{::keys   [resolver-weights]
+                  ::p/keys [request-cache]
+                  :as      env} path]
+  (let [weights (or (some-> resolver-weights deref) {})]
+    (if (and (= 1 (count path)) request-cache)
+      (let [sym (first path)
+            e   (select-keys (p/entity env) (-> (resolver-data env sym)
+                                                ::input))]
+        (if (contains? @request-cache [sym e])
+          1
+          (get weights sym 1)))
+      (transduce (map #(get weights % 1)) + path))))
+
+(defn resolve-plan [{::keys [indexes] :as env}]
+  (let [key (-> env :ast :key)
+        [good-keys bad-keys] (split-good-bad-keys (p/entity env))]
+    (->> (compute-paths (::index-oir indexes) good-keys bad-keys key)
+         (sort-by #(path-cost env (map second %))))))
+
+(defn resolver->output [env resolver-sym]
+  (let [{::keys [output compute-output]} (get-in env [::indexes ::index-resolvers resolver-sym])]
+    (cond
+      compute-output (compute-output env)
+      output output
+      :else (throw (ex-info "No output available" {::sym resolver-sym})))))
+
+(defn plan->provides [env plan]
+  (into #{} (mapcat #(output->provides (resolver->output env (second %)))) plan))
+
+(defn plan->resolvers [plan]
+  (->> plan
+       (flatten)
+       (into #{} (filter symbol?))))
+
+(defn decrease-path-costs [{::keys [resolver-weights resolver-weight-decrease-amount]
+                            :or    {resolver-weight-decrease-amount 1}} plan]
+  (if resolver-weights
+    (swap! resolver-weights
+      #(reduce
+         (fn [rw rsym]
+           (assoc rw rsym (max 1 (- (get rw rsym 0) resolver-weight-decrease-amount))))
+         %
+         (plan->resolvers plan)))))
+
+(defn reader-compute-plan [env failed-resolvers]
+  (let [plan-trace-id (pt/trace-enter env {::pt/event ::compute-plan})
+        plan          (->> (resolve-plan env)
+                           (remove #(some failed-resolvers (map second %))))]
+    (if (seq plan)
+      (let [plan' (first plan)
+            out   (plan->provides env plan')]
+        (pt/trace-leave env plan-trace-id {::pt/event ::compute-plan ::plan plan ::pp/provides out})
+        (decrease-path-costs env plan)
+        [plan' out])
+      (do
+        (pt/trace-leave env plan-trace-id {::pt/event ::compute-plan})
+        nil))))
+
+;; readers

 (defn reader [{::keys   [indexes] :as env
                ::p/keys [processing-sequence]}]
@@ -439,75 +541,6 @@
           ::p/continue))
       ::p/continue)))

-(defn output->provides [output]
-  (let [ast (p/query->ast output)]
-    (into #{} (map :key) (:children ast))))
-
-(defn compute-paths* [index-oir keys bad-keys attr pending]
-  (if (contains? index-oir attr)
-    (reduce-kv
-      (fn [paths input resolvers]
-        (if (or (some input pending) (some bad-keys input))
-          paths
-          (let [new-paths (into #{} (map #(vector [attr %])) resolvers)
-                missing   (set/difference input keys)]
-            (if (seq missing)
-              (let [missing-paths (->> missing
-                                       (into #{} (map #(compute-paths* index-oir keys bad-keys % (into pending missing))))
-                                       (apply combo/cartesian-product)
-                                       (mapv #(into (first %) (second %))))]
-                (if (seq missing-paths)
-                  (into paths (->> (combo/cartesian-product new-paths missing-paths)
-                                   (mapv #(into (first %) (second %)))))
-                  paths))
-              (into paths new-paths)))))
-      #{}
-      (get index-oir attr))
-    #{}))
-
-(defn compute-paths
-  "This function will return a set of possible paths given a set of available keys to reach some attribute. You also
-  send a set of bad keys, bad keys mean information you cannot use (maybe they already got an error, or you known will
-  not be available)."
-  [index-oir keys bad-keys attr]
-  (into #{} (map rseq) (compute-paths* index-oir keys bad-keys attr #{attr})))
-
-(defn split-good-bad-keys [entity]
-  (let [{bad-keys  true
-         good-keys false} (group-by #(contains? p/break-values (second %)) entity)
-        good-keys (into #{} (map first) good-keys)
-        bad-keys  (into #{} (map first) bad-keys)]
-    [good-keys bad-keys]))
-
-(defn path-cost [{::keys   [resolver-weights]
-                  ::p/keys [request-cache]
-                  :as      env} path]
-  (let [weights (or (some-> resolver-weights deref) {})]
-    (if (and (= 1 (count path)) request-cache)
-      (let [sym (first path)
-            e   (select-keys (p/entity env) (-> (resolver-data env sym)
-                                                ::input))]
-        (if (contains? @request-cache [sym e])
-          1
-          (get weights sym 1)))
-      (transduce (map #(get weights % 1)) + path))))
-
-(defn resolve-plan [{::keys [indexes] :as env}]
-  (let [key (-> env :ast :key)
-        [good-keys bad-keys] (split-good-bad-keys (p/entity env))]
-    (->> (compute-paths (::index-oir indexes) good-keys bad-keys key)
-         (sort-by #(path-cost env (map second %))))))
-
-(defn resolver->output [env resolver-sym]
-  (let [{::keys [output compute-output]} (get-in env [::indexes ::index-resolvers resolver-sym])]
-    (cond
-      compute-output (compute-output env)
-      output output
-      :else (throw (ex-info "No output available" {::sym resolver-sym})))))
-
-(defn plan->provides [env plan]
-  (into #{} (mapcat #(output->provides (resolver->output env (second %)))) plan))
-
 (defn parallel-batch-error [{::p/keys [processing-sequence] :as env} e]
   (let [{::keys [output]} (-> env ::resolver-data)
         item-count (count processing-sequence)]
@@ -585,35 +618,6 @@

             (second (get linked-results e [nil {}]))))))))

-(defn plan->resolvers [plan]
-  (->> plan
-       (flatten)
-       (into #{} (filter symbol?))))
-
-(defn decrease-path-costs [{::keys [resolver-weights resolver-weight-decrease-amount]
-                            :or    {resolver-weight-decrease-amount 1}} plan]
-  (if resolver-weights
-    (swap! resolver-weights
-      #(reduce
-         (fn [rw rsym]
-           (assoc rw rsym (max 1 (- (get rw rsym 0) resolver-weight-decrease-amount))))
-         %
-         (plan->resolvers plan)))))
-
-(defn reader-compute-plan [env failed-resolvers]
-  (let [plan-trace-id (pt/trace-enter env {::pt/event ::compute-plan})
-        plan          (->> (resolve-plan env)
-                           (remove #(some failed-resolvers (map second %))))]
-    (if (seq plan)
-      (let [plan' (first plan)
-            out   (plan->provides env plan')]
-        (pt/trace-leave env plan-trace-id {::pt/event ::compute-plan ::plan plan ::pp/provides out})
-        (decrease-path-costs env plan)
-        [plan' out])
-      (do
-        (pt/trace-leave env plan-trace-id {::pt/event ::compute-plan})
-        nil))))
-
 (defn parallel-reader [{::keys    [indexes max-resolver-weight]
                         ::p/keys  [processing-sequence]
                         ::pp/keys [waiting]


include org and board data with notification of entry update

--- src/oc/storage/api/videos.clj
+++ src/oc/storage/api/videos.clj
@@ -8,6 +8,8 @@
             [oc.storage.util.ziggeo :as ziggeo]
             [oc.storage.async.notification :as notification]
             [oc.storage.resources.entry :as entry-res]
+            [oc.storage.resources.org :as org-res]
+            [oc.storage.resources.board :as board-res]
             [oc.storage.config :as config]))

 (defn- handle-video-webhook [conn ctx]
@@ -20,12 +22,16 @@
         video-changed (:video-processed entry)]
     (timbre/debug video entry)
     (when entry
-      (let [updated-result (entry-res/update-video-data conn video entry)]
+      (let [updated-result (entry-res/update-video-data conn video entry)
+            ;; find org
+            org (org-res/get-org conn (:org-uuid entry))
+            ;; find board
+            board (board-res/get-board conn (:board-uuid entry))]
         (when (not= (:video-processed updated-result) video-changed)
           (notification/send-trigger!
-           (notification/->trigger :update
+           (notification/->trigger :update org board
                                    {:old entry :new updated-result}
-                                   nil)))))))
+                                   nil nil)))))))

 ;; ----- Resources - see: http://clojure-liberator.github.io/liberator/assets/img/decision-graph.svg


Do not re-dispatch to defecting executor within configured delay

--- src/cider_ci/dispatcher/dispatch/next_trial.clj
+++ src/cider_ci/dispatcher/dispatch/next_trial.clj
@@ -8,6 +8,7 @@
     [cider-ci.utils.rdbms :as rdbms]
     [clojure.java.jdbc :as jdbc]
     [honeysql.sql :refer :all]
+    [cider-ci.utils.config :as config :refer [get-config]]

     [clj-logging-config.log4j :as logging-config]
     [clojure.tools.logging :as logging]
@@ -45,14 +46,26 @@
                                       " * dispatch_storm_tasks.dispatch_storm_delay_seconds ))"
                                       " > now() "))))])

-(def ^:private trials-excutors-base-query
+(defn ^:private with-defective-trial-delay []
+  (if-let [interval (-> (get-config) :defective_trial_same_executor_redispatch_delay)]
+    [ "NOT EXISTS"
+     (-> (sql-select 1)
+         (sql-from [:trials :dispatch_trials])
+         (sql-merge-where [:= :dispatch_trials.id :trials.id])
+         (sql-merge-join [:tasks :defective_tasks] [:= :defective_tasks.id :dispatch_trials.task_id])
+         (sql-merge-join [:trials :trial_sibblings] [:= :trial_sibblings.task_id :defective_tasks.id])
+         (sql-merge-where [:= :trial_sibblings.state  "defective"])
+         (sql-merge-where (sql-raw (str "( trial_sibblings.updated_at > now() - (interval '"
+                                        interval "'))"))))]
+    (sql-raw "true")))
+
+(defn ^:private trials-excutors-base-query []
   (-> (sql-from :trials)
       (sql-merge-where (sql-raw "trials.state = 'pending'"))
       (sql-merge-join :tasks [:= :tasks.id :trials.task_id])
       (sql-merge-join [:executors_with_load :exs]
                       (sql-raw "(tasks.traits <@ exs.traits)"))
       (sql-select :trials.id :trials.task_id [:exs.id :executor_id])
-      ; TODO write this out more explicitly
       (sql-merge-where [:< :exs.relative_load 1])
       (sql-merge-where (sql-raw (str "tasks.load < "
                                      "exs.max_load * exs.temporary_overload_factor "
@@ -61,10 +74,12 @@
       (sql-merge-where (sql-raw (str "(exs.last_ping_at >  "
                                      "(now() - interval '1 Minutes'))")))
       (sql-merge-where without-conflicting-dispatch-storm-delay)
-      (sql-merge-where without-or-with-available-global-resource-condition)))
+      (sql-merge-where without-or-with-available-global-resource-condition)
+      (sql-merge-where (with-defective-trial-delay))
+      ))

-(def ^:private trials-excutors-base-with-repo
-  (-> trials-excutors-base-query
+(defn ^:private trials-excutors-base-with-repo []
+  (-> (trials-excutors-base-query)
       (sql-merge-join :jobs [:= :tasks.job_id :jobs.id])
       (sql-merge-join :commits [:= :jobs.tree_id :commits.tree_id])
       (sql-merge-join [:branches_commits :bcts]
@@ -77,8 +92,8 @@
              (sql-raw (str " repositories.git_url ="
                            " ANY(exs.accepted_repositories) "))])))

-(def ^:private trials-excutors-query-ordered
-  (-> trials-excutors-base-with-repo
+(defn ^:private trials-excutors-query-ordered []
+  (-> (trials-excutors-base-with-repo)
       (sql-order-by [:jobs.priority :desc]
                     [:jobs.created_at :asc]
                     [:tasks.priority :desc]
@@ -89,7 +104,7 @@
 ;##############################################################################

 (defn next-trial-for-pull [tx executor]
-  (->> (-> trials-excutors-query-ordered
+  (->> (-> (trials-excutors-query-ordered)
            (sql-merge-where [:= :exs.id (:id executor)])
            (sql-merge-where [:= cider-ci.self/VERSION (:version executor)])
            (sql-limit 1) sql-format)
@@ -99,7 +114,7 @@

 ;#### debug ###################################################################
 ;(debug/wrap-with-log-debug #'next-trial-for-pull)
-;(logging-config/set-logger! :level :debug)
+(logging-config/set-logger! :level :debug)
 ;(logging-config/set-logger! :level :info)
 ;(debug/debug-ns 'cider-ci.utils.http)
-;(debug/debug-ns *ns*)
+(debug/debug-ns *ns*)


Implement ILookup in Metronome to allow keyword acces to @start and @bpm.

--- src/overtone/music/rhythm.clj
+++ src/overtone/music/rhythm.clj
@@ -35,6 +35,7 @@
     "Get the current bpm or change the bpm to 'new-bpm'."))

 (deftype Metronome [start bpm]
+
   IMetronome
   (start [this] @start)
   (start [this start-beat]
@@ -52,6 +53,14 @@
       (reset! start new-start)
       (reset! bpm new-bpm))
     [:bpm new-bpm])
+
+  clojure.lang.ILookup
+  (valAt [this key] (.valAt this key nil))
+  (valAt [this key not-found]
+    (cond (= key :start) @start
+          (= key :bpm) @bpm
+          :else not-found))
+
   clojure.lang.IFn
   (invoke [this] (beat this))
   (invoke [this arg]


Add Central Moment

Add Central Moment

--- src/clj/clojurewerkz/statistiker/statistics.clj
+++ src/clj/clojurewerkz/statistiker/statistics.clj
@@ -143,3 +143,16 @@
                (map #(pow (- % mu) 3))
                (reduce +)))
        (pow sigma 3))))
+
+(defn central-moment
+  [xs i]
+  (let [mu    (mean xs)
+        sigma (sd xs)
+        n     (count xs)]
+
+    (/ (* (/ n ;; That doesn't appear to be correct???
+             (apply * (take (dec i) (iterate dec (dec n)))))
+          (->> xs
+               (map #(pow (- % mu) i))
+               (reduce +)))
+       (pow sigma i))))


put event ids and values together on one channel

--- src/cljx/jamesmacaulay/async_tools/signals.cljx
+++ src/cljx/jamesmacaulay/async_tools/signals.cljx
@@ -63,17 +63,17 @@
     (Sprout. value (port mult))))

 (defn input
-  [id mc-in v]
-  (let [c-in (port mc-in)
-        c-out (chan)
-        eid (port event-notify)]
-    (go-loop [prev v]
-      (let [msg (if (= id (<! eid))
-                  (change (<! c-in))
+  [id init]
+  (let [c-in (port event-notify)
+        c-out (chan)]
+    (go-loop [prev init]
+      (let [[eid v] (<! c-in)
+            msg (if (= id eid)
+                  (change v)
                   (no-change prev))]
         (>! c-out msg)
         (recur (body msg))))
-    (Node. v (async/mult c-out))))
+    (Node. init (async/mult c-out))))

 (defn lift-msgs
   [f & sigs]
@@ -162,11 +162,9 @@
 (defn- channel-input
   [ch v]
   (let [id (gen-id)
-        mc-out (async/mult ch)
-        ids (async/map (constantly id)
-                       [(port mc-out)])]
-    (async/pipe ids new-event)
-    (input id mc-out v)))
+        events (async/map (partial vector id) [ch])]
+    (async/pipe events new-event)
+    (input id v)))

 (defn read-port
   [sig]


differenciation of test forms for quicker error analysis

--- src/paredit/core_commands.clj
+++ src/paredit/core_commands.clj
@@ -395,9 +395,9 @@
                  "foo bar| baz" "foo |bar| baz"
                  "foo bar |baz" "foo bar| |baz"
                  "foo ba|r baz" "foo |bar| baz"
-                 "foo bar b|a|z" "foo bar |baz|"
-                 "foo bar ba|z|" "foo bar |baz|"
-                 "foo bar |baz|" "foo bar| baz|"
+                 "foo1 bar b|a|z" "foo1 bar |baz|"
+                 "foo2 bar ba|z|" "foo2 bar |baz|"
+                 "foo3 bar |baz|" "foo3 bar| baz|"
                  "foo bar| baz|" "foo |bar baz|"
                  "foo |bar baz|" "foo| bar baz|"
                  "|(foo bar baz)|" "|(foo bar baz)|"
@@ -407,7 +407,7 @@
                  ;;not-yet "|foo b|ar baz" "|foo bar baz|"
                  "foo (bar| baz)" "foo (|bar| baz)"
                  "foo b|ar| baz" "foo |bar| baz"
-                 "foo (|bar| baz)" "foo |(bar baz)|"
+                 "foo1 (|bar| baz)" "foo1 |(bar baz)|"
                  "foo \"bar |baz\"" "foo |\"bar baz\"|"
                  ; pb parsley "foo;ba|r\nbaz" "foo|;bar\n|baz"
                  "foo (bar [ba|z] |foo)" "foo (bar |[baz] |foo)"
@@ -420,10 +420,10 @@
      ["Shift+Alt+Right" :paredit-expand-right
                 {
                  "foo bar| baz" "foo bar| |baz"
-                 "foo bar |baz" "foo bar |baz|"
+                 "foo4 bar |baz" "foo4 bar |baz|"
                  "foo ba|r baz" "foo |bar| baz"
-                 "foo bar b|a|z" "foo bar |baz|"
-                 "foo bar ba|z|" "foo bar |baz|"
+                 "foo5 bar b|a|z" "foo5 bar |baz|"
+                 "foo6 bar ba|z|" "foo6 bar |baz|"
                  ;;not-yet "foo bar |baz|" "|foo bar baz|"
                  ;;not-yet "foo bar| baz|" "|foo bar baz|"
                  ;;not-yet "foo |bar baz|" "|foo bar baz|"
@@ -435,8 +435,8 @@
                  "foo (bar| baz)" "foo (bar| |baz)"
                  "foo (bar |baz)" "foo (bar |baz|)"
                  "foo b|ar| baz" "foo |bar| baz"
-                 "foo (bar baz|)" "foo |(bar baz)|"
-                 "foo (bar |baz|)" "foo |(bar baz)|"
+                 "foo2 (bar baz|)" "foo2 |(bar baz)|"
+                 "foo3 (bar |baz|)" "foo3 |(bar baz)|"
                  "foo \"bar |baz\"" "foo |\"bar baz\"|"
                  ; pb parsley "foo;ba|r\nbaz" "foo|;bar\n|baz"
                  "foo (bar [ba|z] |foo)" "foo (bar |[baz] |foo)"
@@ -450,9 +450,9 @@
                  "foo bar| baz" "|foo bar baz|"
                  "foo bar |baz" "|foo bar baz|"
                  "foo ba|r baz" "foo |bar| baz"
-                 "foo bar b|a|z" "foo bar |baz|"
-                 "foo bar ba|z|" "foo bar |baz|"
-                 "foo bar |baz|" "|foo bar baz|"
+                 "foo7 bar b|a|z" "foo7 bar |baz|"
+                 "foo8 bar ba|z|" "foo8 bar |baz|"
+                 "foo9 bar |baz|" "|foo9 bar baz|"
                  "foo bar| baz|" "|foo bar baz|"
                  "foo |bar baz|" "|foo bar baz|"
                  "|foo bar baz" "|foo bar baz|"
@@ -460,11 +460,11 @@
                  "|foo| bar baz" "|foo bar baz|"
                  "|foo |bar baz" "|foo bar baz|"
                  "|foo b|ar baz" "|foo bar| baz"
-                 "foo (bar| baz)" "foo |(bar baz)|"
-                 "foo (bar |baz)" "foo |(bar baz)|"
+                 "foo4 (bar| baz)" "foo4 |(bar baz)|"
+                 "foo5 (bar |baz)" "foo5 |(bar baz)|"
                  "foo b|ar| baz" "foo |bar| baz"
-                 "foo (bar baz|)" "foo |(bar baz)|"
-                 "foo (bar |baz|)" "foo |(bar baz)|"
+                 "foo6 (bar baz|)" "foo6 |(bar baz)|"
+                 "foo7 (bar |baz|)" "foo7 |(bar baz)|"
                  "foo \"bar |baz\"" "foo |\"bar baz\"|"
                  ; pb parsley "foo;ba|r\nbaz" "foo|;bar\n|baz"
                  "foo (bar [ba|z] |foo)" "foo (bar |[baz] |foo)"


Removed sketch for rule exploration

Removed sketch for rule exploration

no time.

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/fca/rule_exploration.clj
+++ src/conexp/fca/rule_exploration.clj
@@ -1,35 +0,0 @@
-;; Copyright (c) Daniel Borchmann. All rights reserved.
-;; The use and distribution terms for this software are covered by the
-;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
-;; which can be found in the file LICENSE at the root of this distribution.
-;; By using this software in any fashion, you are agreeing to be bound by
-;; the terms of this license.
-;; You must not remove this notice, or any other, from this software.
-
-(ns conexp.fca.rule-exploration
-  (:use conexp.base
-	conexp.fca.implications))
-
-;;;
-
-(defn apply-to-implication [alpha impl]
-  (make-implication (map alpha (premise impl))
-		    (map alpha (conclusion impl))))
-
-(defn position [x vec]
-  (loop [pos 0
-	 vec vec]
-    (cond
-     (empty? vec) nil,
-     (= x (first vec)) pos,
-     :else (recur (inc pos) (rest vec)))))
-
-(defn permutation
-  ;; hack only, slow and bad
-  [source target]
-  (fn [x]
-    (nth target (position x source))))
-
-;;;
-
-nil


Update REST Service in document/update

Update REST Service in document/update

--- src/rrms/core.clj
+++ src/rrms/core.clj
@@ -68,11 +68,11 @@
               body]
           (rr/content-type
            (rr/response
-            (db/update-documents {:id id
+            (db/update-documents {:id  (parse-int id)
                                   :documentname dn
                                   :title title
                                   :employeename en
-                                  :date d
+                                  :date (java.sql.Date/valueOf d)
                                   :location lc}))
            content-type)))


Remove useless TODO comment.

Remove useless TODO comment.

--- src/promesa/impl/promise.cljc
+++ src/promesa/impl/promise.cljc
@@ -45,7 +45,6 @@
    (.config Promise #js {:cancellation true
                          :warnings false}))

-;; TODO: move to executors
 #?(:clj
    (def ^:redef +executor+
      (ForkJoinPool/commonPool)))


Improve the performance of matching offer to tasks

--- scheduler/src/cook/mesos/scheduler.clj
+++ scheduler/src/cook/mesos/scheduler.clj
@@ -371,10 +371,12 @@
   [schedule {{:keys [cpus mem]} :resources :as offer}]
   (log/debug "Matching offer " offer " to the schedule" schedule)
   (loop [[candidates & remaining-prefixes] (prefixes schedule)
+         resources-so-far {:mem 0 :cpus 0}
          prev []]
-    (let [required (util/sum-resources-of-jobs candidates)]
+    (let [required (merge-with + resources-so-far
+                               (select-keys [:mem :cpus] (util/job-ent->resources (last candidates))))]
       (if (and candidates (>= cpus (:cpus required)) (>= mem (:mem required)))
-        (recur remaining-prefixes candidates)
+        (recur remaining-prefixes required candidates)
         prev))))

 (meters/defmeter [cook-mesos scheduler scheduler-offer-declined])


fix add-projects bug (repos were not loading)

repos were not loading because we had some incorrect logic. We were
being too careful about how we load (too stict of conditionals). this
commit is basically "just load everything and each treatment can use
what it needs."

also added a TODO to change this logic when we launch top bar

--- src-cljs/frontend/controllers/navigation.cljs
+++ src-cljs/frontend/controllers/navigation.cljs
@@ -262,16 +262,12 @@
 (defmethod post-navigated-to! :add-projects
   [history-imp navigation-point _ previous-state current-state comms]
   (let [api-ch (:api comms)]
-    (when (and (feature/enabled? "top-bar-ui-v-1")
-               (not (get-in current-state state/add-projects-selected-org-path)))
-      (let [org (or (get-in current-state state/selected-org-path)
-                    (get-in current-state state/last-visited-org-path))]
-        (routes/org-centric-path {:current-org org
-                                  :nav-point navigation-point}))
-      ;; load orgs, collaborators, and repos
+    ;; TODO: after top-bar-ui-v-1 launched, only load repos we need and do not
+    ;; load orgs
+    ;; load orgs, collaborators, and repos
     (api/get-orgs api-ch :include-user? true)
     (load-repos current-state api-ch)
-    (set-page-title! "Add projects"))))
+    (set-page-title! "Add Projects")))

 (defmethod navigated-to :build-insights
   [history-imp navigation-point args state]


fixes #8657

fixes #8657

Signed-off-by: Andrey Shovkoplyas <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/ui/screens/wallet/send/views.cljs
+++ src/status_im/ui/screens/wallet/send/views.cljs
@@ -27,7 +27,8 @@
      [topbar/simple-toolbar (i18n/label :t/send-transaction)]
      [react/view components.styles/flex
       [wallet.components/network-info]
-      [react/scroll-view {:keyboard-should-persist-taps :always
+      [react/scroll-view {:keyboard-should-persist-taps :never
+                          :keyboard-dismiss-mode        :on-drag
                           :ref                          #(reset! scroll %)
                           :on-content-size-change       #(when (and scroll @scroll)
                                                            (.scrollToEnd @scroll))}


enhance cljs.analyzer/get-namespace to take environment as parameter

--- src/main/clojure/cljs/analyzer.cljc
+++ src/main/clojure/cljs/analyzer.cljc
@@ -406,12 +406,15 @@
            (::namespaces @env/*compiler*)
            default-namespaces)))))

-(defn get-namespace [key]
-  (let [ns (get-in @env/*compiler* [::namespaces key])]
-    (if-not (nil? ns)
-      ns
-      (when (= 'cljs.user key)
-        {:name 'cljs.user}))))
+(defn get-namespace
+  ([key]
+    (get-namespace env/*compiler* key))
+  ([cenv key]
+   (let [ns (get-in @cenv [::namespaces key])]
+     (if-not (nil? ns)
+       ns
+       (when (= 'cljs.user key)
+         {:name 'cljs.user})))))

 #?(:clj
    (defmacro no-warn [& body]


checks

checks

--- src/main/clojure/dojo/solutions.clj
+++ src/main/clojure/dojo/solutions.clj
@@ -23,6 +23,10 @@
 (def DRAWS (mapv #(if (= "D" (mget % (COL-NUMS "FTR"))) 1 0) (slices RESULTS)))
 (def AWINS (mapv #(if (= "A" (mget % (COL-NUMS "FTR"))) 1 0) (slices RESULTS)))

+;; check we have captured all games
+(esum (add HWINS AWINS DRAWS))
+;; => 380
+
 (def HOME-WINS (mapv esum (slices (mul HWINS HOME-GAMES))))
 (def AWAY-WINS (mapv esum (slices (mul AWINS AWAY-GAMES))))
 (def DRAW-RESULTS (mapv esum (slices (add (mul DRAWS AWAY-GAMES) (mul DRAWS HOME-GAMES)))))


Wrapping all curator exceptions in RuntimeExceptions.

--- storm-core/src/clj/backtype/storm/zookeeper.clj
+++ storm-core/src/clj/backtype/storm/zookeeper.clj
@@ -67,21 +67,25 @@

 (defn create-node
   ([^CuratorFramework zk ^String path ^bytes data mode]
-    (.. zk (create) (withMode (zk-create-modes mode)) (withACL ZooDefs$Ids/OPEN_ACL_UNSAFE) (forPath (normalize-path path) data)))
+    (try
+      (.. zk (create) (withMode (zk-create-modes mode)) (withACL ZooDefs$Ids/OPEN_ACL_UNSAFE) (forPath (normalize-path path) data))
+      (catch Exception e (throw (RuntimeException. e)))))
   ([^CuratorFramework zk ^String path ^bytes data]
     (create-node zk path data :persistent)))

 (defn exists-node? [^CuratorFramework zk ^String path watch?]
   ((complement nil?)
-    (if watch?
-       (.. zk (checkExists) (watched) (forPath (normalize-path path)))
-       (.. zk (checkExists) (forPath (normalize-path path))))))
+    (try
+      (if watch?
+         (.. zk (checkExists) (watched) (forPath (normalize-path path)))
+         (.. zk (checkExists) (forPath (normalize-path path))))
+      (catch Exception e (throw (RuntimeException. e))))))

 (defnk delete-node [^CuratorFramework zk ^String path :force false]
   (try-cause  (.. zk (delete) (forPath (normalize-path path)))
     (catch KeeperException$NoNodeException e
-      (when-not force (throw e))
-      )))
+      (when-not force (throw e)))
+    (catch Exception e (throw (RuntimeException. e)))))

 (defn mkdirs [^CuratorFramework zk ^String path]
   (let [path (normalize-path path)]
@@ -103,15 +107,20 @@
           (.. zk (getData) (forPath path))))
     (catch KeeperException$NoNodeException e
       ;; this is fine b/c we still have a watch from the successful exists call
-      nil ))))
+      nil )
+    (catch Exception e (throw (RuntimeException. e))))))

 (defn get-children [^CuratorFramework zk ^String path watch?]
-  (if watch?
-    (.. zk (getChildren) (watched) (forPath (normalize-path path)))
-    (.. zk (getChildren) (forPath (normalize-path path)))))
+  (try
+    (if watch?
+      (.. zk (getChildren) (watched) (forPath (normalize-path path)))
+      (.. zk (getChildren) (forPath (normalize-path path))))
+      (catch Exception e (throw (RuntimeException. e)))))

 (defn set-data [^CuratorFramework zk ^String path ^bytes data]
-  (.. zk (setData) (forPath (normalize-path path) data)))
+  (try
+    (.. zk (setData) (forPath (normalize-path path) data))
+    (catch Exception e (throw (RuntimeException. e)))))

 (defn exists [^CuratorFramework zk ^String path watch?]
   (exists-node? zk path watch?))


get modal text field elements (to import a selected MC)
and their values to submit for import to ajax-orch

address dmohs code concerns :
1) get-in usage , 2) ref with create-classs

react to PR 74 code review

address PR concerns

indenting concerns

address let usage concerns

move URl to proper location

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/method_config_importer.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/method_config_importer.cljs
@@ -2,12 +2,38 @@
   (:require
     [dmohs.react :as react]
     clojure.string
-    [org.broadinstitute.firecloud-ui.utils :as utils]
     [org.broadinstitute.firecloud-ui.common :as common]
     [org.broadinstitute.firecloud-ui.common.icons :as icons]
     [org.broadinstitute.firecloud-ui.common.style :as style]
     [org.broadinstitute.firecloud-ui.common.table :as table]
-    [org.broadinstitute.firecloud-ui.common.components :as comps]))
+    [org.broadinstitute.firecloud-ui.common.components :as comps]
+    [org.broadinstitute.firecloud-ui.utils :as utils]))
+
+
+(defn create-path [workspaceNamespace workspaceName]
+  (str "/" workspaceNamespace "/"  workspaceName  "/methodconfigs/copyFromMethodRepo"))
+
+
+(defn create-post-data
+  [selected-conf
+   selected-conf-dest-name
+   selected-conf-dest-ns
+   dest-workspace-name
+   dest-workspace-namespace]
+  (let [destination-map
+        {"name" selected-conf-dest-name
+        "namespace" selected-conf-dest-ns
+        "workspaceName"
+        {"name" dest-workspace-namespace
+        "namespace" dest-workspace-name}}
+        param-map {"methodRepoNamespace" (get-in selected-conf
+                                           ["methodStoreMethod" "methodNamespace"])
+                   "methodRepoName" (get-in selected-conf
+                                      ["methodStoreMethod" "methodName"])
+                   "methodRepoSnapshotId" (get-in selected-conf
+                                            ["methodStoreMethod" "methodVersion"])
+                   "destination" destination-map}]
+    param-map))

 (defn- create-mock-methodconfs-import []
@@ -16,14 +42,14 @@
       {:name (str "Configuration " (inc i))
        :namespace (rand-nth ["Broad" "nci" "public"])
        :rootEntityType "Task"
-       :workspaceName {:namespace (str "ws_ns_" (inc i))
-                       :name (str "ws_n_" (inc i))}
-       :methodStoreMethod {:methodNamespace (str "ms_ns_" (inc i))
-                           :methodName (str "ms_n_" (inc i))
-                           :methodVersion (str "ms_v_" (inc i))}
-       :methodStoreConfig {:methodConfigNamespace (str "msc_ns_" (inc i))
-                           :methodConfigName (str "msc_n_" (inc i))
-                           :methodConfigVersion (str "msc_v_" (inc i))}
+       :workspaceName {:namespace (str "ws-ns-" (inc i))
+                       :name (str "ws-n-" (inc i))}
+       :methodStoreMethod {:methodNamespace (str "ms-ns-" (inc i))
+                           :methodName (str "ms-n-" (inc i))
+                           :methodVersion (str "ms-v-" (inc i))}
+       :methodStoreConfig {:methodConfigNamespace (str "msc-ns-" (inc i))
+                           :methodConfigName (str "msc-n-" (inc i))
+                           :methodConfigVersion (str "msc-v-" (inc i))}
        :inputs {"Input 1" "[some value]"
                 "Input 2" "[some value]"}
        :outputs {"Output 1" "[some value]"
@@ -32,37 +58,80 @@
     (range (rand-int 50))))

+(defn render-import-modal [state props refs]
+  [comps/ModalDialog
+   {:width 600
+    :content (react/create-element
+               [:div {}
+                [:div {:style {:backgroundColor "#fff"
+                               :borderBottom (str "1px solid " (:line-gray style/colors))
+                               :padding "20px 48px 18px"
+                               :fontSize "137%" :fontWeight 400 :lineHeight 1}}
+                 "Import a Method Configuration"]
+                [:div {:style {:padding "22px 48px 40px"
+                               :backgroundColor (:background-gray style/colors)}}
+                 "Destination Name : "
+                 (style/create-text-field
+                   {:defaultValue (get-in @state [:selected-conf "name"])
+                    :ref "destinationName"})
+                 [:br]
+                 "Destination Namespace : "
+                 (style/create-text-field
+                   {:defaultValue (get-in @state [:selected-conf "namespace"])
+                    :ref "destinationNamespace"})
+                 [:br]
+                 [comps/Button
+                  {:title-text "Import configuration"
+                   :icon :plus
+                   :onClick
+                   (fn []
+                     (let [workspace (:workspace props)
+                           dest-name-value (.-value
+                                             (.getDOMNode (@refs "destinationName")))
+                           dest-namespace-value (.-value (.getDOMNode
+                                                           (@refs "destinationNamespace")))
+                           dest-workspace-name (get workspace "name")
+                           dest-workspace-namespace (get workspace "namespace")
+                           methodRepoQuery (create-post-data
+                                             (:selected-conf @state)
+                                             dest-name-value
+                                             dest-namespace-value
+                                             dest-workspace-name
+                                             dest-workspace-namespace)]
+                       (swap! state assoc :show-import-mc-modal? false)
+                       (utils/ajax-orch
+                         (create-path
+                           dest-workspace-namespace
+                           dest-workspace-name)
+                         {:method :post
+                          :data (utils/->json-string methodRepoQuery)
+                          :canned-response {:status 201
+                                            :delay-ms (rand-int 2000)}
+                          :on-done (fn [{:keys [success? xhr]}]
+                                     (if success?
+                                       (utils/rlog  (str "success in import! "
+                                                      "Here, perhaps trigger re-render "
+                                                      "of the MCs in the current "
+                                                      "workspace?"))
+                                       (let [returned-err-msg
+                                             {:message (.-statusText xhr)}]
+                                         (js/alert
+                                           (str "Error in Method Configuration Import : "
+                                             returned-err-msg)))))})))}]
+                 [comps/Button
+                  {:title-text "cancel import"
+                   :icon :x
+                   :onClick (fn []
+                              (swap! state assoc :show-import-mc-modal? false))}]]])
+    :show-when true}])
+
+
 (react/defc ImportWorkspaceMethodsConfigurationsList
   {:render
-   (fn [{:keys [state props]}]
+   (fn [{:keys [state props refs]}]
      [:div {}
-      [comps/ModalDialog
-       {:width 600
-        :content [:div {}
-                  [:div {:style {:backgroundColor "#fff"
-                                 :borderBottom (str "1px solid " (:line-gray style/colors))
-                                 :padding "20px 48px 18px"
-                                 :fontSize "137%" :fontWeight 400 :lineHeight 1}}
-                   "Import a Method Configuration"]
-                  [:div {:style {:padding "22px 48px 40px" :backgroundColor (:background-gray style/colors)}}
-                   "Destination Name : "
-                   (style/create-text-field {:id "dest_name_id" :style {:ref "destinationName"}})
-                   [:br]
-                   "Destination Namespace : "
-                   (style/create-text-field {:id "dest_namespace_id" :style {:ref "destinationNamespace"}})
-                   [:br]
-                   [comps/Button
-                    {:title-text "Import configuration"
-                     :icon :plus
-                     :onClick (fn []
-                                (utils/rlog "this is where an AJAX call must be made!")
-                                (swap! state assoc :show-import-mc-modal? false))}]
-                   [comps/Button
-                    {:title-text "cancel import"
-                     :icon :x
-                     :onClick (fn []
-                                (swap! state assoc :show-import-mc-modal? false))}]]]
-        :show-when (:show-import-mc-modal? @state)}]
+      (when (:show-import-mc-modal? @state)
+        (render-import-modal state props refs))
       (cond
         (:loaded-import-confs? @state)
         (if (zero? (count (:method-confs @state)))
@@ -74,19 +143,9 @@
                          [:a
                           {:onClick
                            (fn []
-                             (swap! state assoc
-                               :selected-conf conf
-                               :show-import-mc-modal? true)
-                             (let [dest_name_elem (.getElementById js/document (name "dest_name_id"))
-                                   method_config_prepopname ((:selected-conf @state) "name")
-                                   dest_namespace_elem (.getElementById js/document
-                                                         (name "dest_namespace_id"))
-                                   method_config_ns_prepopname ((:selected-conf @state) "namespace")]
-                               (set! (.-value dest_name_elem) method_config_prepopname)
-                               (set! (.-value dest_namespace_elem) method_config_ns_prepopname)))
+                             (swap! state assoc :selected-conf conf :show-import-mc-modal? true))
                            :href "javascript:;"
-                           :style {:color
-                                   (:button-blue style/colors) :textDecoration "none"}}
+                           :style {:color (:button-blue style/colors) :textDecoration "none"}}
                           (conf "name")])}
                       {:header "Namespace" :starting-width 200}
                       {:header "Type" :starting-width 100}
@@ -164,6 +223,7 @@
         [:div {:style {:backgroundColor "#fff"
                        :borderBottom (str "1px solid " (:line-gray style/colors))
                        :padding "20px 48px 18px"}}
-         [:div {:style {:fontSize 24 :align "center" :textAlign "center" :paddingBottom "0.5em"}} "Select A Method Configuration For Import"]
+         [:div {:style {:fontSize 24 :align "center" :textAlign "center" :paddingBottom "0.5em"}}
+          "Select A Method Configuration For Import"]
          [ImportWorkspaceMethodsConfigurationsList {:workspace workspace}]
          [:div {:style {:paddingTop "0.5em"}}]]]])))