Use react's simulate for all event generation

--- mtodo/test/cljs/mtodo/test_helper.cljs
+++ mtodo/test/cljs/mtodo/test_helper.cljs
@@ -65,16 +65,12 @@

 (defn click! [div selector]
   (let [elem (.querySelector div (name selector))]
-    (let [event (.createEvent js/document "MouseEvent")]
-      (do
-        (.initMouseEvent event "click" {"view" js/window "bubbles" true "cancellable" true})
-        (.dispatchEvent elem event)))))
+    (sim/click elem nil)))

 (defn edit! [div selector value]
   (let [elem (.querySelector div (name selector))]
-    (let [event (.createEvent js/document "HTMLEvents")]
-      (do
-        (.focus elem)
-        (set! (.-value elem) value)
-        (sim/change elem nil)
-        (.blur elem)))))
+    (do
+      (.focus elem)
+      (set! (.-value elem) value)
+      (sim/change elem nil)
+      (.blur elem))))


Add private key loading from the standard environment var

--- src/gogolica/auth.clj
+++ src/gogolica/auth.clj
@@ -27,6 +27,20 @@
       (set-key!)
       (select-keys [:client_email :project_id])))

+(defn read-application-credentials
+  "Google specification for effortless auth on their services:
+  https://developers.google.com/identity/protocols/application-default-credentials
+  Supporting only reading from the standard environment variable for now;
+  this function reads the path from the variable, and loads the service account key
+  into the *service-account* var"
+  []
+  (try (key-from-file (System/getenv "GOOGLE_APPLICATION_CREDENTIALS"))
+       (catch Exception e nil)))
+
+(defn authenticated?
+  "If we are authenticated, return the email of the loaded service account"
+  []
+  (:client_email *service-account*))

 ;;;; JWT and OAuth2


PLD: use hatti app state if none passed

PLD: use hatti app state if none passed

