add support for :display-name in :dev-http config

--- src/main/shadow/cljs/ui/components/dashboard.cljs
+++ src/main/shadow/cljs/ui/components/dashboard.cljs
@@ -18,10 +18,13 @@
        [:ol.pl-6.pt-1.list-disc
         (sg/render-seq http-servers ::m/http-server-id
           (fn [{::m/keys [http-url https-url http-config]}]
-            (let [url (or http-url https-url)]
+            (let [url (or http-url https-url)
+                  display-name (:display-name http-config)]
               (<< [:li.pb-1
                    [:a.font-bold {:href url :target "_blank"} url]
                    " - "
+                   (when (seq display-name)
+                     (str display-name " - "))
                    (pr-str (:roots http-config))]))))]]))

 (defc ui-active-build [ident]
@@ -67,5 +70,5 @@
 (defn ui-page []
   (<< [:div.flex-1.overflow-auto
        (ui-http-servers)
-       #_ (ui-active-runtimes)
+       #_(ui-active-runtimes)
        (ui-active-builds)]))


Ready for release

Ready for release

--- lein-template/project.clj
+++ lein-template/project.clj
@@ -1,7 +1,7 @@
 ;; Copyright © 2014 JUXT LTD.

 ;; We call this project modular to make the invocation: lein new modular appname
-(defproject modular/lein-template "0.7.0"
+(defproject modular/lein-template "0.7.1"
   :description "Leiningen template for a full-featured component based app using modular extensions."
   :url "http://modularity.org/"
   :license {:name "The MIT License"


fix typo in IsolationScheduler log message

--- src/clj/backtype/storm/scheduler/IsolationScheduler.clj
+++ src/clj/backtype/storm/scheduler/IsolationScheduler.clj
@@ -202,7 +202,7 @@
              allocated-topologies
              (leftover-topologies topologies <>)
              (DefaultScheduler/default-schedule <> cluster))
-        (log-warn "Unstable to isolate topologies " (pr-str failed-iso-topologies) ". Will wait for enough resources for isolated topologies before allocating any other resources.")
+        (log-warn "Unable to isolate topologies " (pr-str failed-iso-topologies) ". Will wait for enough resources for isolated topologies before allocating any other resources.")
         ))
     (.setBlacklistedHosts cluster orig-blacklist)
     ))


[#8] Code cleanup - Positive conditional

Extract the set of known protocols to a constant to avoid creating
a new one each time.

Use (if ,,,) instead (if (not ,,,)) to

--- src/org/akvo/resumed.clj
+++ src/org/akvo/resumed.clj
@@ -129,14 +129,15 @@
       (some-> req (get-header "host") (.split ":") first)
       (:server-name req)))

+(def ^:const known-protocols #{"http" "https"})
+
 (defn protocol
   "Returns the protocol #{\"http\" \"https\"} for a given request"
   [req]
-  (let [forwarded-proto (get-header req "x-forwarded-proto")
-        known-protocols #{"http" "https"}]
-    (if (not (known-protocols forwarded-proto))
-      (name (:scheme req))
-      forwarded-proto)))
+  (let [forwarded-proto (get-header req "x-forwarded-proto")]
+    (if (known-protocols forwarded-proto)
+      forwarded-proto
+      (name (:scheme req)))))

 (def ^:const http-default-ports #{443 80})


Remove old ns use cases. Fixes #225

Remove old ns use cases. Fixes #225

--- src/overtone/inst/io.clj
+++ src/overtone/inst/io.clj
@@ -1,6 +1,5 @@
 (ns overtone.inst.io
-  (:use [overtone.sc gens envelope]
-        [overtone.studio mixer]))
+  (:use [overtone.core]))

 (definst mic [amp 1]
   (let [src (in (num-output-buses:ir))]


Fix formatting

Fix formatting

--- src/overtone/sc/core.clj
+++ src/overtone/sc/core.clj
@@ -1,29 +1,29 @@
 (ns
-  ^{:doc "An interface to the SuperCollider synthesis server.
+    ^{:doc "An interface to the SuperCollider synthesis server.
           This is at heart an OSC client library for the SuperCollider
           scsynth DSP engine."
-     :author "Jeff Rose"}
+      :author "Jeff Rose"}
   overtone.sc.core
   (:import
-    [java.net InetSocketAddress]
-    [java.util.regex Pattern]
-    [java.util.concurrent TimeUnit TimeoutException]
-    [java.io BufferedInputStream]
-    [supercollider ScSynth ScSynthStartedListener MessageReceivedListener])
+   [java.net InetSocketAddress]
+   [java.util.regex Pattern]
+   [java.util.concurrent TimeUnit TimeoutException]
+   [java.io BufferedInputStream]
+   [supercollider ScSynth ScSynthStartedListener MessageReceivedListener])
   (:require [overtone.log :as log])
   (:use
-    [overtone event config setup util time-utils deps]
-    [overtone.sc allocator]
-    [clojure.contrib.java-utils :only [file]]
-    [clojure.contrib pprint]
-    [clojure.contrib shell-out]
-    osc))
+   [overtone event config setup util time-utils deps]
+   [overtone.sc allocator]
+   [clojure.contrib.java-utils :only [file]]
+   [clojure.contrib pprint]
+   [clojure.contrib shell-out]
+   osc))

 (def SERVER-HOST "127.0.0.1")
 (def SERVER-PORT nil) ; nil means a random port
 (def N-RETRIES 20)

-; Max number of milliseconds to wait for a reply from the server
+;; Max number of milliseconds to wait for a reply from the server
 (def REPLY-TIMEOUT 500)

 (def MAX-OSC-SAMPLES 8192)
@@ -36,8 +36,8 @@
 (defonce status*        (ref :disconnected))
 (defonce synth-group*   (ref nil))

-; The base handler for receiving osc messages just forwards the message on
-; as an event using the osc path as the event key.
+;; The base handler for receiving osc messages just forwards the message on
+;; as an event using the osc path as the event key.
 (on-sync-event :osc-msg-received ::osc-receiver
                (fn [{{path :path args :args} :msg}]
                  (event path :path path :args args)))
