Update the query window based on the edit field.

--- metlog-vault/src-client/metlog_client/metlog.cljs
+++ metlog-vault/src-client/metlog_client/metlog.cljs
@@ -7,7 +7,9 @@
             [cljs.core.async :refer [put! close! chan <!]]
             [metlog-client.tsplot :as tsplot]))

-(def dashboard-state (atom {:series [] :query-window-secs (* 3600 24) :text ""}))
+(defonce query-window-secs (atom (* 3600 24)))
+
+(def dashboard-state (atom {:series []  :text ""}))

 (defn <<< [f & args]
   (let [c (chan)]
@@ -36,32 +38,31 @@
               (watch [:response series-name])
               (cb data))))

-(defn schedule-data-update [ series-name query-window-secs series-state ]
-  (go
-    (swap! series-state assoc :data (<! (<<< fetch-series-data
-                                             series-name
-                                             query-window-secs)))))
+(defn tsplot-fetch-and-draw [ canvas series-name ]
+  (let [ ctx (.getContext canvas "2d")]
+    (go
+      (tsplot/draw ctx 1024 180 [])
+      (tsplot/draw ctx 1024 180 (<! (<<< fetch-series-data
+                                         series-name
+                                         @query-window-secs))))))

 (defn series-tsplot [ series ]
   (let [ series-state (atom { :series-name (:name series)} ) ]
     (reagent/create-class
      {:display-name (str "series-tsplot-" (:name series))
+      :component-did-update
+      (fn [ this ]
+        (watch :component-did-update)
+        (tsplot-fetch-and-draw (reagent/dom-node this) (:name series)))
+
       :component-did-mount
-      (fn [this]
-        (let [canvas (reagent/dom-node this)]
-          (swap! series-state assoc :canvas canvas)
-          (schedule-data-update (:series-name @series-state) (:query-window-secs @dashboard-state) series-state)))
-
-      :component-did-update
-      (fn [this]
-        (tsplot/draw (.getContext (:canvas @series-state) "2d")
-                     1024
-                     180
-                     (:data @series-state)))
-
+      (fn [ this ]
+        (watch :component-did-mount)
+        (tsplot-fetch-and-draw (reagent/dom-node this) (:name series)))

       :reagent-render
       (fn []
+        @query-window-secs
         @series-state
         [:canvas { :width 1024 :height 180}])})))

@@ -79,15 +80,18 @@

 (defn end-edit [ text state ]
   (let [ qws (js/parseInt text) ]
-    (swap! state assoc :query-window-secs qws)))
+    (watch [:update-qws qws])
+    (reset! query-window-secs qws)))

 (defn input-field [ on-enter ]
   (let [ state (atom { :text "" }) ]
     (fn []
       [:input {:value (:text @state)
                :onChange #(swap! state assoc :text (.. % -target -value))
-               :onKeyDown #(when (= (.-key %) "Enter")
-                             (on-enter (:text @state)))} ])))
+               :onKeyDown #(do
+                             (watch [:on-key-down (.-key %)])
+                             (when (= (.-key %) "Enter")
+                                 (on-enter (:text @state))))} ])))

 (defn header [ ]
   (watch :render-header)


Turn off dianostic

Turn off dianostic

--- ClojureScript/replete/src/replete/repl.cljs
+++ ClojureScript/replete/src/replete/repl.cljs
@@ -204,7 +204,7 @@
 (defn- source-callback-data [path extension]
   (when-let [source (js/REPLETE_LOAD (str path extension))]
     ;; Emit a diagnostic if loading source
-    (when-not (= ".js" extension)
+    #_(when-not (= ".js" extension)
       (prn 'source path extension))
     {:lang   (extension->lang extension)
      :source source}))


Adding myself to the members list.

Adding myself to the members list.

--- resources/members.clj
+++ resources/members.clj
@@ -5,4 +5,5 @@
  {:name "Russell Branca" :url "http://chewbranca.com"}
  {:name "Chris Bilson"}
  {:name "Stan Dyck" :url "http://sgd.homelinux.net"}
- {:name "Nick Dimiduk" :url "http://www.n10k.com"}]
+ {:name "Nick Dimiduk" :url "http://www.n10k.com"}
+ {:name "Justin Lilly" :url "http://justinlilly.com"}]


CMR-3281 changes attribute from provider to provider-id

--- access-control-app/src/cmr/access_control/test/util.clj
+++ access-control-app/src/cmr/access_control/test/util.clj
@@ -199,9 +199,9 @@
   ([parent-collection-id attrs]
    (let [short-name (str "gran" (swap! granule-num inc))
          version-id "v1"
-         provider (if (:provider attrs)
-                    (:provider attrs)
-                    "PROV1")
+         provider-id (if (:provider-id attrs)
+                       (:provider-id attrs)
+                       "PROV1")
          native-id short-name
          entry-id (str short-name "_" version-id)
          granule-ur (str short-name "ur")
@@ -223,7 +223,7 @@
                          {:format "application/echo10+xml"
                           :metadata (umm-core/umm->xml granule-umm :echo10)
                           :concept-type :granule
-                          :provider-id provider
+                          :provider-id provider-id
                           :native-id native-id
                           :revision-id 1
                           :extra-fields {:short-name short-name


Use xls extension for SURVEY_FORM

Use xls extension for SURVEY_FORM

--- reports/src/reports/exporter.clj
+++ reports/src/reports/exporter.clj
@@ -30,10 +30,15 @@
 (defonce base-path
   (.getAbsolutePath (io/file (System/getProperty "user.home"))))

+(defn- get-ext [t]
+  (if (= t "SURVEY_FORM")
+    "xls"
+    "xlsx"))
+
 (defn- getfile [et id]
   (let [path (format "%s/tmp/%s" base-path (UUID/randomUUID))
         _ (.mkdir (io/file path))]
-    (io/file (format "%s/%s-%s.xlsx" path et id))))
+    (io/file (format "%s/%s-%s.%s" path et id (get-ext et)))))

 (defn doexport [type base id opts]


Formatting

Formatting

--- test/icecap/schema_test.clj
+++ test/icecap/schema_test.clj
@@ -8,26 +8,26 @@
 (deftest plan-tests
   (testing "correct plans validate"
     (are [example] (s/validate Plan example)
-         simple-http-step
-         simple-https-step
-         #{simple-http-step simple-https-step}))
+      simple-http-step
+      simple-https-step
+      #{simple-http-step simple-https-step}))
   (testing "empty plans don't validate"
     (are [example reason] (= (pr-str (s/check Plan example))
                              (pr-str reason))
-         [] '(not ("collection of two or more plans" []))
-         #{} '(not ("collection of two or more plans" #{}))))
+      [] '(not ("collection of two or more plans" []))
+      #{} '(not ("collection of two or more plans" #{}))))
   (testing "plans with one step in them don't validate"
     (are [example reason] (= (pr-str (s/check Plan example))
                              (pr-str reason))
-         [simple-http-step] '(not ("collection of two or more plans"
-                                   a-clojure.lang.PersistentVector))
-         #{simple-http-step} '(not ("collection of two or more plans"
-                                    a-clojure.lang.PersistentHashSet))))
+      [simple-http-step] '(not ("collection of two or more plans"
+                                a-clojure.lang.PersistentVector))
+      #{simple-http-step} '(not ("collection of two or more plans"
+                                 a-clojure.lang.PersistentHashSet))))
   (testing "plans with empty steps in them don't validate"
     (are [example reason] (= (pr-str (s/check Plan example))
                              (pr-str reason))
-         [#{} simple-http-step] ['(not ("collection of two or more plans" #{}))
-                                 nil]))
+      [#{} simple-http-step] ['(not ("collection of two or more plans" #{}))
+                              nil]))
   (testing "plans with unsupported steps don't validate, with useful error"
     (let [supported-types (into #{} (keys (methods get-schema)))]
       (are [example] (let [e (:type (s/check Plan example))
@@ -35,4 +35,4 @@
                            suggested-types (.vs (.schema e))]
                        (and (= bad-type-in-error (:type example))
                             (= suggested-types supported-types)))
-           simple-ftp-step))))
+        simple-ftp-step))))


test seqa and functions

test seqa and functions

--- test/mustache/core_test.clj
+++ test/mustache/core_test.clj
@@ -24,6 +24,9 @@
   )
 })

