Fix balancing.

Fix balancing.

--- src/onyx/scheduling/balanced_task_scheduler.clj
+++ src/onyx/scheduling/balanced_task_scheduler.clj
@@ -9,7 +9,6 @@
       (fn [[peers-to-drop allocations] _]
         (let [task-most-peers (->> allocations
                                    (sort-by (comp count val))
-                                   reverse
                                    ffirst)]
           [(conj peers-to-drop (last (allocations task-most-peers)))
            (update-in allocations [task-most-peers] butlast)]))


Check return status.

Check return status.

--- src/onyx_starter/launcher/submit_sample_job.clj
+++ src/onyx_starter/launcher/submit_sample_job.clj
@@ -21,8 +21,11 @@
                :catalog dev-catalog
                :lifecycles dev-lifecycles
                :flow-conditions sf/flow-conditions
-               :task-scheduler :onyx.task-scheduler/balanced}]
-      (onyx.api/submit-job peer-config job)
+               :task-scheduler :onyx.task-scheduler/balanced}
+          ret (onyx.api/submit-job peer-config job)]
+      (when-not (:success? ret)
+        (throw (ex-info "Job submission was not successful." ret)))
+
       ;; Automatically grab output from the stubbed core.async channels,
       ;; returning a vector of the results with data structures representing
       ;; the output.


Remove val-fn version of group-by

Remove val-fn version of group-by

--- language-adaptors/rxjava-clojure/src/main/clojure/rx/lang/clojure/core.clj
+++ language-adaptors/rxjava-clojure/src/main/clojure/rx/lang/clojure/core.clj
@@ -478,8 +478,7 @@

 (defn ^Observable group-by
   "Returns an Observable of clojure.lang.MapEntry where the key is the result of
-  (key-fn x) and the val is an Observable of (val-fn x) for each key. If val-fn is
-  omitted, it defaults to identity.
+  (key-fn x) and the val is an Observable of x for each key.

   This returns a clojure.lang.MapEntry rather than rx.observables.GroupedObservable
   for some vague consistency with clojure.core/group-by and so that clojure.core/key,
@@ -492,15 +491,6 @@
   "
   ([key-fn ^Observable xs]
    (->> (.groupBy xs (iop/fn* key-fn))
-        (map (fn [^GroupedObservable go]
-               (clojure.lang.MapEntry. (.getKey go) go)))))
-  ([key-fn val-fn ^Observable xs]
-   ; TODO reinstate once this is implemented
-   ; see https://github.com/Netflix/RxJava/commit/02ccc4d727a9297f14219549208757c6e0efce2a
-   (throw (UnsupportedOperationException. "groupBy with val-fn is currently unimplemented in RxJava"))
-   (->> (.groupBy xs
-                  (iop/fn* key-fn)
-                  (iop/fn* val-fn))
         (map (fn [^GroupedObservable go]
                (clojure.lang.MapEntry. (.getKey go) go))))))


typo, has? -> contains?

typo, has? -> contains?

--- src/main/cljs/cljs/core.cljs
+++ src/main/cljs/cljs/core.cljs
@@ -9839,7 +9839,7 @@
 (deftype Namespace [obj name mappings]
   Object
   (find [_ sym]
-    (when (has? @mappings sym)
+    (when (contains? @mappings sym)
       (Var. #(get @mappings sym)
         (symbol (str name) (str sym)) nil)))
   (findInternedVar [_ sym]


make sign message message text great

make sign message message text great

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

--- src/status_im/ui/screens/wallet/send/views.cljs
+++ src/status_im/ui/screens/wallet/send/views.cljs
@@ -225,7 +225,8 @@
          (i18n/label :t/message)
          [components/amount-input
           {:disabled?     true
-           :input-options {:multiline true}
+           :input-options {:multiline true
+                           :height    100}
            :amount-text   data}
           nil]]]]
       [enter-password-buttons false


add a TODO

add a TODO

--- src/main/compassus/core.cljs
+++ src/main/compassus/core.cljs
@@ -122,6 +122,7 @@
   [{:keys [state]} key _]
   {:value (get @state key)})

+;; TODO: maybe include the current route in the `env` we pass to the user parser
 (defmethod read [nil ::route-data]
   [{:keys [state user-parser] :as env} key params]
   (let [st @state


Refactor exception file path replacement

--- src/adzerk/boot_cljs/impl.clj
+++ src/adzerk/boot_cljs/impl.clj
@@ -48,13 +48,16 @@
   (let [{:keys [type tag file line column] :as data} (util/merge-cause-ex-data e)
         ; Get the message without location info
         message (.getMessage (util/last-cause e))
-        path (util/find-original-path source-paths dirs file)
-        ; Add location info
-        message (cond
-                  column (format "ERROR: %s at file %s, line %d, column %d\n" message path line column)
-                  line (format "ERROR: %s at file %s, line %d\n" message path line)
-                  file (format "ERROR: %s at file %s\n" message path)
-                  :else message)
+        file (util/find-original-path source-paths dirs file)
+        ; Remove file info from message
+        message (if (and file (re-matches #".*in file.*" message))
+                  (first (str/split message #"\s*in file\s*"))
+                  message)
+        ; Add file info with pretty path
+        message (cond-> message
+                  line (str " at line " line)
+                  (and line column) (str ", column " column)
+                  file (str " in file " file))
         cljs-error? (or (= :reader-exception type)
                         (= :cljs/analysis-error tag))]

@@ -65,7 +68,7 @@
         (-> data
             (assoc :from :boot-cljs)
             (cond->
-              path (assoc :file path)
+              file (assoc :file file)
               cljs-error? (assoc :boot.util/omit-stacktrace? true)))
         e))))


ignoring if agr=top then log and return "", rather than throwing exception

--- src/babel/espanol/morphology/verbs.clj
+++ src/babel/espanol/morphology/verbs.clj
@@ -202,9 +202,13 @@
      (str stem "iran")

      ;; </third person plural future>
+
+     (= :top (get-in word [:agr]))
+     (do (log/debug (str "ignoring agr:top for stem: " stem " - maybe this is an incomplete phrase."))
+         "")

      :else
-     (throw (Exception. (str "get-string-1: futuro regular inflection: don't know what to do with input argument: " (strip-refs word)))))))
+     (throw (Exception. (str "get-string-1: future regular inflection: don't know what to do with input argument: " (strip-refs word)))))))

 (defn imperfect [word & [ {usted :usted


always return a valid route

always return a valid route

fixes an edge case where it would return a component in the route if
there was only one route in the `routes` map

--- src/main/compassus/core.cljs
+++ src/main/compassus/core.cljs
@@ -192,11 +192,10 @@
               :mutate (generate-parser-mutate user-parser)}))

 (defn- find-index-route [routes]
-  (let [first-route (ffirst routes)
-        index-route (reduce (fn [_ [k class]]
-                              (when (-> class meta ::index-route)
-                                (reduced k))) routes)]
-    (or index-route first-route)))
+  (reduce (fn [fst [k class]]
+            (if (-> class meta ::index-route)
+              (reduced k)
+              fst)) (ffirst routes) routes))

 (defn- normalize-routes [routes index-route]
   (let [class (get routes index-route)]


Added list of users active in group and whether they are online or offline.

--- src/chat/client/views/pages/users.cljs
+++ src/chat/client/views/pages/users.cljs
@@ -1,7 +1,69 @@
 (ns chat.client.views.pages.users
   (:require [om.core :as om]
             [om.dom :as dom]
+            [chat.client.views.helpers :refer [id->color]]
+            [chat.client.routes :as routes]
+            [chat.client.store :as store]
             [chat.client.views.group-invite :refer [group-invite-view]]))
+
+
+;; Helper Functions
+
+(defn group-users [data]
+  (filter  #(some #{(data :open-group-id)} (get-in % [1 :group-ids]))
+           (data :users)))
+
+(defn status-filter [users status]
+  (filter #(= status (get-in % [1 :status]))
+          users))
+
+
+;;; USER VIEW
+
+(defn user-view [user owner]
+  (reify
+    om/IRender
+    (render [_]
+      (dom/div nil
+               (dom/li nil
+
+                       (dom/a #js {:href (routes/user-page-path {:group-id (routes/current-group)
+                                                                 :user-id (get-in user [1 :id])})}
+                              (dom/img #js{:className "avatar"
+                                           :style #js {:backgroundColor (id->color (get-in user [1 :id]))}
+                                           :src (get-in @store/app-state [:users (get-in user [1 :id]) :avatar])})
+                              (dom/p nil (get-in user [1 :nickname]))))))))
+
+
+;;; User list view
+
+(defn user-list-view [users owner]
+  (reify
+    om/IRender
+    (render [_]
+      (apply dom/ul nil
+             (om/build-all user-view users)))))
+
+
+
+;;; All group users
+
+(defn group-users-view [group-users owner]
+    (reify
+      om/IRender
+      (render [_]
+        (dom/div nil
+                 (dom/h2 nil "Users")
+                 (dom/div nil
+                          (dom/h3 nil "Online")
+                          (om/build user-list-view (status-filter group-users :online))
+
+                          (dom/h3 nil "Offline")
+                          (om/build user-list-view (status-filter group-users :offline))
+
+                          )))))
+
+

 (defn users-page-view [data owner]
   (reify
@@ -10,16 +72,19 @@
       (dom/div #js {:className "page users"}
         (dom/div #js {:className "title"} "Users")

-        (dom/h2 nil "Send Invites")
-        (dom/div nil
-                 (dom/div #js {}
-                          (dom/div nil
-                                   (:name
-                                    (first
-                                     (filter #(= (data :open-group-id) (% :id))
-                                             (vals (data :groups))))))
-                          (om/build group-invite-view (data :open-group-id))))
+        (dom/div #js {:className "content"}
+
+                 (dom/h2 nil "Send Invites")
+                 (dom/div nil
+                          (dom/div #js {}
+                                   (dom/div nil
+                                            (:name
+                                             (first
+                                              (filter #(= (data :open-group-id) (% :id))
+                                                      (vals (data :groups))))))
+                                   (om/build group-invite-view (data :open-group-id)))))
+

         (dom/div #js {:className "content"}
-          (dom/div #js {:className "description"}
-            (dom/p nil "One day, a list of all users in this group will be here.")))))))
+                 (dom/div #js {:className "description"}
+                          (om/build group-users-view (group-users data))))))))


Fix compilation errors

Fix compilation errors

--- src/cljc/robinson/dungeons/temple.cljc
+++ src/cljc/robinson/dungeons/temple.cljc
@@ -4,13 +4,13 @@
             [robinson.random :as rr]
             [robinson.noise :as rn]
             [robinson.lineofsight :as rlos]
+            [robinson.world :as rw]
+            [robinson.monstergen :as mg]
             [clojure.math.combinatorics :as combo]
             [algotools.algos.graph :as graph]
             [taoensso.timbre :as log]
             algotools.data.union-find
             clojure.set))
-
-(timbre/refer-timbre)

 (declare print-cells)

@@ -64,14 +64,14 @@
   "Generate a random set of edges between rooms such that each room
    is traversable from every other room."
   [nodes]