@@ -95,24 +95,24 @@
   names with different drivers or hardware then we need to find a better strategy to auto-connect."
   ([] (connect-jack-ports 2))
   ([n-channels]
-  (let [port-list (sh "jack_lsp")
-        sc-ins         (re-seq #"SuperCollider.*:in_[0-9]*" port-list)
-        sc-outs        (re-seq #"SuperCollider.*:out_[0-9]*" port-list)
-        system-ins     (re-seq #"system:capture_[0-9]*" port-list)
-        system-outs    (re-seq #"system:playback_[0-9]*" port-list)
-        interface-ins  (re-seq #"system:AC[0-9]*_dev[0-9]*_.*In.*" port-list)
-        interface-outs (re-seq #"system:AP[0-9]*_dev[0-9]*_LineOut.*" port-list)
-        connections (partition 2 (concat
-                                   (interleave sc-outs system-outs)
-                                   (interleave sc-outs interface-outs)
-                                   (interleave system-ins sc-ins)
-                                   (interleave interface-ins sc-ins)))]
-    (doseq [[src dest] connections]
-      (sh "jack_connect" src dest)
-      (log/info "jack_connect " src dest)))))
-
-; We have to do this to handle the change in SC, where they added a "/" to the
-; status.reply messsage, which it should have had in the first place.
+     (let [port-list (sh "jack_lsp")
+           sc-ins         (re-seq #"SuperCollider.*:in_[0-9]*" port-list)
+           sc-outs        (re-seq #"SuperCollider.*:out_[0-9]*" port-list)
+           system-ins     (re-seq #"system:capture_[0-9]*" port-list)
+           system-outs    (re-seq #"system:playback_[0-9]*" port-list)
+           interface-ins  (re-seq #"system:AC[0-9]*_dev[0-9]*_.*In.*" port-list)
+           interface-outs (re-seq #"system:AP[0-9]*_dev[0-9]*_LineOut.*" port-list)
+           connections (partition 2 (concat
+                                     (interleave sc-outs system-outs)
+                                     (interleave sc-outs interface-outs)
+                                     (interleave system-ins sc-ins)
+                                     (interleave interface-ins sc-ins)))]
+       (doseq [[src dest] connections]
+         (sh "jack_connect" src dest)
+         (log/info "jack_connect " src dest)))))
+
+;; We have to do this to handle the change in SC, where they added a "/" to the
+;; status.reply messsage, which it should have had in the first place.
 (defn- setup-connect-handlers []
   (let [handler-fn
         (fn []
@@ -132,10 +132,10 @@
                   (.send @sc-world* buffer))
         peer (assoc (osc-peer) :send-fn send-fn)]
     (.addMessageReceivedListener @sc-world*
-      (proxy [MessageReceivedListener] []
-        (messageReceived [buf size]
-                         (event :osc-msg-received
-                                :msg (osc-decode-packet buf)))))
+                                 (proxy [MessageReceivedListener] []
+                                   (messageReceived [buf size]
+                                     (event :osc-msg-received
+                                            :msg (osc-decode-packet buf)))))
     (dosync (ref-set server* peer))
     (setup-connect-handlers)
     (snd "/status")))
@@ -147,11 +147,11 @@
   (let [sc-server (osc-client host port)]
     (osc-listen sc-server #(event :osc-msg-received :msg %))
     (dosync
-      (ref-set server* sc-server))
+     (ref-set server* sc-server))

     (setup-connect-handlers)

-    ; Send /status in a loop until we get a reply
+;; Send /status in a loop until we get a reply
     (loop [cnt 0]
       (log/debug "connect loop...")
       (when (and (< cnt N-RETRIES)
@@ -161,7 +161,7 @@
         (Thread/sleep 100)
         (recur (inc cnt))))))

-; TODO: setup an error-handler in the case that we can't connect to the server
+;; TODO: setup an error-handler in the case that we can't connect to the server
 (defn connect
   "Connect to an running SC audio server. Either an external server if host and port are passed or an internal server
    in the case of no args."
@@ -183,18 +183,18 @@

 (defn await-promise
   "Read the reply received from the server, waiting for timeout ms if the message hasn't yet been received. Returns :timeout if a timeout occurs."
-    ([prom] (await-promise prom REPLY-TIMEOUT))
-    ([prom timeout]
-       (try
-         (.get (future @prom) timeout TimeUnit/MILLISECONDS)
-         (catch TimeoutException t
-           :timeout))))
+  ([prom] (await-promise prom REPLY-TIMEOUT))
+  ([prom timeout]
+     (try
+       (.get (future @prom) timeout TimeUnit/MILLISECONDS)
+       (catch TimeoutException t
+         :timeout))))

 (defn await-promise!
   "Read the reply received from the server, waiting for timeout ms if the message hasn't yet been received. Raises an exception if the message hasn't been received within timeout ms"
-    ([prom] (await-promise prom REPLY-TIMEOUT))
-    ([prom timeout]
-       (.get (future @prom) timeout TimeUnit/MILLISECONDS)))
+  ([prom] (await-promise prom REPLY-TIMEOUT))
+  ([prom timeout]
+     (.get (future @prom) timeout TimeUnit/MILLISECONDS)))

 (defn- parse-status [args]
   (let [[_ ugens synths groups loaded avg peak nominal actual] args]
@@ -211,24 +211,24 @@

 ;;Replies to sender with the following message.
 ;;status.reply
-;;	int - 1. unused.
-;;	int - number of unit generators.
-;;	int - number of synths.
-;;	int - number of groups.
-;;	int - number of loaded synth definitions.
-;;	float - average percent CPU usage for signal processing
-;;	float - peak percent CPU usage for signal processing
-;;	double - nominal sample rate
-;;	double - actual sample rate
+;;      int - 1. unused.
+;;      int - number of unit generators.
+;;      int - number of synths.
+;;      int - number of groups.
+;;      int - number of loaded synth definitions.
+;;      float - average percent CPU usage for signal processing
+;;      float - peak percent CPU usage for signal processing
+;;      double - nominal sample rate
+;;      double - actual sample rate
 (defn status
   "Check the status of the audio server."
   []
   (if (connected?)
     (let [p (promise)
           handler (fn [event]
-                   (deliver p (parse-status (:args event)))
-                   (remove-handler "status.reply" ::status-check)
-                   (remove-handler "/status.reply" ::status-check))]
+                    (deliver p (parse-status (:args event)))
+                    (remove-handler "status.reply" ::status-check)
+                    (remove-handler "/status.reply" ::status-check))]
       (on-event "/status.reply" ::status-check handler)
       (on-event "status.reply" ::status-check handler)

@@ -280,15 +280,15 @@
 (defn- boot-internal
   ([] (boot-internal (+ (rand-int 50000) 2000)))
   ([port]
-   (log/info "boot-internal: " port)
-   (when (not (connected?))
-     (on-deps :booted ::connect-internal connect)
-     (let [sc-thread (Thread. #(internal-booter port))]
-       (.setDaemon sc-thread true)
-       (log/debug "Booting SuperCollider internal server (scsynth)...")
-       (.start sc-thread)
-       (dosync (ref-set server-thread* sc-thread))
-       :booting))))
+     (log/info "boot-internal: " port)
+     (when (not (connected?))
+       (on-deps :booted ::connect-internal connect)
+       (let [sc-thread (Thread. #(internal-booter port))]
+         (.setDaemon sc-thread true)
+         (log/debug "Booting SuperCollider internal server (scsynth)...")
+         (.start sc-thread)
+         (dosync (ref-set server-thread* sc-thread))
+         :booting))))

 (defn- sc-log
   "Pull audio server log data from a pipe and store for later printing."
@@ -319,20 +319,20 @@
   "Boot the audio server in an external process and tell it to listen on a
   specific port."
   ([port]
-   (if (not (connected?))
-     (let [cmd (into-array String (concat [(SC-PATHS (@config* :os)) "-u" (str port)] (SC-ARGS (@config* :os))))
-           sc-thread (Thread. #(external-booter cmd))]
-       (.setDaemon sc-thread true)
-       (log/debug "Booting SuperCollider server (scsynth)...")
-       (.start sc-thread)
-       (dosync (ref-set server-thread* sc-thread))
-       (connect "127.0.0.1" port)
-       :booting))))
+     (if (not (connected?))
+       (let [cmd (into-array String (concat [(SC-PATHS (@config* :os)) "-u" (str port)] (SC-ARGS (@config* :os))))
+             sc-thread (Thread. #(external-booter cmd))]
+         (.setDaemon sc-thread true)
+         (log/debug "Booting SuperCollider server (scsynth)...")
+         (.start sc-thread)
+         (dosync (ref-set server-thread* sc-thread))
+         (connect "127.0.0.1" port)
+         :booting))))

 (defn boot
   "Boot either the internal or external audio server."
   ([]
-   (boot (get @config* :server :internal) SERVER-HOST SERVER-PORT))
+     (boot (get @config* :server :internal) SERVER-HOST SERVER-PORT))
   ([which & [port]]
      (dosync (ref-set status* :connecting))
      (let [port (if (nil? port) (+ (rand-int 50000) 2000) port)]
@@ -357,9 +357,9 @@
   (if @server*
     (osc-close @server* true))
   (dosync
-    (ref-set server* nil)
-    (ref-set status* :disconnected)
-    (unsatisfy-all-dependencies)))
+   (ref-set server* nil)
+   (ref-set status* :disconnected)
+   (unsatisfy-all-dependencies)))

 (defonce _shutdown-hook
   (.addShutdownHook (Runtime/getRuntime)
@@ -370,10 +370,10 @@
   []
   (snd "/clearSched"))

-; The /done message just has a single argument:
-; "/done" "s" <completed-command>
-;
-; where the command would be /b_alloc and others.
+;; The /done message just has a single argument:
+;; "/done" "s" <completed-command>
+;;
+;; where the command would be /b_alloc and others.
 (defn on-done
   "Runs a one shot handler that takes no arguments when an OSC /done
   message from scsynth arrives with a matching path.  Look at load-sample


Refactored jenkins collector to simplify collector loggging before refactoring to a shared capabiltiy

--- collectors/jenkins/src/jenkins_collector/main.clj
+++ collectors/jenkins/src/jenkins_collector/main.clj
@@ -1,13 +1,13 @@
 (ns jenkins-collector.main
-  (:require [clj-http.client :as http]
+  (:require [cheshire.core :refer :all]
+            [clj-http.client :as http]
             [clojure.string :as string]
-            [cheshire.core :refer :all]
             [clojure.tools.logging :as log]
-            [slingshot.slingshot :refer :all]
+            [jenkins-collector.jenkins :as jenkins]
+            [kuona-core.cli :as cli]
             [kuona-core.metric.store :as store]
             [kuona-core.util :as util]
-            [kuona-core.cli :as cli]
-            [jenkins-collector.jenkins :as jenkins])
+            [slingshot.slingshot :refer :all])
   (:gen-class))

 (def cli-options
@@ -23,10 +23,6 @@
   (let [metrics (jenkins/collect-metrics (jenkins/http-source (:credentials config)) (:url config))]
     (doall (map #(store/put-document % mapping) metrics))))

-(def collector-details
-  {:name    "jenkins-collector"
-   :version (util/get-project-version 'kuona-jenkins-collector)})
-
 (defn collector-log
   "Posts details of the collector to the API server to record the collector run"
   [api-url collector-details parameters status]
@@ -39,12 +35,13 @@
     (http/post url body)))

-(defn log-collection [api-url collector-details params f]
+(defn log-collection
+  "Wraps the collection with logging to the API server to act as a history of changes"
+  [api-url collector-details params f]
+
   (try+
    (collector-log api-url collector-details params :started)
-
    (f)
-
    (collector-log api-url collector-details params :stopped)
    (catch Object _
      (collector-log api-url collector-details params :failed))))
@@ -52,11 +49,20 @@

 (defn -main
   [& args]
-  (let [config       (cli/configure "Kuona Jenkins build collector." cli-options args)
-        source       (jenkins/http-source {:username (-> config :username) :password (-> config :password)})
-        build-server (:jenkins config)
-        api-url      (-> config :api-url)]
+  (let [config            (cli/configure "Kuona Jenkins build collector." cli-options args)
+        username          (-> config :username)
+        password          (-> config :password)
+        build-server      (-> config :jenkins)
+        api-url           (-> config :api-url)
+        source            (jenkins/http-source {:username username :password password})
+        collector-details {:name "jenkins-collector" :version (util/get-project-version 'kuona-jenkins-collector)}]
+
     (log/info "Collecting metrics from:" build-server)

-    (log-collection api-url collector-details [{:api api-url} {:build-server build-server}] #(jenkins/collect-metrics source build-server api-url))))
+    (log-collection api-url
+                    collector-details
+                    [{:api api-url} {:build-server build-server}]
+                    #(jenkins/collect-metrics source
+                                              build-server
+                                              api-url))))


Abbreviate cljs.core/cljs.spec.alpha namespaces even in CLJS

--- src/pinpointer/core.cljc
+++ src/pinpointer/core.cljc
@@ -89,8 +89,12 @@
   (walk/postwalk (fn [x]
                    (if (symbol? x)
                      (condp #(= (namespace %2) %1) x
-                       "clojure.core" (symbol (name x))
-                       "clojure.spec.alpha" (symbol "s" (name x))
+                       #?(:clj "clojure.core" :cljs "cljs.core")
+                       (symbol (name x))
+
+                       #?(:clj "clojure.spec.alpha" :cljs "cljs.spec.alpha")
+                       (symbol "s" (name x))
+
                        x)
                      x))
                  spec))


Remove lein default failing test.

Remove lein default failing test.

--- test/aspire/core_test.clj
+++ test/aspire/core_test.clj
@@ -2,10 +2,6 @@
   (:require [clojure.test :refer :all]
             [aspire.core :refer :all]))

-(deftest a-test
-  (testing "FIXME, I fail."
-    (is (= 0 1))))
-
 (deftest pass-test
   (testing "I pass"
     (is (= 1 1))))


print stack trace

print stack trace

--- src/polismath/poller.clj
+++ src/polismath/poller.clj
@@ -97,7 +97,10 @@
                 (assoc convs zid
                     (try
                       (conv-update (or (convs zid) {:rating-mat (named-matrix)}) votes)
-                      (catch Exception e (println "exception when processing zid: " zid))))))
+                      (catch Exception e
+                        (do
+                          (println "exception when processing zid: " zid)
+                          (.printStackTrace e)))))))

             (println "zid: " zid)
             (println "time: " (System/currentTimeMillis))


keep main runner thread from diing (system component gotcha)

--- src/polismath/runner.clj
+++ src/polismath/runner.clj
@@ -86,7 +86,9 @@
       :else
       (let [system-map-generator (subcommands (first arguments))
             system (system/create-and-run-system! system-map-generator options)]
-        system))))
+        (loop []
+          (Thread/sleep 1000)
+          (recur))))))

 (comment


Remove bogus require

Remove bogus require

--- test/icecap/core_test.clj
+++ test/icecap/core_test.clj
@@ -1,3 +1 @@
-(ns icecap.core-test
-  (:require [clojure.test :refer :all]
-            [icecap.core :refer :all]))
+(ns icecap.core-test)


(ASCII 127, 0x7f, DEL) is not a printable ascii character

Signed-off-by: Stuart Halloway <4dc50fc3bc007be011b5445f3f79298b9eeb51b7@thinkrelevance.com>

--- src/main/clojure/clojure/test/generative/generators.clj
+++ src/main/clojure/clojure/test/generative/generators.clj
@@ -127,7 +127,7 @@
 (defn printable-ascii-char
   "Returns a random printable ascii character."
   []
-  (core/char (uniform 32 128)))
+  (core/char (uniform 32 127)))

 (defn char
   "Returns a random character in the range 0-65536."


Fix topological sort

Fix topological sort

--- src/main/clojure/clojure/tools/namespace/dependency.clj
+++ src/main/clojure/clojure/tools/namespace/dependency.clj
@@ -1,5 +1,6 @@
 (ns clojure.tools.namespace.dependency
   "Bidirectional graphs of dependencies and dependent objects."
+  (:refer-clojure :exclude (keys))
   (:require [clojure.set :as set]))

 (defprotocol DependencyGraph
@@ -12,7 +13,9 @@
     transitively.")
   (transitive-dependents [graph key]
     "Returns the set of all things which depend upon key, directly or
-    transitively."))
+    transitively.")
+  (keys [graph]
+    "Returns the set of all keys in graph."))

 (defprotocol DependencyGraphUpdate
   (depend [graph key dep]
@@ -54,6 +57,9 @@
     (transitive dependencies key))
   (transitive-dependents [graph key]
     (transitive dependents key))
+  (keys [graph]
+    (clojure.set/union (set (clojure.core/keys dependencies))
+                       (set (clojure.core/keys dependents))))
   DependencyGraphUpdate
   (depend [graph key dep]
     (when (depends? graph dep key)
@@ -90,26 +96,40 @@
   [graph x y]
   (contains? (transitive-dependents graph x) y))

-(comment
-  ;; These don't work. You can't implement topological sort using a
-  ;; comparison sort.
-  (defn topo-comparator
-    "Returns a comparator which produces a topographical sort based on
-  the dependencies in graph."
-    [graph]
-    (comparator (partial dependent? graph)))
+(defn topo-sort
+  "Returns a topologically-sorted list of keys in graph."
+  [graph]
+  (loop [sorted ()
+         g graph
+         todo (set (filter #(empty? (immediate-dependents graph %))
+                           (keys graph)))]
+    (if (empty? todo)
+      sorted
+      (let [[key & more] (seq todo)
+            deps (immediate-dependencies g key)
+            [add g'] (loop [deps deps
+                            g g
+                            add #{}]
+                       (if (seq deps)
+                         (let [d (first deps)
+                               g' (remove-edge g key d)]
+                           (if (empty? (immediate-dependents g' d))
+                             (recur (rest deps) g' (conj add d))
+                             (recur (rest deps) g' add)))
+                         [add g]))]
+        (recur (cons key sorted)
+               (remove-key g' key)
+               (clojure.set/union (set more) (set add)))))))

-  (defn topo-sort
-    "Returns a topographically-sorted sequence of the items in coll
-  using dependencies in graph."
-    [graph coll]
-    (sort (topo-comparator graph) coll))
-
-  (defn topo-sort-by
-    "Returns a topographically-sorted sequence of the items in coll by
-  comparing (keyfn item) using dependencies in graph."
-    [graph keyfn coll]
-    (sort-by keyfn (topo-comparator graph) coll)))
+(defn topo-comparator
+  "Returns a comparator fn which produces a topological sort based on
+  the dependencies in graph. Keys not present in the graph will sort
+  after keys in the graph."
+  [graph]
+  (let [pos (zipmap (topo-sort graph) (range))]
+    (fn [a b]
+      (compare (get pos a Long/MAX_VALUE)
+               (get pos b Long/MAX_VALUE)))))

 (comment
   ;; example usage: building a graph like:
@@ -131,6 +151,44 @@
   (transitive-dependencies g :d)
   ;;=> #{:a :c :b}

-  (topo-sort g [:d :a :c :b])
-  ;;=> (:a :b :c :d)
-  )
+  (sort (topo-comparator g) [:d :a :b :foo])
+  ;;=> (:a :b :d :foo)
+
+  ;;      'one    'five
+  ;;        |       |
+  ;;      'two      |
+  ;;       / \      |
+  ;;      /   \     |
+  ;;     /     \   /
+  ;; 'three   'four
+  ;;    |      /
+  ;;  'six    /
+  ;;    |    /
+  ;;    |   /
+  ;;    |  /
+  ;;  'seven
+  ;;
+  (def g2 (-> (graph)
+              (depend 'two 'one)
+              (depend 'three 'two)
+              (depend 'four 'two)
+              (depend 'four 'five)
+              (depend 'six 'three)
+              (depend 'seven 'six)
+              (depend 'seven 'four)))
+
+  (transitive-dependencies g2 'seven)
+  ;;=> #{two four six one five three}
+
+  (transitive-dependents g2 'five)
+  ;;=> #{four seven}
+
+  (transitive-dependents g2 'two)
+  ;;=> #{four seven six three}
+
+  (topo-sort g2)
+  ;;=> (one two three five six four seven)
+
+  (sort (topo-comparator g2) '[three seven nine eight five])
+  ;;=> (three five seven nine eight)
+)


fix profiles - was causing lein pom to generate false dependencies

--- profiles.clj
+++ profiles.clj
@@ -4,5 +4,7 @@
      (use '[table.core :only (table)])
      (use '[clojure.repl :only (dir-fn)])
      (load-file (str (System/getProperty "user.home") "/.lein/user.clj")))}
-  :plugins  [[lein-clojars "0.9.0"] [lein-light "0.0.4"]]
-  :dependencies  {table "0.2.0" com.datomic/datomic "0.1.3164" }}}
+    :plugins  [[lein-clojars "0.9.0"] [lein-light "0.0.4"]]
+  }
+  :dependencies  {table "0.2.0" com.datomic/datomic "0.1.3164" }
+}


Adds one?

Adds one?

--- src/the_little_clojurian/chapter4.clj
+++ src/the_little_clojurian/chapter4.clj
@@ -252,3 +252,11 @@
   (is (= (occur 'a '(a a)) 2))
   (is (= (occur 'a '(a b c a)) 2))
   (is (= (occur 'a '(b c d e)) 0)))
+
+(with-test
+  (def one?
+    (fn [x] (equal x 1)))
+
+  (is (= (one? 0) false))
+  (is (= (one? 1) true))
+  (is (= (one? 2) false)))


(SERVER-1103) Fix borrow-after-borrow lock tests

This commit includes fixes for timing-related issues in the
`pool-can-borrow-after-borrow-interrupted-during-lock` and
`pool-can-borrow-after-borrow-timed-out-during-lock` tests.  In both
cases, there previously was a race condition where a borrow on a
separate thread could succeed before a lock() call was made, causing the
lock() call to block indefinitely because the pool was indefinitely not
full.  The production code was behaving properly but the tests were
designed with the expectation that the lock would occur before the
any borrows were attempted.  Both tests were changed to wait to perform
the borrow until the lock is taken.

--- test/unit/puppetlabs/puppetserver/lockable_pool_test.clj
+++ test/unit/puppetlabs/puppetserver/lockable_pool_test.clj
@@ -508,17 +508,19 @@
           borrow-1 (.borrowItem pool)
           borrow-thread-started-2 (promise)
           borrow-thread-started-3? (promise)
+          lock-thread-locked? (promise)
           borrow-thread-2 (future
                            (deliver borrow-thread-started-2
                                     (Thread/currentThread))
+                           (timed-deref lock-thread-locked?)
                            (.borrowItem pool))
           borrow-thread-3 (future
                            (deliver borrow-thread-started-3? true)
+                           (timed-deref lock-thread-locked?)
                            (.borrowItem pool))
           borrow-thread-obj-2 @borrow-thread-started-2
           _ @borrow-thread-started-3?
           lock-thread-started? (promise)
-          lock-thread-locked? (promise)
           unlock? (promise)
           lock-thread (future
                        (deliver lock-thread-started? true)
@@ -547,7 +549,7 @@
       ;; held did not adversely affect the ability of the third borrow call
       ;; to return.
       (is (identical? borrow-1 (timed-deref borrow-thread-3))
-          (str "did not get back the same instance from the third borrow"
+          (str "did not get back the same instance from the third borrow "
                "attempt as was returned from the first borrow attempt")))))

 (deftest pool-can-borrow-after-borrow-timed-out-during-lock
@@ -557,14 +559,17 @@
           borrow-1 (.borrowItem pool)
           borrow-thread-started-2? (promise)
           borrow-thread-started-3? (promise)
+          lock-thread-locked? (promise)
           borrow-thread-2 (future
                            (deliver borrow-thread-started-2? true)
+                           (timed-deref lock-thread-locked?)
                            (.borrowItemWithTimeout
                             pool
                             50
                             TimeUnit/MILLISECONDS))
           borrow-thread-3 (future
                            (deliver borrow-thread-started-3? true)
+                           (timed-deref lock-thread-locked?)
                            (.borrowItemWithTimeout pool
                                                    1
                                                    TimeUnit/SECONDS))
@@ -572,7 +577,6 @@
           _ @borrow-thread-started-3?
           unlock? (promise)
           lock-thread-started? (promise)
-          lock-thread-locked? (promise)
           lock-thread (future
                        (deliver lock-thread-started? true)
                        (.lock pool)


added test

added test

--- test/selmer/core_test.clj
+++ test/selmer/core_test.clj
@@ -181,7 +181,7 @@
                   :bar true})
          "before bar foo & bar are true after bar")))

-(deftest ifequal-tag-test
+(deftest ifequal-tag-test
   (= "\n
equal!
\n\n\n\n
not equal
\n"
      (render-template (parse (str path "ifequal.html")) {:foo "bar"}))
   (= "\n\n
equal!
\n\n\n
not equal
\n"
@@ -191,6 +191,9 @@
   (= "\n\n
equal!
\n\n\n
not equal
\n"
      (render-template (parse (str path "ifequal.html")) {:baz "fail"}))

+  (is (= (render "{% ifequal foo|upper \"FOO\" %}yez{% endifequal %}" {:foo "foo"})
+         "yez"))
+
   (is (= (render "{% ifequal foo \"foo\" %}yez{% endifequal %}" {:foo "foo"})
          "yez"))
   (is (= (render "{% ifequal foo \"foo\" bar %}yez{% endifequal %}"


DimDraw: Tests updated for new syntax

DimDraw: Tests updated for new syntax


CMR-2283: Changed error message

CMR-2283: Changed error message

--- ingest-app/src/cmr/ingest/services/business_rule_validation.clj
+++ ingest-app/src/cmr/ingest/services/business_rule_validation.clj
@@ -16,7 +16,7 @@
   "Validates that the version is not nil"
   [_ concept]
   (when (nil? (get-in concept [:extra-fields :version-id]))
-    ["Version cannot be nil."]))
+    ["Version is required."]))

 (defn- delete-time-validation
   "Validates the concept delete-time.


lein-template: Fix typo in :repl-options :init.

--- lein-template/src/main/leiningen/new/aviary/project.clj
+++ lein-template/src/main/leiningen/new/aviary/project.clj
@@ -17,7 +17,7 @@
                                   "src/dev/cljs"]
                    :dependencies [[weasel "0.5.0"]
                                   [com.cemerick/piggieback "0.1.5"]]
-                   :repl-options {:init ({{namespace}}.dev/start-dev)
+                   :repl-options {:init ({{namespace}}.dev/start)
                                   :init-ns {{namespace}}.dev
                                   :nrepl-middleware
                                   [cemerick.piggieback/wrap-cljs-repl]}}}


Fix all-msgs-handler docstring

Fix all-msgs-handler docstring

--- src/cljs/matthiasn/systems_toolbox_sente/client.cljs
+++ src/cljs/matthiasn/systems_toolbox_sente/client.cljs
@@ -71,7 +71,7 @@
 (defn all-msgs-handler
   "Handler function for all incoming messages. By default, all messages received by this component are
   forwarded to the server. When message filtering is enabled for this component, it will instead only
-  forward messages to the server for which the :fwd-to-backend key is set on the message metadata."
+  forward messages to the server for which the :forward-to-backend key is set in the message metadata."
   [{:keys [cmp-state msg-meta msg-type cfg] :as msg-map}]
   (let [fwd? (if (:msg-filtering cfg) (:forward-to-backend msg-meta) true)
         expect-response? (:expect-backend-response msg-meta)


Rotation: Use vendor prefixes for rotate().

--- src-cljs/pepa/components/page.cljs
+++ src-cljs/pepa/components/page.cljs
@@ -5,12 +5,19 @@
             [pepa.api :as api]
             [sablono.core :refer-macros [html]]))

+(defn ^:private rotate [deg]
+  (let [t (str "rotate(" deg "deg)")]
+    #js {:-webkit-transform t
+         :-moz-transform t
+         :-o-transform t
+         :-ms-transform t
+         :transform t}))
+
 (defn ^:private page-image [page owner {:keys [size]}]
   (assert size)
   (om/component
    (dom/img #js {:src (str "/pages/" (:id page) "/image/" size)
-                 :style (when-let [r (:rotation page)]
-                          #js {:transform (str "rotate(" r "deg)")})})))
+                 :style (rotate (:rotation page))})))

 (defn ^:private rotate-clicked [page rotation e]
   (println "rotating" page "by" rotation "degrees")


add placeholder for account balance check

--- test/clj_money/trading_test.clj
+++ test/clj_money/trading_test.clj
@@ -973,9 +973,6 @@
                         :purchase-price 5M
                         :shares-purchased 200M
                         :shares-owned 200M}]
-        items (transactions/search-items storage-spec
-                                         {:account-id (:id commodity-account)})
-        actual-items (map #(apply dissoc % ignorable-item-attributes) items)
         expected-transaction {:entity-id (:entity-id commodity)
                               :transaction-date (t/local-date 2016 3 2)
                               :description "Split shares of AAPL 2 to 1"
@@ -1006,4 +1003,7 @@
         "The result contains the transaction that was created")
     (pprint-diff expected-lots actual-lots)
     (is (= expected-lots actual-lots)
-        "The lots are adjusted correctly")))
+        "The lots are adjusted correctly")
+    ; TODO Need to workout balance of amount vs balance of value
+    #_(is (= 200M (:balance (accounts/reload storage-spec ira)))
+        "The account has the correct balance after the transfer.")))


Zap typo in src/active/clojure/validation.cljc

Co-authored-by: kaaninho <f950d10c4916556a5d4bff6a6dc331bacbf26608@active-group.de>

--- src/active/clojure/validation.cljc
+++ src/active/clojure/validation.cljc
@@ -247,7 +247,7 @@
   "Takes a sequence of `validation` functions and a `candidate`
   and applies each validation function to the `candidate`.

-  If exactly one validation succeeds, reutrns a [[ValidationSuccess]].
+  If exactly one validation succeeds, returns a [[ValidationSuccess]].
   Otherwise, returns a [[ValidationFailure]] with all failed
   validations.


flesh out balance change tests for commodity purchases

--- test/clj_money/trading_test.clj
+++ test/clj_money/trading_test.clj
@@ -9,6 +9,7 @@
             [clj-money.serialization :as serialization]
             [clj-money.test-helpers :refer [reset-db]]
             [clj-money.validation :as validation]
+            [clj-money.models.accounts :as accounts]
             [clj-money.models.lots :as lots]
             [clj-money.models.lot-transactions :as lot-transactions]
             [clj-money.models.prices :as prices]
@@ -131,6 +132,19 @@
                     (prices/select-by-commodity-id storage-spec (:id commodity)))]
     (is (= expected actual) "The price can be retrieved from the database")))

+(deftest buying-a-commodity-reduces-the-balance-of-the-account
+  (let [context (serialization/realize storage-spec purchase-context)
+        ira (-> context :accounts first)
+        commodity (-> context :commodities first)
+        _ (trading/buy storage-spec {:commodity-id (:id commodity)
+                                     :account-id (:id ira)
+                                     :trade-date (t/local-date 2016 1 2)
+                                     :shares 100M
+                                     :value 999M})
+        new-balance (->> (accounts/reload storage-spec ira)
+                         :balance)]
+    (is (= 1001M new-balance) "The account balance decreases by the amount of the purchase")))
+
 (def ^:private sell-context
   (-> purchase-context
       (merge {:lots [{:commodity-id "APPL"
@@ -152,9 +166,6 @@
                                                       {:action :debit
                                                        :amount 1000M
                                                        :account-id "APPL"}]}]))))
-
-(deftest buying-a-commodity-reduces-the-balance-of-the-account
-  (is false "need to write the test"))

 (deftest sell-a-commodity
   (let [context (serialization/realize storage-spec sell-context)
@@ -187,7 +198,22 @@
         "Thhe transaction is valid")))

 (deftest selling-a-commodity-increases-the-balance-of-the-account
-  (is false "need to write the test"))
+  (let [context (serialization/realize storage-spec purchase-context)
+        ira (-> context :accounts first)
+        commodity (-> context :commodities first)
+        _ (trading/buy storage-spec {:commodity-id (:id commodity)
+                                     :account-id (:id ira)
+                                     :trade-date (t/local-date 2016 1 2)
+                                     :shares 100M
+                                     :value 1000M})
+        _ (trading/sell storage-spec {:commodity-id (:id commodity)
+                                      :account-id (:id ira)
+                                      :trade-date (t/local-date 2017 1 2)
+                                      :shares 50M
+                                      :value 560M})
+        new-balance (->> (accounts/reload storage-spec ira)
+                         :balance)]
+    (is (= 1560M new-balance) "The account balance decreases by the amount of the purchase")))

 ; Selling a commodity updates a lot record (FILO updates the most recent, FIFO updates the oldest)
 ; Selling a commodity creates a lot transaction record


test stuff

test stuff

--- test/clojure/migae/tutorial.clj
+++ test/clojure/migae/tutorial.clj
@@ -84,7 +84,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (deftest ^:api emap-predicates
   (testing "emap predicates"
-    (let [e (ds/emap!! [:Foo/bar])]
+    (let [e (ds/entity-map! [:Foo/bar])]
       (log/trace "test: emap-predicates")
       (log/trace "entity: " (.entity e))
       (log/trace "(ds/emap? e): " (ds/emap? e))
@@ -99,7 +99,7 @@

 (deftest ^:api clojure-predicates
   (testing "clojure predicates, entity with 1 property"
-    (let [e (ds/emap!! [:Dept/IT] {:a 1})]
+    (let [e (ds/entity-map! [:Dept/IT] {:a 1})]
       (log/trace "test: api-predicates")
       (log/trace "e " e)
       (log/trace "(coll? e) " (coll? e))
@@ -123,7 +123,7 @@

 (deftest ^:api emap-1
   (testing "clojure map api: entity with 1 property"
-    (let [e (ds/emap!! [:Dept/IT] {:a 1})]
+    (let [e (ds/entity-map! [:Dept/IT] {:a 1})]
       (log/trace "test: map-entity-1")
       (log/trace "(map? e) " (map? e))
       (log/trace "(e :a) " (e :a))
@@ -175,22 +175,21 @@
 (deftest ^:api emap-add-children
   (testing "clojure map api: adding children by kind"
     (log/trace "test: clojure map api: add children by kind")
-    (let [k (ds/keychain (ds/emap!! [:Study] {:name "Test"}))]
+    (let [k (ds/keychain (ds/entity-map! [:Study] {:name "Test"}))]
       (doseq [mbr test-study-members]
         (let [mmap {:fname (first mbr), :lname (second mbr), :email (last mbr)}
-              m (ds/emap!! (conj k :Participant) mmap)]
+              m (ds/entity-map! (conj k :Participant) mmap)]
           (log/trace "added: " (ds/keychain m) m)))
           )))

 (deftest ^:api emap-ancestors
   (testing "clojure map api: ancestors"
-    (log/trace "test: clojure map api: merge")
-    (let [e1 (ds/emap!! [:Dept/IT] {:name "IT Dept"})
+    (let [e1 (ds/entity-map! [:Dept/IT] {:name "IT Dept"})
           k  (ds/keychain e1)
-          emp1 (ds/emap!! [k :Employee] {:lname "Bits" :fname "Joey" :email "bits@foo.org"})
-          emp2 (ds/emap!! [:Dept/IT :Employee] {:lname "Abend" :fname "Janey" :email "abend@foo.org"})
-          emp3 (ds/emap!! [:Dept/IT :Employee] {:lname "Bates" :fname "Bill" :email "bates@foo.org"})
-          employees  (try (ds/emaps?? [k :Employee]) ; ancestory query
+          emp1 (ds/entity-map! (conj k :Employee) {:lname "Bits" :fname "Joey" :email "bits@foo.org"})
+          emp2 (ds/entity-map! [:Dept/IT :Employee] {:lname "Abend" :fname "Janey" :email "abend@foo.org"})
+          emp3 (ds/entity-map! [:Dept/IT :Employee] {:lname "Bates" :fname "Bill" :email "bates@foo.org"})
+          employees  (try (ds/entity-map* (conj k :Employee)) ; ancestory query
                         (catch EntityNotFoundException e (log/trace (.getMessage e))))]
       (is (map? e1))
       (is (ds/emap? e1))
@@ -207,7 +206,7 @@

 (deftest ^:api clojure-map-2
   (testing "clojure map api: entity with 2 properties"
-    (let [e (ds/emap!! [:Foo/bar] {:a 1 :b 2})]
+    (let [e (ds/entity-map! [:Foo/bar] {:a 1 :b 2})]
       (log/trace "test: clojure map api")
       (log/trace "entity: " (.entity e))
       (log/trace "e: " e)
@@ -238,7 +237,7 @@

 (deftest ^:props emap-embedded-map-1
   (testing "using a map as a property value"
-    (let [e (ds/emap!! [:Foo/bar] {:a 1, :b {:c 3, :d 4}})]
+    (let [e (ds/entity-map! [:Foo/bar] {:a 1, :b {:c 3, :d 4}})]
       (log/trace "test: emap-embedded 1")
       (log/trace "e: " e)
       (log/trace "(e :b): " (e :b) (type (e :b)))
@@ -248,7 +247,7 @@
 ;; FIXME:  recursive embedding doesn't work yet
 (deftest ^:props emap-embedded-map-2
   (testing "using a map as a property value - dbl embed"
-    (let [e (ds/emap!! [:Foo/bar] {:a 1, :b {:c 3, :d {:e 4}}})]
+    (let [e (ds/entity-map! [:Foo/bar] {:a 1, :b {:c 3, :d {:e 4}}})]
       (log/trace "test: emap-embedded 2")
       (log/trace "e: " e)
       (log/trace "(e :b): " (e :b))
@@ -257,7 +256,7 @@

 (deftest ^:props emap-embedded-vec
   (testing "using a vector as a property value"
-    (let [e (ds/emap!! [:Foo/bar] {:a 1, :b [1 2 3]})]
+    (let [e (ds/entity-map! [:Foo/bar] {:a 1, :b [1 2 3]})]
       (log/trace "test: emap-embedded-vec")
       (log/trace "e: " e)
       (log/trace "entity: " (.entity e))
@@ -267,7 +266,7 @@

 (deftest ^:props emap-embedded-set
   (testing "using a set as a property value"
-    (let [e (ds/emap!! [:Foo/bar] {:a 1, :b #{1 2 3}})]
+    (let [e (ds/entity-map! [:Foo/bar] {:a 1, :b #{1 2 3}})]
       (log/trace "test: emap-embedded-set")
       (log/trace "e: " e)
       (log/trace "entity: " (.entity e))
@@ -285,13 +284,13 @@

 (deftest ^:api emap-seq
   (testing "emaps are seqable just like clojure maps"
-  (let [e (ds/emap!! [:Foo/bar] {:a 1, :b {:c 3, :d {:e 4, :f 5}}})
+  (let [e (ds/entity-map! [:Foo/bar] {:a 1, :b {:c 3, :d {:e 4, :f 5}}})
         indent 4]
     (seqtest e indent))))

 (deftest ^:api apix
   (testing "clojure api: query"
-    (let [e (ds/emap!! [:Foo/d3] {:a 1 :b 2})]
+    (let [e (ds/entity-map! [:Foo/d3] {:a 1 :b 2})]
       (log/trace e)
       (log/trace (.entity e))
       (log/trace (type e))
@@ -303,7 +302,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (deftest ^:meta emap-meta
   (testing "emap meta"
-    (let [e (ds/emap!! [:Foo/d3] {:a 1 :b 2})]
+    (let [e (ds/entity-map! [:Foo/d3] {:a 1 :b 2})]
       (is (ds/emap? e))
       (is (= (type e) migae.datastore.PersistentEntityMap))
       (is (= (type (:migae/key (meta e))) clojure.lang.PersistentVector))


Added test cases into test-format-date-using-desired-format

--- test/clouseau/test_calendar.clj
+++ test/clouseau/test_calendar.clj
@@ -116,5 +116,10 @@
     (testing "the function clouseau.calendar/format-date-using-desired-format."
         (let [calendar (get-calendar)]
             (.set calendar 2000 01 01 10 20 30)
-)))
+            (is (= "2000" (format-date-using-desired-format calendar "yyyy")))
+            (is (= "02"   (format-date-using-desired-format calendar "MM")))
+            (is (= "01"   (format-date-using-desired-format calendar "dd")))
+            (is (= "10"   (format-date-using-desired-format calendar "hh")))
+            (is (= "20"   (format-date-using-desired-format calendar "mm")))
+            (is (= "30"   (format-date-using-desired-format calendar "ss"))))))


fixed issue with uploads test

fixed issue with uploads test

--- test/frontend/uploads-test.cljs
+++ test/frontend/uploads-test.cljs
@@ -70,7 +70,8 @@
       (is (nil? (uploads/get-action old-state new-state upload-id))))))

 (deftest get-action-no-change
-  (let [upload-id "test-id"
+  (let [filename "foo.mp3"
+        upload-id "test-id"
         upload (merge uploads/blank-upload {:filename filename
                                             :id upload-id})
         old-state {:uploads {upload-id upload}}


Adding buster prep on selector_test

Adding buster prep on selector_test

--- test/clj/dalap/test/selector_test.clj
+++ test/clj/dalap/test/selector_test.clj
@@ -3,13 +3,15 @@
    (:require [buster-cljs.core :refer [is]]
             [dalap.selector :refer [-gen-decorator gen-visitor]]
             [dalap.walk :refer [walk]])
-   (:require-macros [buster-cljs.macros :refer [deftest it]]))}
+   (:require-macros [buster-cljs.macros :refer [deftest it initialize-buster]]))}
 (ns dalap.test.selector-test
   (:require [clojure.test :refer [deftest is]]
             [buster-cljs.clojure :refer [it]]
             [dalap.selector :refer [-gen-decorator gen-visitor]]
             [dalap.walk :refer [walk]]
             ))
+
+#_(:cljs (initialize-buster))

 (defrecord CustomType [a b])
 (defrecord CustomType2 [a b])


Make more explicit what test is waiting for, hopefully getting rid of some flakyness

--- test/lambdacd_git/core_test.clj
+++ test/lambdacd_git/core_test.clj
@@ -153,15 +153,19 @@
     (ring-mock/request :post (str "/notify-git?remote="(or remote-to-notify (remote state)))))
   state)

-(defn- last-seen-revisions-from-history [ctx]
+(defn- last-seen-revisions-from-history [ctx branch]
   (let [last-step-result (presentation-state/most-recent-step-result-with :_git-last-seen-revisions ctx)
         result            (:_git-last-seen-revisions last-step-result)]
-    (println "last seen revision found:" result)
-    result))
-
-(defn- wait-for-pipeline-state-to-pick-up-last-git-revision [state]
-  (test-utils/while-with-timeout 1000 (nil? (last-seen-revisions-from-history (:ctx @state)))
-                                 (Thread/sleep 10))
+    (get result (str "refs/heads/"branch))))
+
+(defn- wait-for-pipeline-state-to-have-seen-commit [state branch msg]
+  (let [commit-hash-to-wait-for (commit-hash-by-msg state msg)]
+    (test-utils/while-with-timeout 10000 (let [current-last-seen-hash  (last-seen-revisions-from-history (:ctx @state) branch)
+                                               result (not= commit-hash-to-wait-for
+                                                            current-last-seen-hash)]
+                                           (println "waiting for" commit-hash-to-wait-for "but till now it's" current-last-seen-hash)
+                                           result)
+                                   (Thread/sleep 10)))
   state)

 (deftest wait-for-git-test
@@ -228,11 +232,12 @@
                     (git-init)
                     (git-commit "initial commit")
                     (git-checkout-b "some-branch")
+                    (git-checkout "master")

                     (start-wait-for-git-step :ref (fn [_] true))
                     (git-commit "some commit on master")
                     (wait-for-step-to-complete)
-                    (wait-for-pipeline-state-to-pick-up-last-git-revision)
+                    (wait-for-pipeline-state-to-have-seen-commit "master" "some commit on master")

                     (git-checkout "some-branch")
                     (start-wait-for-git-step :ref (fn [_] true))
@@ -240,7 +245,7 @@

                     (get-step-result))]
       (is (= :success (:status (step-result state))))
-      (is (= (commit-hash-by-msg state "some commit on master") (:old-revision (step-result state))))
+      (is (= (commit-hash-by-msg state "initial commit") (:old-revision (step-result state)))) ; FIXME: is this correct?
       (is (= (commit-hash-by-msg state "some commit on branch") (:revision (step-result state))))
       (is (str-containing (commit-hash-by-msg state "some commit on branch") (:out (step-result state))))))
   (testing "that it prints out information on old and new commit hashes"
@@ -259,7 +264,7 @@
                     (start-wait-for-git-step)
                     (git-commit "other commit")
                     (wait-for-step-to-complete)
-                    (wait-for-pipeline-state-to-pick-up-last-git-revision)
+                    (wait-for-pipeline-state-to-have-seen-commit "master" "other commit")
                     (git-commit "commit while not waiting")
                     (start-wait-for-git-step)
                     (get-step-result))]


don't hit api in home page test

don't hit api in home page test

--- test/gh_waiting_room/service_test.clj
+++ test/gh_waiting_room/service_test.clj
@@ -13,6 +13,7 @@
                 (constantly [{:position "1"
                               :id "cldwalker/gh-waiting-room#1"
                               :url "https://github.com/cldwalker/gh-waiting-room/issues/1"}])
+                service/update-gh-issues (constantly nil)
                 gh-waiting-room.config/gh-user (constantly "Hal")]
     (:body (response-for service :get "/"))))


AB & JC | #166 | Reintroduce sync-activities test

--- test/mooncake/test/activity.clj
+++ test/mooncake/test/activity.clj
@@ -43,8 +43,7 @@
         (http/get ...invalid-activity-src-url...
                   {:accept :json :as :json-string-keys}) =throws=> (java.net.ConnectException.)))

-;; FIXME
-(future-fact "sync activities retrieves activities from api and stores in database"
+(fact "sync activities retrieves activities from api and stores in database"
       (let [an-activity-src-url "https://an-activity.src"
             another-activity-src-url "https://another-activity.src"
             json-src1 [{"actor"     {"displayName" "JDog"}


add doc string to clean-entity

add doc string to clean-entity

--- src/hatch.clj
+++ src/hatch.clj
@@ -60,6 +60,7 @@
   (select-keys entity (conj (entity-type attr-map) :db/id)))

 (defn clean-entity
+  "Ensure entity has a db/id and prune it"
   [partitions attr-map entity-type entity]
   (->> entity
        (ensure-db-id partitions entity-type)


clean up warning print

clean up warning print


Adjust rock and fruit characters.

Adjust rock and fruit characters.

--- client/src/client/core.cljs
+++ client/src/client/core.cljs
@@ -15,7 +15,7 @@
 (defonce client-channel (chan))

 (def ant "⚈")
-(def fruit "♥")
+(def fruit "🍎")
 (def phermone "•")
 (def rock "☗")
 (def color-dirt {0 "#d3b383"
@@ -61,7 +61,7 @@
   (let [style {:style {:color (if (get-in cell ["Object" "Mine"]) color-my-ant color-their-ant)
                        :position "absolute"
                        :top "0px"
-                       :right "5px"}}]
+                       :right "3px"}}]
     (condp = (get-in cell ["Object" "Direction"])
       [1,0] (dom/div (clj->js (merge style {:className "right"})) ant)
       [1,-1] (dom/div (clj->js (merge style {:className "down-right"})) ant)
@@ -73,15 +73,18 @@
       [1,1] (dom/div (clj->js (merge style {:className "up-right"})) ant))))

 (defn show-fruit [cell]
-  (dom/div #js {:style #js {:fontSize "25px"
+  (dom/div #js {:style #js {;:fontSize "25px"
                             :color color-fruit
                             :position "absolute"
-                            :top "-5px"
-                            :right "3px"}}
+                            :top "-3px"
+                            :right "0px"}}
            fruit))

 (defn show-rock [cell]
-  (dom/div #js {:style #js {:color color-rock
+  (dom/div #js {:style #js {:position "absolute"
+                            :top "0px"
+                            :right "2px"
+                            :color color-rock
                             :fontSize "16px"}} rock))

 (defn cell-view [cell _]


scrape thread url

scrape thread url

--- src/bonews_rest/scraper/forums.clj
+++ src/bonews_rest/scraper/forums.clj
@@ -23,7 +23,7 @@
 (defn get-thread-url
   [col]
   (let [title-node (html/select col [:h4 [:a (html/attr? :href)]])]
-  (first title-node)))
+  (:href (first (rest (first (rest (first title-node))))))))

 (defn get-cols
   [row]


Null state for top contribs

Null state for top contribs

--- src/clj/clojuredocs/site/intro.clj
+++ src/clj/clojuredocs/site/intro.clj
@@ -31,7 +31,9 @@
      [:section
       [:h5 "Top Contributors"]
       [:div.top-contribs
-       (map common/$avatar top-contribs)]]]]
+       (if-not (empty? top-contribs)
+         (map common/$avatar top-contribs)
+         [:div.null-state "Uh-oh, no contributors!"])]]]]
    [:section
     [:div.row
      [:div.col-md-12


Fix namespace-changing for attached nREPL sessions

--- src/clj/reply/evaluation/nrepl.clj
+++ src/clj/reply/evaluation/nrepl.clj
@@ -63,7 +63,7 @@
     (reply.concurrency/set-signal-handler! "INT" (fn [sig] (println "^C") (@current-command :interrupt)))
     (let [options (assoc options :prompt
                     (fn [ns]
-                      (binding [*ns* (the-ns (symbol ns))]
+                      (binding [*ns* (create-ns (symbol ns))]
                         (reply.eval-state/set-bindings!))
                       (reader.jline/prepare-for-read
                         (partial adhoc-eval connection))))


remove println

remove println

--- src/cljs/shop/components/home.cljs
+++ src/cljs/shop/components/home.cljs
@@ -137,13 +137,13 @@
         (GET "/countries"
             {
             :response-format (json-response-format {:keywords? true})
-            :handler ( fn[response] (println response)  (om/update! state [:countries] (:countries response))  )
+            :handler ( fn[response] (om/update! state [:countries] (:countries response))  )
             :error-handler error-handler}
             )
         (GET "/genres"
             {
             :response-format (json-response-format {:keywords? true})
-            :handler ( fn[response] (println response)  (om/update! state [:genres] (:genres response))  )
+            :handler ( fn[response]  (om/update! state [:genres] (:genres response))  )
             :error-handler error-handler}
             )
         )


start adding specs

start adding specs

--- src/cljs/triboard/logic/board.cljs
+++ src/cljs/triboard/logic/board.cljs
@@ -1,5 +1,7 @@
 (ns triboard.logic.board
   (:require
+    [cljs.spec :as s :include-macros true]
+    [cljs.spec.test :as stest :include-macros true]
     [triboard.logic.constants :as cst]
     ))

@@ -34,6 +36,13 @@
 ;; -----------------------------------------
 ;; Public Types
 ;; -----------------------------------------
+
+(s/def ::board (s/coll-of cst/cell?))
+(s/def ::coord (s/tuple integer? integer?))
+
+(s/fdef new-board :ret ::board)
+(s/fdef to-iterable :args ::board :ret (s/coll-of (s/tuple ::coord cst/cell?)))
+(s/fdef empty-cells :args ::board :ret (s/coll-of cst/cell?))

 (defn board?
   "A board is a vector of vector of cells"


introduce a new function add-aggregated-listener! for http server channel

--- src/clojure/nginx/clojure/core.clj
+++ src/clojure/nginx/clojure/core.clj
@@ -3,7 +3,7 @@
             NginxRequest NginxHttpServerChannel ChannelListener
             AppEventListenerManager AppEventListenerManager$Listener
             AppEventListenerManager$Decoder AppEventListenerManager$PostedEvent
-            MessageAdapter])
+            MessageAdapter WholeMessageAdapter])
   (:import [nginx.clojure.net NginxClojureAsynChannel NginxClojureAsynChannel$CompletionListener
             NginxClojureAsynSocket])
   (:import [nginx.clojure.clj Constants])
@@ -72,6 +72,7 @@
   (-> req (.handler) (.hijack req ignore-nginx-filter?)))

 (defprotocol HttpServerChannel
+  (closed? [ch])
   (close! [ch]
     "Asynchronously close the channel. If there's remaining data to send it won't block
      current thread  and will flush data on the background asynchronously and later close the channel safely")
@@ -91,10 +92,18 @@
      resp is a ring Response Map, e.g. {:status 200, headers {\"Content-Type\" \"text/html\"}, :body \"Hello, Nginx-Clojure!\" } .
      ")
   (add-listener! [ch callbacks-map]
-    "Add a websocket event listener.
+    "Add a channel event listener.
       callbacks-map is a map whose key can be either of :on-open,:on-message,:on-close,:on-error
       the value of :on-open is a function like (fn[ch]...)
       the value of :on-message is a function like (fn[ch message remaining?]...)
+      the value of :on-close is a function like (fn[ch reason]...)
+      the value of :on-error is a function like (fn[ch status])
+     ")
+  (add-aggregated-listener! [ch max-message-size callbacks-map]
+    "Add an aggregated message listener.
+      callbacks-map is a map whose key can be either of :on-open,:on-message,:on-close,:on-error
+      the value of :on-open is a function like (fn[ch]...)
+      the value of :on-message is a function like (fn[ch message]...)
       the value of :on-close is a function like (fn[ch reason]...)
       the value of :on-error is a function like (fn[ch status])
      ")
@@ -155,6 +164,7 @@
     "return the error string message from the error code"))

 (extend-type NginxHttpServerChannel HttpServerChannel
+  (closed? [ch] (.isClosed ch))
   (close [ch] (.close ch))
   (send! [ch data flush? last?]
     (cond
@@ -176,6 +186,14 @@
                           (onOpen [c] (if on-open (on-open c)))
                           (onTextMessage [c msg rem?] (if on-message (on-message c msg rem?)))
                           (onBinaryMessage [c msg rem?] (if on-message (on-message c msg rem?)))
+                          (onClose ;([c] (if on-close (on-close c "0")))
+                                   ([c status reason] (if on-close (on-close c (str status ":" reason)))))
+                          (onError [c status] (if on-error (on-error c (NginxClojureAsynSocket/errorCodeToString status)))))))
+  (add-aggregated-listener! [ch max-message-size {:keys [on-open on-message on-close on-error]}]
+    (.addListener ch ch (proxy [WholeMessageAdapter] [max-message-size]
+                          (onOpen [c] (if on-open (on-open c)))
+                          (onWholeTextMessage [c msg] (if on-message (on-message c msg)))
+                          (onWholeBiniaryMessage [c msg rem?] (if on-message (on-message c msg)))
                           (onClose ;([c] (if on-close (on-close c "0")))
                                    ([c status reason] (if on-close (on-close c (str status ":" reason)))))
                           (onError [c status] (if on-error (on-error c (NginxClojureAsynSocket/errorCodeToString status)))))))


fixed test to check translated balance string

--- test/freecoin/test/handlers/participant_query.clj
+++ test/freecoin/test/handlers/participant_query.clj
@@ -6,6 +6,7 @@
             [freecoin.db.mongo :as fm]
             [freecoin.db.wallet :as w]
             [freecoin.blockchain :as fb]
+            [freecoin.translation :as t]
             [freecoin.test.test-helper :as th]
             [freecoin.handlers.participants :as fp]))

@@ -30,7 +31,8 @@
                                                       (assoc :params {:uid (:uid wallet)})
                                                       (assoc :session {:signed-in-uid (:uid wallet)})))]
                (:status response) => 200
-               (:body response) => (contains #"Balance:"))))
+               (:body response) => (contains (t/locale [:wallet :balance]))
+               )))

 ;;        (fact "can not be accessed when user is not signed in"))

@@ -61,7 +63,7 @@
                    response (-> (th/create-request :get "/participants" {})
                                 participants-handler)]
                (:status response) => 401))
-
+
        (fact "without any query parameters, lists all participants"
              (let [wallet-store (fm/create-memory-store)
                    blockchain (fb/create-in-memory-blockchain :bk)
@@ -77,7 +79,7 @@
                (-> (:body response) html/html-snippet) => (th/element-count [:.clj--participant__item] 5)))

        (tabular
-
+
         (fact "can query by name or email"
               (let [wallet-store (fm/create-memory-store)
                     blockchain (fb/create-in-memory-blockchain :bk)
@@ -93,7 +95,7 @@
                                  participants-handler)]
                 (-> (:body response) html/html-snippet)
                 => (th/element-count [:.clj--participant__item] ?expected-count)))
-
+
         ?field   ?value                  ?expected-count
         "name"   "James Jones"           2
         "email"  "james@jones.com"       1


Appease 1.4.0 wrt EDN decoding

Appease 1.4.0 wrt EDN decoding

--- integration-tests/apps/cluster/src/immutant/init.clj
+++ integration-tests/apps/cluster/src/immutant/init.clj
@@ -21,7 +21,7 @@
 (job/schedule "updater" update-cache :every :second)

 (let [resp  (atom nil)
-      start (fn [] (reset! resp (msg/respond "/queue/cache" (constantly cache))))
+      start (fn [] (reset! resp (msg/respond "/queue/cache" (fn [_] (into {} cache)))))
       stop  (fn [] (msg/unlisten @resp))]
   (dmn/daemonize "cache-status" start stop))


CMR-1747: (and CMR-1781) Added paging and hits tests for all revision searching.

--- system-int-test/test/cmr/system_int_test/search/paging_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/paging_search_test.clj
@@ -5,27 +5,48 @@
             [cmr.system-int-test.utils.search-util :as search]
             [cmr.system-int-test.utils.index-util :as index]
             [cmr.system-int-test.data2.collection :as dc]
+            [cmr.common.concepts :as concepts]
             [cmr.system-int-test.data2.core :as d2c]
             [cmr.search.services.parameters.parameter-validation :as pm]))

 (def prov1-collection-count 10)
+(def prov1-deleted-collection-count 3)
 (def prov2-collection-count 15)

 (def collection-count (+ prov2-collection-count prov1-collection-count))

+(def revision-count (+ (* 2 prov1-collection-count)
+                       prov2-collection-count
+                       (* 2 prov1-deleted-collection-count)))
+
+
+
 (defn create-collections
   "Set up the fixtures for tests."
   []
-  (dotimes [n prov1-collection-count]
-    (d2c/ingest "PROV1" (dc/collection)))
-  (dotimes [n prov2-collection-count]
-    (d2c/ingest "PROV2" (dc/collection)))
-  (index/wait-until-indexed))
+  (let [prov1-colls (doall (for [n (range prov1-collection-count)
+                                 :let [coll-r1 (d2c/ingest "PROV1" (dc/collection))]]
+                             [coll-r1
+                              (d2c/ingest "PROV1" (dissoc coll-r1 :revision-id))]))
+        prov1-deleted-colls (doall (for [n (range prov1-deleted-collection-count)
+                                         :let [coll-r1 (d2c/ingest "PROV1" (dc/collection))]]
+                                     (do
+                                       (ingest/delete-concept (d2c/item->concept coll-r1))
+                                       [coll-r1 (assoc coll-r1 :deleted true
+                                                       :revision-id 2)])))
+
+        prov2-colls (doall (for [n (range prov2-collection-count)]
+                             (d2c/ingest "PROV2" (dc/collection))))]
+    (index/wait-until-indexed)
+
+    (flatten (concat prov1-colls prov1-deleted-colls prov2-colls))))
+

 (use-fixtures :each (ingest/reset-fixture {"provguid1" "PROV1" "provguid2" "PROV2"}))

-(deftest search-with-page-size-and-page-num
+(deftest search-with-page-size
   (create-collections)
+
   (testing "Exceeded page depth (page-num * page-size)"
     (let [page-size 10
           page-num 1000000000]
@@ -35,16 +56,17 @@
             {:keys [status errors]} resp]
         (is (= 400 status))
         (is (re-matches #"The paging depth \(page_num \* page_size\) of \[\d*?\] exceeds the limit of \d*?.*?"
-                        (first errors)))))))
+                        (first errors))))))

-(deftest search-with-page-size
-  (create-collections)
   (testing "Search with page_size."
     (let [{:keys [refs]} (search/find-refs :collection {:page_size 5})]
       (is (= 5 (count refs)))))
   (testing "Search with large page_size."
     (let [{:keys [refs]} (search/find-refs :collection {:page_size 100})]
       (is (= collection-count (count refs)))))
+  (testing "all revision page size"
+    (let [{:keys [refs]} (search/find-refs :collection {:page_size 5 :all-revisions true})]
+      (is (= 5 (count refs)))))
   (testing "page_size less than zero."
     (let [resp (search/find-refs :collection {:page_size -1})
           {:keys [status errors]} resp]
@@ -71,9 +93,69 @@
   (are [hits params]
        (= hits (:hits (search/find-refs :collection params)))
        collection-count {}
+       revision-count {:all-revisions true}
        0 {:provider "NONE"}
        prov1-collection-count {:provider "PROV1"}
        prov2-collection-count {:provider "PROV2"}))
+
+(defn get-concept-id-revision-id
+  "Returns a tuple of concept id and revision id. Works with references or collections."
+  [c]
+  [(or (:concept-id c) (:id c))
+   (:revision-id c)])
+
+(defn concept-id->sequence-number
+  "Returns the sequence number used for sorting in elastic in leau of concept-id"
+  [concept-id]
+  (:sequence-number (concepts/parse-concept-id concept-id)))
+
+(defn sort-collections-all-revisions
+  "Sorts a list of collections using the same default sort as search for all revisions."
+  [collections]
+  (sort-by identity
+           (fn [c1 c2]
+             (let [et1 (:entry-title c1)
+                   et2 (:entry-title c2)
+                   p1 (:provider-id c1)
+                   p2 (:provider-id c2)
+                   seq1 (concept-id->sequence-number (:concept-id c1))
+                   seq2 (concept-id->sequence-number (:concept-id c2))]
+               (cond
+                 (not= et1 et2) (compare et1 et2)
+                 (not= p1 p2) (compare p1 p2)
+                 (not= seq1 seq2) (compare seq1 seq2)
+                 :else (compare (:revision-id c2) (:revision-id c1)))))
+           collections))
+
+(defn select-page
+  "Manually selects a page of collections."
+  [collections page-num page-size]
+  (nth (partition-all page-size collections) (dec page-num)))
+
+
+(deftest search-all-revisions-with-page-num
+  (let [all-collections (sort-collections-all-revisions (create-collections))]
+
+    (testing "Find everything on one big page"
+      (let [{:keys [refs]} (search/find-refs :collection {:page_size 1000
+                                                          :all-revisions true})]
+        (is (= (map get-concept-id-revision-id all-collections)
+               (map get-concept-id-revision-id refs)))))
+
+    (testing "Find by page 1"
+      (let [{:keys [refs]} (search/find-refs :collection {:page_size 12
+                                                          :page_num 1
+                                                          :all-revisions true})]
+        (is (= (map get-concept-id-revision-id (select-page all-collections 1 12))
+               (map get-concept-id-revision-id refs)))))
+
+    (testing "Find by page 2"
+      (let [{:keys [refs]} (search/find-refs :collection {:page_size 12
+                                                          :page_num 2
+                                                          :all-revisions true})]
+        (is (= (map get-concept-id-revision-id (select-page all-collections 2 12))
+               (map get-concept-id-revision-id refs)))))))
+

 (deftest search-with-page-num
   (let [provider-id "PROV1"


Fixes invariants in tagged constraint tests.

--- test/onyx/scheduler/tagged_constraints_test.clj
+++ test/onyx/scheduler/tagged_constraints_test.clj
@@ -19,6 +19,7 @@
         {:jobs [:j1]
          :allocations {}
          :peers [:p1 :p2 :p3]
+         :peer-state {:p1 :idle :p2 :idle :p3 :idle}
          :tasks {:j1 [:t1 :t2 :t3]}
          :task-schedulers {:j1 :onyx.task-scheduler/balanced
                            :j2 :onyx.task-scheduler/balanced}
@@ -145,6 +146,9 @@
                             :t2 [:p3 :p4 :p5]
                             :t3 [:p8]}}
          :peers [:p1 :p3 :p4 :p5 :p7 :p8]
+         :peer-state {:p1 :idle :p2 :idle :p3 :active
+                      :p4 :active :p5 :active :p6 :idle
+                      :p7 :active :p8 :active}
          :tasks {:j1 [:t1 :t2 :t3]
                  :j2 [:t4 :t5 :t6]}
          :task-schedulers {:j1 :onyx.task-scheduler/balanced


A couple non-faction links are no longer being picked up as we drill an additional level down in the dom.

--- scraper/src/scraper/core.clj
+++ scraper/src/scraper/core.clj
@@ -52,6 +52,8 @@
         (-> (parse "http://wiki.project1999.com/index.php?title=Category:Factions")
             (by-attribute {:class "mw-content-ltr"})
             (first)
+            (by-tag :table)
+            (first)
             (by-tag :a))
         )
       )


Show flash notification when API token is deleted


Create generic function for processing items and bubbles

--- src/discuss/communication/lib.cljs
+++ src/discuss/communication/lib.cljs
@@ -22,6 +22,18 @@
   (when (lib/logged-in?)
     {"X-Authentication" (lib/clj->json {:type "user" :nickname (lib/get-nickname) :token (lib/get-token)})}))

+(defn process-and-set-items-and-bubbles
+  "Receive response and prepare UI with the new items and bubbles for the next
+  step in the discussion."
+  [response]
+  (let [{:keys [bubbles attitudes items attacks]} (lib/process-response response)
+        update-items (cond
+                       (seq items) items
+                       (seq attacks) (vals attacks)
+                       (seq attitudes) (vals attitudes)
+                       :default [])]
+    (om/transact! parser/reconciler `[(discussion/bubbles {:value ~bubbles})
+                                      (discussion/items {:value ~update-items})])))

 ;;;; Handlers
 (defn error-handler
@@ -32,22 +44,8 @@

 (defn index-handler
   [response]
-  (let [{:keys [items bubbles]} (lib/process-response response)]
-    (lib/change-to-next-view!)
-    (om/transact! parser/reconciler `[(discussion/items {:value ~items})
-                                      (discussion/bubbles {:value ~bubbles})])))
-
-(defn process-discussion-step
-  "Handler to process the response from a discussion step when an item is clicked."
-  [response]
-  (let [{:keys [bubbles attitudes items attacks]} (lib/process-response response)
-        update-items (cond
-                       (seq items) items
-                       (seq attacks) (vals attacks)
-                       (seq attitudes) (vals attitudes)
-                       :default [])]
-    (om/transact! parser/reconciler `[(discussion/bubbles {:value ~bubbles})
-                                      (discussion/items {:value ~update-items})])))
+  (lib/change-to-next-view!)
+  (process-and-set-items-and-bubbles response))

 (defn ajax-get
   "Make ajax call to dialog based argumentation system."
@@ -60,7 +58,7 @@
          :params        params
          :error-handler error-handler}))
   ([url headers handler] (ajax-get url headers handler nil))
-  ([url headers] (ajax-get url headers process-discussion-step))
+  ([url headers] (ajax-get url headers process-and-set-items-and-bubbles))
   ([url] (ajax-get url (token-header))))

 (defn ajax-get-and-change-view
@@ -70,8 +68,7 @@
    (lib/next-view! view)
    (ajax-get url {} handler))
   ([url view]
-   (ajax-get-and-change-view url view process-discussion-step)))
-
+   (ajax-get-and-change-view url view process-and-set-items-and-bubbles)))

 (defn jump-to-argument
   "Jump directly into the discussion to let the user argue about the given argument.
@@ -124,5 +121,5 @@
 (s/def ::response (s/keys :req-un [::bubbles]
                           :opt-un [::attitudes ::attacks ::items]))

-(s/fdef process-discussion-step
+(s/fdef process-and-set-items-and-bubbles
         :args (s/cat :response ::response))


disable-saml-test (#786)

disable-saml-test (#786)

--- waiter/integration/waiter/authentication_test.clj
+++ waiter/integration/waiter/authentication_test.clj
@@ -88,7 +88,8 @@
                     "form input[name=SAMLResponse]" (reaver/attr :value)
                     "form input[name=RelayState]" (reaver/attr :value))))

-(deftest ^:parallel ^:integration-fast test-saml-authentication
+;; need to temporarily turn off this test until ADFS setting is updated
+(deftest ^:parallel ^:integration-fast ^:explicit test-saml-authentication
   (testing-using-waiter-url
     (when (using-composite-authenticator? waiter-url)
       (let [auth-principal (or (System/getenv "SAML_AUTH_USER") (retrieve-username))


Qualify stop-marker for search results

Qualify stop-marker for search results

--- src/cljs/gtfve/components/maps-canvas/google.cljs
+++ src/cljs/gtfve/components/maps-canvas/google.cljs
@@ -22,7 +22,7 @@
          (when gmap
            [:p (pr-str (:bounds state))])]]))))

-(defn stop-marker [data owner]
+(defn search-stop-marker [data owner]
   (reify
     om/IDisplayName (display-name [_] "Stop Marker")
     om/IInitState
@@ -129,8 +129,8 @@
         (html
          (into [:div.maps-viewport [:div.maps-canvas {:ref "gmap"}]]
                (when gmap
-                 (om/build-all stop-marker stops {:key :stop/id
-                                                  :state {:gmap gmap
-                                                          :info-window info-window
-                                                          :data-click-mult data-click-mult}}))
+                 (om/build-all search-stop-marker stops {:key :stop/id
+                                                         :state {:gmap gmap
+                                                                 :info-window info-window
+                                                                 :data-click-mult data-click-mult}}))
                ))))))


added some common browsers for linux browser can be found from path, so file checks are removed

--- src/jarppe/btest/local_browser.clj
+++ src/jarppe/btest/local_browser.clj
@@ -6,7 +6,11 @@
 (def common-browsers
   {"Mac OS X" {:firefox  "/Applications/Firefox.app/Contents/MacOS/firefox"
                :safari   "/Applications/Safari.app/Contents/MacOS/Safari"
-               :chromium "/Applications/Chromium.app/Contents/MacOS/Chromium"}})
+               :chromium "/Applications/Chromium.app/Contents/MacOS/Chromium"
+               :chrome   "/Applications/Chrome.app/Contents/MacOS/Chrome"}
+   "Linux"    {:firefox  "firefox"
+               :chromium "chromium"
+               :chrome   "chrome"}})

 (def ^:private process (atom nil))

@@ -18,11 +22,9 @@
 (defn open-browser [browser url]
   (close-browser)
   (let [app (if (keyword? browser)
-             (get-in common-browsers [(System/getProperty "os.name") browser])
-             browser)]
+              (get-in common-browsers [(System/getProperty "os.name") browser])
+              browser)]
     (if-not app (throw (RuntimeException. (str "Unknown browser: " browser))))
-    (if-not (.exists (io/file app)) (throw (RuntimeException. (str "Browser '" app "' not found"))))
-    (if-not (.canExecute (io/file app)) (throw (RuntimeException. (str "Browser '" app "' not executable"))))
     (reset! process (-> (ProcessBuilder. [app url]) (.start)))))

 (defonce browser-config (atom nil))
@@ -41,4 +43,5 @@
           (close-browser)
           (println "Browser timeout!")
           (throw+ {:core/source :require-browser})))
-      (.addShutdownHook (Runtime/getRuntime) (Thread. close-browser)))))
+      (.addShutdownHook (Runtime/getRuntime) (Thread. close-browser))
+      true)))


Fix and DRY up tests w/ the new category order.

--- test/open_company/integration/section/section_manipulation.clj
+++ test/open_company/integration/section/section_manipulation.clj
@@ -37,6 +37,8 @@

 ;; ----- Tests -----

+(def categories (map name open-company.resources.common/categories))
+
 (with-state-changes [(before :facts (do (company/delete-all-companies!)
                                         (company/create-company r/open r/coyote)
                                         (section/put-section r/slug :update r/text-section-1 r/coyote)
@@ -58,7 +60,7 @@
         (:body response) => common/unauthorized)
       ;; verify the initial order is unchanged
       (let [db-company (company/get-company r/slug)]
-        (:categories db-company) => ["progress" "financial" "company"]
+        (:categories db-company) => categories
         (:sections db-company) => {:progress ["update" "team" "help"]
                                    :financial ["finances"]
                                    :company ["diversity" "values"]}))
@@ -72,7 +74,7 @@
         (:body response) => common/unauthorized)
       ;; verify the initial order is unchanged
       (let [db-company (company/get-company r/slug)]
-        (:categories db-company) => ["progress" "financial" "company"]
+        (:categories db-company) => categories
         (:sections db-company) => {:progress ["update" "team" "help"]
                                    :financial ["finances"]
                                    :company ["diversity" "values"]}))
@@ -86,7 +88,7 @@
         (:body response) => common/forbidden)
       ;; verify the initial order is unchanged
       (let [db-company (company/get-company r/slug)]
-        (:categories db-company) => ["progress" "financial" "company"]
+        (:categories db-company) => categories
         (:sections db-company) => {:progress ["update" "team" "help"]
                                    :financial ["finances"]
                                    :company ["diversity" "values"]}))
@@ -99,7 +101,7 @@
         (:body response) => "")
       ;; verify the initial order is unchanged
       (let [db-company (company/get-company r/slug)]
-        (:categories db-company) => ["progress" "financial" "company"]
+        (:categories db-company) => categories
         (:sections db-company) => {:progress ["update" "team" "help"]
                                    :financial ["finances"]
                                    :company ["diversity" "values"]})))
@@ -108,7 +110,7 @@

     ;; verify the initial order
     (let [db-company (company/get-company r/slug)]
-      (:categories db-company) => ["progress" "financial" "company"]
+      (:categories db-company) => categories
       (:sections db-company) => {:progress ["update" "team" "help"]
                                  :financial ["finances"]
                                  :company ["diversity" "values"]})


add support for anonymous dependencies

add support for anonymous dependencies

--- src/cake.clj
+++ src/cake.clj
@@ -11,17 +11,6 @@

 (defn verbose? [opts]
   (or (:v opts) (:verbose opts)))
-
-(defn cat [s1 s2]
-  (if s1 (str s1 " " s2) s2))
-
-(defn update-task [task deps doc actions]
-  {:pre [(every? symbol? deps) (every? fn? actions)]}
-  (let [task (or task {:actions [] :deps []})]
-    (-> task
-        (update :deps    into deps)
-        (update :doc     cat  doc)
-        (update :actions into actions))))

 (defn group [project]
   (if (or (= project 'clojure) (= project 'clojure-contrib))
@@ -49,6 +38,22 @@
                          :source-path    (str ~root "/src")
                          :test-path      (str ~root "/test")))))))

+(defn dependency? [form]
+  (or (symbol? form)
+      (and (seq? form)
+           (include? (first form) ['fn* 'fn]))))
+
+(defn cat [s1 s2]
+  (if s1 (str s1 " " s2) s2))
+
+(defn update-task [task deps doc actions]
+  {:pre [(every? dependency? deps) (every? fn? actions)]}
+  (let [task (or task {:actions [] :deps []})]
+    (-> task
+        (update :deps    into deps)
+        (update :doc     cat  doc)
+        (update :actions into actions))))
+
 (defmacro deftask
   "Define a cake task. Each part of the body is optional. Task definitions can
    be broken up among multiple deftask calls and even multiple files:
@@ -58,7 +63,7 @@
      (do-something-else))"
   [name & body]
   (let [[deps body] (if (= '=> (first body))
-                      (split-with symbol? (rest body))
+                      (split-with dependency? (rest body))
                       [() body])
         [doc actions] (if (string? (first body))
                         (split-at 1 body)
@@ -74,18 +79,21 @@
 (defn run-task
   "Execute the specified task after executing all prerequisite tasks."
   ([name] (swap! tasks run-task name) nil)
-  ([tasks name]
-     (let [task (tasks name)]
-       (when (nil? task) (abort "Unknown task:" name))
-       (if (:run? task)
-         tasks
-         (let [tasks (reduce run-task tasks (task :deps))]
-           (doseq [action (task :actions)]
-             (binding [project      @project
-                       current-task name]
-               (action)))
-           (when (verbose? opts) (println " " name "complete."))
-           (assoc-in tasks [name :run?] true))))))
+  ([tasks form]
+     (if (list? form)
+       (binding [project @project]
+         ((eval form)) ; excute anonymous dependency
+         tasks)
+       (let [name form, task (tasks name)]
+         (when (nil? task) (abort "Unknown task:" name))
+         (if (:run? task)
+           tasks
+           (let [tasks (reduce run-task tasks (task :deps))]
+             (doseq [action (task :actions)]
+               (binding [project @project, current-task name]
+                 (action)))
+             (when (verbose? opts) (println " " name "complete."))
+             (assoc-in tasks [name :run?] true)))))))

 (defmacro bake [& body]
   "Execute body in a fork of the jvm with the classpath of your project."


use degrees, not radians

use degrees, not radians

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

--- plugins/SlideExplorer2/src/slide_explorer/canvas.clj
+++ plugins/SlideExplorer2/src/slide_explorer/canvas.clj
@@ -70,6 +70,8 @@
     (keyword? color) (colors color)
     (string? color)  (colors (keyword color))
     :else            color))
+
+(def degrees-to-radians (/ Math/PI 180))

 (defn set-g2d-state [g2d {:keys [alpha color stroke rotate x y scale]}]
   (doto g2d
@@ -92,7 +94,7 @@
     (when (and x y (or rotate scale))
       (doto g2d
         (.translate x y)
-        (.rotate (or rotate 0.0))
+        (.rotate (* degrees-to-radians (or rotate 0.0)))
         (.scale (or scale 1.0) (or scale 1.0))
         (.translate (- x) (- y)))))


WIP: resize plots.

WIP: resize plots.

--- metlog-vault/src-client/metlog_client/metlog.cljs
+++ metlog-vault/src-client/metlog_client/metlog.cljs
@@ -9,7 +9,9 @@

 (defonce query-window-secs (atom (* 3600 24)))

-(def dashboard-state (atom {:series []  :text ""}))
+(def dashboard-state (atom {:series [] :text ""}))
+
+(def window-width (atom 1024))

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

-(defn tsplot-fetch-and-draw [ canvas series-name ]
+(defn tsplot-fetch-and-draw [ canvas series-name width ]
   (let [ ctx (.getContext canvas "2d")]
     (go
-      (tsplot/draw ctx 1024 180 [])
-      (tsplot/draw ctx 1024 180 (<! (<<< fetch-series-data
+      (tsplot/draw ctx width 180 [])
+#_      (tsplot/draw ctx width 180 (<! (<<< fetch-series-data
                                          series-name
                                          @query-window-secs))))))

-(defn series-tsplot [ series ]
+(defn dom-width [ node ]
+  (if node
+    (.-clientWidth node)
+    1024))
+
+(defn series-tsplot [ series initial-width ]
+  (watch [:series-tsplot series initial-width ])
   (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)))
+        (watch [:update (dom-width (reagent/dom-node this))])
+        (tsplot-fetch-and-draw (reagent/dom-node this) (:name series) initial-width))

       :component-did-mount
       (fn [ this ]
-        (watch :component-did-mount)
-        (tsplot-fetch-and-draw (reagent/dom-node this) (:name series)))
+        (watch [:mount (dom-width (reagent/dom-node this))])
+        (tsplot-fetch-and-draw (reagent/dom-node this) (:name series) initial-width))
+
+      :reagent-render
+      (fn [ width ]
+        (watch [:tsplot-render width :args args])
+        @query-window-secs
+        @series-state
+                @window-width
+        [:canvas { :width width :height 180}])})))
+
+(defn series-pane [ series ]
+  (let [ pane-state (atom {})]
+    (reagent/create-class
+
+     {:component-did-mount
+      (fn [ this ]
+        (swap! pane-state assoc :dom-node (reagent/dom-node this)))

       :reagent-render
       (fn []
-        @query-window-secs
-        @series-state
-        [:canvas { :width 1024 :height 180}])})))
-
-(defn series-pane [ series ]
-  (watch :render-series-pane)
-  [:div.series-pane
-   [:div.series-pane-header
-    [:span.series-name (:name series)]]
-   [series-tsplot series]])
+        (watch :series-pane-reagent-render (dom-width (:dom-node @pane-state)))
+        @window-width
+        [:div.series-pane
+         [:div.series-pane-header
+          [:span.series-name (:name series)]]
+         [series-tsplot series (dom-width (:dom-node @pane-state))]])})))

 (defn series-list [ ]
   [:div
@@ -80,7 +100,6 @@

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

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

 (defn header [ ]
-  (watch :render-header)
   [:div.header
    [:span.left
     "Metlog"
     [input-field #(end-edit % dashboard-state)]]])

 (defn dashboard [ ]
-  (watch :render-dashboard)
   [:div
    [header]
    [:div.content
     [series-list]]])

+
+(defn on-window-resize [ evt ]
+  (reset! window-width (.-innerWidth js/window)))
+
 (defn ^:export run []
   (reagent/render [dashboard]
                   (js/document.getElementById "metlog"))
+  (.addEventListener js/window "resize" on-window-resize)
+  (on-window-resize nil)
   (go
     (swap! dashboard-state assoc :series
            (vec (map (fn [ series-name ] {:name series-name})


Start working on restoring the client's operation.

--- metlog-vault/src-client/metlog_client/metlog.cljs
+++ metlog-vault/src-client/metlog_client/metlog.cljs
@@ -43,8 +43,7 @@
 (defn tsplot-fetch-and-draw [ canvas series-name width ]
   (let [ ctx (.getContext canvas "2d")]
     (go
-      (tsplot/draw ctx width 180 [])
-#_      (tsplot/draw ctx width 180 (<! (<<< fetch-series-data
+      (tsplot/draw ctx width 180 (<! (<<< fetch-series-data
                                          series-name
                                          @query-window-secs))))))

@@ -54,27 +53,23 @@
     1024))

 (defn series-tsplot [ series initial-width ]
-  (watch [:series-tsplot series initial-width ])
   (let [ series-state (atom { :series-name (:name series)} ) ]
     (reagent/create-class
      {:display-name (str "series-tsplot-" (:name series))
       :component-did-update
       (fn [ this ]
-        (watch [:update (dom-width (reagent/dom-node this))])
         (tsplot-fetch-and-draw (reagent/dom-node this) (:name series) initial-width))

       :component-did-mount
       (fn [ this ]
-        (watch [:mount (dom-width (reagent/dom-node this))])
         (tsplot-fetch-and-draw (reagent/dom-node this) (:name series) initial-width))

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

 (defn series-pane [ series ]
   (let [ pane-state (atom {})]


Amend Statistical Geography ontology

Amend Statistical Geography ontology

--- src/ontologies/grafter/rdf/ontologies/ons_geography.clj
+++ src/ontologies/grafter/rdf/ontologies/ons_geography.clj
@@ -21,8 +21,9 @@
 (def statistical-entity:theme                (statistical-entity "theme"))

 (def statistical-geography (prefixer "http://statistics.data.gov.uk/def/statistical-geography#"))
-(def statistical-geography:officialname      (statistical-entity "officialname"))
-(def statistical-geography:status            (statistical-entity "status"))
+(def statistical-geography:officialname      (statistical-geography "officialname"))
+(def statistical-geography:status            (statistical-geography "status"))
+(def statistical-geography:parentcode        (statistical-geography "parentcode"))

 (def boundary-change (prefixer "http://statistics.data.gov.uk/def/boundary-change/"))
 (def boundary-change:operativedate           (boundary-change "operativedate"))


WTF weird typo I have no idea I never even touched this

--- desktop/src-common/escape_game/core.clj
+++ desktop/src-common/escape_game/core.clj
@@ -40,7 +40,7 @@
                               :x (:x (:selected screen))
                               :y (- (:y (:selected screen)) 3)
                               :width 47 :height 58)]))
-    entities)       ; WATCH: must return onuly the entities list! (or NIL?)
+    entities)       ; WATCH: must return only the entities list! (or NIL?)

   :on-resize
   (fn [screen entities]


another test that is not consistent on ibm java 6

--- dada-core/src/test/clojure/org/dada/core/test_clojure.clj
+++ dada-core/src/test/clojure/org/dada/core/test_clojure.clj
@@ -76,10 +76,11 @@
     (is (faster 1000000000 (.v r) (aget a 0)))))

 ;; but accessing a record field still appears to be 10 times faster than an array - is the int being boxed on the way out ?
-(deftest record-vs-int-array-access
-  (let [^Value r (Value. 0)
-	^ints a (int-array [0])]
-    (is (faster 1000000000 (.v r) (aget a 0)))))
+(if (not (ibm?))
+  (deftest record-vs-int-array-access
+    (let [^Value r (Value. 0)
+	  ^ints a (int-array [0])]
+      (is (faster 1000000000 (.v r) (aget a 0))))))

 ;; no it's not autoboxing slowing down the int-array test - array access is slower than record access - by a factor of 10
 (deftest record-vs-object-array-access
@@ -108,4 +109,101 @@
     (let [f (Foo. 1)
 	  b (Bar. 1)]
       (is (faster 1000000000 (identity (.a b))  (identity (.a f)))))))
-  +
+(import 'java.util.concurrent.locks.ReadWriteLock)
+(import 'java.util.concurrent.locks.ReentrantReadWriteLock)
+(import 'java.util.concurrent.locks.Lock)
+(import 'java.util.Map)
+(import 'java.util.HashMap)
+
+;; (deftest rw-mutable-vs-immutable
+;;   (let [lock ^ReadWriteLock (ReentrantReadWriteLock.)
+;; 	wr (.writeLock lock)
+;; 	m ^Map (HashMap.)
+;; 	a (atom {})
+;; 	n 10000000]
+;;     (is (faster 1
+;; 		(dotimes [i n] (try (.lock wr) (.put m i i) (catch Exception e)(finally (.unlock wr))))
+;; 		(dotimes [i n] (swap! a conj [i i]))
+;; 		))))
+
+;; atom 4 times faster on J6/C1.3a4
+(deftest atom-vs-ref
+  (let [a (atom 0)
+	r (ref 0)]
+    (dosync
+     (is (faster 10000000
+		 (swap! a inc)
+		 (alter r inc))))))
+
+;; [with two cores] pmap is about 50x slower than map - i.e. the
+;; overhead of dispatching and collating each thread means that you
+;; need to do a significant amount of work on it before it will pay
+;; off....
+(deftest map-vs-pmap
+  (let [data (doall (range 1000000))]
+    (is (faster
+	 1
+	 (doall (map identity data))
+	 (doall (pmap identity data))))))
+
+;; (import 'java.util.concurrent.Executors)
+;; (import 'java.util.concurrent.ExecutorService)
+;; (import 'java.util.concurrent.CountDownLatch)
+;; (import 'java.util.concurrent.ConcurrentLinkedQueue)
+;; (import 'java.util.Queue)
+
+
+;; (def ^ExecutorService pool (Executors/newFixedThreadPool 2))
+
+;; (defn jmap [f & seqs]
+;;   (let [n (atom 0)
+;; 	^CountDownLatch latch (CountDownLatch. 1)
+;; 	^Queue results (ConcurrentLinkedQueue.)]
+;;     (dorun
+;;      (apply
+;;       map
+;;       (fn [& elts]
+;; 	  (swap! n inc)
+;; 	  (.execute
+;; 	   pool
+;; 	   (fn []
+;; 		(.add results (apply f elts))
+;; 		(if (= 0 (swap! n dec)) (.countDown latch))
+;; 		)))
+;;       seqs))
+;;     (.await latch)
+;;     results))
+
+;; ;;(let [data (doall (range 1000000))] (millis 1 (doall (jmap identity data))))
+
+
+
+;; (deftest map-vs-pmap
+;;   (let [data (doall (range 1000000))]
+;;     (is (faster
+;; 	 1
+;; 	 (doall (map identity data))
+;; 	 (doall (pmap identity data))))))
+
+
+;; ;; (deftest transient-vs-persistemt
+;; ;;   (let [times 1000000]
+;; ;;     (is (faster
+;; ;; 	 1
+;; ;; 	 (persistent! (reduce (fn [r i] (conj! r i)) (transient []) (range times)))
+;; ;; 	 (reduce (fn [r i] (conj r i)) [] (range times))))))
+
+;; ;; (deftest transient-vector-vs-ArrayList
+;; ;;   (let [times 1000000]
+;; ;;     (is (faster
+;; ;; 	 1
+;; ;; 	 (reduce (fn [^java.util.List r i] (doto r (.add i))) (java.util.ArrayList.) (range times))
+;; ;; 	 (persistent! (reduce (fn [r i] (conj! r i)) (transient []) (range times)))))))
+
+;; (deftest transient-map-vs-HashMap
+;;   (let [times 1000000]
+;;     (is (faster
+;; 	 1
+;; 	 (reduce (fn [^java.util.Map r i] (doto r (.put i i))) (java.util.HashMap.) (range times))
+;; 	 (persistent! (reduce (fn [r i] (conj! r [i i])) (transient {}) (range times)))))))


core: filter

core: filter

--- data/core.clj
+++ data/core.clj
@@ -1372,3 +1372,15 @@
   {:added "1.0"}
   [f & colls]
   (apply concat (apply map f colls)))
+
+(defn filter
+  "Returns a lazy sequence of the items in coll for which
+  (pred item) returns true. pred must be free of side-effects."
+  {:added "1.0"}
+  ([pred coll]
+   (lazy-seq
+    (when-let [s (seq coll)]
+      (let [f (first s) r (rest s)]
+        (if (pred f)
+          (cons f (filter pred r))
+          (filter pred r)))))))


Accessibility to block button

Accessibility to block button

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

--- src/status_im/ui/screens/profile/components/sheets.cljs
+++ src/status_im/ui/screens/profile/components/sheets.cljs
@@ -15,6 +15,7 @@
       (i18n/label :t/block-contact-details)]
      [react/view {:align-items :center :margin-top 16}
       [quo/button {:theme :negative :disabled @in-progress? :loading @in-progress?
+                   :accessibility-label :block-contact-confirm
                    :on-press #(do (reset! in-progress? true)
                                   (re-frame/dispatch [:contact.ui/block-contact-confirmed public-key]))}
        :t/block]


Fix last commit - let used incorrectly

Fix last commit - let used incorrectly

--- resources/leiningen/new/onyx_app/sample_job_test.clj
+++ resources/leiningen/new/onyx_app/sample_job_test.clj
@@ -37,7 +37,7 @@
           ;; Automatically grab output from the stubbed core.async channels,
           ;; returning a vector of the results with data structures representing
           ;; the output.
-          (let [(:write-lines (sl/collect-outputs! dev-lifecycles [:write-lines]))]
+          (let [results (:write-lines (sl/collect-outputs! dev-lifecycles [:write-lines]))]
             (is (= 16 (count results))))))
       (finally
         (component/stop dev-env)))))


Resource tag should be plural (#1229)

Resource tag should be plural (#1229)

* Resource tag should be plural

* correct alias

--- ssclj/jar/src/com/sixsq/slipstream/ssclj/resources/metering.clj
+++ ssclj/jar/src/com/sixsq/slipstream/ssclj/resources/metering.clj
@@ -11,11 +11,12 @@
     [com.sixsq.slipstream.db.impl :as db]
     [ring.util.response :as r]
     [clojure.tools.logging :as log]
-    [com.sixsq.slipstream.ssclj.util.log :as logu]))
-
-(def ^:const resource-tag :metering)
+    [com.sixsq.slipstream.ssclj.util.log :as logu]
+    [superstring.core :as str]))

 (def ^:const resource-name "Metering")
+
+(def ^:const resource-tag (keyword (str (str/camel-case resource-name) "s")))

 (def ^:const resource-url (u/de-camelcase resource-name))


[#3036] Support additional transformations for data groups

* We add support for additional transformations under data groups that manipulate a single column that contains text

    Co-authored-by: Juan A. Ruz <juanantonioruz@gmail.com>
    Co-authored-by: Iván Perdomo <ivan@perdomo.me>

--- backend/src/akvo/lumen/lib/transformation/engine.clj
+++ backend/src/akvo/lumen/lib/transformation/engine.clj
@@ -218,7 +218,11 @@
 (defn execute-transformation
   [{:keys [tenant-conn] :as deps} dataset-id job-execution-id transformation]
   (if (and (get (env/all tenant-conn) "data-groups")
-           (= "core/to-uppercase" (get transformation "op")))
+           (contains? #{"core/to-lowercase"
+                        "core/to-titlecase"
+                        "core/to-uppercase"
+                        "core/trim"
+                        "core/trim-doublespace"} (get transformation "op")))
     (execute-transformation-2 deps dataset-id job-execution-id transformation)
     (execute-transformation-1 deps dataset-id job-execution-id transformation)))


Time should always be in 24hr clock.

Time should always be in 24hr clock.

Fixes #410

--- src-cljs/kixi/hecuba/widgets/chart.cljs
+++ src-cljs/kixi/hecuba/widgets/chart.cljs
@@ -133,7 +133,7 @@
                      (.multi (to-array
                               [(to-array [".%L" (fn [d] (.getMilliseconds d))])
                                (to-array [":%S" (fn [d] (.getSeconds d))])
-                               (to-array ["%I:%M" (fn [d] (.getMinutes d))])
+                               (to-array ["%H:%M" (fn [d] (.getMinutes d))])
                                (to-array ["%H:00" (fn [d] (.getHours d))])
                                (to-array ["%a %d %b" (fn [d] (and (.getDay d)
                                                                (not= 1 (.getDate d))))])