+(def data4
+  {"repo" (map #(hash-map "name" %) ["resque" "hub" "drip"])})
+
 (defn quick-eval [template-filename data]
   (let [text (slurp template-filename)
         r (java.io.StringReader. text)
@@ -32,14 +35,18 @@
     (.execute template buffer data)
     (str buffer)))

-
 (deftest simple-cases
   (is (= "Hello Chris\nYou have just won 10000 dollars!\nWell, 6000.0 dollars, after taxes.\n"
          (quick-eval "template1.mustache" data1)))
+  (is (= "Hello Chris\nYou have just won 10000 dollars!\nWell, 7000.0 dollars, after taxes.\n"
+         (quick-eval "template1.mustache" (assoc data1 "taxed_value" #(- 10000 (* 10000 0.3))))))
   (is (= "  resque\n  hub\n  rip\n"
          (quick-eval "template2.mustache" data2)))
   (is (= "  resque\n  hub\n  rip\n"
          (quick-eval "template2.mustache" data3)))
+  (is (= "  resque\n  hub\n  drip\n"
+         (quick-eval "template2.mustache" data4)))
+
   )

 (comment


Bumps version to 1.38.3-SNAPSHOT

Bumps version to 1.38.3-SNAPSHOT

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.38.2"
+(defproject cook "1.38.3-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]


no message

no message

--- src/org/spootnik/cyanite/es_path.clj
+++ src/org/spootnik/cyanite/es_path.clj
@@ -161,7 +161,7 @@
            (let [ps (<! checked-paths-p)]
              (go-catch
                (doseq [p ps]
-                 (doseq [ap (distinct-by :path (es-all-paths p ""))]
+                 (doseq [ap (distinct-by :path (es-all-paths (get p 0) (get p 1)))]
                    (>! all-paths ap))))))
           (go-forever
            (let [ps (<! all-paths-p)]


Get image extension from data url

Get image extension from data url


Offline & invalid options modals

Offline & invalid options modals


Setting up mock config variable in pins component

--- src/strange_coop/components/pins.clj
+++ src/strange_coop/components/pins.clj
@@ -2,6 +2,7 @@
   (:require [clojure.core.async :as async :refer [chan <!! >!! go go-loop >! <! close!]]
             [com.stuartsierra.component :as component]
             [strange-coop.bbbpin :as bb]
+            [strange-coop.components.config :as config]
             [strange-coop.button :as button]
             [strange-coop.hbridge :as hb]))

@@ -11,13 +12,14 @@
 (defrecord Pins [config]
   component/Lifecycle
   (start [component]
-    (assoc component
-           :floor-button  (button/button :P8 11 :normally-off)
-           :roof-button   (button/button :P8 12 :normally-on)
-           :light-sensor  (bb/ain 33)
-           :temp-sensor   (bb/ain 35)
-           :motor-control (hb/hbridge [16 17 18] :header :P8)
-           :status-led    (bb/gpio :P8 14 :out)))
+    (with-bindings {#'bb/*mock?* (config/get-in-config component [:mock])}
+      (assoc component
+             :floor-button  (button/button :P8 11 :normally-off)
+             :roof-button   (button/button :P8 12 :normally-on)
+             :light-sensor  (bb/ain 33)
+             :temp-sensor   (bb/ain 35)
+             :motor-control (hb/hbridge [16 17 18] :header :P8)
+             :status-led    (bb/gpio :P8 14 :out))))

   (stop [component]
     (apply dissoc component pin-keys)))


don't need old keyword->string fix

don't need old keyword->string fix

--- src/cljs/gc_api_browser/headers.cljs
+++ src/cljs/gc_api_browser/headers.cljs
@@ -14,8 +14,7 @@
     (render [_]
       (dom/div #js {:className "flex-container headers__header u-direction-row"}
                (dom/div #js {:className "flex-item headers__header__name"}
-                        (disabled-input (name header-name)  ;; when we reload headers from localStorage, we symbolize keys
-                                        ))
+                        (disabled-input header-name))
                (dom/div #js {:className "flex-item headers__header__value"}
                         (disabled-input header-value))
                (dom/button #js {:type      "button"


Fix fact output schema

Fix fact output schema

--- main/src/dda/pallet/dda_serverspec_crate/infra/fact/file.clj
+++ main/src/dda/pallet/dda_serverspec_crate/infra/fact/file.clj
@@ -25,8 +25,10 @@

 (def FileFactConfig {s/Keyword {:path s/Str}})

-(def FileFactResult {:path s/Str
-                     :fact-exist? s/Bool
+(def FileFactFailResult {:path s/Str :fact-exist? (s/enum false)})
+
+(def FileFactOkResult {:path s/Str
+                     :fact-exist? (s/enum true)
                      :fact-size-in-bytes s/Num
                      :fact-user s/Str
                      :fact-group s/Str
@@ -43,6 +45,10 @@
                      :fact-created s/Str
                      :fact-modified s/Str
                      :fact-accessed s/Str})
+
+(def FileFactResult
+  (s/either FileFactOkResult
+            FileFactFailResult))

 (def FileFactResults {s/Keyword FileFactResult})


Don't hang when async test is failing

Don't hang when async test is failing

If async handling gets broken somehow, failing with a timeout message
is preferrable to hanging indefinitely.

--- test/clj_http/test/conn_mgr_test.clj
+++ test/clj_http/test/conn_mgr_test.clj
@@ -96,11 +96,11 @@
                                 :server-port 18084 :scheme :https
                                 :insecure? true :server-name "localhost"
                                 :async? true} resp exception)]
-        (is (= 403 (:status @resp))))
+        (is (= 403 (:status (deref resp 1000 {:status :timeout})))))
       (let [resp (promise)
             exception (promise)
             _ (core/request (assoc secure-request :async? true) resp exception)]
-        (is (= 200 (:status @resp))))
+        (is (= 200 (:status (deref resp 1000 {:status :timeout})))))
       (finally
         (.stop server)))))


more tests

more tests

--- test/cljc/reitit/ring_spec_test.cljc
+++ test/cljc/reitit/ring_spec_test.cljc
@@ -89,7 +89,9 @@
                                 :form {:c string?}
                                 :header {:d string?}
                                 :path {:e string?}}
-                   :responses {200 {:body {:total pos-int?}}}
+                   :responses {200 {:body {:total pos-int?}}
+                               400 {:description "fail"}
+                               500 {}}
                    :handler identity}}]]
           {:data {:middleware [rrc/coerce-exceptions-middleware
                                rrc/coerce-request-middleware


178 in progress

178 in progress


Improve control of ant mode

Improve control of ant mode

--- src/clojure/playasophy/wonderdome/mode/ant.clj
+++ src/clojure/playasophy/wonderdome/mode/ant.clj
@@ -4,6 +4,13 @@
     [playasophy.wonderdome.util.color :as color]
     [playasophy.wonderdome.util.control :as control]))

+
+(def speed-bounds [1 10])
+(def length-bounds [2 10])
+
+(defn- bound
+  [[lower-bound upper-bound] value]
+  (-> value (max lower-bound) (min upper-bound)))

 (defrecord AntMode
   [position speed length hue saturation]
@@ -23,16 +30,22 @@
           :hue hue'))

       [:button/press :L]
-      (assoc this :speed 1)
+      (assoc this :speed (first speed-bounds) :length (second length-bounds))

       [:button/press :R]
-      (assoc this :speed 10)
+      (assoc this :speed (second speed-bounds) :length (first length-bounds))

       [:button/press :A]
-      (assoc this :length 2)
+      (assoc this :length (bound length-bounds (inc length)))

       [:button/press :B]
-      (assoc this :length 10)
+      (assoc this :length (bound length-bounds (dec length)))
+
+      [:button/press :X]
+      (assoc this :speed (bound speed-bounds (inc speed)))
+
+      [:button/press :Y]
+      (assoc this :speed (bound speed-bounds (dec speed)))

       [:axis/direction :x-axis]
       (assoc this :hue (control/adjust hue event :rate 0.20 :min-val -1.0 :max-val 2.0))


nrepl "backlink" server now correctly connects back to clojurescript environment using cemerick's piggieback

--- src-clj/cljs_workspace/nrepl_backlink.clj
+++ src-clj/cljs_workspace/nrepl_backlink.clj
@@ -1,18 +1,18 @@
 (ns cljs-workspace.nrepl-backlink
-; (ns user
   (:require [clojure.tools.nrepl.server :as server]
             [clojure.tools.nrepl :as nrepl]
-            [cider.nrepl]
-            [cemerick.piggieback]))
+            [cemerick.piggieback]
+            [cljs.repl.browser]))

 ; (defonce server (server/start-server :port 7888))

-(def default-env {:port 7888
-                  :client-port 9000
+(def default-env {:port 7889
+                  :client-port 9050
                   :server nil
                   :conn nil
                   :session nil
-                  :browser-repl-enabled false})
+                  :browser-repl-enabled false
+                  :browser-repl-env nil})

 (defn- reset-env
   [env]
@@ -33,7 +33,8 @@
                 :port port
                 :handler (apply server/default-handler
                                 #'cemerick.piggieback/wrap-cljs-repl
-                                (map resolve cider.nrepl/cider-middleware)))
+                                ; (map resolve cider.nrepl/cider-middleware)
+                                server/default-middlewares))
         conn (nrepl/connect :port port)
         session (nrepl/client-session (nrepl/client conn Long/MAX_VALUE))]
     (.setReuseAddress (:server-socket server) true)