-  (let [_ (trace "all nodes" nodes)
+  (let [_ (log/trace "all nodes" nodes)
         minimum-edges (map vector nodes (rest nodes))
         all-edges (combo/combinations nodes 2)
-        _ (trace "all edges" all-edges)
-        _ (trace "minimum-edges" minimum-edges)
+        _ (log/trace "all edges" all-edges)
+        _ (log/trace "minimum-edges" minimum-edges)
         random-edges (map vec (take (/ (count nodes) 2) (shuffle all-edges)))
         union-edges  (distinct (concat minimum-edges random-edges))]
-    (trace "union-edges" union-edges)
+    (log/trace "union-edges" union-edges)
     union-edges))

 (defn points-to-corridor
@@ -449,13 +449,37 @@
   [(int (/ (+ x1 x2) 2))
    (int (/ (+ y1 y2) 2))])

+(defn level->monster-probabilities
+  [level]
+  (get {1 [1 :spider
+           1 :gecko]
+        2 [1 :spider
+           1 :gecko]
+        3 [1 :mosquito
+           1 :snake
+           1 :spider]
+        4 [1 :cobra
+           1 :tarantula]
+        5 [1 :cobra
+           1 :tarantula]
+        6 [1 :cobra
+           1 :tarantula]
+        7 [1 :monkey
+           1 :centipede]
+        8 [1 :monkey
+           1 :centipede]}
+       level))
+
+(defn make-boss-npcs [cells boss-type]
+  cells)
+
 (defn make-npcs [cells level]
   (let [monster-probabilities (partition 2 (level->monster-probabilities level))]
   (log/info "monster-probabilities" monster-probabilities)
   (reduce (fn [npcs [_ x y]]
             (conj npcs (assoc (mg/id->monster (rr/rand-weighted-nth monster-probabilities))
                               :pos (rc/xy->pos x y))))
-          (if (= level 3)
+          (if (= level 8)
             (make-boss-npcs cells (rand-nth [:eels :giant-rat :giant-lizard]))
             [])
           (take 10


Валидатор даты

Валидатор даты


remove whitespace

remove whitespace


use more appropriate predicate for extract fn

--- src/braid/ui/views/embed.cljs
+++ src/braid/ui/views/embed.cljs
@@ -48,7 +48,7 @@
         set-content! (fn [response]
                       (reset! content response))
         fetch-content! (fn [url]
-                         (when (seq url)
+                         (when (some? url)
                            (edn-xhr {:method :get
                                      :uri "/extract"
                                      :params {:url url}


extracted fires information into predicate macro.

--- src/clj/forma/source/fire.clj
+++ src/clj/forma/source/fire.clj
@@ -38,16 +38,23 @@
        count))
   ([count] [count]))

+(def fire-characteristics
+  (<- [?conf ?kelvin :> ?temp-330 ?conf-50 ?both-preds ?max-t]
+      ((c/juxt #'fires-above-330 #'c/max) ?kelvin :> ?temp-330 ?max-t)
+      (conf-above-50 ?conf :> ?conf-50)
+      (both-preds ?conf ?kelvin :> ?both-preds)))
+
 (defn fire-source
   "Takes a source of textlines, and returns 2-tuples with latitude and
   longitude."
   [source t-res]
-  (<- [?dataset ?datestring ?t-res ?lat ?lon ?kelvin ?conf]
+  (<- [?dataset ?datestring ?t-res ?lat ?lon ?temp-330 ?conf-50 ?both-preds ?max-t]
       (source ?line)
       (identity "fire" :> ?dataset)
       (identity "01" :> ?t-res)
       (format-datestring ?date :> ?datestring)
-      (p/mangle ?line :> ?lat ?lon ?kelvin _ _ ?date _ _ ?conf _ _ _)))
+      (p/mangle ?line :> ?lat ?lon ?kelvin _ _ ?date _ _ ?conf _ _ _)
+      (fire-characteristics ?conf ?kelvin :> ?temp-330 ?conf-50 ?both-preds ?max-t)))

 (defn rip-fires
   "Aggregates fire data at the supplied path by modis pixel at the
@@ -56,19 +63,16 @@
   (let [fires (fire-source (hfs-textline path) t-res)]
     (<- [?dataset ?m-res ?t-res ?tilestring
          ?datestring ?sample ?line ?fire-count ?temp-330 ?conf-50 ?both-preds ?max-t]
-        (fires ?dataset ?datestring ?t-res ?lat ?lon ?kelvin ?conf)
+        (fires ?dataset ?datestring ?t-res ?lat ?lon ?temp-330 ?conf-50 ?both-preds ?max-t)
         (latlon->modis m-res ?lat ?lon :> ?mod-h ?mod-v ?sample ?line)
+        (hv->tilestring ?mod-h ?mod-v :> ?tilestring)
         (identity m-res :> ?m-res)
-        (hv->tilestring ?mod-h ?mod-v :> ?tilestring)
-        (fires-above-330 ?kelvin :> ?temp-330)
-        (conf-above-50 ?conf :> ?conf-50)
-        (both-preds ?conf ?kelvin :> ?both-preds)
-        (c/max ?kelvin :> ?max-t)
         (c/count ?fire-count))))

 (defn run-rip
   "Rips apart fires!"
   [count]
   (?- (stdout)
-      (c/first-n (rip-fires "1000" "32" testfile)
-                 count)))
+      (c/first-n
+       (rip-fires "1000" "32" testfile)
+       count)))


use unprotected macro for Political assets

--- src/clj/game/cards-assets.clj
+++ src/clj/game/cards-assets.clj
@@ -91,7 +91,7 @@
                                                 (lose :runner :credit 1))}}}

    "Bio-Ethics Association"
-   (let [ability {:req (req (no-ice? state (second (:zone card))))
+   (let [ability {:req (req unprotected)
                   :label "Do 1 net damage (start of turn)"
                   :once :per-turn
                   :msg "do 1 net damage"
@@ -137,7 +137,7 @@
    "Clone Suffrage Movement"
    {:derezzed-events {:runner-turn-ends corp-rez-toast}
     :flags {:corp-phase-12 (req (and (some #(is-type? % "Operation") (:discard corp))
-                                     (no-ice? state (second (:zone card)))))}
+                                     unprotected))}
     :abilities [{:label "Add 1 operation from Archives to HQ"
                  :prompt "Choose an operation in Archives to add to HQ" :show-discard true
                  :choices {:req #(and (is-type? % "Operation")
@@ -146,7 +146,7 @@
                  :msg (msg "add " (card-str state target) " to HQ")}]}

    "Commercial Bankers Group"
-   (let [ability {:req (req (no-ice? state (second (:zone card))))
+   (let [ability {:req (req unprotected)
                   :label "Gain 3 [Credits] (start of turn)"
                   :once :per-turn
                   :msg "gain 3 [Credits]"
@@ -752,7 +752,7 @@

    "Sensie Actors Union"
    {:derezzed-events {:runner-turn-ends corp-rez-toast}
-    :flags {:corp-phase-12 (req (no-ice? state (second (:zone card))))}
+    :flags {:corp-phase-12 (req unprotected)}
     :abilities [{:label "Draw 3 cards and add 1 card in HQ to the bottom of R&D"
                  :once :per-turn
                  :msg "draw 3 cards"


fix ordering bug introduced in click-run and refactor calls to system-msg

--- src/clj/game/core-actions.clj
+++ src/clj/game/core-actions.clj
@@ -225,7 +225,10 @@
   "Advance a corp card that can be advanced."
   [state side {:keys [card]}]
   (when-let [cost (pay state side card :click 1 :credit 1)]
-    (system-msg state side (str (build-spend-msg cost "advance") (card-str state card)))
+    (let [spent   (build-spend-msg cost "advance")
+          card    (card-str state card)
+          message (str spent card)]
+      (system-msg state side message))
     (update-advancement-cost state side card)
     (add-prop state side (get-card state card) :advance-counter 1)))

@@ -262,16 +265,17 @@
         (update-ice-strength state side ice)))))

 ;;; Runner actions
-
 (defn click-run
   "Click to start a run."
   [state side {:keys [server] :as args}]
   (when (and (not (get-in @state [:runner :register :cannot-run]))
              (can-run-server? state server)
              (can-pay? state :runner "a run" :click 1))
-    (let [cost (pay state :runner nil :click 1)]
-      (system-msg state :runner (str (build-spend-msg cost "make a run on") server))
-      (run state side server))))
+    (run state side server)
+    (let [cost (pay state :runner nil :click 1)
+          spent (build-spend-msg cost "make a run on")
+          message (str spent server)]
+      (system-msg state :runner message))))

 (defn remove-tag
   "Click to remove a tag."


Trigger coffee alarm when shelly plug uses > 1000W

--- src/clj/mokkameister/mqtt.clj
+++ src/clj/mokkameister/mqtt.clj
@@ -1,16 +1,49 @@
 (ns mokkameister.mqtt
   (:require [clojurewerkz.machine-head.client :as mh]
             [lambdaisland.uri :as uri]
+            [mokkameister.brew :refer [start-brewing! finish-brewing!]]
             [mokkameister.system :refer [system]]))

-(def topic "mokkameister/alarm/coffee/trigger/set")
-(def trigger-payload "true")
+(def THRESHOLD_WATT 1000)

-(defn trigger-alarm! []
-  (let [my-uri (uri/uri (system :mqtt-uri))
+(def topic "shellies/shellyplug-s-882239/relay/0/power")
+
+(defn- started-percolating? [history]
+  (->> history
+       (take-last 3)
+       (map #(<= THRESHOLD_WATT %))
+       (vec)
+       (= [false false true])))
+
+(defn- brew-finished? [history]
+  (->> history
+       (take-last 5)
+       (map #(<= THRESHOLD_WATT %))
+       (vec)
+       (= [true true false false false])))
+
+(defn- connect! []
+  (let [
+        my-uri (uri/uri (system :mqtt-uri))
         short-url (str "tcp://" (:host my-uri) ":" (:port my-uri))
         creds {:username (:user my-uri)
                :password (:password my-uri)}
         conn (mh/connect short-url {:opts creds})]
-    (mh/publish conn topic trigger-payload)
-    (mh/disconnect conn)))
+    conn))
+
+(defn connect-and-process! []
+  (let [conn (connect!)
+        history (atom (vec [0 0 0 0 0]))
+        on-receive (fn [^String topic _ ^bytes payload]
+                     (let [wattage (Float/parseFloat (String. payload "UTF-8"))]
+                       (do
+                         (swap! history
+                                #(->> (conj % wattage)
+                                      (drop 1)
+                                      (vec)))
+                         (cond
+                           (started-percolating? @history) (start-brewing!)
+                           (brew-finished? @history) (finish-brewing!)))))]
+    (mh/subscribe conn {topic 0} on-receive)))
+
+(connect-and-process!)


reformat some code

reformat some code

--- src/clj/shadow/cljs/build.clj
+++ src/clj/shadow/cljs/build.clj
@@ -559,10 +559,8 @@
     ast))

 (defn hijacked-parse-ns [env form name opts]
-  (assoc (util/parse-ns form)
-    :env env
-    :form form
-    :op :ns))
+  (-> (util/parse-ns form)
+      (assoc :env env :form form :op :ns)))

 (def default-parse ana/parse)

@@ -610,20 +608,23 @@
                  {:read-cond :allow :features #{:cljs}}))
         in (readers/indexing-push-back-reader (PushbackReader. (StringReader. cljs-source)) 1 name)]

-    (binding [comp/*source-map-data* (atom {:source-map (sorted-map)
-                                            :gen-col 0
-                                            :gen-line 0})]
+    (binding [comp/*source-map-data*
+              (atom {:source-map (sorted-map)
+                     :gen-col 0
+                     :gen-line 0})]

       (let [result
             (loop [{:keys [ns ns-info] :as compile-state} (assoc init :js "")]
-              (let [form (binding [*ns* (create-ns ns)
-                                   ana/*cljs-ns* ns
-                                   ana/*cljs-file* name
-                                   reader/*data-readers* tags/*cljs-data-readers*
-                                   reader/*alias-map* (merge reader/*alias-map*
-                                                        (:requires ns-info)
-                                                        (:require-macros ns-info))]
-                           (reader/read opts in))]
+              (let [form
+                    (binding [*ns* (create-ns ns)
+                              ana/*cljs-ns* ns
+                              ana/*cljs-file* name
+                              reader/*data-readers* tags/*cljs-data-readers*
+                              reader/*alias-map*
+                              (merge reader/*alias-map*
+                                (:requires ns-info)
+                                (:require-macros ns-info))]
+                      (reader/read opts in))]

                 (if (identical? form eof-sentinel)
                   ;; eof
@@ -1102,14 +1103,20 @@
   [state]
   (-> state
       (discover-macros)
-      (assoc :configured true
-             :unoptimizable (when-let [imul (io/resource "cljs/imul.js")]
-                              (slurp imul))
-             ;; populate index with known sources
-             :provide->source (into {} (for [{:keys [name provides]} (vals (:sources state))
-                                             provide provides]
-                                         [provide name]
-                                         )))))
+      (assoc
+        :configured
+        true
+
+        :unoptimizable
+        (when-let [imul (io/resource "cljs/imul.js")]
+          (slurp imul))
+
+        ;; populate index with known sources
+        :provide->source
+        (into {} (for [{:keys [name provides]} (vals (:sources state))
+                       provide provides]
+                   [provide name]
+                   )))))

 (def step-finalize-config finalize-config)

@@ -1236,27 +1243,31 @@
   (if (= 1 (count modules))
     (vals modules)
     ;; else: multiple modules must be sorted in dependency order
-    (let [module-graph (module-graph modules)
-          module-order (reverse (la/topsort module-graph))
-
-          js-mods (reduce
-                    (fn [js-mods module-key]
-                      (let [{:keys [js-name name depends-on sources]} (get modules module-key)
-                            js-mod (JSModule. js-name)]
-
-                        (doseq [name sources]
-                          ;; we don't actually need code yet
-                          (.add js-mod (SourceFile. name)))
-
-                        (doseq [other-mod-name depends-on
-                                :let [other-mod (get js-mods other-mod-name)]]
-                          (when-not other-mod
-                            (throw (ex-info "module depends on undefined module" {:mod name :other other-mod-name})))
-                          (.addDependency js-mod other-mod))
-
-                        (assoc js-mods module-key js-mod)))
-                    {}
-                    module-order)]
+    (let [module-graph
+          (module-graph modules)
+
+          module-order
+          (reverse (la/topsort module-graph))
+
+          js-mods
+          (reduce
+            (fn [js-mods module-key]
+              (let [{:keys [js-name name depends-on sources]} (get modules module-key)
+                    js-mod (JSModule. js-name)]
+
+                (doseq [name sources]
+                  ;; we don't actually need code yet
+                  (.add js-mod (SourceFile. name)))
+
+                (doseq [other-mod-name depends-on
+                        :let [other-mod (get js-mods other-mod-name)]]
+                  (when-not other-mod
+                    (throw (ex-info "module depends on undefined module" {:mod name :other other-mod-name})))
+                  (.addDependency js-mod other-mod))
+
+                (assoc js-mods module-key js-mod)))
+            {}
+            module-order)]

       ;; eek mutable code
       ;; this will move duplicate files from each module to the closest common ancestor
@@ -1312,26 +1323,28 @@
          (string? externs-source)
          (seq externs-source)]}

-  (merge-resource state {:type :js
-                         :foreign true
-                         :name name
-                         :js-name name
-                         :provides provides
-                         :requires requires
-                         ;; FIXME: should allow getting a vector as provides instead
-                         :require-order (into [] requires)
-                         :output js-source
-                         :input (atom js-source)
-                         :externs-source externs-source
-                         :last-modified 0
-                         }))
+  (merge-resource state
+    {:type :js
+     :foreign true
+     :name name
+     :js-name name
+     :provides provides
+     :requires requires
+     ;; FIXME: should allow getting a vector as provides instead
+     :require-order (into [] requires)
+     :output js-source
+     :input (atom js-source)
+     :externs-source externs-source
+     :last-modified 0
+     }))

 (defn make-runtime-setup [{:keys [runtime] :as state}]
-  (let [src (str/join "\n" [(case (:print-fn runtime)
-                              ;; Browser
-                              :console "cljs.core.enable_console_print_BANG_();"
-                              ;; Node.JS
-                              :print "cljs.core._STAR_print_fn_STAR_ = require(\"util\").print;")])]
+  (let [src (str/join "\n"
+              [(case (:print-fn runtime)
+                 ;; Browser
+                 :console "cljs.core.enable_console_print_BANG_();"
+                 ;; Node.JS
+                 :print "cljs.core._STAR_print_fn_STAR_ = require(\"util\").print;")])]
     {:type :js
      :name "runtime_setup.js"
      :js-name "runtime_setup.js"
@@ -1773,7 +1786,7 @@
                     (zero? last-modified)
                     (> (or (:compiled-at src) ;; js is not compiled but maybe modified
                            last-modified)
-                      (.lastModified target)))]
+                       (.lastModified target)))]

     (io/make-parents target)


Fix ability description typo

Fix ability description typo

--- src/cljc/robinson/player.cljc
+++ src/cljc/robinson/player.cljc
@@ -727,7 +727,7 @@
     :wtl->thirst "wtl->thirst"
     :str+1 "Increase strength (+2%)"
     :dex+1 "Increase dexterity (+1)"
-    :max-hp+1 "Increase map hp (+1)"
+    :max-hp+1 "Increase max hp (+1)"
     :toughness+1 "Increase toughness (+1)"
     :speed+1 "Increase speed (+5%)"
     :wtl->strength-buff "Increase strength temporarily"


Fix movement of test entity

Fix movement of test entity

--- src/cljs/engine/entities.cljs
+++ src/cljs/engine/entities.cljs
@@ -9,8 +9,9 @@
 (defrecord Bunny [id sprite x y]
   Entity
   (tick [this]
-    (let [sprite (:sprite this)])
-    (aset sprite "rotation" (+ 0.01 (aget sprite "rotation"))))
+    (let [sprite (:sprite this)
+          old-rotation (aget sprite "rotation")]
+      (aset sprite "rotation" (+ 0.01 old-rotation))))

   Renderable
   (render [this stage]


We like colgroups too.  And interactive forms.

--- src/cljs/omstool/company.cljs
+++ src/cljs/omstool/company.cljs
@@ -4,16 +4,21 @@
             [om-tools.core :refer-macros [defcomponent]]
             [om-bootstrap.table :as t]
             [om-bootstrap.button :as b]
+            [om-bootstrap.grid :as g]
             [om-bootstrap.input :as i]
             [om-bootstrap.random :as r]))

 (def company-data [ {:sid "Foo"
                      :name "Foo Company"
-                     :industry "Retail"}
+                     :industry "retail"}
                     {:sid "Bar"
                      :name "Bar Company"
-                     :industry "Travel"}])
+                     :industry "travel"}])
+
+(def industry-data [{:value "travel" :label "Travel"}
+                    {:value "retail" :label "Retail"}])
+

 (defn input-value [owner input]
   (-> (om/get-node owner input)
@@ -33,30 +38,53 @@
                            (.preventDefault e))} "cancel"))))

+(defn text-input-type [editing?]
+  (if editing?
+    "text"
+    "static"))
+
+(defn select-input-type [editing?]
+  (if editing?
+    "select"
+    "static"))
+
+(defn options-for-select [data selected]
+  (map (fn [o] (dom/option {:value (:value o)
+                            :selected (= selected (:value o))}
+                           (:label o)))
+       data))
+
 (defcomponent company-table-line [company owner]
   (init-state [_]
               {:company company})
   (render-state [_ {:keys [company editing?]}]
                 (dom/tr
                  (dom/td
-                  (if editing?
-                    (i/input {:type "text"
-                              :ref "company-name"
-                              :default-value (:name company)})
-                    (:name company)))
+                  (i/input {:type (text-input-type editing?)
+                            :ref "company-name"
+                            :value (:name company)}))
                  (dom/td
-                  (if editing?
-                    (i/input {:type "text"
-                              :ref "company-id"
-                              :default-value (:sid company)})
-                    (:sid  company)))
-                 (dom/td (:industry company))
+                  (i/input {:type (text-input-type editing?)
+                            :ref "company-id"
+                            :value (:sid company)}))
+                 (dom/td
+                  (i/input {:type (select-input-type editing?)
+                            :ref "industry-id"
+                            :value (:industry company)}
+                           (if editing? (options-for-select
+                                         industry-data
+                                         (:industry company)))))
                  (dom/td (action-links owner editing?)))))

 (defcomponent companies-table [_ _]
   (render-state [_ {:keys [companies]}]
                 (t/table {:striped? true}
+                         (dom/colgroup
+                          (dom/col {:className "col-md-4"} nil)
+                          (dom/col {:className "col-md-4"} nil)
+                          (dom/col {:className "col-md-2"} nil)
+                          (dom/col {:className "col-md-2"} nil))
                          (dom/thead
                           (dom/tr
                            (dom/th "Name")
@@ -70,10 +98,11 @@

 (defcomponent render-companies-index [_ _]
   (render [_]
-          (dom/div
-           (dom/h3 "Companies")
-           (om/build companies-table nil
-                     {:init-state {:companies company-data}}))))
+          (g/row nil
+                 (g/col {:md 12}
+                        (dom/h3 "Companies")
+                        (om/build companies-table nil
+                                  {:init-state {:companies company-data}})))))


fix context

fix context

--- src/cljs/re_form/context.cljs
+++ src/cljs/re_form/context.cljs
@@ -1,6 +1,5 @@
 (ns re-form.context
-  (:require [reagent.core :as r]
-            [clojure.walk :as w]))
+  (:require [reagent.core :as r]))

 (def context-type (clj->js {"re-form-context" (-> js/React
                                                   (aget "PropTypes")
@@ -12,7 +11,9 @@

     :get-child-context
     (fn []
-      (clj->js {"re-form-context" context-data}))
+      (let [obj (js/Object.)]
+        (aset obj "re-form-context" context-data)
+        obj))

     :reagent-render (fn [] child)}))

@@ -24,7 +25,7 @@

         :component-will-mount
         (fn [this]
-          (reset! ctx (w/keywordize-keys (js->clj (aget (.-context this) "re-form-context")))))
+          (reset! ctx (aget (.-context this) "re-form-context")))

         :reagent-render
         (fn [props child]


[n.activity] Override methods based on arity

--- src/clojure/neko/activity.clj
+++ src/clojure/neko/activity.clj
@@ -95,7 +95,8 @@
           prefix (or prefix (str sname "-"))
           extends (resolve (or extends 'Activity))
           state (or state `(atom {}))
-          exposed-methods (if (:neko.init/release-build *compiler-options*)
+          release-build? (:neko.init/release-build *compiler-options*)
+          exposed-methods (if release-build?
                             (map str (keys methods))
                             (u/list-all-methods extends))]
       `(do
@@ -107,7 +108,9 @@
           :state "state"
           :extends ~extends
           :implements ~(conj implements neko.ActivityWithState)
-          :overrides-methods ~(conj (keys methods) 'getState)
+          :overrides-methods ~(when release-build?
+                                (map (fn [[_ [mname args]]] [mname (count args)])
+                                     (assoc methods 'getState '(getState [this]))))
           :exposes-methods
           ~(->> exposed-methods
                 distinct


Report on grain-sizes.

Report on grain-sizes.

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -417,6 +417,15 @@
                (* 1.0 (mean ages)))
       (println "Median age in population:"
                (* 1.0 (median ages))))
+    (let [grain-sizes (map :grain-size population)]
+      (println "Minimum grain-size in population:"
+               (* 1.0 (apply min grain-sizes)))
+      (println "Maximum grain-size in population:"
+               (* 1.0 (apply max grain-sizes)))
+      (println "Average grain-size in population:"
+               (* 1.0 (mean grain-sizes)))
+      (println "Median grain-size in population:"
+               (* 1.0 (median grain-sizes))))
     (println "--- Population Diversity Statistics ---")
     (let [genome-frequency-map (frequencies (map :genome population))]
       (println "Min copy number of one Plush genome:" (apply min (vals genome-frequency-map)))


Fixed possible exception if entire population is equivalent.

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -355,13 +355,14 @@
         err-fn (if (= total-error-method :rmse) :weighted-error :total-error)
         sorted (sort-by err-fn < population)
         ; err-fn-best (first sorted)
-        err-fn-best (loop [sorted-individuals sorted] (if (and (<= (:total-error (first sorted-individuals)) error-threshold)
-                                                  (> (apply + (:errors (error-function (first sorted-individuals) :train))) error-threshold)
-                                                  (<= (:total-error (second sorted-individuals)) error-threshold))
-                                            (recur (rest sorted-individuals))
-                                            (first sorted-individuals)))
-
-
+        err-fn-best (loop [sorted-individuals sorted]
+                      (if (empty? (rest sorted-individuals))
+                        (first sorted-individuals)
+                        (if (and (<= (:total-error (first sorted-individuals)) error-threshold)
+                                 (> (apply + (:errors (error-function (first sorted-individuals) :train))) error-threshold)
+                                 (<= (:total-error (second sorted-individuals)) error-threshold))
+                          (recur (rest sorted-individuals))
+                          (first sorted-individuals))))
         psr-best (problem-specific-report err-fn-best
                                           population
                                           generation


Added HTTP status to default message.

Added HTTP status to default message.

--- src/cmr/http/kit/response.clj
+++ src/cmr/http/kit/response.clj
@@ -83,7 +83,11 @@

 (defn error-handler
   ([status headers body]
-    (error-handler status headers body "Unexpected cmr-authz error."))
+    (error-handler
+      status
+      headers
+      body
+      (format "Unexpected cmr-authz error (%s)." status)))
   ([status headers body default-msg]
     (let [ct (:content-type headers)]
       (log/trace "Headers:" headers)


CMR-615: Added check for content type to find-concepts.

--- src/cmr/search/api/routes.clj
+++ src/cmr/search/api/routes.clj
@@ -2,6 +2,7 @@
   (:require [compojure.handler :as handler]
             [compojure.route :as route]
             [compojure.core :refer :all]
+            [clojure.string :as str]
             [ring.util.response :as r]
             [ring.util.codec :as codec]
             [ring.middleware.json :as ring-json]
@@ -147,16 +148,21 @@
 (defn- find-concepts
   "Invokes query service to find results and returns the response"
   [context path-w-extension params headers query-string]
-  (let [concept-type (concept-type-path-w-extension->concept-type path-w-extension)
-        context (-> context
-                    (process-context-info params headers)
-                    (assoc :query-string query-string))
-        params (process-params params path-w-extension headers "application/xml")
-        _ (info (format "Searching for %ss from client %s in format %s with params %s."
-                        (name concept-type) (:client-id context) (:result-format params) (pr-str params)))
-        search-params (lp/process-legacy-psa params query-string)
-        results (query-svc/find-concepts-by-parameters context concept-type search-params)]
-    (search-response params results)))
+  (println headers)
+  (if (= "application/x-www-form-urlencoded" (get headers (str/lower-case CONTENT_TYPE_HEADER)))
+    (let [concept-type (concept-type-path-w-extension->concept-type path-w-extension)
+          context (-> context
+                      (process-context-info params headers)
+                      (assoc :query-string query-string))
+          params (process-params params path-w-extension headers "application/xml")
+          _ (info (format "Searching for %ss from client %s in format %s with params %s."
+                          (name concept-type) (:client-id context) (:result-format params)
+                          (pr-str params)))
+          search-params (lp/process-legacy-psa params query-string)
+          results (query-svc/find-concepts-by-parameters context concept-type search-params)]
+      (search-response params results))
+    {:status 415
+     :body (str "Unsupported content type [" (get headers (str/lower-case CONTENT_TYPE_HEADER)) "]")}))

 (defn- find-concepts-by-aql
   "Invokes query service to parse the AQL query, find results and returns the response"
@@ -220,14 +226,14 @@
         (GET "/" {params :params headers :headers context :request-context}
           (find-concept-by-cmr-concept-id context path-w-extension params headers)))

-      ;; Find concepts
+      ;; Find concepts - form encoded
       (context ["/:path-w-extension" :path-w-extension concept-type-w-extension-regex] [path-w-extension]
         (GET "/" {params :params headers :headers context :request-context query-string :query-string}
           (find-concepts context path-w-extension params headers query-string))
         (POST "/" {params :params headers :headers context :request-context body :body-copy}
           (find-concepts context path-w-extension params headers body)))

-      ;; AQL search
+      ;; AQL search - xml
       (context ["/concepts/:path-w-extension" :path-w-extension search-w-extension-regex] [path-w-extension]
         (POST "/" {params :params headers :headers context :request-context body :body-copy}
           (find-concepts-by-aql context path-w-extension params headers body)))


Removed example HMM.

Removed example HMM.

--- src/com/lemonodor/viterbi.clj
+++ src/com/lemonodor/viterbi.clj
@@ -112,21 +112,9 @@
           (recur (rest s) (first s))
           (recur (rest s) max))))))

+
 (defn pprint-hmm [hmm]
   (println "number of states: " (:n hmm) " number of observations:  " (:m hmm))
   (print "init probabilities: ") (pprint/pprint (:init-probs hmm))
   (print "emission probs: " ) (pprint/pprint (:emission-probs hmm))
   (print "state-transitions: " ) (pprint/pprint (:state-transitions hmm)))
-
-
-(def example-hmm
-  (make-hmm
-   :states [:healthy :fever]
-   :obs [:normal :cold :dizzy]
-   :start-p {:healthy 0.6, :fever 0.4}
-   :trans-p (let [t {:healthy {:healthy 0.7, :fever 0.3},
-                     :fever {:healthy 0.4, :fever 0.6}}]
-              #((t %1) %2))
-   :emit-p (let [t {:healthy {:normal 0.5, :cold 0.4, :dizzy 0.1},
-                    :fever {:normal 0.1, :cold 0.3, :dizzy 0.6}}]
-             #((t %1) %2))))


Reduce default batch size to 10

Reduce default batch size to 10

--- src/onyx/metrics/riemann.clj
+++ src/onyx/metrics/riemann.clj
@@ -32,7 +32,7 @@
     (throw (ex-info "Invalid Riemann metrics configuration." riemann-config)))

   (future
-    (let [batch-size (or batch-size 50)
+    (let [batch-size (or batch-size 10)
           batch-timeout (or batch-timeout 50)
           defaulted-timeout (or send-timeout 4000)
           defaulted-port (if port
@@ -42,17 +42,17 @@
           timeout-count (atom 0)]

       (while (not (Thread/interrupted))
-        (let [events (map metric->riemann-event (read-batch ch batch-size batch-timeout))]
+        (let [events (first (map metric->riemann-event (read-batch ch batch-size batch-timeout)))]
           (when-not (empty? events)
             (loop [sleep 0]
               ;; Exponential backoff to rate limit errors
               (when-not (zero? sleep)
-                (info (format "Message send timeout count %s. Backing off %s.") @timeout-count sleep)
+                (info (format "Message send timeout count %s. Backing off %s." @timeout-count sleep))
                 (Thread/sleep sleep))

               (let [result (try
                              (-> client
-                                 (r/send-events events)
+                                 (r/send-event events)
                                  (deref defaulted-timeout ::timeout))
                              (catch InterruptedException e
                                ;; Intentionally pass.


util/date.clj: added unit test for empty string

--- src/org/altlaw/util/date.clj
+++ src/org/altlaw/util/date.clj
@@ -23,7 +23,8 @@
                               (ParsePosition. 0))
                       (StringBuffer.)
                       (FieldPosition. 0)))))
-  (is (= "January 1, 2009" (format-long-date "2009-01-01"))))
+  (is (= "January 1, 2009" (format-long-date "2009-01-01")))
+  (is (= nil (format-long-date ""))))

 (defn filename-timestamp []
   (.format *datetime-filename-format* (Date.)))


Missing require

Missing require

--- src/datascript/serialize.cljc
+++ src/datascript/serialize.cljc
@@ -4,6 +4,7 @@
    [clojure.edn :as edn]
    [clojure.string :as str]
    [datascript.db :as db #?(:cljs :refer-macros :clj :refer) [raise cond+] #?@(:cljs [:refer [Datom]])]
+   [datascript.lru :as lru]
    [me.tonsky.persistent-sorted-set :as set]
    [me.tonsky.persistent-sorted-set.arrays :as arrays])
   #?(:cljs (:require-macros [datascript.serialize :refer [array dict]]))


improve trivial comment

improve trivial comment

--- src/re_frame/middleware.cljs
+++ src/re_frame/middleware.cljs
@@ -82,7 +82,7 @@
 ;; Found I had to do it this way:
 ;;   (def fn-name
 ;;     "docstring"
-;;     ^{....}       ;; middleware put on the following fn
+;;     ^{....}       ;; metadata to put on the following fn
 ;;     (fn fn-name ....))
 ;;
 ;; So, yeah, weird.


EMI implementation, still some problems to solve

--- src/clj/clojurewerkz/statistiker/metrics.clj
+++ src/clj/clojurewerkz/statistiker/metrics.clj
@@ -5,10 +5,13 @@
 ;TODO move this to a util NS? Or find a better implementation
 (defn factorial
   [x]
-    (loop [n x f 1]
+  (println x)
+    (if (zero? x)
+      1
+      (loop [n x f 1]
         (if (= n 1)
             f
-            (recur (dec n) (* f n)))))
+            (recur (dec n) (* f n))))))

 ; The Mutual Information is a measure of the similarity between two labels of the same data.
 ; Where P(i) is the probability of a random sample occurring in cluster U_i and P'(j) is the probability of a random sample
@@ -27,7 +30,6 @@
         b (frequencies V)
         n (apply merge-with + (map #(hash-map [%1 %2] 1) U V))
         N (count U)
-        ;; TODO: Use a fmap.
         norm_n (into {} (map (fn[[k v]] [k (/ v N)]) n))
         cells (keys norm_n)]
     (reduce + (map
@@ -38,24 +40,34 @@
                                     (* N N))))))
                cells))))

-;TODO: write this!
+
+(defn inside-fn
+  [N a b [i j nij]]
+           (* (/ nij N)
+            (Math/log (/ (* N nij)  (* (a i) (b j))))
+            (/
+             (* (factorial (a i)) (factorial (b j)) (factorial (- N (a i))) (factorial (- N (b j))))
+             (* (factorial N) (factorial nij) (factorial (- (a i) nij)) (factorial (- (b i) nij)) (factorial (+ (- N (a i) (b j)) nij))))))
+
+
+(defn triples
+  [N a b i j]
+  (let [start (max (- (+ (a i) (b j)) N) 0)
+        end (min (a i) (b j))]
+    (map #(vector i j %) (range start (inc end)))))
+
 (defn expected_mututal_information
   [U V]
-   (let [a (frequencies U)
+  (let [a (frequencies U)
         b (frequencies V)
         n (apply merge-with + (map #(hash-map [%1 %2] 1) U V))
         N (count U)
-        ;; TODO: Use a fmap.
         norm_n (into {} (map (fn[[k v]] [k (/ v N)]) n))
-        cells (keys norm_n)]
-(reduce + (map
-            (fn [[i j]]
+        cells (keys norm_n)
+        combinations (apply concat (map (fn[[i j]] ((partial triples N a b) i j)) cells))]

-              (/
-               (* (factorial (a i)) (factorial (b j)) (factorial (- N (a i))) (factorial (- N (b j))))
-               (* (factorial N) (n [i j])
-              )
-               cells))))
+        (reduce + (map (partial inside-fn N a b) combinations))))
+

 ; Adjusted Mutual Information (AMI) is an adjustment of the Mutual Information (MI) score to account for chance.
 ; AMI(U, V) = [MI(U, V) - E(MI(U, V))] / [max(H(U), H(V)) - E(MI(U, V))]


Changed order of user-in-game? args.

Changed order of user-in-game? args.

--- src/cljs/wombats_web_client/utils/games.cljs
+++ src/cljs/wombats_web_client/utils/games.cljs
@@ -18,7 +18,7 @@

 (defn- user-in-game?
   "Whether current-user is in the game"
-  [game current-user]
+  [current-user game]
   (> (count (filter #(= (:user/github-username current-user)
                         (get-in % [:player/user :user/github-username]))
                     (:game/players game)))
@@ -63,7 +63,7 @@
   [games current-user]
   (reduce-kv (fn [coll _ [game]]
                (if (and (is-open? game)
-                        (user-in-game? game current-user))
+                        (user-in-game? current-user game))
                  (conj coll game)
                  coll)) [] games))

@@ -78,6 +78,6 @@
   [games current-user]
   (reduce-kv (fn [coll _ [game]]
                (if (and (is-closed? games)
-                        (user-in-game? game current-user))
+                        (user-in-game? current-user game))
                  (conj coll game)
                  coll)) [] games))


Escape backslash in ns-string to allow for compilation

`\\n` and `\-` do not compile

--- src/riemann/streams/pure.clj
+++ src/riemann/streams/pure.clj
@@ -78,9 +78,9 @@
   c0. All child streams unify at a final stream f.

-        /--- c0 ---\
+        /--- c0 ---\\
       by            f
-        \--- c1 ---/
+        \\--- c1 ---/

   Case 1: e falls in w0. Create child c1 and inform it that the current window


Fix build - paren in wrong place

Fix build - paren in wrong place

--- src/grafter/rdf/protocols.clj
+++ src/grafter/rdf/protocols.clj
@@ -35,7 +35,7 @@
   want to use grafter.rdf.sesame/with-transaction"
   (begin [repo] "Start a transaction")
   (commit [repo] "Commit a transaction")
-  (rollback [repo]) "Rollback a transaction")
+  (rollback [repo] "Rollback a transaction"))

 (defrecord Triple
     [s p o]


Added proper logging into db-interface module

--- src/hurvinek/db_interface.clj
+++ src/hurvinek/db_interface.clj
@@ -21,6 +21,7 @@
 (defn read-products
     "Read list of all products."
     []
+    (log/info "list of all products")
     (try
         (jdbc/query db-spec/hurvinek-db
                         ["select id, name, description from products order by name"])
@@ -31,6 +32,7 @@
 (defn read-from-product-table
     "Read selected column from the given product id."
     [product-id what]
+    (log/info product-id what)
     (try
         (-> (jdbc/query db-spec/hurvinek-db
                             [(str "select " (name what) " from products where id=?") product-id])
@@ -43,15 +45,18 @@
 (defn read-product-name
     "Read name of product for the given product id."
     [product-id]
+    (log/info product-id)
     (read-from-product-table product-id :name))

 (defn read-product-description
     "Read description of product for the given product id."
     [product-id]
+    (log/info product-id)
     (read-from-product-table product-id :description))

 (defn read-name-for-id
     [table-name id]
+    (log/info table-name id)
     (try
         (-> (jdbc/query db-spec/hurvinek-db
                             [(str "select name from " table-name " where id=?") id])
@@ -64,21 +69,25 @@
 (defn read-chapter-name
     "Read name of chapter for the given chapter id."
     [chapter-id]
+    (log/info chapter-id)
     (read-name-for-id "chapters" chapter-id))

 (defn read-group-name
     "Read name of group for the given group id."
     [group-id]
+    (log/info group-id)
     (read-name-for-id "groups" group-id))

 (defn read-component-name
     "Read name of component for the given component id."
     [component-id]
+    (log/info component-id)
     (read-name-for-id "components" component-id))

 (defn read-chapters
     "Read list of all chapters for selected product."
     [product-id]
+    (log/info product-id)
     (try
         (jdbc/query db-spec/hurvinek-db
                         ["select id, name from chapters where product=? order by name" product-id])
@@ -89,6 +98,7 @@
 (defn read-groups
     "Read list of all groups for selected chapter (and product - it is implicit)."
     [chapter-id]
+    (log/info chapter-id)
     (try
         (jdbc/query db-spec/hurvinek-db
                         ["select id, name from groups where chapter=? order by name" chapter-id])
@@ -188,6 +198,7 @@
 (defn read-components
     "Read list of all components for selected group."
     [group-id]
+    (log/info group-id)
     (try
         (jdbc/query db-spec/hurvinek-db
                         ["select id, name from components where group_id=? order by name" group-id])
@@ -197,6 +208,7 @@

 (defn read-components-for-chapter
     [chapter-id]
+    (log/info chapter-id)
     (try
         (jdbc/query db-spec/hurvinek-db
                         ["select components.id, components.name
@@ -208,6 +220,7 @@

 (defn read-components-to-chapter
     [product-id]
+    (log/info product-id)
     (try
         (jdbc/query db-spec/hurvinek-db
                         ["select components.name component, chapters.name chapter
@@ -220,6 +233,7 @@

 (defn add-new-component
     [component-name group-id]
+    (log/info component-name group-id)
     (try
         (jdbc/insert! db-spec/hurvinek-db
                         :components {:name component-name
@@ -231,6 +245,7 @@

 (defn delete-component
     [component-id]
+    (log/info component-id component-id)
     (try
         (jdbc/delete! db-spec/hurvinek-db
                         :components ["id=?" component-id])
@@ -241,6 +256,7 @@

 (defn update-component
     [component-id component-name]
+    (log/info component-id component-name)
     (if (empty? component-name)
         "Component name is empty"
         (try


removing duplicate requires

removing duplicate requires

--- src/vignette/http/routes.clj
+++ src/vignette/http/routes.clj
@@ -1,7 +1,5 @@
 (ns vignette.http.routes
-  (:require (vignette.storage [protocols :refer :all]
-                              [core :refer :all])
-            [cheshire.core :refer :all]
+  (:require [cheshire.core :refer :all]
             [clojure.java.io :as io]
             [clout.core :refer [route-compile route-matches]]
             [compojure.core :refer [routes GET ANY]]


TNS-15: Handle spaces in classpath directories

Signed-off-by: Stuart Sierra <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@stuartsierra.com>

--- src/main/clojure/clojure/tools/namespace.clj
+++ src/main/clojure/clojure/tools/namespace.clj
@@ -99,7 +99,7 @@
 (defn- loader-classpath [loader]
   (when (instance? java.net.URLClassLoader loader)
     (map
-     #(java.io.File. (.getPath ^java.net.URL %))
+     #(java.io.File. (.toURI ^java.net.URL %))
      (.getURLs ^java.net.URLClassLoader loader))))

 (defn- classpath


Require at least one variable in variable paths (via the path spec)

--- src/main/workflo/macros/specs/bind.cljc
+++ src/main/workflo/macros/specs/bind.cljc
@@ -5,7 +5,7 @@
             [workflo.macros.specs.parsed-query :as spq]))

 (s/def ::path
-  (s/coll-of ::spq/typed-property :gen-max 10))
+  (s/coll-of ::spq/typed-property :min-count 1 :gen-max 10))

 (s/def ::paths
   (s/coll-of ::path :gen-max 10))


Fix message nav with key up/down.

Fix message nav with key up/down.

--- src/devtools/cljs/kamituel/s-tlbx-chrome/state.cljs
+++ src/devtools/cljs/kamituel/s-tlbx-chrome/state.cljs
@@ -142,13 +142,13 @@
 (defn next-younger-message
   [{:keys [cmp-state]}]
   (let [{:keys [selected-message messages]} @cmp-state
-        younger-msg (second (drop-while #(not (u/msg-eq selected-message %)) (reverse messages)))]
+        younger-msg (second (drop-while #(not (u/msg-eq selected-message %)) messages))]
     (swap! cmp-state assoc :selected-message younger-msg)))

 (defn next-older-message
   [{:keys [cmp-state]}]
   (let [{:keys [selected-message messages]} @cmp-state
-        older-msg (second (drop-while #(not (u/msg-eq selected-message %)) messages))]
+        older-msg (second (drop-while #(not (u/msg-eq selected-message %)) (reverse messages)))]
     (swap! cmp-state assoc :selected-message older-msg)))

 (defn handle-probe-error


[clojure] Prevent refresh if the dev system is running

--- etc/repl.clj
+++ etc/repl.clj
@@ -21,10 +21,6 @@
   (ns.repl/disable-reload! *ns*)
   (ns.repl/set-refresh-dirs "src" "test")
   (help))
-
-(def ^{:doc "Refresh changed namespaces"}  refresh ns.repl/refresh)
-(def ^{:doc "Refresh everything"}  refresh-all ns.repl/refresh-all)
-(def ^{:doc "Pretty pretint a thing"} pp clojure.pprint/pprint)

 (defn list-ns
   "Return list of symbols of namespaces found in src dir"
@@ -113,4 +109,25 @@
   (let [sys (sys)]
     (get sys component-name)))

+(defn safe-to-refresh? []
+(or (empty? @system-status)
+    (= #{false} (-> @system-status vals set))))
+
+(defn  refresh
+  "Refresh changed namespaces"
+  []
+  (if (safe-to-refresh?)
+    (ns.repl/refresh)
+    ::system-running!))
+
+(defn refresh-all
+  "Refresh everything"
+  []
+  (if (safe-to-refresh?)
+    (ns.repl/refresh-all)
+    ::system-running!))
+
+(def ^{:doc "Pretty pretint a thing"} pp clojure.pprint/pprint)
+
+
 (init!)


add some parse- functions

add some parse- functions

--- clojure/src/usedbooks_search/core.clj
+++ clojure/src/usedbooks_search/core.clj
@@ -55,9 +55,38 @@
 (defn fetch-url [url]
   (html/html-resource (java.net.URL. url)))

+(defn parse-titles [q]
+  (html/select
+    (fetch-url (usedstore-url "jongno"
+                              (encode-aladin-query q)))
+    [:a.bo_l :b]))
+
+(defn parse-each-prices [q]
+  (html/select
+    (fetch-url (usedstore-url "jongno"
+                              (encode-aladin-query q)))
+    [:span.ss_p2]))
+
+(defn parse-each-nbooks [q]
+  (html/select
+    (fetch-url (usedstore-url "jongno"
+                              (encode-aladin-query q)))
+    [:span.ss_p4]))
+
+(defn parse-total-nbooks [q]
+  (html/select
+    (fetch-url (usedstore-url "jongno"
+                              (encode-aladin-query q)))
+    [:span.ss_f_g_l]))
+
+(defn find-total-nbooks [q]
+  (let [result
+        (first (:content (first (parse-total-nbooks q))))]
+    (if (nil? result)
+      0
+      result)))
+
 (defn -main [& args]
   (if (= (count args) 0)
     (println "USAGE: usedbooks-search <query-string>")
-    (println
-      (fetch-url (usedstore-url "jongno"
-                                (encode-aladin-query (first args)))))))
+    (println (find-total-nbooks (first args)))))


Version 0.4.13

Version 0.4.13

--- components/timbre-logstash/project.clj
+++ components/timbre-logstash/project.clj
@@ -1,4 +1,4 @@
-(defproject gorillalabs.tesla/timbre-logstash "0.4.13-SNAPSHOT"
+(defproject gorillalabs.tesla/timbre-logstash "0.4.13"
             :plugins [[lein-modules "0.3.11"]]
             :modules {:parent "../.."}
             :description "A logastash component"


[#1142] Remove println

[#1142] Remove println

--- backend/src/akvo/lumen/lib/visualisation/map_config.clj
+++ backend/src/akvo/lumen/lib/visualisation/map_config.clj
@@ -72,7 +72,6 @@
           (layer-point-color layer-index)))

 (defn cartocss [layer layer-index metadata-array]
-  (println "FOO " (get layer "layerType"))
   (cond
     (and (get layer "aggregationDataset")(get layer "aggregationColumn")(get layer "aggregationGeomColumn"))
     (shape-aggregation-cartocss layer-index)


Use a private keyword in the ex-data to control if operations need to be logged

This requires that the code using track maintain the exception cause chain, which is reasonable. The prior
approach, which involved a mutable map keyed on thread, did not work with core.async go blocks.


Add 'none' color constant.

Add 'none' color constant.

--- src/org/playasophy/wonderdome/util/color.clj
+++ src/org/playasophy/wonderdome/util/color.clj
@@ -6,6 +6,9 @@

 ; TODO: use deftypes instead of vectors with metadata and protocols instead of multimethods
 ; should be much higher performance
+
+(def none 0)
+

 ;;;;; HELPER FUNCTIONS ;;;;;


Make grayscale color constructor a separate function.

--- src/org/playasophy/wonderdome/util/color.clj
+++ src/org/playasophy/wonderdome/util/color.clj
@@ -17,10 +17,14 @@
 (defn rgb
   "Creates a color value from red, green, and blue component channels. Each
   component should be a number from [0.0, 1.0]."
-  ([v]
-   (rgb v v v))
-  ([r g b]
-   (.getRGB (Color. (float r) (float g) (float b)))))
+  [r g b]
+  (.getRGB (Color. (float r) (float g) (float b))))
+
+
+(defn gray
+  "Creates a grayscale color by using the same value for every color channel."
+  [v]
+  (rgb v v v))

 (defn rgb-components


Cleanup Bookie cookie deletion

Cleanup Bookie cookie deletion

--- src/onyx/state/bookkeeper.clj
+++ src/onyx/state/bookkeeper.clj
@@ -43,13 +43,12 @@
           server (try (BookieServer. server-conf)
                       (catch Exception e
                         (if (instance? KeeperException$NodeExistsException (.getCause e))
-                          (do (println "Deleting existing Bookie cookie")
-                              (if-let [cookie-path (format "%s/cookies/%s"
-                                                           ledgers-root-path
-                                                           (Bookie/getBookieAddress server-conf))]
-                                (do (zk/delete (:conn log) cookie-path)
-                                    (BookieServer. server-conf))
-                                (throw e)))
+                          (let [cookie-path (format "%s/cookies/%s"
+                                                    ledgers-root-path
+                                                    (Bookie/getBookieAddress server-conf))]
+                            (info "Deleting existing Bookie cookie" cookie-path)
+                            (zk/delete (:conn log) cookie-path)
+                            (BookieServer. server-conf))
                           (throw e))))]
       (info "Starting BookKeeper server on port" port)
       (.start server)


[#10044] Responsive new chat input

[#10044] Responsive new chat input

--- src/status_im/ui/screens/add_new/styles.cljs
+++ src/status_im/ui/screens/add_new/styles.cljs
@@ -27,8 +27,9 @@
    :height             52})

 (styles/def input
-  {:padding-horizontal 14
+  {:flex               1
+   :padding-horizontal 14
    :desktop            {:height 30
                         :width  "100%"}
    :android            {:padding 0
-                        :width  "100%"}})
+                        :width   "100%"}})


add % completed println messages when *verbose-overtone-file-helpers* is bound to true

--- src/overtone/helpers/file.clj
+++ src/overtone/helpers/file.clj
@@ -167,6 +167,44 @@
         con (.openConnection url)]
     (.getContentLength con)))

+(defn- percentage-slices
+  "Returns a seq of maps of length num-slices where each map represents the
+  percentage and the associated percentage of size
+
+  usage:
+  (percentage-slices 1000 2) ;=> ({:perc 50N, :val 500N} {:perc 100, :val 1000})"
+  [size num-slices]
+  (map (fn [slice]
+         (let [perc (/ (inc slice) num-slices)]
+           {:perc (* 100 perc)
+            :val  (* size perc)}))
+       (range num-slices)))
+
+(defn- print-file-copy-status
+  "Print copy status in percentage - granularity times - evenly as
+  num-copied-bytes approaches file-size"
+  [num-copied-bytes buf-size file-size slices]
+  (let [min    num-copied-bytes
+        max    (+ buf-size num-copied-bytes)]
+    (when-let [slice (some (fn [slice]
+                             (when (and (> (:val slice) min)
+                                        (< (:val slice) max))
+                               slice))
+                           slices)]
+      (println (str (:perc slice) "% completed")))))
+
+(defn remote-file-copy [in-stream out-stream file-size]
+  (let [buf-size 2048
+        buffer   (make-array Byte/TYPE buf-size)
+        slices   (percentage-slices file-size 100)]
+    (loop [bytes-copied 0]
+      (let [size (.read in-stream buffer)]
+        (when *verbose-overtone-file-helpers*
+          (print-file-copy-status bytes-copied size file-size slices))
+        (when (pos? size)
+          (do (.write out-stream buffer 0 size)
+              (recur (+ size bytes-copied))))))))
+
 (defn- download-file-without-timeout
   "Downloads remote file at url to local file specified by target path. Has
   potential to block current thread whilst reading data from remote host. See
@@ -185,24 +223,26 @@
   java.net.SocketTimeoutException"
   [url target-path timeout]
   (let [target-path (resolve-tilde-path target-path)
-        url (URL. url)
-        con  (.openConnection url)]
+        size        (remote-file-size url)
+        url         (URL. url)
+        con         (.openConnection url)]
     (.setReadTimeout con timeout)
     (with-open [in (.getInputStream con)
                 out (output-stream target-path)]
-      (copy in out))
+      (remote-file-copy in out size))
     target-path))

 (defn get-file-with-timeout
   "Returns a stringified version of the file pointed to by url. If download
   stalls for more than timeout ms an exception is thrown."
   [url timeout]
-  (let [url (URL. url)
-        con  (.openConnection url)]
+  (let [url  (URL. url)
+        con  (.openConnection url)
+        size (remote-file-size url)]
     (.setReadTimeout con timeout)
     (with-open [in (.getInputStream con)
                 out (StringWriter.)]
-      (copy in out)
+      (copy in out size)
       (.toString out))))

 (defn file-size
@@ -313,9 +353,11 @@
      (let [path (resolve-tilde-path path)]
        (try
          (download-file-with-timeout url path timeout)
-         (catch java.io.IOException e
+         (catch java.net.SocketTimeoutException e
            (rm-rf! path)
            (Thread/sleep wait-t)
+           (when *verbose-overtone-file-helpers*
+             (println "Download timed out. Retrying:" url ))
            (download-file* url path timeout n-retries wait-t (inc attempts-made)))))))

 (defn- print-download-file


Fix bug in clear-ids

Fix bug in clear-ids

--- src/overtone/sc/allocator.clj
+++ src/overtone/sc/allocator.clj
@@ -11,13 +11,13 @@
 ;; free a synth.)

 (defn mk-bitset [size]
-  (ref (vec (repeat size false))))
+  (vec (repeat size false)))

 (defonce allocator-bits
-  {:node         (mk-bitset MAX-NODES)
-   :audio-buffer (mk-bitset MAX-BUFFERS)
-   :audio-bus    (mk-bitset MAX-NODES)
-   :control-bus  (mk-bitset MAX-NODES)})
+  {:node         (ref (mk-bitset MAX-NODES))
+   :audio-buffer (ref (mk-bitset MAX-BUFFERS))
+   :audio-bus    (ref (mk-bitset MAX-NODES))
+   :control-bus  (ref (mk-bitset MAX-NODES))})

 (defonce allocator-limits
   {:node         MAX-NODES
@@ -85,11 +85,13 @@
 (defonce _root-group_ (alloc-id :node))

 (defn free-id
-  "Free the id of type key. Takes an optional action-fn which it will evaluate
-  in transaction with the freeing of the id. Therefore there is no possibility
-  of interleaving concurrent freeing of ids and execution of associated
-  action-fns. Execution of action-fn is also synchronised with the execution of
-  alloc-id action-fns."
+  "Free the ID of type key. Takes an optional action-fn which it will evaluate
+  in transaction with the freeing of the id. (Evaluation happens within an agent
+  so there's no need to worry about the transaction retrying multiple times).
+  Therefore there is no possibility of interleaving concurrent freeing of ids
+  and execution of associated action-fns. Execution of action-fn is also
+  synchronised with the execution of alloc-id action-fns (they all use the same
+  agent)."
   ([k id] (free-id k id 1 nil))
   ([k id size] (free-id k id size nil))
   ([k id size action-fn]
@@ -102,7 +104,7 @@
 (defn clear-ids
   "Clear all ids allocated for key."
   [k]
-  (let [bits (get allocator-bits k)
+  (let [bits  (get allocator-bits k)
         limit (get allocator-limits k)]
     (dosync
      (ref-set bits (mk-bitset limit)))))


Fix bug in volume now studio* is a map

Fix bug in volume now studio* is a map

--- src/overtone/studio/mixer.clj
+++ src/overtone/studio/mixer.clj
@@ -152,7 +152,8 @@
   ([] (:master-volume @studio*))
   ([vol]
    (ctl (main-mixer-group) :master-volume vol)
-   (swap! studio* :master-volume vol)))
+   (swap! studio* assoc :master-volume vol)
+   vol))

 (defn input-gain
   "Set the input gain on the master mixer. When called with no params, retrieves
@@ -262,4 +263,3 @@
 (defn clear-instruments []
   "Clear all instruments from the session."
   (swap! studio* assoc :instruments {}))
-


Fix bug in recording functionality. Fixes #166

--- src/overtone/studio/mixer.clj
+++ src/overtone/studio/mixer.clj
@@ -154,8 +154,8 @@
   (let [path (resolve-tilde-path path)
         bs   (apply buffer-stream path args)
         rec  (master-recorder :target (foundation-monitor-group) bs)]
-    (swap! studio* :recorder {:rec-id rec
-                              :buf-stream bs})
+    (swap! studio* assoc :recorder {:rec-id rec
+                                    :buf-stream bs})
     :recording-started))

 (defn recording-stop


Updated tests based on review comments.

Updated tests based on review comments.

--- test/cmr/system_int_test/search/granule_platform_instrument_sensor_search_test.clj
+++ test/cmr/system_int_test/search/granule_platform_instrument_sensor_search_test.clj
@@ -12,6 +12,7 @@

 (deftest search-by-platform-short-names
   (let [p0 (dc/platform "platform_Inherit")
+        p01 (dc/platform "platform_ONE")
         p1 (dc/platform "platform_Sn A")
         p2 (dc/platform "platform_Sn a")
         p3 (dc/platform "platform_SnA")
@@ -20,14 +21,16 @@
         pr2 (dg/platform-ref "platform_Sn a")
         pr3 (dg/platform-ref "platform_SnA")
         pr4 (dg/platform-ref "platform_Snx")
+        pr5 (dg/platform-ref "platform_ONE")
         coll1 (d/ingest "CMR_PROV1" (dc/collection {:platforms [p1 p2 p3 p4]}))
-        coll2 (d/ingest "CMR_PROV1" (dc/collection {:platforms [p0]}))
+        coll2 (d/ingest "CMR_PROV1" (dc/collection {:platforms [p0 p01]}))
         gran1 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [pr1]}))
         gran2 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [pr1 pr2]}))
         gran3 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [pr2]}))
         gran4 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [pr3]}))
         gran5 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [pr4]}))
-        gran6 (d/ingest "CMR_PROV1" (dg/granule coll2 {}))]
+        gran6 (d/ingest "CMR_PROV1" (dg/granule coll2 {}))
+        gran7 (d/ingest "CMR_PROV1" (dg/granule coll2 {:platform-refs [pr5]}))]

     (index/flush-elastic-index)

@@ -69,16 +72,19 @@

 (deftest search-by-instrument-short-names
   (let [i0 (dc/instrument "instrument_Inherit")
-        p0 (dc/platform "collection_platform" i0)
+        i01 (dc/instrument "instrument_ONE")
+        p0 (dc/platform "collection_platform" i0 i01)
         i1 (dg/instrument-ref "instrument_Sn A")
         i2 (dg/instrument-ref "instrument_Sn a")
         i3 (dg/instrument-ref "instrument_SnA")
         i4 (dg/instrument-ref "instrument_Snx")
+        i5 (dg/instrument-ref "instrument_ONE")
         pr1 (dg/platform-ref "platform_1" i1)
         pr2 (dg/platform-ref "platform_2" i2)
         pr3 (dg/platform-ref "platform_3" i3)
         pr4 (dg/platform-ref "platform_4" i4)
         pr5 (dg/platform-ref "platform_5" i1 i2)
+        pr6 (dg/platform-ref "platform_6" i5)
         coll1 (d/ingest "CMR_PROV1" (dc/collection {}))
         coll2 (d/ingest "CMR_PROV1" (dc/collection {:platforms [p0]}))
         gran1 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [pr1]}))
@@ -87,7 +93,8 @@
         gran4 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [pr3]}))
         gran5 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [pr4]}))
         gran6 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [pr5]}))
-        gran7 (d/ingest "CMR_PROV1" (dg/granule coll2 {}))]
+        gran7 (d/ingest "CMR_PROV1" (dg/granule coll2 {}))
+        gran8 (d/ingest "CMR_PROV1" (dg/granule coll2 {:platform-refs [pr6]}))]

     (index/flush-elastic-index)

@@ -129,23 +136,27 @@

 (deftest search-by-sensor-short-names
   (let [s0 (dc/sensor "sensor_Inherit")
-        i0 (dc/instrument "collection_instrument" s0)
+        s01 (dc/sensor "sensor_ONE")
+        i0 (dc/instrument "collection_instrument" s0 s01)
         p0 (dc/platform "collection_platform" i0)
         s1 (dg/sensor-ref "sensor_Sn A")
         s2 (dg/sensor-ref "sensor_Sn a")
         s3 (dg/sensor-ref "sensor_SnA")
         s4 (dg/sensor-ref "sensor_Snx")
+        s5 (dg/sensor-ref "sensor_ONE")
         i1 (dg/instrument-ref "instrument_1" s1)
         i2 (dg/instrument-ref "instrument_2" s2)
         i3 (dg/instrument-ref "instrument_3" s3)
         i4 (dg/instrument-ref "instrument_4" s4)
         i5 (dg/instrument-ref "instrument_5" s1 s2)
+        i6 (dg/instrument-ref "instrument_6" s5)
         p1 (dg/platform-ref "platform_1" i1)
         p2 (dg/platform-ref "platform_2" i2)
         p3 (dg/platform-ref "platform_3" i3)
         p4 (dg/platform-ref "platform_4" i4)
         p5 (dg/platform-ref "platform_5" i5)
         p6 (dg/platform-ref "platform_6" i1 i2)
+        p7 (dg/platform-ref "platform_7" i6)
         coll1 (d/ingest "CMR_PROV1" (dc/collection {}))
         coll2 (d/ingest "CMR_PROV1" (dc/collection {:platforms [p0]}))
         gran1 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [p1]}))
@@ -155,7 +166,8 @@
         gran5 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [p4]}))
         gran6 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [p5]}))
         gran7 (d/ingest "CMR_PROV1" (dg/granule coll1 {:platform-refs [p6]}))
-        gran8 (d/ingest "CMR_PROV1" (dg/granule coll2 {}))]
+        gran8 (d/ingest "CMR_PROV1" (dg/granule coll2 {}))
+        gran9 (d/ingest "CMR_PROV1" (dg/granule coll2 {:platform-refs [p7]}))]

     (index/flush-elastic-index)


A working swap.clj.

A working swap.clj.

--- swap.clj
+++ swap.clj
@@ -1,14 +1,15 @@
 ;; swap! already exists in Clojure
 (defmacro my-swap! [x y]
-  `(let [tmp# ~x]
-     (set! ~x ~y)
-     (set! ~y tmp#)))
+  `(dosync
+    (let [tmp# @~x]
+      (ref-set ~x @~y)
+      (ref-set ~y tmp#))))

-;; Doesn't yet work because of Clojure's immutable-by-default behaviour
-;; http://stackoverflow.com/a/940946/509706
-(let [a 1 b 2]
-  (my-swap! a b)
-  (pr "a")
-  (pr a)
-  (pr "b")
-  (pr b))
+(def a (ref 1))
+(def b (ref 2))
+
+(my-swap! a b)
+(pr "a")
+(pr a)
+(pr "b")
+(pr b)


CMR-3279 fixes unit test

CMR-3279 fixes unit test

--- access-control-app/test/cmr/access_control/test/services/permitted_concept_id_search.clj
+++ access-control-app/test/cmr/access_control/test/services/permitted_concept_id_search.clj
@@ -41,7 +41,6 @@
                     :collection-access-value-max
                     1.0
                     1.0)
-                  (common-qm/boolean-condition :collection-identifier true)
                   (common-qm/boolean-condition :collection-applicable true)])]))))
     (testing "create permitted-concept-id conditions with access value nil"
       (is (= (pcs/get-permitted-concept-id-conditions (u/conn-context) concept-access-value-nil)
@@ -54,5 +53,4 @@
                (gc/group-conds
                  :and
                  [(common-qm/boolean-condition :collection-access-value-include-undefined-value true)
-                  (common-qm/boolean-condition :collection-identifier true)
                   (common-qm/boolean-condition :collection-applicable true)])]))))))


removing an unnecessary threading macro

removing an unnecessary threading macro

--- src/hu/ssh/github_changelog/github.clj
+++ src/hu/ssh/github_changelog/github.clj
@@ -14,6 +14,6 @@
   [config :- Config
    user :- s/Str
    repo :- s/Str]
-  (with-url (:github-api config)
-            (->> (pulls/pulls user repo (merge {:token (:token config), :all-pages true, :state "closed"}))
-                 (map #(assoc % :sha (pull-sha %))))))
+  (let [options {:token (:token config), :all-pages true, :state "closed"}]
+    (with-url (:github-api config)
+              (map #(assoc % :sha (pull-sha %)) (pulls/pulls user repo options)))))


Optimize JavaScript minification to not wrap the handler when not enabled

--- src/io/aviso/twixt/js_minification.clj
+++ src/io/aviso/twixt/js_minification.clj
@@ -45,17 +45,15 @@
   "Identifies JavaScript assets and, if not aggregating, passes them through the Google Closure compiler."
   [asset-handler :- AssetHandler
    {:keys [development-mode js-optimizations]}]
-  (fn [asset-path {:keys [for-aggregation] :as context}]
-    (let [{:keys [content-type] :as asset} (asset-handler asset-path context)]
-      (if (and (= "text/javascript" content-type)
-               (not for-aggregation))
-        (case js-optimizations
-          :none asset
-          :default (if development-mode
-                     ;; Do nothing by default in development mode
-                       asset
-                       ;; Otherwise default to :simple in production mode
-                       (minimize-javascript-asset asset (optimization-levels :simple)))
-          ;; Use the provided level if it's set and not :none
-          (minimize-javascript-asset asset (optimization-levels js-optimizations)))
-        asset))))+  (let [js-optimizations' (if (= :default js-optimizations)
+                           (if development-mode :none :simple)
+                           js-optimizations)
+        level (optimization-levels js-optimizations')]
+    (if (nil? level)
+      asset-handler
+      (fn [asset-path {:keys [for-aggregation] :as context}]
+        (let [{:keys [content-type] :as asset} (asset-handler asset-path context)]
+          (if (and (= "text/javascript" content-type)
+                   (not for-aggregation))
+            (minimize-javascript-asset asset level)
+            asset))))))


PDOK-1599: callback addded

PDOK-1599: callback addded

--- src/main/clojure/pdok/featured/api.clj
+++ src/main/clojure/pdok/featured/api.clj
@@ -13,6 +13,7 @@
             [pdok.featured
              [config :as config]
              [processor :as processor :refer [consume shutdown]]
+             [extracts :as extracts]
              [json-reader :as reader]]
             [ring.middleware.defaults :refer :all]
             [ring.middleware.json :refer :all]
@@ -76,7 +77,17 @@
   )

 (defn- extract* [callback-chan request]
-  (log/info "Processing extract: " request))
+  (log/info "Processing extract: " request)
+
+  (try (extracts/fill-extract (:dataset request) (:collection request) (:extractType request) (:extractVersion request))
+    (let [extract-stats (assoc request :status "ok")]
+       (when (:callback request)
+         (go (>! callback-chan [(:callback request) extract-stats]))))
+    (catch Exception e
+      (let [error-stats (assoc request :error (str e))]
+        (log/warn error-stats)
+        (when (:callback request)
+          (go (>! callback-chan [(:callback request) error-stats])))))))

 (defn- process-request [schema request-chan http-req]
   (let [request (:body http-req)


(maint) Reorder requires in request_handler_core_test

--- test/unit/puppetlabs/services/request_handler/request_handler_core_test.clj
+++ test/unit/puppetlabs/services/request_handler/request_handler_core_test.clj
@@ -1,13 +1,13 @@
 (ns puppetlabs.services.request-handler.request-handler-core-test
   (:import (java.io StringReader ByteArrayInputStream))
-  (:require [puppetlabs.services.request-handler.request-handler-core :as core]
+  (:require [clojure.test :refer :all]
+            [slingshot.test :refer :all]
+            [ring.util.codec :as ring-codec]
+            [puppetlabs.services.request-handler.request-handler-core :as core]
             [puppetlabs.ssl-utils.core :as ssl-utils]
             [puppetlabs.ssl-utils.simple :as ssl-simple]
             [puppetlabs.puppetserver.certificate-authority :as cert-authority]
             [puppetlabs.trapperkeeper.testutils.logging :as logutils]
-            [clojure.test :refer :all]
-            [ring.util.codec :as ring-codec]
-            [slingshot.test :refer :all]
             [puppetlabs.services.protocols.jruby-puppet :as jruby-protocol]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Add defspec macro tests

Add defspec macro tests

--- src/test/clojure/clojure/test/check/test.clj
+++ src/test/clojure/clojure/test/check/test.clj
@@ -500,3 +500,17 @@
 (defspec shuffled-vector-is-a-permutation-of-original 100
   (prop/for-all [[coll permutation] original-vector-and-permutation]
                 (= (sort coll) (sort permutation))))
+
+;; defspec macro
+;; ---------------------------------------------------------------------------
+
+(defspec run-only-once 1 (prop/for-all* [gen/int] (constantly true)))
+
+(defspec run-default-times (prop/for-all* [gen/int] (constantly true)))
+
+(defspec run-with-map {:num-tests 1} (prop/for-all* [gen/int] (constantly true)))
+
+(defspec run-with-map {:num-tests 1
+                       :seed 1}
+  (prop/for-all [a gen/int]
+                (= a 0)))


Updated condition

Updated condition

--- src/riemann/transport/tcp.clj
+++ src/riemann/transport/tcp.clj
@@ -84,11 +84,14 @@
          (.equals (System/getProperty "netty.epoll.enabled" "true") "true"))
        {:event-loop-group-fn #(EpollEventLoopGroup.)
          :channel EpollServerSocketChannel}
-    (or (and (.contains (. System getProperty "os.name") "mac") (.contains (. System getProperty "os.arch") "x86_64"))
-        (and (.contains (. System getProperty "os.name") "freebsd") (.contains (. System getProperty "os.arch") "amd64"))
-      (and (.equals (System/getProperty "netty.kqueue.enabled" "true") "true")))
-        {:event-loop-group-fn #(KQueueEventLoopGroup.)
-          :channel KQueueServerSocketChannel}
+    (and
+      (or (and (.contains (. System getProperty "os.name") "mac")
+               (.contains (. System getProperty "os.arch") "x86_64"))
+          (and (.contains (. System getProperty "os.name") "freebsd")
+               (.contains (. System getProperty "os.arch") "amd64")))
+      (.equals (System/getProperty "netty.kqueue.enabled" "true") "true"))
+       {:event-loop-group-fn #(KQueueEventLoopGroup.)
+         :channel KQueueServerSocketChannel}
     :else
        {:event-loop-group-fn #(NioEventLoopGroup.)
           :channel NioServerSocketChannel}))


Adapt to PR review

Adapt to PR review

--- backend/src/akvo/lumen/lib/auth.clj
+++ backend/src/akvo/lumen/lib/auth.clj
@@ -90,18 +90,20 @@
 (defn ids [spec data]
   (let [ids (atom {:dataset-ids #{}
                    :visualisation-ids #{}})
+        original-vis-id? visualisation.s/*id?*
+        original-ds-id? dataset.s/*id?*
         ds-fun (fn [id]
                  (swap! ids update :dataset-ids conj id)
                  (try
-                   (lumen.s/str-uuid? id)
+                   (original-vis-id? id)
                    (catch Exception e false)))
         vis-fun (fn [id]
                   (swap! ids update :visualisation-ids conj id)
                   (try
-                    (lumen.s/str-uuid? id)
+                    (original-ds-id? id)
                     (catch Exception e false)))]
     (binding [visualisation.s/*id?* vis-fun
               dataset.s/*id?* ds-fun]
       (let [explain (s/explain-str spec data)]
-        (swap! ids assoc :spec-valid? (= "Success!\n" explain))
+        (swap! ids assoc :spec-valid? (s/valid? spec data))
         (deref ids)))))


adds indentation to classes

adds indentation to classes

--- compiler/src/clojure/ruby/emitter.clj
+++ compiler/src/clojure/ruby/emitter.clj
@@ -3,6 +3,15 @@
             [clojure.tools.analyzer.utils :refer [resolve-var]]
             [clojure.ruby.runtime         :refer [var->constant lookup-var-in-module]]
             [clojure.ruby.util            :refer :all]))
+
+(defn- endl-separate [exprs]
+  (clojure.string/join "\n" exprs))
+
+(defn- indent [s]
+  (endl-separate
+    (map
+      #(str "  " %)
+      (clojure.string/split s #"\n"))))

 (defn- comma-separate [exprs]
   (clojure.string/join ", " exprs))
@@ -15,16 +24,6 @@

 (defn- wrap-quotes [s]
   (format "\"%s\"" s))
-
-(defn- endl-separate [exprs]
-  (clojure.string/join "\n" exprs))
-
-(defn- module-eval [ns body]
-  (if (and ns (not= 'user ns) (not= "" body))
-    (format "%s.module_eval do\n%s\nend"
-            (namespace->module (name ns))
-            body)
-    body))

 (defmulti -emit (fn [{:keys [op] :as ast}] op))

@@ -44,13 +43,15 @@
   (let [arg-names (map :name fields)
         arglist (clojure.string/join ", " arg-names)
         ivar   #(format "@%s = %s" % %)
+        ivars (endl-separate (map ivar arg-names))
         attr-reader #(format "attr_reader :%s" %)
-        ivars  (endl-separate (map ivar arg-names))
         attr-readers (endl-separate (map attr-reader arg-names))
-        constructor (format "def initialize(%s)\n%s\nend" arglist ivars)
-        body (endl-separate [attr-readers constructor])
-        module (namespace->module (clojure.core/name ns))]
-    (format "%s.const_set(\"%s\", Class.new do\n%s\nend)" module name body)))
+        constructor (format "def initialize(%s)\n%s\nend" arglist (indent ivars))
+        body (endl-separate [attr-readers constructor])]
+    (format "%s.const_set(\"%s\", Class.new do\n%s\nend)"
+            (namespace->module (clojure.core/name ns))
+            name
+            (indent body))))

 (defmethod -emit :deftype [{:keys [name fields methods interfaces env] :as ast}]
   (emit-type (:ns env) name fields interfaces methods))
@@ -73,7 +74,9 @@
   (format "%s.const_set(\"%s\", Class.new do\n%s\nend.new)"
           (namespace->module (name (:ns env)))
           (clojure.string/upper-case (name (gensym "fn")))
-          (format "def invoke(*args)\n%s\nend" (-emit (first methods)))))
+          (indent
+            (format "def invoke(*args)\n%s\nend"
+                    (indent (-emit (first methods)))))))

 (defmethod -emit :local [{:keys [name] :as ast}]
   (str name))
@@ -100,10 +103,15 @@
           (comma-separate (map -emit args))))

 (defmethod -emit :if [{:keys [test then else] :as ast}]
-  (format "if %s\n%s\nelse\n%s\nend"
-          (-emit test)
-          (-emit then)
-          (-emit else)))
+  (let [else-expr (-emit else)]
+    (if (= "" else-expr)
+      (format "if %s\n%s\nend"
+              (-emit test)
+              (indent (-emit then)))
+      (format "if %s\n%s\nelse\n%s\nend"
+              (-emit test)
+              (indent (-emit then))
+              (indent else-expr)))))

 (defmethod -emit :do [{:keys [statements ret env] :as ast}]
   (endl-separate (map -emit (conj (vec statements) ret))))
@@ -147,19 +155,5 @@
 (defmethod -emit :in-ns [{:keys [name]}]
   (emit-module-declaration (clojure.core/name name)))

-(defn- wrap-emit-in-module-eval [emitter]
-  (fn [{:keys [op env] :as ast}]
-    (let [body (emitter ast)]
-      (if (= op :create-ns)
-        body
-        (module-eval (:ns env) body)))))
-
-(defn- wrap-emit-source-comment [emitter]
-  (fn [{:keys [form] :as ast}]
-    (format "# %s\n%s" form (emitter ast))))
-
-(def emitter (-> -emit
-               wrap-emit-source-comment))
-
 (defn emit [ast]
-  (emitter ast))
+  (-emit ast))


started work on sessions

started work on sessions

--- src-clj/mappt/server/routes.clj
+++ src-clj/mappt/server/routes.clj
@@ -1,5 +1,6 @@
 (ns mappt.server.routes
   (:use compojure.core
+        ring.middleware.session
         ring.middleware.edn
         mappt.server.views
         [hiccup.middleware :only (wrap-base-url)])
@@ -23,4 +24,5 @@
   (-> (handler/site main-routes)
       wrap-exceptions
       wrap-edn-params
+      (wrap-session)
       (wrap-base-url)))


Update ocp files for dependencies

Update ocp files for dependencies

--- src_ext/depends.ocp.boot
+++ src_ext/depends.ocp.boot
@@ -40,12 +40,31 @@
 end

 begin library "re_perl"
-  sort = true
   files = [
      "ocaml-re/lib/re_perl.ml"
+  ]
+  requires = [ "re" ]
+end
+
+begin library "re_pcre"
+  files = [
      "ocaml-re/lib/re_pcre.ml"
   ]
-  requires = [ "re" ]
+  requires = [ "re" "re_perl" ]
+end
+
+begin library "re_emacs"
+  files = [
+     "ocaml-re/lib/re_emacs.ml"
+  ]
+  requires = [ "re"  ]
+end
+
+begin library "re_str"
+  files = [
+     "ocaml-re/lib/re_str.ml"
+  ]
+  requires = [ "re" "re_emacs"  ]
 end

 begin library "re_glob"
@@ -180,6 +199,7 @@

    requires = [
      "re_perl"
+     "re_pcre"
      "extlib"
      "cudf"
      "graph"


intention revealing names, default ns for vars-meta

--- user.clj
+++ user.clj
@@ -43,22 +43,16 @@
   (sort (distinct (map #(.getName %) (seq (.getMethods klass))))))

 ; mtable 'doc
-(defn mtable "Prints meta of a function as a table" [sym]
+(defn var-meta "Prints meta of a symbol" [sym]
   (table.core/table (meta (resolve sym))))

-(defn dir-mtable "Prints public vars for a namespace with its meta info" [nsname]
-  (table.core/table (map #( meta (resolve %)) (clojure.repl/dir-fn nsname))))
+(defn vars-meta "Prints public vars for a namespace with its meta info"
+  ([] (vars-meta *ns*))
+  ([nsname]
+    (table.core/table (map #( meta (resolve %)) (clojure.repl/dir-fn nsname)))))

-(defn class-path "Prints list of class paths" []
-  (pp/pprint  (seq  (.getURLs  (java.lang.ClassLoader/getSystemClassLoader)))))
-
-(defn properties "List properties and their values" []
-  (table.core/table
-    (->> (System/getProperties) .stringPropertyNames
-      (reduce #(assoc %1 %2 (System/getProperty %2)) {}))))
-
-(defn dvtable
-  "dynamic vars for a namespace mapped to their values"
+(defn vars-values
+  "Prints dynamic vars for a namespace mapped to their values"
    [& options]
    (let [opts (apply hash-map options)]
      (apply
@@ -69,6 +63,14 @@
        :sort true
        options)))

+(defn class-paths "Prints list of class paths" []
+  (pp/pprint (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader)))))
+
+(defn properties "List properties and their values" []
+  (table.core/table
+    (->> (System/getProperties) .stringPropertyNames
+      (reduce #(assoc %1 %2 (System/getProperty %2)) {}))))
+
 (defn envs "List of envs and their values" []
   (->> (System/getenv) keys (reduce #(assoc %1 %2 (System/getenv %2)) {}) table.core/table))


don't expect util to know about parsing values

--- test/clj_money/x_platform/util_test.clj
+++ test/clj_money/x_platform/util_test.clj
@@ -42,7 +42,9 @@
     (is (= {:names ["john" "jane"]}
            (query-string->map "names[]=john&names[]=jane"))))
   (testing "a deep nested map"
-    (is (= {:criteria {:transaction-date [:between (t/local-date 2018 2 27) (t/local-date 2018 3 2)]}
-            :options {:sort [:transaction-date :desc]
-                      :limit 50}}
-           (query-string->map "criteria[transaction-date][]=between&criteria[transaction-date][]=2018-02-27&criteria[transaction-date][]=2018-03-02&options[sort][]=transaction-date&options[sort][]=desc&options[limit]=50")))))
+    (let [expected {:criteria {:transaction-date ["between" "2018-02-27" "2018-03-02"]}
+                    :options {:sort ["transaction-date" "desc"]
+                              :limit "50"}}
+          actual (query-string->map "criteria[transaction-date][]=between&criteria[transaction-date][]=2018-02-27&criteria[transaction-date][]=2018-03-02&options[sort][]=transaction-date&options[sort][]=desc&options[limit]=50")]
+      (pprint-diff expected actual)
+      (is (= expected actual)))))


enable links for types page

enable links for types page

--- pedestal-app/app/src/semtag_web/rendering.cljs
+++ pedestal-app/app/src/semtag_web/rendering.cljs
@@ -142,7 +142,7 @@

 ;;; Other pages
 ;;;
-(defn render-types-results [_ [_ _ _ new-value] _]
+(defn render-types-results [_ [_ _ _ new-value] input-queue]
   (dom/set-html!
     (dom/by-id "content")
     (p/generate-table "type_stats_table" (:results new-value)
@@ -150,7 +150,8 @@
                                        (get-in new-value [:counts :thing])
                                        (get-in new-value [:counts :tags]))
                       :row-partial p/type-stats-row
-                      :fields [:name :count :name-percent :url-percent])))
+                      :fields [:name :count :name-percent :url-percent]))
+  (enable-clickable-links-on "#type_stats_table" input-queue))

 (defn render-tag-stats-results [_ [_ _ _ new-value] input-queue]
   (dom/set-html!


fix(svg): fix #56, update filter-attribs

--- src/thi/ng/geom/svg/core.cljc
+++ src/thi/ng/geom/svg/core.cljc
@@ -1,5 +1,6 @@
 (ns thi.ng.geom.svg.core
   (:require
+   [clojure.string :refer [starts-with?]]
    [thi.ng.math.core :as m]
    [thi.ng.geom.core :as g]
    [thi.ng.geom.utils :as gu]
@@ -134,7 +135,9 @@
   (loop [acc (transient attribs), ks (keys attribs)]
     (if ks
       (recur
-       (if (= "__" (subs (name (first ks)) 0 2)) (dissoc! acc (first ks)) acc)
+       (if (starts-with? (name (first ks)) "__")
+         (dissoc! acc (first ks))
+         acc)
        (next ks))
       (persistent! acc))))


fix(viz): re-add fix #47 lin-tick-marks zero check

--- src/thi/ng/geom/viz/core.cljc
+++ src/thi/ng/geom/viz/core.cljc
@@ -340,9 +340,11 @@

 (defn lin-tick-marks
   [[d1 d2] delta]
-  (let [dr (- d2 d1)
-        d1' (m/roundto d1 delta)]
-    (filter #(m/in-range? d1 d2 %) (range d1' (+ d2 delta) delta))))
+  (if (m/delta= delta 0.0 m/*eps*)
+    '()
+    (let [dr (- d2 d1)
+          d1' (m/roundto d1 delta)]
+      (filter #(m/in-range? d1 d2 %) (range d1' (+ d2 delta) delta)))))

 (defn linear-axis
   [{:keys [domain range major minor] :as spec}]


working for one user, need to get it to create maps for every user

--- src/trend_compliance/core.clj
+++ src/trend_compliance/core.clj
@@ -34,36 +34,55 @@
   [item]
   (filter (every-pred windows? ping-successful? trend-installed?) item))

-(def user-map (atom {}))
+(def log-map (atom {}))

-(defn line-to-map
+(defn create-log-map
   "take a line from detail and put into map using an atom"
-  [line]
-  ;; (reset! state {})
-  (if (= (str (first line)) (re-find #"\w{3} \w{3} \d{2} \d{2}:\d{2}:\d{2} \d{4}" (str (first line))))
-    (swap! state assoc :date (str (first line)))
-    (swap! state assoc
-      (keyword (re-find #"(?x)\S+" (str (first line))))
-      (re-find #"[^\\\"]+" (str (second line))))))
+  [user-map]
+  (swap! log-map assoc (keyword (get user-map :Framed-IP-Address)) user-map))

 ;; (defn compare-ip
 ;;   "compare the ip held in log to the ips on compliance list"
 ;;   [ip-list]
 ;;   (first (filter #(= % (get @state :Framed-IP-Address)) ip-list)))

-;; (defn get-ip
-;;   "get the ip from map"
-;;   [item]
-;;   (get item :ip))
+(defn get-ip
+  "get the ip from map"
+  [item]
+  (get item :ip))
+
+(def user-map (atom {}))
+
+(defn create-user-map
+  "take a line from detail and put into map using an atom"
+  [line]
+  (if (= (str (first line)) (re-find #"\w{3} \w{3} \d{2} \d{2}:\d{2}:\d{2} \d{4}" (str (first line))))
+    (swap! user-map assoc :date (str (first line)))
+    (swap! user-map assoc
+      (keyword (re-find #"(?x)\S+" (str (first line))))
+      (re-find #"[^\\\"]+" (str (second line))))))
+
+(defn parse-line
+  "only keep important lines"
+  [line]
+  (cond
+    (re-matches #"(?i)\w{3} \w{3} \d{2} \d{2}:\d{2}:\d{2} \d{4}" (str (first line)))(create-user-map line)
+    (re-matches #"(?i)(.*)Acct-Session-Id" (str (first line)))(create-user-map line)
+    (re-matches #"(?i)(.*)Framed-IP-Address" (str (first line)))(create-user-map line)
+    (re-matches #"(?i)(.*)User-Name" (str (first line)))(create-user-map line)))
+
+(defn split-line
+  "parse each line of a large file"
+  [line]
+  (str/split line #" = "))

 (defn read-large-file
   "read in a large detail file"
-  [file-name ip-list]
+  [file-name]
   (with-open [rdr (io/reader file-name)]
-    (doseq [line (line-seq rdr)]
-      (if (empty? line)
-        (compare-ip ip-list)
-        (line-to-map (str/split line #" = "))))))
+    (let [line (line-seq rdr)]
+      (doall (map parse-line (doall (map split-line line))))
+    (doall (create-log-map @user-map)))))

 (defn read-csv
   "read in a csv file"
@@ -82,11 +101,5 @@
           detail (nth file-names 2)
           wired-ip-list (set (map get-ip (uncompliant-map (map create-map (read-csv wired)))))
           wireless-ip-list (set (map get-ip (uncompliant-map (map create-map (read-csv wireless)))))]
-          ;; wireless-ip-list (map get-ip wireless-list)
-          ;; matching-ip (read-large-file detail wireless-ip-list)]
-      ;; (println matching-ip)))
-      ;; (println wireless-ip-list)))
       (println "=============== Wired List: ===============")
-      (println wired-ip-list)
-      (println "\n=============== Wireless List: ===============")
-      (println wireless-ip-list)))
+      (println wired-ip-list)))


Fix passing a sort key fun to sort-by, make sure to sort children

--- src/web/components/nodes.cljs
+++ src/web/components/nodes.cljs
@@ -13,8 +13,7 @@
                            "work-item"
                            "tag"]
                       (:kind node)))]
-    (let [sort-key (juxt kind-index :name)]
-      (sort-by #(compare (sort-key %1) (sort-key %2)) nodes))))
+    (sort-by (juxt kind-index :title) nodes)))

 (declare node)

@@ -111,7 +110,7 @@
                   "Nothing has been tagged with this yet."
                   (map node-link (sort-nodes tagged)))))))
         (dom/div #js {:className "node-subnodes"}
-          (for [child children]
+          (for [child (sort-nodes children)]
             (node
               (om/computed child {:parent (om/props this)}))))))))


corrected diventare

corrected diventare

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -900,10 +900,9 @@

       "andare"

-      "diventare" {:italiano {:italiano "diventare"
-                :essere true
-                {:synsem {:cat :verb
-                          :sem {:pred :become}}}
+      "diventare" {:synsem {:essere true
+                            :cat :verb
+                            :sem {:pred :become}}}

       "divertirsi" (let [subject-semantics (atom {:human true})
                          subject-agr (atom :top)]