Verify results of 'newest-voom-ver-by-spec against 'get-voom-version

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -461,6 +461,8 @@

 (declare newest-voom-ver-by-spec)

+(def verify-newest? true)
+
 (defn print-repo-infos
   [repo-infos]
   (->> repo-infos
@@ -469,7 +471,9 @@
                   (dissoc :gitdir)
                   (update-in [:sha] #(subs (str % "--------") 0 7)))))
        (sort-by :ctime)
-       (print-table [:repo :path :proj :version :branch :ctime :sha]))
+       (print-table (-> [:repo :path :proj :version :branch :ctime :sha]
+                        (->/when verify-newest?
+                          (conj :verify)))))
   (newline))

 (defn fresh-version [repo-dbs [prj ver :as dep]]
@@ -477,14 +481,17 @@
     (let [voom-meta (merge {:allow-snaps false, :freshen true} voom-meta)]
       (if (not (:freshen voom-meta))
         dep
-        (let [groups (->> (newest-voom-ver-by-spec repo-dbs prj voom-meta)
+        (let [infos (newest-voom-ver-by-spec repo-dbs prj voom-meta)
+              groups (->> infos
                           (map #(assoc % :voom-ver (format-voom-ver %)))
                           (group-by :voom-ver))]
           (case (count groups)
             0 (do (println "No matching version found for:" prj
                            (pr-str voom-meta))
                   dep)
-            1 (assoc dep 1 (key (first groups)))
+            1 (do
+                (assert (contains? #{nil :ok} (:verify (first infos))))
+                (assoc dep 1 (first infos)))
             (do (print "\nMultiple bump resolutions for:"
                        prj (pr-str voom-meta))
                 (print-repo-infos (map #(first (val %)) groups))
@@ -615,7 +622,8 @@
               (sh "rm" "-rf" checkout))))

 (defn box-repo-add
-  [{:keys [repo gitdir branch sha proj path]}]
+  [{:keys [repo gitdir branch sha proj path verify]}]
+  (assert (contains? #{nil :ok} verify))
   (if-let [bdir (find-box)]
     (let [sha (str sha)
           pname (-> (str proj)
@@ -1119,7 +1127,13 @@
               candidates-g (remove #(seq (sha-successors shabam (:sha %) shas-f))
                                    candidates-f)]
         {:keys [sha ctime]} candidates-g]
-    {:sha sha
+    {:verify (when verify-newest?
+               (git {:gitdir gitdir} "checkout" (str sha))
+               (let [check-sha (sha/mk (:sha (get-voom-version found-path :gitdir gitdir)))]
+                 (if (= check-sha sha)
+                   :ok
+                   check-sha)))
+     :sha sha
      :ctime ctime
      :version max-ver-e
      :path found-path


[search] Make leaving the search page clear the search bar

--- src/braid/search/ui/search_bar.cljs
+++ src/braid/search/ui/search_bar.cljs
@@ -7,7 +7,13 @@

 (defn search-bar-view
   []
-  (r/with-let [search-query (r/atom @(subscribe [:braid.search/query]))]
+  (r/with-let [search-query (r/atom @(subscribe [:braid.search/query]))
+               prev-page (r/atom (:type @(subscribe [:page])))]
+    (let [current-page (:type @(subscribe [:page]))]
+      (when (not= @prev-page current-page)
+        (when (= @prev-page :search)
+          (reset! search-query ""))
+        (reset! prev-page current-page)))
     [:div.search-bar
      [:input {:type "text"
               :placeholder "Search..."


Revert "Fix extension parsing for paths with a dot in the directory - close #1755"

Reverted because it's causing a blank startup. More investigation required.
This reverts commit 5f8009cb3494dedd1e9ad171ee7b507ac4708d65.

--- src/lt/objs/files.cljs
+++ src/lt/objs/files.cljs
@@ -88,7 +88,9 @@
         (recur (rest parts) (conj acc (string/join "." parts)))))))

 (defn ext [path]
-  (.extname fpath path))
+  (let [i (.lastIndexOf path ".")]
+    (when (> i 0)
+      (subs path (inc i) (count path)))))

 (defn without-ext [path]
   (let [i (.lastIndexOf path ".")]


Staging banner copy

Staging banner copy

--- src/clj/clojuredocs/site/common.clj
+++ src/clj/clojuredocs/site/common.clj
@@ -95,7 +95,7 @@
     [:div.sticky-wrapper
      (when config/staging?
        [:div.staging-banner
-        "This is the ClojureDocs staging site, where you'll find all the neat things we're working on (don't link to here)."])
+        "This is the ClojureDocs staging site, where you'll find all the neat things we're working on. Please don't link to here."])
      ($navbar opts)
      [:div.container
       [:div.row


Remvoe staging don't link warning

Remvoe staging don't link warning

--- src/clj/clojuredocs/site/common.clj
+++ src/clj/clojuredocs/site/common.clj
@@ -98,7 +98,7 @@
     [:div.sticky-wrapper
      (when config/staging?
        [:div.staging-banner
-        "This is the ClojureDocs staging site, where you'll find all the neat things we're working on. Please don't link to here."])
+        "This is the ClojureDocs staging site, where you'll find all the neat things we're working on."])
      ($navbar opts)
      [:div.container
       [:div.row


Fix indentation

Fix indentation

--- src/cljs/asciinema_player/view.cljs
+++ src/cljs/asciinema_player/view.cljs
@@ -83,22 +83,22 @@

 (defn play-icon []
   [:svg {:version "1.1" :xmlns "http://www.w3.org/2000/svg" :view-box "0 0 12 12" :class-name "icon"}
-    [:path {:d "M1,0 L11,6 L1,12 Z"}]])
+   [:path {:d "M1,0 L11,6 L1,12 Z"}]])

 (defn pause-icon []
   [:svg {:version "1.1" :xmlns "http://www.w3.org/2000/svg" :view-box "0 0 12 12" :class-name "icon"}
-    [:path {:d "M1,0 L4,0 L4,12 L1,12 Z"}]
-    [:path {:d "M8,0 L11,0 L11,12 L8,12 Z"}]])
+   [:path {:d "M1,0 L4,0 L4,12 L1,12 Z"}]
+   [:path {:d "M8,0 L11,0 L11,12 L8,12 Z"}]])

 (defn expand-icon []
   [:svg {:version "1.1" :xmlns "http://www.w3.org/2000/svg" :view-box "0 0 12 12" :class-name "icon"}
-    [:path {:d "M12,0 L7,0 L9,2 L7,4 L8,5 L10,3 L12,5 Z"}]
-    [:path {:d "M0,12 L0,7 L2,9 L4,7 L5,8 L3,10 L5,12 Z"}]])
+   [:path {:d "M12,0 L7,0 L9,2 L7,4 L8,5 L10,3 L12,5 Z"}]
+   [:path {:d "M0,12 L0,7 L2,9 L4,7 L5,8 L3,10 L5,12 Z"}]])

 (defn shrink-icon []
   [:svg {:version "1.1" :xmlns "http://www.w3.org/2000/svg" :view-box "0 0 12 12" :class-name "icon"}
-    [:path {:d "M7,5 L7,0 L9,2 L11,0 L12,1 L10,3 L12,5 Z"}]
-    [:path {:d "M5,7 L0,7 L2,9 L0,11 L1,12 L3,10 L5,12 Z"}]])
+   [:path {:d "M7,5 L7,0 L9,2 L11,0 L12,1 L10,3 L12,5 Z"}]
+   [:path {:d "M5,7 L0,7 L2,9 L0,11 L1,12 L3,10 L5,12 Z"}]])

 (defn playback-control-button [playing? dispatch]
   (let [on-click (fn [e]
@@ -122,8 +122,8 @@

 (defn timer [current-time total-time]
   [:span.timer
-    [:span.time-elapsed (elapsed-time current-time)]
-    [:span.time-remaining (remaining-time current-time total-time)]])
+   [:span.time-elapsed (elapsed-time current-time)]
+   [:span.time-remaining (remaining-time current-time total-time)]])

 (defn fullscreen-toggle-button []
   (let [on-click (fn [e]
@@ -143,30 +143,30 @@
                               position (/ mouse-x bar-width)]
                           (dispatch [:seek position])))]
     [:span.progressbar
-      [:span.bar {:on-mouse-down on-mouse-down}
-        [:span.gutter
-          [:span {:style {:width (str (* 100 progress) "%")}}]]]]))
+     [:span.bar {:on-mouse-down on-mouse-down}
+      [:span.gutter
+       [:span {:style {:width (str (* 100 progress) "%")}}]]]]))

 (defn control-bar [playing? current-time total-time dispatch]
   [:div.control-bar
-    [playback-control-button playing? dispatch]
-    [timer current-time total-time]
-    [fullscreen-toggle-button]
-    [progress-bar (/ current-time total-time) dispatch]])
+   [playback-control-button playing? dispatch]
+   [timer current-time total-time]
+   [fullscreen-toggle-button]
+   [progress-bar (/ current-time total-time) dispatch]])

 (defn start-overlay [dispatch]
   (let [on-click (fn [e]
                    (.preventDefault e)
                    (dispatch [:toggle-play]))]
     [:div.start-prompt {:on-click on-click}
-      [:div.play-button
-        [:div
-          [:span
-            [logo-play-icon]]]]]))
+     [:div.play-button
+      [:div
+       [:span
+        [logo-play-icon]]]]]))

 (defn loading-overlay []
   [:div.loading
-    [:div.loader]])
+   [:div.loader]])

 (defn player-class-name [theme-name]
   (str "asciinema-theme-" theme-name))
@@ -211,8 +211,8 @@
         class-name (player-class-name theme)
         playing? (boolean stop)]
     [:div.asciinema-player-wrapper {:tab-index -1 :on-key-press on-key-press :on-key-down on-key-down}
-      [:div.asciinema-player {:class-name class-name :style (player-style)}
-        [terminal width height font-size lines cursor]
-        [control-bar playing? current-time duration dispatch]
-        (when-not (or loading frames) [start-overlay dispatch])
-        (when loading [loading-overlay])]]))
+     [:div.asciinema-player {:class-name class-name :style (player-style)}
+      [terminal width height font-size lines cursor]
+      [control-bar playing? current-time duration dispatch]
+      (when-not (or loading frames) [start-overlay dispatch])
+      (when loading [loading-overlay])]]))


prefix region in nav bar

prefix region in nav bar