@@ -50,16 +51,18 @@
   [env form]
   (when-not (running? env) (throw (Exception. "Server not running")))
   (let [{session :session} @env
-        result (doall (nrepl/message session {:op "eval" :code (str form)}))]
+        {browser-repl-env :browser-repl-env} @env
+        ; result (doall (nrepl/message session {:op "eval" :code (str form)}))
+        result (cemerick.piggieback/cljs-eval browser-repl-env form :verbose true)]
     result))

 (defn start-browser-repl-default
   [env]
-  (let [port (:client-port env)]
-   (cljs-eval env `(do (require 'cljs.repl.browser)
-                  (cemerick.piggieback/cljs-repl
-                   :repl-env (cljs.repl.browser/repl-env :port ~port)))))
-  (swap! env #(assoc % :browser-repl-enabled true)))
+  (let [port (:client-port @env)
+        browser-repl-env (cljs.repl.browser/repl-env :port port)]
+    (cemerick.piggieback/cljs-repl :repl-env browser-repl-env)
+    (swap! env #(assoc % :browser-repl-enabled true))
+    (swap! env #(assoc % :browser-repl-env browser-repl-env))))

 (defn start-browser-repl
   [env]
@@ -67,8 +70,9 @@

 (defn stop-browser-repl
   [env]
-  (cljs-eval env :cljs/quit)
-  (swap! env #(assoc % :browser-repl-enabled false)))
+  (when (:browser-repl-enabled env)
+    (cljs-eval env :cljs/quit)
+    (swap! env #(assoc % :browser-repl-enabled false))))

 (defn stop
@@ -99,13 +103,6 @@
   [& options]
   (apply start-with-env (atom default-env) options))

-(defonce repl-runtime (start))
-
-; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
-(defn -main [& args]
-  (println "started"))
-
 (comment

   (require '[clojure.tools.nrepl :as repl])


macroexpanding (foo/bar.) preserves namespace segment

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -111,7 +111,8 @@
    (let [[op & expr] form]
      (if (symbol? op)
        (let [opname (name op)
-             opns   (namespace op)]
+             opns   (namespace op)
+             op-s   (str op)]
          (cond

           (= (first opname) \.)
@@ -131,7 +132,7 @@

           (= (last opname) \.)
-          (with-meta (list* 'new (symbol (subs opname 0 (dec (count opname)))) expr)
+          (with-meta (list* 'new (symbol (subs op-s 0 (dec (count op-s)))) expr)
             (meta form))

           :else form))


Always treat attributes called '_geometry' as geometry

This restores the original behavior from when featured implemented
default geometry as a first class concept.

--- src/main/clojure/pdok/featured/json_reader.clj
+++ src/main/clojure/pdok/featured/json_reader.clj
@@ -125,7 +125,12 @@
     ;; else just return element, replace nothing
     element))

+(defn- upgrade-geometry [element]
+  (if (get element "_geometry")
+    (update element "_geometry" create-geometry-attribute)
+    element))
+
 (defn- upgrade-data [attributes]
   "Replaces functions with their parsed values"
   (let [attributes (postwalk replace-fn attributes)]
-    attributes))+    (postwalk upgrade-geometry attributes)))


oops, why did that change?

oops, why did that change?

--- src/main/shadow/cljs/devtools/server/nrepl.clj
+++ src/main/shadow/cljs/devtools/server/nrepl.clj
@@ -73,9 +73,9 @@
                 (send msg {:err "There are too many JS runtimes, don't know which to eval in.\n"})

                 :else
-                (send msg {:value (pr-str [:FIXME result])})))
+                (send msg {:value (pr-str [:FIXME result])}))

-            (recur)
+              (recur))
             ))))

     (send msg {:status :done})
@@ -150,6 +150,7 @@
        #'clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval
        #'clojure.tools.nrepl.middleware.load-file/wrap-load-file

+
        ;; FIXME: insert any other middleware here

        ;; provided by fake-piggieback, only because tools expect piggieback


uncomment name view

uncomment name view

Former-commit-id: 6ff7c71e35be89d4314106c37cd3792b882d4d09

--- src/status_im/chats_list/views/inner_item.cljs
+++ src/status_im/chats_list/views/inner_item.cljs
@@ -14,7 +14,7 @@
      [view st/chat-icon-container
       [chat-icon-view-chat-list chat-id group-chat name color online]]
      [view st/item-container
-      #_[view st/name-view
+      [view st/name-view
        [text {:style st/name-text} (truncate-str name 20)]
        (when group-chat
          [icon :group st/group-icon])


Test that new log format is parsed in full log

Related to #554

--- test/clojars/test/unit/tools/process_stats.clj
+++ test/clojars/test/unit/tools/process_stats.clj
@@ -31,4 +31,5 @@
 (deftest compute-stats
   (let [stats (stats/process-log (io/resource "fake.access.log"))]
     (is (= 5 (get-in stats [["snowy" "snowy"] "0.2.0"])))
+    (is (= 2 (get-in stats [["snowy" "snowy"] "0.3.0"])))
     (is (= 3 (get-in stats [["captain.archibald" "haddock"] "0.1.0"])))))


Remove leftover println

Remove leftover println

--- src/braid/core/client/ui/views/thread_header.cljs
+++ src/braid/core/client/ui/views/thread_header.cljs
@@ -212,7 +212,6 @@
                       [(el :view) thread]))))])

 (defn thread-header-view [thread]
-  (println @thread-header-items)
   (into
     [:div.head]
     (->> (into @thread-header-items


divide :eat between :subj and :obj

divide :eat between :subj and :obj


Make it possible to put and look up complex types


Handle invalid clicks

Handle invalid clicks


Now the vertical points wrap around to the top, so you should always see the timeline


Changed `.getClass` to more idiomatic `type`

--- src/kmg/datomic_helpers.clj
+++ src/kmg/datomic_helpers.clj
@@ -7,7 +7,7 @@

 (defn db-url [] (config :db :url))

-#_(d/create-database (db-url))
+(d/create-database (db-url))

 (defn conn [] (d/connect (db-url)))

@@ -24,7 +24,7 @@
 (defn entity [db id]
   (->> (d/touch (d/entity db id))
          (remove #(or (set? (val %))
-                      (= (.getClass (val %)) datomic.query.EntityMap)))
+                      (= (type (val %)) datomic.query.EntityMap)))
          (into {})))

 (defn prepare-entity [data]


Improve tracklist parsing

Improve tracklist parsing

Remove more lines from the start of the tracklist to reduce the need
for manual editing.

--- src/ktra_indexer/parser.clj
+++ src/ktra_indexer/parser.clj
@@ -24,12 +24,13 @@
   on it."
   [sc-url]
   (let [document (.get (Jsoup/connect sc-url))
-        tracklist-lines (rest (rest (s/split-lines
-                                     (.get (.attributes
-                                            (.first
-                                             (.select document
-                                                      "article > p > meta")))
-                                           "content"))))]
+        ;; Remove description from tracklist start
+        tracklist-lines (drop 3 (s/split-lines
+                                 (.get (.attributes
+                                        (.first
+                                         (.select document
+                                                  "article > p > meta")))
+                                       "content")))]
     {:title (s/trim (s/replace (first (s/split (.title document) #" by"))
                                "KTRA" ""))
      :tracklist (s/join "\n" tracklist-lines)


Remove bad peer settings used in tests

Remove bad peer settings used in tests


Change email error order

Change email error order

--- src/clj/collect_earth_online/db/users.clj
+++ src/clj/collect_earth_online/db/users.clj
@@ -27,7 +27,10 @@
                                 :userRole (if (:administrator user) "admin" "user")}})))) ; TODO user 1 is the only superuser

 (defn- get-register-errors [email password password-confirmation]
-  (cond (not (email? email))
+  (cond (sql-primitive (call-sql "email_taken" email -1))
+        (str "Account " email " already exists.")
+
+        (not (email? email))
         (str email " is not a valid email address.")

         (< (count password) 8)
@@ -35,9 +38,6 @@

         (not= password password-confirmation)
         "Password and Password confirmation do not match."
-
-        (sql-primitive (call-sql "email_taken" email -1))
-        (str "Account " email " already exists.")

         :else nil))


Export to JSON - use real maps instead of vectors

--- src/emender_jenkins/metadata_exporter.clj
+++ src/emender_jenkins/metadata_exporter.clj
@@ -20,13 +20,19 @@
 (defn column->keyword
     [columns]
     (for [column columns]
-    (-> (clojure.string/replace column " " "*")
+    (-> (clojure.string/replace column " " "-")
+        keyword)))
+
+(defn column->json-key
+    [columns]
+    (for [column columns]
+    (-> (clojure.string/replace column " " "_")
         keyword)))

 (defn mix-columns-with-data
-    [columns data]
+    [columns data function]
     (for [item data]
-        (zipmap (column->keyword columns) item)))
+        (zipmap (function columns) item)))

 (defn data->csv
     "Convert/format any data to CSV format."
@@ -51,11 +57,12 @@

 (defn export2json
     [columns data]
-    (data->json data))
+    (-> (mix-columns-with-data columns data column->json-key)
+        data->json))

 (defn export2edn
     [columns data]
-    (-> (mix-columns-with-data columns data)
+    (-> (mix-columns-with-data columns data column->keyword)
         data->edn))

 (defn export


Added add-price! to schema.clj

Added add-price! to schema.clj

--- src/hackerati_interval_web_app/schema.clj
+++ src/hackerati_interval_web_app/schema.clj
@@ -34,15 +34,25 @@
   (belongs-to products {:fk :productid})
   (entity-fields :priceid :productid :date :price))

-
 ;;;;;;;;;;;;;;;;;;;; FUNCTIONS ;;;;;;;;;;;;;;;;;;;;
-

 ;; TODO duplicate URLs should just not create multiple productids,
 ;; only multiple actionids
 (defn add-link! [userid url]
   (let [productid ((insert products (values {:url url})) :generated_key)]
     (insert tracked-links (values {:userid userid :productid productid}))))
+
+(defn add-price!
+  ([productid price]
+     (add-price! productid (java.util.Date.) price))
+  ([productid date price]
+     (try
+       (insert prices
+               (values {:productid productid
+                        :date date
+                        :price price}))
+       (catch com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException e "Error: date already exists!")
+       (catch Exception e "Warning: unidentified error " (.getMessage e)))))

 (defn add-user! [username pw email]
   (insert users


formatting.

formatting.

--- src/metabase/driver/generic_sql/query_processor/annotate.clj
+++ src/metabase/driver/generic_sql/query_processor/annotate.clj
@@ -30,18 +30,18 @@
   [query results]
   (let [field-ids (-> query :query :fields)
         fields-clause-fields (when-not (or (empty? field-ids)
-                                         (= field-ids [nil]))
+                                           (= field-ids [nil]))
                                (let [field-id->name (->> (sel :many [Field :id :name]
-                                                           :id [in field-ids])     ; Fetch names of fields from `fields` clause
-                                                      (map (fn [{:keys [id name]}]  ; build map of field-id -> field-name
-                                                             {id (keyword name)}))
-                                                      (into {}))]
+                                                              :id [in field-ids])     ; Fetch names of fields from `fields` clause
+                                                         (map (fn [{:keys [id name]}]  ; build map of field-id -> field-name
+                                                                {id (keyword name)}))
+                                                         (into {}))]
                                  (map field-id->name field-ids)))                     ; now get names in same order as the IDs
         other-fields (->> (first results)
-                       keys                                                        ; Get the names of any other fields that were returned (i.e., `sum`)
-                       (filter #(not (contains? (set fields-clause-fields) %))))]
+                          keys                                                        ; Get the names of any other fields that were returned (i.e., `sum`)
+                          (filter #(not (contains? (set fields-clause-fields) %))))]
     (->> (concat fields-clause-fields other-fields)                                   ; Return a combined vector. Convert them to strs, otherwise korma
-      (map name))))                                                                ; will qualify them like `"METABASE_FIELD"."FOLLOWERS_COUNT"
+         (map name))))                                                                ; will qualify them like `"METABASE_FIELD"."FOLLOWERS_COUNT"

 (defn- uncastify
   "Remove CAST statements from a column name if needed.


Fix fact-group metadata for integration tests

--- src/leiningen/new/cljskel/integration.clj
+++ src/leiningen/new/cljskel/integration.clj
@@ -32,7 +32,7 @@
 (defmethod read-body :none [http-response]
   (throw (Exception. (str "No content-type in response: " http-response))))

-(fact-group :acceptance
+(fact-group :integration
    (fact "Ping resource returns 200 HTTP response"
          (let [response (client/get (url+ "/ping")  {:throw-exceptions false})]
            response => (contains {:status 200})))


Add link to complete source

Add link to complete source

--- demo/reagentdemo/news/clockpost.cljs
+++ demo/reagentdemo/news/clockpost.cljs
@@ -19,7 +19,8 @@
         lexclock {:href "http://www.lexicallyscoped.com/2014/01/23/clojurescript-react-om-binary-clock.html"}
         hopclock {:href "http://pmbauer.github.io/2014/01/27/hoplon-binary-clock/"}
         om {:href "https://github.com/swannodette/om"}
-        hoplon {:href "http://hoplon.io"}]
+        hoplon {:href "http://hoplon.io"}
+        clocksrc {:href "https://github.com/holmsand/reagent/blob/master/demo/reagentdemo/news/binaryclock.cljs"}]

     [:div.reagent-demo
      [:h1 [link {:href main} head]]
@@ -85,6 +86,9 @@

          [fn-src :main]

+         [:p "The entire source is also available " [:a
+         clocksrc "here"] "."]
+
          [:h2 "How it all works"]

          [:p "Reading through the source, it may look like the entire


Rewrote satellite component with websockets (gniazdo)

--- src/strange_coop/components/satellite.clj
+++ src/strange_coop/components/satellite.clj
@@ -2,85 +2,47 @@
   (:require [clojure.core.async :as async :refer [chan <!! >!! go go-loop >! <! close!]]
             [org.httpkit.client :as http]
             [strange-coop.components.config :as config]
-            [cheshire.core :as json]
+            [clojure.edn :as edn]
+            [gniazdo.core :as ws]
             [com.stuartsierra.component :as component]))
-
-(defn basic-auth
-  [satellite]
-  (mapv (fn [k] (config/get-in-config satellite) [:satellite k]) [:username :password]))
-
-(defn monitor-url
-  ([statellite]
-   (config/get-in-config satellite [:monitor-url]))
-  ([satellite path]
-   (str (monitor-url satellite) path)))
-
-(defn handle-message
-  [satellite {:keys [] :as message}]
-  (http/post (monitor-url satellite "event")
-             {:query-params message
-              :basic-auth (basic-auth satellite)}))

 (defn initiate-emit-loop!
   [satellite]
   (go-loop []
-    (when-let [message (<! (get-in-config satellite [:channels :satellite-notify]))]
-      (handle-message satellite message)
+    (when-let [message (<! (get-in satellite [:channels :satellite-notify]))]
+      (ws/send-msg (:socket satellite) (str message))
       (recur))))

+(defmulti handle-incoming-message
+  "Handles an incoming message. Warning: satellite passed here is in closer before the socket was added to
+  the event satellite object. So no implementations of this multimethods should try to use (:socket channel)."
+  (fn [satellite message] (:type message))

-(defn handle-incoming-message
+(defmethod handle-incoming-message :command
   [satellite message]
-  (
-
-(defn check-messages
-  [satellite]
-  ;; Need to decide on the satellite api
-  (let [message-url (str (get-in-config satellite [:satellite :url]) "messages")
-        ;; Mocky.io
-        ;message-url "http://www.mocky.io/v2/55af3083bf6e05f92366fb35"
-        options  {:timeout 5000
-                  :basic-auth (basic-auth satellite)
-                  :query-params {:since @(:last-check satellite)}}]
-    (go-loop []
-      (http/get message-url
-                options
-                (fn [{:keys [status headers body error]}] ;; asynchronous response handling
-                  (if error
-                    ;; Not sure what to do here
-                    (do (>!! (get-in satellite [:channels :log])
-                             {:type ::check-messages-error
-                              :message "Failed, exception in check-message"
-                              :error error})
-                        (recur))
-                    (do (<!! (:recv-chan satellite) (json/parse-string body true))
-                        )))))
-
-
-(json/parse-string (:body @(http/get "http://www.mocky.io/v2/55af3083bf6e05f92366fb35")) true)
-
-(defn inititate-recv-loop!
-  [satellite]
-  (let [polling-interval 5000]
-    (async/thread
-      (
-    (go-loop []
-      (
-
-(defrecord Satellite [config channels last-check recv-chan]
+  (>!! (-> satellite :channels :door) (:message message)))
+
+(defrecord Satellite [config channels socket]
   component/Lifecycle
   (start [component]
-    (let [component (assoc component :last-check (atom 0))]
+    (let [log-chan (:log channels)
+          socket (ws/connect
+                   (str "wss://" (get-in config [:satellite :url]) "/socket")
+                   :on-receive (comp (partial handle-incoming-message component) edn/read-string)
+                   :on-connect (fn [_] (>!! log-chan {:type ::info :message "Satellite initialized"}))
+                   ;; Should add reconnect logic...
+                   :on-error (fn [e] (>!! log-chan {:type ::error :message "Satellite error" :error e}))
+                   :on-close (fn [status-code message] (>!! log-chan {:type ::warning
+                                                                    :message (str "Satellite connection closed: " message)
+                                                                    :status-code status-code})))
+          component (assoc component :socket socket)]
       (initiate-emit-loop! component)
-      (initiate-recv-loop! component)
       component))

   (stop [component]
-    ;; emit loop will kill automatically because the input channel will close! on channel lifecycle
-    ;; Need a kill siwtch for recv still
-    (assoc component
-           :last-check nil)))
-
+    (ws/close socket)
+    ;; Note that emit loop will close when channels do
+    (assoc component :socket nil)))

 (defn new-satellite []
   (map->Satellite {}))


misc. pom cleanup

misc. pom cleanup

--- src/tailrecursion/boot/middleware/pom.clj
+++ src/tailrecursion/boot/middleware/pom.clj
@@ -8,10 +8,7 @@
    org.apache.maven.model.io.xpp3.MavenXpp3Writer))

 (defmacro dotoseq [obj seq-exprs & body]
-  `(let [o# ~obj]
-     (doseq ~seq-exprs
-       (doto o# ~@body))
-     o#))
+  `(let [o# ~obj] (doseq ~seq-exprs (doto o# ~@body)) o#))

 (defn ^Model set-repositories! [^Model model repositories]
   (dotoseq model [repo repositories]
@@ -53,10 +50,10 @@
     {:model model
      :xml (with-out-str (.write (MavenXpp3Writer.) *out* model))}))

-(defn wrap-pom [handler & options]
-  #(handler (merge-with merge % (if (:pom %) {:pom (make-pom %)}))))
+(defn wrap-pom [handler]
+  #(handler (if (:pom %) (update-in % [:pom] merge (make-pom %)) %)))

-(defmethod dispatch/dispatch-cli "pom" [env [_ name & _]]
-  (let [pom-file (io/file (get-in env [:boot :system :cwd]) (or name "pom.xml"))]
+(defmethod dispatch/dispatch-cli "pom" [env [_ path]]
+  (let [pom-file (io/file (get-in env [:boot :system :cwd]) (or path "pom.xml"))]
     (spit pom-file (:xml (make-pom env)))
     (println "Wrote" (.getAbsolutePath pom-file))))


No longer printing empty diff, instead printing actual & expected

--- src/untangled_spec/reporters/terminal.clj
+++ src/untangled_spec/reporters/terminal.clj
@@ -65,7 +65,7 @@
              (pretty-str patched-actual 2))))

 (defn print-diff [diff actual print-fn]
-  (when (and (env :diff?) (diff/diff? diff))
+  (when (and (seq diff) (env :diff?) (diff/diff? diff))
     (println)
     (when (env :diff-list?)
       (let [num-diffs (env :num-diffs)
@@ -124,8 +124,10 @@
              (not (instance? Throwable actual)))
     (print-throwable throwable))
   (some-> message (print-message print-fn))
-  (when (or (not diff) (not (env :diff?))
-            (and (not (env :diff-hl?)) (not (env :diff-list?))))
+  (when (or (not diff) (empty? diff)
+            (not (env :diff?))
+            (and (not (env :diff-hl?))
+                 (not (env :diff-list?))))
     (print-fn "   Actual:" (pretty-str actual (+ 5 print-level)))
     (print-fn " Expected:" (pretty-str expected (+ 5 print-level))))
   (some-> extra (print-extra print-fn))


Minor refactoring

Minor refactoring

--- frontend/src/faceboard/views/boards/inkpad.cljs
+++ frontend/src/faceboard/views/boards/inkpad.cljs
@@ -9,9 +9,8 @@
 (defn extract-content [html]
   (let [frame (.createElement js/document "div")]
     (set! (.-innerHTML frame) html)
-    (let [markdown-body (aget (.querySelectorAll frame ".markdown-body") 0)]
-      (when markdown-body
-        (.-innerHTML markdown-body)))))
+    (if-let [markdown-body (aget (.querySelectorAll frame ".markdown-body") 0)]
+      (.-innerHTML markdown-body))))

 (defn process-response [id url response]
   (perform! :update-tab-cache id (if (:success response)


Visual feedback after add contact (#315)

--- src/status_im/contacts/handlers.cljs
+++ src/status_im/contacts/handlers.cljs
@@ -172,7 +172,8 @@
   (u/side-effect!
     (fn [_ [_ {:keys [whisper-identity] :as contact}]]
       (when-not (contacts/get-by-id whisper-identity)
-        (dispatch [::prepare-contact contact])))))
+        (dispatch [::prepare-contact contact])
+        (dispatch [:start-chat whisper-identity {} :navigation-replace])))))

 (register-handler ::prepare-contact
   (-> add-new-contact


project changes

project changes

--- example/project.clj
+++ example/project.clj
@@ -5,7 +5,7 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [
                  [org.clojure/clojure "1.8.0-RC2"]
-                 [org.clojure/clojurescript "1.7.170"]
+                 [org.clojure/clojurescript "1.7.228"]
                  [org.clojure/core.async "0.2.374"]
                  [sablono "0.3.5"]
                  [org.omcljs/om "0.8.8"]
@@ -84,8 +84,8 @@
                                      :output-dir "resources/public/js/compiled/admin"
                                      :libs ["libs_src" "libs_sscr/tweaky.js"]
                                      ;; :externs ["foreign/wowza-externs.js"]
-                                    :foreign-libs [{:file "foreign/wowza.js"
-                                                    :provides ["wowzacore"]}]
+                                     :foreign-libs [{:file "foreign/wowza.js"
+                                                     :provides ["wowzacore"]}]
                                      ;; :recompile-dependents true
                                      :source-map true
                                      :optimizations :none
@@ -95,14 +95,14 @@
                          :compiler { :output-to "resources/public/js/prod/example_admin.js"
                                      :output-dir "resources/public/js/prod/admin"
                                      :optimizations :whitespace
-                                     }}]}
+                                    }}]}

   :profiles { :dev { :dependencies [[com.cemerick/piggieback "0.2.1"]
                                     [figwheel-sidecar "0.5.0-3"]
                                     [org.clojure/tools.namespace "0.2.11"]
                                     [org.clojure/tools.nrepl "0.2.12"]]
-                    :source-paths ["src" "dev"]}
-             :repl { :plugins [ [cider/cider-nrepl "0.10.0-SNAPSHOT"]]}}
+                    :source-paths ["src" "dev"]
+                    :plugins [[cider/cider-nrepl "0.10.1"]]}}

   :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}

@@ -112,13 +112,13 @@
              :css-dirs ["resources/public/css"]
              :open-file-command "emacsclient"

-            ;; :reload-clj-files {:clj true :cljc true}
+             ;; :reload-clj-files {:clj true :cljc true}

              ;; Start an nREPL server into the running fighweel
              ;; process

-             :nrepl-port 7888
+             ;; :nrepl-port 7888

              :nrepl-middleware ["cider.nrepl/cider-middleware"
                                 #_"refactor-nrepl.middleware/wrap-refactor"


Update dependency in the example project

--- example/project.clj
+++ example/project.clj
@@ -6,7 +6,7 @@

   ; List of plugins
-  :plugins [[lein-jslint "0.1.8-SNAPSHOT"]]
+  :plugins [[lein-jslint "0.1.9"]]

   ; List of hooks
   ; It's used for running JSLint during compile phase


added bootstrap

added bootstrap

--- src/aristotle/templates/home.clj
+++ src/aristotle/templates/home.clj
@@ -10,7 +10,6 @@
      [:html
       [:head
       "<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css' integrity='sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M' crossorigin='anonymous'>"
-
       [:style (style/render)]]
      [:body
       [:div {:class "container" :id "search-container"}


Eagerly calculate future frames via requestIdleCallback

--- src/asciinema/player/source.cljs
+++ src/asciinema/player/source.cljs
@@ -209,6 +209,14 @@
                            (>! msg-ch (m/->UpdateScreen (screen-at start-at frames)))
                            (recur start-at speed end-ch stop-ch)))))))

+(defn dorun-when-idle [coll]
+  (when-let [ric (util/window-prop "requestIdleCallback")]
+    (letfn [(make-cb [coll]
+              (fn []
+                (when (seq coll)
+                  (ric (make-job (rest coll))))))]
+      (ric (make-cb coll)))))
+
 (defn start-preloader [{:keys [recording-ch-fn command-ch force-load-ch preload? poster-time] :as recording} msg-ch]
   (go
     (let [recording-ch (recording-ch-fn (or preload? poster-time))
@@ -223,7 +231,8 @@
       (when poster-time
         (show-poster data poster-time msg-ch))
       (report-metadata data msg-ch)
-      (start-event-loop recording msg-ch data))))
+      (start-event-loop recording msg-ch data)
+      (dorun-when-idle (:frames data)))))

 (defrecord Recording [recording-ch-fn command-ch force-load-ch start-at speed auto-play? loop? preload? poster-time]
   Source


log errors in rmqstate

log errors in rmqstate

--- src/brainbot/nozzle/rmqstate.clj
+++ src/brainbot/nozzle/rmqstate.clj
@@ -39,12 +39,18 @@
       (throw-management-api-error))
     qs))

+(defn call-and-log-errors
+  [f]
+  (try
+    (f)
+    (catch Throwable err
+      (logging/error "error while calling list-queues" err))))

 (defn start-looping-qwatcher
   "periodically call list-queues and put the result on an async/mult"
   [vhost]
   (let [ch (chan)
         m (mult ch)
-        lqfn #(async/thread (list-queues vhost))]
+        lqfn #(async/thread (call-and-log-errors (fn [] (list-queues vhost))))]
     (assoc (async-helper/looping-go 10000 lqfn ch)
       :mult m)))


Fix play/pause handlers, broke the schema

--- src/app/handlers.cljs
+++ src/app/handlers.cljs
@@ -16,12 +16,13 @@

 (def ->ls (after db/db->ls!))

-(def player-mw [trim-v])
+(def player-mw [(path :player)
+                trim-v])
 (def controls-mw [(path :controls)
                   trim-v])

 (def channel-mw [->ls
-                 (path :channels)
+                 (path :channels)
                  trim-v])

 (def playstates {:stopped "Stopped"
@@ -44,7 +45,7 @@

 ;; -- Player

-(defn start [db [_]]
+(defn start [db [_]] ;; TODO remove channel dep
   (let [player (:player db)
         interval-new (/ 1000 (:items-per-sec player))
         interval-anim 50
@@ -62,7 +63,7 @@

 (register-handler
  :start
- [player-mw]
+ [trim-v]
  start)

 (defn stop [db [_]]
@@ -72,14 +73,14 @@

 (register-handler
  :stop
- player-mw
+ [trim-v]
  stop)

 (register-handler
  :toggle-play
- player-mw
+ [trim-v]
  (fn [db [_]]
-   (if (= (:playstate db) :stopped)
+   (if (= (get-in db [:player :playstate]) :stopped)
      (start db [])
      (stop db []))))

@@ -92,7 +93,7 @@

 (register-handler
  :set-playmode
- player-mw
+ [player-mw]
  (fn [db [playmode]]
    (assoc-in db [:playmode] playmode)))


protect priority queue with a lock

protect priority queue with a lock

--- src/clj/backtype/storm/timer.clj
+++ src/clj/backtype/storm/timer.clj
@@ -25,7 +25,7 @@
                       (fn []
                         (while @active
                           (try
-                            (let [[time-secs _ _ :as elem] (.peek queue)]
+                            (let [[time-secs _ _ :as elem] (locking lock (.peek queue))]
                               (if (and elem (>= (current-time-secs) time-secs))
                                 ;; imperative to not run the function inside the timer lock
                                 ;; otherwise, it's possible to deadlock if function deals with other locks


Add ArraySeq to the list of seqs serializable by clojure-seq-serializer

--- src/clj/carbonite/serializer.clj
+++ src/clj/carbonite/serializer.clj
@@ -13,7 +13,7 @@
            [java.sql Time Timestamp]
            [clojure.lang Keyword Symbol PersistentArrayMap
             PersistentHashMap MapEntry PersistentStructMap
-            PersistentVector PersistentHashSet Ratio
+            PersistentVector PersistentHashSet Ratio ArraySeq
             Cons PersistentList PersistentList$EmptyList Var
             ArraySeq$ArraySeq_int LazySeq IteratorSeq StringSeq]))

@@ -192,7 +192,7 @@
     [MapEntry (clojure-coll-serializer registry [])]]

    ;; list/seq collections
-   (zipmap [Cons PersistentList$EmptyList PersistentList LazySeq IteratorSeq]
+   (zipmap [Cons PersistentList$EmptyList PersistentList LazySeq IteratorSeq ArraySeq]
            (repeat (clojure-seq-serializer registry list)))

    ;; other seqs


Update no zooming meta tag

Update no zooming meta tag

--- src/clj/ji/service/templates.clj
+++ src/clj/ji/service/templates.clj
@@ -36,8 +36,7 @@
        (page/html5
          [:head
           [:meta {:charset "utf-8"}]
-          [:meta {:name"viewport" :content "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"}]
-          [:meta {:name "viewport" :content "width=device-width"}]
+          [:meta {:name "viewport" :content "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"}]
           [:title ~page-title]
           (page/include-css "/stylesheets/app.css")
           (page/include-js "/js/vendor/custom.modernizr.js")]


Update ji.service.templates

Update ji.service.templates

--- src/clj/ji/service/templates.clj
+++ src/clj/ji/service/templates.clj
@@ -71,7 +71,6 @@
     (page/include-js "/js/main.js")
     [:script "$(ji.main.init);"]))

-
 (defpage game-create [game-id]
   (defblock content
     [:form
@@ -80,7 +79,7 @@
      [:input {:type "hidden" :name "game-id" :value game-id}]
      [:div.row.collapse
       [:div.large-6.small-12.columns.large-centered
-       [:h2 "Game does not exist ..yet!"]
+       [:h2 "Game does not exist ...yet!"]
        [:input.button
         {:type "submit"
          :value "Create Game"}]]]]))


add prod js paths

add prod js paths

--- src/clj/link_collective/core.clj
+++ src/clj/link_collective/core.clj
@@ -1,7 +1,7 @@
 (ns link-collective.core
   (:gen-class :main true)
   (:require [clojure.edn :as edn]
-            [net.cgrand.enlive-html :refer [deftemplate set-attr] :as enlive]
+            [net.cgrand.enlive-html :refer [deftemplate set-attr substitute html] :as enlive]
             [clojure.java.io :as io]
             [compojure.route :refer [resources]]
             [compojure.core :refer [GET POST defroutes]]
@@ -34,7 +34,8 @@
   [:#bootstrap-theme-css] (set-attr "href" "static/bootstrap/bootstrap-3.1.1-dist/css/bootstrap-theme.min.css")
   [:#react-js] (set-attr "src" "static/react/react-0.9.0.min.js")
   [:#jquery-js] (set-attr "src" "static/jquery/jquery-1.11.0.min.js")
-  [:#bootstrap-js] (set-attr "src" "static/bootstrap/bootstrap-3.1.1-dist/js/bootstrap.min.js"))
+  [:#bootstrap-js] (set-attr "src" "static/bootstrap/bootstrap-3.1.1-dist/js/bootstrap.min.js")
+  [:#js-files] (substitute (html [:script {:src "js/main.js" :type "text/javascript"}])))

 (defn create-store


minor fix

minor fix

--- src/cljs/dbquery/db_console.cljs
+++ src/cljs/dbquery/db_console.cljs
@@ -145,7 +145,7 @@
         [code-mirror cm {:mode "text/x-sql"
                          :tabindex 2 :autofocus true
                          :extraKeys {:Ctrl-Enter exec-sql :Alt-S save-fn}}
-         (or (:sql @query) "  ")]]])))
+         (or (:sql @query) "")]]])))

 (defn metadata-table [db-id {:keys [table] :as model}]
   (let [data (subscribe [:metadata db-id table])]


Improve target->nodes

Improve target->nodes

--- src/clojure_fabric/chaincode.clj
+++ src/clojure_fabric/chaincode.clj
@@ -235,11 +235,12 @@
    (second (rand-nth (seq (:peers channel))))))

 (defn target->nodes [target]
-  (condp instance? target
-    Peer [target]
-    Orderer [target]
-    Channel [(get-random-peer target)]
-    clojure.lang.PersistentVector target))
+  (if (sequential? target)
+    target
+    (condp instance? target
+      Peer [target]
+      Orderer [target]
+      Channel [(get-random-peer target)])))

 (defn send-chaincode-request
   [chaincode-key channel-name target user & {:keys [verify?]


[#1853] Fix entity property keyword name

--- backend/test/akvo/lumen/lib/import/clj_data_importer_test.clj
+++ backend/test/akvo/lumen/lib/import/clj_data_importer_test.clj
@@ -70,7 +70,7 @@
           stored-data (->> (latest-dataset-version-by-dataset-id *tenant-conn*
                                                                  {:dataset-id dataset-id})
                            (get-data *tenant-conn*))
-          updated-res (update-file *tenant-conn* *error-tracker* (:dataset_id job) (:data_source_id job)
+          updated-res (update-file *tenant-conn* *error-tracker* (:dataset-id job) (:data_source_id job)
                         {:kind "clj"
                          :data (i-c/sample-imported-dataset [:text :number] 2)})]
       (is (some? updated-res)))))


Remove debug join

Remove debug join

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -737,7 +737,6 @@
         iterator-results (apply-to-iterator (iterator tree) movements)
         iterator-a (iterator tree)
         iterator-b (iterator tree)
-        _ (iter-seq 10 (join #js [iterator-a iterator-b] key-len #js [(into-array (repeat key-len true)) (into-array (repeat key-len true))]))
         join-results (apply-to-iterator
                       (join #js [iterator-a iterator-b] key-len #js [(into-array (repeat key-len true)) (into-array (repeat key-len true))])
                       movements)]


(PDB-3630) update facts blacklist test to match schema changes in 5.1.x

--- test/puppetlabs/puppetdb/command_test.clj
+++ test/puppetlabs/puppetdb/command_test.clj
@@ -705,14 +705,15 @@
           (handle-message (queue/store-command q (facts->command-req (version-kwd->num version) command)))
           (is (= (query-to-vec
                   "SELECT fp.path as name,
-                          COALESCE(f.value_string,
-                                   cast(f.value_integer as text),
-                                   cast(f.value_boolean as text),
-                                   cast(f.value_float as text),
+                          COALESCE(fv.value_string,
+                                   cast(fv.value_integer as text),
+                                   cast(fv.value_boolean as text),
+                                   cast(fv.value_float as text),
                                    '') as value,
                           fs.certname
                    FROM factsets fs
                      INNER JOIN facts as f on fs.id = f.factset_id
+                     INNER JOIN fact_values as fv on f.fact_value_id = fv.id
                      INNER JOIN fact_paths as fp on f.fact_path_id = fp.id
                    WHERE fp.depth = 0
                    ORDER BY name ASC")


enable shallow scan

enable shallow scan


Fixed issue #18

Fixed issue #18

--- src/alfresco_technical_validation/binary_validation.clj
+++ src/alfresco_technical_validation/binary_validation.clj
@@ -86,11 +86,18 @@
                                                          AND NOT(m.name IN [
                                                                              {in-clause-values}
                                                                            ])
-                                                      RETURN n.name AS ClassName, COLLECT(DISTINCT m.name) AS APIs
-                                                       ORDER BY n.name
+                                                      RETURN DISTINCT m.name AS PrivateAPIs
+                                                       ORDER BY m.name
                                                      ", alfresco-public-java-api)
-        res                      (cy/tquery cypher-query)]
-    (standard-validation "API01" res false "The technology only uses Alfresco's Public Java APIs.")))
+        res                      (cy/tquery cypher-query)
+        res-as-string            (str "The following private Java APIs are used:\n"
+                                   (s/join "\n" (map #(str (get % "PrivateAPIs")) res)))
+        message                  (if (empty? res)
+                                   "The technology only uses Alfresco's Public Java APIs."
+                                   res-as-string)]
+    (declare-result "API01"
+                    (empty? res)
+                    message)))

 ; Would be preferable to do a deeper search here, but Neo4J is super slow at those
 (defn- api06-service-locator


errors

errors

--- src/celestial/api.clj
+++ src/celestial/api.clj
@@ -56,7 +56,7 @@
     (schedule-job id action msg [(assoc (p/get-system id) :system-id (Integer. id))]))
   ([id action msg args]
     (if-not (p/system-exists? id)
-     (bad-req {:msg (<< "No system found with given id ~{id}")})
+     (bad-req {:errors (<< "No system found with given id ~{id}")})
      (success
        {:msg msg :id id :job (jobs/enqueue action {:identity id :args args :tid (get-tid)})}))))


missing action notice

missing action notice

--- src/celestial/api.clj
+++ src/celestial/api.clj
@@ -83,12 +83,13 @@
      {:nickname "runAction" :summary "Run remote action"
       :notes "Runs adhoc remote opertions on system (like deployment, service restart etc)
              using matching remoting capable tool like Capisrano/Supernal/Fabric"}
-       (let [{:keys [machine] :as system} (p/get-system id)
-             actions (p/find-action-for (keyword action) (:type system))
-             args {:identity id :args [actions {:action (keyword action) :target (machine :ip)}]}
-             job (jobs/enqueue "run-action" args)]
-           (success
-             {:msg "submitted action" :action action :job job})))
+       (let [{:keys [machine] :as system} (p/get-system id)]
+         (if-let [actions (p/find-action-for (keyword action) (:type system))]
+           (let [args {:identity id :args [actions {:action (keyword action) :target (machine :ip)}]}
+                 job (jobs/enqueue "run-action" args)]
+             (success {:msg "submitted action" :action action :job job}))
+           (bad-req {:msg (<< "No action ~{action} found for id ~{id}")})
+           )))

   (GET- "/job/:queue/:uuid/status" [^:string queue ^:string uuid]
         {:nickname "jobStatus" :summary "job status tracking"


Fix issue with errors on CSV throwing a 404

--- src/cfpb/qu/views.clj
+++ src/cfpb/qu/views.clj
@@ -432,11 +432,13 @@
                       (response/set-headers {"Link" (str/join ", " links)})
                       (response/set-headers {"X-Computing" computing}))
         data (concat (vector columns) rows)]
-    (if (should-stream? resource)
-      (stream-slice-query-csv request response data)
-      (->> (str (write-csv (vector columns)) (write-csv rows))
-           (response/content-type "text/csv; charset=utf-8")
-           (response/set-headers {"Link" (str/join ", " links)})))))
+    (if (query/valid? query)
+      (if (should-stream? resource)
+        (stream-slice-query-csv request response data)
+        (->> (str (write-csv (vector columns)) (write-csv rows))
+             (response/content-type "text/csv; charset=utf-8")
+             (response/set-headers {"Link" (str/join ", " links)})))
+      (response/content-type "text/plain" ""))))

 (defmethod slice-query "application/json"
   [_ resource {:keys [request]}]


Clojure code - nube level achived!

Clojure code - nube level achived!

--- downloadRandImage/Program.clj
+++ downloadRandImage/Program.clj
@@ -1,27 +1,27 @@
 (ns downloadRandImage
- (:require [clojure.java.io :as io]))
+  (:gen-class)
+  (:require [clojure.java.io :as io]))

 (def url "http://alpha.wallhaven.cc/random")
 (def userAgent "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1")
+(def img-r-ex #"<img [^>]*? src=\".*?th-(\d+\..{3})\"[^>]*?>")
+(def image-link-prefix "http://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-")

-(defn getWwwInputStream [url]
-  (-> (java.net.URL. url)
-      .openConnection
+(defn getWwwInputStream [url]
+  (-> (java.net.URL. url)
+      .openConnection
       (doto (.setRequestProperty "User-Agent"
-                               userAgent))
+        userAgent))
       .getInputStream))

-(def html (-> url getWwwInputStream slurp))
+(defn fetch-to-file [url file]
+  (with-open [in  (io/input-stream url)
+              out (io/output-stream file)]
+    (io/copy in out)))

-(def *matcher* (re-matcher #"<img [^>]*? src=\".*?th-(\d+\..{3})\"[^>]*?>" html))
-
-(def imgName ((re-find *matcher*) 1))
-
-(def imgUrl (str "http://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-" imgName))
-
-(defn fetch-to-file [url file]
-                (with-open [in (io/input-stream url)
-                            out (io/output-stream file)]
-                  (io/copy in out)))
-
-(fetch-to-file (getInputStream imgUrl) imgName)+(defn -main [& args]
+  (let [html    (-> url getWwwInputStream slurp)
+        matcher (re-matcher img-r-ex html)
+        imgName ((re-find matcher) 1)
+        imgUrl  (str image-link-prefix imgName)]
+          (fetch-to-file (getWwwInputStream imgUrl) imgName)))


#99 add condp also to other function

#99 add condp also to other function

--- src/cheshire/core.clj
+++ src/cheshire/core.clj
@@ -82,10 +82,14 @@
                                      factory/json-factory)
                     ^Writer writer)
          print-pretty (:pretty opt-map)]
-     (when (= true print-pretty)
-       (.useDefaultPrettyPrinter generator))
-     (when (map? print-pretty)
-       (.setPrettyPrinter generator (create-pretty-printer print-pretty)))
+     (condp instance? print-pretty
+       Boolean
+         (.useDefaultPrettyPrinter generator)
+       clojure.lang.IPersistentMap
+         (.setPrettyPrinter generator (create-pretty-printer print-pretty))
+       PrettyPrinter
+         (.setPrettyPrinter generator print-pretty)
+       nil)
      (when (:escape-non-ascii opt-map)
        (.enable generator JsonGenerator$Feature/ESCAPE_NON_ASCII))
      (gen/generate generator obj (or (:date-format opt-map)


fix bug with IFn direct invoke implementation where we weren't properly propagating needed deftype metadata on the fn form

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -675,21 +675,21 @@
             ~(with-meta `(fn ~@(map #(adapt-obj-params type %) meths)) (meta form))))
     sigs))

-(defn ifn-invoke-methods [type-sym meths]
+(defn ifn-invoke-methods [type type-sym [f & meths :as form]]
   (map
     (fn [meth]
       (let [arity (count (first meth))]
         `(set! ~(prototype-prefix type-sym
                   (symbol (core/str "cljs$core$IFn$_invoke$arity$" arity)))
-           (fn ~meth))))
-    meths))
+           ~(with-meta `(fn ~meth) (meta form)))))
+    (map #(adapt-ifn-invoke-params type %) meths)))

 (defn add-ifn-methods [type type-sym [f & meths :as form]]
-  (let [meths'   (map #(adapt-ifn-params type %) meths)
+  (let [meths    (map #(adapt-ifn-params type %) meths)
         this-sym (with-meta 'self__ {:tag type})
         argsym   (gensym "args")]
     (concat
-      [`(set! ~(prototype-prefix type-sym 'call) ~(with-meta `(fn ~@meths') (meta form)))
+      [`(set! ~(prototype-prefix type-sym 'call) ~(with-meta `(fn ~@meths) (meta form)))
        `(set! ~(prototype-prefix type-sym 'apply)
           ~(with-meta
              `(fn ~[this-sym argsym]
@@ -697,8 +697,7 @@
                   (.apply (.-call ~this-sym) ~this-sym
                     (.concat (array ~this-sym) (aclone ~argsym)))))
              (meta form)))]
-      (ifn-invoke-methods type-sym
-        (map #(adapt-ifn-invoke-params type %) meths)))))
+      (ifn-invoke-methods type type-sym form))))

 (defn add-proto-methods* [pprefix type type-sym [f & meths :as form]]
   (let [pf (core/str pprefix f)]


Don't run `req` when installing facedown

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -1231,7 +1231,7 @@
        (let [cost (if (or no-cost facedown) 0 (install-cost state side card))]
          (when (and (or (not uniqueness) (not (in-play? state card)) facedown)
                     (if-let [req (:req (card-def card))]
-                      (req state side card nil) true)
+                      (or facedown (req state side card nil)) true)
                     (pay state side card :credit cost (when (and (not facedown) memoryunits) [:memory memoryunits]) extra-cost))
            (let [c (if host-card
                      (host state side host-card card)


add segment integrators

add segment integrators

--- src/clj/hsm/views.clj
+++ src/clj/hsm/views.clj
@@ -211,6 +211,10 @@
               suggestion: Handlebars.compile('
{{watchers}}- {{full_name}}
')}
             });
 !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
+
+!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error('Segment snippet included twice.');else{analytics.invoked=!0;analytics.methods=['trackSubmit','trackClick','trackLink','trackForm','pageview','identify','group','track','ready','alias','page','once','off','on'];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement('script');e.type='text/javascript';e.async=!0;e.src=('https:'===document.location.protocol?'https://':'http://')+'cdn.segment.com/analytics.js/v1/'+t+'/analytics.min.js';var n=document.getElementsByTagName('script')[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION='3.0.1';
+  analytics.load('eqMNHeqB0Ukx8AWah4nKiwFwaxbeJlGg');
+  analytics.page()
 "
           )
         ])


Add type hint

Add type hint

--- src/clj_http/core.clj
+++ src/clj_http/core.clj
@@ -59,7 +59,7 @@

 (defn make-proxy-method-with-body
   [method]
-  (fn [url]
+  (fn [^String url]
     (doto (proxy [HttpEntityEnclosingRequestBase] []
             (getMethod [] (.toUpperCase (name method))))
       (.setURI (URI. url)))))


Fix for plexus/chestnut#106

Fix for plexus/chestnut#106

--- env/dev/clj/haunting_refrain/dev.clj
+++ env/dev/clj/haunting_refrain/dev.clj
@@ -25,7 +25,7 @@
 (defn start-figwheel []
   (let [server (fig/start-server { :css-dirs ["resources/public/css"] })
         config {:builds [{:id "dev"
-                          :source-paths ["env/dev/cljs" "src/cljs"]
+                          :source-paths ["src/cljs" "env/dev/cljs"]
                           :compiler {:output-to            "resources/public/js/app.js"
                                      :output-dir           "resources/public/js/out"
                                      :source-map           "resources/public/js/out.js.map"


(maint) Repair broken mq test

(maint) Repair broken mq test

This commit fixes a broken mq test where there was an `(= ...)`
expression that wasn't wrapped around its second argument. This failed
silently with a normal `lein test` but caused failures with the
humane-test-output plugin for `lein`. This commit also removes some
unnecessary commas and makes sure to cleanup the `somedir` created
during the mq-tests.

--- test/puppetlabs/puppetdb/mq_test.clj
+++ test/puppetlabs/puppetdb/mq_test.clj
@@ -89,25 +89,28 @@

 (deftest test-build-broker
   (testing "build-embedded-broker"
-    (let [broker (build-embedded-broker "somedir")]
-      (is (instance? BrokerService broker)))
-    (let [broker (build-embedded-broker "localhost" "somedir")]
-      (is (instance? BrokerService broker)))
-    (let [broker (build-embedded-broker "localhost" "somedir" {})]
-      (is (instance? BrokerService broker)))
-    (let [size-megs 50
-          size-bytes (* size-megs 1024 1024)
+    (try
+      (let [broker (build-embedded-broker "somedir")]
+        (is (instance? BrokerService broker)))
+      (let [broker (build-embedded-broker "localhost" "somedir")]
+        (is (instance? BrokerService broker)))
+      (let [broker (build-embedded-broker "localhost" "somedir" {})]
+        (is (instance? BrokerService broker)))
+      (let [size-megs 50
+            size-bytes (* size-megs 1024 1024)

-          broker (build-embedded-broker "localhost" "somedir"
-                                        {:store-usage size-megs
-                                         :temp-usage  size-megs})]
-      (is (instance? BrokerService broker))
-      (is (.. broker (getPersistenceAdapter) (isIgnoreMissingJournalfiles)))
-      (is (.. broker (getPersistenceAdapter) (isArchiveCorruptedIndex)))
-      (is (.. broker (getPersistenceAdapter) (isCheckForCorruptJournalFiles)))
-      (is (.. broker (getPersistenceAdapter) (isChecksumJournalFiles)))
-      (is (= size-bytes (.. broker (getSystemUsage) (getStoreUsage) (getLimit))))
-      (is (= size-bytes (.. broker (getSystemUsage) (getTempUsage) (getLimit)))))))
+            broker (build-embedded-broker "localhost" "somedir"
+                                          {:store-usage size-megs
+                                           :temp-usage  size-megs})]
+        (is (instance? BrokerService broker))
+        (is (.. broker (getPersistenceAdapter) (isIgnoreMissingJournalfiles)))
+        (is (.. broker (getPersistenceAdapter) (isArchiveCorruptedIndex)))
+        (is (.. broker (getPersistenceAdapter) (isCheckForCorruptJournalFiles)))
+        (is (.. broker (getPersistenceAdapter) (isChecksumJournalFiles)))
+        (is (= size-bytes (.. broker (getSystemUsage) (getStoreUsage) (getLimit))))
+        (is (= size-bytes (.. broker (getSystemUsage) (getTempUsage) (getLimit)))))
+      (finally
+        (fs/delete-dir "somedir")))))

 (deftest test-jmx-enabled
   (without-jmx
@@ -159,7 +162,7 @@
       (transfer-messages! "test" "foo" "bar")
       (is (zero? (queue-size "test" "foo")))
       (is (= 3 (queue-size "test" "bar")))
-      (is (= [{:headers {}, :body "1"}
-              {:headers {}, :body "2"}
-              {:headers {}, :body "3"}])
-          (bounded-drain-into-vec! conn "bar" 3)))))
+      (is (= [{:headers {} :body "1"}
+              {:headers {} :body "2"}
+              {:headers {} :body "3"}]
+             (bounded-drain-into-vec! conn "bar" 3))))))


put! to clients, never >!

put! to clients, never >!

--- src/c4_arena/core.clj
+++ src/c4_arena/core.clj
@@ -101,7 +101,7 @@
       ;; Cleanup
       (doseq [{:keys [latch ch-out]} players]
         (notify ch-out)
-        (>! ch-out {:type (if @winner "end" "disconnected")})
+        (put! ch-out {:type (if @winner "end" "disconnected")})
         (async/close! latch)))))

 (defn match-once [{:keys [id] :as player0}]
@@ -150,7 +150,7 @@
             (>! @matcher {:id id :ch-in ch-in :ch-out ch-out :latch latch})
             ;; Waits here until game ends
             (<! latch))
-          (>! ch-out {:type "ignored" :msg msg}))
+          (put! ch-out {:type "ignored" :msg msg}))
         (recur)))))

 ;;; Game loop


Don't require type

Don't require type

--- src/circle/backend/action.clj
+++ src/circle/backend/action.clj
@@ -32,7 +32,7 @@
   "defines an action."
   [& {:keys [name act-fn type source]
       :as args}]
-  (require-args name act-fn type)
+  (require-args name act-fn)
   args)

 (defn successful? [action-result]


returning an empty map if no actions exists

--- src/celestial/api.clj
+++ src/celestial/api.clj
@@ -124,7 +124,7 @@

   (GET- "/actions/type/:type" [^:string type] {:nickname "getActionsByTargetType" :summary "Gets actions that operate on a target type"}
         (let [ids (p/get-action-index :operates-on type)]
-           (success (apply merge (map #(hash-map % (p/get-action %)) ids)))))
+           (success (apply merge {} (map #(hash-map % (p/get-action %)) ids)))))

   (GET- "/actions/:id" [^:int id] {:nickname "getActions" :summary "Gets actions descriptor"}
         (success (p/get-action id)))


fix Executive Wiretaps bug and add info to Forged Activation Orders prompt

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -187,7 +187,7 @@
                  (when caninst (lose state side :credit cost))))))}

    "Executive Wiretaps"
-   {:msg (msg "reveal cards in HQ: " (map :title (:hand corp)))}
+   {:msg (msg "reveal cards in HQ: " (join ", " (map :title (:hand corp))))}

    "Exploratory Romp"
    {:prompt "Choose a server" :choices (req servers)
@@ -219,15 +219,19 @@

    "Forged Activation Orders"
    {:choices {:req #(and (has? % :type "ICE") (not (:rezzed %)))}
-    :effect (req (let [ice target]
+    :effect (req (let [ice target
+                       serv (zone->name (second (:zone ice)))
+                       icepos (ice-index state ice)]
                    (resolve-ability
                      state :corp
-                     {:prompt (msg "Rez " (:title ice) " or trash it?") :choices ["Rez" "Trash"]
+                     {:prompt (msg "Rez " (:title ice) " at position " icepos
+                                   " of " serv " or trash it?") :choices ["Rez" "Trash"]
                       :effect (effect (resolve-ability
                                         (if (and (= target "Rez") (<= (rez-cost state :corp ice) (:credit corp)))
                                           {:msg (msg "force the rez of " (:title ice))
                                            :effect (effect (rez :corp ice))}
-                                          {:msg "trash the ICE" :effect (effect (trash :corp ice))})
+                                          {:msg (msg "trash the ICE at position " icepos " of " serv)
+                                           :effect (effect (trash :corp ice))})
                                         card nil))}
                      card nil)))}


Deprecate client/raw-url

Deprecate client/raw-url

--- src/clj/http/async/client.clj
+++ src/clj/http/async/client.clj
@@ -300,7 +300,8 @@
   [resp]
   (:url resp))

-(defn raw-url
+(defn ^:deprecated raw-url
+  ;; Deprecated due to lack of support from underlying Java AHC library
   "Gets raw URL from response"
   [resp]
   (:raw-url resp))


Add a more extensive docsting to the archive multimethod

--- src/clj/mdr2/archive/core.clj
+++ src/clj/mdr2/archive/core.clj
@@ -163,7 +163,17 @@
   (add-to-db production sektion))

 (defmulti archive
-  "Archive a `production`"
+  "Archive a `production`
+
+  There are multiple ways to archive an production.
+
+  1. for a *book* we simply archive both the master and the dist-master
+  2. for a *periodical* we archive the master and then put the
+     dist-master into a special spool directory based on the setting
+     `:archive-periodical-spool-dir`
+  3. for *other* productions we archive the master and then put the
+     dist-master into a special spool directory based on the setting
+     `:archive-other-spool-dir`"
   (fn [production] (:production_type production))
   :default "book")


add test for Genetics Pavilion

add test for Genetics Pavilion

--- src/clj/test/cards-assets.clj
+++ src/clj/test/cards-assets.clj
@@ -203,6 +203,33 @@
         "Franchise City no longer installed")
     (is (find-card "Franchise City" (:scored (get-corp))) "Franchise City in corp scored area")
     (is (= 1 (:agenda-point (get-corp))) "Corp has 1 point")))
+
+(deftest genetics-pavilion
+  (do-game
+    (new-game (default-corp [(qty "Genetics Pavilion" 1)])
+              (default-runner [(qty "Diesel" 2) (qty "Sure Gamble" 3)]))
+    (play-from-hand state :corp "Genetics Pavilion" "New remote")
+    (let [gp (get-content state :remote1 0)]
+      (take-credits state :corp)
+      (core/rez state :corp gp)
+      (core/move state :runner (find-card "Sure Gamble" (:hand (get-runner))) :deck)
+      (core/move state :runner (find-card "Sure Gamble" (:hand (get-runner))) :deck)
+      (core/move state :runner (find-card "Sure Gamble" (:hand (get-runner))) :deck)
+      (is (= 2 (count (:hand (get-runner)))))
+      (play-from-hand state :runner "Diesel")
+      (is (= 3 (count (:hand (get-runner)))) "Drew only 2 cards because of Genetics Pavilion")
+      (take-credits state :runner)
+      (core/derez state :corp (refresh gp))
+      (take-credits state :corp)
+      (core/move state :runner (find-card "Sure Gamble" (:hand (get-runner))) :deck)
+      (core/move state :runner (find-card "Sure Gamble" (:hand (get-runner))) :deck)
+      (core/move state :runner (find-card "Diesel" (:discard (get-runner))) :deck)
+      (is (= 1 (count (:hand (get-runner)))))
+      (play-from-hand state :runner "Diesel")
+      (is (= 3 (count (:hand (get-runner)))) "Drew 3 cards with Diesel")
+      (core/rez state :corp (refresh gp))
+      (core/draw state :runner)
+      (is (= 3 (count (:hand (get-runner)))) "No card drawn; GP counts cards drawn prior to rez"))))

 (deftest ghost-branch
   "Ghost Branch - Advanceable; give the Runner tags equal to advancements when accessed"


Added get sections

Added get sections

--- src/clj_applenewsapi/core.clj
+++ src/clj_applenewsapi/core.clj
@@ -48,6 +48,14 @@
          concatenated (canonical "GET" url ts)]
      (client/get url (authorize default-opts concatenated ts channel-name)))))

+(defn get-sections
+  ([] (get-sections :sandbox))
+  ([channel-name]
+   (let [url (str (cfg/host) "/channels/" (cfg/channel-id channel-name) "/sections/")
+         ts (now)
+         concatenated (canonical "GET" url ts)]
+     (client/get url (authorize default-opts concatenated ts channel-name)))))
+
 (defn create-article
   ([bundle] (create-article bundle :sandbox))
   ([bundle channel-name]
@@ -58,4 +66,7 @@
          content-type (str "multipart/form-data; boundary=" boundary)
          concatenated (canonical "POST" url ts content-type payload)
          opts (authorize (post-opts boundary payload) concatenated ts channel-name)]
-     (client/post url (assoc opts :throw-exceptions true)))))
+     (select-keys (client/post url (assoc opts :throw-exceptions true)) [:status :request-time :trace-redirects]))))
+
+; test with
+; (require '[clj-applenewsapi.core :as c]) (def bundle (read-string (slurp "test/bundle.edn")))  (c/create-article bundle :sandbox))


authorize reports

authorize reports

--- src/clj_money/web/reports.clj
+++ src/clj_money/web/reports.clj
@@ -11,6 +11,7 @@
                                     format-date
                                     parse-local-date]]
             [clj-money.web.shared :refer :all]
