Minor code style improvement (indentation).

--- src/cats/core.cljc
+++ src/cats/core.cljc
@@ -353,68 +353,67 @@
         (range join-count))))

 #?(:clj
-  (defmacro alet
-    "Applicative composition macro similar to Clojure's
-    `let`. This macro facilitates composition of applicative
-    computations using `fmap` and `fapply` and evaluating
-    applicative values in parallel.
-
-    Let's see an example to understand how it works.
-    This code uses fmap for executing computations inside
-    an applicative context:
-
-      (fmap (fn [a] (inc a)) (just 1))
-      ;=> #<Just [2]>
-
-    Now see how this code can be made clearer
-    by using the alet macro:
-
-      (alet [a (just 1)]
-        (inc a))
-      ;=> #<Just [2]>
-
-    Let's look at a more complex example, imagine we have
-    dependencies between applicative values:
-
-      (join
-        (fapply
-         (fmap
-           (fn [a]
-             (fn [b]
-               (fmap (fn [c] (inc c))
-                     (just (+ a b)))))
-           (just 1))
-         (just 2)))
+   (defmacro alet
+     "Applicative composition macro similar to Clojure's
+     `let`. This macro facilitates composition of applicative
+     computations using `fmap` and `fapply` and evaluating
+     applicative values in parallel.
+
+     Let's see an example to understand how it works.
+     This code uses fmap for executing computations inside
+     an applicative context:
+
+       (fmap (fn [a] (inc a)) (just 1))
+       ;=> #<Just [2]>
+
+     Now see how this code can be made clearer
+     by using the alet macro:
+
+       (alet [a (just 1)]
+         (inc a))
+       ;=> #<Just [2]>
+
+     Let's look at a more complex example, imagine we have
+     dependencies between applicative values:
+
+       (join
+         (fapply
+          (fmap
+            (fn [a]
+              (fn [b]
+                (fmap (fn [c] (inc c))
+                      (just (+ a b)))))
+            (just 1))
+          (just 2)))
+       ;=> #<Just [4]>
+
+     This is greatly simplified using `alet`:
+
+       (alet [a (just 1)
+              b (just 2)
+              c (just (+ a b))]
+         (inc c))
       ;=> #<Just [4]>

-    This is greatly simplified using `alet`:
-
-      (alet [a (just 1)
-             b (just 2)
-             c (just (+ a b))]
-        (inc c))
-     ;=> #<Just [4]>
-
-    The intent of the code is much clearer and evaluates `a` and `b`
-    at the same time, then proceeds to evaluate `c` when all the values
-    it depends on are available. This evaluation strategy is specially
-    helpful for asynchronous applicatives."
-    [bindings & body]
-    (when-not (and (vector? bindings)
-                   (not-empty bindings)
-                   (even? (count bindings)))
-      (throw (IllegalArgumentException. "bindings has to be a vector with even number of elements.")))
-    (let [bindings (partition 2 bindings)
-          [bindings body] (dedupe-symbols bindings body)
-          batches (bindings->batches bindings)
-          env (into {} bindings)]
-      (if (and (= (count batches) 1)
-               (= (count (map first bindings)) 1))
-        `(fmap (fn [~@(map first bindings)]
-                 ~@body)
-               ~@(map second bindings))
-        (alet* batches env body)))))
-
+     The intent of the code is much clearer and evaluates `a` and `b`
+     at the same time, then proceeds to evaluate `c` when all the values
+     it depends on are available. This evaluation strategy is specially
+     helpful for asynchronous applicatives."
+     [bindings & body]
+     (when-not (and (vector? bindings)
+                    (not-empty bindings)
+                    (even? (count bindings)))
+       (throw (IllegalArgumentException. "bindings has to be a vector with even number of elements.")))
+     (let [bindings (partition 2 bindings)
+           [bindings body] (dedupe-symbols bindings body)
+           batches (bindings->batches bindings)
+           env (into {} bindings)]
+       (if (and (= (count batches) 1)
+                (= (count (map first bindings)) 1))
+         `(fmap (fn [~@(map first bindings)]
+                  ~@body)
+                ~@(map second bindings))
+         (alet* batches env body)))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Curry Facilities


Removed some unused vars.

Removed some unused vars.

--- src/cbfg/core.cljs
+++ src/cbfg/core.cljs
@@ -195,17 +195,17 @@
     (ago w-actx w
          (reset! root-actx w-actx)
          (let [in (achan-buf w-actx 100)
-               out (achan-buf w-actx 1)
-               fdp (make-fenced-pump w-actx in out @max-inflight)
-               gch (ago-loop main-out w-actx [acc nil]
-                             (let [result (atake main-out out)]
-                               (set-el-innerHTML "output" result)
-                               (recur (conj acc result))))]
+               out (achan-buf w-actx 1)]
            (ago-loop main-in w-actx [num-cmds 0]
                      (let [cmd (<! cmds)
                            cmd-handler ((get cmd-handlers (:op cmd)) cmd)]
                        (aput main-in in cmd-handler)
-                       (recur (inc num-cmds))))))))
+                       (recur (inc num-cmds))))
+           (ago-loop main-out w-actx [acc nil]
+                     (let [result (atake main-out out)]
+                       (set-el-innerHTML "output" result)
+                       (recur (conj acc result))))
+           (make-fenced-pump w-actx in out @max-inflight)))))

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


Add (:gen-class) directive to allow

Add (:gen-class) directive to allow

dependent projects to use the media driver
as a jar entrypoint.

--- src/onyx/messaging/aeron_media_driver.clj
+++ src/onyx/messaging/aeron_media_driver.clj
@@ -1,4 +1,5 @@
 (ns onyx.messaging.aeron-media-driver
+  (:gen-class)
   (:require [clojure.core.async :refer [chan <!!]])
   (:import [io.aeron Aeron$Context]
            [io.aeron.driver MediaDriver MediaDriver$Context ThreadingMode]))


only setup encoder on record

only setup encoder on record

--- Assets/game/gif.clj
+++ Assets/game/gif.clj
@@ -9,10 +9,11 @@

 (def gif-cam (atom nil))
 (def gif-tex (atom nil))
-(def gif-encoder (atom false))
+(def gif-encoder (atom nil))

 (defn setup-encoder []
  (let [encoder (AnimatedGifEncoder. (GameUtils/CreateDocumentFile))]
+  (.SetDelay @gif-encoder (float (/ 1000 24)))
   (reset! gif-encoder encoder)))

 (defn setup [w h b]
@@ -22,7 +23,6 @@
        cam (a/cmpt cam-go Camera)]
   (reset! gif-cam cam)
   (reset! gif-tex render-texture)
-  (if (false? @gif-encoder) (setup-encoder))
   (set! (.targetTexture cam) render-texture)
   (set! (.worldCamera (a/cmpt gif-canvas Canvas)) cam)
   (a/hook+ cam-go :update
@@ -32,7 +32,6 @@
       (do
        (set! (.. go transform position) (.. (a/object-tagged "skatecam") transform position))
        (set! (.. go transform rotation) (.. (a/object-tagged "skatecam") transform rotation)))))))
-  (.SetDelay @gif-encoder (float (/ 1000 24)))
   (add-watch data/recording? nil
    (fn [_ _ _ new-state]
     (if new-state
@@ -41,6 +40,7 @@
 (defn start-recording []
  (let [start-time Time/time
        recording-canvas (hard/clone! :ui/recording-canvas)]
+  (setup-encoder)
   (set! (.worldCamera (a/cmpt recording-canvas Canvas)) (a/cmpt (a/object-tagged "skatecam") Camera))
   (timeline* :loop
    (wait Time/deltaTime)
@@ -64,4 +64,3 @@
      nil))))

 '(setup 800 480 24)
-'(start-recording)


whitespace

whitespace

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -10,136 +10,140 @@

 (def encyc
   {
-   {:activity true} {:animate false
-                     :artifact false
-                     :consumable false
-                     :part-of-human-body false}
+   {:activity true}  {:animate false
+                      :artifact false
+                      :consumable false
+                      :part-of-human-body false}
+
+   {:animate false}  {:human false
+                      :pet false}
+
+   {:animate true}   {:activity false
+                      :artifact false
+                      :mass false
+                      :furniture false
+                      :physical-object true
+                      :part-of-human-body false
+                      :drinkable false
+                      :speakable false
+                      :place false}

-   {:animate false} {:human false
-                     :pet false}
+   {:artifact true}  {:animate false
+                      :activity false
+                      :living false
+                      :physical-object true}

-   {:animate true} {:activity false
-                    :artifact false
-                    :mass false
-                    :furniture false
-                    :physical-object true
-                    :part-of-human-body false
-                    :drinkable false
-                    :speakable false
-                    :place false}
+   {:buyable true}   {:human false
+                      :part-of-human-body false}

-   {:artifact true} {:animate false
-                     :activity false
-                     :living false
-                     :physical-object true}
+   {:city true}      {:artifact true
+                      :legible false
+                      :place true}

-   {:buyable true} {:human false
-                    :part-of-human-body false}
+   {:clothing true}  {:animate false
+                      :place false
+                      :physical-object true}

-   {:city true} {:artifact true
-                 :legible false
-                 :place true}
+   {:consumable
+    true}            {:activity false
+                      :buyable true
+                      :furniture false
+                      :legible false
+                      :human false
+                      :part-of-human-body false
+                      :pet false
+                      :physical-object true
+                      :place false
+                      :speakable false}
+
+   {:consumable
+    false}           {:drinkable false
+                      :edible false}

-   {:clothing true} {:animate false
-                     :place false
-                     :physical-object true}
+   {:drinkable true} {:consumable true
+                      :edible false
+                      :mass true}
+
+   {:edible true}    {:consumable true
+                      :drinkable false}

-   {:consumable true} {:activity false
-                       :buyable true
-                       :furniture false
-                       :legible false
-                       :human false
-                       :part-of-human-body false
-                       :pet false
-                       :physical-object true
-                       :place false
-                       :speakable false}
+   {:event true}     {:physical-object false}
+
+   {:furniture true} {:artifact true
+                      :animate false
+                      :buyable true
+                      :consumable false
+                      :legible false
+                      :edible false
+                      :place false
+                      :speakable false}
+
+   {:human true}     {:animate true
+                      :buyable false
+                      :consumable false
+                      :legible false
+                      :pet false
+                      :part-of-human-body false
+                      :physical-object true
+                      :place false
+                      :spec {:of {:human true}}}
+   {:intelligent
+    true}            {:animate true}

-   {:consumable false} {:drinkable false
-                        :edible false}
+   {:living false}   {:animate false
+                      :human false}
+
+   {:living true}    {:artifact false
+                      :place false}

-   {:drinkable true}   {:consumable true
-                        :edible false
-                        :mass true}
+   {:part-of-human-body
+    true}            {:consumable false
+                      :human false
+                      :physical-object true}

-   {:edible true}      {:consumable true
-                        :drinkable false}
+   {:pet true}       {:animate true
+                      :buyable true
+                      :edible false
+                      :human false
+                      :spec {:of {:human true}}}

-   {:event true}       {:physical-object false}
-
-   {:furniture true}   {:artifact true
-                        :animate false
-                        :buyable true
-                        :consumable false
-                        :legible false
-                        :edible false
-                        :place false
-                        :speakable false}
-
-   {:human true} {:animate true
-                  :buyable false
-                  :consumable false
-                  :legible false
-                  :pet false
-                  :part-of-human-body false
-                  :physical-object true
-                  :place false
-                  :spec {:of {:human true}}}
+   {:physical-object
+    false}           {:animate false
+                      :consumable false}

-   {:intelligent true} {:animate true}
-   {:stupid true} {:animate true}
-
-   {:living false} {:animate false
-                    :human false}
-
-   {:living true} {:artifact false
-                   :place false}
-
-   {:part-of-human-body true} {:consumable false
-                               :human false
-                               :physical-object true}
-
-   {:pet true} {:animate true
-                :buyable true
-                :edible false
-                :human false
-                :spec {:of {:human true}}}
-
-   {:physical-object false} {:animate false
-                             :consumable false}
-
-   {:place true} {:activity false
-                  :consumable false
-                  :living false
-                  :physical-object true}
+   {:place true}     {:activity false
+                      :consumable false
+                      :living false
+                      :physical-object true}

    ;; <preds>
-   {:pred :bag} {:artifact true
-                 :consumable false
-                 :event false
-                 :place false}
+   {:pred :bag}      {:artifact true
+                      :consumable false
+                      :event false
+                      :legible false
+                      :place false}

-   {:pred :bicycle} {:artifact true
-                     :consumable false}
+   {:pred :bicycle}  {:artifact true
+                      :consumable false}

-   {:pred :bread} {:artifact true
-                   :edible true}
+   {:pred :bread}    {:artifact true
+                      :edible true}

-   {:pred :car} {:artifact true
-                 :consumable false
-                 :place false}
+   {:pred :car}      {:artifact true
+                      :consumable false
+                      :place false}

-   {:pred :key} {:animate false
-                 :consumable false
-                 :event false
-                 :place false}
+   {:pred :key}      {:animate false
+                      :consumable false
+                      :event false
+                      :place false}
+   ;; </preds>

-   ;; </preds>
-
-   {:time true} {:activity false
-                 :living false
-                 :place false}
-
+   {:stupid true}    {:animate true}
+
+   {:time true}      {:activity false
+                      :living false
+                      :place false}
    }
   )


facts about drinkable things and words

facts about drinkable things and words

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -64,7 +64,8 @@
     false}           {:drinkable false
                       :edible false}

-   {:drinkable true} {:consumable true
+   {:drinkable true} {:animate false
+                      :consumable true
                       :edible false
                       :mass true}

@@ -215,7 +216,8 @@
    {:pred :vino}     {:artifact true
                       :drinkable true}

-   {:pred :word}     {:legible true
+   {:pred :word}     {:consumable false
+                      :legible true
                       :living false
                       :speakable true}


+(defn svegliarsi), (defn chiamarsi); ~with-shrunken-model: update rule name

--- src/babel/italiano/lab.cljc
+++ src/babel/italiano/lab.cljc
@@ -239,16 +239,42 @@
                (or
                 (= (:rule rule) "s-aux")
                 (= (:rule rule) "vp-pronoun-phrasal")
-                (= (:rule rule) "vp-aux-22")))
-             (:grammar model))
-
-            babel.generate/model model]
+                (= (:rule rule) "vp-aux-22-nonphrasal-comp")))
+             (:grammar model))]
     (generate {:modified false
                :root {:italiano {:italiano "radersi"}}
                :synsem {:cat :verb
                         :sem {:aspect :perfect
                               :tense :present}
                         :subcat []}})))
