CMR-702: Updating test for default ordering of CMR collection results

--- test/cmr/system_int_test/search/collection_sorting_search_test.clj
+++ test/cmr/system_int_test/search/collection_sorting_search_test.clj
@@ -25,6 +25,7 @@
           :errors [(msg/invalid-sort-key "foo_bar" :collection)]}
          (search/find-refs :collection {:sort-key "foo_bar"}))))

+
 (deftest sorting-test
   (let [c1 (make-coll "PROV1" "et99" 10 20)
         c2 (make-coll "PROV1" "et90" 14 24)
@@ -43,10 +44,6 @@
         all-colls [c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12]]
     (index/refresh-elastic-index)

-    (testing "default sorting"
-      (is (d/refs-match-order?
-            (sort-by (comp str/lower-case :entry-title) all-colls)
-            (search/find-refs :collection {:page-size 20}))))

     (testing "Sort by entry title ascending"
       (are [sort-key] (d/refs-match-order?
@@ -80,6 +77,17 @@
                                                              :sort-key sort-key}))
            "end_date" [c5 c1 c12 c2 c6 c7 c3 c4 c8 c9 c10 c11]
            "-end_date" [c8 c4 c3 c7 c6 c2 c12 c1 c5 c9 c10 c11]))))
+
+(deftest default-sorting-test
+  (let [c1 (make-coll "PROV1" "et99" 10 20)
+        c2 (make-coll "PROV2" "et99" 14 24)
+        c3 (make-coll "PROV2" "et80" 19 30)
+        c4 (make-coll "PROV1" "et80" 24 35)
+        all-colls [c1 c2 c3 c4]]
+    (index/refresh-elastic-index)
+    (is (d/refs-match-order?
+      (sort-by (juxt (comp str/lower-case :entry-title) (comp str/lower-case :provider-id)) all-colls)
+      (search/find-refs :collection {:page-size 20})))))

 (deftest multiple-sort-key-test
   (let [c1 (make-coll "PROV1" "et10" 10 nil)


One more TODO

One more TODO

--- src/loudmoauth/core.clj
+++ src/loudmoauth/core.clj
@@ -50,6 +50,7 @@
   (assoc astate :state (uuid)))

 ;This is the handlers function to call after receiving callback to specified url.
+;TODO - Deal with cases where token is nil. If so don't put on channel.
 (defn parse-code
   "Parse code from http-response and deliver promise."
   [response]


add icons

add icons

--- src/lout_expo/core.cljs
+++ src/lout_expo/core.cljs
@@ -13,21 +13,24 @@
 (def touchable-highlight (r/adapt-react-class (.-TouchableHighlight ReactNative)))
 (def Alert (.-Alert ReactNative))

+(def FontAwesome (js/require "@expo/vector-icons/FontAwesome"))
+(def icon (r/adapt-react-class (aget FontAwesome "default")))
+
 (defn alert [title]
   (.alert Alert title))

 (defn light-component [val x y]
   ^{:key (str x "," y)}
   [view {:style {:background-color :white :flex 1}}
-   [touchable-highlight {:style {:background-color "#999"
+   [touchable-highlight {:style {:background-color (if (= 1 val) "#aaa" "#555")
                                  :margin 1
-                                 :padding 10
-                                 :border-radius 5
-
+                                 :border-radius 3
                                  :flex 1}
                          :on-press #(dispatch [:toggle-light [x y]])}
-    [text {:style {:color :white
-                   :flex 1 :text-align :center :text-align-vertical :center :font-weight "bold"}} val]]
+    [icon {:style {:color (if (= 1 val) :yellow :white)
+                   :flex 1 :text-align :center :text-align-vertical :center :font-size 60}
+           :name "lightbulb-o"
+           }]]
    ])

 (defn row-component [row-lights y]


Only set :produced_date for the first revision

Fixes #24 and fixes #23

--- src/mdr2/production.clj
+++ src/mdr2/production.clj
@@ -207,14 +207,21 @@
   (obi/config-file production)
   (set-state! production "structured"))

+(defn update-production-dates
+  "Update the production dates for a new revision according to
+  http://www.daisy.org/z3986/2005/Z3986-2005.html#PubMed"
+  [production date]
+  (-> production
+      (assoc :date date :revision_date date)
+      ;; only set the :produced_date for the first revision
+      (conj (when (= (:revision production) 0) [:produced_date date]))))
+
 (defn set-state-recorded! [production]
   (transaction
-   (let [current-date (to-sql-date (t/now))
-         new-production
+   (let [new-production
          (-> production
              (merge (dtb/meta-data (path/recorded-path production)))
-             (assoc :produced_date current-date)
-             (assoc :revision_date current-date)
+             (update-production-dates (to-sql-date (t/now)))
              (update-in [:revision] inc)
              (set-state! "recorded"))]
      (msg/publish (queues/encode) {:production new-production})


fix #6

fix #6

--- src/ombs/db/payment.clj
+++ src/ombs/db/payment.clj
@@ -109,12 +109,16 @@
   ([ename date]
   (reduce -
           (replace
-            (first (sql/select summary (sql/where {:event ename :date date})))
+            (first (sql/select summary (sql/where {:event ename :date date})
+                               (sql/aggregate (sum :debits) :debits)
+                               (sql/aggregate (sum :credits) :credits)))
             [:debits :credits])))
   ([eid]
   (reduce -
           (replace
-            (first (sql/select summary (sql/where {:eid eid}) ))
+            (first (sql/select summary (sql/where {:eid eid})
+                               (sql/aggregate (sum :debits) :debits)
+                               (sql/aggregate (sum :credits) :credits)))
             [:debits :credits])))

   )


Add control-bus-monitor functionality to mirror audio-bus-monitor.

Also, move to using taps for audio-bus-monitor

--- src/overtone/sc/bus.clj
+++ src/overtone/sc/bus.clj
@@ -3,6 +3,7 @@
   (:use [overtone.sc.machinery allocator]
         [overtone.sc.machinery.server comms]
         [overtone.sc synth ugens defaults server node]
+        [overtone.sc.cgens.tap]
         [overtone.helpers lib]
         [overtone.sc.foundation-groups :only [foundation-monitor-group]]
         [overtone.libs.deps            :only [on-deps]])
@@ -16,7 +17,8 @@
 ;; but in SC they are implemented using a simple integer referenced
 ;; array of float values.

-(defonce ^{:private true} bus-monitors* (atom {}))
+(defonce ^{:private true} audio-bus-monitors* (atom {}))
+(defonce ^{:private true} control-bus-monitors* (atom {}))
 (defonce ^{:private true} bus-monitor-pool (at-at/mk-pool))
 (defonce ^{:private true} audio-bus-monitor-group* (atom nil))

@@ -167,17 +169,19 @@
 (on-deps :foundation-groups-created ::create-monitor-group create-monitor-group)

 (defonce __BUS-MONITOR-SYNTH__
-  (defsynth mono-audio-bus-level [in-a-bus 0 out-c-bus 0]
+  (defsynth mono-audio-bus-level [in-a-bus 0]
     (let [sig   (in:ar in-a-bus 1)
           level (amplitude sig)
           level (lag-ud level 0.1 0.3)]
-      (out:kr out-c-bus [(a2k level)]))))
+      (tap "level" 20 level))))

 (defn audio-bus-monitor
   "Mono bus amplitude monitor. Returns an atom containing the current
-   amplitude of the monitor. For multi-channel buses, an offset may be
-   specified. Current amplitude is updated within the returned atom
-   every 50 ms.
+   amplitude of the audio bus. Note that this isn't the current value,
+   rather it's the peak amplitude of the signal within the audio bus.
+
+   For multi-channel buses, an offset may be specified. Current
+   amplitude is updated within the returned atom every 50 ms.

    Note - only creates one monitor per audio bus - subsequent calls for
    the same audio bus idx will return a cached monitor."
@@ -187,18 +191,36 @@
      (assert @audio-bus-monitor-group* "Couldn't find audio bus monitor group")
      (let [bus-idx (to-sc-id audio-bus)
            bus-idx (+ chan-offset bus-idx)]
-       (if-let [[monitor _] (get @bus-monitors* bus-idx)]
+       (if-let [[monitor _] (get @audio-bus-monitors* bus-idx)]
          monitor
-         (let [monitor (atom 0)
-               cb      (control-bus (str "audio-bus-level [" bus-idx "]"))
-               m-synth (mono-audio-bus-level [:tail @audio-bus-monitor-group*]
-                                             bus-idx
-                                             cb)]
-
+         (let [m-synth (mono-audio-bus-level [:tail @audio-bus-monitor-group*]
+                                             bus-idx)
+               monitor (get-in m-synth [:taps "level"])]
+           (swap! audio-bus-monitors* assoc bus-idx [monitor m-synth])
+           monitor)))))
+
+(defn control-bus-monitor
+  "Control bus monitor. Returns an atom containing the current value of
+   the control bus. Note that this isn't the peak amplitude, rather the
+   direct value of the control bus.
+
+   For multi-channel buses, an offset may be specified. Current
+   amplitude is updated within the returned atom every 50 ms.
+
+   Note - only creates one monitor per control bus - subsequent calls for
+   the same control bus idx will return a cached monitor."
+  ([control-bus] (control-bus-monitor control-bus 0))
+  ([control-bus chan-offset]
+     (ensure-connected!)
+     (let [bus-idx (to-sc-id control-bus)
+           bus-idx (+ chan-offset bus-idx)]
+       (if-let [monitor (get @control-bus-monitors* bus-idx)]
+         monitor
+         (let [monitor (atom 0)]
            (at-at/every 50
                         #(reset! monitor (control-bus-get bus-idx))
                         bus-monitor-pool
                         :initial-delay 0
-                        :desc (str "bus-monitor [" bus-idx "]"))
-           (swap! bus-monitors* assoc bus-idx [monitor m-synth])
+                        :desc (str "control-bus-monitor [" bus-idx "]"))
+           (swap! control-bus-monitors* assoc bus-idx monitor)
            monitor)))))


Add an instrument reference.

Add an instrument reference.

--- src/klangmeister/ui/reference.cljs
+++ src/klangmeister/ui/reference.cljs
@@ -80,4 +80,11 @@
      (where :pitch (comp D minor)))"]
            ["tempo" "Puts a melody in a tempo at a particular beats-per-minute."
 "(->> piece
-     (tempo (bpm 120))"]])])
+     (tempo (bpm 120))"]])
+    [:h2 "Instruments"]
+    [:p "These instruments are available by default."]
+   (table [["bell" "An approximate bell sound." ""]
+           ["kick" "A kick drum." ""]
+           ["open-hat, closed-hat" "High hat sounds." ""]
+           ["marimba" "A pure, percussive sound like a marimba." ""]
+           ["wah" "A synth with a wah sound made by a filter." ""]])])


numbers etc.

numbers etc.

--- src/picsou/time/api.clj
+++ src/picsou/time/api.clj
@@ -41,15 +41,10 @@
                          {:normalized {:value (t/period->duration value)
                                        :unit "second"}}))

-      :temperature  (merge {:type "value" :value value}
-                           (select-keys token [:unit]))
+      (:temperature :distance :amount-of-money :number :volume)
+                (merge {:type "value" :value value}
+                       (select-keys token [:unit]))

-      :distance     (merge {:type "value" :value value}
-                           (select-keys token [:unit]))
-
-      :amount-of-money  (merge {:type "value" :value value}
-                               (select-keys token [:unit]))
-
       :quantity (select-keys token [:value :unit :product])

 	    value))) ; keep value as is for other dims


better not to display canonical

better not to display canonical

--- src/clj/apollo/db/schema.clj
+++ src/clj/apollo/db/schema.clj
@@ -151,7 +151,7 @@

 (defn get-albums-recently-added
   ([db days-ago]
-   (sql/query db [(format "select group_concat(DISTINCT artist_canonical) as artist, album_canonical, album, year, last_modified from tracks where last_modified > %s group by album order by last_modified desc,id desc" (c/to-long (-> days-ago t/days t/ago)))]))
+   (sql/query db [(format "select group_concat(DISTINCT artist) as artist, album_canonical, album, year, last_modified from tracks where last_modified > %s group by album order by last_modified desc,id desc" (c/to-long (-> days-ago t/days t/ago)))]))
   ([db] (get-albums-recently-added db 365)))

 (defn get-albums-by-year [db]


more of Dan playing with himself on the playground.

--- src/clj/forma/playground.clj
+++ src/clj/forma/playground.clj
@@ -1,3 +1,4 @@
+
 ;; I'll put some stuff on a guide to clojure for the guys in
 ;; here. Know how to switch namespaces -- know what they mean, and
 ;; know that you can look up documentation for any function, the way
@@ -101,31 +102,18 @@
     (vector (map #(Float. %) (s/split txtln #" "))))

-(defn )
-
 (defn test-mult
   [m pd]
   (let [row (vector m)
         col (i/trans row)
-        ones (vector (i/trans (i/matrix 1 1 pd)))
-        ind (apply vector (map inc (range 134)))]
+        ones (i/trans (i/matrix 1 1 pd))
+        ind (apply vector (map inc (range pd)))]
     (vector (i/mmult row col))))

-(def iris-lm [m]
-    (linear-model y x))

 (defn wordcount
     [path pd]
     (?<- (stdout) [?sum]
         ((hfs-textline path) ?line)
         (text->num ?line :> ?vector)
-        (test-mult ?vector :> ?sum)))
-
-
-
-
-
-(defn tester-2 []
-  (?<- (stdout) [?name ?period ?face]
-       (age ?name ?period)
-       (identity "face" :> ?face)))
+        (test-mult ?vector :> ?sum)))


