adjust the sign-in for the grove server

adjust the sign-in for the grove server

--- src/goodbot/core.clj
+++ src/goodbot/core.clj
@@ -5,17 +5,25 @@
             [goodbot.plugins.ping :as ping]
             [goodbot.plugins.clojure :as clj]))

-(def host    (or (System/getenv "GOODBOT_HOST")    "irc.freenode.net"))
-(def port    (or (System/getenv "GOODBOT_PORT")    6667))
-(def nick    (or (System/getenv "GOODBOT_NICK")    "goodbot-test"))
-(def channel (or (System/getenv "GOODBOT_CHANNEL") "#goodbot-test"))
+(def host     (or (System/getenv "GOODBOT_HOST")    "irc.freenode.net"))
+(def port     (or (System/getenv "GOODBOT_PORT")    6667))
+(def nick     (or (System/getenv "GOODBOT_NICK")    "goodbot-test"))
+(def channel  (or (System/getenv "GOODBOT_CHANNEL") "#goodbot-test"))
+(def server-password (or (System/getenv "GOODBOT_SERVER_PASSWORD") nil))
+(def password (or (System/getenv "GOODBOT_PASSWORD") nil))

 (defn -main
   "Starts the bot"
   [& args]
-  (println (str "connecting to " host ":" port channel " as " nick))
+  (println (str "connecting to " host ":" port channel " as " nick " with password " server-password))
   (let [bot (irclj/connect host port nick
+                           :pass server-password
                            :callbacks {:privmsg (bot/make-callback
                                                   [ping/plugin
-                                                   clj/plugin])})]
+                                                   clj/plugin])
+                                       :raw-log println})]
+    ; XXX HACK remove me once prefixes gets defaulted in irclj (and released) ! XXX
+    (dosync (alter bot assoc :prefixes {}))
+
+    (irclj/identify bot password)
     (irclj/join bot channel)))


Resolve collision. Winning and losing conditions

--- src/asteroids/core.clj
+++ src/asteroids/core.clj
@@ -12,10 +12,13 @@
 ; functional model
 ; ----------------------------------------------------------
 ; START: constants
+(def sqrt3 (Math/sqrt 3.0))
+
 (def width 120)
 (def height 100)
 (def point-size 8)
 (def ship-size 1.5)
+(def ship-life 3)
 (def turn-speed 4)
 (def shot-size (/ ship-size 10))
 (def shot-speed 1.5)
@@ -141,6 +144,8 @@

    :direction              0
    :rotation-speed         0
+
+   :life                   ship-life
    })

 (defn create-shot
@@ -205,10 +210,87 @@
     (> y (+ height size))
     ))

+(defn collide? [{size1 :size [x1 y1] :position} {size2 :size [x2 y2] :position}]
+  (let [distance (fn [a b max]
+                   (let [d (Math/abs (- a b))]
+                     (if (< d (/ max 2)) d (- max d))))
+        x (distance x1 x2 width)
+        y (distance y1 y2 height)
+        size (+ size1 size2)
+        square #(* % %)]
+    (<= (+ (square x) (square y)) (square size))))
+
+(defmulti check-collision
+          (fn [obj1 obj2]
+            (cond
+              (and (map? obj1) (map? obj2)) :map-map
+              (and (map? obj1) (sequential? obj2)) :map-seq
+              (and (sequential? obj1) (sequential? obj2)) :seq-seq)))
+
+(defmethod check-collision :map-map [obj1 obj2]
+  (if (collide? obj1 obj2)
+    [(assoc obj1 :hit? true) (assoc obj2 :hit? true)]
+    [obj1 obj2]))
+
+(defmethod check-collision :map-seq [obj1 coll]
+  (loop [obj1 obj1, coll coll, coll-result []]
+    (if (empty? coll)
+      [obj1 coll-result]
+      (let [[obj1 obj2] (check-collision obj1 (first coll))]
+        (recur obj1 (rest coll) (conj coll-result obj2)))
+      )))
+
+(defmethod check-collision :seq-seq [coll1 coll2]
+  (loop [coll1 coll1, coll2 coll2, coll1-result []]
+    (if (empty? coll1)
+      [coll1-result coll2]
+      (let [[obj1 coll2] (check-collision (first coll1) coll2)]
+        (recur (rest coll1) coll2 (conj coll1-result obj1)))
+      )))
+
+(defmulti handle-collision (fn [object] (:type object)))
+
+(defmethod handle-collision :ship [{:keys [hit? life] :as ship}]
+  (if hit?
+    (assoc ship :life (dec life)
+                :hit? false)
+    ship))
+
+(defmethod handle-collision :shot [{:keys [hit?] :as shot}]
+  (if hit?
+    nil
+    shot))
+
+(defmethod handle-collision :asteroid [{:keys [hit? size position speed] :as asteroid}]
+  (let [fragment-size (/ size sqrt3)]
+    (if hit?
+      (if (< fragment-size asteroid-min-size)
+        nil
+        (create-asteroids 3 (/ size sqrt3) position speed))
+      asteroid)))
+
+(defn resolve-all-collision [{shots :shots :as ship} asteroids]
+  (let [[ship asteroids] (check-collision ship asteroids)
+        [shots asteroids] (check-collision shots asteroids)
+        ship (handle-collision ship)
+        shots (->> shots
+                   (map handle-collision)
+                   flatten
+                   (filter (comp not nil?)))
+        asteroids (->> asteroids
+                       (map handle-collision)
+                       flatten
+                       (filter (comp not nil?)))]
+    [(assoc ship :shots shots) asteroids]))
+
 (def win? (constantly false))
-
-(defn lose? [ship]
-  (out-of-bounds? ship))
+(def lose? (constantly false))
+
+(defn win? [asteroids]
+  (empty? asteroids))
+
+(defn lose? [{life :life}]
+  (<= life 0))

 ; ----------------------------------------------------------------------
 ; Actions
@@ -277,6 +359,12 @@
     (alter asteroids (partial map move))
     nil))

+(defn resolve-collision! [ship asteroids]
+  (dosync
+    (let [[ship* asteroids*] (resolve-all-collision @ship @asteroids)]
+      (ref-set ship ship*)
+      (ref-set asteroids asteroids*))))
+
 (defn do-action!
   ([ship {:keys [rotation acceleration shoot] :as action} modifier]
    (when rotation (dosync (alter ship turn (* modifier rotation))))
@@ -287,10 +375,12 @@
    (do-action! ship action 1))
   )

-(defn reset-game! [ship asteroids]
+(defn reset-game! [ship asteroids level increase-level?]
   (dosync
     (ref-set ship (create-ship))
-    (ref-set asteroids (create-asteroids asteroids-start-number asteroid-start-size)))
+    (when increase-level?
+      (alter level inc))
+    (ref-set asteroids (create-asteroids @level asteroid-start-size)))
   nil)

 ; ----------------------------------------------------------
@@ -338,7 +428,7 @@
 ; game
 ; ----------------------------------------------------------

-(defn game-panel [frame ship asteroids]
+(defn game-panel [frame ship asteroids level]
   (proxy [JPanel ActionListener KeyListener] []
     (paintComponent [g]                                     ; <label id="code.game-panel.paintComponent"/>
       (proxy-super paintComponent g)
@@ -347,11 +437,12 @@
         (paint g asteroid)))
     (actionPerformed [e]                                    ; <label id="code.game-panel.actionPerformed"/>
       (update-positions! ship asteroids)
+      (resolve-collision! ship asteroids)
       (when (lose? @ship)
-        (reset-game! ship asteroids)
+        (reset-game! ship asteroids level false)
         (JOptionPane/showMessageDialog frame "You lose!"))
-      (when (win? @ship)
-        (reset-game! ship asteroids)
+      (when (win? @asteroids)
+        (reset-game! ship asteroids level true)
         (JOptionPane/showMessageDialog frame "You win!"))
       (.repaint this))
     (keyPressed [e]
@@ -365,9 +456,10 @@

 (defn game []
   (let [ship (ref (create-ship))
+        level (ref asteroids-start-number)
         asteroids (ref (create-asteroids asteroids-start-number asteroid-start-size))
         frame (JFrame. "Asteroids")
-        panel (game-panel frame ship asteroids)
+        panel (game-panel frame ship asteroids level)
         timer (Timer. turn-millis panel)]
     (doto panel                                             ; <label id="code.game.panel"/>
       (.setFocusable true)


activate wordcloud generation by default

--- src/distillery/config.clj
+++ src/distillery/config.clj
@@ -12,4 +12,4 @@

 (def min-relative-appearance (/ 1.0 4.0))

-(def skip-wordclouds true)+(def skip-wordclouds false)


Fix error with testing equality with laziness

--- test/src/clojure/neko/activity_test.clj
+++ test/src/clojure/neko/activity_test.clj
@@ -135,9 +135,9 @@
   [this]
   (reset! test-activity/set-content-view? false)
   (let [activity (start-activity this)]
-    (is-eq [true] (request-window-features! activity :progress))
+    (is (= [true] (request-window-features! activity :progress)))
     (with-activity activity
-      (is-eq [true] (request-window-features! :no-title)))))
+      (is (= [true] (request-window-features! :no-title))))))

 (defn -testRequestWindowFeaturesManyFeatures
   "Tests the request-window-features! requesting several features."


Change some apidocs group headings

Change some apidocs group headings

--- src/re_frame/core.cljc
+++ src/re_frame/core.cljc
@@ -881,7 +881,7 @@
       ;; now install my alternative loggers
       (re-frame.core/set-loggers!  {:warn my-logger :log my-logger})
    "
-  {:api-docs/heading "Logging"}
+  {:api-docs/heading "Miscellaneous"}
   [new-loggers]
   (loggers/set-loggers! new-loggers))

@@ -901,7 +901,7 @@
       (console :error \"Sure enough it happened:\" a-var \"and\" another)
       (console :warn \"Possible breach of containment wall at:\" dt)
   "
-  {:api-docs/heading "Logging"}
+  {:api-docs/heading "Miscellaneous"}
   [level & args]
   (apply loggers/console (into [level] args)))

@@ -915,7 +915,7 @@

   The checkpoint includes `app-db`, all registered handlers and all subscriptions.
   "
-  {:api-docs/heading "Utilities"}
+  {:api-docs/heading "Miscellaneous"}
   []
   (let [handlers @registrar/kind->id->handler
         app-db   @db/app-db
@@ -937,7 +937,7 @@

 (defn purge-event-queue
   "Removes all events currently queued for processing"
-  {:api-docs/heading "Events"}
+  {:api-docs/heading "Miscellaneous"}
   []
   (router/purge re-frame.router/event-queue))

@@ -962,7 +962,7 @@
   `id` is typically a keyword. If it supplied when an `f` is added, it can be
   subsequently be used to identify it for removal. See `remove-post-event-callback`.
   "
-  {:api-docs/heading "Events"}
+  {:api-docs/heading "Miscellaneous"}
   ([f]
    (add-post-event-callback f f))   ;; use f as its own identifier
   ([id f]
@@ -973,7 +973,7 @@
   "Unregisters a post event callback function, identified by `id`.

   Such a function must have been previously registered via `add-post-event-callback`"
-  {:api-docs/heading "Events"}
+  {:api-docs/heading "Miscellaneous"}
   [id]
   (router/remove-post-event-callback re-frame.router/event-queue id))

@@ -983,7 +983,7 @@
 (defn register-handler
   "Deprecated. Use `reg-event-db` instead."
   {:deprecated "0.8.0"
-   :api-docs/heading "Events"}
+   :api-docs/heading "Deprecated"}
   [& args]
   (console :warn  "re-frame: \"register-handler\" has been renamed \"reg-event-db\" (look for registration of " (str (first args)) ")")
   (apply reg-event-db args))
@@ -991,7 +991,7 @@
 (defn register-sub
   "Deprecated. Use `reg-sub-raw` instead."
   {:deprecated "0.8.0"
-   :api-docs/heading "Events"}
+   :api-docs/heading "Deprecated"}
   [& args]
   (console :warn  "re-frame: \"register-sub\" is used to register the event " (str (first args)) " but it is a deprecated part of the API. Please use \"reg-sub-raw\" instead.")
   (apply reg-sub-raw args))


Switch back to sonatype client

Switch back to sonatype client

--- src/engulf/url_worker.clj
+++ src/engulf/url_worker.clj
@@ -57,6 +57,6 @@
   (UrlWorker. (atom :initialized)
                 url
                 worker-id
-                (hac-http/http-client {})
+                (ning-http/http-client {})
                 succ-callback
                 err-callback))


Use the real send-email instead of the stub/mock version

--- src/foreclojure/login.clj
+++ src/foreclojure/login.clj
@@ -106,18 +106,15 @@
       (update! :users
                {:_id id}
                {:$set {:pwd pw-hash}})
-      (let [send-email (fn [& args]
-                         (spit (str "/tmp/email" pw)
-                               args))]
-        (send-email
-         {:from "team@4clojure.com"
-          :to [email]
-          :subject "Password reset"
-          :body
-          (str "The password for your 4clojure.com account "
-               name " has been reset to " pw ". Make sure to change it"
-               " soon at https://4clojure.com/login/update - pick"
-               " something you'll remember!")}))
+      (send-email
+       {:from "team@4clojure.com"
+        :to [email]
+        :subject "Password reset"
+        :body
+        (str "The password for your 4clojure.com account "
+             name " has been reset to " pw ". Make sure to change it"
+             " soon at https://4clojure.com/login/update - pick"
+             " something you'll remember!")})
       (flash-msg "Your password has been reset! You should receive an email soon"
                  "/login"))
     (flash-error "We don't know anyone with that email address!"


component can set initial ::routing/token in its (init)

--- src/frontend/routing.cljs
+++ src/frontend/routing.cljs
@@ -47,12 +47,11 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;; Middleware
 (defn -wrap-init
-  "Sets initial token."
+  "Sets ::token to empty string if component didn't already set it."
   [component-init]
   (fn init
     [& args]
-    (-> (apply component-init args)
-        (assoc ::token ""))))
+    (merge {::token ""} (apply component-init args))))

 (defn -wrap-view-model
   "Adds reaction to token."
@@ -107,7 +106,8 @@
 (defn wrap
   "Middlware keeps browser url bar in sync with model.
   Catches [::on-navigate <token>] signal, updates ::token in model.
-  In order to start sending signals invoke start-signaling after component is connected."
+  In order to start sending ::on-navigate signals invoke (start-signaling history component) after component is connected.
+  Component can set initial ::token in its (init)."
   [spec history]
   (-> spec
       (update :init -wrap-init)


Fix warnings which block the CI builds

Fix warnings which block the CI builds

Signed-off-by: Pratik Karki <48ee16e89cc3ed79ec6f449232f648624dd8c0a8@gmail.com>

--- src/lt/util/ipc.cljs
+++ src/lt/util/ipc.cljs
@@ -5,21 +5,21 @@

 ;; `send` and `on` are declared here with their bodies defined later as otherwise Codox will use the
 ;; redefined `send` and `on` in the below when block instead.
-(declare send)
+(declare transport)

-(declare on)
+(declare start)

 ;; Set $IPC_DEBUG to debug incoming and outgoing ipc messages for the renderer process
 (when (aget js/process.env "IPC_DEBUG")
-  (let [old-send send
-        old-on on]
-    (def send (fn [& args]
-                (prn "RENDERER->" args)
-                (apply old-send args)))
-    (def on (fn [channel cb]
-              (old-on channel (fn [_ & args]
-                                (prn "->RENDERER" channel args)
-                                (apply cb args)))))))
+  (let [old-send transport
+        old-on start]
+    (def transport (fn [& args]
+                     (prn "RENDERER->" args)
+                     (apply old-send args)))
+    (def start (fn [channel cb]
+                 (old-on channel (fn [_ & args]
+                                   (prn "->RENDERER" channel args)
+                                   (apply cb args)))))))

 (defn send
   "Delegates to ipc.send, which asynchronously sends args to the browser process's channel."


bind to any address

bind to any address

--- src/ontrail/core.clj
+++ src/ontrail/core.clj
@@ -214,4 +214,4 @@
   (nc/newcomment-cache-restore-all)
   (schedule-work nc/newcomment-cache-store-all 2400)
   (aleph/start-http-server ring-handler
-                     {:host "localhost" :port 8080 :websocket true}))
+                           {:port 8080 :websocket true}))


Revert "Add optional key `:onyx/percentage` in base-task-map schema. (#892)"

This reverts commit 8a221c934ad0ae6757eec1b40382606c094937ff.

--- src/onyx/schema.cljc
+++ src/onyx/schema.cljc
@@ -94,7 +94,6 @@
    (s/optional-key :onyx/max-peers) PosInt
    (s/optional-key :onyx/min-peers) PosInt
    (s/optional-key :onyx/n-peers) PosInt
-   (s/optional-key :onyx/percentage) PosInt
    (s/optional-key :onyx/required-tags) [s/Keyword]
    (restricted-ns :onyx) s/Any})