+
 (defn basecamp []
   (repeatedly
    #(println (morph (time (with-shrunken-model))))))
+
+(defn svegliarsi []
+  (repeatedly
+   #(println (pprint
+              (let [expr
+                    (time (generate {:modified false,
+                                     :synsem {:cat :verb, :subcat []
+                                              :sem {:tense :present, :aspect :progressive}},
+                                     :root {:italiano {:italiano "svegliarsi"}}
+                                     :comp {:phrasal false}}
+                                    model))]
+                {:m (morph expr)
+                 :ps (morph-ps expr)})))))
+
+(defn chiamarsi []
+  (repeatedly
+   #(println (pprint
+              (let [expr
+                    (time (generate {:modified false,
+                                     :synsem {:cat :verb, :subcat []
+                                              :sem {:tense :present, :aspect :progressive}},
+                                     :root {:italiano {:italiano "chiamarsi"}}
+                                     :comp {:phrasal false}}
+                                    model))]
+                {:m (morph expr)
+                 :ps (morph-ps expr)})))))
+


Fixed a bug (db was not called as method)

--- src/barmap/model/places.clj
+++ src/barmap/model/places.clj
@@ -3,7 +3,7 @@
             [lobos.config :as config]))

 (defn all []
-  (into [] (sql/query config/db ["select * from places;"])))
+  (into [] (sql/query (config/db) ["select * from places;"])))

 (defn allViaType [type]
-  (into [] (sql/query config/db ["select * from places where type_id = ?" type])))
+  (into [] (sql/query (config/db) ["select * from places where type_id = ?" type])))


add further sc-book translations

add further sc-book translations

--- docs/sc-book/sc-one.clj
+++ docs/sc-book/sc-one.clj
@@ -344,3 +344,54 @@
 ;;Synth("PMCrotale", ["midi", rrand(48, 72).round(1), "tone", rrand(1, 6)])

 (pmc-rotale :midi (ranged-rand 48 72) :tone (ranged-rand 1 6))
+
+
+;;Page 25
+;;
+;;~houston = Buffer.read(s, "sounds/a11wlk01-44_1.aiff");
+;;~chooston = Buffer.read(s, "sounds/a11wlk01.wav");
+;;
+;;{PlayBuf.ar(1, ~houston)}.play;
+;;{PlayBuf.ar(1, ~chooston)}.play;
+
+
+;;this assumes you have a separate install of SuperCollider and
+;;you're running OS X. Feel free to change the following audio paths
+;;to any other audio file on your disk...
+
+(def houston (load-sample "/Applications/SuperCollider/sounds/a11wlk01-44_1.aiff"))
+(def chooston (load-sample "/Applications/SuperCollider/sounds/a11wlk01.wav"))
+
+(demo 4 (play-buf 1 houston))
+(demo 5 (play-buf 1 chooston))
+
+
+;;Page 26
+;;
+;;[~houston.bufnum, ~houston.numChannels, ~houston.path, ~houston.numFrames];
+;;[~chooston.bufnum, ~chooston.numChannels, ~chooston.path, ~chooston.numFrames];
+
+;;samples are represented as standard clojure maps
+houston
+chooston
+
+
+
+;;(
+;;{
+;;        var rate, trigger, frames;
+;;        frames = ~houston.numFrames;
+;;
+;;        rate = [1, 1.01];
+;;        trigger = Impulse.kr(rate);
+;;        PlayBuf.ar(1, ~houston, 1, trigger, frames * Line.kr(0, 1, 60)) *
+;;        EnvGen.kr(Env.linen(0.01, 0.96, 0.01), trigger) * rate;
+;;}.play
+;;)
+
+(demo 60 (let [frames (num-frames houston)
+              rate   [1 1.01]
+              trigger (impulse:kr rate)
+              src (play-buf 1 houston 1 trigger (* frames (line:kr 0 1 60)))
+              env (env-gen:kr (lin-env 0.01 0.96 0.01) trigger)]
+          (* src env rate)))


change "state" to an atom

change "state" to an atom

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@6064 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -140,7 +140,7 @@
     (log-cmd (@state :last-wake-time))
     (when (pos? sleep-time)
       (Thread/sleep sleep-time)
-      (dosync (alter state assoc :last-wake-time target-time)))))
+      (swap! state assoc :last-wake-time target-time))))

 (declare device-agents)

@@ -155,7 +155,7 @@
 (defn set-stage-position
   ([stage-dev z] (log "setting z position to " z)
 		 (core setPosition stage-dev z)
-		 (dosync (alter state assoc :last-z-position z)))
+		 (swap! state assoc :last-z-position z))
   ([stage-dev x y] (log "setting x,y position to " x "," y)
                    (when (and x y) (core setXYPosition stage-dev x y))))

@@ -228,7 +228,7 @@
     (.put out-queue (annotate-image image event))))

 (defn store-z-correction [z event]
-  (dosync (alter state assoc-in [:z-corrections (get-in event [:position :label])] z)))
+  (swap! state assoc-in [:z-corrections (get-in event [:position :label])] z))

 (defn compute-z-position [event]
   (if-let [z-drive (:z-drive event)]
@@ -261,21 +261,21 @@
     (event-fn)))

 (defn stop-acq []
-  (dosync (alter state assoc :stop true)))
+  (swap! state assoc :stop true))

 (defn pause-acq []
-  (dosync (alter state assoc :pause true)))
+  (swap! state assoc :pause true))

 (defn run-acquisition [settings out-queue]
   (def acq-settings settings)
   (binding
-    [state (ref {:pause false
-                 :stop false
-                 :z-corrections nil
-                 :last-wake-time (clock-ms)
-                 :start-time (clock-ms)
-                 :init-auto-shutter (core getAutoShutter)
-                 :last-z-position (get-z-stage-position (core getFocusDevice))})]
+    [state (atom {:pause false
+                  :stop false
+                  :z-corrections nil
+                  :last-wake-time (clock-ms)
+                  :start-time (clock-ms)
+                  :init-auto-shutter (core getAutoShutter)
+                  :last-z-position (get-z-stage-position (core getFocusDevice))})]
     (let [acq-seq (generate-acq-sequence settings)]
        (def acq-sequence acq-seq)
        (def last-state state)


Add final anchor on path drawing in order to facilitate path closing.

--- src/uxbox/main/ui/workspace/drawarea.cljs
+++ src/uxbox/main/ui/workspace/drawarea.cljs
@@ -23,6 +23,7 @@

 ;; --- State

+(defonce drawing-stoper (rx/bus))
 (defonce drawing-shape (atom nil))
 (defonce drawing-position (atom nil))

@@ -75,9 +76,24 @@
         (shapes/render-component))))

 (mx/defc path-shape-draw-area
-  [shape]
-  (-> (assoc shape :drawing? true)
-      (shapes/render-component)))
+  [{:keys [points] :as shape}]
+  (letfn [(on-click [event]
+            (dom/stop-propagation event)
+            (swap! drawing-shape
+                   (fn [shape]
+                     (let [points (:points shape)
+                           points (vec (butlast points))]
+                       (assoc shape :points points :close? true))))
+            (rx/push! drawing-stoper true))]
+    (let [{:keys [x y]} (first points)]
+      [:g
+       (-> (assoc shape :drawing? true)
+           (shapes/render-component))
+       [:circle {:cx x
+                 :cy y
+                 :r 5
+                 :fill "red"
+                 :on-click on-click}]])))

 ;; --- Drawing Initialization

