use new use-X function

use new use-X function

--- src/blackbox/test/leela/blackbox/storage/cassandra_test.clj
+++ src/blackbox/test/leela/blackbox/storage/cassandra_test.clj
@@ -16,193 +16,208 @@
 (deftest test-get-gindex
   (let [node (f/uuid-1)
         table (rand-nth [:g_index :k_index])]
-    (storage/with-connection [cluster ["127.0.0.1"] "leela"]
+    (storage/with-connection [cluster ["127.0.0.1"] {}]
+      (storage/use-attr-schema cluster "leela")
+      (storage/use-graph-schema cluster "leela")

       (truncate-n-test cluster "get-gindex with no data"
-        (is (= [] (storage/get-index cluster table node))))
+                       (is (= [] (storage/get-index cluster table node))))

       (truncate-n-test cluster "get-gindex after put-gindex"
-        (storage/put-index cluster table [{:key node :name "foobar"}])
-        (is (= ["foobar"] (storage/get-index cluster table node))))
+                       (storage/put-index cluster table [{:key node :name "foobar"}])
+                       (is (= ["foobar"] (storage/get-index cluster table node))))

       (truncate-n-test cluster "get-gindex after multiple put-gindex"
-        (storage/put-index cluster table [{:key node :name "f"}
-                                          {:key node :name "o"}
-                                          {:key node :name "b"}
-                                          {:key node :name "a"}
-                                          {:key node :name "r"}])
-        (is (= ["a" "b" "f" "o" "r"] (storage/get-index cluster table node))))
+                       (storage/put-index cluster table [{:key node :name "f"}
+                                                         {:key node :name "o"}
+                                                         {:key node :name "b"}
+                                                         {:key node :name "a"}
+                                                         {:key node :name "r"}])
+                       (is (= ["a" "b" "f" "o" "r"] (storage/get-index cluster table node))))

       (truncate-n-test cluster "get-gindex pagination with only start"
-        (storage/put-index cluster table [{:key node :name "a0"}
-                                          {:key node :name "a1"}
-                                          {:key node :name "a2"}])
-        (storage/with-limit 1
-          (is (= ["a0"] (storage/get-index cluster table node)))
-          (is (= ["a1"] (storage/get-index cluster table node "a1")))
-          (is (= ["a2"] (storage/get-index cluster table node "a2")))))
+                       (storage/put-index cluster table [{:key node :name "a0"}
+                                                         {:key node :name "a1"}
+                                                         {:key node :name "a2"}])
+                       (storage/with-limit 1
+                         (is (= ["a0"] (storage/get-index cluster table node)))
+                         (is (= ["a1"] (storage/get-index cluster table node "a1")))
+                         (is (= ["a2"] (storage/get-index cluster table node "a2")))))

       (truncate-n-test cluster "get-gindex pagination with start & finish"
-        (storage/put-index cluster table [{:key node :name "fooba0r"}
-                                          {:key node :name "fooba1r"}
-                                          {:key node :name "fooba2r"}])
-        (is (= ["fooba0r"] (storage/get-index cluster table node "fooba0" "fooba1")))
-        (is (= ["fooba1r"] (storage/get-index cluster table node "fooba1" "fooba2")))
-        (is (= ["fooba2r"] (storage/get-index cluster table node "fooba2" "fooba3")))))))
+                       (storage/put-index cluster table [{:key node :name "fooba0r"}
+                                                         {:key node :name "fooba1r"}
+                                                         {:key node :name "fooba2r"}])
+                       (is (= ["fooba0r"] (storage/get-index cluster table node "fooba0" "fooba1")))
+                       (is (= ["fooba1r"] (storage/get-index cluster table node "fooba1" "fooba2")))
+                       (is (= ["fooba2r"] (storage/get-index cluster table node "fooba2" "fooba3")))))))

 (deftest test-put-tattr
   (let [node-a (f/uuid-from-time 1)]
-    (storage/with-connection [cluster ["127.0.0.1"] "leela"]
+    (storage/with-connection [cluster ["127.0.0.1"] {}]
+      (storage/use-attr-schema cluster "leela")
+      (storage/use-graph-schema cluster "leela")

       (truncate-n-test cluster "put-tattr without index"
-         (storage/put-tattr cluster [[{:key node-a
-                                       :name "foobar"
-                                       :time 0
-                                       :value (f/str-to-bytes "foobar")} {}]])
-         (is (= [] (storage/get-index cluster :t_index node-a false))))
+                       (storage/put-tattr cluster [[{:key node-a
+                                                     :name "foobar"
+                                                     :time 0
+                                                     :value (f/str-to-bytes "foobar")} {}]])
+                       (is (= [] (storage/get-index cluster :t_index node-a false))))

       (truncate-n-test cluster "put-tattr with index"
-         (storage/put-tattr cluster [[{:key node-a
-                                       :name "foobar"
-                                       :time 0
-                                       :value (f/str-to-bytes "foobar")} {:index true}]])
-         (is (= ["foobar"] (storage/get-index cluster :t_index node-a false)))))))
+                       (storage/put-tattr cluster [[{:key node-a
+                                                     :name "foobar"
+                                                     :time 0
+                                                     :value (f/str-to-bytes "foobar")} {:index true}]])
+                       (is (= ["foobar"] (storage/get-index cluster :t_index node-a false)))))))

 (deftest test-getlink
   (let [node-a (f/uuid-from-time 1)
         node-b (f/uuid-from-time 2)
         node-c (f/uuid-from-time 3)
         node-d (f/uuid-from-time 4)]
-    (storage/with-connection [cluster ["127.0.0.1"] "leela"]
+    (storage/with-connection [cluster ["127.0.0.1"] {}]
+      (storage/use-attr-schema cluster "leela")
+      (storage/use-graph-schema cluster "leela")

       (truncate-n-test cluster "getlink with no data"
-        (is (= [] (storage/getlink cluster node-a "l" (f/uuid-from-time 0)))))
+                       (is (= [] (storage/getlink cluster node-a "l" (f/uuid-from-time 0)))))

       (truncate-n-test cluster "getlink after putlink"
-        (storage/putlink cluster [{:a node-a :l "l" :b node-b}
-                                  {:a node-a :l "l" :b node-c}
-                                  {:a node-a :l "l" :b node-d}])
-        (is (= [node-b node-c node-d] (storage/getlink cluster node-a "l" (f/uuid-from-time 0)))))
+                       (storage/putlink cluster [{:a node-a :l "l" :b node-b}
+                                                 {:a node-a :l "l" :b node-c}
+                                                 {:a node-a :l "l" :b node-d}])
+                       (is (= [node-b node-c node-d] (storage/getlink cluster node-a "l" (f/uuid-from-time 0)))))

       (truncate-n-test cluster "getlink pagination"
-        (storage/putlink cluster [{:a node-a :l "l" :b node-b}
-                                  {:a node-a :l "l" :b node-c}
-                                  {:a node-a :l "l" :b node-d}])
-        (storage/with-limit 2
-          (is (= [node-b node-c] (storage/getlink cluster node-a "l" (f/uuid-from-time 0))))
-          (is (= [node-b node-c] (storage/getlink cluster node-a "l" node-b)))
-          (is (= [node-c node-d] (storage/getlink cluster node-a "l" node-c)))
-          (is (= [node-d] (storage/getlink cluster node-a "l" node-d)))))
+                       (storage/putlink cluster [{:a node-a :l "l" :b node-b}
+                                                 {:a node-a :l "l" :b node-c}
+                                                 {:a node-a :l "l" :b node-d}])
+                       (storage/with-limit 2
+                         (is (= [node-b node-c] (storage/getlink cluster node-a "l" (f/uuid-from-time 0))))
+                         (is (= [node-b node-c] (storage/getlink cluster node-a "l" node-b)))
+                         (is (= [node-c node-d] (storage/getlink cluster node-a "l" node-c)))
+                         (is (= [node-d] (storage/getlink cluster node-a "l" node-d)))))

       (truncate-n-test cluster "getlink after dellink"
-        (storage/putlink cluster [{:a node-a :l "l" :b node-b}
-                                  {:a node-a :l "l" :b node-c}
-                                  {:a node-a :l "l" :b node-d}])
-        (storage/dellink cluster [{:a node-a :l "l" :b node-b}
-                                  {:a node-a :l "l" :b node-c}
-                                  {:a node-a :l "l" :b node-d}])
-        (is (= [] (storage/getlink cluster node-a "l" (f/uuid-from-time 0)))))
+                       (storage/putlink cluster [{:a node-a :l "l" :b node-b}
+                                                 {:a node-a :l "l" :b node-c}
+                                                 {:a node-a :l "l" :b node-d}])
+                       (storage/dellink cluster [{:a node-a :l "l" :b node-b}
+                                                 {:a node-a :l "l" :b node-c}
+                                                 {:a node-a :l "l" :b node-d}])
+                       (is (= [] (storage/getlink cluster node-a "l" (f/uuid-from-time 0)))))

       (truncate-n-test cluster "getlink after dellink with no optional argument"
-        (storage/putlink cluster [{:a node-a :l "l" :b node-b}
-                                  {:a node-a :l "l" :b node-c}
-                                  {:a node-a :l "l" :b node-d}])
-        (storage/dellink cluster [{:a node-a :l "l" :b nil}])
-        (is (= [] (storage/getlink cluster node-a "l" (f/uuid-from-time 0))))))))
+                       (storage/putlink cluster [{:a node-a :l "l" :b node-b}
+                                                 {:a node-a :l "l" :b node-c}
+                                                 {:a node-a :l "l" :b node-d}])
+                       (storage/dellink cluster [{:a node-a :l "l" :b nil}])
+                       (is (= [] (storage/getlink cluster node-a "l" (f/uuid-from-time 0))))))))

 (deftest test-get-tattr
   (let [node-a (f/uuid-from-time 1)
         node-b (f/uuid-from-time 2)
         node-c (f/uuid-from-time 3)
         node-d (f/uuid-from-time 4)]
-    (storage/with-connection [cluster ["127.0.0.1"] "leela"]
+    (storage/with-connection [cluster ["127.0.0.1"] {}]
+      (storage/use-attr-schema cluster "leela")
+      (storage/use-graph-schema cluster "leela")

       (truncate-n-test cluster "get-tattr with no data"
-        (is (= [] (storage/get-tattr cluster node-a "attr" 0))))
+                       (is (= [] (storage/get-tattr cluster node-a "attr" 0))))

       (truncate-n-test cluster "get-tattr after put-tattr"
-        (storage/put-tattr cluster [[{:key node-a
-                                      :name "attr"
-                                      :time 0
-                                      :value (f/str-to-bytes "foobar")} {}]])
-        (let [results (storage/get-tattr cluster node-a "attr" 0)]
-          (is (= [[0 "foobar"]] (map (partial map f/bytes-to-str) results)))))
+                       (storage/put-tattr cluster [[{:key node-a
+                                                     :name "attr"
+                                                     :time 0
+                                                     :value (f/str-to-bytes "foobar")} {}]])
+                       (let [results (storage/get-tattr cluster node-a "attr" 0)]
+                         (is (= [[0 "foobar"]] (map (partial map f/bytes-to-str) results)))))

       (truncate-n-test cluster "get-tattr after put-tattr (overwrite)"
-        (storage/put-tattr cluster [[{:key node-a
-                                      :name "attr"
-                                      :time 0
-                                      :value (f/str-to-bytes "foobar")} {}]
-                                    [{:key node-a
-                                      :name "attr"
-                                      :time 0
-                                      :value (f/str-to-bytes "foobaz")} {}]])
-        (let [results (storage/get-tattr cluster node-a "attr" 0)]
-          (is (= [[0 "foobaz"]] (map (partial map f/bytes-to-str) results)))))
+                       (storage/put-tattr cluster [[{:key node-a
+                                                     :name "attr"
+                                                     :time 0
+                                                     :value (f/str-to-bytes "foobar")} {}]
+                                                   [{:key node-a
+                                                     :name "attr"
+                                                     :time 0
+                                                     :value (f/str-to-bytes "foobaz")} {}]])
+                       (let [results (storage/get-tattr cluster node-a "attr" 0)]
+                         (is (= [[0 "foobaz"]] (map (partial map f/bytes-to-str) results)))))

       (truncate-n-test cluster "get-tattr after delattr"
-        (storage/put-tattr cluster [[{:key node-c
-                                      :name "attr"
-                                      :time 0
-                                      :value (f/str-to-bytes "foobar")} {}]])
-        (storage/del-tattr cluster [{:key node-c
-                                     :name "attr"
-                                     :time 0}])
-        (is (= [] (storage/get-tattr cluster node-c "attr" 0)))))))
+                       (storage/put-tattr cluster [[{:key node-c
+                                                     :name "attr"
+                                                     :time 0
+                                                     :value (f/str-to-bytes "foobar")} {}]])
+                       (storage/del-tattr cluster [{:key node-c
+                                                    :name "attr"
+                                                    :time 0}])
+                       (is (= [] (storage/get-tattr cluster node-c "attr" 0)))))))

 (deftest test-put-kattr
   (let [node-a (f/uuid-from-time 1)]
-    (storage/with-connection [cluster ["127.0.0.1"] "leela"]
+    (storage/with-connection [cluster ["127.0.0.1"] {}]
+      (storage/use-attr-schema cluster "leela")
+      (storage/use-graph-schema cluster "leela")

       (truncate-n-test cluster "put-kattr without index"
-         (storage/put-kattr cluster [[{:key node-a
-                                       :name "foobar"
-                                       :value (f/str-to-bytes "foobar")} {}]])
-         (is (= [] (storage/get-index cluster :k_index node-a false))))
+                       (storage/put-kattr cluster [[{:key node-a
+                                                     :name "foobar"
+                                                     :value (f/str-to-bytes "foobar")} {}]])
+                       (is (= [] (storage/get-index cluster :k_index node-a false))))

       (truncate-n-test cluster "put-kattr with index"
-         (storage/put-kattr cluster [[{:key node-a
-                                       :name "foobar"
-                                       :value (f/str-to-bytes "foobar")} {:index true}]])
-         (is (= ["foobar"] (storage/get-index cluster :k_index node-a false)))))))
+                       (storage/put-kattr cluster [[{:key node-a
+                                                     :name "foobar"
+                                                     :value (f/str-to-bytes "foobar")} {:index true}]])
+                       (is (= ["foobar"] (storage/get-index cluster :k_index node-a false)))))))

 (deftest test-get-kattr
   (let [node-a (f/uuid-from-time 1)
         node-b (f/uuid-from-time 2)
         node-c (f/uuid-from-time 3)
         node-d (f/uuid-from-time 4)]
-    (storage/with-connection [cluster ["127.0.0.1"] "leela"]
+    (storage/with-connection [cluster ["127.0.0.1"] {}]
+      (storage/use-attr-schema cluster "leela")
+      (storage/use-graph-schema cluster "leela")

       (truncate-n-test cluster "get-kattr with no data"
-        (is (= nil (storage/get-kattr cluster node-a "attr"))))
+                       (is (= nil (storage/get-kattr cluster node-a "attr"))))

       (truncate-n-test cluster "get-kattr after put-kattr"
-        (storage/put-kattr cluster [[{:key node-a :name "attr#0" :value (f/str-to-bytes "foobar")} {}]])
-        (is (not (= nil (storage/get-kattr cluster node-a "attr#0")))))
+                       (storage/put-kattr cluster [[{:key node-a :name "attr#0" :value (f/str-to-bytes "foobar")} {}]])
+                       (is (not (= nil (storage/get-kattr cluster node-a "attr#0")))))

       (truncate-n-test cluster "get-kattr after put-kattr (overwrite)"
-        (storage/put-kattr cluster [[{:key node-a :name "attr#0" :value (f/str-to-bytes "foobar")} {}]
-                                    [{:key node-a :name "attr#0" :value (f/str-to-bytes "foobaz")} {}]])
-        (is (= "foobaz" (f/bytes-to-str (storage/get-kattr cluster node-a "attr#0")))))
+                       (storage/put-kattr cluster [[{:key node-a :name "attr#0" :value (f/str-to-bytes "foobar")} {}]
+                                                   [{:key node-a :name "attr#0" :value (f/str-to-bytes "foobaz")} {}]])
+                       (is (= "foobaz" (f/bytes-to-str (storage/get-kattr cluster node-a "attr#0")))))

       (truncate-n-test cluster "getakattr after del-kattr"
-        (storage/put-kattr cluster [[{:key node-a :name "attr#0" :value (f/str-to-bytes "foobar")} {}]])
-        (storage/del-kattr cluster [{:key node-a :name "attr#0"}])
-        (is (= nil (storage/get-kattr cluster node-a "attr#0")))))))
+                       (storage/put-kattr cluster [[{:key node-a :name "attr#0" :value (f/str-to-bytes "foobar")} {}]])
+                       (storage/del-kattr cluster [{:key node-a :name "attr#0"}])
+                       (is (= nil (storage/get-kattr cluster node-a "attr#0")))))))

 (deftest test-naming
-  (storage/with-connection [cluster ["127.0.0.1"] "leela"]
+  (storage/with-connection [cluster ["127.0.0.1"] {}]
+    (storage/use-attr-schema cluster "leela")
+    (storage/use-graph-schema cluster "leela")
+
     (truncate-n-test cluster "putguid register a new uuid"
-      (is (not (= nil (storage/putguid cluster "leela" "leela" "foo" "bar")))))
+                     (is (not (= nil (storage/putguid cluster "leela" "leela" "foo" "bar")))))

     (truncate-n-test cluster "getguid is idempotent"
-      (is (= (storage/putguid cluster "leela" "leela" "foo" "bar") (storage/putguid cluster "leela" "leela" "foo" "bar"))))
+                     (is (= (storage/putguid cluster "leela" "leela" "foo" "bar") (storage/putguid cluster "leela" "leela" "foo" "bar"))))

     (truncate-n-test cluster "getguid with no data"
-      (is (empty? (storage/getguid cluster "leela" "leela" "foo" "bar"))))
+                     (is (empty? (storage/getguid cluster "leela" "leela" "foo" "bar"))))

     (truncate-n-test cluster "getguid with no data"
-      (is (= nil (storage/getguid cluster "leela" "leela" "foo" "bar"))))
+                     (is (= nil (storage/getguid cluster "leela" "leela" "foo" "bar"))))

     (truncate-n-test cluster "getguid aftter putguid"
-      (is (= (storage/putguid cluster "leela" "leela" "foo" "bar") (storage/getguid cluster "leela" "leela" "foo" "bar"))))))
+                     (is (= (storage/putguid cluster "leela" "leela" "foo" "bar") (storage/getguid cluster "leela" "leela" "foo" "bar"))))))


