session timeout

session timeout

--- src/co/nclk/flax/node.clj
+++ src/co/nclk/flax/node.clj
@@ -152,12 +152,18 @@
                                              (:runid checkpoint)
                                              (clojure.string/trim (:display checkpoint)))))

-                           (ssh/with-connection session
+                           (try
+
+                             (when-not (ssh/connected? session)
+                               (ssh/connect session
+                                            (or (-> @node :options :timeout) (* 60 1000))))
+
                              (when *log*
                                (log :debug (node-log-str (:short-name @node)
                                                          (:public_ip @node)
                                                          (:runid checkpoint)
                                                          (clojure.string/trim (:source checkpoint)))))
+
                              (let [result (ssh/ssh session {:cmd (str "sudo su " (or (:user checkpoint) "root") " - ")
                                                             :in (:source checkpoint)})]
                                (when *log*
@@ -174,7 +180,8 @@
                                                        :value (:err result)}
                                                  :exit {:keys (:exit checkpoint)
                                                         :value (:exit result)}))
-                               ))
+
+                             (finally (ssh/disconnect session))))
                          (catch Exception se
                            (log :error
                              (node-log-str (:short-name @node)


optimize icons

optimize icons

--- src-cljs/frontend/components/common.cljs
+++ src-cljs/frontend/components/common.cljs
@@ -158,14 +158,16 @@

 (defn svg-icon [icon-name & [{:keys [path-props svg-props]}]]
   (let [template (get icon-templates icon-name)]
-    [:svg (merge {:viewBox "0 0 100 100" :class "iconpile"} svg-props)
-     (for [path (:paths template)]
-       [:path (merge {:class (name path) :d (get icon-paths path) :key (name path)} path-props)])]))
+    (html
+     [:svg (merge {:viewBox "0 0 100 100" :class "iconpile"} svg-props)
+      (for [path (:paths template)]
+        (html [:path (merge {:class (name path) :d (get icon-paths path) :key (name path)} path-props)]))])))

 (defn icon [icon-name & [{:keys [path-props svg-props]}]]
-  [:i {:class (str "icon-" (name icon-name))}
-   (svg-icon icon-name {:path-props path-props
-                        :svg-props svg-props})])
+  (html
+   [:i {:class (str "icon-" (name icon-name))}
+    (svg-icon icon-name {:path-props path-props
+                         :svg-props svg-props})]))

 (def spinner
   (icon :logomark-precursor))


reset comment form height

reset comment form height

--- src-cljs/frontend/components/issues.cljs
+++ src-cljs/frontend/components/issues.cljs
@@ -117,7 +117,8 @@
                                                                                :frontend/issue-id (utils/squuid)}
                                                                                (when parent-id
                                                                                {:comment/parent parent-id}))}])
-                                                (om/set-state! owner :comment-body ""))
+                                                (om/set-state! owner :comment-body "")
+                                                (om/set-state! owner :input-height 64))
                                               (when (fn? close-callback)
                                                 (close-callback)))}
           [:div.adaptive


SC Book pp28-34

SC Book pp28-34

--- src/overtone_workspace/sc-one.clj
+++ src/overtone_workspace/sc-one.clj
@@ -701,7 +701,9 @@
   ;; .playは後で
   (defsynth choos [] (out gate-b (pan2 (play-buf 1 chooston :loop 1) -0.5))))

-(hous [:tail pb-group]) ;.play(~pbGroup)
+;; .play(~pbGroup)
+(hous [:tail pb-group])
+(stop)
 ;; hous -> gate-b -> out 0
 ;; hous -> gate-syn
 ;; hous -> gate-b -> mod-b -> delay-b -> out 0
@@ -709,7 +711,8 @@
 ;; hous -> pb-group -> c-syn -> d-syn <- m-syn <- g-syn
 ;; hous -> group -> control-syn -> delay-syn <- mod-syn <- gate-syn

-(choos [:tail pb-group])  ;.play(~pbGroup)
+;.play(~pbGroup)
+(choos [:tail pb-group])

 (stop)

@@ -754,7 +757,9 @@

   (future
     (loop []
-      (let [density 1
+      (let [density 1.0  ; 100% of the time. Uncomment below for 70%, etc.
+            ;;density 0.7
+            ;;density 0.3
             midi (choose [0 2 4 7 9])
             oct (choose [48 60 72])]
         (if (weighted-coin density)
@@ -772,6 +777,11 @@

 ;; to stop
 (reset! cont false)
+
+(odoc choose)
+(odoc choose-n)
+(odoc weighted-coin)
+(odoc nth)

 ;; Page 36


Think I figured out test failures.

Think I figured out test failures.

--- src/cortex/nn/execute.clj
+++ src/cortex/nn/execute.clj
@@ -46,7 +46,7 @@
                           {:error e}))
           (do
             (println "CUDA backend creation failed, reverting to CPU")
-            (cpu/backend datatype)))))))
+            (cpu/backend :datatype datatype)))))))

 (defn compute-context


Add a test to affirm [IMMUTANT-342]

Add a test to affirm [IMMUTANT-342]

--- modules/cache/src/test/clojure/test/immutant/cache.clj
+++ modules/cache/src/test/clojure/test/immutant/cache.clj
@@ -196,6 +196,16 @@
      (io/delete-file "Infinispan-FileCacheStore/mike")
      (io/delete-file "Infinispan-FileCacheStore"))))

+(deftest test-persist-file-store-with-parents
+  (let [dir (io/file "target/gin/tonic")]
+    (try
+      (create "chas" :persist (str dir))
+      (is (.exists dir))
+      (finally
+        (io/delete-file (io/file dir "chas"))
+        (io/delete-file dir)
+        (io/delete-file (.getParent dir))))))
+
 (deftest test-create-restarts
   (let [c (create "terrence")]
     (put c :a 1)


Don't need to bind *compile-path* in compile.

--- src/leiningen/compile.clj
+++ src/leiningen/compile.clj
@@ -7,11 +7,8 @@
   "Compile the namespaces specified in build.clj or all namespaces in src/
   if none are provided."
   [project]
-  ;; TODO: not sure why this is necessary
-  (binding [*compile-path* "classes/"]
-    (.mkdir (file (:root project) "classes"))
-    (doseq [n (or (:namespaces project)
-                  (find-namespaces-in-dir (file (:root project) "src")))]
-      (println "Compiling" n)
-      ;; TODO: check to see if bytecode is older than source
-      (clojure.core/compile n))))
+  (doseq [n (or (:namespaces project)
+                (find-namespaces-in-dir (file (:root project) "src")))]
+    (println "Compiling" n)
+    ;; TODO: check to see if bytecode is older than source
+    (clojure.core/compile n)))


Fixed broken action button style on iOS

Fixed broken action button style on iOS

--- src/status_im/components/button/styles.cljs
+++ src/status_im/components/button/styles.cljs
@@ -51,8 +51,11 @@
                          (when disabled? {:opacity 0.6}))})

 (defstyle button-borders
-  {:android           {:border-radius 4}
-   :ios               {:border-radius 8}})
+  {:android {:border-radius 4}
+   :ios     {:border-radius 8
+             ;; Border radius is ignored with transparent background unless overflow "hidden" is used
+             ;; See https://github.com/facebook/react-native/issues/13760
+             :overflow      :hidden}})

 (def primary-button
   (merge


CMR-1383 Adds test to update provider without authorization.

--- system-int-test/test/cmr/system_int_test/ingest/provider_ingest_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/provider_ingest_test.clj
@@ -31,6 +31,13 @@
            (ingest/get-ingest-providers))))
   (testing "updating a non-existent provider fails"
     (is (= 404 (:status (ingest/update-ingest-provider "PROV5" true))))))
+
+(deftest update-provider-without-permission-test
+  (let [response (client/put (url/ingest-provider-url "PROV1")
+                             {:throw-exceptions false
+                              :connection-manager (s/conn-mgr)
+                              :query-params {:token "dummy-token"}})]
+    (is (= 401 (:status response)))))

 (deftest delete-provider-test
   (let [coll1 (d/ingest "PROV1" (dc/collection))


Update docs

Update docs

--- test/compound/docs.cljc
+++ test/compound/docs.cljc
@@ -361,6 +361,8 @@

 "We want to index our fruit by an SKU, which is a string composite of the first letter of the category (capitalized) and the id padded with 3 zeroes (not really, but just imagine)"

+"To do this, first implement the `compound.custom-key/custom-key-fn` multimethod to tell compound how to form the key from the item."
+
 (require '[compound.custom-key :as cu])
 (require '[clojure.string :as string])

@@ -368,6 +370,8 @@
   [_ item]
   (let [{:keys [category id]} item]
     (str (string/upper-case (first category)) (format "%03d" id))))
+
+"And then reference it in the index definition, using `:custom-key`"

 (fact
   (-> (c/compound {:primary-index-def {:custom-key :sku


message memo queue for getting new messages in channel reinitializations

--- src/ontrail/websocket.clj
+++ src/ontrail/websocket.clj
@@ -13,8 +13,18 @@

 (def #^{:private true} logger (org.slf4j.LoggerFactory/getLogger (str *ns*)))

+(def message-buffer-size 30)
+
+(def message-ring (atom (clojure.lang.PersistentQueue/EMPTY)))
+
 (defn message-init [ch]
-  (lamina/receive-all ch #(.info logger (str "chat message: " (json/read-str %)))))
+  (lamina/receive-all
+   ch
+   (fn [message]
+     (.info logger (str "chat message: " message))
+     (swap! message-ring conj message)
+     (if (> (count @message-ring) message-buffer-size)
+       (swap! message-ring pop)))))

 (def message-channel (lamina/named-channel "messages" message-init))

@@ -27,11 +37,21 @@
                                       :message (formats/to-human-comment-date (local/local-now))})))
    3600)) ;; seconds

+(defn process-user-message [user json]
+  (try
+    (let [as-json (json/read-str json)]
+      (json/write-str (merge as-json {:user user})))
+    (catch Exception e
+      (.error logger (str e ":" json ":"))
+      nil)))
+
 (defn message-handler [user ch]
-  (let [user-channel (lamina/map* (fn [json]
-                                    (let [value (json/read-str json)]
-                                      (json/write-str (merge value {:user user}))))
-                                  ch)]
+  (let [user-channel (lamina/filter*
+                      identity
+                      (lamina/map*
+                       (partial process-user-message user)
+                       ch))]
+    (mapv (partial lamina/enqueue ch) @message-ring)
     (lamina/siphon user-channel message-channel)
     (lamina/siphon message-channel ch)))


defend an atom with defonce

defend an atom with defonce

--- src/overtone/gui/info.clj
+++ src/overtone/gui/info.clj
@@ -6,7 +6,7 @@

 (native!)

-(def ^{:private true} update-timer (atom nil))
+(defonce ^{:private true} update-timer (atom nil))

 (def ^{:private true} divider-color "#aaaaaa")
 (def ^{:private true} normal-font   "ARIAL-12-PLAIN")
@@ -133,4 +133,3 @@
                      :south (label :id :status :text "Ready")))
       (add-behaviors)
       (show!))))
-


Add missing :use clause

Add missing :use clause

--- src/overtone/sc/mixer.clj
+++ src/overtone/sc/mixer.clj
@@ -5,7 +5,8 @@
   (:use [overtone.libs deps event]
         [overtone.helpers file]
         [overtone.sc synth ugens server info node buffer]
-        [overtone.sc.machinery defaults]))
+        [overtone.sc.machinery defaults]
+        [overtone.sc.machinery.server comms]))

 (defonce master-vol*  (ref MASTER-VOL))
 (defonce master-gain* (ref MASTER-GAIN))