@@ -149,7 +165,10 @@
                      (rx/mapcat conditional-align-point)
                      (rx/map #(gpt/subtract % canvas-coords)))

-          stoper (rx/take 1 (rx/filter stoper-event? wb/events-s))
+          stoper (->> (rx/merge
+                       (rx/take 1 drawing-stoper)
+                       (rx/filter stoper-event? wb/events-s))
+                      (rx/take 1))
           firstpos (rx/take 1 mouse)
           stream (->> (rx/take-until stoper mouse)
                       (rx/skip-while #(nil? @drawing-shape))
@@ -163,32 +182,10 @@
                 (let [point (gpt/point point)]
                   (update shape :points conj point)))

-              (update-point [{:keys [type] :as shape} point index]
+              (update-point [{:keys [type points] :as shape} point index]
                 (let [point (gpt/point point)
                       points (:points shape)]
-                  (if (= (count points) index)
-                    (append-point shape point)
-                    (assoc-in shape [:points index] point))))
-
-              (normalize-shape [{:keys [points] :as shape}]
-                (let [minx (apply min (map :x points))
-                      miny (apply min (map :y points))
-                      maxx (apply max (map :x points))
-                      maxy (apply max (map :y points))
-
-                      ;; dx (- 0 minx)
-                      ;; dy (- 0 miny)
-                      ;; points (mapv #(gpt/add % [dx dy]) points)
-                      width (- maxx minx)
-                      height (- maxy miny)]
-
-                  (assoc shape
-                         ;; :x1 minx
-                         ;; :y1 miny
-                         ;; :x2 maxx
-                         ;; :y2 maxy
-                         ;; :view-box [0 0 width height]
-                         :points points)))
+                  (assoc-in shape [:points index] point)))

               (on-first-point [point]
                 (let [shape (append-point shape point)]
@@ -219,7 +216,7 @@
                   (on-free-draw point)))

               (on-end []
-                (let [shape (normalize-shape @drawing-shape)]
+                (let [shape @drawing-shape]
                   (rs/emit! (uds/add-shape shape)
                             (udw/select-for-drawing nil)
                             (uds/select-first-shape))


Can create insert triggers on rows now. yay!

Still a lot of cleanup work needed but the basic thing is working

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -450,19 +450,28 @@

         coils-trigger-exists   (pos? (count coils-trigger))

-        sql-to-create-trigger "
+      sql-to-insert-trigger-row "
 INSERT INTO coils_triggers
 (
   table_name,version
 ) values (?,?);
 "
+
+        sql-to-create-trigger "
+CREATE TRIGGER trigger_afterInsert AFTER INSERT ON todo_items FOR EACH ROW EXECUTE PROCEDURE trigger_function_afterInsert();
+"
         ]
         (println "Coils trigger table exists: " coils-trigger-exists)

         (if (not coils-trigger-exists )
-                      (korma.core/exec-raw   [sql-to-create-trigger [table-name  coils-tables-trigger-version]]   [])
+        (do
+            (korma.core/exec-raw   [sql-to-insert-trigger-row [table-name  coils-tables-trigger-version]]   [])
+            (korma.core/exec-raw   [sql-to-create-trigger []]   [])
+
+                      )
                       nil
+
         )

           )


remove misguided quasiquote sanitization

--- src/clj/wombat/compiler.clj
+++ src/clj/wombat/compiler.clj
@@ -184,14 +184,6 @@

 (declare sanitize-jvm)

-(defn sanitize-quasiquote
-  [env form]
-  (if (list-like? form)
-    (if (#{'unquote 'unquote-splicing} (first form))
-      (list* (first form) (map (partial sanitize env) (rest form)))
-      (seq->list (map (partial sanitize-quasiquote env) form)))
-    form))
-
 (defn sanitize-define
   [env [define name & val :as form]]
   (debug "sanitize-define: " form)
@@ -218,9 +210,6 @@
       #{'define 'define-macro} :>> (partial sanitize-define env)

       #{'define-class*} form
-
-      #{'quasiquote} :>> (fn [[_ & forms]]
-                           (list* 'quasiquote (map (partial sanitize-quasiquote env) forms)))

       #{:jvm} :>> (fn [[_ & insns]]
                     (list* :jvm (map (partial sanitize-jvm env) insns)))
@@ -246,19 +235,6 @@
    :else
    form))

-(declare free-vars)
-(defn quasiquote-free-vars
-  [form]
-  (if (list-like? form)
-    (loop [f form
-           frees (sorted-set)]
-      (if (seq f)
-        (if (#{'unquote 'unquote-splicing} (first f))
-          (reduce into frees (map free-vars (rest f)))
-          (recur (next f) (into frees (quasiquote-free-vars (first f)))))
-        frees))
-    (sorted-set)))
-
 (defn free-vars
   "Returns a sorted-set of free symbols in the given form. Sorting is
   arbitrary, but consistent."
@@ -269,8 +245,6 @@
      nil (sorted-set)

      (['quote val] :seq) (sorted-set)
-
-     (['quasiquote val] :seq) (quasiquote-free-vars val)

      (['lambda params & body] :seq)
      (apply disj (free-vars body) (cons *lambda-name* (remove special-token? params)))


Remove GET and POST stuff from clojurescript

--- src/cljs/movement/util.cljs
+++ src/cljs/movement/util.cljs
@@ -8,7 +8,6 @@
     [reagent.session :as session]
     [secretary.core :as secretary
      :include-macros true :refer [dispatch!]]
-    [dommy.core :as dommy :refer-macros [sel1]]
     [ajax.core :as cljs-ajax :refer [to-interceptor]]
     [ajax.edn :refer [edn-request-format edn-response-format]]
     [clojure.string :as str]))
@@ -17,56 +16,11 @@
   [coll pos]
   (vec (concat (subvec coll 0 pos) (subvec coll (inc pos)))))

-(def csrf-token
-  (dommy/attr (sel1 :#anti-forgery-token) "value"))
-
 (defn positions
   "Finds the integer positions of the elements in the collection, that matches the predicate."
   [pred coll]
   (keep-indexed (fn [idx x]
                   (when (pred x) idx)) coll))
-
-(defn GET [url & [opts]]
-  (let [token (str/trim (str "Token " (:token (session/get :user))))
-        base-opts {:format          (edn-request-format)
-                   :response-format (edn-response-format)
-                   ;:with-credentials true
-                   :interceptors    [(to-interceptor {:name    "Token Interceptor"
-                                                      :request #(assoc-in % [:headers "authorization"] token)})]}]
-    (cljs-ajax/GET url (merge base-opts opts))))
-
-(defn POST [url & [opts]]
-  (let [token (str/trim (str "Token " (:token (session/get :user))))
-        base-opts {:format          (edn-request-format)
-                   :response-format (edn-response-format)
-                   ;:with-credentials true
-                   :interceptors    [(to-interceptor {:name    "Token Interceptor"
-                                                      :request #(assoc-in % [:headers "authorization"] token)})]
-                   :headers         {:x-csrf-token csrf-token}}]
-    (cljs-ajax/POST url (merge base-opts opts))))
-
-(defn get-user-info []
-  (GET "user" {:params        {:email (:email (session/get :user))}
-               :handler       #(session/put! :username (:username %))
-               :error-handler #(pr (str "error retrieving user information: " %))}))
-
-(defn get-templates []
-  (GET "templates" {:params        {:user (:email (session/get :user))}
-                    :handler       #(session/put! :templates %)
-                    :error-handler #(pr (str "error retrieving templates: " %))}))
-
-(defn get-movements []
-  (GET "movements" {:handler       #(session/put! :all-movements %)
-                    :error-handler #(pr (str "error retrieving movements: " %))}))
-
-(defn get-categories []
-  (GET "categories" {:handler       #(session/put! :all-categories %)
-                    :error-handler #(pr (str "error retrieving movements: " %))}))
-
-(defn get-stored-sessions []
-  (GET "sessions" {:params        {:user (session/get :user)}
-                   :handler       #(session/put! :stored-sessions %)
-                   :error-handler #(pr (str "error retrieving stored sessions: " %))}))

 (defn hook-browser-navigation! []
   (doto (History.)
@@ -93,4 +47,3 @@
   (fn [] func nil))

 (def temp-state (atom {}))
-


minor fixes

minor fixes

--- src/cljs/worktv/events.cljs
+++ src/cljs/worktv/events.cljs
@@ -3,14 +3,16 @@

 (def log js/console.log)

+(reg-fx
+  :xhr
+  (fn )
 (reg-event-fx
  :init
  (fn [_ _]
    (log "init event...")
-   (as-> effects {:db {}}
-     (if (.startsWith (-> js/window .-location .-pathname) "/login")
-       (assoc effects :dispatch [:get-user])
-       effects))))
+   (cond-> {:db {}}
+     (cond (.startsWith (-> js/window .-location .-pathname) "/login")
+       (assoc :dispatch [:get-user])))))

 (reg-event-db
  :current-page


Add colors to classifications

Add colors to classifications

--- src/zooniverse_live/classifiers_view.cljs
+++ src/zooniverse_live/classifiers_view.cljs
@@ -13,20 +13,25 @@
   [project]
   (str "/images/" project ".jpg"))

+(defn merge-color
+  [projects]
+  (fn [{:strs [project] :as classification}]
+    (assoc classification "color" (get-in projects [(keyword project) :color]))))
+
 (defn classifications-slice
-  [{:keys [classifications]}]
-  (println classifications)
-  (take-last 7 classifications))
+  [{:keys [classifications projects]}]
+  (map (merge-color projects) (take-last 7 classifications)))

 (defn classifier-view
-  [{:strs [project country_name city_name] :as classification} owner]
+  [{:strs [project color country_name city_name] :as classification} owner]
   (println classification)
   (reify
     om/IRender
     (render [this]
-      (dom/li #js {:className "classifier-view-item"} (dom/div #js {:className project}
-                           (dom/h2 nil (location city_name country_name))
-                           (dom/img #js {:src (image-src project)} nil))))))
+      (dom/li #js {:className "classifier-view-item" :style #js {:background color}}
+              (dom/div #js {:className project}
+                       (dom/h2 nil (location city_name country_name))
+                       (dom/img #js {:src (image-src project)} nil))))))

 (defn classifiers-view
   [app owner]


fix messaging

fix messaging

--- src/clj/org/openforis/ceo/db/projects.clj
+++ src/clj/org/openforis/ceo/db/projects.clj
@@ -355,17 +355,17 @@
             header-diff (set/difference (set must-include) header-set)]
         (cond
           (not (str/includes? header-row ","))
-          (init-throw "The CSV file must use commas for the delimiter. This error may indicate that the csv file contains one column")
+          (init-throw "The CSV file must use commas for the delimiter. This error may indicate that the csv file contains only one column.")

           (seq header-diff)
-          (init-throw (str "Header fields " header-diff " are missing."))
+          (init-throw (str "The required header field(s) " (str/join ", " header-diff) " are missing."))

           (every? (fn [header]
                     (or (re-matches #"^[a-zA-Z_][a-zA-Z0-9_]*$" header)
                         (init-throw (str "The CSV column \"" header "\" is invalid."))))
                   header-set)
           (do
-            (spit ext-file (str/replace-first data header-row (str/join "," headers)))
+            (spit ext-file (str/replace-first data header-row (str/join ", " headers)))
             (type-columns headers))))
       (init-throw "CSV file contains no rows of data."))))

@@ -408,11 +408,11 @@
                                           (str (str/capitalize type) " " distribution " file failed to load."))
                          table))
                      (if (= "csv" distribution)
-                       (str "Malformed " type " CSV. Fields must include LON,LAT," (str/join "," must-include) " columns.")
+                       (str "Malformed " type " CSV.")
                        (str "Malformed "
                             type
                             " Shapefile. All features must be of type polygon and include "
-                            (str/join "," must-include)
+                            (str/join ", " must-include)
                             " field(s).")))))

 (defn- create-project-samples [plot-id
@@ -512,7 +512,7 @@
                 (init-throw (str "The uploaded plot and sample files do not have correctly overlapping data. "
                                  (count bad-plots)
                                  " plots have no samples. The first 10 are: ["
-                                 (str/join "," (take 10 bad-plots))
+                                 (str/join ", " (take 10 bad-plots))
                                  "]"))))))
       (let [[[left bottom] [top right]] (pu/EPSG:4326->3857 [lon-min lat-min] [lon-max lat-max])
             [left bottom right top] (pad-bounds left bottom top right (/ 2.0 plot-size))]


Changed usage of data-augmentation/rotate

--- src/clj/think/image/data_augmentation.clj
+++ src/clj/think/image/data_augmentation.clj
@@ -41,7 +41,7 @@
   [^BufferedImage img degrees random?]
   (let [width (.getWidth img)
         height (.getHeight img)
-        degrees (if random? (rand-int 360) degrees)
+        degrees (if random? (rand-int degrees) degrees)
         out-image (imagez/new-image width height)
         tx (AffineTransform.)
         radians (Math/toRadians degrees)


Use photos from an album instead of all photos

--- src/dappr/core.clj
+++ src/dappr/core.clj
@@ -26,6 +26,18 @@
         photos (-> body (get "photos") (get "photo"))]
     photos))

+(defn- photoset-photos
+  "Get the photos from a specified photoset (adding the user_id improves
+  performance according to the Flickr API docs)"
+  [photoset_id user_id]
+  (let [body (flickr-method
+               "flickr.photosets.getPhotos"
+               {"user_id" user_id
+                "photoset_id" photoset_id
+                "extras" "url_l,date_taken,path_alias"})
+        photos (-> body (get "photoset") (get "photo"))]
+    photos))
+
 (defn- generate
   "Generates the output given some photos data and a template path"
   [data input-file output-file]
@@ -37,6 +49,6 @@
   "I don't do a whole lot ... yet."
   [& args]
   (generate
-    (public-photos "79132105@N04")
+    (photoset-photos "72157659937187072" "79132105@N04")
     "templates/photoblog.mustache.html"
     "src/templates/photoblog.html"))


"Solved" 6.10 (quoted due to fact Clojure does not provide case classes and companion objects as Scala does.

--- src/fpinscala/purely_functional_state.clj
+++ src/fpinscala/purely_functional_state.clj
@@ -282,4 +282,20 @@

 (def double-int-via-both-map2-flat-map-fpins
   "double-int via both (via map2 (: )"
-  (both-via-map2-via-flat-map-fpins a-double-fpins non-negative-int))+  (both-via-map2-via-flat-map-fpins a-double-fpins non-negative-int))
+
+;6.10
+;Well, given Clojure's dynamic nature, I have nothing special to do
+;for State type and functions apart from re-defining supporting from-rng macro
+;and make-result function to use more generic names for value and new state map entries
+(defmacro from-state [state _ bindings & body]
+  `(let [{~@(interleave bindings [:val :next-state]) ~@[]} ~state]
+     ~@body))
+
+(defn- make-result-state
+  "Auxiliary function to avoid same map creation all over the place"
+  [val next-state]
+  {:val val :next-state next-state})
+;In addition, Clojure does not provide case classes and companion objects as Scala
+;does so existing unit, map, map2, flat-map and sequnce does the job as
+;there is no instance you could invoke method on


more tweaking

more tweaking

--- src/mccarthy_animation/speech_bubble.cljc
+++ src/mccarthy_animation/speech_bubble.cljc
@@ -40,16 +40,19 @@
             box-height    (+ 18 (* 14 lines-of-text))]

         ;; box
-        (let [box-x     (- (+ hero-x hero-size-x) 35)
+        (let [stroke-weight 2
+              box-x     (- (+ hero-x hero-size-x) 35)
               box-y     (+ (- hero-y hero-size-y) (- 50 box-height))
               box-width (+ 16 text-width)]
+
           (quil/rect box-x box-y box-width box-height)

           ;; outline box on 3 sides
           (quil/stroke 0)
-          (quil/line box-x box-y (+ box-x box-width) box-y)
-          (quil/line (+ box-x box-width) box-y (+ box-x box-width) (+ box-y box-height))
-          (quil/line box-x box-y box-x (+ box-y box-height))
+          (quil/stroke-weight stroke-weight)
+          (quil/line box-x box-y (- (+ box-x box-width) stroke-weight) box-y)
+          (quil/line (+ box-x box-width) box-y (+ box-x box-width) (- (+ box-y box-height) 1))
+          (quil/line box-x box-y box-x (- (+ box-y box-height) 1))

           ;; triangle
           (quil/stroke 255)
@@ -67,12 +70,12 @@

             ;; outline triangle
             (quil/stroke 1)
-            (quil/line tri-0-x tri-0-y tri-1-x tri-y)
-            (quil/line tri-0-x tri-0-y tri-2-x tri-y)
+            (quil/line tri-0-x tri-0-y tri-1-x (+ tri-y 1))
+            (quil/line tri-0-x tri-0-y tri-2-x (+ tri-y 1))

             ;; last little bits to tie in triangle and box
-            (quil/line box-x (+ box-y box-height) tri-2-x tri-y)
-            (quil/line (+ box-x box-width) (+ box-y box-height) tri-1-x tri-y) )
+            (quil/line box-x (+ box-y box-height) (- tri-2-x 1) tri-y)
+            (quil/line (- (+ box-x box-width) stroke-weight) (+ box-y box-height) (+ tri-1-x 1) tri-y) )

           ;; actual text
           (quil/fill 0) ; blacken text


Fix for :set-chat-ui-props call

Fix for :set-chat-ui-props call

--- src/status_im/chat/views/input/input.cljs
+++ src/status_im/chat/views/input/input.cljs
@@ -154,7 +154,7 @@
                               :placeholder       placeholder
                               :blur-on-submit    false
                               :editable          (not @sending-in-progress?)
-                              :on-focus          #(dispatch [:set-chat-ui-props :show-emoji? false])
+                              :on-focus          #(dispatch [:set-chat-ui-props {:show-emoji? false}])
                               :on-submit-editing (fn []
                                                    (when-not (str/blank? @seq-arg-input-text)
                                                      (dispatch [:send-seq-argument]))


Make test for conexp.fca.more work again

--- src/test/clojure/conexp/fca/more_test.clj
+++ src/test/clojure/conexp/fca/more_test.clj
@@ -7,7 +7,8 @@
 ;; You must not remove this notice, or any other, from this software.

 (ns conexp.fca.more-test
-  (:require [conexp.base :refer :all]
+  (:require [clojure.test :refer [deftest is]]
+            [conexp.base :refer :all]
             [conexp.fca.contexts :refer :all]
             [conexp.fca.contexts-test :refer :all]
             [conexp.fca.implications :refer :all]


Fix reflection

Fix reflection

--- test/caesium/crypto/box_test.clj
+++ test/caesium/crypto/box_test.clj
@@ -49,7 +49,7 @@
     (let [pk (u/hexify alice-pk)
           sk (u/hexify bob-sk)]
       (is (thrown? ClassCastException (b/encrypt pk sk nonce ptext))))
-    (let [forgery (r/randombytes (alength ctext))]
+    (let [forgery (r/randombytes (alength ^bytes ctext))]
       (is (thrown-with-msg?
            RuntimeException #"Ciphertext verification failed"
            (b/decrypt bob-pk alice-sk nonce forgery))))))


Remove extraneous top-level assertion

Remove extraneous top-level assertion

--- test/comic_reader/sites_test.clj
+++ test/comic_reader/sites_test.clj
@@ -178,23 +178,21 @@

 (defn testdef-form [site-name]
   `(deftest ~(symbol (str site-name "-test"))
-     (is
-      (binding [~'site-name ~site-name]
-        (expect-opts-are-map ~site-name)
-        (call-with-options
-         ((get-sites) site-name)
-         #(and
-           (if (has-test-folder?)
-             (and
-              (test-image-page-extraction)
-              (test-extract-chapters-list)
-              (test-extract-comic-list))
-             (error-must-have-test-data))
-           (when (connected-to-network?)
-             (test-scrape-urls))))
-        (when (connected-to-network?)
-          (test-full-site-traversal ((get-sites) site-name)))
-        true))))
+     (binding [~'site-name ~site-name]
+       (expect-opts-are-map ~site-name)
+       (call-with-options
+        ((get-sites) site-name)
+        #(and
+          (if (has-test-folder?)
+            (and
+             (test-image-page-extraction)
+             (test-extract-chapters-list)
+             (test-extract-comic-list))
+            (error-must-have-test-data))
+          (when (connected-to-network?)
+            (test-scrape-urls))))
+       (when (connected-to-network?)
+         (test-full-site-traversal ((get-sites) site-name))))))

 (defmacro defsite-tests []
   (try


Messing around with a few things

Messing around with a few things

--- examples/dropout/src/dropout/autoencoder.clj
+++ examples/dropout/src/dropout/autoencoder.clj
@@ -9,7 +9,8 @@
             [cortex-gpu.nn.train :as gpu-train]
             [cortex-gpu.resource :as resource]
             [cortex-gpu.nn.cudnn :as cudnn]
-            [cortex-visualization.nn.core :as nn-vis]))
+            [cortex-visualization.nn.core :as nn-vis]
+            [tsne.core :as tsne]))

@@ -18,7 +19,7 @@
 (defonce normalized-data (future (mnist/normalized-data)))
 (def training-data (future (:training-data @normalized-data)))
 (def test-data  (future (:test-data @normalized-data)))
-(def autoencoder-size 529)
+(def autoencoder-size 1000)

 (defn build-and-create-network
   [description]
@@ -117,12 +118,46 @@
      :labels labels
      :loss-fn loss-fn}))

+
+(defn create-mnist-tsne-target
+  []
+  (let [network-desc [(desc/input 28 28 1)
+                      (desc/dropout 0.8)
+                      (desc/convolutional 5 0 1 20 :l2-max-constraint 2.0)
+                      (desc/max-pooling 2 0 2)
+                      (desc/convolutional 5 0 1 50 :l2-max-constraint 2.0)
+                      (desc/max-pooling 2 0 2)
+                      (desc/linear->logistic autoencoder-size :l2-max-constraint 2.0)
+                      (desc/dropout 0.5)
+                      ;;Note carefully the order of the leaves of the network.  There
+                      ;;is currently an implicit dependency here on that order, the order
+                      ;;of the loss functions and the order of the training and test
+                      ;;labels which is probably an argument to specify all of that
+                      ;;in the network description
+
+                      ;;It takes a powerful network to reverse a convolution...
+                      (desc/split [[(desc/linear->logistic 2
+                                                           :l2-max-constraint 2.0)
+                                    (desc/linear->logistic autoencoder-size
+                                                           :l2-max-constraint 2.0)
+                                    (desc/linear->logistic autoencoder-size
+                                                           :l2-max-constraint 2.0)
+                                    (desc/linear 784)]
+                                   [(desc/linear->softmax 10)]])]
+        labels {:training [@training-data @training-labels]
+                :test [@test-data @test-labels]}
+        loss-fn [(opt/mse-loss) (opt/softmax-loss)]]
+    {:network-desc network-desc
+     :labels labels
+     :loss-fn loss-fn}))
+
 (def network-fns
   {:linear create-linear
    :logistic create-logistic
    :logistic-dropout-full create-dropout-logistic-full
    :multiple-target-dropout create-multi-target-dropout
-   :mnist-multiple-target-dropout create-mnist-multi-target})
+   :mnist-multiple-target-dropout create-mnist-multi-target
+   :mnist-tsne-multi-target create-mnist-tsne-target})

 (defn train-and-evaluate
@@ -191,9 +226,34 @@
                                encoder]))]
     (desc/build-and-create-network encoder)))

+
+(defn plot-raw-mnist-tsne
+  []
+  (let [data (vec (take 1000 @test-data))
+        labels (vec (take 1000 @test-labels))
+        label-idx (mapv nn-vis/index-of-label labels)
+        tsne-samples (tsne/tsne data 2)]
+    (nn-vis/scatter-plot-data tsne-samples label-idx "raw mnist")))
+
 (defn plot-network-tsne
   [net-key]
   (let [network (build-encoder-net net-key)]
     (nn-vis/plot-network-tsne network
                               (vec (take 1000 @test-data))
                               (vec (take 1000 @test-labels)) (name net-key))))
+
+
+(defn plot-tsne-encoder
+  []
+  (let [description (remove #(or (= :dropout (:type %))
+                                 (= :input (:type %)))
+                            (:network (get @networks :mnist-tsne-multi-target)))
+        split-item (last description)
+        first-linear (take 2 (first (:branches split-item)))
+        tsne-desc (vec (flatten (concat (drop-last description) [first-linear])))
+        data (vec (take 1000 @test-data))
+        labels (vec (take 1000 @test-labels))
+        label-idx (mapv nn-vis/index-of-label labels)
+        network (desc/build-and-create-network (concat (desc/input 28 28 1) tsne-desc))
+        samples (net/run network data)]
+    (nn-vis/scatter-plot-data samples label-idx "tsne autoencoder")))


Pass GC log test.

Pass GC log test.

--- test/onyx/log/gc_test.clj
+++ test/onyx/log/gc_test.clj
@@ -37,7 +37,9 @@
          :allocations {:j2 {:t3 [:p1]}}
          :percentages nil
          :saturation nil
-         :task-percentages nil})
+         :task-percentages nil
+         :input-tasks nil
+         :output-tasks nil})
   (fact reactions => [])
   (fact diff => {:jobs #{:j1 :j3}
                  :killed-jobs #{:j1}


implict grant scenario tested

implict grant scenario tested

--- test/cerber/oauth2/authorization_test.clj
+++ test/cerber/oauth2/authorization_test.clj
@@ -24,7 +24,7 @@

 (defonce client (c/create-client "http://foo.com" [redirect-uri] [scope]  nil ["moderator"] false))

-(fact "enabled user with valid password is redirected to langing page when successfully logged in"
+(fact "Enabled user with valid password is redirected to langing page when successfully logged in."
       (u/purge-users)

       ;; given
@@ -42,7 +42,7 @@
         (get-in state [:response :status]) => 302
         (get-in state [:response :headers "Location"]) => (get-in app-config [:cerber :landing-url])))

-(fact "Wrong credentials redirect again to login page with failure info displayed."
+(fact "Enabled user with wrong credentials is redirected back to login page with failure info provided."
       (u/purge-users)

       ;; given
@@ -61,7 +61,7 @@
         (get-in state [:response :status]) => 200
         (get-in state [:response :body]) => (contains "failed")))

-(fact "Inactive user is not able to log in"
+(fact "Inactive user is not able to log in."
       (u/purge-users)

       ;; given
@@ -123,6 +123,35 @@
           status => 200
           (slurp body) => (contains "access_token"))))

+(fact "Client may receive its token in Implict Grant scenario."
+      (u/purge-users)
+
+      ;; given
+      (u/create-user {:login "nioh" :enabled true} "alamakota")
+
+      ;; when
+      (let [state (-> (session (wrap-defaults oauth-routes api-defaults))
+                      (header "Accept" "text/html")
+                      (request (str "/authorize?response_type=token"
+                                    "&client_id=" (:id client)
+                                    "&scope=" scope
+                                    "&state=" state
+                                    "&redirect_uri=" redirect-uri))
+
+                      ;; login window
+                      (follow-redirect)
+                      (request-secured "/login"
+                                       :request-method :post
+                                       :params {:username "nioh"
+                                                :password "alamakota"})
+
+                      ;; response with token
+                      (follow-redirect))]
+
+        ;; then
+        (get-in state [:response :status]) => 302
+        (get-in state [:response :headers "Location"]) => (contains "access_token")))
+
 (fact "Client may receive its token in Resource Owner Password Credentials Grant scenario."
       (u/purge-users)

@@ -139,6 +168,7 @@
                                         :password "alamakota"
                                         :grant_type "password"}))]

+        ;; then
         (let [{:keys [status body]} (:response state)]
           status => 200
           (slurp body) => (contains "access_token"))))


[CS] Add `:warnings` & `:errors` to pipeline test

--- test/vip/data_processor/pipeline_test.clj
+++ test/vip/data_processor/pipeline_test.clj
@@ -44,4 +44,7 @@
     (let [intial-input 0
           pipeline [incrementor incrementor incrementor]
           result (process pipeline intial-input)]
-      (is (= {:input 3 :pipeline []} result)))))
+      (is (= {:input 3
+              :pipeline []
+              :warnings {}
+              :errors {}} result)))))


Fix tests so they compile.

Fix tests so they compile.

--- test/grafter/rdf/sesame_test.clj
+++ test/grafter/rdf/sesame_test.clj
@@ -1,7 +1,7 @@
 (ns grafter.rdf.sesame-test
   (:require
    [grafter.rdf.protocols :as pr]
-   [grafter.rdf :refer :all]
+   [grafter.rdf :refer [graph]]
    [grafter.rdf.ontologies.rdf :refer :all]
    [grafter.rdf.sesame :refer :all]
    [clojure.test :refer :all]


[Issue #18] added fact coverage of [{a :a b :b}] style map destructuring, because I Wasn't sure if it worked :)

--- test/midje/checkers/t_chatty.clj
+++ test/midje/checkers/t_chatty.clj
@@ -82,15 +82,24 @@
         (and (= a 1)
              (= b 2))))

+(def other-map-structured-checker
+     (chatty-checker [{a :a b :b}]
+        (and (= a 1)
+             (= b 2))))
+
 (fact "chatty checkers can use a destructuring argument"
   ;; Note: Can't use extended-equality because it swallows chatty-failures
-  (= (vec-structured-checker [1 2 3 4]) true) => truthy
+  (= (vec-structured-checker [1 2 3 4]) true) => truthy )

-  (= (map-structured-checker {:a 1 :b 2}) true) => truthy
-  (= (map-structured-checker {:a 10 :b 10}) true) => falsey
-
-  (= (map-structured-checker-with-as {:a 1 :b 2}) true) => truthy
-  (= (map-structured-checker-with-as {:a 10 :b 10}) true) => falsey)
+(tabular "chatty checkers can use a map destructuring argument"
+  (fact
+      (= (?structured-checker {:a 1 :b 2}) true) => truthy
+      (= (?structured-checker {:a 10 :b 10}) true) => falsey)
+
+  ?structured-checker
+  map-structured-checker
+  map-structured-checker-with-as
+  other-map-structured-checker )

 (tabular
   (fact "different parts are in fact checked"
@@ -106,15 +115,18 @@
   (:intermediate-results (vec-structured-checker ['x 2 3 4]))
   => '(    ((= a 1) false)
            ((= b 2) true)
-           ((= c [3 4]) true) )
+           ((= c [3 4]) true) ) )

-  (:intermediate-results (map-structured-checker {:a 10 :b 2}))
+(tabular "map structured checkers still work"
+  (fact (:intermediate-results (?structured-checker {:a 10 :b 2}))
   => '(    ((= a 1) false)
-           ((= b 2) true))
+           ((= b 2) true) ))
+
+  ?structured-checker
+  map-structured-checker
+  map-structured-checker-with-as
+  other-map-structured-checker )

-  (:intermediate-results (map-structured-checker-with-as {:a 10 :b 2}))
-  => '(    ((= a 1) false)
-           ((= b 2) true)) )

 ;; Chatty checkers: interaction with checkers that return chatty-failures.
 (defn rows-in [rows] rows)