interim version pre Sat/Parents

interim version pre Sat/Parents

--- src/prais2/faqs.cljs
+++ src/prais2/faqs.cljs
@@ -63,114 +63,84 @@
    (map-indexed key-with
                 (map #(render-glossary-term %) glossary))])

-(rum/defc render-faq-menu []
-  )
+(rum/defc render-faq-block [sec-ix block-class]
+  (let [section (content/faq-sections sec-ix)]
+    [:div.faq-block {:class block-class}
+     [:h4 (:section section)]
+     [:ul.list-unstyled
+      (for [[ix faq] (map-indexed vector (:faqs section))]
+        [:li [:a {:href (str "#/faq/" sec-ix "/" ix)} (:title faq)]])]]))
+
+
+(rum/defc render-faq-top [faq-ref]
+  [:div
+   [:h1.col-md-12 content/title]
+   ;; new block menu
+
+   ;; column 1
+   [:div.col-sm-4
+    (render-faq-block 0 "faq-nav-1")
+    (render-faq-block 2 "faq-nav-2")]
+
+   ;; column 2
+   [:div.col-sm-4
+    (render-faq-block 1 "faq-nav-3")]
+
+   ;; column 3
+   [:div.col-sm-4
+    (render-faq-block 3 "faq-nav-4")
+    (render-faq-block 4 "faq-nav-4")
+    (render-faq-block 5 "faq-nav-4")
+    (render-faq-block 6 "faq-nav-4")]
+
+   ;; old bubble menu
+   #_(map-indexed key-with
+                  (map render-section
+                       (vec (zipmap (range) faq-sections))))])
+
+
+(rum/defc render-faq-section [faq-ref]
+  [:#faq.col-md-10.col-md-offset-1
+     (let [[section-ix ix] faq-ref
+           section (faq-sections section-ix)
+           faq ((:faqs section) ix)
+           short-answer (:short-answer faq)
+           glossary (:glossary faq)]
+       [:div
+        [:h2 {:key 1}
+         [:div {:style {:margin-top "-32px"
+                        :width "80px"
+                        :float "left"}} [:i.fa.fa-question {:style {:font-size "100px"
+                                                                    :color "#FFA500"}}]]
+         [:div {:style {:margin-top "40px"}}
+          (:title faq)]]
+        (when short-answer
+          (do
+            (prn "rendering short answer for section " section-ix "." ix)
+            (render-short-answer short-answer)))
+        [:div {:key 2
+               :style {:clear "both"}} (:body faq)]
+        (when (> (count glossary) 0)
+          (do
+            (prn "rendering glossary " glossary)
+            (render-glossary glossary)))
+        [:button.btn.btn-primary
+         {:key 3
+          :style {:margin-bottom "100px"}
+          :on-click #(core/click->event-bus % :faqs :top)
+          :on-touch-start #(core/click->event-bus % :faqs :top)
+          }
+         "Back"
+         ]])])

 (rum/defc render-faqs [faq-ref]

-  (prn "rendering " faq-ref)
   [:.container-fluid
    [:.row
+
     (if (= :top faq-ref)
-      [:div
-       [:h1.col-md-12 content/title]
-       ;; new block menu
-
-       ;; column 1
-       [:div.col-sm-4
-        (let [section (content/faq-sections 0)]
-          [:div.faq-block.faq-nav-1
-           [:h4 (:section section)]
-           [:ul.list-unstyled
-            (for [[ix faq] (map-indexed vector (:faqs section))]
-              [:li [:a {:href (str "#/faq/0/" ix)} (:title faq)]])]])
-
-        (let [section (content/faq-sections 2)]
-          [:div.faq-block.faq-nav-2
-           [:h4 (:section section)]
-           [:ul.list-unstyled
-            (for [faq (:faqs section)]
-              [:li (:title faq)])]])]
-
-
-       ;; column 2
-       [:div.col-sm-4
-        (let [section (content/faq-sections 1)]
-          [:div.faq-block.faq-nav-3
-           [:h4 (:section section)]
-           [:ul.list-unstyled
-            (for [faq (:faqs section)]
-              [:li (:title faq)])]])
-        ]
-
-       ;; column 3
-       [:div.col-sm-4
-        (let [section (content/faq-sections 3)]
-          [:div.faq-block.faq-nav-4
-           [:h4 (:section section)]
-           [:ul.list-unstyled
-            (for [faq (:faqs section)]
-              [:li (:title faq)])]])
-        (let [section (content/faq-sections 4)]
-          [:div.faq-block.faq-nav-4
-           [:h4 (:section section)]
-           [:ul.list-unstyled
-            (for [faq (:faqs section)]
-              [:li (:title faq)])]])
-        (let [section (content/faq-sections 5)]
-          [:div.faq-block.faq-nav-4
-           [:h4 (:section section)]
-           [:ul.list-unstyled
-            (for [faq (:faqs section)]
-              [:li (:title faq)])]])
-        (let [section (content/faq-sections 6)]
-          [:div.faq-block.faq-nav-4
-           [:h4 (:section section)]
-           [:ul.list-unstyled
-            (for [faq (:faqs section)]
-              [:li (:title faq)])]])
-
-]
-
-
-
-
-       ;; old bubble menu
-       #_(map-indexed key-with
-                    (map render-section
-                         (vec (zipmap (range) faq-sections))))
-
-       ]
-      [:#faq.col-md-10.col-md-offset-1
-       (let [[section-ix ix] faq-ref
-             section (faq-sections section-ix)
-             faq ((:faqs section) ix)
-             short-answer (:short-answer faq)
-             glossary (:glossary faq)]
-         [:div
-          [:h2 {:key 1}
-           [:div {:style {:margin-top "-32px"
-                          :width "80px"
-                          :float "left"}} [:i.fa.fa-question {:style {:font-size "100px"
-                                                                      :color "#FFA500"}}]]
-           [:div {:style {:margin-top "40px"}}
-            (:title faq)]]
-          (when short-answer
-            (do
-              (prn "rendering short answer for section " section-ix "." ix)
-              (render-short-answer short-answer)))
-          [:div {:key 2
-                 :style {:clear "both"}} (:body faq)]
-          (when (> (count glossary) 0)
-            (do
-              (prn "rendering glossary " glossary)
-              (render-glossary glossary)))
-          [:button.btn.btn-primary
-           {:key 3
-            :style {:margin-bottom "100px"}
-            :on-click #(core/click->event-bus % :faqs :top)
-            :on-touch-start #(core/click->event-bus % :faqs :top)
-            }
-           "Back"
-           ]])])]])
+      (render-faq-top faq-ref)
+      (render-faq-section faq-ref)
+      )
+    ]])


Better words.

Better words.

--- src/re_com/core.cljs
+++ src/re_com/core.cljs
@@ -182,10 +182,10 @@
 ;;--------------------------------------------------------------------------------------------------

 (def md-circle-icon-button-args-desc
-  [{:name :md-icon-name  :required true                   :type "string"     :description "Label for the button (can be artitrary markup)."}
-   {:name :size          :required false  :default 36     :type "integer"    :description "Set size of button in pixels (do not add 'px' prefix)."}
-   {:name :disabled?     :required false                  :type "boolean"    :description "Set to true to disable the button."}
-   {:name :on-click      :required false                  :type "keyword"    :description "Callback when the button is clicked."}])
+  [{:name :md-icon-name  :required true   :default "md-add" :type "string"     :description "The name of the icon. See http://zavoloklom.github.io/material-design-iconic-font/icons.html"}
+   {:name :size          :required false  :default 36       :type "integer"    :description "Set size of button in pixels (do not add 'px' prefix)."}
+   {:name :disabled?     :required false                    :type "boolean"    :description "If true, the user can't click the button."}
+   {:name :on-click      :required false                    :type "() -> nil"  :description "The fucntion to call when the button is clicked."}])

 (def md-circle-icon-button-args
   (set (map :name md-circle-icon-button-args-desc)))