--- src/cljs/ikea_clojure_cup/core.cljs
+++ src/cljs/ikea_clojure_cup/core.cljs
@@ -32,7 +32,7 @@
      [bootstrap/nav {:pull-right true}
       [bootstrap/nav-item {:title "Change region"
                            :on-click #(swap! regions/region-state dissoc :region)}
-       (get-in @regions/region-state [:region :name])]
+       (str "Region: " (get-in @regions/region-state [:region :name]))]
       [bootstrap/nav-item {:title "About" :href "/about"} "About"]
       [bootstrap/nav-item {:title "Start over" :bs-style :danger
                            :href "/"


improved deck edit with deckbuilding constraints support

--- src/cljs/netrunner/deckbuilder.cljs
+++ src/cljs/netrunner/deckbuilder.cljs
@@ -33,8 +33,10 @@
 (defn get-card [title]
   (some #(when (= (:title %) title) %) (:cards @cb/app-state)))

-(defn deck->str [cards]
-  (reduce #(str %1 (:qty %2) " " (get-in %2 [:card :title]) "\n") "" cards))
+(defn deck->str [owner]
+  (let [cards (om/get-state owner [:deck :cards])
+        str (reduce #(str %1 (:qty %2) " " (get-in %2 [:card :title]) "\n") "" cards)]
+    (om/set-state! owner :deck-edit str)))

 (defn influence [deck]
   (let [faction (get-in deck [:identity :faction])
@@ -58,7 +60,7 @@

 (defn edit-deck [owner]
   (om/set-state! owner :edit true)
-  (om/set-state! owner :deck-edit (deck->str (om/get-state owner [:deck :cards])))
+  (deck->str owner)
   (-> owner (om/get-node "viewport") js/$ (.addClass "edit"))
   (go (<! (timeout 500))
       (-> owner (om/get-node "deckname") js/$ .focus)))
@@ -123,8 +125,9 @@

 (defn handle-add [owner event]
   (.preventDefault event)
-  (put! (om/get-state owner :add-channel)
-        (str (om/get-state owner :quantity) " " (om/get-state owner :query) "\n"))
+  (put! (om/get-state owner :edit-channel)
+        {:qty (js/parseInt (om/get-state owner :quantity))
+         :card (first (om/get-state owner :matches))})
   (om/set-state! owner :quantity 3)
   (om/set-state! owner :query "")
   (-> ".deckedit .lookup" js/$ .focus))
@@ -146,8 +149,8 @@
         [:form.card-search {:on-submit #(handle-add owner %)}
          [:input.lookup {:type "text" :placeholder "Card" :value (:query state)
                          :on-change #(om/set-state! owner :query (.. % -target -value))
-                         :on-key-down #(handle-keydown owner %)
-                         :on-blur #(om/set-state! owner :matches [])}] " x "
+                         :on-key-down #(handle-keydown owner %)}]
+         " x "
          [:input.qty {:type "text" :value (:quantity state)
                       :on-change #(om/set-state! owner :quantity (.. % -target -value))}]
          [:button "Add to deck"]
@@ -168,17 +171,27 @@
     om/IInitState
     (init-state [this]
       {:edit false
-       :add-channel (chan)
+       :edit-channel (chan)
        :deck nil})

     om/IWillMount
     (will-mount [this]
-      (let [add-channel (om/get-state owner :add-channel)]
+      (let [edit-channel (om/get-state owner :edit-channel)]
         (go (while true
-              (let [line (<! add-channel)]
-                ;; (println line)
-                (-> ".deckedit textarea" js/$ (.append line))
-                (handle-edit owner))))))
+              (let [edit (<! edit-channel)
+                    card (:card edit)
+                    cards (om/get-state owner [:deck :cards])
+                    match? #(when (= (get-in % [:card :title]) (:title card)) %)
+                    existing-line (some match? cards)]
+                (if existing-line
+                  (let [new-qty (+ (:qty existing-line) (:qty edit))
+                        other-cards (remove match? cards)
+                        new-cards (cond (> new-qty 3) (conj other-cards {:qty 3 :card card})
+                                        (<= new-qty 0) other-cards
+                                        :else (conj other-cards {:qty new-qty :card card}))]
+                    (om/set-state! owner [:deck :cards] new-cards))
+                  (om/set-state! owner [:deck :cards] (conj cards edit)))
+                (deck->str owner))))))

     om/IDidUpdate
     (did-update [this prev-props prev-state]


fix permission issuer

fix permission issuer

--- src/cljs/salava/badge/ui/modal.cljs
+++ src/cljs/salava/badge/ui/modal.cljs
@@ -138,9 +138,9 @@
             (str " " (t :badge/Congratulate) "!")]))]]
      ;messages
      (when-not invalid?
-       [:div.row
-        (if (session/get :user)
-          [badge-message-link message_count  badge_id])])
+       (if user-logged-in?
+         [:div.row
+          [badge-message-link message_count  badge_id]]))
      ;endorsements
      [:div.row (badge-endorsement-modal-link badge_id endorsement_count)]

@@ -213,7 +213,7 @@
           [:h2.uppercase-header (t :badge/Evidence)]
           [:div [:a {:target "_blank" :href evidence_url} (t :badge/Openevidencepage) "..."]]]])

-      (if owner? "" [reporttool1 id name "badge"])]]
+      #_(if (and owner? (session/get :user)) "" [reporttool1 id name "badge"])]]
     ))

 (defn modal-navi [state]
@@ -245,7 +245,7 @@

 (defn modal-top-bar [state]
-  (let [{:keys [verified_by_obf issued_by_obf obf_url owner?]} @state]
+  (let [{:keys [verified_by_obf issued_by_obf obf_url owner? ]} @state]
     [:div.row.flip
      (if (or verified_by_obf issued_by_obf)
        (bh/issued-by-obf obf_url verified_by_obf issued_by_obf)
@@ -254,9 +254,9 @@

 (defn content [state]
-  (let [{:keys [owner? tab]} @state]
+  (let [{:keys [owner? tab user-logged-in?]} @state]
     [:div
-     (when-not owner? [follow-verified-bar @state nil nil])
+     (when (and (not owner?) user-logged-in?) [follow-verified-bar @state nil nil])
      [modal-top-bar state]
      (if tab tab [badge-content state])]))


Commend fdefs on connect

Commend fdefs on connect

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -108,6 +108,7 @@
            (= 1 (count input'))
            (assoc ::idents #{(first input')})))))))

+#_
 (s/fdef add
   :args (s/cat :indexes (s/or :index ::indexes :blank #{{}})
                :sym qualified-symbol?
@@ -141,6 +142,7 @@

 (s/def ::dependency-track (s/coll-of (s/tuple qualified-symbol? ::attributes-set) :kind set?))

+#_
 (s/fdef pick-resolver
   :args (s/cat :env (s/keys :req [::indexes] :opt [::dependency-track])))

@@ -226,6 +228,7 @@
                 (reduce merge-io collected (vals matches)))
               collected)))))))

+#_
 (s/fdef discover-attrs
   :args (s/cat :indexes ::indexes :ctx (s/coll-of ::attribute))
   :ret ::io-map)


Fix off by one error in checkpoint recovery. Track offset in new metrics.

--- src/onyx/plugin/kafka.clj
+++ src/onyx/plugin/kafka.clj
@@ -30,10 +30,10 @@
   (:import (org.apache.kafka.clients.consumer ConsumerRecords ConsumerRecord)
            (org.apache.kafka.clients.consumer KafkaConsumer ConsumerRebalanceListener Consumer)
            (franzy.clients.consumer.client FranzConsumer)
+           [java.util.concurrent.atomic AtomicLong]
            (org.apache.kafka.clients.producer Callback)
            [franzy.clients.producer.types ProducerRecord]
-           [org.apache.kafka.common TopicPartition]
-           [clojure.core.async.impl.channels ManyToManyChannel]))
+           [org.apache.kafka.common TopicPartition]))

 (def defaults
   {:kafka/receive-buffer-bytes 65536
@@ -46,8 +46,8 @@
         start-offsets (:kafka/start-offsets task-map)]
     (cond checkpoint
           (do
-           (info log-prefix "Seeking to checkpointed offset at:" checkpoint)
-           (seek-to-offset! consumer {:topic topic :partition kpartition} checkpoint))
+           (info log-prefix "Seeking to checkpointed offset at:" (inc checkpoint))
+           (seek-to-offset! consumer {:topic topic :partition kpartition} (inc checkpoint)))

           start-offsets
           (let [offset (get start-offsets kpartition)]
@@ -122,7 +122,7 @@

 (deftype KafkaReadMessages
   [log-prefix task-map topic ^:unsynchronized-mutable kpartition batch-timeout
-   deserializer-fn segment-fn ^:unsynchronized-mutable consumer
+   deserializer-fn segment-fn read-offset ^:unsynchronized-mutable consumer
    ^:unsynchronized-mutable iter ^:unsynchronized-mutable offset ^:unsynchronized-mutable drained]
   p/Plugin
   (start [this event]
@@ -163,6 +163,7 @@
   (recover! [this replica-version checkpoint]
     (set! drained false)
     (set! iter nil)
+    (set! offset checkpoint)
     (seek-offset! log-prefix consumer kpartition task-map topic checkpoint)
     this)

@@ -180,11 +181,12 @@
     (if (and iter (.hasNext ^java.util.Iterator iter))
       (let [rec ^ConsumerRecord (.next ^java.util.Iterator iter)
             new-offset (if rec (.offset rec) offset)
-            deserialized (some-> rec (.value) deserializer-fn)]
+            deserialized (some-> rec segment-fn)]
         (if (= :done deserialized)
           (do (set! drained true)
               nil)
           (do
+           (.set ^AtomicLong read-offset new-offset)
            (set! offset new-offset)
            deserialized)))
       (do (set! iter
@@ -193,7 +195,7 @@
                                   batch-timeout)))
           nil))))

-(defn read-messages [{:keys [onyx.core/task-map onyx.core/log-prefix] :as event}]
+(defn read-messages [{:keys [onyx.core/task-map onyx.core/log-prefix onyx.core/monitoring] :as event}]
   (let [{:keys [kafka/topic kafka/deserializer-fn]} task-map
         batch-timeout (arg-or-default :onyx/batch-timeout task-map)
         wrap-message? (or (:kafka/wrap-with-metadata? task-map) (:kafka/wrap-with-metadata? defaults))
@@ -206,9 +208,10 @@
                         :message (deserializer-fn (.value cr))
                         :offset (.offset cr)})
                      (fn [^ConsumerRecord cr]
-                       (deserializer-fn (.value cr))))]
+                       (deserializer-fn (.value cr))))
+        read-offset (:read-offset monitoring)]
     (->KafkaReadMessages log-prefix task-map topic nil batch-timeout
-                         deserializer-fn segment-fn nil nil nil false)))
+                         deserializer-fn segment-fn read-offset nil nil nil false)))

 (defn close-read-messages
   [event lifecycle]


cleanup

cleanup

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -422,8 +422,6 @@
            feminine-noun
            {:synsem {:sem {:pred :birra
                            :artifact true}}})
-
-
    "braccio"
    (unify agreement-noun
           common-noun


+aereo,attoro,aula,caffè,chiave,domanda,espresso,finestre,giallo,idea,isola,lezonie,libro,ristorante

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -119,6 +119,11 @@
                                             :pronoun true
                                             :reflexive true
                                             :sem subject-semantics}}}})
+   "aereo" {:synsem {:agr {:gender :masc}
+                     :cat :noun
+                     :sem {:physical-object true
+                           :pred :airplane
+                           :place true}}}
    "affolato"
    [;; comparative
     (let [is-place1 {:place true} ;; only places can be crowded.
@@ -325,6 +330,14 @@
                   {:synsem {:cat :verb
                             :sem {:pred :insure}}}]

+   "attoro" {:synsem {:agr {:gender :masc}
+                      :cat :noun
+                      :sem {:pred :actor}}}
+
+   "aula" {:synsem {:agr {:gender :fem}
+                    :cat :noun
+                    :sem {:pred :classroom}}}
+
    "aumentare"   {:synsem {:cat :verb
                            :sem {:pred :increase}}}
    "avere"
@@ -515,6 +528,9 @@
                    :speakable false}
              :subcat {:1 {:def :def}}}}

+   "caffè" {:synsem {:agr {:gender :masc}
+                     :cat :noun
+                     :sem {:pred :lesson}}}
    "calzoni"
    ;; inherently plural
    {:synsem {:cat :noun
@@ -644,6 +660,13 @@
                                         :sem called-semantics
                                         :cat :noun
                                         :subcat '()}}}})
+
+   "chiave" {:synsem {:agr {:gender :masc}
+                      :cat :noun
+                      :sem {:physical-object true
+                            :pred :key
+                            :place false}}}
+
    "chiedere" {:synsem {:cat :verb
                         :sem {:subj {:human true}
                               :pred :chiedere}}
@@ -959,6 +982,10 @@
                                          :pronoun true
                                          :reflexive true
                                          :sem subject-semantics}}}})
+
+   "domanda" {:synsem {:agr {:gender :fem}
+                :cat :noun
+                :sem {:pred :question}}}
    "domani"
    (unify sentential-adverb
           {:synsem {:cat :sent-modifier
@@ -1016,6 +1043,10 @@
                         :essere true
                         :sem {:pred :exist}}
                :italiano {:passato "esistito"}}
+
+   "espresso" {:synsem {:agr {:gender :masc}
+                :cat :noun
+                :sem {:pred :espresso}}}

    "esprimere" {:italiano {:passato "espresso"}
                 :synsem {:cat :verb
@@ -1208,6 +1239,10 @@
                                   :3 {:cat :adverb
                                       :sem {:pred :bad}}}}}))])

+   "finestre" {:synsem {:agr {:gender :fem}
+                        :cat :noun
+                        :sem {:pred :window}}}
+
    "finire"  {:italiano {:boot-stem1 "finisc"
                          :boot-stem2 "fin"}
               :synsem {:cat :verb
@@ -1237,6 +1272,13 @@
                          :boot-stem2 "gest"}
               :synsem {:sem {:pred :manage}
                        :cat :verb}}
+   "giallo"
+   (unify adjective
+          {:synsem {:cat :adjective
+                    :sem {:pred :yellow
+                          :comparative false
+                          :physical-object true
+                          :human false}}})

    "giocare"  {:synsem {:cat :verb
                         :sem {;:obj {:games true}
@@ -1830,6 +1872,12 @@
                           :essere false
                           :sem {:pred :answer}}
                  :italiano {:passato "risposto"}}
+   "ristorante"
+   {:synsem {:agr {:gender :fem}
+             :cat :noun
+             :sem {:pred :restaurant
+                   :city false
+                   :place true}}}

    "ritornare" {:synsem {:cat :verb
                          :sem {:pred :ritornare}
@@ -2189,6 +2237,11 @@
                                    :1plur "vogliamo"
                                    :2plur "volete"
                                    :3plur "vogliono"}}}
