Fix start parameter check to apply the direction filter.

--- src/oc/storage/db/common.clj
+++ src/oc/storage/db/common.clj
@@ -2,7 +2,7 @@
   "CRUD function to retrieve entries from RethinkDB with pagination."
   (:require [clj-time.core :as t]
             [rethinkdb.query :as r]
-            [clojure.set :as clj-set]
+            [cuerdas.core :as string]
             [oc.lib.schema :as lib-schema]
             [oc.storage.config :as config]
             [oc.lib.time :as lib-time]
@@ -59,7 +59,7 @@
       (as-> (r/table table-name) query
         (r/get-all query index-value {:index index-name})
            ;; Filter out:
-        (if start
+        (if-not (string/blank? start)
           (r/filter query (r/fn [row]
             ;; All records after/before the start
             (direction-filter direction start (r/get-field row :published-at))))
@@ -115,7 +115,7 @@
                            (r/get-field :bookmarked-at)
                            (r/default nil))}))
         ;; Filter out:
-        (if start
+        (if-not (string/blank? start)
           (r/filter query (r/fn [row]
             ;; All records after/before the start
             (direction-filter direction start (r/get-field row :sort-value))))
@@ -227,7 +227,7 @@
       (as-> (r/table table-name) query
         (r/get-all query index-value {:index index-name})
         ;; Filter out:
-        (if start
+        (if-not (string/blank? start)
           (r/filter query (r/fn [row]
             (direction-filter direction start (r/get-field row :published-at))))
           query)


format comments

format comments

--- src/overtone/gui/control.clj
+++ src/overtone/gui/control.clj
@@ -20,7 +20,7 @@
 (defn- control-slider
   [name min-val max-val step val-atom]
   (let [init-val   @val-atom
-                                        ;_ (println (str name) ": " init-val min-val max-val step)
+;;_ (println (str name) ": " init-val min-val max-val step)
         spin-model  (spinner-model (double init-val)
                                    :from (double min-val)
                                    :to (double max-val)
@@ -40,7 +40,7 @@
                 [spinner "width 80:80:80"]
                 [slider "wrap"]]]

-                                        ; return 2 element vector of items and cleanup function. hmmm.
+;; return 2 element vector of items and cleanup function. hmmm.
     [items
      (juxt
       (bind/bind
@@ -48,16 +48,16 @@
        (bind/transform (partial scale-val [0 slider-max] [min-val max-val]))
        val-atom
        (bind/transform (partial scale-val [min-val max-val] [0 slider-max]))
-                                        ; if the value's "close enough" to the spinner, stop. Otherwise,
-                                        ; we get infinite loops caused by rounding error.
+;; if the value's "close enough" to the spinner, stop. Otherwise,
+;; we get infinite loops caused by rounding error.
        (bind/filter #(>= (Math/abs (- % (value slider))) 0.01))
        slider)

       (bind/bind
        spinner
        val-atom
-                                        ; if the value's "close enough" to the slider, stop. Otherwise,
-                                        ; we get infinite loops caused by rounding error.
+;; if the value's "close enough" to the slider, stop. Otherwise,
+;; we get infinite loops caused by rounding error.
        (bind/filter #(>= (Math/abs (- % (value spinner))) 0.01))
        spinner))]))

@@ -111,9 +111,9 @@
                                             :border 5
                                             :items (map :panel panels)))
                       :on-close :dispose)]
-                                        ; When the window is closed, unhook everything from the synth
-                                        ; so the ui can be garbage collected, etc.
-     (listen frame :window-closed (fn [_] (cleanup)))
+;; When the window is closed, unhook everything from the synth
+;; so the ui can be garbage collected, etc.
+
      (-> frame pack! show!))))

 (defn live-synth-controller


First working teleop

First working teleop

--- ros/angelic_planning/src/ros/robot.clj
+++ ros/angelic_planning/src/ros/robot.clj
@@ -154,6 +154,21 @@
 	 (while (not @a) (.spinOnce nh))
 	 @a))))

+(let [mem (atom {})]
+  (def get-current-base-odom
+     (fn [#^NodeHandle nh]
+       (let [a
+	     (or (@mem nh)
+		 (let [a (atom nil)]
+		   (.subscribe nh "/robot_pose_ekf/odom_combined"
+			       (PoseWithCovariance.)
+			       (sub-cb [m] (reset! a m)) 1)
+		   (swap! mem assoc nh a)
+		   a))]
+	 (.spinOnce nh)
+	 (while (not @a) (.spinOnce nh))
+	 @a))))
+
 (defn get-current-base-state [#^NodeHandle nh]
   (pose-stamped->base-state (get-current-base-pose nh)))

@@ -183,35 +198,25 @@
 (defn move-base-unsafe
   "Custom interface for moving base directly, without move_base."
   [#^NodeHandle nh command-fn goal-fn]
-  (let [current-pose (atom nil)
-	pub (.advertise nh "/cmd_vel" (PoseDot.) 1)
-	sub (.subscribe nh "/base_pose_ground_truth" (PoseWithRatesStamped.)
-			(sub-cb [m] (reset! current-pose (:pose (:pose_with_rates m)))) 1)]
-    (print "Waiting for pose...")
-    (while (not @current-pose)
-      (print ".")
-      (.spinOnce nh)
-      (Thread/sleep 10))
-    (let [init-pose @current-pose
+  (let [pub (.advertise nh "/cmd_vel" (PoseDot.) 1)]
+    (let [init-pose (:pose (get-current-base-odom nh))
 	  init-pos (:position init-pose)
 	  zero     {:vx 0 :vy 0 :vz 0}]
       (loop []
-	(when (not (goal-fn init-pose @current-pose))
+	(let [current-pose (:pose (get-current-base-odom nh))]
+  	 (when (not (goal-fn init-pose current-pose))
 	  (.publish pub (map-msg PoseDot (update-in
 					  (update-in
-					   (command-fn init-pose @current-pose)
+					   (command-fn init-pose current-pose)
 					   [:vel] #(merge zero %))
 					   [:ang_vel] #(merge zero %))))
 	  (Thread/sleep 100)
-	  (.spinOnce nh)
-	  (recur)))
+	  (recur))))
       (.publish pub (map-msg PoseDot {:vel zero :ang_vel zero}))
-      (println "Stopping: traveled" (point-distance init-pos (:position @current-pose)))
-      (Thread/sleep 4000)
-      (.spinOnce nh)
-      (println "Stopping: traveled" (point-distance init-pos (:position @current-pose))))
-
-    (.shutdown sub)
+      (println "Stopping: traveled" (point-distance init-pos (:position (:pose (get-current-base-odom nh)))))
+;      (Thread/sleep 4000)
+;      (println "Stopping: traveled" (point-distance init-pos (:position (:pose (get-current-base-odom nh))))))
+      )
     (.shutdown pub)))

@@ -225,7 +230,8 @@
    (move-base-unsafe nh
     (fn [init-pose current-pose]
       (let [dist (- distance (point-distance (:position init-pose) (:position current-pose)))]
-	{:vel {coord (* dir (if (> dist 0.1) 0.5 (* dist 3)))}}))
+	(println "commanding" (* dir (if (> dist 0.1) 0.2 (* dist 3))))
+	{:vel {coord (* dir (if (> dist 0.1) 0.2 (* dist 3)))}}))
     (fn [init-pose current-pose]
       (let [dist (- distance (point-distance (:position init-pose) (:position current-pose)))]
 	(< (Math/abs (double dist)) 0.005))))))
@@ -249,6 +255,9 @@
 	(recur)))
     (.shutdown pub)))

+;; TODO: fix to use pose info
+;; TODO: fix normalization
+;(spin-base-to nh (- (* 1.5 (Math/PI)) 0.15))
 (defn spin-base-to
   "Spins base to a desired angle, with no collision checking."
   [#^NodeHandle nh angle]
@@ -256,11 +265,11 @@
     (fn [init-pose current-pose]
       (let [ac (quaternion->angle (:orientation current-pose))
 	    norm-diff (double (norm-angle (- angle ac)))]
-	{:ang_vel {:vz (if (> (Math/abs norm-diff) 0.1) 0.5 (* norm-diff 3))}}))
+	{:ang_vel {:vz (if (> (Math/abs norm-diff) 0.1) 0.5 (* norm-diff 4))}}))
     (fn [init-pose current-pose]
       (let [ac (quaternion->angle (:orientation current-pose))
 	    norm-diff (double (norm-angle (- angle ac)))]
-	(< (Math/abs norm-diff) 0.005)))))
+	(< (Math/abs norm-diff) 0.05)))))

 (defn base-state->disc [state res minc maxc]
@@ -375,13 +384,15 @@
      (apply-gripper-force nh (isa? (:class gs) ::Right) (* (:force gs) (if (:open? gs) 1 -1)))))

-
-
-
-
-
-
-
+; Bottles - 45 (everything)
+
+
+(comment
+(defn open [] (move-gripper-to-state nh (make-robot-gripper-state nh true)))
+(defn close [] (move-gripper-to-state nh (make-robot-gripper-state nh false 0.45 nil)))
+(defn fw [x] (move-base-rel nh :vx x))
+(defn r  [x] (move-base-rel nh :vy x))
+)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Arms ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -771,6 +782,7 @@

 (def *shared-arm-params*
      {:class KinematicSpaceParameters
+      :contacts nil
       :distance_metric "L2Square" :planner_id      "" :contacts nil
       :volumeMin       {:header *map-header* :point {:x 0 :y 0 :z 0}}
       :volumeMax       {:header *map-header* :point {:x 0 :y 0 :z 0}}})