Minor cleanup of pprint uses in utils

Minor cleanup of pprint uses in utils

--- src/clj_ns_browser/utils.clj
+++ src/clj_ns_browser/utils.clj
@@ -310,10 +310,7 @@
                                            *max-value-display-size*)))
               (coll? val) (str
                            " (any ... or # shown are likely due to truncation for brevity)\n"
-                           (with-out-str
-                             (binding [*print-length* 10
-                                       *print-level* 5]
-                               (clojure.pprint/pprint val))))
+                           (pprint-str val))
               :else (str val "   (default display using .toString)"))
              "\n")))))

@@ -448,4 +445,4 @@
   "Shorter-name version of apropos that also sorts and pretty-prints
 the results."
   [str-or-pattern & opts]
-  (clojure.pprint/pprint (sort (apply apropos str-or-pattern opts))))
+  (pprint (sort (apply apropos str-or-pattern opts))))


fix token comp error

fix token comp error

--- src/cljc/swarmpit/token.cljc
+++ src/cljc/swarmpit/token.cljc
@@ -11,7 +11,8 @@
                [clojure.walk :refer [keywordize-keys]]
                [goog.crypt.base64 :as b64]])))

-(def r (t/reader :json))
+#?(:cljs
+   (def r (t/reader :json)))

 (defn- token-value
   [token]


Fixes https://github.com/lspector/Clojush/issues/225

When going through the list of genetic operators, we now check when
there's just one operator left and choose that. This avoids the
rare but occassional situation where we'd get a `NullPointerException`
because we'd run through the whole list of operators without the sum
of the probabilities getting past the random number.

--- src/clojush/pushgp/breed.clj
+++ src/clojush/pushgp/breed.clj
@@ -135,7 +135,8 @@
     (let [prob (lrand)]
       (loop [vectored-go-probabilities (reductions #(assoc %2 1 (+ (second %1) (second %2)))
                                                    (vec genetic-operator-probabilities))]
-        (if (<= prob (second (first vectored-go-probabilities)))
+        (if (or (= 1 (count vectored-go-probabilities))
+                (<= prob (second (first vectored-go-probabilities))))
           (perform-genetic-operator (first (first vectored-go-probabilities)) population location rand-gen argmap)
           (recur (rest vectored-go-probabilities)))))))


Moved start timer into originating function.

--- src/cmr/opendap/ous/core.clj
+++ src/cmr/opendap/ous/core.clj
@@ -138,15 +138,14 @@
 (defn stage1
   [search-endpoint user-token raw-params]
   (log/debug "Starting stage 1 ...")
-  (let [start (util/now)
-        params (params/parse raw-params)
+  (let [params (params/parse raw-params)
         bounding-box (:bounding-box params)
         grans-promise (granule/async-get-metadata
                        search-endpoint user-token params)
         coll-promise (collection/async-get-metadata
                       search-endpoint user-token params)]
     (log/debug "Finishing stage 1 ...")
-    [start params bounding-box grans-promise coll-promise]))
+    [params bounding-box grans-promise coll-promise]))

 (defn stage2
   [search-endpoint user-token params coll-promise grans-promise]
@@ -196,10 +195,11 @@
 (defn get-opendap-urls
   [search-endpoint user-token raw-params]
   (log/trace "Got params:" raw-params)
-  (let [;; Stage 1
-        [start params bounding-box granules coll] (stage1 search-endpoint
-                                                          user-token
-                                                          raw-params)
+  (let [start (util/now)
+        ;; Stage 1
+        [params bounding-box granules coll] (stage1 search-endpoint
+                                                    user-token
+                                                    raw-params)
         ;; Stage 2
         [data-files service-ids vars s2-errs] (stage2
                                                search-endpoint


Enterprise has no 'Need Help?' tab.

Enterprise has no 'Need Help?' tab.

--- src-cljs/frontend/components/app.cljs
+++ src-cljs/frontend/components/app.cljs
@@ -135,7 +135,7 @@
                (when-not (config/enterprise?)
                  [:footer.main-foot
                   (footer/footer)])
-               (when-not logged-in?
+               (when-not (or logged-in? (config/enterprise?))
                  (om/build shared/sticky-help-link app))]])))))))


Make progress an absolute path in k8s (#1743)

Co-authored-by: Scott Crosby <23e8f75489aff47cf2cd5a529e9a769a24e9501c@twosigma.com>

--- scheduler/src/cook/kubernetes/api.clj
+++ scheduler/src/cook/kubernetes/api.clj
@@ -842,7 +842,7 @@
                    ;; Add a default progress file path to the environment when missing,
                    ;; preserving compatibility with Meosos + Cook Executor.
                    (not progress-file-path)
-                   (assoc progress-file-var (str task-id ".progress")))
+                   (assoc progress-file-var (str workdir "/" task-id ".progress")))
         main-env-vars (make-filtered-env-vars main-env)
         computed-mem (if checkpoint-memory-overhead (add-as-decimals mem checkpoint-memory-overhead) mem)]


Store AWS credentials in local storage.

Store AWS credentials in local storage.