+
+   "ziano" {:synsem {:agr {:gender :masc}
+                     :cat :noun
+                     :sem {:pred :shoe}}}
+
    ":top" {:synsem :top
            :top true}
    ":top-noun" {:synsem {:cat :noun}


+(generate-all) and make (generate) simply a "take 1" of the call to (generate-all)

--- src/babel/italiano/workbook.clj
+++ src/babel/italiano/workbook.clj
@@ -29,9 +29,15 @@

 (defn generate
   ([spec]
-   (engine/generate spec medium))
+   (take 1 (engine/generate-all spec medium)))
   ([spec model]
-   (engine/generate spec model)))
+   (take 1 (engine/generate-all spec model))))
+
+(defn generate-all
+  ([spec]
+   (engine/generate-all spec medium))
+  ([spec model]
+   (engine/generate-all spec model)))

 (defn parse
   ([string]


better width/height handling for copy/paste

--- src-cljs/frontend/clipboard.cljs
+++ src-cljs/frontend/clipboard.cljs
@@ -134,7 +134,8 @@
   [layer opts]
   [:path (layer->svg-path layer opts)])

-(defn render-layers [{:keys [layers] :as layer-data} & {:keys [invert-colors? size-limit]}]
+;; TODO: take path width/height into account
+(defn render-layers [{:keys [layers] :as layer-data} & {:keys [invert-colors?]}]
   (let [layers (filter #(not= :layer.type/group (:layer/type %)) layers)
         start-xs (remove #(js/isNaN %) (map :layer/start-x layers))
         start-ys (remove #(js/isNaN %) (map :layer/start-y layers))
@@ -146,26 +147,14 @@
         min-y (apply min ys)
         max-x (apply max xs)
         max-y (apply max ys)
-        width (if (pos? min-x)
-                max-x
-                (- max-x min-x))
-        height (if (pos? min-y)
-                 max-y
-                 (- max-y min-y))
-        offset-top (if (neg? min-y)
-                     (+ 250 (- min-y))
-                     0)
-        offset-left (if (neg? min-x)
-                      (+ 250 (- min-x))
-                      0)]
+        width (+ 2 (js/Math.abs (- max-x min-x))) ;; room for stroke
+        height (+ 2 (js/Math.abs (- max-y min-y)))
+        offset-top (- 1 min-y)
+        offset-left (- 1 min-x)]
     (hiccups/html
      [:svg (merge
-            {:width (apply min (concat [(+ width 500)]
-                                       (when size-limit
-                                         [size-limit])))
-             :height (apply min (concat [(+ height 500)]
-                                        (when size-limit
-                                          [size-limit])))
+            {:width width
+             :height height
              :xmlns "http://www.w3.org/2000/svg"
              :xmlns:xlink "http://www.w3.org/1999/xlink"
              :version "1.1"}


add frontend ids

add frontend ids

--- src/pc/datomic/schema.clj
+++ src/pc/datomic/schema.clj
@@ -479,7 +479,12 @@
    (attribute :pre-made
               :db.type/ref
               :db/doc "dummy attribute so that we can pre-generate entity ids for a migration")
-   (enum :pre-made/free-to-postgres)])
+   (enum :pre-made/free-to-postgres)
+
+   (attribute :frontend/id
+              :db.type/uuid
+              :db/unique :db.unique/value
+              :db/doc "Squuuid that can be created on the frontend. Frontend uses this as a stable id for every entity")])

 (defonce schema-ents (atom nil))


Hide tooltip after click

Hide tooltip after click

--- src/discuss/components/tooltip.cljs
+++ src/discuss/components/tooltip.cljs
@@ -119,7 +119,9 @@
                  (when config/experimental-features?
                    [:span
                     (vlib/safe-space) " " (vlib/safe-space)
-                    [:span.pointer {:onClick #(.modal ((js* "$") "#discuss-overlay"))}
+                    [:span.pointer {:onClick (fn [_e]
+                                               (.modal ((js* "$") "#discuss-overlay"))
+                                               (hide))}
                      (vlib/fa-icon "fa-comments")
                      (translate :common :show-discuss :space)]])])))
 (def tooltip (om/factory Tooltip))


Remove unnecessary function

Remove unnecessary function

--- src/elfeed_cljsrn/android/core.cljs
+++ src/elfeed_cljsrn/android/core.cljs
@@ -243,14 +243,6 @@
         [icon {:style (:icon styles) :name "settings" :size 20}]
         [rn/text {:style (:value styles)} "Settings" ]]]]]))