--- src/hatti/shared.cljs
+++ src/hatti/shared.cljs
@@ -119,12 +119,13 @@

 (defn language-selector
   "A language selector and a following divider."
-  [_ owner {:keys [app-state]}]
+  [_ owner {custom-app-state :app-state}]
   (reify
     om/IRender
     (render [_]
       (let [{:keys [current all] :as ls}
-            (om/observe owner (language-cursor app-state))
+            (om/observe owner (language-cursor (or custom-app-state
+                                                   app-state)))
             get-update-handler (fn [language]
                                  (fn [event]
                                    (om/update! ls [:current] language)


[network] Add a predict function for running inputs through the network.

--- src/cortex/network.clj
+++ src/cortex/network.clj
@@ -110,20 +110,20 @@
     (map->TanhActivation {:output (m/zero-array shape)
                           :input-gradient (m/zero-array shape)})))

-(defrecord
+(defrecord
   ^{:doc "Used for multinomial classification (choose 1 of n classes), where the output
-  layer can be interpreted as class probabilities.  Softmax is a generalization of the
+  layer can be interpreted as class probabilities.  Softmax is a generalization of the
   logistic function for K-dimensional vectors that scales values between (0-1) that
   add up to 1.
-
+
             e^x_j
    h_j = -----------
            𝚺 e^x_i
-  "}
-  SoftmaxLoss [output]
-
-  cp/PNeuralTraining
-  (forward [this input]
+  "}
+  SoftmaxLoss [output]
+
+  cp/PNeuralTraining
+  (forward [this input]
     (m/assign! output input)
     (m/exp! output)
     ;; FIXME: (m/div! output (m/esum exponentials))
@@ -132,10 +132,10 @@
   (backward [this input output-gradient] output-gradient))

 (defrecord ^{:doc "The support vector machine (SVM) loss guides the output representation such
-  that the correct class is separated from incorrect classes by at least a
-  specified margin."}
+  that the correct class is separated from incorrect classes by at least a
+  specified margin."}
   SVMLayer [output input-gradient]
-
+
   cp/PNeuralTraining
     (forward [this input]
       (m/assign! output input))
@@ -316,21 +316,22 @@
   [data]
   (map #(m/get-row data %) (range (m/row-count data))))

+(defn predict
+  "Uses a trained network to predict a result."
+  [net data]
+  (->> (cp/forward net data)
+       (m/emap #(Math/round (double %)))))
+
 (defn evaluate
   "Evaluates a model with a given set of test data.
    Returns a [result score] pair"
-  ([net test-data test-labels]
-    (let [results (doall
-                    (map (fn [data label]
-                           (let [res (cp/forward net data)]
-                             (m/emap #(Math/round (double %)) res)))
-                         (row-seq test-data) (row-seq test-labels)))
-          res-labels (map vector results (row-seq test-labels))
-          score (count (filter #(m/equals (first %) (second %)) res-labels))]
-      (println "evaluated: " (take 10 res-labels))
-      [results score])))
-
-(defn evaluator
+  [net test-data test-labels]
+  (let [results (doall (map (partial predict net) (row-seq test-data)))
+        res-labels (map vector results (row-seq test-labels))
+        score (count (filter #(m/equals (first %) (second %)) res-labels))]
+    [results score]))
+
+(defn evaluator
   "Creates an evaluator for a given set of test data, as a function that can be applied to a model.
    The evalutor function takes a model and returns the error rate."
   ([test-data test-labels]


CMR-5094: Changed get variable concepts by associations to batch search.

--- indexer-app/src/cmr/indexer/data/concepts/variable.clj
+++ indexer-app/src/cmr/indexer/data/concepts/variable.clj
@@ -64,18 +64,17 @@
                                           "revision-id" (:associated-revision-id va)}))
                                       variable-associations))))})))

-(defn- variable-association->variable-concept
-  "Returns the variable concept and variable association for the given variable association."
-  [context variable-association]
-  (let [{:keys [variable-concept-id]} variable-association
-        variable-concept (mdb/find-latest-concept
-                          context
-                          {:concept-id variable-concept-id}
-                          :variable)]
-    (when-not (:deleted variable-concept)
-      ;; associate variable association into variable concept, so we can use it to generate
-      ;; elastic document for nested variables field
-      (assoc variable-concept :variable-association variable-association))))
+(defn- variable-associations->variable-concepts
+  "Returns the variable concepts for the given variable associations."
+  [context variable-associations]
+  (let [variable-concept-ids (map :variable-concept-id variable-associations)
+        id->association (zipmap variable-concept-ids variable-associations)
+        add-association-fn (fn [concept]
+                             (assoc concept :variable-association (get id->association (:concept-id concept))))
+        variable-concepts (mdb/get-latest-concepts context variable-concept-ids true)]
+    (->> variable-concepts
+         (filter #(not (:deleted %)))
+         (map add-association-fn))))

 (defn- variable-concept->elastic-doc
   "Converts the augmented variable concept into the portion going in the collection elastic document."
@@ -92,9 +91,7 @@
 (defn variable-associations->elastic-doc
   "Converts the variable association into the portion going in the collection elastic document."
   [context variable-associations]
-  (let [variable-concepts (remove nil?
-                                  (map #(variable-association->variable-concept context %)
-                                       variable-associations))
+  (let [variable-concepts (variable-associations->variable-concepts context variable-associations)
         variable-native-ids (map :native-id variable-concepts)
         variable-concept-ids (map :concept-id variable-concepts)
         variable-fields (map :extra-fields variable-concepts)


add #inst usage strings

add #inst usage strings

--- src/main/cljs_api_gen/syntax.clj
+++ src/main/cljs_api_gen/syntax.clj
@@ -92,7 +92,11 @@

    ;; available tagged literals
    {:display "#uuid \"\" literal"               :id "uuid-literal"  :type "tagged literal" :form "#uuid \"\"" :clj-doc doc-clj-tags :edn-doc (edn-doc "uuid-f81d4fae-7dec-11d0-a765-00a0c91e6bf6") :clj-added "1.4.0"}
-   {:display "#inst \"\" literal"               :id "inst-literal"  :type "tagged literal" :form "#inst \"\"" :clj-doc doc-clj-tags :edn-doc (edn-doc "inst-rfc-3339-format") :clj-added "1.4.0"}
+   {:display "#inst \"\" literal"               :id "inst-literal"  :type "tagged literal" :form "#inst \"\"" :clj-doc doc-clj-tags :edn-doc (edn-doc "inst-rfc-3339-format") :clj-added "1.4.0"
+    :usage ["#inst \"yyyy-mm-dd\""
+            "#inst \"yyyy-mm-ddThh:mm:ss\""
+            "#inst \"yyyy-mm-ddThh:mm:ssZ\""
+            "#inst \"yyyy-mm-ddThh:mm:ss-hh:mm\""]}
    {:display "#queue [] literal"                :id "queue-literal" :type "tagged literal" :form "#queue []"}
    {:display "#js []|{} literal"                :id "js-literal"    :type "tagged literal" :form ["#js {}" "#js []"]}


RS | #0 | Fix github issue 3 - 'Incorrect Error Message for Add Questions Pop-Up Box' - Due to incorrect title attribute

--- src/objective8/templates/page_furniture.clj
+++ src/objective8/templates/page_furniture.clj
@@ -166,7 +166,7 @@
   [:.clj-question-create-form] (html/prepend (html/html-snippet (anti-forgery-field)))

   [:.l8n-label-add-question] (html/content (translations :question-create/question-label))
-  [:.l8n-textarea-add-question] (html/set-attr "title" (translations :question-create/question-title))
+  [:.l8n-textarea-add-question] (html/set-attr :title (translations :question-create/question-title))
   [:.l8n-button-add-question] (html/content (translations :question-create/post-button)))

 (html/defsnippet sign-in-to-add-question


Messing around.

Messing around.

--- src/kolmogorov_music/song.clj
+++ src/kolmogorov_music/song.clj
@@ -7,7 +7,7 @@
             [leipzig.temperament :as temperament]
             [kolmogorov-music.champernowne :as champernowne]))

-(def master-volume 0.05)
+(def master-volume 0.03)

 ; Instruments
 ;(defonce sweep-bus (audio-bus))
@@ -22,9 +22,9 @@

 (definst buzz [freq 110 vol 1.0]
   (-> (saw freq)
-      (+ (sin-osc (* 0.51 freq)))
+      (+ (sin-osc (* 0.505 freq)))
       (rlpf (* 3 440) 1/9)
-      (* (env-gen (perc 0.01 0.5) :action FREE))
+      (* (env-gen (perc 0.01 0.3) :action FREE))
       (* vol master-volume)))

 (definst sing [freq 110 dur 1.0 vol 1.0]
@@ -48,40 +48,36 @@
         (take n s)
         (lazy-seq (chunked-by n (drop n s)))))))

-(->> (range 1 18) (chunked-by 3))
-
 (defn split-by [n s]
   (when (seq s)
     (cons
       (take-while (partial not= n) s)
       (lazy-seq (->> s (drop-while #(not= % n)) rest (split-by n))))))

-(defn encode [[duration pitch]]
-  {:time 0
-   :duration (/ duration 4)
-   :pitch pitch})
+(defn encode [[duration pitch & others]]
+  (when others
+    (let [duration (/ (or duration 1) 16)
+          pitch (or pitch 0) ]
+    (cons {:time 0
+           :duration duration
+           :pitch pitch}
+          (lazy-seq (->> others encode (where :time (scale/from duration))))))))

-(defn evens [[x _ & zs]]
-  (when x
-    (cons x (lazy-seq (evens zs)))))
+(defn evens [xs]
+  (->> xs (chunked-by 2) (map first)))

-(defn odds [[_ y & zs]]
-  (when y
-    (cons y (lazy-seq (odds zs)))))
+(defn odds [xs]
+  (->> xs (chunked-by 2) (map second)))

-(defn thence [[{duration :duration time :time :as a} b & cs]]
-  (cond
-    (nil? a) []
-    (nil? b) [a]
-    :otherwise (cons a (lazy-seq (thence (cons (assoc b :time (+ time duration)) cs))))))
-
-(defn arrange [digits]
-  (with
-    (->> digits evens (chunked-by 2) (map encode) thence (all :part :dux))
-    (->> digits odds (chunked-by 2) (map encode) thence (all :part :comes))))
+(defn arrange [strings]
+  (map
+    #(with
+       (->> % evens encode (all :part :dux))
+       (->> % odds encode (all :part :comes)))
+    strings))

 (defn end [notes]
-  (let [{:keys [duration time]} (or (last notes) {:time 0 :duration 0}) ]
+  (let [{:keys [duration time]} (or (last notes) {:time 0 :duration 0})]
     (+ duration time)))

 (defn sequentially [[a & bs]]
@@ -91,14 +87,14 @@

 (def track
   (->>
-    (champernowne/word 16 0)
+    (champernowne/word 16 (rand-int 99999))
     (split-by 15)
-    (map arrange)
+    arrange
     sequentially
     (where :pitch (comp temperament/equal scale/A scale/minor))
     (where :pitch scale/lower)
-    (where :time (bpm 120))
-    (where :duration (bpm 120))))
+    (where :time (bpm 160))
+    (where :duration (bpm 160))))

 (comment


Automatically add SDK local repos to :repositories

--- src/leiningen/droid/utils.clj
+++ src/leiningen/droid/utils.clj
@@ -172,6 +172,16 @@
                                  conj res-path out-res-path))))))
           project project-dependencies))

+(defn add-local-android-repositories
+  "Populates project's :repositories list with flat filesystem Maven
+  repositories that reside in Android SDK. This allows to use certain
+  dependencies without explicitly specifying path to them."
+  [{{:keys [sdk-path]} :android :as project}]
+  (let [p (fn [& path] {:url (str "file://" (apply file sdk-path path))})]
+    (update-in project [:repositories] conj
+               ["android-support" (p "extras" "android" "m2repository")]
+               ["android-play-services" (p "extras" "google" "m2repository")])))
+
 ;; This is the middleware function to be plugged into project.clj.
 (defn android-parameters
   "Merges project's `:android` map with the default parameters map,
@@ -182,6 +192,7 @@
                               android)]
     (-> project
         (assoc :android android-params)
+        add-local-android-repositories
         process-project-dependencies
         absolutize-android-paths)))


update to newest boot-cljsjs

update to newest boot-cljsjs

--- src/leiningen/new/tenzing.clj
+++ src/leiningen/new/tenzing.clj
@@ -82,13 +82,13 @@
           (reagent? opts) (conj "reagent \"0.4.3\"" "cljsjs/react \"0.12.2-1\"")
           (garden?  opts) (conj "boot-garden \"1.2.5-1\"")
           (sass?    opts) (conj "boot-sassc  \"0.1.0\"")
-          (cljsjs?  opts) (conj "cljsjs/boot-cljsjs \"0.3.0\"")))
+          (cljsjs?  opts) (conj "cljsjs/boot-cljsjs \"0.4.0\"")))

 (defn build-requires [opts]
   (cond-> []
           (garden? opts) (conj "'[boot-garden.core :refer [garden]]")
           (sass?   opts) (conj "'[boot-sassc.core  :refer [sass]]")
-          (cljsjs? opts) (conj "'[cljsjs.app :refer [from-cljsjs]]")))
+          (cljsjs? opts) (conj "'[cljsjs.boot-cljsjs :refer [from-cljsjs]]")))

 (defn pre-build-steps [name opts]
   (cond-> []
@@ -97,8 +97,7 @@
 (defn build-steps [name opts]
   (cond-> []
           (garden? opts) (conj (str "(garden :styles-var '" name ".styles/screen\n:output-to \"css/garden.css\")"))
-          (sass?   opts) (conj (str "(sass :output-to \"css/sass.css\")"))
-          (cljsjs? opts) (conj (str "(from-cljsjs)"))))
+          (sass?   opts) (conj (str "(sass :output-to \"css/sass.css\")"))))

 (defn production-task-opts [opts]
   (cond-> []
@@ -130,7 +129,7 @@
   {:name                   name
    :sanitized              (name-to-path name)
    :source-paths           (source-paths opts)
-   :deps                   (dep-list 18 (dependencies opts))
+   :deps                   (dep-list 17 (dependencies opts))
    :requires               (indent 1 (build-requires opts))
    :pre-build-steps        (indent 8 (pre-build-steps name opts))
    :build-steps            (indent 8 (build-steps name opts))


conj app.js to the end of the script tags instead of reversing the list

--- src/leiningen/new/tenzing.clj
+++ src/leiningen/new/tenzing.clj
@@ -106,9 +106,10 @@

 (defn index-html-script-tags [opts]
   (letfn [(script-tag [src] (str "<script type=\"text/javascript\" src=\"" src "\"></script>"))]
-    (reverse (cond-> [(script-tag "js/app.js")]
-                     (or (om? opts) (reagent? opts))
-                     (conj (script-tag "js/preamble.js"))))))
+    (conj (cond-> []
+            (or (om? opts) (reagent? opts))
+            (conj (script-tag "js/preamble.js")))
+          (script-tag "js/app.js"))))

 (defn template-data [name opts]
   {:name name


Add add-child-stub method to ts

Add add-child-stub method to ts

--- src/angelic/search/implicit/dash_astar.clj
+++ src/angelic/search/implicit/dash_astar.clj
@@ -106,12 +106,14 @@

 (declare sp-ts get-stub-output norm-name)

-;; TODO: now this will never be true; how to avoid extra connections ?
 (defprotocol TreeSummarizer
   (ts-stub [ts])
   (subsuming-sps [ts]) ; True tree summarizers subsuming this one.
-  (add-subsuming-sp! [ts subsuming-sp]))
+  (add-subsuming-sp! [ts subsuming-sp])
+  (add-child-stub! [ts child-stub])) ; Add stub whose output will become output of sp.

+
+;; TODO: (when-not (get-stub-output stb)  ) on stub connections; can't work now.

 (defn- make-tree-summarizer [stb]
   (let [subsuming-sp-set (IdentityHashMap.)
@@ -123,11 +125,15 @@
                 (util/assert-is (= (norm-name (stub-name stb)) (norm-name (sp-name subsuming-sp))))
                 (when-not (.containsKey subsuming-sp-set subsuming-sp)
                   (.put subsuming-sp-set subsuming-sp true)
-                  (summaries/connect-subsumed! (sp-ts subsuming-sp) ts))))]
-    (when-not (get-stub-output stb)
-      (summaries/connect! ret stb)
-      (summaries/connect-subsumed! ret stb))
+                  (summaries/connect-subsumed! (sp-ts subsuming-sp) ts)))
+              (add-child-stub! [ts child-stub]
+                (summaries/connect-subsumed! ts (tree-summarizer child-stub))
+                #_ ::TODO-propagate
+                ))]
+    (summaries/connect! ret stb)
+    (summaries/connect-subsumed! ret stb)
     ret))
+

 (defn tree-summarizer? [x] (instance? angelic.search.implicit.dash_astar.TreeSummarizer x))


Improve the function scan-number (tests and refactoring will be necessary yet).

--- src/berry/lexical_analysis/scan_number.clj
+++ src/berry/lexical_analysis/scan_number.clj
@@ -1,9 +1,87 @@
 (ns berry.lexical-analysis.scan-number
-    (:require [berry.lexical-analysis.context-handler :refer [++ --]]
+  (:require [berry.lexical-analysis.context-handler :refer [++ --]]
             [berry.lexical-analysis.character :refer :all]
             [berry.lexical-analysis.error-handler :refer :all]
             [berry.lexical-analysis.token :as token]))

+(declare scan-digits handle-end-of-input handle-non-digit
+         ends-with-digit? scan-fractional-part scan-exponential-part)
+
 (defn scan-number
-  [source context buffer]
-  )
+  [source buffer context]
+  (let [char (first source)]
+    (cond
+      (empty? source)
+      (handle-end-of-input buffer context)
+      (dot? char)
+      (scan-fractional-part (rest source)
+                            (conj buffer char)
+                            (++ context))
+      (exponent-sign? char)
+      (scan-exponential-part (rest source)
+                             (conj buffer char)
+                             (++ context))
+      (not (digit? char))
+      (handle-non-digit char buffer context)
+      :else
+      (recur (rest source)
+             (conj buffer char)
+             (++ context)))))
+
+(defn- handle-end-of-input [buffer context]
+  (if (digit? (last buffer))
+    (token/number buffer context)
+    (unexpected-end-of-input context)))
+
+(defn- scan-fractional-part
+  [source buffer context]
+  (let [char (first source)]
+    (cond
+      (nil? char)
+      (handle-end-of-input buffer context)
+      (and (exponent-sign? char) (ends-with-digit? buffer))
+      (scan-exponential-part (rest source)
+                             (conj buffer char)
+                             (++ context))
+      (not (digit? char))
+      (handle-non-digit char buffer context)
+      :else
+      (recur (rest source)
+             (conj buffer char)
+             (++ context)))))
+
+(defn- scan-exponential-part
+  [source buffer context]
+  (let [char (first source)]
+    (cond
+      (nil? char)
+      (unexpected-end-of-input context)
+      (or (plus-sign? char) (minus-sign? char) (digit? char))
+      (scan-digits (rest source)
+                   (conj buffer char)
+                   (++ context))
+      :else
+      (unexpected-token char context))))
+
+(defn- scan-digits
+  [source buffer context]
+  (let [char (first source)]
+    (cond
+      (empty? source)
+      (handle-end-of-input buffer context)
+      (not (digit? char))
+      (handle-non-digit char buffer context)
+      :else
+      (recur (rest source)
+             (conj buffer char)
+             (++ context)))))
+
+(defn- handle-non-digit
+  [char buffer context]
+  (if (ends-with-digit? buffer)
+    (token/number buffer context)
+    (unexpected-token char context)))
+
+(defn- ends-with-digit?
+  [buffer]
+  (digit? (last buffer)))


DecimalFormatter used

DecimalFormatter used

--- src/analyze_runs/core.clj
+++ src/analyze_runs/core.clj
@@ -17,7 +17,7 @@

 (defn handle-file [file]
   (let [points (-> file .getAbsolutePath get-points-from-file)
-        distance (format "%.2f" (calculate-distance points))
+        distance (.format (java.text.DecimalFormat. "#.##") (calculate-distance points))
         duration (calculate-time points)
         start (:time (first points))
         year-week (tf/unparse week-formatter start)
@@ -56,7 +56,3 @@
 (defn -main
   [& args]
   (test-pipeline))
-
-                                        ; map => 53 s
-                                        ; pmap => 20s
-                                        ; core.async 23s


fix travis-ci build error

fix travis-ci build error

--- storm-core/test/clj/org/apache/storm/scheduler_test.clj
+++ storm-core/test/clj/org/apache/storm/scheduler_test.clj
@@ -261,21 +261,34 @@
     ))

 (deftest test-sort-slots
+  (let [supervisor1 (SupervisorDetails. "supervisor1" "192.168.0.1" (list ) (map int (list 6700 6701)))
+        supervisor2 (SupervisorDetails. "supervisor2" "192.168.0.2" (list ) (map int (list 6700 6701 6702)))
+        supervisor3 (SupervisorDetails. "supervisor3" "192.168.0.3" (list ) (map int (list 6700 6701 6702 6703)))
+        assignment1 (SchedulerAssignmentImpl. "topology1" nil)
+        assignment2 (SchedulerAssignmentImpl. "topology2" nil)
+        supervisor1-slot0 (WorkerSlot. "supervisor1" 6700)
+        supervisor1-slot1 (WorkerSlot. "supervisor1" 6701)
+        supervisor2-slot0 (WorkerSlot. "supervisor2" 6700)
+        supervisor2-slot1 (WorkerSlot. "supervisor2" 6701)
+        supervisor2-slot2 (WorkerSlot. "supervisor2" 6702)
+        supervisor3-slot0 (WorkerSlot. "supervisor3" 6700)
+        supervisor3-slot1 (WorkerSlot. "supervisor3" 6701)
+        supervisor3-slot2 (WorkerSlot. "supervisor3" 6702)
+        supervisor3-slot3 (WorkerSlot. "supervisor3" 6703)
+        cluster (Cluster. (nimbus/standalone-nimbus)
+                          {"supervisor1" supervisor1 "supervisor2" supervisor2 "supervisor3" supervisor3}
+                          {"topology1" assignment1 "topology2" assignment2}
+                  nil)]
   ;; test supervisor2 has more free slots
-  (is (= '(["supervisor2" 6700] ["supervisor1" 6700]
-           ["supervisor2" 6701] ["supervisor1" 6701]
-           ["supervisor2" 6702])
-         (EvenScheduler/sortSlots [["supervisor1" 6700] ["supervisor1" 6701]
-                      ["supervisor2" 6700] ["supervisor2" 6701] ["supervisor2" 6702]
-                      ])))
+  (is (= "[supervisor2:6700, supervisor1:6700, supervisor2:6701, supervisor1:6701, supervisor2:6702]"
+         (.toString (EvenScheduler/sortSlots [supervisor1-slot0 supervisor1-slot1
+                      supervisor2-slot0 supervisor2-slot1 supervisor2-slot2
+                      ] cluster))))
   ;; test supervisor3 has more free slots
-  (is (= '(["supervisor3" 6700] ["supervisor2" 6700] ["supervisor1" 6700]
-           ["supervisor3" 6703] ["supervisor2" 6701] ["supervisor1" 6701]
-           ["supervisor3" 6702] ["supervisor2" 6702]
-           ["supervisor3" 6701])
-         (EvenScheduler/sortSlots [["supervisor1" 6700] ["supervisor1" 6701]
-                      ["supervisor2" 6700] ["supervisor2" 6701] ["supervisor2" 6702]
-                      ["supervisor3" 6700] ["supervisor3" 6703] ["supervisor3" 6702] ["supervisor3" 6701]
-                      ])))
-    )
-
+  (is (= "[supervisor3:6700, supervisor2:6700, supervisor1:6700, supervisor3:6701, supervisor2:6701, supervisor1:6701, supervisor3:6702, supervisor2:6702, supervisor3:6703]"
+         (.toString (EvenScheduler/sortSlots [supervisor1-slot0 supervisor1-slot1
+                      supervisor2-slot0 supervisor2-slot1 supervisor2-slot2
+                      supervisor3-slot0 supervisor3-slot3 supervisor3-slot2 supervisor3-slot1
+                      ] cluster))))
+    ))
+


