Remove vehicle icons from journey preview map

--- src/cljs/travel_site/components/city.cljs
+++ src/cljs/travel_site/components/city.cljs
@@ -14,7 +14,14 @@

 ;; Various util functions
 (def colors (flatten (repeat ["green" "blue" "#66CD00" "#03A89E" "#83F52C" "#4C7064"])))
-(def widths (flatten (repeat [8.0 6.0 4.0])))
+(def widths (flatten (repeat [6.0 4.0])))
+
+(defn strict-map [map-func map-over]
+  (reduce
+    (fn [_ v]
+      (map-func v))
+    []
+    map-over))

 (defn geojson->goog-latlng [[lng lat]]
   (js/google.maps.LatLng. lat lng))
@@ -131,25 +138,47 @@
     waypoints
     all-directions))

-(defn create-renderers [owner transit-directions]
+(defn construct-renderer [index directions google-map]
+  (let [renderer (js/google.maps.DirectionsRenderer.
+                   #js {:polylineOptions #js {:strokeColor (nth colors index)
+                                              :strokeOpacity 0.6
+                                              :geodesic true
+                                              :strokeWeight (nth widths index)}
+                        :suppressInfoWindows true
+                        :suppressMarkers true}) ]
+    (.setMap renderer google-map)
+    (.setDirections renderer (clj->js (-> directions :directions clj->js)))
+    renderer))
+
+(defn construct-polyline [index directions google-map]
+  (let [polyline (js/google.maps.Polyline.
+                   #js {:path #js []
+                        :strokeColor (nth colors index)
+                        :strokeOpacity 0.6
+                        :geodesic true
+                        :strokeWeight (nth widths index)})]
+    (.setMap polyline google-map)
+    (strict-map
+      (fn [step]
+        (strict-map
+          (fn [segment]
+            (-> polyline .getPath (.push (clj->js segment))))
+          (:path step)))
+      (-> directions :directions :routes (get 0) :legs (get 0) :steps))
+    polyline))
+
+
+(defn create-renderers [owner transit-directions show-vehicle-icons]
   (reduce
     (fn [renderers [index directions]]
-      (let [renderer (js/google.maps.DirectionsRenderer.
-                       #js {:polylineOptions #js {:strokeColor (nth colors index)
-                                                  :strokeOpacity 0.6
-                                                  :geodesic true
-                                                  :icons #js []
-                                                  :strokeWeight (nth widths index)}
-                            :suppressInfoWindows true
-                            :suppressMarkers true})]
-        (.setMap renderer (om/get-state owner :google-map))
-        (.setDirections renderer (clj->js (-> directions :directions clj->js)))
-        (conj renderers renderer)))
+      (if show-vehicle-icons
+        (conj renderers (construct-renderer index directions (om/get-state owner :google-map)))
+        (conj renderers (construct-polyline index directions (om/get-state owner :google-map)))))
     []
     (map vector (range) transit-directions)))

-(defn gen-new-renderers [owner transit-directions]
-  (let [all-renderers (create-renderers owner transit-directions)]
+(defn gen-new-renderers [owner transit-directions show-vehicle-icons]
+  (let [all-renderers (create-renderers owner transit-directions show-vehicle-icons)]
     (om/set-state! owner :all-renderers all-renderers)))

 (defn create-markers [owner transit-journey]
@@ -216,7 +245,7 @@
                         transit-journey
                         (make-transit-journey waypoints journey partial-directions)))))))))))))

-(defn attraction-map-view [[current-city journey transit-journey] owner]
+(defn attraction-map-view [[current-city journey transit-journey show-vehicle-icons] owner]
   (reify
     ;; initialize the google maps objects and store them as local state to the map view
     om/IDidMount
@@ -234,7 +263,7 @@
                                 :zoom 9})]
           (om/set-state! owner :google-map google-map)
           (om/set-state! owner :google-directions-service google-directions-service)
-          (gen-new-renderers owner transit-journey)
+          (gen-new-renderers owner transit-journey show-vehicle-icons)
           (gen-new-markers owner transit-journey))))

     ;; recompute the route upon journey update
@@ -245,7 +274,7 @@
           (when-not (= transit-journey prev-transit-journey)
             (remove-old-markers owner)
             (remove-old-renderers owner)
-            (gen-new-renderers owner transit-journey)
+            (gen-new-renderers owner transit-journey show-vehicle-icons)
             (gen-new-markers owner transit-journey)))
         (if-not (= (-> city :city :data :center :coordinates) (-> prev-city :city :data :center :coordinates))
           (.setCenter (om/get-state owner :google-map) (geojson->goog-latlng (-> current-city :city :data :center :coordinates))))))
@@ -290,13 +319,13 @@
                 [:div {:class "ui padded basic sticky stickied-map segment"}
                  [:div {:class "ui segment preview-directions"}
                   [:h3 "Route preview"]
-                  (om/build attraction-map-view [current-city journey transit-journey])]] ]
+                  (om/build attraction-map-view [current-city journey transit-journey false])]] ]
                [:div {:class "twelve wide column"}
                 (om/build attractions/all-attractions-view [(-> current-city :attraction_categories :data)
                                                             (-> current-city :attractions :data)])]]
               [:div {:class "ui fourteen wide column row basic segment final-directions"}
                [:div {:class "fourteen wide column"}
-                (om/build attraction-map-view [current-city journey transit-journey])] ]
+                (om/build attraction-map-view [current-city journey transit-journey true])] ]
               [:div {:class "ui fourteen wide column row basic segment final-directions"}
                [:div {:class "fourteen wide column"}
                 (om/build transit-view transit-journey) ]]


Made travel instructions more detailed and tenatively fixed sticky map from getting caught

--- src/cljs/travel_site/components/city.cljs
+++ src/cljs/travel_site/components/city.cljs
@@ -32,6 +32,17 @@
 (defn get-end-location [transit-directions]
   (-> transit-directions :directions :routes (get 0) :legs (get 0) :end_location))

+(defn transit-step-view [transit-step owner]
+  (reify
+    om/IRender
+    (render [_]
+      (html [:li
+             [:b (:instructions transit-step)]
+             [:i (str " (" (-> transit-step :distance :text) " - " (-> transit-step :duration :text) ")")]
+             (when (= "TRANSIT" (:travel_mode transit-step))
+               [:div
+                (-> transit-step :transit :departure_stop :name) " - "
+                (-> transit-step :transit :arrival_stop :name)])]))))

 (defn transit-directions-view [transit-directions owner]
   (reify
@@ -44,8 +55,7 @@
                  (:start_name transit-directions)
                  [:div {:class "sub header"} (:end_name transit-directions)]]]
                [:ul {:class "transit-steps"}
-                (map #(html [:li (:instructions %)])
-                     (:steps directions))]])))))
+                (om/build-all transit-step-view (:steps directions))]])))))

 (defn transit-view [transit-journey owner]
   (reify
@@ -297,6 +307,7 @@
     ;; Perhaps better to put it in a different component...
     om/IDidUpdate
     (did-update [_ prev-props _]
+      (.sticky (.find (js/$. (om/get-node owner)) ".stickied-map")) ;; Hack to prevent stickied map from getting "stuck"
       (when-not (journey-same? journey (:journey prev-props))
         (update-journey-plan owner)
         (router/go-to-hash


fixes https://github.com/status-im/status-react/issues/1111

--- src/status_im/chat/views/input/input.cljs
+++ src/status_im/chat/views/input/input.cljs
@@ -64,16 +64,19 @@
   (let [input-text           (subscribe [:chat :input-text])
         command              (subscribe [:selected-chat-command])
         sending-in-progress? (subscribe [:chat-ui-props :sending-in-progress?])
-        input-focused?       (subscribe [:chat-ui-props :input-focused?])]
+        input-focused?       (subscribe [:chat-ui-props :input-focused?])
+        input-ref            (atom nil)]
     (fn [{:keys [set-layout-height set-container-width height]}]
       [text-input
        {:ref                    #(when %
-                                   (dispatch [:set-chat-ui-props {:input-ref %}]))
+                                   (dispatch [:set-chat-ui-props {:input-ref %}])
+                                   (reset! input-ref %))
         :accessibility-label    id/chat-message-input
         :multiline              true
         :default-value          (or @input-text "")
         :editable               true
         :blur-on-submit         false
+        :on-submit-editing      #(.setNativeProps @input-ref (clj->js {:text (str @input-text "\n")})) ;because of bug on Android, next line is not inserted
         :on-focus               #(dispatch [:set-chat-ui-props {:input-focused? true
                                                                 :show-emoji?    false}])
         :on-blur                #(do (dispatch [:set-chat-ui-props {:input-focused? false}]))


fix hour format

fix hour format

--- src/status_im/components/drawer/view.cljs
+++ src/status_im/components/drawer/view.cljs
@@ -108,7 +108,7 @@
        [view {:style st/transaction-details-container}
         [text {:style st/transaction-to} (i18n/label :t/to)]
         [text {:style st/transaction-recipient :number-of-lines 1} recipient-name]
-        [text {:style st/transaction-time} (time/format-date "dd MMM hh:mm" (time/to-date timestamp))]]]
+        [text {:style st/transaction-time} (time/format-date "dd MMM HH:mm" (time/to-date timestamp))]]]
       [view {:style st/transaction-picture}
        (when recipient
          [ci/chat-icon (:photo-path recipient) {:size 40}])]]]))


