Reviewed the file for more errors

Reviewed the file for more errors

--- src/status_im/translations/de.cljs
+++ src/status_im/translations/de.cljs
@@ -37,7 +37,7 @@

    ;messages
    :status-sending                        "Absenden"
-   :status-pending                        "Anhängig"
+   :status-pending                        "In Bearbeitung"
    :status-sent                           "Verschickt"
    :status-seen-by-everyone               "Von allen gesehen"
    :status-seen                           "Gesehen"
@@ -68,30 +68,30 @@
    :phone-number                          "Telefonnumer"
    :email                                 "E-Mail"
    :profile-no-status                     "Kein Status"
-   :add-to-contacts                       "Zu Kontakten hinzufügen"
+   :add-to-contacts                       "Zu Kontakte hinzufügen"
    :error-incorrect-name                  "Bitte wählen Sie einen anderen Namen"
    :error-incorrect-email                 "Inkorrekte E-Mail"

    ;;make_photo
    :image-source-title                    "Profilfoto"
    :image-source-make-photo               "Fotografieren"
-   :image-source-gallery                  "Aus Galarie auswählen"
+   :image-source-gallery                  "Aus Galerie auswählen"
    :image-source-cancel                   "Abbrechen"

    ;sign-up
-   :contacts-syncronized                  "Ihre Kontakte wurden synchronisiert"
-   :confirmation-code                     (str "Danke! Wir haben Ihnen eine Textnachricht mit einer Bestätigungscode"
-                                               "geschickt. Bitte geben Sie den Code ein, damit wir Ihre Telefonnummer verifizieren können")
-   :incorrect-code                        (str "Tut uns leid, der Code war nicht korrekt, bitte erneut eingeben")
-   :generate-passphrase                   (str "Ich werde eine Passphrase für Sie generieren, damit Sie Ihren"
-                                               "Zugriff wiederherstellen oder sich von einem anderen Gerät aus einloggen können")
-   :phew-here-is-your-passphrase          "*Puh* das war schwer, hier ist Ihr Passphrase, *bitte aufschreiben und sicher aufbewahren!*Sie benötigen dies, um Ihren Account wiederherzustellen."
-   :here-is-your-passphrase               "Hier ist Ihr Passphrase, *bitte aufschreiben und sicher verwahren!*Sie benötigen dies, um Ihren Account wiederherzustellen."
-   :written-down                          "Stellen Sie sicher, dass Sie es sicher aufgeschrieben haben"
-   :phone-number-required                 "Tippen Sie hier, um Ihre Telefonnummer einzugeben & ich werde Ihre Freunde finden"
+   :contacts-syncronized                  "Ihre Kontakte wurden synchronisiert."
+   :confirmation-code                     (str "Danke! Wir haben Ihnen eine Textnachricht mit einem Bestätigungscode "
+                                               "geschickt. Bitte geben Sie den Code ein, damit wir Ihre Telefonnummer verifizieren können.")
+   :incorrect-code                        (str "Tut uns leid, der Code war nicht korrekt, bitte erneut eingeben.")
+   :generate-passphrase                   (str "Ich werde eine Passphrase für Sie generieren, damit Sie Ihren "
+                                               "Zugriff wiederherstellen oder sich von einem anderen Gerät aus einloggen können.")
+   :phew-here-is-your-passphrase          "*Puh* das war schwer, hier ist Ihr Passphrase, *bitte aufschreiben und sicher aufbewahren! *Sie benötigen diese, um Ihren Account wiederherzustellen."
+   :here-is-your-passphrase               "Hier ist Ihr Passphrase, *bitte aufschreiben und sicher verwahren!* Sie benötigen diese, um Ihren Account wiederherzustellen."
+   :written-down                          "Stellen Sie sicher, dass Sie sie sicher aufgeschrieben haben."
+   :phone-number-required                 "Tippen Sie hier, um Ihre Telefonnummer einzugeben & ich werde Ihre Freunde finden."
    :intro-status                          "Chatten Sie mit mir, um Ihren Account einzurichten und Ihre Einstellungen zu ändern!"
-   :intro-message1                        "Willkommen beim Status\nTippen Sie auf diese nachricht, um Ihr Passwort einzurichten und loszulegen!"
-   :account-generation-message            "Eine Sekunde, ich muss wahnsinnig schwere Mathematik machen, um Ihr Konto zu generieren!"
+   :intro-message1                        "Willkommen beim Status.\nTippen Sie auf diese Nachricht, um Ihr Passwort einzurichten und loszulegen!"
+   :account-generation-message            "Eine Sekunde, ich muss wahnsinnig schwierige Berechnungen durchführen, um Ihr Konto zu generieren!"

    ;chats
    :chats                                 "Chats"
@@ -99,7 +99,7 @@
    :new-group-chat                        "Neuer Gruppenchat"

    ;discover
-   :discover                             "Entdeckung"
+   :discover                             "Entdecken"
    :none                                  "Nichts"
    :search-tags                           "Geben Sie Ihre Suchbegriffe hier ein"
    :popular-tags                          "Beliebte Begriffe"
@@ -117,7 +117,7 @@
    :contacts-group-people                 "Leute"
    :contacts-group-new-chat               "Neuen Chat beginnen"
    :no-contacts                           "Noch keine Kontakte"
-   :show-qr                               "QR anzeigen"
+   :show-qr                               "QR-Code anzeigen"

    ;group-settings
    :remove                                "Entfernen"
@@ -175,7 +175,7 @@
    :import-qr                             "Import"
    :scan-qr                               "QR-Code scannen"
    :name                                  "Name"
-   :whisper-identity                      "Identität Flüstern"
+   :whisper-identity                      "Identität flüstern"
    :address-explication                   "Vielleicht sollte hier ein Text stehen, der erklärt, was eine Adresse ist und wo man danach sucht"
    :enter-valid-address                   "Bitte geben Sie eine gültige Adresse ein oder scannen Sie einen QR-Code"
    :contact-already-added                 "Dieser Kontakt wurde bereits hinzugefügt"
@@ -191,8 +191,8 @@
    :wrong-password                        "Falsches Passwort"

    ;recover
-   :recover-from-passphrase               "Via Passphrase wiederherstellen"
-   :recover-explain                       "Bitte geben Sie den Passphrase für Ihr Passwort ein, um den Zugriff wiederherzustellen"
+   :recover-from-passphrase               "Mittels Passphrase wiederherstellen"
+   :recover-explain                       "Bitte geben Sie die Passphrase für Ihr Passwort ein, um den Zugriff wiederherzustellen"
    :passphrase                            "Passphrase"
    :recover                               "Wiederherstellen"
    :enter-valid-passphrase                "Bitte geben Sie einen Passphrase ein"
@@ -216,7 +216,7 @@
                                            :other "{{count}} Transaktionen bestätigen"
                                            :zero  "Keine Transaktionen"}
    :status                                "Status"
-   :pending-confirmation                  "Bestätigung ausstehend"
+   :pending-confirmation                  "Bestätigung in Bearbeitung"
    :recipient                             "Empfänger"
    :one-more-item                         "Noch ein Objekt"
    :fee                                   "Gebühr"


Fix french translation

Fix french translation

"Address" in english is "Adresse" in French + Everything in the page is in Zero infinitive exect this "Entrez Addresse", which sounded weird.

--- src/status_im/translations/fr.cljs
+++ src/status_im/translations/fr.cljs
@@ -175,7 +175,7 @@
    :choose-from-contacts                  "Ajouter depuis mes contacts"
    :no-contacts                           "Pas encore de contacts"
    :show-qr                               "Afficher le QR"
-   :enter-address                         "Entrez Addresse"
+   :enter-address                         "Entrer Adresse"
    :more                                  "plus"

    ;group-settings


Proper behaviour of the call get_job

Proper behaviour of the call get_job

--- src/emender_jenkins/rest_api.clj
+++ src/emender_jenkins/rest_api.clj
@@ -34,7 +34,8 @@
     :create-job            "create_job"
     :delete-job            "delete_job"
     :update-job            "update_job"
-    :get-job               "get_job"})
+    :get-job               "get_job"
+    :get-job-results       "get_job_results"})

 ; HTTP codes used by several REST API responses
 (def http-codes {
@@ -182,8 +183,8 @@
                               job-name)
                     (reload-job-list request)
                     (send-response request))