Add extra groups.

Add extra groups.

--- test/onyx/peer/grouping_test.clj
+++ test/onyx/peer/grouping_test.clj
@@ -89,13 +89,15 @@
    {:name "Mike" :amount 20}

    {:name "Dorrene" :amount 30}
-   {:name "Dorrene" :amount 40}])
+   {:name "Dorrene" :amount 40}
+
+   {:name "Benti" :amount 55}])

 (hq-util/write-and-cap! hq-config in-queue data 1)

 (def conn (onyx.api/connect (str "onyx:memory//localhost/" id) coord-opts))

-(def v-peers (onyx.api/start-peers conn 1 peer-opts))
+(def v-peers (onyx.api/start-peers conn 7 peer-opts))

 (onyx.api/submit-job conn {:catalog catalog :workflow workflow})


Add some commented tests

Add some commented tests

--- test/picard/test/http/parser.clj
+++ test/picard/test/http/parser.clj
@@ -28,6 +28,9 @@
    ;; "/with_\"stupid\"_quotes?foo=\"bar\""
    ;; {:path-info "/with_\"stupid\"_quotes" :query-string "foo=\"bar\""}

+   ;; "GET /δ¶/δt/pope?q=1#narf HTTP/1.1\r\n"
+   ;; {:path-info "/δ¶/δt/pope" :query-string "q=1"}
+
    "http://hypnotoad.org/hail?all"
    {:path-info "/hail" :query-string "all"}