@@ -200,7 +200,7 @@
   (let [hover? (reagent/atom false)]
     (fn
       [& {:keys [md-icon-name size disabled? on-click]
-          :or   {disabled? false}}]
+          :or   {md-icon-name "md-add" disabled? false}}]
       [:div {:class       "rc-md-circle-icon-button rc-md-circle-icon-button"
              :style       {:width   (when size (px size))
                            :height  (when size (px size))


+(defn np-grammar-debug)

+(defn np-grammar-debug)


successful file upload debug output on server

--- src/server/core.cljs
+++ src/server/core.cljs
@@ -53,7 +53,10 @@
     (fn [stream data]
       (let [absolute-file-path (string/join [(string/join [file-upload-directory "/"]) (.v4 js-uuid)])]
         (println (string/join ["Saving file as: " absolute-file-path]))
-        (.pipe stream (.createWriteStream fs absolute-file-path))))))
+        (.pipe stream (.createWriteStream fs absolute-file-path))
+        (.on stream "end"
+          (fn []
+            (println (str "Successfully uploaded " absolute-file-path)))))))A)

 (.on io "connection" connection)


cleanup

cleanup

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -72,84 +72,6 @@
    (fail? (unifyc (get-in parent [:head :synsem :subcat :2] :top)
                   (get-in child [:synsem :subcat :2] :top)))))