-(defn navbar-title [title]
-  (let [styles {:title {:width 200
-                        :color "#e0f2f1"
-                        :font-size 20
-                        :font-weight "500"
-                        :margin-vertical 15}}]
-    [rn/text {:style (:title styles)} title]))
-
 (defn entry-actions-button []
   (let [ref-icon (r/atom nil)
         styles {:button {:padding-vertical 16


remove reference to non-existent directory

--- db-binding/build.boot
+++ db-binding/build.boot
@@ -52,7 +52,7 @@
                                 with-bikeshed]])

 (set-env!
-  :source-paths #{"test" "test-resources"}
+  :source-paths #{"test"}
   :resource-paths #{"src" "resources"})

 (task-options!


insights: refactor (idiomacy) history handling

- hash literal

--- src-cljs/frontend/history.cljs
+++ src-cljs/frontend/history.cljs
@@ -103,22 +103,20 @@
   (let [a (closest-tag target "A")]
     (cond (instance? js/SVGElement a)   ; SVG
           (let [href (-> a (.-href) (.-baseVal))]
-            (hash-map :attr-href href
-                      :attr-target (-> a
-                                       (.-target)
-                                       (.-baseVal))
-                      :host-name (let [uri-info (goog.Uri.parse href)
-                                       domain (.getDomain uri-info)]
-                                   (if (empty? domain)
-                                     (.. js/window -location -hostname)
-                                     domain))))
-          (instance? js/HTMLElement a)                         ; HTML
+            {:attr-href href
+             :attr-target (-> a .-target .-baseVal)
+             :host-name (let [uri-info (goog.Uri.parse href)
+                              domain (.getDomain uri-info)]
+                          (if (empty? domain)
+                            (-> js/window .-location .-hostname)
+                            domain))})
+          (instance? js/HTMLElement a)  ; HTML
           (let [href (let [path (str (.-pathname a) (.-search a) (.-hash a))]
                        (when-not (empty? path)
                          path))]
-            (hash-map :attr-href href
-                      :attr-target (-> a .-target)
-                      :host-name (-> a .-hostname))))))
+            {:attr-href href
+             :attr-target (-> a .-target)
+             :host-name (-> a .-hostname)}))))

 (defn setup-link-dispatcher! [history-imp top-level-node]
   (events/listen


Properly load "now playing" games from backloggery

"Now playing" games have CSS class "gamebox nowplaying" rather than just
"gamebox".

--- src/bltool/data/backloggery.clj
+++ src/bltool/data/backloggery.clj
@@ -73,7 +73,7 @@

 (defn- bl-extract-games [body]
   (->> body (tag-seq :section)
-       (filter #(= "gamebox" (:class (:attrs %))))
+       (filter #(.contains (:class (:attrs %)) "gamebox"))
        ; filter out collections - they don't have edit links, so (first (tag-seq :a)) will be nil
        (filter #(first (tag-seq :a %)))
        (map gamebox-to-game)))


Don't need next anymore

Don't need next anymore

--- src/cljs/cljs_webrepl/core.cljs
+++ src/cljs/cljs_webrepl/core.cljs
@@ -17,7 +17,6 @@
 (defonce state
   (atom {:ns      "unknown"
          :input   "(+ 1 2)"
-         :next    0
          :cursor  0
          :history (sorted-map)}))


Display the results of an ajax call!!

Display the results of an ajax call!!

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -33,11 +33,12 @@
  (fn [data owner]
    (om/component
     (dom/div nil
-     (dom/h1 nil (:heading data))
-     (apply dom/ul nil
-            (map (fn [{:keys [name url]}]
-                   (dom/li (dom/a #js {:href url} name)))
-                 (:sites data))))))
+             (dom/h1 nil (:heading data))
+             (apply dom/ul nil
+                    (map (fn [{:keys [name url]}]
+                           (dom/li nil
+                                   (dom/a #js {:href url} name)))
+                         (:sites data))))))
  app-state
  {:target (. js/document (getElementById "main-area"))})

@@ -47,6 +48,7 @@
 (defn error-handler [{:keys [status status-text]}]
   (.log js/console (str "something bad happened: " status " " status-text)))

-(GET "/api/v1/sites" {:handler handler
+(GET "/api/v1/sites" {:handler (fn [sites]
+                                 (swap! app-state assoc :sites sites))
                       :error-handler error-handler
                       :response-format :edn})


debug pprint

debug pprint

--- src/clojure/nossal/api/core.clj
+++ src/clojure/nossal/api/core.clj
@@ -6,7 +6,7 @@

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

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


Added filter fn's for first and last source line.

--- nav-obj-splitter.clj
+++ nav-obj-splitter.clj
@@ -4,6 +4,7 @@

 (def type-id-map {"Table" 1 "Form" 2 "Report" 3 "Dataport" 4 "Codeunit" 5 "XMLport" 6 "MenuSuite" 7 "Page" 8})
 (def first-line-regex #"^OBJECT (.+) (\d+) (.+)")
+(def last-line-regex #"^}$")
 (def source-file-extension ".txt")

 ;; Read big source file line by line.
@@ -13,11 +14,21 @@
 ;; If so , than place that line on the "stack" and send of the source for this
 ;; one object to be parsed and saved in its own file.

-(defn read-big-source
+(defn get-big-source-lines
   "doc"
   [file-name]
   (let [lines (clojure.string/split-lines (slurp file-name :encoding "ibm850"))]
     lines))
+
+(defn first-line-of-object-source? [line]
+  (if (re-find first-line-regex line)
+    true
+    false))
+
+(defn last-line-of-object-source? [line]
+  (if (re-find last-line-regex line)
+    true
+    false))

 (defn parse-first-line
   "Parses meta data from the first line of the object source file."


Broke down final example into two cases; one for clojure/data.csv, one for clojure-csv to show writing differences

--- src/semantic_csv/core.clj
+++ src/semantic_csv/core.clj
@@ -440,26 +440,42 @@
 ;; # One last example showing everything together
 ;;
 ;; Let's see how Semantic CSV in the context of a little data pipeline.
-;; We're going to thread data in, tranform into maps to make things easier to work with, modify the data based
-;; on some computations, and then write the modified data out to a file, all maintaining laziness.
+;; We're going to thread data in, tranform into maps, run some computations for each row and assoc in,
+;; then write the modified data out to a file, all lazily.
+;; First let's show this with `clojure/data.csv`, which I find a little easier to use for writing.
+;;
+;;     (require '[clojure.data.csv :as cd-csv])
 ;;
 ;;     (with-open [in-file (io/reader "test/test.csv")
 ;;                 out-file (io/writer "test-out.csv")]
 ;;       (->>
-;;         (csv/parse-csv in-file)
+;;         (cd-csv/read-csv in-file)
 ;;         remove-comments
 ;;         mappify
 ;;         (cast-with {:this ->int :that ->float})
-;;         ;; Do some of your own processing...
+;;         ;; Do your processing...
 ;;         (map
 ;;           (fn [row]
 ;;             (assoc row :jazz (* (:this row)
 ;;                                 (:that row)))))
 ;;         vectorize
-;;         ; clojure-csv doesn't like non string values
+;;         (cd-csv/write-csv out-file)))
+;;
+;; Now let's see what this looks like with `clojure-csv`.
+;; Note that as mentioned above, `clojure-csv` doesn't actually handle file writing for you, just formatting
+;; into a CSV string.
+;; So, to maintain lazyness, you'll have to add a couple steps to the end.
+;; Additionally, it doesn't accept row items with anything that isn't a string, in contrast with
+;; `clojure/data.csv` which casts to a string for you, so we'll have to account for that as well.
+;;
+;;     (with-open [in-file (io/reader "test/test.csv")
+;;                 out-file (io/writer "test-out.csv")]
+;;       (->>
+;;         (csv/parse-csv in-file)
+;;         ...
 ;;         (format-all-with str)
-;;         ; Convert into row strings
-;;         (map (comp csv/write-csv vector))
+;;         (batch 1)
+;;         (map csv/write-csv)
 ;;         (reduce
 ;;           (fn [w row]
 ;;             (.write w row)


Finished JSON parser

Finished JSON parser

--- src/seminarski/parser.clj
+++ src/seminarski/parser.clj
@@ -42,7 +42,54 @@
 )

+(defn get-moviecast-data [cast]
+  (vec (doall (map #(select-keys % [:name :imdb_code]) cast)))
+)
+
+(defn get-parsed-movie [movie]
+  {:_id (:id movie)
+   :imdb_code (:imdb_code movie)
+   :title (:title_long movie)
+   :year (:year movie)
+   :imdb_rating (:rating movie)
+   :genres (:genres movie)
+   :yt_trailer_code (:yt_trailer_code movie)
+   :description (:description_full movie)
+   :directors (get-moviecast-data (:directors movie))
+   :actors (get-moviecast-data (:actors movie))
+   }
+)
+
+
+(defn get-processed-movies [movies]
+  (loop [mv movies mvfrompage []]
+    (if (empty? mv)
+      mvfrompage
+      (let [mvfp (get-parsed-movie(json-parse (get-movie-details (first mv)) (get-movie-details-json-tag)))]
+        (if-not (nil? mvfp)
+          (recur (rest mv) (conj mvfrompage mvfp))
+          (recur (rest mv) mvfrompage)))))
+)
+
+(defn get-movies []
+  (loop [page 1 movies []]
+    (let [moviesfrompage (json-parse (get-movies-from-page page) (get-movies-json-tag))]
+      (if-not (nil? moviesfrompage)
+        (if (empty? moviesfrompage)
+          (do
+            (println "EMPTY")
+            movies)
+          (do
+
+          (recur (inc page) (into movies (get-processed-movies moviesfrompage)))))
+        (recur (inc page) movies))))
+)

+
+
+
+
+


import separator

import separator

--- src/ontrail/import.clj
+++ src/ontrail/import.clj
@@ -110,12 +110,12 @@
                   fres (frequencies res)]
               (send-import-msg user fres)
               (if (> (fres \+) 0)
-                (str "/#import-ok=" (fres \+))
-                (do (.delete import-file) "/#import-error=invalidFormat")))
+                (str "/#import/ok=" (fres \+))
+                (do (.delete import-file) "/#import/error=invalidFormat")))
             (catch Exception exception
               (.error logger (str exception))
-              (do (.delete import-file) "/#import-error=invalidFormat"))))
-      "/#import-error=alreadyExists")))
+              (do (.delete import-file) "/#import/error=invalidFormat"))))
+      "/#import/error=alreadyExists")))

 (defn -main [& args]
   "Imports lenkkivihko.fi export format. First arg is an username, and the second export filename."


reading hundreds back

reading hundreds back


fix fatigue

fix fatigue

--- src/soot/game_helpers.clj
+++ src/soot/game_helpers.clj
@@ -251,7 +251,7 @@
 (defn tick-fatigue
   "Does a tick of fatigue on the current player"
   [state] (target state [:my :hero] (fn [s] (-> s
-    (update-target (fn [hero] (update-in hero [:fatigue #(+ 1 (or % 0))])))
+    (update-target (fn [hero] (update-in hero [:fatigue] #(+ 1 (or % 0)))))
     (#(damage-target % (get-in % [:heroes (:actor %) :fatigue])))))))

 (defn cards-in-hand [s] (count (filter-all s [:my :drawn])))


Comment for focus manager

Comment for focus manager

--- flatguicore/src/flatgui/focus.clj
+++ flatguicore/src/flatgui/focus.clj
@@ -91,7 +91,12 @@
         (sort-lines-by-y (sort-each-line-by-x lines) line-y1)))))

 ;;; Sorts focusable components so that they are traversed in left->right, up->down direction.
-;;; To make such ad order, arranges components in a vector of horizontal "lines"
+;;; To make such an order, arranges components in a vector of horizontal "lines".
+;;;
+;;;  NOTE:
+;;; This implementation is slow. For containers that have frequenlty moving children, it's better
+;;; to wrap it into another function that would call this one in rare cases (e.g. only when :children
+;;; change)
 (fg/defevolverfn :focus-traversal-order
   (let [accepting-children (get-accepting-children component)]
     (if (pos? (count accepting-children))


added fregar

added fregar

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -285,6 +285,11 @@

    "formar" {:synsem {:cat :verb
                       :sem {:pred :form}}}
+
+   "fregar" {:espanol {:boot-stem1 "frieg"
+                        :boot-stem2 "freg"}
+             :synsem {:cat :verb
+                      :sem {:pred :scrub}}}

    "funcionar" {:synsem {:cat :verb
                          :sem {:subj {:human false}


test fix

test fix

--- src/metabase/driver/generic_sql/sync.clj
+++ src/metabase/driver/generic_sql/sync.clj
@@ -337,6 +337,9 @@
   "Fields that have at least this percent of values that are valid URLs should be marked as `special_type = :url`."
   0.95)

+;; TODO - this fails for postgres tables that we consider TextFields but don't work for char_length, such as UUID fields
+;; This is not a big deal since we wouldn't want to mark those as URLs any way, but we should do casting here to avoid
+;; that issue in the first place
 (defn- field-percent-urls
   "Return the percentage of non-null values of FIELD that are valid URLS."
   {:arglists '([korma-table field])}
@@ -347,7 +350,7 @@
     (if (= total-non-null-count 0) 0
         (let [url-count (-> (select korma-table
                                     (aggregate (count :*) :count)
-                                    (where {(raw (format "CAST(\"%s\" AS TEXT)" (name field-name))) [like "http%://_%.__%"]})) first :count)] ; This is how the old Django app worked. Didn't match URLs like
+                                    (where {(keyword field-name) [like "http%://_%.__%"]})) first :count)] ; This is how the old Django app worked. Didn't match URLs like
           (float (/ url-count total-non-null-count))))))                                                   ; "www.zagat.com". Is this what we want?

 (defn- check-for-urls


code as documentation.  make it clear what we are destructuring.

--- src/metabase/driver/generic_sql/util.clj
+++ src/metabase/driver/generic_sql/util.clj
@@ -46,7 +46,7 @@
     (-> (sel :one Table :id 100)
         korma-entity
         (select (aggregate (count :*) :count)))"
-  [{:keys [name db]}]
+  [{:keys [name db] :as table}]
   {:table name
    :pk    :id
    :db    (korma-db @db)})


Updating to latest modular.bidi

Updating to latest modular.bidi

--- modules/less/project.clj
+++ modules/less/project.clj
@@ -8,7 +8,7 @@
   :dependencies [[prismatic/schema "0.3.3"]
                  [com.stuartsierra/component "0.2.2"]
                  [malcolmsparks/clj-less "1.7.3"]
-                 [juxt.modular/bidi "0.7.1"]]
+                 [juxt.modular/bidi "0.7.2"]]

   :profiles {:dev {:dependencies
                    [[org.clojure/clojure "1.6.0"]


make we can draw grid from board

make we can draw grid from board

Signed-off-by: Yen-Chin Lee <082d453d72dce940e12089a4ad48b97cfe1f3ec4@gmail.com>

--- src/clj/brains_brain/core.clj
+++ src/clj/brains_brain/core.clj
@@ -23,21 +23,56 @@

 (println (str "size: " size))

+(defn make-board
+  []
+  (let [board (make-array Integer/TYPE board-size board-size)]
+    (doseq [x (range 0 board-size)
+            y (range 0 board-size)]
+      (aset-int board x y (if (< (rand-int 100) 50) 0 1))
+      )
+    board))
+(use 'clojure.pprint)
+
+
+;;(make-indexed )
+
+(def a (make-board))
+(pprint a)
+(aget a 1 1)
+
 (defn draw-grid [c g]
-  (let [cellw 3
-        cellh 3
-        ]
+  (doseq [x (range 0 board-size)
+          y (range 0 board-size)
+          :let [cell (aget a x y)
+                xb (* x cell-size)
+                yb (* y cell-size)
+                ]]
+    (draw g
+          ;;            (rect x y (dec cell-size))
+          (rect xb yb cell-size)
+          (style :background (case cell
+                               1 :red
+                               :white)
+                                        ; :white ;; "#F03232"
+                 :foreground :black ; broader
+                 )
+          )
+    ))
+
+(comment
+  (defn draw-grid [c g]
     (doseq [x (range 0 size cell-size)
             y (range 0 size cell-size)]
       (draw g
             ;;            (rect x y (dec cell-size))
             (rect x y cell-size)
-            (style :background (if (< (rand-int 100) 50) :white :black)
+            (style :background :white
                                         ; :white ;; "#F03232"
                    :foreground :black ; broader
                    )
             )
-      )))
+      ))
+  )

 (defn make-ui
   []


Makes triggering Shi.Kyu an optional ability for the corp.

--- src/clj/game/cards-assets.clj
+++ src/clj/game/cards-assets.clj
@@ -478,10 +478,12 @@
                                                         :effect (effect (trash-cards targets))) shat nil)))}}}}

    "Shi.Kyū"
-   {:access {:req (req (not= (first (:zone card)) :deck))
-             :prompt "How many [Credits] for Shi.Kyū?" :choices :credit
-             :msg (msg "attempt to do " target " net damage")
-             :effect (effect (resolve-ability
+   {:access
+    {:optional {:req (req (not= (first (:zone card)) :deck))
+                :prompt "Pay [Credits] to use Shi.Kyū?"
+                :yes-ability {:prompt "How many [Credits] for Shi.Kyū?" :choices :credit
+                              :msg (msg "attempt to do " target " net damage")
+                              :effect (effect (resolve-ability
                                {:player :runner
                                 :prompt (str "Take " target " net damage or take Shi.Kyū as -1 agenda point?")
                                 :choices [(str "Take " target " net damage") "Add Shi.Kyū to score area"]
@@ -495,7 +497,7 @@
                                                  (do (damage state :corp :net dmg {:card card})
                                                    (system-msg state :corp
                                                     (str "uses Shi.Kyū to do " dmg " net damage"))))))}
-                              card targets))}}
+                              card targets))}}}}

    "Shock!"
    {:access {:msg "do 1 net damage" :effect (effect (damage :net 1 {:card card}))}}


Remove unused require

Remove unused require

--- src/clj/nightcode/editors.clj
+++ src/clj/nightcode/editors.clj
@@ -5,7 +5,6 @@
             [ring.middleware.resource :refer [wrap-resource]]
             [ring.middleware.content-type :refer [wrap-content-type]]
             [ring.util.response :refer [redirect not-found]]
-            [ring.util.request :refer [body-string]]
             [clojure.spec.alpha :as s :refer [fdef]]
             [nightcode.shortcuts :as shortcuts]
             [nightcode.utils :as u]


Clear dumpdata

Clear dumpdata

--- src/clj/salava/badge/main.clj
+++ src/clj/salava/badge/main.clj
@@ -65,20 +65,12 @@
         badges-with-tags (map-badges-tags badges tags)]
     (map #(badge-issued-and-verified-by-obf ctx %) badges-with-tags)))

-(def ctx {:db (hikari-cp.core/make-datasource {:adapter "mysql",
-                                               :username "root",
-                                               :password "isokala",
-                                               :database-name "salava4",
-                                               :server-name "localhost"})})
-
 (defn user-badges-to-export
   "Returns valid badges of a given user"
   [ctx user-id]
   (let [badges (select-user-badges-to-export {:user_id user-id} (get-db ctx))
         tags (if-not (empty? badges) (select-taglist {:badge_ids (map :id badges)} (get-db ctx)))]
     (map-badges-tags badges tags)))
-
-(user-badges-to-export ctx 1)

 (defn user-badges-pending
   "Returns pending badges of a given user"


extract message consumption into consume-stream

--- src/clj_kafka/consumer/zk.clj
+++ src/clj_kafka/consumer/zk.clj
@@ -41,6 +41,12 @@
   ([^ConsumerConnector consumer topic-count-map key-decoder value-decoder]
    (.createMessageStreams consumer topic-count-map key-decoder value-decoder)))

+(defn consume-stream
+  "Returns a lazy sequence of KafkaMessage messages from the stream."
+  [^KafkaStream stream]
+  (map to-clojure
+       (lazy-iterate (.iterator ^KafkaStream stream))))
+
 (defn messages
   "Provides a simple way to consume a sequence of KafkaMessage messages from the
   named topic. Consumes on a single thread and returns a lazy sequence."
@@ -51,5 +57,4 @@
                   (create-message-streams consumer topic-count-map key-decoder value-decoder)
                   (create-message-streams consumer topic-count-map))
         [stream & _] (get streams topic)]
-    (map to-clojure
-         (lazy-iterate (.iterator ^KafkaStream stream)))))
+    (consume-stream stream)))


correct call to apply-scope

correct call to apply-scope

--- src/clj_money/web/budgets.clj
+++ src/clj_money/web/budgets.clj
@@ -69,8 +69,7 @@
          [:th " "]]
         (map budget-row (budgets/search (env :db)
                                         (apply-scope {:entity-id (:id entity)}
-                                                     :budget
-                                                     (env :db))))]
+                                                     :budget)))]
        [:a.btn.btn-primary {:href (format "/entities/%s/budgets/new" (:id entity))}
         "Add"]]])))