[#2439] Dummy test

[#2439] Dummy test

--- backend/test/akvo/lumen/endpoints_test.clj
+++ backend/test/akvo/lumen/endpoints_test.clj
@@ -11,6 +11,9 @@

 (use-fixtures :once (partial system-fixture "endpoints-test.edn")
   tenant-conn-fixture error-tracker-fixture tu/spec-instrument)
+
+(deftest dummy-test
+  (is (= 1 1)))

 (deftest handler-test
   (let [h (:handler (:akvo.lumen.component.handler/handler *system*))]


Fixes timbre custom config in logging-configuration

--- src/onyx/static/logging_configuration.clj
+++ src/onyx/static/logging_configuration.clj
@@ -8,7 +8,7 @@

   (start [component]
     (if config
-      (timbre/set-config! [] config)
+      (reset! timbre/config config)
       (do
         (timbre/set-config!
           [:appenders :rotor]


[#12418] Error when declining membership request

Signed-off-by: andrey <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/transport/message/core.cljs
+++ src/status_im/transport/message/core.cljs
@@ -176,22 +176,23 @@
   "before processing we want to filter and sort messages, so we can process first only messages which will be showed"
   {:events [:sanitize-messages-and-process-response]}
   [{:keys [db] :as cofx} ^js response-js process-async]
-  (let [current-chat-id (:current-chat-id db)
-        {:keys [db messages transactions chats statuses]}
-        (reduce group-by-and-update-unviewed-counts
-                {:db db :chats #{} :transactions #{} :statuses [] :messages []
-                 :current-chat-id current-chat-id}
-                (.-messages response-js))]
-    (sort-js-messages! response-js messages)
-    (fx/merge cofx
-              {:db db
-               :utils/dispatch-later (concat []
-                                             (when (seq statuses)
-                                               [{:ms 100 :dispatch [:process-statuses statuses]}])
-                                             (when (seq transactions)
-                                               (for [transaction-hash transactions]
-                                                 {:ms 100 :dispatch [:watch-tx transaction-hash]})))}
-              (process-response response-js process-async))))
+  (when response-js
+    (let [current-chat-id (:current-chat-id db)
+          {:keys [db messages transactions chats statuses]}
+          (reduce group-by-and-update-unviewed-counts
+                  {:db db :chats #{} :transactions #{} :statuses [] :messages []
+                   :current-chat-id current-chat-id}
+                  (.-messages response-js))]
+      (sort-js-messages! response-js messages)
+      (fx/merge cofx
+                {:db db
+                 :utils/dispatch-later (concat []
+                                               (when (seq statuses)
+                                                 [{:ms 100 :dispatch [:process-statuses statuses]}])
+                                               (when (seq transactions)
+                                                 (for [transaction-hash transactions]
+                                                   {:ms 100 :dispatch [:watch-tx transaction-hash]})))}
+                (process-response response-js process-async)))))

 (fx/defn remove-hash
   [{:keys [db]} envelope-hash]


added US_FAIL_ONLY, defaults to 0/false, but can be set to 1/true and will only display failing namespaces/items/results

--- src/untangled_spec/reporters/terminal.clj
+++ src/untangled_spec/reporters/terminal.clj
@@ -13,8 +13,10 @@
                DIFF        (System/getenv "US_DIFF")
                NUM_DIFFS   (System/getenv "US_NUM_DIFFS")
                FRAME_LIMIT (System/getenv "US_FRAME_LIMIT")
-               QUICK_FAIL  (System/getenv "US_QUICK_FAIL")]
-           {:color?          (#{"1" "true"}  COLOR)
+               QUICK_FAIL  (System/getenv "US_QUICK_FAIL")
+               FAIL_ONLY   (System/getenv "US_FAIL_ONLY")]
+           {:fail-only?      (#{"1" "true"} FAIL_ONLY)
+            :color?          (#{"1" "true"}  COLOR)
             :diff-hl?        (#{"hl" "all"}  DIFF_MODE)
             :diff-list? (not (#{"hl"}        DIFF_MODE))
             :diff?      (not (#{"0" "false"} DIFF))
@@ -144,6 +146,8 @@
                                           (partial println))
                                    (inc print-level))))
     (->> (:test-items test-item)
+         (remove #(when (env :fail-only?)
+                    (= :passed (:status %))))
          (mapv #(print-test-item % (inc print-level))))))

 (defn print-namespace [make-tests-by-namespace]
@@ -152,6 +156,8 @@
     (println (color-str (:status make-tests-by-namespace)
                         "Testing " (:name make-tests-by-namespace)))
     (->> (:test-items make-tests-by-namespace)
+         (remove #(when (env :fail-only?)
+                    (= :passed (:status %))))
          (mapv #(print-test-item % 1)))))

 (defn print-report-data
@@ -160,6 +166,8 @@
   (t/with-test-out
     (let [{:keys [namespaces tested passed failed error]} @impl/*test-state*]
       (try (->> namespaces
+                (remove #(when (env :fail-only?)
+                           (= :passed (:status %))))
                 (mapv print-namespace))
            (catch Exception e
              (when-not (->> e ex-data ::stop?)


dropped jdbc clojure library

dropped jdbc clojure library

SQL Korma by Chris granger works much better here! :)

--- src/webapp/framework/server/db_helper.clj
+++ src/webapp/framework/server/db_helper.clj
@@ -4,7 +4,6 @@
   [:require [korma.core]]
   [:use [webapp-config.settings]]
   [:use [webapp.framework.server.encrypt]]
-  (:require [clojure.java.jdbc :as j])
 )

@@ -59,63 +58,43 @@
    (sql sql-in {}))

   ([sql-in  params]
-   (do
-     (let [
-            lower (.toLowerCase sql-in)
-            ]
-       ;(println "SQL from client: " sql-in)
-       ;
-       (cond
-         (or (.startsWith lower "select")  (.contains lower "returning"))
-         (do (into [] (map   (fn [r] (to-lower-case-keys r));
-                             (korma.core/exec-raw [sql-in params] :results))))
+   (sql nil sql-in params))

-         :else
-         (do (comment println "INSERT") (korma.core/exec-raw [sql-in params]) [])
-         ; []
-         )))
-   )

   ([schema  sql-in  params]
-   (do
+   (let [
+          lower             (.toLowerCase sql-in)
+          returns-results?  (or (.startsWith lower "select")  (.contains lower "returning"))
+          update-only?      (not returns-results?)
+          use-schema        (cond
+                              (or (= schema "public") (nil? schema))      "public"
+                              :else                                        schema)
+          ]
+
      (cond
-       (or (= schema "public") (nil? schema))
-       (let [
-              lower (.toLowerCase sql-in)
-              ]
-         (cond
-           (or (.startsWith lower "select")  (.contains lower "returning"))
-           (do  (into [] (map   (fn [r] (to-lower-case-keys r));
-                                (korma.core/exec-raw [sql-in params] :results))))
+       returns-results?
+       ;---------------
+       (let [res     (korma.db/transaction
+                       (korma.core/exec-raw [(str "set schema '" use-schema "'") []])
+                       (korma.core/exec-raw [sql-in params] :results))

-           :else (do (comment println "INSERT") (korma.core/exec-raw [sql-in params]) [])
-           ; []
-           ))
+             formatted   (into [] (map   (fn [r] (to-lower-case-keys r)) res))
+             ]
+         (korma.core/exec-raw [(str "set schema 'public'") []])
+         formatted)

-       :else
-       (let [
-              jdbc-conn        (cond
-                                 (= *database-type* "postgres" )
-                                 (. java.sql.DriverManager getConnection  (str "jdbc:postgresql://" *database-server* ":5432/" *database-name*)  *database-user*  *database-password*)

-                                 (= *database-type* "oracle" )
-                                 (. java.sql.DriverManager getConnection  (str "jdbc:oracle:thin:" *database-user* "/" *database-password* "@" *database-server* ":1521:" *database-name*)  *database-user*  *database-password*))
+       update-only?
+       ;-----------
+       (do
+         (korma.db/transaction
+           (korma.core/exec-raw [(str "set schema ' " use-schema "'") []])
+           (korma.core/exec-raw [sql-in params])
+           (korma.core/exec-raw [(str "set schema 'public'") []]))
+         [])

-              statement    (. jdbc-conn createStatement)
-
-              change-schema   (. statement execute  (str "set schema '" schema "'"))
-              res             (. statement executeQuery  sql-in)
-              outrows         (into [] (j/result-set-seq res))
-              ]
-
-         (if outrows
-           (do
-             (. statement close)
-             (. jdbc-conn close)
-             outrows
-             )))
        ))))

@@ -167,3 +146,11 @@
     ;(println (str table-name " table-exists-result: " (count table-exists-result)))
     (println (str table-name " table exists: " table-exists?))
     table-exists?))
+
+
+
+
+
+(comment korma.db/transaction
+  (korma.core/exec-raw [(str "set schema 'public'") []])
+  (korma.core/exec-raw ["select id from appshare_applications" []] :results))


doc(view-helpers/beep): typo in docstring

--- ccw.core/src/clj/ccw/repl/view_helpers.clj
+++ ccw.core/src/clj/ccw/repl/view_helpers.clj
@@ -22,7 +22,7 @@
   [f] (swt/ui-sync f))

 (defn ^:deprecated beep
-  "deprecated - use ccw.swt/ui-sync instead. Executes a beep sound"
+  "deprecated - use ccw.swt/beep instead. Executes a beep sound"
   [] (swt/beep))

 (defn- set-style-range


Fix Issue 459:	Lots of things reported as error when evaluation goes wrong in the REPL

--- ccw.core/src/clj/ccw/repl/view_helpers.clj
+++ ccw.core/src/clj/ccw/repl/view_helpers.clj
@@ -89,10 +89,9 @@
   (future (doseq [{:keys [out err value ns status] :as resp} responses]
             (ui-sync
               (when ns (.setCurrentNamespace repl-view ns))
-              (doseq [[k v] (dissoc resp :id :ns :status :session)]
-                (if (log-styles k)
-                  (log repl-view log-component v k)
-                  (CCWPlugin/log (str "Cannot handle REPL response: " k (pr-str resp)))))
+              (doseq [[k v] (dissoc resp :id :ns :status :session)
+                      :when (log-styles k)]
+                (log repl-view log-component v k))
               (doseq [status status]
                 (case status
                   "interrupted" (log repl-view log-component (eval-failure-msg status expr) :err)


Eight tests added into test-core module

Eight tests added into test-core module

--- test/clouseau/test_core.clj
+++ test/clouseau/test_core.clj
@@ -1,7 +1,7 @@
 ;;;
 ;;;   Clouseau
 ;;;
-;;;    Copyright (C) 2015 Pavel Tisnovsky <ptisnovs@redhat.com>
+;;;    Copyright (C) 2015, 2016  Pavel Tisnovsky <ptisnovs@redhat.com>
 ;;;
 ;;; Clouseau is free software; you can redistribute it and/or modify
 ;;; it under the terms of the GNU General Public License as published by
@@ -74,6 +74,11 @@
     (testing "if the clouseau.core/get-and-check-port definition exists."
         (is (callable? 'clouseau.core/get-and-check-port))))

+(deftest test-show-help-existence
+    "Check that the clouseau.core/show-help definition exists."
+    (testing "if the clouseau.core/show-help definition exists."
+        (is (callable? 'clouseau.core/show-help))))
+
 (deftest test-cli-options-def-existence
     "Check that the clouseau.core/cli-options definition exists."
     (testing "if the hostname def exists"
@@ -101,7 +106,9 @@
     (testing "the function clouseau.core/get-port."
         (is (= (get-port "1")     "1"))
         (is (= (get-port "2")     "2"))
+        (is (= (get-port "2999")  "2999"))
         (is (= (get-port "3000")  "3000"))
+        (is (= (get-port "3001")  "3001"))
         (is (= (get-port "65534") "65534"))
         (is (= (get-port "65535") "65535"))))

@@ -110,10 +117,16 @@
     (testing "the function clouseau.core/get-port."
         (is (= (get-port nil)     "3000"))
         (is (= (get-port "")      "3000"))
-        (is (= (get-port 0)       "3000"))
-        (is (= (get-port 1)       "3000"))
-        (is (= (get-port 65535)   "3000"))
-        (is (= (get-port 65536)   "3000"))))
+        (is (= (get-port -1)      "3000")) ; not a string
+        (is (= (get-port 0)       "3000")) ; not a string
+        (is (= (get-port 1)       "3000")) ; not a string
+        (is (= (get-port 65535)   "3000")) ; not a string
+        (is (= (get-port 65536)   "3000")))) ; not a string
+
+(deftest test-get-port-zero
+    "Check the function clouseau.core/get-port."
+    (testing "the function clouseau.core/get-port."
+        (is (thrown? AssertionError (get-port "0")))))

 (deftest test-get-port-negative
     "Check the function clouseau.core/get-port."
@@ -121,6 +134,12 @@
         (is (thrown? AssertionError (get-port "0")))
         (is (thrown? AssertionError (get-port "-1")))
         (is (thrown? AssertionError (get-port "-2")))
+        (is (thrown? AssertionError (get-port "-65535")))
+        (is (thrown? AssertionError (get-port "-65536")))))
+
+(deftest test-get-port-too-big
+    "Check the function clouseau.core/get-port."
+    (testing "the function clouseau.core/get-port."
         (is (thrown? AssertionError (get-port "65536")))
         (is (thrown? AssertionError (get-port "65537")))
         (is (thrown? AssertionError (get-port "1000000")))))
@@ -133,14 +152,32 @@
         (is (= (get-and-check-port "65534") "65534"))
         (is (= (get-and-check-port "65535") "65535"))))

+(deftest test-get-and-check-port-zero
+    "Check the function clouseau.core/get-and-check-port."
+    (testing "the function clouseau.core/get-and-check-port."
+        (is (thrown? AssertionError (get-and-check-port "0")))))
+
 (deftest test-get-and-check-port-negative
     "Check the function clouseau.core/get-and-check-port."
     (testing "the function clouseau.core/get-and-check-port."
         (is (thrown? AssertionError (get-and-check-port "-1")))
-        (is (thrown? AssertionError (get-and-check-port "0")))
+        (is (thrown? AssertionError (get-and-check-port "-2")))
+        (is (thrown? AssertionError (get-and-check-port "-65536")))
+        (is (thrown? AssertionError (get-and-check-port "-65537")))
+        (is (thrown? AssertionError (get-and-check-port "-1000000")))))
+
+(deftest test-get-and-check-port-too-big
+    "Check the function clouseau.core/get-and-check-port."
+    (testing "the function clouseau.core/get-and-check-port."
         (is (thrown? AssertionError (get-and-check-port "65536")))
         (is (thrown? AssertionError (get-and-check-port "65537")))
         (is (thrown? AssertionError (get-and-check-port "1000000")))))
+
+(deftest test-get-and-check-port-wrong-argument
+    "Check the function clouseau.core/get-and-check-port."
+    (testing "the function clouseau.core/get-and-check-port."
+        (is (thrown? NumberFormatException (get-and-check-port nil)))
+        (is (thrown? NumberFormatException (get-and-check-port "")))))

 (deftest test-start-server-positive-1
     (testing "clouseau.core/start-server"
@@ -149,6 +186,8 @@
             (is (= {:port 1}     (start-server "1")))
             (is (= {:port 2}     (start-server "2")))
             (is (= {:port 1000}  (start-server "1000")))
+            (is (= {:port 1234}  (start-server "1234")))
+            (is (= {:port 3000}  (start-server "3000")))
             (is (= {:port 65534} (start-server "65534")))
             (is (= {:port 65535} (start-server "65535"))))))

@@ -159,6 +198,7 @@
             (is (= app (start-server "1")))
             (is (= app (start-server "2")))
             (is (= app (start-server "1000")))
+            (is (= app (start-server "3000")))
             (is (= app (start-server "65534")))
             (is (= app (start-server "65535"))))))

@@ -166,12 +206,20 @@
     (testing "clouseau.core/start-server"
         ; use mock instead of jetty/run-jetty
         (with-redefs [jetty/run-jetty (fn [app port] port)]
+            (is (= {:port -2}      (start-server "-2")))
             (is (= {:port -1}      (start-server "-1")))
             (is (= {:port 0}       (start-server "0")))
             (is (= {:port 65536}   (start-server "65536")))
             (is (= {:port 65537}   (start-server "65537")))
             (is (= {:port 1000000} (start-server "1000000"))))))

+(deftest test-show-help
+    (testing "clouseau.core/show-help"
+        ; use mock instead of println function
+        (with-redefs [println (fn [string] string)]
+            (is (= "help"         (show-help {:summary "help"})))
+            (is (= "line1\nline2" (show-help {:summary "line1\nline2"}))))))
+
 (deftest test-main-basic
     (testing "clouseau.core/-main"
         ; use mock instead of jetty/run-jetty
@@ -179,6 +227,12 @@
             (is (= {:port 3000}    (-main)))
             (is (= {:port 3000}    (-main "-1")))
             (is (= {:port 3000}    (-main "-p" "3000")))
-            (is (= {:port 9999}    (-main "-p" "9999")))
-            )))
-
+            (is (= {:port 9999}    (-main "-p" "9999"))))))
+
+(deftest test-main-show-help
+    (testing "clouseau.core/-main"
+        ; use mock instead of show-help function
+        (with-redefs [show-help (fn [string] "called")]
+            (is (= "called"    (-main "-h")))
+            (is (= "called"    (-main "--help"))))))
+


Adds generative test

Adds generative test

--- test/expound/spec_test.cljs
+++ test/expound/spec_test.cljs
@@ -609,13 +609,6 @@
 Detected 1 error"
          (e.s/pretty-explain-str :map-of-spec/name->age {:sally 30}))))

-(s/def :specs/string string?)
-(s/def :specs/vector vector?)
-(s/def :specs/int int?)
-(s/def :specs/boolean boolean?)
-(s/def :specs/keyword keyword?)
-(s/def :specs/map map?)
-
 (s/def :specs.coll-of/into #{[] '() #{}})
 (s/def :specs.coll-of/kind #{vector? list? set?})
 (s/def :specs.coll-of/count pos-int?)
@@ -634,29 +627,41 @@
 (defn apply-coll-of [spec {:keys [into kind count max-count min-count distinct gen-max gen-into gen] :as opts}]
   (s/coll-of spec :into into :kind kind :min-count min-count :max-count max-count :distinct distinct))

-(s/def :specs/spec
-  #{:specs/type
-    :specs/set})
+;; TODO - and
+;; TODO - or
+;; TODO - keys
+;; TODO - map-of
 ;; TODO - cat + alt, + ? *

-(deftest spec-combinations
+(def simple-spec-gen (gen/one-of
+                      [(gen/elements [vector?
+                                      int?
+                                      boolean?
+                                      keyword?
+                                      map?
+                                      symbol?
+                                      pos-int?
+                                      neg-int?
+                                      zero?])
+                       (gen/set gen/simple-type-printable)]))
+
+(deftest generated-simple-spec
   (checking
-   "explaining a spec failure doesn't throw an error"
+   "simple spec"
    20
-   [base-spec (gen/elements
-               [:specs/vector
-                :specs/int
-                :specs/boolean
-                :specs/keyword
-                :specs/map
-                #{:a :b :c}
-                #{}])
+   [simple-spec simple-spec-gen
+    :let [sp-form (s/form simple-spec)]
+    form gen/any-printable]
+   (e.s/pretty-explain-str simple-spec form)))
+
+(deftest generated-coll-of-specs
+  (checking
+   "coll-of spec"
+   20
+   [simple-spec simple-spec-gen
     coll-of-args (s/gen :specs/coll-of-args)
     ;; TODO - do i need to wrap this 'let'??
-    :let [coll-of-spec (apply-coll-of base-spec coll-of-args)]
-    sp (gen/elements
-        [base-spec
-         coll-of-spec])
-    :let [sp-form (s/form sp)]
+    :let [coll-of-spec (apply-coll-of simple-spec coll-of-args)]
+    :let [sp-form (s/form coll-of-spec)]
     form gen/any-printable]
-   (e.s/pretty-explain-str sp form)))
+   (e.s/pretty-explain-str coll-of-spec form)))


Comment pubsub problematic tests.

Comment pubsub problematic tests.

--- test/nanomsg/core_tests.clj
+++ test/nanomsg/core_tests.clj
@@ -89,32 +89,34 @@
       (is (= result1 [false true])))))

-(deftest socket-pub-sub
-  (let [p1 (promise)
-        p2 (promise)]
-    (future
-      (with-open [sock (nn/socket :sub {:connect s-bind-tcp})]
-        (nn/subscribe! sock (into-array Byte/TYPE [1]))
-        (let [received (nn/recv! sock)]
-          (deliver p1 received))))
+;; (deftest socket-pub-sub
+;;   (let [p1 (promise)
+;;         p2 (promise)]

-    (future
-      (with-open [sock (nn/socket :sub {:connect s-bind-tcp})]
-        (nn/subscribe! sock (into-array Byte/TYPE [0]))
-        (let [received (nn/recv! sock)]
-          (deliver p2 received))))
+;;     (future
+;;       (with-open [sock (nn/socket :sub)]
+;;         (nn/connect! sock s-bind-ipc)
+;;         (nn/subscribe! sock (into-array Byte/TYPE [1]))
+;;         (let [received (nn/recv! sock)]
+;;           (deliver p1 received))))

+;;     ;; (future
+;;     ;;   (with-open [sock (nn/socket :sub)]
+;;     ;;     (nn/connect! sock s-bind-ipc)
+;;     ;;     (nn/subscribe! sock (into-array Byte/TYPE [0]))
+;;     ;;     (let [received (nn/recv! sock)]
+;;     ;;       (deliver p2 received))))
+;;     (Thread/sleep 1000)
+;;     (with-open [sock (nn/socket :pub)]
+;;       (nn/bind! sock s-bind-ipc)
+;;       (nn/send! sock (into-buffer spec1 [true false])))

-    (with-open [sock (nn/socket :pub {:bind s-bind-tcp})]
-      (nn/send! sock (into-buffer spec1 [false true]))
-      (nn/send! sock (into-buffer spec1 [true false])))
-
-    (let [buffer1 (deref p1)
-          buffer2 (deref p2)
-          result1 (buf/read buffer1 spec1)
-          result2 (buf/read buffer2 spec1)]
-      (is (= result1 [true false]))
-      (is (= result2 [false true])))))
+;;     (let [buffer1 (deref p1)
+;;           ;; buffer2 (deref p2)
+;;           result1 (buf/read buffer1 spec1)]
+;;           ;; result2 (buf/read buffer2 spec1)]
+;;       (is (= result1 [true false])))))
+;;       ;; (is (= result2 [false true])))))

 (deftest socket-bus
   (let [p1 (promise)


Fix log test.

Fix log test.

--- test/onyx/log/full_test.clj
+++ test/onyx/log/full_test.clj
@@ -11,19 +11,9 @@

 (def config (read-string (slurp (clojure.java.io/resource "test-config.edn"))))

-(def scheduler :onyx.job-scheduler/greedy)
+(def env-config (assoc (:env-config config) :onyx/id id))

-(def env-config
-  {:zookeeper/address (:address (:zookeeper config))
-   :zookeeper/server? true
-   :zookeeper.server/port (:spawn-port (:zookeeper config))
-   :onyx/id onyx-id})
-
-(def peer-config
-  {:zookeeper/address (:address (:zookeeper config))
-   :onyx/id onyx-id
-   :onyx.messaging/impl :http-kit-websockets
-   :onyx.peer/job-scheduler scheduler})
+(def peer-config (assoc (:peer-config config) :onyx/id id))

 (def env (onyx.api/start-env env-config))


Fix comment

Fix comment

--- test/overseer/core_test.clj
+++ test/overseer/core_test.clj
@@ -102,8 +102,8 @@

       (is (= (->job-tempid :result1)
              (:job/dep (nth edge-assertions 2)))
-          ":finish depends on :result1")
+          ":publish depends on :result1")

       (is (= (->job-tempid :result2)
              (:job/dep (nth edge-assertions 3)))
-          ":finish depends on :result2")))
+          ":publish depends on :result2")))


Don't need pass connection pools around during client tests anymore

--- test/picard/test/client.clj
+++ test/picard/test/client.clj
@@ -102,47 +102,46 @@
 (defcoretest simple-keep-alive-requests
   [_ ch2]
   :hello-world
-  (let [pool (client/mk-pool)]
-    (client/request
-     pool ["localhost" 4040]
-     [{:path-info "/" :request-method "GET"}]
-     (fn [_ evt val] (enqueue ch2 [evt val])))
-
-    (is (next-msgs-for
-         ch2
-         :response   [200 {"content-length" "5"} "Hello"]))
-
-    (client/request
-     pool ["localhost" 4040]
-     [{:path-info "/" :request-method "GET"}]
-     (fn [_ evt val] (enqueue ch2 [evt val])))
-
-    (is (next-msgs-for
-         ch2
-         ;; :connected nil
-         :response   [200 {"content-length" "5"} "Hello"]))
-
-    (client/request
-     pool ["localhost" 4040]
-     [{:path-info          "/zomg"
-       :request-method     "POST"
-       "transfer-encoding" "chunked"
-       "connection"        "close"}
-      :chunked]
-     (fn [upstream-fn evt val]
-       (enqueue ch2 [evt val])
-       (when (= :connected evt)
-         (upstream-fn :body "HELLO")
-         (upstream-fn :body "WORLD")
-         (upstream-fn :done nil))))
-
-    (is (next-msgs-for
-         ch2
-         :connected nil
-         :response   [200 {"content-length" "5"} "Hello"]))
-
-    ;; 2 is to account for the connection test-helper makes
-    (is (= 2 (count (netty-connect-evts))))))
+  (client/request
+   ["localhost" 4040]
+   [{:path-info "/" :request-method "GET"}]
+   (fn [_ evt val] (enqueue ch2 [evt val])))
+
+  (is (next-msgs-for
+       ch2
+       :response   [200 {"content-length" "5"} "Hello"]))
+
+  (client/request
+   ["localhost" 4040]
+   [{:path-info "/" :request-method "GET"}]
+   (fn [_ evt val] (enqueue ch2 [evt val])))
+
+  (is (next-msgs-for
+       ch2
+       ;; :connected nil
+       :response   [200 {"content-length" "5"} "Hello"]))
+
+  (client/request
+   ["localhost" 4040]
+   [{:path-info          "/zomg"
+     :request-method     "POST"
+     "transfer-encoding" "chunked"
+     "connection"        "close"}
+    :chunked]
+   (fn [upstream-fn evt val]
+     (enqueue ch2 [evt val])
+     (when (= :connected evt)
+       (upstream-fn :body "HELLO")
+       (upstream-fn :body "WORLD")
+       (upstream-fn :done nil))))
+
+  (is (next-msgs-for
+       ch2
+       :connected nil
+       :response   [200 {"content-length" "5"} "Hello"]))
+
+  ;; 2 is to account for the connection test-helper makes
+  (is (= 2 (count (netty-connect-evts)))))

 (defcoretest issuing-pause-resume
   [ch1 ch2]
@@ -247,7 +246,3 @@
   (is (next-msgs-for
        ch2
        :abort (cmp-with #(instance? Exception %)))))
-
-;; MISSING TESTS
-;; * Issuing :pause :resume to the client
-;; * First write failing


Update bench specs for core atoms.

Update bench specs for core atoms.

--- test/riemann/test/bench.clj
+++ test/riemann/test/bench.clj
@@ -109,9 +109,8 @@
    (let [core (core)
          servers [(tcp-server core) (udp-server core)]
          streams (or (:streams opts) [])]
-     (dosync
-        (alter (core :servers) concat servers)
-        (alter (core :streams) concat streams))
+     (swap! (core :servers) concat servers)
+     (swap! (core :streams) concat streams)
      {:core core
       :servers servers
       :streams streams})))


Replace first keep with some.

Replace first keep with some.

--- src/cljs/kixi/nhs/exploration_ui/data.cljs
+++ src/cljs/kixi/nhs/exploration_ui/data.cljs
@@ -71,10 +71,10 @@
       (s->timestamps s (.-source parser)))))

 (defn parse-date [s]
-  (first (keep (fn [p]
-                 (let [d (parse p s)]
-                   (when-not (nil? d)
-                     d))) parsers)))
+  (some (fn [p]
+          (let [d (parse p s)]
+            (when-not (nil? d)
+              d))) parsers))

 (defn ckan-host []
   "http://54.154.11.196/api/3/action/")


Add support for transit+msgpack.

Add support for transit+msgpack.

--- src/clojure/catacumba/handlers/parsing.clj
+++ src/clojure/catacumba/handlers/parsing.clj
@@ -59,10 +59,13 @@

 (defmethod parse :application/transit+json
   [^Context ctx ^TypedData body]
-  (transit/read
-   (transit/reader
-    (.getInputStream body)
-    :json)))
+  (let [reader (transit/reader (.getInputStream body) :json)]
+    (transit/read reader)))
+
+(defmethod parse :application/transit+msgpack
+  [^Context ctx ^TypedData body]
+  (let [reader (transit/reader (.getInputStream body) :msgpack)]
+    (transit/read reader)))

 (defn body-params
   "A route chain that parses the body into


Fix typo in by-path docstring

Fix typo in by-path docstring

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -1255,7 +1255,7 @@
   (by-name names files true))

 (defn by-path
-  "This function takes two arguments: `paths` and `files`, where `path` is
+  "This function takes two arguments: `paths` and `files`, where `paths` is
   a seq of path strings like `[\"a/b/c/foo.clj\" \"bar.xml\"]` and `files` is
   a seq of file objects. Returns a seq of the files in `files` which have file
   paths listed in `paths`."


fixed max-eid, restricted __hash to clj only

--- src/datascript/core.cljc
+++ src/datascript/core.cljc
@@ -478,30 +478,33 @@
     :max-eid 0
     :max-tx  tx0
     :rschema (rschema schema)
-    :__hash  (atom nil)}))
+    #?@(:clj [:__hash (atom nil)])}))

 (defn init-db [datoms & [schema]]
-  (let [datoms  (into-array datoms)
-        len     (alength datoms)
-        max-eid (if (pos? len) (.-e (aget datoms (dec len))) 0) ; assign before mutable sorts below
-        #?@(:cljs
-            [eavt    (btset/-btset-from-sorted-arr (.sort datoms cmp-datoms-eavt-quick) cmp-datoms-eavt)
-             aevt    (btset/-btset-from-sorted-arr (.sort datoms cmp-datoms-aevt-quick) cmp-datoms-aevt)
-             avet    (btset/-btset-from-sorted-arr (.sort datoms cmp-datoms-avet-quick) cmp-datoms-avet)]
-            :clj
-            [eavt    (btset/btset-by datoms cmp-datoms-eavt)
-             aevt    (btset/btset-by datoms cmp-datoms-aevt)
-             avet    (btset/btset-by datoms cmp-datoms-avet)])
-        max-tx  (transduce (map #(.-tx %)) max tx0 datoms)]
-    (map->DB {
-      :schema  (validate-schema schema)
-      :eavt    eavt
-      :aevt    aevt
-      :avet    avet
-      :max-eid max-eid
-      :max-tx  max-tx
-      :rschema (rschema schema)
-      :__hash  (atom nil)})))
+  (if (empty? datoms)
+    (empty-db schema)
+    (let [_ (validate-schema schema)
+          #?@(:cljs
+              [ds-arr  (into-array datoms)
+               eavt    (btset/-btset-from-sorted-arr (.sort ds-arr cmp-datoms-eavt-quick) cmp-datoms-eavt)
+               aevt    (btset/-btset-from-sorted-arr (.sort ds-arr cmp-datoms-aevt-quick) cmp-datoms-aevt)
+               avet    (btset/-btset-from-sorted-arr (.sort ds-arr cmp-datoms-avet-quick) cmp-datoms-avet)
+               max-eid (.-e (first (-rseq eavt)))]
+              :clj
+              [eavt    (btset/btset-by datoms cmp-datoms-eavt)
+               aevt    (btset/btset-by datoms cmp-datoms-aevt)
+               avet    (btset/btset-by datoms cmp-datoms-avet)
+               max-eid (.-e (first (rseq eavt)))])
+          max-tx (transduce (map #(.-tx %)) max tx0 eavt)]
+      (map->DB {
+        :schema  schema
+        :eavt    eavt
+        :aevt    aevt
+        :avet    avet
+        :max-eid max-eid
+        :max-tx  max-tx
+        :rschema (rschema schema)
+        #?@(:clj [:__hash (atom nil)])}))))

 (defn- equiv-db-index [x y]
   (and (= (count x) (count y))


[#5938] [desktop] switch editing mode when leaving profile

--- src/status_im/ui/screens/desktop/main/tabs/profile/views.cljs
+++ src/status_im/ui/screens/desktop/main/tabs/profile/views.cljs
@@ -121,4 +121,6 @@
 (views/defview profile-data []
   (views/letsubs
     [user [:get-current-account]]
+    {:component-will-unmount
+     #(re-frame/dispatch [:set :my-profile/editing? false])}
     [profile user]))


fixed intendation

fixed intendation

--- src/distillery/tasks.clj
+++ src/distillery/tasks.clj
@@ -25,9 +25,9 @@
   [msg & body]
   `(do
      (print-progress (str "BEGIN " ~msg "..."))
-       (let [result# (time (do ~@body))]
-         (print-progress (str "END   " ~msg))
-         result#)))
+     (let [result# (time (do ~@body))]
+       (print-progress (str "END   " ~msg))
+       result#)))

 (defn- load-speech-recognition-result


Added a test for parameter at the end of uri.

--- test/meerkat/httpservice/routing_test.clj
+++ test/meerkat/httpservice/routing_test.clj
@@ -106,6 +106,18 @@
       (let [recorded-context (test-common/get-recorded)]
         (is (= "/test/entity1/list" (get-in recorded-context [:request :uri])))
         (is (= {:param1 "entity1"} (get-in recorded-context [:request :parameters]))))))
+  (testing "Appropriate handler must be invoked for particular uri with a parameter at the end."
+    (let
+      [routing-configuration
+       (-> (routing/register-default-handler (fn [_]))
+           (routing/register-handler :GET "/test/:param1" test-common/record)
+           (routing/register-handler :GET "/test/:param1/info" (fn [_])))
+       router (routing/build-router routing-configuration)
+       context {:request {:uri "/test/entity1" :method :GET}}]
+      (router context)
+      (let [recorded-context (test-common/get-recorded)]
+        (is (= "/test/entity1" (get-in recorded-context [:request :uri])))
+        (is (= {:param1 "entity1"} (get-in recorded-context [:request :parameters]))))))
   (testing "Appropriate handler must be invoked for particular uri with two parameters."
     (let
       [routing-configuration


Update core.clj

Update core.clj

update Versuch vorbereitet (auskommentiert)

--- src/hello_world/core.clj
+++ src/hello_world/core.clj
@@ -23,6 +23,8 @@
 (defn sqlquery [name]

 (first (jdbc/query mysql-db [(str "select * from konten where Name='" name "'")])))
+;(jdbc/update! mysql-db :konten {:Guthaben 99} ["Name = ?" name]))
+;maybe this sets the guthaben to 99

 (defn page [name]
   (str "<html><body>"


Correct version regexp

Correct version regexp

--- src/kixi/datastore/communication_specs.clj
+++ src/kixi/datastore/communication_specs.clj
@@ -10,7 +10,7 @@
                  :kixi.datastore/file-segmentation-created
                  :kixi.datastore/schema-created})

-(s/def ::version (s/and string? #(re-matches #"\d.\d.\d" %)))
+(s/def ::version (s/and string? #(re-matches #"\d+\.\d+\.\d+" %)))

 (defmulti file-metadata-updated-type ::file-metadata-update-type)


fix hooks for clj

fix hooks for clj

--- src/rum/core.clj
+++ src/rum/core.clj
@@ -367,11 +367,11 @@

 (defn use-state [value-or-fn]
   (if (fn? value-or-fn)
-    (value-or-fn)
-    value-or-fn))
+    [(value-or-fn) identity]
+    [value-or-fn identity]))

 (defn use-reducer [reducer-fn initial-value]
-  initial-value)
+  [initial-value reducer-fn])

 (defn use-effect!
   ([setup-fn])


Add mappings for BBH and NBH

Add mappings for BBH and NBH

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -108,6 +108,8 @@
   {1 "DBh, Marburg"
    101 "DBh, Marburg"
    2 "BHB, Berlin"
+   4 "NBH, Hamburg"
+   5 "BBH, München"
    6 "WBH, Münster"
    8 "SBH, Stuttgart"
    11 "DKBB, Bonn"


Remove non-printable chars from titles

Remove non-printable chars from titles

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -161,6 +161,9 @@
          (string/join " ")
          string/trim)))

+(defn remove-nonprintable-chars [s]
+  (string/replace s #"[¶]" ""))
+
 (defn clean-raw-item
   "Return a proper production based on a raw item, i.e.
   translate the language tag into proper ISO 639-1 codes"
@@ -169,7 +172,7 @@
            series-title-raw series-volume-raw duration
            volumes-raw narrator producer-long-raw
            game-category-raw game-description-raw game-materials-raw
-           braille-grade-raw ] :as item
+           braille-grade-raw title] :as item
     :or {genre-raw "x01"}}]
   (let [rucksackbuch-number (when (and series-title-raw
                                        (re-find #"^Rucksackbuch" series-title-raw))
@@ -177,6 +180,7 @@
         fmt (format-raw-to-format format-raw)]
     (-> item
         (assoc-some
+         :title (remove-nonprintable-chars title)
          :language (iso-639-2-to-iso-639-1 language)
          :genre (or (genre-raw-to-genre (subs genre-raw 0 1))
                     (genre-code-to-genre (subs genre-code 0 2)))


update documentation for custom keyword function

--- src/cheshire/core.clj
+++ src/cheshire/core.clj
@@ -70,8 +70,8 @@
 ;; Parsers
 (defn parse-string
   "Returns the Clojure object corresponding to the given JSON-encoded string.
-  keywords? should be true if keyword keys are needed, the default is false
-  maps will use strings as keywords.
+  An optional key-fn argument can be either true (to coerce keys to keywords),
+  false to leave them as strings, or a function to provide custom coercion.

   The array-coerce-fn is an optional function taking the name of an array field,
   and returning the collection to be used for array values."
@@ -84,8 +84,9 @@

 (defn parse-stream
   "Returns the Clojure object corresponding to the given reader, reader must
-  implement BufferedReader. keywords? should be true if keyword keys are needed
-  the default is false, maps will use strings as keywords.
+  implement BufferedReader. An optional key-fn argument can be either true (to
+  coerce keys to keywords),false to leave them as strings, or a function to
+  provide custom coercion.

   The array-coerce-fn is an optional function taking the name of an array field,
   and returning the collection to be used for array values.
@@ -98,8 +99,8 @@

 (defn parse-smile
   "Returns the Clojure object corresponding to the given SMILE-encoded bytes.
-  keywords? should be true if keyword keys are needed, the default is false
-  maps will use strings as keywords.
+  An optional key-fn argument can be either true (to coerce keys to keywords),
+  false to leave them as strings, or a function to provide custom coercion.

   The array-coerce-fn is an optional function taking the name of an array field,
   and returning the collection to be used for array values."


minor

minor

--- src/client/state.cljs
+++ src/client/state.cljs
@@ -18,7 +18,7 @@
 ;; ie: in the lobby waiting, playing a round, how much time is left, etc
 (def round-state (atom nil))

-;; a map of all the players currently connected and their board states
+;; a map of all the players currently connected and their states
 (def players (atom {}))

 ;; current player's username


remove dead comment

remove dead comment

--- src/clj/cljs/repl.clj
+++ src/clj/cljs/repl.clj
@@ -204,10 +204,6 @@
             (print js))
           (let [ret (-evaluate repl-env filename (:line (meta form)) wrap-js)]
             (case (:status ret)
-              ;;we eat ns errors because we know goog.provide() will throw when reloaded
-              ;;TODO - file bug with google, this is bs error
-              ;;this is what you get when you try to 'teach new developers'
-              ;;via errors (goog/base.js 104)
               :error (display-error ret form)
               :exception (display-error ret form
                            (if (:repl-verbose opts)


Big simplification of the HDF code.

Big simplification of the HDF code.

--- src/clj/forma/hdf.clj
+++ src/clj/forma/hdf.clj
@@ -4,7 +4,7 @@
                   [io :only (temp-dir)])
         (clojure.contrib [io :only (file copy delete-file-recursively)]
                          [string :only (substring? as-str)]))
-  (:import [java.util Map$Entry Hashtable]
+  (:import [java.util Hashtable]
            [java.io File]
            [org.gdal.gdal gdal Dataset Band]
            [org.gdal.gdalconst gdalconstConstants]
@@ -43,85 +43,56 @@
   ([modis]
      (metadata modis "")))

-(defn subdatasets-dict
-  "Returns the SUBDATASETS metadata Hashtable for a given filepath."
+
+;; TODO -- describe why we only take the names business. It's because we're
+;; skipping the descriptions.
+
+(defn subdataset-names
+  "Returns the NAME entries of the SUBDATASETS metadata Hashtable for
+  a given filepath."
   [hdf-file]
   (let [path (str hdf-file)
         dataset (gdal/Open path)]
     (try
-      (metadata dataset "SUBDATASETS")
+      (vals (filter #(substring? "_NAME" (key %))
+                    (metadata dataset "SUBDATASETS")))
       (finally (.delete dataset)))))

-(defn lookup
-  "Looks up a key in the supplied hashtable."
-  [key ^Hashtable table]
-  (.get table key))
+;; The MODIS SUBDATASET dictionary holds entries of the form:
+;; Key: SUBDATASET_2_NAME
+;; Val: HDF4_EOS:EOS_GRID:"/path/to/modis.hdf":MOD_Grid_monthly_1km_VI:1 km
+;; monthly EVI
+;; Key: SUBDATASET_4_DESC

-(defn split-entry
-  "Splits a given Entry into its map and key."
-  [^Map$Entry entry]
-  (vector (.getValue entry) (.getKey entry)))
-
+;; TODO --udpate docs
 (defn subdataset-key
-  "Takes a long-form description of a NASA MODIS dataset, and checks
+  "Takes a long-form path to a MODIS subdataset, and checks
   to see if any of the values of the modis-subsets map can be found as
   substrings. If we find one, we return the associated key, cast to a
   String."
-  [str]
-  (some #(if (substring? (% modis-subsets) str) (as-str %))
-          (keys modis-subsets)))
+  [path]
+  (some #(if (substring? (% modis-subsets) path) (as-str %))
+        (keys modis-subsets)))

+;;  TODO-- check docs
 (defn dataset-filter
-  "Generates a predicate function that checks the a Hashtable entry
+  "Generates a predicate function that checks the a subdataset name
    from the SUBDATASETS metadata dictionary against a supplied set of
    acceptable datasets."
   [good-keys]
   (let [substrings (map modis-subsets good-keys)]
-    (fn [entry]
-      (let [[val key] (split-entry entry)]
-        (and (substring? "_NAME" key)
-             (some #(substring? % val) substrings))))))
+    (fn [name]
+      (some #(substring? % name) substrings))))

+;; TODO --update docs
 (defn make-subdataset
-  "Accepts an entry from the SUBDATASETS Hashtable of a MODIS Dataset,
-   and returns a 2-tuple - (modis-subsets key, Dataset)."
-  [entry]
-  (let [[path] (split-entry entry)]
-    (vector (subdataset-key path) (gdal/Open path))))
-
-(defn raster-array
-  "Unpacks the data inside of a MODIS band into a 1xN integer array."
-  [^Dataset data]
-  (let [^Band band (.GetRasterBand data 1)
-        type (gdalconstConstants/GDT_UInt16)
-        width (.GetXSize band)
-        height (.GetYSize band)
-        ret (int-array (* width height))]
-    (do (.ReadRaster band 0 0 width height type ret) ret)))
-
-(defn tile-position
-  "For a given MODIS chunk and index within that chunk, returns [line,
-  sample] within the MODIS tile."
-  [chunk index]
-  (let [line (* chunk chunk-size)
-        sample (+ line index)]
-    (vector line sample)))
-
-(defn split-id
-  "Splits the TileID metadata string into integer x and y,
-  representing MODIS tile coordinates."
-  [tileid]
-  (let [[_ _ tile-x tile-y] (re-find #"(\d{2})(\d{3})(\d{3})" tileid)]
-    (map #(Integer/parseInt %) [tile-x tile-y])))
+  "Accepts an entry from the SUBDATASETS Hashtable of a MODIS
+ Dataset (remember, this is just a path to the subdataset), and
+ returns a 2-tuple - (modis-subsets key, Dataset)."
+  [path]
+  (vector (subdataset-key path) (gdal/Open path)))

 ;; ##Cascalog Custom Functions
-
-(defmapop
-  #^{:doc "Generates metadata values for a given unpacked MODIS
-Dataset and a seq of keys."}
-  [meta-values [meta-keys]] [modis]
-  (let [metadict (metadata modis)]
-    (map #(lookup % metadict) meta-keys)))

 (defmapcatop
   #^{:doc "Stateful approach to unpacking HDF files. Registers all
@@ -141,6 +112,47 @@
        (do
          (copy bytes temp-hdf)
          (map make-subdataset
-              (filter keep? (subdatasets-dict temp-hdf))))))
+              (filter keep? (subdataset-names temp-hdf))))))
   ([tdir]
-     (delete-file-recursively tdir)))+     (delete-file-recursively tdir)))
+
+;; ## Dataset Chunking
+;; This needs some more documentation, but these are the functions
+;; that deal with opened datasets.
+
+(defn lookup
+  "Looks up a the value for a given key in the supplied hashtable."
+  [key ^Hashtable table]
+  (.get table key))
+
+(defmapop
+  #^{:doc "Generates metadata values for a given unpacked MODIS
+Dataset and a seq of keys."}
+  [meta-values [meta-keys]] [modis]
+  (let [metadict (metadata modis)]
+    (map #(lookup % metadict) meta-keys)))
+
+(defn split-id
+  "Splits the TileID metadata string into integer x and y,
+  representing MODIS tile coordinates."
+  [tileid]
+  (let [[_ _ tile-x tile-y] (re-find #"(\d{2})(\d{3})(\d{3})" tileid)]
+    (map #(Integer/parseInt %) [tile-x tile-y])))
+
+(defn raster-array
+  "Unpacks the data inside of a MODIS band into a 1xN integer array."
+  [^Dataset data]
+  (let [^Band band (.GetRasterBand data 1)
+        type (gdalconstConstants/GDT_UInt16)
+        width (.GetXSize band)
+        height (.GetYSize band)
+        ret (int-array (* width height))]
+    (do (.ReadRaster band 0 0 width height type ret) ret)))
+
+(defn tile-position
+  "For a given MODIS chunk and index within that chunk, returns [line,
+  sample] within the MODIS tile."
+  [chunk index]
+  (let [line (* chunk chunk-size)
+        sample (+ line index)]
+    (vector line sample)))


Remove hard coded roles as they are now actually in LDAP

--- src/clj/mdr2/ldap.clj
+++ src/clj/mdr2/ldap.clj
@@ -40,9 +40,7 @@
                    (map extract-role)
                    (map keyword)
                    (remove nil?)
-                   set)
-        roles (conj (conj roles :admin) :it) ; FIXME: this is a temporary workaround
-        ]
+                   set)]
     (assoc user :roles roles)))

 (defn authenticate [username password & [attributes]]


figwheel.main: only join in certain cases

--- figwheel-main/src/figwheel/main.cljc
+++ figwheel-main/src/figwheel/main.cljc
@@ -1174,7 +1174,6 @@
                              "<cljs repl>"
                              ;; todo allow opts to be added here
                              (first (ana-api/forms-seq (StringReader. eval-str)))))
-
   (when-let [server (and join? @(:server repl-env))]
     (.join server)))

@@ -1317,8 +1316,9 @@
                   (serve {:repl-env repl-env
                           :repl-options repl-options
                           :join? (get b-cfg ::join-server? true)})
-                  ;; finally if we have a watcher running join it
-                  (fww/running?)
+                  ;; the final case is compiling without a repl or a server
+                  ;; if there is a watcher running join it
+                  (and (fww/running?) (get b-cfg ::join-server? true))
                   (fww/join))))))))))

 (defn start-build-arg->build-options [build]


handle printing redirection on the client side

--- figwheel-repl/src/figwheel/repl.cljc
+++ figwheel-repl/src/figwheel/repl.cljc
@@ -8,6 +8,8 @@
               [goog.net.jsloader :as loader]
               [goog.net.XhrIo :as xhrio]
               [goog.log :as glog]
+              [goog.array :as garray]
+              [goog.json :as gjson]
               [goog.html.legacyconversions :as conv]
               [goog.userAgent.product :as product]]
        :clj [[clojure.data.json :as json]
@@ -217,6 +219,34 @@
   (swap! reload-promise-chain #(.then % (fn [_] (Promise. f)))))

 ;; --------------------------------------------------------------
+;; REPL print forwarding
+;; --------------------------------------------------------------
+
+(goog-define print-output "console,repl")
+
+(defn print-receivers [outputs]
+  (->> (string/split outputs #",")
+       (map string/trim)
+       (filter (complement string/blank?))
+       (map keyword)
+       distinct))
+
+(defmulti out-print (fn [k args] k))
+(defmethod out-print :console [_ args]
+  (.apply (.-log js/console) js/console (garray/clone (to-array args))))
+
+(defmulti err-print (fn [k args] k))
+(defmethod err-print :console [_ args]
+  (.apply (.-error js/console) js/console (garray/clone (to-array args))))
+
+(defn setup-printing! []
+  (let [printers (print-receivers print-output)]
+    (set-print-fn! (fn [& args] (doseq [p printers] (out-print p args))))
+    (set-print-err-fn! (fn [& args] (doseq [p printers] (err-print p args))))))
+
+#_ (printing-receivers "console,repl")
+
+;; --------------------------------------------------------------
 ;; Websocket REPL
 ;; --------------------------------------------------------------

@@ -237,13 +267,12 @@
 (defn ^:export session-name [] (get-state ::session-name))
 (defn ^:export session-id [] (get-state ::session-id))

-(defn response-for [{:keys [uuid websocket]} response-body]
+(defn response-for [{:keys [uuid]} response-body]
   (cond->
-        {:uuid uuid
-         :session-name (session-name)
-         :response response-body}
-    (and (nil? websocket) (session-id))
-    (assoc :session-id (session-id))))
+      {:session-id   (session-id)
+       :session-name (session-name)
+       :response response-body}
+    uuid (assoc :uuid uuid)))

 (defn respond-to [{:keys [websocket http-url] :as old-msg} response-body]
   (let [response (response-for old-msg response-body)]
@@ -268,6 +297,7 @@
 (def ^:dynamic *eval-js* js/eval)

 (let [ua-product-fn
+      ;; TODO make sure this works on other platforms
       #(cond
          (not (nil? goog/nodeGlobalRequire)) :chrome
          product/SAFARI    :safari
@@ -278,6 +308,7 @@
     (let [ua-product (ua-product-fn)]
       (try
         (let [sb (js/goog.string.StringBuffer.)]
+          ;; TODO capture err as well?
           (binding [cljs.core/*print-newline* false
                     cljs.core/*print-fn* (fn [x] (.append sb x))]
             (let [result-value (*eval-js* code)]
@@ -321,8 +352,21 @@
 (defn exponential-backoff [attempt]
   (* 1000 (min (js/Math.pow 2 attempt) 20)))

+(defn hook-repl-printing-output! [respond-msg]
+  (defmethod out-print :repl [_ args]
+    (glog/info logger (str "Printing" (pr-str args)))
+    (respond-to respond-msg
+                {:output true
+                 :stream :out
+                 :args (mapv #(if (string? %) % (gjson/serialize %)) args)}))
+  (defmethod err-print :repl [_ args]
+    (respond-to respond-msg
+                {:output true
+                 :stream :err
+                 :args (mapv #(if (string? %) % (gjson/serialize %)) args)}))
+  (setup-printing!))
+
 (defn ws-connect [& [websocket-url']]
-  ;; TODO take care of forwarding print output to the connection
   (let [websocket (goog.net.WebSocket.)
         url (str (make-url websocket-url'))]
     (patch-goog-base)
@@ -339,6 +383,7 @@
                                  (glog/error logger e))))))
       (.addEventListener goog.net.WebSocket.EventType.OPENED
                          (fn [e]
+                           (hook-repl-printing-output! {:websocket websocket})
                            (js/console.log "OPENED")
                            (js/console.log e)))
       (.open url))))
@@ -390,6 +435,8 @@
              (let [typ (gobj/get msg "connection-type")]
                (glog/info logger (str "Connected: " typ))
                (msg-fn msg)
+               ;; after connecting setup printing redirects
+               (hook-repl-printing-output! {:http-url surl})
                (if (= typ "http-long-polling")
                  (long-poll msg-fn connect-url')
                  (poll msg-fn connect-url'))))


procfile

procfile

--- src/spc/core.clj
+++ src/spc/core.clj
@@ -9,5 +9,5 @@
   (-> handler))

 (defn -main []
-  ([let port (Integer/parseInt (get (System/getenv) "PORT" "5000"))]
+  (let [port (Integer/parseInt (get (System/getenv) "PORT" "5000"))]
     (defonce server (run-jetty app { :port port }))))


Remove errant debugging

Remove errant debugging

--- frontend/components/account.cljs
+++ frontend/components/account.cljs
@@ -146,7 +146,6 @@
                :data-failed-text  "Failed to add token",
                :data-success-text "Created",
                :on-click          #(do (create-token! (om/get-state owner :token-label))
-                                       (js/alert "Return false")
                                        false)
                :type "submit"
                :value "Create"}])]]


Demo piano# too.

Demo piano# too.

--- src/overtunes/songs/canone_alla_quarta.clj
+++ src/overtunes/songs/canone_alla_quarta.clj
@@ -20,8 +20,8 @@
         notes (map vector (range start end note-length) pitches)]
     (play# notes)))

+;(piano# 50)
 ;(demo# (range 60 73))
-

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


added POST method on /post

added POST method on /post

--- instapapure.clj
+++ instapapure.clj
@@ -15,11 +15,18 @@
     (html
       [:strong "Pong"])))

+(defn post [location title]
+  (layout (str "Posted " title)
+    (html
+      [:a {:href location} title])))
+
 (defroutes instapapure-app
    (GET "/public/*"
      (or (serve-file (params :*)) :next))
    (GET "/ping"
      (ping))
+   (POST "/post"
+       (post (:l params) (:t params)))
    (ANY "*"
      (page-not-found)))


Basic grid generation (no display yet)

Basic grid generation (no display yet)

--- app/pyrexia/src/pyrexia/core.cljs
+++ app/pyrexia/src/pyrexia/core.cljs
@@ -50,6 +50,80 @@
        (send (str "http://" (cljs-env :es-host "localhost") ":9200/" log "/_search") "POST" payload))
 	   ))

+(defn contains [coll key]
+	(not (not-any? #(= % key) coll))
+)
+
+(defn weighted-average [values]
+	(let [
+			distances (seq (map :distance values))
+			weights (map #(/ 1 (+ % 1)) distances)
+			weightTotal (apply + weights)
+			weightedValues (map #(/ (:value %) (+ 1 (:distance %))) values)
+			weightedSum (apply + weightedValues)
+		]
+		(.log js/console "wa" weightedSum weightTotal (/ weightedSum weightTotal))
+		(/ weightedSum weightTotal)
+	)
+)
+
+(defn temp-for-locations [boxWidth boxHeight]
+	(let [
+		locations (:locations @app-state)
+		nodes (:nodes @app-state)
+	]
+		(.log js/console "tl-beg" (keys locations) (keys nodes) (keys @app-state))
+		(for [
+				node (keys locations)
+				:when (contains (keys nodes) node)
+				:let [
+					location (get locations node)
+					data (get nodes node)
+				]
+			]
+			(do
+				(.log js/console "tl" location data)
+				{:location location :temp (:temp data)}
+			)
+		)
+	)
+)
+
+(defn rangeValues [node x y]
+	{:value (:temp node) :distance (Math/sqrt (+
+		(Math/pow (- (-> node :location first) x) 2.0)
+		(Math/pow (- (-> node :location second) y) 2.0)))}
+)
+
+(defn draw-map [canvas mapImage]
+	(set! (.-width canvas) (.-width mapImage))
+	(set! (.-height canvas) (.-height mapImage))
+	(let [
+		context (.getContext canvas "2d")
+		gridSize 2
+		boxWidth (/ (.-width canvas) gridSize)
+		boxHeight (/ (.-height canvas) gridSize)
+		values (-> (:nodes @app-state) vals)
+		temp (-> (temp-for-locations boxWidth boxHeight) seq)
+		grid (apply merge (for
+			[x (range gridSize) y (range gridSize)]
+			{[x y] (weighted-average (map #(rangeValues % x y) temp))}
+		))
+		minTemp (apply min (vals grid))
+		maxTemp (apply max (vals grid))
+		]
+		(.drawImage context mapImage 0 0)
+		(.log js/console "max" minTemp maxTemp)
+		(.fillRect context 0 0 boxWidth boxHeight)
+		(set! (.-fillStyle context) "#ff0000")
+		(set! (.-globalAlpha context) .5)
+		(.log js/console context)
+		(.fillRect context 100 100 10 10)
+	)
+)
+
+(def canvas-dom (.getElementById js/document "map"))
+
 (defn parse-nodes [node-data node-key]
     (let [
         buckets (-> node-data :aggregations :group_by_state :buckets)
@@ -58,6 +132,7 @@
         (.log js/console "nodes" (pr-str nodes))
         (swap! app-state assoc node-key nodes)
 		(swap! app-state assoc :nodes (merge (:old-nodes @app-state) (:new-nodes @app-state)))
+		(draw-map canvas-dom (:map @app-state))
     )
 )

@@ -109,18 +184,6 @@
 (om/root sensors-view app-state
   {:target (. js/document (getElementById "sensors"))})

-(defn draw-map [canvas mapImage]
-	(set! (.-width canvas) (.-width mapImage))
-	(set! (.-height canvas) (.-height mapImage))
-	(let [context (.getContext canvas "2d")]
-		(.drawImage context mapImage 0 0)
-		(set! (.-fillStyle context) "#ff0000")
-		(.fillRect context 100 100 10 10)
-	)
-)
-
-(def canvas-dom (.getElementById js/document "map"))
-
 (defn map-image []
 	(let [img (js/Image.)]
 		(set! (.-src img) "map.png")


Add connected? to app-state

Add connected? to app-state

--- frontend/src/cruncher/utils/lib.cljs
+++ frontend/src/cruncher/utils/lib.cljs
@@ -10,7 +10,8 @@
                                 :logged-in? false}
             :error             {:message nil}
             :info              {:message nil}
-            :app               {:loading? false}
+            :app               {:loading?   false
+                                :connected? nil}
             :progress          {:running   false
                                 :to_delete 100
                                 :deleted   0


temporary fix to missing call

temporary fix to missing call

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

--- plugins/DataBrowser/src/org/micromanager/browser/core.clj
+++ plugins/DataBrowser/src/org/micromanager/browser/core.clj
@@ -27,7 +27,8 @@
            [java.awt.event ItemEvent ItemListener KeyAdapter MouseAdapter
                            WindowAdapter WindowListener]
            [com.swtdesigner SwingResourceManager]
-           [org.micromanager.acquisition ImageStorageListener MMImageCache]
+           [org.micromanager.api ImageCacheListener]
+           [org.micromanager.acquisition MMImageCache]
            [org.micromanager.utils JavaUtils ReportingUtils])
   (:use [org.micromanager.browser.utils
             :only (gen-map constrain-to-parent create-button create-icon-button
@@ -556,8 +557,8 @@
       (update-collection-menu (get-last-collection-name)))))

 (defn create-image-storage-listener []
-  (reify ImageStorageListener
-    (imageStorageFinished [_ path]
+  (reify ImageCacheListener
+    (imagingFinished [_ path]
       ;(println "image storage:" path)
       (doseq [data-set (find-data-sets path)]
         (.put pending-data-sets [data-set ""])))))
@@ -694,7 +695,7 @@
   (update-browser-status)
   (start-scanning-thread)
   (start-reading-thread)
-  (MMImageCache/addImageStorageListener (create-image-storage-listener))
+  ;(MMImageCache/addImageCacheListener (create-image-storage-listener))
   (awt-event
     (.show (@browser :frame))
     (.setModel (:table @browser) (create-browser-table-model tags))


allow multiple specs in same index

allow multiple specs in same index

--- src/govalert/init.clj
+++ src/govalert/init.clj
@@ -26,7 +26,7 @@
         (doseq [h (harvesters index)]
           (println (json/generate-string h {:pretty true :escape-non-ascii true}))))) )
   ([es-endpoint index harvest-spec]
-    (-main es-endpoint index index harvest-spec))
+    (-main es-endpoint index nil harvest-spec))
   ([es-endpoint harvest-spec]
     (-main es-endpoint nil harvest-spec))
   ([es-endpoint]


Revert arity change to eq>

Revert arity change to eq>

--- src/deepfns/transitive.cljc
+++ src/deepfns/transitive.cljc
@@ -44,10 +44,10 @@
   "A transative form of = where both arguments are transitive
   expressions"
   [x-expr y-expr]
-  (let [x-t (d/<=> x-expr m)
-        y-t (d/<=> y-expr m)]
+  (let [x-t (d/<=> x-expr)
+        y-t (d/<=> y-expr)]
     (fn [m]
-      (= x-t y-t))))
+      (= (x-t m) (y-t m)))))

 (defn if>
   "Like if but for transitives. Takes a predicate and returns the then


CMR-3685: Fixed bug in single threaded lookup cache wrt booleans

--- common-lib/src/cmr/common/cache/single_thread_lookup_cache.clj
+++ common-lib/src/cmr/common/cache/single_thread_lookup_cache.clj
@@ -47,10 +47,10 @@
         [{:keys [key lookup-fn response-channel]} (async/<!! lookup-request-channel)]

         (try
-          ;; A when let is used in case of a nil value being returned. We just close the response
+          ;; If a nil value is returned we just close the response
           ;; channel in that case and a nil will be read.
-          (when-let [value (safely-get-value-or-exception delegate-cache key lookup-fn)]
-            (async/>!! response-channel value))
+          (let [value (safely-get-value-or-exception delegate-cache key lookup-fn)]
+            (when (not (nil? value)) (async/>!! response-channel value)))

           (finally
             ;; Close the response channel whether a value was successfully written to the response


improve street descriptions

improve street descriptions

--- src/house/rooms/street.cljc
+++ src/house/rooms/street.cljc
@@ -7,6 +7,7 @@
 (def street (->
               (room/make "Front of house"
                          "The house, big and old, was on the corner of the block. On every side of the door was a large window."
+                         :initial-description "I arrived on foot, without being noticed. The house, big and old, was placed on a quiet corner of a not-so-quiet street.\n \nThe house was big and old and I had to take it over."
                          :default-go "I didn't want too go too far away from the house.")

               (room/add-item (item/make "street" "It was very quiet at the time.") "")
@@ -52,10 +53,10 @@
                      "A plastered brick wall, about twice my height."
                      :climb-up "I needed to hold on to something to climb it."))

-; FIXME comment on house size first time
 (def house-side (->
                   (room/make "Side of the house"
                              "The western side of the house, just around the corner, turned into a high wall that stretched north."
+                             :initial-description "Walking by the side of the house I realized it was even bigger than it appeared from the front."
                              :known true
                              :up "Maybe there was a way to climb up that wall.")


CMR-1215: Fix broken CI

CMR-1215: Fix broken CI

--- dev-system/src/cmr/dev_system/runner.clj
+++ dev-system/src/cmr/dev_system/runner.clj
@@ -9,6 +9,9 @@
 (defn -main
   "Starts the App."
   [& args]
-  (let [system (system/create-system :in-memory)
+  (let [system (system/create-system {:elastic :in-memory
+                                      :echo :in-memory
+                                      :db :in-memory
+                                      :message-queue :in-memory})
         system (system/start system)]
     (info "Running...")))


don't blow up when there wasn't a previously active tabset

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/lt/objs/tabs.cljs
+++ src/lt/objs/tabs.cljs
@@ -329,9 +329,8 @@

 (defn activate-tabset [ts]
   (when-not (= (ctx/->obj :tabset) ts)
-    (dom/remove-class (-> (ctx/->obj :tabset)
-                          (object/->content))
-                      :active)
+    (when-let [old (ctx/->obj :tabset)]
+      (dom/remove-class (object/->content old) :active))
     (ctx/in! :tabset ts)
     (dom/add-class (object/->content ts) :active)
     true))


store: fetch ttl in resolution

store: fetch ttl in resolution

--- src/io/cyanite/store.clj
+++ src/io/cyanite/store.clj
@@ -52,7 +52,7 @@

   (insert! [this metric]
     (c/runq! session insertq
-             [(-> metric :ttl int)
+             [(-> metric :resolution :period int)
               (c/->point point-type metric)
               (c/->id id-type metric)
               (-> metric :time long)]


Focus search when opening plugin manager close #1422

--- src/lt/objs/plugins.cljs
+++ src/lt/objs/plugins.cljs
@@ -681,6 +681,7 @@
               :desc "Plugins: Show plugin manager"
               :exec (fn []
                       (tabs/add-or-focus! manager)
+                      (dom/focus (dom/$ :input (object/->content manager)))
                       (cmd/exec! :plugin-manager.refresh))})

 (cmd/command {:command :plugin-manager.update-outdated


Fix typo in No layout registered with key expection.

--- src/incise/layouts/core.clj
+++ src/incise/layouts/core.clj
@@ -18,8 +18,7 @@
   (if-let [layout-key (:layout parse-data)]
     (if-let [layout-fn (get layout-key)]
       (layout-fn (conf/get) parse-data)
-      (throw (ex-info (str "No layout function of with registered with key "
-                           layout-key)
+      (throw (ex-info (str "No layout function registered with key " layout-key)
                       {:layouts @layouts})))
     (throw (ex-info (str "No layout key specified in given parse.")
                     {:layouts @layouts


Got result pulling working.

Got result pulling working.

--- src/provider/core.clj
+++ src/provider/core.clj
@@ -43,24 +43,24 @@
 (defn get-result
   "Gets a specific result"
   [id]
-  ; TODO
-  )
+  (collections/find-one-as-map db "results" {:execution_id id}))
 (defn get-visualization
   "Gets a single visualization"
   [id]
   ; TODO: Other computations.
-  (let [visualization (collections/find-map-by-id db "queries" (ObjectId. id))
-        executions (map get-result (:executions visualization))]
-    ; TODO: Code
-    ))
+  (let [unprocessed-visualization (collections/find-map-by-id db "queries" (ObjectId. id))
+        execution-ids (for [execution (:executions unprocessed-visualization)] (:_id execution))
+        executions (map get-result execution-ids)]
+    (assoc unprocessed-visualization :executions executions)))
+
 (defn visualization-route
   "Responds withs a single visualization"
   [request id]
-  (try
+  ;(try
     {:status 200
      :headers {"Content-Type" "application/json; charset=utf-8"}
-     :body (chesire/encode (get-visualization id))}
-    (catch Exception e {:status 500 :body (str e )})))
+     :body (chesire/encode (get-visualization id))})
+   ; (catch Exception e {:status 500 :body (str e )})))

 ; Route declaration.
 (defroutes app


Prevent direct use of postRunnable

Prevent direct use of postRunnable

--- src/nightmod/sandbox.clj
+++ src/nightmod/sandbox.clj
@@ -21,7 +21,8 @@
        *read-eval* ns-publics ns-unmap set! ns-map ns-interns the-ns
        push-thread-bindings pop-thread-bindings future-call agent send
        send-off pmap pcalls pvals in-ns System/out System/in System/err
-       with-redefs-fn Class/forName})
+       with-redefs-fn Class/forName
+       set-screen! app! postRunnable})
    (jail-test/blacklist-nses '[clojure.main])
    (jail-test/blanket "clojail")])


Remove unused function.

Remove unused function.

--- src/oc/email/content.clj
+++ src/oc/email/content.clj
@@ -289,9 +289,6 @@
           (:board-name entry))
          " • " (post-date (:published-at entry)))
    css-class "text-left attribution"))
-
-(defn- css-background-image [image-url]
-  (str "background-image: url(\"" image-url "\");"))

 (defn- post-headline [entry]
   (let [ms (:must-see entry)


Remove empty test file

Remove empty test file

--- metrics-clojure-core/test/metrics/test/core.clj
+++ metrics-clojure-core/test/metrics/test/core.clj
@@ -1,4 +0,0 @@
-(ns metrics.test.core
-  (:use [metrics.core])
-  (:use [clojure.test]))
-


Don't trap all Throwables - only suppress InterruptableExceptions from the repl.

--- src/onyx/test_helper.clj
+++ src/onyx/test_helper.clj
@@ -88,53 +88,80 @@
 (defn try-start-env [env-config]
   (try
     (onyx.api/start-env env-config)
+    (catch InterruptedException e)
     (catch Throwable e
-      nil)))
+      (throw e))))

 (defn try-start-group [peer-config]
   (try
     (onyx.api/start-peer-group peer-config)
+    (catch InterruptedException e)
+    (catch Throwable e (throw e))))
+
+(defn try-start-peers [n-peers peer-group monitoring-config]
+  (try
+    (onyx.api/start-peers n-peers peer-group (or monitoring-config {:monitoring :custom}))
+    (catch InterruptedException e)
     (catch Throwable e
-      nil)))
-
-(defn try-start-peers [n-peers peer-group monitoring-config]
-  (try
-    (onyx.api/start-peers n-peers peer-group (or monitoring-config {:monitoring :custom}))
-    (catch Throwable e
-      nil)))
+      (throw e))))

 (defn add-test-env-peers!
   "Add peers to an OnyxTestEnv component"
   [{:keys [peer-group peers monitoring-config] :as component} n-peers]
   (swap! peers into (try-start-peers n-peers peer-group monitoring-config)))

+(defn shutdown-peer [v-peer]
+  (try
+    (onyx.api/shutdown-peer v-peer)
+    (catch InterruptedException e)))
+
+(defn shutdown-peer-group [peer-group]
+  (try
+    (onyx.api/shutdown-peer-group peer-group)
+    (catch InterruptedException e)))
+
+(defn shutdown-env [env]
+  (try
+    (onyx.api/shutdown-env env)
+    (catch InterruptedException e)))
+
 (defrecord OnyxTestEnv [env-config peer-config monitoring-config n-peers]
   component/Lifecycle

   (start [component]
     (println "Starting Onyx test environment")
-    (let [env (try-start-env env-config)
-          peer-group (try-start-group peer-config)
-          peers (try-start-peers n-peers peer-group monitoring-config)]
-      (assoc component :env env :peer-group peer-group :peers (atom peers))))
+    (let [state (atom {})]
+      (try
+        (let [env (try-start-env env-config)]
+          (swap! state assoc :env env)
+          (let [peer-group (try-start-group peer-config)]
+            (swap! state assoc :peer-group peer-group)
+            (let [peers (try-start-peers n-peers peer-group monitoring-config)]
+              (swap! state assoc :peers peers)
+              (assoc component :env env :peer-group peer-group :peers (atom peers)))))
+        (catch Throwable t
+          (when-let [peers (:peers @state)]
+            (doseq [v-peer peers]
+              (shutdown-peer v-peer)))
+
+          (when-let [peer-group (:peer-group @state)]
+            (shutdown-peer-group peer-group))
+
+          (when-let [env (:env @state)]
+            (shutdown-env env))
+          (throw t)))))

   (stop [component]
     (println "Stopping Onyx test environment")

     (doseq [v-peer @(:peers component)]
-      (try
-        (onyx.api/shutdown-peer v-peer)
-        (catch InterruptedException e)))
+      (shutdown-peer v-peer))

     (when-let [pg (:peer-group component)]
-      (try
-        (onyx.api/shutdown-peer-group pg)
-        (catch InterruptedException e)))
+      (shutdown-peer-group pg))

     (when-let [env (:env component)]
-      (try
-        (onyx.api/shutdown-env env)
-        (catch InterruptedException e)))
+      (shutdown-env env))

     (assoc component :env nil :peer-group nil :peers nil)))


Fix a typo. Make Eastwood happy. Thanks Eastwood!

--- src/open_company/app.clj
+++ src/open_company/app.clj
@@ -62,8 +62,9 @@
         (get-in [:handler :handler])))
   (timbre/info "Started"))

-(defn start [port]
+(defn start
   "Start a development server"
+  [port]
   (timbre/set-config! c/log-config)

   (-> {:handler-fn app :port port}


add edit webhooks page

add edit webhooks page

--- frontend/components/project_settings.cljs
+++ frontend/components/project_settings.cljs
@@ -434,7 +434,13 @@
         :on-click #(do (put! controls-ch [:saved-notification-hooks {:project-id project-id}]))}]]]))

 (defn webhooks [project settings controls-ch]
-  [:div "webhooks"])
+  [:div
+   [:h2 "Webhooks for " (vcs-url/project-name (:vcs_url project))]
+   [:div.doc
+    [:p
+     "Circle also support webhooks, which run at the end of a build. They can be configured in your "
+     [:a {:href "https://circleci.com/docs/configuration#notify" :target "_blank"}
+      "circle.yml file"] "."]]])

 (defn ssh-keys [project settings controls-ch]
   [:div "ssh-keys"])


Fix group-free to actually delete a group as well as extending Group to support ISynthNode (given that groups are actually nodes).

--- src/overtone/sc/node.clj
+++ src/overtone/sc/node.clj
@@ -83,7 +83,9 @@
          the groups and synths contained within it.

          Low-level functionality. See node-tree for something more
-         usable." ))))
+         usable." )
+      (group-free [group]
+        "Destroys this group and any containing synths or subgroups."))))

 (extend-type java.lang.Long to-sc-id*    (to-sc-id [v] v))
 (extend-type java.lang.Integer to-sc-id* (to-sc-id [v] v))
@@ -357,9 +359,9 @@

 (defn- group-free*
   "Free synth groups, releasing their resources."
-  [& group-ids]
-  (ensure-connected!)
-  (apply node-free group-ids))
+  [group-id]
+  (ensure-connected!)
+  (node-free group-id))

 (defn node-pause*
   "Pause a running synth node."
@@ -561,6 +563,13 @@
    :node-block-until-ready node-block-until-ready*})

 (extend SynthGroup
+  ISynthNode
+  {:node-free  node-free*
+   :node-pause node-pause*
+   :node-start node-start*
+   :node-place node-place*}
+
+
   IControllableNode
   {:node-control           node-control*
    :node-control-range     node-control-range*
@@ -710,7 +719,8 @@
    :group-clear        group-clear*
    :group-deep-clear   group-deep-clear*
    :group-post-tree    group-post-tree*
-   :group-node-tree    group-node-tree*}
+   :group-node-tree    group-node-tree*
+   :group-free         group-free*}

   IKillable
   {:kill* group-deep-clear*})
@@ -723,7 +733,8 @@
    :group-clear        group-clear*
    :group-deep-clear   group-deep-clear*
    :group-post-tree    group-post-tree*
-   :group-node-tree    group-node-tree*})
+   :group-node-tree    group-node-tree*
+   :group-free         group-free*})

 (defn node-tree
   "Returns a data representation of the synth node tree starting at


Grab mouse

Grab mouse

--- src/phys_world/input.clj
+++ src/phys_world/input.clj
@@ -127,4 +127,4 @@
 ;;

 (defn init []
-  (set-mouse-grabbed false))
+  (set-mouse-grabbed true))


xymon.clj: event->disable: small docstring update

--- src/riemann/xymon.clj
+++ src/riemann/xymon.clj
@@ -60,7 +60,8 @@
   Convert an event to a Xymon disable message:
   disable HOSTNAME.TESTNAME DURATION <additional text>

-  Fields mapping is the same as event-status'.
+  Fields mapping is the same as event->status'. Also, the event ttl is
+  used as duration, same as LIFETIME in event->status.
   "
   [{:keys [host service duration description]
     :or {host "" service "*" ttl "" description ""}}]


reverse last change we need to detect the base-url somehow

--- src/main/cawala/client.cljs
+++ src/main/cawala/client.cljs
@@ -35,7 +35,7 @@
                       {:target [:person-list/by-id :friends :person-list/people]}))
            :networking
            {:remote (net/fulcro-http-remote
-                     {:url "/api" #_(str (-> js/window .-location .-href) "api")
+                     {:url (str (-> js/window .-location .-href) "api")
                           :request-middleware secured-request-middleware})}))
   (start))


tweakable number series

tweakable number series

--- src/semitone/core.clj
+++ src/semitone/core.clj
@@ -2,7 +2,25 @@

 ;; TODO:
 ;;   MPE support
-;;   :time-signature
+;;    - :channel can be a list of available channels, in order of preference
+;;    - get start/stop of note to be played
+;;    - get all the notes that intersect the note to be played on the current track
+;;      - do a linear scan of the track
+;;    - get a unique set of channels from the intersecting notes
+;;    - choose to play on the next available channel on the channel list
+;;    - if no channels are available, play on the next channel/least used channel
+;;   smoothing/averaging function for param values
+;;   DAW recording interface for capturing param values / performances
+;;   :time-signature [4 4]
+;;   add shortcuts for intervals, chords, key signatures, dynamics
+;;   convenient meta message functions
+;;   convenient sysex function
+;;   SMPTE time
+
+;; Useful links:
+;; http://www.midi.org/techspecs/midimessages.php
+;; http://computermusicresource.com/midikeys.html
+;; http://www.recordingblogs.com/sa/tabid/88/Default.aspx?topic=MIDI+meta+messages

 (ns semitone.core
   (:require [clojure.pprint :refer [pprint]]
@@ -138,6 +156,7 @@
                       value (cond
                               (= \> (get (get m 2) 0)) (mod (+ old-value (or value 0) (- (count (get m 2)) 1)) max-value)
                               (= \< (get (get m 2) 0)) (mod (- old-value (or value 0) (- (count (get m 2)) 1)) max-value)
+                              (and (= "" (get m 2)) (= "" (get m 3))) old-value
                               :else value)]
                   (merge state
                          (cond
@@ -172,56 +191,65 @@
     state
     (let [token (first notes)
           token (if (number? token) (str token) (name token))]
-      (if (re-matches #"((!|\?|&|\$|)(>+|<+|)(-?(?:[0-9]+|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)(?:[eE]-?[0-9]+)?|))+" token)
-        (merge
-         (apply merge state
-                (mapcat #(if (= "" (get % 0)) []
-                             (let [param
-                                   (get {"!" :attack
-                                         "?" :release
-                                         "$" :displacement-start
-                                         "&" :displacement-end}
-                                        (get % 1) (:param state))
-                                   [min-value max-value double-min double-max]
-                                   (get {:attack [0 128 0.0 1.0]
-                                         :release [0 128 0.0 1.0]
-                                         :channel-pressure [0 128 0.0 1.0]
-                                         :key-pressure [0 128 0.0 1.0]
-                                         :cc-value [0 128 0.0 1.0]
-                                         :key [0 128 -1.0 10.0]
-                                         :pitch-bend [0 16384 -1.0 1.0]
-                                         :octave [-1 9 -1.0 10.0]
-                                         :displacement-start
-                                         [(- (.getResolution (.getSequence (:sequencer state))))
-                                          (.getResolution (.getSequence (:sequencer state)))
-                                          -1.0 1.0]
-                                         :displacement-end
-                                         [(- (.getResolution (.getSequence (:sequencer state))))
-                                          (.getResolution (.getSequence (:sequencer state)))
-                                          -1.0 1.0]}
-                                        param)
-                                   old-value (get state param)
-                                   value (if (re-find #"[.eE]" (get % 3))
-                                           (max min-value (min max-value
-                                                               (int (+
-                                                                     (* (/ (- (Double. (get % 3)) double-min)
-                                                                           (- double-max double-min))
-                                                                        (- max-value min-value))
-                                                                     min-value))))
-                                           (+ (mod (- (if (= "" (get % 3))
-                                                        (if (= "" (get % 2)) 0 1)
-                                                        (Integer. (get % 3)))
-                                                      min-value)
-                                                   (- max-value min-value))
-                                              min-value))
-                                   value (cond
-                                           (= \> (get (get % 2) 0)) (mod (+ old-value (or value 0) (- (count (get % 2)) 1)) max-value)
-                                           (= \< (get (get % 2) 0)) (mod (- old-value (or value 0) (- (count (get % 2)) 1)) max-value)
-                                           :else value)]
-                               [{param value}]))
-                     (re-seq #"\G(!|\?|&|\$|)(>+|<+|)(-?(?:[0-9]+|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)(?:[eE]-?[0-9]+)?|)" token)))
-         {:notes (vec-rest notes)})
-        state))))
+      (if-let [m (re-matches #"(!|\?|&|\$)" token)]
+        (let [param
+              (get {"!" :attack
+                    "?" :release
+                    "&" :displacement-end
+                    "$" :displacement-start}
+                   (get m 1) (:param state))]
+          (recur (vec-rest notes) (merge state {:param param})))
+        (if (re-matches #"((!|\?|&|\$|)(>+|<+|)(-?(?:[0-9]+|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)(?:[eE]-?[0-9]+)?|))+" token)
+          (merge
+           (apply merge state
+                  (mapcat #(if (= "" (get % 0)) []
+                               (let [param
+                                     (get {"!" :attack
+                                           "?" :release
+                                           "$" :displacement-start
+                                           "&" :displacement-end}
+                                          (get % 1) (:param state))
+                                     [min-value max-value double-min double-max]
+                                     (get {:attack [0 128 0.0 1.0]
+                                           :release [0 128 0.0 1.0]
+                                           :channel-pressure [0 128 0.0 1.0]
+                                           :key-pressure [0 128 0.0 1.0]
+                                           :cc-value [0 128 0.0 1.0]
+                                           :key [0 128 -1.0 10.0]
+                                           :pitch-bend [0 16384 -1.0 1.0]
+                                           :octave [-1 9 -1.0 10.0]
+                                           :displacement-start
+                                           [(- (.getResolution (.getSequence (:sequencer state))))
+                                            (.getResolution (.getSequence (:sequencer state)))
+                                            -1.0 1.0]
+                                           :displacement-end
+                                           [(- (.getResolution (.getSequence (:sequencer state))))
+                                            (.getResolution (.getSequence (:sequencer state)))
+                                            -1.0 1.0]}
+                                          param)
+                                     old-value (get state param)
+                                     value (if (re-find #"[.eE]" (get % 3))
+                                             (max min-value (min max-value
+                                                                 (int (+
+                                                                       (* (/ (- (Double. (get % 3)) double-min)
+                                                                             (- double-max double-min))
+                                                                          (- max-value min-value))
+                                                                       min-value))))
+                                             (+ (mod (- (if (= "" (get % 3))
+                                                          (if (= "" (get % 2)) 0 1)
+                                                          (Integer. (get % 3)))
+                                                        min-value)
+                                                     (- max-value min-value))
+                                                min-value))
+                                     value (cond
+                                             (= \> (get (get % 2) 0)) (mod (+ old-value (or value 0) (- (count (get % 2)) 1)) max-value)
+                                             (= \< (get (get % 2) 0)) (mod (- old-value (or value 0) (- (count (get % 2)) 1)) max-value)
+                                             (and (= "" (get % 2)) (= "" (get % 3))) old-value
+                                             :else value)]
+                                 [{param value}]))
+                          (re-seq #"\G(!|\?|&|\$|)(>+|<+|)(-?(?:[0-9]+|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)(?:[eE]-?[0-9]+)?|)" token)))
+           {:notes (vec-rest notes)})
+          state)))))

 (def ^:dynamic *seq* (Sequence. Sequence/PPQ 256))
 (def ^:dynamic *synth* (MidiSystem/getSynthesizer))
@@ -264,7 +292,7 @@
                       :tie nil
                       :key 0
                       :message-type ShortMessage/NOTE_ON
-                      :channel 0
+                      :ch 0
                       :track 0
                       :key-signature {}
                       :time-signature [4 4]
@@ -334,7 +362,7 @@
                               (.add track
                                     (MidiEvent. (ShortMessage.
                                                  (:message-type state)
-                                                 (:channel state)
+                                                 (:ch state)
                                                  key
                                                  value)
                                                 (+ (:position state)
@@ -342,7 +370,7 @@
                             (when (and (= (:message-type state) ShortMessage/NOTE_ON) (not (= (:tie state) :begin)))
                               (.add track (MidiEvent. (ShortMessage.
                                                        ShortMessage/NOTE_OFF
-                                                       (:channel state)
+                                                       (:ch state)
                                                        key
                                                        (:release state))
                                                       (max


fixed scrolling up

fixed scrolling up

--- src/re_complete/app.cljs
+++ src/re_complete/app.cljs
@@ -165,7 +165,7 @@
         one-item-height (:item-height options)
         selected-item-number (+ 1 selected-item-index)
         current-position (* selected-item-number one-item-height)]
-    (cond (< selected-item-number (first @current-view)) (do (set! (.-scrollTop node) (- current-position (* 4 one-item-height)))
+    (cond (< selected-item-number (first @current-view)) (do (set! (.-scrollTop node) (- current-position (* number-of-visible-items one-item-height)))
                                                              (swap! current-view (partial mapv dec)))
           (> selected-item-number (last @current-view)) (do (set! (.-scrollTop node) (* one-item-height number-of-items-to-complete))
                                                             (reset! current-view [(- number-of-items-to-complete number-of-visible-items) number-of-items-to-complete]))


Remove trace

Remove trace

--- test/clojurewerkz/cassaforte/cql_test.clj
+++ test/clojurewerkz/cassaforte/cql_test.clj
@@ -1,6 +1,5 @@
 (ns clojurewerkz.cassaforte.cql-test
-  (:require [clojurewerkz.cassaforte.test-helper :as th]
-            [clojure.tools.trace :as t])
+  (:require [clojurewerkz.cassaforte.test-helper :as th])
   (:use clojurewerkz.cassaforte.cql
         clojure.test
         clojurewerkz.cassaforte.query))