@@ -888,6 +900,7 @@
   [#^NodeHandle nh arm-state]
   (run-action nh (str "/move_" (if (isa? (:class arm-state) ::Right) "right" "left") "_arm")
     (map-msg {:class MoveArmGoal
+	      :contacts nil
 	      :path_constraints *no-constraints*
 	      :goal_constraints {:pose_constraint  []
 				 :joint_constraint (vec (map parse-joint-constraint


Make events flow for timeline and list view to change each other positions while scroll

--- src/teach_by_friends/shared/scenes/chapters_scene.cljs
+++ src/teach_by_friends/shared/scenes/chapters_scene.cljs
@@ -109,13 +109,16 @@
                              :on-press #(dispatch [:add-to-well-known term])}
        [ui/text {:style {:color "white"}} "I remember this"]]])])

+(def TERM_ROW_HEIGHT 60)
+
 (defn term-row [term-raw activity-indicator]
   (if (= (:status term-raw) const/ACTIVE_TERM)
     [detailed-term-row term-raw activity-indicator]
-    [ui/touchable-opacity {:style    {:border-bottom-width 1
+    [ui/touchable-opacity {:style    {:height              TERM_ROW_HEIGHT
+                                      :border-bottom-width 1
                                       :border-color        "rgba(0,0,0,.1)"
-                                      :padding-top         20
-                                      :padding-bottom      20
+                                      :flex-direction      "column"
+                                      :justify-content     "center"
                                       :padding-left        30}
                            :on-press #(dispatch [:translate-term (:term term-raw)])}
      [ui/text {:style {:font-size 20 :color "rgb(72, 86, 155)"}} (:term term-raw)]]))
@@ -134,11 +137,11 @@
                         :font-size 30}}
        (string/upper-case
          (str "season " @title))]
-      [ui/view {:style {:position "absolute"
-                        :top 0
-                        :left 5
-                        :right 5
-                        :bottom 0
+      [ui/view {:style {:position    "absolute"
+                        :top         0
+                        :left        5
+                        :right       5
+                        :bottom      0
                         :flex        5
                         :align-items "stretch"}}
        [ui/view {:style {:border-radius    15
@@ -161,47 +164,82 @@
 ;         [seasons-bar @chapters
 ;          #(dispatch [:chapter-load %1 %2])])

+(defn update-positions [tPosition get-words-list fullHeight visibleHeight lock event _]
+  (swap! lock (fn [_] true))
+  (let [words-list (get-words-list)
+        timeline-y (aget event "nativeEvent" "pageY")
+        y-ratio (/ timeline-y @visibleHeight)
+        words-list-y-temp (* @fullHeight y-ratio)
+        words-list-y (if (> words-list-y-temp (- @fullHeight @visibleHeight))
+                       (- @fullHeight @visibleHeight)
+                       words-list-y-temp)]
+    (ui/animated-set-value tPosition timeline-y)
+    (.scrollTo words-list (clj->js {:y words-list-y :animated false}))))
+
+(defn update-timeline-position [tPosition fullHeight visibleHeight lock event]
+  (when (false? @lock)
+    (let [words-list-y (aget event "nativeEvent" "contentOffset" "y")
+          y-ratio (/ words-list-y @fullHeight)
+          timeline-y (* @visibleHeight y-ratio)]
+      (print words-list-y timeline-y)
+      (ui/animated-set-value tPosition timeline-y))))
+
 (defn chapters-content [activity-indicator]
   (let [chapters (subscribe [:chapters])
         chapter (reaction (take 100 @(subscribe [:get-chapter])))
-        tPosition (ui/animated-value 100.0)
+        tPosition (ui/animated-value 0.0)
+        wordsListHeight (reaction (* (count @chapter) TERM_ROW_HEIGHT))
+        visibleHeight (atom 0)
+        _this (atom nil)
+        timeline-pan-lock (atom false)
         pan-responder (ui/create-pan-responder {:onStartShouldSetPanResponder        (fn [_ _] true)
                                                 :onStartShouldSetPanResponderCapture (fn [_ _] true)
                                                 :onMoveShouldSetPanResponder         (fn [_ _] true)
                                                 :onMoveShouldSetPanResponderCapture  (fn [_ _] true)
-                                                :onPanResponderGrant                 (fn [event _]
-                                                                                (ui/animated-set-value tPosition (aget event "nativeEvent" "pageY")))
-                                                :onPanResponderMove                  (fn [event _]
-                                                                                (ui/animated-set-value tPosition (aget event "nativeEvent" "pageY")))})]
-    (fn chapters-content-comp []
-      (print (count @chapter))
-      [ui/view {:style {:position       "absolute"
-                        :left           0
-                        :right          0
-                        :top            0
-                        :bottom         0
-                        :flex           1
-                        :flex-direction "column"
-                        :align-items    "stretch"}}
-       (if (not (empty? @chapter))
-         [ui/view {:style {:flex             12
-                           :background-color "white"
-                           :flex-direction "row"}}
-          [timeline (-> {:tPosition          tPosition
-                         :countWordsOnScreen 11
-                         :timestamps         (clj->js @chapter)
-                         :style              {:flex 1}}
-                        (merge (ui/get-pan-handlers pan-responder)))]
-          [ui/list-view {:dataSource            (.cloneWithRows chapter-ds (clj->js @chapter))
-                         :enable-empty-sections true
-                         :render-row            #(r/as-element [term-row (js->clj % :keywordize-keys true) activity-indicator])
-                         :style                 {:flex             5
-                                                 :background-color "white"}}]]
-         [ui/view {:style {:flex             (if (nil? @chapters) 13 12)
-                           :background-color "white"
-                           :justify-content  "center"
-                           :align-items      "center"}}
-          [activity-indicator {:color "rgb(72, 86, 155)"}]])])))
+                                                :onPanResponderTerminationRequest    (fn [_ _] true)
+                                                :onPanResponderGrant                 (partial update-positions tPosition #(.. @_this -refs -wordsList) wordsListHeight visibleHeight timeline-pan-lock)
+                                                :onPanResponderMove                  (partial update-positions tPosition #(.. @_this -refs -wordsList) wordsListHeight visibleHeight timeline-pan-lock)
+                                                :onPanResponderTerminate             (fn [_ _] (swap! timeline-pan-lock (fn [_] false)))
+                                                :onPanResponderRelease               (fn [_ _] (swap! timeline-pan-lock (fn [_] false)))})]
+    (r/create-class
+      {:render
+       (fn chapters-content-comp [this]
+         (if (nil? @_this)
+           (swap! _this #(identity this)))
+         [ui/view {:style {:position       "absolute"
+                           :left           0
+                           :right          0
+                           :top            0
+                           :bottom         0
+                           :flex           1
+                           :flex-direction "column"
+                           :align-items    "stretch"}}
+          (if (not (empty? @chapter))
+            [ui/view {:style {:flex             12
+                              :background-color "white"
+                              :flex-direction   "row"}}
+             [timeline (-> {:tPosition          tPosition
+                            :countWordsOnScreen 11
+                            :timestamps         (clj->js @chapter)
+                            :style              {:flex 1}}
+                           (merge (ui/get-pan-handlers pan-responder)))]
+             [ui/list-view {:ref                          "wordsList"
+                            :on-layout                    (fn []
+                                                            (swap! visibleHeight (fn [_] (.. @_this -refs -wordsList -scrollProperties -visibleLength))))
+                            :on-scroll                    (partial update-timeline-position tPosition wordsListHeight visibleHeight timeline-pan-lock)
+                            :scrollEventThrottle          16
+                            :showsVerticalScrollIndicator false
+                            :dataSource                   (.cloneWithRows chapter-ds (clj->js @chapter))
+                            :enable-empty-sections        true
+                            :render-row                   #(r/as-element [term-row (js->clj % :keywordize-keys true) activity-indicator])
+                            :style                        {:flex             5
+                                                           :background-color "white"}}]]
+            [ui/view {:style {:flex             (if (nil? @chapters) 13 12)
+                              :background-color "white"
+                              :justify-content  "center"
+                              :align-items      "center"}}
+             [activity-indicator {:color "rgb(72, 86, 155)"}]])])})))
+

 (defn get-chapters-scene [activity-indicator]
   (fn chapters-scene []


Rename function again

Rename function again

--- src/play_clj/core_global.clj
+++ src/play_clj/core_global.clj
@@ -34,14 +34,14 @@
     :y (.getY ^Input (Gdx/input))
     nil))

-(defmacro keycode
+(defmacro key-code
   [key]
   `~(symbol
       (str utils/gdx-package ".Input$Keys/" (utils/key->static-field key))))

 (defmacro is-pressed?
   [key]
-  `(.isKeyPressed ^Input (Gdx/input) (keycode ~key)))
+  `(.isKeyPressed ^Input (Gdx/input) (key-code ~key)))

 (defn- input-processor
   [{:keys [on-key-down on-key-typed on-key-up on-mouse-moved


Gen test for key exclusion in a post transformation.

--- test/onyx/flow_conditions/flow_conditions_gen_test.clj
+++ test/onyx/flow_conditions/flow_conditions_gen_test.clj
@@ -358,7 +358,7 @@
 (deftest post-transformation-invocation
   (checking
    "Post-transformations are invoked when they are matched"
-   (times 20)
+   (times 30)
    [fcs
     (gen/not-empty
      (gen/vector (->> :a
@@ -374,5 +374,24 @@
          compiled-ex (c/compile-fc-exs fcs :a)
          event {:onyx.core/compiled-norm-fcs compiled-hp
                 :onyx.core/compiled-ex-fcs compiled-ex}
-         routes (r/route-data event nil message fcs downstream)]
-     (is (= post-transformed-segment (r/flow-conditions-transform message routes fcs event))))))
+         routes (r/route-data event nil message fcs downstream)
+         transformed (reduce dissoc post-transformed-segment (:exclusions routes))]
+     (is (= transformed (r/flow-conditions-transform message routes fcs event))))))
+
+(deftest post-transformation-exclusions
+  (checking
+   "Key exclusions are applied during post transformation"
+   (times 30)
+   [fcs
+    (gen/vector (->> :a
+                     (flow-condition-gen)
+                     (flow-to-tasks-gen)
+                     (maybe-predicate)))]
+   (let [segment (zipmap (mapcat :flow/exclude-keys fcs) (repeat 0))
+         downstream (mapcat :flow/to fcs)
+         compiled-hp (c/compile-fc-norms fcs :a)
+         event {:onyx.core/compiled-norm-fcs compiled-hp}
+         routes (r/route-data event nil segment fcs downstream)
+         exclusions (mapcat :flow/exclude-keys (filter :pred/val fcs))
+         filtered-segment (reduce dissoc segment exclusions)]
+     (is (= filtered-segment (r/flow-conditions-transform segment routes fcs event))))))


figwheel.main: fix case where figwheel.main/start config options aren't seen

--- figwheel-main/src/figwheel/main.cljc
+++ figwheel-main/src/figwheel/main.cljc
@@ -727,27 +727,27 @@
       handler (assoc :ring-handler handler))))

 (defn process-figwheel-main-edn [main-edn]
-  (when-not (false? (:validate-config main-edn))
-    (log/info "Validating figwheel-main.edn")
-    (validate-config!
-     :figwheel.main.schema.config/edn
-     main-edn "Configuration error in figwheel-main.edn"
-                      "figwheel-main.edn is valid!"))
-  (process-main-config main-edn))
+  (when main-edn
+    (when-not (false? (:validate-config main-edn))
+      (log/info "Validating figwheel-main.edn")
+      (validate-config!
+       :figwheel.main.schema.config/edn
+       main-edn "Configuration error in figwheel-main.edn"
+       "figwheel-main.edn is valid!"))
+    (process-main-config main-edn)))

 ;; use tools reader read-string for better error messages
 #_(redn/read-string)
 (defn fetch-figwheel-main-edn [cfg]
-  (read-edn-file "figwheel-main.edn"))
+  (when (.isFile (io/file "figwheel-main.edn"))
+    (read-edn-file "figwheel-main.edn")))

 (defn- config-figwheel-main-edn [cfg]
-  (if-not (.isFile (io/file "figwheel-main.edn"))
-    cfg
-    (let [config-edn (process-figwheel-main-edn
-                      (or (::start-figwheel-options cfg)
-                          (fetch-figwheel-main-edn cfg)))]
-      (-> cfg
-          (update ::config #(merge config-edn %))))))
+  (let [config-edn (process-figwheel-main-edn
+                    (or (::start-figwheel-options cfg)
+                        (fetch-figwheel-main-edn cfg)))]
+    (cond-> cfg
+      config-edn (update ::config #(merge config-edn %)))))

 (defn- config-merge-current-build-conf [{:keys [::extra-config ::build] :as cfg}]
   (update cfg
@@ -1495,7 +1495,6 @@
            (assoc ::background-builds (mapv
                                        start-build-arg->build-options
                                        background-builds)))]
-     cfg
      (default-compile cljs.repl.figwheel/repl-env cfg))))

 (defn start


add neighborhood, degree and lifetime

add neighborhood, degree and lifetime

--- src/clj/ceres_analytics/measures.clj
+++ src/clj/ceres_analytics/measures.clj
@@ -3,19 +3,23 @@
   (:require [ceres-analytics.db :refer [db]]
             [monger.collection :as mc]
             [monger.joda-time]
+            [clj-time.core :as t]
             [monger.operators :refer :all]
             [monger.query :refer :all]))

+(def contacts ["shares" "replies" "retweets" "tagrefs" "pubs"])
+(def cascades ["shares" "replies" "retweets"])
+(def nodes ["users" "messages" "tags"])

 (defn dispatch-entity [entity]
   (case entity
-    :nodes ["users" "messages" "tags"]
+    :nodes nodes
     :users "users"
     :messages "messages"
     :topics "tags"
-    :contacts ["shares" "replies" "retweets" "tagrefs" "pubs"]
+    :contacts contacts
     :publications "pubs"
-    :cascades ["shares" "replies" "retweets"]
+    :cascades cascades
     :assignments "tagrefs"
     :unrelated))

@@ -26,5 +30,33 @@
   [entity t1 t2]
   (let [colls (dispatch-entity entity)]
     (if (vector? colls)
-      (reduce + (map #(mc/count @db %) colls))
-      (mc/count @db colls))))
+      (zipmap colls
+              (map #(mc/find-maps @db % {:ts {$gt t1
+                                              $lt t2}}) colls))
+      {colls
+       (mc/find-maps @db colls {:ts {$gt t1
+                                     $lt t2}})})))
+
+
+(defn neighborhood
+  "Compute neighborhood of given node id"
+  [id t0]
+  (zipmap
+   contacts
+   (map #(mc/find-maps @db % {$or [{:ts {$lt t0}
+                                    :source id}
+                                   {:ts {$lt t0}
+                                    :target id}]}) contacts)))
+
+
+(defn degree
+  "Compute degree of given node id"
+  [id t0]
+  (->> (neighborhood id t0) vals (apply concat) count))
+
+
+(defn lifetime
+  "Computes lifetime of contact set"
+  [cs]
+  (let [sorted-cs (sort-by :ts cs)]
+    (t/in-seconds (t/interval (last cs) (first cs)))))


Fix user permission bug

Fix user permission bug

--- src/cljs/salava/user/ui/profile.cljs
+++ src/cljs/salava/user/ui/profile.cljs
@@ -172,22 +172,22 @@
      {:handler (fn [data]
                  (reset! state (assoc data :user-id user-id
                                       :show-link-or-embed-code nil
-                                      :permission true
+                                      :permission "success"
                                       :reporttool reporttool-init)))}
-     (fn [] (swap! state assoc :permission false)))))
+     (fn [] (swap! state assoc :permission "error")))))

 (defn handler [site-navi params]
   (let [user-id (:user-id params)
         state (atom {:user-id user-id
-                     :permission nil
+                     :permission "initial"
                      :reporttool {}})
         user (session/get :user)]
     (init-data user-id state)
     (fn []
-      (layout/default site-navi [:div])
       (cond
-        (and user (not (:permission @state))) (layout/default-no-sidebar site-navi (err/error-content))
-        (not (:permission @state)) (layout/landing-page site-navi (err/error-content))
+        (= "initial" (:permission @state)) (layout/default site-navi [:div])
+        (and user (= "error" (:permission @state)))(layout/default-no-sidebar site-navi (err/error-content))
+        (= "error" (:permission @state)) (layout/landing-page site-navi (err/error-content))
         (= (:id user) (js/parseInt user-id)) (layout/default site-navi (content state))
-        user (layout/default-no-sidebar site-navi (content state))
+        (and (= "success" (:permission @state)) user) (layout/default-no-sidebar site-navi (content state))
         :else (layout/landing-page site-navi (content state))))))


return message strings instead of, potentially huge, values

--- src/com/billpiel/mem_tracer/core.clj
+++ src/com/billpiel/mem_tracer/core.clj
@@ -121,9 +121,11 @@
 (defn rec-save-as!
   "Saves active recording to the recording shelf namespace in the specified `slot`."
   [slot]
-  (#'rec/save-as! recording
-                 (:rec-ns @config)
-                 slot))
+  (->>  (#'rec/save-as! recording
+                        (:rec-ns @config)
+                        slot)
+        ((juxt :id :rec-slot))
+        (apply format "Saved recording with id '%s' to slot '%s'.")))

 (defn rec-load!
   "Loads a recording from the shelf namespace into the active
@@ -138,10 +140,12 @@
 (defn rec-load-from!
   "Loads a recording from the provided source. Source may be a workspace"
   [src & [force]]
-  (#'rec/coerce&load! recording
-                      src
-                      (:rec-ns @config)
-                      force))
+  (->> (#'rec/coerce&load! recording
+                           src
+                           (:rec-ns @config)
+                           force)
+       ((juxt :id :rec-slot))
+       (apply format "Loaded recording with id '%s', slot '%s' to active position.")))

 (defn rec-load-from-ws!
   [& [force]]


Normalized namespaces

Normalized namespaces

--- src/test/clojure/envtest.clj
+++ src/test/clojure/envtest.clj
@@ -1 +1 @@
-(require '(it.sk.alfresco core))+(require '(alfresco core))


verify we got html by printing substring

--- ohack/src/ohack/core.clj
+++ ohack/src/ohack/core.clj
@@ -161,3 +161,5 @@
 ;; we're going to fetch the tab from
 ;; http://tabs.ultimate-guitar.com/t/tracy_chapman/fast_car_ver8_tab.htm
 (def fast-car-html (slurp "http://tabs.ultimate-guitar.com/t/tracy_chapman/fast_car_ver8_tab.htm"))
+;; verify we grabbed some html?
+(print (.substring fast-car-html 2000 3000))


Adding a test for the armstrong number 21897142587612075.

Many students seem to implement this exercise using floating point
arithmetics `(Math/pow)` comparing the result with the equal operator
afterwards.
I think we can agree, that comparing floating point numbers for strict
equality is not a good thing. But our tests had no case, where this
actually mattered.
I was searching for the lowest armstrong number, where this actually
matters and found 21897142587612075 to be a good candidate. The exercise
implemented in floating point arithmetics doesn't pass this added test,
while implementing it in integer arithmetics let all test pass.

--- exercises/armstrong-numbers/test/armstrong_numbers_test.clj
+++ exercises/armstrong-numbers/test/armstrong_numbers_test.clj
@@ -33,3 +33,7 @@
 (deftest not-armstrong-number-9926314
   (testing "Seven digit number that is not an Armstrong number"
     (is (not (armstrong? 9926314)))))
+
+(deftest armstrong-number-21897142587612075
+  (testing "Seventeen digit number that is an Armstrong number"
+    (is (armstrong? 21897142587612075))))


CMR-496: Fixed bug in ttl function.

CMR-496: Fixed bug in ttl function.

--- message-queue-lib/src/cmr/message_queue/queue/rabbit_mq.clj
+++ message-queue-lib/src/cmr/message_queue/queue/rabbit_mq.clj
@@ -43,7 +43,7 @@
 (defn- wait-queue-ttl
   "Returns the Time-To-Live (TTL) in milliseconds for the nth (1 based) wait queue"
   [n]
-  (nth (config/rabbit-mq-ttls) (dec n)))
+  (* 1000 (nth (config/rabbit-mq-ttls) (dec n))))

 (def ^{:const true}
   default-exchange-name "")


cleanup; feeding both wordcount barchart implementations with data

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/core.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/core.cljs
@@ -5,6 +5,7 @@
             [birdwatch.timeseries :as ts]
             [birdwatch.communicator :as comm]
             [birdwatch.wordcount :as wc]
+            [birdwatch.wordcount-barchart :as wc-bc]
             [birdwatch.ui :as ui]
             [birdwatch.ui-tweets :as ui-t]
             [birdwatch.state :as state]
@@ -17,13 +18,13 @@
 (reset! state/app (state/initial-state))

 ;;; Om components for the application are initialized here.
-(om/root ui-t/tweets-view     state/app {:target (. js/document (getElementById "tweet-frame"))})
-(om/root ui/count-view        state/app {:target (. js/document (getElementById "tweet-count"))})
-(om/root ui/users-count-view  state/app {:target (. js/document (getElementById "users-count"))})
-(om/root ui/total-count-view  state/app {:target (. js/document (getElementById "total-tweet-count"))})
-(om/root ui/search-view       state/app {:target (. js/document (getElementById "search"))})
-(om/root ui/sort-buttons-view state/app {:target (. js/document (getElementById "sort-buttons"))})
-(om/root ui/pagination-view   state/app {:target (. js/document (getElementById "pagination"))})
+(om/root ui-t/tweets-view     state/app {:target (util/by-id "tweet-frame")})
+(om/root ui/count-view        state/app {:target (util/by-id "tweet-count")})
+(om/root ui/users-count-view  state/app {:target (util/by-id "users-count")})
+(om/root ui/total-count-view  state/app {:target (util/by-id "total-tweet-count")})
+(om/root ui/search-view       state/app {:target (util/by-id "search")})
+(om/root ui/sort-buttons-view state/app {:target (util/by-id "sort-buttons")})
+(om/root ui/pagination-view   state/app {:target (util/by-id "pagination")})

 (defn ^:export append-search-text [s]
   (swap! state/app assoc :search-text (str (:search-text @state/app) " " s)))
@@ -34,8 +35,9 @@
 (def word-cloud (.WordCloud js/BirdWatch cloud-w (* cloud-w 0.7) 250 append-search-text "#wordCloud"))

 ; update the cheap charts every second
-(go-loop [] (<! (timeout 1000))
+(go-loop [] (<! (timeout 2000))
          (.updateBarchart js/BirdWatch (clj->js (wc/get-words state/app 25)))
+         (wc-bc/update-words (wc/get-words2 state/app 25))
          (ts/update-ts state/app)
          (recur))


fix issue with arg type.

fix issue with arg type.

--- src/kixi/hecuba/api/measurements.clj
+++ src/kixi/hecuba/api/measurements.clj
@@ -69,8 +69,8 @@
      :month            (util/get-month-partition-key t)
      :reading_metadata {}}))

-(defn template-upload->item [{:keys [size tempfile content-type filename]} entity_id username]
-  (assert (= content-type "text/csv") "Must be text/csv")
+(defn template-upload->item [entity_id username {:keys [size tempfile content-type filename]}]
+  (assert (= content-type "text/csv") (str  "Must be text/csv, not " content-type))
   (let [timestamp (t/now)]
     {:dest      :upload
      :type      :measurements
@@ -172,7 +172,7 @@
         route-params (:route-params (:request ctx))
         entity_id    (:entity_id route-params)
         auth         (sec/current-authentication session)
-        items        (template-upload->item file-data entity_id username)]
+        items        (map (partial template-upload->item entity_id username) file-data)]
     (doseq [item items]
       (pipe/submit-item pipe (assoc item :auth auth)))
     ;; We don't have emough info to return a Location header here. So


Minor correction in docstrings/comments.

--- src/main/clojure/conexp/fca/more.clj
+++ src/main/clojure/conexp/fca/more.clj
@@ -261,11 +261,11 @@
 (defn concept-robustness-polynomial
   "For the given `concept' of a context, the polynomial p, corresponding to the robustness,
    is computed by using the seq `concepts' of all concepts of the context.
-   The optional boolean parameter `sorted?' allows, to declare the list of concepts
+   The optional boolean parameter `sorted?' allows, to declare the seq of concepts
    as beeing already sorted by increasing attributeset.
    See Finding Robust Itemsets under Subsampling from Tatti, Moerchen and Calders
    https://dl.acm.org/citation.cfm?doid=2676651.2656261 (page 17-19) for details.
-   If v is the result of (robustness-polynom concept concepts),
+   If v is the result of (robustness-polynomial concept concepts),
    then (eval-polynomial v (- 1 alpha)) computes the robustness with parameter alpha."
   ([concept concepts sorted?]
    (assert (or (true? sorted?) (false? sorted?)) "Third argument must be a boolean!")
@@ -274,13 +274,13 @@
                               (filter #(subset? B (second %)) concepts)
                               (sort-by #(count (second %))
                                        (filter #(subset? B (second %)) concepts))))
-       concepts-with-values (reduce ;Stores for all subconcepts (C_A,C_B) of 'concept' the vector [C, e(C_B, 'concept')].
+       concepts-with-values (reduce ;Stores for all subconcepts (C_A,C_B) of `concept' the vector [C, e(C_B, `concept')].
                                 (fn [x y]
                                 (addnextentry y x))
                               [[concept, 1]]
                               usedconcepts)
        sup (count (first concept))]
-     (reduce ;Use the above computed values [C, e(C_B, 'concept')] to compute the polynomial.
+     (reduce ;Use the above computed values [C, e(C_B, `concept')] to compute the polynomial.
         (fn [oldcoefficients entry]
           (let [index (- sup (count (first (first entry))))]
             (assoc oldcoefficients index (+ (nth oldcoefficients index) (second entry)))))
@@ -292,8 +292,8 @@
 (defn concept-robustness
   "Computes the robustness of a `concept' in a context with parameter `alpha'
    by using the seq `concepts', which contains all concepts of the context.
-   The optional boolean parameter `sorted' allows to declare the list of concepts
-   as beeing already sorted by increasing size of the attributeset.?
+   The optional boolean parameter `sorted?' allows to declare the seq of concepts
+   as beeing already sorted by increasing size of the attributeset.
    This function uses the function concept-robustness-polynomial."
   ([concept concepts alpha sorted?]
    (assert (<= 0 alpha 1) "Third argument must be between 0 and 1!")


Whitespace

Whitespace

--- src/onyx/messaging/acking_daemon.clj
+++ src/onyx/messaging/acking_daemon.clj
@@ -55,7 +55,7 @@
             (if-let [ack (get state message-id)]
               (let [updated-ack-val (bit-xor ^long (:ack-val ack) ^long ack-val)]
                 (if (zero? updated-ack-val)
-                  (dissoc state message-id)
+                  (dissoc state message-id)
                   (assoc state message-id (assoc ack :ack-val updated-ack-val))))
               (if (zero? ^long ack-val)
                 state


log errors before reporting to zookeeper

--- src/clj/backtype/storm/daemon/task.clj
+++ src/clj/backtype/storm/daemon/task.clj
@@ -123,6 +123,7 @@
         task-stats (mk-task-stats task-object (sampling-rate storm-conf))

         report-error (fn [error]
+                       (log-error error)
                        (.report-task-error storm-cluster-state storm-id task-id error))

         report-error-and-die (fn [error]


Improve placement of cookie message.

Improve placement of cookie message.

--- src/clojure/staircase/views/footer.clj
+++ src/clojure/staircase/views/footer.clj
@@ -4,7 +4,17 @@

 (defn snippet [config]
   [:section.footer.dark {:ng-controller "FooterCtrl"}
-   [:div.panel.panel-info {:ng-show "showCookieMessage"}
+   [:div.row
+    [:div.col-sm-8.site-map
+     [:ul
+      [:li (link-to "/" "Home")]
+      [:li (link-to "/about" "Help")]
+      [:li "Tools" [:ul.row (tool-list {:class "col-sm-6"})]]]]
+    [:div.col-sm-4.contacts
+     (unordered-list (for [[icon addr text] (:contacts config)]
+                       (link-to addr [:i.fa.fa-fw.fa-2x {:class icon}] " " text)))]
+    ]
+   [:div.row.panel.panel-info {:ng-show "showCookieMessage"}
     [:div.panel-heading "Cookies"]
     [:div.panel-body
      [:button.btn.btn-warning.pull-right {:ng-click "showCookieMessage = false"} "understood"]
@@ -15,14 +25,4 @@
       ". By dismissing this message you agree to let this application store the data it needs
       to operate."]
      ]]
-   [:div.row
-    [:div.col-sm-8.site-map
-     [:ul
-      [:li (link-to "/" "Home")]
-      [:li (link-to "/about" "Help")]
-      [:li "Tools" [:ul.row (tool-list {:class "col-sm-6"})]]]]
-    [:div.col-sm-4.contacts
-     (unordered-list (for [[icon addr text] (:contacts config)]
-                       (link-to addr [:i.fa.fa-fw.fa-2x {:class icon}] " " text)))]
-    ]
    ])


Spell the arg key correctly

Spell the arg key correctly

--- web/src/immutant/web.clj
+++ web/src/immutant/web.clj
@@ -34,7 +34,7 @@
      * :host          The interface bind address [localhost]
      * :port          The port listening for requests [8080]
      * :path          Maps the handler to a prefix of the url path [/]
-     * :virtual-hosts Virtual host name[s] (a String or a List of Strings) [nil]
+     * :virtual-host  Virtual host name[s] (a String or a List of Strings) [nil]

    Run calls may be threaded together, too:


Add tests

Add tests

--- src/devcards/discuss/devcards/lib.cljs
+++ src/devcards/discuss/devcards/lib.cljs
@@ -1,5 +1,8 @@
 (ns discuss.devcards.lib
   (:require [cljs.test :refer-macros [testing is are]]
+            [clojure.test.check :as tc]
+            [clojure.test.check.generators :as gen]
+            [clojure.test.check.properties :as prop :include-macros true]
             [devcards.core :as dc :refer-macros [defcard deftest defcard-om]]
             [discuss.utils.common :as lib]))

@@ -43,4 +46,14 @@
            (is (not= (lib/get-unique-key) (lib/get-unique-key))))

          (testing "Add :react-key to given dictionary with a unique key."
-           (is (not (nil? (:react-key (lib/merge-react-key {:foo "bar"})))))))+           (is (not (nil? (:react-key (lib/merge-react-key {:foo "bar"})))))))
+
+(deftest string-conversions
+         (testing "Pluralize words if input is greater one."
+           (is (= "entries" (lib/singular->plural 2 "entry")))
+           (is (= "entry" (lib/singular->plural 1 "entry")))
+           (is (= "entries" (lib/singular->plural 0 "entry")))
+           (is (= nil (lib/singular->plural -1 "entry")))
+           (is (= "may-the-force-be-with-you" (lib/singular->plural 1 "may-the-force-be-with-you")))
+           (is (= "may-the-force-be-with-yous" (lib/singular->plural 101000 "may-the-force-be-with-you"))) ;; Strange :D
+           (is (= nil (lib/singular->plural -1 -1)))))


failing test for OMCSS-32

failing test for OMCSS-32

--- src/devcards/om_css/devcards/bugs.cljs
+++ src/devcards/om_css/devcards/bugs.cljs
@@ -245,3 +245,24 @@

 (defcard nested-fn-card
   (nested-fn-component))
+
+;;====================
+;; OMCSS-32
+
+(defui OMCSS-32-Component
+  Object
+  (render [this]
+    (dom/div {:ref :some-ref} "div with ref")))
+
+(def omcss-32-reconciler
+  (om/reconciler {:state (atom nil)
+                  :parser (om/parser {:read #(do {})})}))
+
+(defcard-om-next omcss-32-card
+  OMCSS-32-Component
+  omcss-32-reconciler)
+
+(deftest test-omcss-32
+  (let [c (om/class->any omcss-32-reconciler OMCSS-32-Component)]
+    (is (some? c))
+    (is (some? (om/react-ref c :some-ref)))))


Bump figwheel to 0.5.1

Bump figwheel to 0.5.1

--- src/leiningen/new/chestnut/project.clj
+++ src/leiningen/new/chestnut/project.clj
@@ -93,12 +93,12 @@
   :auto {"sassc" {:file-pattern  #"\.(scss)$"}}{{/sass?}}

   :profiles {:dev
-             {:dependencies [[figwheel "0.5.0-6"]
-                             [figwheel-sidecar "0.5.0-6"]
+             {:dependencies [[figwheel "0.5.1"]
+                             [figwheel-sidecar "0.5.1"]
                              [com.cemerick/piggieback "0.2.1"]
                              [org.clojure/tools.nrepl "0.2.12"]]

-              :plugins [[lein-figwheel "0.5.0-6"]
+              :plugins [[lein-figwheel "0.5.1"]
                         [lein-doo "0.1.6"]]

               :cljsbuild {:builds


ooops needed to bump dependency

ooops needed to bump dependency

--- src/leiningen/new/figwheel/project.clj
+++ src/leiningen/new/figwheel/project.clj
@@ -5,7 +5,7 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/clojurescript "0.0-2202"]
-                 [figwheel "0.1.2-SNAPSHOT"]
+                 [figwheel "0.1.3-SNAPSHOT"]
                  [org.clojure/core.async "0.1.278.0-76b25b-alpha"]
                  [sablono "0.2.16"]
                  [om "0.6.2"]]


solved 4Clojure: Palindrome Detector

solved 4Clojure: Palindrome Detector

--- src/4clojure/palindrome-detector.clj
+++ src/4clojure/palindrome-detector.clj
@@ -4,14 +4,16 @@
 ;; (defn palindrome? [coll]
 ;;   (println (int (/ (count coll) 2))))

+(def not-nil? (complement nil?))
+
 (defn palindrome? [coll]
   (loop [c coll
          r false]
-    (if (not (= (first c) (last c)))
-      false
-      (recur
-        (-> c rest butlast)
-        true))))
+    (let [f (first c)
+          l (last c)]
+      (if (and (not-nil? f) (not-nil? l) (= f l))
+        (recur (-> c rest butlast) true)
+        r))))

 (false? (palindrome? '(1 2 3 4 5)))
@@ -29,3 +31,27 @@
 (-> a (rest) (butlast))
 ; <=> - more readable
 (-> a rest butlast)
+
+(first a)
+(last a)
+(= (first a) (last a))
+
+(first nil)
+(last nil)
+
+(-> [1] rest butlast)
+
+
+;; 4clojure solution
+;; (fn palindrome? [coll]
+;;   (loop [c coll
+;;          r false]
+;;     (let [f (first c)
+;;           l (last c)
+;;           not-nil? (complement nil?)]
+;;       (if (and (not-nil? f) (not-nil? l) (= f l))
+;;         (recur (-> c rest butlast) true)
+;;         r))))
+
+;; _artem_uv's solution:
+;; #(if (= (apply str %) (apply str (vec (reverse %)))) true false)


(SERVER-297) Fix up LOAD_PATH behavior

(SERVER-297) Fix up LOAD_PATH behavior

Without this patch the load path behavior is incorrect because the use
of normalized and absolute paths is incompatible with the use of loading
resources from a sealed jar.  This patch addresses the problem by
restoring the previous behavior of implicitly relying in JRuby's
LoadService implementation.

For more information, particularly on the combination and interaction of
load path, class path, and ruby require, please see:

https://github.com/jruby/jruby/blob/1.7.20/core/src/main/java/org/jruby/runtime/load/LoadService.java

--- src/clj/puppetlabs/services/jruby/jruby_puppet_internal.clj
+++ src/clj/puppetlabs/services/jruby/jruby_puppet_internal.clj
@@ -16,8 +16,17 @@
 ;;; Definitions

 (def ruby-code-dir
-  "The name of the directory containing the ruby code in this project."
-  "src/ruby/puppet-server-lib")
+  "The name of the directory containing the ruby code in this project.
+
+  This directory is relative to `src/ruby` and works from source because the
+  `src/ruby` directory is defined as a resource in `project.clj` which places
+  the directory on the classpath which in turn makes the directory available on
+  the JRuby load path.  Similarly, this works from the uberjar because this
+  directory is placed into the root of the jar structure which is on the
+  classpath.
+
+  See also:  http://jruby.org/apidocs/org/jruby/runtime/load/LoadService.html"
+  "puppet-server-lib")

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Private
@@ -62,7 +71,7 @@
   (let [whitelist ["HOME" "PATH"]
         clean-env (select-keys env whitelist)]
     (assoc clean-env
-      "GEM_HOME" (fs/absolute-path gem-home)
+      "GEM_HOME" gem-home
       "JARS_NO_REQUIRE" "true"
       "JARS_REQUIRE" "false")))

@@ -73,15 +82,11 @@
   extensions extensions.  See SERVER-297 and SERVER-538 for more info."
   [ruby-load-path :- [schema/Str]
    jruby-home :- schema/Str]
-  (let [load-path (->> ruby-load-path
-                    (cons ruby-code-dir)
-                    (cons (str jruby-home "/lib/ruby/1.9"))
-                    (cons (str jruby-home "/lib/ruby/shared"))
-                    (cons (str jruby-home "/lib/ruby/1.9/site_ruby")))]
-    (->> load-path
-      (map fs/absolute-path)
-      (map fs/normalized-path)
-      (map str))))
+  (->> ruby-load-path
+    (cons ruby-code-dir)
+    (cons (str jruby-home "/lib/ruby/1.9"))
+    (cons (str jruby-home "/lib/ruby/shared"))
+    (cons (str jruby-home "/lib/ruby/1.9/site_ruby"))))

 (defn prep-scripting-container
   [scripting-container ruby-load-path gem-home]


CMR-815: Shorten line length to adhere to coding style.

--- src/cmr/search/services/parameters/parameter_validation.clj
+++ src/cmr/search/services/parameters/parameter_validation.clj
@@ -24,7 +24,8 @@

 (def single-value-params
   "Parameters that must take a single value, never a vector of values."
-  #{:keyword :page-size :page-num :sort-key :result-format :pretty :echo-compatible :include-granule-counts :include-has-granules :include-facets})
+  #{:keyword :page-size :page-num :sort-key :result-format :pretty :echo-compatible
+    :include-granule-counts :include-has-granules :include-facets})

 (def search-paging-depth-limit
   "The maximum value for page-num * page-size"


fix quoted string terminator check

fix quoted string terminator check

--- src/main/clojure/clojure/data/json.clj
+++ src/main/clojure/clojure/data/json.clj
@@ -109,7 +109,7 @@
                    len (unchecked-subtract-int read off)]
                (.unread stream buffer off len)
                (slow-read-string stream (String. buffer 0 i)))
-          (if (= i 63)
+          (if (= i (dec read))
             (do (.unread stream c)
                 (slow-read-string stream (String. buffer 0 i)))
             (recur (unchecked-inc-int i))))))))


Revert "collect trailing args only"

Revert "collect trailing args only"

This reverts commit 16d8f6365974663b25f82a19fe20c1d4c08a2586.

--- src/main/clojure/clojure/tools/cli.clj
+++ src/main/clojure/clojure/tools/cli.clj
@@ -70,7 +70,7 @@
                 (drop 2 args))

          :default
-         (recur (assoc result :args args) nil))))))
+         (recur (update-in result [:args] conj (first args)) (rest args)))))))

 (defn switches-for
   [switches flag]


Teach #find-documents to fetch *all* documents in the collection

--- src/app/cljs/one/repmax/mongohq.cljs
+++ src/app/cljs/one/repmax/mongohq.cljs
@@ -55,9 +55,78 @@
     simplify-object-ids
     walk/keywordize-keys))

-(defn find-documents [collection-name on-success]
+(defn find-documents
+  "Finds all documents in the given collection. Invokes the given callback,
+   passing in a sequence of documents (as Clojure maps).
+
+   MongoHQ returns a maximum of 100 documents per request. If the given collection
+   has more than 100 documents, this function makes multiple requests to MongoHQ.
+   It will make as many requests as needed to fetch all the documents in the
+   collection.
+  "
+  [collection-name on-success]
   (let [url (root-documents-url collection-name)]
-    (jsonp-request url
-                   {:_apikey *api-key*}
-                   (fn [data] (on-success (documents->maps data))))))
+    (find-documents-request url :on-success on-success)))

+(defn- find-documents-request
+  "Issues a JSONP request to the given URL to find documents.
+
+   Optional keyword argments:
+   * :skip            Used for pagination in MongoHQ. Indicates the number of documents to
+                      'skip' over when determining which documents to return from a query.
+                      Defaults to 0.
+   * :limit           The maximum number of documents to return in this request.
+                      Defaults to 100 (i.e., the maximum limit supported by MongoHQ).
+   * previous-results A sequence of documents produced by previous calls to this same
+                      function. Since we may need to call MongoHQ multiple times to 'paginate'
+                      through the list of documents, we can pass the results from previous calls
+                      to subsequent calls. After the final request to MongoHQ, all results are
+                      combined and passed to the on-success function.
+                      Defaults to an empty Vector.
+   * on-success       The function that will be invoked upon successful completion of the
+                      request. The function must accept a single argument: a sequence of
+                      documents.
+  "
+  [url & {:keys [skip limit previous-results on-success]
+          :or   {skip 0
+                 limit 100
+                 previous-results []
+                 on-success (fn [data])}}]
+  (jsonp-request url
+                 {:_apikey *api-key* :skip skip :limit limit}
+                 (find-documents-callback url
+                                          skip
+                                          limit
+                                          previous-results
+                                          on-success)))
+
+(defn- find-documents-callback
+  "Returns a callback function to be invoked after a successful request to MongoHQ to find
+   documents for a collection.
+
+   Ensures that we get *all* documents in the collection before we invoke the original
+   callback provided by the caller. To do so, it determines whether the another request is
+   needed in order to fetch more documents.
+
+   If this request returned fewer documents than allowed by the given limit, then we know
+   that we have reached the end of the 'resultset' for this query. In this case, we combine
+   the previous results with the results from this request, and we pass the combined results
+   to the original callback provided by the caller.
+
+   On the other hand, if this request returned the number of documents specified in the
+   limit, then there may be other documents remaining in the 'resultset' for this query.
+   In this case, we issue a subsequent request to MongoHQ for the next 'page' of results
+   in this 'resultset'. We continue this pattern until we have fetched all documents in
+   the collection.
+  "
+  [url skip limit previous-results on-success]
+  (fn [new-results]
+    (let [all-results (apply conj previous-results new-results)]
+      (if (< (count new-results) limit)
+        (on-success (documents->maps all-results))
+        (find-documents-request url
+                                :skip (+ skip limit)
+                                :limit limit
+                                :previous-results all-results
+                                :on-success on-success)))))
+


removed pattern for plain smiley, because it breaks links

--- src/blog/text_plugin/smiley_impl.clj
+++ src/blog/text_plugin/smiley_impl.clj
@@ -7,7 +7,7 @@
               [#"B-?\)|:glasses:"     "face-glasses.png"]
               [#":-?D|:grin:"         "face-grin.png"]
               [#":-?\*|:kiss:"        "face-kiss.png"]
-              [#":-?(\||\/)|:plain:"  "face-plain.png"]
+              [#":-?\||:plain:"       "face-plain.png"]
               [#":-?\(|:sad:"         "face-sad.png"]
               [#":-?\)|:smile:"       "face-smile.png"]
               [#":-?(o|O)|:surprise:" "face-surprise.png"]


Fix encode for sensors with no alias info

--- src/clj/kixi/hecuba/data/sensors.clj
+++ src/clj/kixi/hecuba/data/sensors.clj
@@ -171,9 +171,11 @@
    (-> sensor
        (cond-> (:user_metadata sensor) (user-metadata (:synthetic sensor)))
        (cond-> remove-pk? (dissoc :device_id :sensor_id))
-       (cond-> (:alias_sensor sensor)
-               (assoc :alias_sensor {"sensor_id" (get-in sensor [:alias_sensor :sensor_id])
-                                     "device_id" (get-in sensor [:alias_sensor :device_id])})))))
+       (cond-> (not-empty  (:alias_sensor sensor))
+         (assoc :alias_sensor {"sensor_id" (get-in sensor [:alias_sensor :sensor_id])
+                               "device_id" (get-in sensor [:alias_sensor :device_id])}))
+       (cond-> (empty? (:alias_sensor sensor))
+         (assoc :alias_sensor {})))))

 (defn sensor-time-range [sensor session]


Refactor - create `module-not-in-ModulesSelectedOrder?` function

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

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -212,6 +212,11 @@
    of a selected module"
   []
   (clj->js ModulesSelectedOrder))
+
+(defn- module-not-in-ModulesSelectedOrder?
+  "Determines if a module is in `ModulesSelectedOrder`"
+  [moduleCode]
+  (not-any? #{moduleCode} ModulesSelectedOrder))

 (defn is-module-selected?
   "Determines if a module has been selected"
@@ -781,7 +786,7 @@
                               {:label lessonGroup, :info lessonInfoSeq}))

               ; Add to ModulesSelectedOrder
-              (if (not-any? #{moduleCode} ModulesSelectedOrder)
+              (if (module-not-in-ModulesSelectedOrder? moduleCode)
                   (do
                     (set! ModulesSelectedOrder
                           (conj ModulesSelectedOrder moduleCode))


adding hypervisor to task tracking

adding hypervisor to task tracking

--- src/com/narkisr/proxmox/provider.clj
+++ src/com/narkisr/proxmox/provider.clj
@@ -4,7 +4,7 @@
   (:use
     [taoensso.timbre :only (debug info error warn)]
     clojure.core.strint
-    [com.narkisr.celestial.core]
+    com.narkisr.celestial.core
     [com.narkisr.proxmox.remote :only (prox-post prox-delete prox-get)]
     [slingshot.slingshot :only  [throw+ try+]]
     )
@@ -27,19 +27,19 @@
 (defn validate [spec]
   (schema/report-errors (schema/validate ct-schema spec)))

-(defn task-status [upid]
-  (prox-get (str "/nodes/proxmox/tasks/" upid "/status")))
+(defn task-status [node upid]
+  (prox-get (str "/nodes/" node  "/tasks/" upid "/status")))

-(defn wait-for [upid]
-  (while (= "running" (:status (task-status upid)))
+(defn wait-for [node upid]
+  (while (= "running" (:status (task-status node upid)))
     (Thread/sleep 200)
     (debug "Waiting for task" upid "to end")) )

 (defn check-task
   "Checking that a proxmox task has succeeded"
-  [upid]
-  (wait-for upid)
-  (let [{:keys [exitstatus] :as res} (task-status upid)]
+  [node upid]
+  (wait-for node upid)
+  (let [{:keys [exitstatus] :as res} (task-status node upid)]
     (when (not= exitstatus "OK")
       (throw+ (assoc res :type ::task-failed)))))

@@ -48,38 +48,42 @@
   (use 'com.narkisr.proxmox.provider))

 (defmacro safe [f]
-  `(try+ (check-task ~f)
+  `(try+
+       (check-task ~'node ~f)
          (catch [:status 500] e# (warn  "Container does not exist"))))

-(defprotocol Openvz
-  (unmount [this]))
+(defprotocol Openvz (unmount [this]))

 (deftype Container [node spec]
   Vm
   (create [this]
     (use-ns)
+    (debug "creating" (:vmid spec))
     (let [errors (validate spec)]
       (when-not (empty? errors)
         (throw (ExceptionInfo. "Failed to validate spec" errors)))
       (try+
-        (check-task (prox-post (str "/nodes/" node "/openvz") spec))
+        (check-task node (prox-post (str "/nodes/" node "/openvz") spec))
         (catch [:status 500] e
           (warn "Container already exists" e))
         )))

   (delete [this]
     (use-ns)
+    (debug "deleting" (:vmid spec))
     (.unmount this)
     (safe
       (prox-delete (str "/nodes/" node "/openvz/" (:vmid spec)))))

   (start [this]
     (use-ns)
+    (debug "starting" (:vmid spec))
     (safe
       (prox-post (str "/nodes/" node "/openvz/" (:vmid spec) "/status/start"))))

   (stop [this]
     (use-ns)
+    (debug "stopping" (:vmid spec))
     (safe
       (prox-post (str "/nodes/" node "/openvz/" (:vmid spec) "/status/stop"))))

@@ -94,6 +98,7 @@
   Openvz
   (unmount [this]
     (use-ns)
+    (debug "unmounting" (:vmid spec))
     (try+
       (safe
         (prox-post (str "/nodes/" node "/openvz/" (:vmid spec) "/status/umount")))


Fix local-storage/save function

Fix local-storage/save function

--- src/elfeed_cljsrn/local_storage.cljs
+++ src/elfeed_cljsrn/local_storage.cljs
@@ -19,6 +19,6 @@
    (save data nil nil))
   ([data on-success on-error]
    (-> storage
-       (.setItem key (pr-str data))
+       (.setItem storage-key (pr-str data))
        (.then on-success)
        (.catch on-error))))


save-record

save-record

New function for saving each record

--- src/ads_txt_crawler/database.clj
+++ src/ads_txt_crawler/database.clj
@@ -7,9 +7,9 @@
    :subname     dbname
    })

-(defn save-url [domain url dbname]
-  (let [{:keys [exchange-domain account-id account-type tag-id]} url]
-    (println (format "%s,%s,%s,%s,%s" domain exchange-domain account-id account-type tag-id))))
+;; (defn save-url [domain url dbname]
+;;   (let [{:keys [exchange-domain account-id account-type tag-id]} url]
+;;     (println (format "%s,%s,%s,%s,%s" domain exchange-domain account-id account-type tag-id))))

 (defn save [domain data dbname]
   (let [db-spec (db-spec dbname)]
@@ -30,5 +30,22 @@
             ))))))

+(defn save-record [domain record dbname]
+  (let [db-spec (db-spec dbname)]
+    (let [{:keys [exchange-domain account-id account-type tag-id comment]} record]
+      ;; some ads.txt files have duplicates
+      ;; for these we can ignore the exception causes by trying to insert a duplicate
+      (try
+        (jdbc/insert! db-spec :adstxt {:site_domain domain
+                                       :exchange_domain exchange-domain
+                                       :seller_account_id account-id
+                                       :account_type account-type
+                                       :tag_id tag-id
+                                       :entry_comment comment})
+        (catch org.sqlite.SQLiteException e
+          ;; Uncomment if you want to see the duplicates
+          ;; (.println *err* (format "Duplicate: %s,%s,%s,%s,%s" domain exchange-domain account-id account-type tag-id))
+          )))))

+


Rename PrerecordedSource -> Recording

Rename PrerecordedSource -> Recording

--- src/asciinema/player/source.cljs
+++ src/asciinema/player/source.cljs
@@ -170,7 +170,7 @@
       stopped-at)))

 (defn start-event-loop!
-  "Main event loop of the PrerecordedSource."
+  "Main event loop of the Recording."
   [{:keys [recording-ch-fn start-at speed loop?] :as source} msg-ch]
   (let [command-ch (chan 10)
         pri-ch (chan 10)]
@@ -219,7 +219,7 @@
                            (recur start-at speed end-ch stop-ch)))))
     command-ch))

-(defrecord PrerecordedSource [url start-at speed auto-play? loop? preload? poster-time recording-fn recording-ch-fn stop-ch command-ch]
+(defrecord Recording [url start-at speed auto-play? loop? preload? poster-time recording-fn recording-ch-fn stop-ch command-ch]
   Source
   (init [this]
     (let [msg-ch (chan)]
@@ -248,16 +248,17 @@
   (change-speed [this speed]
     (put! @command-ch [:change-speed speed])))

-(defn prerecorded-source [url start-at speed auto-play? loop? preload poster-time recording-fn]
-  (->PrerecordedSource url start-at speed auto-play? loop? preload poster-time recording-fn (atom nil) (atom nil) (atom nil)))
+(defn recording [url start-at speed auto-play? loop? preload poster-time recording-fn]
+  (->Recording url start-at speed auto-play? loop? preload poster-time recording-fn (atom nil) (atom nil) (atom nil)))
+

 (defmethod make-source :asciicast [url {:keys [start-at speed auto-play loop preload poster-time]}]
-  (prerecorded-source url start-at speed auto-play loop preload poster-time
-                      (fn [json]
-                        (-> json
-                            js/JSON.parse
-                            (js->clj :keywordize-keys true)
-                            initialize-asciicast))))
+  (recording url start-at speed auto-play loop preload poster-time
+                   (fn [json]
+                     (-> json
+                         js/JSON.parse
+                         (js->clj :keywordize-keys true)
+                         initialize-asciicast))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Add dummy spec to lazytest-asserts so that watch-spec works on it

--- src/asserts/lazytest_asserts.clj
+++ src/asserts/lazytest_asserts.clj
@@ -109,5 +109,5 @@
     (assert (= @*log* [:open-c1 :open-c2 :close-c2 :close-c1]))))

-;; empty describe to block run-spec
-(describe *ns* )
+(describe *ns* "Dummy spec to thwart run-spec"
+          (is (= 1 1)))


Name anon functions. Remove debug statements. Avoid using with-meta on functions (it creates a reified proxy)

--- src/aurora/compiler/datalog.cljs
+++ src/aurora/compiler/datalog.cljs
@@ -23,6 +23,12 @@
 ;; We assume that if we rely on attr then stratification ensures no more retractions are forthcoming

 ;; runtime
+(defn with-info [f x]
+  (aset f "our_info" x)
+  f)
+
+(defn info [f]
+  (aget f "our_info"))

 (defrecord Knowledge [old asserted retracted])

@@ -120,25 +126,25 @@
     #{}))

 (def empty-q
-  (with-meta
-    (fn [kn]
+  (with-info
+    (fn empty-q-fn [kn]
       #{{}})
     {::shape #{}}))

 (defn debug-q [query]
-  (with-meta
-    (fn [kn]
+  (with-info
+    (fn debug-q-fn [kn]
       (let [facts (query kn)]
         (prn facts)
         facts))
-    (meta query)))
+    (info query)))

 (defn project-q [pattern kn-f]
   (let [shape (match/vars pattern)
         return-syms (into [] shape)
         f (match/pattern pattern return-syms)]
-    (with-meta
-      (fn [kn]
+    (with-info
+      (fn project-q-fn [kn]
         (into #{}
               (for [fact (kn-f kn)
                     :let [vals (f fact)]
@@ -155,38 +161,38 @@
           (merge vals1 vals2))))

 (defn join-q [query1 query2]
-  (let [shape (union (::shape (meta query1)) (::shape (meta query2)))
-        join-shape (intersection (::shape (meta query1)) (::shape (meta query2)))]
-    (with-meta
-      (fn [kn]
+  (let [shape (union (::shape (info query1)) (::shape (info query2)))
+        join-shape (intersection (::shape (info query1)) (::shape (info query2)))]
+    (with-info
+      (fn join-q-fn [kn]
         (join (query1 kn) (query2 kn) join-shape))
       {::shape shape})))

 (defn filter-q [query fns]
-  ;; (check (subset? (:aurora/selects (meta fns)) (::shape (meta query))))
-  (with-meta
-    (fn [kn]
+  ;; (check (subset? (:aurora/selects (meta fns)) (::shape (info query))))
+  (with-info
+    (fn filter-q-fn [kn]
       (into #{} (filter fns (query kn))))
-    {::shape (::shape (meta query))}))
+    {::shape (::shape (info query))}))

 (defn let-q [query name-sym fns]
-  ;; (check (subset? (:aurora/selects (meta fns)) (::shape (meta query))))
-  (with-meta
-    (fn [kn]
+  ;; (check (subset? (:aurora/selects (meta fns)) (::shape (info query))))
+  (with-info
+    (fn let-q-fn [kn]
       (into #{} (for [result (query kn)]
                   (assoc result name-sym (fns result)))))
-    {::shape (conj (::shape (meta query)) name-sym)}))
+    {::shape (conj (::shape (info query)) name-sym)}))

 (defn fill-in [template result]
   (clojure.walk/postwalk-replace result template))

 (defn fill-in-q [template]
-  (fn [facts]
+  (fn fill-in-q-fn [facts]
     (into #{} (map #(fill-in template %) facts))))

 (defn mapcat-q [fns]
   (let [selects (:aurora/selects (meta fns))]
-    (fn [facts]
+    (fn mapcat-q-fn [facts]
       (into #{} (mapcat fns (into #{} (map #(select-keys % selects) facts)))))))

 (declare gen*)
@@ -197,36 +203,35 @@
         group-f #(select-keys % project-syms)
         shape (conj (set project-syms) name-sym)
         gen (gen* clauses)]
-    (with-meta
-      (fn [kn]
+    (with-info
+      (fn set-q-fn [kn]
         (into #{}
               (for [[projects selects] (group-by group-f (gen kn))]
                 (assoc (zipmap project-syms projects) name-sym (set (map #(select-keys % select-syms) selects))))))
       {::shape shape})))

 (defn in-q [query name-sym set-sym]
-  (fn [kn]
+  (fn in-q-fn [kn]
     (for [fact (query kn)
           elem (get fact set-sym :inq-not-found)]
       (assoc fact name-sym elem))))

 (defn gen* [clauses]
   (reduce
-   (fn [query clause]
-     (debug-q
-      (condp op? clause
-        '+ed (join-q query (project-q (second clause) :asserted))
-        '-ed (join-q query (project-q (second clause) :retracted))
-        '? (filter-q query (second clause))
-        '= (let-q query (nth clause 1) (nth clause 2))
-        'set (join-q query (set-q (nth clause 1) (nth clause 2) (nthnext clause 3)))
-        'in (in-q query (nth clause 1) (nth clause 2))
-        '+ query ;; handled later
-        '+s query ;; handled later
-        '- query ;; handled later
-        '-s query ;; handled later
-        '> query ;; handled later
-        (join-q query (project-q clause to-be)))))
+   (fn gen*-fn [query clause]
+     (condp op? clause
+       '+ed (join-q query (project-q (second clause) :asserted))
+       '-ed (join-q query (project-q (second clause) :retracted))
+       '? (filter-q query (second clause))
+       '= (let-q query (nth clause 1) (nth clause 2))
+       'set (join-q query (set-q (nth clause 1) (nth clause 2) (nthnext clause 3)))
+       'in (in-q query (nth clause 1) (nth clause 2))
+       '+ query ;; handled later
+       '+s query ;; handled later
+       '- query ;; handled later
+       '-s query ;; handled later
+       '> query ;; handled later
+       (join-q query (project-q clause to-be))))
    empty-q
    clauses))

@@ -239,7 +244,7 @@
         update-gens (into [] (map #(project-q (with-meta (nth % 1) {:tag update-sym}) to-be) (filter #(op? '> %) clauses)))
         update-templates (into [] (map #(nth % 2) (filter #(op? '> %) clauses)))
         gen (gen* clauses)]
-    (fn [kn]
+    (fn asserts+retracts*-fn [kn]
       (let [facts (gen kn)
             asserts #js []
             retracts #js []]
@@ -250,21 +255,21 @@
                 result (retract-f facts)]
           (.push retracts result))
         (doseq [[update-gen update-template] (map vector update-gens update-templates)
-                result (join (update-gen kn) facts (intersection (::shape (meta update-gen)) (::shape (meta gen))))]
+                result (join (update-gen kn) facts (intersection (::shape (info update-gen)) (::shape (info gen))))]
           (.push retracts (update-sym result))
           (.push asserts (merge (update-sym result) (fill-in update-template result))))
         [asserts retracts]))))

 (defn query* [clauses]
   (let [asserts+retracts (asserts+retracts* clauses)]
-    (fn [kn]
+    (fn query*-fn [kn]
       (let [[asserts retracts] (asserts+retracts kn)]
         (difference (set asserts) retracts)))))

 (defn rule* [clauses]
   (let [asserts+retracts (asserts+retracts* clauses)]
-    (with-meta
-      (fn [kn]
+    (with-info
+      (fn rule*-fn [kn]
         (let [[asserts retracts] (asserts+retracts kn)]
           (reduce retract (reduce assert kn asserts) retracts)))
       {::preds-in (apply union (map preds-in clauses))
@@ -273,12 +278,12 @@
        ::negs-out (apply union (map negs-out clauses))})))

 (defn chain [rules]
-  (fn [kn]
+  (fn chain-fn [kn]
     (reduce #(%2 %1) kn rules)))

 ;; TODO this doesn't propagate deltas efficiently, needs some fast way to read changes before and after
 (defn fixpoint [rule]
-  (fn [kn]
+  (fn fixpoint-fn [kn]
     (let [new-kn (rule kn)]
       (if (= new-kn kn)
         new-kn


show filesystem id on errors in extract_content

--- src/brainbot/nozzle/extract2.clj
+++ src/brainbot/nozzle/extract2.clj
@@ -31,7 +31,10 @@
         extract (try
                   (vfs/extract-content fs path)
                   (catch Throwable err
-                    (logging/error "error in extract-content" {:error err :path path})
+                    (logging/error "error in extract-content"
+                                   {:error err
+                                    :path path
+                                    :fsid (:fsid fs)})
                     nil))
         new-body (if extract
                    (assoc body :extract extract)


Update the build object more often, so the email code has the correct status when it runs

--- src/circle/backend/build/run.clj
+++ src/circle/backend/build/run.clj
@@ -38,8 +38,10 @@
     (when (-> @build :continue?)
       (let [current-act-results-count (count (-> @build :action-results))]
         (build/build-log "running %s" (-> act :name))
-        (action/run-action build act))))
+        (action/run-action build act)
+        (build/update-mongo build))))
   (stop* build)
+  (build/update-mongo build)
   build)

 (defn log-result [b]


Fix typographical error in gathering synopsis

--- src/clj/chili_dog_night/data.clj
+++ src/clj/chili_dog_night/data.clj
@@ -3,7 +3,7 @@

 (def gatherings [{:date "2016/05/18"
                   :address "3828 Meridian Ave N, Seattle, WA 98103, USA",
-                  :synopsis "May 18th, 2016: Chili Dogts, We Are Your Friends, and Ride."
+                  :synopsis "May 18th, 2016: Chili Dogs, We Are Your Friends, and Ride."
                   :food ["Chili Dogs"
                          "Oreo Triple Double Chocolate Sandwich Cookies"
                          "Peanut M&M's"


fix reflection

fix reflection

--- src/clj/morpheus/models/base.clj
+++ src/clj/morpheus/models/base.clj
@@ -8,7 +8,9 @@
   (:import (org.shisoft.morpheus SchemaStore)
            (org.shisoft.neb.exceptions SchemaAlreadyExistsException)))

-(def schema-store (SchemaStore.))
+(set! *warn-on-reflection* true)
+
+(def ^SchemaStore schema-store (SchemaStore.))
 (def cid-list-schema-id (atom nil))

 (defn add-schema [sname neb-id id meta]


About page route

About page route

--- src/clj/sparqlab/routes/home.clj
+++ src/clj/sparqlab/routes/home.clj
@@ -65,6 +65,10 @@
   []
   (layout/render "endpoint.html"))

+(defn about-page
+  []
+  (layout/render "about.html"))
+
 (defroutes home-routes
   (GET "/" [] (home-page))
   (context "/exercise" []
@@ -72,4 +76,5 @@
            (POST "/evaluate/:id" [id :as request]
                  (let [query (get-in request [:form-params "query"])]
                    (evaluate-exercise id query))))
-  (GET "/endpoint" [] (sparql-endpoint)))
+  (GET "/endpoint" [] (sparql-endpoint))
+  (GET "/about" [] (about-page)))


test for Film Critic preventing Corp-trashed execs going to Runner score area

--- src/clj/test/cards-resources.clj
+++ src/clj/test/cards-resources.clj
@@ -93,6 +93,24 @@
       (run-on state "HQ")
       (core/rez state :corp iwall)
       (is (get-in (refresh iwall) [:rezzed])))))
+
+(deftest film-critic-discarded-executives
+  "Film Critic - Prevent Corp-trashed execs going to Runner scored. Issues #1181/#1042"
+  (do-game
+    (new-game (default-corp [(qty "Director Haas" 3) (qty "Project Vitruvius" 3) (qty "Hedge Fund" 1)])
+              (default-runner [(qty "Film Critic" 1)]))
+    (play-from-hand state :corp "Project Vitruvius" "New remote")
+    (take-credits state :corp)
+    (play-from-hand state :runner "Film Critic")
+    (let [fc (first (get-in @state [:runner :rig :resource]))]
+      (run-empty-server state "Server 1")
+      (card-ability state :runner fc 0)
+      (is (= 1 (count (:hosted (refresh fc)))) "Agenda hosted on FC")
+      (take-credits state :runner)
+      (trash-from-hand state :corp "Director Haas")
+      (is (= 1 (count (:discard (get-corp)))) "Director Haas stayed in Archives")
+      (is (= 0 (:agenda-point (get-runner))) "No points gained by Runner")
+      (is (empty? (:scored (get-runner))) "Nothing in Runner scored"))))

 (deftest film-critic-fetal-ai
   "Film Critic - Fetal AI interaction"


Improve errors atom check

Improve errors atom check

--- src/com/wsscode/pathom/core.cljc
+++ src/com/wsscode/pathom/core.cljc
@@ -22,6 +22,8 @@

 ;; pathom core

+(declare atom?)
+
 (>def ::env map?)
 (>def ::attribute ::eql/property)

@@ -46,7 +48,7 @@

 (>def ::errors (s/map-of vector? any?))

-(>def ::errors* #(instance? IAtom %))
+(>def ::errors* #(atom? %))

 (>def ::entity any?)
 (>def ::entity-key keyword?)


fixed up compile errors in datascript namespace

--- src/copper/datascript_store.cljs
+++ src/copper/datascript_store.cljs
@@ -5,7 +5,9 @@
   (:require
     [clojure.set :as set]
     [clojure.walk :as walk]
-    [copper.core :as copper]))
+    [copper.core :as core]
+    [copper.store :as store]
+    [copper.basic-store :as bs]))

 (declare transact-datom)

@@ -64,7 +66,7 @@
 (defn create-store [& [schema]]
   (let [ea (sorted-map)
         av (sorted-map)
-        db (copper/-store
+        db (store/-store
             (atom {:ea ea
                    :av av
                    :schema schema}))]
@@ -74,42 +76,42 @@
         (cond->>
          (case [(when e :+) (when a :+) (when v :+)]
            [:+  nil nil]
-           (->> (copper/read this [:ea e]) vals (apply concat))
+           (->> (store/read this [:ea e]) vals (apply concat))
            [nil :+  nil]
-           (->> (copper/read this [:av a]) vals (apply concat))
+           (->> (store/read this [:av a]) vals (apply concat))
            [:+  :+  nil]
-           (copper/read this [:ea e a])
+           (store/read this [:ea e a])
            [nil :+  :+]
-           (copper/read this [:av a v])
+           (store/read this [:av a v])
            [:+  :+  :+]
-           (->> (copper/read this [:ea e a])
+           (->> (store/read this [:ea e a])
                 (filter #(= v (.-v %)))))
          tx    (filter #(= tx (.-tx %)))
          added (filter #(= added (.-added %)))))

-      copper/IListen
+      store/IListen
       (-listen! [_ component path]
-        (copper/listen! db component path))
+        (store/listen! db component [path]))

-      copper/IRemoveDep
-      (-remove-dep! [_ component path]
-        (-remove-dep! db component path))
+      store/IRemoveDep
+      (-remove-dep! [_ component [path]]
+        (store/remove-dep! db component path))

-      copper/IReadable
-      (-read [this path]
-        (core/listen! this core/*component* path)
+      store/IReadable
+      (-read [this [path]]
+        (store/listen! this core/*component* path)
         (get-in @db path))

-      core/ITransact
-      (-transact! [_ datom _]
+      store/ITransact
+      (-transact! [_ [datom]]
         (swap! db update-in edit-queue (fn [datoms]
-                                         (core/add-to [] datoms {:datom path}))))
-
-      core/ICommit
+                                         (core/add-to [] datoms datom))))
+
+      store/ICommit
       (-commit [_]
         (swap! db (fn [state]
                     (let [edits (get-in state edit-queue)
-                          new-state (reduce (fn [v {:keys [datom]}]
+                          new-state (reduce (fn [v datom]
                                               (transact-datom state datom))
                                             state
                                             edits)]
@@ -117,15 +119,17 @@
                           (assoc-in last-edits edits)
                           (assoc-in edit-queue nil))))))

-      core/INotificationSource
+      store/INotificationSource
       (-notify-deps [_]
         (let [edits (get-in @db last-edits)
-              dep-graph (get-in @db deps)]
-          (notify-updates (map :path edits) dep-graph)))
-
-      core/IDirty
+              dep-graph (get-in @db deps)
+              ea-paths (map (fn [datom] [:ea (:e datom) (:a datom)]) edits)
+              av-paths (map (fn [datom] [:ea (:a datom) (:v datom)]) edits)]
+          (bs/notify-updates (concat ea-paths av-paths) dep-graph)))
+
+      store/IDirty
       (-dirty? [_]
-        (not (nil? (get-in @db edit-queue)))))))
+        (store/dirty? db)))))

 (defn- update-in-sorted [map path f & args]
   (let [map (if (associative? map) map (sorted-map))
@@ -157,7 +161,7 @@
 (defn- op->datoms [db [op e a v] tx]
   (case op
     :db/add
-      (if (= :many (copper/read db [:schema a :cardinality]))
+      (if (= :many (store/read db [:schema a :cardinality]))
         (when (empty? (-search db [e a v]))
           [(datom e a v tx true)])
         (if-let [old-datom (first (-search db [e a]))]
@@ -169,13 +173,13 @@
       (when-let [old-datom (first (-search db [e a v]))]
         [(datom e a v tx false)])))

-(defn transact! [db entitie]
+(defn transact! [db entities]
   (let [tx     0
         datoms (->> entities
                     (mapcat #(explode-entity db %))
                     (mapcat #(op->datoms db % tx)))]
     (doseq [datom datoms]
-      (copper/-transact! db datom nil))))
+      (store/transact! db datom nil))))

 (defn next-eid [db & [offset]]
   (let [max-eid (or (-> (:ea db) keys last) 0)]


added hitlist to category overview

added hitlist to category overview

--- src/distillery/view/category.clj
+++ src/distillery/view/category.clj
@@ -4,6 +4,7 @@
   (:require [distillery.files :refer :all])
   (:require [distillery.view.cloud :as cloud])
   (:require [distillery.view.glossary :as glossary])
+  (:require [distillery.view.hitlist :as hitlist])
   (:require [distillery.view.html :refer :all]))

 (defn- render-headline
@@ -11,14 +12,23 @@
   [{:keys [category]}]
   (headline 2 (:name category)))

+(defn- render-hitlist
+  [{:keys [configuration] :as job} {:keys [id index] :as category}]
+  (hitlist/render-hitlist
+   (vals index)
+   :occurrences
+   configuration
+   :category-cloud))
+
 (defn- render-overview
   "Creates the HTML for the overview page."
-  [{:keys [category]}]
+  [{:keys [category] :as job}]
   (innerpage "overview" "Übersicht" true
-             (ulist "category_statistic"
+             [(ulist "category_statistic"
                     [(list-item (str "Quellen: " (count (:resources category))))
                      (list-item (str "Gesamtanzahl Worte: " (count (:words category))))
-                     (list-item (str "Worte im Index: " (count (:index category))))])))
+                     (list-item (str "Worte im Index: " (count (:index category))))])
+              (render-hitlist job category)]))

 (defn- render-glossary
   "Creates the HTML for the category glossary page."


Function get-job-name-from-body can't throw exception

--- src/emender_jenkins/rest_api.clj
+++ src/emender_jenkins/rest_api.clj
@@ -41,9 +41,12 @@

 (defn get-job-name-from-body
     [request]
-    (-> (read-request-body request)
-        body->job-info
-        get-job-name))
+    (try
+        (-> (read-request-body request)
+            body->job-info
+            get-job-name)
+        (catch Exception e
+            nil)))

 (defn send-response
     [response request]


get org name and repo name out of navigation-data

--- frontend/components/header.cljs
+++ frontend/components/header.cljs
@@ -18,8 +18,10 @@
 (defn show-follow-project-button? [app]
   (when-let [project (get-in app state/project-path)]
     (and (not (:followed project))
-         (= (vcs-url/project-name (:vcs_url project))
-            (get-in app [:project-settings-project-name])))))
+         (= (vcs-url/org-name (:vcs_url project))
+            (get-in app [:navigation-data :org]))
+         (= (vcs-url/repo-name (:vcs_url project))
+            (get-in app [:navigation-data :repo])))))

 (defn settings-link [app]
   (let [navigation-data (:navigation-data app)]


stress test tweaked

stress test tweaked

--- test/acceptance/new_stress_tests.clj
+++ test/acceptance/new_stress_tests.clj
@@ -72,12 +72,12 @@
         " (" (fix/count-collection-points (:program i)) ")")
     :steps (:counter i)
     :errors (count (push/get-stack i :error))
-    ; :argument-errors
-    ;   (count
-    ;     (filter
-    ;       #(.contains (:item %)
-    ;                   "missing arguments")
-    ;                   (push/get-stack i :error)))
+    :argument-errors
+      (count
+        (filter
+          #(.contains (:item %)
+                      "missing arguments")
+                      (push/get-stack i :error)))
     ; :stack-points
     ;   (reduce-kv
     ;     (fn [counts key value]
@@ -116,7 +116,7 @@

 (defn launch-some-workers
   [interpreter bindings how-many]
-  (cp/with-shutdown! [net-pool (cp/threadpool 1)]
+  (cp/with-shutdown! [net-pool (cp/threadpool 10)]
     (doall
       (lazy/upmap net-pool
         #(println ; .write *out*


Refactor

Refactor

--- test/buildviz/teamcity/sync_test.clj
+++ test/buildviz/teamcity/sync_test.clj
@@ -5,25 +5,26 @@
             [clj-http.fake :as fake]
             [clojure.test :refer :all]))

+(defn- successful-json-response [body]
+  (fn [_] {:status 200
+           :body (j/generate-string body)}))
+
 (deftest test-main
   (testing "should sync a build"
     (let [build-puts (atom {})]
       (fake/with-fake-routes {"http://teamcity:8000/httpAuth/app/rest/projects/the_project"
-                              (fn [_] {:status 200
-                                       :body (j/generate-string {:buildTypes {:buildType [{:id "theId"
-                                                                                :projectName "theProject"
-                                                                                :name "theJob"}]}})})
+                              (successful-json-response {:buildTypes {:buildType [{:id "theId"
+                                                                                :projectName "theProject"
+                                                                                :name "theJob"}]}})
                               "http://teamcity:8000/httpAuth/app/rest/buildTypes/id:theId/builds/?fields=build(id,number,status,startDate,finishDate,revisions(revision(version,vcs-root-instance)))"
-                              (fn [_] {:status 200
-                                       :body (j/generate-string {:build [{:id 42
-                                                                          :number 2
-                                                                          :status "SUCCESS"
-                                                                          :startDate "20160410T041049+0000"
-                                                                          :finishDate "20160410T041100+0000"
-                                                                          :revisions []}]})})
+                              (successful-json-response {:build [{:id 42
+                                                                  :number 2
+                                                                  :status "SUCCESS"
+                                                                  :startDate "20160410T041049+0000"
+                                                                  :finishDate "20160410T041100+0000"
+                                                                  :revisions []}]})
                               "http://teamcity:8000/httpAuth/app/rest/testOccurrences?locator=count:100,start:0,build:(id:42)"
-                              (fn [_] {:status 200
-                                       :body (j/generate-string {:testOccurrences []})})
+                              (successful-json-response {:testOccurrences []})
                               #"http://buildviz:8010/builds/(.+)/(.+)"
                               (fn [req]
                                 (swap! build-puts #(assoc % (:uri req) (j/parse-string (slurp (:body req)) true)))


Demonstrate that *last-error* works

Demonstrate that *last-error* works

--- test/cljs/comic_reader/api_test.cljs
+++ test/cljs/comic_reader/api_test.cljs
@@ -21,11 +21,7 @@
       (sut/setup!)
       (reactively
        [:div
-        [:input {:type "button"
-                 :value "Error"
-                 :on-click #(sut/report-error error)}]
-        [:input {:type "button"
-                 :value "Warning"
-                 :on-click #(sut/report-error warning)}]
+        [:button {:on-click #(sut/report-error error)} "Error"]
+        [:button {:on-click #(sut/report-error warning) :style {:margin-left "10px"}} "Warning"]
         [:p (str "Error count " (count @(sut/api-errors)))]
-        [:pre (prn-str (peek @(sut/api-errors)))]]))))
+        [:pre (prn-str @sut/*last-error*)]]))))


Get spatial params working

Get spatial params working

--- src/afterglow/effects/params.clj
+++ src/afterglow/effects/params.clj
@@ -6,8 +6,10 @@
   show metronome snapshot, show variables (which can be bound to OSC
   and MIDI mappings), and other, not-yet-imagined things."
   {:author "James Elliott"}
-  (:require [afterglow.rhythm :refer [metro-snapshot]]
+  (:require [afterglow.channels :as chan]
+            [afterglow.rhythm :refer [metro-snapshot]]
             [afterglow.show-context :refer [*show* with-show]]
+            [afterglow.fixtures :refer [printable]]
             [clojure.math.numeric-tower :as math]
             [com.evocomputing.colors :as colors]
             [taoensso.timbre :refer [error]])
@@ -534,15 +536,104 @@
           (resolve-non-frame-dynamic-elements [this show snapshot] (resolve-fn show snapshot nil))
           IHeadParam
           (evaluate-for-head [this show snapshot head] (eval-fn show snapshot head))
-          (resolve-non-frame-dynamic-elements-for-head [this show snapshot head] (resolve-fn show snapshot head)))))))
-
-;; TODO: Implement
-(defn build-linear-spatial-param
+          (resolve-non-frame-dynamic-elements-for-head [this show snapshot head]
+            (resolve-fn show snapshot head)))))))
+
+(defn- scale-spatial-result
+  [value smallest value-range start target-range]
+  (if (zero? value-range)
+    (+ start (/ target-range 2))  ; All values are the same, map to middle of range
+    (+ start (* target-range (/ (- value smallest) value-range)))))
+
+(defn- build-spatial-eval-fn
+  [results start target-range]
+  (if-not (some (partial satisfies? IParam) (vals results))
+    ;; Optimize the case of all constant results
+    (let [smallest (apply min (vals results))
+          largest (apply max (vals results))
+          value-range (- largest smallest)
+          precalculated (reduce (fn [altered-map [k v]]
+                                  (assoc altered-map k (scale-spatial-result
+                                                        v smallest value-range start target-range)))
+                                {} results)]
+      (fn [show snapshot head] (get precalculated (:id head))))
+
+    ;; Handle the general case of some dynamic results
+    (fn [show snapshot head]
+      (let [resolved (reduce (fn [altered-map [k v]]
+                               (assoc altered-map k (resolve-param v show snapshot head))))
+            smallest (apply min (vals resolved))
+            largest (apply max (vals resolved))]
+        (scale-spatial-result (get resolved (:id head)) smallest largest)))))
+
+;; TODO: Is there some way to pass in a circular flag to deal with
+;;       values like hue or angle, where the max and min yield the
+;;       same result? It would work if the heads are linearly spaced,
+;;       but without that, the caller may be responsible for picking
+;;       a good end value.
+(defn build-spatial-param
   "Returns a dynamic number parameter related to the physical
-  arrangement of the supplied fixture heads."
-  {:doc/format :markdown}
-  [heads & {:keys [start end circular] :or {start 0 end 255 }}]
-  {:pre [(some? *show*) (sequential? heads)]}
-)
+  arrangement of the supplied fixtures or heads. First the heads of
+  any fixtures passed in `fixtures-or-heads` are included. Then
+  function `f` is called for all fixtures or heads, passing in the
+  fixture or head. It must return a literal number or dynamic number
+  parameter.
+
+  When it comes time to evaluate this parameter, any dynamic number
+  parameters are evaluated, and the resulting numbers are scaled so
+  they fall within the range [`start`-`end`].
+
+  Useful things that `f` can do include calculating the distance of
+  the head from some point, either in 3D or along an axis, its angle
+  from some line, and so on. These can allow the creation of lighting
+  gradients across all or part of a show.
+
+  If you do not specify an explicit value for `:frame-dynamic`, this
+  spatial parameter will be frame dynamic if any values returned by
+  `f` are dynamic parameters which themselves are frame dynamic."
+  {:doc/format :markdown}
+  [fixtures-or-heads f & {:keys [start end frame-dynamic]
+                          :or {start 0 end 255 frame-dynamic :default}}]
+  {:pre [(some? *show*) (sequential? fixtures-or-heads) (ifn? f)
+         (number? start) (number? end) (< start end)]}
+  (let [heads (chan/expand-heads fixtures-or-heads)
+        results (zipmap (map :id heads) (map f heads))
+        target-range (math/abs (- start end))]
+    (doseq [v (vals results)] check-type v Number "spatial-param function result")
+    (let [dyn (if (= :default frame-dynamic)
+                ;; Default means results of head function control how dynamic to be
+                (boolean (some frame-dynamic-param? results))
+                ;; We were given an explicit value for frame-dynamic-param
+                (boolean frame-dynamic))
+          eval-fn (build-spatial-eval-fn results start target-range)
+          resolve-fn (fn [show snapshot head]
+                       (with-show show
+                         (let [resolved (reduce (fn [altered-map [k v]]
+                                                  (assoc altered-map k (resolve-unless-frame-dynamic
+                                                                        v show snapshot head))))
+                               resolved-eval-fn (build-spatial-eval-fn resolved start target-range)]
+                           (reify
+                             IParam
+                             (evaluate [this show snapshot] start) ; Needs head to do anything
+                             (frame-dynamic? [this] dyn)
+                             (result-type [this] Number)
+                             (resolve-non-frame-dynamic-elements [this show snapshot]
+                               this) ; Already resolved
+                             IHeadParam
+                             (evaluate-for-head [this show snapshot head] (eval-fn show snapshot head))
+                             (resolve-non-frame-dynamic-elements-for-head [this show snapshot head]
+                               this)))))] ; Already resolved
+      (reify
+        IParam
+        (evaluate [this show snapshot] start) ; Needs head to do anything
+        (frame-dynamic? [this] dyn)
+        (result-type [this] Number)
+        (resolve-non-frame-dynamic-elements [this show snapshot]
+          resolve-fn show snapshot nil)
+        IHeadParam
+        (evaluate-for-head [this show snapshot head]
+          (eval-fn show snapshot head))
+        (resolve-non-frame-dynamic-elements-for-head [this show snapshot head]
+          resolve-fn show snapshot head)))))

 ;; TODO: some kind of random parameter?


Test for function print-configuration

Test for function print-configuration

--- test/emender_jenkins/config_test.clj
+++ test/emender_jenkins/config_test.clj
@@ -11,7 +11,8 @@
 ;

 (ns emender-jenkins.config-test
-  (:require [clojure.test :refer :all]
+  (:require [clojure.test   :refer :all]
+            [clojure.pprint :as     pprint]
             [emender-jenkins.config :refer :all]))

 ;
@@ -146,3 +147,10 @@
             (assoc-in-if-not-nil {:first {:left "L" :right "R"} :second {:left "L" :right "R"}} [:second :left] "***")  {:first {:left "L",   :right "R"},   :second {:left "***", :right "R"}}
             (assoc-in-if-not-nil {:first {:left "L" :right "R"} :second {:left "L" :right "R"}} [:second :right] "***") {:first {:left "L",   :right "R"},   :second {:left "L",   :right "***"}})))

+(deftest test-print-configuration
+    "Check the behaviour of function emender-jenkins.config/print-configuration."
+        ; use mock instead of clojure.pprint/pprint
+        (with-redefs [pprint/pprint (fn [configuration] (str configuration))]
+            (is (not (nil? (print-configuration {:first 1 :second 2}))))
+            (is (= (type (print-configuration   {:first 1 :second 2})) java.lang.String))))
+


Update to ClojureScript 0.0-3030

Update to ClojureScript 0.0-3030

--- ClojureScript/project.clj
+++ ClojureScript/project.clj
@@ -1,7 +1,7 @@
 (defproject shrimp "0.1.0-SNAPSHOT"
   :description "Demo project for Goby."
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [org.clojure/clojurescript "0.0-2913"]
+                 [org.clojure/clojurescript "0.0-3030"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [goby "0.2.0"]
                  [org.omcljs/ambly "0.1.0-SNAPSHOT"]]


CMR-6689: Added comments.

CMR-6689: Added comments.

--- search-app/src/cmr/search/api/concepts_search.clj
+++ search-app/src/cmr/search/api/concepts_search.clj
@@ -268,14 +268,17 @@
   (if-let [short-scroll-id (-> body
                                (json/parse-string true)
                                :scroll_id)]
+    ;; if the short scroll id is valid, retrieve the real scroll id
     (if-let [scroll-id (->> short-scroll-id
                             (core-api/get-scroll-id-and-search-params-from-cache context)
                             :scroll-id)]
+      ;; clear the scroll session for the scroll id
       (query-svc/clear-scroll context scroll-id)
       (svc-errors/throw-service-error
        :invalid-data (format "scroll_id [%s] not found." short-scroll-id)))
     (svc-errors/throw-service-error
      :invalid-data "scroll_id must be provided."))
+  ;; no errors, return 204
   {:status 204})

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


testing code

testing code

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

--- plugins/SlideExplorer2/src/slide_explorer/canvas.clj
+++ plugins/SlideExplorer2/src/slide_explorer/canvas.clj
@@ -200,7 +200,7 @@
   [
    {:type :primitive-round-rect
     :params {:l 20 :t 10 :w 140 :h 140
-             :arc-radius 20 :arc-height 20
+             :arc-radius 20
              :filled true :color Color/RED}}
    {:type :primitive-ellipse
     :params {:l 25 :t 15 :w 110 :h 90
@@ -214,14 +214,22 @@
    {:type :primitive-polygon
     :params {:vertices [{:x 100 :y 100}
                         {:x 50 :y 150}
-                        {:x 160 :y 160}]
+                        {:x 50 :y 220}
+                        {:x 160 :y 250}]
              :filled false
-             :closed true}}
+             :closed false
+             :color Color/ORANGE
+             :alpha 0.8
+             :stroke {:width 25
+                      :dashes [20 3 10 3 5 3]
+                      :cap :butt
+                      :join :bevel
+                      :miter-limit 10.0}}}
    {:type :primitive-text
     :params {:x 180 :y 120 :text "TEST"
              :color Color/BLUE
              :alpha 0.5
-             :font {:name "Helvetica"
+             :font {:name "Arial"
                     :bold true
                     :italic false
                     :underline true
@@ -229,10 +237,12 @@
                     :size 100}}}
    {:type :primitive-line
     :params {:x 180 :y 120 :w 0 :h 150 :color Color/RED
-             :stroke {:width 15 :cap :round}
+             :stroke {:width 10 :cap :round}
              :alpha 0.7}}
    {:type :primitive-line
-    :params {:x 180 :y 120 :w 30 :h 0 :color Color/RED}}
+    :params {:x 180 :y 120 :w 30 :h 0 :color Color/GREEN
+             :alpha 0.6
+             :stroke {:width 4}}}
    {:type :primitive-arc
     :params {:l 40 :t 30 :w 100 :h 100
              :start-angle 10 :arc-angle 100 :color Color/GREEN


latest deps

latest deps

--- iwaswhere-web/project.clj
+++ iwaswhere-web/project.clj
@@ -23,8 +23,8 @@
                  [ubergraph "0.3.0"]
                  [camel-snake-kebab "0.4.0"]
                  [matthiasn/systems-toolbox "0.6.4"]
-                 [matthiasn/systems-toolbox-ui "0.6.1"]
-                 [matthiasn/systems-toolbox-sente "0.6.4"]
+                 [matthiasn/systems-toolbox-ui "0.6.2"]
+                 [matthiasn/systems-toolbox-sente "0.6.5"]
                  ;[matthiasn/systems-toolbox-probe "0.6.2"]
                  [re-frame "0.9.1"]
                  [clucy "0.4.0"]


Update Jetty dependency

Update Jetty dependency

--- ring-jetty-adapter/project.clj
+++ ring-jetty-adapter/project.clj
@@ -7,7 +7,7 @@
   :dependencies [[org.clojure/clojure "1.5.1"]
                  [ring/ring-core "1.6.0-beta1"]
                  [ring/ring-servlet "1.6.0-beta1"]
-                 [org.eclipse.jetty/jetty-server "9.2.10.v20150310"]]
+                 [org.eclipse.jetty/jetty-server "9.3.10.v20160621"]]
   :profiles
   {:dev {:dependencies [[clj-http "2.2.0"]]}
    :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}