Fix rendering high scores

Fix rendering high scores

--- src/cljc/robinson/render.cljc
+++ src/cljc/robinson/render.cljc
@@ -316,20 +316,20 @@
       (ranimation/set-mask! screen #{:rain :transform} (map rc/pos->xy characters) false)))))

 (def single-border
-  {:horizontal   "\u2500"
-   :vertical     "\u2502"
-   :top-left     "\u250C"
-   :top-right    "\u2510"
-   :bottom-left  "\u2514"
-   :bottom-right "\u2518"})
+  {:horizontal   \u2500
+   :vertical     \u2502
+   :top-left     \u250C
+   :top-right    \u2510
+   :bottom-left  \u2514
+   :bottom-right \u2518})

 (def double-border
-  {:horizontal   "\u2550"
-   :vertical     "\u2551"
-   :top-left     "\u2554"
-   :top-right    "\u2557"
-   :bottom-left  "\u255A"
-   :bottom-right "\u255D"})
+  {:horizontal   \u2550
+   :vertical     \u2551
+   :top-left     \u2554
+   :top-right    \u2557
+   :bottom-left  \u255A
+   :bottom-right \u255D})

 (defn render-rect-border
   [screen x y width height fg bg characters]
@@ -343,17 +343,17 @@
                 bottom-right]} characters]
     ;; render top and bottom
     (doseq [dx (range (dec width))]
-      (put-string screen (+ x dx 1) y horizontal fg bg #{} {:mask #{:rain :transform}})
-      (put-string screen (+ x dx 1) (+ y height) horizontal fg bg #{} {:mask #{:rain :transform}}))
+      (put-string screen (+ x dx 1) y (str horizontal) fg bg #{} {:mask #{:rain :transform}})
+      (put-string screen (+ x dx 1) (+ y height) (str horizontal) fg bg #{} {:mask #{:rain :transform}}))
     ;; render left and right
     (doseq [dy (range (dec height))]
-      (put-string screen x (+ y dy 1) vertical fg bg #{} {:mask #{:rain :transform}})
-      (put-string screen (+ x width) (+ y dy 1) vertical fg bg #{} {:mask #{:rain :transform}}))
+      (put-string screen x (+ y dy 1) (str vertical) fg bg #{} {:mask #{:rain :transform}})
+      (put-string screen (+ x width) (+ y dy 1) (str vertical) fg bg #{} {:mask #{:rain :transform}}))
     ;; render tl, tr, bl, br
-    (put-string screen x y top-left fg bg #{} {:mask #{:rain :transform}})
-    (put-string screen (+ x width) y top-right fg bg #{} {:mask #{:rain :transform}})
-    (put-string screen x (+ y height) bottom-left fg bg #{} {:mask #{:rain :transform}})
-    (put-string screen (+ x width) (+ y height) bottom-right fg bg #{} {:mask #{:rain :transform}})))
+    (put-string screen x y (str top-left) fg bg #{} {:mask #{:rain :transform}})
+    (put-string screen (+ x width) y (str top-right) fg bg #{} {:mask #{:rain :transform}})
+    (put-string screen x (+ y height) (str bottom-left) fg bg #{} {:mask #{:rain :transform}})
+    (put-string screen (+ x width) (+ y height) (str bottom-right) fg bg #{} {:mask #{:rain :transform}})))

 (defn render-rect-single-border
   [screen x y width height fg bg]
@@ -1853,7 +1853,7 @@
   (doseq [i (range 8)]
     (put-chars (state :screen) [{:c (get single-border :horizontal) :x (+ x i 1) :y (+ y 8) :fg (rcolor/color->rgb :white) :bg (rcolor/color->rgb :black) :style #{}}]))
   ;; put caret
-  (put-chars (state :screen) [{:c "^"  :x (+ x (int (/ value group-size)) 1) :y (+ y 8) :fg (rcolor/color->rgb :highlight) :bg (rcolor/color->rgb :black) :style #{}}])
+  (put-chars (state :screen) [{:c \^ :x (+ x (int (/ value group-size)) 1) :y (+ y 8) :fg (rcolor/color->rgb :highlight) :bg (rcolor/color->rgb :black) :style #{}}])
   ;; render y-axis
   (doseq [i (range 7)]
     (put-chars (state :screen) [{:c (get single-border :vertical)  :x x :y (+ y i 1) :fg (rcolor/color->rgb :white) :bg (rcolor/color->rgb :black) :style #{}}]))
@@ -1879,7 +1879,7 @@
             to   (+ y 7)]
         (log/debug "from" from "to" to "x" x)
       (doseq [y (range from to)]
-        (put-chars (state :screen) [{:c (-> 219 cp437->unicode str)#_"*" :x x :y (inc y) :fg fg :bg (rcolor/color->rgb :black) :style #{}}])))))))
+        (put-chars (state :screen) [{:c (cp437->unicode 219)#_"*" :x x :y (inc y) :fg fg :bg (rcolor/color->rgb :black) :style #{}}])))))))

 (defn render-share-score
   [state]


Use relative links

Use relative links

--- src/cljs/retroboard/user.cljs
+++ src/cljs/retroboard/user.cljs
@@ -16,7 +16,7 @@
   ([email password ch]
      (xhr/edn-xhr
       {:method :post
-       :url "http://localhost:8080/login"
+       :url "/login"
        :data {:username email
               :password password}
        :chan ch})))
@@ -29,7 +29,7 @@
   ([email password name ch]
      (xhr/edn-xhr
       {:method :post
-       :url "http://localhost:8080/signup"
+       :url "/signup"
        :data {:email email
               :password password
               :name name}})))
@@ -42,7 +42,7 @@
   ([ch]
      (xhr/edn-xhr
       {:method :get
-       :url "http://localhost:8080/boards"
+       :url "/boards"
        :chan ch})))

 (defn input [owner id placeholder & type]


Minimize necessary initial (only!) metadata.

--- src/cljx/geschichte/meta.cljx
+++ src/cljx/geschichte/meta.cljx
@@ -103,11 +103,12 @@
         new-causal (merge (:causal-order other-meta) causal-order)
         new-meta {:last-update (if newer (:last-update other-meta) last-update)
                   :id id
-                  :description description
+                  :description (or description (:description other-meta))
                   :schema {:type (:type schema)
                            :version (max (:version schema) (or (:version (:schema other-meta))
                                                                (:version schema)))}
-                  :head (if newer (or (:head other-meta) head) head)
+                  :head (if newer (or (:head other-meta) head)
+                            (or head (:head other-meta)))
                   :branches (merge-with (fn [{heads-a :heads indexes-a :indexes}
                                             {heads-b :heads indexes-b :indexes}]
                                           (let [ind {:indexes (merge-with


Remove unnecessary symbol

Remove unnecessary symbol

--- src/play_clj/utils.clj
+++ src/play_clj/utils.clj
@@ -95,7 +95,7 @@
     (scaling :stretch-x)
     (scaling :stretch-y)"
   [k]
-  `(static-field-lower main-package :utils :Scaling ~k))
+  `(static-field-lower :utils :Scaling ~k))

 ; java interop


Add name of fn which was automatically tested

--- src/test/discuss/lib.cljs
+++ src/test/discuss/lib.cljs
@@ -3,7 +3,10 @@
             [cljs.test :refer-macros [is]]))

 (defn- summarize-results' [spec-check]
-  (doall (map #(-> % :clojure.test.check/ret pprint/pprint) spec-check)))
+  (doall (map #(-> %
+                   (select-keys [:clojure.test.check/ret :sym])
+                   vals
+                   pprint/pprint) spec-check)))

 (defn check' [spec-check]
   (summarize-results' spec-check)


slight refactor of sentence rendering and include capitalization.

--- src/pronouns/pages.clj
+++ src/pronouns/pages.clj
@@ -7,34 +7,29 @@
   [pronoun]
   [:b pronoun])

-(defn wrap-para
-  [whatever]
-  [:p whatever])
+(defn render-sentence [& content]
+  [:p [:span.sentence content]]
+)

 (defn subject-example
   [subject]
-  (wrap-para
-   [:span#sentence (wrap-pronoun subject) " went to the park."]))
+  (render-sentence (wrap-pronoun (s/capitalize subject)) " went to the park."))

 (defn object-example
   [object]
-  (wrap-para
-   [:span#sentence "I went with " (wrap-pronoun object) "."]))
+  (render-sentence "I went with " (wrap-pronoun object) "."))

 (defn posessive-determiner-example
   [subject possessive-determiner]
-  (wrap-para
-   [:span#sentence (wrap-pronoun subject) " brought " (wrap-pronoun possessive-determiner) " frisbee."]))
+  (render-sentence (wrap-pronoun (s/capitalize subject)) " brought " (wrap-pronoun possessive-determiner) " frisbee."))

 (defn possessive-pronoun-example
   [possessive-pronoun]
-  (wrap-para
-   [:span#sentence "At least I think it was " (wrap-pronoun possessive-pronoun) "."]))
+  (render-sentence "At least I think it was " (wrap-pronoun possessive-pronoun) "."))

 (defn reflexive-example
   [subject reflexive]
-  (wrap-para
-   [:span#sentence (wrap-pronoun subject) " threw the frisbee to " (wrap-pronoun reflexive)]))
+  (render-sentence (wrap-pronoun (s/capitalize subject)) " threw the frisbee to " (wrap-pronoun reflexive) "."))

 (defn twitter-name [name]


Added tests for detecting conflicting modes.

--- test/app/test/core.clj
+++ test/app/test/core.clj
@@ -48,6 +48,21 @@
   (let [cl (parseType "NotSingletonEnum_NotOnlyInstance")]
     (is (not (isSingletonEnum? cl)))))

+(deftest testSelfExclusiveModes
+  (is (true? (self-exclusive-modes?
+               {:query 'mc :linter true :interactive true})))
+  (is (true? (self-exclusive-modes?
+               {:linter true :interactive true})))
+  (is (true? (self-exclusive-modes?
+               {:query 'mc :linter true})))
+  (is (true? (self-exclusive-modes?
+               {:query 'mc :interactive true})))
+  (is (false? (self-exclusive-modes?
+                {:linter false :interactive true})))
+  (is (false? (self-exclusive-modes? {:query 'mc})))
+  (is (false? (self-exclusive-modes? {:linter true})))
+  (is (false? (self-exclusive-modes? {:interactive true}))))
+
 ; =============================================================
 ; Command parser
 ; =============================================================
@@ -62,4 +77,4 @@
   (is (= [:EXIT 'quit']) (command-parser "quit")))

 (deftest testParsingExit
-  (is (= [:EXIT 'exit']) (command-parser "exit")))+  (is (= [:EXIT 'exit']) (command-parser "exit")))


Fix new comments count for unread entries.

--- src/oc/storage/representations/entry.clj
+++ src/oc/storage/representations/entry.clj
@@ -257,8 +257,7 @@
                            :bookmarked-at (:bookmarked-at bookmark)
                            :last-read-at (:read-at entry-read)
                            :new-comments-count (when enrich-entry?
-                                                 (new-comments-count entry-with-comments user-id entry-read)
-                                                   0)
+                                                 (new-comments-count entry-with-comments user-id entry-read))
                            :new-at (when enrich-entry?
                                      (entry-new-at user-id entry-with-comments))}
                           entry)


Fix make-job dispatch function

Fix make-job dispatch function

--- src/main/clojure/clj_print/core.clj
+++ src/main/clojure/clj_print/core.clj
@@ -229,22 +229,24 @@

 (defmulti make-job
   "Returns a JobSpec map that is the result of
-   assoc'ing required values to it. The values are:
-
-   1. A SimpleDoc object (wrapped in a Delay) made from
-   the map keyed at :doc.
-   2. A DocPrintJob object that is retrieved from the
-   PrintService.
-
-   The following defaults are also assoc'd to the job-spec
-   if no values are supplied for them:
-
-   1. The default system printer.
-   2. An attribute set with the single attribute MediaTray/MAIN.
-   3. A basic PrintJobListener that prints any events that occur
-   on the DocPrintJob."
-  {:since "0.0.1"}
-  (fn [spec] (some spec [:doc :docs])))
+  assoc'ing required values to it. The values are:
+
+  1. A SimpleDoc object (wrapped in a Delay) made from
+  the map keyed at :doc.
+  2. A DocPrintJob object that is retrieved from the
+  PrintService.
+
+  The following defaults are also assoc'd to the job-spec
+  if no values are supplied for them:
+
+  1. The default system printer.
+  2. An attribute set with the single attribute MediaTray/MAIN.
+  3. A basic PrintJobListener that prints any events that occur
+  on the DocPrintJob."
+  {:since "0.0.1"}
+  (fn [spec]
+    (some #(and spec %)
+          [:doc :docs])))

 (defmethod make-job :doc [spec]
   (let [{doc :doc attrs :attrs} spec


conditionalize check-use-macros

conditionalize check-use-macros

--- src/main/clojure/cljs/analyzer.cljc
+++ src/main/clojure/cljs/analyzer.cljc
@@ -1632,7 +1632,8 @@

 (defn check-use-macros [use-macros env]
   (doseq [[sym lib] use-macros]
-    (when (nil? (.findInternedVar ^clojure.lang.Namespace (find-ns lib) sym))
+    (when (nil? #?(:clj  (.findInternedVar ^clojure.lang.Namespace (find-ns lib) sym)
+                   :cljs (.findInternedVar (find-macros-ns lib) sym)))
       (throw
         (error env
           (error-message :undeclared-ns-form {:type "macro" :lib lib :sym sym}))))))


CMR-4254: Fixed tests.

CMR-4254: Fixed tests.

--- metadata-db-app/src/cmr/metadata_db/data/oracle/search.clj
+++ metadata-db-app/src/cmr/metadata_db/data/oracle/search.clj
@@ -34,7 +34,7 @@
    :variable (into common-columns [:provider_id :variable_name :measurement :user_id])
    :variable-association (into common-columns
                                [:associated_concept_id :associated_revision_id
-                                :variable_name :user_id])})
+                                :variable_concept_id :user_id])})

 (def single-table-with-providers-concept-type?
   "The set of concept types that are stored in a single table with a provider column. These concept


Removes reflection for buffer length (#267)

--- waiter/src/waiter/process_request.clj
+++ waiter/src/waiter/process_request.clj
@@ -313,7 +313,7 @@
                         (confirm-live-connection)
                         (let [buffer (timers/start-stop-time! stream-read-body (async/<! body))
                               bytes-read (if buffer
-                                           (alength buffer)
+                                           (count buffer)
                                            -1)]
                           (if-not (= -1 bytes-read)
                             (do


Add defcs macro.

Add defcs macro.

--- src/uxbox/util/mixins.clj
+++ src/uxbox/util/mixins.clj
@@ -38,3 +38,8 @@
   [& args]
   (let [[render doc mixins cname] (parse-defc args)]
     `(def ~cname ~doc (rum/build-defc ~render ~mixins ~(str cname)))))
+
+(defmacro defcs
+  [& args]
+  (let [[render doc mixins cname] (parse-defc args)]
+    `(def ~cname ~doc (rum/build-defcs ~render ~mixins ~(str cname)))))


(PDB-2435) Use read-db for population metrics

This commit changes our population metrics to use the read-db and not
the write-db so that we leverage read replica's when they are available.

--- src/puppetlabs/puppetdb/cli/services.clj
+++ src/puppetlabs/puppetdb/cli/services.clj
@@ -242,7 +242,7 @@
       (log/infof "PuppetDB version %s" v))

     (init-with-db database config)
-    (pop/initialize-metrics write-db)
+    (pop/initialize-metrics read-db)

     (when (.exists discard-dir)
       (dlo/create-metrics-for-dlo! discard-dir))


Colocate TODOs

Colocate TODOs

--- src/re_frame/core.cljc
+++ src/re_frame/core.cljc
@@ -17,6 +17,8 @@

 ;; XXX move API functions up here
+;; XXX add a clear all handlers:
+;; XXX add a push handlers for testing purposes

 ;; --  subscribe
 (def reg-sub-raw         subs/register)
@@ -27,8 +29,6 @@
 (def reg-fx       fx/register)
 (def clear-fx     (partial registrar/clear-handlers fx/kind))

-;; XXX add a clear all handlers:
-;; XXX add a push handlers for testing purposes

 ;; --  middleware


In the absence of proper API docs, core.cljs becomes the docs.  So start to improve it.

--- src/re_frame/core.cljc
+++ src/re_frame/core.cljc
@@ -16,71 +16,49 @@
     [clojure.set               :as set]))

-;; --  dispatch
+;; XXX move API functions up to this core level - to enable code completion and auto-generated docs
+
+
+;; --  dispatch ---------------------------------------------------------------
 (def dispatch         router/dispatch)
 (def dispatch-sync    router/dispatch-sync)

-;; XXX move API functions up to this core level - to enable code completion and docs
-;; XXX on figwheel reload, is there a way to not get the re-registration messages.
-
-
-;; -- interceptor related
-;; useful if you are writing your own interceptors
-(def ->interceptor   interceptor/->interceptor)
-(def enqueue         interceptor/enqueue)
-(def get-coeffect    interceptor/get-coeffect)
-(def get-effect      interceptor/get-effect)
-(def assoc-effect    interceptor/assoc-effect)
-(def assoc-coeffect  interceptor/assoc-coeffect)
-
-
-;; --  standard interceptors
-(def debug       std-interceptors/debug)
-(def path        std-interceptors/path)
-(def enrich      std-interceptors/enrich)
-(def trim-v      std-interceptors/trim-v)
-(def after       std-interceptors/after)
-(def on-changes  std-interceptors/on-changes)
-
-
-;; --  subscriptions
-(defn reg-sub-raw
-  "Associate a given `query id` with a given subscription handler function `handler-fn`
-   which is expected to take two arguments: app-db and query vector, and return
-   a `reaction`.
-
-  This is a low level, advanced function.  You should probably be using reg-sub
-  instead."
-  [query-id handler-fn]
-  (registrar/register-handler subs/kind query-id handler-fn))
-
+;; --  subscriptions ----------------------------------------------------------
 (def reg-sub             subs/reg-sub)
 (def subscribe           subs/subscribe)

 (def clear-sub    (partial registrar/clear-handlers subs/kind))
 (def clear-subscription-cache! subs/clear-subscription-cache!)

-;; -- effects
+(defn reg-sub-raw
+  "This is a low level, advanced function.  You should probably be
+  using reg-sub instead.
+  Docs in https://github.com/Day8/re-frame/blob/master/docs/SubscriptionFlow.md"
+  [query-id handler-fn]
+  (registrar/register-handler subs/kind query-id handler-fn))
+
+
+;; -- effects -----------------------------------------------------------------
 (def reg-fx      fx/register)
 (def clear-fx    (partial registrar/clear-handlers fx/kind))

-;; -- coeffects
+;; -- coeffects ---------------------------------------------------------------
 (def reg-cofx    cofx/register)
 (def inject-cofx cofx/inject-cofx)
 (def clear-cofx (partial registrar/clear-handlers cofx/kind))

-;; --  Events
+;; --  Events -----------------------------------------------------------------
 (def clear-event (partial registrar/clear-handlers events/kind))

 (defn reg-event-db
-  "Register the given `id`, typically a keyword, with the combination of
+  "Register the given `id`, typically a namespaced keyword, with the combination of
   `db-handler` and an interceptor chain.
   `db-handler` is a function: (db event) -> db
   `interceptors` is a collection of interceptors, possibly nested (needs flattening).
-  `db-handler` is wrapped in an interceptor and added to the end of the chain, so in the end
-   there is only a chain.
+  `db-handler` is wrapped in an interceptor and added to the end of the chain, so
+   that, in the end, there is only a chain.
    The necessary effects and coeffects handler are added to the front of the
    interceptor chain.  These interceptors ensure that app-db is available and updated."
   ([id db-handler]
@@ -103,7 +81,38 @@
    (events/register id [cofx/inject-db fx/do-fx interceptors (ctx-handler->interceptor handler)])))

-;; --  Logging -----
+;; -- interceptors ------------------------------------------------------------
+
+;; Standard interceptors. Detailed docs in std-interceptors.cljs
+(def debug       std-interceptors/debug)
+(def path        std-interceptors/path)
+(def enrich      std-interceptors/enrich)
+(def trim-v      std-interceptors/trim-v)
+(def after       std-interceptors/after)
+(def on-changes  std-interceptors/on-changes)
+
+
+;; utility functions - for creating your own interceptors
+;;
+;;  (def some-interceptor
+;;     (->interceptor                ;; used to create an interceptor
+;;       :id     :my-interceptor     ;; an id - decorative only
+;;       :before (fn [context]                         ;; you normally want to change :coeffects
+;;                  ... use get-coeffect  and assoc-coeffect
+;;                       )
+;;       :after  (fn [context]                         ;; you normally want to change :effects
+;;                 (let [db (get-effect context :db)]  ;; (get-in context [:effects :db])
+;;                   (assoc-effect context :http-ajax {...}])))))
+;;
+(def ->interceptor   interceptor/->interceptor)
+(def get-coeffect    interceptor/get-coeffect)
+(def assoc-coeffect  interceptor/assoc-coeffect)
+(def get-effect      interceptor/get-effect)
+(def assoc-effect    interceptor/assoc-effect)
+(def enqueue         interceptor/enqueue)
+
+
+;; --  logging ----------------------------------------------------------------
 ;; Internally, re-frame uses the logging functions: warn, log, error, group and groupEnd
 ;; By default, these functions map directly to the js/console implementations,
 ;; but you can override with your own fns (set or subset).
@@ -120,7 +129,7 @@
 (def console loggers/console)

-;; -- State Restoration For Unit Tests
+;; -- unit testing ------------------------------------------------------------

 (defn make-restore-fn
   "Checkpoints the state of re-frame and returns a function which, when
@@ -148,7 +157,7 @@
       nil)))

-;; -- Event Processing Callbacks
+;; -- Event Processing Callbacks  ---------------------------------------------

 (defn add-post-event-callback
   "Registers a function `f` to be called after each event is processed
@@ -176,7 +185,7 @@
   (router/remove-post-event-callback re-frame.router/event-queue id))

-;; --  Deprecation Messages
+;; --  Deprecation ------------------------------------------------------------
 ;; Assisting the v0.0.7 ->  v0.0.8 transition.
 (defn register-handler
   [& args]


Improve comments around logging

Improve comments around logging

--- src/re_frame/core.cljs
+++ src/re_frame/core.cljs
@@ -3,6 +3,7 @@
     [re-frame.handlers   :as handlers]
     [re-frame.subs       :as subs]
     [re-frame.router     :as router]
+    [re-frame.utils      :as utils]
     [re-frame.middleware :as middleware]))

@@ -34,12 +35,12 @@

 ;; --  Logging -----
-;; re-frame uses a few utility logging functions: warn, log, error, group and groupEnd
-;; By default they use the js/console implementations
-;; But you can override:
+;; re-frame uses the logging functions: warn, log, error, group and groupEnd
+;; By default, these functions map directly to the js/console implementations
+;; But you can override with your own (set or subset):
 ;;   (set-loggers!  {:warn  my-warn   :log  my-looger ...})
-;; The functions you supply will be given a string.
 (def set-loggers! utils/set-loggers!)
+

 ;; --  Convenience API -------


Use array for notify

Use array for notify

--- src/reagent/ratom.cljs
+++ src/reagent/ratom.cljs
@@ -7,8 +7,8 @@
 (declare ^:dynamic *ratom-context*)
 (defonce ^boolean debug false)
 (defonce ^boolean silent false)
-(defonce generation 0)
-(defonce -running (clojure.core/atom 0))
+(defonce ^:private generation 0)
+(defonce ^:private -running (clojure.core/atom 0))

 (defn ^boolean reactive? []
   (not (nil? *ratom-context*)))
@@ -75,7 +75,7 @@
                  (recur (inc i))
                  false))))))

-(def reaction-counter 0)
+(def ^:private reaction-counter 0)

 (defn- reaction-key [r]
   (if-some [k (.-reaction-id r)]
@@ -90,19 +90,34 @@
   new)

 (defn- add-w [this key f]
+  (set! (.-watchesArr this) nil)
   (let [w (.-watches this)]
     (set! (.-watches this) (check-watches w (assoc w key f)))))

 (defn- remove-w [this key]
+  (set! (.-watchesArr this) nil)
   (let [w (.-watches this)
         r -running]
     (set! (.-watches this) (check-watches w (dissoc w key)))))

 (defn- notify-w [this old new]
-  (reduce-kv (fn [_ k f]
-               (f k this old new)
-               nil)
-             nil (.-watches this))
+  (let [w (.-watchesArr this)
+        a (if (nil? w)
+            (set! (.-watchesArr this) (array))
+            w)]
+    (when (nil? w)
+      ;; Copy watches to an array for speed
+      (reduce-kv (fn [_ k f]
+                   (.push a k)
+                   (.push a f))
+                 nil (.-watches this)))
+    (let [len (alength a)]
+      (loop [i 0]
+        (when (< i len)
+          (let [k (aget a i)
+                f (aget a (inc i))]
+            (f k this old new))
+          (recur (+ 2 i))))))
   nil)

 (defn- pr-atom [a writer opts s]
@@ -113,8 +128,8 @@

 ;;; Queueing

-(defonce rea-queue nil)
-(def empty-context #js{})
+(defonce ^:private rea-queue nil)
+(def ^:private empty-context #js{})

 (defn- rea-enqueue [r]
   (when (nil? rea-queue)


Use node ID as well as URL from session reqs.

--- src/shale/sessions.clj
+++ src/shale/sessions.clj
@@ -145,7 +145,7 @@
                            [:tags :reserved :browser-name :current-url])
                 (if-let [node-id (get-in session-model [:node :id])]
                   {:node-id node-id}))
-     :node (select-keys (:node session-model) [:tags :url])}
+     :node (select-keys (:node session-model) [:tags :url :id])}
     [:and
      (vec
        (concat
@@ -173,7 +173,7 @@
       :node-tag     (some #{arg} (get-in s [:node :tags]))
       :id           (= arg (get-in s [:id]))
       :webdriver-id (= arg (get-in s [:session :webdriver-id]))
-      :node-id      (= arg (get-in s [:session :node-id]))
+      :node-id      (= arg (get-in s [:session :node :id]))
       :reserved     (= arg (get-in s [:session :reserved]))
       :browser-name (= arg (get-in s [:session :browser-name]))
       :current-url  (= arg (get-in s [:session :current-url]))


Log whenever resuming a webdriver fails.

--- src/shale/sessions.clj
+++ src/shale/sessions.clj
@@ -283,10 +283,11 @@
   Throws an exception on timeout, but blocks forever by default."
   [session-id & {:keys [timeout]}]
   (if-let [model (view-model session-id)]
-    (let [resume-args (map-indexed
+    (let [node-url (get-in model [:node :url])
+          resume-args (map-indexed
                         (fn [index e] (if (= index 2) {"browserName" e} e))
                         [(model :id)
-                         (get-in model [:node :url])
+                         node-url
                          :browser-name])
           future-wd (future (apply resume-webdriver resume-args))
           wd (if (nil? timeout)
@@ -295,8 +296,16 @@
       (if (= wd ::timeout)
         (do
           (future-cancel future-wd)
+          ;; TODO send to riemann
+          (warn (format
+                  "Timeout resuming session %s after %d ms against node %s"
+                  session-id
+                  timeout
+                  node-url))
           (throw (ex-info "Timeout resuming session."
-                          {:session-id session-id :timeout timeout})))
+                          {:session-id session-id
+                           :timeout timeout
+                           :node-url node-url})))
         wd))
     (throw (ex-info "Unknown session id."
                     {:session-id session-id}))))


Rendering tweaks

Rendering tweaks

--- src/snergly/image.cljs
+++ src/snergly/image.cljs
@@ -8,7 +8,19 @@
 ;;
 ;; Any variable called 'g' is a CanvasRenderingContext2D object.

-(def optimize-drawing false)
+(def optimize-drawing true)
+
+;; To debug the optimized drawing:
+;; * set snergly.image/optimize-drawing to true
+;; * set snergly.core/sync-by-frame to false
+;; * in snergly.core/sync-chan, change the parameter of async/timeout
+;;   from 0 to 1000.
+;;
+;; When I do this, I can tell that the cell background starts too far up
+;; and to the left, so that redrawing the background makes the top and left
+;; borders half-width.  And the right and left borders, if they are drawn,
+;; become progressively thicker; I think this is just because of the canvas
+;; drawing strokes with translucency for some reason, even

 (defn fill-rect [g style x y w h]
   (aset g "fillStyle" style)
@@ -32,19 +44,22 @@
   {:distances g/Distances
    :color-family s/Keyword})

+(def strokewidth 1.0)
+
 (s/defn draw-cell-backgrounds [g
                                grid :- g/Grid
                                cell-size :- g/NonNegativeInt
                                background :- s/Str
                                distance-maps :- [DistanceMap]
                                changed-cells]
-  (println (str "Drawing backgrounds for " (count changed-cells) " cells."))
   (doseq [coord changed-cells]
     (let [{:keys [distances color-family max-distance] :as distance-map} (first (filter #(contains? (:distances %) coord) distance-maps))
           [y x] (map #(* % cell-size) coord)
           cell (g/grid-cell grid coord)
-          w (if (g/linked? cell (:east cell)) (inc cell-size) cell-size)
-          h (if (g/linked? cell (:south cell)) (inc cell-size) cell-size)
+          x (if (g/linked? cell (:west cell)) (- x 0.5) x)
+          y (if (g/linked? cell (:north cell)) (- y 0.5) y)
+          w (if (g/linked? cell (:east cell)) (+ cell-size 0.5) cell-size)
+          h (if (g/linked? cell (:south cell)) (+ cell-size 0.5) cell-size)
           color (if distance-map
                   (util/make-color max-distance (distances coord) color-family)
                   background)]
@@ -55,7 +70,6 @@
                          cell-size :- g/NonNegativeInt
                          wall :- s/Str
                          changed-cells]
-  (println (str "Drawing walls for " (count changed-cells) " cells."))
   (doseq [coord changed-cells]
     (let [[y1 x1] (map #(* % cell-size) coord)
           [y2 x2] (map #(+ % cell-size) [y1 x1])
@@ -95,11 +109,11 @@
                     wall :- s/Str
                     distance-maps :- [DistanceMap]
                     path-map :- (s/maybe PathMap)]
-  (let [changed-cells (or (when-not optimize-drawing (g/grid-coords grid))
+  (let [changed-cells (or (when-not optimize-drawing (set (g/grid-coords grid)))
                           (when path-map (:changed-cells (:distances path-map)))
                           (first (map (comp :changed-cells :distances) distance-maps))
                           (:changed-cells grid)
-                          (g/grid-coords grid))]
+                          (set (g/grid-coords grid)))]
     (draw-cell-backgrounds g grid cell-size background distance-maps changed-cells)
     (draw-cell-walls g grid cell-size wall changed-cells)
     (when path-map (draw-path g cell-size path-map changed-cells))
@@ -119,7 +133,7 @@
         ]
     (aset g "imageSmoothingEnabled" false)
     (aset g "fillStyle" background)
-    (aset g "lineWidth" 1)
+    (aset g "lineWidth" strokewidth)
     (when (g/new? grid) (fill-rect g background 0 0 img-width img-height))
     (draw-cells g grid cell-size background wall (remove nil? [dist2 dist1]) path)
     )


Handle the case when variables are empty string, due to hack job on client

--- src/bgg_graphql_proxy/server.clj
+++ src/bgg_graphql_proxy/server.clj
@@ -6,7 +6,8 @@
     [clojure.java.io :as io]
     [clojure.data.json :as json]
     [com.walmartlabs.graphql :refer [execute]]
-    [ring.util.response :as response]))
+    [ring.util.response :as response]
+    [clojure.string :as str]))

 (defn ^:private index-handler
@@ -20,9 +21,10 @@

   Returns a map of the variables (using keyword keys)."
   [request]
-  (if-let [vars (get-in request [:query-params :variables])]
-    (json/read-str vars :key-fn keyword)
-    {}))
+  (let [vars (get-in request [:query-params :variables])]
+    (if-not (str/blank? vars)
+      (json/read-str vars :key-fn keyword)
+      {})))

 (defn extract-query
   [request]


dev notes

dev notes

--- figwheel-repl/src/figwheel/repl.cljc
+++ figwheel-repl/src/figwheel/repl.cljc
@@ -880,8 +880,7 @@
 ;; TODOS
 ;; - learn more about https
 ;; - make work on node and other platforms
-;; - make http polling connection as backup
-;; - make http polling connection a ring handler
+;; - make complete dev webserver stack

 (comment
   (def serve (run-server not-found {:port 9500 :join? false}))
@@ -895,9 +894,9 @@

   (evaluate re "33")

-  (mapv #(do #_(Thread/sleep 1)
-             (evaluate re (str %)))
-        (range 100))
+  (= (mapv #(:value (evaluate re (str %)))
+           (range 100))
+     (range 100))

 (def x (ping (first (vals @*connections*))))


aspect of this verb should be constrained to be :simple, not :progressive

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -155,7 +155,7 @@
                      :intransitivize false
                      :transitivize false
                      :synsem {:agr subj-agr
-                              :sem {:aspect :progressive
+                              :sem {:aspect :simple
                                     :pred :be-called
                                     :reflexive true
                                     :subj the-real-subj


"be born" is intransitive

"be born" is intransitive

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -237,7 +237,8 @@
                           :sem {:pred :be-able-to}}}

    "be born" {:synsem {:cat :verb
-                       :sem {:pred :be-born}}
+                       :sem {:pred :be-born}
+                       :subcat {:2 '()}}
               :english {:future "be born"
                         :participle "being born"
                         :conditional "be born"


expand jar quarantine

expand jar quarantine

didn't expect distributed jar files to contain multiple
compiled cljs.core versions but apparently that also exists.

--- src/main/shadow/build/classpath.clj
+++ src/main/shadow/build/classpath.clj
@@ -601,33 +601,36 @@
 ;;   cljs-bean.from.cljs.core
 ;; ns that needs to be accounted for and not quarantined
 ;; will be filtered at a later stage if the ns does not match the filename
-(defn quarantine-bad-jar-contents [^File jar-file resources]
+(defn quarantine-bad-jar-contents [^File jar-file banned-name resources]
   (let [bad
         (->> resources
              (filter (fn [{:keys [resource-name] :as rc}]
-                       (str/ends-with? resource-name "/cljs/core.js")))
-             (first))]
-
-    (if-not bad
+                       (str/ends-with? resource-name banned-name))))]
+
+    (if-not (seq bad)
       resources
       ;; .jar file contains a compiled version of cljs.core
       ;; filter out all sources in that directory, likely contains many other compiled
       ;; and uncompiled sources
-      (let [{:keys [resource-name]} bad
-            bad-prefix (subs resource-name 0 (str/index-of resource-name "cljs/core.js"))
-
-            filtered
-            (->> resources
-                 (remove (fn [{:keys [resource-name] :as rc}]
-                           (str/starts-with? resource-name bad-prefix)))
-                 (vec))]
-
-        (log/warn ::bad-jar-contents
-          {:jar-file (.getAbsolutePath jar-file)
-           :bad-prefix bad-prefix
-           :bad-count (- (count resources) (count filtered))})
-
-        filtered))))
+      (reduce
+        (fn [resources {:keys [resource-name] :as bad-rc}]
+          (let [bad-prefix
+                (subs resource-name 0 (str/index-of resource-name banned-name))
+
+                filtered
+                (->> resources
+                     (remove (fn [{:keys [resource-name] :as rc}]
+                               (str/starts-with? resource-name bad-prefix)))
+                     (vec))]
+
+            (log/warn ::bad-jar-contents
+              {:jar-file (.getAbsolutePath jar-file)
+               :bad-prefix bad-prefix
+               :bad-count (- (count resources) (count filtered))})
+
+            filtered))
+        resources
+        bad))))

 (defn find-jar-resources
   [{:keys [manifest-cache-dir] :as cp} ^File jar-file]
@@ -659,7 +662,8 @@

         (let [jar-contents
               (->> (find-jar-resources* cp jar-file checksum)
-                   (quarantine-bad-jar-contents jar-file)
+                   (quarantine-bad-jar-contents jar-file "/cljs/core.js")
+                   (quarantine-bad-jar-contents jar-file "/goog/base.js")
                    (process-root-contents cp jar-file))]
           (io/make-parents mfile)
           (try


when creating English lexemes from :source part of lexeme, discard everything in parentheses (including the parentheses themselves)

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -667,11 +667,13 @@
                               vocab-cat :vocab_cat}]
   ;; add some additional constraints that we should not need (should be in compile-lex)
   ;; TODO: remove need to add these constraints.
-  (cond (clojure.string/starts-with? vocab-cat "noun")
-        {surface
-         [{:synsem {:sem {:pred (keyword pred)}
-                    :propernoun false
-                    :pronoun false
-                    :subcat {:1 {:cat :det}}
-                    :cat :noun}}]}
-        true {}))
+  (let [surface (clojure.string/replace surface #"\s*\(.*$" "")]
+    (cond (clojure.string/starts-with? vocab-cat "noun")
+          {surface
+           [{:synsem {:sem {:pred (keyword pred)}
+                      :propernoun false
+                      :pronoun false
+                      :subcat {:1 {:cat :det}}
+                      :cat :noun}}]}
+          true {})))
+


add subcategorization for various verbs

add subcategorization for various verbs

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -271,7 +271,8 @@
                                   :3plur "are born"}}}

    "be missed" {:synsem {:cat :verb
-                         :sem {:pred :mancare}}
+                         :sem {:pred :mancare}
+                         :subcat {:2 '()}}
                 :english {:future "be missed"
                           :participle "being missed"
                           :conditional "be missed"
@@ -482,11 +483,13 @@
                        :sem {:pred :comment}}}

    "confess" {:synsem {:cat :verb
-                       :sem {:pred :confess}}}
-
+                       :sem {:pred :confess}
+                       :subcat {:2 {:cat :prep
+                                    :sem {:pred :to}}}}}
    "consent" {:synsem {:cat :verb
-                        :sem {:pred :consent}}}
-
+                       :sem {:pred :consent}
+                       :subcat {:2 {:cat :prep
+                                    :sem {:pred :to}}}}}
    "conserve" {:synsem {:cat :verb
                         :sem {:pred :conserve}}}

@@ -519,8 +522,13 @@
           :synsem {:cat :verb
                    :sem {:pred :cut}}}

-   "dance" {:synsem {:cat :verb
-                      :sem {:pred :dance}}}
+   "dance" [{:synsem {:cat :verb
+                      :sem {:pred :dance}
+                      :subcat {:2 {:cat :prep
+                                   :sem {:pred :with}}}}}
+            {:synsem {:cat :verb
+                      :sem {:pred :dance
+                            :subcat {:2 '()}}}}]

    "decide" {:synsem {:cat :verb
                       :sem {:pred :decide}}}
@@ -541,7 +549,8 @@
                       :sem {:pred :dictate}}}

    "dine" {:synsem {:cat :verb
-                    :sem {:pred :cenare}}}
+                    :sem {:pred :cenare}
+                    :subcat {:2 '()}}}

    "displace" {:synsem {:cat :verb
                 :sem {:pred :displace}}}
@@ -619,8 +628,8 @@
                        :sem {:pred :express}}}

    "faint" {:synsem {:cat :verb
-                     :sem {:pred :faint}}}
-
+                     :sem {:pred :faint}
+                     :subcat {:2 '()}}}
    "fall asleep"
    (let [subject-semantics (atom :top)]
      {:synsem {:cat :verb
@@ -1206,11 +1215,16 @@
                           :present {:3sing "listens to"}}}

    "live" {:synsem {:cat :verb
-                    :sem {:pred :live}}}
-
-   "look" {:synsem {:cat :verb
-                    :sem {:pred :look}}}
-
+                    :sem {:pred :live}
+                    :subcat {:2 '()}}}
+
+   "look" {:share-sem :obj
+           :synsem {:cat :verb
+                    :sem {:pred :look
+                          :subcat {:2 {:cat :prep
+                                       :sem {:pred :at}}}}}}
+
+   ;; TODO: combine all "look X" into "look" with different subcategorizations
    "look for" {:synsem {:cat :verb
                         :sem {:pred :cercare}}
                :english {:participle "looking for"
@@ -1428,7 +1442,8 @@
                       :sem {:pred :paint}}}

    "participate"  {:synsem {:cat :verb
-                            :sem {:pred :participate}}}
+                            :sem {:pred :participate}
+                            :subcat {:2 '()}}}

    "party" [{:synsem {:cat :noun
                       :sem {:pred :party
@@ -1712,7 +1727,8 @@
                              :2 '()}}})

    "snap" {:synsem {:cat :verb
-                    :sem {:pred :snap-pictures}}
+                    :sem {:pred :snap-pictures}
+                    :subcat {:2 {:sem {:pred :picture}}}}
            :english {:past "snapped"
                      :participle "snapping"
                      :note "pictures"}}


+"turn on"

+"turn on"

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2134,7 +2134,12 @@
     :english {:past "turned off"
               :present {:3sing "turns off"}
               :participle "turning off"}}
-
+   "turn on"
+   {:synsem {:cat :verb
+             :sem {:pred :turn-on}}
+    :english {:past "turned on"
+               :present {:3sing "turns on"}
+              :participle "turning on"}}

     "understand" (let [common {:english {:past "understood"}}]
                   [(unify


add 'else' for structure, where needed

add 'else' for structure, where needed

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -680,6 +680,14 @@
                           :pronoun false
                           :subcat {:1 {:cat :det}}}}

+                structure (if (= "" (dag_unify.core/get-in structure [:english :plur]))
+                            (dag_unify.core/dissoc-paths structure [[:english :plur]])
+                            structure)
+
+                structure (if (= :unspec (dag_unify.core/get-in structure [:synsem :cat]))
+                            (dag_unify.core/dissoc-paths structure [[:synsem :cat]])
+                            structure)
+
                 with-structure
                 (if structure (unify base-unify structure)
                     base-unify)]


i don't remember what I changed!

i don't remember what I changed!

--- src/babel/espanol/lexicon.cljc
+++ src/babel/espanol/lexicon.cljc
@@ -152,7 +152,20 @@
              {:synsem {:cat :verb
                        :sem {:pred :look-up}}}]
    "caber" {}
-   "caerse" {}
+   "caerse" (let [subject-semantics (atom {:human true})
+         subject-agr (atom :top)]
+     {:espanol {:boot-stem "diviert"}
+      :synsem {:cat :verb
+               :sem {:pred :have-fun
+                     :reflexive true
+                     :subj subject-semantics
+                     :obj subject-semantics}
+               :subcat {:1 {:agr subject-agr
+                            :sem subject-semantics}
+                        :2 {:agr subject-agr
+                            :pronoun true
+                            :reflexive true
+                            :sem subject-semantics}}}})

    "cambiar" {:synsem {:cat :verb
                        :sem {:pred :change}}}


Ensure aggregations are not nil

Ensure aggregations are not nil

--- src/cfpb/qu/data/aggregation.clj
+++ src/cfpb/qu/data/aggregation.clj
@@ -79,10 +79,11 @@

   If you want map and reduce already stringified, to send through
   Monger, run `generate-map-reduce`."
-  [{:keys [dataset from to group aggregations filter slicedef] :or {aggregations {}}}]
-  {:pre [(every? #(not (nil? %)) [dataset from to group aggregations])
+  [{:keys [dataset from to group aggregations filter slicedef] :as aggmap}]
+  {:pre [(every? #(not (nil? %)) [dataset from to group])
          (sequential? group)]}
-  (let [field-zip-fn (if slicedef
+  (let [aggregations (or aggregations {})
+        field-zip-fn (if slicedef
                        (field-zip-fn slicedef)
                        identity)
         query (if filter


Adds autocomplete off to training input.

--- src/cadence/views/training.clj
+++ src/cadence/views/training.clj
@@ -25,6 +25,7 @@
              [:form#trainer.row-fluid
               (common/input {:type "text"
                              :eclass ".phrase.input-xlarge.span12"
+                             :params {:autocomplete "off"}
                              :name (str "phrase-"
                                         (sess/get :train-count))
                              :placeholder phrase})]))


Switch order of :idf and :document-names in docstring.

--- project/analyze-data/src/analyze_data/corpus_to_tf_idf.clj
+++ project/analyze-data/src/analyze_data/corpus_to_tf_idf.clj
@@ -25,10 +25,10 @@

   Return a map of the following form:
   {:all-terms  [term1 term2 ...]
-   :document-names [item1 item2 ...]
    :idf        {term1 value
                 term2 value
                 ...}
+   :document-names [item1 item2 ...]
    :tf-idf     [[term1-value term2-value ...]
                 [term1-value term2-value ...]
                 ...]}


DOC: add headers for exercise 1

DOC: add headers for exercise 1

--- src/clj_prj03/ch6_additional.clj
+++ src/clj_prj03/ch6_additional.clj
@@ -36,6 +36,9 @@
   (fn [& args]
     (f (apply g args))))

+;; Exercise 1: Create a new function called attr that can be
+;; called like (attr :intelligence)
+
 (defn attr
   [attr-name]
   (fn [x] (attr-name (:attributes x))))


allow for nil account value

allow for nil account value

--- src/cljc/clj_money/accounts.cljc
+++ src/cljc/clj_money/accounts.cljc
@@ -24,7 +24,7 @@
     (assoc account
            :children-value children-value
            :total-value (+ children-value
-                           (:value account))
+                           (or (:value account) 0M))
            :has-children? true)))

 (defn nest


Refresh async channel for block-event

Refresh async channel for block-event

--- src/clojure_fabric/event_hub.clj
+++ src/clojure_fabric/event_hub.clj
@@ -189,11 +189,13 @@

 (defn register-block-event
   [fn-name fn]
-  (swap! block-event-handlers assoc fn-name fn))
+  (swap! block-event-handlers assoc fn-name fn)
+  (async/put! command-ch :refresh))

 (defn unregister-block-event
   [fn-name]
-  (swap! block-event-handlers dissoc fn-name))
+  (swap! block-event-handlers dissoc fn-name)
+  (async/put! command-ch :refresh))

 (defn- %unregister-event
   [id ref]
@@ -246,8 +248,8 @@

             (instance? Block v)
             (doseq [f @block-event-handlers]
-                  (utils/ignore-errors
-                   (f v)))
+              (utils/ignore-errors
+               (f v)))

             (instance? TxEvent v)
             (utils/ignore-errors


* handler.clj (cleanup-name): More cleanup. (generate-markers): Better formatting of popups.

--- src/wlmmap/handler.clj
+++ src/wlmmap/handler.clj
@@ -27,7 +27,7 @@

 (defn- cleanup-name [n]
   (-> n
-      (clojure.string/replace #"[[\|]]" "")
+      (clojure.string/replace #"^\[\[|\]\]" "")
       (clojure.string/replace #"[\n\r]" "")
       (clojure.string/replace #"\"" "\\\\\"")))

@@ -40,7 +40,7 @@
 (defn- generate-markers
   "return a string with the javascript code to generate addressPoints."
   [params]
-  (let [mons (take 10000 (wcar* (car/smembers "frfr")))
+  (let [mons (take 100 (wcar* (car/smembers "frfr")))
         all (remove #(nil? %)
                     (for [m mons]
                       (let [res (read-string (wcar* (car/get m)))
@@ -55,14 +55,15 @@
                             emb (str "")
                             ilk (if (not (= imc ""))
-                                  (str "" "Wikimedia image" "") "")
+                                  (str "" emb "") "")
                             art (:monument_article res)
-                            arl (str "<a href=\\\"http://" lng ".wikipedia.org/wiki/" art "")
-                            src (format "%s" reg id)]
+                            arl (format "%s" lng art art)
+                            src (format "Source: %s" reg id)]
                         (when (and lat lon nam)
-                          (format "[%s,%s,\"%s\"]" lat lon (str "
" nam "
" emb "
" ilk
-                                                                "
" src "
" (if art arl "")))))))]
+                          (format "[%s,%s,\"%s\"]" lat lon (str "
" nam "
"
+                                                                ilk "
" (if art (str arl "
") "")
+                                                                src "
"))))))]
     (str "var addressPoints = [" (str/join "," all) "];")))

 (defn- index [params]