-                (send-job-does-not-exist-response request job-name :start-job))
-            (send-job-not-specified-response request :start-job))))
+                (send-job-does-not-exist-response request job-name command))
+            (send-job-not-specified-response request command))))

 (defn start-job
     [request]
@@ -274,11 +275,13 @@
     [request uri]
     (let [job-name (uri->job-name uri "/api/get_job/")]
         (if job-name
-            (let [job-metadata (results/find-job-with-name job-name)]
-                 (if job-metadata
-                     (send-response job-metadata request)
-                     (-> (create-error-response job-name :get-job "Test results does not exist")
-                         (send-error-response request :not-found))))
+            (if (results/job-exists? job-name)
+                (let [job-metadata (results/find-job-with-name job-name)]
+                     (if job-metadata
+                         (send-response job-metadata request)
+                         (-> (create-error-response job-name (get commands :get-job) "Test results does not exist")
+                             (send-error-response request :not-found))))
+                (send-job-does-not-exist-response request job-name :get-job))
             (send-job-not-specified-response request :get-job))))

 (defn get-jobs


Fix default port parsing.

Fix default port parsing.

--- src/cavm/core.clj
+++ src/cavm/core.clj
@@ -116,7 +116,7 @@

 (def ^:private argspec
   [[nil "--no-serve" "Don't start web server" :id :serve :parse-fn not :default true]
-   ["-p" "--port PORT" "Server port to listen on" :default 7222]
+   ["-p" "--port PORT" "Server port to listen on" :default 7222 :parse-fn #(Integer/parseInt %)]
    ["-l" "--load" "Load files into running server"]
    [nil "--no-auto" "Don't auto-load files" :id :auto :parse-fn not :default true]
    ["-h" "--help" "Show help"]
@@ -134,7 +134,7 @@
 (defn -main [& args]
   (let [{:keys [options arguments summary errors]} (parse-opts args argspec)
         docroot (:root options)
-        port (Integer/parseInt (:port options))
+        port (:port options)
         tmp (:tmp options)]
     (if errors
       (binding [*out* *err*]


Add kilo calculator.

Add kilo calculator.

--- src/hello_re_natal/ios/core.cljs
+++ src/hello_re_natal/ios/core.cljs
@@ -2,8 +2,10 @@
   (:require [reagent.core :as r :refer [atom]]
             [re-frame.core :refer [subscribe dispatch dispatch-sync]]
             [hello-re-natal.events]
-            [hello-re-natal.subs]))
+            [hello-re-natal.subs]
+            [cljs.reader :as reader]))

+(def read-string reader/read-string)
 (def ReactNative (js/require "react-native"))

 (def app-registry (.-AppRegistry ReactNative))
@@ -19,7 +21,12 @@
 (def logo-img (js/require "./images/cljs.png"))

 (defn alert [title]
-      (.alert (.-Alert ReactNative) title))
+  (.alert (.-Alert ReactNative) title))
+
+(def pounds-per-kilogram 0.45359237)
+(defn to-pounds
+  [weight]
+  (* weight pounds-per-kilogram))

 (defn app-root []
   (let [greeting (subscribe [:get-greeting])
@@ -36,15 +43,15 @@
                        :width 80
                        :height 80
                        :margin-bottom 30}}]
-          [text-input {:style {:height 40}
-                       :on-change-text #(do
-                                         (reset! state %)
-                                         (r/flush))
-                       :value @state}]
+       [text-input {:style {:height 40}
+                    :on-change-text #(do
+                                       (reset! state %)
+                                       (r/flush))
+                    :value @state}]
        [touchable-highlight {:style {:background-color "#999"
                                      :padding 10
                                      :border-radius 5}
-                             :on-press #(alert "hello...")}
+                             :on-press #(alert (str (to-pounds 135)))}
         [text {:style {:color "white" :text-align "center" :font-weight "bold"}} "press me"]]
        [view {:style {:background-color "#000"
                       `:height 80}}]
@@ -52,8 +59,12 @@
                       `:height 80}}]
        [text {:style {:color "black"
                       :text-align "center"
-                      :font-weight "bold"}} "DOT DOT DOT"]])))
+                      :font-weight "bold"}}
+                      (if (number? (read-string @state))
+                          (str (to-pounds @state))
+                          (str "Not a number" @state (rand 10))
+                          )]])))

 (defn init []
-      (dispatch-sync [:initialize-db])
-      (.registerComponent app-registry "HelloReNatal" #(r/reactify-component app-root)))
+  (dispatch-sync [:initialize-db])
+  (.registerComponent app-registry "HelloReNatal" #(r/reactify-component app-root)))


Make page layout a bit more basic.

Make page layout a bit more basic.

--- src/incise/layouts/impl/page.clj
+++ src/incise/layouts/impl/page.clj
@@ -1,63 +1,44 @@
 (ns incise.layouts.impl.page
-  (:require [incise.layouts.core :refer [register]]
-            [incise.parsers.core]
+  (:require (incise.layouts [core :refer [register]]
+                            [html :refer [deflayout defpartial]])
             [dieter.core :refer [link-to-asset]]
             (hiccup [def :refer :all]
                     [page :refer :all]
                     [element :refer :all]
                     [core :refer :all])))

-(defhtml header
-  [{:keys [site-title] :as site-options} parse]
+(defpartial header
+  "A very basic header partial."
+  [{:keys [site-title]} _]
   [:header
    [:h1#site-title (link-to "/" site-title)]])

-(defmulti contact (fn [x & _] x))
-(defmethod contact :default
-  [end-point handle]
-  (link-to (str "https://" (name end-point) ".com/" handle)
-           (str \@ handle)))
-(defmethod contact :email
-  [_ email]
-  (mail-to email))
+(defpartial footer
+  "A very basic footer crediting this project."
+  [_ {:keys [contacts author]}]
+  [:footer
+   [:p
+    "This website is "
+    (link-to "https://github.com/RyanMcG/incise" "incise") "d."]])

-(defhtml contact-spec [[end-point handle]]
-  [:div.contact
-   [:span.end-point end-point]
-   (contact end-point handle)])
+(defn stylesheets []
+  [(link-to-asset "stylesheets/app.css.dieter")])

-(defhtml footer
-  [{:keys [contacts author] :as site-options} parse]
-  [:hr]
-  [:footer
-   [:div.row
-    [:div#cc.col-md-8
-     (link-to {:rel "license"} "http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"
-              (image "http://i.creativecommons.org/l/by-sa/3.0/88x31.png" "Creative Commons License"))
-     [:p "Content on this website is licensed under a "
-      (link-to {:rel "license"} "http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"
-               "Creative Commons Attribution-ShareAlike 3.0 Unported License")
-      " by " author "."]]
-    [:div#contacts.col-md-4 (map contact-spec contacts)]]
-    [:p "This website is " (link-to "https://github.com/RyanMcG/incise" "incise") "d."]])
+(defn javascripts []
+   [(link-to-asset "javascripts/app.js.dieter")])

-(defn page
+(deflayout page
   "The default page/post layout."
-  [{:keys [site-title] :as site-options}
-   ^incise.parsers.core.Parse {:keys [title content] :as parse}]
-  (html5
-    [:head
-     [:title (str site-title (when title (str " - " title)))]
-     [:meta {:name "viewport"
-             :content "width=device-width, initial-scale=1.0"}]
-     (include-css (link-to-asset "stylesheets/app.css.dieter"))]
-    [:body#page
-     [:div.container
-      (header site-options parse)
-      [:div#content content]
-      (footer site-options parse)]
-     (include-js "http://code.jquery.com/jquery-2.0.3.min.js"
-                 (link-to-asset "javascripts/app.js.dieter"))]))
+  [:head
+   [:title (str site-title (when title (str " - " title)))]
+   [:meta {:name "viewport"
+           :content "width=device-width, initial-scale=1.0"}]
+   (apply include-css (stylesheets))]
+  [:body#page
+   [:div.container
+    (header)
+    [:div#content content]
+    (footer)]
+   (apply include-js (javascripts))])

-(register :page page)
-(register :post page)
+(register [:post :page] page)


Added lookup to PersistenHashMap

Added lookup to PersistenHashMap

--- src/main/cljs/fast_map/core.cljs
+++ src/main/cljs/fast_map/core.cljs
@@ -203,6 +203,15 @@
   IHash
   (-hash [coll] (caching-hash coll hash-unordered-coll __hash))

+  ILookup
+  (-lookup [coll k]
+    (-lookup coll k nil))
+
+  (-lookup [coll k not-found]
+    (if (nil? root)
+      not-found (.inode-lookup root 0 (hash k) k not-found)))
+
+
   ISeqable
   (-seq [coll]
     (when (pos? cnt)


Allow arbitrary namespaces on rule separator symbol.

--- src/main/clojure/clara/rules.clj
+++ src/main/clojure/clara/rules.clj
@@ -126,10 +126,14 @@
     `(apply mk-session* ~(vec sources))
     `(mk-session* (ns-name *ns*))))

+(defn ^:private separator?
+  "True iff `x` is a rule body separator symbol."
+  [x] (and (symbol? x) (= "=>" (name x))))
+
 (defn- parse-rule-body [[head & more]]
   (cond
    ;; Detect the separator for the right-hand side.
-   (= '=> head) {:lhs (list) :rhs (first more)}
+   (separator? head) {:lhs (list) :rhs (first more)}

    ;; Handle a normal left-hand side element.
    (sequential? head) (update-in


Add improve implementation for transitive-closure

Signed-off-by: Daniel Borchmann <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@algebra20.de>

--- src/main/clojure/conexp/base.clj
+++ src/main/clojure/conexp/base.clj
@@ -913,18 +913,29 @@

 (defn transitive-closure
   "Computes transitive closure of a given set of pairs."
+  ;; Inspired by the corresponding code from the graph library by
+  ;; Jeffrey Straszheim
   [pairs]
-  (let [pairs  (set pairs),
-        runner (fn runner [new old]
-                 (if (= new old)
-                   new
-                   (recur (union new
-                                 (set-of [x y]
-                                         [[x z_1] (difference new old)
-                                          [z_2 y] pairs
-                                          :when (= z_1 z_2)]))
-                          new)))]
-    (runner pairs #{})))
+  (let [pairs-as-map (loop [pairs pairs
+                            map   {}]
+                       (if (not (seq pairs))
+                         map
+                         (let [[x y] (first pairs)]
+                           (recur (rest pairs)
+                                  (update map x conj y)))))
+        runner (fn runner [to-be-visited already-visited]
+                 (lazy-seq
+                  (let [not-yet-visited (seq (drop-while already-visited
+                                                         to-be-visited))
+                        unseen-node     (first not-yet-visited)]
+                    (when unseen-node
+                      (cons unseen-node
+                            (runner (concat (get pairs-as-map unseen-node)
+                                            (rest not-yet-visited))
+                                    (conj already-visited
+                                          unseen-node)))))))]
+    (set-of [x y] [x (keys pairs-as-map)
+                   y (runner (get pairs-as-map x) #{})])))

 (defn reflexive-transitive-closure
   "Computes the reflexive, transitive closure of a given set of pairs


small perf improvment for controls-handler

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -144,17 +144,17 @@
             (browser-settings/restore-browser-settings cust)))))

 (defn controls-handler
-  [value state browser-state]
-  (when-not (keyword-identical? :mouse-moved (first value))
+  [[msg data :as value] state browser-state]
+  (when-not (keyword-identical? :mouse-moved msg)
     (mlog "Controls Verbose: " value))
   (utils/swallow-errors
    (binding [frontend.async/*uuid* (:uuid (meta value))]
      (let [previous-state @state
            ;; TODO: control-event probably shouldn't get browser-state
-           current-state (swap! state (partial controls-con/control-event browser-state (first value) (second value)))]
-       (controls-con/post-control-event! browser-state (first value) (second value) previous-state current-state)
+           current-state (swap! state (partial controls-con/control-event browser-state msg data))]
+       (controls-con/post-control-event! browser-state msg data previous-state current-state)
        ;; TODO: enable a way to set the event separate from the control event
-       (analytics/track-control (first value) current-state)))))
+       (analytics/track-control msg current-state)))))

 (defn nav-handler
   [value state history]


Currently broken with referenceerror _ in on change handler

--- src-cljs/tea_time/core.cljs
+++ src-cljs/tea_time/core.cljs
@@ -65,7 +65,7 @@

 ;; (def teas-list (reagent/atom nil))
-(def new-tea (reagent/atom nil))
+;; (def new-tea (reagent/atom nil))
 (def edit-tea-id (reagent/atom nil))
 (def edit-tea (reagent/atom nil))
 (def edit-tea-snap (reagent/atom nil))
@@ -92,15 +92,29 @@
                :keywords? true})
     app-db))

+(re-frame/register-handler
+  :initialize-db
+  (fn [_ _]
+    {:teas-list []
+     :new-tea "BLAH"}))
+
+(defn new-tea-entered
+  [app-state [_ new-tea-input]]
+  (assoc-in app-state [:new-tea] new-tea-input))
+
+(re-frame/register-handler
+  :new-tea-entry
+  new-tea-entered)
+
 (re-frame/register-sub
   :teas
   (fn [db]
     (reaction (:teas-list @db))))

-(re-frame/register-handler
-  :initialize-db
-  (fn [_ _]
-    {:teas-list []}))
+(re-frame/register-sub
+  :new-tea
+  (fn [db]
+    (reaction (:new-tea @db))))

 (defonce app-db (reagent/atom {}))
@@ -130,7 +144,7 @@
   [tea-name]
   ;; (println "post-to-teas-db hit, params: " tea-name)
   (ajax/POST "/api/newtea" {:params {:new-tea tea-name} :format :json}
-             :handler (fn [] (println "New Tea Posted") (get-teas) (reset! new-tea nil))
+             :handler (fn [] (println "New Tea Posted") (get-teas))
              :error-handler (fn [err] (println "New Tea Failed To Post" err))))

@@ -175,18 +189,24 @@
                     .-target
                     .-value)))

-(def sync-new-tea (partial sync-atom-to-event new-tea))
+;; (def sync-new-tea (partial sync-atom-to-event new-tea))
 (def sync-edit-tea (partial sync-atom-to-event edit-tea))
+
+(defn value-event
+  [event]
+  (-> event .-target -.value))

 (defn tea-adder
   "A component for the tea-adder form"
   []
-  (fn []
-    [:div.row
-     [:div.col-md-12
-      [:form {:post "/api/newtea"}
-       [:input.form-control {:field :text :id :in-tea :placeholder "Name of New Tea" :value @new-tea :on-change sync-new-tea }
-        [:input.btn.btn-primary {:type "submit" :value (str "Add " @new-tea) :on-click #(post-to-teas-db @new-tea)}]]]]]))
+  (let [tmp-new-tea (re-frame/subscribe [:new-tea])]
+    (println @tmp-new-tea)
+    (fn []
+      [:div.row
+        [:div.col-md-12
+          [:form {:post "/api/newtea"}
+            [:input.form-control {:field :text :id :in-tea :placeholder "Name of New Tea" :value @tmp-new-tea :on-change #(re-frame/dispatch [:new-tea-entry (value-event %)])}]
+            [:input.btn.btn-primary {:type "submit" :value (str "Add " @tmp-new-tea) :on-click #(post-to-teas-db @tmp-new-tea)}]]]])))

@@ -195,8 +215,7 @@
   []
   (fn []
     [:div.form-group
-     [:div.row
-      [:div.col-md-12
+     [:div.row [:div.col-md-12
        [:button.btn.btn-info {:on-click (fn [_] (swap! show-edit not))} "Show/Hide edit form"]
        [:div.p (str "Preview: " (or @edit-tea-snap "*no tea selected*") " -> " (or @edit-tea "*no tea selected*"))]
        [:div.p]


remove some unused model methods

remove some unused model methods

--- cljs/src/main/plastic/cogs/editor/model.cljs
+++ cljs/src/main/plastic/cogs/editor/model.cljs
@@ -234,33 +234,8 @@
 (defn remove-left-siblink [editor node-id]
   (transform-parse-tree editor (parse-tree-transformer (partial remove-left-siblink-of-loc node-id))))

-(defn get-render-infos [editor]
-  (get-in editor [:render-state :forms]))
-
 (defn get-render-order [editor]
   (get-in editor [:render-state :order]))
-
-(defn set-render-infos [editor render-infos]
-  (assoc-in editor [:render-state :forms] render-infos))
-
-(defn get-render-info-by-id [editor form-id]
-  (get (get-render-infos editor) form-id))
-
-(defn get-focused-render-info [editor]
-  {:post [%]}
-  (get-render-info-by-id editor (get-focused-form-id editor)))
-
-(defn set-focused-render-info [editor render-info]
-  {:post [%]}
-  (assoc-in editor [:render-state :forms (get-focused-form-id editor)] render-info))
-
-(defn get-input-text [editor]
-  (let [text (get editor :text)]
-    (assert text)
-    text))
-
-(defn get-output-text [editor]
-  (node/string (get-parse-tree editor)))

 (defn can-edit-node? [editor node-id]
   (let [node-loc (find-node-loc editor node-id)]
@@ -307,13 +282,6 @@
     (for [[editor-id editor] editors]
       (if (selector-matches-editor? editor-id id-or-ids)
         (f editor)))))
-
-(defn make-render-tree-zipper [root]
-  (z/zipper
-    (fn [] true)
-    #(seq (:children %))
-    (fn [node children] (assoc node :children children))
-    root))

 (defn get-analysis-for-form [editor form-id]
   (get-in editor [:analysis form-id]))


[#148] Add methods for :clojerl.LazySeq

[#148] Add methods for :clojerl.LazySeq

--- priv/clojure/core_print.clj
+++ priv/clojure/core_print.clj
@@ -128,9 +128,14 @@
   (print-meta o w)
   (print-sequential "(" pr-on " " ")" o w))

+(defmethod print-method :clojerl.LazySeq [o, ^Writer w]
+  (print-meta o w)
+  (print-sequential "(" pr-on " " ")" o w))
+
 (defmethod print-dup :clojerl.List [o w] (print-method o w))
 (defmethod print-dup :clojerl.erlang.List [o w] (print-method o w))
 (defmethod print-dup :clojerl.Cons [o w] (print-method o w))
+(defmethod print-dup :clojerl.LazySeq [o w] (print-method o w))

 (def ^{:tag String
        :doc "Returns escape string for char or nil if none"


user - should validate invalid user to falsey

--- test/taggie_server/models/user_test.clj
+++ test/taggie_server/models/user_test.clj
@@ -24,4 +24,7 @@
 (fact "should validate valid user truthy"
     (user/is-valid new-user) => truthy)

+(fact "should validate invalid user falsey"
+    (user/is-valid (dissoc new-user :email)) => falsey)
+
 )


(maint) Rework dotestseq macro to be more useful

The original version of the dotestseq macro from puppetdb didn't
show the values of the bindings per iteration in the test name,
only the names of them.

    Testing case (version)
    Testing case (version)
    Testing case (sender-version receiver-version)
    Testing case (sender-version receiver-version)

This rework from Michal Růžička enhances this so we get better annotated
test names like so:

    Testing case: version: v1.0
    Testing case: version: vNext
    Testing case: sender-version: v1.0, receiver-version: v1.0
    Testing case: sender-version: v1.0, receiver-version: vNext

--- test/utils/puppetlabs/pcp/testutils.clj
+++ test/utils/puppetlabs/pcp/testutils.clj
@@ -6,5 +6,10 @@
     `(do ~@body)
     (let [case-versions (remove keyword? (take-nth 2 bindings))]
       `(doseq ~bindings
-         (testing (str "Testing case " '~case-versions)
+         (testing (str "Testing case: " (clojure.string/join
+                                         ", "
+                                         (map #(clojure.string/join ": " %)
+                                              (partition
+                                               2
+                                               (interleave '~case-versions (list ~@case-versions))))))
            ~@body)))))


Task/batch lifecycles are now started in the correct order, however `:batch-after` is not called after the last batch goes through #188

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -467,11 +467,11 @@
                            :onyx.core/state (atom {:timeout-pool r-seq})}

             ex-f (fn [e] (handle-exception e restart-ch outbox-ch job-id))
+
+            _ (while (and (first (alts!! [kill-ch task-kill-ch] :default true))
+                          (not (munge-start-lifecycle pipeline-data)))
+                (Thread/sleep (or (:onyx.peer/sequential-back-off opts) 2000)))
             pipeline-data (merge pipeline-data ((:onyx.core/compiled-before-task-fn pipeline-data) pipeline-data))]
-
-        (while (and (first (alts!! [kill-ch task-kill-ch] :default true))
-                    (not (munge-start-lifecycle pipeline-data)))
-          (Thread/sleep (or (:onyx.peer/sequential-back-off opts) 2000)))

         (>!! outbox-ch (entry/create-log-entry :signal-ready {:id id}))


Make segments around 100 bytes each.

Make segments around 100 bytes each.

--- src/onyx/plugin/bench_plugin.clj
+++ src/onyx/plugin/bench_plugin.clj
@@ -3,13 +3,18 @@
             [clojure.data.fressian :as fressian]
             [onyx.peer.pipeline-extensions :as p-ext]))

+(def hundred-bytes
+  (into-array Byte/TYPE (range 100)))
+
 (defmethod p-ext/read-batch :generator
   [{:keys [onyx.core/task-map] :as event}]
   (let [batch-size (:onyx/batch-size task-map)]
-    {:onyx.core/batch (map (fn [i] {:id (java.util.UUID/randomUUID)
-                                    :input :generator
-                                    :message {:n i}})
-                           (range batch-size))}))
+    {:onyx.core/batch (doall (map (fn [i] {:id (java.util.UUID/randomUUID)
+                                           :input :generator
+                                           :message {:n i
+                                                     ;:data hundred-bytes
+                                                     }})
+                                  (range batch-size)))}))

 (defmethod p-ext/ack-message :generator
   [{:keys [core.async/pending-messages]} message-id]


Don't need to print that ever

Don't need to print that ever

--- src/oxcart/passes/tree_shake.clj
+++ src/oxcart/passes/tree_shake.clj
@@ -99,5 +99,4 @@

         ;; The emit set is now trivially
         emit-set (get symbol-sets (resolve entry))]
-    (info emit-set)
     (trim-with-emit-set ast emit-set)))


Prevent expected exception from being printed out during tests

--- test/puppetlabs/trapperkeeper/logging_test.clj
+++ test/puppetlabs/trapperkeeper/logging_test.clj
@@ -8,9 +8,11 @@
 (deftest test-catch-all-logger
   (testing "catch-all-logger ensures that message from an exception is logged"
     (with-test-logging
-      (catch-all-logger
-        (Exception. "This exception is expected; testing error logging")
-        "this is my error message")
+      ;; Prevent the stacktrace from being printed out
+      (with-redefs [clojure.stacktrace/print-cause-trace (fn [e] nil)]
+        (catch-all-logger
+          (Exception. "This exception is expected; testing error logging")
+          "this is my error message"))
       (is (logged? #"this is my error message" :error)))))

 (deftest test-logging-configuration
@@ -22,4 +24,4 @@
       "Calling `configure-logging!` with another log4j.properties file
       in case the default logging level is DEBUG"
     (configure-logging! {:global {:logging-config "./test-resources/another-log4j.properties"}})
-    (is (= (Level/WARN) (.getLevel (Logger/getRootLogger))))))+    (is (= (Level/WARN) (.getLevel (Logger/getRootLogger))))))


Modified functional tests for invoice downloads in line with present invoice functionality

--- test/time_tracker/invoices/functional_test.clj
+++ test/time_tracker/invoices/functional_test.clj
@@ -13,7 +13,6 @@

 (use-fixtures :once fixtures/init! fixtures/migrate-test-db fixtures/serve-app)
 (use-fixtures :each fixtures/isolate-db)
-

 (defn- create-timer-over-ws
   [ws-chan socket project-id current-time duration]
@@ -64,8 +63,8 @@
       (testing "Existing client"
         (let [data             {:client "foo"
                                 :start (- current-time (* 60 60 24))
-                                :end current-time
-                                :address "baz"
+                                :end (+ current-time (* 60 60 24))
+                                :address "goo"
                                 :notes "quux"
                                 :user-rates (vec (for [user-id user-ids]
                                                    {:user-id user-id
@@ -83,7 +82,7 @@
       (testing "Another client with no timers"
         (let [data                  {:client "bar"
                                      :start (- current-time (* 60 60 24))
-                                     :end current-time
+                                     :end (+ current-time (* 60 60 24))
                                      :address "baz"
                                      :notes "quux"
                                      :user-rates (vec (for [user-id user-ids]
@@ -97,7 +96,7 @@
                                       invoice-url
                                       "gid1"
                                       data)]
-          (is (= 200 status))))
+          (is (= 404 status))))

       (testing "Client does not exist"
         (let [data                  {:client "quux"
@@ -137,15 +136,15 @@
                                       data)]
           (is (= 400 status))))

-      (testing "Insufficient user rates"
+      (testing "Missing user rates"
         (let [user-id (first user-ids)
               data    {:client "foo"
                        :start (- current-time (* 60 60 24))
-                       :end current-time
+                       :end (+ current-time (* 60 60 24))
                        :address "baz"
                        :notes "quux"
                        :user-rates [{:user-id user-id
-                                     :rate    3}]
+                                     :rate    nil}]
                        :utc-offset 330
                        :currency :inr
                        :tax-rates nil}


Speak chinese word when showing the answer

--- src/juzi/core.clj
+++ src/juzi/core.clj
@@ -18,6 +18,9 @@
 (defn expand-data [data]
   (map #(zipmap [:en :pi :zh] %) data))

+(defn say [chinese]
+  (future (sh "/usr/bin/say" chinese)))
+
 (defn start []
   (clear-screen)
   (let [cr (ConsoleReader.)]
@@ -30,7 +33,7 @@
           (println "Press any key to see the answer ...")
           (.readCharacter cr)
           (println)
-          (println "Answer:" pi (when zh (str "(" zh ")")))
+          (println "Answer:" pi (when zh (do (say zh) (str "(" zh ")"))))
           (println)
           (println "Were you correct ? [y/n]")
           (let [i (.readCharacter cr)]


CMR-2652: Fixed PR issues.

CMR-2652: Fixed PR issues.

--- system-int-test/test/cmr/system_int_test/search/collection_keyword_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_keyword_search_test.clj
@@ -525,26 +525,33 @@
 ;; This would break other tests when doing the keyword searches.
 (deftest search-by-ancillary-keywords
   (let [c10-umm-json (d/ingest "PROV1"
-                               exp-conv/example-collection-record
+                               (assoc exp-conv/example-collection-record
+                                      :AncillaryKeywords ["CMR-2652-AKW1" "CMR-2652-AKW2"])
                                {:format :umm-json
-                                :accept-format :json})]
+                                :accept-format :json})
+        keyword-str1 "CMR-2652-AKW1"
+        keyword-str2 "CMR-2652-AKW2"
+        keyword-str3 "CMR-2652-AKW3"]
     (index/wait-until-indexed)
-    (testing "search by ancillary keywords."
-      (let [keyword-str "ancillary keyword 1"
-            items [c10-umm-json]
-            parameter-refs (search/find-refs :collection {:keyword keyword-str})
-            json-refs (search/find-refs-with-json-query :collection {} {:keyword keyword-str})
-            parameter-matches? (d/refs-match? items parameter-refs)
-            json-matches? (d/refs-match? items json-refs)]
-        (when-not parameter-matches?
-          (println "Parameter search failed")
-          (println "Expected:" (map :entry-title items))
-          (println "Actual:" (map :name (:refs parameter-refs))))
-        (when-not json-matches?
-          (println "JSON Query search failed")
-          (println "Expected:" (map :entry-title items))
-          (println "Actual:" (map :name (:refs json-refs))))
-        (and parameter-matches? json-matches?)))))
+    (testing "search by existing ancillary keywords parameter match."
+      (let [parameter-refs (search/find-refs :collection {:keyword keyword-str1})
+            parameter-matches? (d/refs-match? [c10-umm-json] parameter-refs)]
+        (is parameter-matches?)))
+
+    (testing "search by non-existing ancillary keywords parameter match."
+      (let [parameter-refs (search/find-refs :collection {:keyword keyword-str3})
+            parameter-matches? (d/refs-match? [] parameter-refs)]
+        (is parameter-matches?)))
+
+    (testing "search by existing ancillary keywords json query match."
+      (let [json-refs (search/find-refs-with-json-query :collection {} {:keyword keyword-str2})
+            json-matches? (d/refs-match? [c10-umm-json] json-refs)]
+        (is json-matches?)))
+
+    (testing "search by non-existing ancillary keywords json query match."
+      (let [json-refs (search/find-refs-with-json-query :collection {} {:keyword keyword-str3})
+            json-matches? (d/refs-match? [] json-refs)]
+        (is json-matches?)))))

 ;; This tests that when searching by relevancy that if the score is the same short name ascending is used for
 ;; sorting the results and then if short name is the same version is used for sorting the results


CMR-4226 Remove logging, add a comment about empty response (#153)

--- search-app/src/cmr/search/api/routes.clj
+++ search-app/src/cmr/search/api/routes.clj
@@ -252,11 +252,9 @@
                           (dissoc :has-granules-created-at)
                           lp/process-legacy-psa)]

-    (info (format "Found %d collections. Were they distinct? - %s"
-                  (count collection-ids)
-                  (distinct? collection-ids)))
-
     (if (empty? collection-ids)
+      ;; collections-with-new-granules-search already has an empty response object,
+      ;; as well as time-took, which is why it's being passed to search-response here
       (search-response ctx collections-with-new-granules-search)
       (find-concepts-by-parameters ctx path-w-extension search-params headers body))))


routes

routes

--- src/clj/salava/metabadge/routes.clj
+++ src/clj/salava/metabadge/routes.clj
@@ -18,7 +18,7 @@
     (context "/obpv1/metabadge" []
              :tags ["metabadge"]
              (GET "/" []
-                  ;:return [schemas/Allmetabadges]
+                  :return schemas/AllMetabadges
                   :summary "get all metabadges"
                   :auth-rules access/signed
                   :current-user current-user
@@ -26,23 +26,22 @@
                   (ok (mb/all-metabadges ctx (:id current-user))))

              (GET "/info" [user_badge_id]
-                  ;:return schemas/Metabadge
-                  :summary "get metabadge info via badge-id"
+                  :return schemas/BadgeMetabadge
+                  :summary "get metabadge info via user-badge-id"
                   :current-user current-user
-                  (ok (mb/get-metabadge ctx user_badge_id (:id current-user)) #_(mb/check-metabadge ctx assertion_url)))
+                  (ok (mb/get-metabadge ctx user_badge_id (:id current-user))))

              (GET "/assertion/info" [assertion_url]
-                  ;:return schemas/Metabadge
+                  :return schemas/BadgeMetabadge
                   :summary "get metabadge info via assertion url"
                   :current-user current-user
                   (ok (mb/check-metabadge ctx assertion_url)))

-             (GET "/badge/info" [user_badge_id]
+             #_(GET "/badge/info" [user_badge_id]
                   ;:return schemas/Milestone?
                   :summary "check if badge is a metabadge"
                   :current-user current-user
-                  (ok (mb/is-metabadge? ctx user_badge_id))
-                  #_(ok (mb/get-user-badge-data ctx (:id current-user) user_badge_id )))
+                  (ok (mb/is-metabadge? ctx user_badge_id)))

              (POST "/update_status/:badgeid" []
                    :path-params [badgeid :- String]


fix bug causing all budget items to be removed

--- src/cljs/clj_money/api/budgets.cljs
+++ src/cljs/clj_money/api/budgets.cljs
@@ -49,7 +49,7 @@
   (-> budget
       (dissoc :end-date)
       (update-in [:start-date] serialize-date)
-      (update-in [:items] #(map before-item-save %))))
+      (update-in-if [:items] #(map before-item-save %))))

 (defn- update
   [budget success-fn error-fn]


Initial level counter impl.

Initial level counter impl.

--- src/cljs/munchkin_toolbox/core.cljs
+++ src/cljs/munchkin_toolbox/core.cljs
@@ -1,12 +1,122 @@
 (ns munchkin-toolbox.core
+  (:require-macros [cljs.core.async.macros :refer [go]])
   (:require [om.core :as om :include-macros true]
+            [cljs.core.async :refer [put! chan <! go]]
             [sablono.core :as html :refer-macros [html]]))

 (enable-console-print!)

-(def app-state (atom {:text "Hello world!"}))
+(defn default-player
+  [n]
+  "Creates a default description for n-th player."
+  {:name (str "Player " n)
+   :level 1})
+
+(def app-state
+  (atom {:players (mapv default-player (range 1 4))}))
+
+
+(defn level-counter
+  "Editable level counter."
+  [level owner]
+  (reify
+    om/IRenderState
+    (render-state [_ state]
+      (let [level-changed-c (:level-changed state)]
+        (html
+         [:div {:class "row"}
+          [:div {:class "col-sm-2"}
+           [:button
+            {:class "btn btn-success btn-lg btn-block"
+             :on-click #(put! level-changed-c ::dec)}
+            "-"]]
+          [:div {:class "col-sm-2"}
+           [:span
+            {:class "btn btn-info btn-lg btn-block" :disabled "disabled"}
+            level]]
+          [:div {:class "col-sm-2"}
+           [:button
+            {:class "btn btn-danger btn-lg btn-block"
+             :on-click #(put! level-changed-c ::inc)}
+            "+"]]])))))
+
+(defmulti change-level identity)
+(defmethod change-level ::inc [op] (fn [l] (if (< l 10) (inc l) l)))
+(defmethod change-level ::dec [op] (fn [l] (if (> l 1) (dec l) l)))
+
+(defn player-info
+  "Row with info about the player."
+  [{:keys [name level] :as player} owner]
+  (reify
+    om/IInitState
+    (init-state [_] {:level-changed (chan)})
+    om/IWillMount
+    (will-mount [_]
+      (let [level-changed-c (om/get-state owner :level-changed)]
+        (go (loop []
+              (let [op (<! level-changed-c)]
+                (om/transact! player :level (change-level op))
+                (recur))))))
+    om/IRenderState
+    (render-state [_ state]
+      (html
+       [:div {:class "row"}
+        [:div {:class "row"} name]
+        (om/build level-counter
+                  level
+                  {:init-state (select-keys state [:level-changed])})
+        [:hr]]))))
+
+(defn players-list
+  "List of players' info."
+  [data owner]
+  (reify
+    om/IRender
+    (render [_]
+      (html
+       [:div {:class "row"}
+        (om/build-all player-info (get data :players []))]))))
+
+
+(defn control-panel
+  [data owner]
+  (reify
+    om/IInitState
+    (init-state [_]
+      {:player-added (chan)})
+    om/IWillMount
+    (will-mount [_]
+      (let [player-added-c (om/get-state owner :player-added)]
+        (go (loop []
+              (let [op (<! player-added-c)]
+                (om/transact! data :players
+                              (fn [p]
+                                (let [n (inc (count p))]
+                                  (conj p (default-player n)))))
+                (recur))))))
+    om/IRenderState
+    (render-state [_ state]
+      (let [player-added-c (:player-added state)]
+        (html
+         [:div {:class "row"}
+          [:button
+           {:class "btn btn-default"
+            :on-click #(put! player-added-c true)}
+           "Add player"]])))))
+
+
+(defn app
+  [data owner]
+  (reify
+    om/IRender
+    (render [_]
+      (html
+       [:div {:class "container"}
+        (om/build control-panel data)
+        (om/build players-list data)]))))
+

 (when-let [dom-el (.getElementById js/document "app")]
-  (om/root (fn [app owner] (html [:h1 (:text app)]))
+  (om/root app
            app-state
            {:target dom-el}))


Add closing over constants tests.

Add closing over constants tests.

--- test/active/clojure/match_test.clj
+++ test/active/clojure/match_test.clj
@@ -274,8 +274,49 @@
              ((p/map-matcher [(:x (:compare-fn even?))] ::even)
               {:x 42})))))

+(def x "x")
+(p/defpattern constant-pattern [(:x x)])
+(def p (p/parse-pattern '[(:x x)]))
+
 (t/deftest closes-over-outer-variables-test
-  (let [evt {:x "x"}]
-    (t/is (= "x"
-             ((p/map-matcher [(:x (:compare-fn #(= % (:x evt))))] x)
-              evt)))))
+  (t/testing "with compare-fn"
+    (let [evt {:x "x"}]
+      (t/is (= "x"
+               ((p/map-matcher [(:x (:compare-fn #(= % (:x evt))))] x)
+                evt)))))
+  (t/testing "as local constant"
+    (let [x "x"
+          evt {:x x}]
+      (t/is (= x
+               ((p/map-matcher [(:x x)] x)
+                evt)))))
+  (t/testing "as global constant"
+    (let [evt {:x x}]
+      (t/is (= x
+               ((p/map-matcher [(:x x)] x)
+                evt)))))
+  (t/testing "as constant with global defpattern"
+    (let [x "x"
+          evt {:x x}]
+      (t/is (= x
+               ((p/map-matcher constant-pattern x)
+                evt)))))
+  (t/testing "as constant with global parse-pattern"
+    (let [evt {:x x}]
+      (t/is (= x
+               ((p/map-matcher p x)
+                evt)))))
+  (t/testing "as constant with global defpattern"
+    (let [x "x"
+          evt {:x x}]
+      (p/defpattern p [(:x x)])
+      (t/is (= x
+               ((p/map-matcher p x)
+                evt)))))
+  #_(t/testing "as constant with local parse-pattern"
+    (let [x "x"
+          evt {:x x}
+          p (p/parse-pattern [(:x x)])]
+      (t/is (= x
+               ((p/map-matcher p x)
+                evt))))))


great stuff

great stuff

--- test/bluebell/bubble/core_test.clj
+++ test/bluebell/bubble/core_test.clj
@@ -2,7 +2,9 @@
   (:require [clojure.test :refer :all]
             [bluebell.bubble.core :refer :all]))

+(def my-add (protect-fn +))

 (deftest bubble-test
   (is (bubble? (bubble 3)))
-  (is (not (bubble? 3))))
+  (is (not (bubble? 3)))
+  (is (= 7 (my-add 3 4))))


Type hint

Type hint

--- src/advent_2017/day_11.cljc
+++ src/advent_2017/day_11.cljc
@@ -18,7 +18,7 @@
     nw [(dec x) (inc y)      z]))

 (defn dist [coords]
-  (/ (apply + (map #(Math/abs %) coords)) 2))
+  (/ (apply + (map #(Math/abs ^long %) coords)) 2))

 (defn part-1 []
   (dist (reduce move [0 0 0] data)))


Clean up export code (slightly)

Clean up export code (slightly)

--- src/alder/graph-export.cljs
+++ src/alder/graph-export.cljs
@@ -7,11 +7,39 @@
 (defn- node-id->var [node-id]
   (string/replace (str node-id) #"[:-]" ""))

+(defn- node-graph-node [node-graph node-id]
+  (-> node-graph :nodes node-id))
+
+(defn- node-export-data [node]
+  (-> node node/node-type :export-data))
+
+(defn- node-dependencies [node]
+  (-> node node-export-data :dependencies))
+
+(defn- node-constructor [node]
+  (-> node node-export-data :constructor))
+
+(defn- node-export-data-type [node]
+  (-> node node-export-data :type))
+
+(defn- node-ignores-export? [node]
+  (-> node node-export-data :ignore-export))
+
+(defn- node-inputs [node]
+  (-> node node/node-type :inputs))
+
+(defn- node-outputs [node]
+  (-> node node/node-type :outputs))
+
+(defn- node-input [node input-id]
+  (-> node node-inputs input-id))
+
+(defn- node-output [node output-id]
+  (-> node node-outputs output-id))
+
+
 (defn- write-dependency [[class-name [file _]]]
   (str "var " class-name " = require('" file "');"))
-
-(defn- node-dependencies [node]
-  (-> node node/node-type :export-data :dependencies))

 (defn- write-dependencies [node-graph]
   (->> (:nodes node-graph)
@@ -20,69 +48,83 @@
        (map write-dependency)
        (string/join "\n")))

-(defn- write-set-input [node-id [_ input]]
-  (case (:type input)
-    :param (str "  " (node-id->var node-id)
-                "." (:name input)
-                ".value = " (:default input) ";")
-    :constant (str "  " (node-id->var node-id)
-                   "." (:name input)
-                   " = " (pr-str (:default input)) ";")
-    nil))
+
+(defmulti write-set-input (fn [_ [_ input]] (:type input)))
+
+(defmethod write-set-input :param [node-id [_ input]]
+  (str "  " (node-id->var node-id)
+       "." (:name input)
+       ".value = " (:default input) ";"))
+
+(defmethod write-set-input :constant [node-id [_ input]]
+  (str "  " (node-id->var node-id)
+       "." (:name input)
+       " = " (pr-str (:default input)) ";"))
+
+(defmethod write-set-input :default [_ _] nil)
+
+

 (defn- write-create-node [[node-id node]]
   (let [construct (str "  var " (node-id->var node-id)
-                       " = "
-                       (-> node node/node-type :export-data :constructor) ";")
-        inputs (-> node node/node-type :inputs)
-        props (string/join "\n"
-                           (keep (partial write-set-input node-id)
-                                 inputs))]
-    (str construct "\n" props (if (string/blank? props) "" "\n"))))
+                       " = " (node-constructor node))
+        props (->> (node-inputs node)
+                   (keep (partial write-set-input node-id))
+                   (string/join "\n"))]
+    (str construct "\n"
+         props (if (string/blank? props) "" "\n"))))

 (defn- write-create-nodes [node-graph]
-  (->> node-graph
-       :nodes
-       (filter (fn [[_ n]] (-> n node/node-type :export-data :constructor)))
+  (->> (:nodes node-graph)
+       (filter (fn [[_ n]] (node-constructor n)))
        (map write-create-node)
        (string/join "\n")))
+
+
+
+(defmulti write-connect-call (fn [_ _ _ to-slot] (:type to-slot)))
+
+(defmethod write-connect-call :param [from-node-var from-slot to-node-var to-slot]
+  (str "  " from-node-var
+       ".connect(" to-node-var "." (:name to-slot)
+       ", " (:index from-slot)
+       ");"))
+
+(defmethod write-connect-call :null-node [_ _ _ _] nil)
+
+(defmethod write-connect-call :default [from-node-var from-slot to-node-var to-slot]
+  (str "  " from-node-var
+       ".connect(" to-node-var
+       ", " (:index from-slot)
+       ");"))
+

 (defn- write-connection [node-graph [[from-node-id from-slot-id] [to-node-id to-slot-id]]]
   (let [from-node-var (node-id->var from-node-id)
         to-node-var (node-id->var to-node-id)

-        from-slot (-> node-graph :nodes from-node-id node/node-type :outputs from-slot-id)
-        to-slot (-> node-graph :nodes to-node-id node/node-type :inputs to-slot-id)]
+        from-slot (-> (node-graph-node node-graph from-node-id)
+                      (node-output from-slot-id))
+        to-slot (-> (node-graph-node node-graph from-node-id)
+                    (node-input to-slot-id))]

     (when-not (= (:type from-slot) :null-node)
-      (case (:type to-slot)
-        :param (str "  " from-node-var
-                    ".connect(" to-node-var "." (:name to-slot)
-                    ", " (:index from-slot)
-                    ");")
-        :node (str "  " from-node-var
-                   ".connect(" to-node-var
-                   ", " (:index from-slot)
-                   ");")
-        :gate (str "  " from-node-var
-                   ".connect(" to-node-var
-                   ", " (:index from-slot)
-                   ");")
-        :null-node nil))))
+      (write-connect-call from-node-var from-slot to-node-var to-slot))))

 (defn- write-connections [node-graph]
-  (->> node-graph
-       :connections
+  (->> (:connections node-graph)
        (map (partial write-connection node-graph))
        (remove nil?)
        (string/join "\n")))

+
+
 (defn- write-property-input [node-graph [from-node-id _]]
-  (->> from-node-id
-       (node-graph/nodes-out-from node-graph)
+  (->> (node-graph/nodes-out-from node-graph from-node-id)
        (map (fn [[_ [to-id to-slot-id]]]
-              [to-id (-> node-graph :nodes to-id node/node-type :inputs to-slot-id)]))
-       (filter (fn [[node-id slot]] (#{:param :node} (:type slot))))
+              [to-id (-> (node-graph-node node-graph to-id)
+                         (node-input to-slot-id))]))
+       (filter (fn [[_ slot]] (#{:param :node} (:type slot))))
        (map (fn [[node-id slot]]
               (str "  this." (or (:name slot) (node-id->var node-id))
                    " = " (node-id->var node-id) (if (= (:type slot) :param)
@@ -92,16 +134,17 @@
        (string/join "\n")))

 (defn- write-property-inputs [node-graph]
-  (->> node-graph
-       :nodes
-       (filter (fn [[_ n]] (-> n node/node-type :export-data :type (= :input))))
+  (->> (:nodes node-graph)
+       (filter (fn [[_ n]] (-> n node-export-data-type (= :input))))
        (map (partial write-property-input node-graph))
        (remove string/blank?)
        (string/join "\n")))

-(defn- graph-without-internal-nodes [node-graph]
+
+
+(defn- graph-without-ignored-nodes [node-graph]
   (let [nodes (into {}
-                    (remove (fn [[_ n]] (-> n node/node-type :export-data :ignore-export))
+                    (remove (fn [[_ n]] (-> n node-ignores-export?))
                             (:nodes node-graph)))
         node-ids (set (keys nodes))
         connections (filter (fn [[[id1 _] [id2 _]]]
@@ -111,26 +154,24 @@
         (assoc :nodes nodes)
         (assoc :connections connections))))

+
 (defn- write-connect-destinations [node-graph to-node-id]
-  (->> to-node-id
-       (node-graph/nodes-in-to node-graph)
+  (->> (node-graph/nodes-in-to node-graph to-node-id)
        (map (fn [[[from-id _] _]]
               (str "    this." (node-id->var from-id)
                    ".connect(destination, input);")))
        (string/join "\n")))

 (defn- write-disconnect-destinations [node-graph to-node-id]
-  (->> to-node-id
-       (node-graph/nodes-in-to node-graph)
+  (->> (node-graph/nodes-in-to node-graph to-node-id)
        (map (fn [[[from-id _] _]]
               (str "    this." (node-id->var from-id)
                    ".disconnect();")))
        (string/join "\n")))

 (defn- write-output-if-statements [node-graph f]
-  (->> node-graph
-       :nodes
-       (filter (fn [[_ n]] (-> n node/node-type :export-data :type (= :output))))
+  (->> (:nodes node-graph)
+       (filter (fn [[_ n]] (-> n node-export-data-type (= :output))))
        (map-indexed (fn [i [id _]]
                       (str "  if (output === " i ") {\n"
                            (f node-graph id) "\n"
@@ -150,6 +191,8 @@
        "\n"
        (write-output-if-statements node-graph write-disconnect-destinations)
        "};"))
+
+

 (defn- write-constructor [node-graph]
   (let [create-nodes (write-create-nodes node-graph)
@@ -161,13 +204,23 @@
          "\n"
          "}")))

+
 (defn- write-property-accessor-function [to-id slot]
   (str "GroupedNode.prototype." (:name slot) " = function (value) {\n"
        "  return this." (node-id->var to-id)
        "." (:name slot) "(value);\n"
        "};"))

-(defn- write-property-constant-function [to-id slot]
+
+(defmulti write-accessor-function (fn [_ slot] (:type slot)))
+
+(defmethod write-accessor-function :accessor [to-id slot]
+  (write-property-accessor-function to-id slot))
+
+(defmethod write-accessor-function :gate [to-id slot]
+  (write-property-accessor-function to-id slot))
+
+(defmethod write-accessor-function :constant [to-id slot]
   (str "GroupedNode.prototype." (:name slot) " = function (value) {\n"
        "  if (value === undefined) {\n"
        "    return this." (node-id->var to-id) "." (:name slot) ";\n"
@@ -177,18 +230,15 @@
        "  }\n"
        "};"))

+(defmethod write-accessor-function :default [_ _] "")
+
 (defn- write-property-input-function [node-graph [from-node-id node]]
   (->> from-node-id
        (node-graph/nodes-out-from node-graph)
        (map (fn [[_ [to-id to-slot-id]]]
               [to-id (-> node-graph :nodes to-id node/node-type :inputs to-slot-id)]))
        (filter (fn [[node-id slot]] (#{:gate :accessor :constant} (:type slot))))
-       (map (fn [[node-id slot]]
-              (case (:type slot)
-                :accessor (write-property-accessor-function node-id slot)
-                :gate (write-property-accessor-function node-id slot)
-                :constant (write-property-constant-function node-id slot)
-                "")))
+       (map (fn [[node-id slot]] (write-accessor-function node-id slot)))
        (string/join "\n")))

 (defn- write-property-input-functions [node-graph]
@@ -199,8 +249,10 @@
        (remove string/blank?)
        (string/join "\n")))

+
+
 (defn javascript-node-graph [node-graph]
-  (let [node-graph (graph-without-internal-nodes node-graph)
+  (let [node-graph (graph-without-ignored-nodes node-graph)
         dependencies (write-dependencies node-graph)
         constructor (write-constructor node-graph)
         connect-function (write-connect-function node-graph)


Fix source links for incrementals [IMMUTANT-189]

--- docs/src/main/clojure/immutant/docs/generate_codox_docs.clj
+++ docs/src/main/clojure/immutant/docs/generate_codox_docs.clj
@@ -62,7 +62,7 @@
   (binding [*root-path* root-path]
     (with-redefs [html/header our-header]
       (-> options
-          (update-in [:src-dir-uri] str (if (re-find #"SNAPSHOT" version)
+          (update-in [:src-dir-uri] str (if (re-find #"SNAPSHOT|incremental" version)
                                           "master"
                                           version))
           (assoc :version version


Commenting require statement.

Commenting require statement.

--- umm-lib/src/cmr/umm/validation/core.clj
+++ umm-lib/src/cmr/umm/validation/core.clj
@@ -6,6 +6,8 @@
             [cmr.umm.validation.granule :as vg]
             [cmr.umm.validation.parent-weaver :as pw]
             [cmr.umm.validation.utils :as vu]
+
+            ;; Required so that the spatial validations will be available.
             [cmr.spatial.ring-validations]
             [cmr.common.services.errors :as e]
             [clojure.string :as str]))


+water

+water

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -205,6 +205,8 @@
    {:pred :vino}     {:artifact true
                       :drinkable true}

+   {:pred :water}    {:drinkable true}
+
    {:pred :word}     {:consumable false
                       :legible true
                       :living false


+(defn with-shrunken-model)

+(defn with-shrunken-model)

--- src/babel/italiano/lab.cljc
+++ src/babel/italiano/lab.cljc
@@ -101,14 +101,14 @@

 (def tree-8
-;;      ___.__
-;;     /      \
-;;    C        H
-;;   / \      / \
-;;  C   H    H   C
-;;          / \
-;;         H   C
-;;
+  ;;      ___.__
+  ;;     /      \
+  ;;    C        H
+  ;;   / \      / \
+  ;;  C   H    H   C
+  ;;          / \
+  ;;         H   C
+  ;;
   {:phrasal true
    :comp tree-1
    :head {:phrasal true
@@ -117,14 +117,14 @@
                  :head {:phrasal false}}}})

 (def tree-9
-;;      ___.__
-;;     /      \
-;;    C        H
-;;   / \      / \
-;;  C   H    H   C
-;;              / \
-;;             H   C
-;;
+  ;;      ___.__
+  ;;     /      \
+  ;;    C        H
+  ;;   / \      / \
+  ;;  C   H    H   C
+  ;;              / \
+  ;;             H   C
+  ;;
   {:phrasal true
    :comp tree-1
    :head {:phrasal true
@@ -194,7 +194,7 @@

         all-of-the-specs (concat specs [root-spec semantic-spec]
                                  vedere-specs)]
-
+
     (repeatedly #(println
                   (morph-ps (time (generate
                                    (nth all-of-the-specs
@@ -226,18 +226,28 @@
   (let [generated (generate spec model)]
     (u/get-in generated path ::none)))

+(defn with-shrunken-model []
+  (binding [babel.generate/truncate? true
+            babel.generate/println? false
+            babel.generate/default-fn (if true (fn [x] [x]) (:default-fn model))
+            babel.generate/index-fn (:index-fn model)
+            babel.generate/morph-ps (:morph-ps model)
+            babel.generate/grammar
+            (filter
+             (fn [rule]
+               (or
+                (= (:rule rule) "s-aux")
+                (= (:rule rule) "vp-pronoun-phrasal")
+                (= (:rule rule) "vp-aux-22")))
+             (:grammar model))
+
+            babel.generate/model model]
+    (generate {:modified false
+               :root {:italiano {:italiano "radersi"}}
+               :synsem {:cat :verb
+                        :sem {:aspect :perfect
+                              :tense :present}
+                        :subcat []}})))
 (defn basecamp []
-  (repeatedly
-   #(println
-     (morph
-      (time (binding [babel.generate/truncate? true
-                      babel.generate/println? true
-                      babel.generate/index-fn (:index-fn model)
-                      babel.generate/model model]
-              (generate {:modified false
-                         :root {:italiano {:italiano "radersi"}}
-                         :synsem {:cat :verb
-                                  :sem {:aspect :perfect
-                                        :tense :present}
-                                  :subcat []}})))))))
-
+  (repeatedly
+   #(println (morph (time (with-shrunken-model))))))


CMR-4451: Fix failing test

CMR-4451: Fix failing test

--- metadata-db-app/test/cmr/metadata_db/test/services/concept_service.clj
+++ metadata-db-app/test/cmr/metadata_db/test/services/concept_service.clj
@@ -152,7 +152,7 @@
         ;; went through
         (is (= [expired-2]
                (for [concept (c/get-expired-concepts db {:provider-id "PROV1"} :collection)]
-                 (dissoc concept :revision-date))))
+                 (dissoc concept :revision-date :created-at))))

         ;; run it again, this time without the conflict...
         (cs/delete-expired-concepts {:system {:db db}} {:provider-id "PROV1"} :collection)


also handle zooming with touch devices

also handle zooming with touch devices

--- src-cljs/frontend/components/canvas.cljs
+++ src-cljs/frontend/components/canvas.cljs
@@ -474,6 +474,14 @@
         ;; touches aren't seqable
         (js/Array.prototype.slice.call touches)))

+(defn measure [[x1 y1] [x2 y2]]
+  (Math/sqrt (+ (Math/pow (- x2 x1) 2)
+                (Math/pow (- y2 y1) 2))))
+
+(defn center [[x1 y1] [x2 y2]]
+  [(/ (+ x2 x1) 2)
+   (/ (+ y2 y1) 2)])
+
 (defn svg-canvas [payload owner opts]
   (reify
     om/IInitState (init-state [_]
@@ -509,6 +517,7 @@
                                           (= (.-length touches) 1)
                                           (do
                                             (.preventDefault event)
+                                            (js/clearInterval (om/get-state owner :touch-timer))
                                             (om/set-state! owner :touch-timer (js/setTimeout #(cast! :menu-opened) 500))
                                             ((:handle-mouse-down handlers) (aget touches "0")))

@@ -518,7 +527,7 @@
                                             (cast! :cancel-drawing)
                                             (reset! (om/get-state owner :touches) (touches->clj touches)))

-                                          :else nil)))
+                                          :else (js/clearInterval (om/get-state owner :touch-timer)))))
                       :onTouchEnd (fn [event]
                                     (.preventDefault event)
                                     (js/clearInterval (om/get-state owner :touch-timer))
@@ -542,15 +551,27 @@
                                                (when in-progress?
                                                  (cast! :cancel-drawing))
                                                (let [touches-atom (om/get-state owner :touches)
-                                                     previous-touches @touches-atom
-                                                     current-touches (touches->clj touches)]
+                                                     [p-a p-b :as previous-touches] @touches-atom
+                                                     [c-a c-b :as current-touches] (touches->clj touches)
+
+                                                     p-center (center [(:page-x p-a) (:page-y p-a)]
+                                                                      [(:page-x p-b) (:page-y p-b)])
+
+                                                     c-center (center [(:page-x c-a) (:page-y c-a)]
+                                                                      [(:page-x c-b) (:page-y c-b)])
+
+                                                     drift-x (- (first c-center) (first p-center))
+                                                     drift-y (- (second c-center) (second p-center))
+
+                                                     spread (- (measure [(:page-x p-a) (:page-y p-a)]
+                                                                        [(:page-x p-b) (:page-y p-b)])
+                                                               (measure [(:page-x c-a) (:page-y c-a)]
+                                                                        [(:page-x c-b) (:page-y c-b)]))]
                                                  (reset! touches-atom current-touches)
                                                  (om/transact! payload (fn [state]
-                                                                         (cameras/move-camera state
-                                                                                (- (:client-x (first current-touches))
-                                                                                (:client-x (first previous-touches)))
-                                                                                (- (:client-y (first current-touches))
-                                                                                (:client-y (first previous-touches))))))))
+                                                                         (-> state
+                                                                           (cameras/set-zoom (partial + (* -0.004 spread)))
+                                                                           (cameras/move-camera drift-x drift-y))))))
                                              :else nil)))
                       :onMouseDown (fn [event]
                                      ((:handle-mouse-down handlers) event)


Add login uri to authentication wrapper

Add login uri to authentication wrapper

--- src/todo_repl_webapp/handler.clj
+++ src/todo_repl_webapp/handler.clj
@@ -28,6 +28,7 @@

 (def secured-app
   (-> app
-    (friend/authenticate {:credential-fn
+    (friend/authenticate {:login-uri "/login"
+                          :credential-fn
                             (partial credentials/bcrypt-credential-fn u/users)
                           :workflows [(workflows/interactive-form)]})))


vcs_type is vcs-type here

vcs_type is vcs-type here

--- src-cljs/frontend/components/header.cljs
+++ src-cljs/frontend/components/header.cljs
@@ -59,7 +59,7 @@
             project-id (project-model/id project)
             project-name (:reponame project)
             project-user (:username project)
-            vcs-type (:vcs_type project)
+            vcs-type (:vcs-type project)
             vcs-url (:vcs_url project)]
         (html
           [:div.head-user


figuring out description interaction

figuring out description interaction

--- src-cljs/frontend/components/issues.cljs
+++ src-cljs/frontend/components/issues.cljs
@@ -19,6 +19,54 @@
   (:require-macros [sablono.core :refer (html)])
   (:import [goog.ui IdGenerator]))

+; (defn description-form [{:keys [issue issue-id]} owner]
+;   (reify
+;     om/IDisplayName (display-name [_] "Description form")
+;     om/IInitState (init-state [_] {:issue-description nil
+;                                    :describing? false})
+;     om/IRenderState
+;     (render-state [_ {:keys [issue-description]}]
+;       (let [{:keys [issue-db cust cast!]} (om/get-shared owner)]
+;         (html
+;           [:div.original-comment
+;           (if (:issue/description issue)
+
+;             [:div.issue-comment
+;              [:p.make (:issue/description issue)]
+;              [:p.issue-foot.make
+;               [:span (common/icon :user) " "]
+;               [:a {:role "button"}
+;                (:issue/author issue)]
+;               [:span " on "]
+;               [:a {:role "button"}
+;                (datetime/month-day (:issue/created-at issue))]
+;               [:span " — "]
+;               [:a {:role "button"
+;                    :on-click #(do
+;                                 (if (om/get-state owner :replying?)
+;                                   (om/set-state! owner :replying? false)
+;                                   (om/set-state! owner :replying? true)))}
+;                (if (om/get-state owner :describing?) "Cancel" "Reply")]]]
+
+;             [:div.content.make
+;              [:form.adaptive {:on-submit #(do (utils/stop-event %)
+;                                             (when issue-description
+;                                               (d/transact! issue-db [{:db/id (:db/id issue)
+;                                                                       :issue/description issue-description}]))
+;                                             (om/set-state! owner :issue-description nil)
+;                                             (om/set-state! owner :replying? false))}
+;               [:textarea {:value (or issue-description (:issue/description issue ""))
+;                           :required "true"
+;                           :onChange #(om/set-state! owner :issue-description (.. % -target -value))}]
+;               [:label {:data-label "label here"
+;                        :data-placeholder "How can we improve Precursor?"}]
+;               [:input {:type "submit"
+;                        :value "Submit idea."}]]])
+
+;           (om/build comment-form {:issue-id issue-id})
+
+;           ])))))
+
 (defn issue-form [_ owner]
   (reify
     om/IDisplayName (display-name [_] "Issue form")
@@ -46,7 +94,7 @@
            [:input {:type "submit"
                     :value "Submit idea."}]]])))))

-(defn comment-form [{:keys [issue-id parent-id]} owner {:keys [issue-db]}]
+(defn comment-form [{:keys [issue-id parent-id close-callback]} owner {:keys [issue-db]}]
   (reify
     om/IDisplayName (display-name [_] "Comment form")
     om/IInitState (init-state [_] {:comment-body ""})
@@ -56,19 +104,18 @@
             cust (om/get-shared owner :cust)]
         (html
           [:div.content.make
-          [:form.adaptive {:on-submit #(do (utils/stop-event %)
-                                              (when (seq comment-body)
-                                                (d/transact! issue-db [{:db/id issue-id
-                                                                        :issue/comments (merge {:db/id -1
-                                                                                :comment/created-at (datetime/server-date)
-                                                                                :comment/body comment-body
-                                                                                :comment/author (:cust/email cust)
-                                                                                :frontend/issue-id (utils/squuid)}
-                                                                                (when parent-id
-                                                                                {:comment/parent parent-id}))}])
-                                                (om/set-state! owner :comment-body ""))
-                                              (om/set-state! owner :replying? false)
-                                              )}
+           [:form.adaptive {:on-submit #(do (utils/stop-event %)
+                                          (when (seq comment-body)
+                                            (d/transact! issue-db [{:db/id issue-id
+                                                                    :issue/comments (merge {:db/id -1
+                                                                                :comment/created-at (datetime/server-date)
+                                                                                :comment/body comment-body
+                                                                                :comment/author (:cust/email cust)
+                                                                                :frontend/issue-id (utils/squuid)}
+                                                                                (when parent-id
+                                                                                {:comment/parent parent-id}))}])
+                                            (om/set-state! owner :comment-body ""))
+                                          (close-callback))}

            [:textarea {:required true
                        :value comment-body
@@ -77,6 +124,69 @@
                     :data-forgot "To be continued"}]
            [:input {:type "submit"
                          :value "Comment."}]]])))))
+
+(defn description-form [{:keys [issue issue-id]} owner]
+  (reify
+    om/IDisplayName (display-name [_] "Description form")
+    om/IInitState (init-state [_] {:issue-description nil
+                                   :editing? false})
+    om/IRenderState
+    (render-state [_ {:keys [issue-description]}]
+      (let [{:keys [issue-db cust cast!]} (om/get-shared owner)
+            editable? (= (:cust/email cust) (:issue/author issue))
+            editing? (and editable? (om/get-state owner :editing?))]
+        (html
+          ; if editable? ; (:issue/description issue)
+
+          [:div.original-comment
+
+           (when editing?
+             [:div.content.make
+              [:form.adaptive {:on-submit #(do (utils/stop-event %)
+                                             (when issue-description
+                                               (d/transact! issue-db [{:db/id (:db/id issue)
+                                                                       :issue/description issue-description}]))
+                                             (om/set-state! owner :issue-description nil)
+                                             (om/set-state! owner :editing? false))}
+               [:textarea {:value (or issue-description (:issue/description issue ""))
+                           :required "true"
+                           :onChange #(om/set-state! owner :issue-description (.. % -target -value))}]
+               [:label {:data-label "label here"
+                        :data-placeholder "How can we improve Precursor?"}]
+               [:input {:type "submit"
+                        :value "Make description."}]]]
+             )
+
+           (when (and (not editing?)
+                      (:issue/description issue))
+
+             [:div.issue-comment
+              [:p.make (:issue/description issue)]
+              [:p.issue-foot.make
+               [:span (common/icon :user) " "]
+               [:a {:role "button"}
+                (:issue/author issue)]
+               [:span " on "]
+               [:a {:role "button"}
+                (datetime/month-day (:issue/created-at issue))]
+               [:span " — "]
+               [:a {:role "button"
+                    :on-click #(do
+                                 (if editing?
+                                   (om/set-state! owner :editing? false)
+                                   (om/set-state! owner :editing? true)))}
+                "Edit"]]])
+
+           (when (and (not editing?)
+                      (not (:issue/description issue)))
+
+             (om/build comment-form {:issue-id issue-id}))]
+
+
+
+          ; (om/build comment-form {:issue-id issue-id})
+
+          )))))

 ;; XXX: handle logged-out users
 (defn vote-box [{:keys [issue]} owner]
@@ -183,15 +293,12 @@
                               (if (om/get-state owner :replying?)
                                 (om/set-state! owner :replying? false)
                                 (om/set-state! owner :replying? true)))}
-             (if (om/get-state owner :replying?) "Cancel" "Reply")]
-
-            ; (when (om/get-state owner :replying?) (om/build comment-form {:issue-id issue-id}))
-
-            ]
+             (if (om/get-state owner :replying?) "Cancel" "Reply")]]

            (when (om/get-state owner :replying?)
              (om/build comment-form {:issue-id issue-id
-                                     :parent-id comment-id}))
+                                     :parent-id comment-id
+                                     :close-callback #(om/set-state! owner :replying? false)}))

            ; [:div.issue-divider]

@@ -433,6 +540,11 @@
            ; [:input {:value (or description (:issue/description issue ""))
            ;          :on-change #(om/set-state! owner :description (.. % -target -value))}]

+           (om/build description-form {:issue issue
+                                       :issue-id issue-id})
+
+           ; (om/build comment-form {:issue-id issue-id})
+
            ; [:div.comment-author
            ;  [:span.comment-avatar (common/icon :user)]
            ;  [:span.comment-name (str " " (:issue/author issue))]
@@ -455,9 +567,9 @@

            ;   [:div.comment-content "There's no description yet."])]

-           (when description
-             [:div.issue-description (or description (:issue/description issue ""))]
-             )
+           ; (when (:issue/description issue)
+           ;   [:div.issue-description (:issue/description issue)]
+           ;   )

            ; [:div.single-issue-foot
            ;   [:a {:role "button"} "reply"]
@@ -488,7 +600,7 @@
            ; [:div.content
            ;  (om/build comment-form {:issue-id issue-id})]

-           (om/build comment-form {:issue-id issue-id})
+           ; (om/build comment-form {:issue-id issue-id})

            ; [:div.calls-to-action
            ; [:a.menu-button {:role "button"} "Comment"]]


fix updated name

fix updated name

--- src/braid/common/state.cljs
+++ src/braid/common/state.cljs
@@ -45,7 +45,7 @@
 (defn current-user-is-group-admin?
   "Is the current user an admin in the given group?"
   ([state [_ group-id]]
-   (is-group-admin? state nil [group-id]))
+   (current-user-is-group-admin? state nil [group-id]))
   ([state _ [group-id]]
    (reaction (->> (get-in @state [:session :user-id])
                   (contains? (get-in @state [:groups group-id :admins]))))))


Use mouse down event instead of click

Use mouse down event instead of click

--- src/chessground/render.cljs
+++ src/chessground/render.cljs
@@ -27,7 +27,7 @@
         attributes {:className (class-name classes)
                     :key (name key) ; react.js key just in case it helps performance
                     :data-key (name key)}
-        behaviors {:onClick #(push! (:select-square channels) key)
+        behaviors {:onMouseDown #(push! (:select-square channels) key)
                    :onTouchStart (fn [event]
                                    (.preventDefault event)
                                    (push! (:select-square channels) key))}]


Add helper options to make-request for testing (#1616)

* add helper options for tests

* revert host header change

* undo change

* bruh

--- waiter/src/waiter/util/client_tools.clj
+++ waiter/src/waiter/util/client_tools.clj
@@ -372,12 +372,13 @@

 (defn make-request
   ([waiter-url path &
-    {:keys [async? body client cookies content-type disable-auth form-params headers
-            method multipart protocol query-params scheme trailers-fn verbose]
+    {:keys [async? body client cookies content-type disable-auth form-params follow-redirects? headers
+            method multipart protocol query-params scheme server-principal trailers-fn verbose]
      :or {async? false
           body nil
           cookies []
           disable-auth nil
+          follow-redirects? false
           headers {}
           method :get
           query-params {}
@@ -395,6 +396,9 @@
                          (str scheme "://"))
                        (strip-trailing-slash waiter-url)
                        path)
+         server-principal (if (some? server-principal)
+                            (str scheme "://" server-principal)
+                            request-url)
          request-headers (walk/stringify-keys (ensure-cid-in-headers headers))]
      (try
        (when verbose
@@ -409,13 +413,13 @@
                           client
                           (cond-> {:body body
                                    :fold-chunked-response? (not async?)
-                                   :follow-redirects? false
+                                   :follow-redirects? follow-redirects?
                                    :headers request-headers
                                    :method method
                                    :query-string query-params
                                    :url request-url}
                             multipart (assoc :multipart multipart)
-                            add-spnego-auth (assoc :auth (hu/spnego-authentication (URI. request-url)))
+                            add-spnego-auth (assoc :auth (hu/spnego-authentication (URI. server-principal)))
                             form-params (assoc :form-params form-params)
                             (not (str/blank? content-type)) (assoc :content-type content-type)
                             cookies (assoc :cookies (map (fn [c] [(:name c) (:value c)]) cookies))
@@ -1200,7 +1204,7 @@
   (make-request waiter-url "/token"
                 :body (utils/clj->json token-map)
                 :cookies cookies
-                :headers (assoc headers "host" token)
+                :headers (assoc headers "x-waiter-token" token)
                 :method :post
                 :query-params query-params))


fix safe-exec for spec

fix safe-exec for spec

--- src/clj/datasplash/core.clj
+++ src/clj/datasplash/core.clj
@@ -62,10 +62,11 @@
          nss (list)]
     (let [{:keys [message trace-elems cause] :as current-ex} todo]
       (if message
-        (if (re-find #"clojure\.lang\.Var\$Unbound|call unbound fn|dynamically bind non-dynamic var|Unbound:" message)
+        (if (re-find #"clojure\.lang\.Var\$Unbound|call unbound fn|dynamically bind non-dynamic var|Unbound:|Unable to resolve spec:" message)
           (let [[_ missing-ns] (or (re-find #"call unbound fn: #'([^/]+)/" message)
                                    (re-find #"Unbound: #'([^/]+)/" message)
-                                   (re-find #"Can't dynamically bind non-dynamic var: ([^/]+)/" message))
+                                   (re-find #"Can't dynamically bind non-dynamic var: ([^/]+)/" message)
+                                   (re-find #"Unable to resolve spec: :([^/]+)/"))
                 ns-to-add (->> trace-elems
                                (filter #(:clojure %))
                                (map :ns)


remove dangerous use of seq creating lazyness in Value of KV

--- src/clj/datasplash/core.clj
+++ src/clj/datasplash/core.clj
@@ -49,7 +49,7 @@
          (instance? Iterable v)
          (not (instance? java.util.Set v))
          (not (instance? java.util.Map v)))
-      (seq v)
+      (vec v)
       v)))

 (defn kv->clj


insert assertion endorsement

insert assertion endorsement

--- src/clj/salava/badge/db.clj
+++ src/clj/salava/badge/db.clj
@@ -222,10 +222,11 @@
                                                        (assoc :user_badge_id user-badge-id
                                                               :ctime now
                                                               :mtime now))))))
+      (dump (:endorsement user-badge))
       (when (seq (:endorsement user-badge))
         (doseq [endorsement (:endorsement user-badge)]
           (when (map? endorsement)
             (jdbc/insert! tx "user_badge_endorsement" (-> endorsement
                                                           (dissoc :id)
-                                                          (assoc :user_badge_id user-badge-id))))))
+                                                          (assoc :user_badge_id user-badge-id :status "accepted"))))))
       user-badge-id)))


Supports for titles and subtitles in line charts

--- src/clj_flotr/generator.clj
+++ src/clj_flotr/generator.clj
@@ -101,7 +101,9 @@
                                     vertical-lines
                                     show-legend
                                     legend-position
-                                    legend-background]}]
+                                    legend-background
+                                    title
+                                    subtitle]}]
     [:div {:id id :style (str "width:" width ";height:" height)}
         [:script {:type "text/javascript"}
             (str "Flotr.draw($('" id "'), [")
@@ -119,7 +121,10 @@
                       show: "             (bool->string show-legend) ",
                       position: '"        (or legend-position "ne") "',
                       backgroundColor: '" (or legend-background "#D2E8FF") "',
-                  }});")]])
+                  }"
+                  (if title    (str ", title: '" title "'"))
+                  (if subtitle (str ", subtitle: '" subtitle "'"))
+                  "});")]])

 (defn stacked-bars
     [id width height data & {:keys [horizontal-lines


Cleaning a bit the code

Cleaning a bit the code

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -12,7 +12,7 @@
 (def board-height 11)
 (def init-block-count 12) ;; Init blocks for red, blue, green, gray
 (def players [:blue :red :green])
-
+(def directions [[-1 0] [1 0] [0 -1] [0 1] [-1 1] [1 1] [-1 -1] [1 -1]])

 ;; -----------------------------------------
 ;; INIT THE BOARD
@@ -75,14 +75,14 @@

 (defn range-cells ;; TODO - Use the concept of sentinel for the walls?
   "Give all the cells in the provided direction - until you reach an empty / blocked / wall cell"
-  [board [x y] [dx dy]]
+  [board pos dir]
   (eduction
     (comp
       (map (juxt #(get-in board %) identity))
       (take-while (comp is-cell-owned? first))
       (partition-by first)
       (map (juxt #(-> % first first) #(mapv second %))))
-    (range-coord [x y] [dx dy])))
+    (range-coord pos dir)))

 (defn available-cells-by-dir
   "Indicates the convertible cells for the provided player - when clicking at [x y]
@@ -91,8 +91,8 @@
      :winner :blue,
 		 :looser :red,
 		 :taken [[8 5] [9 5]]}"
-  [board [x y :as pos] [dx dy]]
-  (let [[head tail :as cells] (take 2 (range-cells board [(+ x dx) (+ y dy)] [dx dy]))]
+  [board [x y :as pos] [dx dy :as dir]]
+  (let [[head tail :as cells] (take 2 (range-cells board [(+ x dx) (+ y dy)] dir))]
     (when (= 2 (count cells))
       {:move pos             ;; Where the move took place
        :winner (first tail)  ;; Who wins the cells
@@ -103,9 +103,7 @@
 (defn available-moves-at
   "Provides the list of moves that can be done from a cell"
   [board [x y]]
-  (eduction
-    (keep #(available-cells-by-dir board [x y] %))
-    [[-1 0] [1 0] [0 -1] [0 1] [-1 1] [1 1] [-1 -1] [1 -1]]))
+  (eduction (keep #(available-cells-by-dir board [x y] %)) directions))

 (defn take-empty-cell-move
   "Create a move to take an empty cell"


Refactoring to put every interaction in the game loop

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -370,9 +370,13 @@
           (async/timeout ai-move-delay) ([_] (put! ai-events :ai-play))
           )))

-    player-events))
+    {:player-events player-events}
+    ))

 (defonce game-loop (start-game-loop))
+
+(def send-player-event!
+  (partial put! (game-loop :player-events)))

 ;; -----------------------------------------
@@ -400,7 +404,7 @@
   [x y game]
   (rect-cell x y
     (if-not (show-help? game x y) "lightgray" "lightblue")
-    {:on-click #(put! game-loop [x y])}
+    {:on-click #(send-player-event! [x y])}
     ))

 (defn show-scores


Tweak hardocded resilience

Tweak hardocded resilience

--- src/clojush/meta_errors.clj
+++ src/clojush/meta_errors.clj
@@ -168,7 +168,7 @@
         0
         (if (> (/ (count (distinct hist))
                   (count hist))
-               3/4)
+               1/2)
           0
           1)))))


Be more descriptive when programs are incomplete

--- src/gamma_driver/drivers/basic.cljs
+++ src/gamma_driver/drivers/basic.cljs
@@ -42,10 +42,14 @@
     (into {}
           (map #(vector % (s %)) (:inputs program)))))

-(defn input-complete? [driver program]
-  (let [state   (@(:input-state driver) program)
-        inputs  (:inputs program)]
-    (not-any? nil? (map state inputs))))
+(defn input-incomplete? [driver program]
+  (let [state  (@(:input-state driver) program)
+        inputs (:inputs program)]
+    (if (some nil? (map state inputs))
+      ;; We're going to bail at this point anyway, so let's spend some
+      ;; extra time extracting what inputs were incomplete
+      (remove (fn [input] (get state input)) inputs)
+      false)))
 ;; would like return value to indicate which inputs are not filled in?

@@ -62,8 +66,12 @@
   ([driver program opts]
     (draw-arrays* driver program opts nil))
   ([driver program opts target]
-   (if (not (input-complete? driver program))
-     (throw (js/Error. "Program inputs are incomplete."))
+   (if-let [missing-inputs (input-incomplete? driver program)]
+     ;; TODO: Warn in dev mode for programs missing :id key
+     ;; Should we make this pass the missing inputs so tooling can
+     ;; catch it and present it to the user, e.g. in a shadertoy/live
+     ;; editor?
+     (throw (js/Error. (str "Program '" (pr-str (:id program)) "' inputs are incomplete."  (pr-str (map (juxt :name :type) missing-inputs)))))
      (let [c (if-let [c (:count opts)]
                c
                (draw-count driver program))
@@ -80,8 +88,8 @@
   ([driver program opts]
     (draw-elements* driver program opts nil))
   ([driver program opts target]
-    (if (not (input-complete? driver program))
-     (throw (js/Error. "Program inputs are incomplete."))
+   (if-let [missing-inputs (input-incomplete? driver program)]
+     (throw (js/Error. (str "Program '" (pr-str (:id program)) "' inputs are incomplete."  (pr-str (map (juxt :name :type) missing-inputs)))))
      (gd/draw-elements
       (gdp/gl driver)
        program


Fix #480 Make path-separator private

Fix #480 Make path-separator private

--- planck-cljs/src/planck/io.cljs
+++ planck-cljs/src/planck/io.cljs
@@ -195,7 +195,7 @@
   [x & opts]
   (make-output-stream x (when opts (apply hash-map opts))))

-(def path-separator "/")
+(def ^:private path-separator "/")

 (defn ^boolean file?
   "Returns true if x is a File."


(PE-2685) Don't cleanup on error (helps debugging)

--- acceptance/src/clojure/puppetlabs/jvm/test/certificate_authority/server.clj
+++ acceptance/src/clojure/puppetlabs/jvm/test/certificate_authority/server.clj
@@ -3,11 +3,6 @@
   (:require [puppetlabs.trapperkeeper.core :as tk]
             [puppetlabs.jvm.test.certificate-authority.puppet-agent-cert-manager :as client-ca]
             [me.raynes.fs :as fs]))
-
-(defn cleanup
-  []
-  (fs/delete-dir "acceptance/resources/server")
-  (fs/delete-dir "acceptance/resources/client"))

 (tk/defservice secure-test-server
   [[:WebserverService add-ring-handler]]
@@ -16,15 +11,12 @@
                           "/test-ssl")
         context)
   (stop [_ context]
-        (cleanup)
+        (fs/delete-dir "acceptance/resources/server")
+        (fs/delete-dir "acceptance/resources/client")
         context))

 (defn -main
   [& args]
-  (try
-    (-> (PuppetMasterCertManager. "acceptance/resources/server/conf" "localhost")
-        (client-ca/initialize! "acceptance/resources/client/conf" "local-client"))
-    (apply tk/main args)
-    (catch Exception e
-      (cleanup)
-      (throw e))))
+  (-> (PuppetMasterCertManager. "acceptance/resources/server/conf" "localhost")
+      (client-ca/initialize! "acceptance/resources/client/conf" "local-client"))
+  (apply tk/main args))


fix typo

fix typo

--- src/main/clojure/powderkeg/core.clj
+++ src/main/clojure/powderkeg/core.clj
@@ -365,7 +365,7 @@
                     (has-method? org.apache.spark.api.java.function.FlatMapFunction '[java.util.Iterator "call" [?]])
                     ((df) it)
                     (has-method? org.apache.spark.api.java.function.FlatMapFunction '[java.lang.Iterable "call" [?]])
-                    (reify java.util.Iterable
+                    (reify java.lang.Iterable
                       (iterator [_] ((df) it))))))
               preserve-partitioning)]
     rdd))


fix closure munge issue

fix closure munge issue

goog.i18n.DateTimeSymbols_en
was only available under
goog.i18n.DateTimeSymbols-en
which is confusing since _ would be the original name.

now both work.

--- src/main/shadow/build/classpath.clj
+++ src/main/shadow/build/classpath.clj
@@ -110,12 +110,19 @@
           (-> rc
               (assoc :type :goog
                      :requires (into #{} deps)
-                     :provides (into #{} (map util/munge-goog-ns) goog-provides)
+                     :provides
+                     (-> #{}
+                         ;; for goog files make both namespaces available
+                         ;; to match cljs behaviour where _ is always converted to -
+                         ;; goog.i18n.DateTimeSymbols_en
+                         (into (map symbol) goog-provides)
+                         ;; goog.i18n.DateTimeSymbols-en
+                         (into (map util/munge-goog-ns) goog-provides))
                      :deps deps)
               (cond->
                 (seq goog-module)
                 (-> (assoc :goog-module true)
-                    (update :provides conj (util/munge-goog-ns goog-module)))
+                    (update :provides conj (util/munge-goog-ns goog-module) (symbol goog-module)))

                 (= resource-name "goog/base.js")
                 (update :provides conj 'goog)


core: with-bindings

core: with-bindings

--- core/data/core.clj
+++ core/data/core.clj
@@ -2400,9 +2400,9 @@
              binding-map))

 (defn with-bindings*
-  "Takes a map of Var/value pairs. Installs for the given Vars the associated
-  values as thread-local bindings. Then calls f with the supplied arguments.
-  Pops the installed bindings after f returned. Returns whatever f returns."
+  "Takes a map of Var/value pairs. Sets the vars to the corresponding values.
+  Then calls f with the supplied arguments. Resets the vars back to the original
+  values after f returned. Returns whatever f returns."
   {:added "1.0"}
   [binding-map f & args]
   (let [existing-bindings (replace-bindings* binding-map)]
@@ -2410,6 +2410,14 @@
       (apply f args)
       (finally
         (replace-bindings* existing-bindings)))))
+
+(defmacro with-bindings
+  "Takes a map of Var/value pairs. Sets the vars to the corresponding values.
+  Then executes body. Resets the vars back to the original
+  values after body was evaluated. Returns the value of body."
+  {:added "1.0"}
+  [binding-map & body]
+  `(with-bindings* ~binding-map (fn [] ~@body)))

 (defmacro with-out-str
   "Evaluates exprs in a context in which *out* is bound to a fresh


add simulator section to the swagger docs

--- src/wombats/handlers/swagger.clj
+++ src/wombats/handlers/swagger.clj
@@ -6,7 +6,7 @@
 (def ^{:private true
        :doc "List of handlers to be sources for api documentation"}
   handlers
-  #{"user" "game" "arena" "auth"})
+  #{"user" "game" "arena" "auth" "simulator"})

 (def ^:private swagger-specs {:info {:title "Wombats API"
                                      :description "API documentation for Wombats"
@@ -27,7 +27,9 @@
                                      {:name "arena"
                                       :description "Arena Configuration API"}
                                      {:name "game"
-                                      :description "Game API"}]})
+                                      :description "Game API"}
+                                     {:name "simulator"
+                                      :description "Simulator API"}]})

 (defn- source-handler-vars
   "sources all public vars inside of each ns passed in the handlers set"


Update to ClojureScript 1.8.40

Update to ClojureScript 1.8.40

--- ClojureScript/replete/project.clj
+++ ClojureScript/replete/project.clj
@@ -1,6 +1,6 @@
 (defproject replete "0.1.0"
   :dependencies [[org.clojure/clojure "1.8.0"]
-                 [org.clojure/clojurescript "1.8.34"]
+                 [org.clojure/clojurescript "1.8.40"]
                  [tailrecursion/cljson "1.0.7"]
                  [cljsjs/parinfer "1.5.1-0"]]
   :clean-targets ["out" "target"]