narrow down deref! exception to a TimeOutException

--- src/overtone/util/lib.clj
+++ src/overtone/util/lib.clj
@@ -258,7 +258,7 @@
      (let [timeout-indicator (gensym "deref-timeout")
            res               (deref ref timeout timeout-indicator)]
        (if (= timeout-indicator res)
-         (throw (Exception. (str "deref! timeout error. Dereference took longer than " timeout " ms")))
+         (throw (TimeoutException. (str "deref! timeout error. Dereference took longer than " timeout " ms")))
          res))))

 (defn stringify-map-vals


put entire project.clj in loader-info

put entire project.clj in loader-info

--- src/tailrecursion/boot/loader.clj
+++ src/tailrecursion/boot/loader.clj
@@ -19,11 +19,8 @@
 (defn info
   "Returns a map of version information for tailrecursion.boot.loader"
   []
-  (let [[_ proj vers & kvs] (guard (read-string (slurp (io/resource "project.clj"))))
-        {:keys [description url license]} (->> (partition 2 kvs)
-                                               (map (partial apply vector))
-                                               (into {}))]
-    {:proj proj :vers vers :description description :url url :license license}))
+  (let [[_ & kvs] (guard (read-string (slurp (io/resource "project.clj"))))]
+    (->> kvs (partition 2) (map (partial apply vector)) (into {}))))

 (defn index-of [v val]
   (ffirst (filter (comp #{val} second) (map vector (range) v))))


Add `return` & args variant

Add `return` & args variant

--- src/taoensso/carmine/protocol.clj
+++ src/taoensso/carmine/protocol.clj
@@ -238,16 +238,17 @@
   `(parse (with-meta identity {:thaw-opts ~thaw-opts}) ~@body))

 (defn return
-  "Takes value and returns it unchanged as part of next reply from Redis server.
+  "Takes values and returns them as part of next reply from Redis server.
   Unlike `echo`, does not actually send any data to Redis."
-  [value]
-  (swap! (:req-queue *context*)
-    (fn [[_ q]]
-      [nil (conj q (with-meta [] ; Dummy request
-                     {:parser (parser-comp *parser* ; Nb keep context's parser
-                                (with-meta identity {:dummy-reply value}))
-                      :expected-keyslot nil ; Irrelevant
-                      }))])))
+  ([value & more] (doseq [value (cons value more)] (return value)))
+  ([value]
+   (swap! (:req-queue *context*)
+     (fn [[_ q]]
+       [nil (conj q (with-meta [] ; Dummy request
+                      {:parser (parser-comp *parser* ; Nb keep context's parser
+                                 (with-meta identity {:dummy-reply value}))
+                       :expected-keyslot nil ; Irrelevant
+                       }))]))))

 ;;;; Requests


Use seq when you mean "not empty" instead of seq?

--- src/mdr2/views.clj
+++ src/mdr2/views.clj
@@ -73,7 +73,7 @@
     (layout/common user
      [:h1 "Upload"]
      [:p (str "Upload structure for " (:title p))]
-     (when (seq? errors)
+     (when (seq errors)
        [:p [:ul.alert.alert-danger (for [e errors] [:li e])]])
      (form/form-to
       {:enctype "multipart/form-data"}
@@ -146,7 +146,7 @@
   (let [user (friend/current-authentication request)]
     (layout/common user
      [:h1 "Upload new productions from Vubis XML"]
-     (when (seq? errors)
+     (when (seq errors)
        [:p [:ul.alert.alert-danger (for [e errors] [:li e])]])
      (form/form-to
       {:enctype "multipart/form-data"}


formatting

formatting

--- src/clj/backtype/storm/daemon/nimbus.clj
+++ src/clj/backtype/storm/daemon/nimbus.clj
@@ -1164,4 +1164,3 @@

 (defn -main []
   (-launch (standalone-nimbus)))
-


working on router

working on router

--- src/cljc/ow/starbuck/message_router.cljc
+++ src/cljc/ow/starbuck/message_router.cljc
@@ -69,7 +69,7 @@
            :evmsgs []}
           eventhandlers))

-(defn advance [ruleset msg]
+(defn advance [{:keys [ruleset] :as router} msg]
   "Takes a message, runs it against ruleset and returns a sequence of routed messages."
   (debug "routing starting with" (printable-msg msg))
   (if (< (::transition-count msg) 100)
@@ -89,6 +89,12 @@
       resmsgs)
     (do (warn "dropping message due to high transition-count")
         [])))
+
+(defn make-router [unit ruleset & {:keys [dispatch?]
+                                   :or {dispatch? true}}]
+  {:unit unit
+   :ruleset ruleset
+   :dispatch? dispatch?})

 #_(defrecord MessageRouter [ruleset]

@@ -132,14 +138,15 @@

 (comment

-  (def ruleset2
-    {:routes
-     {:book-flight
-      {:transitions {:auth-checker :overbooked-checker-remote}}}})
+  (def ruleset1
+    {:units
+     {:browser
+      #{:overbooked-checker :booker}
+      :server
+      #{:auth-checker}}

-  (def ruleset1
-    ;;; you can have many routes
-    {:routes
+     ;;; you can have many routes
+     :routes

      ;;; defining a route :book-flight
      {:book-flight
@@ -155,9 +162,6 @@
                      :booker {:transform (fn [msg] (assoc msg :checked true))
                               :next [:invoice-generator (fn [msg] :notifier)]}}}}})

-  (def dispatchset1
-    {})
-
   #_(def router1 (message-router ruleset1))

   (->> (message :book-flight {:foo :bar})


nil? accepts JavaScript undefined

nil? accepts JavaScript undefined

--- test/is/predicates.cljs
+++ test/is/predicates.cljs
@@ -2,6 +2,7 @@
 (println "Predicates tests")

 (is (= (nil? nil) true))
+(is (= (nil? js/undefined) true))
 (is (= (nil? false) false))
 (is (= (nil? true) false))
 (is (= (nil? 42) false))


CMR-4296: Updated preview gem to commit 0211841.

--- collection-renderer-lib/project.clj
+++ collection-renderer-lib/project.clj
@@ -14,7 +14,7 @@
    the hardcoded commit id during dev integration with cmr_metadata_preview project.
    The hardcoded commit id should be updated when MMT releases a new version of the gem."
   (or (System/getenv "CMR_METADATA_PREVIEW_COMMIT")
-      "2c39580"))
+      "0211841"))

 (def gem-install-path
   "The directory within this library where Ruby gems are installed."


fix ignore-build-channel?

fix ignore-build-channel?

--- frontend/controllers/ws.cljs
+++ frontend/controllers/ws.cljs
@@ -40,8 +40,9 @@
   "Returns true if we should ignore pusher updates for the given channel-name. This will be
   true if the channel is stale or if the build hasn't finished loading."
   [state channel-name]
-  (and (get-in state state/build-path)
-       (not= channel-name (pusher/build-channel (get-in state state/build-path)))))
+  (if-let [build (get-in state state/build-path)]
+    (not= channel-name (pusher/build-channel build))
+    true))

 (defn usage-queue-build-index-from-channel-name [state channel-name]
   "Returns index if there is a usage-queued build showing with the given channel name"


fix directMultiGet to return bytebuffer wrapped keys

--- elephantdb-server/src/clj/elephantdb/keyval/core.clj
+++ elephantdb-server/src/clj/elephantdb/keyval/core.clj
@@ -119,8 +119,8 @@
 (defn direct-multiget [database domain-name key-seq]
   (let [domain (db/domain-get database domain-name)]
     (when (loaded? domain)
-      (into {} (for [key key-seq]
-                    {key (thrift/mk-value (dom/kv-get domain key))})))))
+      (into {} (map (fn [key]
+                      {(ByteBuffer/wrap key) (thrift/mk-value (dom/kv-get domain key))}) key-seq)))))

 ;; ## MultiGet

@@ -139,7 +139,7 @@
                                          (deliver p (get-fn host indexed-keys)))) hosts)
                           p))
                       host-map)]
-        (update-keys (apply into {} (map deref promises)) #(ByteBuffer/wrap %))))))
+        (into {} (map deref promises))))))

 (defn kv-get-fn
   [service domain-name database]
@@ -178,7 +178,7 @@
       (let [get-fn (kv-get-fn this domain-name database)
             ret (byte-array (.remaining key))]
         (.get key ret)
-        (first (multi-get get-fn database domain-name [ret]))))
+        (clojure.core/get (multi-get get-fn database domain-name [ret]) key)))

     (getDomainStatus [_ domain-name]
       "Returns the thrift status of the supplied domain-name."


fix tests

fix tests

--- src/proto_facade/core.clj
+++ src/proto_facade/core.clj
@@ -30,7 +30,7 @@
     (instance? MessageOrBuilder obj)
     (convert-to-map obj)
     (instance? java.util.Collection obj)
-    (map resolve-value obj)
+    (map #(resolve-value % convert-f) obj)
     (instance? ByteString obj)
     (if (nil? obj)
       nil


Allow sys prop override for message cluster channel/stack [IMMUTANT-284]

Not sure if udp or tcp is the better default.

--- support/build-support/src/main/clojure/immutant/build/tools.clj
+++ support/build-support/src/main/clojure/immutant/build/tools.clj
@@ -326,8 +326,8 @@

 (defn insert-jgroups-config [loc]
   (-> loc
-      (zip/insert-child {:tag :jgroups-channel :content ["hq-cluster"]})
-      (zip/insert-child {:tag :jgroups-stack :content ["udp"]})))
+      (zip/insert-child {:tag :jgroups-channel :content ["${msg.jgroups.channel:hq-cluster}"]})
+      (zip/insert-child {:tag :jgroups-stack :content ["${msg.jgroups.stack:udp}"]})))

 (defn replace-socket-with-jgroups [loc]
   (if-let [socket-binding (zfx/xml1-> loc :socket-binding)]


Updated version reading

Updated version reading

--- kuona-api/src/kuona_api/handler.clj
+++ kuona-api/src/kuona_api/handler.clj
@@ -1,6 +1,7 @@
 (ns kuona-api.handler
   (:require [cheshire.core :refer :all]
             [clojure.tools.logging :as log]
+            [clojure.java.io :as io]
             [clj-http.client :as http]
             [compojure.core :refer :all]
             [compojure.handler :as handler]
@@ -12,8 +13,8 @@
             [ring.middleware.defaults :refer [wrap-defaults api-defaults]]
             [ring.middleware.json :as middleware]
             [ring.util.response :refer [resource-response response status]])
+  (:import java.util.Properties)
   (:gen-class))
-

 (defn service-data
   []
@@ -197,10 +198,21 @@
   [id]
   (response (value-stream)))

+
+(defn get-version [dep]
+  (let [path (str "META-INF/maven/" (or (namespace dep) (name dep))
+                  "/" (name dep) "/pom.properties")
+        props (io/resource path)]
+    (when props
+      (with-open [stream (io/input-stream props)]
+        (let [props (doto (Properties.) (.load stream))]
+          (.getProperty props "version"))))))
+
 (defn get-api-info
   []
   (let [es (util/parse-json-body (http/get "http://localhost:9200"))]
-    (response {:kuona_api      {:version (System/getProperty "kuona-api.version")}
+    (response {:kuona_api      {:version (get-version 'kuona-api)}
+               :clojure        {:version (get-version 'org.clojure/clojure)}
                :elastic_search es})))

 (defroutes app-routes


Test ContentSource options

Test ContentSource options

--- test/uruk/core_test.clj
+++ test/uruk/core_test.clj
@@ -459,8 +459,6 @@
 ;;                                                            "rest-admin" "x" "TutorialDB")
 ;;                                    {})))

-
-
 (deftest content-src-options
   (testing "Content Source preemptive-authentication settings"
     (is (true? (.isAuthenticationPreemptive (make-uri-content-source "xdbc://localhost:8383/"
@@ -474,17 +472,13 @@
     ;; TODO with make-cp-content-source, once we want to delve into
     ;; the extreme complexity of ConnectionProvider
     )
-  ;; (testing "Content Source default Logger settings"
-  ;;   (is (= "foo" (.getName (.getDefaultLogger (make-uri-content-source
-  ;;                                              "xdbc://localhost:8383/"
-  ;;                                              {:default-logger (Logger. )})))))
-  ;;   (is (false? (.isAuthenticationPreemptive (make-uri-content-source "xdbc://localhost:8383/"
-  ;;                                                                     {:preemptive-auth false}))))
-  ;;   (is (true? (.isAuthenticationPreemptive (make-hosted-content-source "localhost" 8383
-  ;;                                                                       {:preemptive-auth true}))))
-  ;;   (is (false? (.isAuthenticationPreemptive (make-hosted-content-source "localhost" 8383
-  ;;                                                                        {:preemptive-auth false}))))
-  ;;   ;; TODO with make-cp-content-source, once we want to delve into
-  ;;   ;; the extreme complexity of ConnectionProvider
-  ;;   )
-  )
+  (testing "Content Source default Logger settings"
+    (is (= "foo" (.getName (.getDefaultLogger (make-uri-content-source
+                                               "xdbc://localhost:8383/"
+                                               {:default-logger (Logger/getLogger "foo")})))))
+    (is (= "bar" (.getName (.getDefaultLogger (make-hosted-content-source
+                                               "localhost" 8383
+                                               {:default-logger (Logger/getLogger "bar")})))))
+    ;; TODO with make-cp-content-source, once we want to delve into
+    ;; the extreme complexity of ConnectionProvider
+    ))


Handle 'ies' words in singularise fn

Handle 'ies' words in singularise fn

--- src/tesq/utils.clj
+++ src/tesq/utils.clj
@@ -11,4 +11,13 @@
 (defn singularise
   "Turn plural string into singular."
   [s]
-  (replace s #"s$" ""))
+  (cond
+
+   (re-find #"ies$" s)
+   (replace s #"ies$" "y")
+
+   :else
+   (replace s #"s$" "")
+
+   ))
+


Reduce logging in users model

Reduce logging in users model

--- src/yetibot/core/models/users.clj
+++ src/yetibot/core/models/users.clj
@@ -1,6 +1,6 @@
 (ns yetibot.core.models.users
   (:require
-    [taoensso.timbre :refer [info warn error]]
+    [taoensso.timbre :refer [info debug warn error]]
     [clj-time.core :refer [now]]))

 (def config {:active-threshold-milliseconds (* 15 60 1000)})
@@ -60,7 +60,7 @@
            {user-key (merge user {:rooms #{chat-source}})})))

 (defn update-user [source id attrs]
-  (info "update-user" source id attrs)
+  (debug "update-user" source id attrs)
   (let [user-key {:adapter (:adapter source) :id id}]
     ; ensure user exists
     (or (get @users user-key)


Re-add liberator.dev.

Re-add liberator.dev.

--- src/clj/freefrog/rest.clj
+++ src/clj/freefrog/rest.clj
@@ -20,6 +20,7 @@
 (ns freefrog.rest
   (:require [liberator.core :refer [resource defresource]]
             [liberator.representation :refer [ring-response]]
+            [liberator.dev]
             [ring.middleware.params :refer [wrap-params]]
             [freefrog.governance :as g]
             [freefrog.governance-logs :as gl]


fixup! remove "virtual" from facts

fixup! remove "virtual" from facts

--- src/clj/runbld/system.clj
+++ src/clj/runbld/system.clj
@@ -45,8 +45,7 @@
      :timezone
      :uptime-days
      :uptime-secs
-     :uptime
-     :virtual])))
+     :uptime])))

 (s/defn make-fs
   ([dir]


better slack messages on changes

better slack messages on changes

--- src/clj/tictag/server.clj
+++ src/clj/tictag/server.clj
@@ -71,9 +71,10 @@
   (debugf "Sending slack message to %s" (pr-str (:username user)))
   (slack/send-message! user (apply format body-fmt)))

+(def wtf (f/formatter "yyyy-MM-dd HH:MM:SS"))
 (defn report-changed-ping [old-ping new-ping]
   (format "Changing Ping @ `%s`\nOld: `%s`\nNew: `%s`"
-          (:local-time new-ping)
+          (f/unparse wtf (:local-time new-ping))
           (:tags old-ping)
           (:tags new-ping)))

@@ -93,13 +94,13 @@
                   (:local-time (first sleepy-pings))])))

 (defmethod apply-command! :tag-ping-by-id [db user _ {:keys [id tags]}]
-  (tag-ping db user (db/ping-from-id db user id) tags))
+  (tag-ping db user (db/ping-from-id db user id) (set tags)))

 (defmethod apply-command! :tag-ping-by-long-time [db user _ {:keys [tags long-time]}]
-  (tag-ping db user (db/ping-from-long-time db user long-time) tags))
+  (tag-ping db user (db/ping-from-long-time db user long-time) (set tags)))

 (defmethod apply-command! :tag-last-ping [db user _ {:keys [tags]}]
-  (tag-ping db user (db/last-ping db user) tags))
+  (tag-ping db user (db/last-ping db user) (set tags)))

 (defmethod apply-command! :ditto [db user _ _]
   (let [[last-ping second-to-last-ping] (db/last-pings db user 2)]
@@ -126,9 +127,9 @@
     valid?))

 (defn slack [{:keys [db] :as component} {:keys [params]}]
-  (future
+  (taoensso.timbre/logged-future
     (when-let [user (and (valid-slack? component params)
-                       (slack-user db params))]
+                         (slack-user db params))]
       (apply-command db user (slack-text params))))
   {:status 200 :body ""})


update campaign on login if it already exists

--- src/clj/yambox/routes.clj
+++ src/clj/yambox/routes.clj
@@ -76,7 +76,9 @@
   (c/GET "/" req
    (let [wallet-id (oauth/req->wallet-id req)]
      (if (db/wallet-id-exists? wallet-id)
-       (tpl/page-management req (db/get-campaign-by-wallet-id wallet-id))
+       (do
+         (handle-campaign-change false req)
+         (tpl/page-management req (db/get-campaign-by-wallet-id wallet-id)))
        (tpl/page-management-create req))))
   (c/POST "/" req
     (let [create? (not (db/wallet-id-exists? (oauth/req->wallet-id req)))]


Adding TODO

Adding TODO

--- src/clj/zetawar/game.cljs
+++ src/clj/zetawar/game.cljs
@@ -6,6 +6,8 @@
    [zetawar.db :refer [e find-by qe qes qess]]
    [zetawar.hex :as hex]
    [zetawar.util :refer [breakpoint inspect oonly]]))
+
+;; TODO: improve exception data

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Util


Start a list of modifications to the algorithms in the papers

--- src/cljs/fatlip/core.cljs
+++ src/cljs/fatlip/core.cljs
@@ -406,7 +406,17 @@
 (defn count-crossings
   "Step 5 of ESK, counts the number of crossings that result from a
   bi-layer ordering. Implements the algorithm found in Bilayer Cross Counting,
-  by Wilhelm Barth, Petra Mutzel and Michael Jünger"
+  by Wilhelm Barth, Petra Mutzel and Michael Jünger
+
+  I've made the following modifications:
+  - Added weights to the edges
+  - Marking node -> node edges that cross segment containers, which helps
+    in the layout process later, by
+    - Storing accumulated node -> node edges in the accumulator tree
+    - Storing a flag for whether a node has seen a segment container in the
+      accumulator tree
+  - Only storing information on right siblings, as the information on left
+    siblings is never accessed"
   [graph layer next-layer]
   (let [minus-ps (:minus-ps layer)
         minus-qs (:minus-qs next-layer)
@@ -466,7 +476,11 @@
 (defn order-graph
   "Implements the 2-layer crossing minimization algorithm on a sparse graph found in
   'An Efficient Implementation of Sugiyama’s Algorithm for Layered Graph Drawing',
-  a paper by Markus Eiglsperger, Martin Sieberhaller, and Michael Kaufmann (ESK)"
+  a paper by Markus Eiglsperger, Martin Sieberhaller, and Michael Kaufmann (ESK)
+
+  I've made the following modifications:
+  - Removed the concept of alternating layers, which don't help much, and hurt a bit
+  - Added weights to nodes and edges"
   [sparse-graph]
   ;; seed the first layer with initial ordered layer
   (loop [seed-order (-> sparse-graph :layers first :nodes)


small update

small update

--- src/cljs/gaugin/core.cljs
+++ src/cljs/gaugin/core.cljs
@@ -115,7 +115,7 @@
                    .enter
                    (.append "circle")
                    (.attr {:class "node"
-                           :r "3"})
+                           :r "4"})
                    (.style {:fill (fn [d] (color (.-group d)))})
                    (.call (.-drag force)))]
       (do
@@ -150,7 +150,7 @@
 (deftemplate graph-header "templates/graph.html"
   [app owner state]
   {[:#container-header] (content (str "Force-based Graph: " (:selected state)))
-   [:#graph-dropdown-menu] (content (map (partial graph-menu-entry owner) (range 10)))})
+   [:#graph-dropdown-menu] (content (map (partial graph-menu-entry owner) (range 50)))})

 (defn force-graph-view


Fix name and visibility check-empty-body function.

--- src/cljs/quil/sketch.cljs
+++ src/cljs/quil/sketch.cljs
@@ -81,7 +81,7 @@
       (if (.-attachEvent js/window)
           (.attachEvent js/window (str "on" event) fun))))

-(defn ^:export check-empty-body []
+(defn empty-body? []
   (let [child (.-childNodes (.-body js/document))]
     (= 1 (.-length child))))


tooltips for commit nodes

tooltips for commit nodes

--- src/cljs/signet/core.cljs
+++ src/cljs/signet/core.cljs
@@ -57,13 +57,19 @@
   (let [width (* 0.4 (.-width js/screen))
         height (* 0.5 (.-height js/screen))
         circle-size 10
-        {:keys [nodes x-positions y-positions links]}
+        {:keys [nodes x-positions y-positions links branches]}
         (compute-positions width height circle-size test-cg)
         svg (.. d3
                 (select frame)
                 (append "svg")
                 (attr {:width width
-                       :height height}))]
+                       :height height}))
+        tooltip (.. d3
+                    (select "body")
+                    (append "div")
+                    (style {:position "absolute"
+                            :z-index 10
+                            :visibility "visisble"}))]
     (do
       (.. svg
           (selectAll "link")
@@ -83,8 +89,21 @@
           (append "circle")
           (attr {:cx (fn [d] (get x-positions d))
                  :cy (fn [d] (get y-positions d))
-                 :fill "steelblue"
-                 :r circle-size})))))
+                 :fill (fn [d] (if (contains? (into #{} (vals branches)) d)
+                                "red"
+                                "steelblue"))
+                 :r circle-size})
+          (on "mouseover" (fn [d] (do (.. tooltip
+                                         (style {:visiblity "visible"
+                                                 :top (str (- (get y-positions d) 10) "px")
+                                                 :left (str  (+ (get x-positions d) 50)  "px")
+                                                 })
+                                         (text d)))))
+          (on "mouseout" (fn [d] (.. tooltip
+                                    (style {:visiblity "hidden"})
+                                    (text ""))))
+          #_(append "svg:title") #_(text (fn [d] d))
+          ))))

 (defn commit-graph-view


Safe nil handling for `get-arbitrary`

Safe nil handling for `get-arbitrary`

--- src/clojure/neko/data.clj
+++ src/clojure/neko/data.clj
@@ -123,4 +123,5 @@
   HashMap (wrapped with `like-map`) and transforms it into a data
   value using Clojure reader."
   [sp-map key]
-  (read-string (get sp-map key)))
+  (when-let [val (get sp-map key)]
+   (read-string val)))


Remove unnecessary newline

Remove unnecessary newline

--- test/github_changelog/conventional_test.clj
+++ test/github_changelog/conventional_test.clj
@@ -57,4 +57,3 @@
     (concat (revert pulls) pulls) 0
     (concat (revert (drop 1 pulls)) pulls) 1
     (concat (revert (revert (take 1 pulls))) (revert pulls) pulls) 1))
-


working on an if

working on an if

--- test/bluebell/fibers/ops_test.clj
+++ test/bluebell/fibers/ops_test.clj
@@ -4,6 +4,7 @@
             [bluebell.fibers.types :as types]
             [bluebell.fibers.core :as core]
             [clojure.test :refer :all]
+            [bluebell.utils.access :as access]
             [clojure.spec.alpha :as spec]
             [bluebell.utils.core :as utils]))

@@ -29,3 +30,16 @@
             (core/make-code (+ (+ (types/input 3)
                                   (types/input 2))
                                (types/input 2)))))))
+
+(defn static-if [cond true-branch false-branch]
+  (core/node
+   (access/build core/-datatype :unspecified)))
+
+(comment
+  (core/make-map {}
+                 (static-if (types/input 1)
+                            (types/input 2)
+                            (types/input 3)))
+
+  )
+


Refactor all-zero? out

Refactor all-zero? out

--- test/caesium/randombytes_test.clj
+++ test/caesium/randombytes_test.clj
@@ -8,11 +8,15 @@
   (let [buf (r/randombytes 10)]
     (is (= 10 (bb/buflen buf)))))

+(defn all-zero?
+  [buf]
+  (every? #{0} (bb/->bytes buf)))
+
 (deftest random-to-buf!-test
   (let [buf (bb/alloc 30)]
-    (is (= #{0} (set (seq (bb/->bytes buf)))))
+    (is (all-zero? buf))
     (r/random-to-buf! buf)
-    (is (not= #{0} (set (seq (bb/->bytes buf))))))
+    (is (not (all-zero? buf))))
   (let [buf (bb/alloc 20)]
     (r/random-to-buf! buf 10)
     (let [s (seq (bb/->bytes buf))


(maint) tests should be called -test

(maint) tests should be called -test

Even though this doesn't shadow a symbol, the pattern is we call these -test

--- test/puppetlabs/pcp/broker/service_test.clj
+++ test/puppetlabs/pcp/broker/service_test.clj
@@ -259,7 +259,7 @@
           ;; destinations
           (is (= {:id (:id message)} (message/get-json-data response))))))))

-(deftest send-disconnect-connect-receive
+(deftest send-disconnect-connect-receive-test
   (with-app-with-config
     app
     [authorization-service broker-service jetty9-service webrouting-service metrics-service]


PCP-124 account for potential race in test

We have a slightly unreliable test here, sometimes in a race netty (the
websockets client) will see that the connection has been shutdown before it
sees the reason for shutdown (code 4003 - you have no certificate).

This can be reduced by introducing this unwanted unwanted voodoo sleep in
the brokers on-connect handler, which seems to give netty enough
time to see it established a websockets session which will then be shutdown:

    diff --git a/src/puppetlabs/pcp/broker/core.clj b/src/puppetlabs/pcp/broker/core.clj
    index c8426eb..a255c68 100644
    --- a/src/puppetlabs/pcp/broker/core.clj
    +++ b/src/puppetlabs/pcp/broker/core.clj
    @@ -374,6 +374,8 @@
                    (sl/maplog :debug (assoc (connection/summarize connection)
                                            :type :connection-no-peer-certificate)
                                "No client certificate, closing {remoteaddress}")
    +
    +                 (Thread/sleep 250)
                    (websockets-client/close! ws 4003 "No client certificate"))
                    (do
                    (websockets-client/idle-timeout! ws idle-timeout)

Intead of taking this approach, we just accept that sometimes we'll get a 1006
close-code in this test, and leave breadcrumbs to the ticket where
other notes have been gathered.

--- test/puppetlabs/pcp/broker/service_test.clj
+++ test/puppetlabs/pcp/broker/service_test.clj
@@ -74,8 +74,18 @@
       (with-open [client (http/create-client)
                   ws (http/websocket client
                                      "wss://127.0.0.1:8143/pcp"
-                                     :close (fn [ws code reason] (deliver closed [code reason])))]
-        (is (= [4003 "No client certificate"] (deref closed (* 2 1000) false)) "Disconnected due to no client certificate")))))
+                                     :close (fn [ws code reason] (deliver closed code)))]
+        ;; NOTE(richardc): This test should only check for close-code 4003, but it
+        ;; is a little unreliable and so may sometimes yield the close-code 1006 due
+        ;; to a race between the client (netty) becoming connected and the server (jetty)
+        ;; closing a connected session because we asked it to.
+        ;; This failure is more commonly observed when using Linux
+        ;; than on OSX, so we suspect the underlying races to be due
+        ;; to thread scheduling.
+        ;; See the comments of http://tickets.puppetlabs.com/browse/PCP-124 for more.
+        (is (contains? #{ 4003 1006 }
+                       (deref closed (* 2 1000) false))
+            "Disconnected due to no client certificate")))))

 (deftest certificate-must-match-test
   (with-app-with-config


Remove missing references

Remove missing references

--- src/db_quiz_prep/core.clj
+++ src/db_quiz_prep/core.clj
@@ -1,7 +1,6 @@
 (ns db-quiz-prep.core
   (:gen-class)
-  (:require [db-quiz-prep.mustache :as mustache]
-            [db-quiz-prep.util :refer [join-lines]]
+  (:require [db-quiz-prep.util :refer [join-lines]]
             [db-quiz-prep.prepare :as prepare]
             [clojure.tools.cli :refer [parse-opts]]
             [clojure.edn :as edn]
@@ -20,7 +19,7 @@
                      :password s/Str
                      :page-size positive-number}
    :data {:selector {:p sc/URI
-                     :o sc/Str}
+                     :o s/Str}
           :surface-forms [sc/URI]
           :source-graph sc/URI
           :target-graph sc/URI}


Remove whitespace and unneeded debug printf

--- src/sqls/ui/worksheet.clj
+++ src/sqls/ui/worksheet.clj
@@ -171,7 +171,6 @@
   "Get line number from text and index."
   [text position]
   (let [before-position-text (subs text 0 position)
-        _ (println "text before position:" before-position-text)
         is-newline (fn [c] (= (str c) "\n"))]
     (count (filter is-newline before-position-text))))

@@ -276,11 +275,11 @@
   "Display results inside results panel.
   This involves building results-table UI with accompanying controls.
   Parameters:
-
+
   - frame - worksheet frame,
   - columns - column names,
   - rows - a pair of semi strict and lazy sequences of rows do display.
-
+
   Scroll view is being configured so that if user scrolls close to the end of the table, new
   rows are fetched from second element of rows pair.
   "


CMR-7492: Added logging when collection update succeeds with existing… (#1314)

* CMR-7492: Added logging when collection update succeeds with existing errors.

* CMR-7492: Added description of err-warnings and non-err-warnings.

* CMR-7492: Rewrote the logging part to make it less confusing

Co-authored-by: siwei xu <6532de1a8b5e90ff3cadd14b3ab551515d3f3d37@raytheon.com>

--- ingest-app/src/cmr/ingest/services/ingest_service/collection.clj
+++ ingest-app/src/cmr/ingest/services/ingest_service/collection.clj
@@ -1,6 +1,8 @@
 (ns cmr.ingest.services.ingest-service.collection
   (:require
    [clojure.string :as string]
+   [cmr.common.api.context :as common-context]
+   [cmr.common.log :as log :refer (warn)]
    [cmr.common.util :refer [defn-timed]]
    [cmr.ingest.config :as config]
    [cmr.ingest.services.helper :as ingest-helper]
@@ -73,10 +75,10 @@
         prev-concept (first (ingest-helper/find-visible-collections context {:provider-id provider-id
                                                                              :native-id native-id}))
         {:keys [collection warnings]} (validate-and-parse-collection-concept
-                                                       context
-                                                       concept
-                                                       prev-concept
-                                                       validation-options)
+                                       context
+                                       concept
+                                       prev-concept
+                                       validation-options)
         ;; Add extra fields for the collection
         coll-concept (assoc (add-extra-fields-for-collection context concept collection)
                             :umm-concept collection)]
@@ -93,7 +95,20 @@
                                                                     concept
                                                                     validation-options)]
     (let [{:keys [concept-id revision-id]} (mdb/save-concept context concept)
-          entry-title (get-in concept [:extra-fields :entry-title])]
+          entry-title (get-in concept [:extra-fields :entry-title])
+          ;; extract out existing errors from warnings
+          existing-errors (some #(:existing-errors %) warnings)
+          ;; extract out the rest of the  warnings from warnings
+          other-warnings (remove #(:existing-errors %) warnings)]
+      ;; if ingested with existing errors, log the existing errors and warnings for the collection
+      ;; and the user
+      (when (seq existing-errors)
+        (warn "Ingest with existing errors info:  "
+              (format "Collection[%s] has the existing errors: %s and warnings: %s by user: [%s]"
+                      concept-id (pr-str existing-errors) (pr-str other-warnings)
+                      (if (:token context)
+                        (common-context/context->user-id context)
+                        "unknown user"))))
       {:entry-title entry-title
        :concept-id concept-id
        :revision-id revision-id


Introduce pentatonic as part of CA music.

--- src/african_polyphony_and_polyrhythm/talk.clj
+++ src/african_polyphony_and_polyrhythm/talk.clj
@@ -201,7 +201,6 @@
 ; Scales
 (def major (scale [2 2 1 2 2 2 1]))
 (def minor (scale [2 1 2 2 1 2 2]))
-(def pentatonic (scale [2 3 2 2 3]))

 (comment
   (->> (phrase (repeat 1/4) (range 0 8))
@@ -221,21 +220,22 @@

-; Little-endian
-(def little-endian-pentatonic
-  "In Central African music, we play scales from small sounds to big ones."
-  (comp pentatonic -))
-
-(comment
-  (map (comp A little-endian-pentatonic) (range 0 6))
+
+; Little-endian pentatonic
+(def pentatonic (scale [2 3 2 2 3]))
+(def little-endian -)
+
+(comment
+  (map (comp A pentatonic) (range 0 6))
+  (map (comp A little-endian pentatonic) (range 0 6))

   (->> (phrase (repeat 1/4) (range 0 6))
-       (where :pitch (comp midi->hz A little-endian-pentatonic))
-       live/play))
-
-
-
-
+       (where :pitch (comp midi->hz A pentatonic))
+       live/play)
+
+  (->> (phrase (repeat 1/4) (range 0 6))
+       (where :pitch (comp midi->hz A little-endian pentatonic))
+       live/play))

@@ -299,7 +299,7 @@
        (map rand-variations)
        (introduce-successively 4)
        (map pan)
-       (where :pitch (comp midi->hz high A little-endian-pentatonic))
+       (where :pitch (comp midi->hz high A little-endian pentatonic))
        (tempo (bpm 120))))

 (comment


Adapt PR review

Adapt PR review

--- backend/test/akvo/lumen/lib/aggregation_test.clj
+++ backend/test/akvo/lumen/lib/aggregation_test.clj
@@ -83,8 +83,8 @@
     (testing "Row Column Only"
       (let [[tag query-result] (query {:aggregation "count", :rowColumn "c2"})]
         (is (= query-result
-               {:columns [{:type "text", :title "B"}
-                          {:type "number", :title "Total"}],
+               {:columns [{:title "B" :type "text"}
+                          {:title "Total" :type "number"}]
                 :rows [["b1" 4]
                        ["b2" 4]]
                 :metadata {:categoryColumnTitle nil}}))))


Improve the rk! documentation.

Improve the rk! documentation.

--- src/clojure/uncomplicate/neanderthal/core.clj
+++ src/clojure/uncomplicate/neanderthal/core.clj
@@ -1320,8 +1320,8 @@
        (mv! a res)))))

 (defn rk!
-  "Rank-1 update. Multiplies vector `x` with transposed vector `y`, scales the resulting matrix
-  by scalar `alpha`, and adds it to the matrix `a`.
+  "The output product of two vectors. Multiplies vector `x` with transposed vector `y`,
+  scales the resulting matrix  by scalar `alpha`, and adds it to the matrix `a`.

   The contents of `a` will be changed.

@@ -1346,7 +1346,8 @@
    (rk! 1.0 x y a)))

 (defn rk
-  "Pure rank-1 update. A pure version of [[rk!]] that returns the result in a new matrix instance."
+  "Pure output product of two vectors. A pure version of [[rk!]] that returns
+  the result in a new matrix instance."
   ([alpha x y a]
    (let-release [res (copy a)]
      (rk! alpha x y res)))


Fix missing namespace in benchmark.clj

Fix missing namespace in benchmark.clj

Signed-off-by: Deepak Giridharagopal <d11186354d1ef01ca06ae37d7e23e827da13e85f@puppetlabs.com>

--- src/com/puppetlabs/puppetdb/cli/benchmark.clj
+++ src/com/puppetlabs/puppetdb/cli/benchmark.clj
@@ -42,6 +42,7 @@
             [com.puppetlabs.puppetdb.catalog :as cat]
             [com.puppetlabs.puppetdb.catalog.utils :as catutils]
             [com.puppetlabs.puppetdb.command :as command]
+            [com.puppetlabs.http :as pl-http]
             [cheshire.core :as json]
             [clj-http.client :as client]
             [clj-http.util :as util]


making sure to create all local files for cluster

--- src/terraboot/cluster.clj
+++ src/terraboot/cluster.clj
@@ -149,34 +149,35 @@
         dump-local-file (fn [content file-name] (str "mkdir -p " directory-name "; echo '" content "' > " directory-name "/" file-name))
         make-executable (fn [file-name] (str "chmod +x " directory-name "/" file-name))]
     ;; local resources: easy customized local access to the cluster
-    (cluster-resource "template_file" "cassandra_deploy"
-                      {:template (snippet "local-exec/cassandra-production.json")
-                       :vars {:cassandra_node_count min-number-of-slaves
-                              :cassandra_seed_count (max (quot min-number-of-slaves 3) 1)}
-                       :provisioner {"local-exec" {"cassandra-marathon"
-                                                   {:command (dump-local-file (cluster-output-of "template_file" "cassandra_deploy" "rendered") (str "cassandra-marathon.json"))}}}})
-
-    (cluster-resource "template_file" "deploy-sh"
-                      {:template (snippet "local-exec/deploy.sh")
-                       :vars {:internal-lb internal-lb
-                              :cluster-name cluster-name}
-                       :provisioner {"local-exec" {"deploy-sh"
-                                                   {:command (str (dump-local-file (cluster-output-of "template_file" "deploy-sh" "rendered") "deploy.sh") ";"
-                                                                  (make-executable "deploy.sh"))}}}})
-
-    (cluster-resource "template_file" "dcos-cli-install"
-                      {:template (snippet "local-exec/dcos-cli-install.sh")
-                       :vars {:internal-lb internal-lb}
-                       :provisioner {"local-exec" {"dcos-cli-install"
-                                                   {:command (str (dump-local-file (cluster-output-of "template_file" "dcos-cli-install" "rendered") "dcos-cli-install.sh") ";"
-                                                                  (make-executable "dcos-cli-install.sh"))}}}})
-
-    (cluster-resource "template_file" "open-mesos-admin"
-                      {:template (str "open http://" internal-lb)
-                       :provisioner {"local-exec" {"open-mesos-admin"
-                                                   {:command (str (dump-local-file (cluster-output-of "template_file" "open-mesos-admin" "rendered") "open-mesos-admin.sh") ";"
-                                                                  (make-executable "open-mesos-admin.sh"))}}}}
-                      )))
+    (merge-in
+     (cluster-resource "template_file" "cassandra_deploy"
+                       {:template (snippet "local-exec/cassandra-production.json")
+                        :vars {:cassandra_node_count min-number-of-slaves
+                               :cassandra_seed_count (max (quot min-number-of-slaves 3) 1)}
+                        :provisioner {"local-exec" {"cassandra-marathon"
+                                                    {:command (dump-local-file (cluster-output-of "template_file" "cassandra_deploy" "rendered") (str "cassandra-marathon.json"))}}}})
+
+     (cluster-resource "template_file" "deploy-sh"
+                       {:template (snippet "local-exec/deploy.sh")
+                        :vars {:internal-lb internal-lb
+                               :cluster-name cluster-name}
+                        :provisioner {"local-exec" {"deploy-sh"
+                                                    {:command (str (dump-local-file (cluster-output-of "template_file" "deploy-sh" "rendered") "deploy.sh") ";"
+                                                                   (make-executable "deploy.sh"))}}}})
+
+     (cluster-resource "template_file" "dcos-cli-install"
+                       {:template (snippet "local-exec/dcos-cli-install.sh")
+                        :vars {:internal-lb internal-lb}
+                        :provisioner {"local-exec" {"dcos-cli-install"
+                                                    {:command (str (dump-local-file (cluster-output-of "template_file" "dcos-cli-install" "rendered") "dcos-cli-install.sh") ";"
+                                                                   (make-executable "dcos-cli-install.sh"))}}}})
+
+     (cluster-resource "template_file" "open-mesos-admin"
+                       {:template (str "open http://" internal-lb)
+                        :provisioner {"local-exec" {"open-mesos-admin"
+                                                    {:command (str (dump-local-file (cluster-output-of "template_file" "open-mesos-admin" "rendered") "open-mesos-admin.sh") ";"
+                                                                   (make-executable "open-mesos-admin.sh"))}}}}
+                       ))))

 (defn cluster-infra
   [{:keys [vpc-name


improved names

improved names

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

--- sandbox/bioformats/src/org/micromanager/bioformats.clj
+++ sandbox/bioformats/src/org/micromanager/bioformats.clj
@@ -11,10 +11,10 @@

 ;; xml <--> str

-(defn str-to-xml [s]
+(defn parse-xml [s]
   (clojure.xml/parse (ByteArrayInputStream. (.getBytes s "UTF-8"))))

-(defn xml-to-str [xml]
+(defn generate-xml [xml]
   (with-out-str (clojure.xml/emit xml)))

 ;; OMEXMLMetadata functions
@@ -27,8 +27,8 @@
 (defn get-ome-xml-string [m]
   (.getOMEXML ome-xml-service m))

-(defn ome-to-xml [m]
-  (-> m get-ome-xml-string str-to-xml))
+(defn parse-ome-metadata [m]
+  (-> m get-ome-xml-string parse-xml))

 ;; read/write tiff files

@@ -42,8 +42,8 @@
 (defn get-tiff-comment [filename]
   (.getComment (TiffParser. filename)))

-(defn read-tiff-xml [filename]
-  (-> filename get-tiff-comment parse-xml-str))
+(defn read-tiff-metadata [filename]
+  (-> filename get-tiff-comment parse-xml))

 (defn overwrite-comment [filename comment]
   (.overwriteComment
@@ -51,8 +51,8 @@
     (RandomAccessInputStream. filename)
     comment))

-(defn overwrite-tiff-xml [filename xml]
-  (overwrite-comment filename (xml-to-str xml)))
+(defn overwrite-tiff-metadata [filename md]
+  (overwrite-comment filename (generate-xml md)))

 ;; construct OME metadata using clojure xml emitter

@@ -121,9 +121,9 @@

 (def test-meta (populate-meta 0 (new-ome-meta) 512 512 2 2 2 2))

-(defn test-write-image []
+(defn test-write-image [name]
   (write-ome-tiff
-    "blah.tiff"
+    (str name ".ome.tiff")
     (rand-image 512 512 2 2)
     test-meta))


(SERVER-71) Rename schema for clarity

(SERVER-71) Rename schema for clarity

--- src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
+++ src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
@@ -93,7 +93,7 @@
    :profiler   (schema/maybe PuppetProfiler)
    :pool-state PoolStateContainer})

-(def PoolInstance
+(def JRubyPuppetInstance
   "A map with objects pertaining to an individual entry in the JRubyPuppet pool."
   {:jruby-puppet JRubyPuppet
    :scripting-container ScriptingContainer})
@@ -137,7 +137,7 @@
     (.runScriptlet "require 'puppet/server/master'")))

 (schema/defn ^:always-validate
-  create-pool-instance :- PoolInstance
+  create-pool-instance :- JRubyPuppetInstance
   "Creates a new pool instance."
   [config   :- JRubyPuppetConfig
    profiler :- (schema/maybe PuppetProfiler)]
@@ -209,7 +209,7 @@
   be available to other callers) and throws the poison pill's exception.
   Otherwise returns the instance that was passed in."
   [instance pool]
-  {:post [((some-fn nil? #(nil? (schema/check PoolInstance %))) %)]}
+  {:post [((some-fn nil? #(nil? (schema/check JRubyPuppetInstance %))) %)]}
   (when (instance? PoisonPill instance)
     (.put pool instance)
     (throw (IllegalStateException. "Unable to borrow JRuby instance from pool"
@@ -265,7 +265,7 @@
   (.size (get-pool context)))

 (schema/defn ^:always-validate
-  borrow-from-pool :- PoolInstance
+  borrow-from-pool :- JRubyPuppetInstance
   "Borrows a JRubyPuppet interpreter from the pool. If there are no instances
   left in the pool then this function will block until there is one available."
   [context :- PoolContext]
@@ -274,7 +274,7 @@
     (validate-instance-from-pool! instance pool)))

 (schema/defn ^:always-validate
-  borrow-from-pool-with-timeout :- (schema/maybe PoolInstance)
+  borrow-from-pool-with-timeout :- (schema/maybe JRubyPuppetInstance)
   "Borrows a JRubyPuppet interpreter from the pool, like borrow-from-pool but a
   blocking timeout is provided. If an instance is available then it will be
   immediately returned to the caller, if not then this function will block
@@ -292,6 +292,6 @@
   return-to-pool
   "Return a borrowed pool instance to its free pool."
   [context :- PoolContext
-   instance :- PoolInstance]
+   instance :- JRubyPuppetInstance]
   (let [pool (get-pool context)]
     (.put pool instance)))


Add type hints to eliminate some reflection

--- src/zaffre/glterminal.clj
+++ src/zaffre/glterminal.clj
@@ -403,7 +403,7 @@
                (Display/destroy))
              (log/info "Exiting"))
            (do
-             (Thread/sleep 1)
+             (Thread/sleep 5)
              (recur)))))
      ;; Wait for Display to be created
      (.await latch)))
@@ -451,7 +451,7 @@
                                 (println (GL20/glGetProgramInfoLog pgm-id 10000)))
         _ (except-gl-errors "@ let before GetUniformLocation")
         ]
-    (doseq [[i attribute-name] (map-indexed vector attribute-names)]
+    (doseq [[^int i ^String attribute-name] (map-indexed vector attribute-names)]
       (GL20/glBindAttribLocation pgm-id i attribute-name))
     pgm-id))

@@ -479,7 +479,7 @@
 (defn ortho-matrix-buffer
   ([viewport-width viewport-height]
     (ortho-matrix-buffer viewport-width viewport-height (BufferUtils/createFloatBuffer 16)))
-  ([viewport-width viewport-height matrix-buffer]
+  ([viewport-width viewport-height ^FloatBuffer matrix-buffer]
     (let [ortho-matrix (doto (Matrix4f.)
                          (.setIdentity))
           matrix-buffer matrix-buffer
@@ -502,7 +502,7 @@
 (defn position-matrix-buffer
   ([v s]
    (position-matrix-buffer v s (BufferUtils/createFloatBuffer 16)))
-  ([v s matrix-buffer]
+  ([v s ^FloatBuffer matrix-buffer]
     (let [matrix (doto (Matrix4f.)
                          (.setIdentity))]
       (.translate matrix (Vector3f. (get v 0) (get v 1) (get v 2)))
@@ -643,13 +643,15 @@
                     character-height
                     font-texture-width
                     font-texture-height
-                    font-texture-image]} (get @font-textures (font-key @normal-font))]
+                    font-texture-image]} (get @font-textures (font-key @normal-font))
+            ;; type nil as ByteBuffer to avoid reflection on glTexImage2D
+            ^ByteBuffer bbnil nil]
         (log/info "screen size" screen-width "x" screen-height)
         (try
           (Display/setDisplayMode (DisplayMode. screen-width screen-height))
           ;; resize FBO
           (GL11/glBindTexture GL11/GL_TEXTURE_2D fbo-texture)
-          (GL11/glTexImage2D GL11/GL_TEXTURE_2D 0 GL11/GL_RGB screen-width screen-height 0 GL11/GL_RGB GL11/GL_UNSIGNED_BYTE nil)
+          (GL11/glTexImage2D GL11/GL_TEXTURE_2D 0 GL11/GL_RGB (int screen-width) (int screen-height) 0 GL11/GL_RGB GL11/GL_UNSIGNED_BYTE bbnil)
           (swap! font-textures update (font-key @normal-font) (fn [m] (assoc m :font-texture (texture-id font-texture-image))))
           (catch Throwable t
             (log/error "Eror changing font" t))))
@@ -1131,7 +1133,7 @@
                (log/error "Error getting keyboard input" e))))
          (if @gl-lock
            (do
-             (Thread/sleep 1)
+             (Thread/sleep 5)
              (recur))
            (on-key-fn :exit)))
       terminal))


Fix HiDPI drawing

Fix HiDPI drawing

--- src/zaffre/glterminal.clj
+++ src/zaffre/glterminal.clj
@@ -714,14 +714,14 @@
               (doseq [line (partition (* 4 texture-columns) layer)]
                 (log/info (vec line))))
             (try
-              (log/info "y" (+ y-pos (- framebuffer-height (* rows character-height)) (- (/ framebuffer-height 2)))
+              #_(log/info "y" (+ y-pos #_(- framebuffer-height (* rows character-height)) (- (/ framebuffer-height 2)))
                 "y-pos" y-pos "fb-h" framebuffer-height "rows" rows "ch-h" character-height)
               (GL20/glUniformMatrix4fv
                 u-MVMatrix
                 false
                 (position-matrix-buffer
                   [(+ x-pos (- (/ framebuffer-width 2)))
-                   (+ y-pos (- framebuffer-height (* rows character-height)) (- (/ framebuffer-height 2)))
+                   (+ y-pos #_(- framebuffer-height (* rows character-height)) (- (/ framebuffer-height 2)))
                    -1.0
                    0.0]
                   [framebuffer-width framebuffer-height 1.0]


added with-stacktrace to stacktrace.clj

added with-stacktrace to stacktrace.clj

--- stacktrace.clj
+++ stacktrace.clj
@@ -64,3 +64,8 @@
 (defn print-throwable-trace [t]
   (println (str color-header "Traceback (most recent call last):" color-normal))
   (print-throwable-trace-noheader t))
+
+(defmacro with-stacktrace [& body]
+  '(try
+    ~@body
+    (catch Throwable err (print-throwable-trace err))))


fix check-queued test

fix check-queued test

--- frontend/components/build_head.cljs
+++ frontend/components/build_head.cljs
@@ -336,12 +336,13 @@

             (when logged-in?
               [:li {:class (when (= :usage-queue selected-tab) "active")}
-               [:a {:on-click #(do (raise! owner [:build-header-tab-clicked {:tab :usage-queue}])
-                                   (raise! owner [:usage-queue-why-showed
-                                                  {:build-id build-id
-                                                   :username (:username @build)
-                                                   :reponame (:reponame @build)
-                                                   :build_num (:build_num @build)}]))}
+               [:a#queued_explanation
+                {:on-click #(do (raise! owner [:build-header-tab-clicked {:tab :usage-queue}])
+                                (raise! owner [:usage-queue-why-showed
+                                               {:build-id build-id
+                                                :username (:username @build)
+                                                :reponame (:reponame @build)
+                                                :build_num (:build_num @build)}]))}
                 "Queue"
                 (when (:usage_queued_at build)
                   [:span " ("


PDOK-1276: use of map with visualization tables

--- src/main/clojure/pdok/featured/projectors.clj
+++ src/main/clojure/pdok/featured/projectors.clj
@@ -27,6 +27,14 @@
 (defn- conj!-when-not-nil [target src & srcs]
   (apply conj!-when target identity src srcs))

+(def visualization-table
+  {:bgt {:wegdeel$kruinlijn "kruinlijn"}})
+
+(defn visualization [dataset collection]
+  (let [k-collection (keyword collection)
+        k-dataset (keyword dataset)]
+    (or (get-in visualization-table [k-dataset k-collection] collection))))
+
 (defn- gs-dataset-exists? [db dataset]
   ;(println "dataset exists?")
   (pg/schema-exists? db dataset))
@@ -35,18 +43,19 @@
   (pg/create-schema db dataset))

 (defn- gs-collection-exists? [db dataset collection]
-  ;(println "collection exists?")
-  (pg/table-exists? db dataset collection))
+  (let [table (visualization dataset collection)]
+    (pg/table-exists? db dataset table)))

 (defn- gs-create-collection [db dataset collection]
   "Create table with default fields"
-  (pg/create-table db dataset collection
+  (let [table (visualization dataset collection)]
+    (pg/create-table db dataset table
                 [:gid "serial" :primary :key]
                 [:_id "varchar(100)"]
                 [:_geometry "geometry"])
-  (pg/create-index db dataset collection "_id")
-  (pg/add-geo-constraints db dataset collection :_geometry)
-  (pg/populate-geometry-columns db dataset collection))
+    (pg/create-index db dataset table "_id")
+    (pg/add-geo-constraints db dataset table :_geometry)
+    (pg/populate-geometry-columns db dataset table)))

 (defn- gs-collection-attributes [db dataset collection]
   ;(println "attributes")
@@ -95,7 +104,7 @@
            (let [all-attributes (all-attributes-fn dataset collection)
                  records (map #(feature-to-sparse-record % (all-fields-constructor all-attributes)) grouped-features)
                  fields (concat [:_id :_geometry] (map (comp keyword pg/quoted) all-attributes))]
-                          (apply (partial j/insert! c (str dataset "." (pg/quoted collection)) fields) records)))))
+                          (apply (partial j/insert! c (str dataset "." (pg/quoted (visualization dataset collection))) fields) records)))))
       (catch java.sql.SQLException e (j/print-sql-exception-chain e))))
   )

@@ -113,7 +122,7 @@
         (let [keyed (group-by feature-keys collection-features)]
           (doseq [[columns vals] keyed]
             (when (< 0 (count columns))
-              (let [sql (gs-update-sql dataset collection (map name columns))
+              (let [sql (gs-update-sql dataset (visualization dataset collection) (map name columns))
                     update-vals (map feature-to-update-record vals)]
                 (j/execute! db (cons sql update-vals) :multi? true :transaction? false)))))
         ))
@@ -129,7 +138,7 @@
     (let [per-dataset-collection
           (group-by #(select-keys % [:dataset :collection]) features)]
       (doseq [[{:keys [dataset collection]} collection-features] per-dataset-collection]
-        (let [sql (gs-delete-sql dataset collection)
+        (let [sql (gs-delete-sql dataset (visualization dataset collection))
               ids (map #(vector (:id %)) collection-features)]
           (j/execute! db (cons sql ids) :multi? true :transaction? false))))))


removed println

removed println

--- test/selmer/core_test.clj
+++ test/selmer/core_test.clj
@@ -6,8 +6,7 @@

 (deftest custom-handler-test
   (let [handler (tag-handler
-                  (fn [args context-map content]
-                    (println "args" args "\ncontext map:" context-map "\ncontent" content)
+                  (fn [args context-map content]
                     (get-in content [:endfoo :content]))
                   :foo :endfoo)]
     (is


lein-release plugin: bumped version from 0.2.2 to 0.2.3-SNAPSHOT for next development cycle

--- prosemirror/project.clj
+++ prosemirror/project.clj
@@ -1,4 +1,4 @@
-(defproject re-view/prosemirror "0.2.2"
+(defproject re-view/prosemirror "0.2.3-SNAPSHOT"

   :description "Rich text editors built with ProseMirror in Re-View"


fix github link to not have dangling second line if not present

--- cljs-server/cljsinfo_server/html.cljs
+++ cljs-server/cljsinfo_server/html.cljs
@@ -4,7 +4,7 @@
     [cljsinfo-server.config :refer [config]]
     [cljsinfo-server.latest-release :refer [latest]]
     [cljsinfo-server.util :refer [js-log log]]
-    [clojure.string :refer [capitalize replace split trim]]
+    [clojure.string :refer [capitalize replace split trim join]]
     hiccups.runtime))

 (def fs     (js/require "fs-extra"))
@@ -407,11 +407,10 @@
 (defn- github-link [src]
   (let [filename (:filename src)
         tag (:tag src)
-        repo (:repo src)
-        [line1 line2] (:lines src)]
+        repo (:repo src)]
     (str "https://github.com/clojure/"
          repo "/blob/" tag "/" filename
-         "#L" line1 "-L" line2)))
+         "#" (join "-" (map #(str "L" %) (:lines src))))))

 (hiccups/defhtml docs-source [docs]
   [:h2.section-99c9a "Source"


Watch out for left-hand sides that are lazyseqs instead of lists.

--- src/midje/parsing/2_to_lexical_maps/fakes.clj
+++ src/midje/parsing/2_to_lexical_maps/fakes.clj
@@ -32,7 +32,8 @@
   (#{#'deref #'assoc} some-var))

 (defn assert-right-shape! [[_fake_ funcall & _ :as form]]
-  (when-not (list? funcall)
+  (when-not (or (list? funcall)
+                (seq? funcall))
     (error/report-error form
                         "The left-hand-side of a prerequisite must look like a function call or metaconstant."
                         (cl-format nil "`~S` doesn't." funcall))))


Added functions used to determine the grammar and structure of a sentence. Added the first few functions used to set the 13 parameters

--- src/research_clojure/eChild/processingSentences.clj
+++ src/research_clojure/eChild/processingSentences.clj
@@ -1,20 +1,141 @@
+(ns research-clojure.eChild.processingSentences)
+(require ['clojure.string :as 'str])
+
 (defn isQuestion
   [x]
   (= x "Q"))
+

 (defn isImperative
   [x]
   (= x "IMP"))

+
 (defn isDelarative
   [x]
   (= x "DEC"))
+

 (defn in?
   "Returns true if lt is an element of sentence"
   [sentence lt]
   (some #(= lt %) sentence))
+

 (defn Verb_tensed
   [sentence]
   (or isDeclarative x (and isQuestion x (in? sentence "Aux"))))
+
+
+(defn containsTopicalizable
+  [sentence]
+  (def i (.indexOf sentence "S"))
+  (def j (.indexOf sentence "01"))
+  (def k (.indexOf sentence "02"))
+  (def l (.indexOf sentence "03"))
+  (def m (.indexOf sentence "Adv"))
+
+  (or (= i 0) (= j 0) (= k 0) (= l 0) (= m 0)))
+
+
+(defn outOblique
+  [sentence]
+  (def i (.indexOf sentence "01"))
+  (def j (.indexOf sentence "02"))
+  (def k (.indexOf sentence "P"))
+  (def l (.indexOf sentence "03"))
+
+  (if (and (not= i -1) (not= j -1) (not= k -1) (< i j k) (or (and (< i j k) (= l (+ k 1))) (and (< l j i) (= k (+ l 1)))))
+    false)
+
+  (if (and (not= i -1) (not= j -1) (not= k -1) (not= l -1))
+    true))
+
+
+(defn S_Aux
+  [sen]
+  (if (isDeclarative (get sen 1))
+    (do (def i (.indexOf sen "S"))
+        (and (> i 0) (= (+ i 1) (.indexOf sen "Aux")))))
+  false)
+
+
+(defn Aux_S
+  [sen]
+  (if (isDeclarative (get sen 1))
+    (do (def i (.indexOf sen "Aux"))
+        (and (> i 0) (= (+ i 1) (.indexOf sen "S")))))
+  false)
+
+
+(defn Aux_Verb
+  [sen]
+  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Aux") (- (.indexOf sen "Verb") 1))))
+
+
+(defn Verb_Aux
+  [sen]
+  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Verb") (- (.indexOf sen "Aux") 1))))
+
+
+(defn Never_Verb
+  [sen]
+  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Never") (.indexOf sen "Verb")) ((= (.indexOf sen "Aux") -1))))
+
+
+(defn Verb_Never
+  [sen]
+  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Verb") (- (.indexOf sen "Never") 1)) ((= (.indexOf sen "Aux") -1))))
+
+
+(defn hasKa
+  [sen]
+  (in? sen "ka"))
+
+
+(defn setParameters
+  [sen])
+
+
+;First parameter
+(defn setSubjPos
+  [sen grammar]
+  (if (and (in? (get infoList 2) "01") (in? (get infoList 2) "S"))
+    ;;Check if 01 and S are in the sentence
+    (do (def first (.indexOf sen "01"))
+        ;Make sure 01 is non-sentence-initial and before S
+        (if (and (> first 0) (< first (.indexOf sen "S")))
+          (assoc grammar 0 '1')))))
+
+
+(defn noSubjPos
+  [sen grammar]
+  (if (and (in? (get infoList 2) "01") (in? (get infoList 2) "S"))
+    ;;Check if 01 and S are in the sentence
+    (do (def first (.indexOf sen "S"))
+        ;Make sure 01 is non-sentence-initial and before S
+        (if (and (> first 0) (< first (.indexOf sen "01")))
+          (assoc grammar 0 "0")))))
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defn consumeSentence
+  [sen]
+  (def info (str.replace sen #"\n" ""))
+  (def info (str.replace info #"\"" ""))
+  (def infoList (str.split info #"\t"))
+  (def sentence (str.split (get infoList 2) #" ")))
+
+
+(defn doesChildLearnGrammar
+  "Runs sentence consuming functions until the
+  correct grammar is learned or the maximum number
+  of sentences are processed"
+  [sentences max_num]
+  (def grammarLearned false)
+  (def count 0)
+
+  (while (and (not grammarLearned) (< count max_num))
+    (consumeSentence (rand-nth sentences))))
+


Bump cider version

Bump cider version

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -65,7 +65,7 @@
                      (require 'pjstadig.humane-test-output)
                      (pjstadig.humane-test-output/activate!)]
         ;;:local-repo "repo"
-        :plugins [[cider/cider-nrepl "0.10.0" :exclusions [org.clojure/java.classpath]]
+        :plugins [[cider/cider-nrepl "0.10.1" :exclusions [org.clojure/java.classpath]]
                   [com.jakemccrary/lein-test-refresh "0.9.0"]
                   [jonase/eastwood "0.2.2" :exclusions [org.clojure/clojure]]
                   [lein-ancient "0.6.8" :exclusions [cheshire common-codec commons-codec org.clojure/clojure org.clojure/tools.reader slingshot]]


Fixing a broker unit test that started failing after merge.

--- storm-core/test/clj/backtype/storm/cluster_test.clj
+++ storm-core/test/clj/backtype/storm/cluster_test.clj
@@ -17,6 +17,7 @@
   (:import [java.util Arrays]
            [backtype.storm.nimbus NimbusInfo])
   (:import [backtype.storm.daemon.common Assignment StormBase SupervisorInfo])
+  (:import [backtype.storm.generated NimbusSummary])
   (:import [org.apache.zookeeper ZooDefs ZooDefs$Ids])
   (:import [org.mockito Mockito])
   (:import [org.mockito.exceptions.base MockitoAssertionError])


Wrap threading macro steps

Wrap threading macro steps

--- test/github_changelog/dependencies/bundler_test.clj
+++ test/github_changelog/dependencies/bundler_test.clj
@@ -5,8 +5,8 @@

 (defn- test-parse [path]
   (->> (io/file "test/fixtures" path)
-       .getCanonicalPath
-       sut/parse))
+       (.getCanonicalPath)
+       (sut/parse)))

 (deftest parse
   (testing "with an empty file"


indentation fix

indentation fix

--- examples/kitchensink/src/kitchensink/core.cljs
+++ examples/kitchensink/src/kitchensink/core.cljs
@@ -35,10 +35,14 @@
                                                 "A page with all Blueprintjs Components, rendered in Om"))
                               (dom/div {:class "pt-navbar-group pt-align-right"}
                                        (dom/a {:href "https://github.com/drcode/blueprint-cljs"}
-                                              (bp/button {:icon-name "home" :class "pt-minimal"
-                                                                                :intent (bp/intents :primary)} "Github"))
+                                              (bp/button {:icon-name "home"
+                                                          :class     "pt-minimal"
+                                                          :intent    (bp/intents :primary)}
+                                                         "Github"))
                                        (dom/a {:href "https://github.com/drcode/blueprint-cljs/blob/master/examples/kitchensink/src/kitchensink/core.cljs"}
-                                              (bp/button {:icon-name "pt-icon-document-open" :class "pt-minimal"} "Code for this page"))))
+                                              (bp/button {:icon-name "pt-icon-document-open"
+                                                          :class "pt-minimal"}
+                                                         "Code for this page"))))
                      (dom/div {:style {:display "flex"
                                        :justify-content "center"}}
                               (dom/div {:style {:width            "800px"
@@ -51,7 +55,8 @@
                                        (section "Click on things for animations & stuff. " (dom/i "This demo page is intended for desktop browsers only."))
 left-icon-name "refresh"
                                                                  :value "Text input with icons & stuff"
-                                                                 :right-element (bp/button {:intent (bp/intents :warning)} "Do It!")}))
+                                                                 :right-element (bp/button {:intent (bp/intents :warning)}
+                                                                                "Do It!")}))
                                        (section (bp/menu (bp/menu-item {:icon-name "new-object" :text "Here's"})
                                                          (bp/menu-item {:icon-name "new-text-box" :text "A haiku that's"})
                                                          (bp/menu-item {:icon-name "new-link" :text "Written inside"})
@@ -62,7 +67,9 @@
                                                                      :visual "pt-icon-thumbs-down"}))
                                        (section (bp/popover {:content (dom/div (dom/p "Random stuff in here")
                                                                                (bp/button "A Button"))
-                                                             :popover-class-name "pt-popover-content-sizing"} (bp/button {:on-click (toggle :popover)} "Popover")))
+                                                             :popover-class-name "pt-popover-content-sizing"}
+                                                            (bp/button {:on-click (toggle :popover)}
+                                                                       "Popover")))

                                        (section (dom/p (bp/progress-bar {:value 0.8}))
                                                 (dom/p) (bp/spinner))
@@ -76,9 +83,12 @@
                                                             (dom/tr (dom/td "Stuff") (dom/td "In") (dom/td "A Table")))))

                                        (section (dom/p (bp/tag "Just"))
-                                                (dom/p (bp/tag {:intent (bp/intents :primary)} "Some"))
-                                                (dom/p (bp/tag {:on-remove (fn [])}  "Tags")))
-                                       (section (bp/tooltip {:content "This is very important text"} "Hover over me."))
+                                                (dom/p (bp/tag {:intent (bp/intents :primary)}
+                                                               "Some"))
+                                                (dom/p (bp/tag {:on-remove (fn [])}
+                                                               "Tags")))
+                                       (section (bp/tooltip {:content "This is very important text"}
+                                                            "Hover over me."))

                                        (section (bp/tree {:contents (bp/clj->tree-nodes [{:label "Foo"}
                                                                                {:label       "Bar"


fix failing tests

fix failing tests

--- test/midje/emission/t_clojure_test_facade.clj
+++ test/midje/emission/t_clojure_test_facade.clj
@@ -33,9 +33,9 @@
   (fact
     (:test result) => 2
     (:fail result) => 1
-    (nth (:lines result) 1) => #"FAIL in.*a-clojure-test-fail"
-    (nth (:lines result) 2) => #"expected"
-    (nth (:lines result) 3) => #"actual"
+    (nth (:lines result) 1) => #"FAIL.*in.*a-clojure-test-fail"
+    (nth (:lines result) 3) => #"expected"
+    (nth (:lines result) 4) => #"actual"
     (take-last 2 (:lines result)) => ["Ran 2 tests containing 2 assertions."
                                       "1 failures, 0 errors."]))


fixed syntax

fixed syntax

--- src/org/domaindrivenarchitecture/pallet/crate/user.clj
+++ src/org/domaindrivenarchitecture/pallet/crate/user.clj
@@ -90,36 +90,19 @@
 (defn configure-ssh-credentials-to-user
   [& {:keys [user-name
             key-ids
-            key-config
-            result]
-      :or {result {} }}]
-    (let [key-id
-        (first key-ids)]
-    (if (empty? key-ids)
-      result
-      (recur
-        user-name
-        (pop key-ids)
-        key-config
-        (let [key-key
-              (keyword (peek key-ids))
-              ssh-key-record
-              (key-key key-config)]
-          (when-exits? (:private-key ssh-key-record)
-                       (merge
-                         result
-                         {key-key
-                          (ssh-key/install-key
-                                user-name
-                                "id_rsa"
-                                (:private-key ssh-key-record)
-                                (ssh-key-record/format-public-key ssh-key-record))}
-                         )
-                       result)
-          ))
-      )
-    ))
-
+            key-config]}]
+  (doseq [key-id key-ids]
+    (let [key-key (keyword (peek key-ids))
+          ssh-key-record (key-key key-config)]
+      (when (some? (:private-key ssh-key-record))
+        (ssh-key/install-key
+          user-name
+          "id_rsa"
+          (:private-key ssh-key-record)
+          (ssh-key-record/format-public-key ssh-key-record))
+        )))
+    )
+
 (defn configure-sudo-for-user
   ""
   [user-name]


Remove unused import from workspace base.

--- frontend/src/uxbox/main/ui/workspace/base.cljs
+++ frontend/src/uxbox/main/ui/workspace/base.cljs
@@ -11,7 +11,6 @@
             [potok.core :as ptk]
             [uxbox.store :as st]
             [uxbox.main.lenses :as ul]
-            [uxbox.main.data.workspace :as dw]
             [uxbox.main.data.shapes :as uds]
             [uxbox.util.geom.point :as gpt]
             [goog.events :as events])


Fix spider rules in dmoz_lisp example

Fix spider rules in dmoz_lisp example

--- src/attercop/examples/dmoz_lisp.clj
+++ src/attercop/examples/dmoz_lisp.clj
@@ -28,9 +28,9 @@
   (let [config {:name "dmoz scraper for lisp resources"
                 :allowed-domains #{"www.dmoz.org"}
                 :start-urls ["http://www.dmoz.org/Computers/Programming/Languages/"]
-                :rules [[#"Computers/Programming/Languages/Functional/"
+                :rules [[#"^[^?]+Computers/Programming/Languages/Functional/"
                          {:scrape nil :follow true}]
-                        [#"Computers/Programming/Languages/Lisp/?.*"
+                        [#"^[^?]+Computers/Programming/Languages/Lisp/?.*"
                          {:scrape parse :follow false}]
                         [:default {:scrape nil :follow false}]]
                 :pipeline [prn]


The logo path may be an absolute URL

The logo path may be an absolute URL

--- lib/assets/cljs/cglossa/start.cljs
+++ lib/assets/cljs/cglossa/start.cljs
@@ -11,7 +11,9 @@
     [:h2
      (:name @corpus)
      (when-let [logo (:logo @corpus)]
-       [:img.corpus-logo {:src (str "img/" logo)}])]]])
+       (let [logo-path (if (or (.startsWith logo "http:") (.startsWith logo "https:")) logo (str "img/" logo))]
+         (.log js/console logo-path)
+         [:img.corpus-logo {:src (str logo-path)}]))]]])

 (defn start [{:keys [num-resets] :as a} m]
   [:div


Add user status operation to user model

Add user status operation to user model

--- src/checkin_halake/models/users.clj
+++ src/checkin_halake/models/users.clj
@@ -1,13 +1,17 @@
 (ns checkin-halake.models.users
   (:require [monger.core :as mg]
             [monger.collection :as mc]
+            [monger.operators :as mo]
             [environ.core :refer [env]]
             [checkin-halake.models.ticket :as ticket])
   (:use [crypto.password.bcrypt :only [encrypt check]]
         checkin-halake.models.core))

+(def user-statuses #{:member :dropin})
+
 (defn- fix-user [doc]
-  (dissoc doc :password))
+  (-> (dissoc doc :password)
+      (update-in [:status] (fnil keyword :dropin))))

 (def initial-tickets
   (zipmap (keys ticket/ticket-types)
@@ -40,3 +44,7 @@
        (mc/find-maps db "users")))

 ;; (query-users)
+
+(defn set-user-status [user status]
+  (assert (contains? user-statuses status))
+  (boolean (mc/update db "users" {:_id (:_id user)} {mo/$set {:status status}})))


Minor fix

Minor fix

--- src/clj/salava/badgeIssuer/main.clj
+++ src/clj/salava/badgeIssuer/main.clj
@@ -8,7 +8,7 @@
    [salava.badgeIssuer.creator :refer [generate-image]]
    [salava.badgeIssuer.db :as db]
    [salava.badgeIssuer.util :refer [selfie-id is-badge-issuer? badge-valid? already-issued?]]
-   [salava.core.util :refer [publish get-site-url get-site-name bytes->base64 hex-digest now get-full-path get-db get-db-1 file-from-url-fix md->html get-db-col plugin-fun get-plugins]]
+   [salava.core.util :refer [publish get-site-url bytes->base64 hex-digest now get-full-path get-db get-db-1 file-from-url-fix md->html get-db-col plugin-fun get-plugins]]
    [salava.profile.db :refer [user-information]]
    [salava.user.db :refer [primary-email]]
    [slingshot.slingshot :refer :all]))
@@ -43,7 +43,7 @@
      :description description
      :type "Profile"
      :url (if (pos? uid) (str (get-full-path ctx) "/profile/" uid) (get-site-url ctx))
-     :email (str "no-reply@" (get-site-name ctx))
+     :email (str "no-reply@" (get-site-url ctx))
      :image (str (get-site-url ctx) "/" image_file)
      (keyword "@context") "https://w3id.org/openbadges/v2"}))


CMR-5145: Fixed indentation.

CMR-5145: Fixed indentation.

--- src/cmr/opendap/components/core.clj
+++ src/cmr/opendap/components/core.clj
@@ -109,18 +109,18 @@
     (merge (cfg)
            log)))

-(defn initialize-with-web
+(defn initialize
   []
   (let [cfg-data (initialize-bare-bones)]
-  (component/map->SystemMap
-    (merge cfg-data
-           reg
-           pubsub
-           auth-cache
-           authz
-           concept-cache
-           concepts
-           (httpd cfg-data)))))
+    (component/map->SystemMap
+      (merge cfg-data
+             reg
+             pubsub
+             auth-cache
+             authz
+             concept-cache
+             concepts
+             (httpd cfg-data)))))

 (defn initialize-without-logging
   []
@@ -139,11 +139,11 @@
   {:basic #'initialize-bare-bones
    :testing-config-only #'initialize-config-only
    :testing #'initialize-without-logging
-   :web #'initialize-with-web})
+   :main #'initialize})

 (defn init
   ([]
-    (init :web))
+    (init :main))
   ([mode]
     ((mode init-lookup))))


Use timestamp in message when it is provided

--- src/onyx/plugin/kafka.clj
+++ src/onyx/plugin/kafka.clj
@@ -226,7 +226,8 @@
   (let [message (:message m)
         k (some-> m :key key-serializer-fn)
         message-topic (get m :topic topic)
-        message-partition (some-> m (get :partition kpartition) int)]
+        message-partition  (some-> m (get :partition kpartition) int)
+        message-timestamp (some-> m (get :timestamp) long)]
     (cond (not (contains? m :message))
           (throw (ex-info "Payload is missing required. Need message key :message"
                           {:recoverable? false
@@ -241,7 +242,7 @@
                    :payload m}))

           :else
-          (ProducerRecord. message-topic message-partition k (serializer-fn message)))))
+          (ProducerRecord. ^String message-topic ^Integer message-partition ^Long message-timestamp k (serializer-fn message)))))

 (defn clear-write-futures! [fs]
   (doall (remove (fn [^java.util.concurrent.Future f]