Improved put and take slide

Improved put and take slide

--- src-cljs/qcon/main.cljs
+++ src-cljs/qcon/main.cljs
@@ -18,6 +18,19 @@

 (def debug false)

+(defn new-random-pick [owner]
+  (go-loop [c 4]
+    (om/set-state! owner :pending-put nil)
+    (let [n (inc (mod
+                  (+
+                   (om/get-state owner :pending-put)
+                   (inc (rand-int 9)))
+                  9))]
+      (om/set-state! owner :pending-put n))
+    (when (pos? c)
+      (<! (timeout 30))
+      (recur (dec c)))))
+
 (defn put-and-take-slide [data owner opts]
   (reify
     om/IInitState
@@ -28,7 +41,8 @@
          :buf buf
          :ch ch
          :default-font (:font-size opts)
-         :radius (:radius opts)}))
+         :radius (:radius opts)
+         :pending-put nil}))
     om/IRender
     (render [_]
       (let [bufsize (om/get-state owner :buffer-size)
@@ -39,35 +53,52 @@
         (html
          [:div
           [:svg {:version "1.1" :width 800 :height 600}
-           [:g {:transform "translate(70,65)"
-                :onClick (fn [_]
-                           (go
-                             (>! ch (str (rand-int 10)))
-                             ;; Forces a re-render
-                             (om/set-state! owner :modified (new js/Date))))}
-
-            [:g {:transform "translate(90,0)"}
+
+           [:g {:transform "translate(100,0)"}
+            [:g {:transform "translate(30,0)"
+                 :onClick (fn [_] (new-random-pick owner))}
+             [:rect
+              {:x 0 :y 65 :width 100 :height 100 :fill "black" :stroke "white" :stroke-width 3}]
+             (when-let [n (om/get-state owner :pending-put)]
+               [:text {:x 20 :y 150 :style {:font-size "64pt"
+                                            :color "white"} :fill "white"} (str n)])
+             ]
+
+            [:g {:transform "translate(160,65)"
+                 :onClick (fn [_]
+                            (when-let [n (om/get-state owner :pending-put)]
+                              (om/set-state! owner :pending-put nil)
+                              (go
+                                (>! ch (str n))
+                                (new-random-pick owner)
+                                ;; Forces a re-render
+                                (om/set-state! owner :modified (new js/Date)))))}
              [:rect {:x 0 :y 0 :width 140 :height 100 :fill "black"}]
-             [:text {:x 0 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} ">!"]]]
-
-           (for [x (range bufsize)]
-             [:g {:transform (str "translate(320,320)")}
-              [:g {:transform (str "rotate(" (- (* (- x (/ bufsize 2) (- 1)) (/ 180 bufsize))) ") translate(200)")}
-               [:circle {:cx 0 :cy radius :r radius :style {:fill "#224"}}]
-               [:text {:x (- 0 (/ radius 2) 5) :y (* 1.7 radius) :style {:font-size default-font :fill "white"}}
-                (str (aget (.-arr (.-buf buf)) (mod (+ x (.-head (.-buf buf))) bufsize)))]]])
-
-           [:g {:transform "translate(70,475)"
-                :onClick (fn [_]
-                           (go
-                             (<! ch)
-                             (om/set-state! owner :modified (new js/Date))))}
-
-            [:g {:transform "translate(90,0)"}
+             [:text {:x 0 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} ">!"]]
+
+            (for [x (range bufsize)]
+              [:g {:transform (str "translate(320,320)")}
+               [:g {:transform (str "rotate(" (- (* (- x (/ bufsize 2) (- 1)) (/ 180 bufsize))) ") translate(200)")}
+                [:circle {:cx 0 :cy radius :r radius :style {:fill "#224"}}]
+                [:text {:x (- 0 (/ radius 2) 5) :y (* 1.7 radius) :style {:font-size default-font :fill "white"}}
+                 (str (aget (.-arr (.-buf buf)) (mod (+ x (.-head (.-buf buf))) bufsize)))]]])
+
+            [:g {:transform "translate(160,475)"
+                 :onClick (fn [_]
+                            (go
+                              (om/set-state! owner :last-get (<! ch))
+                              (om/set-state! owner :modified (new js/Date))))}
+
              [:rect {:x 0 :y 0 :width 140 :height 100 :fill "black"}]
-             [:text {:x 0 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} "<!"]]
-
-            ]]])))))
+             [:text {:x 0 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} "<!"]
+
+             ]
+            [:g  {:transform "translate(30,475)"}
+             [:rect
+              {:x 0 :y 0 :width 100 :height 100 :fill "black" :stroke "white" :stroke-width 3}]
+             (when-let [n (om/get-state owner :last-get)]
+               [:text {:x 20 :y 80 :style {:font-size "64pt"
+                                            :color "white"} :fill "white"} (str n)])]]]])))))

 (defn timeout-slide [data owner opts]
   (reify
@@ -244,7 +275,7 @@
            ]]]]))))

 (def app-model
-  (atom {:current-slide 9
+  (atom {:current-slide 4
          :slides
          ;; TODO Add cardinal such that each slide has its own number to avoid react warning
          (vec
@@ -457,7 +488,7 @@
     (render [_]
       (html
        [:div
-        #_[:p (str "Current slide is " (inc (:current-slide app)) "/" (count (:slides app)))]
+        [:p (str "Current slide is " (inc (:current-slide app)) "/" (count (:slides app)))]
         (om/build-all slide
                       (:slides app)
                       {:key :slideno :init-state chans :opts (:current-slide app)})]))))


Startup does not initialize exercise summary caches for all users

--- src/ontrail/core.clj
+++ src/ontrail/core.clj
@@ -210,9 +210,6 @@
   (future (.info logger (str "Search terms in index: " (time (rebuild-index)))))
   (nc/newcomment-cache-restore-all)
   (schedule-work nc/newcomment-cache-store-all 600)
-  (future (do (.info logger "Summary cache initialized")
-              (time (doall (for [user (mc/distinct ONUSER "username" {})]
-                             (memoizes-after-reset user))))))
   (start-http-server (-> app-routes
                          handler/site
                          ring-head/wrap-head


Added plugin lein-autodoc

Added plugin lein-autodoc

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -3,6 +3,7 @@
         :plugins [
             [lein-exec "0.2.0"]
             [lein-swank "1.4.4"]
+            [lein-autodoc "0.9.0"]
             [org.clojure/clojure "1.3.0"]
         ]
     }


Removed unnecessary fn wrapping in swqp! calls.

--- src/tetris/core.cljs
+++ src/tetris/core.cljs
@@ -112,16 +112,16 @@
 (defn game-running? [game-state] (:running game-state))

 (defn game-over! [game]
-  (swap! game (fn [g] (merge g {:running false, :game-over true}))))
+  (swap! game merge {:running false, :game-over true}))

 (defn toggle-pause-game! [game]
-  (swap! game #(update-in % [:running] not)))
+  (swap! game update-in [:running] not))

 (defn calculate-score [current-score rows-cleared]
   (+ current-score (* 10 rows-cleared) (if (= rows-cleared 4) 20)))

 (defn update-score! [game rows-cleared]
-  (swap! game (fn [g] (update-in g [:score] #(calculate-score % rows-cleared)))))
+  (swap! game update-in [:score] #(calculate-score % rows-cleared)))

 (defn score->level [score]
   (min MAX-LEVEL (inc (quot score SWITCH-LEVEL-EACH))))
@@ -149,14 +149,14 @@

 (defn move-falling-piece! [game dir]
   (try
-    (swap! game (fn [g] (update-in g [:falling-piece] #(move-piece % dir))))
+    (swap! game update-in [:falling-piece] #(move-piece % dir))
   (catch js/Error e)))

 (defn make-falling-piece-fall! [game] (move-falling-piece! game :down))

 (defn rotate-falling-piece! [game]
   (try
-    (swap! game (fn [g] (update-in g [:falling-piece] rotate-piece)))
+    (swap! game update-in [:falling-piece] rotate-piece)
   (catch js/Error e)))

 (defn entered-board? [piece]
@@ -208,7 +208,7 @@
 (defn clear-rows! [game]
   (let [completed-rows (completed-rows (:pieces @game))]
     (when (not (empty? completed-rows))
-      (swap! game #(update-in % [:pieces] clear-rows-from-pieces)))
+      (swap! game update-in [:pieces] clear-rows-from-pieces))
     (count completed-rows)))

 ; ---------- Rendering ----------
@@ -308,7 +308,7 @@

 (defn start-new-game! [game]
   (reset! game starting-state)
-  (swap! game (fn [g] (-> g (assoc :level 1) (assoc :score 0))))
+  (swap! game merge {:level 1, :score 0})
   (add-next-falling-piece! game))

 (defonce game (atom starting-state))


Decrease scope of around-all spec state

Decrease scope of around-all spec state

--- spec/cljx/speclj/core_spec.cljx
+++ spec/cljx/speclj/core_spec.cljx
@@ -111,40 +111,42 @@
   )

-(def #^{:dynamic true} widget (atom 5))
-(def #^{:dynamic true} call-count (atom 0))
 (describe "around-all form"
   (describe "with nothing else"
-    (around-all [context]
-      (swap! call-count inc)
-      (binding [*gewgaw* (swap! widget inc)]
-        (context)))
-
-    (it "executes before the specs"
-      (should= 6 @widget))
-
-    (it "executes around the specs"
-      (should= 6 *gewgaw*))
-
-    (it "only executes once"
-      (should= 1 @call-count))
-
-    (context "nested"
+    (let [widget (atom 5)
+          call-count (atom 0)]
+
+      [
       (around-all [context]
         (swap! call-count inc)
-        (swap! widget #(/ % 2))
-        (context))
-
-      (around-all [context]
-        (swap! call-count inc)
-        (swap! widget #(- % 2))
-        (context))
-
-      (it "executes in the order in which they are defined"
-        (should= 1 @widget))
-
-      (it "and still only execute once"
-        (should= 3 @call-count))))
+        (binding [*gewgaw* (swap! widget inc)]
+          (context)))
+
+      (it "executes before the specs"
+        (should= 6 @widget))
+
+      (it "executes around the specs"
+        (should= 6 *gewgaw*))
+
+      (it "only executes once"
+        (should= 1 @call-count))
+
+      (context "nested"
+        (around-all [context]
+          (swap! call-count inc)
+          (swap! widget #(/ % 2))
+          (context))
+
+        (around-all [context]
+          (swap! call-count inc)
+          (swap! widget #(- % 2))
+          (context))
+
+        (it "executes in the order in which they are defined"
+          (should= 1 @widget))
+
+        (it "and still only execute once"
+          (should= 3 @call-count)))]))

   (describe "with before-alls"
     (before-all


Add missing ::uuid generic spec.

Add missing ::uuid generic spec.

--- src/uxbox/schema.clj
+++ src/uxbox/schema.clj
@@ -87,6 +87,7 @@
 (s/def ::boolean-string (s/conformer boolean-conformer boolean-unformer))
 (s/def ::positive-integer #(< 0 % Long/MAX_VALUE))
 (s/def ::uploaded-file #(instance? ratpack.form.UploadedFile %))
+(s/def ::uuid uuid?)
 (s/def ::bytes bytes?)
 (s/def ::path path?)


Fix broken test

Fix broken test

--- scheduler/test/cook/test/mesos/scheduler.clj
+++ scheduler/test/cook/test/mesos/scheduler.clj
@@ -343,7 +343,7 @@
                                              :task-id task-id-3
                                              :start-time start-time-3)
         test-db (d/db conn)]
-    (is (= #{task-id-1 task-id-2} (set (sched/get-lingering-tasks test-db (t/now) timeout-hours))))))
+    (is (= #{task-id-1 task-id-2} (set (sched/get-lingering-tasks test-db (t/now) timeout-hours timeout-hours))))))

 (deftest test-filter-offensive-jobs
   (let [uri "datomic:mem://test-filter-offensive-jobs"


when solving types use the fully qualified name

--- src/app/symbol_solver/scope.clj
+++ src/app/symbol_solver/scope.clj
@@ -93,8 +93,8 @@

 (defn solveClassInPackage [pakage nameToSolve]
   {:pre [typeSolver]}
-  ; TODO first look into the package
-  (typeSolver nameToSolve))
+  (let [qualified-name (if pakage (str (packageName pakage) "." nameToSolve) nameToSolve)]
+    (typeSolver qualified-name)))

 (defn solveAmongVariableDeclarator
   [nameToSolve variableDeclarator]


Fix typo in type hint

Fix typo in type hint

--- src/appengine_magic/servlet.clj
+++ src/appengine_magic/servlet.clj
@@ -42,7 +42,7 @@

 (defn- make-request-map [^HttpServlet servlet
                          ^HttpServletRequest request
-                         ^HttpServletRespone response]
+                         ^HttpServletResponse response]
   {:servlet            servlet
    :response           response
    :request            request


insights: filter out builds cancelled while in queue

- These builds show up as gaps.

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -39,8 +39,10 @@
   (let [queued-time (max (build/queued-time build) 0)]
     (assoc build :queued_time_millis queued-time)))

-(defn build-graphable [{:keys [outcome]}]
-  (#{"success" "failed" "canceled"} outcome))
+(defn build-graphable [{:keys [outcome build_time_millis]}]
+  (or (#{"success" "failed"} outcome)
+      (and (= "canceled" outcome)
+           build_time_millis)))

 (defn visualize-insights-bar! [el builds owner]
   (let [[y-pos-max y-neg-max] (->> [:build_time_millis :queued_time_millis]


fix analytics for bottom bar click

fix analytics for bottom bar click

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -231,6 +231,9 @@
     (-> bars-join
         (.select ".bottom")
         (.attr #js {"xlink:href" build-timing-url})
+        (.on #js {"click" #(analytics/track {:event-type :insights-bar-clicked
+                                             :owner owner
+                                             :properties {:build-url (unexterned-prop % "build_url")}})})
         (.select "rect.bar")
         (.attr #js {"y" y-zero
                     "x" #(x-scale (unexterned-prop % "build_num"))


moved the show-insights? addition further down in insights since it was returning empty (not nil) which caused it to show the wrong screen

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -302,7 +302,7 @@

 (defrender build-insights [state owner]
   (let [orgs (dissoc (get-in state state/user-organizations-path))
-        projects (add-show-insights?-to-projects orgs (get-in state state/projects-path))]
+        projects (get-in state state/projects-path)]
     (html
      [:div#build-insights {:class (case (count projects)
                                     1 "one-project"
@@ -311,4 +311,4 @@
         (cond
           (nil? projects)    [:div.loading-spinner-big common/spinner]
           (empty? projects)  (om/build no-projects state)
-          :else              (om/build-all project-insights projects))])))
+          :else              (om/build-all project-insights (add-show-insights?-to-projects orgs projects)))])))


+(def modified),(def unmodified)

+(def modified),(def unmodified)

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -202,6 +202,9 @@
 (def vp-non-pronoun
   {:comp {:synsem {:pronoun false}}})

+(def modified {:modified true})
+(def unmodified {:modified false})
+
 (def grammar (list (unifyc h21
                            {:rule "adjective-phrase"
                             :synsem {:cat :adjective}})
@@ -256,6 +259,7 @@
                               :head {:phrasal false
                                      :synsem {:propernoun is-propernoun?}}
                               :comp {:phrasal false}})) ;; rathole prevention ;; TODO: see if this can be removed.
+
                    (unifyc c10
                            comp-specs-head
                            (let [number-agreement (atom :top)


+(defn filtered-model)

+(defn filtered-model)

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -20,6 +20,7 @@
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
    [clojure.core.cache :as cache]
+   [clojure.pprint :refer (pprint)]
    [clojure.repl :refer (doc)]
    [dag_unify.core :refer (fail? get-in remove-matching-keys strip-refs unify)]))

@@ -947,3 +948,36 @@
          (generation-implications spec (rest reflexive-constraints) model)))
      spec)))

+(def example-lexical-filter
+  #(or (= "cane"
+          (get-in % [:italiano :italiano]))
+       (= "gatto"
+          (get-in % [:italiano :italiano]))
+       (= "poltrona"
+          (get-in % [:italiano :italiano]))
+       (= "sedia"
+          (get-in % [:italiano :italiano]))
+       (and
+        (= :det
+           (get-in % [:synsem :cat]))
+        (= :def
+           (get-in % [:synsem :def])))))
+
+(defn filtered-model
+  "creating a model from a subset of the model's lexicon, filtered by specified criteria."
+  [lexical-filter]
+  (let [model (model)
+        lexicon (:lexicon model)
+        surface-and-structures-pairs
+        (filter (fn [[surface structures]] (not (empty? structures)))
+                (zipmap (keys lexicon)
+                        (map (fn [lexemes]
+                               (filter lexical-filter lexemes))
+                             (vals lexicon))))]
+    (model-plus-lexicon
+     (zipmap (map first surface-and-structures-pairs)
+             (map second surface-and-structures-pairs)))))
+
+
+
+


fix typo

fix typo

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -792,7 +792,7 @@
       "del"
       {:synsem {:cat :det
                 :def :partitivo
-                :agr {:number :singular
+                :agr {:number :sing
                       :gender :masc}}}
       "dei"
       {:synsem {:cat :det


added restare

added restare

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -1708,6 +1708,10 @@
    "recuperare" {:synsem {:cat :verb
                            :sem {:pred :recover}}}

+   "restare" {:synsem {:essere true
+                            :cat :verb
+                            :sem {:pred :remain2}}}
+
    "restituire" {:italiano {:boot-stem1 "restituisc"
                             :boot-stem2 "restitu"}
                  :synsem {:cat :verb


Completes recaptcha helpers.

Completes recaptcha helpers.

--- src/cadence/model/recaptcha.clj
+++ src/cadence/model/recaptcha.clj
@@ -1,2 +1,30 @@
 (ns cadence.model.recaptcha
-  (:import net.tanesha.recaptcha4j))
+  (:require [cadence.config :as config])
+  (:import (net.tanesha.recaptcha ReCaptcha ReCaptchaFactory)))
+
+
+(def ^:dynamic *recaptcha*
+  (let [rconf (:recaptcha config/tokens)]
+    (ReCaptchaFactory/newReCaptcha
+      (:public-key rconf) (:private-key rconf) false)))
+
+(defn get-html
+  "Returns the html to show the recaptcha."
+  (^String [^ReCaptcha recap errors] (.createRecaptchaHtml recap errors nil))
+  (^String [errors] (get-html *recaptcha* errors)))
+
+(defn check
+  "Checks whether the recaptcha response is correct or not."
+  ([^String address
+    ^String challenge
+    ^String response] (check *recaptcha* address challenge response))
+  ([^ReCaptcha recap
+    ^String address
+    ^String challenge
+    ^String response] (.checkAnswer recap address challenge response)))
+
+(defmacro with-recaptcha
+  "Macro to rebind the default recaptcha with the given one."
+  [recap & body]
+  `(binding [*recaptcha* ~recap]
+     ~@body))


refactor Old Hollywood Grid with flag system

--- src/clj/game/cards-upgrades.clj
+++ src/clj/game/cards-upgrades.clj
@@ -223,21 +223,14 @@
                                            (system-msg state :corp (str "trashes Off the Grid")))}}}

    "Old Hollywood Grid"
-   (let [ab {:req (req (or (= (:zone card) (:zone target)) (= (central->zone (:zone target)) (butlast (:zone card)))))
-             :effect (req (if-not (some #(= (:title %) (:title target)) (:scored runner))
-                            (prevent-steal state side)
-                            (swap! state update-in [:runner :register] dissoc :cannot-steal)))}
-         un {:effect (req (swap! state update-in [:runner :register] dissoc :cannot-steal))}]
-     {:trash-effect
-      {:req (req (and (= :servers (first (:previous-zone card))) (:run @state)))
-       :effect (effect (register-events {:pre-steal-cost (assoc ab :req (req (or (= (:zone target) (:previous-zone card))
-                                                                                (= (central->zone (:zone target))
-                                                                                (butlast (:previous-zone card))))))
-                                         :run-ends {:effect (req (unregister-events state side card)
-                                                                 (swap! state update-in [:runner :register] dissoc
-                                                                        :cannot-steal))}}
-                                        (assoc card :zone '(:discard))))}
-      :events {:pre-steal-cost ab :run-ends un}})
+   {:events {:pre-steal-cost
+             {:req (req (or (= (:zone card) (:zone target)) (= (central->zone (:zone target)) (butlast (:zone card)))))
+              :effect (effect (register-run-flag!
+                                card :can-steal
+                                (fn [state side card]
+                                  (if-not (some #(= (:title %) (:title card)) (:scored runner))
+                                    ((constantly false) (toast state :runner "Cannot steal due to Old Hollywood Grid." "warning"))
+                                    true))))}}}

    "Panic Button"
    {:init {:root "HQ"} :abilities [{:cost [:credit 1] :label "Draw 1 card" :effect (effect (draw))


Function to count all terms

Function to count all terms

--- src/clj_mrazik/db_interface.clj
+++ src/clj_mrazik/db_interface.clj
@@ -63,3 +63,11 @@
         first
         :cnt))

+(defn all-words-count
+    []
+    (->
+        (jdbc/query db-spec/mrazik-db
+            ["select count(*) as cnt from dictionary"])
+        first
+        :cnt))
+


Code simplifications

Code simplifications

--- src/cljs/clojure_rest/core.cljs
+++ src/cljs/clojure_rest/core.cljs
@@ -19,18 +19,16 @@

 (defn status->str
   [status]
-  (cond
-    (= status BACKLOG) "Backlog"
-    (= status UNDER-DEV) "In Progress"
-    (= status DONE) "Done"
-    :else "Unknown"))
+  (condp = status
+    BACKLOG "Backlog"
+    UNDER-DEV "In Progress"
+    DONE "Done"))

 (defn category->color
   [category]
-  (cond
-    (= category BUG-FIX) "#BD8D31"
-    (= category ENHANCEMENT) "#3A7E28"
-    :else "#eee"))
+  (condp = category
+    BUG-FIX "#BD8D31"
+    ENHANCEMENT "#3A7E28"))

 (defn card-side-color
   "Render the ribbon on the left of the card, that indicates its category"


remove duplicate code

remove duplicate code

--- src/cljs/lambdacd/pipeline.cljs
+++ src/cljs/lambdacd/pipeline.cljs
@@ -7,11 +7,14 @@

 (declare build-step-component) ;; mutual recursion

+(defn step-component-with [step-id status display-output name children]
+  (append-components [:li { :key (str step-id) :data-status status :on-click display-output }
+                      [:span {:class "build-step"} name]] children))
+
 (defn container-build-step-component [{step-id :step-id {status :status} :result children :children name :name } output-atom ul-or-ol on-click-fn retrigger-elem build-number]
-  [:li {:key step-id :data-status status :on-click on-click-fn}
-   [:span {:class "build-step"} name ]
-   retrigger-elem
-   [ul-or-ol (map #(build-step-component  % output-atom build-number) children)]])
+  (step-component-with step-id status on-click-fn name [
+                                                   retrigger-elem
+                                                   [ul-or-ol (map #(build-step-component  % output-atom build-number) children)]]))

 (defn ask-for [parameters]
   (into {} (doall (map (fn [[param-name param-config]]
@@ -46,9 +49,6 @@
     (if (and trigger-id (not (is-finished build-step)))
       [:i {:class "fa fa-play trigger" :on-click (click-handler #(manual-trigger result))}])))

-(defn step-component-with [step-id status display-output children]
-  (append-components [:li { :key (str step-id) :data-status status :on-click display-output }] children))
-
 (defn build-step-component [build-step output-atom build-number]
   (let [result (:result build-step)
         step-id (:step-id build-step)
@@ -59,7 +59,7 @@
     (case (:type build-step)
       "parallel"  (container-build-step-component build-step output-atom :ul display-output retrigger-elem build-number)
       "container" (container-build-step-component build-step output-atom :ol display-output retrigger-elem build-number)
-      (step-component-with step-id status display-output [[:span {:class "build-step"} name]
-                                                          (manualtrigger-component build-step)
-                                                          retrigger-elem] ))))
+      (step-component-with step-id status display-output name
+                           [(manualtrigger-component build-step)
+                            retrigger-elem] ))))


reload dokku

reload dokku

--- src/cljs/secret_shame/core.cljs
+++ src/cljs/secret_shame/core.cljs
@@ -66,7 +66,7 @@
         [:h4.list-group-item-heading "Reformed Thief"]
         [:input.list-group-item-heading.editing
          {:onChange (fn [e] (.log js/console "occupation changed"))
-          :value "Thief"}])]
+          :value "Unreformed Thief"}])]

      [:div.list-group.item.widget.widget-card


Removed SimpleAttribute and replaced it with a simple fn.

--- src/clojure/freactive/core.cljc
+++ src/clojure/freactive/core.cljc
@@ -864,14 +864,6 @@
          ((.-remove-watch binding-info) the-ref #?(:cljs id :clj this))
          (enqueue-fn #(.set this))))

-     (deftype SimpleAttribute [set-fn enqueue-fn]
-       IFn
-       (#?(:cljs -invoke :clj invoke) [this new-val]
-         (.dispose this)
-         (bind-attr* new-val set-fn enqueue-fn))
-       #?(:cljs Object :clj IReactiveAttributeImpl)
-       (dispose [this] (set-fn nil)))
-
      (defn bind-attr* [the-ref set-fn enqueue-fn]
        (if (satisfies? IDeref the-ref)
          (let [binding
@@ -880,7 +872,9 @@
            binding)
          (do
            (set-fn the-ref)
-           (SimpleAttribute. set-fn enqueue-fn))))
+           (fn [new-val]
+             (set-fn nil)
+             (bind-attr* new-val set-fn enqueue-fn)))))

      (defn attr-binder** [enqueue-fn]
        (fn attr-binder* [set-fn]


Fixes to cursor fn's.

Fixes to cursor fn's.

--- src/clojure/freactive/core.cljs
+++ src/clojure/freactive/core.cljs
@@ -328,11 +328,11 @@

             (sequential? korks-or-getter)
             korks-or-getter)
-        getter (if ks (fn [cur] (get-in cur path)) korks-or-getter)
+        getter (if ks (fn [cur] (get-in cur ks)) korks-or-getter)
         setter (or
                 setter
                 (when ks
-                  (fn [cur new-sub] (assoc-in cur path new-sub)))
+                  (fn [cur new-sub] (assoc-in cur ks new-sub)))
                 (fn [_ _] (assert false "Cursor does not support updates")))
         cursor (ReactiveCursor. ref getter setter true nil nil nil nil lazy nil nil)
         sully  (make-sully-fn cursor)
@@ -350,5 +350,5 @@
   ([ref getter setter] (cursor* ref getter setter false false)))

 (defn lazy-cursor
-  ([ref korks-or-getter] (cursor* ref korks-or-getter nil true))
+  ([ref korks-or-getter] (cursor* ref korks-or-getter nil true false))
   ([ref getter setter] (cursor* ref getter setter true false)))


Work on consolidating core code.

Work on consolidating core code.

--- src/clojure/freactive/core.cljs
+++ src/clojure/freactive/core.cljs
@@ -205,7 +205,7 @@

   IDeref
   (-deref [this]
-    (register-rx-dep this id lazy)
+    (register-rx-dep this lazy)
     (when dirty (-compute this))
     state)

@@ -315,7 +315,7 @@

   cljs.core/IDeref
   (-deref [this]
-    (register-rx-dep this id lazy)
+    (register-rx-dep this lazy)
     (when dirty (-compute this))
     state)

@@ -367,6 +367,25 @@
   (-swap! [this f x] (cursor-swap! this ref getter setter #(f % x)))
   (-swap! [this f x y] (cursor-swap! this ref getter setter #(f % x y)))
   (-swap! [this f x y more] (cursor-swap! this ref getter setter #(apply f %  x y  more))))
+
+
+(def ^:private IInvalidates-mixin
+  {:-notify-invalidation-watches
+   (fn --notify-invalidation-watches [this]
+     (goog.object/forEach (.-invalidation-watches this)
+       (fn [f key _] (f key this))))
+
+   :-add-invalidation-watch
+   (fn --add-invalidation-watch
+     [this key f]
+     (aset invalidation-watches key f)
+     this)
+
+   :-remove-invalidation-watch
+   (fn -remove-invalidation-watch
+     [this key]
+     (js-delete invalidation-watches key)
+     this)})

 (defn cursor* [ref korks-or-getter setter lazy]
   (let [id (new-reactive-id)


[n.u.mapping] added :on-focus-change trait to View

--- src/clojure/neko/ui/mapping.clj
+++ src/clojure/neko/ui/mapping.clj
@@ -17,7 +17,7 @@
    ;; UI widgets
    {:view {:classname android.view.View
            :traits [:def :id :padding :on-click :on-long-click :on-touch
-                    :on-create-context-menu :on-key
+                    :on-create-context-menu :on-key :on-focus-change
                     :default-layout-params :linear-layout-params
                     :relative-layout-params :listview-layout-params
                     :frame-layout-params :gallery-layout-params]


Flesh out the Hotels & Rooms to make them a bit more realistic

--- spec/rooms.clj
+++ spec/rooms.clj
@@ -8,7 +8,24 @@

 ;; In a real app, we'd probably have a POST /hotels/:id/create-rooms instead.
 ;; But this exists mostly to
+
+
+(rs/defschema RoomSize (s/enum :single :double :suite :special))
+
+(rs/defschema CreateRequest {
+                             :number s/Int
+                             :floor  s/Int
+                             :size   RoomSize
+                             })
+
+(def create-responses
+  {HttpServletResponse/SC_CREATED   {:id       s/Int
+                                     :hotel-id s/Int}
+   HttpServletResponse/SC_NOT_FOUND (rs/with-description "The specified hotel does not exist." nil)})
+
 (defn create
+  {:body-schema CreateRequest
+   :responses   create-responses}
   [hotel-id resource-uri]
   (let [room-id 227]
     (->
@@ -20,7 +37,7 @@
   {:number         s/Int
    :floor          s/Int
    :last_booked_at s/Inst
-   :size           (s/enum :single :double :suite :special)})
+   :size           RoomSize})

 (def show-responses
   {HttpServletResponse/SC_OK        Room


Add Scorpion Storm RGX.

Add Scorpion Storm RGX.

--- src/afterglow/fixtures/chauvet.clj
+++ src/afterglow/fixtures/chauvet.clj
@@ -273,7 +273,7 @@
                             (chan/functions :strobe 3
                                             0 nil
                                             5 :strobe
-                                            255 "Sound Active strobe")
+                                            255 "Strobe Sound Active")
                             (chan/functions :control 4
                                             0 "Motor 1 Stop"
                                             5 :motor-1-clockwise
@@ -312,6 +312,44 @@
                                             181 "Beam Red Blue"
                                             217 "Beam Red Green Blue")]}))))

+(defn scorpion-storm-rgx
+  "[Scorpion Storm RGX](http://www.chauvetlighting.com/products/manuals/Scorpion_Storm_RGX_UM_Rev03_WO.pdf)
+  grid effect laser."
+  []
+  {:channels [(chan/functions :control 1
+                                       0 "DMX Mode"
+                                       20 "Auto Fast Red"
+                                       40 "Auto Slow Red"
+                                       60 "Auto Fast Green"
+                                       80 "Auto Slow Green"
+                                       100 "Auto Fast Red Green"
+                                       120 "Auto Slow Red Green"
+                                       140 :sound-active-red
+                                       160 :sound-active-green
+                                       180 :sound-active
+                                       200 "Random")
+                       (chan/functions :control 2
+                                       0 "Blackout"
+                                       5 "Beam Red"
+                                       29 "Beam Green"
+                                       57 "Beam Red Green"
+                                       85 "Strobe Green"
+                                       113 "Strobe Red"
+                                       141 "Beam Red, Strobe Green"
+                                       169 "Beam Green, Strobe Red"
+                                       198 "Strobe Red Green"
+                                       225 "Alternate Red/Green")
+                       (chan/functions :strobe 3
+                                       0 nil
+                                       5 :strobe
+                                       255 "Strobe Sound Active")
+                       (chan/functions :control 4
+                                       0 "Stop"
+                                       5 :beams-clockwise
+                                       128 "Stop 2"
+                                       134 :beams-counterclockwise)]
+   :name "Scorpion Storm RGX"})
+
 (defn slimpar-hex3-irc
   "[SlimPAR HEX 3 IRC](http://www.chauvetlighting.com/slimpar-hex3irc.html)
   six-color low-profile LED PAR.


with query it is possible to work with result from repl

--- src/athena_cmd/core.clj
+++ src/athena_cmd/core.clj
@@ -44,15 +44,19 @@
            more (.next rs)]

       (if-not more
-        (generate-string res {:pretty true})
+        res
         (do
           (recur
             (conj res (read_row rs))
             (.next rs)))))))

+(defn query
+  [file]
+  (exec (slurp file)))
+
 (defn -main
   [& args]
-  (let [query (slurp (nth args 0))]
+  (let [file (nth args 0)]
     (println
-      (exec query))))
+      (generate-string (query file) {:pretty true}))))


cleanup

cleanup

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -77,9 +77,6 @@
       (filter not-fail?
               (map (fn [bolt-and-comps]
                      (log/debug (str "doing defaults on: " depth "/" max-depth ":" ((:morph-ps model) (get bolt-and-comps []))))
-                     (doall (map (fn [k]
-                                   (log/debug (str "doing defaults with path:" k " => " (count (get bolt-and-comps k)))))
-                                 (keys bolt-and-comps)))
                      (do-defaults
                       (do-assocs (get bolt-and-comps [])
                                  (dissoc bolt-and-comps []) model)


Update cake.tasks.test to respect :test-path.

--- src/cake/tasks/test.clj
+++ src/cake/tasks/test.clj
@@ -15,7 +15,7 @@
 (defn run-project-tests [& opts]
   (bake (:use bake.test
               [bake.core :only [with-context]])
-    [namespaces (find-namespaces-in-dir (java.io.File. "test"))
+    [namespaces (find-namespaces-in-dir (java.io.File. (:test-path *project*)))
      opts       (merge (test-opts) (apply hash-map opts))]
     (with-context :test
       (run-project-tests namespaces opts))))


Line's shorter now.

Line's shorter now.

--- src/cbfg/world/net.cljs
+++ src/cbfg/world/net.cljs
@@ -183,11 +183,10 @@
                                    rad (Math/atan2 dx dy)
                                    dist (Math/abs (Math/sqrt (+ (* dx dx)
                                                                 (* dy dy))))
-                                   prev-msgs (get-in
-                                              prev-addrs
-                                              [addr :outs
-                                               [accept-addr accept-port]
-                                               [from-port to-addr to-port]])]
+                                   prev-msgs (get-in prev-addrs
+                                                     [addr :outs
+                                                      [accept-addr accept-port]
+                                                      [from-port to-addr to-port]])]
                                ["
"
                                 "
"
                                 from-port " --> "


throw an exception at expansion rather than evaluation

--- plugins/matross/tasks/temp_file.clj
+++ plugins/matross/tasks/temp_file.clj
@@ -18,7 +18,7 @@
    body has been evaluated, delete the temp files from the target machine."
   [conn bindings & body]
   (cond (some #(= conn %1) bindings)
-        `(throw (IllegalArgumentException. "Collission between conn and tempfile bindings."))
+        (throw (IllegalArgumentException. "Collission between conn and tempfile bindings."))

         :else
         `(let [~@(interleave bindings


Metrics: set hostname prefix in setup, not classload

--- src/cfpb/qu/metrics.clj
+++ src/cfpb/qu/metrics.clj
@@ -3,16 +3,17 @@
   (:require
     [clj-statsd :as sd]))

-(def prefix (str "qu." (.getHostName (java.net.InetAddress/getLocalHost)) "."))
+(def prefix (atom ""))

 (defn setup
   [host port]
+  (swap! prefix str "qu." (.getHostName (java.net.InetAddress/getLocalHost)) ".")
   (sd/setup host port))

 (defn prefix-metric
   "Ensure consistent prefix for all metrics"
   [key]
-  (str prefix key))
+  (str @prefix key))

 (defn increment
   [key & args]


conjugate gerund: e.g. "mangiare" => "mangiando"

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -900,11 +900,20 @@
      (and
       (= (get-in word [:infl]) :participle)
       (string? (get-in word [:italiano])))
-      (let [infinitive (if (get-in word [:infinitive]) ;; present participle
-                        (get-in word [:infinitive])
-                        (get-in word [:italiano]))]
-        (log/debug (str "conjugating present participle from infinitive form: " infinitive))
-        "mangiando") ;; TODO: stub that passes test: complete actual participle conjugation
+     (let [stem-analysis (stem-analysis word)
+           infinitive (:infinitive stem-analysis)
+           stem (:stem stem-analysis)]
+        (log/debug (str "conjugating present participle; analysis:" stem-analysis))
+        (cond (= "are" (:are-type stem-analysis))
+              (str stem "ando")
+              (= "ere" (:ere-type stem-analysis))
+              (str stem "endo")
+              (= "ire" (:ire-type stem-analysis))
+              (str stem "endo")
+              true
+              (do
+                (log/warn (str "no specific conjugation found for word with stem-analysis:" stem-analysis " - returning infinitive"))
+                infinitive)))

      (and
       (string? (get-in word '(:italiano)))


Increase append limit

Increase append limit

--- src/cljs/nightcode/paren_soup.cljs
+++ src/cljs/nightcode/paren_soup.cljs
@@ -123,7 +123,7 @@
                   (fn [text]
                     (.onenter js/window.java (str text "\n")))
                   :disable-clj? (not repl?)
-                  :append-limit 5000})))))
+                  :append-limit 10000})))))

 (defn show-instarepl []
   (-> (.querySelector js/document "#instarepl")


hide metabadge content

hide metabadge content

--- src/cljs/salava/badge/ui/info.cljs
+++ src/cljs/salava/badge/ui/info.cljs
@@ -255,7 +255,7 @@
                [:div [:label (t :badge/Recipient) ": " ] [:a.link {:href (path-for (str "/user/profile/" owner))} first_name " " last_name]]
                [:div [:label (t :badge/Recipient) ": "]  first_name " " last_name]))

-            [:div [metabadge (:assertion_url @state)]]
+            #_[:div [metabadge (:assertion_url @state)]]

            [:div.description description]


Fix typo on failure type constructor docstring.

--- src/cljx/cats/monad/exception.cljx
+++ src/cljx/cats/monad/exception.cljx
@@ -168,7 +168,7 @@
 (defn failure
   "A failure type constructor.

-  If a provided parameter is an exceptio, it wraps
+  If a provided parameter is an exception, it wraps
   it in a `Failure` instance and return it. But if
   a provided parameter is arbitrary data, it tries
   create an exception from it using clojure `ex-info`


Do not pull stupidly all blobs in memory before sending one by one...

--- src/cljx/geschichte/p2p/fetch.cljx
+++ src/cljx/geschichte/p2p/fetch.cljx
@@ -162,22 +162,16 @@
   (go-loop [{:keys [ids peer] :as m} (<! binary-fetch-ch)]
     (when m
       (info "binary-fetch:" ids)
-      (let [fetched (->> ids
-                         (map (fn [id] (go [id (<! (-bget store id
-                                                         #+clj #(let [baos (ByteArrayOutputStream.)]
-                                                                  (io/copy (:input-stream %) baos)
-                                                                  (.toByteArray baos))
-                                                         #+cljs identity))])))
-                         async/merge
-                         (async/into [])
-                         <!)]
-        (debug "BFETCHED:" fetched)
-        (doseq [[id blob] fetched]
-          (>! out {:topic :binary-fetched
-                   :value blob
-                   :peer peer})
-          (debug "sent blob:" id (*id-fn* blob)))
-        (recur (<! binary-fetch-ch))))))
+      (doseq [id ids]
+        (>! out {:topic :binary-fetched
+                 :value (<! (-bget store id
+                                   #+clj #(let [baos (ByteArrayOutputStream.)]
+                                            (io/copy (:input-stream %) baos)
+                                            (.toByteArray baos))
+                                   #+cljs identity))
+                 :peer peer})
+        (debug "sent blob:" id))
+      (recur (<! binary-fetch-ch)))))

 (defn- fetch-dispatch [{:keys [topic] :as m}]


Provide target sdk for imported Android projects

--- src/clojure/nightcode/projects.clj
+++ src/clojure/nightcode/projects.clj
@@ -150,7 +150,8 @@
                (not (.exists (io/file dir "project.clj")))
                (dialogs/show-project-clj-dialog))
       (->> {:app-name (.getName dir)
-            :namespace "put.your.main.class.here"}
+            :namespace "put.your.main.class.here"
+            :target-sdk "15"}
            (lein/create-file-from-template dir
                                            "project.clj"
                                            (if (lein/is-android-project? dir)


fix var formatting; clean up unused variables

--- src/clojure/zensols/cisql/conf.clj
+++ src/clojure/zensols/cisql/conf.clj
@@ -21,9 +21,7 @@
    [:gui false "use a graphical window to display result sets"
     "graphical-results"]
    [:headless true "use separate window for GUI (require restart)"
-    "graphical-results"]
-   [:end-directive "exit" "string used to exit the program"]
-   [:help-directive "help" "string used to print help"]])
+    "graphical-results"]])

 (def ^:private default-config
   (->> var-meta
@@ -135,7 +133,7 @@
   []
   (let [conf (config)]
     (letfn [(pr-conf [key]
-              (println (format " * %s: %s "(name key) (get conf key))))]
+              (println (format " * %s: %s" (name key) (get conf key))))]
       (println "# Built in variables:")
       (->> (map first var-meta)
            (map pr-conf)


Added more timing functions.

Added more timing functions.

--- src/cmr/dev/env/manager/timing.clj
+++ src/cmr/dev/env/manager/timing.clj
@@ -36,3 +36,17 @@
 (defn passed?
   [times tracker]
   (into {} (map (partial get-passed times tracker) (keys times))))
+
+(defn update-interval
+  [times tracker time-key]
+  (if (pos? (get-interval times tracker time-key))
+    (assoc tracker time-key (System/currentTimeMillis))
+    tracker))
+
+(defn update-tracker
+  [times tracker]
+  (loop [[time-key & time-keys] (keys times)
+         t tracker]
+    (if-not time-key
+      t
+      (recur time-keys (update-interval times t time-key)))))


function to title plots

function to title plots

--- src/clj/gyptis/core.clj
+++ src/clj/gyptis/core.clj
@@ -56,3 +56,26 @@
       (vt/->vg-data $)
       (vt/choropleth $ geotransform)
       (merge vt/top-level $))))
+
+(defn title
+  "Adds data and a text mark to the given spec to display the title-text."
+  [spec title-text]
+  (let [not-title (partial filter #(not= "title-text" (:name %)))
+        title-free-spec (-> spec
+                            (update :data (comp vec not-title))
+                            (update :marks (comp vec not-title)))]
+    (-> title-free-spec
+        (update-in [:data] conj {:name "title-text" :values [{:a "a"}]})
+        (update-in [:marks] conj
+                   {:type "text"
+                    :name "title-text"
+                    :from {:data "title-text"}
+                    :properties {:update
+                                 {:text {:value title-text}
+                                  :fill {:value "#000"}
+                                  :x {:value (* -1 (get-in vt/top-level [:padding :left]))}
+                                  :y {:value (* -1 (get-in vt/top-level [:padding :top]))}
+                                  :align {:value "left"}
+                                  :baseline {:value "top"}
+                                  :fontWeight {:value "bold"}
+                                  :fontSize {:value "16"}}}}))))


Ensure all side-effects will happen in the right order

--- src/cljam/io/bigwig.clj
+++ src/cljam/io/bigwig.clj
@@ -216,7 +216,7 @@
                   _reversed (lsb/read-ubyte r)
                   child-count (lsb/read-ushort r)]
               (if leaf?
-                (read-leafs r key-size child-count)
+                (doall (read-leafs r key-size child-count))
                 (let [file-offsets (read-file-offsets r key-size child-count)]
                   (map traverse file-offsets)))))]
     (traverse root-offset)))


Draw arc on current-graphcis, not current-applet. Fix #179.

--- src/cljc/quil/core.cljc
+++ src/cljc/quil/core.cljc
@@ -426,13 +426,13 @@
   ellipse-mode function. The start and stop parameters specify the
   angles at which to draw the arc. The mode is either :open, :chord or :pie."
   ([x y width height start stop]
-    (.arc (ap/current-applet) (float x) (float y) (float width) (float height)
+    (.arc (current-graphics) (float x) (float y) (float width) (float height)
         (float start) (float stop)))

   #?(:clj
      ([x y width height start stop mode]
       (let [arc-mode (u/resolve-constant-key mode arc-modes)]
-        (.arc (ap/current-applet) (float x) (float y) (float width) (float height)
+        (.arc (current-graphics) (float x) (float y) (float width) (float height)
               (float start) (float stop) (int arc-mode))))))

 (defn


code style - collapse nested lets in last commit

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -4120,36 +4120,36 @@
   (-reduce [v f init]
     (loop [i 0 step 0 init init]
       (if (< i cnt)
-        (let [arr (unchecked-array-for v i)
-              len (alength arr)]
-          (let [init (loop [j 0 init init]
-                       (if (< j len)
-                         (let [init (f init (aget arr j))]
-                           (if (reduced? init)
-                             init
-                             (recur (inc j) init)))
-                         init))]
-            (if (reduced? init)
-              @init
-              (recur (+ i len) len init))))
+        (let [arr  (unchecked-array-for v i)
+              len  (alength arr)
+              init (loop [j 0 init init]
+                     (if (< j len)
+                       (let [init (f init (aget arr j))]
+                         (if (reduced? init)
+                           init
+                           (recur (inc j) init)))
+                       init))]
+          (if (reduced? init)
+            @init
+            (recur (+ i len) len init)))
         init)))

   IKVReduce
   (-kv-reduce [v f init]
     (loop [i 0 step 0 init init]
       (if (< i cnt)
-        (let [arr (unchecked-array-for v i)
-              len (alength arr)]
-          (let [init (loop [j 0 init init]
-                       (if (< j len)
-                         (let [init (f init (+ j i) (aget arr j))]
-                           (if (reduced? init)
-                             init
-                             (recur (inc j) init)))
-                         init))]
-            (if (reduced? init)
-              @init
-              (recur (+ i len) len init))))
+        (let [arr  (unchecked-array-for v i)
+              len  (alength arr)
+              init (loop [j 0 init init]
+                     (if (< j len)
+                       (let [init (f init (+ j i) (aget arr j))]
+                         (if (reduced? init)
+                           init
+                           (recur (inc j) init)))
+                       init))]
+          (if (reduced? init)
+            @init
+            (recur (+ i len) len init)))
         init)))

   IFn


Disable event transmission when updating the view.

--- src/fm/simrunner/gui/rendering.clj
+++ src/fm/simrunner/gui/rendering.clj
@@ -9,6 +9,7 @@
     (java.io File))
   (:require
     [fm.simrunner.gui (toc :as toc)
+                      (wiring :as wrg)
                       (renderer :as rdr)
                       (task-buffer :as tbf)]))

@@ -24,7 +25,8 @@
  (update-in app-state [:ui] start-rendering tasks))

 (defn- render [{render-tasks :render-tasks :as ui}]
-  ((apply comp (reverse (tbf/staged render-tasks))) ui))
+  (wrg/do-unwired (:view ui)
+    ((apply comp (reverse (tbf/staged render-tasks))) ui)))

 (defn- stop-rendering [app-ui rendered-ui]
   (update-in app-ui [:render-tasks] tbf/drain))


Using Clojure reader for profiles map instead of EDN reader. (fix #19)

--- src/leiningen/ancient/utils/io.clj
+++ src/leiningen/ancient/utils/io.clj
@@ -4,7 +4,7 @@
             [leiningen.core.project :as prj]
             [leiningen.core.main :as main]
             [ancient-clj.verbose :refer :all]
-            [clojure.tools.reader.edn :as edn])
+            [clojure.tools.reader :as reader])
   (:import java.io.File))

 ;; ## Configure Logging
@@ -90,7 +90,7 @@
 (defn read-profiles-map!
   [path]
   (try
-    (when-let [form  (edn/read-string (slurp path))]
+    (when-let [form  (reader/read-string (slurp path))]
       (when-not (map? form)
         (throw (Exception. (str "Not a map: " form))))
       form)


fixed partition-by method

fixed partition-by method

--- src/datasplash/core.clj
+++ src/datasplash/core.clj
@@ -516,14 +516,14 @@
     (reify
       Partition$PartitionFn
       (partitionFor [this elem num]
-        (f elem num)))))
+       (f elem num)))))

 (defn dpartition-by
   ([f num options ^PCollection pcoll]
    (let [opts (assoc options :label :partition-by)
          ptrans (Partition/of num (partition-fn f))]
      (apply-transform pcoll ptrans base-schema opts)))
-  ([f pcoll] (dpartition-by f num {} pcoll)))
+  ([f num pcoll] (dpartition-by f num {} pcoll)))

 (defn ->combine-fn
   "Returns a CombineFn if f is not one already."


split out the promise-impl dependent stuff

--- src/deferst/system.cljc
+++ src/deferst/system.cljc
@@ -249,6 +249,11 @@
             (return config-ctx system)
             dks)))

+(defn- stop-system*
+  [system]
+  (let [sd (system-destructor system)]
+    (run-state sd system)))
+
 (defn stop-system!
   "given a Deferred<[_, system]> (i.e. the result of one of the
    config-ctx value fns) stop the system, running
@@ -257,8 +262,7 @@
   (d/chain
    dsys
    (fn [[_ system]]
-     (let [sd (system-destructor system)]
-       (run-state sd system)))))
+     (stop-system* system))))

 (defn start-system!
   "given a system-builder, start a system with the seed config
@@ -289,6 +293,9 @@
                   (ex-info "start-system! failed and unwound"
                            {:state st
                             :error e})))))))))
+(defn- system-map*
+  [system]
+  (filter-system-map system))

 (defn system-map
   "given the result of a config-ctx value fn,
@@ -298,7 +305,7 @@
   (d/chain
    dsys
    (fn [[_ system]]
-     (filter-system-map system))))
+     (system-map* system))))

 (comment
   (require '[deferst.system :as dfs])


fixed formatting of prepared debug statements

--- src/distillery/core.clj
+++ src/distillery/core.clj
@@ -100,7 +100,7 @@
 ;;     (generate-website! job)
 ;;     (run-complete! job-descr)
 ;;
-;; (def job (assoc-in job [:configuration :skip-wordclouds] true))
-;; (def job (assoc-in job [:configuration :skip-wordclouds] false))
-;; (def job (assoc-in job [:configuration :parallel-proc] true))
-;; (def job (assoc-in job [:configuration :parallel-proc] false))
+;;     (def job (assoc-in job [:configuration :skip-wordclouds] true))
+;;     (def job (assoc-in job [:configuration :skip-wordclouds] false))
+;;     (def job (assoc-in job [:configuration :parallel-proc] true))
+;;     (def job (assoc-in job [:configuration :parallel-proc] false))


New functions: job-name->product-name, job-name->version, job-name->book-name, read-results, and reload-all-results

--- src/emender_jenkins/results.clj
+++ src/emender_jenkins/results.clj
@@ -38,9 +38,48 @@
         ; rename files atomically (on the same filesystem)
         (file-utils/mv-file "results2.edn" "results.edn")))

+(defn job-name->product-name
+    [job-name]
+    (let [name-version (clojure.string/split job-name #"-")
+          product-name (second name-version)]
+          (if product-name
+              (clojure.string/replace product-name "_" " "))))
+
+(defn job-name->version
+    [job-name]
+    (let [name-version (clojure.string/split job-name #"-")
+          version      (get name-version 2)]
+          (if (and version (re-matches #"[0-9.]+" version))
+              version
+              "unknown")))
+
+(defn job-name->book-name
+    [job-name]
+    (let [name-version (clojure.string/split job-name #"-")
+          book-name    (get name-version 3)]
+          (if book-name
+              (clojure.string/replace book-name "_" " ")
+              "unknown")))
+
+(defn read-results
+    [job-list]
+    (for [job job-list]
+        (let [job-name (get job "name")]
+            {:job-name  job-name
+             :product   (job-name->product-name job-name)
+             :version   (job-name->version job-name)
+             :book-name (job-name->book-name job-name)
+            })))
+
 (defn reload-all-results
     [configuration]
-    (let [job-list (jenkins-api/read-list-of-all-jobs (-> configuration :jenkins :jenkins-url)
-                                                      (-> configuration :jenkins :jenkins-job-list-url))]
-    ))
+    (let [job-list (jenkins-api/read-list-of-test-jobs (-> configuration :jenkins :jenkins-url)
+                                                       (-> configuration :jenkins :jenkins-job-list-url)
+                                                       (-> configuration :jobs    :test-jobs-suffix))
+          job-results (read-results job-list)]
+          (clojure.pprint/pprint job-results)
+          ;job-results (read-all-test-results configuration job-list)]
+          (reset! results job-results)
+          ;job-results))
+))


Use destructuring for semver/extract

Use destructuring for semver/extract

--- src/github_changelog/semver.clj
+++ src/github_changelog/semver.clj
@@ -7,9 +7,9 @@
   (try (semver/parse version)
        (catch java.lang.AssertionError _e nil)))

-(defn extract [tag-name]
+(defn extract [[first-char :as tag-name]]
   (parse
-   (if (= \v (first tag-name))
+   (if (= \v first-char)
      (subs tag-name 1)
      tag-name)))


[#157] Use TEMP table for initial data load (#158)

--- backend/src/org/akvo/dash/import/csv.clj
+++ backend/src/org/akvo/dash/import/csv.clj
@@ -117,7 +117,7 @@
                        (vec (for [i (range 1 (inc n-cols))]
                               (str "Column " i))))
           temp-table (str table-name "_temp")]
-      (jdbc/execute! tenant-conn [(get-create-table-sql temp-table n-cols "text" false)])
+      (jdbc/execute! tenant-conn [(get-create-table-sql temp-table n-cols "text" true)])
       (jdbc/execute! tenant-conn [(get-create-table-sql table-name n-cols "jsonb" false)])
       (with-open [conn (-> tenant-conn :datasource .getConnection)]
         (let [copy-manager (.getCopyAPI (.unwrap conn PGConnection))]


Adds support for reading authdb if supplied, defaulting to dbname

--- src/metabase/driver/mongo/util.clj
+++ src/metabase/driver/mongo/util.clj
@@ -43,7 +43,7 @@
   "Run F with a new connection (bound to `*mongo-connection*`) to DATABASE.
    Don't use this directly; use `with-mongo-connection`."
   [f database]
-  (let [{:keys [dbname host port user pass ssl]
+  (let [{:keys [dbname host port user pass ssl authdb]
          :or   {port 27017, pass "", ssl false}} (cond
                                                    (string? database)            {:dbname database}
                                                    (:dbname (:details database)) (:details database) ; entire Database obj
@@ -53,9 +53,12 @@
                            user)
         pass             (when (seq pass)
                            pass)
+        authdb           (if (seq authdb)
+                           authdb
+                           dbname)
         server-address   (mg/server-address host port)
         credentials      (when user
-                           (mcred/create user dbname pass))
+                           (mcred/create user authdb pass))
         connect          (partial mg/connect server-address (build-connection-options :ssl? ssl))
         conn             (if credentials
                            (connect credentials)


Fix common tests

Fix common tests

--- test/discuss/utils/common_test.cljs
+++ test/discuss/utils/common_test.cljs
@@ -74,18 +74,18 @@
                  {:item2 "item2"}]
           bubbles [{:bubble1 "bubble1"}
                    {:bubble2 "bubble2"}]]
-      (= `[(discussion/items {:value ~items})
-           (discussion/bubbles {:value ~bubbles})]
-         (lib/build-transactions [['discussion/items items]
-                                  ['discussion/bubbles bubbles]]))
-      (= `[(discussion/items {:value nil})]
-         (lib/build-transactions [['discussion/items nil]])))))
+      (is (= `[(discussion/items {:value ~items})
+               (discussion/bubbles {:value ~bubbles})]
+             (lib/build-transactions [['discussion/items items]
+                                      ['discussion/bubbles bubbles]])))
+      (is (= `[(discussion/items {:value nil})]
+             (lib/build-transactions [['discussion/items nil]]))))))

 (deftest filter-keys-by-namespace-test
   (testing "Query subset of keys by their namespace."
     (let [test-data [:search/results :layout/add? :layout/title :layout/view :default]]
-      (= [:layout/add? :layout/title :layout/view]
-         (lib/filter-keys-by-namespace test-data "layout"))
-      (= [:default]
-         (lib/filter-keys-by-namespace test-data nil))
-      (empty? (lib/filter-keys-by-namespace test-data :non-existent)))))
+      (is (= [:layout/add? :layout/title :layout/view]
+             (lib/filter-keys-by-namespace test-data "layout")))
+      (is (= [:default]
+             (lib/filter-keys-by-namespace test-data nil)))
+      (is (empty? (lib/filter-keys-by-namespace test-data :non-existent))))))


fix build break dealing with the old version of leiningen on travis

--- src/leiningen/leinsync/list.clj
+++ src/leiningen/leinsync/list.clj
@@ -87,17 +87,15 @@
                          assertion)
                 (vals m)))))

-(defn mark-2-different-values [m [first second] marker-fn]
-  (let [[first-freq second-freq] (->> m
-                                      (vals)
-                                      (remove empty?)
-                                      (frequencies)
-                                      (vals))]
+(defn mark-2-different-values [m [first-v second-v] marker-fn]
+  (let [not-empty-values (remove empty? (vals m))
+        first-freq (count (filter #(= first-v %) not-empty-values))
+        second-freq (count (filter #(= second-v %) not-empty-values))]
     (cond
       (and (not= first-freq 1) (not= second-freq 1)) (marker-fn m)
-      (= first-freq second-freq) (marker-fn m #(or (= % first) (= % second)))
-      (> first-freq second-freq) (marker-fn m #(= % second))
-      (< first-freq second-freq) (marker-fn m #(= % first))
+      (= first-freq second-freq) (marker-fn m #(or (= % first-v) (= % second-v)))
+      (> first-freq second-freq) (marker-fn m #(= % second-v))
+      (< first-freq second-freq) (marker-fn m #(= % first-v))
       :else m)))

 (defn unterline-different-values [m]


Fix #48; clear out lib/dev in lein clean.

--- src/leiningen/clean.clj
+++ src/leiningen/clean.clj
@@ -17,5 +17,7 @@
   (delete-file (str (:jar-dir project) "/" (:name project) "-standalone.jar")
                true)
   (doseq [d [(:compile-path project)
-             (:library-path project)]]
+             (:library-path project)
+             ;; This must be hard-coded since it's needed in bin/lein
+             "lib/dev"]]
     (empty-directory (file d) true)))


doc for eval-formula corrected

doc for eval-formula corrected

--- src/logic/evaluator.clj
+++ src/logic/evaluator.clj
@@ -12,6 +12,6 @@

 (defn eval-formula
   "Takes a formula in clojure code and evaluates it with the given substitution vector.
-  The last must be of the shape [:a true :b false]"
+  The last must be of the shape ['a true 'b false]"
   [formula val-assignment]
   (eval `(let ~val-assignment ~formula)))


Repaired sat-solve

Repaired sat-solve

--- src/logic/sat-solve.clj
+++ src/logic/sat-solve.clj
@@ -44,6 +44,6 @@
     (if (nil? res-str)
               [0]
               (vec (cons 1 (let [numvec  (vec (filter #(not= 0 %) (map #(Integer. %) (clojure.string/split res-str #" "))))
-                                 substitutions (apply hash-map (flatten (map (fn [[k v]] [k v (Integer. (str "-" k)) (symbol (str "not(" v ")"))]) (:subs dimacs-test))))]
+                                 substitutions (apply hash-map (flatten (map (fn [[k v]] [k v (Integer. (str "-" k)) (symbol (str "(not " v ")"))]) (:subs dimacs-map))))]
                              (println substitutions)
                              (replace substitutions numvec)))))))


Debug kc cypress dark-lumenci build problem bis

--- backend/src/akvo/lumen/endpoint/user.clj
+++ backend/src/akvo/lumen/endpoint/user.clj
@@ -30,9 +30,9 @@
                                                   firstName lastName))}}]
     ["/profile" {:get {:handler (fn [{tenant :tenant
                                     query-params :query-params}]
-                                (let [u (user/user authorizer tenant (get query-params "email"))]
+                                  (let [u (user/user authorizer tenant (get query-params "email"))]
                                     (log/error :email (get query-params "email") :profile u)
-                                    (lib/ok (select-keys u [:admin :email :firstName :id :lastName])))))}}]]
+                                    (lib/ok (select-keys u [:admin :email :firstName :id :lastName]))))}}]
    ["/admin/users"
     ["" {:get {:handler (fn [{tenant :tenant}]
                           (user/users authorizer tenant))}}]


added second sheet of bach (hopefully without errors)

--- test/examples/mad.clj
+++ test/examples/mad.clj
@@ -90,34 +90,50 @@
 ; (stop)

 ; Ok, now try this one slow, and add the echo effect
-(comment p (cycle (map
+(comment
+  (p (cycle (map
             #(assoc % :synth ks1-demo)
-            (pattern derezzed 4))))
+            (pattern derezzed 4)))))
 ;(inst-fx ks1-demo fx-echo)

-(comment p (cycle
+(comment
+  (p (cycle
      (map
        #(assoc % :pitch (- (:pitch %) 24))
      (map
        #(assoc % :synth grunge-bass)
-       (pattern derezzed 2)))))
+       (pattern derezzed 2))))))

 ;(stop)

 ; Now for a Bach challenge:
-; http://www.sheetmusic1.com/new.great.music/bach.minuet.gmajor/bach.1.demo.gif
+;; http://www.sheetmusic1.com/new.great.music/bach.minuet.gmajor/bach.1.demo.gif
+;; http://www.sheetmusic1.com/new.great.music/bach.minuet.gmajor/bach.2.demo.gif
 (def g-minuet-right-hand [[D5 D5 D5]
                          [B4 [A4 B4] G4]
                          [A4 D5 C5]
                          [B4 B4 A4] ; the two B4's should be tied together (ie. they should be one note). I don't think it's possible to express that they are one note using the []-dividing notation
                          [D5 [C5 B4] [A4 G4]]
                          [E5 [C5 B4] [A4 G4]]
-                         [F4 [E4 D4] F4]
+                         [F#4 [E4 D4] F#4]
                          [G4]
                          [B4 E5 E5]
                          [C#5 [B4 C5] A4]
                          [D5 E5 F5]
-                         [[E5 D5] [C#5 B4] A4]])
+                         [[E5 D5] [C#5 B4] A4]
+
+                         [A6 [G5 F#5 E5 D5]]
+                         [B6 [G5 F#5 E5 D5]]
+                         [C#5 A5 C#5]
+                         [D5]
+                         [D5 [C5 B5] A5]
+                         [B5 [A5 B5] [G4]]
+                         [C5 C5 [C5 B5]]
+                         [A5]
+                         [D5 [C5 B5 A5 G4]]
+                         [E5 [C5 B5 A5 G4]]
+                         [F#4 [E4 D4] F#4]
+                         [G4]])

 (def g-minuet-left-hand [[G3 F#3 D3]
                         [G3 D3 G2]
@@ -130,15 +146,30 @@
                         [G3 G3 E3]
                         [A3 E3 A2]
                         [F#3 E3 D3]
-                        [A2 E3 [A3 G3]]])
+                        [A2 E3 [A4 G3]]

-; now make it play both hands at once! I don't know how.
+                        [F#3]
+                        [G3]
+                        [A4 A4 A3]
+                        [D3 [D4 C4 B4 A4]]
+                        [G3 G3 F#3]
+                        [G3 D3 G2]
+                        [A4 F#3 G3]
+                        [D3 D2 [D3 C3]]
+                        [B3]
+                        [C3]
+                        [D3 D3 D2]
+                        [G3]])
+
+;; now make it play both hands at once! I don't know how.
+
 (comment
   (do
   (p (map
      #(assoc % :synth ks1-demo)
-     (pattern g-minuet-left-hand 10)))
+     (pattern g-minuet-left-hand 20)))

   (p (map
      #(assoc % :synth ks1-demo)
-     (pattern g-minuet-right-hand 10)))))
+     (pattern g-minuet-right-hand 20)))))
+


Remove final usage of expect-let :tada:

Remove final usage of expect-let :tada:

--- test/metabase/api/activity_test.clj
+++ test/metabase/api/activity_test.clj
@@ -8,7 +8,7 @@
                              [view-log :refer [ViewLog]])
             [metabase.test.data :refer :all]
             [metabase.test.data.users :refer :all]
-            [metabase.test.util :refer [match-$ expect-with-temp resolve-private-fns]]
+            [metabase.test.util :refer [match-$ expect-with-temp resolve-private-fns], :as tu]
             [metabase.util :as u]))

 ;; GET /
@@ -18,26 +18,22 @@
 ;;  2. :user and :model_exists are hydrated

 ;; NOTE: timestamp matching was being a real PITA so I cheated a bit.  ideally we'd fix that
-(expect-let [_         (db/cascade-delete! Activity)
-             activity1 (db/insert! Activity
-                         :topic     "install"
-                         :details   {}
-                         :timestamp (u/->Timestamp "2015-09-09T12:13:14.888Z"))
-             activity2 (db/insert! Activity
-                         :topic     "dashboard-create"
-                         :user_id   (user->id :crowberto)
-                         :model     "dashboard"
-                         :model_id  1234
-                         :details   {:description  "Because I can!"
-                                     :name         "Bwahahaha"
-                                     :public_perms 2}
-                         :timestamp (u/->Timestamp "2015-09-10T18:53:01.632Z"))
-             activity3 (db/insert! Activity
-                         :topic     "user-joined"
-                         :user_id   (user->id :rasta)
-                         :model     "user"
-                         :details   {}
-                         :timestamp (u/->Timestamp "2015-09-10T05:33:43.641Z"))]
+(tu/expect-with-temp [Activity [activity1 {:topic     "install"
+                                           :details   {}
+                                           :timestamp (u/->Timestamp "2015-09-09T12:13:14.888Z")}]
+                      Activity [activity2 {:topic     "dashboard-create"
+                                           :user_id   (user->id :crowberto)
+                                           :model     "dashboard"
+                                           :model_id  1234
+                                           :details   {:description  "Because I can!"
+                                                       :name         "Bwahahaha"
+                                                       :public_perms 2}
+                                           :timestamp (u/->Timestamp "2015-09-10T18:53:01.632Z")}]
+                      Activity [activity3 {:topic     "user-joined"
+                                           :user_id   (user->id :rasta)
+                                           :model     "user"
+                                           :details   {}
+                                           :timestamp (u/->Timestamp "2015-09-10T05:33:43.641Z")}]]
   [(match-$ (Activity (:id activity2))
      {:id           $
       :topic        "dashboard-create"
@@ -98,8 +94,12 @@
       :table        nil
       :custom_id    nil
       :details      $})]
-  (for [activity ((user->client :crowberto) :get 200 "activity")]
-    (dissoc activity :timestamp)))
+  ;; clear any other activities from the DB just in case; not sure this step is needed any more
+  (do (db/cascade-delete! Activity :id [:not-in #{(:id activity1)
+                                                  (:id activity2)
+                                                  (:id activity3)}])
+      (for [activity ((user->client :crowberto) :get 200 "activity")]
+        (dissoc activity :timestamp))))

 ;;; GET /recent_views


Add sentinel for test.

Add sentinel for test.

--- test/onyx/peer/single_peer_test.clj
+++ test/onyx/peer/single_peer_test.clj
@@ -97,7 +97,7 @@

 (def results (atom []))

-(doseq [n (range 10)]
+(doseq [n (range 11)]
   (let [message (.receive consumer)]
     (.acknowledge message)
     (swap! results conj (read-string (.readString (.getBodyBuffer message))))))
@@ -117,5 +117,5 @@
      (onyx.api/shutdown conn)
      (catch Exception e (prn e)))))

-(fact @results => (map (fn [x] {:n x}) (range 1 11)))
+(fact @results => (conj (vec (map (fn [x] {:n x}) (range 1 11))) :done))


Add CORS support to clojure-http-kit implementation

--- clojure-http-kit/src/sse_server/core.clj
+++ clojure-http-kit/src/sse_server/core.clj
@@ -3,6 +3,11 @@
             [org.httpkit.timer :refer [schedule-task]]))

 (def channel-hub (atom {}))
+
+(defn handle-cors []
+  {:status 204
+   :headers {"Access-Control-Allow-Origin" "*"
+             "Connection" "close"}})

 (defn handle-404 []
   {:status 404
@@ -12,6 +17,7 @@
 (defn handle-connections []
   {:status 200
    :headers {"Content-Type" "text/plain"
+             "Access-Control-Allow-Origin" "*"
              "Cache-Control" "no-cache"
              "Connection" "close"}
    :body (str (count @channel-hub))})
@@ -21,6 +27,7 @@
   (with-channel req channel
     (send! channel {:status 200
                     :headers {"Content-Type" "text/event-stream"
+                              "Access-Control-Allow-Origin" "*"
                               "Cache-Control" "no-cache"
                               "Connection" "keep-alive"}
                     :body ":ok\n\n"} false)
@@ -29,10 +36,12 @@
                         (swap! channel-hub dissoc channel)))))

 (defn app [req]
-  (case (:uri req)
-    "/connections" (handle-connections)
-    "/sse" (handle-sse req)
-    (handle-404)))
+  (if (= (:request-method req) :options)
+    (handle-cors)
+    (case (:uri req)
+      "/connections" (handle-connections)
+      "/sse" (handle-sse req)
+      (handle-404))))

 (defn notify-channels []
   (let [time (System/currentTimeMillis)]


changed :circle-inside? to :circle-nested?

--- src/demo/examples/plane_geometry/definitions.clj
+++ src/demo/examples/plane_geometry/definitions.clj
@@ -340,10 +340,10 @@
     (d/push-onto :boolean :result)))

-(def circle-inside?
-  (i/build-instruction
-    circle-inside?
-    "`:circle-inside?` pops the top two `:circle` items, and pushes `true` if one of them lies entirely inside the other (in either order), but is not tangent (they may be concentric)"
+(def circle-nested?
+  (i/build-instruction
+    circle-nested?
+    "`:circle-nested?` pops the top two `:circle` items, and pushes `true` if one of them lies entirely inside the other (in either order), but is not tangent (they may be concentric)"
     :tags #{:plane-geometry :construction}
     (d/consume-top-of :circle :as :arg2)
     (d/consume-top-of :circle :as :arg1)
@@ -440,8 +440,7 @@
 ; [X] `:circle-coincide?`
 ; [X] `:circle-intersect?`
 ; [X] `:circle-separate?`
-; [X] `:circle-inside?`
-; [ ] `:circle-surrounds?`
+; [X] `:circle-nested?`
 ; [ ] `:circle-tangent?` (to another circle)
 ; [ ] `:circle-intersections` (with another circle)
 ; [ ] `:LC-intersect?` (line-circle)


fix docstring

fix docstring

--- src/main/clojure/cljs/core.cljc
+++ src/main/clojure/cljs/core.cljc
@@ -690,15 +690,13 @@
   string, number or boolean.

   Default value can be overridden at compile time using the
-  compiler option `:closure-defines`. When overriding the string
-  you need to pass to `:closure-defines` is the munged version
-  of the original var.
+  compiler option `:closure-defines`.

   Example:
     (ns your-app.core)
     (define DEBUG! false)
     ;; can be overridden with
-    :closure-defines {\"your_app.core.DEBUG_BANG_\" true}"
+    :closure-defines {\"your-app.core.DEBUG!\" true}"
   [sym default]
   (assert-args define
    (core/or (core/string? default)


Fix circle.webdriver.plans/updating-containers-works test.

--- frontend/components/org_settings.cljs
+++ frontend/components/org_settings.cljs
@@ -344,7 +344,7 @@
       (list
        [:div.calculator-preview-item
         [:div.item  [:strong (pm/usable-containers plan)]]
-        [:div.value [:strong (str "$" plan-total "/month")]]]
+        [:div.value [:strong#current-plan-total (str "$" plan-total "/month")]]]
        (when (pm/grandfathered? plan)
          [:div.calculator-preview-item "Current price grandfathered in. Updates priced as:"])))


Add tests for discount rendering

Add tests for discount rendering

--- frontend/components/org_settings.cljs
+++ frontend/components/org_settings.cljs
@@ -580,7 +580,7 @@
           id                 :id}  (get-in plan [:discount :coupon])
         discount-amount (if percent-off
                           (str percent-off "%")
-                          (gstring/format "$%.2f" amount-off))
+                          (gstring/format "$%.2f" (/ amount-off 100)))
         discount-period (cond (= duration "forever") "forever"
                               (= duration-in-months 1) "for 1 month"
                               :else (gstring/format "for %d months" duration-in-months))]


Fix window close button event so that if stops the process

--- src/robinson/autoreloadcore.clj
+++ src/robinson/autoreloadcore.clj
@@ -95,6 +95,9 @@
             (reset! state-ref state)
             (zt/do-frame terminal 33
               (binding [zc/*updater* ruu/updater]
+                (when (zt/destroyed? terminal)
+                  (log/info "terminal destroyed")
+                  (System/exit 0))
                 (let [state (or @state-ref state)
                       _ (assert (not (nil? state)))
                       ui (@render-fn terminal state @dom-ref)]
@@ -122,5 +125,6 @@
                      (log/error ex)
                      (print-stack-trace ex)
                      state))))
+              (zevents/add-event-listener terminal :close (fn [keyin] (log/info "received :close") (System/exit 0)))
             (async/<!! done-chan)))))))


refactor executor with resolver

refactor executor with resolver

--- test/graphql_clj/executor_test.clj
+++ test/graphql_clj/executor_test.clj
@@ -3,6 +3,7 @@
   (:require [clojure.test :refer :all]
             [graphql-clj.type :as type]
             [graphql-clj.parser :as parser]
+            [graphql-clj.resolver :as resolver]
             [clojure.core.match :as match]))

 (def simple-user-schema
@@ -21,7 +22,7 @@
   query: QueryRoot
 }")

-(def resolver-fn
+(def customized-resolver-fn
   (fn [type-name field-name]
     (match/match
      [type-name field-name]
@@ -35,9 +36,7 @@
                           (map (fn [no] {:name "Friend 1 name"
                                         :nickname "Friend 1 nickname"})
                                (range 5)))
-     :else (fn [context parent & args]
-             (println (format "Not found resolver function for type(%s) and field(%s)." type-name field-name))
-             (get parent (keyword field-name))))))
+     :else nil)))

 (defn- create-test-schema
   [type-spec]
@@ -57,6 +56,7 @@
           user-selection (first query-selection-set)
           user-selection-set (get-in (second user-selection) [:field :selection-set])
           new-document (parser/transform (parser/parse "query {user {name son}}"))
+          resolver-fn (resolver/create-resolver-fn schema customized-resolver-fn)
           new-result (execute context schema resolver-fn new-document)
           ]
       (is (= "user" (get-selection-name user-selection)))
@@ -71,6 +71,7 @@
     (let [schema (create-test-schema simple-user-schema)
           query "query {user {name friends{name}}}"
           document (parser/transform (parser/parse query))
+          resolver-fn (resolver/create-resolver-fn schema customized-resolver-fn)
           context nil]
       (is (= 5 (count (get-in (execute context schema resolver-fn document)
                               [:data "user" "friends"])))))))
@@ -84,6 +85,7 @@
   nickname
 }"
           document (parser/transform (parser/parse query))
+          resolver-fn (resolver/create-resolver-fn schema customized-resolver-fn)
           context nil]
       (is (= 5 (count (get-in (execute context schema resolver-fn document)
                               [:data "user" "friends"])))))))


Fix raw image links.

Fix raw image links.

--- src/afterglow/fixtures/blizzard.clj
+++ src/afterglow/fixtures/blizzard.clj
@@ -43,8 +43,7 @@
   rotations when you patch it. Otherwise, tell Afterglow how far it
   has been rotated around each of the axes when hanging:

-  ![F3
-  axes](https://raw.githubusercontent.com/Deep-Symmetry/afterglow/master/doc/assets/F3.png)
+  ![F3 axes]({{guide-url}}_images/F3.png)

   The center pan value (aimed straight at the audience when hung in
   the default orientation described above), is defined as 85.5, half a
@@ -161,8 +160,7 @@
   rotations when you patch it. Otherwise, tell Afterglow how far it
   has been rotated around each of the axes when hanging:

-  ![Blade
-  axes](https://raw.githubusercontent.com/Deep-Symmetry/afterglow/master/doc/assets/Blade.png)
+  ![Blade axes]({{guide-url}}_images/Blade.png)

   If you are hanging the light at an odd angle, or for any reason it
   is harder to measure the exact axis location given where where you
@@ -326,8 +324,7 @@
   parallel to the X axis, and the LED display and sockets all facing
   away from the audience.

-  ![Weather System
-  axes](https://raw.githubusercontent.com/Deep-Symmetry/afterglow/master/doc/assets/WeatherSystem.jpg)
+  ![Weather System axes]({{guide-url}}_images/WeatherSystem.jpg)

   This fixture can be configured to use either 7 or 26 DMX channels.
   If you do not specify a mode when patching it, `:26-channel` is


tested queue-exists?

tested queue-exists?

--- hyrax/test/hyrax/dist/rabbit_test.clj
+++ hyrax/test/hyrax/dist/rabbit_test.clj
@@ -17,17 +17,30 @@
                             :connection-timeout 5000})

 (fact "rabbit lock exclusion"
-    (let [with-lock! (fn [f]
-                       (with-conn [conn rabbit-info]
-                         (#'hyrax.dist.rabbit/with-rabbit-lock! conn "foo.queue" "foo.instance" f)))
-          a (atom false)
-          b (atom false)
-          result (with-lock! (fn []
-                               (reset! a true)
-                               (with-lock! #(reset! b true))))]
-      [@a @b])
-    => [true false])
-
+  (let [with-lock! (fn [f]
+                     (with-conn [conn rabbit-info]
+                       (#'hyrax.dist.rabbit/with-rabbit-lock! conn "foo.queue" "foo.instance" f)))
+        a (atom false)
+        b (atom false)
+        result (with-lock! (fn []
+                             (reset! a true)
+                             (with-lock! #(reset! b true))))]
+    [@a @b])
+  => [true false])
+
+(fact "verify queue-exists?"
+  (with-conn [conn rabbit-info]
+    (let [exists? (fn [queue-name]
+                    (#'hyrax.dist.rabbit/queue-exists? conn queue-name))
+          existent "funzors"
+          non-existent "funzors-imaginary"]
+
+      (with-chan [ch conn]
+        (doseq [q [existent non-existent]]
+                (lq/delete ch q))
+        (lq/declare ch existent {:auto-delete false}))
+
+      [(exists? existent) (exists? non-existent)])) => [true false])

 (fact "bucket consumers provide concurrent exclusion of buckets"
    (with-conn [conn rabbit-info]


Only attempt to load the job name if we have a config

--- src/circle/backend/build/config.clj
+++ src/circle/backend/build/config.clj
@@ -236,10 +236,11 @@
   (let [url (-> github-json :repository :url)
         config (get-config-for-url url)
         project (project/get-by-url! url)
-        job-name (or (-> config :schedule :commit :job (keyword)) (-> config :jobs (first) (key)))
         vcs-revision (-> github-json :after)]
     (if (and config project)
-      (build-from-config config project
-                         :vcs_revision vcs-revision
-                         :notify (-> config :jobs job-name :notify_emails (parse-notify) (get-build-email-recipients github-json)))
+      (let [job-name (or (-> config :schedule :commit :job (keyword)) (-> config :jobs (first) (key)))]
+        (build-from-config config project
+                           :vcs_revision vcs-revision
+                           :notify (-> config :jobs job-name :notify_emails (parse-notify) (get-build-email-recipients github-json))))
+
       (infer-build-from-url url))))


Hard code our memoized AMI, for now

Hard code our memoized AMI, for now

--- src/circle/backend/nodes/circle.clj
+++ src/circle/backend/nodes/circle.clj
@@ -17,11 +17,25 @@
             [pallet.thread-expr :as thread-expr]
             [circle.backend.nodes :as nodes]))

-;; The pallet  configuration to build the circle box
+
+;; this is our "memoized" circle box
 (def circle-group
   (pallet.core/group-spec
    "circle"
-   :circle-node-spec {:ami "ami-06ad526f"
+   :circle-node-spec {:ami "ami-afa46dc6"
+                      :availability-zone "us-east-1a"
+                      :instance-type "m1.small"
+                      :keypair-name "www"
+                      :security-groups ["www" "allow-DB"]
+                      :username "ubuntu"
+                      :public-key (slurp "www.id_rsa.pub")
+                      :private-key (slurp "www.id_rsa")}))
+
+;; The configuration to build the circle box from scratch
+(def circle-raw-group
+  (pallet.core/group-spec
+   "circle"
+   :circle-node-spec {:ami "ami-06ad526f" ;; clean ubuntu 11.10
                       :availability-zone "us-east-1a"
                       :instance-type "m1.small"
                       :keypair-name "www"


add "product-context" in search results

add "product-context" in search results

--- src/clj/ikea_clojure_cup/search.clj
+++ src/clj/ikea_clojure_cup/search.clj
@@ -5,6 +5,16 @@
             [clojure.string :as cs]
             [clojure.pprint :refer [pprint]]
             [ikea-clojure-cup.common :refer [ikea-domain]]))
+
+(defn- get-product-context [m]
+  (-> (s/select (s/and (s/tag :a)
+                       (s/attr :href)) m)
+      first
+      :attrs
+      :href
+      (cs/split #"/")
+      reverse
+      second))

 (defn- get-product-id [m]
   (-> (s/select (s/and (s/tag :a)
@@ -44,7 +54,7 @@
                      :image-src (get-img-src m)
                      :name (get-product-name m)
                      :desc (get-product-desc m)
-                     }))
+                     :product-context (get-product-context m)}))
           []
           hick-products))


Fix addicted parser fails

Fix addicted parser fails

--- src/clj/subman/sources/addicted.clj
+++ src/clj/subman/sources/addicted.clj
@@ -78,14 +78,14 @@
               :else buffer))
           [] lines))

-(defn- get-versions
-  "Get versions of subtitles for single episode"
-  [episode]
-  (-> episode
-      :url
-      helpers/fetch
-      (html/select [:table.tabel95 :table.tabel95 :tr])
-      get-subtitles))
+(defsafe get-versions
+         "Get versions of subtitles for single episode"
+         [episode]
+         (-> episode
+             :url
+             helpers/fetch
+             (html/select [:table.tabel95 :table.tabel95 :tr])
+             get-subtitles))

 (defn- get-releases-url
   "Get releases url for page"
@@ -128,4 +128,5 @@
                         :lang (:name lang)
                         :url (:url lang)
                         :source const/type-addicted)))
+        (remove empty?)
         flatten))


Fix reflection problem for graalvm compilation version.

--- src/zprint/config.cljc
+++ src/zprint/config.cljc
@@ -892,7 +892,7 @@
 (defn current-stack-trace [] (.getStackTrace (Thread/currentThread)))

 (defn is-repl-stack-element
-  [stack-element]
+  [^java.lang.StackTraceElement stack-element]
   (and (= "clojure.main$repl" (.getClassName stack-element))
        (= "doInvoke" (.getMethodName stack-element))))


Change `with-meta` to `vary-meta` x3

Change `with-meta` to `vary-meta` x3

--- src/cljc/mikron/runtime/buffer.cljc
+++ src/cljc/mikron/runtime/buffer.cljc
@@ -338,7 +338,7 @@

 (defn put-ubyte
   "Puts an unsigned byte `value` to `buffer`."
-  #?(:clj {:inline (fn [buffer value] `(put-byte ~buffer (unchecked-byte (bit-and ~(with-meta value {:tag 'long}) 0xFF))))})
+  #?(:clj {:inline (fn [buffer value] `(put-byte ~buffer (unchecked-byte (bit-and ~(vary-meta value assoc :tag 'long) 0xFF))))})
   [^Buffer buffer ^long value]
   (put-byte buffer (unchecked-byte (bit-and value 0xFF))))

@@ -350,7 +350,7 @@

 (defn put-ushort
   "Puts an unsigned short `value` to `buffer`."
-  #?(:clj {:inline (fn [buffer value] `(put-short ~buffer (unchecked-short (bit-and ~(with-meta value {:tag 'long}) 0xFFFF))))})
+  #?(:clj {:inline (fn [buffer value] `(put-short ~buffer (unchecked-short (bit-and ~(vary-meta value assoc :tag 'long) 0xFFFF))))})
   [^Buffer buffer ^long value]
   (put-short buffer (unchecked-short (bit-and value 0xFFFF))))

@@ -364,7 +364,7 @@

 (defn put-uint
   "Puts an unsigned int `value` to `buffer`."
-  #?(:clj {:inline (fn [buffer value] `(put-int ~buffer (unchecked-int (bit-and ~(with-meta value {:tag 'long}) 0xFFFFFFFF))))})
+  #?(:clj {:inline (fn [buffer value] `(put-int ~buffer (unchecked-int (bit-and ~(vary-meta value assoc :tag 'long) 0xFFFFFFFF))))})
   [^Buffer buffer ^long value]
   (put-int buffer (unchecked-int (bit-and value 0xFFFFFFFF))))


Our current implementation of close-on-click prevents click events which breaks sign-out. Disabling for now. (#773)

--- src/cljs/main/broadfcui/common.cljs
+++ src/cljs/main/broadfcui/common.cljs
@@ -344,7 +344,8 @@
     :button-class "float-right"
     :button-style (merge {:fontSize "unset" :lineHeight "unset" :padding 0 :textAlign "center"}
                          button-style)
-    :close-on-click true
+    ;; TODO(dmohs): This prevents DropdownItem from receiving the click event.
+    ;; :close-on-click true
     :dropdown-class "bottom"
     :style {:boxShadow "0 3px 6px 0 rgba(0, 0, 0, 0.15)"
             :backgroundColor "#fff"


Convert visible rule to deflogical

Convert visible rule to deflogical

--- src/cljs/precept/todomvc/rules.cljs
+++ src/cljs/precept/todomvc/rules.cljs
@@ -52,12 +52,10 @@
   (retract! ?entry)
   (insert-unconditional! (todo ?v)))

-(def-tuple-rule todo-is-visible
+(deflogical [?e :todo/visible true] :-
   [:or [:and [_ :visibility-filter :all] [?e :todo/title]]
        [:and [_ :visibility-filter :done] [?e :todo/done true]]
-       [:and [_ :visibility-filter :active] [?e :todo/done false]]]
-  =>
- (insert! [?e :todo/visible true]))
+       [:and [_ :visibility-filter :active] [?e :todo/done false]]])

 (def-tuple-rule insert-done-count
   [?n <- (acc/count) :from [_ :todo/done true]]
@@ -75,10 +73,8 @@
   [(<- ?visible-todos (entities ?eids))]
   [[_ :active-count ?active-count]]
   =>
-  (let [_ (println "Visible todos" ?visible-todos)
-        _ (println "Accum eids!" ?eids)]
-    {:visible-todos ?visible-todos
-     :all-complete? (= 0 ?active-count)}))
+  {:visible-todos ?visible-todos
+   :all-complete? (= 0 ?active-count)})

 (defsub :task-entry
   [[?e :entry/title ?v]]


fixing time formatting and code formatting

--- src/cljs/server/service/github.cljs
+++ src/cljs/server/service/github.cljs
@@ -4,6 +4,7 @@
             [cljs.core.async :as async :refer [<! put! chan onto-chan close!]]
             [cljs-time.core :as time]
             [cljs-time.coerce :as ctime]
+            [cljs-time.format :as ftime]
             [common.util :refer [js-log log js->cljs]]
             [server.config :refer [config]]))

@@ -50,13 +51,13 @@
     (conj acc out-ch)))

 (defn- reduce-commits [acc commit]
-  (let [date (-> commit
-                 (get "commit")
-                 (get "committer")
-                 (get "date")
-                 (ctime/to-local-date)
-                 (ctime/to-string))]
-    (merge-with + acc {date 1})))
+  (let [formatter (ftime/formatter "yyyyMMdd")
+        date      (-> commit
+                    (get "commit")
+                    (get "committer")
+                    (get "date")
+                    (ctime/from-string))]
+    (merge-with + acc {(ftime/unparse formatter date) 1})))

 ; @TODO: account for error in all requests
 ; @TODO: native clj transformations to transit
@@ -65,8 +66,10 @@
   ; paginate through all user repos
   (.getAll RepoApi (clj->js {"per_page" 100}) (paginate repo-ch))
   ; reduce over commits and add them together
-  ;(reduce #(inc %1) 0 commit-ch))
   (go
-    (let [chs           (<! (async/reduce reduce-repos [] repo-ch))
-          repo-commits  (async/merge chs)]
-      (<! (async/reduce reduce-commits {} repo-commits)))))
+    (->> repo-ch
+         (async/reduce reduce-repos [])
+         (<!)
+         (async/merge)
+         (async/reduce reduce-commits {})
+         (<!))))


Remove AltGr line

Remove AltGr line

--- src/clojure/paredit_widget/core.clj
+++ src/clojure/paredit_widget/core.clj
@@ -96,7 +96,6 @@
         key-text (java.awt.event.KeyEvent/getKeyText key-code)]
     (when *debug* (println [event key-code key-char key-text]))
     [(cond
-       (.isAltGraphDown event) nil
        (.isAltDown event) "M"
        (.isControlDown event) "C"
        :else nil)


Move resolver option validations to resolver

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -1535,6 +1535,10 @@
   "Helper to return a resolver map"
   [sym {::keys [transform] :as options} resolve]
   (assert (symbol? sym) "Resolver name must be a symbol")
+  (when (and options (not (s/valid? (s/keys) options)))
+    (s/explain (s/keys) options)
+    (throw (ex-info (str "Invalid options on resolver of " sym)
+                    {:explain (s/explain-data (s/keys) options)})))
   (cond-> (merge {::sym sym ::resolve resolve} options)
     transform transform))

@@ -1690,16 +1694,12 @@
      "
      {:arglists '([name docstring? arglist options? & body])}
      [& args]
-     (let [{:keys [name arglist options body docstring] :as params}
+     (let [{:keys [name arglist body docstring] :as params}
            (-> (s/conform ::defresolver-args args)
                (update :arglist normalize-arglist))
-
            arglist' (s/unform ::operation-args arglist)
            fqsym    (full-symbol name (str *ns*))
            defdoc   (cond-> [] docstring (conj docstring))]
-       (if (and options (not (s/valid? (s/keys) options)))
-         (throw (ex-info (str "Invalid options on defresolver of " name)
-                         {:explain (s/explain (s/keys) options)})))
        `(def ~name
           ~@defdoc
           (resolver '~fqsym ~(params->resolver-options params)


Format clojurescript uuids as strings in graphql queries.

--- src/com/wsscode/pathom/graphql.cljc
+++ src/com/wsscode/pathom/graphql.cljc
@@ -30,7 +30,8 @@
 (defn stringify [x]
   #?(:clj  (json/write-str (cond-> x
                              (uuid? x) str))
-     :cljs (js/JSON.stringify (clj->js x))))
+     :cljs (js/JSON.stringify (cond-> (clj->js x)
+                                (uuid? x) str))))

 (defn params->graphql
   ([x js-name tempid?] (params->graphql x js-name tempid? true))


Prepare for release 0.1.0

Prepare for release 0.1.0

--- clojure/project.clj
+++ clojure/project.clj
@@ -1,4 +1,4 @@
-(defproject me.perdomo.cofre "0.1.0-SNAPSHOT"
+(defproject me.perdomo.cofre "0.1.0"
   :description "Small HTTP server to process image upload/get requests"
   :url "http://github.com/iperdomo/cofre"
   :license {:name "Apache Public License"


test build?

test build?

--- clojure/project.clj
+++ clojure/project.clj
@@ -28,22 +28,34 @@
   :clean-targets ["server.js"
                   "target"]

+	:hooks  [leiningen.cljsbuild]
+
   :cljsbuild {
     :builds [{:id "dev"
               :source-paths ["src" "test"]
               :figwheel true
               :compiler {
-                :main dnd.core
-                :output-to "target/server_dev/dnd.js"
-                :output-dir "target/server_dev"
-                :target :nodejs
-                :asset-path "target/server_dev"
-                :optimizations :none
-                :source-map true}}
+                         :main dnd.core
+                         :output-to "target/server_dev/dnd.js"
+                         :output-dir "target/server_dev"
+                         :asset-path "target/server_dev"
+                         :optimizations :none
+                         :target :nodejs
+                         :source-map true}}
+             {:id "test"
+              :source-paths ["src" "test"]
+              :compiler {
+                         :main dnd.test-runner
+                         :output-to "target/server_dev/test.js"
+                         :output-dir "target/server_dev/test"
+                         :asset-path "target/server_dev/test"
+                         :optimizations :none
+                         :target :nodejs
+                         :source-map true}}
              {:id "prod"
               :source-paths ["src"]
               :compiler {
-                :output-to "server.js"
-                :output-dir "target/server_prod"
-                :target :nodejs
-                :optimizations :simple}}]})
+                         :output-to "server.js"
+                         :output-dir "target/server_prod"
+                         :target :nodejs
+                         :optimizations :simple}}]})


Exploration: check if counterexamples respects knowledge

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

--- src/conexp/fca/exploration/repl.clj
+++ src/conexp/fca/exploration/repl.clj
@@ -153,14 +153,19 @@
   (let [new-atts    (union (set (:positives state)) (set (:negatives state))),
         object-set? (contains? state :object),
         all-atts?   (= (attributes ctx) new-atts),
-        valid-cex?  (falsifies-implication? (set (:positives state)) impl)]
+        respects?   (forall [impl (:knowledge state)]
+                      (or (not (subset? (premise impl) (set (:positives state))))
+                          (subset? (conclusion impl) (set (:positives state))))),
+        falsifies?  (falsifies-implication? (set (:positives state)) impl)]
     (when-not object-set?
       (println "You need to set a name for the new object."))
     (when-not all-atts?
       (println "You have not specified a complete counterexample."))
-    (when-not valid-cex?
+    (when-not respects?
+      (println "Your example does not respect the already confirmed knowledge."))
+    (when-not falsifies?
       (println "Your example does not falsify the given implication."))
-    (and object-set? all-atts? valid-cex?)))
+    (and object-set? all-atts? respects? falsifies?)))

 (define-repl-fn check-counterexample
   "Checks the given counterexample for being valid."


updated test

updated test

--- luminus/hello/test/hello/test/handler.clj
+++ luminus/hello/test/hello/test/handler.clj
@@ -8,7 +8,7 @@
     (let [response (app (request :get "/"))]
       (is (= (:status response) 200))
       (is (= (:body response)
-             "\n    \n        <title>Welcome to hello</title>\n        <link href=\"/css/screen.css\" rel=\"stylesheet\" type=\"text/css\"></link>\n    \n    \n
\n
\n
\n                    Home\n
\n
\n                    About\n
\n
\n
\n
\n
Welcome to hello
\n        \n
Some links to get started

HTML templating

Accessing the database

Serving static resources

Setting response types

Defining routes

Adding middleware

Sessions and cookies

Security

Deploying the application

\n\n
        \n        Copyright ...\n    \n\n\n\n"))))
+             "Hello, World!"))))

   (testing "not-found route"
     (let [response (app (request :get "/invalid"))]


remove unneeded :enrich

remove unneeded :enrich

--- test/babel/test/fr.clj
+++ test/babel/test/fr.clj
@@ -14,10 +14,7 @@
                                           :sem {:pred :sleep
                                                 :subj {:pred :I}
                                                 :tense :conditional}}}
-                                fr/small
-                                :enrich true)]
-    (is (= :1st (get-in result [:comp :synsem :agr :person])))
-    (is (= :sing (get-in result [:comp :synsem :agr :number])))
+                                fr/small)]
     (is (= "je dormirais" (fo result)))))

 (deftest present-irregular


Remove logging

Remove logging

--- src/export_server/utils/phantom.clj
+++ src/export_server/utils/phantom.clj
@@ -223,8 +223,8 @@
         (execute-script d "window.close(\"\")")
         (.window (.switchTo (:webdriver d)) prev-handle)

-        (with-open [out (output-stream (clojure.java.io/file "/media/ssd/sibental/export-server-data/html-to-png.png"))]
-          (.write out screenshot))
+        ;(with-open [out (output-stream (clojure.java.io/file "/media/ssd/sibental/export-server-data/html-to-png.png"))]
+        ;  (.write out screenshot))

         (if error
           (if exit-on-error