-(def head-precheck-pairs
-  [[[:head :synsem :infl]       [:synsem :infl]]
-   [[:head :synsem :subcat]     [:synsem :subcat]]
-   [[:head :synsem :agr]        [:synsem :agr]]
-   [[:head :phrasal]            [:phrasal]]
-   [[:head :synsem :sem]        [:synsem :sem]]
-   [[:head :synsem :aux]        [:synsem :aux]]
-   [[:head :synsem :cat]        [:synsem :cat]]
-   [[:head :synsem :pronoun]    [:synsem :pronoun]]
-   [[:head :synsem :propernoun] [:synsem :propernoun]]
-   [[:head :synsem :subcat :1]  [:synsem :subcat :1]]
-   [[:head :synsem :subcat :2]  [:synsem :subcat :2]]])
-
-(defn head-pre-checks2 [parent child]
-  (not (nil?
-        (some #(= :fail %)
-              (mapfn (fn [pair]
-                       (log/trace (str "head-pre-checks2: looking at pair: " pair))
-                       (let [parent-value (get-in parent (first pair) :top)
-                             child-value (get-in child (second pair) :top)
-                             result
-                             (unifyc parent-value child-value)]
-                         (log/trace (str "head-pre-checks2: result: " result))
-                         (if (fail? result)
-                           (do
-                             (log/trace (str "head precheck failed  for pair: " pair))
-                             (log/trace (str "head precheck failed: parent wanted: " (strip-refs parent-value) ";"
-                                             "child has: " (strip-refs child-value)))
-                             (log/trace (str " parent is: " (strip-refs parent)))
-                           (log/trace (str " child is: " (strip-refs child)))
-                           :fail)
-                           (do
-                             (log/trace (str "head precheck success for pair: " pair))
-                             :top))))
-                     (lazy-seq head-precheck-pairs))))))
-
-(def comp-precheck-pairs
-  [{:parent [:comp :synsem :cat]
-    :childc [:synsem :cat]}
-
-   {:parent [:comp :synsem :agr]
-    :childc [:synsem :agr]}
-
-   {:parent [:comp :synsem :case]
-    :childc [:synsem :case]}
-
-   {:parent [:comp :synsem :sem]
-    :childc [:synsem :sem]}
-
-   {:parent [:comp :synsem :reflexive]
-    :childc [:synsem :reflexive]}
-
-   {:parent [:comp :synsem :pronoun]
-    :childc [:synsem :pronoun]}
-
-   {:parent [:comp :synsem :subcat]
-    :childc [:synsem :subcat]}])
-
-(defn comp-pre-checks2 [parent child]
-  (some #(= :fail %)
-        (mapfn (fn [pair]
-                 (let [parent-value (get-in parent (:parent pair) :top)
-                       child-value (get-in parent (:childc pair) :top)
-                       result
-                       (unifyc parent-value child-value)]
-                   (log/debug (str "comp-pre-checks2: result: " result))
-                   (if (fail? result)
-                     (do
-                       (log/trace (str "comp precheck failed  for pair: " pair))
-                       (log/trace (str "comp precheck failed: parent wanted: " (strip-refs parent-value) ";"
-                                       "child has: " (strip-refs child-value)))
-                       (log/trace (str " child is: " (strip-refs child)))
-                       :fail)
-                     (do
-                       (log/trace (str "comp precheck success for pair: " pair))
-                       :top))))
-               (lazy-seq comp-precheck-pairs))))
-
 (defn comp-pre-checks [parent child]
   (or
    (fail? (unifyc (get-in parent [:comp :synsem :cat] :top)
@@ -172,8 +94,6 @@
     (log/trace (str "moreover-head (candidate) parent: [" (get-in parent [:rule]) "] '" (morph parent) "' sem:    " (strip-refs (get-in parent '(:synsem :sem) :no-semantics))))
     (log/trace (str "moreover-head (candidate) head child: [" (get-in parent [:child]) "] '" (morph child) "' sem:" (strip-refs (get-in child '(:synsem :sem) :top))))
     (let [head-pre-checks (head-pre-checks parent child)
-          ;; TODO: replace head-pre-checks with head-pre-checks2
-          ;;head-pre-checks2 (head-pre-checks2 parent child)
           result
           (if head-pre-checks
             (do


-(defn head-pre-checks): doesn't seem to be worth the time required

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -41,28 +41,6 @@
       (log/debug (str "check-vals caught a fail: p1=" p1 "; p2=" p2 "; fail-path:" (fail-path m1 m2))))
     result))

-(defn head-pre-checks [parent child]
-  (or
-   (check-vals parent child [:head :synsem :cat]            [:synsem :cat])
-   (check-vals parent child [:head :synsem :essere]         [:synsem :essere])
-   (check-vals parent child [:head :synsem :subcat :1 :cat] [:synsem :subcat :1 :cat])
-   (check-vals parent child [:head :synsem :subcat :2 :cat] [:synsem :subcat :2 :cat])
-   (check-vals parent child [:head :synsem :infl]           [:synsem :infl])
-   (check-vals parent child [:head :phrasal]                [:phrasal])
-   (check-vals parent child [:head :synsem :agr]            [:synsem :agr])
-   (check-vals parent child [:head :synsem :sem]            [:synsem :sem])
-   (check-vals parent child [:head :synsem :aux]            [:synsem :aux])
-   (check-vals parent child [:head :synsem :pronoun]        [:synsem :pronoun])
-   (check-vals parent child [:head :synsem :propernoun]     [:synsem :propernoun])
-   (check-vals parent child [:head :synsem :subcat]         [:synsem :subcat])
-   (check-vals parent child [:head :modified]               [:modified])
-   ;; TODO: language-specific rules should be supplied from their respective namespaces.
-   (check-vals parent child [:head :espanol :espanol]       [:espanol :espanol])
-   (check-vals parent child [:head :italiano :italiano]     [:italiano :italiano])
-   (check-vals parent child [:head :synsem :comp-type]      [:synsem :comp-type])
-
-   ))
-
 (defn comp-pre-checks [parent child]
   (or
    (check-vals parent child [:comp :synsem :cat]            [:synsem :cat])
@@ -78,15 +56,9 @@
   (let [morph (if morph morph (fn [x] (str "(no morph function provided:" x)))]
     (log/trace (str "moreover-head (candidate) parent: [" (get-in parent [:rule]) "] '" (morph parent) "' sem:    " (strip-refs (get-in parent '(:synsem :sem) :no-semantics))))
     (log/trace (str "moreover-head (candidate) head child: [" (get-in parent [:child]) "] '" (morph child) "' sem:" (strip-refs (get-in child '(:synsem :sem) :top))))
-    (let [head-pre-checks (head-pre-checks parent child)
-          result
-          (if head-pre-checks
-            (do
-              (log/trace (str "moreover-head: head failed prechecks for parent: " (get-in parent [:rule])))
-              :fail)
-            (unify
-             (copy parent)
-             {:head (copy child)}))]
+    (let [result (unify
+                  (copy parent)
+                  {:head (copy child)})]
       (if (not (fail? result))
         (let [debug (log/trace (str "moreover-head: " (get-in parent '(:rule)) " succeeded: " (get-in result [:rule])
                                     ":'" (morph result) "'"))
@@ -104,15 +76,6 @@
         ;; Ideally the attempt would always succeed, because calling (moreover-head) is expensive
         ;; because of the need to copy structures.
         (do
-          (if (not (= true head-pre-checks))
-            (log/warn (str "moreover-head: pre-check missed: fail-path-between "
-                           "parent:'" (get-in parent [:rule]) "' and child with pred:"
-                           (get-in child [:rule] (get-in child [:synsem :sem :pred] :nopred)) " ; "
-                           (let [{path :fail-path
-                                  parent-value :val1
-                                  head-value :val2} (fail-path parent {:head child})]
-                             (str "parent[" path        "] = " parent-value ";")))))
-
           (if (= *extra-diagnostics* true)
             (let [fail-path (get-fail-path (get-in parent [:head]) child)]
               (log/trace (str "moreover-head: failed to add head: '" (morph child) "' to parent: " (get-in parent [:rule])))


in verbose mode show how many sources are being optimized

--- src/main/clojure/cljs/closure.clj
+++ src/main/clojure/cljs/closure.clj
@@ -1666,7 +1666,7 @@
                                              (- (count (.split #"\r?\n" fdeps-str -1)) 1))]
                              (->>
                                (util/measure compiler-stats
-                                 "Optimize sources"
+                                 (str "Optimizing " (count js-sources) " sources")
                                  (apply optimize all-opts
                                    (remove foreign-source? js-sources)))
                                (add-wrapper all-opts)


Remove NaNs from distances.

Remove NaNs from distances.

--- project/analyze-data/src/analyze_data/knn/core.clj
+++ project/analyze-data/src/analyze_data/knn/core.clj
@@ -17,7 +17,9 @@
   (let [dot-product (m/mmul X y)
         product-of-norms (m/mul (map m/magnitude X) (m/magnitude y))
         cosine-similarity (m/div dot-product product-of-norms)]
-    (m/sub 1 cosine-similarity)))
+    (->> cosine-similarity
+         (m/sub 1)
+         (m/emap #(if (Double/isNaN %) 1.0 %)))))

 (defn euclidean-distance
   "Euclidean distance between each vector in X and y.


[hotfix] Rename keys-as-allowed-values-help-text to keys->allowed-values-help-text

--- flink-jepsen/src/jepsen/flink/flink.clj
+++ flink-jepsen/src/jepsen/flink/flink.clj
@@ -98,7 +98,7 @@
             :checker   (flink-checker/job-running-checker)})
          (assoc opts :concurrency 1)))

-(defn keys-as-allowed-values-help-text
+(defn- keys->allowed-values-help-text
   "Takes a map and returns a string explaining which values are allowed.
   This is a CLI helper function."
   [m]
@@ -121,20 +121,20 @@
          :opt-spec [[nil "--test-spec FILE" "Path to a test specification (.edn)"
                      :parse-fn read-test-spec
                      :validate [#(->> % :dbs (map dbs) (every? (complement nil?)))
-                                (str "Invalid :dbs specification. " (keys-as-allowed-values-help-text dbs))]]
+                                (str "Invalid :dbs specification. " (keys->allowed-values-help-text dbs))]]
                     [nil "--ha-storage-dir DIR" "high-availability.storageDir"]
                     [nil "--nemesis-gen GEN" (str "Which nemesis should be used?"
-                                                  (keys-as-allowed-values-help-text fn/nemesis-generator-factories))
+                                                  (keys->allowed-values-help-text fn/nemesis-generator-factories))
                      :parse-fn keyword
                      :default :kill-task-managers
                      :validate [#(fn/nemesis-generator-factories %)
-                                (keys-as-allowed-values-help-text fn/nemesis-generator-factories)]]
+                                (keys->allowed-values-help-text fn/nemesis-generator-factories)]]
                     [nil "--client-gen GEN" (str "Which client should be used?"
-                                                 (keys-as-allowed-values-help-text client-gens))
+                                                 (keys->allowed-values-help-text client-gens))
                      :parse-fn keyword
                      :default :poll-job-running
                      :validate [#(client-gens %)
-                                (keys-as-allowed-values-help-text client-gens)]]
+                                (keys->allowed-values-help-text client-gens)]]
                     [nil "--job-running-healthy-threshold TIMES" "Number of consecutive times the job must be running to be considered healthy."
                      :default 5
                      :parse-fn #(Long/parseLong %)


min-peers is not required if max-peers and n-partitions is 1

--- src/onyx/plugin/kafka.clj
+++ src/onyx/plugin/kafka.clj
@@ -128,7 +128,8 @@

 (defn check-num-peers-equals-partitions [{:keys [onyx/min-peers onyx/max-peers] :as task-map}
                                          n-partitions]
-  (when-not (= n-partitions min-peers max-peers)
+  (when-not (or (= n-partitions min-peers max-peers)
+                (= 1 n-partitions max-peers))
     (let [e (ex-info ":onyx/min-peers must equal :onyx/max-peers and the number of kafka partitions"
                      {:n-partitions n-partitions
                       :min-peers min-peers


Further tweaks to the mixer. The mixer now 'clicks' slightly annoyingly between a safe clipped sound and a ultra safe super clipped sound when the volume is too high. Would be good to get some ideas on how to communicate that the sound is too high both in terms of log messages and in terms of the final audio.

--- src/overtone/sc/mixer.clj
+++ src/overtone/sc/mixer.clj
@@ -21,13 +21,6 @@
            (fn [k r old new-gain]
              (ctl (main-input-group) :master-gain new-gain)))

-(on-event "/server-audio-clipping-rogue-input"
-          (fn [msg]
-            (println "TOO LOUD!! (clipped) Bus:"
-                     (int (nth (:args msg) 2))
-                     "- fix source synth"))
-          ::server-audio-clipping-warner-input)
-
 (on-event "/server-audio-clipping-rogue-vol"
           (fn [msg]
             (println "TOO LOUD!! (clipped) Bus:"
@@ -40,23 +33,18 @@
     (defsynth out-bus-mixer [in-bus 20 out-bus 0
                              volume 0.5 master-volume @master-vol*]
       (let [source        (internal:in in-bus)
-            source        (clip2 source 2)
-            not-safe?     (> (a2k source) 1)
+            source        (* volume master-volume source)
+            not-safe?     (trig1 (a2k (> source 1)) 1)
             limited       (compander source source 0.7
                                      1 0.1
                                      0.05 0.05)
             std-clipped   (clip2 limited 1)
             safe-clipped  (clip2 limited 0.1)
-            safe-snd      (select not-safe? [std-clipped safe-clipped])
-            amplified-snd (* volume master-volume safe-snd)
-            final-snd     (clip2 amplified-snd 1)]
-        (send-reply (trig1 (> (a2k amplified-snd) 1) 0.25)
+            safe-snd      (select not-safe? [std-clipped safe-clipped])]
+        (send-reply not-safe?
                     "/server-audio-clipping-rogue-vol"
                     out-bus)
-        (send-reply (trig1 not-safe? 0.25)
-                    "/server-audio-clipping-rogue-input"
-                    out-bus)
-        (internal:out out-bus final-snd)))
+        (internal:out out-bus safe-snd)))

     (defsynth in-bus-mixer [in-bus 10 out-bus 0
                             gain 1 master-gain @master-gain*]


prevent goog caching for generated virtual sources

--- src/main/shadow/build/closure.clj
+++ src/main/shadow/build/closure.clj
@@ -2223,7 +2223,18 @@
         state
         (if-not need-compile?
           state
-          (convert-goog* state sources))
+          (convert-goog* state (remove :virtual sources)))
+
+        ;; virtual sources should never be compiled and just be used as is
+        state
+        (->> sources
+             (filter :virtual)
+             (reduce
+               (fn [state {:keys [resource-id source] :as rc}]
+                 (update state :output assoc resource-id {:resource-id resource-id
+                                                          :source source
+                                                          :js source}))
+               state))

         cache-index-updated
         (if-not need-compile?


Comments.

Comments.

--- src/cbfg/fence.cljs
+++ src/cbfg/fence.cljs
@@ -60,14 +60,14 @@
                               (if (:fence v) new-inflight nil)
                               nil)))
       (= v nil) (let [new-inflights (disj inflights ch)] ; an inflight request is done.
-                  (if (empty? new-inflights)
-                    (do (when fenced-res                 ; all inflight requests are done, so we can
-                          (aput out-ch fenced-res))      ; send the fenced-res that we've been keeping.
+                  (if (empty? new-inflights)             ; if inflight requests are all done,
+                    (do (when fenced-res                 ; finally send the fenced-res that
+                          (aput out-ch fenced-res))      ; we have been holding onto.
                         (recur new-inflights nil nil))
                     (recur new-inflights fenced fenced-res)))
       (= ch fenced) (do (when fenced-res
-                          (aput out-ch fenced-res))      ; send off any previous fenced-res so
-                        (recur inflights fenced v))      ; we can keep v as our latest fenced-res.
+                          (aput out-ch fenced-res))      ; send any previous fenced-res so
+                        (recur inflights fenced v))      ; we can hold v as last fenced-res.
       :else (do (aput out-ch v)
                 (recur inflights fenced fenced-res))))))


Fix incorrect use of js/console.warn (it's not js/console.warning)

--- src/main/workflo/macros/view.cljs
+++ src/main/workflo/macros/view.cljs
@@ -45,14 +45,14 @@
    om.dom/div to avoid breaking apps entirely."
   []
   (if-not (get-config :wrapper-view)
-    (do (js/console.warning "No wrapper view defined for defview.")
+    (do (js/console.warn "No wrapper view defined for defview.")
         om.dom/div)
     (get-config :wrapper-view)))

 (defn handle-command
   [cmd-name view params reads]
   (if-not (get-config :handle-command)
-    (js/console.warning "No command handler defined for defview.")
+    (js/console.warn "No command handler defined for defview.")
     (some-> :handle-command get-config
             (apply [cmd-name view params reads]))))


Accept _v4 postfix for configuration files

--- src/cider_ci/repository/project_configuration.clj
+++ src/cider_ci/repository/project_configuration.clj
@@ -19,7 +19,9 @@

 (def ^:private CONFIG-FILES-ALTERNATIVES
-  ["cider-ci.yml" ".cider-ci.yml"
+  ["cider-ci_v4.yml" ".cider-ci_v4.yml"
+   "cider-ci_v4.json" ".cider-ci_v4.json"
+   "cider-ci.yml" ".cider-ci.yml"
    "cider-ci.json" ".cider-ci.json"])

 (defn- get-content-or-nil [id path]


bugfix

bugfix

--- src/cljs/wombats_web_client/panels/game_play.cljs
+++ src/cljs/wombats_web_client/panels/game_play.cljs
@@ -158,7 +158,9 @@
       (fn [{:keys [game-id]}]
         (let [game (get @games game-id)
               winner (:game/winner game)]
-
+
+          (arena/arena @arena canvas-id)
+
           [:div {:class-name root-class}
            [:div.left-game-play-panel {:id "wombat-arena"
                                        :class (when winner "game-over")}


additional styling calculations for cell labels

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -65,14 +65,17 @@

 (def get-cell-xy (juxt mod quot))

-(defn get-cell-transform [app i]
+(defn get-cell-style [app i]
   (let [size  (:grid-size app)
         pct   (str (/ 100 size) \%)
+        px    (/ (:grid-px app) size)
         [x y] (get-cell-xy i size)]
     #js {
-      :transform (t3d (* 100 x) (* 100 y))
-      :width     pct
-      :height    pct}))
+      :transform  (t3d (* 100 x) (* 100 y))
+      :width      pct
+      :height     pct
+      :lineHeight (str px "px")
+      :fontSize   (/ px 10)}))

 (defn get-bg-transform [app i]
@@ -123,7 +126,7 @@
       (dom/div #js {
         :react-key n
         :className (str "cell" (when is-adj " adjacent"))
-        :style     (get-cell-transform app idx)
+        :style     (get-cell-style app idx)
         :onClick   #(when is-adj (move! app n))}
           (dom/video #js {
             :src      (:stream app)


Don't throw error when drawing a nil

Don't throw error when drawing a nil

--- src/play_clj/entities.clj
+++ src/play_clj/entities.clj
@@ -15,6 +15,8 @@
   clojure.lang.PersistentArrayMap
   (draw-entity! [this screen batch])
   clojure.lang.PersistentHashMap
+  (draw-entity! [this screen batch])
+  nil
   (draw-entity! [this screen batch]))

 (defrecord TextureEntity [object] Entity


Should not add the extra translation of 'origin-x, origin-y'

--- src/play_clj/entities.clj
+++ src/play_clj/entities.clj
@@ -21,7 +21,7 @@

 (defrecord TextureEntity [object] Entity
   (draw! [{:keys [^TextureRegion object x y width height
-                  scale-x scale-y angle origin-x origin-y color]}
+                  scale-x scale-y angle color]}
           _
           batch]
     (let [x (float (or x 0))
@@ -33,10 +33,8 @@
       (if (or scale-x scale-y angle)
         (let [scale-x (float (or scale-x 1))
               scale-y (float (or scale-y 1))
-              origin-x (float (or origin-x (/ width 2)))
-              origin-y (float (or origin-y (/ height 2)))
               angle (float (or angle 0))]
-          (.draw ^Batch batch object x y origin-x origin-y width height
+          (.draw ^Batch batch object x y 0 0 width height
             scale-x scale-y angle))
         (.draw ^Batch batch object x y width height))
       (when color


add fn for determining the default ugen rate given a list of possible rates

--- src/overtone/sc/ugen/defaults.clj
+++ src/overtone/sc/ugen/defaults.clj
@@ -27,6 +27,11 @@
 (def UGEN-RATE-SORT-FN
   (zipmap UGEN-DEFAULT-RATE-PRECEDENCE (range (count UGEN-DEFAULT-RATE-PRECEDENCE))))

+(defn default-ugen-rate
+  "Given a list of rates, returns the default rate based on UGEN-RATE-SORT-FN"
+  [rates]
+  (first (sort-by UGEN-RATE-SORT-FN rates)))
+
 (def NO-ARG-DOC-FOUND "-")

 (def DEFAULT-ARG-DOCS
@@ -41,4 +46,3 @@
    })

 (def DOC-WIDTH 45)
-


Add wiki generation functions.

Add wiki generation functions.

--- src/quil/helpers/docs.clj
+++ src/quil/helpers/docs.clj
@@ -1,6 +1,7 @@
 (ns ^{:doc "Functions for filtering/displaying docs in REPL and generating wiki pages."}
   quil.helpers.docs
-  (:require [clojure.set :refere [difference]]))
+  (:require [clojure.string :as cstr]
+            [clojure.java.io :as io]))

 (defn- fn-metas-with-orig-method-name
   "Returns a seq of metadata maps for all fns with a corresponding
@@ -103,3 +104,74 @@
     (doseq [l lines]
       (println l))))

+
+;;; wiki generation
+
+(defn- as-url [str]
+  (cstr/replace str " " "-"))
+
+(defn- as-filename [& path]
+  (->> path (map as-url) (cstr/join "/")))
+
+(defn- as-filename-ext [& path]
+  (str (apply as-filename path) ".md"))
+
+(defn- write-lines [file lines]
+  (io/make-parents file)
+  (spit file (cstr/join \newline lines)))
+
+(defn- link
+  ([to]
+    (link to (as-filename to)))
+  ([text to]
+    (format "[[%s|%s]]" text to)))
+
+(defn- generate-all-categories-page [fn-metas folder]
+  (let [cats (sort (fields-as-sorted-set fn-metas :category))
+        lines (map #(str "* " (link %)) cats)]
+    (write-lines (as-filename-ext folder "all_categories") lines)))
+
+(defn- generate-category-page [category folder]
+  (let [{:keys [name fns subcategories]} category
+        fn-line (fn [fn-name]
+                  (str "* " (link fn-name (as-filename name fn-name))))
+        subcat-lines (fn [subcat]
+                       (concat [""
+                                (str "## " (:name subcat))]
+                               (map fn-line (:fns subcat))
+                               []))
+        lines (flatten (concat (map fn-line fns)
+                               (map subcat-lines (vals subcategories))))]
+    (write-lines (as-filename-ext folder name) lines)))
+
+(defn- generate-function-page [fn-meta folder]
+  (let [{:keys [name arglists subcategory added doc
+                processing-name requires-bindings category]} fn-meta
+        bold #(str "**" % "**")
+        lines [(str "## " name)
+               (bold "Arguments") (map #(str "`" (pr-str %) "`  ") arglists)
+               (bold "Docstring") doc
+               (bold "Category") (link category)
+               (if subcategory
+                 [(bold "Subcategory") "" (format "[[%s|%s#%s]]"
+                                                  subcategory
+                                                  (as-filename category)
+                                                  (as-filename subcategory))]
+                 nil)
+               (bold "Works only inside sketch functions?") (if requires-bindings "Yes" "No")
+               (bold "Original Processing method") (if processing-name
+                                                     (str "`" processing-name "`")
+                                                     "None. It is present only in Quil.")
+               (bold "Added in") added]]
+     (write-lines (as-filename-ext folder category name)
+                  (->> lines (remove nil?) (interpose "") flatten))))
+
+(defn- generate-all [fn-metas folder]
+  (generate-all-categories-page fn-metas folder)
+  (let [category-map (sorted-category-map fn-metas)]
+    (doseq [category (vals category-map)]
+      (generate-category-page category folder)))
+  (doseq [fn-meta (filter :category fn-metas)]
+    (generate-function-page fn-meta folder)))
+
+;(generate-all quil.core/fn-metas "../wiki")


Fix missing arg

Fix missing arg

--- src/refactor_nrepl/middleware.clj
+++ src/refactor_nrepl/middleware.clj
@@ -57,7 +57,8 @@

                      (set? v) (list v)

-                     :else v))))
+                     :else v))
+                 data))

 (defn- serialize-response [{:keys [serialization-format] :as msg} response]
   (condp = serialization-format


cleanup, default width, center throbber

cleanup, default width, center throbber

--- src/re_com/typeahead.cljs
+++ src/re_com/typeahead.cljs
@@ -149,7 +149,7 @@
       :tab   (swap! state-atom suggestion-select-next)
       true)))

-(defn- typeahead-base
+(defn- typeahead
   "Returns markup for a typeahead text input"
   [& {:keys [model data-source] :as args}]
   {:pre [(validate-args-macro typeahead-args-desc args "typeahead")]}
@@ -161,7 +161,8 @@
       [& {:keys [model placeholder width height status-icon? status status-tooltip disabled? class style]
           :as   args}]
       {:pre [(validate-args-macro typeahead-args-desc args "typeahead")]}
-      (let [{:keys [suggestions waiting? model suggestion-selected-index]} @state-atom]
+      (let [{:keys [suggestions waiting? model suggestion-selected-index]} @state-atom
+            width (or width "250px")]
         [v-box
          :width width
          :children
@@ -185,7 +186,7 @@
             [v-box
              :class "rc-typeahead-suggestions"
              :children [(when waiting?
-                          [throbber :size :small :class "rc-typeahead-throbber"])
+                          [box :align :center :child [throbber :size :small :class "rc-typeahead-throbber"]])
                         (for [[ i s ] (map vector (range) suggestions)
                               :let [selected? (= suggestion-selected-index i)]]
                           [box
@@ -195,7 +196,3 @@
                            :attr {:on-mouse-over #(swap! state-atom suggestion-select-set i)
                                   :on-mouse-down #(do (.preventDefault %) (swap! state-atom suggestion-select-choose))
                                   }])]])]]))))
-
-(defn typeahead
-  [& args]
-  (apply typeahead-base args))


Concatenate doc strings when flattening groups in flat-plan

--- src/main/clojure/com/stuartsierra/lazytest/plan.clj
+++ src/main/clojure/com/stuartsierra/lazytest/plan.clj
@@ -11,28 +11,34 @@
   (instance? RunnableExample x))

 (defn- new-runnable-example
-  [f group contexts parent-tags]
+  [f group contexts parent-tags parent-doc]
   {:pre [(nil-or set? (:tags (meta f)))]}
-  (RunnableExample. f contexts
-		    (assoc (meta f)
-		      :group group
-		      :tags (union parent-tags (:tags (meta f))))
-		    nil))
+  (let [m (meta f)]
+    (RunnableExample. f contexts
+		      (assoc m
+			:group group
+			:doc (str parent-doc (when parent-doc " ") (:doc m))
+			:tags (union parent-tags (:tags m)))
+		      nil)))

 (defn flatten-group
   "Given a Group g, returns a flat sequence of RunnableExamples from
-  that group and all its subgroups. Tags are inherited."
-  ([g] (flatten-group g [] #{}))
-  ([g parent-contexts parent-tags]
+  that group and all its subgroups. Tags are inherited, doc strings
+  are concatenated."
+  ([g] (flatten-group g [] #{} nil))
+  ([g parent-contexts parent-tags parent-doc]
      {:pre [(group? g)
 	    (every? context? parent-contexts)]
       :post [(seq? %)
 	     (every? (fn [x] (instance? RunnableExample x)) %)]}
      (let [combined-contexts (vec (concat parent-contexts (:contexts g)))
-	   combined-tags (union parent-tags (:tags (meta g)))]
-       (concat (map #(new-runnable-example % g combined-contexts combined-tags)
+	   combined-tags (union parent-tags (:tags (meta g)))
+	   combined-doc (str parent-doc (when parent-doc " ") (:doc (meta g)))]
+       (concat (map #(new-runnable-example % g combined-contexts combined-tags
+					   combined-doc)
 		    (:examples g))
-	       (mapcat #(flatten-group % combined-contexts combined-tags)
+	       (mapcat #(flatten-group % combined-contexts combined-tags
+				       combined-doc)
 		       (:subgroups g))))))

 (defn has-tag?


CMR-997: Fixing failing granule ingest

CMR-997: Fixing failing granule ingest

--- umm-lib/src/cmr/umm/validation/core.clj
+++ umm-lib/src/cmr/umm/validation/core.clj
@@ -30,7 +30,10 @@

 (def granule-validations
   "Defines validations for granules"
-  {})
+  {
+   ;; TODO this is a temporary validation. There must be at least one validation or else bouncer fails.
+   :access-value v/number
+   })

 (def umm-validations
   "A list of validations by type"


nicer formatting for generic SQL QP SQL logging

--- src/metabase/driver/generic_sql/query_processor.clj
+++ src/metabase/driver/generic_sql/query_processor.clj
@@ -2,6 +2,7 @@
   "The Query Processor is responsible for translating the Metabase Query Language into korma SQL forms."
   (:require [clojure.core.match :refer [match]]
             [clojure.tools.logging :as log]
+            [clojure.string :as s]
             [clojure.walk :as walk]
             [korma.core :refer :all]
             [metabase.config :as config]
@@ -202,11 +203,16 @@
   [korma-form]
   (when-not qp/*disable-qp-logging*
     (log/debug
-     (u/format-color 'green "\n\nKORMA FORM:\n%s" (->> (nth korma-form 2)                                ; korma form is wrapped in a let clause. Discard it
-                                                       (walk/prewalk (fn [form]                          ; strip korma.core/ qualifications from symbols in the form
-                                                                       (if-not (symbol? form) form       ; to remove some of the clutter
+     (u/format-color 'green "\n\nKORMA FORM:\n%s" (->> (nth korma-form 2)                                    ; korma form is wrapped in a let clause. Discard it
+                                                       (walk/prewalk (fn [form]                              ; strip korma.core/ qualifications from symbols in the form
+                                                                       (if-not (symbol? form) form           ; to remove some of the clutter
                                                                                (symbol (name form)))))
                                                        (u/pprint-to-str)))
-     (u/format-color 'blue  "\nSQL:\n%s\n"        (eval (let [[let-form binding-form & body] korma-form] ; wrap the (select ...) form in a sql-only clause
-                                                          `(~let-form ~binding-form                      ; has to go there to work correctly
-                                                                      (sql-only ~@body))))))))
+     (u/format-color 'blue  "\nSQL:\n%s\n"        (-> (eval (let [[let-form binding-form & body] korma-form] ; wrap the (select ...) form in a sql-only clause
+                                                               `(~let-form ~binding-form                     ; has to go there to work correctly
+                                                                           (sql-only ~@body))))
+                                                      (s/replace #"\sFROM" "\nFROM")                         ; add newlines to the SQL to make it more readable
+                                                      (s/replace #"\sWHERE" "\nWHERE")
+                                                      (s/replace #"\sGROUP BY" "\nGROUP BY")
+                                                      (s/replace #"\sORDER BY" "\nORDER BY")
+                                                      (s/replace #"\sLIMIT" "\nLIMIT"))))))


Added simple /healthcheck resource.

Added simple /healthcheck resource.

--- src/exploud/web.clj
+++ src/exploud/web.clj
@@ -28,6 +28,11 @@
 (def default-region "eu-west-1")

 (def default-user "exploud")
+
+(defn response [data content-type & [status]]
+  {:status (or status 200)
+   :headers {"Content-Type" content-type}
+   :body data})

 (defn get-application
   [name]
@@ -78,6 +83,9 @@
                                                                                :environment environment
                                                                                :user default-user})}))

+     (GET "/healthcheck" []
+        (response "I am healthy. Thank you for asking." "text/plain;charset=utf-8"))
+
   (route/not-found (error-response "Resource not found" 404)))

 (def app


Fix ns

Fix ns

--- test/caesium/crypto/sign_test.clj
+++ test/caesium/crypto/sign_test.clj
@@ -1,7 +1,7 @@
 (ns caesium.crypto.sign-test
   (:require [caesium.crypto.sign :as s]
             [caesium.util :as u]
-            [clojure.test :refer :all]))
+            [clojure.test :refer [deftest is testing]]))

 ;; Test values taken from Kalium's suite
 (def secret


bugfix area-light generator: update to new plane ctor (plane-with-p), also enforce entity id’s as strings, remove obsolete example from core ns

--- src/thi/ng/luxor/core.clj
+++ src/thi/ng/luxor/core.clj
@@ -1,15 +1,14 @@
 (ns thi.ng.luxor.core
   (:require
    [thi.ng.luxor.config :as conf]
-   [thi.ng.luxor.compiler :as c]
+   [thi.ng.luxor.compiler :refer [luxvalues-typed]]
    [thi.ng.luxor.color :as col]
    [thi.ng.luxor.presets :as presets]
    [thi.ng.luxor.version :refer [version]]
    [thi.ng.common.math.core :as m]
    [thi.ng.geom.core :as g :refer [vec3 M44]]
-   [thi.ng.geom.rect :as r]
    [thi.ng.geom.plane :as pl]
-   [thi.ng.geom.mesh :as mesh]
+   [thi.ng.geom.gmesh :as gmesh]
    [thi.ng.geom.meshio :as mio]
    [clojure.java.io :as io])
   (:import
@@ -113,7 +112,7 @@
      (let [scene* (reduce
                    (fn [s [k type]]
                      (if-let [ents (k scene)]
-                       (assoc s k (c/luxvalues-typed scene type ents))
+                       (assoc s k (luxvalues-typed scene type ents))
                        s))
                    (select-keys scene [:comments :includes])
                    {:renderer :renderer
@@ -428,8 +427,8 @@
                                (g/normalize (g/cross (g/- eye target) g/V3X)))}}
         opts (cond
               focal-dist  (assoc opts
-                           :focaldistance [:float focal-dist]
-                           :autofocus [:bool false])
+                            :focaldistance [:float focal-dist]
+                            :autofocus [:bool false])
               focal-point (assoc opts
                             :focaldistance [:float (g/dist eye (vec3 focal-point))]
                             :autofocus [:bool false])
@@ -481,12 +480,13 @@
              :or {samples 1 size 1.0 mesh-type :inline} :as opts}]
   (let [mesh (if mesh
                mesh
-               (g/as-mesh (pl/plane (or p [0 0 0]) (or n [0 0 -1]))
-                          (if (sequential? size)
-                            {:width (first size) :height (second size)}
-                            {:size size})))]
+               (g/as-mesh
+                (pl/plane-with-p (g/vec3 (or p [0 0 0])) (g/vec3 (or n [0 0 -1])))
+                (if (sequential? size)
+                  {:width (first size) :height (second size)}
+                  {:size size})))]
     (append
-     scene :lights id
+     scene :lights (name id)
      (merge
       (when tx (transform-common scene tx))
       (light-common scene opts)
@@ -513,7 +513,7 @@
   [scene id {:keys [z radius inner-radius phi tx material]
              :or {z 0 radius 1 inner-radius 0 phi 360}}]
   (append
-   scene :geometry id
+   scene :geometry (name id)
    (merge
     (when tx (transform-common scene tx))
     {:__type :disk
@@ -527,7 +527,7 @@
 (defn ply-mesh
   [scene id {:keys [mesh path export-path tx material smooth]}]
   (append
-   scene :geometry id
+   scene :geometry (name id)
    (merge
     (when tx (transform-common scene tx))
     {:__type :plymesh
@@ -535,13 +535,13 @@
      :__mesh mesh
      :__export-path (or export-path path)
      :name [:string id]
-     :filename [:string (or path (str id ".ply"))]
+     :filename [:string (or path (str (name id) ".ply"))]
      :smooth [:bool smooth]})))

 (defn stl-mesh
   [scene id {:keys [mesh path export-path tx material]}]
   (append
-   scene :geometry id
+   scene :geometry (name id)
    (merge
     (when tx (transform-common scene tx))
     {:__type :stlmesh
@@ -549,7 +549,7 @@
      :__mesh mesh
      :__export-path (or export-path path)
      :name [:string id]
-     :filename [:string (or path (str id ".stl"))]})))
+     :filename [:string (or path (str (name id) ".stl"))]})))

 (defn lux-scene
   []
@@ -564,20 +564,3 @@
       (light-group "default" {})
       (material-null "__hidden__" {})))

-(comment
-  (def lxs (-> (lux-scene)
-               (camera {:eye [10 -2 10] :target [0 0 0] :up [0 0 1]})
-               (film {:width 640 :height 360 :display-interval 5 :halt-spp 50})
-               (volume "inside" {:type :clear :absorb [0.972 0.8 0.7] :abs-depth 1 :ior 2.04})
-               (area-light "left" {:p [0 0 5] :size 1 :gain 1 :tx {:translate [-5 0 0] :ry -20}})
-               (area-light "top" {:p [0 0 7] :size 6 :gain 0.5 :tx {:translate [0 4 0] :rx -45}})
-               (area-light "right" {:p [0 0 5] :size 1 :gain 1 :tx {:translate [5 0 0] :ry 20}})
-               (shape-disk "floor" {:radius 20 :material "white"})
-               (stl-mesh "map" {:material "orange-trans" :tx {:scale [5 3 1] :translate [0 0 1]} :mesh (g/extrude (r/rect -1 -1 2 2) {:depth 1 :scale 0.8})})
-               (material-matte "white" {:diffuse [0.8 0.8 0.8]})
-               (material-matte "red" {:diffuse [1.0 0 0]})
-               (material-matte "orange" {:diffuse [1.0 0.3 0]})
-               (material-matte-translucent "orange-trans" {:interior "inside" :transmit [0.9 0.3 0.05] :reflect [0.3 0.3 0.3] :conserve? true})
-               ;;(serialize-scene "foo" false)
-               ))
-  )


add a way to quit processing in indent mode

--- lib/src/parinfer/indent_mode.cljc
+++ lib/src/parinfer/indent_mode.cljc
@@ -226,6 +226,16 @@
   [state key-]
   (update state key- conj (get-cached-state state)))

+(defn process-indent-trigger
+  "Called when we have actually reached an indentation trigger.
+  (i.e. first non-whitespace char of a line)"
+  [{:keys [x-pos] :as state}]
+  (-> state
+      (close-delims x-pos)
+      (commit-cached-state :postindent-states)
+      (assoc :track-indent? false
+             :processed-indent? true)))
+
 (defn process-indent
   "Update the state by handling a possible indentation trigger.

@@ -246,17 +256,14 @@
                         (in-code? stack)
                         (not (whitespace? ch))
                         (not= ";" ch))
-        skip? (and check-indent? (closing-delim? ch))
-        at-indent? (and check-indent? (not skip?))
-        quit? (and at-indent? quote-danger?)
-        state (assoc state :process? (not skip?))]
-    (if at-indent?
-      (-> state
-          (close-delims x-pos)
-          (commit-cached-state :postindent-states)
-          (assoc :track-indent? false
-                 :processed-indent? true))
-      state)))
+        skip?       (and check-indent? (closing-delim? ch))
+        at-indent?  (and check-indent? (not skip?))
+        quit?       (and at-indent? quote-danger?)
+        state (assoc state
+                     :quit? quit?
+                     :process? (and (not skip?) (not quit?)))]
+    (cond-> state
+      (and at-indent? (not quit?)) process-indent-trigger)))

 (defn update-line
   "Update the state by adding processed character to the line."
@@ -287,14 +294,34 @@
   (let [x-pos (count (get lines line-no))
         state (assoc state :x-pos x-pos :ch (str ch))
         state (process-indent state)]
-    (cond-> state
-      (:process? state) process-char*)))
+    (cond
+      (:quit? state) (reduced state)
+      (:process? state) (process-char* state)
+      :else state)))
+
+(defn- postprocess-line
+  "Called after last character of a line has been processed."
+  [state]
+  (let [state (-> state
+                  block-delim-trail
+                  remove-delim-trail
+                  save-preinsert-line
+                  (commit-cached-state :postline-states))
+
+        ;; if this did not have an indentation trigger point,
+        ;; pad postindent-states with a nil.
+        state (cond-> state
+                (not (:processed-indent? state))
+                (update :postindent-states conj nil))]
+    state))

 (defn process-line
   "Update the state by processing the given line of text."
   ([line] (process-line initial-state line))
   ([{:keys [stack lines line-no cursor-line] :as state} line]
    (let [line-no (inc line-no)
+
+         ;; set line-specific state
          state (assoc state
                   :backup []
                   :cursor-in-comment? false
@@ -305,19 +332,11 @@
                   :line-no line-no
                   :removed-delims [])
          state (update-in state [:insert :line-dy] #(when % (dec %)))
-         state (reduce process-char state (str line "\n"))
-         state (-> state
-                   block-delim-trail
-                   remove-delim-trail
-                   save-preinsert-line
-                   (commit-cached-state :postline-states))
-
-         ;; if this did not have an indentation trigger point,
-         ;; pad postindent-states with a nil.
-         state (cond-> state
-                 (not (:processed-indent? state))
-                 (update :postindent-states conj nil))]
-     state)))
+
+         state (reduce process-char state (str line "\n"))]
+     (if (:quit? state)
+       (reduced state)
+       (postprocess-line state)))))

 (defn finalize-state
   [{:keys [stack quote-danger?] :as state}]


Fix typo in comment

Fix typo in comment

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

--- src/test/clojure/conexp/fca/implications_test.clj
+++ src/test/clojure/conexp/fca/implications_test.clj
@@ -393,7 +393,7 @@
 ;;;

 (deftest test-learn-implications-by-queries
-  ;; example Angluin, Frazier, Pitt: Learning Conjunctoins of Horn Clauses
+  ;; example Angluin, Frazier, Pitt: Learning Conjunctions of Horn Clauses
   (let [background-hypothesis #{(make-implication '#{a c} '#{d}) (make-implication '#{a b} '#{c})}]
     (is (= (set
             (learn-implications-by-queries '#{a b c d}


added a comment

added a comment

--- src/gpckwlf/app.clj
+++ src/gpckwlf/app.clj
@@ -29,9 +29,12 @@
      :items ["Username" login-username
              "Password" login-password])))

+; use a border-panel instead
 (def site-tiles
-  (seesaw.core/grid-panel
-   :columns 3
+  (seesaw.core/flow-panel
+   :align :left
+   :hgap 1
+   :vgap 1
    :items ["These" "will" "be" "tiles"]))

 (def options-button


Made the unique function work correctly with non-true values.

--- clojure/org/gavrog/clojure/azulenoids.clj
+++ clojure/org/gavrog/clojure/azulenoids.clj
@@ -29,9 +29,10 @@
     (letfn [(step [[seen _] x]
                   (let [key (key-fun x)]
                     (if (seen key)
-                      [seen false]
-                      [(conj seen key) x])))]
-           (filter identity (map second (reductions step [#{} false] coll)))))
+                      [seen nil false]
+                      [(conj seen key) x true])))]
+           (map second
+                (filter #(nth % 2) (reductions step [#{} nil false] coll)))))
   ([coll]
     (unique identity coll)))


[#2756] Fix tests

[#2756] Fix tests

--- backend/test/akvo/lumen/endpoints_test.clj
+++ backend/test/akvo/lumen/endpoints_test.clj
@@ -180,8 +180,8 @@
                       :name title
                       :status "OK"
                       :transformations []
-                      :groups [[:main (map #(assoc % :groupName "main" :groupId "main") commons/dataset-link-columns)]
-                               [:transformations []]]}
+                      :groups [["main" (map #(assoc % :groupName "main" :groupId "main") commons/dataset-link-columns)]
+                               ["transformations" []]]}
                      (select-keys meta-group-dataset [:id :name :status :transformations :groups]))))

             (let [meta-group-dataset (-> (h (get* (api-url "/datasets" dataset-id "group" "main")))


And more endpoint-tests

And more endpoint-tests

--- backend/test/akvo/lumen/endpoints_test.clj
+++ backend/test/akvo/lumen/endpoints_test.clj
@@ -114,6 +114,32 @@
                             :columnName "c6",
                             :direction nil,
                             :sort nil}])
+
+;; Todo: check if we can generate it with current vis specs!!
+(defn visualisation-bar-payload [dataset-id name*] {:type "visualisation",
+                                                    :name name*,
+                                                    :visualisationType "bar",
+                                                    :datasetId dataset-id
+                                                    :spec
+                                                    {:metricColumnX nil,
+                                                     :horizontal false,
+                                                     :metricAggregation "count",
+                                                     :filters [],
+                                                     :axisLabelYFromUser false,
+                                                     :bucketColumn nil,
+                                                     :showLabels false,
+                                                     :metricColumnY nil,
+                                                     :subBucketMethod "split",
+                                                     :subBucketColumn nil,
+                                                     :truncateSize nil,
+                                                     :axisLabelX nil,
+                                                     :legendTitle nil,
+                                                     :axisLabelXFromUser false,
+                                                     :axisLabelY nil,
+                                                     :version 1,
+                                                     :sort nil,
+                                                     :showValueLabels false}})
+

 (deftest handler-test
   (let [h (:handler (:akvo.lumen.component.handler/handler *system*))]
@@ -203,8 +229,17 @@
                                               :body (json/parse-string keyword)
                                               :modified)))))

-
           (is (= title (-> (h (get* (api-url "/library")))
                            :body (json/parse-string keyword) :datasets first :name)))
-          ))
+          (let [bar-vis-name "hello-bar-vis!"]
+            (is (= [bar-vis-name dataset-id]
+                   (-> (h (post*  (api-url "/visualisations") (visualisation-bar-payload dataset-id bar-vis-name)))
+                       :body
+                       (json/parse-string keyword)
+                       ((juxt :name :datasetId))
+                       )))
+            (is (= bar-vis-name (-> (h (get* (api-url "/library")))
+                                    :body (json/parse-string keyword) :visualisations first :name)))
+
+            )))
       )))


Fix broken test case on PG

Fix broken test case on PG

--- test/com/puppetlabs/puppetdb/test/scf/migrate.clj
+++ test/com/puppetlabs/puppetdb/test/scf/migrate.clj
@@ -1,6 +1,7 @@
 (ns com.puppetlabs.puppetdb.test.scf.migrate
   (:require [com.puppetlabs.puppetdb.scf.migrate :as migrate]
             [com.puppetlabs.puppetdb.scf.storage :refer (db-serialize)]
+            [cheshire.core :as json]
             [clojure.java.jdbc :as sql])
   (:use [com.puppetlabs.puppetdb.scf.migrate]
         [clj-time.coerce :only [to-timestamp]]
@@ -102,14 +103,15 @@

       ;; Now the cache table should have the json-ified version of
       ;; each resource as the value
-      (is (= (query-to-vec "SELECT * FROM resource_params_cache ORDER BY resource")
-             [{:resource "1" :parameters (db-serialize {"ensure" "file"
-                                                        "owner"  "root"
-                                                        "group"  "root"})}
-              {:resource "2" :parameters (db-serialize {"random" "true"})}
+      (is (= (map #(update-in % [:parameters] json/parse-string)
+                  (query-to-vec "SELECT * FROM resource_params_cache ORDER BY resource"))
+             [{:resource "1" :parameters {"ensure" "file"
+                                          "owner"  "root"
+                                          "group"  "root"}}
+              {:resource "2" :parameters {"random" "true"}}
               ;; There should be no resource 3
-              {:resource "4" :parameters (db-serialize {"ensure"  "present"
-                                                        "content" "#!/usr/bin/make\nall:\n\techo done\n"})}
-              {:resource "5" :parameters (db-serialize {"random" "false"})}
-              {:resource "6" :parameters (db-serialize {"multi" ["one" "two" "three"]})}
-              {:resource "7" :parameters (db-serialize {"hash" (sorted-map "foo" 5 "bar" 10)})}])))))
+              {:resource "4" :parameters {"ensure"  "present"
+                                          "content" "#!/usr/bin/make\nall:\n\techo done\n"}}
+              {:resource "5" :parameters {"random" "false"}}
+              {:resource "6" :parameters {"multi" ["one" "two" "three"]}}
+              {:resource "7" :parameters {"hash" (sorted-map "foo" 5 "bar" 10)}}])))))


tiny refactor

tiny refactor

--- src/icecap/rest.clj
+++ src/icecap/rest.clj
@@ -26,9 +26,9 @@
                                              :store store
                                              :kdf kdf
                                              :scheme scheme)))]
-                   (if cap
-                     {:body (cap-url request cap)}
-                     {:error (str error)})))
+                   {:body (if cap
+                            (cap-url request cap)
+                            (str error))}))
            (context "/:encoded-cap" [encoded-cap]
                     (GET "/" []
                          (let [cap (spy (safebase64-decode encoded-cap))]


Clearing trumpets after test

Clearing trumpets after test

--- test/trumpet_server/rest_test.clj
+++ test/trumpet_server/rest_test.clj
@@ -1,7 +1,8 @@
 (ns trumpet-server.rest-test
   (:require [midje.sweet :refer :all]
             [clj-http.client :as client]
-            [trumpet-server.rest :refer [start-server]]))
+            [trumpet-server.rest :refer [start-server]]
+            [trumpet-server.repository :refer [clear-trumpets!]]))

 (def server (atom nil))

@@ -12,7 +13,8 @@

 (with-state-changes [(before :facts (reset! server (start-server)))
                      (after :facts (do (.stop @server)
-                                       (reset! server nil)))]
+                                       (reset! server nil)
+                                       (clear-trumpets!)))]
                     (fact "Entry point returns the correct links"
                           (def href-for-rel (->> (client/get "http://127.0.0.1:5000" {:query-params {"latitude" 22.2 "longitude" 21.2} :as :json})
                                                  :body


Remove logging statements

Remove logging statements

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -727,8 +727,6 @@
             project-id (project-model/id project)
             inputs (inputs/get-inputs-from-app-state owner)
             settings (state-utils/merge-inputs project inputs project-model/notification-keys)]
-        (js/console.log "STATE: " (clj->js state))
-        (js/console.log "SETTINGS: " (clj->js settings))
         (html
          [:section
           [:article


(SERVER-4) Add comment about FileInputStream

Add a comment explaining why a FileInputStream is needed when
parsing /proc/meminfo.

--- src/clj/puppetlabs/services/master/master_core.clj
+++ src/clj/puppetlabs/services/master/master_core.clj
@@ -70,6 +70,11 @@
    so that the JVM doesn't fail later due to an Out of Memory error."
   []
   (when (fs/exists? "/proc/meminfo")
+    ; Due to OpenJDK Issue JDK-7132461
+    ; (https://bugs.openjdk.java.net/browse/JDK-7132461),
+    ; we have to open and slurp a FileInputStream object rather than
+    ; slurping the file directly, since directly slurping the file
+    ; causes a call to be made to FileInputStream.available().
     (with-open [mem-info-file (FileInputStream. "/proc/meminfo")]
       (let [heap-size (/ (.maxMemory (Runtime/getRuntime)) 1024)
             mem-size (Integer. (second (re-find #"MemTotal:\s+(\d+)\s+\S+"


improve logging

improve logging

--- src/babel/over.clj
+++ src/babel/over.clj
@@ -161,22 +161,9 @@

 (defn overh [parent head morph]
   "add given head as the head child of the phrase: parent."
-  (log/trace (str "overh parent type: " (type parent)))
-  (log/trace (str "overh head  type: " (type head)))
-
-  (log/trace (str "set? parent:" (set? parent)))
-  (log/trace (str "seq? parent:" (seq? parent)))
-  (log/trace (str "seq? head:" (seq? head)))
-  (log/trace (str "vector? head:" (vector? head)))
-
   (when (map? parent)
     (do
-      (if (get-in parent '(:aliases))
-        (log/debug (str "overh: parent aliases:" (get-in parent '(:aliases)))))
-      (if (get-in parent '(:comment))
-        (log/trace (str "overh: parent comment:" (get-in parent '(:comment)))))
-      (if (get-in parent '(:rule))
-        (log/trace (str "overh: parent rule:" (get-in parent '(:rule)))))))
+      (log/trace (str "overh: parent: " (strip-refs parent)))))

   (cond

@@ -210,10 +197,7 @@
    (let [result (moreover-head parent head sem-impl morph)
          is-fail? (fail? result)
          label (if (get-in parent [:rule]) (get-in parent [:rule]) (:comment parent))]
-     (log/trace (str "overh result keys: " (if (map? result) (keys result) "(not a map)")))
-     (log/trace (str "overh italian value: " (if (map? result) (get-in result '(:italiano)) "(not a map)")))
-     (log/trace (str "overh italian :a value: " (if (map? result) (get-in result '(:italiano :a)) "(not a map)")))
-     (log/trace (str "overh italian :b value: " (if (map? result) (get-in result '(:italiano :b)) "(not a map)")))
+     (log/trace (str "overh result result: " (strip-refs result)))
      (if (not is-fail?)
        (list result)))))


mention Steve Reich

mention Steve Reich

--- src/overtone/examples/compositions/piano_phase.clj
+++ src/overtone/examples/compositions/piano_phase.clj
@@ -1,13 +1,15 @@
 (ns overtone.examples.compositions.piano-phase
   (:use overtone.live
         overtone.inst.sampled-piano))
+
+;; Steve Reich's Piano Phase

 (def piece [:E4 :F#4 :B4 :C#5 :D5 :F#4 :E4 :C#5 :B4 :F#4 :D5 :C#5])

 (defn player
   [t speed notes]
-  (let [n     (first notes)
-        notes (next notes)
+  (let [n      (first notes)
+        notes  (next notes)
         t-next (+ t speed)]
     (when n
       (at t


Less racy possition assignment.

Less racy possition assignment.

Aaron Miller pointed out the racism.


Remove debug test that did not function

Remove debug test that did not function

--- test/mavlink/mavlink1.clj
+++ test/mavlink/mavlink1.clj
@@ -79,19 +79,6 @@
                                               value)))})
                            fields))))

-(deftest byte-array-data
-  (testing "Encoding GPS-RTCM-DATA"
-    (let [cmd (.getBytes "soc, swiftgcsSync\n")
-          in {:message'id :gps-rtcm-data
-              :flags 0
-              :len (alength cmd)
-              :data cmd}
-          rtrp (encode-roundtrip in)]
-      (println "starting")
-    (println "\n\nEncoded" in "to" rtrp "\n\n")
-      (println "ended")
-    )))
-
 (deftest mavlink-1-0
   (testing "Message round trips."
     (reset! last-error nil)


draft for :fill vs :input

draft for :fill vs :input

--- test/osmium/core_test.clj
+++ test/osmium/core_test.clj
@@ -65,9 +65,17 @@
 (defmethod eval!* :click [driver [_ sel]]
   (taxi/click driver sel))

-(defmethod eval!* :fill [driver [_ sel text]]
-  (let [text (or text (gen/generate (s/gen string?)))]
+(defmethod eval!* :input [driver [_ sel text]]
+  (let [text (str (or text (gen/generate (s/gen string?))))]
     (taxi/input-text driver sel text)))
+
+(defmethod eval!* :fill [driver [_ mappings entity]]
+  (eval! d (->> mappings
+                (map (fn [[k q]]
+                       (when-let [v (get entity k)]
+                         [:input q v])))
+                (remove nil?)
+                vec)))

 (defn reset-form! [driver id]
   (taxi/execute-script driver (format "document.getElementById('%s').reset();" id)))
@@ -89,7 +97,7 @@
 (defmethod eval!* :default [driver [k sel]]
   (assert (spec-keyword? k) (str k " is not a spec keyword"))
   (let [val (gen/generate (s/gen k))]
-    (eval!* driver [:fill sel (str val)])))
+    (eval!* driver [:input sel (str val)])))

 ;; TODO: select options
 ;; TODO: wait (not necessary for a performance demo!)


state change on text area on-change

state change on text area on-change

--- pp-cljs-client/src-cljs/pp_client/html.cljs
+++ pp-cljs-client/src-cljs/pp_client/html.cljs
@@ -168,7 +168,9 @@
     [:div.left-body-ca07e
       [:textarea#mainTextarea.text-f3988
         {:value (:value new-state)
-         :on-change #(swap! state assoc :value (-> % .-target .-value))}]]))
+         :on-change #(swap! state assoc :value (-> % .-target .-value)
+                                        :success? false
+                                        :error? false)}]]))

 (quiescent/defcomponent Footer []
   (sablono/html


Write to a writer, don't print to a writer.

--- src/clojars/db.clj
+++ src/clojars/db.clj
@@ -36,10 +36,11 @@
      (with-query-results rs ["select user, ssh_key from users"]
        (with-open [f (io/writer new-file)]
          (doseq [x rs]
-           (.println f (str "command=\"ng --nailgun-port 8700 clojars.scp " (:user x)
+           (.write f (str "command=\"ng --nailgun-port 8700 clojars.scp " (:user x)
                             "\"," ssh-options " "
                             (.replaceAll (.trim (:ssh_key  x))
-                                               "[\n\r\0]" ""))))))
+                                         "[\n\r\0]" "")
+                            "\n")))))
      (.renameTo new-file (File. path)))))

 (defn db-middleware


add hash-map for index -> line

add hash-map for index -> line


Fix style

Fix style

--- src/datemo/arb.clj
+++ src/datemo/arb.clj
@@ -9,7 +9,7 @@
   (if (string? (first hiccup))
     (first hiccup)
     (let [[tag attrs & rest] (first hiccup)
-          rest-count (count rest)]
+           rest-count (count rest)]
       (if (or (= 0 rest-count) (and (= 1 rest-count) (string? (first rest))))
         [:arb {:original-tag tag} (first rest)]
         (loop [arb [:arb {:original-tag tag}]


add dda-cloudspec

add dda-cloudspec

--- main/src/dda/pallet/dda_managed_ide/domain/git.clj
+++ main/src/dda/pallet/dda_managed_ide/domain/git.clj
@@ -46,4 +46,5 @@
        "https://github.com/DomainDrivenArchitecture/dda-managed-ide.git"
        "https://github.com/DomainDrivenArchitecture/dda-mariadb-crate.git"
        "https://github.com/DomainDrivenArchitecture/dda-serverspec-crate.git"
-       "https://github.com/DomainDrivenArchitecture/dda-tomcat-crate.git"]}}))
+       "https://github.com/DomainDrivenArchitecture/dda-tomcat-crate.git"
+       "https://github.com/DomainDrivenArchitecture/dda-cloudspec.git"]}}))


Add collection size and partition size command line arguments.

--- src/dsbdp/main.clj
+++ src/dsbdp/main.clj
@@ -60,6 +60,10 @@
     "The number of data instances to be generated for one batch."
     :default 2000
     :parse-fn #(Integer/parseInt %)]
+   ["-c" "--collection-size COLLECTION-SIZE"
+    "The size of the collection that is to be processed with pmap and reducers."
+    :default 512
+    :parse-fn #(Integer/parseInt %)]
    ["-d" "--batch-delay BATCH-DELAY"
     "The delay in ms between generating batches."
     :default 1
@@ -76,6 +80,10 @@
     "The mapping of dsl-expressions to processing functions."
     :default [5 5 4 3]
     :parse-fn #(binding [*read-eval* false] (read-string %))]
+   ["-p" "--partition-size PARTITION-SIZE"
+    "The size of the partitions that are used for the reducer-based processing."
+    :default 128
+    :parse-fn #(Integer/parseInt %)]
    ["-s" "--scenario SCENARIO"
     "The scenario that is to be used."
     :default "no-op"]
@@ -196,6 +204,8 @@
                                  (in-fn in-data)
                                  (.inc in-cntr)))
           direct-proc-fn (create-direct-proc-fn scenario)
+          collection-size (:collection-size options)
+          partition-size (:partition-size options)
           in-loop (ProcessingLoop.
                     "DataGenerationLoop"
                     (cond
@@ -204,18 +214,18 @@
                           (direct-proc-fn in-data)
                           (.inc out-cntr))
                       (.endsWith scenario "-pmap")
-                        (let [d (repeat queue-size in-data)]
+                        (let [d (repeat collection-size in-data)]
                           (doall d)
                           (fn []
                             (doseq [_ (pmap direct-proc-fn d)]
                               (.inc out-cntr))))
                       (.endsWith scenario "-reducers-map")
-                        (let [in-vec (vec (repeat (* 512 pipeline-length) in-data))]
+                        (let [in-vec (vec (repeat collection-size in-data))]
                           (doall in-vec)
                           (fn []
                             (doseq [
                                     ;_ (reducers/foldcat (reducers/map direct-proc-fn in-vec))
-                                    _ (reducers/fold 16 reducers/cat reducers/append! (reducers/map direct-proc-fn in-vec))
+                                    _ (reducers/fold partition-size reducers/cat reducers/append! (reducers/map direct-proc-fn in-vec))
                                     ]
                               (.inc out-cntr))))
                       (.endsWith scenario "-async-pipeline")


fix `name` warning

fix `name` warning


string? no longer need to check for unicode char

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -79,8 +79,7 @@
   [x] (if x false true))

 (defn ^boolean string? [x]
-  (and ^boolean (goog/isString x)
-    (not (identical? (.charAt x 0) \uFDD0))))
+  (goog/isString x))

 (set! *unchecked-if* true)
 (defn ^boolean type_satisfies_


prioritize configure > follow in project settings

--- frontend/components/project_settings.cljs
+++ frontend/components/project_settings.cljs
@@ -104,7 +104,6 @@
     (render [_]
       (html
        [:section
-        (om/build follow-sidebar (:project project-data))
         [:article
          [:h2 "How to configure " (vcs-url/project-name (get-in project-data [:project :vcs_url]))]
          [:h4 "Option 1"]
@@ -118,7 +117,8 @@
          [:p
           "Override all settings via a "
           [:a {:href "/docs/configuration"} "circle.yml file"]
-          " in your repo. Very powerful."]]]))))
+          " in your repo. Very powerful."]]
+        (om/build follow-sidebar (:project project-data))]))))

 (defn mini-parallelism-faq [project-data]
   [:div.mini-faq


move sequence down

move sequence down

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -474,14 +474,6 @@
       (-seq coll)

       :else (throw (js/Error. (str coll "is not ISeqable"))))))
-
-(defn ^seq sequence
-  "Coerces coll to a (possibly empty) sequence, if it is not already
-  one. Will not force a lazy seq. (sequence nil) yields ()"
-  [coll]
-   (if (seq? coll)
-     coll
-     (or (seq coll) ())))

 (defn first
   "Returns the first item in the collection. Calls seq on its
@@ -1260,6 +1252,14 @@
      false)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Seq fns ;;;;;;;;;;;;;;;;
+
+(defn ^seq sequence
+  "Coerces coll to a (possibly empty) sequence, if it is not already
+  one. Will not force a lazy seq. (sequence nil) yields ()"
+  [coll]
+   (if (seq? coll)
+     coll
+     (or (seq coll) ())))

 (defn ^number compare
   "Comparator. Returns a negative number, zero, or a positive number


Add seq library functions to support printing

Pairing with devn. Refs #19

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -146,6 +146,98 @@
   "Same as (next (next x))"
   [coll]
   (next (next coll)))
+
+(defn take
+  "Returns a lazy sequence of the first n items in coll, or all items if
+  there are fewer than n."
+  [n coll]
+  (lazy-seq
+   (when (pos? n)
+     (when-let [s (seq coll)]
+      (cons (first s) (take (dec n) (rest s)))))))
+
+(defn drop
+  "Returns a lazy sequence of all but the first n items in coll."
+  [n coll]
+  (let [step (fn [n coll]
+               (let [s (seq coll)]
+                 (if (and (pos? n) s)
+                   (recur (dec n) (rest s))
+                   s)))]
+    (lazy-seq (step n coll))))
+
+(defn repeat
+  "Returns a lazy (infinite!, or length n if supplied) sequence of xs."
+  ([x] (lazy-seq (cons x (repeat x))))
+  ([n x] (take n (repeat x))))
+
+(defn interleave
+  "Returns a lazy seq of the first item in each coll, then the second etc."
+  ([c1 c2]
+     (lazy-seq
+      (let [s1 (seq c1) s2 (seq c2)]
+        (when (and s1 s2)
+          (cons (first s1) (cons (first s2)
+                                 (interleave (rest s1) (rest s2))))))))
+  ([c1 c2 & colls]
+     (lazy-seq
+      (let [ss (map seq (conj colls c2 c1))]
+        (when (every? identity ss)
+          (concat (map first ss) (apply interleave (map rest ss))))))))
+
+(defn interpose
+  "Returns a lazy seq of the elements of coll separated by sep"
+  [sep coll] (drop 1 (interleave (repeat sep) coll)))
+
+(defn map
+  "Returns a lazy sequence consisting of the result of applying f to the
+  set of first items of each coll, followed by applying f to the set
+  of second items in each coll, until any one of the colls is
+  exhausted.  Any remaining items in other colls are ignored. Function
+  f should accept number-of-colls arguments."
+  ([f coll]
+   (lazy-seq
+    (when-let [s (seq coll)]
+      (cons (f (first s)) (map f (rest s))))))
+  ([f c1 c2]
+   (lazy-seq
+    (let [s1 (seq c1) s2 (seq c2)]
+      (when (and s1 s2)
+        (cons (f (first s1) (first s2))
+              (map f (rest s1) (rest s2)))))))
+  ([f c1 c2 c3]
+   (lazy-seq
+    (let [s1 (seq c1) s2 (seq c2) s3 (seq c3)]
+      (when (and  s1 s2 s3)
+        (cons (f (first s1) (first s2) (first s3))
+              (map f (rest s1) (rest s2) (rest s3)))))))
+  ([f c1 c2 c3 & colls]
+   (let [step (fn step [cs]
+                 (lazy-seq
+                  (let [ss (map seq cs)]
+                    (when (every? identity ss)
+                      (cons (map first ss) (step (map rest ss)))))))]
+     (map #(apply f %) (step (conj colls c3 c2 c1))))))
+
+(defn- flatten1
+  "Take a collection of collections, and return a lazy seq
+  of items from the inner collection"
+  [colls]
+  (let [cat (fn cat [coll colls]
+              (lazy-seq
+                (if-let [coll (seq coll)]
+                  (cons (first coll) (cat (rest coll) colls))
+                  (when (seq colls)
+                    (cat (first colls) (rest colls))))))]
+    (cat nil colls)))
+
+(defn mapcat
+  "Returns the result of applying concat to the result of applying map
+  to f and colls.  Thus function f should return a collection."
+  ([f coll]
+    (flatten1 (map f coll)))
+  ([f coll & colls]
+    (flatten1 (apply map f coll colls))))

 (defn reduce
   "f should be a function of 2 arguments. If val is not supplied,


only persistent collections should implement cloneable


Use application context for in UI constructors

--- src/clojure/neko/ui.clj
+++ src/clojure/neko/ui.clj
@@ -11,8 +11,7 @@

 (ns neko.ui
   "Tools for defining and manipulating Android UI elements."
-  (:use [neko.activity :only [*activity*]]
-        [neko.context :only [*context*]]
+  (:use [neko.application :only [context]]
         [neko.-utils :only [capitalize]]
         [neko.listeners.view :only [on-click-call]])
   (:require [neko.ui.mapping :as kw])
@@ -142,7 +141,7 @@
   additional arguments (if available) and returns a form that
   constructs the object."
   [klass {:keys [constructor-args]}]
-  `(new ~klass *context* ~@constructor-args))
+  `(new ~klass context ~@constructor-args))

 ;; ## Top-level code-generation facilities

@@ -150,9 +149,8 @@
   "Takes a tree of elements and generates the code to create a new
   element object, set all attributes onto it and add all inside
   elements to it. `make-ui-element` is called recursively on each
-  internal element. Presumes the `*context*` var to be bound. The
-  second argument is a keyword that represents the type of the
-  container UI element will be put in."
+  internal element. The second argument is a keyword that represents
+  the type of the container UI element will be put in."
   [element container-type]
   (if (vector? element)
     (let [[el-type attributes & inside-elements] element


Added add-css! fn.

Added add-css! fn.

--- src/fx_clj/css.clj
+++ src/fx_clj/css.clj
@@ -6,7 +6,9 @@
            (com.sun.javafx.css StyleManager)
            (java.net URL URLStreamHandlerFactory URLStreamHandler URLConnection)
            (java.io ByteArrayInputStream FileNotFoundException)
-           (com.sun.javafx.application PlatformImpl)))
+           (com.sun.javafx.application PlatformImpl)
+           (javafx.stage Stage)
+           (javafx.scene Scene)))

 (defonce ^:private auto-inc (atom 0))

@@ -60,15 +62,15 @@
     (swap! css-strings assoc url css)
     (set-global-stylesheet! url)))

-(comment
-  (defn set-css! [stage css]
-    (run!
-      (let [url (URL. (str prefix ":global-" (swap! auto-inc inc)))
-            to-remove (filter #(re-matches global-url-re (str %)) (keys @css-strings))]
-        ;;(swap! css-strings (fn [x] (apply dissoc x to-remove)))
-        ;;(doseq [x to-remove] (remove-global-stylesheet! x))
-        (swap! css-strings assoc url css)
-        ;;(set-global-stylesheet! url)
-        (.clear (.getStylesheets (.getScene stage)))
-        (.add (.getStylesheets (.getScene stage)) (str url))
-        ))))
+(defn add-css! [stage-or-scene css]
+  (run!
+    (let [url (URL. (str prefix ":custom-" (swap! auto-inc inc)))
+          stylesheets
+          (cond
+            (instance? Stage stage-or-scene)
+            (.getStylesheets (.getScene stage-or-scene))
+
+            (instance? Scene stage-or-scene)
+            (.getStylesheets stage-or-scene))]
+      (swap! css-strings assoc url css)
+      (.add stylesheets (str url)))))