Filter out more stack spewage (sun.this.that)

--- src/midje/util/exceptions.clj
+++ src/midje/util/exceptions.clj
@@ -16,6 +16,7 @@
   (->> all-strings
        (remove-matches #"^java\.")
        (remove-matches #"^clojure\.")
+       (remove-matches #"^sun\.")
        (remove-matches #"^swank\.")
        (remove-matches #"^user\$eval")))


Listview bottom padding

Listview bottom padding

--- src/hackernews/shared/components/list.cljs
+++ src/hackernews/shared/components/list.cljs
@@ -22,6 +22,7 @@
   [{:keys [::items ::render-row ::on-press ::on-end-reached]}]
   (let [ds (rn/ReactNative.ListView.DataSource. #js{:rowHasChanged (fn[a b] false)})]
     [rn/list-view {:dataSource (.cloneWithRows ds (clj->js items))
+                   :content-container-style {:padding-bottom 100}
                    :render-row (fn [js-item]
                                  (let [item (js->clj js-item :keywordize-keys true)]
                                    (r/as-element


Avoid the extra copy for small, uncompressed files

--- src/net/dishevelled/mailindex/backends/nnml.clj
+++ src/net/dishevelled/mailindex/backends/nnml.clj
@@ -17,21 +17,30 @@
       (GZIPInputStream. fis 16384)
       fis)))

+(def SMALL-FILE-SIZE (* 8 1024 1024))
+
 (defn- message-bytes
   "Return the bytes of a message."
   [^String msg]
   (try
-    (let [f (file msg)
-          buf (byte-array 16384)
-          out (ByteArrayOutputStream. (.length f))]
-      ;; Our initial length is really just a guess here.  We'll be right for
-      ;; uncompressed files and wrong for everything else :)
-      (with-open [^InputStream is (input-stream-for-file f)]
-        (loop [len (.read is buf)]
-          (when (>= len 0)
-            (.write out buf 0 len)
-            (recur (.read is buf)))))
-      (.toByteArray out))
+    (let [f (file msg)]
+      (cond
+        ;; Straight into a byte buffer with no copying if it's small
+        (and (not (.endsWith msg ".gz")) (<= (.length f) SMALL-FILE-SIZE))
+        (java.nio.file.Files/readAllBytes (.toPath f))
+
+        ;; Stream it otherwise
+        :else
+        (let [buf (byte-array 16384)
+              out (ByteArrayOutputStream. (.length f))]
+          ;; Our initial length is really just a guess here.  We'll be right for
+          ;; uncompressed files and wrong for everything else :)
+          (with-open [^InputStream is (input-stream-for-file f)]
+            (loop [len (.read is buf)]
+              (when (>= len 0)
+                (.write out buf 0 len)
+                (recur (.read is buf)))))
+          (.toByteArray out))))
     (catch IOException _
       (byte-array 0))))


Fix issue "No sound with 0.7-SNAPSHOT under Linux"

* Set connection-info* before booting the server.
* Make transient-server? return true, like the docstring says.

--- src/overtone/sc/machinery/server/connection.clj
+++ src/overtone/sc/machinery/server/connection.clj
@@ -23,7 +23,7 @@
   "Return true if the server was booted by us, whether internally or
   externally."
   []
-  (not-empty @connection-info*))
+  (when (not-empty @connection-info*) true))

 (defn- server-notifications-on
   "Turn on notification messages from the audio server.  This lets us free
@@ -75,8 +75,10 @@
          (sh "jack_connect" src dest)
          (log/info "jack_connect " src " " dest)))))

-(if (and (= :linux (config-get :os)) (transient-server?))
-  (on-deps :server-connected ::connect-jack-ports #(connect-jack-ports)))
+(if (= :linux (config-get :os))
+  (on-deps :server-connected ::connect-jack-ports
+           #(when (transient-server?)
+              (connect-jack-ports))))

 ;; We have to do this to handle the change in SC, where they added a "/" to the
 ;; status.reply messsage, which it should have had in the first place.
@@ -250,15 +252,15 @@
        (dosync
         (ref-set connection-status* :connecting))

+       (dosync
+        (ref-set connection-info*
+                 (transient-connection-info connection-type port)))
+
        (let [port (if (nil? port) (+ (rand-int 50000) 2000) port)]
          (case connection-type
            :internal (boot-internal-server)
            :external (boot-external-server port))
-         (wait-until-deps-satisfied :server-ready)
-
-         (dosync
-          (ref-set connection-info*
-                   (transient-connection-info connection-type port)))))))
+         (wait-until-deps-satisfied :server-ready)))))

 (defn shutdown-server
   "Quit the SuperCollider synth process."


fixed sign message text [#4529]

fixed sign message text [#4529]

--- src/status_im/ui/screens/wallet/send/views.cljs
+++ src/status_im/ui/screens/wallet/send/views.cljs
@@ -36,11 +36,11 @@
                          [:wallet/sign-transaction true]))))

 (defview sign-panel [message?]
-  (letsubs [account [:get-current-account]
+  (letsubs [account         [:get-current-account]
             wrong-password? [:wallet.send/wrong-password?]
-            signing-phrase (:signing-phrase @account)
-            bottom-value (animation/create-value -250)
-            opacity-value (animation/create-value 0)]
+            signing-phrase  (:signing-phrase @account)
+            bottom-value    (animation/create-value -250)
+            opacity-value   (animation/create-value 0)]
     {:component-did-mount #(send.animations/animate-sign-panel opacity-value bottom-value)}
     [react/animated-view {:style (styles/animated-sign-panel bottom-value)}
      [react/animated-view {:style (styles/sign-panel opacity-value)}
@@ -117,8 +117,8 @@
 (defview transaction-fee []
   (letsubs [{:keys [amount symbol] :as transaction} [:wallet.send/transaction]
             network [:get-current-account-network]
-            edit [:wallet/edit]]
-    (let [gas (or (:gas edit) (:gas transaction))
+            edit    [:wallet/edit]]
+    (let [gas       (or (:gas edit) (:gas transaction))
           gas-price (or (:gas-price edit) (:gas-price transaction))
           {:keys [decimals]} (tokens/asset-for (ethereum/network->chain-keyword network) symbol)]
       [wallet.components/simple-screen {:status-toolbar-type :modal-wallet}
@@ -208,9 +208,9 @@
      [react/view components.styles/flex
       [common/network-info {:text-color :white}]
       [react/scroll-view {:keyboard-should-persist-taps :always
-                          :ref                           #(reset! scroll %)
-                          :on-content-size-change        #(when (and (not modal?) scroll @scroll)
-                                                            (.scrollToEnd @scroll))}
+                          :ref                          #(reset! scroll %)
+                          :on-content-size-change       #(when (and (not modal?) scroll @scroll)
+                                                           (.scrollToEnd @scroll))}
        [react/view styles/send-transaction-form
         [components/recipient-selector {:disabled? (or from-chat? modal?)
                                         :address   to
@@ -222,8 +222,8 @@
         [components/amount-selector {:disabled?     (or from-chat? modal?)
                                      :error         (or amount-error
                                                         (when-not sufficient-funds? (i18n/label :t/wallet-insufficient-funds)))
-                                     :amount amount
-                                     :amount-text amount-text
+                                     :amount        amount
+                                     :amount-text   amount-text
                                      :input-options {:max-length     21
                                                      :on-focus       (fn [] (when (and scroll @scroll) (utils/set-timeout #(.scrollToEnd @scroll) 100)))
                                                      :on-change-text #(re-frame/dispatch [:wallet.send/set-and-validate-amount % symbol decimals])}} token]
@@ -249,22 +249,22 @@

 (defview send-transaction []
   (letsubs [transaction [:wallet.send/transaction]
-            symbol [:wallet.send/symbol]
-            advanced? [:wallet.send/advanced?]
-            network [:get-current-account-network]
-            scroll (atom nil)]
+            symbol      [:wallet.send/symbol]
+            advanced?   [:wallet.send/advanced?]
+            network     [:get-current-account-network]
+            scroll      (atom nil)]
     [send-transaction-panel {:modal? false :transaction transaction :scroll scroll :advanced? advanced?
                              :symbol symbol :network network}]))

 (defview send-transaction-modal []
   (letsubs [transaction [:wallet.send/unsigned-transaction]
-            symbol [:wallet.send/symbol]
-            advanced? [:wallet.send/advanced?]
-            network [:get-current-account-network]
-            scroll (atom nil)]
+            symbol      [:wallet.send/symbol]
+            advanced?   [:wallet.send/advanced?]
+            network     [:get-current-account-network]
+            scroll      (atom nil)]
     (if transaction
       [send-transaction-panel {:modal? true :transaction transaction :scroll scroll :advanced? advanced?
-                               symbol symbol :network network}]
+                               symbol  symbol :network network}]
       [react/view wallet.styles/wallet-modal-container
        [react/view components.styles/flex
         [status-bar/status-bar {:type :modal-wallet}]
@@ -282,9 +282,11 @@
        [react/view styles/send-transaction-form
         [wallet.components/cartouche {:disabled? true}
          (i18n/label :t/message)
-         [components/amount-input {:disabled?     true
-                                   :input-options {:multiline     true
-                                                   :default-value data}} nil]]]]
+         [components/amount-input
+          {:disabled?     true
+           :input-options {:multiline true}
+           :amount-text   data}
+          nil]]]]
       [signing-buttons
        #(re-frame/dispatch [:wallet/discard-transaction-navigate-back])
        #(re-frame/dispatch [:wallet/sign-transaction-modal])


[#9975] Trim recipient address before validation

--- src/status_im/wallet/choose_recipient/core.cljs
+++ src/status_im/wallet/choose_recipient/core.cljs
@@ -94,8 +94,9 @@

 (fx/defn set-recipient
   {:events [:wallet.send/set-recipient ::recipient-address-resolved]}
-  [{:keys [db]} recipient]
-  (let [chain (ethereum/chain-keyword db)]
+  [{:keys [db]} raw-recipient]
+  (let [chain (ethereum/chain-keyword db)
+        recipient (string/trim raw-recipient)]
     (cond
       (ethereum/address? recipient)
       (let [checksum (eip55/address->checksum recipient)]


remove constraint that caused source expression to have certain constraints on :comp taken from the target expression

--- src/babel/reader.clj
+++ src/babel/reader.clj
@@ -151,11 +151,6 @@
         (unify/strip-refs ;; TODO: consider removing strip-refs; not clear if there is any reason why we need to do it.
          (unify/unify
           {:synsem {:sem (unify/get-in target-expression [:synsem :sem])}}
-          (cond
-            (= true (unify/get-in target-expression [:comp :synsem :pronoun]))
-            {:comp {:phrasal false
-                    :synsem {:pronoun true}}}
-            true :top)
           basic-spec))

         ;; TODO: catch possible deref NPE exception that can happen when model is not yet loaded.


CMR-4307: Fixed the typo.

CMR-4307: Fixed the typo.

--- search-app/src/cmr/search/services/humanizers/humanizer_report_service.clj
+++ search-app/src/cmr/search/services/humanizers/humanizer_report_service.clj
@@ -49,7 +49,7 @@
   {:default 400 :type Long})

 (defconfig humanizer-report-generator-job-wait
-  "Number of mili-seconds humanizer-generator-job waits for the collection cache
+  "Number of milli-seconds humanizer-generator-job waits for the collection cache
    to be populated in the event when the delay is not long enough."
   {:default 60000 :type Long}) ;; one minute

@@ -79,7 +79,7 @@
   (let [rfms (metadata-cache/all-cached-revision-format-maps context)]
     (if (seq rfms)
       rfms
-      (warn (format "Collection cache is not populated after %d seconds of delay and %d seconds of wait."
+      (warn (format "Collection cache is not populated after %d seconds of delay and %d milli-seconds of wait."
                     (humanizer-report-generator-job-delay)
                     (humanizer-report-generator-job-wait))))))


added declarations for to-dbo, to-clj (curse you, REPL!)

--- src/karras.clj
+++ src/karras.clj
@@ -34,6 +34,7 @@
 (defn- has-option? [options k]
   (boolean (some #{k} options)))

+(declare to-dbo)
 (defn to-dbo-value [v]
   (cond
    (map? v) (to-dbo v)
@@ -48,6 +49,7 @@
       (.put dbo (keyword-str k) (to-dbo-value v)))
     dbo))

+(declare to-clj)
 (defn to-clj-value [v]
   (cond
    (map? v) (to-clj v)


Mark some functions private

Mark some functions private

--- src/io/aviso/rook.clj
+++ src/io/aviso/rook.clj
@@ -61,12 +61,12 @@
   [{:keys [status]}]
   (<= 200 status 399))

-(defn function-entry
+(defn- function-entry
   "Create function entry if it has :path-spec defined in its metadata, for example:

-  (defn
-   ^{:path-spec [:post \"/:id/activate\"]}
-   activate [id]
+  (defn activate
+   {:path-spec [:post \"/:id/activate\"]}
+  [id]
    ...
    )"
   [sym]
@@ -74,7 +74,7 @@
     (when-let [path-spec (:path-spec symbol-meta)]
       [path-spec (keyword (:name symbol-meta))])))

-(defn ns-paths
+(defn- ns-paths
   "Returns paths for <namespace> using DEFAULT_MAPPINGS and by scanning for functions :path-spec metadata.
    Each path returned is a tuple of [path-spec function-key] where:
      path-spec is a tuple of [method path]
@@ -88,7 +88,7 @@
                  (filter symbol-for-function? (map second (ns-publics namespace)))))
     DEFAULT-MAPPINGS))

-(defn get-function-meta
+(defn- get-function-meta
   "Get meta for route-mapping and namespace."
   [namespace [path-spec function-key]]
   (when-let [f (ns-function namespace function-key)]
@@ -133,7 +133,7 @@
                :rook (merge (:rook request)
                             {:default-arg-resolvers (concat (:default-arg-resolvers (:rook request)) arg-resolvers)})))))

-(defn get-available-paths
+(defn- get-available-paths
   "Scan namespace for available routes - only those that have available function are returned.

   Routes are sorted by the line number from metadata - which can be troubling if you have the same namespace in many files.


Update CSS to point at new Kibana.

Update CSS to point at new Kibana.

--- src/kiries/layout.clj
+++ src/kiries/layout.clj
@@ -5,9 +5,9 @@
 (defn full-layout [title & content]
   (html5
    [:head
-    (include-css "/kibana/common/css/bootstrap.light.min.css")
-    (include-css "/kibana/common/css/bootstrap-responsive.min.css")
-    (include-css "/kibana/common/css/font-awesome.min.css")
+    (include-css "/kibana/css/bootstrap.light.min.css")
+    (include-css "/kibana/css/bootstrap-responsive.min.css")
+    (include-css "/kibana/css/font-awesome.min.css")
     [:title title]]
    [:body
     [:div.container-fluid.main


Brought graphite reporter api inline with console reporter api. (Added start fn)

--- metrics-clojure-graphite/src/metrics/reporters/graphite.clj
+++ metrics-clojure-graphite/src/metrics/reporters/graphite.clj
@@ -1,6 +1,7 @@
 (ns metrics.reporters.graphite
   "Graphite reporter interface"
-  (:require [metrics.core  :refer [default-registry]])
+  (:require [metrics.core  :refer [default-registry]]
+            [metrics.reporters :as mrep])
   (:import java.util.concurrent.TimeUnit
            java.net.InetSocketAddress
            [com.codahale.metrics Metric MetricRegistry Clock MetricFilter]
@@ -27,3 +28,8 @@
        (when-let [^MetricFilter f (:filter opts)]
          (.filter b f))
        (.build b g))))
+
+(defn start
+  "Report all metrics to graphite periodically."
+  [^GraphiteReporter r ^long seconds]
+  (mrep/start r seconds))


Change :extra-classpath-dirs to accept a vector of strings instead of a string, like Leiningen. It's also just better.

--- src/cake/project.clj
+++ src/cake/project.clj
@@ -30,10 +30,8 @@
                               (str (file (:test-path *project*) "classes"))
                               (:resources-path *project*)
                               (:dev-resources-path *project*)
-                              "classes/"]))
-               ;; extra-classpath-dirs might be nil, but concat will remove it.
-               (if (:extra-classpath-dirs *project*)
-                 [(file (:extra-classpath-dirs *project*))])
+                              "classes/"
+                              (:extra-classpath-dirs *project*)]))
                (path-files (get *config* "project.classpath"))
                (fileset-seq {:dir (file (:library-path *project*))
                              :includes "*.jar"})


Calling convention might look like this - still not sure if I want this guy here.

--- src/cljs/go/core.clj
+++ src/cljs/go/core.clj
@@ -32,7 +32,7 @@
                                      (core/float? %) (core/true? %)
                                      (core/false? %))
                           "~{}"
-                          "cljs.core.str.cljs$core$IFn$_invoke$arity$1(~{})"))
+                          "Str_cljs__core__IFn___invoke__arity__1(~{})"))
                   (interpose "+")
                   (apply core/str))]
     ;; Google closure advanced compile will stringify and concat strings and


fixing regex for bucket names

fixing regex for bucket names

--- src/vignette/http/routes.clj
+++ src/vignette/http/routes.clj
@@ -20,7 +20,7 @@
            [java.net InetAddress]))

 (def revision-regex #"\d+|latest")
-(def wikia-regex #"\w+")
+(def wikia-regex #"[\w-]+")
 (def top-dir-regex #"\w")
 (def middle-dir-regex #"\w\w")
 (def original-regex #"[^/]*")


changing default unsupported-redirect-host env var

--- src/vignette/http/routes.clj
+++ src/vignette/http/routes.clj
@@ -94,7 +94,7 @@
                (if (:unsupported image-params)
                  (-> (response "unsupported thumbnail route")
                      (status 307)
-                     (header "Location" (str (env :unsupported-redirect-host "http://thumbnails.com")
+                     (header "Location" (str (env :unsupported-redirect-host "http://images.wikia.com")
                                              (:uri request))))
                  (if-let [thumb (u/get-or-generate-thumbnail system image-params)]
                    (create-image-response thumb)


Adding one-hot encode method.

Adding one-hot encode method.

--- src/cortex/util.cljc
+++ src/cortex/util.cljc
@@ -74,6 +74,13 @@
   (when (or (not idx) (not (< -1 idx p)))
     (throw (ex-info "Bad idx->one-hot" {:idx idx :p p})))
   (assoc (vec (repeat p 0.0)) idx 1.0))
+
+
+(defn one-hot-encode
+  "Given a classes vector c, return a one-hot encoded vector
+in '(count c)-dimensional' space"
+  [classes class]
+  (mapv #(if (= class %) 1.0 0.0) classes))

 ;;;; Timing


write to file

write to file

--- src/dartbot/core.clj
+++ src/dartbot/core.clj
@@ -270,6 +270,7 @@

 (defn end-game [world gid]
   (http/upload-game gid (get world gid))
+  (spit (str gid ".game") (get world gid))
   ;(delete-game gid world)
   world
   )
@@ -327,4 +328,4 @@
         (do (reset! world-atom (update-world @world-atom message)) (recur (read-line)))
         (recur (read-line))
         )
-      )))+      )))


Remove the tx-report forwarding from the top-level datomic ns

--- src/dato/datomic.clj
+++ src/dato/datomic.clj
@@ -32,6 +32,4 @@
   (infof "Creating default database if it doesn't exist: %s"
          (d/create-database default-uri))
   (infof "Ensuring connection to default database")
-  (infof "Connected to: %s" (conn))
-  (infof "forwarding report-queue to tx-report-ch")
-    (setup-tx-report-ch (conn)))
+  (infof "Connected to: %s" (conn)))


Alphabetize command options

Alphabetize command options

--- src/degasolv/cli.clj
+++ src/degasolv/cli.clj
@@ -614,16 +614,16 @@
                           (and (.isDirectory ^java.io.File f)
                                (.exists ^java.io.File f)))
                        "Must be a directory which exists on the file system."]]
+           ["-I" "--index-file FILE"
+            "The name of the repo file"
+            :default nil
+            :default-desc (str (:index-file subcommand-option-defaults))]
            ["-O" "--index-sort-order ORDER"
             "May be 'ascending' or 'descending'."
             :default nil
             :default-desc "descending"
             :validate [#(some #{%} ["ascending" "descending"])
                        "Index sort order may be 'ascending' or 'descending'."]]
-           ["-I" "--index-file FILE"
-            "The name of the repo file"
-            :default nil
-            :default-desc (str (:index-file subcommand-option-defaults))]
            ["-V" "--version-comparison CMP"
             "May be 'debian', 'maven', 'naive', 'python', 'rpm', 'rubygem', or 'semver'."
             :default nil


add help source

add help source

--- src/fat_jar/core.clj
+++ src/fat_jar/core.clj
@@ -2,6 +2,7 @@
   (:require [clojure.tools.cli :refer [parse-opts]])
   (:gen-class))

+; guide for cli-options: https://github.com/clojure/tools.cli/blob/master/src/test/clojure/clojure/tools/cli_test.clj
 (def cli-options
   [["-o" "--output DIRECTORY" "Folder where to write the file"
      :missing "output option is missing"]


Un-memoize ys

Un-memoize ys

With thanks to the excellent Bruce Hauman. He quite helpfully
discovered the problem in my code was some unnecessary memoization,
which was not good at comparing class graphs for equality. Lesson
learned.  Another lesson: memoize is stateful - which... duh, but
it was a new thought to me.

--- src/fatlip/plot.cljs
+++ src/fatlip/plot.cljs
@@ -68,39 +68,31 @@
           classes))

-(def memo-ys ;; heh
-  ^{:doc "Given a class graph and node and char separations, calculates y
-         positions for each node in the underlying graph."}
-  (memoize
-   (fn [class-graph node-sep char-sep]
-     (let [{:keys [classes block-classes preds succs
-                   block-preds block-succs compacted]} class-graph
-           [block-edges class-edges] ({:up [block-preds preds]
-                                       :down [block-succs succs]} compacted)
-           rel-ys (reduce #(merge %1 (get-block-rel-ys %2 block-edges
-                                                       node-sep char-sep
-                                                       compacted))
-                          {}
-                          classes)
-           shift-ys (get-shift-ys classes block-classes class-edges node-sep
-                                  char-sep rel-ys compacted)
-           block-shift-ys (into {} (mapcat (fn [[class shift]]
-                                             (map #(-> [% shift]) class))
-                                           shift-ys))]
-       (->> rel-ys
-            (map (fn [[block rel-y]]
-                   [block (+ rel-y (get block-shift-ys block))]))
-            (mapcat (fn [[block y]]
-                      (->> (filter #(instance? Node %) block)
-                           (map #(-> [% y])))))
-            (into {}))))))
-
-
 (defrecord ClassGraph [classes block-classes succs preds block-succs
                        block-preds sources sinks aligned compacted]
   YPlottable
   (ys [this node-sep char-sep]
-    (memo-ys this node-sep char-sep))
+    (let [{:keys [classes block-classes preds succs
+                  block-preds block-succs compacted]} this
+                  [block-edges class-edges] ({:up [block-preds preds]
+                                              :down [block-succs succs]} compacted)
+                  rel-ys (reduce #(merge %1 (get-block-rel-ys %2 block-edges
+                                                              node-sep char-sep
+                                                              compacted))
+                                 {}
+                                 classes)
+                  shift-ys (get-shift-ys classes block-classes class-edges node-sep
+                                         char-sep rel-ys compacted)
+                  block-shift-ys (into {} (mapcat (fn [[class shift]]
+                                                    (map #(-> [% shift]) class))
+                                                  shift-ys))]
+      (->> rel-ys
+           (map (fn [[block rel-y]]
+                  [block (+ rel-y (get block-shift-ys block))]))
+           (mapcat (fn [[block y]]
+                     (->> (filter #(instance? Node %) block)
+                          (map #(-> [% y])))))
+           (into {}))))

   (ys [this node-sep char-sep delta]
     (->> (ys this node-sep char-sep)


adding hot reloading http dev server msg when running on dev modes. each time theres changes in src folder, the namespaces will be refreshed immediately prior serving the next request. You'll see a hot reloading message on terminal where lein run was running.

--- src/fbi_api/core.clj
+++ src/fbi_api/core.clj
@@ -13,6 +13,10 @@
             [fbi-api.cron.core :refer [load-api-data]])
   (:use [clojure.tools.nrepl.server :only (start-server stop-server)])
   (:gen-class))
+
+(when-not const/production?
+  ;; First time running, or changes detected in "src" code
+  (println "Hot reloading http dev server before processing next request..."))

 (def server-error-details
   "\n\nPlease contact the administrator:


Discover a previous impl of invert-map in util!

--- src/overtone/util.clj
+++ src/overtone/util.clj
@@ -64,13 +64,6 @@
 (defn uuid
   "Creates a random, immutable UUID object that is comparable using the '=' function."
   [] (. java.util.UUID randomUUID))
-
-(defn invert-map
-  "Make the keys the values and the values the keys.  Note, if there are
-  duplicate values in the map they will result in key collisions and a smaller
-  result map."
-  [m]
-  (apply hash-map (interleave (vals m) (keys m))))

 (defn cpu-count
   "Get the number of CPUs on this machine."
@@ -153,6 +146,8 @@
   (let [arg-map (arg-mapper args arg-names default-map)]
     (vec (map arg-map arg-names))))

+
+
 ; TODO: generate arglists and doc meta-data and attach to var
 (defmacro defunk [name args & body]
   (let [arg-names (map first (partition 2 args))
@@ -165,9 +160,9 @@

 (defn invert-map
-  "Takes a map and returns a new map that's keys are the original map's vals and that's vals are the original map's keys.
-   Assumes the map's key's and vals are both sets (i.e. don't contain any duplicates)
+  "Takes a map m and returns a new map that's keys are the m's vals and that's vals are m's keys.
+   Assumes that m's keys and vals are both sets (i.e. don't contain any duplicates). If there are duplicate values in the map they will result in key collisions and a smaller result map.

    (invert-map {:a 1, :b 2, :c 3}) ;=> {1 :a, 2 :b, 3 :c}"
   [m]
-  (apply hash-map (reverse (flatten (seq m)))))
+  (apply hash-map (interleave (vals m) (keys m))))


Rename local symbol for consistency

Rename local symbol for consistency

--- src/play_clj/core.clj
+++ src/play_clj/core.clj
@@ -43,8 +43,8 @@
     (compare-and-set! e-atom e-old e-new)))

 (defn ^:private wrapper
-  [screen f]
-  (f))
+  [screen screen-fn]
+  (screen-fn))

 (defn defscreen*
   [{:keys [screen entities


Added log-msg

Added log-msg

--- src/hangman/core.clj
+++ src/hangman/core.clj
@@ -5,6 +5,14 @@
   ) )

 (def ^:const all-letters (set (map char (range (int \a) (inc(int \z)) ))) )
+
+(def logging-enabled true)
+
+(defn log-msg
+  "Write log msg to console for debugging."
+  [& msgs]
+  (when logging-enabled
+    (apply println msgs)) )

 (def all-words
   "A collection of all words for the hangman game."
@@ -16,7 +24,7 @@
 (defn show-info
   "Print synopsis info about a sequence of strings"
   [ seqName seqVals ]
-  (println
+  (log-msg
     (str seqName "("  (count seqVals) ") " )
         (take show-info-size (map #(str \" % \") seqVals)) ))

@@ -100,19 +108,19 @@
       ]
       (loop [ guessed-chars   #{}
               clue            (make-clue tgt-word guessed-chars) ]
-        (println)
+        (log-msg)
         (let [ keep-words (filter-words clue guessed-chars word-list) ]
           (show-info "keep-words" keep-words)
           (if (= 1 (count keep-words))
             (let [final-guess (str/join (first keep-words)) ]
-              (println (str "***** found word:  '" final-guess
+              (log-msg (str "***** found word:  '" final-guess
                 "'   Guesses:  " (count guessed-chars) "  *****") )
-              (println "matches:" (= final-guess tgt-word)) )
+              (log-msg "matches:" (= final-guess tgt-word)) )
           ;else
             (let [new-guess       (make-guess keep-words guessed-chars)
                   guessed-chars   (conj guessed-chars new-guess)
                   new-clue        (make-clue tgt-word guessed-chars) ]
-              (println "clue: " clue "  new-guess" new-guess
+              (log-msg "clue: " clue "  new-guess" new-guess
                 "  guessed-chars (" (count guessed-chars) ")" guessed-chars)
               (when (some #(= \- %) new-clue)
                 (recur  (conj guessed-chars new-guess)  new-clue ) )


add runtime check

add runtime check

--- src/holston/core.clj
+++ src/holston/core.clj
@@ -28,7 +28,10 @@
 (defn get-oauth-callback-domain []
   (println "ENV_DIR")
   (println (System/getenv "ENV_DIR"))
-  (if (System/getenv "ENV_DIR") ;; We're in Heroku, not local env
+  (println "DYNO")
+  (println (System/getenv "DYNO"))
+
+  (if (or (System/getenv "ENV_DIR") (System/getenv "DYNO")) ;; We're in Heroku, not local env
     (get-mandatory-env-var "HOLSTON_OATH2_CALLBACK_DOMAIN")
     "http://localhost:8080"))


allow moves

allow moves

--- src/quoridor/core.clj
+++ src/quoridor/core.clj
@@ -8,9 +8,11 @@
 (defn -main
   [& args]
   (loop [current (first black-white)
-         next (rest black-white)]
-    (println (board/render))
+         next (rest black-white)
+         state { :black "e1" :white "e8" }]
+    (println (board/render state))
     (println (str current "'s move: "))
-    (if (= (s/trim (read-line)) "q")
-      (println "Thanks for playing!")
-      (recur (first next) (rest next)))))
+    (let [move (s/trim (read-line))]
+      (if (= move "q")
+        (println "Thanks for playing!")
+        (recur (first next) (rest next) (assoc state (keyword current) move))))))


messing around with download-location.

messing around with download-location.

--- src/beebster_clj/core.clj
+++ src/beebster_clj/core.clj
@@ -72,7 +72,7 @@
   "concatenate index and mode to download command"
    [index mode]
    (list "gnome-terminal" "-e" (apply str "get-iplayer" " --modes=" mode "1"
-                                       " output=$HOME/Videos/" " -g " index)))
+                                       " output=/home/martin/Videos" " -g " index)))

 (defn get-url


Part 2: extend 'cljify' implementation to round-trip records like TempId.

--- src/node/datomish/cljify.cljs
+++ src/node/datomish/cljify.cljs
@@ -1,7 +1,27 @@
 (ns datomish.cljify)

 (defn cljify
-  "In node, equivalent to `(js->clj o :keywordize-keys true).
-  See <http://dev.clojure.org/jira/browse/CLJS-439?focusedCommentId=43909>."
-  [o]
-  (js->clj o :keywordize-keys true))
+  "In node, equivalent to `(js->clj o :keywordize-keys true),
+  but successfully passes Clojure Records through. This allows JS API
+  callers to round-trip values they receive from ClojureScript APIs."
+  [x]
+  (if (record? x)
+    x
+    (cond
+      (satisfies? IEncodeClojure x)
+      (-js->clj x (apply array-map {:keywordize-keys true}))
+
+      (seq? x)
+      (doall (map cljify x))
+
+      (coll? x)
+      (into (empty x) (map cljify x))
+
+      (array? x)
+      (vec (map cljify x))
+
+      (identical? (type x) js/Object)
+      (into {} (for [k (js-keys x)]
+                 [(keyword k) (cljify (aget x k))]))
+
+      :else x)))


Fix test

Fix test

--- test/clojure/clojurewerkz/cassaforte/async_cql_test.clj
+++ test/clojure/clojurewerkz/cassaforte/async_cql_test.clj
@@ -8,9 +8,9 @@
             [clojure.test                        :refer :all]
             [clojurewerkz.cassaforte.query       :refer :all]))

-(use-fixtures :each (fn [f]
-                      (th/with-temporary-keyspace f)))

+  (use-fixtures :each (fn [f]
+                        (th/with-temporary-keyspace f)))

 (let [s (th/make-test-session)]
   (deftest test-insert
@@ -23,7 +23,7 @@
   (deftest test-insert-time-unit
     (let [r {:name "Alex" :city "Munich" :age (int 19)}]
       @(insert-async s :users r)
-      (is (= r (first (deref (select-async s :users) 1 java.util.concurrent.TimeUnit/SECONDS))))
+      (is (= r (first (deref (select-async s :users) 1000 nil))))
       (truncate s :users)))

   (deftest test-insert-callback
@@ -70,8 +70,8 @@
     (testing "One of many update"
       (dotimes [i 3]
         @(insert-async s :user_posts {:username "user1"
-                                     :post_id (str "post" i)
-                                     :body (str "body" i)}))
+                                      :post_id (str "post" i)
+                                      :body (str "body" i)}))
       @(update-async s :user_posts
                      {:body "bodynew"}
                      (where {:username "user1"


Add support for lifecycle function signatures in defview

--- src/main/workflo/macros/view.clj
+++ src/main/workflo/macros/view.clj
@@ -13,11 +13,19 @@
 (def fn-specs
   "Function specifications for all functions that are not Object
    instance functions taking [this] as the sole argument."
-  '{query-params [:static   (static om.next/IQueryParams) [this]]
-    query        [:static   (static om.next/IQuery)       [this]]
-    ident        [:instance (static om.next/Ident)        [this props]]
-    keyfn        [:factory  nil                           [props]]
-    validator    [:factory  nil                           [props]]})
+  '{query-params              [:static (static om.next/IQueryParams) [this]]
+    query                     [:static (static om.next/IQuery) [this]]
+    ident                     [:instance (static om.next/Ident) [this props]]
+    keyfn                     [:factory nil [props]]
+    validator                 [:factory nil [props]]
+    initLocalState            [:facetory nil [this]]
+    componntWillMount         [:instance nil [this]]
+    componntDidMount          [:instance nil [this]]
+    componentWillUnmount      [:instance nil [this]]
+    componentWillReceiveProps [:instance nil [this next-props]]
+    componentWillUpdate       [:instance nil [this next-props next-state]]
+    componentDidUpdate        [:instance nil [this prev-props prev-state]]
+    shouldComponentUpdate     [:instance nil [this next-props next-state]]})

 (def fn-aliases
   "A few aliases allowing to define view functions with shorter or


we'd like to do something like this - but it doesn't quite work

--- src/cion_clojure/core.clj
+++ src/cion_clojure/core.clj
@@ -37,7 +37,4 @@
 			(first command-line-options))
 		(if (= (:file command-line-values) "")
 			(println (str "(create-projects (list " (clojure.string/join " " (map quoted (get-project-names (:url command-line-values)))) "))"))
-			(print command-line-values))
-	)
-  )
-)+			(eval (read-string (slurp (:file command-line-values))))))))


bump cljdev

bump cljdev

--- stow/lein/.lein/profiles.clj
+++ stow/lein/.lein/profiles.clj
@@ -1,4 +1,4 @@
-{:user {:dependencies        [[cljdev "0.7.2"]]
+{:user {:dependencies        [[cljdev "0.8.0"]]
         :injections          [(require 'nu)]
         :repositories        [["central"  {:url "https://repo1.maven.org/maven2/" :snapshots false}]
                               ["clojars"  {:url "https://clojars.org/repo/"}]


no need to set :pk?, :special-type, and :preview-display values when they are just the defaults anyways.

--- src/metabase/driver/bigquery.clj
+++ src/metabase/driver/bigquery.clj
@@ -126,10 +126,7 @@
 (defn- table-schema->metabase-field-info [^TableSchema schema]
   (for [^TableFieldSchema field (.getFields schema)]
     {:name            (.getName field)
-     :base-type       (bigquery-type->base-type (.getType field))
-     :special-type    nil
-     :preview-display true
-     :pk?             false}))
+     :base-type       (bigquery-type->base-type (.getType field))}))

 (defn- describe-table
   ([table]


fix date query function

fix date query function

--- src/clj/ceres/curator.clj
+++ src/clj/ceres/curator.clj
@@ -169,8 +169,9 @@
         (:db @mongo-state)
         "tweets"
         {:created_at
-         {$gt (t/date-time 2014 month day)
-          $lte (t/date-time 2014 month (inc day))}})
+         {$gt (t/date-time 2014 month day 0 0 0 0)
+          $lte (t/date-time 2014 month day 23 59 59 999)}
+         })
        seq
        (pmap #(from-db-object % true))))


Check for source file. Refs #5

Check for source file. Refs #5

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -959,23 +959,25 @@
   ([src dest]
      (let [src-file (io/file src)
            dest-file (io/file dest)]
-       (do (when (not (:defs (get @namespaces 'cljs.core)))
-             (load-file (repl-env) "cljs/core.cljs"))
-           (.mkdirs (.getParentFile (.getCanonicalFile dest-file)))
-           (with-open [out ^java.io.Writer (io/make-writer dest-file {})]
-             (binding [*out* out
-                       *cljs-ns* 'cljs.user]
-               (loop [forms (forms-seq src-file)
-                      ns-name nil
-                      deps nil]
-                 (if (seq forms)
-                   (let [env {:ns (@namespaces *cljs-ns*) :context :statement :locals {}}
-                         ast (analyze env (first forms))]
-                     (do (emit ast)
-                         (if (= (:op ast) :ns)
-                           (recur (rest forms) (:name ast) (:requires ast))
-                           (recur (rest forms) ns-name deps))))
-                   {:ns (or ns-name 'cljs.user) :requires (vals deps)}))))))))
+       (if (.exists src-file)
+         (do (when-not (:defs (get @namespaces 'cljs.core))
+               (load-file (repl-env) "cljs/core.cljs"))
+             (.mkdirs (.getParentFile (.getCanonicalFile dest-file)))
+             (with-open [out ^java.io.Writer (io/make-writer dest-file {})]
+               (binding [*out* out
+                         *cljs-ns* 'cljs.user]
+                 (loop [forms (forms-seq src-file)
+                        ns-name nil
+                        deps nil]
+                   (if (seq forms)
+                     (let [env {:ns (@namespaces *cljs-ns*) :context :statement :locals {}}
+                           ast (analyze env (first forms))]
+                       (do (emit ast)
+                           (if (= (:op ast) :ns)
+                             (recur (rest forms) (:name ast) (:requires ast))
+                             (recur (rest forms) ns-name deps))))
+                     {:ns (or ns-name 'cljs.user) :requires (vals deps)})))))
+         (throw (java.io.FileNotFoundException. (str "The file " src " does not exist.")))))))

 (comment
   ;; flex compile-file


fix compile time hash code computation for symbols

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -181,7 +181,9 @@
     (emits ",")
     (emit-constant symstr)
     (emits ",")
-    (emit-constant (goog-string-hash symstr))
+    (emit-constant (clojure.lang.Util/hashCombine
+                     (unchecked-int (goog-string-hash ns))
+                     (unchecked-int (goog-string-hash name))))
     (emits ",")
     (emit-constant nil)
     (emits ")")))


* src/clj/cljs/compiler.clj: comments about the various protocol keys. add :protocol-impl :protocol-inline to the analysis environment when analyzing fn methods

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -958,13 +958,17 @@
                    (when dynamic {:dynamic true})
                    (when-let [line (:line env)]
                      {:file *cljs-file* :line line})
+                   ;; the protocol a protocol fn belongs to
                    (when protocol
                      {:protocol protocol})
+                   ;; symbol for reified protocol
                    (when-let [protocol-symbol (-> sym meta :protocol-symbol)]
                      {:protocol-symbol protocol-symbol})
                    (when fn-var?
                      {:fn-var true
+                      ;; protocol implementation context
                       :protocol-impl (:protocol-impl init-expr)
+                      ;; inline protocol implementation context
                       :protocol-inline (:protocol-inline init-expr)
                       :variadic (:variadic init-expr)
                       :max-fixed-arity (:max-fixed-arity init-expr)
@@ -1021,6 +1025,9 @@
                        locals fields)

         menv (if (> (count meths) 1) (assoc env :context :expr) env)
+        menv (merge menv
+               {:protocol-impl protocol-impl
+                :protocol-inline protocol-inline})
         methods (map #(analyze-fn-method menv locals % gthis) meths)
         max-fixed-arity (apply max (map :max-fixed-arity methods))
         variadic (boolean (some :variadic methods))


fix repeat with zero length list, make sure note off comes after note on

--- src/semitone/core.clj
+++ src/semitone/core.clj
@@ -36,7 +36,7 @@

 (defn env [num-points values & [type options]]
   (if (= 0 (count values))
-    '()
+    (repeat num-points 0)
     (if (= 1 (count values))
       (repeat num-points (first values))
       (let [values (vec values)
@@ -395,7 +395,8 @@
                                                        key
                                                        (:release state))
                                                       (max
-                                                       (+ (:position state)
+                                                       (+ 1
+                                                          (:position state)
                                                           (:displacement-start state))
                                                        (+ (:position state)
                                                           (or (:repeat-length state) (:length state))


Only render tile position changes if instance position has changed

--- src/cljs/tiling/core.cljs
+++ src/cljs/tiling/core.cljs
@@ -13,12 +13,17 @@
   (traversable? [this] true)

   Renderable
-  ;; Render sets the x y position of the tile on the screen
+  ;; Render sets the x y position of the tile on the screen only if
+  ;; the tile position has changed
   (render [this state]
     (let [sprite (:sprite this)]
-      (set! (.-position.x sprite) (:x this))
-      (set! (.-position.y sprite) (:y this))
-      (assoc this :sprite sprite))))
+      (if (and (not= (.-position.x sprite) (:x this))
+               (not= (.-position.y sprite) (:y this)))
+        (do
+          (set! (.-position.x sprite) (:x this))
+          (set! (.-position.y sprite) (:y this))
+          (assoc this :sprite sprite))
+        this))))

 (defn create-tile! [stage img height width x y traversable]
   ;; (debug "Creating tile" stage img height width x y traversable)


Cleaned up code.

Cleaned up code.

--- src/cljs/tunnit/core.cljs
+++ src/cljs/tunnit/core.cljs
@@ -15,19 +15,6 @@
                (f/unparse (f/formatters :week-date) (t/now))
                #"-")
              1) 1))
-
-(defn new-project [id name]
-  {:id id :name name
-   :entries {
-             1 {:hours 0}
-             2 {:hours 0}
-             3 {:hours 0}
-             4 {:hours 0}
-             5 {:hours 0}
-             6 {:hours 0}
-             7 {:hours 0}
-             }
-   })

 (def day-map
   {1 {:name "Ma" :date nil}
@@ -94,22 +81,6 @@
 (defn week-dates []
   (map-kv day-map count-date))

-(defcomponent project-row [project owner opts]
-              (render [this]
-                      (let [todays-hours
-                            (map #(get-in % [:entries (:day opts) :hours])
-                                 (:projects opts))]
-
-                        (print "day: " (:day opts) "hours: " (:entries project))
-                        ;(print "day: " (:day opts) ", hours: " todays-hours)
-                        ;(.log js/console opts)
-
-                        (ot/div {:class "todays-hours"} nil
-                                (map (fn [hours] (ot/div {:class "hour-input"} nil
-                                                         ;(println "hours:" hours)
-                                                         (ot/input {:class "hour-entry" :value hours})))
-                                     todays-hours)))))
-
 (defcomponent project-entries [app]
               (render [this]
                       (ot/div


Add notes about paging

Add notes about paging

--- test/layzee/integration/finding_replies.clj
+++ test/layzee/integration/finding_replies.clj
@@ -44,3 +44,18 @@
              (doseq [tweet tweets]
                   (:in_reply_to_status_id tweet) => 636840679272873984 :notes ["Expected all of the replies to be tagged as replies to the original"]))))

+(defn replies-to[tweet] ;; also consider using the date it was posted so we can search "newer-than"
+  (let [search-result (search/by-keyword settings/twitter-bearer-token (format "@%s" (:screen_name tweet)) {:count 1000}) id (:id_str tweet)]
+    (println (map #(format "id: %s, in_reply_to: %s, %s\n" (:id_str %) (:in_reply_to_status_id_str %) (:text %) (:text %)) search-result))
+    (println (count search-result))
+    (filter #(= id (:in_reply_to_status_id_str %)) search-result)))
+
+(facts :next "As an alternative to the (slow) page scrapes, we could instead do this" ;; https://www.quora.com/How-can-I-get-a-list-of-replies-to-a-specific-tweet-via-Twitter-API
+       ;; Find tweets referenceing the author by searching for them
+       ;; Find any that are in reply to that tweet
+       ;; Note that we will have to page through the results <https://dev.twitter.com/rest/public/timelines>, since at the moment we get single page
+       (let [result (replies-to { :id_str "636840679272873984" :screen_name "iamkey" })]
+         (println result)
+
+         )
+       )


[HOW-TO] Find replies as tweets (not just ids)

--- test/layzee/integration/finding_replies.clj
+++ test/layzee/integration/finding_replies.clj
@@ -33,3 +33,9 @@
  (fact "it returns empty when status id is bung"
        (let [result (replies/to {:id "xxx-this-is-bung-xxx" :screen-name "iamkey"})]
          (count result) => 0)))
+
+ (facts
+  (fact "And you can find the actual tweets like this"
+    (let [result (replies/to {:id "636840679272873984" :screen-name "iamkey"})]
+        (let [tweets (pmap #(api/get-tweet settings/oauth-credential %) result)]
+          (map #(:text %) tweets) => (contains #{"@iamkey Got latest?" "@benbiddington have just now. Still failing." "@iamkey Config file format has changed <https://t.co/66dquz6N78> (soz)" "@benbiddington chur"})))))


Move channels up the namespace.

Move channels up the namespace.

--- test/onyx/peer/lifecycle_exception_test.clj
+++ test/onyx/peer/lifecycle_exception_test.clj
@@ -6,6 +6,10 @@
             [onyx.api]))

 (def n-messages 100)
+
+(def in-chan (atom nil))
+
+(def out-chan (atom nil))

 (defn my-inc [{:keys [n] :as segment}]
   (assoc segment :n (inc n)))
@@ -49,10 +53,6 @@

 (defn handle-exception [event lifecycle phase e]
   :restart)
-
-(def in-chan (atom nil))
-
-(def out-chan (atom nil))

 (defn inject-in-ch [event lifecycle]
   {:core.async/chan @in-chan})


Fixed bug in how user schema version gets saved.

--- src/pe_datomic_utils/core.clj
+++ src/pe_datomic_utils/core.clj
@@ -45,18 +45,26 @@
                       :db/doc "The user schema version number."
                       :db.install/_attribute :db.part/db}]))

+(defn transact-partition
+  [conn partition]
+  @(d/transact conn [{:db/id #db/id[:db.part/db -1]
+                      :db/ident partition}
+                     [:db/add :db.part/db :db.install/partition #db/id[:db.part/db -1]]]))
+
 (defn get-user-schema-version
   [conn user-schema-attr-name]
-  (let [result (d/q (format "[:find ?verval :in $ :where [?ver %s ?verval]]"
+  (let [result (d/q (format "[:find ?ver ?verval :in $ :where [?ver %s ?verval]]"
                             user-schema-attr-name)
                     (d/db conn))]
+
     (when (> (count result) 0)
-      (ffirst result))))
+      (first result))))

 (defn transact-user-schema-version
   [conn partition user-schema-attr-name val]
-  @(d/transact conn [{:db/id (d/tempid partition)
-                      user-schema-attr-name val}]))
+  (let [existing-ver (get-user-schema-version conn user-schema-attr-name)
+        ver-entid (if existing-ver (first existing-ver) (d/tempid partition))]
+    @(d/transact conn [{:db/id ver-entid user-schema-attr-name val}])))

 (defn entity-for-parent-by-id
   [conn parent-entid entity-entid parent-attr]


~vp-pronoun-phrasal remove {:sem {:tense :future}} which was being used for debugging

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -511,8 +511,8 @@
                            :comp {:synsem {:cat :noun
                                            :pronoun true}}
                            :rule "vp-pronoun-phrasal"
-                           :synsem {:cat :verb
-                                    :sem {:tense :future}}})
+                           :synsem {:cat :verb}})
+
                    (unify c21
                           root-is-head
                           (let [reflexive? (atom :top)]


prevent regular morphological pluralization if vocab-cat is 'nounplurf' or 'nounplurm'

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -546,6 +546,7 @@
       (= vocab-cat "nounplurm")
       {surface
        [{:vocab-cat vocab-cat
+         :italiano {:plur surface}
          :synsem {:sem {:pred (keyword pred)}
                   :agr {:gender :masc
                         :number :plur}}}]}
@@ -553,6 +554,7 @@
       (= vocab-cat "nounplurf")
       {surface
        [{:vocab-cat vocab-cat
+         :italiano {:plur surface}
          :synsem {:sem {:pred (keyword pred)}
                   :agr {:gender :fem
                         :number :plur}}}]}


rewrite italian workbook; for unknown reasons it could not reference functions like 'parse' and 'analyze'

--- src/babel/italiano/workbook.clj
+++ src/babel/italiano/workbook.clj
@@ -3,7 +3,7 @@
   (:require
    [babel.engine :as engine]
    [babel.forest :refer [lightning-bolt]]
-   [babel.italiano.grammar :refer [medium small np-grammar]]
+   [babel.italiano.grammar :refer [small medium np-grammar]]
    [babel.italiano.lexicon :refer :all]
    [babel.italiano.morphology :as morph :refer [fo]]
    [babel.italiano.writer :refer [expression]]
@@ -23,24 +23,31 @@
    [clojure.string :as string]
    [clojure.tools.logging :as log]
    [compojure.core :as compojure :refer [GET PUT POST DELETE ANY]]
-   [dag_unify.core :refer [fail? fail-path-between get-in merge remove-false
-                           remove-matching-keys strip-refs unify]]
-   [hiccup.core :refer [html]]
-))
+   [dag_unify.core :refer [fail? fail-path-between get-in remove-false strip-refs unify]]
+   [hiccup.core :refer [html]]))
+
+(defn analyze
+  ([surface-form]
+   (analyze surface-form (:lexicon medium)))
+  ([surface-form lexicon]
+   (morph/analyze surface-form lexicon)))

 (defn generate
   ([]
-   (first (take 1 (engine/generate-all :top medium))))
+   (let [result (engine/generate :top medium)]
+     (conj {:surface (fo result)}
+            result)))
   ([spec]
-   (first (take 1 (engine/generate-all spec medium))))
+   (let [result (engine/generate spec medium)]
+     (conj {:surface (fo result)}
+            result)))
   ([spec model]
-   (first (take 1 (engine/generate-all spec model)))))
-
-(defn generate-all
-  ([spec]
-   (engine/generate-all spec medium))
-  ([spec model]
-   (engine/generate-all spec model)))
+   (let [result (engine/generate spec model)]
+     (conj {:surface (fo result)}
+           result))))
+
+(defn lookup [lexeme]
+  ((:lookup medium) lexeme))

 (defn parse
   ([string]
@@ -51,36 +58,30 @@
 (defn expr [id]
   (reader/id2expression (Integer. id)))

-;; this def is needed to avoid initialization errors when evaluating within the workbook
-;; e.g.: evaluating things like:
-;;(generate {:synsem {:subcat '()
-;;                                          :infl :imperfect
-;;                                          :sem {:subj {:pred :I} :pred :be}}}
-;;                                fr/small)
-
-(def rules (:grammar-map medium))
-
-(defn analyze
-  ([surface-form]
-   (analyze surface-form (:lexicon medium)))
-  ([surface-form lexicon]
-   (morph/analyze surface-form lexicon)))
+;; TODO: do morphological analysis
+;; do find non-infinitives (e.g. find 'parler' given 'parle')
+;; and then apply conjugated parts to lexeme
+;; i.e. if input is 'parle', return
+;; list of lexemes; for each, [:synsem :agr :person] will be
+;; 1st, 2nd, or 3rd, and for all, number will be singular.
+(defn lookup [lexeme]
+  (get (:lexicon medium) lexeme))

 (defn over
   ([arg1]
-   (over/over (vals (:grammar-map medium)) (analyze arg1 medium)))
-  ([grammar arg1]
-   (over/over grammar (analyze arg1)))
-  ([grammar arg1 arg2]
    (cond (string? arg1)
-         (over grammar (analyze arg1)
+         (over (lookup arg1))
+         true
+         (over/over (vals (:grammar-map medium)) arg1)))
+  ([arg1 arg2]
+   (cond (string? arg1)
+         (over (lookup arg1)
                arg2)
-
          (string? arg2)
-         (over grammar arg1 (analyze arg2))
-
+         (over arg1 (lookup arg2))
          true
-         (over/over grammar arg1 arg2))))
+         (over/over (vals (:grammar-map medium))
+                    arg1 arg2))))

 (def workbook-sandbox-it
   (sandbox
@@ -103,7 +104,8 @@
                         ]))
    :refer-clojure false
    ;; using 60000 for development: for production, use much smaller value.
-   :timeout 10000
+   :timeout 60000
+;   :timeout 15000
    :namespace 'babel.italiano.workbook))

@@ -184,12 +186,12 @@
   (let [search-query (get (get request :query-params) "search")]
     (html
      [:div#workbook-ui {:class "quiz-elem"}
-      [:h2 "Italian Workbook"]
+      [:h2 "Italiano Workbook"]

       [:div.hints
        [:h3 "Try:"]
        [:div "(expr X)"]
-       [:div "(parse 'je parle')"]
+       [:div "(parse 'I speak')"]

        ]

@@ -204,10 +206,6 @@
        (if search-query
          (workbookq search-query))]])))

-;(def foo (expression {:synsem {:cat :verb}}))
-;(def foo (expression {:synsem {:sem {:pred :have-fun}}}))
-(def foo (count (take 1 (parse "io dormo"))))
-
 (def routes
   (compojure/routes

@@ -218,15 +216,6 @@
    (GET "/" request
         {:status 200
          :body (html/page "Italian Workbook" (workbook-ui request) request)
-         :headers {"Content-Type" "text/html;charset=utf-8"}})
-
-   (GET "/parse/" request
-        {:status 200
-         :body
-         (let [debug (log/info (str "sending string to parser.."))]
-           (str "" (html/tablize
-                    (get-in (strip-refs (first (parse (get (get request :query-params) "string"))))
-                            [:synsem :sem]))))
          :headers {"Content-Type" "text/html;charset=utf-8"}})

    (GET "/q/" request
@@ -235,3 +224,6 @@
                           (get (get request :query-params) "attrs"))
          :headers {"Content-Type" "text/html;charset=utf-8"}})
   ))
+
+;; not sure why this is necessary: investigate why english/workbook.clj doesn't need it.
+(def foo (count (take 1 (parse "io dormo"))))


fix assertion

fix assertion

--- src/sledge/server.clj
+++ src/sledge/server.clj
@@ -58,7 +58,9 @@
  (=
   (media-links {:encoding-type "FLAC 16 bits"
                 :pathname "/path/to/audio.flac"})
-  {"mp3" {"href" "/bits/L3BhdGgvdG8vYXVkaW8uZmxhYw.mp3"}, "flac" {"href" "/bits/L3BhdGgvdG8vYXVkaW8uZmxhYw.flac"}}))
+  {"mp3" {"href" "/bits/L3BhdGgvdG8vYXVkaW8uZmxhYw.mp3"},
+   "ogg" {"href" "/bits/L3BhdGgvdG8vYXVkaW8uZmxhYw.ogg"},
+   "flac" {"href" "/bits/L3BhdGgvdG8vYXVkaW8uZmxhYw.flac"}}))

 (defn tracks-json [req]
   (let [p (:params req)


better heading for icon part of cljs design post

--- src/pc/views/blog/clojure_is_a_product_design_tool.clj
+++ src/pc/views/blog/clojure_is_a_product_design_tool.clj
@@ -121,7 +121,7 @@
          That's great design, by any standard."]]

     [:article
-     [:h3 "And it protects me from complex design tools."]
+     [:h3 "And it protects me from complex design workflows."]
      [:p "The icon system I made for Precursor is a good example of the inherent elegance within ClojureScript."]
      [:p "Using Illustrator, I constrain every icon to a single area.
          This helps me prevent inconsistent proportions."]]


fix burst bug

fix burst bug

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


Make delete org work even when related resources don't exist.

--- src/oc/storage/resources/org.clj
+++ src/oc/storage/resources/org.clj
@@ -149,11 +149,17 @@

     (do
       ;; Delete interactions
-      (db-common/delete-resource conn common/interaction-table-name :org-uuid uuid)
+      (try
+        (db-common/delete-resource conn common/interaction-table-name :org-uuid uuid)
+        (catch java.lang.RuntimeException e)) ; OK if no interactions
       ;; Delete entries
-      (db-common/delete-resource conn common/entry-table-name :org-uuid uuid)
+      (try
+        (db-common/delete-resource conn common/entry-table-name :org-uuid uuid)
+        (catch java.lang.RuntimeException e)) ; OK if no entries
       ;; Delete boards
-      (db-common/delete-resource conn common/board-table-name :org-uuid uuid)
+      (try
+        (db-common/delete-resource conn common/board-table-name :org-uuid uuid)
+        (catch java.lang.RuntimeException e)) ; OK if no boards
       ;; Delete the org itself
       (db-common/delete-resource conn table-name slug))


Improve performance of peer->allocated-job

--- src/onyx/log/commands/common.clj
+++ src/onyx/log/commands/common.clj
@@ -25,15 +25,15 @@
   (apply + (map count (vals (get-in replica [:allocations job])))))

 (defn peer->allocated-job [allocations id]
-  (get
-   (reduce-kv
-    (fn [all job tasks]
-      (->> tasks
-           (mapcat (fn [[t ps]] (map (fn [p] {p {:job job :task t}}) ps)))
-           (into {})
-           (merge all)))
-    {} allocations)
-   id))
+  (if-let [[job-id [task-id]]
+           (first
+             (remove (comp empty? second)
+                     (map (fn [[job-id task-peers]]
+                            [job-id (first (filter (fn [[task-id peers]]
+                                                     (get (set peers) id))
+                                                   task-peers))])
+                          allocations)))]
+    {:job job-id :task task-id}))

 (defn allocations->peers [allocations]
    (reduce-kv


Revert "Old unused fn."

Revert "Old unused fn."

This reverts commit 26b52a90633c815039bc0338804d19bda552c360.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -435,6 +435,17 @@
       (catch Throwable e
         (ex-f e)))))

+(defn resolve-compression-fn-impls [opts]
+  (assoc opts
+    :onyx.peer-decompress-fn-impl
+    (if-let [f (:onyx.peer-decompress-fn opts)]
+      (operation/resolve-fn f)
+      onyx.compression.nippy/decompress)
+    :onyx.peer-compress-fn-impl
+    (if-let [f (:onyx.peer-compress-fn opts)]
+      (operation/resolve-fn f)
+      onyx.compression.nippy/compress)))
+
 (defn gc-peer-links [event state opts]
   (let [interval (arg-or-default :onyx.messaging/peer-link-gc-interval opts)
         idle (arg-or-default :onyx.messaging/peer-link-idle-timeout opts)


Switch agg-fns to only returning one entry per command

If agg-fns want to play back more than one message they can reduce in
their playback-fn

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -23,6 +23,7 @@
               [clj-tuple :as t]
               [onyx.interop]
               [onyx.state.log.atom]
+              [onyx.state.log.bookkeeper]
               [onyx.state.core :as state]
               [onyx.state.state-extensions :as state-extensions]
               [onyx.static.default-vals :refer [defaults arg-or-default]]))
@@ -323,11 +324,14 @@
   [{:keys [onyx.core/windows onyx.core/window-state onyx.core/state-log] :as event}]
   (when (seq windows)
     (swap! window-state
-           (fn [state] (state-extensions/playback-log-entries state-log event state))))
+           (fn [state]
+             (let [replayed-state (state-extensions/playback-log-entries state-log event state)]
+               (info "REPLAYED STATE:" replayed-state)
+               replayed-state))))
   event)

 (defn assign-windows
-  [{:keys [onyx.core/windows onyx.core/window-state onyx.core/results] :as event}]
+  [{:keys [onyx.core/windows onyx.core/window-state onyx.core/state-log onyx.core/results] :as event}]
   (when (seq windows)
     (doseq [w windows]
       (doseq [msg (mapcat :leaves (:tree results))]
@@ -340,11 +344,10 @@
           (doseq [e extents]
             (let [f (:window/agg-fn w)
                   state (init-window-state w (get-in @window-state [window-id e]))
-                  entries (f state w (:message msg))
-                  updated-state (reduce (fn [state' entry]
-                                          ((:window/log-resolve w) state' entry))
-                                        state
-                                        entries)]
+                  entry (f state w (:message msg))
+                  updated-state ((:window/log-resolve w) state entry)]
+              ;; Need to modify acking for the log storing
+              (state-extensions/store-log-entry state-log event [(:window/id w) e entry])
               (swap! window-state assoc-in [(:window/id w) e] updated-state)))
           (doseq [t (:onyx.core/triggers event)]
             (triggers/fire-trigger! event window-state t {:segment (:message msg) :context :new-segment}))))))
@@ -536,14 +539,10 @@
         (throw (ex-info "Failed to resolve or build plugin on the classpath, did you require/import the file that contains this plugin?" {:symbol kw :exception e}))))))

-(def test-full-log
-  (into {}
-        (map (fn [id]
-               [id (atom [])])
-             (range 20))))
-
 (defn resolve-log [pipeline]
   (assoc pipeline :onyx.core/state-log (state-extensions/initialise-log :atom pipeline)))
+;; place outside of task-lifecycle for testing persistence
+(def test-entries-log (atom {}))

 (defrecord TaskLifeCycle
     [id log messenger-buffer messenger job-id task-id replica peer-replica-view restart-ch
@@ -601,12 +600,14 @@
                            :onyx.core/monitoring monitoring
                            :onyx.core/outbox-ch outbox-ch
                            :onyx.core/seal-ch seal-resp-ch
+                           :onyx.core/task-kill-ch task-kill-ch
+                           :onyx.core/kill-ch kill-ch
                            :onyx.core/peer-opts opts
                            :onyx.core/fn (operation/resolve-task-fn catalog-entry)
                            :onyx.core/replica replica
                            :onyx.core/peer-replica-view peer-replica-view
                            :onyx.core/state state
-                           :onyx.core/test-entries-log test-full-log
+                           :onyx.core/test-entries-log test-entries-log
                            :onyx.core/window-state (atom {})}

             pipeline (build-pipeline catalog-entry pipeline-data)


fix: availability zone

fix: availability zone

--- src/terraboot/vpc.clj
+++ src/terraboot/vpc.clj
@@ -103,7 +103,7 @@
                                                })

              (vpc-resource "aws_ebs_volume" "influxdb"
-                           {:availability_zone region
+                           {:availability_zone (stringify region (first azs))
                             :size 20})

              (aws-instance "influxdb" {:ami "ami-9b9c86f7"


load overlay-trigger and tooltips from react-bootstrap

--- src/desdemona/ui/dom.cljs
+++ src/desdemona/ui/dom.cljs
@@ -12,6 +12,12 @@
 (def menu-item
   (r/adapt-react-class (aget js/ReactBootstrap "MenuItem")))

+(def overlay-trigger
+  (r/adapt-react-class (aget js/ReactBootstrap "OverlayTrigger")))
+
+(def tooltip
+  (r/adapt-react-class (aget js/ReactBootstrap "Tooltip")))
+
 (defn get-el-width
   [el]
   (:width (d/bounding-client-rect el)))


another fix for Old Hollywood Grid, Red Herrings, Strongbox

Only persist the steal cost effects if these cards were trashed during a run. Otherwise they still apply when they shouldn't if the Runner kills one of these with Drive By or if the Corp voluntarily trashes them when doing an install.

--- src/clj/game/cards-upgrades.clj
+++ src/clj/game/cards-upgrades.clj
@@ -191,7 +191,7 @@
                             (swap! state update-in [:runner :register] dissoc :cannot-steal)))}
          un {:effect (req (swap! state update-in [:runner :register] dissoc :cannot-steal))}]
      {:trash-effect
-      {:req (req (= :servers (first (:previous-zone card))))
+      {:req (req (and (= :servers (first (:previous-zone card))) (:run @state)))
        :effect (effect (register-events {:pre-steal-cost (assoc ab :req (req (or (= (:zone target) (:previous-zone card))
                                                                                (= (central->zone (:zone target))
                                                                                (butlast (:previous-zone card))))))
@@ -213,7 +213,7 @@
    (let [ab {:req (req (or (= (:zone card) (:zone target)) (= (central->zone (:zone target)) (butlast (:zone card)))))
              :effect (effect (steal-cost-bonus [:credit 5]))}]
      {:trash-effect
-      {:req (req (= :servers (first (:previous-zone card))))
+      {:req (req (and (= :servers (first (:previous-zone card))) (:run @state)))
        :effect (effect (register-events {:pre-steal-cost (assoc ab :req (req (or (= (:zone target) (:previous-zone card))
                                                                                (= (central->zone (:zone target))
                                                                                (butlast (:previous-zone card))))))
@@ -270,7 +270,7 @@
    (let [ab {:req (req (or (= (:zone card) (:zone target)) (= (central->zone (:zone target)) (butlast (:zone card)))))
              :effect (effect (steal-cost-bonus [:click 1]))}]
      {:trash-effect
-      {:req (req (= :servers (first (:previous-zone card))))
+      {:req (req (and (= :servers (first (:previous-zone card))) (:run @state)))
        :effect (effect (register-events {:pre-steal-cost (assoc ab :req (req (or (= (:zone target) (:previous-zone card))
                                                                                (= (central->zone (:zone target))
                                                                                (butlast (:previous-zone card))))))


Fix story-list-item unmount unbinding

Fix story-list-item unmount unbinding

--- src/cljs/hacker_agent/core.cljs
+++ src/cljs/hacker_agent/core.cljs
@@ -101,8 +101,7 @@
     {:component-will-unmount #(let [story (get (.. % -props -argv) 1)
                                     id (@story :id)]
                                 (binding [base/closer-root [:story-list-item id]]
-                                  (base/close-channel! story [])
-                                  (swap! story dissoc :preview)))}))
+                                  (base/unbind! story [:preview])))}))

 (defn top-stories [stories]
   [:ol.stories


cleanup

cleanup

--- src/cljs/swarmpit/material.cljs
+++ src/cljs/swarmpit/material.cljs
@@ -20,7 +20,6 @@
 (def expand-icon "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z")

 (def create-factory js/React.createFactory)
-(def make-selectable js/MaterialUI.makeSelectable)

 (def paper (create-factory js/MaterialUI.Paper))
 (def avatar (create-factory js/MaterialUI.Avatar))
@@ -30,7 +29,6 @@
 (def menu (create-factory js/MaterialUI.Menu))
 (def menu-item (create-factory js/MaterialUI.MenuItem))
 (def list (create-factory js/MaterialUI.List))
-(def selectable-list (create-factory (make-selectable js/MaterialUI.List)))
 (def list-item (create-factory js/MaterialUI.ListItem))
 (def svg-icon (create-factory js/MaterialUI.SvgIcon))
 (def font-icon (create-factory js/MaterialUI.FontIcon))


more oops

more oops

--- src/clojure/flambo/function.clj
+++ src/clojure/flambo/function.clj
@@ -84,7 +84,6 @@
     (log/trace "CLASS" (type this))
     (log/trace "META" (meta f))
     (log/trace "XS" xs)
-    (log/trace (memo/snapshot deserialize-fn))
     (apply f xs)))

 (defn Function2-call [^flambo.function.Function2 this & xs]
@@ -96,7 +95,6 @@
     (log/trace "CLASS" (type this))
     (log/trace "META" (meta f))
     (log/trace "XS" xs)
-    (log/trace "MEMO" (memo/snapshot deserialize-fn))
     (apply f xs)))

 (defn Function3-call [^flambo.function.Function2 this & xs]
@@ -108,7 +106,6 @@
     (log/trace "CLASS" (type this))
     (log/trace "META" (meta f))
     (log/trace "XS" xs)
-    (log/trace "MEMO" (memo/snapshot deserialize-fn))
     (apply f xs)))

 (defn VoidFunction-call [^flambo.function.VoidFunction this & xs]
@@ -120,7 +117,6 @@
     (log/trace "CLASS" (type this))
     (log/trace "META" (meta f))
     (log/trace "XS" xs)
-    (log/trace "MEMO" (memo/snapshot deserialize-fn))
     (apply f xs)))

 (defn FlatMapFunction-call [^flambo.function.FlatMapFunction this & xs]
@@ -132,7 +128,6 @@
     (log/trace "CLASS" (type this))
     (log/trace "META" (meta f))
     (log/trace "XS" xs)
-    (log/trace "MEMO" (memo/snapshot deserialize-fn))
     (apply f xs)))

 (defn FlatMapFunction2-call [^flambo.function.FlatMapFunction2 this & xs]
@@ -144,7 +139,6 @@
     (log/trace "CLASS" (type this))
     (log/trace "META" (meta f))
     (log/trace "XS" xs)
-    (log/trace "MEMO" (memo/snapshot deserialize-fn))
     (apply f xs)))

 (defn PairFlatMapFunction-call [^flambo.function.PairFlatMapFunction this & xs]
@@ -156,7 +150,6 @@
     (log/trace "CLASS" (type this))
     (log/trace "META" (meta f))
     (log/trace "XS" xs)
-    (log/trace "MEMO" (memo/snapshot deserialize-fn))
     (apply f xs)))

 (defn PairFunction-call [^flambo.function.PairFunction this & xs]
@@ -168,7 +161,6 @@
     (log/trace "CLASS" (type this))
     (log/trace "META" (meta f))
     (log/trace "XS" xs)
-    (log/trace "MEMO" (memo/snapshot deserialize-fn))
     (apply f xs)))

 (defn DoubleFunction-call [^flambo.function.DoubleFunction this & xs]
@@ -180,7 +172,6 @@
     (log/trace "CLASS" (type this))
     (log/trace "META" (meta f))
     (log/trace "XS" xs)
-    (log/trace "MEMO" (memo/snapshot deserialize-fn))
     (apply f xs)))

 (defn DoubleFlatMapFunction-call [^flambo.function.DoubleFlatMapFunction this & xs]
@@ -192,5 +183,4 @@
     (log/trace "CLASS" (type this))
     (log/trace "META" (meta f))
     (log/trace "XS" xs)
-    (log/trace "MEMO" (memo/snapshot deserialize-fn))
     (apply f xs)))


remove unused :require in generated code.

--- src/clojure/pandect/codegen.clj
+++ src/clojure/pandect/codegen.clj
@@ -42,10 +42,7 @@
                      'ns (algorithm-namespace sym)
                      (format "%s algorithm implementation" algorithm)
                      '(:require [pandect.buffer :refer [*buffer-size*]]
-                                [pandect.utils.convert]
-                                [pandect.gen
-                                 [hash-generator]
-                                 [hmac-generator]]))
+                                [pandect.utils.convert]))
                    defs)]
       (pprint form out))))


using sets for all data and removed comments


Unit tests compile again.

Unit tests compile again.

--- test/uk/co/anthonycampbell/imdb/parser_test.clj
+++ test/uk/co/anthonycampbell/imdb/parser_test.clj
@@ -15,13 +15,16 @@

 (ns uk.co.anthonycampbell.imdb.parser-test
     (:use [clojure.test :as test]
+        [uk.co.anthonycampbell.imdb.request :as request]
+        [uk.co.anthonycampbell.imdb.cast-parser :as cast-parser]
         [uk.co.anthonycampbell.imdb.parser :as parser]
+        [uk.co.anthonycampbell.imdb.struct :as struct]
         [uk.co.anthonycampbell.imdb.core :as core]))

 (def test-url "http://www.imdb.com")
 (def test-query-url "http://www.imdb.com/find?s=all&q=clash%20of%20the%20titans")
 (def test-title-url "http://www.imdb.com/title/tt0800320")
-(def test-agent select-agent)
+(def test-agent request/select-agent)

 (println "\nBase URL:" test-url)
 (println "Title URL:" test-title-url)
@@ -113,7 +116,7 @@
 (deftest check-construct-release-date
     (testing
         "Ensure we successfully construct a release date string from parsed title page."
-        (is (= "2 April 2010 (UK)"
+        (is (= "2 April 2010"
                (construct-release-date
                    (parse-title-main-details (body-resource test-title-url)))))))


[CS] Differentiate full-good-xml test db name

--- test/vip/data_processor/validation/xml_test.clj
+++ test/vip/data_processor/validation/xml_test.clj
@@ -108,7 +108,7 @@
     (let [ctx (merge {:input (xml-input "full-good-run.xml")
                       :data-specs data-spec/data-specs
                       :pipeline (concat [load-xml] db/validations)}
-                     (sqlite/temp-db "load-xml-test"))
+                     (sqlite/temp-db "full-good-xml"))
           out-ctx (pipeline/run-pipeline ctx)]
       (is (nil? (:stop out-ctx)))
       (is (nil? (:exception out-ctx)))


Work on functions to generate types

Work on functions to generate types

--- src/beehive/hive.clj
+++ src/beehive/hive.clj
@@ -69,6 +69,10 @@
       :rejected-metrics (~metrics-fn ~key->form ~@metric-fn-args)
       :back-pressure [~@(for [form mechanisms]
                           (clojure.walk/postwalk-replace key->form form))]}))
+
+;; TODO: Can get keyword for enum
+(defmacro gen-result-type [result->success?]
+  (:cpath (enums/generate-result-enum result->success?)))

 (defmacro results
   [result->success? metrics-seq & latency-metrics-seq]