@@ -41,8 +44,10 @@
    {:path-info "/" :query-string ""}})

-(def get-request  {:request-method "GET"  :path-info "/" :query-string "" :http-version [1 1]})
-(def post-request {:request-method "POST" :path-info "/" :query-string "" :http-version [1 1]})
+(def get-request  {:request-method "GET"  :path-info "/"
+                   :query-string   ""     :http-version [1 1]})
+(def post-request {:request-method "POST" :path-info "/"
+                   :query-string   ""     :http-version [1 1]})

 ;; ==== REQUEST LINE TESTS


Adding unconditional PUT to http test.

Adding unconditional PUT to http test.

--- test/poky/protocol/http_test.clj
+++ test/poky/protocol/http_test.clj
@@ -103,6 +103,12 @@
            (end-point-url default-port bucket "set-me")
            {:headers {"if-unmodified-since" (tf/unparse (tf/formatters :rfc822) (t/now))}
             :body "with-a-value"}) => (contains {:status 200})
+
+         (client/get
+           (end-point-url default-port bucket "set-me")) => (contains {:status 200
+                                                                       :headers #(string? (get % "last-modified"))
+                                                                       :body "with-a-value"})
+
          ; If-Unmodified-Since in the past, should be rejected
          (client/put
            (end-point-url default-port bucket "set-me")
@@ -110,10 +116,17 @@
             :headers {"if-unmodified-since"
                       (tf/unparse (tf/formatters :rfc822) (t/minus (t/now) (t/days 1)))}
             :body "with-a-value"}) => (contains {:status 412})