+            [clj-money.authorization :refer [authorize]]
             [clj-money.models.budgets :as budgets]
             [clj-money.reports :as reports]))

@@ -129,6 +130,7 @@

 (defn render
   [{{entity :entity :as params} :params}]
+  (authorize entity :show)
   (let [params (-> params ; TODO separate default based on the report type
                    (update-in [:type] keyword)
                    (update-in [:type] (fnil identity :balance-sheet))


Add end time to schedule display

Add end time to schedule display

--- src/cljs/herder/schedule.cljs
+++ src/cljs/herder/schedule.cljs
@@ -15,7 +15,7 @@
            (for [{:keys [id date event_id slot_id]} (sort-by :date schedule)
                  :let [event (get-data [:event (:id @state) event_id])
                        slot (get slots slot_id)]]
-             ^{:key id} [:li [:a {:href (str "#/events/" event_id)} (:name event)] " " (to-date date) " " (:start slot)]))
+             ^{:key id} [:li [:a {:href (str "#/events/" event_id)} (:name event)] " " (to-date date) " " (:start slot) "-" (:end slot)]))
      (if (-> schedule-issues empty? not)
        [:div
         [:h3 "Issues"]


[n.activity] Call request-window-features before superOnCreate

--- src/clojure/neko/activity.clj
+++ src/clojure/neko/activity.clj
@@ -121,19 +121,15 @@
              [~(vary-meta 'this assoc :tag name)]
              (.state ~'this))
          ~(when-let [[mname args & body] (get methods 'onCreate)]
-            (let [[super-call body] (if (= (ffirst body) '.superOnCreate)
-                                      [(first body) (rest body)]
-                                      [nil body])]
-              `(defn ~(symbol (str prefix mname))
-                 [~(vary-meta (first args) assoc :tag name)
-                  ~(vary-meta (second args) assoc :tag android.os.Bundle)]
-                 ~super-call
-                 (.put all-activities '~(.name *ns*) ~'this)
-                 ~(when key
-                    `(.put all-activities ~key ~'this))
-                 ~(when features
-                    `(request-window-features! ~'this ~@features))
-                 (safe-for-ui ~@body))))
+            `(defn ~(symbol (str prefix mname))
+               [~(vary-meta (first args) assoc :tag name)
+                ~(vary-meta (second args) assoc :tag android.os.Bundle)]
+               (.put all-activities '~(.name *ns*) ~'this)
+               ~(when key
+                  `(.put all-activities ~key ~'this))
+               ~(when features
+                  `(request-window-features! ~'this ~@features))
+               (safe-for-ui ~@body)))
          ~@(for [[_ [mname args & body]] (dissoc methods 'onCreate)]
              `(defn ~(symbol (str prefix mname))
                 [~(vary-meta (first args) assoc :tag name)


Improve comment and arg name

Improve comment and arg name

--- src/clojure/nightcode/git.clj
+++ src/clojure/nightcode/git.clj
@@ -159,7 +159,7 @@
     ; remove existing listener
     (doseq [l (.getTreeSelectionListeners sidebar)]
       (.removeTreeSelectionListener sidebar l))
-    ; add model and listener
+    ; add model and listener, then re-select the row
     (let [repo (FileRepository. (git-file path))
           git (Git. repo)
           commits (cons nil ; represents uncommitted changes
@@ -245,5 +245,5 @@

 (add-watch ui/tree-selection
            :update-git
-           (fn [_ _ _ path]
+           (fn [_ _ _ _]
              (update-sidebar!)))


Commented out problematic logging calls and fix mapcat->map call.

--- src/cmr/http/kit/app/core.clj
+++ src/cmr/http/kit/app/core.clj
@@ -24,14 +24,11 @@
          plugins-api-routes-fns :api} (registry/resolved-routes httpd-component)
          main-site-routes-fn (config/site-routes httpd-component)
          main-api-routes-fn (config/api-routes httpd-component)]
-    (log/trace "plugins-site-routes-fns:" (vec plugins-site-routes-fns))
-    (log/trace "plugins-api-routes-fns:" (vec plugins-api-routes-fns))
-    (log/trace "main-site-routes-fn:" main-site-routes-fn)
     ;; Note that the following calls don't call the routes, rather they call
     ;; the configuration function which extract the routes from the config
     ;; data. The route functions provided in the configuration data will be
     ;; called by a middleware wrapper.
-    {:site-routes (concat (mapcat #(% httpd-component) plugins-site-routes-fns)
+    {:site-routes (concat (map #(% httpd-component) plugins-site-routes-fns)
                           (main-site-routes-fn httpd-component))
      :plugins-api-routes-fns plugins-api-routes-fns
      :main-api-routes-fn main-api-routes-fn}))


add start/end circles

add start/end circles


minor

minor

--- src/cljsfmt/core.cljs
+++ src/cljsfmt/core.cljs
@@ -245,4 +245,4 @@
       (reformat-form options)
       (n/string)))

-(reformat-string "(foo bar\nbaz\nquz)")
+; (reformat-string "(foo bar\nbaz\nquz)")


Implemented fuzzy completion at dashes

Implemented fuzzy completion at dashes

--- src/de/kotka/gorilla/backend.clj
+++ src/de/kotka/gorilla/backend.clj
@@ -82,22 +82,28 @@
 (defn complete-in-namespace
   "Complete the given symbol name in the given namespace."
   [the-name the-space]
-  (let [publics (-> the-space symbol the-ns ns-map keys)
+  (let [name-parts (.split the-name "-")
+        publics (-> the-space symbol the-ns ns-map keys)
         publics (map name publics)]
     (reduce (fn [completions sym]
-              (if (.startsWith sym the-name)
-                (let [sym-var  (ns-resolve (symbol the-space) (symbol sym))
-                      sym-meta (meta sym-var)
-                      sym-type (type-of-var sym-var)
-                      arglists (:arglists sym-meta)
-                      info     (map #(prn-str (cons (symbol sym) %)) arglists)
-                      info     (str sym \newline
-                                    (when info
-                                      (apply str \newline info))
-                                    \newline "  "
-                                    (:doc sym-meta))]
-                  (conj completions
-                        {"word" sym      "menu" (pr-str arglists)
-                         "kind" sym-type "info" info}))
-                completions))
+              (let [sym-parts (.split sym "-")]
+                (if (and (<= (count name-parts) (count sym-parts))
+                         (every? identity (map #(.startsWith %1 %2)
+                                               sym-parts name-parts)))
+                  (let [sym-var  (ns-resolve (symbol the-space) (symbol sym))
+                        sym-meta (meta sym-var)
+                        sym-type (type-of-var sym-var)
+                        arglists (:arglists sym-meta)
+                        info     (map #(str "  "
+                                            (prn-str (cons (symbol sym) %)))
+                                      arglists)
+                        info     (str "  " sym \newline
+                                      (when info
+                                        (apply str \newline info))
+                                      \newline "  "
+                                      (:doc sym-meta))]
+                    (conj completions
+                          {"word" sym      "menu" (pr-str arglists)
+                           "kind" sym-type "info" info}))
+                completions)))
             [] publics)))


Fixed line number and file information for sent expressions

--- src/de/kotka/vimclojure/repl.clj
+++ src/de/kotka/vimclojure/repl.clj
@@ -101,7 +101,7 @@
   everything, but allows to specify an offset as initial line."
   [reader offset]
   (proxy [LineNumberingPushbackReader] [reader]
-    (getLineNumber []  (+ offset (proxy-super getLineNumber)))))
+    (getLineNumber [] (+ offset (proxy-super getLineNumber) -1))))

 (defn with-repl*
   "Calls thunk in the context of the Repl with the given id. id may be -1
@@ -121,8 +121,9 @@
                    line)]
     (try
       (Var/pushThreadBindings
-        {Compiler/SOURCE        file
-         Compiler/LINE          line
+        {Compiler/LINE          line
+         Compiler/SOURCE        (.getName (java.io.File. file))
+         Compiler/SOURCE_PATH   file
          #'*in*                 (make-reader *in* line)
          #'*ns*                 (if nspace nspace (the-repl :ns))
          #'*warn-on-reflection* (the-repl :warn-on-reflection)


CMR-5906: Updated default configuration based on ESDIS input.

--- search-app/src/cmr/search/services/parameters/converters/spatial.clj
+++ search-app/src/cmr/search/services/parameters/converters/spatial.clj
@@ -12,16 +12,16 @@

 (defconfig min-points-on-circle
   "The minimum number of vertices of the polygon used to approximate a circle"
-  {:default 32 :type Long})
+  {:default 16 :type Long})

 (defconfig max-points-on-circle
   "The maximum number of vertices of the polygon used to approximate a circle"
-  {:default 100 :type Long})
+  {:default 32 :type Long})

 (defconfig min-radius-for-max-points
   "The minimum radius in meters to trigger the use of maximum number of vertices of the polygon
   to approximate the circle"
-  {:default 5000 :type Long})
+  {:default 50000 :type Long})

 (defn- points-on-circle
   "Returns the number of vertices of the polygon to approximate the circle"


open-modal function that works with advanced compilation

--- frontend/utils.cljs
+++ frontend/utils.cljs
@@ -115,3 +115,11 @@
   event is the Synthetic React event."
   [controls-ch path event]
   (put! controls-ch [:toggled-input {:path path}]))
+
+(defn open-modal
+  "Open bootstrap modal with given selector"
+  [selector]
+  (let [jq (aget js/window "$")
+        $node (jq selector)
+        modal (aget $node "modal")]
+    (.call modal $node #js {:open true})))


Removed dependency on AOT class by direct usage of clojure var

--- ccw.core/src/ccw/editors/clojure/ClojureHyperlinkDetector.clj
+++ ccw.core/src/ccw/editors/clojure/ClojureHyperlinkDetector.clj
@@ -2,7 +2,8 @@
   (:require [clojure.zip :as z]
             [paredit.loc-utils :as lu]
             [clojure.tools.nrepl :as repl]
-            [ccw.editors.clojure.ClojureHyperlink])
+            [ccw.editors.clojure.ClojureHyperlink]
+            [ccw.editors.clojure.EditorSupport :as editor])
   (:use clojure.contrib.core)
   (:import
     [org.eclipse.jface.text BadLocationException
@@ -15,8 +16,7 @@
     [ccw.editors.clojure IClojureEditor
                          ClojureEditorMessages
                          IHyperlinkConstants
-                         ClojureHyperlink
-                         EditorSupport]
+                         ClojureHyperlink]
     [ccw.debug           ClojureClient]
     [ccw                 ClojureCore])
   (:gen-class
@@ -54,7 +54,7 @@

 (defn detect-hyperlinks
   [offset editor]
-  (let [rloc (-> editor .getParseState (EditorSupport/getParseTree) lu/parsed-root-loc)
+  (let [rloc (-> editor .getParseState (editor/-getParseTree) lu/parsed-root-loc)
         l (lu/loc-for-offset rloc offset)]
     (when-let [{:strs #{ns file line}} (and (= :symbol (-> l z/node :tag)) ; TODO transform :strs -> :keys
                                          (find-decl (lu/loc-text l) editor))]


Remove loading? fn

Remove loading? fn

--- src/discuss/utils/common.cljs
+++ src/discuss/utils/common.cljs
@@ -254,18 +254,11 @@

 ;;;; Generic Handlers
-(defn loading?
-  "Return boolean if app is currently loading content. Provide a boolean to
-  change the app-state."
-  ([] (load-from-app-state :layout/loading?))
-  ([bool] (store-to-app-state! 'layout/loading? bool)))
-
 (defn process-response
   "Generic success handler, which sets error handling and returns a cljs-compatible response."
   [response]
   (let [res (json->clj response)
         error (:error res)]
-    (loading? false)
     (if (pos? (count error))
       (error! error)
       (do (error! nil)


Require dropping-buffer

Require dropping-buffer

--- src/onyx_benchmark/riemann.clj
+++ src/onyx_benchmark/riemann.clj
@@ -1,5 +1,5 @@
 (ns onyx-benchmark.riemann
-  (:require [clojure.core.async :refer [chan >!! <!!]]
+  (:require [clojure.core.async :refer [chan >!! <!! dropping-buffer]]
             [taoensso.timbre :refer [warn info]]
             [riemann.client :as r]))


Fix method import in workspace (#743)

Fix method import in workspace (#743)

--- src/cljs/main/broadfcui/page/method_repo/method_config_importer.cljs
+++ src/cljs/main/broadfcui/page/method_repo/method_config_importer.cljs
@@ -265,15 +265,14 @@
                    :as-text (fn [item] (str (item "namespace") "\n" (item "name") "\nSnapshot ID: " (item "snapshotId")))
                    :content-renderer
                    (fn [item]
-                     (style/create-link {:text (style/render-name-id (item "name")
-                                                                     (item "snapshotId"))
-                                         :href (nav/get-link
-                                                (if (= (item "entityType") "Configuration")
-                                                  :method-config
-                                                  :method)
-                                                {:namespace (item "namespace")
-                                                 :name (item "name")
-                                                 :snapshot-id (item "snapshotId")})}))}
+                     (let [id {:namespace (item "namespace")
+                               :name (item "name")
+                               :snapshot-id (item "snapshotId")}
+                           type (if (= (item "entityType") "Configuration") :method-config :method)]
+                       (style/create-link
+                        {:text (style/render-name-id (item "name") (item "snapshotId"))
+                         :href (if (:in-workspace? props) "javascript:;" (nav/get-link type id))
+                         :onClick (when (:in-workspace? props) #((:on-selected props) type id))})))}
                   {:header "Namespace" :starting-width 160
                    :sort-by (fn [m] (clojure.string/lower-case (m "namespace")))
                    :sort-initial :asc
@@ -337,18 +336,25 @@
 (react/defc MethodConfigImporter
   {:render
    (fn [{:keys [props state refs]}]
-     [:div {}
-      (when-let [id (:id props)]
-        [:div {:style {:marginBottom "1rem" :fontSize "1.1rem"}}
-         [comps/Breadcrumbs
-          {:crumbs
-           [{:text "Methods" :href (nav/get-link :method-repo)}
-            {:text [:span {} (id :namespace) "/" (id :name)
-                    [:span {:style {:marginLeft "1rem" :fontWeight "normal"}} "#" (id :snapshot-id)]]}]}]])
-      (if (:id props)
-        (let [form (if (= (:type props) :method) MethodImportForm ConfigImportForm)]
-          [form (merge
-                 (select-keys props [:type :id :workspace-id :allow-edit :after-import])
-                 {:on-delete #(nav/go-to-path :method-repo)})])
-        [Table {:ref "table"
-                :in-workspace? (:workspace-id props)}])])})
+     (let [{:keys [workspace-id]} props
+           type (or (:type props) (:type @state))
+           id (or (:id props) (:id @state))]
+       [:div {}
+        (when id
+          [:div {:style {:marginBottom "1rem" :fontSize "1.1rem"}}
+           [comps/Breadcrumbs
+            {:crumbs
+             [{:text "Methods" :href (if workspace-id "javascript:;" (nav/get-link :method-repo))
+               :onClick (when workspace-id #(swap! state dissoc :type :id))}
+              {:text [:span {} (id :namespace) "/" (id :name)
+                      [:span {:style {:marginLeft "1rem" :fontWeight "normal"}}
+                       "#" (id :snapshot-id)]]}]}]])
+        (if id
+          (let [form (if (= type :method) MethodImportForm ConfigImportForm)]
+            [form (merge
+                   (utils/restructure type id)
+                   (select-keys props [:workspace-id :allow-edit :after-import])
+                   {:on-delete #(nav/go-to-path :method-repo)})])
+          [Table {:ref "table"
+                  :in-workspace? workspace-id
+                  :on-selected #(swap! state assoc :type %1 :id %2)}])]))})


Fix typo in test name

Fix typo in test name


adding opacity and additive blending.

adding opacity and additive blending.

--- src/play_clj/core_graphics.clj
+++ src/play_clj/core_graphics.clj
@@ -491,8 +491,14 @@
   [{:keys [^Stage renderer] :as screen} entities]
   (let [^Batch batch (.getBatch renderer)]
     (.begin batch)
-    (doseq [entity entities]
-      (e/draw! entity screen batch))
+    (doseq [{:keys [additive? opacity] :as entity} entities]
+      (when additive?
+        (.setBlendFunction ^Batch batch (gl :gl-src-alpha) (gl :gl-one)))
+      (.setColor batch (color 1 1 1 (or opacity 1.0)))
+      (e/draw! entity screen batch)
+      (.setColor batch (color 1 1 1 1))
+      (when additive?
+        (.setBlendFunction ^Batch batch (gl :gl-src-alpha) (gl :gl-one-minus-src-alpha))))
     (.end batch))
   entities)