--- src/mash_commander/core.cljs
+++ src/mash_commander/core.cljs
@@ -9,10 +9,13 @@
 (enable-console-print!)

 (defonce polly
-  (js/AWS.Polly. #js {:apiVersion "2016-06-10"
-                      :region "us-east-1"
-                      :accessKeyId "foo"
-                      :secretAccessKey "bar"}))
+  (let [access-key-id (js/localStorage.getItem "accessKeyId")
+        secret-access-key (js/localStorage.getItem "secretAccessKey")]
+    (when-not (or (nil? access-key-id) (nil? secret-access-key))
+      (js/AWS.Polly. #js {:apiVersion "2016-06-10"
+                          :region "us-east-1"
+                          :accessKeyId access-key-id
+                          :secretAccessKey secret-access-key}))))

 ;; https://gist.github.com/msgodf/9296652
 (defn decode-audio-data
@@ -38,7 +41,12 @@

 (def polly-say (chan))
 (go-loop []
-    (let [what (<! polly-say)]
+  (let [what (<! polly-say)]
+    (if (nil? polly)
+      (do
+        (print "Polly needs AWS credentials to say:" what)
+        (print "window.localStorage.setItem('accessKeyId', /* access key id */)")
+        (print "window.localStorage.setItem('secretAccessKey', /* secret access key */"))
       (. polly synthesizeSpeech (clj->js {:Text what
                                           :OutputFormat "mp3"
                                           :VoiceId "Ivy"})
@@ -46,7 +54,7 @@
            (if err
              (print err err.stack)
              (let [buffer (.-buffer (.-AudioStream data))]
-               (play-audio buffer))))))
+               (play-audio buffer)))))))
     (recur))

 (defonce app-state


Comment

Comment

--- src/cylon/user/protocols.clj
+++ src/cylon/user/protocols.clj
@@ -8,7 +8,9 @@
   (get-user [_ uid])
   (get-user-password-hash [_ uid])
   (set-user-password-hash! [_ uid pw-hash])
-  (get-user-by-email [_ email])
+  (get-user-by-email [_ email]
+    "Return user details for the user with this email address. Delegate
+    to get-user if email addresses are used as the user identifier.")
   (delete-user! [_ uid])
   (verify-email! [_ uid]))


Report actual model name (Mini or S) found.


Fix errors in startup animation.

Fix errors in startup animation.


attempt and fail to extend stratified

attempt and fail to extend stratified

--- src/angelic/search/action_set/stratified.clj
+++ src/angelic/search/action_set/stratified.clj
@@ -18,7 +18,20 @@

 (defn effect-var [a] (util/safe-singleton (keys (:effect-map a))))

-(defn stratified-applicable-actions [last-a state tsi actions]
+;; Does not work.  The "jumping around" afforded by the TSI is needed.
+(defn improved-inf-stratified-applicable-actions [last-a state pre-var-map actions]
+  (if last-a
+    (let [a-var   (effect-var last-a)
+          p-set   (util/safe-get pre-var-map a-var)]
+      (filter
+       (fn [b]
+         (let [b-var (effect-var b)]
+           (or (contains? p-set b-var)
+               (contains? (:precond-map b) a-var))))
+       (actions state)))
+    (actions state)))
+
+(defn inf-stratified-applicable-actions [last-a state tsi actions]
   (if last-a
     (let [a-var   (effect-var last-a)
           a-level (util/safe-get tsi a-var)]
@@ -32,15 +45,20 @@
     (actions state)))

 (defn stratified-search [sas-problem]
-  (let [q       (queues/make-tree-search-pq)
+  (let [improved? false
+        q       (queues/make-tree-search-pq)
         closed  (HashSet.)
         actions (env/actions-fn sas-problem)
-        causal-graph  (remove #(apply = %) (sas-analysis/standard-causal-graph sas-problem))
-        tsi           (graphs/topological-sort-indices causal-graph)
+        causal-graph  (sas-analysis/standard-causal-graph sas-problem)
+        pre-var-map   (util/map-vals #(set (map first %)) (group-by second causal-graph))
+        tsi           (graphs/topological-sort-indices (remove #(apply = %) causal-graph))
         goal    (env/goal-fn sas-problem)
-        init    (env/initial-state sas-problem)]
+        init    (env/initial-state sas-problem)
+        strat-actions (if improved?
+                        (fn [last-a state] (improved-inf-stratified-applicable-actions last-a state pre-var-map actions))
+                        (fn [last-a state] (inf-stratified-applicable-actions last-a state tsi actions)))]
     (queues/pq-add! q [nil init] 0)
-    (println tsi)
+;    (println causal-graph tsi pre-var-map)
     (loop []
       (when-not (queues/pq-empty? q)
         (let [[[last-a state] c] (queues/pq-remove-min-with-cost! q)]
@@ -49,7 +67,7 @@
             [(reverse (:act-seq (meta state))) (:reward (meta state))]
             (do (when-not (.contains closed state)
                   (.add closed state)
-                  (doseq [a (stratified-applicable-actions last-a state tsi actions)]
+                  (doseq [a (strat-actions last-a state)]
                     (when (env/applicable? a state)
                       (let [[ss sc] (env/successor a state)]
                         (queues/pq-add! q [a ss] (- c sc))))))
@@ -61,7 +79,7 @@

 ;; (let [e (force (nth ipc2-logistics 3)) ]  (println (time (run-counted #(stratified-search e)))))

-;; Logistics results (# states) to match table.
+;; Logistics results (# states) to match table. -- ordi
 ;; 5-2: 19771
 ;; 6-1: 226446
 ;; 4-2: 365709


Missing secure-uuid prop from email trigger.

--- src/oc/storage/lib/email.clj
+++ src/oc/storage/lib/email.clj
@@ -15,6 +15,7 @@
    :org-name (schema/maybe schema/Str)
    :org-logo-url (schema/maybe schema/Str)
    :title (schema/maybe schema/Str)
+   :secure-uuid lib-schema/UniqueID
    :published-at lib-schema/ISO8601
    :shared-at lib-schema/ISO8601})

@@ -28,6 +29,7 @@
    :org-name (:name org)
    :org-logo-url (:logo-url org)
    :title (:title story)
+   :secure-uuid (:secure-uuid story)
    :published-at (:published-at story)
    :shared-at (:shared-at share-request)})


Aux message types will never be fragmented

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -84,11 +84,16 @@
           (let [retry-id (protocol/read-retry buffer offset-rest)]
             (>!! retry-ch retry-id)))))

-(defn data-handler [f]
+(defn fragment-data-handler [f]
   (FragmentAssemblyAdapter.
     (proxy [FragmentHandler] []
       (onFragment [buffer offset length header]
         (f buffer offset length header)))))
+
+(defn data-handler [f]
+  (proxy [FragmentHandler] []
+    (onFragment [buffer offset length header]
+      (f buffer offset length header))))

 (defn backoff-strategy [strategy]
   (case strategy
@@ -191,10 +196,12 @@
         aeron (Aeron/connect ctx)
         channel (aeron-channel bind-addr (:aeron/port assigned))
         decompress-f (:decompress-f messenger)
-        send-handler (data-handler (fn [buffer offset length header]
-                                     (handle-sent-message inbound-ch decompress-f buffer offset length header)))
-        aux-handler (data-handler (fn [buffer offset length header]
-                                    (handle-aux-message acking-daemon release-ch retry-ch buffer offset length header)))
+        send-handler (fragment-data-handler
+                       (fn [buffer offset length header]
+                         (handle-sent-message inbound-ch decompress-f buffer offset length header)))
+        aux-handler (data-handler
+                      (fn [buffer offset length header]
+                        (handle-aux-message acking-daemon release-ch retry-ch buffer offset length header)))

         send-subscriber (.addSubscription aeron channel send-stream-id)
         aux-subscriber (.addSubscription aeron channel aux-stream-id)


moved to core async

moved to core async

--- src/basilisk/tasks/collector/tsetmc/core.clj
+++ src/basilisk/tasks/collector/tsetmc/core.clj
@@ -10,22 +10,38 @@
 (defrecord TradeSymbol [symbol name tsetmc-id tsetmc-name])

-(defn fetch-csv []
-  (async/>!! input-channel
-             (clojure.string/split (:body (http/get (:index-csv (:fa site-url)))) #";")))
+(defn fetch-csv
+  "Fetch the CSV file from remote host and add each line to a channel"
+  [output-channel]
+  (async/go
+    (let [buffer (:body (http/get (:index-csv (:fa site-url))))
+          lines (clojure.string/split buffer  #";")]
+      (map #(async/>! output-channel %) lines))))

-(defn create-record [line]
-  (let [fields (clojure.string/split line #",")]
-    (if (= 23 (count fields))
-      (map->TradeSymbol
-        {:symbol      (get fields 2)
-         :name        (get fields 3)
-         :tsetmc-id   (get fields 0)
-         :tsetmc-name (get fields 1)})
-      nil)))
+
+(defn create-records
+  "Fetch each line of the CSV from the input-channel and create a record then push it
+  to the output channel."
+  [input-channel output-channel]
+  (async/go
+    (let [line (async/<! input-channel)
+          fields (clojure.string/split line #",")]
+      (if (= 23 (count fields))
+        (async/>! output-channel
+                  (map->TradeSymbol
+                    {:symbol      (get fields 2)
+                     :name        (get fields 3)
+                     :tsetmc-id   (get fields 0)
+                     :tsetmc-name (get fields 1)}))))))

 (defn with-each-symbol []
   (let [lines (take 5 (fetch-csv))]
-    (map create-record lines)))
+    (map create-records lines)))

-(defn collect-symbols [])
+(defn collect-symbols
+  []
+  (let [in (async/chan 10000)
+        rec-chan (async/chan 10000)]
+    (fetch-csv in)
+    (create-records in rec-chan)
+    (async/go (println (async/<! rec-chan)))))


add Sam and Marius to the list of authors

--- src/overtone/music/pitch.clj
+++ src/overtone/music/pitch.clj
@@ -2,7 +2,7 @@
   ^{:doc "Functions to help generate and manipulate frequencies and sets of related frequencies.
           This is the place for functions representing general musical knowledge, like scales, chords,
           intervals, etc."
-     :author "Jeff Rose"}
+     :author "Jeff Rose, Sam Aaron & Marius Kempe"}
   overtone.music.pitch
   (:require [clojure.contrib.math :as math]))


More consistent bench result reporting

More consistent bench result reporting

--- benchmarks/caesium/magicnonce/secretbox_benchmark.clj
+++ benchmarks/caesium/magicnonce/secretbox_benchmark.clj
@@ -9,16 +9,14 @@
   (let [f @#'ms/synthetic-nonce
         key (randombytes ms/keybytes)
         sizes (map (partial bit-shift-left 1) [6 8 10 12 20 24])]
-    (print-title "synthetic nonce benchmarks")
     (doseq [[size message] (map (juxt identity randombytes) sizes)]
-      (println (fmt-bytes size))
+      (print-title "synthetic nonce generation" (fmt-bytes size))
       (quick-bench (f message key)))))

 (deftest ^:benchmark implicit-nonce-benchmarks
   (let [key (randombytes ms/keybytes)
         sizes (map (partial bit-shift-left 1) [6 8 10 12 20 24])]
-    (print-title "implicit nonce schemes")
     (doseq [[size message] (map (juxt identity randombytes) sizes)
             f [ms/secretbox-nmr ms/secretbox-rnd ms/secretbox-det]]
-      (println f (fmt-bytes size))
+      (print-title "implicit nonce scheme" f (fmt-bytes size))
       (bench (f message key)))))


add transaction fields to item query

add transaction fields to item query

--- src/clj_money/models/storage/sql_storage.clj
+++ src/clj_money/models/storage/sql_storage.clj
@@ -235,10 +235,11 @@

   (select-transaction-items-by-account-id
     [_ account-id]
-    (query db-spec (-> (h/select :*)
-                      (h/from :transaction_items)
-                      (h/where [:= :account_id account-id])
-                      (h/order-by [:index :desc]))))
+    (query db-spec (-> (h/select :i.* :t.transaction_date :t.description)
+                      (h/from [:transaction_items :i])
+                      (h/join [:transactions :t] [:= :t.id :i.transaction_id])
+                      (h/where [:= :i.account_id account-id])
+                      (h/order-by [:i.index :desc]))))

   (select-transaction-items-by-account-id-and-starting-index
     [_ account-id index]


skip nodejs targets

skip nodejs targets

--- src/adzerk/boot_reload.clj
+++ src/adzerk/boot_reload.clj
@@ -46,14 +46,15 @@

 (defn- add-init!
   [in-file out-file]
-  (let [ns 'adzerk.boot-reload]
-    (info "Adding :require %s to %s...\n" ns (.getName in-file))
-    (-> in-file
-        slurp
-        read-string
+  (let [ns 'adzerk.boot-reload
+        spec (-> in-file slurp read-string)]
+    (when (not= :nodejs (-> spec :compiler-options :target))
+      (info "Adding :require %s to %s...\n" ns (.getName in-file))
+      (io/make-parents out-file)
+      (-> spec
         (update-in [:require] conj ns)
         pr-str
-        ((partial spit out-file)))))
+        ((partial spit out-file))))))

 (deftask reload
   "Live reload of page resources in browser via websocket.


Remove unnecessary namespace qualifier.

Remove unnecessary namespace qualifier.

--- src/afterglow/channels.clj
+++ src/afterglow/channels.clj
@@ -62,8 +62,7 @@
   including those used by any fixture heads."
   [fixtures]
   (mapcat #(vals (select-keys % [:address :fine-address]))
-          (mapcat :channels (afterglow.channels/expand-heads fixtures))))
-
+          (mapcat :channels (expand-heads fixtures))))

 (defn extract-heads-with-some-matching-channel
   "Given a fixture list, returns all heads (which may be top-level fixtures too)


Allow circle chases to act as overlay cues.

--- src/afterglow/examples.clj
+++ src/afterglow/examples.clj
@@ -1478,7 +1478,7 @@
                              :color :yellow :end-keys [:movement]))

     (show/set-cue! (+ x-base 3) (+ y-base 4)
-                   (cues/cue :move-blades
+                   (cues/cue :blade-circles
                              (fn [var-map] (cues/apply-merging-var-map var-map circle-chain
                                                                        (show/fixtures-named :blade) true))
                              :variables [{:key "bars" :name "Bars" :min 1 :max 8 :type :integer :start 2}
@@ -1486,10 +1486,10 @@
                                           :resolution 0.1 :start 1.0}
                                          {:key "stagger" :name "Stagger" :min 0 :max 2 :start 0
                                           :resolution 0.1}]
-                             :short-name "Blade Circles" :color :green :end-keys [:movement]))
+                             :short-name "Blade Circles" :color :green :priority 4))

     (show/set-cue! (+ x-base 1) (+ y-base 4)
-                   (cues/cue :move-torrents
+                   (cues/cue :torrent-circles
                              (fn [var-map] (cues/apply-merging-var-map var-map circle-chain
                                                                        (show/fixtures-named :torrent) false))
                              :variables [{:key "bars" :name "Bars" :min 1 :max 8 :type :integer :start 2}
@@ -1497,10 +1497,10 @@
                                           :resolution 0.1 :start 1.0}
                                          {:key "stagger" :name "Stagger" :min 0 :max 2 :start 0
                                           :resolution 0.1}]
-                             :short-name "Torrent Circles" :color :green :end-keys [:movement]))
+                             :short-name "Torrent Circles" :color :green :priority 4))

     ;; A chase which overlays on other movement cues, gradually taking over the lights
-    (show/set-cue! (+ x-base 2) (+ y-base 6)
+    (show/set-cue! (+ x-base 2) (+ y-base 5)
                    (cues/cue :crossover (fn [var-map] (cues/apply-merging-var-map var-map crossover-chase))
                              :variables [{:key "beats" :min 1 :max 8 :start 2 :type :integer :name "Beats"}
                                          {:key "fade-fraction" :min 0 :max 1 :start 0 :name "Fade"}


Rename local vars.

Rename local vars.

--- src/dsbdp/local_data_processing_pipeline.clj
+++ src/dsbdp/local_data_processing_pipeline.clj
@@ -153,32 +153,32 @@

 (defn create-local-processing-element
-  ([^BlockingQueue in-queue f]
-    (create-local-processing-element in-queue f nil))
-  ([^BlockingQueue in-queue f id]
+  ([^BlockingQueue in-queue proc-fn]
+    (create-local-processing-element in-queue proc-fn nil))
+  ([^BlockingQueue in-queue proc-fn id]
     (let [running (atom true)
           out-queue (create-queue)
           out-counter (Counter.)
           out-drop-counter (Counter.)
-          proc-fn (fn []
-                    (try
-                      (let [^LocalTransferContainer c (take-from-queue in-queue)
-                            new-out (if (not (nil? c))
-                                      (f (.getIn c) (.getOut c)))]
-                        (when (not (nil? new-out))
-                          (.setOut c new-out)
-                          (enqueue out-queue c out-counter out-drop-counter)))
-                      (catch InterruptedException e
-                        (if @running
-                          (throw e)))))
+          handler-fn (fn []
+                       (try
+                         (let [^LocalTransferContainer c (take-from-queue in-queue)
+                               new-out (if (not (nil? c))
+                                         (proc-fn (.getIn c) (.getOut c)))]
+                           (when (not (nil? new-out))
+                             (.setOut c new-out)
+                             (enqueue out-queue c out-counter out-drop-counter)))
+                         (catch InterruptedException e
+                           (if @running
+                             (throw e)))))
           thread-name (if (not (nil? id))
                         (str "ProcessingElement_" id))
           proc-loop (if (not (nil? thread-name))
                       (ProcessingLoop.
                         thread-name
-                        proc-fn)
+                        handler-fn)
                       (ProcessingLoop.
-                        proc-fn))]
+                        handler-fn))]
       (.start proc-loop)
       {:get-counts-fn (fn []
                         {:out (.value out-counter)


Added paper and more explainations to functions

--- src/main/clojure/conexp/fca/dependencies.clj
+++ src/main/clojure/conexp/fca/dependencies.clj
@@ -7,7 +7,9 @@
 ;; You must not remove this notice, or any other, from this software.

 (ns conexp.fca.dependencies
-  "Dependencies for Formal Concept Analysis."
+  "Dependencies for Formal Concept Analysis, based on
+   'Dependencies of many-valued attributes', 1987, Rudolf Wille
+   http://www.opengrey.eu/item/display/10068/148205 "
   (:require [clojure.core.reducers :as r]
             [conexp.base :refer :all]
             [conexp.fca.implications :refer [premise conclusion
@@ -19,8 +21,12 @@
 ;;; validation methods

 (defn dependent?
-  "Checks if a dependency is valid. Scales must be given as map between
-   attributes and contexts."
+  "Checks if a dependency between attributes is valid. Attributes depend
+   on another set of attributes if they can be expressed by them, i.e.
+   given a context (G,M,I), the set Y depends on the set X of attributes
+   if every extent of the concepts of (G,M,I_{X u Y}) is an extent of
+   a concet of (G,M,I_{X}).
+   Scales must be given as map between attributes and contexts."
   [mv-ctx scales impl]
   (let [default (fn [a] (make-context-nc #{} #{} #{}))
         ctx-pc  (scale-mv-context
@@ -36,8 +42,10 @@
        (extents ctx-pc))))

 (defn weakly-dependent?
-  "Checks if a weak dependency is valid. Scales must be given as map
-   between attributes and contexts."
+  "Checks if a weak dependency is valid. Given a context (G,M,I), a set of
+   attributes Y is weakly dependent on X if every extent of a concept in
+   (G,M,I_{Y}) is also an extent of a concept of (G,M,I_{X}).
+   Scales must be given as map between attributes and contexts."
   [mv-ctx scales impl]
   (let [default (fn [a] (make-context-nc #{} #{} #{}))
         ctx-p  (scale-mv-context
@@ -52,7 +60,9 @@
              (set (extents ctx-c)))))

 (defn functional-dependent?
-  "Checks if a functional dependency is valid."
+  "Checks if a functional dependency is valid. A set Y is functinally dependet
+   on a set X of a mv-context if for some objects g and h
+   x(g) = x(h) for all x in X implies y(g) = y(h) for all y in Y."
   [mv-ctx impl]
   (let [inz   (incidence mv-ctx)
         objs  (objects mv-ctx)


Create *_group columns for all geometry attributes

--- src/main/clojure/pdok/featured/geoserver.clj
+++ src/main/clojure/pdok/featured/geoserver.clj
@@ -56,13 +56,24 @@
   (let [attribute-type (pg/clj-to-pg-type attribute-value)]
     (pg/create-column db dataset collection attribute-name attribute-type ndims srid)
     (when (= attribute-type pg/geometry-type)
-      (pg/create-geo-index db dataset collection attribute-name))))
+      (pg/create-column db dataset collection (str attribute-name "_group") "text" ndims srid)
+      (pg/create-geo-index db dataset collection attribute-name))))
+
+(defn- all-feature-attributes [existing-attributes]
+  (merge
+    existing-attributes
+    (into {}
+       (->>
+         (seq existing-attributes)
+         (filter (fn [[_ value]] (instance? pdok.featured.GeometryAttribute value)))
+         (map (fn [[attribute-name geometry-attribute]]
+                [(str attribute-name "_group") (f/geometry-group geometry-attribute)]))))))

 (defn- feature-to-sparse-record [proj-fn feature all-fields-constructor import-nil-geometry?]
   (let [id (:id feature)
         parent-id (:parent-id feature)
         version (:version feature)
-        sparse-attributes (all-fields-constructor (:attributes feature))]
+        sparse-attributes (all-fields-constructor (all-feature-attributes (:attributes feature)))]
     (concat [id
                 parent-id
                 version]
@@ -133,7 +144,7 @@
            (group-by selector features)]
      (doseq [[[collection] collection-features] per-collection]
         ;; group per key collection so we can batch every group
-        (let [keyed (group-by feature-keys collection-features)]
+        (let [keyed (group-by feature-keys (map #(update % :attribute all-feature-attributes) collection-features))]
           (doseq [[columns vals] keyed]
             (when (< 0 (count columns))
               (let [update-vals (map (partial feature-to-update-record proj-fn) vals)]


(PDB-3723) Remove transitional classic-facts-pred

[rlb@puppet.com: adjust message]

--- src/puppetlabs/puppetdb/query_eng/engine.clj
+++ src/puppetlabs/puppetdb/query_eng/engine.clj
@@ -1452,14 +1452,6 @@
 (def binary-operators
   #{"=" ">" "<" ">=" "<=" "~"})

-(defn classic-facts-pred
-  "Wrap the given predicate function to make a predicate that
-   always returns false when not using classic-facts"
-  [pred]
-  (fn [x]
-    (and (not @scf-store/enable-json-facts)
-         (pred x))))
-
 (defn expand-query-node
   "Expands/normalizes the user provided query to a minimal subset of the
   query language"
@@ -1470,12 +1462,11 @@
             ["and" ["=" ["function" "jsonb_typeof" "value"] "number"] [op "value" value]]

-            [[(op :guard (classic-facts-pred #{"="})) "value"
-              (value :guard #(or (string? %) (ks/boolean? %)))]]
+            [["=" "value" (value :guard #(or (string? %) (ks/boolean? %)))]]
             (let [value-column (if (string? value) "value_string" "value_boolean")]
-            [op value-column value])
-
-            [[(op :guard (classic-facts-pred #{"=" "~" ">" "<" "<=" ">="})) "value" value]]
+            ["=" value-column value])
+
+            [[(op :guard #{"=" "~" ">" "<" "<=" ">="}) "value" value]]
             (when (= :facts (get-in (meta node) [:query-context :entity]))
               ["and" ["=" "depth" 0] [op "value" value]])


use gameboy tilemap for i piece

use gameboy tilemap for i piece

--- src/client/game/paint.cljs
+++ src/client/game/paint.cljs
@@ -12,6 +12,10 @@

 (def tilemap-tengen (let [img (js/Image.)]
                       (aset img "src" "tilemap-tengen.png")
+                      img))
+
+(def tilemap-gameboy (let [img (js/Image.)]
+                      (aset img "src" "tilemap-gameboy.png")
                       img))

 (def tilemap-gameboy-color (let [img (js/Image.)]
@@ -55,6 +59,11 @@
               row (value-position k)
               col a]
           [tilemap-gameboy-color row col])
+      (and (= wrap-theme 3) (= (subs string-value 0 1) "I"))
+        (let [[k a] (piece-type-adj value)
+              row (value-position k)
+              col a]
+          [tilemap-gameboy row col])
       :else
         (let [[k _] (piece-type-adj value)
               row wrap-theme


export graphs

export graphs

--- src/clj/ceres/analyzer.clj
+++ src/clj/ceres/analyzer.clj
@@ -215,27 +215,32 @@
       4))

   (let [source-uids (map :_id (mc/find-maps @db "users" {:screen_name {$in news-accounts}}))
-        graph (->> (mc/find-maps @db "publications" {:user {$in source-uids}})
+        graphs (->> (mc/find-maps @db "publications" {:user {$in source-uids}})
              (pmap (comp summary reaction-tree :_id))
              (sort-by :size >)
-             (take 4)
-             last
-             :source
-             full-reaction-tree
-             create-d3-graph)
-        types (:types graph)
-        cleaned-graph (update-in
-                       (dissoc graph :types)
-                       [:nodes]
-                       #(mapv
-                         (fn [k]
-                           {:name k
-                            :group (dispatch-types (get types k))})
-                         %))]
-    (with-open [w (clojure.java.io/writer "resources/graph-4.edn")]
-      (binding [*print-length* false
-                *out* w]
-        (pr cleaned-graph))))
+             (take 10)
+             (pmap (comp create-d3-graph full-reaction-tree :source)))
+        types (:types (first graphs))
+        cleaned-graphs (pmap (fn [graph]
+                               (update-in
+                                  (dissoc graph :types)
+                                  [:nodes]
+                                  #(mapv
+                                    (fn [k]
+                                      {:name k
+                                       :group (dispatch-types (get types k))})
+                                    %)))
+                             graphs)]
+    (loop [gs cleaned-graphs
+           counter 0]
+      (when-not (empty? gs)
+        (with-open [w (clojure.java.io/writer (str "data/graph-" counter ".edn"))]
+          (binding [*print-length* false
+                    *out* w]
+            (pr (first gs))))
+        (recur
+         (rest gs)
+         (inc counter)))))

   ;; find all related shares


fix wrong function calls

fix wrong function calls

--- src/clj/lesezeichen/db.clj
+++ src/clj/lesezeichen/db.clj
@@ -53,7 +53,7 @@

 (defn transact-bookmark [conn {:keys [url title email]}]
-  (let [uid (get-user-id email)]
+  (let [uid (get-user-id conn email)]
     (d/transact
      conn
      [{:db/id (d/tempid :db.part/user)


Allow width to be set from drop-down

Allow width to be set from drop-down

--- src/cljs/pizarra/core.cljs
+++ src/cljs/pizarra/core.cljs
@@ -107,11 +107,26 @@
                  (dom/button #js {:onClick (fn [_] (undo/do-redo app-state))}
                              "Redo"))))))

+(defn tools-component [tools owner]
+  (reify
+    om/IRender
+    (render [_]
+      (dom/div nil
+               (apply dom/select
+                      #js {:value (:width tools)
+                           :onChange (fn [e]
+                                       (let [newval (.-value (.-currentTarget e))]
+                                         (om/update! tools [:width] newval)))}
+                      (map (fn [i]
+                             (dom/option #js {:value i} i))
+                           (range 1 11)))))))
+
 (defn app-component [app owner]
   (reify
     om/IRender
     (render [_]
       (dom/div nil
+               (om/build tools-component (:tools app))
                (om/build canvas (:canvas app))))))

 (undo/init-history app-state)


Makes replumb.load/read-files-and-callback! not tail recursive again

--- src/cljs/replumb/load.cljs
+++ src/cljs/replumb/load.cljs
@@ -27,18 +27,20 @@
   "Loop on the file-names using a supplied read-file-fn (fn [file-name
   src-cb] ...), calling back cb upon first successful read, otherwise
   calling back with nil."
-  [verbose? file-names read-file-fn cb]
-  (loop [names file-names]
-    (if (seq names)
-      (let [name (first names)]
-        (when verbose?
+  [verbose? file-names read-file-fn load-fn-cb]
+  ;; AR - Can't make this function tail recursive as it is now
+  (if-let [name (first file-names)]
+    (do (when verbose?
           (common/debug-prn "Reading" name "..."))
         (read-file-fn name (fn [source]
                              (if source
-                               (cb {:lang (filename->lang name)
-                                    :source source})
-                               (recur (rest names))))))
-      (cb nil))))
+                               (load-fn-cb {:lang (filename->lang name)
+                                            :source source})
+                               (do
+                                 (when verbose?
+                                   (common/debug-prn "No source found..."))
+                                 (read-files-and-callback! verbose? (rest file-names) read-file-fn load-fn-cb))))))
+    (load-fn-cb nil)))

 (defn filenames-to-try
   "Produces a sequence of filenames to try reading, in the


fixes

fixes

--- src/cljs/worktv/views.cljs
+++ src/cljs/worktv/views.cljs
@@ -144,15 +144,16 @@
              :placeholder "60"}]
    [c/input {:type "textarea" :label "HTML template" :model [form :template] :placeholder "mustache template" :rows 10}]])

-(defn with-node [node-fn]
+(defn with-node [data node-fn]
   (r/create-class
-   {:reagent-render (fn [] [:div.fill.full {:ref "chart" :width "100%" :height "100%"}])
-    :component-did-mount (fn [this] (node-fn (-> this .-refs .-chart)))
-    :should-component-update (fn [this] (node-fn (-> this .-refs .-chart)))}))
+   {:reagent-render (fn [data node-fn] [:div.fill.full {:ref "chart" :width "100%" :height "100%"}])
+    :component-did-mount (fn [this] (node-fn (-> this .-refs .-chart) data))
+    :component-will-update (fn [this [_ data node-fn]] (node-fn (-> this .-refs .-chart) data))
+    :should-component-update (fn [this] true)}))

-(defn chart-view [{:keys [title url data-path x-path x-label y-series] :as pane}]
-  [with-node
-   (fn [elem]
+(defn chart-view [pane]
+  [with-node pane
+   (fn [elem {:keys [title url data-path x-path x-label y-series] :as pane}]
      (if (and url data-path)
        (go
          (let [gviz (.-visualization js/google)
@@ -160,7 +161,7 @@
                labels (cons x-label (vals y-series))
                [data error] (<! (u/fetch-data url data-path columns))
                data (if data (->> data rest (sort-by #(nth % 0)) (cons labels) clj->js))]
-           (js/console.log "rendering chart...")
+           (js/console.log "rendering chart..." title)
            (if data
              (.. (js/google.visualization.LineChart. elem)
                  (draw (.arrayToDataTable gviz data) #js {:title title :curveType "function"


disable defaults

disable defaults

--- src/clojure/nossal/app.clj
+++ src/clojure/nossal/app.clj
@@ -5,7 +5,7 @@
             [compojure.core :refer [defroutes GET PUT POST DELETE ANY]]
             [ring.middleware.json :refer [wrap-json-body]]
             [compojure.handler :refer [site]]
-            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]
+            [ring.middleware.defaults :refer [wrap-defaults site-defaults api-defaults]]
             [ring.adapter.jetty :as jetty]
             [ring.util.response :as response]
             [environ.core :refer [env]]
@@ -84,12 +84,13 @@

 (def app
   (-> app-routes
-      (wrap-defaults (site-defaults-options site-defaults))
+      ; (wrap-defaults (site-defaults-options site-defaults) )
+      (wrap-json-body {:keywords? true :bigdecimals? true})
       (ignore-trailing-slash)))

 (def dev-app
   (-> app-routes
-      ; (wrap-defaults site-defaults)
+      ; (wrap-defaults (site-defaults-options site-defaults) api-defaults)
       (wrap-json-body {:keywords? true :bigdecimals? true})
       (ignore-trailing-slash)))


debug pprint

debug pprint

--- src/clojure/nossal/web.clj
+++ src/clojure/nossal/web.clj
@@ -264,7 +264,7 @@

 (defn assistant [request]
-  (prn (get request :body))
+  (json/pprint (get request :body))

   (-> (res/response (json/write-str (get request :body)))
       (res/content-type "application/json")))


Shut down session, too

Shut down session, too

--- src/clojure/clojurewerkz/cassaforte/client.clj
+++ src/clojure/clojurewerkz/cassaforte/client.clj
@@ -260,6 +260,7 @@

 (defn disconnect!
   []
+  (.shutdown *default-session*)
   (.shutdown *default-cluster*))

 (defn render-query


Pick protocol version 2 by default for now

--- src/clojure/clojurewerkz/cassaforte/client.clj
+++ src/clojure/clojurewerkz/cassaforte/client.clj
@@ -69,7 +69,8 @@
            ssl-options
            kerberos
            protocol-version
-           compression]}]
+           compression]
+    :or {protocol-version 2}}]
   (when force-prepared-queries
     (alter-var-root (var hayt/*prepared-statement*)
                     (constantly true)))


Minor change for parallel-cbo

Minor change for parallel-cbo

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

--- src/conexp/contrib/algorithms/parallel_cbo.clj
+++ src/conexp/contrib/algorithms/parallel_cbo.clj
@@ -24,12 +24,12 @@
 (alter-meta! (var pcbo-external) assoc :private true)

 (defn- pcbo
-  "Runs pcbo and returns the name of the file where the concepts have
-  been written to."
+  "Runs pcbo and returns the file where the concepts have been written
+  to."
   [threads depth min-support context]
-  (let [output-file (.getAbsolutePath ^java.io.File (tmpfile))]
+  (let [^java.io.File output-file (tmpfile)]
     (pcbo-external (str "-P" threads) (str "-L" depth) (str "-S" (float (* min-support 100)))
-                   context output-file)
+                   context (.getAbsolutePath output-file))
     output-file))

 (defn- to-fcalgs-context


Fixed bfo_identifier_typing rule

Fixed bfo_identifier_typing rule

The BFO uses rdfs:isDefinedBy instead of oboInOwl:hasOBONamespace

--- resources/rules/pre_identifier_merge/step_a_ontology_to_ice/step_c/identifier_typing/bfo_identifier_typing.clj
+++ resources/rules/pre_identifier_merge/step_a_ontology_to_ice/step_c/identifier_typing/bfo_identifier_typing.clj
@@ -10,5 +10,6 @@
                   select ?id {
                   ?id rdf:type ccp:IAO_EXT_0000088 .
                   ?id obo:IAO_0000219 ?c .
-                  ?c oboInOwl:hasOBONamespace 'bfo'}"
+                  ?c rdfs:isDefinedBy obo:bfo.owl
+                  }"
   }


Add trigger opts to trigger-sync-fn opts map #489

--- src/onyx/triggers/triggers_api.clj
+++ src/onyx/triggers/triggers_api.clj
@@ -93,7 +93,8 @@
        (if (f event trigger args)
          (let [window-metadata {:window-id window-id
                                 :lower-bound lower
-                                :upper-bound upper}]
+                                :upper-bound upper
+                                :opts opts}]
            (refine-state event trigger)
            ((:trigger/sync-fn trigger) event window trigger window-metadata state)
            (if (refinement-destructive? event trigger)


www/DocResource.clj: added doctype field for template

--- src/org/altlaw/www/DocResource.clj
+++ src/org/altlaw/www/DocResource.clj
@@ -41,6 +41,7 @@
   for use by case-pages/gen-case-page"
   [doc]
   {:docid (.getFieldValue doc "docid")
+   :doctype (.getFieldValue doc "doctype")
    :name (.getFieldValue doc "name")
    :date (.getFieldValue doc "date")
    :court (.getFieldValue doc "court")


Fix reflection warning in ring.util.request/content-length

--- ring-core/src/ring/util/request.clj
+++ ring-core/src/ring/util/request.clj
@@ -24,7 +24,7 @@
   "Return the content-length of the request, or nil no content-length is set."
   {:added "1.3"}
   [request]
-  (if-let [length (get-in request [:headers "content-length"])]
+  (if-let [^String length (get-in request [:headers "content-length"])]
     (Long. length)))

 (def ^:private charset-pattern


Change user logo url.

Change user logo url.

--- src/uxbox/ui/users.cljs
+++ src/uxbox/ui/users.cljs
@@ -45,7 +45,7 @@

 ;; FIXME this is a temporal
 (def current-user (atom {:user/fullname "Cirilla"
-                         :user/avatar "http://lorempixel.com/50/50/"}))
+                         :user/avatar "//lorempixel.com/50/50/"}))
 (def menu-open? (atom false))

 (def ^:static user-l


minor doc changes

minor doc changes

--- src/edu/berkeley/ai/angelic/hierarchies/abstract_lookahead_trees.clj
+++ src/edu/berkeley/ai/angelic/hierarchies/abstract_lookahead_trees.clj
@@ -9,15 +9,13 @@
 ;; Abstract lookahead trees, with (optional) forward caching and graph stuff.
 ; Should subsume top_down_forward at some point

-; WARNING
-
-; Note: According to node contract, equality should be only on plan-tail and valuations if possible.  This is tree though, so forget that?
+; WARNING: plan-Graph search will not work here!  Cannot eliminate duplicate plans due to
+; iteraction with state-graph..

 ;; Nodes
 ; note that valuations are metadata so they aren't used in comparisons.

 ; Graph map is metadata on ALT, maps from [state-set rest-plan] --> max-pess-reward.
-; MUST contain only active plans, or you can screw yourself?;
 ; Solution: do it all in node-immediate-refinements??
 ; OK to prune if strictly dominated by ancestor (assuming consistency)
   ; Or even weakly dominated by non-ancestor refined ?????
@@ -40,7 +38,7 @@
 ; Strengths: as much pruning and skipping as possible
 ; Weaknesses: must keep track of both direct and indirect ancestors. Replacement policy?

-; Skip duplicate plans  (= this version, when used with graph search)
+; Skip duplicate plans  (= old version 2f3753c, when used with graph search)
  ; Prune if weakly dominated by any unrefined plan.
 ; Strengths: simple, just remove refined plans
 ; Weaknesses: misses out on things like [left right act]


(PDB-3302) Use fs/temp-file in puppetdb_query integration test

--- test/puppetlabs/puppetdb/integration/storeconfigs/puppetdb_query.clj
+++ test/puppetlabs/puppetdb/integration/storeconfigs/puppetdb_query.clj
@@ -10,21 +10,19 @@
     (testing "Initial agent run, to populate puppetdb with data to query"
       (int/run-puppet ps pdb "notify { 'hello, world!': }"))

-    (let [test-out-file "/tmp/test_puppetdb_query.txt"]
+    (let [test-out-file (fs/temp-file "test_puppetdb_query" ".txt")]
       (testing "Agent run with puppedb_query in the manifest"
-        (when (fs/exists? test-out-file)
-          (fs/delete test-out-file))

         (int/run-puppet ps pdb
                         (str "node default {"
                              "  $counts = puppetdb_query(['from', 'catalogs',"
                              "                            ['extract', [['function', 'count']]]])"
                              "  $count = $counts[0]['count']"
-                             "  file { '" test-out-file "':"
+                             "  file { '" (.getCanonicalPath test-out-file) "':"
                              "        ensure  => present,"
                              "        content => \"${count}\""
                              "  }"
                              "}"))

         (testing "should write the correct catalog count to a temp file"
-          (is (= "1" (slurp "/tmp/test_puppetdb_query.txt"))))))))
+          (is (= "1" (slurp test-out-file))))))))


Define :key for fontawesome icons

Define :key for fontawesome icons

--- src/discuss/utils/views.cljs
+++ src/discuss/utils/views.cljs
@@ -6,9 +6,13 @@
 (defn fa-icon
   "Wrapper for font-awesome icons."
   ([class]
-   (dom/i #js {:className (str "fa " class)}))
+   (dom/i #js {:react-key (discuss.utils.common/get-unique-key)
+               :key (discuss.utils.common/get-unique-key)
+               :className (str "fa " class)}))
   ([class f]
-   (dom/i #js {:className (str "pointer fa " class)
+   (dom/i #js {:react-key (discuss.utils.common/get-unique-key)
+               :key (discuss.utils.common/get-unique-key)
+               :className (str "pointer fa " class)
                :onClick   f})))

 (defn logo


small cleanup

small cleanup

--- src/cortex/description.clj
+++ src/cortex/description.clj
@@ -324,8 +324,7 @@
   cortex.impl.wiring.StackModule
   (layer->input [layer] (layer->input (first (:modules layer))))
   (layer->description [layer]
-    (let [modules (:modules layer)]
-      (map layer->description modules))))
+    (map layer->description (:modules layer))))

 (defn network->description


Trying to get the last loss, center-loss ported over.

--- src/cortex/loss/center.clj
+++ src/cortex/loss/center.clj
@@ -7,57 +7,84 @@
             [cortex.loss.util :as util]
             [cortex.util :refer [max-index]]
             [cortex.graph :as graph]
-            [cortex.argument :as argument]))
+            [cortex.argument :as argument]
+            [cortex.tensor :as ct]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Compute implementation
-(defrecord CenterLoss [loss-term backend batch-centers monotonic-indexes temp-centers]
+(defrecord CenterLoss [loss-term backend batch-centers]
   util/PComputeLoss
   (compute-loss-gradient [this buffer-map]
-    (let [output-buffer (get-in buffer-map [:output :buffer])
-          [batch-size n-elems] (math/batch-shape output-buffer)
-          output-gradient (get-in buffer-map [:output :gradient])
-          labels (get-in buffer-map [:labels :buffer])
-          label-indexes (get-in buffer-map [:label-indexes :buffer])
-          label-inverse-counts (get-in buffer-map [:label-inverse-counts :buffer])
-          centers (get-in buffer-map [:centers :buffer])
-          stream (backend/get-stream)
-          alpha (double (get loss-term :alpha))
-          label-indexes (math/device-buffer label-indexes)
-          monotonic-indexes (math/device-buffer monotonic-indexes)
-          beta (- 1.0 alpha)]
-      ;;First distribute centers according to labels
-      (drv/indexed-copy stream
-                        (math/device-buffer centers)
-                        (math/device-buffer label-indexes)
-                        (math/device-buffer batch-centers)
-                        (math/device-buffer monotonic-indexes) n-elems)
-      ;;gradient = feature - center
-      (math/subtract stream 1.0 output-buffer 1.0 batch-centers output-gradient)
-      ;;copy features to batch-centers to start to calculate new centers
+    (ct/with-stream (backend/get-stream)
+      (let [->batch-ct (fn [item] (math/->batch-ct item))
+            ->ct (fn [item] (math/->vector-ct item))
+            output-buffer (->batch-ct (get-in buffer-map [:output :buffer]))
+            output-gradient (->batch-ct (get-in buffer-map [:output :gradient]))
+            labels (->batch-ct (get-in buffer-map [:labels :buffer]))
+            label-indexes (->ct (get-in buffer-map [:label-indexes :buffer]))
+            label-inverse-counts (->ct buffer-map [:label-inverse-counts :buffer])
+            centers (->batch-ct (get-in buffer-map [:centers :buffer]))
+            alpha (double (get loss-term :alpha))
+            beta (- 1.0 alpha)
+            batch-centers (->batch-ct batch-centers)
+            [batch-size num-elems] (m/shape output-buffer)
+            expanded-centers (ct/select centers label-indexes :all)]
+        (when-not (= batch-size (ct/ecount label-indexes))
+          (throw (ex-info "Label index size is wrong" {:batch-size batch-size
+                                                       :label-index-count (ct/ecount label-indexes)})))

-      ;;c' = a*c + b*sum(x)/n
-      ;;c' = sum(a*c + b*x)/n
-      ;;c' = c - c + sum(a*c + b*x)/n
-      ;;c' = c + sum(a*c - c + b*x)/n
-      ;;c  = a*c + b*c
-      ;;c - b*c = a*c
-      ;;-b*c = a*c - c
-      ;;c' = c + sum(b*x - b*c)/n
-      ;;subtract centers from features
-      (math/subtract stream beta output-buffer beta batch-centers batch-centers)
+        (when-not (= [batch-size] (ct/shape label-inverse-counts))
+          (throw (ex-info "Label index size is wrong" {:batch-size batch-size
+                                                       :label-inverse-count (ct/shape label-inverse-counts)})))
+        ;; definitions (var :: def :: shape):
+        ;; c  :: current centers :: [num-classes]
+        ;; c' :: new centers :: [num-classes]
+        ;; a  :: alpha :: scalar
+        ;; b  :: 1.0 - alpha
+        ;; Note that a single 'center' may be represented multiple times in the batch
+        ;; n  :: per-center per-batch counts :: [batch-size]
+        ;; x  :: centers calculated this batch :: [batch-size]
+        ;;
+        ;; centers are running averages over time so new-center = old-center * alpha + batch-center * beta
+        ;; restricted per-batch to the set of centers that actually appear in this batch.  We rely on items being
+        ;; evenly distributed throughout an epoch to make this pathway work as at later epochs the centers
+        ;; should be more 'set' and meaningful.
+        ;;
+        ;; derived math
+        ;; a + b = 1.0
+        ;;
+        ;; Then if we multiply cb by b we can then add this to c' and the classes that are in this batch
+        ;; will get updated but the classes that are not in this batch will not get updated.
+        ;; c' = c + b*(x - c)
+        ;; c' = a*c + b * avg(x)
+        ;; c' = c - b * c + b * avg(x)
+        ;; We can move c into the average because it is a constant so the avg of c is always c.
+        ;; c' = c + b * (avg(x) - c)
+        ;; c' = c + b * avg(x - c)
+        ;; c' = c + b * sum(x - c) * 1/n
+        ;;
+        ;; If (b*x-b*c) is an expansion and not a reduction we can guarantee b will only be multiplied
+        ;; into c exactly once.
+        ;; We can then
+        ;; Then the reduction into c' has no constant on c

-      ;;scale subtracted quantities according to inverse counts
-      (math/mul-rows (backend/get-stream) batch-size n-elems
-                     (math/device-buffer batch-centers) n-elems
-                     (math/device-buffer label-inverse-counts) 1
-                     (math/device-buffer batch-centers) n-elems)

-      (math/indirect-add stream
-                         1.0 batch-centers monotonic-indexes
-                         1.0 centers label-indexes
-                         centers label-indexes
-                         n-elems))))
+        ;; First distribute centers according to labels
+        (ct/assign! batch-centers expanded-centers)
+
+        ;; gradient = feature - center
+        (ct/binary-op! output-gradient 1.0 output-buffer 1.0 batch-centers :-)
+
+        ;; copy features to batch-centers to start to calculate new centers
+        ;; This is really (beta*(x-c))
+        (ct/binary-op! batch-centers beta output-buffer beta batch-centers :-)
+
+        ;; Multiply by n
+        (ct/binary-op! batch-centers 1.0 batch-centers 1.0 (ct/in-place-reshape label-inverse-counts [batch-size 1]))
+
+        ;; update centers with new positions doing a reduction.  This is safe because we aren't
+        ;; using a constant alpha on expanded-centers.
+        (ct/binary-op! expanded-centers 1.0 expanded-centers 1.0 batch-centers :+)))))

 (defmethod util/create-compute-loss-term :center-loss
@@ -67,15 +94,8 @@
                                                (graph/get-node-argument loss-term :output))
         labels-shape (graph/get-argument-shape graph loss-term
                                                (graph/get-node-argument loss-term :labels))
-        batch-centers (backend/new-array backend output-shape batch-size)
-        monotonic-indexes (math/array (backend/get-stream)
-                                      :int
-                                      (range batch-size))
-        label-indexes (math/new-array (backend/get-stream)
-                                      :int
-                                      [batch-size])
-        temp-centers (backend/new-array backend [(apply * labels-shape) (apply * output-shape)])]
-    (->CenterLoss loss-term backend batch-centers monotonic-indexes temp-centers)))
+        batch-centers (backend/new-array backend output-shape batch-size)]
+    (->CenterLoss loss-term backend batch-centers)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Stream augmentation


Core module, CLI options handling, server initialization etc.

--- src/emender_service/core.clj
+++ src/emender_service/core.clj
@@ -1,7 +1,58 @@
 (ns emender-service.core
-  (:gen-class))
+    "Core module that contains -main function called by Leiningen to start the application.")
+
+(require '[ring.adapter.jetty      :as jetty])
+(require '[ring.middleware.params  :as http-params])
+(require '[ring.middleware.cookies :as cookies])
+
+(require '[clojure.tools.cli       :as cli])
+
+(require '[emender-service.server  :as server])
+
+(def default-port
+    "3000")
+
+(def cli-options
+    "Definitions of all command line options currenty supported."
+    ;; an option with a required argument
+    [["-p" "--port   PORT"    "port number"   :id :port]])
+
+(def app
+    "Definition of a Ring-based application behaviour."
+    (-> server/handler            ; handle all events
+        cookies/wrap-cookies      ; we need to work with cookies
+        http-params/wrap-params)) ; and to process request parameters, of course
+
+(defn start-server
+    "Start the HTTP server on the specified port."
+    [port]
+    (println "Starting the server at the port: " port)
+    (jetty/run-jetty app {:port (read-string port)}))
+
+(defn get-and-check-port
+    "Accepts port number represented by string and throws AssertionError
+     if port number is outside defined range."
+    [port]
+    (let [port-number (. Integer parseInt port)]
+        (assert (> port-number 0))
+        (assert (< port-number 65536))
+        port))
+
+(defn get-port
+    "Returns specified port or default port if none is specified on the command line."
+    [specified-port]
+    (if (or (not specified-port) (not (string? specified-port)) (empty? specified-port))
+        default-port
+        (get-and-check-port specified-port)))
+

 (defn -main
-  "I don't do a whole lot ... yet."
-  [& args]
-  (println "Hello, World!"))
+    "Entry point to the Emender service server"
+    [& args]
+    (let [all-options   (cli/parse-opts args cli-options)
+          options       (all-options :options)
+          port          (options :port)]
+          (start-server (get-port port))))
+
+; finito
+


add eulalie.lambda.util/request!

add eulalie.lambda.util/request!

--- src/eulalie/lambda/util.cljc
+++ src/eulalie/lambda/util.cljc
@@ -26,7 +26,11 @@
 (defn invoke! [creds fn-name type payload & [params]]
   (thunk! creds fn-name type (assoc params :payload payload)))

+(defn request! [creds fn-name & [payload]]
+  (invoke! creds fn-name :request-response payload))
+
 #?(:clj
    (do
-     (def thunk!!  (comp <?! thunk!))
-     (def invoke!! (comp <?! invoke!))))
+     (def thunk!!   (comp <?! thunk!))
+     (def invoke!!  (comp <?! invoke!))
+     (def request!! (comp <?! request!))))


disable warning reports for now

disable warning reports for now

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


Add optargs for title icon and uid task options

--- boot/core/src/boot/task/built_in.clj
+++ boot/core/src/boot/task/built_in.clj
@@ -206,9 +206,9 @@
    T theme             NAME     str       "The name of the audible notification sound theme"
    s soundfiles        KEY=VAL  {kw str}  "Sound files overriding theme sounds. Keys can be :success, :warning or :failure"
    m messages          KEY=VAL  {kw str}  "Templates overriding default messages. Keys can be :success, :warning or :failure"
-   t title                      str       "Title of the notification"
-   i icon                       str       "Full path of the file used as notification icon"
-   u uid                        str       "Unique ID identifying this boot process"]
+   t title             TITLE    str       "Title of the notification"
+   i icon              ICON     str       "Full path of the file used as notification icon"
+   u uid               UID      str       "Unique ID identifying this boot process"]

   (let [themefiles (notify/get-themefiles theme (core/tmp-dir!))
         sounds (merge themefiles soundfiles)


CMR-3691: Testing...

CMR-3691: Testing...

--- system-int-test/test/cmr/system_int_test/search/collection_search_format_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_search_format_test.clj
@@ -206,7 +206,7 @@
               "DIF" :dif
               "DIF10" :dif10
               "ISO" :iso19115))))))
-  (dev-sys-util/eval-in-dev-sys `(cmr.ingest.config/set-ingest-accept-umm-version! "1.9")))
+  (dev-sys-util/eval-in-dev-sys `(cmr.ingest.config/set-ingest-accept-umm-version! original-ingest-accept-umm-version)))

 (deftest collection-umm-json-metadata-cache-test
   (dev-sys-util/eval-in-dev-sys `(cmr.ingest.config/set-ingest-accept-umm-version! "1.10"))
@@ -249,7 +249,7 @@
       (assert-cache-state {c1-r2-echo [:echo10 latest-umm-format]
                            c2-echo [:echo10 latest-umm-format]
                            c10-umm-json [latest-umm-format]})))
-  (dev-sys-util/eval-in-dev-sys `(cmr.ingest.config/set-ingest-accept-umm-version! "1.9")))
+  (dev-sys-util/eval-in-dev-sys `(cmr.ingest.config/set-ingest-accept-umm-version! original-ingest-accept-umm-version)))

 ;; Tests that we can ingest and find items in different formats
 (deftest multi-format-search-test


Fix building JAR on Windows

Fix building JAR on Windows

--- build.boot
+++ build.boot
@@ -41,8 +41,15 @@
       ((resolve 'instrument))
       ((resolve 'dev-main)))))

+(def jar-exclusions
+  ;; the standard exclusions don't work on windows,
+  ;; because we need to use backslashes
+  (conj boot.pod/standard-jar-exclusions
+    #"(?i)^META-INF\\[^\\]*\.(MF|SF|RSA|DSA)$"
+    #"(?i)^META-INF\\INDEX.LIST$"))
+
 (deftask build []
-  (comp (aot) (pom) (uber) (jar) (sift) (target)))
+  (comp (aot) (pom) (uber :exclude jar-exclusions) (jar) (sift) (target)))

 (deftask build-cljs []
   (comp


Upgrade to latest Clojure 1.9 alpha

Upgrade to latest Clojure 1.9 alpha

--- build.boot
+++ build.boot
@@ -43,7 +43,7 @@
    [deraen/boot-sass "0.2.1" :scope "test"]
    [reloaded.repl "0.2.1" :scope "test"]

-   [org.clojure/clojure "1.9.0-alpha12"]
+   [org.clojure/clojure "1.9.0-alpha14"]
    [org.clojure/clojurescript "1.9.229"]

    [org.clojure/tools.nrepl "0.2.12"]


Update lein

Update lein

--- build.boot
+++ build.boot
@@ -11,7 +11,7 @@
                   ; clj deps
                   [org.clojure/clojure "1.9.0-beta3"]
                   [javax.xml.bind/jaxb-api "2.3.0"] ; necessary for Java 9 compatibility
-                  [leiningen "2.8.0" :exclusions [leiningen.search]]
+                  [leiningen "2.8.1" :exclusions [leiningen.search]]
                   [ring "1.6.1"]
                   [hawk "0.2.11"]
                   [play-cljs/lein-template "0.10.1-5"]


build fixed

build fixed

--- build.boot
+++ build.boot
@@ -1,6 +1,6 @@
 (set-env!
- :source-paths   #{"src/clj" "src/java" "test"}
- :resource-paths #{"src/clj" "src/java"}
+ :source-paths   #{"src/java"}
+ :resource-paths #{"src/clj"}
  :dependencies '[[org.clojure/clojure "1.8.0" :scope "provided"]
                  [adzerk/bootlaces "0.1.13" :scope "test"]
                  [metosin/boot-alt-test "0.3.0" :scope "test"]
@@ -11,7 +11,7 @@
 ;; to check the newest versions:
 ;; boot -d boot-deps ancient

-(def +version+ "0.0.2")
+(def +version+ "0.0.4")

 (require '[adzerk.bootlaces :refer [bootlaces! build-jar push-release]]
          '[metosin.boot-alt-test :refer :all])


upping dev/test deps

upping dev/test deps

--- build.boot
+++ build.boot
@@ -5,10 +5,10 @@
   :dependencies '[;; mount brings _no dependencies_, everything here is for
                   ;; mount dev, examples apps and tests

-                  [org.clojure/clojure "1.7.0"              :scope "provided"]
-                  [org.clojure/clojurescript "1.7.189"      :scope "provided" :classifier "aot"]
-                  [datascript "0.13.3"                      :scope "provided"]
-                  [compojure "1.4.0"                        :scope "provided"]
+                  [org.clojure/clojure "1.8.0"              :scope "provided"]
+                  [org.clojure/clojurescript "1.7.228"      :scope "provided" :classifier "aot"]
+                  [datascript "0.15.0"                      :scope "provided"]
+                  [compojure "1.5.0"                        :scope "provided"]
                   [ring/ring-jetty-adapter "1.1.0"          :scope "provided"]
                   [cheshire "5.5.0"                         :scope "provided"]
                   [hiccups "0.3.0"                          :scope "provided" :exclusions [org.clojure/clojurescript]]
@@ -18,24 +18,24 @@
                   [robert/hooke "1.3.0"                     :scope "provided"]
                   [org.clojure/tools.namespace "0.2.11"     :scope "provided"]
                   [org.clojure/tools.nrepl "0.2.12"         :scope "provided"]
-                  [com.datomic/datomic-free "0.9.5327"      :scope "provided" :exclusions [joda-time]]
+                  [com.datomic/datomic-free "0.9.5359"      :scope "provided" :exclusions [joda-time]]

                   ;; boot clj
-                  [boot/core              "2.5.1"           :scope "provided"]
+                  [boot/core              "2.6.0"           :scope "provided"]
                   [adzerk/bootlaces       "0.1.13"          :scope "test"]
                   [adzerk/boot-logservice "1.0.1"           :scope "test"]
-                  [adzerk/boot-test       "1.0.6"           :scope "test"]
+                  [adzerk/boot-test       "1.1.1"           :scope "test"]
                   [tolitius/boot-check    "0.1.1"           :scope "test"]

                   ;; boot cljs
-                  [adzerk/boot-cljs            "1.7.170-3"       :scope "test"]
+                  [adzerk/boot-cljs            "1.7.228-1"       :scope "test"]
                   [adzerk/boot-cljs-repl       "0.3.0"           :scope "test"]
                   [pandeiro/boot-http          "0.7.1-SNAPSHOT"  :scope "test"]
                   [tolitius/boot-stripper      "0.1.0-SNAPSHOT"  :scope "test"]
                   [com.cemerick/piggieback     "0.2.1"           :scope "test" :exclusions [org.clojure/clojurescript]]
                   [weasel                      "0.7.0"           :scope "test" :exclusions [org.clojure/clojurescript]]
                   [adzerk/boot-reload          "0.4.8"           :scope "test"]
-                  [crisptrutski/boot-cljs-test "0.2.1-SNAPSHOT"  :scope "test"]])
+                  [crisptrutski/boot-cljs-test "0.2.2-SNAPSHOT"  :scope "test"]])

 (require '[adzerk.bootlaces :refer :all]
          '[adzerk.boot-test :as bt]


Bump version

Bump version

--- build.boot
+++ build.boot
@@ -11,7 +11,7 @@
          '[adzerk.boot-cljs   :refer [cljs]]
          '[pandeiro.boot-http :refer [serve]])

-(def +version+ "2.1.4")
+(def +version+ "2.1.5-SNAPSHOT")

 (task-options!
   pom {:project     'adzerk/boot-cljs


Update pom urls for library

Update pom urls for library

--- build.boot
+++ build.boot
@@ -14,6 +14,6 @@
   pom {:project 'afrey/boot-asset-fingerprint
        :version +version+
        :description "Boot task to fingerprint asset references in html files."
-       :url "https://github.com/pointslope/boot-fingerprint"
-       :scm {:url "https://github.com/pointslope/boot-fingerprint"}
+       :url "https://github.com/AdamFrey/boot-asset-fingerprint"
+       :scm {:url "https://github.com/AdamFrey/boot-asset-fingerprint"}
        :license {"EPL" "http://www.eclipse.org/legal/epl-v10.html"}})


Fix format-commands #n

Fix format-commands #n

--- build.boot
+++ build.boot
@@ -158,7 +158,7 @@
         (with-pass-thru _
           (util/info "A1\n")
           (util/info "B\n")
-          (util/dosh "sudo" "sh" "-c" "'cd target'")
+          (util/dosh "sudo" "sh" "-c" "\"cd target\"")
           (util/info "C\n")
           (util/dosh "bash" "-c" "'cd target ; ls -l'"))))))
         ;(with-pass-thru _


Move clojurescript deps to dev task

Move clojurescript deps to dev task

--- build.boot
+++ build.boot
@@ -7,8 +7,6 @@
                  [deraen/boot-less "0.5.0"]
                  [org.clojure/clojure "1.8.0"]
                  [org.clojure/clojurescript "1.7.170"]
-                 [org.clojure/core.async "0.2.374"]
-                 [org.omcljs/om "1.0.0-alpha28"]
                  [org.clojure/tools.nrepl "0.2.12"]
                  [com.cemerick/piggieback "0.2.1"  :scope "test"]
                  [weasel                  "0.7.0"  :scope "test"]])
@@ -50,7 +48,9 @@
   "Simple alias to run application in development mode"
   []
   (set-env! :target-path "target/dev"
-            :source-paths #(conj % "sass"))
+            :source-paths #(conj % "sass")
+            :dependencies #(concat % '[[org.omcljs/om "1.0.0-alpha28"]
+                                       [org.clojure/core.async "0.2.374"]]))
   (comp
    (watch)
    (speak)


Fix lint and reflection warnings

Fix lint and reflection warnings

--- src/clj_chrome_devtools/cljs/test.clj
+++ src/clj_chrome_devtools/cljs/test.clj
@@ -126,9 +126,7 @@
     (when match
       (if (= "0" errors failures)
         :ok
-        :fail
-        ;"ClojureScript tests had failures or errors, see previous output for details."
-        ))))
+        :fail))))

 (defn- poll-test-execution []
   (loop [started? false
@@ -200,7 +198,7 @@
      (chrome-fixture
       (fn []
         (log "Chrome launched")
-        (let [con (.-connection @automation/current-automation)
+        (let [con (:connection @automation/current-automation)
               port (random-free-port)
               server (http-server/run-server (fn [req]
                                                (or (and ring-handler (ring-handler req))


scaffolds for player, get the logic working first, then the polish

--- src/cljs/cljspazzer/client/pages.cljs
+++ src/cljs/cljspazzer/client/pages.cljs
@@ -208,11 +208,22 @@
   (reify
     om/IRender
     (render [this]
-      (html [:div.player
+      (let [tracks (data :play-list [])
+            playlist-item (fn [r] [:li r])]
+        (html [:div.player
              (main-nav-partial)
              [:div.content.pure-g
               [:div.pure-u-1
-               [:h1 "player goes here"]]]]))))
+               [:h1 "player goes here"]
+               [:ul (map  playlist-item tracks)]
+               [:a.button
+                {:on-click (fn [e]
+                             (.log js/console owner)
+                             (om/transact! data :play-list (fn [v]
+                                                              (conj v "xxx")))
+
+                             )
+                 } "add"]]]])))))

 (defn view-debug [data owner]
   (reify


Add marker constructor utility

Add marker constructor utility

--- src/cljs/gtfve/utils/google_maps.cljs
+++ src/cljs/gtfve/utils/google_maps.cljs
@@ -70,6 +70,15 @@
 (defn data-point [x y]
   (Data.Point. (latlng x y)))

+(defn marker
+  [[lat lng] & {:as options}]
+  (Maps.Marker.
+   (clj->js (merge {:position (latlng lat lng)
+                    :icon {:path Maps.SymbolPath.CIRCLE
+                           :strokeColor "#FF0000"
+                           :scale 3}}
+                   options))))
+
 (defn data-listen
   ([data type]
    (data-listen data type (chan)))


Remove unused keys in destructuring

Remove unused keys in destructuring

--- src/cljs/mdr2/productions/repair.cljs
+++ src/cljs/mdr2/productions/repair.cljs
@@ -114,9 +114,7 @@
    title])

 (defn production [id]
-  (let [{:keys [uuid id title creator product_number
-                library_number library_record_id
-                total_time volumes depth narrator]
+  (let [{:keys [uuid id creator]
          :as production} @(rf/subscribe [::production id])]
     [:tr
      [:td id]


make analyze work stand-alone

make analyze work stand-alone

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -264,7 +264,6 @@
 (defn run-passes [ast]
   (-> ast))

-;; assumes *ns* is bound
 (defn analyze
   ([form] (analyze form (empty-env) {}))
   ([form env] (analyze form env {}))
@@ -274,6 +273,8 @@
                             #'ana/parse         parse
                             #'ana/var?          var?
                             #'ana/analyze-form  analyze-form}
+                           (when-not (thread-bound? #'*ns*)
+                             {#'*ns* *ns*})
                            (:bindings opts))
        (env/ensure (global-env)
          (run-passes (-analyze form env))))))


Updating job scheduling to slightly delay the start of the jobs.

--- src/cmr/metadata_db/services/jobs.clj
+++ src/cmr/metadata_db/services/jobs.clj
@@ -9,7 +9,8 @@
             [cmr.common.log :as log :refer (debug info warn error)]
             [cmr.metadata-db.data.providers :as provider-db]
             [cmr.metadata-db.data.oracle.providers]
-            [cmr.metadata-db.services.concept-service :as srv]))
+            [cmr.metadata-db.services.concept-service :as srv]
+            [clj-time.core :as ct]))

 (def job-key "jobs.expired.1")

@@ -53,7 +54,7 @@
               (jobs/with-identity (jobs/key job-key)))
         trigger (t/build
                   (t/with-identity (t/key "triggers.1"))
-                  (t/start-now)
+                  (t/start-at (-> 5 ct/seconds ct/from-now))
                   (t/with-schedule (schedule
                                      (with-interval-in-seconds EXPIRED_CONCEPT_CLEANUP_INTERVAL))))]
     (qs/schedule job trigger))


docstrings

docstrings

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -522,22 +522,30 @@
                       (recur))))))))
         (get-in @*env* [::analyzed-cljs path])))))

-(defn backup-env []
-  (with-redefs [clojure.core/pr-on (fn [x w] (if (clojure.core/var? x)
-                                              (print-dup x w)
-                                              (print-method x w))
-                                     nil)]
-    (binding [*print-level* nil
-              *print-length* nil
-              *print-meta* true]
-      (let [s (pr-str (:namespaces @(global-env)))]
-        (spit (io/resource "tools.analyzer.js/cached-env.res") s)))))
-
-(defn restore-env []
+(defn backup-env
+  "Caches the current namespaces state in a resource file, can be restored with
+   (restore-env)"
+  []
+  (env/ensure (global-env)
+    (with-redefs [clojure.core/pr-on (fn [x w] (if (clojure.core/var? x)
+                                                (print-dup x w)
+                                                (print-method x w))
+                                       nil)]
+      (binding [*print-level* nil
+                *print-length* nil
+                *print-meta* true]
+        (let [s (pr-str (:namespaces (env/deref-env)))]
+          (spit (io/resource "tools.analyzer.js/cached-env.res") s))))))
+
+(defn restore-env
+  "Uses a cached env to populate the default namespace map"
+  []
   (reset! core-env
           (reader/read-string (slurp (io/resource "tools.analyzer.js/cached-env.res")))))

-(defn setup-rt! []
+(defn setup-rt!
+  "Setups the basic runtime, loading cljs.core and initializing cljs.user"
+  []
   (require 'cljs.core)
   (when-not (or (seq @core-env)
                 (seq (restore-env)))
@@ -546,38 +554,42 @@
       (analyze '(ns cljs.user))
       (reset! core-env (select-keys (:namespaces (env/deref-env)) '[cljs.core cljs.user])))))

-(defn cljs-env->env []
-  (reduce (fn [m {:keys [name excludes uses requires use-macros require-macros imports defs]}]
-            (let [imports (reduce-kv (fn [m k v]
-                                       (assoc m k (let [s (s/split (c.c/name v) #"\.")]
-                                                    {:op   :js-var
-                                                     :ns   (symbol (s/join "." (butlast s)))
-                                                     :name (symbol (last s))}))) {} imports)
-                  parse-requires (fn [r] (reduce-kv (fn [m k v] (if (not= k v)
-                                                                (assoc m k v)
-                                                                m)) {} r))
-                  core-mappings (apply dissoc (get-in (env/deref-env) [:namespaces 'cljs.core :mappings]) excludes)
-                  core-macro-mappings (apply dissoc (core-macros) excludes)
-                  js-namespaces (reduce (fn [m ns] (assoc m ns {:ns ns :js-namespace true})) {} (set (keys requires)))
-                  ;; should resolve bindings
-                  mappings (reduce-kv (fn [m k v] (assoc m k {:op   (if (js-namespaces v) :js-var :var)
-                                                             :name k
-                                                             :ns   v})) {} uses)
-                  macro-mappings (reduce-kv (fn [m k v]
-                                              (let [macro (ns-resolve v k)]
-                                                (if (:macro (meta macro))
-                                                  (assoc m k macro)
-                                                  m))) {} uses)
-                  defs (reduce-kv (fn [m k v]
-                                    (assoc m k {:op   :var
-                                                :name (vary-meta k merge (select-keys v #{:protocol-impl}))
-                                                :ns   name})) {} defs)]
-              (merge m js-namespaces
-                     {name {:ns             name
-                            :mappings       (merge imports core-mappings mappings defs)
-                            :macro-mappings (merge core-macro-mappings macro-mappings)
-                            :aliases        (parse-requires requires)
-                            :macro-aliases  (parse-requires require-macros)}})))
-          (vals @(cljs.ana/namespaces))))
+(defn cljs-env->env
+  "Converts the namespace map of the current cljs environment in a tools.analyzer.js
+   namespace map and returns it."
+  []
+  (env/ensure (global-env)
+    (reduce (fn [m {:keys [name excludes uses requires use-macros require-macros imports defs]}]
+              (let [imports (reduce-kv (fn [m k v]
+                                         (assoc m k (let [s (s/split (c.c/name v) #"\.")]
+                                                      {:op   :js-var
+                                                       :ns   (symbol (s/join "." (butlast s)))
+                                                       :name (symbol (last s))}))) {} imports)
+                    parse-requires (fn [r] (reduce-kv (fn [m k v] (if (not= k v)
+                                                                  (assoc m k v)
+                                                                  m)) {} r))
+                    core-mappings (apply dissoc (get-in (env/deref-env) [:namespaces 'cljs.core :mappings]) excludes)
+                    core-macro-mappings (apply dissoc (core-macros) excludes)
+                    js-namespaces (reduce (fn [m ns] (assoc m ns {:ns ns :js-namespace true})) {} (set (keys requires)))
+                    ;; should resolve bindings
+                    mappings (reduce-kv (fn [m k v] (assoc m k {:op   (if (js-namespaces v) :js-var :var)
+                                                               :name k
+                                                               :ns   v})) {} uses)
+                    macro-mappings (reduce-kv (fn [m k v]
+                                                (let [macro (ns-resolve v k)]
+                                                  (if (:macro (meta macro))
+                                                    (assoc m k macro)
+                                                    m))) {} uses)
+                    defs (reduce-kv (fn [m k v]
+                                      (assoc m k {:op   :var
+                                                  :name (vary-meta k merge (select-keys v #{:protocol-impl}))
+                                                  :ns   name})) {} defs)]
+                (merge m js-namespaces
+                       {name {:ns             name
+                              :mappings       (merge imports core-mappings mappings defs)
+                              :macro-mappings (merge core-macro-mappings macro-mappings)
+                              :aliases        (parse-requires requires)
+                              :macro-aliases  (parse-requires require-macros)}})))
+            (vals @(cljs.ana/namespaces)))))

 (setup-rt!)


Add test

Add test

--- src/test/clojure/pigpen/functional/io_test.clj
+++ src/test/clojure/pigpen/functional/io_test.clj
@@ -160,4 +160,11 @@
         command (pig/return data)]
     (test-diff
       (pig/dump command)
-      '[1 2])))
+      '[1 2]))
+
+  (let [command (->>
+                  (pig/return [])
+                  (pig/map inc))]
+    (test-diff
+      (pig/dump command)
+      '[])))


CMR-4821: Move up tag association and other system concepts cleanup ahead of provider concept table cleanup.

--- metadata-db-app/src/cmr/metadata_db/services/jobs.clj
+++ metadata-db-app/src/cmr/metadata_db/services/jobs.clj
@@ -27,17 +27,18 @@

 (defn old-revision-concept-cleanup
   [context]
+  ;; cleanup CMR system concepts
+  (concept-service/delete-old-revisions context pv/cmr-provider :tag-association)
+  (concept-service/delete-old-revisions context pv/cmr-provider :tag)
+  (concept-service/delete-old-revisions context pv/cmr-provider :variable-association)
+  (concept-service/delete-old-revisions context pv/cmr-provider :service-association)
+  ;; cleanup provider specific tables
   (doseq [provider (provider-service/get-providers context)]
     (concept-service/delete-old-revisions context provider :collection)
     (concept-service/delete-old-revisions context provider :granule)
     (concept-service/delete-old-revisions context provider :variable)
     (concept-service/delete-old-revisions context provider :service)
-    (concept-service/delete-old-revisions context provider :access-group))
-  ;; cleanup system provider concepts
-  (concept-service/delete-old-revisions context pv/cmr-provider :tag)
-  (concept-service/delete-old-revisions context pv/cmr-provider :tag-association)
-  (concept-service/delete-old-revisions context pv/cmr-provider :variable-association)
-  (concept-service/delete-old-revisions context pv/cmr-provider :service-association))
+    (concept-service/delete-old-revisions context provider :access-group)))

 (def-stateful-job OldRevisionConceptCleanupJob
   [ctx system]


version snapshot bump

version snapshot bump

--- src/dj/init/cidernrepl.clj
+++ src/dj/init/cidernrepl.clj
@@ -5,7 +5,7 @@

 (cp/add-dependencies
  :coordinates '[[refactor-nrepl "2.3.1"]
-                [cider/cider-nrepl "0.15.1"]]
+                [cider/cider-nrepl "0.16.0-SNAPSHOT"]]
  :repositories (merge a/maven-central
                       {"clojars" "https://clojars.org/repo"}))


fixing saving basket

fixing saving basket

--- src/eatme/client/main.cljs
+++ src/eatme/client/main.cljs
@@ -69,7 +69,7 @@
    (map
     (fn [input] {:item-name (d/attr input "name")
                  :qty (d/value input)})
-    (d/nodes (x/xpath items-list "div/input[@rel='qty']")))})
+    (d/nodes (x/xpath items-list "div/*/input[@rel='qty']")))})

 (defn save-basket []
     (srm/rpc


storm 0.7.1 compatible

storm 0.7.1 compatible

--- storm-kafka/project.clj
+++ storm-kafka/project.clj
@@ -1,11 +1,11 @@
-(defproject storm/storm-kafka "0.7.0-kafka7-SNAPSHOT"
+(defproject storm/storm-kafka "0.7.1-kafka7-SNAPSHOT"
   :source-path "src/clj"
   :java-source-path "src/jvm"
   :javac-options {:debug "true" :fork "true"}
   :dependencies [[storm/kafka "0.7.0-incubating"
                    :exclusions [org.apache.zookeeper/zookeeper
                                 log4j/log4j]]]
-  :dev-dependencies [[storm "0.7.0"]
+  :dev-dependencies [[storm "0.7.1"]
                      [org.clojure/clojure "1.2.0"]]
   :jvm-opts ["-Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib"]
 )


Cast class to avoid reflection

Cast class to avoid reflection

--- src/play_clj/core_render.clj
+++ src/play_clj/core_render.clj
@@ -29,7 +29,7 @@

 (defmacro tiled-map-layer!
   [layer k & options]
-  `(u/call! ^TiledMapTileLayer ~layer ~k ~@options))
+  `(u/call! ^TiledMapTileLayer (cast TiledMapTileLayer ~layer) ~k ~@options))

 (defn tiled-map-cell
   [screen layer x y]


Problem 0075.

Problem 0075.

--- src/project_euler/problem_0075.clj
+++ src/project_euler/problem_0075.clj
@@ -48,12 +48,10 @@
                    (conj s-t-set (if (< s t) [s t] [t s])))
                  #{})
          (map (fn [[s t]] [(+ r s) (+ r t) (+ r s t)]))
-         ;;(map (fn [xyz] [(apply + xyz) xyz]))
-         ;;(filter (fn [[r s t]] (== (+ (* r r) (* s s)) (* t t))))
          )))

 (defn brute-force-solution []
-  (->> (range 2 50000 2)
+  (->> (range 2 375000 2)
        (mapcat dickson)
        (map (fn [xyz] [(apply + xyz) xyz]))
        (filter (fn [[perim _]] (<= perim 1500000)))


Would be nice to actually compare against an expected result, and wtf does = return true for one parameter?

--- modules/messaging/src/test/clojure/test/immutant/messaging/codecs.clj
+++ modules/messaging/src/test/clojure/test/immutant/messaging/codecs.clj
@@ -14,7 +14,7 @@
             (.get properties k)))))))

 (defn test-codec [message encoding]
-  (is (= (decode (encode (session-mock) message {:encoding encoding})))))
+  (is (= message (decode (encode (session-mock) message {:encoding encoding})))))

 (deftest simple-json
   (test-codec "a random text message" :json))


Full screen css fix

Full screen css fix

--- src/garden/clchess/css.clj
+++ src/garden/clchess/css.clj
@@ -10,6 +10,9 @@
 (defstyles clchess
   [(s/input (type= "file")) {:display "none"}]

+  [:div:-webkit-full-screen {:width "100% !important"
+                             :height "100% !important"}]
+
   [:.chessground {:background "#404040"
                   :padding "20px"
                   :border-radius "2px"