+
+         ; PUT without if-unmodified-since should be accepted
+         (client/put
+           (end-point-url default-port bucket "set-me")
+           {:throw-exceptions false
+            :body "NEW-with-a-value"}) => (contains {:status 200})
+
          (client/get
            (end-point-url default-port bucket "set-me")) => (contains {:status 200
                                                                        :headers #(string? (get % "last-modified"))
-                                                                       :body "with-a-value"}))
+                                                                       :body "NEW-with-a-value"}))

   (facts :integration :put :multi-byte
          (client/put


perf tests

perf tests

--- src/clj/algorithms_clj/perf_fibo.clj
+++ src/clj/algorithms_clj/perf_fibo.clj
@@ -79,14 +79,25 @@
   [n]
   (advance (FiboType. 0N 1N) n))

+; -----------------------------------------------
+
+(defn run-bench*
+  [name f n]
+  (println name ": ------------------------------")
+  (perf/quick-bench (f n)))
+
+(defmacro run-bench
+  [[f n]]
+  `(run-bench* ~(name f) ~f ~n))
+
 (defn run-benches
   []
   (let [n 1000]
-    (perf/quick-bench (fibo-iterate n))
-    (perf/quick-bench (fibo-lazy-seq n))
-    (perf/quick-bench (fibo-recur n))
-    (perf/quick-bench (fibo-imperative n))
-    (perf/quick-bench (fibo-volatile n))
-    (perf/quick-bench (fibo-with-type n))
+    (run-bench (fibo-iterate n))
+    (run-bench (fibo-lazy-seq n))
+    (run-bench (fibo-recur n))
+    (run-bench (fibo-imperative n))
+    (run-bench (fibo-volatile n))
+    (run-bench (fibo-with-type n))
     #_(perf/quick-bench (fibo-lazy-cat n))
     ))


Refactor - create `timetable-get-lesson-div` function

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -548,6 +548,11 @@
         {:foundFreeRow false, :rowIndex 0}
         ttDay))))

+(defn- timetable-get-lesson-div
+  "Retrieves the jQuery object for a lesson <div>"
+  [day rowNum ttLessonInfo]
+  (get-in Timetable [day rowNum ttLessonInfo]))
+
 (defn- create-lesson-div
   "Creates a <div> element for a new lesson using jQuery"
   [& {:keys [moduleCode moduleName lessonType lessonGroup venue slotsOcc
@@ -1039,11 +1044,11 @@
                  rowNum       (:rowNum modSelLessonInfo)
                  startTime    (:startTime modSelLessonInfo)
                  endTime      (:endTime modSelLessonInfo)
-                 ttRow        (get-in Timetable [day rowNum])
                  ttLessonInfo {:moduleCode moduleCode, :lessonType lessonType,
                                :lessonGroup lessonGroup, :startTime startTime,
                                :endTime endTime}
-                 $lessonDiv   (get ttRow ttLessonInfo)]
+                 $lessonDiv   (timetable-get-lesson-div day rowNum
+                                                        ttLessonInfo)]
              ($lesson-div-remove $lessonDiv startTime endTime)
              (assoc ttLessonInfo :day day, :rowNum rowNum)))
          lessonInfoSeq)))


Add scroll stabilizing code to the comic-location-list component

Adapted from here: http://blog.vjeux.com/2013/javascript/scroll-position-with-react.html

--- src/cljs/comic_reader/ui/reader.cljs
+++ src/cljs/comic_reader/ui/reader.cljs
@@ -1,5 +1,6 @@
 (ns comic-reader.ui.reader
   (:require [re-frame.core :as re-frame]
+            [reagent.core :as reagent]
             [comic-reader.ui.image :as image]
             [comic-reader.api :as api]
             [comic-reader.ui.base :as base]
@@ -194,7 +195,26 @@
     {:key (location-id location)}))

 (defn comic-location-list [set-current-location locations]
-  [:div (map #(make-comic-image set-current-location %) locations)])
+  (let [storage (atom {})]
+    (reagent/create-class
+     {:display-name "comic-location-list"
+      :component-will-update
+      (fn [this]
+        (let [node (reagent/dom-node this)]
+          (swap! storage assoc
+                 :scroll-height (.-scrollHeight node)
+                 :scroll-top (.-scrollTop node))))
+      :component-did-update
+      (fn [this]
+        (let [node (reagent/dom-node this)
+              curr-scroll-height (.-scrollTop node)
+              prev-scroll-height (:scroll-height @storage)
+              prev-scroll-top    (:scroll-top @storage)]
+          (set! (.-scrollTop node)
+                (+ prev-scroll-top (- curr-scroll-height prev-scroll-height)))))
+      :reagent-render
+      (fn [set-current-location locations]
+        [:div (map #(make-comic-image set-current-location %) locations)])})))

 (defn reader [set-current-location locations loading-before loading-after]
   [:div


kinded stuff etc

kinded stuff etc

--- src/clojure/migae/datastore/emap.clj
+++ src/clojure/migae/datastore/emap.clj
@@ -51,6 +51,81 @@
         (.setProperty e (subs (str k) 1) (get-val-ds v)))
       (PersistentEntityMap. e))))

+(defn get-kinded-emap
+  [keychain & data]
+  ;; precon: improper keychain is validated
+  (log/trace "get-kinded-emap " keychain)
+  ;; (log/trace "keychain" keychain)
+  ;; (log/trace "data" data)
+  ;; (let [em (first data)
+  ;;       kind (clj/name (last keychain))
+  ;;       ;; foo (log/trace "kind" kind)
+  ;;       parent-keychain (vec (butlast keychain))
+  ;;       e (if (nil? parent-keychain)
+  ;;           (Entity. kind)
+  ;;           (do #_(log/trace "parent-keychain" parent-keychain)
+  ;;               #_(log/trace "parent-key" (ekey/keychain-to-key parent-keychain))
+  ;;               (Entity. kind  (ekey/keychain-to-key parent-keychain))
+  ;;               ))]
+  ;;   (when (not (empty? em))
+  ;;     (doseq [[k v] (seq em)]
+  ;;       (.setProperty e (subs (str k) 1) (get-val-ds v))))
+  ;;   (.put (ds/datastore) e)
+  ;;   (PersistentEntityMap. e)))
+  )
+;;  (throw (IllegalArgumentException. (str "kinded keychain" keychain))))
+
+(defn get-proper-emap
+  [keychain & data]
+  ;; precon: keychain has already been validated
+  (log/trace "get-proper-emap" keychain)
+  ;; (log/trace "keychain" keychain)
+  ;; (log/trace "data" data)
+  ;; (let [k (ekey/keychain-to-key keychain)
+  ;;       em (first data)
+  ;;       e (Entity. k)]
+  ;;   (when (not (empty? em))
+  ;;     (doseq [[k v] em]
+  ;;       (.setProperty e (subs (str k) 1) (get-val-ds v))))
+  ;;   (.put (ds/datastore) e)
+  ;;   (PersistentEntityMap. e)))
+  )
+
+(defn put-kinded-emap
+  [keychain & data]
+  ;; precon: improper keychain is validated
+  ;; (log/trace "keychain" keychain)
+  ;; (log/trace "data" data)
+  (let [em (first data)
+        kind (clj/name (last keychain))
+        ;; foo (log/trace "kind" kind)
+        parent-keychain (vec (butlast keychain))
+        e (if (nil? parent-keychain)
+            (Entity. kind)
+            (do #_(log/trace "parent-keychain" parent-keychain)
+                #_(log/trace "parent-key" (ekey/keychain-to-key parent-keychain))
+                (Entity. kind  (ekey/keychain-to-key parent-keychain))
+                ))]
+    (when (not (empty? em))
+      (doseq [[k v] (seq em)]
+        (.setProperty e (subs (str k) 1) (get-val-ds v))))
+    (.put (ds/datastore) e)
+    (PersistentEntityMap. e)))
+
+(defn put-proper-emap
+  [keychain & data]
+  ;; precon: keychain has already been validated
+  ;; (log/trace "keychain" keychain)
+  ;; (log/trace "data" data)
+  (let [k (ekey/keychain-to-key keychain)
+        em (first data)
+        e (Entity. k)]
+    (when (not (empty? em))
+      (doseq [[k v] em]
+        (.setProperty e (subs (str k) 1) (get-val-ds v))))
+    (.put (ds/datastore) e)
+    (PersistentEntityMap. e)))
+
 ;; OBSOLETE - use entity-map for consistency with hash-map, array-map, etc
 (defn emap
   "create PersistentEntityMap object"
@@ -66,33 +141,41 @@

 ;; getter
 (defn get-ds
-  [keychain]
+  [keychain & em]
   (log/trace "get-ds " keychain)
-   (if (clj/empty? keychain)
-     (throw (IllegalArgumentException. "keychain vector must not be empty"))
-     (let [k (apply ekey/keychain-to-key keychain)
-           e (.get (ds/datastore) k)]
-       (log/trace "key: " k)
-       (log/trace "e: " e)
-       ;; throw  EntityNotFoundException
-                  ;; (catch EntityNotFoundException e nil)
-                  ;; (catch DatastoreFailureException e (throw e))
-                  ;; (catch java.lang.IllegalArgumentException e (throw e)))]
-       (PersistentEntityMap. e))))
-
-;; co-constructor
+   (cond
+     (ekey/improper-keychain? keychain)
+     (get-kinded-emap keychain)
+     (ekey/proper-keychain? keychain)
+     (get-proper-emap keychain)
+     :else
+     (throw (IllegalArgumentException. (str "Invalid keychain" keychain)))))
+
+   ;; (if (clj/empty? keychain)
+   ;;   (throw (IllegalArgumentException. "keychain vector must not be empty"))
+   ;;   (let [k (ekey/keychain-to-key keychain)
+   ;;         e (.get (ds/datastore) k)]
+   ;;     (log/trace "key: " k)
+   ;;     (log/trace "e: " e)
+   ;;     ;; throw  EntityNotFoundException
+   ;;                ;; (catch EntityNotFoundException e nil)
+   ;;                ;; (catch DatastoreFailureException e (throw e))
+   ;;                ;; (catch java.lang.IllegalArgumentException e (throw e)))]
+   ;;     (PersistentEntityMap. e))))
+
+;; pull constructor
 (defmulti entity-map*
-  "entity-map co-constructor.  Retrieve entities with exact, complete
-  match; if no matches, throw exception."
+  "Pull constructor.  Retrieve entities with exact, complete
+  match."
   ;; FIXME:  implement map matching
   ;; FIXME:  throw notfound exception
     (fn [keychain & valmap]
-      ;; (log/trace "keychain: " keychain)
-      ;; (log/trace "type keychain: " (type keychain))
-      ;; (log/trace "valmap: " valmap)
-      ;; (log/trace "type valmap: " (type valmap))
-      ;; (log/trace "first valmap: " (first valmap))
-      ;; (log/trace "type first valmap: " (type (first valmap)))
+      (log/trace "keychain: " keychain)
+      (log/trace "type keychain: " (type keychain))
+      (log/trace "valmap: " valmap)
+      (log/trace "type valmap: " (type valmap))
+      (log/trace "first valmap: " (first valmap))
+      (log/trace "type first valmap: " (type (first valmap)))
       ;; (flush)
       [(type keychain) (type (first valmap))])) ;; (first valmap) should be the val map
 (defmethod entity-map* [clojure.lang.PersistentVector nil]
@@ -148,42 +231,6 @@
    (into-ds! keychain em))
   ([keychain]
    (into-ds! keychain)))
-
-(defn put-kinded-emap
-  [keychain & data]
-  ;; precon: improper keychain is validated
-  ;; (log/trace "keychain" keychain)
-  ;; (log/trace "data" data)
-  (let [em (first data)
-        kind (clj/name (last keychain))
-        ;; foo (log/trace "kind" kind)
-        parent-keychain (vec (butlast keychain))
-        e (if (nil? parent-keychain)
-            (Entity. kind)
-            (do #_(log/trace "parent-keychain" parent-keychain)
-                #_(log/trace "parent-key" (ekey/keychain-to-key parent-keychain))
-                (Entity. kind  (ekey/keychain-to-key parent-keychain))
-                ))]
-    (when (not (empty? em))
-      (doseq [[k v] (seq em)]
-        (.setProperty e (subs (str k) 1) (get-val-ds v))))
-    (.put (ds/datastore) e)
-    (PersistentEntityMap. e)))
-;;  (throw (IllegalArgumentException. (str "kinded keychain" keychain))))
-
-(defn put-proper-emap
-  [keychain & data]
-  ;; precon: keychain has already been validated
-  ;; (log/trace "keychain" keychain)
-  ;; (log/trace "data" data)
-  (let [k (ekey/keychain-to-key keychain)
-        em (first data)
-        e (Entity. k)]
-    (when (not (empty? em))
-      (doseq [[k v] em]
-        (.setProperty e (subs (str k) 1) (get-val-ds v))))
-    (.put (ds/datastore) e)
-    (PersistentEntityMap. e)))

 (defn into-ds!
 ;; FIXME: convert to [keychain & em]


Fix error.

Fix error.

--- src/cljs/hatnik/web/client/app_state.cljs
+++ src/cljs/hatnik/web/client/app_state.cljs
@@ -34,5 +34,5 @@
   (u/ajax "/api/projects" "GET" nil update-projects-list))

 (defn update-project-actions [action]
-  (update-all-view))
+  (update-all-views))


import button description

import button description

--- src/cljs/salava/extra/hpass/ui/block.cljs
+++ src/cljs/salava/extra/hpass/ui/block.cljs
@@ -202,7 +202,8 @@
   "I have read and i agree to the privacy policy")

 (defn ^:export importbadgetext [lang]
-  [:small {:key "import"} [:i (case lang
-                                "en" "Import badges from other platforms, and add them to your myHPass profile"
-                                "Import badges from other platforms, and add them to your myHPass profile"
-                                )]])
+  [:div.import-button-desc {:key "import"}
+   [:i (case lang
+         "en" "Import badges from other platforms, and add them to your myHPass profile"
+         "Import badges from other platforms, and add them to your myHPass profile"
+         )]])


fix ns ordering

fix ns ordering

--- cimi-resources/src/com/sixsq/slipstream/ssclj/resources/deployment.clj
+++ cimi-resources/src/com/sixsq/slipstream/ssclj/resources/deployment.clj
@@ -2,16 +2,16 @@
   (:require
     [clojure.string :as str]
     [com.sixsq.slipstream.auth.acl :as a]
+    [com.sixsq.slipstream.db.impl :as db]
     [com.sixsq.slipstream.ssclj.resources.common.crud :as crud]
     [com.sixsq.slipstream.ssclj.resources.common.schema :as c]
     [com.sixsq.slipstream.ssclj.resources.common.std-crud :as std-crud]
     [com.sixsq.slipstream.ssclj.resources.common.utils :as u]
     [com.sixsq.slipstream.ssclj.resources.deployment-template :as deployment-template]
+    [com.sixsq.slipstream.ssclj.resources.job :as job]
     [com.sixsq.slipstream.ssclj.resources.spec.deployment :as deployment-spec]
     [com.sixsq.slipstream.ssclj.resources.spec.deployment-template :as deployment-template-spec]
     [com.sixsq.slipstream.util.response :as r]
-    [com.sixsq.slipstream.ssclj.resources.job :as job]
-    [com.sixsq.slipstream.db.impl :as db]
     [taoensso.timbre :as log]))

 (def ^:const resource-tag :deployments)


clicking refactored

clicking refactored

--- src/etaoin/api.clj
+++ src/etaoin/api.clj
@@ -667,7 +667,21 @@

 ;; Blind click

-(defmulti mouse-click dispatch-driver)
+(defmulti mouse-click
+  "
+  Click on a mouse button using the *current* mouse position.
+  The `btn` is a mouse button code. See `keys/mouse-*` constants.
+  "
+  {:arglists '([driver btn])}
+  dispatch-driver)
+
+(defmethod mouse-click
+  :default
+  [driver btn]
+  (let [{driver-type :type} @driver]
+    (throw (ex-info "Mouse click is not supported for that browser"
+                    {:button btn
+                     :driver-type driver-type}))))

 (defmethod mouse-click
   :chrome ;; TODO: try safari once the issue with it is solved
@@ -678,34 +692,54 @@
             :data {:button btn}}))

 (defn left-click
+  "A shortcut for `mouse-click` with the left button."
   [driver]
   (mouse-click driver keys/mouse-left))

 (defn right-click
+  "A shortcut for `mouse-click` with the right button."
   [driver]
   (mouse-click driver keys/mouse-right))

 (defn middle-click
+  "A shortcut for `mouse-click` with the middle button."
   [driver]
   (mouse-click driver keys/mouse-middle))

-(defn mouse-click-at
+(defn mouse-click-on
+  "
+  Mouse click on a specific element and a button.
+  Moves the mouse pointer to the element first.
+  "
   [driver btn q]
   (doto driver
     (mouse-move-to q)
     (mouse-click btn)))

-(defn left-click-at
+(defn left-click-on
+  "
+  Left mouse click on an element. Probably don't need
+  that one, use `click` instead.
+  "
   [driver q]
-  (mouse-click-at driver keys/mouse-left q))
-
-(defn right-click-at
+  (mouse-click-on driver keys/mouse-left q))
+
+(defn right-click-on
+  "
+  Move pointer to an element found with a query
+  and right click on it.
+  "
   [driver q]
-  (mouse-click-at driver keys/mouse-right q))
-
-(defn middle-click-at
+  (mouse-click-on driver keys/mouse-right q))
+
+(defn middle-click-on
+  "
+  Move pointer to an element found with a query
+  and middle click on it. Useful for opening links
+  in a new tab.
+  "
   [driver q]
-  (mouse-click-at driver keys/mouse-middle q))
+  (mouse-click-on driver keys/mouse-middle q))

 ;;


Gem is not plural

Gem is not plural

--- src/fatty/core.clj
+++ src/fatty/core.clj
@@ -52,7 +52,7 @@
                             ["sudo" "make" "install"]]))

 (def chef (software :source "chef"
-            :steps [["/opt/opscode/embedded/bin/gems" "install" "chef" "-n" "/opt/opscode/bin"]]))
+            :steps [["/opt/opscode/embedded/bin/gem" "install" "chef" "-n" "/opt/opscode/bin"]]))

 (defn- log-sh-result
   [status true-log false-log]


Fix conditional and items return value.

Fix conditional and items return value.

--- src/cmr_edsc_stubs/data/fake_response.clj
+++ src/cmr_edsc_stubs/data/fake_response.clj
@@ -182,7 +182,7 @@
     {:updated "2017-10-10T23:19:19.360Z",
      :id "stubbed-data/search/collections.json",
      :title "ECHO dataset metadata",
-     :entry [items]}})
+     :entry items}})

 (defn data->json-payload
   [item-payload-fn data]
@@ -221,9 +221,13 @@
     (handle-prototype-request path-w-extension params headers ""))
   ([path-w-extension params headers query-string]
     (println "path-w-extension:" path-w-extension)
+    (println "params:" params)
     (println "headers:" headers)
-    (case path-w-extension
-      "collections" (get-collections path-w-extension params headers)
-      "variables" (get-umm-json-ges-disc-airx3std-variables params)
-      "services" (get-umm-json-ges-disc-airx3std-services params)
-      (get-umm-json-concept path-w-extension))))
+    (cond
+      (string/starts-with? path-w-extension "collections")
+        (get-collections path-w-extension params headers)
+      (string/starts-with? path-w-extension "variables")
+        (get-umm-json-ges-disc-airx3std-variables params)
+      (string/starts-with? path-w-extension "services")
+        (get-umm-json-ges-disc-airx3std-services params)
+      :else (get-umm-json-concept path-w-extension))))


Add missing labels to connect test traces

--- test/com/wsscode/pathom/connect_test.cljc
+++ test/com/wsscode/pathom/connect_test.cljc
@@ -1057,6 +1057,7 @@
                  :com.wsscode.pathom.core/path          [:a]
                  :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                  :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                 :com.wsscode.pathom.trace/label        a
                  :key                                   :a}
                 {:com.wsscode.pathom.core/path       [:a]
                  :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1092,6 +1093,7 @@
                    :com.wsscode.pathom.core/path          [:a]
                    :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                    :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/schedule-resolver
+                   :com.wsscode.pathom.trace/label        a
                    :key                                   :a}
                   {:com.wsscode.pathom.core/path       [:a]
                    :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1101,6 +1103,7 @@
                    :com.wsscode.pathom.core/path          [:a]
                    :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                    :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                   :com.wsscode.pathom.trace/label        a
                    :key                                   :a}
                   {:com.wsscode.pathom.core/path       [:a]
                    :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1147,6 +1150,7 @@
                  :com.wsscode.pathom.core/path          [:computed-out]
                  :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                  :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                 :com.wsscode.pathom.trace/label        computed-out
                  :key                                   :computed-out}
                 {:com.wsscode.pathom.core/path       [:computed-out]
                  :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1198,6 +1202,7 @@
                      :com.wsscode.pathom.core/path          [:multi-path]
                      :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                      :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                     :com.wsscode.pathom.trace/label        multi-path-blank
                      :key                                   :multi-path}
                     {:com.wsscode.pathom.core/path       [:multi-path]
                      :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1223,6 +1228,7 @@
                      :com.wsscode.pathom.core/path          [:multi-path]
                      :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                      :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                     :com.wsscode.pathom.trace/label        multi-path-value
                      :key                                   :multi-path}
                     {:com.wsscode.pathom.core/path       [:multi-path]
                      :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1298,6 +1304,7 @@
                      :com.wsscode.pathom.core/path          [:multi-path-error]
                      :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                      :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                     :com.wsscode.pathom.trace/label        multi-path-error-error
                      :key                                   :multi-path-error}
                     {:com.wsscode.pathom.core/error      "class clojure.lang.ExceptionInfo: Error 1 - {}"
                      :com.wsscode.pathom.core/path       [:multi-path-error]
@@ -1322,6 +1329,7 @@
                      :com.wsscode.pathom.core/path          [:multi-path-error]
                      :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                      :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                     :com.wsscode.pathom.trace/label        multi-path-error-blank
                      :key                                   :multi-path-error}
                     {:com.wsscode.pathom.core/path       [:multi-path-error]
                      :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1371,6 +1379,7 @@
                      :com.wsscode.pathom.core/path          [:multi-path-error]
                      :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                      :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                     :com.wsscode.pathom.trace/label        multi-path-error-blank
                      :key                                   :multi-path-error}
                     {:com.wsscode.pathom.core/path       [:multi-path-error]
                      :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1394,6 +1403,7 @@
                      :com.wsscode.pathom.core/path          [:multi-path-error]
                      :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                      :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                     :com.wsscode.pathom.trace/label        multi-path-error-error
                      :key                                   :multi-path-error}
                     {:com.wsscode.pathom.core/error      "class clojure.lang.ExceptionInfo: Error 1 - {}"
                      :com.wsscode.pathom.core/path       [:multi-path-error]
@@ -1441,6 +1451,7 @@
                  :com.wsscode.pathom.core/path          [:b]
                  :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                  :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                 :com.wsscode.pathom.trace/label        a
                  :key                                   :b}
                 {:com.wsscode.pathom.core/path       [:b]
                  :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1459,6 +1470,7 @@
                  :com.wsscode.pathom.core/path          [:b]
                  :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                  :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                 :com.wsscode.pathom.trace/label        a->b
                  :key                                   :b}
                 {:com.wsscode.pathom.core/path       [:b]
                  :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1513,6 +1525,7 @@
                    :com.wsscode.pathom.core/path          [:b]
                    :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                    :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                   :com.wsscode.pathom.trace/label        a->b
                    :key                                   :b}
                   {:com.wsscode.pathom.core/path       [:b]
                    :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1548,6 +1561,7 @@
                  :com.wsscode.pathom.core/path          [:b]
                  :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                  :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                 :com.wsscode.pathom.trace/label        a->b
                  :key                                   :b}
                 {:com.wsscode.pathom.core/path       [:b]
                  :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1590,6 +1604,7 @@
                    :com.wsscode.pathom.core/path          [:z3]
                    :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                    :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                   :com.wsscode.pathom.trace/label        no-path-z
                    :key                                   :z3}
                   {:com.wsscode.pathom.core/path       [:z3]
                    :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1649,6 +1664,7 @@
                  :com.wsscode.pathom.core/path          [:b]
                  :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                  :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                 :com.wsscode.pathom.trace/label        a->b
                  :key                                   :b}
                 {:com.wsscode.pathom.core/path       [:b]
                  :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1702,6 +1718,7 @@
                    :com.wsscode.pathom.core/path          [:l]
                    :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                    :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                   :com.wsscode.pathom.trace/label        i->l
                    :key                                   :l}
                   {:com.wsscode.pathom.core/path       [:l]
                    :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1759,6 +1776,7 @@
                    :com.wsscode.pathom.core/path          [:error]
                    :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                    :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                   :com.wsscode.pathom.trace/label        error
                    :key                                   :error}
                   {:com.wsscode.pathom.core/error      "class clojure.lang.ExceptionInfo: Error - {}"
                    :com.wsscode.pathom.core/path       [:error]
@@ -1806,6 +1824,7 @@
                    :com.wsscode.pathom.core/path          [:d]
                    :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                    :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                   :com.wsscode.pathom.trace/label        error
                    :key                                   :d}
                   {:com.wsscode.pathom.core/error      "class clojure.lang.ExceptionInfo: Error - {}"
                    :com.wsscode.pathom.core/path       [:d]
@@ -1854,6 +1873,7 @@
                    :com.wsscode.pathom.core/path          [:error-trail-final]
                    :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                    :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                   :com.wsscode.pathom.trace/label        error-trail-dep
                    :key                                   :error-trail-final}
                   {:com.wsscode.pathom.core/path       [:error-trail-final]
                    :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1906,6 +1926,7 @@
                    :com.wsscode.pathom.core/path          [:invalid]
                    :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                    :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                   :com.wsscode.pathom.trace/label        invalid
                    :key                                   :invalid}
                   {:com.wsscode.pathom.core/path       [:invalid]
                    :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
@@ -1989,6 +2010,7 @@
                                                            :error-batch]
                    :com.wsscode.pathom.trace/direction    :com.wsscode.pathom.trace/enter
                    :com.wsscode.pathom.trace/event        :com.wsscode.pathom.connect/call-resolver
+                   :com.wsscode.pathom.trace/label        error-batch
                    :key                                   :error-batch}
                   {:com.wsscode.pathom.core/error      "class clojure.lang.ExceptionInfo: Error - {}"
                    :com.wsscode.pathom.core/path       [:list


Fix viewbox on external icons collection.

--- frontend/uxbox/library/icons.cljs
+++ frontend/uxbox/library/icons.cljs
@@ -18,12 +18,12 @@

 (def ^:private +external+
   [{:name "Custon icon"
-    :view-box [0 0 50 50]
+    :view-box [0 0 48 48]
     :id (gensym "icon")
     :type :builtin/icon-svg
     :image {:xlink-href "http://s.cdpn.io/3/kiwi.svg"
-            :width 50
-            :height 50}}])
+            :width 48
+            :height 48}}])

 (def +collections+
   [{:name "Material design (actions)"


Fix url

Fix url

--- src/obb_api/service.clj
+++ src/obb_api/service.clj
@@ -54,7 +54,7 @@
               ;; "http://localhost:8080"
               ;;
               ::bootstrap/allowed-origins ["http://orionsbelt.eu"
-                                           "http://orionsbelt-battlegrounds.github.io/"
+                                           "http://orionsbelt-battlegrounds.github.io"
                                            "http://localhost"]

               ;; Root for resource interceptor that is available by default.


Namespace checkpoints to avoid task-id collisions for namespaced tasks.

--- src/onyx/storage/s3.clj
+++ src/onyx/storage/s3.clj
@@ -141,8 +141,12 @@
   ;; We need to prefix the checkpoint key in a random way to partition keys for
   ;; maximum write performance.
   (let [prefix-hash (mod (hash [tenancy-id job-id replica-version epoch task-id slot-id]) 100000)]
-    (str prefix-hash "_" tenancy-id "/" job-id "/" replica-version "-" epoch "/" (name task-id)
-         "/" slot-id "/" (name checkpoint-type))))
+    (str prefix-hash "_" tenancy-id "/"
+         job-id "/"
+         replica-version "-" epoch "/"
+         (namespace task-id) "-" (name task-id)
+         "/" slot-id "/"
+         (name checkpoint-type))))

 (defmethod checkpoint/write-checkpoint onyx.storage.s3.CheckpointManager
   [{:keys [transfer-manager transfers bucket] :as storage} tenancy-id job-id replica-version epoch


Make unit test single threaded so that running all tests locally can be stable.

--- common-lib/src/cmr/common/test/runners/default.clj
+++ common-lib/src/cmr/common/test/runners/default.clj
@@ -125,7 +125,7 @@
                                          (integration-test-namespaces))

         test-results-handler (fail-fast?->test-results-handler fail-fast?)
-        unittest-results (run-tests unit-test-namespaces true)
+        unittest-results (run-tests unit-test-namespaces false)
         inttest-results (run-tests integration-test-namespaces false)
         [took test-results] (u/time-execution
                               (test-results-handler


Before solving 5.4, auxiliary functions fold-right and exists translated

--- src/fpinscala/strictness_and_laziness.clj
+++ src/fpinscala/strictness_and_laziness.clj
@@ -78,4 +78,16 @@
   (let [value (first s)]
     (when (f value)
       (stream-cons value (my-take-while-fpins f (rest s))))))
-;-----------------------------------------------------------------------+;-----------------------------------------------------------------------
+
+;auxiliary - direct translation from book
+(defn fold-right [z f s]
+  (if-let [[h & t] s]
+    (f h (fold-right z f t))
+    z))
+
+;example - exists via f-r - also direct translation from book
+(defn exists
+  "Function exists via fold-right from fpins"
+  [p s]
+  (fold-right false #(or (p %) %2) s))


Some code for repulsive force

Some code for repulsive force

not finished yet.

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

--- src/conexp/layout/force.clj
+++ src/conexp/layout/force.clj
@@ -70,16 +70,28 @@
 		    node-connections)]
      (sum [[v pos-v] node-positions,
 	   [x y pos-x pos-y] edges
-	   :when (not (#{x, y} v))]
-	 (/ 1.0
-	    (double (node-line-distance pos-v [pos-x, pos-y])))))
+	   :when (not (contains? #{x, y} v))]
+       (/ 1.0
+	  (double (node-line-distance pos-v [pos-x, pos-y])))))
    (catch Exception e
      Double/POSITIVE_INFINITY)))

+(defn- node-line-distance-derivative
+  "Computes partial derivative of node-line-distance between w and
+  [x y] after n_i, given part only."
+  [w [x y] n_i part]
+  (throw (UnsupportedOperationException. (str "Not yet implemented."))))
+
 (defn- repulsive-force
-  ""
-  [layout n_i part information]
-  (throw (UnsupportedOperationException. "Not yet implemented.")))
+  "Computes given part of repulsive force in layout on the
+  inf-irreducible element n_i."
+  [[node-positions node-connections] n_i part information]
+  (sum [v (keys node-positions),
+	[x y] node-connections,
+	:when (not (contains? #{x,y} v))]
+    (* (/ (square (node-line-distance (node-positions v)
+				      [(node-positions x), (node-positions y)])))
+       (node-line-distance-derivative v [x y] n_i part))))

 ;; Attractive Energy and Force

@@ -105,7 +117,7 @@
 ;; Gravitative Energy and Force

 (defn- phi
-  "Returns the angle between a inf-irreducible node [x_1,y_1]
+  "Returns the angle between an inf-irreducible node [x_1,y_1]
   and its upper neighbor [x_2, y_2]."
   [[x_1,y_1] [x_2,y_2]]
   (with-doubles [x_1, y_1, x_2, y_2]
@@ -123,22 +135,22 @@
 	E_1   (double (+ E_0 Math/PI))]
     (try
      (sum [n inf-irrs]
-	  (let [phi_n (double (phi (node-positions n)
-				   (node-positions (upper-neighbours n))))]
-	    (cond
-	     (<= 0 phi_n phi_0)
-	     (+ phi_n
-		(/ (square (Math/sin phi_0))
-		   (Math/tan phi_n))
-		E_0),
-
-	     (<= (- Math/PI phi_0) phi_n Math/PI)
-	     (+ (- phi_n)
-		(/ (- (square (Math/sin phi_0)))
-		   (Math/tan phi_n))
-		E_1),
-
-	     :else 0)))
+       (let [phi_n (double (phi (node-positions n)
+				(node-positions (upper-neighbours n))))]
+	 (cond
+	  (<= 0 phi_n phi_0)
+	  (+ phi_n
+	     (/ (square (Math/sin phi_0))
+		(Math/tan phi_n))
+	     E_0),
+
+	  (<= (- Math/PI phi_0) phi_n Math/PI)
+	  (+ (- phi_n)
+	     (/ (- (square (Math/sin phi_0)))
+		(Math/tan phi_n))
+	     E_1),
+
+	  :else 0)))
      (catch Exception e
        Double/POSITIVE_INFINITY))))

@@ -184,7 +196,7 @@
       (* *gravitative-amount* (gravitative-energy layout information)))))

 (defn- layout-force
-  "Computes overall force _component_ of index n in the inf-irreducible elements."
+  "Computes overall force component of index n in the inf-irreducible elements."
   [layout inf-irrs n information]
   (let [part (mod n 2),
 	n_i (nth inf-irrs (div n 2))]


Fixed issue #28

Fixed issue #28

--- src/alfresco_technical_validation/source_indexes.clj
+++ src/alfresco_technical_validation/source_indexes.clj
@@ -64,7 +64,7 @@
         :sec03          #"<authentication>\s*none\s*</authentication>"
       }
     :spring-app-context {
-        :api05          #"(?:^|\s)ref="
+        :api05          #"(?:^|\s)ref=\s*\"(?!ServiceRegistry)"
       }
     :content-model {
         :perf02         #"<index\s+enabled\s*=\s*\"true"


Add healthcheck api.

Add healthcheck api.

--- src/clj/job_streamer/notificator/component/camel.clj
+++ src/clj/job_streamer/notificator/component/camel.clj
@@ -58,6 +58,8 @@
                      (process-template config template)
                      (.recipientList (Builder/simple (:uri config))))))
              (-> route
+                 (.when (. (Builder/header "type") (isEqualTo "healthcheck"))))
+             (-> route
                  (.otherwise)
                  (.to "log:ROUTE_NOT_FOUND?showAll=true")))
            (doseq [[type config] consumer-rules]


set user connections hyperlink go to profile page

--- src/cljs/salava/extra/socialuser/ui/connections.cljs
+++ src/cljs/salava/extra/socialuser/ui/connections.cljs
@@ -38,7 +38,7 @@
           [:table {:class "table" :summary (t :badge/Badgeviews)}
            [:thead
             [:tr
-             [:th (t :badge/Name)]
+             [:th ""]
              [:th (t :badge/Name)]
              [:th ""]]]
            (into [:tbody]
@@ -47,7 +47,7 @@
                    [:tr
                     [:td [:img.badge-icon {:src (profile-picture profile_picture)
                                            :alt name}]]
-                    [:td.name [:a {:href     "#"
+                    [:td.name [:a {:href     (path-for (str "/user/profile/" user_id))
                                    :on-click #(do
                                         ;(b/open-modal id false init-data state)
                                                 (.preventDefault %)) } (str first_name " " last_name)]]


Added documentation.

Added documentation.

--- src/midje/repl.clj
+++ src/midje/repl.clj
@@ -461,6 +461,20 @@

     (autotest :all)

+  You can filter the facts checked by giving more arguments following
+  a `:filter` or `:filters` keyword:
+
+    (autotest :filter :integration)
+
+  Facts matching any of the arguments are the ones that are
+  checked. The arguments can be of these types:
+
+  :keyword      -- Does the metadata have a truthy value for the keyword?
+  \"string\"    -- Does the fact's name contain the given string?
+  #\"regex\"    -- Does any part of the fact's name match the regex?
+  a function    -- Does the function return a truthy value when given
+                   the fact's metadata?
+
   `autotest` can take special keyword arguments:

      (autotest :stop)   ; stop checking