serialize runner's default printing

serialize runner's default printing

--- src/main/clojure/clojure/test/generative/runner.clj
+++ src/main/clojure/clojure/test/generative/runner.clj
@@ -9,7 +9,6 @@

 (ns clojure.test.generative.runner
   (:require
-   [clojure.pprint :as pprint]
    [clojure.tools.namespace :as ns]
    [clojure.data.generators :as gen]
    [clojure.test.generative :as tgen]))
@@ -26,7 +25,8 @@
        read-string
        10000]])

-(defn- config
+(defn config
+  "Returns runner configuration derived from system properties."
   []
   (reduce
    (fn [m [prop path coerce default]]
@@ -123,10 +123,34 @@
                      :seeds (repeatedly nthreads next-seed)})
           tests))

-(defn- prf
+(def ^:private serializer (agent nil))
+
+(defn serialized
+  "Returns a function that calls f for side effects, async,
+   serialized by an agent"
+  ([f] (serialized f serializer))
+  ([f agt]
+     (fn [& args]
+       (send-off agt
+                 (fn [_]
+                   (try
+                    (apply f args)
+                    (catch Throwable t
+                      (.printStackTrace t)))
+                   nil))
+       nil)))
+
+(def prf
   "Print and flush."
-  [s]
-  (print s) (flush))
+  (serialized (fn [s]
+                (binding [*out* *err*]
+                  (print s)
+                  (flush)))))
+
+(def print-stack-trace
+  (serialized (fn [^Throwable t] (.printStackTrace t))))
+
+(def sprn (serialized prn))

 (defn dir-tests
   "Returns all tests in dirs"
@@ -161,9 +185,9 @@
         ret (reduce
              (fn [{:keys [failures iters nresults]} result]
                (when (:exception result)
-                 (.printStackTrace ^Throwable (:exception result)))
+                 (print-stack-trace (:exception result)))
                (if (:exception result)
-                 (prn result)
+                 (sprn result)
                  (progress))
                {:failures (+ failures (if (:exception result) 1 0))
                 :iters (+ iters (:iter result))


match lazytest_asserts.clj ns to file name

--- src/asserts/lazytest_asserts.clj
+++ src/asserts/lazytest_asserts.clj
@@ -1,4 +1,4 @@
-(ns com.stuartsierra.lazytest-asserts
+(ns lazytest-asserts
   (:use com.stuartsierra.lazytest
         com.stuartsierra.lazytest.report))


remove unneeded reference

remove unneeded reference

--- src/metabase/api/meta/field.clj
+++ src/metabase/api/meta/field.clj
@@ -4,7 +4,6 @@
             [metabase.api.common :refer :all]
             [metabase.db :refer :all]
             [metabase.db.metadata-queries :as metadata]
-            [metabase.driver :as driver]
             (metabase.models [hydrate :refer [hydrate]]
                              [field :refer [Field] :as field]
                              [field-values :refer [FieldValues]]


cosmit

cosmit

--- corpusmaker.clj
+++ corpusmaker.clj
@@ -12,7 +12,7 @@
 (ns corpusmaker
     (:require [clojure.zip :as zip]
               [clojure.xml :as xml]
-	      [clojure.contrib.zip-filter.xml]))
+              [clojure.contrib.zip-filter.xml]))

 (defn parse-xml
   "seqable XML content from filename"


unused function

unused function

--- src/ontrail/exercise.clj
+++ src/ontrail/exercise.clj
@@ -11,19 +11,6 @@
   (:import [org.joda.time DateTime]))

 (def #^{:private true} logger (org.slf4j.LoggerFactory/getLogger (str *ns*)))
-
-
-(def TRUNCATE 110)
-
-(defn strip-and-truncate [s]
-  (if (= s nil)
-    ""
-    (let [stripped (strip-html s)
-          chars (count stripped)
-          truncated-len (if (> chars TRUNCATE) TRUNCATE chars)]
-      (if (> chars TRUNCATE)
-        (str (subs stripped 0 truncated-len))
-        stripped))))

 (defn as-comment [comment]
   (let [id (str (:_id comment))]


Add other drives (D and E) to windows scsynth paths

--- src/overtone/sc/core.clj
+++ src/overtone/sc/core.clj
@@ -260,7 +260,12 @@

 (def SC-PATHS {:linux ["scsynth"]
                :windows ["C:/Program Files/SuperCollider/scsynth.exe"
-                         "C:/Program Files (x86)/SuperCollider/scsynth.exe"]
+                         "D:/Program Files/SuperCollider/scsynth.exe"
+                         "E:/Program Files/SuperCollider/scsynth.exe"
+                         "C:/Program Files (x86)/SuperCollider/scsynth.exe"
+                         "D:/Program Files (x86)/SuperCollider/scsynth.exe"
+                         "E:/Program Files (x86)/SuperCollider/scsynth.exe"]
+
                :mac  ["/Applications/SuperCollider/scsynth"] })

 (def SC-ARGS  {:linux []


[#234] Fix failing receive example

[#234] Fix failing receive example

--- priv/examples/receive.clj
+++ priv/examples/receive.clj
@@ -15,7 +15,11 @@
      _
      (loop state))))

-(let [x (erlang/spawn.e :examples.receive :loop '#erl (42))]
+(def spawn
+  (fn* [f & args]
+       (erlang/spawn.e :clj_core :apply (clj_core/to_list.e [f args]))))
+
+(let [x (spawn loop 42)]
   (erlang/send.e x :inc)
   (erlang/send.e x :inc)
   (erlang/send.e x :inc)


Moved main realtime function to bottom of the code

Since it is accessed all the time so it makes it easier to scroll to.
Dumb, yeh!!

--- src/webapp/framework/client/coreclient.cljs
+++ src/webapp/framework/client/coreclient.cljs
@@ -137,9 +137,9 @@
   "
   [did]
   (reset! call-stack
-          (into [] (filter #(not= %1 did) @call-stack))
-          )
-  )
+          (into [] (filter #(not= %1 did) @call-stack))))
+
+

@@ -2043,7 +2043,7 @@

-(defn update-data-source-fields  [data-source  fields]
+(defn keep-client-fields-up-tp-date  [data-source  fields]
   (let [ds-fields          (get  @client-datasource-fields   data-source)
         fields-atom        (atom fields)                            ]

@@ -2061,6 +2061,129 @@

+
+
+
+
+
+
+
+
+
+
+"-----------------------------------------------------------
+Get data window requests
+
+this waits for requests on the channel
+'client-query-cache-requests' and then gets the corresponding
+data and updates the internal cache
+-----------------------------------------------------------"
+(go
+ (loop []
+   (let [request (<! client-data-window-requests)]  ; <-- reads the request from the channel
+
+
+      (update-or-create-data-window
+       (:key    request)
+       (:start  request)
+       (:end    request)
+       (:ui     request)))
+   (recur)))
+
+
+
+
+
+
+
+
+
+
+
+
+
+"-------------------------------------------------
+(<-- :profession)
+
+
+
+This is used from a GUI data component to read
+a value from the current record
+
+It is actually called from the <-- macro
+-------------------------------------------------"
+(defn <---fn [record  field  path  relative-path]
+
+  ;(log (pr-str (-> record :value field))))
+  (-> record :value field))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+"-------------------------------------------------
+(<--pos)
+
+
+
+This is used from a GUI data component to read
+the record position. This starts from 1. It is most
+useful when showing a list of records which are
+numbered such as:
+
+1) eggs
+2) beans
+3) soup
+
+It is actually called from the <--pos macro
+-------------------------------------------------"
+(defn <---pos [record  path  relative-path]
+
+    (-> record :pos))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+"-------------------------------------------------
+(<--id)
+
+
+
+Actually <---id and this is used from a GUI data
+component to read the record ID, as stored in the
+database.
+
+It is actually called from the <--id macro
+-------------------------------------------------"
+(defn <---id [record-id  record  path  relative-path]
+
+    record-id)
+
+
+(defn session-user-id-fn []
+  (((get @data-state :session) :user ) :id))

@@ -2125,27 +2248,25 @@

   (let [
-        full-path             (into [] (flatten (conj
-                                                 component-path
-                                                 relative-path
-                                                 [])))
-
-        data-window-key      {
-                               :ui-component-name   ui-component-name
-                               :relative-path       relative-path
-                               :component-path      component-path
-                               :data-source         data-source
-                               :fields              fields
-                               :where               where
-                               :path                relative-path
-                               :full-path           full-path
-                               :db-table            db-table
-                               :params              params
-                               :order               order
-                               :realtime            realtime
-                               }
+        full-path             (into [] (flatten (conj  component-path  relative-path  [])))
+
+        data-window-key       {
+                                :ui-component-name   ui-component-name
+                                :relative-path       relative-path
+                                :component-path      component-path
+                                :data-source         data-source
+                                :fields              fields
+                                :where               where
+                                :path                relative-path
+                                :full-path           full-path
+                                :db-table            db-table
+                                :params              params
+                                :order               order
+                                :realtime            realtime
+                              }
         ]
-    (update-data-source-fields   data-source  fields)
+
+    (keep-client-fields-up-tp-date   data-source  fields)

     (go
@@ -2171,115 +2292,3 @@

-
-"-----------------------------------------------------------
-Get data window requests
-
-this waits for requests on the channel
-'client-query-cache-requests' and then gets the corresponding
-data and updates the internal cache
------------------------------------------------------------"
-(go
- (loop []
-   (let [request (<! client-data-window-requests)]  ; <-- reads the request from the channel
-
-
-      (update-or-create-data-window
-       (:key    request)
-       (:start  request)
-       (:end    request)
-       (:ui     request)))
-   (recur)))
-
-
-
-
-
-
-
-
-
-
-
-
-
-"-------------------------------------------------
-(<-- :profession)
-
-
-
-This is used from a GUI data component to read
-a value from the current record
-
-It is actually called from the <-- macro
--------------------------------------------------"
-(defn <---fn [record  field  path  relative-path]
-
-  ;(log (pr-str (-> record :value field))))
-  (-> record :value field))
-
-
-
-
-
-
-
-
-
-
-
-
-"-------------------------------------------------
-(<--pos)
-
-
-
-This is used from a GUI data component to read
-the record position. This starts from 1. It is most
-useful when showing a list of records which are
-numbered such as:
-
-1) eggs
-2) beans
-3) soup
-
-It is actually called from the <--pos macro
--------------------------------------------------"
-(defn <---pos [record  path  relative-path]
-
-    (-> record :pos))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-"-------------------------------------------------
-(<--id)
-
-
-
-Actually <---id and this is used from a GUI data
-component to read the record ID, as stored in the
-database.
-
-It is actually called from the <--id macro
--------------------------------------------------"
-(defn <---id [record-id  record  path  relative-path]
-
-    record-id)
-
-
-(defn session-user-id-fn []
-  (((get @data-state :session) :user ) :id)
-  )


make deer demand ugen :dr rate

make deer demand ugen :dr rate

--- src/overtone/sc/ugen/demand.clj
+++ src/overtone/sc/ugen/demand.clj
@@ -132,7 +132,8 @@
       {:name "Dser"
        :args [{:name "list", :mode :append-sequence, :array true :doc "array of values or other ugens"}
               {:name "count", :default 1 :doc "number of values to return"}],
-       :doc "Demand rate sequence generator. Generates a sequence of values Like dseq, except outputs only count total values, rather than repeating."}
+       :doc "Demand rate sequence generator. Generates a sequence of values Like dseq, except outputs only count total values, rather than repeating."
+       :rates #{:dr}}

       {:name "Dshuf" :extends "Dseq"
        :doc "Demand rate random sequence generator. Shuffle a sequence once and then output it one or more times."}


atoms in dir

atoms in dir

--- src/atom_finder/atoms_in_dir.clj
+++ src/atom_finder/atoms_in_dir.clj
@@ -2,6 +2,8 @@
   (:require [atom-finder.util :refer :all]
             [atom-finder.classifier :refer :all]
             [atom-finder.constants :refer :all]
+            [clojure.string :as str]
+            [clojure.pprint :refer [pprint]]
             ))

 (defn all-atoms-in-tree
@@ -47,8 +49,6 @@
       int y = M();"
      parse-frag
      root-ancestor .getMacroExpansions first write-tree)
-     .getNestedMacroReferences (into []))
-     ppublic-methods)

 (->> "
   #define M(x) f(x)
@@ -65,9 +65,31 @@

   (->> "~/opt/src/linux"
        expand-home
-       (pmap-dir-files #(atoms-in-file (map atom-lookup [:macro-operator-precedence]) %))
+       (pmap-dir-files #(atoms-in-file (map atom-lookup [:literal-encoding]) %))
        (filter (fn [[file atms]] (->> atms vals (exists? (complement empty?)))))
        (map prn)
        count
        println
        time-mins)
+
+(->> "~/opt/src/linux"
+       expand-home
+       (pmap-dir-trees (->> atom-lookup :literal-encoding :finder))
+       flatten
+       (take 1000)
+       (map write-tree)
+       (map println)
+       )
+
+(->> "~(3 | 2)" parse-frag print-tree)
+(->> "~ 3 | 2" parse-frag print-tree)
+
+(->> "~/opt/src/linux"
+     expand-home
+     (pmap-dir-files identity)
+     (take 5)
+     pprint)
+
+(->> "/Users/dgopstein/opt/src/linux/arch/alpha/boot/main.c"
+     parse-file
+     print-tree)


Fixed dropdown height when placed in h-boxes

--- src/re_com/dropdown.cljs
+++ src/re_com/dropdown.cljs
@@ -275,9 +275,10 @@
                                  35 (press-end)
                                  filter-box))] ;; Use this boolean to allow/prevent the key from being processed by the text box
         [:div
-         {:class (str "chosen-container chosen-container-single" (when @drop-showing? " chosen-container-active chosen-with-drop"))
-          :style {:flex  (if width "0 0 auto" "auto")
-                  :width (when width width)
+         {:class (str "rc-dropdown chosen-container chosen-container-single" (when @drop-showing? " chosen-container-active chosen-with-drop"))
+          :style {:flex       (if width "0 0 auto" "auto")
+                  :align-self "flex-start"
+                  :width      (when width width)
                   :-webkit-user-select "none"}} ;; Prevent user text selection
          [dropdown-top tmp-model choices tab-index placeholder dropdown-click key-handler filter-box drop-showing?]
          (when (and @drop-showing? (not disabled))


Improve error messages when we can't build ASTs

This fixes clojure-emacs/clj-refactor#274

--- src/refactor_nrepl/analyzer.clj
+++ src/refactor_nrepl/analyzer.clj
@@ -91,7 +91,9 @@
 (defn- throw-ast-in-bad-state
   [file-content msg]
   (throw (IllegalStateException.
-              (str (first (parse-ns file-content)) " is in a bad state! Error: " msg))))
+          (str "refactor-nrepl is unable to build an AST for "
+               (first (parse-ns file-content))
+               ". tools.analyzer encountered the following problem: " msg))))

 (defn ns-ast
   "Build AST for a namespace"


Add nicer error output on exception

Add nicer error output on exception

--- src/robinson/autoreloadcore.clj
+++ src/robinson/autoreloadcore.clj
@@ -1,7 +1,10 @@
 (ns robinson.autoreloadcore
   (:use ns-tracker.core
         clojure.stacktrace)
-  (:require robinson.main))
+  (:require robinson.main
+            [taoensso.timbre :as timbre]))
+
+(timbre/refer-timbre)

 (defn check-namespace-changes [track]
  (try
@@ -9,7 +12,7 @@
      (println "Reloading namespace:" ns-sym)
      (require ns-sym :reload)
      (println "Done."))
-   (catch Throwable e (.printStackTrace e)))
+   (catch Throwable e (error e)))
    (Thread/sleep 500))

 (defn start-nstracker []
@@ -38,8 +41,8 @@
         ; tick the old state through the tick-fn to get the new state
         (let [new-state (try
                           ((get-tick-fn) state)
-                          (catch Exception ex
-                            (print-stack-trace ex)
+                          (catch Throwable e
+                            (error e)
                             state))]
           (if (nil? new-state)
             (System/exit 0)


Reducing the size of history files

Reducing the size of history files

--- src/civs/logic/tribe_choices.clj
+++ src/civs/logic/tribe_choices.clj
@@ -168,7 +168,7 @@
             new-tribe (:tribe apply-res)
             new-game (or (:game apply-res) game)
             new-game (update-tribe new-game new-tribe)
-            params (assoc (:params apply-res) :tribe new-tribe)
+            params (assoc (:params apply-res) :tribe (.id new-tribe))
             msg (:msg apply-res)]
         (fact (:name event) params msg)
         {:game new-game :tribe new-tribe})


making sure thumnail returned as "default" or "image" is not retreived

--- src/saved_for_reddit/views.cljs
+++ src/saved_for_reddit/views.cljs
@@ -29,7 +29,7 @@
     (if visible?
       [:div {:class "panel panel-default"}
        [:div {:class "media"}
-        (if (not (= thumbnail "self"))
+        (if (not (or (= thumbnail "self") (= thumbnail "image") (= thumbnail "default")))
           (if (= thumbnail "nsfw")
             [:div {:class "media-left"}
              [:img {:class "media-object" :height "70em" :src "img/nsfw.png"}]]


Adjustments to previous gathering

Adjustments to previous gathering

--- src/clj/chili_dog_night/data.clj
+++ src/clj/chili_dog_night/data.clj
@@ -30,11 +30,13 @@
                           " "
                           (el/link-to "http://www.apa.org/monitor/jun06/emerging.aspx" "Adulthood")
                           [:br]
-                          (el/link-to "https://en.wikipedia.org/wiki/Red_velvet_cake" "Red Velvet")
-                          [:br]
                           (el/link-to "http://www.avclub.com/review/netflixs-fuller-house-porn-parody-without-porn-232696" "Fuller House is like a porn parody without the porn")
                           [:br]
                           (el/link-to "https://www.youtube.com/watch?v=fJWmbLS2_ec" "Kokomo")
+                          [:br]
+                          (el/link-to "https://en.wikipedia.org/wiki/Red_velvet_cake" "Red Velvet")
+                          [:br]
+                          (el/link-to "https://www.youtube.com/watch?v=FR3u0WSEcgE" "#eatlikeaking")
                           [:br]
                           (el/link-to "https://www.youtube.com/watch?v=UCJJ1iZuoQ4" "Dekkar")
                           " performs at "
@@ -51,6 +53,8 @@
                           (el/link-to "https://www.youtube.com/watch?v=8jzDnsjYv9A" "Writing's on the Wall")
                           [:br]
                           (el/link-to "https://en.wikipedia.org/wiki/Neanderthal" "Neanderthals")
+                          [:br]
+                          (el/link-to "https://www.youtube.com/watch?v=eW5_ZUFaKEw" "Spit Takes")
                           [:br]
                           (el/link-to "http://gawker.com/centennials-are-the-new-millennials-are-the-new-menaces-1705468073" "Centennials")]}
                  {:date "2016/02/24"


Reimplements empty grid creation by using core.matrix

--- src/cljc/game_of_life/rules.cljc
+++ src/cljc/game_of_life/rules.cljc
@@ -77,6 +77,4 @@
 (defn create-empty-grid
   "Creates a new cell grid"
   [rows columns]
-  (->> (repeat (vec (take columns (repeat 0))))
-       (take rows)
-       vec))
+  (matrix/emap (constantly 0) (matrix/new-matrix rows columns)))


Add a confirmation before deleting

Add a confirmation before deleting

--- src/cljs/hyphen_keeper/core.cljs
+++ src/cljs/hyphen_keeper/core.cljs
@@ -87,7 +87,7 @@
       {:on-click start}
       [:span.glyphicon.glyphicon-edit {:aria-hidden true}] " Edit"]
      [:button.btn.btn-default
-      {:on-click remove}
+      {:on-click #(when (js/confirm (str "Really delete hyphenation pattern for " word "?")) (remove))}
       [:span.glyphicon.glyphicon-trash {:aria-hidden true}] " Delete"]]]])

 (defn- hyphenation-pattern-edit-ui


fix my badges page

fix my badges page

--- src/cljs/salava/badge/ui/my.cljs
+++ src/cljs/salava/badge/ui/my.cljs
@@ -6,7 +6,7 @@
     [clojure.set :as set :refer [intersection]]
     [clojure.string :refer [upper-case]]
     [salava.core.ui.ajax-utils :as ajax]
-    [salava.core.ui.helper :as h :refer [unique-values navigate-to path-for  not-activated? private? js-navigate-to]]
+    [salava.core.ui.helper :as h :refer [unique-values navigate-to path-for  not-activated? private? js-navigate-to current-path current-route-path]]
     [salava.core.ui.notactivated :refer [not-activated-banner]]
     [salava.core.ui.layout :as layout]
     [salava.core.ui.grid :as g]
@@ -105,7 +105,13 @@
 (defn open-modal [id state]
   (ajax/GET
     (path-for (str "/obpv1/badge/info/" id))
-    {:handler (fn [data] (mo/open-modal [:badge :info] {:badge-id id :data data} {:hide (fn [] (init-data state))}))}))
+    {:handler (fn [data] (mo/open-modal [:badge :info] {:badge-id id :data data} {:hidden (fn []
+                                                                                (do
+                                                                                (if (clojure.string/includes? (str js/window.location.href) (path-for (str "/badge?id=" id)))
+                                                                                (.replaceState js/history {} "Badge modal" (path-for "/badge"))
+                                                                                (navigate-to (current-route-path)))
+                                                                                (init-data state))
+                                                                                )}))}))

 (defn content [state]
   (create-class {:reagent-render (fn [] [:div {:id "my-badges"}


Commented out integer_tag... instructions for genomes and zips because no literal syntax for these; lein release :patch

--- src/clojush/instructions/tag.clj
+++ src/clojush/instructions/tag.clj
@@ -255,25 +255,26 @@
                  (pop-item :integer state))
       state)))

-(define-registered
-  integer_tag_zip_instruction
-  ^{:stack-types [:integer :tag :exec :zip]}
-  (fn [state]
-    (if (not (empty? (:integer state)))
-      (push-item (symbol (str "tag_zip_" (mod (#(if (neg? %) (- %) %) (stack-ref :integer 0 state))
-                                              @global-tag-limit)))
-                 :exec
-                 (pop-item :integer state))
-      state)))
-
-(define-registered
-  integer_tag_genome_instruction
-  ^{:stack-types [:integer :tag :exec :genome]}
-  (fn [state]
-    (if (not (empty? (:integer state)))
-      (push-item (symbol (str "tag_genome_" (mod (#(if (neg? %) (- %) %) (stack-ref :integer 0 state))
-                                                 @global-tag-limit)))
-                 :exec
-                 (pop-item :integer state))
-      state)))
-
+;(define-registered
+;  integer_tag_zip_instruction
+;  ^{:stack-types [:integer :tag :exec :zip]}
+;  (fn [state]
+;    (if (not (empty? (:integer state)))
+;      (push-item (symbol (str "tag_zip_" (mod (#(if (neg? %) (- %) %) (stack-ref :integer 0 state))
+;                                              @global-tag-limit)))
+;                 :exec
+;                 (pop-item :integer state))
+;      state)))
+
+;(define-registered
+;  integer_tag_genome_instruction
+;  ^{:stack-types [:integer :tag :exec :genome]}
+;  (fn [state]
+;    (if (not (empty? (:integer state)))
+;      (push-item (symbol (str "tag_genome_" (mod (#(if (neg? %) (- %) %) (stack-ref :integer 0 state))
+;                                                 @global-tag-limit)))
+;                 :exec
+;                 (pop-item :integer state))
+;      state)))
+
+


fixed one should_spec error

fixed one should_spec error

--- spec/cljx/speclj/should_spec.cljx
+++ spec/cljx/speclj/should_spec.cljx
@@ -132,7 +132,6 @@

       )

-
     (context "two collections"
       (it "passes if target contains all items"
         (should-pass! (should== [1 2 3] [1 2 3])))
@@ -369,11 +368,10 @@

   (it "should-not-throw tests that nothing was thrown"
     (should-pass! (should-not-throw (+ 1 1)))
-    (should-fail! (should-not-throw (throw (throwable "error"))))
-;    (should= (str "Expected nothing thrown from: " (pr-str '(throw (new-throwable "error"))) endl
-;               "                     but got: " (pr-str (new-throwable "error")))
-;      (failure-message (should-not-throw (throw (new-throwable "error")))))
-      )
+    (should-fail! (should-not-throw (throw (new-throwable "error"))))
+    (should= (str "Expected nothing thrown from: " (pr-str '(throw (new-throwable "error"))) endl
+               "                     but got: " (pr-str (new-throwable "error")))
+      (failure-message (should-not-throw (throw (new-throwable "error"))))))

   (context "should-be-a"


Catch throwable in error-plugin

Catch throwable in error-plugin

--- src/com/wsscode/pathom/core.cljc
+++ src/com/wsscode/pathom/core.cljc
@@ -233,7 +233,7 @@
       (reader env)
       (try
         (reader env)
-        (catch #?(:clj Exception :cljs :default) e
+        (catch #?(:clj Throwable :cljs :default) e
           (swap! errors* assoc path (if process-error (process-error env e)
                                                       #?(:clj (Throwable->map e)
                                                          :cljs e)))


Infer (ident ...) and :keyfn automatically if props include :db/id

--- src/main/workflo/macros/view.clj
+++ src/main/workflo/macros/view.clj
@@ -4,11 +4,6 @@
             [workflo.macros.util.string :refer [camel->kebab]]))

 ;;;; Om Next query generation
-
-(defn generate-query-fn
-  "Generate a (query ...) function from the props spec."
-  [props]
-  (list 'query (p/om-query props)))

 (def fn-specs
   "Function specifications for all functions that are not Object
@@ -55,12 +50,43 @@
   (let [alias (fn-alias f)]
     `(~alias ~@body)))

+(defn generate-ident-fn
+  "Generate a (ident ...) function from the props spec."
+  [props]
+  (list 'ident '[:db/id id]))
+
+(defn generate-key-fn
+  "Generate a (key ...) function from the props spec."
+  [props]
+  (list 'key 'id))
+
+(defn generate-query-fn
+  "Generate a (query ...) function from the props spec."
+  [props]
+  (list 'query (p/om-query props)))
+
+(defn maybe-generate-ident-fn
+  "If the props spec includes a :db/id property, an (ident ...)
+   function is automatically generated based on this ID."
+  [props fns]
+  (cond-> fns
+    (some #{'db/id} (map :name props))
+    (conj (generate-ident-fn props))))
+
+(defn maybe-generate-key-fn
+  "If the props spec includes a :db/id property, a (key ...)
+   function is automatically generated based on this ID."
+  [props fns]
+  (cond-> fns
+    (some #{'db/id} (map :name props))
+    (conj (generate-key-fn props))))
+
 (defn maybe-generate-query-fn
   "If (query ...) is missing from fns, it is generated automatically
    from the props spec."
-  [fns props]
+  [props fns]
   (cond-> fns
-    (not (some '#{query} (map first fns)))
+    (not (some #{'query} (map first fns)))
     (conj (generate-query-fn props))))

 (defn raw-fn?
@@ -130,13 +156,14 @@
    (let [prop-specs         (take-while vector? forms)
          props              (p/parse (first prop-specs))
          computed           (p/parse (second prop-specs))
-         fns                (drop-while vector? forms)
-         fns-aliased        (map resolve-fn-alias fns)
-         fns-with-query     (maybe-generate-query-fn fns-aliased props)
-         fns-with-args      (map maybe-inject-fn-args fns-with-query)
-         fns-with-names     (map normalize-fn-name fns-with-args)
-         fns-with-props     (map #(inject-props % props computed)
-                                 fns-with-names)
+         fns-with-props     (->> (drop-while vector? forms)
+                                 (maybe-generate-ident-fn props)
+                                 (maybe-generate-key-fn props)
+                                 (maybe-generate-query-fn props)
+                                 (map resolve-fn-alias)
+                                 (map maybe-inject-fn-args)
+                                 (map normalize-fn-name)
+                                 (map #(inject-props % props computed)))
          factory-fns        (filter #(= (fn-scope %) :factory)
                                     fns-with-props)
          factory-params     (zipmap (map (comp keyword first)


Fixed #80 "Reply function broken"

Fixed #80 "Reply function broken"

- renamed "coalesce"to "first-non-nil" as it's more fitting
- introduced a "field-value" var to not calculate "first-non-nil" twice

--- src/statuses/routing.clj
+++ src/statuses/routing.clj
@@ -68,14 +68,15 @@
                             "text/html;charset=utf-8"
                             (list-page items next request)))))))

-(defn coalesce [& vals]
+(defn first-non-nil [& vals]
   (first (filter (complement nil?) vals)))

 (defn new-update [{:keys [form-params] :as request}]
   (let [{:strs [entry-text reply-text reply-to]} form-params
-        length (.length (coalesce entry-text reply-text))]
+        field-value (first-non-nil entry-text reply-text)
+        length (.length field-value)]
     (if (<= length max-length)
-      (do (swap! db core/add-update (user request) (coalesce entry-text reply-text) (parse-num reply-to nil))
+      (do (swap! db core/add-update (user request) field-value (parse-num reply-to nil))
           (resp/redirect "/statuses"))
       (resp/redirect (str "/statuses/too-long/" length)))))


kibana needs to have a public ip for ES policy

--- src/terraboot/elasticsearch.clj
+++ src/terraboot/elasticsearch.clj
@@ -118,6 +118,7 @@
                                                                            (vpc-id-of "aws_security_group" "sends_influx")
                                                                            (vpc-id-of "aws_security_group" "all-servers")]
                                                   :subnet_id (vpc-id-of "aws_subnet" "private-a")
+                                                  :associate_public_ip_address true
                                                   })


Allow `:span-reqs nil` to disable scan/query request spanning

--- src/taoensso/faraday.clj
+++ src/taoensso/faraday.clj
@@ -575,13 +575,13 @@
   [more-f {max-reqs :max :keys [throttle-ms]} last-result]
   (loop [{:keys [unprocessed last-prim-kvs] :as last-result} last-result idx 1]
     (let [more (or unprocessed last-prim-kvs)]
-      (if (or (empty? more) (>= idx max-reqs))
+      (if (or (empty? more) (nil? max-reqs) (>= idx max-reqs))
         (if-let [items (:items last-result)]
           (with-meta items (dissoc last-result :items))
           last-result)
         (let [merge-results (fn [l r] (cond (number? l) (+    l r)
-                                            (vector? l) (into l r)
-                                            :else               r))]
+                                           (vector? l) (into l r)
+                                           :else               r))]
           (when throttle-ms (Thread/sleep throttle-ms))
           (recur (merge-with merge-results last-result (more-f more))
                  (inc idx)))))))


Revert order of startup calls so that lifecycle order is maintained

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -597,14 +597,15 @@
                            :onyx.core/replica replica
                            :onyx.core/state state}

-            pipeline-data (merge pipeline-data ((:onyx.core/compiled-before-task-start-fn pipeline-data) pipeline-data))
             pipeline (build-pipeline catalog-entry pipeline-data)
             pipeline-data (assoc pipeline-data :onyx.core/pipeline pipeline)

             ex-f (fn [e] (handle-exception e restart-ch outbox-ch job-id))
             _ (while (and (first (alts!! [kill-ch task-kill-ch] :default true))
                           (not (munge-start-lifecycle pipeline-data)))
-                (Thread/sleep (or (:onyx.peer/peer-not-ready-back-off opts) 2000)))]
+                (Thread/sleep (or (:onyx.peer/peer-not-ready-back-off opts) 2000)))
+
+            pipeline-data (merge pipeline-data ((:onyx.core/compiled-before-task-start-fn pipeline-data) pipeline-data))]

         (>!! outbox-ch (entry/create-log-entry :signal-ready {:id id}))


Multiple definition ow windowed-task?

Multiple definition ow windowed-task?

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -50,10 +50,6 @@

 (defn add-completion-id [id m]
   (assoc m :completion-id id))
-
-(defn windowed-task? [event]
-  (or (not-empty (:onyx.core/windows event))
-      (not-empty (:onyx.core/triggers event))))

 (defn sentinel-found? [event]
   (seq (filter #(= :done (:message %))


Changes to play-note, construct-piece and play-piece

--- src/tenor/constructs.clj
+++ src/tenor/constructs.clj
@@ -162,22 +162,22 @@

 ;; --- Playback --- ;;

-(defmacro play-note [time player entity]
+(defmacro play-note [pivot-time position base-time player entity]
   "Take time, instrument and note entity as arguments,
   and return overtone code that plays the note."
-  `(list 'at ~time (list ~player ~entity)))
+  `(list 'at
+         `(+ pivot-time ~(* ~position ~base-time))
+         (list ~player ~entity)))

 (defmacro construct-piece [entity-maps base-time player pivot-time]
   "Take an entity map and run play-note on each
   note, creating a list of overtone playback code components."
-  `(map #(play-note (+ ~pivot-time (* (:pos %) ~base-time))
-                         ~player (:note %))
-        ~entity-maps))
+  `(map #(play-note pivot-time (:pos %) ~base-time ~player (:note %)) ~entity-maps))

 (defn play-piece [entity-maps base-time player
                     & {:keys [pivot-time] :or {pivot-time (now)}}]
   "Play the constructed piece with current time as start time."
-  `(let [time# ~pivot-time]
+  `(let [pivot-time (now)]
      ~@(construct-piece entity-maps base-time player pivot-time)))

 ;; --- Multiple voices --- ;;


Story ID: RPC-236 Added docstring for parse-arrow-count that describes why provided arrow counts cannot be zero.

--- src/untangled_spec/provided.clj
+++ src/untangled_spec/provided.clj
@@ -4,14 +4,23 @@
             )
   )

-(defn parse-arrow-count [sym]
+(defn parse-arrow-count
+  "parses how many times the mock/stub should be called with.
+   * => implies 1+,
+   * =yx=> implies exactly y times.
+   Provided arrow counts cannot be zero because mocking should
+      not be a negative assertion, but a positive one.
+   IE: verify that what you want to be called is called instead,
+      or that, if necessary, it should throw an error if called."
+  [sym]
   (let [nm (name sym)
-        number (re-find #"\d+" nm)]
+        number (re-find #"\d+" nm)
+        not-zero-msg "Arrow count must not be zero in provided clauses."]
     (assert (re-find #"^=" nm) "Arrows must start with = (try =#x=>)")
     (assert (re-find #"=>$" nm) "Arrows must end with => (try =#x=>)")
     (cond
       (= "=>" nm) :many
-      (= "0" number) (assert false "Arrow count must not be zero in provided clauses.")
+      (= "0" number) (assert false not-zero-msg)
       number (Integer/parseInt number)
       )
     )


Almost there! Completely broken. But almost there.

--- src-cljs/githubcomments/core.cljs
+++ src-cljs/githubcomments/core.cljs
@@ -6,11 +6,18 @@
             [githubcomments.github :refer [repo-comments
                                            render-user-content-markdown]]))

+(defn display-comments [comments element]
+  (go-loop [merged (async/merge comments)]
+           (let [comment (<! merged)
+                 current (.-innerHTML element)]
+             (set! (.-innerHTML element) (str current comment)))
+           (recur)))
+
 (defn rendered-comment [repo comment]
   "Render the given comment in the context of the given repository."
   (go (let [response (async/<!
                        (render-user-content-markdown (:body comment) repo))]
-        (.log js/console (:body response)))))
+        (:body response))))

 (enable-console-print!)

@@ -22,6 +29,7 @@
             repo [(dataset/get element "repositoryOwner")
                   (dataset/get element "repositoryName")]
             response (async/<! (repo-comments repo))]
-        (apply println (rendered-comments repo (:body response))))))
+        (apply display-comments
+               [(rendered-comments repo (:body response)) element]))))

 (init)


provide sensible defaults for the configuration.

--- src/org/spootnik/warp/config.clj
+++ src/org/spootnik/warp/config.clj
@@ -1,15 +1,25 @@
 (ns org.spootnik.warp.config
-  (:require [clj-yaml.core :as yaml]))
+  (:require [clj-yaml.core          :as yaml]
+            [org.spootnik.logconfig :refer [start-logging!]]))

-(def default-logging
-  "Logging can be bypassed if a log4j configuration is provided to the underlying JVM"
-  {:use "org.spootnik.logconfig/start-logging!"
-   :pattern "%p [%d] %t - %c - %m%n"
-   :external false
-   :console true
-   :files  []
-   :level  "info"
-   :overrides {:org.spootnik.warp "debug"}})
+(defn defaults
+  [key config]
+  (let [defaults {:logging
+                  {:pattern "%p [%d] %t - %c - %m%n"
+                   :external false
+                   :console true
+                   :files  []
+                   :level  "info"
+                   :overrides {:org.spootnik.warp "debug"}}
+                  :codec
+                  {:use "org.spootnik.warp.codec/json-codec"}
+                  :transport
+                  {:use "org.spootnik.warp.transport.redis/redis-transport"}
+                  :security
+                  {:use "org.spootnik.warp.security/rsa-store"}
+                  :scenarios
+                  {:use "org.spootnik.warp.api/standard-scenario-store"}}]
+    (merge (get defaults key) (get config key))))

 (defn find-ns-var
   "Find a symbol in a namespace"
@@ -44,11 +54,11 @@
 (defn init
   [path]
   (let [config    (read-config path)
-        logging   (get-instance (merge default-logging (:logging config)))
-        codec     (get-instance (:codec config))
-        signer    (get-instance (:security config))
-        transport (get-instance (:transport config) codec signer)
-        scenarios (get-instance (:scenarios config))]
+        logging   (start-logging! (defaults :logging config))
+        codec     (get-instance  (defaults :codec config))
+        signer    (get-instance (defaults :security config))
+        transport (get-instance (defaults :transport config) codec signer)
+        scenarios (get-instance (defaults :scenarios config))]
     (assoc config
       :transport transport
       :codec     codec


update and delete endpoints ported.

update and delete endpoints ported.

--- src/metabase/api/emailreport.clj
+++ src/metabase/api/emailreport.clj
@@ -46,36 +46,39 @@
   ; we require admin/default perms on the org to do this operation
   (check-403 ((:perms-for-org @*current-user*) organization))
   ;; TODO - validate that for public_perms, mode, etc are within their expected set of possible values
-  (->> (-> body
-         (select-keys [:organization :name :description :public_perms :mode :dataset_query :email_addresses :schedule])
-         (clojure.set/rename-keys {:organization :organization_id})
-         (assoc :creator_id *current-user-id*))
-    (mapply ins EmailReport)))
+  ;; TODO - deal with recipients
+  (check-500 (->> (-> body
+                    (select-keys [:organization :name :description :public_perms :mode :dataset_query :email_addresses :schedule])
+                    (clojure.set/rename-keys {:organization :organization_id})
+                    (assoc :creator_id *current-user-id*))
+               (mapply ins EmailReport))))

 (defendpoint GET "/:id" [id]
-  ; user must have read permissions on the report
+  ; user must have READ permissions on the report
   (let-404 [{:keys [can_read] :as report} (sel :one EmailReport :id id)]
     (check-403 @can_read)
     (hydrate report :creator :organization :can_read :can_write)))

-;(defendpoint PUT "/:id" [id :as {{:keys [sql timezone version] :as body} :body}]
-;  ;; TODO - check that database exists and user has permission (if specified)
-;  (let-404 [{:keys [can_write] :as query} (sel :one Query :id id)]
-;    (check-403 @can_write)
-;    (check-500 (-> (merge query body)
-;                 (#(mapply upd Query id %))))
-;    (-> (sel :one Query :id id)
-;      (hydrate :creator :database))))
-;
-;
-;(defendpoint DELETE "/:id" [id]
-;  (let-404 [{:keys [can_write] :as query} (sel :one [Query :id :creator_id :public_perms] :id id)]
-;    (check-403 @can_write)
-;    (del Query :id id)))
-;
-;
+(defendpoint PUT "/:id" [id :as {body :body}]
+  ; user must have WRITE permissions on the report
+  (let-404 [{:keys [can_write] :as report} (sel :one EmailReport :id id)]
+    (check-403 @can_write)
+    ;; TODO - validate that for public_perms, mode, etc are within their expected set of possible values
+    ;; TODO - deal with recipients
+    (check-500 (->> (util/select-non-nil-keys body :name :description :public_perms :mode :dataset_query :email_addresses :schedule)
+                 (mapply upd EmailReport id)))
+    (-> (sel :one EmailReport :id id)
+      (hydrate :creator :database :can_read :can_write))))
+
+
+(defendpoint DELETE "/:id" [id]
+  (let-404 [{:keys [can_write] :as report} (sel :one EmailReport :id id)]
+    (check-403 @can_write)
+    (del EmailReport :id id)))
+
+
 ;(defendpoint POST "/:id" [id]
 ;  ;; TODO - implementation (execute a query)
 ;  {:TODO "TODO"})


cleanup

cleanup

--- src/babel/espanol/morphology.cljc
+++ src/babel/espanol/morphology.cljc
@@ -553,8 +553,7 @@
          plural-to-singular-noun-masc-2
          plural-to-singular-adj-masc
          plural-to-singular-adj-fem-plur
-         plural-to-singular-adj-fem-sing
-         )
+         plural-to-singular-adj-fem-sing)

         analyzed
         (remove fail?


s/DEBUG/TRACE/

s/DEBUG/TRACE/

--- src/babel/espanol/morphology.cljc
+++ src/babel/espanol/morphology.cljc
@@ -607,7 +607,7 @@
                                    merge-fn (:merge-fn path-and-merge-fn)]
                                ;; a lexeme-kv is a pair of a key and value. The key is a string (the word's surface form)
                                ;; and the value is a list of lexemes for that string.
-                               (log/debug (str (first lexeme-kv) ": looking at path: " path))
+                               (log/trace (str (first lexeme-kv) ": looking at path: " path))
                                (mapcat (fn [lexeme]
                                          ;; this is where a unify/dissoc that supported
                                          ;; non-maps like :top and :fail, would be useful:


More vals.

More vals.

--- src/onyx/static/default_vals.clj
+++ src/onyx/static/default_vals.clj
@@ -10,4 +10,7 @@
    :onyx.peer/outbox-capacity 1000
    :onyx.peer/drained-back-off 400
    :onyx.peer/sequential-back-off 2000
-   :onyx.peer/job-not-ready-back-off 500})+   :onyx.peer/job-not-ready-back-off 500
+
+   :onyx.messaging/release-ch-buffer-size 10000
+   :onyx.messaging/retry-ch-buffer-size 10000})


Prevent "too much recursion" errors.

Prevent "too much recursion" errors.

--- src/leiningen/new/mies/core.cljs
+++ src/leiningen/new/mies/core.cljs
@@ -1,7 +1,8 @@
 (ns {{name}}.core
   (:require [clojure.browser.repl :as repl]))

-;; (repl/connect "http://localhost:9000/repl")
+;; (defonce conn
+;;   (repl/connect "http://localhost:9000/repl"))

 (enable-console-print!)


master: Make API return Polygon objects

master: Make API return Polygon objects

--- web/src/web/routes/services.clj
+++ web/src/web/routes/services.clj
@@ -31,25 +31,24 @@
                 :from 0
                 :size 2000)))

+(defn gen-small-polygon [point]
+  (let [[lat lon] point
+        sz 0.01]
+    [[(- lon sz) (- lat sz)]
+     [(- lon sz) (+ lat sz)]
+     [(+ lon sz) (+ lat sz)]
+     [(+ lon sz) (- lat sz)]
+     [(- lon sz) (- lat sz)]]))
+
 (defn bucket->feature [name unit bucket]
   (let [point (read-string (:key bucket))
         value (get-in bucket [:avg_value :value])]
     {:type "Feature"
-     :geometry {:type "Point"
-                :coordinates point}
+     :geometry {:type "Polygon"
+                :coordinates (gen-small-polygon point)}
      :properties {:name name
                   :unit unit
                   :value value}}))
-
-(comment
-  (s/defschema GeoJSON
-    {:type String
-     :features [{:type String
-                 :geometry {:type String
-                            :coordinates [Double]}
-                 :properties {:name String
-                              :unit String
-                              :value Double}}]}))

 (defn to-geo-json [resp]
   (let [aggs (esrsp/aggregations-from resp)
@@ -61,28 +60,6 @@
     {:type "FeatureCollection"
      :features features}))

-(comment
-  (defapi service-routes
-    (ring.swagger.ui/swagger-ui
-     "/swagger-ui"
-     :api-url "/swagger-docs")
-    (swagger-docs
-     :title "Sample api")
-    (swaggered "waterquality"
-               :description "Water quality data search API"
-               (context "/api" []
-
-                        (GET* "/search" []
-                              :return       GeoJSON
-                              :query-params [name :- String
-                                             w :- Double
-                                             s :- Double
-                                             e :- Double
-                                             n :- Double
-                                             year :- String]
-                              :summary      "Query water quality data of given year within a bound box range"
-                              (to-geo-json (water-quality-search name w s e n year)))))))
-
 (defroutes service-routes
   (GET "/api/search" [name w s e n year]
        {:status 200


add content_type field

add content_type field

--- src/brainbot/nozzle/esconnect.clj
+++ src/brainbot/nozzle/esconnect.clj
@@ -35,6 +35,7 @@
                     :omit_norms true},
              :lastmodified {:type "date", :store "yes"},
              :content {:type "string", :store "yes"},
+             :content_type {:type "string", :store "yes" :index "not_analyzed"},
              :title   {:type "string", :store "yes"},
              :deny_token_document token,
              :allow_token_document token}},
@@ -60,6 +61,12 @@
   "convert elasticsearch date string to unix timestamp"
   [lastmodified]
   (quot (tcoerce/to-long (tcoerce/from-string lastmodified)) 1000))
+
+
+(defn strip-mime-type-parameters
+  "strip mime type parameters from mime type string"
+  [s]
+  (string/trim (first (string/split s #";" 2))))

 (defn ensure-index-and-mappings
@@ -184,6 +191,11 @@
              id
              {:parent parent-id
               :content (get-in body [:extract :tika-content :text])
+              :content_type (strip-mime-type-parameters
+                             (or
+                              (first (get-in body [:extract :tika-content :content-type]))
+                              ""))
+
               :title title
               :tags (get-tags-from-path directory)
               :allow_token_document (simple-perms :allow)


run transaction first so emails don't get sent if there's an error

--- server/src/gratefulplace/db/transactions.clj
+++ server/src/gratefulplace/db/transactions.clj
@@ -16,8 +16,12 @@
                                     :post/created-at now
                                     :content/author author-id
                                     :db/id post-tempid})
-        watches (db/all :watch/topic [:watch/topic topic-id])]
+        watches (db/all :watch/topic [:watch/topic topic-id])
+        result (db/t [post
+                      {:db/id topic-id :topic/last-posted-to-at now}
+                      [:increment-watch-count topic-id author-id]])]

+    ;; TODO find a better home for this
     (future
       (doseq [watch watches]
         (let [user (c/mapify (:watch/user watch) mr/ent->user)]
@@ -26,9 +30,7 @@
                (not= author-id (:id user)))
             (mailer/send-post-notification user params)))))

-    {:result (db/t [post
-                    {:db/id topic-id :topic/last-posted-to-at now}
-                    [:increment-watch-count topic-id author-id]])
+    {:result result
      :tempid post-tempid}))

 (defn update-post


Ditch unused :refer symbols

Ditch unused :refer symbols

--- src/oxcart/passes/tree_shake.clj
+++ src/oxcart/passes/tree_shake.clj
@@ -16,7 +16,7 @@
             [oxcart.passes.defs :as defs]
             [clojure.set :as set]
             [clojure.tools.analyzer.ast :as ast]
-            [taoensso.timbre :refer [info warn error debug]]))
+            [taoensso.timbre :refer [info warn]]))

 (defn reach-set


use mutable cell for must-cache-paths state for cljs compatibility

--- src/clj/com/rpl/specter/impl.cljx
+++ src/clj/com/rpl/specter/impl.cljx
@@ -642,11 +642,11 @@
   #+cljs (atom {})
   )

-(def ^:dynamic *must-cache-paths* false)
+(def MUST-CACHE-PATHS (mutable-cell false))

 (defn must-cache-paths!
   ([] (must-cache-paths! true))
-  ([v] (alter-var-root #'*must-cache-paths* (constantly v))))
+  ([v] (set-cell! MUST-CACHE-PATHS v)))

 #+clj
 (defn add-path-cache! [k v]
@@ -707,7 +707,7 @@

 (defn- magic-precompilation* [p params-atom failed-atom]
   (let [magic-fail! (fn [& reason]
-                      (if *must-cache-paths*
+                      (if (get-cell MUST-CACHE-PATHS)
                         (println "Failed to cache path:" (apply str reason)))
                       (reset! failed-atom true)
                       nil)]
@@ -820,7 +820,7 @@
         path (magic-precompilation* prepared-path params-atom failed-atom)
         ]
     (if @failed-atom
-      (if *must-cache-paths*
+      (if (get-cell MUST-CACHE-PATHS)
         (throw-illegal "Failed to cache path")
         (->CachedPathInfo nil nil))
       (let [precompiled (comp-paths* path)


implement Nero Severn

implement Nero Severn

--- src/clj/game/cards-identities.clj
+++ src/clj/game/cards-identities.clj
@@ -291,6 +291,12 @@
    "Near-Earth Hub: Broadcast Center"
    {:events {:server-created {:msg "draw 1 card" :once :per-turn :effect (effect (draw 1))}}}

+   "Nero Severn: Information Broker"
+   {:abilities [{:req (req (has-subtype? current-ice "Sentry"))
+                 :once :per-turn
+                 :msg "jack out when encountering a sentry"
+                 :effect (effect (jack-out nil))}]}
+
    "New Angeles Sol: Your News"
    (let [nasol {:optional
                 {:prompt "Play a Current?" :player :corp


Don't try and stop a watch that hasn't been started

--- src/clj/herder/systems/solver.clj
+++ src/clj/herder/systems/solver.clj
@@ -19,7 +19,7 @@
   (stop [component]
     (if (-> component :pool nil? not)
       (.shutdownNow (:pool component)))
-    (if (-> component :watch deref nil? not)
+    (if (and (-> component :watch nil? not) (-> component :watch deref nil? not))
       (remove-watch (:tosolve component) (-> component :watch deref)))
     (dissoc component
             :pool


Sort the paredit help map

Sort the paredit help map

--- src/clojure/nightcode/editors.clj
+++ src/clojure/nightcode/editors.clj
@@ -160,7 +160,13 @@

 (defn paredit-help
   [_]
-  (s/alert (with-out-str (pp/pprint pw/advanced-keymap))))
+  (->> pw/advanced-keymap
+       (apply concat)
+       (cons #(compare %1 %2))
+       (apply sorted-map-by)
+       pp/pprint
+       with-out-str
+       s/alert))

 (defn focus-on-field
   [id]


shop specs WIP

shop specs WIP

--- src/clojure/nossal/shop/spec.cljc
+++ src/clojure/nossal/shop/spec.cljc
@@ -4,8 +4,10 @@

 (def email-regex #"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$")
 (def phone-regex #"^(?:(?:\+|00)?(55)\s?)?(?:\(?([1-9][0-9])\)?\s?)?(?:((?:9\d|[2-9])\d{3})\-?(\d{4}))$")
+(def cep-regex #"^[0-9]{5}-[0-9]{3}$")

 (s/def ::category string?)
+(s/def ::categories (s/col-of ::category :distinct true :into []))

 (s/def ::id int?)
 (s/def ::quantity (s/and int? #(> % 0)))
@@ -41,15 +43,34 @@
 (s/def ::basket-itens (s/coll-of ::basket-item :kind vector? :distinct true :into []))
 (s/def ::basket (s/keys :req-un [::id ::basket-itens]))

+
+(s/def ::cep (s/def (s/and string? #(re-matches cep-regex %))))
+(s/def ::street-address (s/keys :req [::street ::number]
+                                :opt [::building ::apt]))
+
+(s/def ::country #{:brazil})
+(s/def ::address (s/keys :req [::cep
+                               ::country
+                               ::state
+                               ::city
+                               ::street-address]))
+
+(s/def ::shipping-tracker string?)
+
 (s/def ::order (s/keys :req-un [::id
                                 ::basket
                                 ::costumer
-                                ::time]))
-
+                                ::status
+                                ::payment
+                                ::shipping-tracker
+                                ::address
+                                ::creation-time]))
+(s/def ::name (s/keys :req [::first-name ::last-name]))
 (s/def ::costumer (s/keys :req [::id
                                 ::name
                                 ::email
                                 ::address]
-                          :opt [::phone]))
+                          :opt [::phone
+                                ::cpf]))

 (s/def ::db (s/keys :req-un [::products ::basket]))


Some fancy refactoring

Some fancy refactoring

--- src/clojure/picard/net/client.clj
+++ src/clojure/picard/net/client.clj
@@ -56,6 +56,31 @@
     opts)
    (opts :netty)))

+(defprotocol Client
+  (do-connect [_ app opts])
+  (do-release [_]))
+
+(defrecord BasicClient  [channel-group bootstrap]
+  Client
+  (do-connect [client app {host :host port :port :as opts}]
+    (let [bootstrap     (.bootstrap client)
+          channel-group (.channel-group client)
+          addr          (mk-socket-addr [host port])
+          pipeline      (mk-client-pipeline channel-group app opts)]
+      (.connect bootstrap addr pipeline)))
+  (do-release [client]
+    (receive
+     (.. client channel-group close)
+     (fn [_ _ _]
+       (.releaseExternalResources (.bootstrap client))))))
+
+(defrecord PooledClient [basic-client pool]
+  Client
+  (do-connect [client app opts]
+    (do-connect (.basic-client client) app opts))
+  (do-release [client]
+    (do-release (.basic-client client))))
+
 (defn client
   ([] (client {}))
   ([opts]
@@ -67,26 +92,15 @@
        (doseq [[k v] (merge-netty-opts opts)]
          (.setOption bootstrap k v))

-       ;; Configure the bootstrap
-       {::channel-group channel-group
-        ::bootstrap     bootstrap})))
+       (BasicClient. channel-group bootstrap))))

 (def default-client (client))

 (defn release
-  ([]
-     (release default-client))
-  ([{channel-group ::channel-group bootstrap ::bootstrap}]
-     (receive
-      (.close channel-group)
-      (fn [_ _ _]
-        (.releaseExternalResources bootstrap)))))
+  [client]
+  (.do-release client))

 (defn connect
   ([app opts] (connect default-client app opts))
-  ([client app {host :host port :port :as opts}]
-     (let [bootstrap     (client ::bootstrap)
-           channel-group (client ::channel-group)
-           addr         (mk-socket-addr [host port])
-           pipeline     (mk-client-pipeline channel-group app opts)]
-       (.connect bootstrap addr pipeline))))
+  ([client app opts]
+     (do-connect client app opts)))


add note on how we retrieve the symbol belonging to generated docset page

--- src/main/cljs_api_gen/docset.clj
+++ src/main/cljs_api_gen/docset.clj
@@ -171,7 +171,20 @@
     (let [refs-path (str docset-docs-path "/" (resolve-path "refs"))]
       (apply j/insert! sqlite-db :searchIndex
         (for [ref-file (list-dir refs-path)]
-          (let [encoded-name
+          (let [;; We want to retrieve the full name of the symbol belonging to
+                ;; this file.  We do this by decoding the original filename of
+                ;; the generated page.
+                ;;
+                ;; But, httrack can rename files by appending number suffixes
+                ;; to prevent collision on case-insensitive file systems. This
+                ;; is actually really helpful since it allows us to maintain
+                ;; compatibility with Windows and Mac, but prevents us from
+                ;; decoding the filenames straighaway.
+                ;;
+                ;; Luckily, httrack adds an html comment stamp containing the
+                ;; original filename, which we can parse:
+                ;;    <!-- Mirrored from <url-here> by HTTrack Website Copier ... -->
+                encoded-name
                 (second
                   (re-find #"github\.com/cljsinfo/cljs-api-docs/blob/catalog/refs/(.*)\.md "
                            (slurp ref-file)))


Correctly check for DOM nodes inside (extend-dom)

--- src/main/clojure/cascade/dom.clj
+++ src/main/clojure/cascade/dom.clj
@@ -260,7 +260,7 @@
       ; Never found an element node? Return the original nodes unchanged.
       (empty? queue) dom-nodes
       :let [node (first queue)]
-      (= (node :type) :element) (concat result [(extend-root-element node path position new-nodes)] (rest queue))
+      (element? node) (concat result [(extend-root-element node path position new-nodes)] (rest queue))
       :else (recur (conj result node) (rest queue)))))


Parse BigQuery ints as longs [ci drivers] (Credit: @felipegasparini)

--- src/metabase/driver/bigquery.clj
+++ src/metabase/driver/bigquery.clj
@@ -139,7 +139,7 @@
   "Functions that should be used to coerce string values in responses to the appropriate type for their column."
   {"BOOLEAN"   #(Boolean/parseBoolean %)
    "FLOAT"     #(Double/parseDouble %)
-   "INTEGER"   #(Integer/parseInt %)
+   "INTEGER"   #(Long/parseLong %)
    "RECORD"    identity
    "STRING"    identity
    "TIMESTAMP" parse-timestamp-str})


Add a workaround for odd conform output, likely related to CLJ-2003

--- src/main/workflo/macros/specs/conforming_query.cljc
+++ src/main/workflo/macros/specs/conforming_query.cljc
@@ -112,18 +112,28 @@
 (s/def :parameterization-value/parameters
   :workflo.macros.specs.query/parameters)

-(s/def ::parameterizatio-value
+(s/def ::parameterization-value
   (s/keys :req-un [:parameterization-value/query
                    :parameterization-value/parameters]))

 (s/def ::parameterization
-  (s/tuple #{:parameterization} ::parameterizatio-value))
+  (s/tuple #{:parameterization} ::parameterization-value))
+
+;; Workaround for extra [] around [:aliased-property ...] and
+;; [:prefixed-properties ...] in output of conform (JIRA issue
+;; CLJ-2003)
+(s/def ::bug-vector
+  (s/coll-of (s/or :property ::property
+                   :aliased-property ::aliased-property
+                   :prefixed-properties ::prefixed-properties)
+             :kind vector? :count 1))

 (s/def ::query-value
   (s/or :property ::property
         :aliased-property ::aliased-property
         :prefixed-properties ::prefixed-properties
-        :parameterization ::parameterization))
+        :parameterization ::parameterization
+        :bug-vector ::bug-vector))

 (s/def ::query
   (s/coll-of ::query-value :kind vector?


the snippets are good and display inside the js/alert pop-up.

--- src/app/cljs/one/sample/view.cljs
+++ src/app/cljs/one/sample/view.cljs
@@ -139,12 +139,12 @@
   :state)

 (defmethod render-fnx :init [_]
-  (js/alert "this is a fucking test!"))
+  (js/alert (str (:ns-nav snippets) (:fn-display snippets) (:spinner snippets)))
+  (comment (initialize-views-fnx (:ns-nav snippets) (:fn-display snippets) (:spinner snippets))))

 (dispatch/react-to #{:state-change} (fn [_ m] (render-fnx m)))

-;; ------------- fnx -------------
-
+;; ------------- fnx -------------

 (defn- form-fields-status
   "Given a map of old and new form states, generate a map with `:id`,


Some modifications for read-wiki

Some modifications for read-wiki

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- stuff/code/read-wiki.clj
+++ stuff/code/read-wiki.clj
@@ -10,23 +10,22 @@

 (use '[clojure.contrib.io :only (with-in-reader)]
      '[clojure.walk :only (walk)]
-     '[clojure.contrib.def :only (defnk)]
      '[conexp.base :only (set-of)])

 ;;;

-(defn line-to-pair
+(defn- line-to-pair
   "Converts RDF line to a pair [role [First Second]]."
   [line]
   (let [[A to B] (rest (re-find #"<(.*)> <(.*)> <(.*)>" line))]
     [to [A B]]))

-(defn map-count
+(defn- map-count
   "Counts overall entries in a map."
   [hash-map]
   (reduce + (map #(count (get hash-map %)) (keys hash-map))))

-(defn read-lines-from-file [file interesting-role? interesting-A? interesting-B?]
+(defn- read-lines-from-file [file interesting-role? interesting-A? interesting-B?]
   (with-in-reader file
     (binding [*in* (clojure.lang.LineNumberingPushbackReader. *in*)]
       (loop [map {},
@@ -46,28 +45,17 @@
             (println line-count)
             map))))))

-(defn role-count
-  "Returns a hash-map from role names to their cardinality."
-  [file]
-  (with-in-reader file
-    (binding [*in* (clojure.lang.LineNumberingPushbackReader. *in*)]
-      (loop [map {},
-             line-count 0]
-        (if-let [line (read-line)]
-          (do
-            (when (zero? (mod line-count 10000))
-              (println line-count (count map)))
-            (let [[role [A B]] (line-to-pair line)]
-              (recur (assoc map role (inc (get map role 0)))
-                     (inc line-count))))
-          map)))))
-
-(defn capitalize [word]
+(defn- capitalize
+  "Capitalizes word."
+  [word]
   (if (empty? word)
     word
     (apply str (Character/toUpperCase (first word)) (rest word))))

-(defn symbolify [coll]
+(defn- symbolify
+  "Transforms every string in coll to a symbol, walking through
+  sequential collectiones recursively."
+  [coll]
   ((fn transform [thing]
      (cond
       (string? thing) (symbol (capitalize thing)),
@@ -78,11 +66,11 @@
       :else thing))
    coll))

-(defn prepare-for-conexp [hash-map]
+(defn- prepare-for-conexp [hash-map]
   (into {} (for [[k v] (symbolify hash-map)]
              [k (set v)])))

-(defn role-map->concept-map [role-map]
+(defn- role-map->concept-map [role-map]
   (assert (= 1 (count role-map)))
   (loop [concept-map {},
          is-as (get role-map (first (keys role-map)))]
@@ -94,18 +82,24 @@

 ;;;

+(defvar *wikipedia-properties* "/users/lat/borch/wikiprops.nt"
+  "File containing the properties as defined by dbpedia")
+
+(defvar *wikipedia-instances* "/users/lat/borch/wikiinstances.nt"
+  "File containing the instances as defined by dbpedia")
+
 (defn read-wiki [roles]
   "Reads model from wikipedia entries. roles can be any quoted
   sequence of child, father, mother, influenced, influencedBy, relation,
   relative, spouse, partner, opponent, ..."
-  (let [relations (read-lines-from-file "/users/lat/borch/wikiprops.nt"
+  (let [relations (read-lines-from-file *wikipedia-properties*
                                         (set-of (str "http://dbpedia.org/ontology/" role)
                                                 [role roles])
                                         (constantly true)
                                         (constantly true)),
         instances (set (flatten (vals relations))),
         concepts (role-map->concept-map
-                  (read-lines-from-file "/users/lat/borch/wikiinstances.nt"
+                  (read-lines-from-file *wikipedia-instances*
                                         (constantly true)
                                         #(contains? instances %)
                                         #(not (re-find #"owl#Thing" %))))]
@@ -122,11 +116,16 @@
      'conexp.contrib.dl.languages.EL-gfp-exploration
      'conexp.contrib.dl.languages.interaction)

-(defn read-wiki-model [roles]
+(defn read-wiki-model
+  "For the given set of roles (as symbols) returns the smallest model
+  containing the interpretations of roles in the data-set of dbpedia."
+  [roles]
   (let [[concepts, roles] (read-wiki roles)]
     (interpretation->model concepts roles :base-lang EL-gfp)))

-(defn collect [start relation]
+(defn collect
+  "Returns the smallest connected subrelation of relation containing start."
+  [start relation]
   (let [related (set (for [[x y] relation,
                            :when (or (contains? start x)
                                      (contains? start y)),
@@ -135,6 +134,22 @@
     (if (= start related)
       start
       (recur related relation))))
+
+(defn smallest-submodel
+  "Returns the smallest submodel of model containing the given
+  individuals."
+  [model individuals]
+  (let [relation (reduce union #{} (map #(interpret model %) (role-names (model-language model)))),
+        base-set (collect (set individuals) relation),
+
+        name-int (into {} (for [name (concept-names (model-language model))]
+                            [name (intersection base-set (interpret model name))])),
+        role-int (let [base-square (cross-product base-set base-set)]
+                   (into {} (for [role (role-names (model-language model))]
+                              [role (intersection base-square (interpret model role))])))],
+    (make-model (model-language model)
+                base-set
+                (merge name-int role-int))))

 (defn explore-wiki-model
   "Computes a basis of gcis holding in wiki-model. Returns a reference


add planet titles

add planet titles

--- src/solar_system_of_js/core.cljs
+++ src/solar_system_of_js/core.cljs
@@ -444,30 +444,48 @@
     ))

 (defn draw-coffeescript!
-  [{:keys [alpha] :as opts}]
+  [{:keys [alpha highlight] :as opts}]
   (when-not (zero? alpha)
     (save!)
     (global-alpha! alpha)
     (draw-orbit! opts)
     (draw-planet! opts)
+    (when highlight
+      (font! "100 200px Roboto")
+      (text-baseline! "middle")
+      (text-align! "center")
+      (fill-style! "#566")
+      (fill-text! "COFFEESCRIPT" 0 -1400))
     (restore!)))

 (defn draw-dart!
-  [{:keys [alpha] :as opts}]
+  [{:keys [alpha highlight] :as opts}]
   (when-not (zero? alpha)
     (save!)
     (global-alpha! alpha)
     (draw-orbit! opts)
     (draw-planet! opts)
+    (when highlight
+      (font! "100 200px Roboto")
+      (text-baseline! "middle")
+      (text-align! "center")
+      (fill-style! "#DEE")
+      (fill-text! "DART" 0 -1700))
     (restore!)))

 (defn draw-clojurescript!
-  [{:keys [alpha] :as opts}]
+  [{:keys [alpha highlight] :as opts}]
   (when-not (zero? alpha)
     (save!)
     (global-alpha! alpha)
     (draw-orbit! opts)
     (draw-planet! opts)
+    (when highlight
+      (font! "100 300px Roboto")
+      (text-baseline! "middle")
+      (text-align! "center")
+      (fill-style! "#DEE")
+      (fill-text! "CLOJURESCRIPT" 3800 0))
     (restore!)))

 ;;--------------------------------------------------------------------------------


Completion fn.

Completion fn.

--- src/onyx/log/commands/common.clj
+++ src/onyx/log/commands/common.clj
@@ -323,20 +323,31 @@
   (fn [scheduler old new diff state]
     scheduler))

+(defmulti volunteer-via-completed-task?
+  (fn [scheduler old new diff state]
+    scheduler))
+
+(defn any-coverable-jobs? [replica]
+  (seq
+   (filter
+    (fn [job]
+      (let [tasks (get-in replica [:tasks job])]
+        (>= (count (get-in [replica :peers])) (count tasks))))
+    (:jobs replica))))
+
 (defmethod volunteer-via-new-job? :onyx.job-scheduler/greedy
   [scheduler old new diff state]
-  (when (zero? (count (incomplete-jobs old)))
-    (let [tasks (get-in new [:tasks (:job diff)])]
-      (>= (count (get-in [new :peers])) (count tasks)))))
+  (when-not (zero? (count (incomplete-jobs old)))
+    (any-coverable-jobs? new)))

 (defmethod volunteer-via-killed-job? :onyx.job-scheduler/greedy
   [scheduler old new diff state]
   (let [peers (get-in [old :allocations (first diff)])]
     (when (some #{(:id state)} (into #{} peers))
-      (seq
-       (filter
-        (fn [job]
-          (let [tasks (get-in new [:tasks job])]
-            (>= (count (get-in [new :peers])) (count tasks))))
-        (:jobs new))))))
-
+      (any-coverable-jobs? new))))
+
+(defmethod volunteer-via-completed-task? :onyx.job-scheduler/greedy
+  [scheduler old new diff state]
+  (when-not (some #{(:job diff)} (into #{} (incomplete-jobs new)))
+    (any-coverable-jobs? new)))
+


Subheader generation refactored for better performance

Signed-off-by: Volodymyr Kozieiev <f2778d839d9f3ad586693b057b494a6ec3a7ca24@gmail.com>

--- src/status_im/ui/screens/home/views/inner_item.cljs
+++ src/status_im/ui/screens/home/views/inner_item.cljs
@@ -20,53 +20,59 @@
   (letsubs [contact-name [:contacts/contact-name-by-identity from]]
     contact-name))

-(defn render-subheader-inline [acc {:keys [type destination literal children]}]
-  (case type
-    "paragraph"
-    (conj acc (reduce
-               (fn [acc e] (render-subheader-inline acc e))
-               [react/text-class " "]
-               children))
+;; if truncated subheader text is too short we won't get ellipsize at the end of text
+(def max-subheader-length 100)

-    "blockquote"
-    (conj acc (.substring literal 0 (dec (.-length literal))))
+(defn truncate-literal [literal]
+  (let [size (min max-subheader-length (.-length literal))]
+    {:components (.substring literal 0 size)
+     :length     size}))

-    "codeblock"
-    (conj acc (.substring literal 0 (dec (.-length literal))))
+(defn add-parsed-to-subheader [acc {:keys [type destination literal children]}]
+  (let [result (case type
+                 "paragraph"
+                 (reduce
+                  (fn [{:keys [_ length] :as acc-paragraph} parsed-child]
+                    (if (>= length max-subheader-length)
+                      (reduced acc-paragraph)
+                      (add-parsed-to-subheader acc-paragraph parsed-child)))
+                  {:components [react/text-class]
+                   :length     0}
+                  children)

-    "mention"
-    (conj acc [react/text-class
-               [mention-element literal]])
+                 "mention"
+                 {:components [react/text-class [mention-element literal]]
+                  :length 4} ;; we can't predict name length so take the smallest possible

-    "status-tag"
-    (conj acc [react/text-class
-               "#"
-               literal])
+                 "status-tag"
+                 (truncate-literal (str "#" literal))

-    "link"
-    (conj acc destination)
+                 "link"
+                 (truncate-literal destination)

-    (conj acc literal)))
+                 (truncate-literal literal))]
+    {:components (conj (:components acc) (:components result))
+     :length     (+ (:length acc) (:length result))}))

-(def max-length 40)
+(def subheader-wrapper
+  [react/text-class {:style               styles/last-message-text
+                     :number-of-lines     1
+                     :ellipsize-mode      :tail
+                     :accessibility-label :chat-message-text}])

 (defn render-subheader
-  "Render the chat subheader markdown inline, to a maximum of max-length characters"
+  "Render the preview of a last message to a maximum of max-subheader-length characters"
   [parsed-text]
-  (:elements
-   (reduce
-    (fn [{:keys [elements l] :as acc} {:keys [literal] :as e}]
-      (if (> l max-length)
-        (reduced acc)
-        {:elements (render-subheader-inline elements e)
-         :l (+ l (count literal))}))
-    {:length 0
-     :elements
-     [react/text-class {:style               styles/last-message-text
-                        :number-of-lines     1
-                        :ellipsize-mode      :tail
-                        :accessibility-label :chat-message-text}]}
-    parsed-text)))
+  (let [result
+        (reduce
+         (fn [{:keys [_ length] :as acc-text} new-text-chunk]
+           (if (>= length max-subheader-length)
+             (reduced acc-text)
+             (add-parsed-to-subheader acc-text new-text-chunk)))
+         {:components subheader-wrapper
+          :length     0}
+         parsed-text)]
+    (:components result)))

 (defn message-content-text [{:keys [content content-type]}]
   [:<>


Minor clarifications.

Minor clarifications.

--- src/tutorial/untangled_tutorial/B_UI_Exercises.cljs
+++ src/tutorial/untangled_tutorial/B_UI_Exercises.cljs
@@ -13,6 +13,13 @@
   In this tutorial we are going to build an app with just enough complexity to
   exercise the most significant features of Om. That said, we want it to be
   tractable.
+
+  NOTE - Namespace aliases used in this document:
+
+```clojure
+(require '[om.next :as om :refer-macros [defui]]
+         '[om.dom :as dom])
+```

   ")

@@ -77,7 +84,7 @@

   (render [this]
     ;; TODO: (ex 4) Obtain the 'computed' onDelete handler
-    (let [name "name"                                       ; TODO (ex 1): Get the Om properties from this
+    (let [name "What's my :person/name?"                    ; TODO (ex 1): Get the Om properties from this for `name` and `mate`
           mate nil
           checked false]                                    ; TODO (ex 3): Component local state
       (dom/li nil
@@ -111,7 +118,7 @@
   Object
   (render [this]
     ;; TODO (ex 4): Create a deletePerson function
-    (let [people []]                                        ; TODO (ex 2): Get yo stuff
+    (let [people []]                                        ; TODO (ex 2): `people` should come from the props
       (dom/div nil
         (if (= nil people)
           (dom/span nil "Loading...")
@@ -128,7 +135,7 @@
   (render [this]
     (let [widget nil
           new-person nil
-          last-error nil]                                   ; TODO (ex 2): Get yo stuff
+          last-error nil]                                   ; TODO (ex 2): Extract the proper props for each var.
       (dom/div nil
         (dom/div nil (when (not= "" last-error) (str "Error " last-error)))
         (dom/div nil
@@ -170,7 +177,7 @@
   (initLocalState [this] { map-of-data-to-store })
   ```

-  in the Object setion of your UI. Then use `om/get-state`, `om/update-state!`, and `om/set-state!` to
+  in the Object section of your UI. Then use `om/get-state`, `om/update-state!`, and `om/set-state!` to
   work with the state.

   Add component local state to your Person class, and update the UI so that when


Improve comment

Improve comment

--- src/ctia/entity/investigation.clj
+++ src/ctia/entity/investigation.clj
@@ -32,7 +32,7 @@
             CTIAEntity
             {(s/required-key :actions) (s/either s/Str {s/Keyword s/Any})
              (s/required-key :object_ids) [s/Str]
-             ;; "type:value"
+             ;; The value of this field should look like "type:value".
              (s/required-key :investigated_observables [s/Str])
              (s/required-key :targets [(f-schema/->schema IdentitySpecification)])
              s/Keyword s/Any}))


added fix-mname (converts kw to method name)

--- src/rosado/processing/applet.clj
+++ src/rosado/processing/applet.clj
@@ -10,12 +10,23 @@
             (binding [*applet* this#]
               (apply ~f args#)))))

+(defn- fix-mname
+  "Changes :method-name to :methodName."
+  [[mname fun]]
+  (let [mname (name mname)
+        mr (re-matcher #"\-[a-zA-z]" mname)
+        replace-fn (comp #(.replaceFirst mr %) toupper #(.substring % 1))
+        fixed-name (if-let [matched (re-find mr)]
+                     (replace-fn matched)
+                     mname)]
+    [(keyword fixed-name) fun]))
+
 (defmacro defapplet
   "Define an applet. Takes an app-name and a map of options."
   [app-name & opts]
   (let [options (assoc (apply hash-map opts) :name (str app-name))
         fns (dissoc options :name :title :size)
-        methods (reduce with-binding {} fns)]
+        methods (reduce with-binding {} (into {} (map fix-mname fns)))]
     `(def ~app-name
           (let [frame# (atom nil)
                 prx# (proxy [processing.core.PApplet


renamed bind-applets to with-binding

renamed bind-applets to with-binding

--- src/rosado/processing/applet.clj
+++ src/rosado/processing/applet.clj
@@ -2,7 +2,7 @@
   (:use [rosado.processing :except (size)])
   (:import (javax.swing JFrame)))

-(defn- bind-applets
+(defn- with-binding
   "Turn the method map into something one that update-proxy can use."
   [methods [method-name f]]
   (assoc methods (name method-name)
@@ -15,7 +15,7 @@
   [app-name & opts]
   (let [options (assoc (apply hash-map opts) :name (str app-name))
         fns (dissoc options :name :title :size)
-        methods (reduce bind-applets {} fns)]
+        methods (reduce with-binding {} fns)]
     `(def ~app-name
           (let [frame# (atom nil)
                 prx# (proxy [processing.core.PApplet