don't log/warn if sequence is empty

don't log/warn if sequence is empty

--- src/babel/korma.clj
+++ src/babel/korma.clj
@@ -50,12 +50,12 @@

               true
               (do
-                (log/warn (str "using default of 'text' as SQL type for"
-                               " sequence of type:" (type sequence)
-                               (if (not (empty? sequence))
+                (if (not (empty? sequence))
+                  (log/warn (str "using default of 'text' as SQL type for"
+                                 " sequence of type:" (type sequence)
                                  (str " whose first member is of type:"
-                                      (type (first sequence))))
-                               "."))
+                                      (type (first sequence)))
+                                 ".")))
                 {:type "text"
                  :map-fn (fn [x] x)}))
         sql-type (:type sql-type-and-map-fn)


Stupid

Stupid

--- src/korhal/core.clj
+++ src/korhal/core.clj
@@ -50,8 +50,6 @@

 (defn korhal-gameUpdate [this]

-  (println "updating")
-
   ;; spawn a drone
   (doseq [unit (.getMyUnits (:api @(.state this)))]
     (when (= (.getTypeID unit) (.getID jnibwapi.types.UnitType$UnitTypes/Zerg_Larva))
@@ -65,7 +63,7 @@
     (when (= (.getTypeID unit) (.getID jnibwapi.types.UnitType$UnitTypes/Zerg_Drone))
       (when (and (.isIdle unit) (not (= (.getID unit) (:pool-drone @(.state this)))))
         (let [mineral? (fn [unit] (= (.getTypeID unit) (.getID jnibwapi.types.UnitType$UnitTypes/Resource_Mineral_Field)))
-              minerals (first (filter mineral? (.getNeutralUnits (:api @(.state this)))))
+              minerals (filter mineral? (.getNeutralUnits (:api @(.state this))))
               closest-mineral (first (filter #(< (dist unit %) 300) minerals))]
           (.rightClick (:api @(.state this)) (.getID unit) (.getID closest-mineral)))))))


remove old comment about goog.editor stuff in models

--- src/app/cljs/one/sample/model.cljs
+++ src/app/cljs/one/sample/model.cljs
@@ -3,9 +3,6 @@
   one.sample.model
   (:require [one.dispatch :as dispatch]
             [local        :as local]))
-;; Note: ns aliases for goog.editor.Field and goog.editor.SeamlessField do not
-;; work due to there being no goog/editor/editor.js file that provides goog.editor
-;; in the Google Closure Library.

 (def ^{:doc "An atom containing a map which is the application's current state."}
   state (atom {}))


Backtick docs.

Backtick docs.

--- doc/information_model.clj
+++ doc/information_model.clj
@@ -176,7 +176,7 @@
    :type :boolean
    :optional? true
    :default false
-   :restrictions ["Any entry that has :flow/short-circuit? set to true must come before any entries for an task that have it set to false or nil."]}
+   :restrictions ["Any entry that has `:flow/short-circuit?` set to `true` must come before any entries for an task that have it set to false or nil."]}

   :flow/thrown-exception?
   {:doc "If an exception is thrown from an Onyx transformation function, you can capture it from within your flow conditions by setting this value to `true`. If an exception is thrown, only flow conditions with `:flow/thrown-exception?` set to `true` will be evaluated. The value that is normally the segment which is sent to the predicate will be the exception object that was thrown. Note that exceptions don't serialize. This feature is meant to be used in conjunction with Post-transformations and Actions for sending exception values to downstream tasks."
@@ -465,13 +465,13 @@
   {:doc "The Clojure function to use for messaging decompression. Receives one argument - a byte array. Must return the decompressed value of the byte array."
    :optional? true
    :type :function
-   :default onyx.compression.nippy/decompress}
+   :default 'onyx.compression.nippy/decompress}

   :onyx.messaging/compress-fn
   {:doc "The Clojure function to use for messaging compression. Receives one argument - a sequence of segments. Must return a byte array representing the segment seq."
    :optional? true
    :type :function
-   :default onyx.compression.nippy/compress}
+   :default 'onyx.compression.nippy/compress}

   :onyx.messaging/impl
   {:doc "The messaging protocol to use for peer-to-peer communication."


App Engine SDK 1.7 breaks console URLs, as always.

--- src/appengine_magic/core_local.clj
+++ src/appengine_magic/core_local.clj
@@ -98,36 +98,63 @@
              (com.google.appengine.api.blobstore.dev.ServeBlobFilter.)]}
       {"/" handler-servlet
        ;; These mappings are from webdefault.xml in appengine-local-runtime-*.jar.
+       "/_ah/admin" (com.google.apphosting.utils.servlet.DatastoreViewerServlet.)
+       "/_ah/admin/backends" (com.google.apphosting.utils.servlet.ServersServlet.)
+       "/_ah/admin/capabilitiesstatus" (com.google.apphosting.utils.servlet.CapabilitiesStatusServlet.)
+       "/_ah/admin/datastore" (com.google.apphosting.utils.servlet.DatastoreViewerServlet.)
+       "/_ah/admin/inboundmail" (com.google.apphosting.utils.servlet.InboundMailServlet.)
+       "/_ah/admin/search" (com.google.apphosting.utils.servlet.SearchServlet.)
+       "/_ah/admin/taskqueue" (com.google.apphosting.utils.servlet.TaskQueueViewerServlet.)
+       "/_ah/admin/xmpp" (com.google.apphosting.utils.servlet.XmppServlet.)
+       "/_ah/adminConsole" (org.apache.jsp.ah.adminConsole_jsp.)
+       "/_ah/backendsBody" (org.apache.jsp.ah.backendsBody_jsp.)
+       "/_ah/backendsFinal" (org.apache.jsp.ah.backendsFinal_jsp.)
+       "/_ah/backendsHead" (org.apache.jsp.ah.backendsHead_jsp.)
+       "/_ah/blobImage" (com.google.appengine.api.images.dev.LocalBlobImageServlet.)
+       "/_ah/blobUpload" (com.google.appengine.api.blobstore.dev.UploadBlobServlet.)
+       "/_ah/capabilitiesStatusBody" (org.apache.jsp.ah.capabilitiesStatusBody_jsp.)
+       "/_ah/capabilitiesStatusFinal" (org.apache.jsp.ah.capabilitiesStatusFinal_jsp.)
+       "/_ah/capabilitiesStatusHead" (org.apache.jsp.ah.capabilitiesStatusHead_jsp.)
+       "/_ah/capabilitiesViewer" (com.google.apphosting.utils.servlet.CapabilitiesStatusServlet.)
+       "/_ah/channel/jsapi" (com.google.appengine.api.channel.dev.ServeScriptServlet.)
+       "/_ah/channelLocalChannel" (com.google.appengine.api.channel.dev.LocalChannelServlet.)
+       "/_ah/datastoreViewer" (com.google.apphosting.utils.servlet.DatastoreViewerServlet.)
+       "/_ah/datastoreViewerBody" (org.apache.jsp.ah.datastoreViewerBody_jsp.)
+       "/_ah/datastoreViewerFinal" (org.apache.jsp.ah.datastoreViewerFinal_jsp.)
+       "/_ah/datastoreViewerHead" (org.apache.jsp.ah.datastoreViewerHead_jsp.)
+       "/_ah/entityDetailsBody" (org.apache.jsp.ah.entityDetailsBody_jsp.)
+       "/_ah/entityDetailsFinal" (org.apache.jsp.ah.entityDetailsFinal_jsp.)
+       "/_ah/entityDetailsHead" (org.apache.jsp.ah.entityDetailsHead_jsp.)
+       "/_ah/inboundmailBody" (org.apache.jsp.ah.inboundMailBody_jsp.)
+       "/_ah/inboundmailFinal" (org.apache.jsp.ah.inboundMailFinal_jsp.)
+       "/_ah/inboundmailHead" (org.apache.jsp.ah.inboundMailHead_jsp.)
+       "/_ah/indexDetailsBody" (org.apache.jsp.ah.indexDetailsBody_jsp.)
+       "/_ah/indexDetailsFinal" (org.apache.jsp.ah.indexDetailsFinal_jsp.)
+       "/_ah/indexDetailsHead" (org.apache.jsp.ah.indexDetailsHead_jsp.)
        "/_ah/login" (com.google.appengine.api.users.dev.LocalLoginServlet.)
        "/_ah/logout" (com.google.appengine.api.users.dev.LocalLogoutServlet.)
-       "/_ah/upload/*" (servlet (blobstore-upload/make-blob-upload-handler war-root))
-       "/_ah/img/*" (com.google.appengine.api.images.dev.LocalBlobImageServlet.)
-       "/_ah/channel/jsapi" (com.google.appengine.api.channel.dev.ServeScriptServlet.)
-       "/_ah/channel/dev" (com.google.appengine.api.channel.dev.LocalChannelServlet.)
+       "/_ah/oauthAuthorizeToken" (com.google.appengine.api.users.dev.LocalOAuthAuthorizeTokenServlet.)
+       "/_ah/oauthGetAccessToken" (com.google.appengine.api.users.dev.LocalOAuthAccessTokenServlet.)
+       "/_ah/oauthGetRequestToken" (com.google.appengine.api.users.dev.LocalOAuthRequestTokenServlet.)
+       "/_ah/queue_deferred" (com.google.apphosting.utils.servlet.DeferredTaskServlet.)
+       "/_ah/resources" (com.google.apphosting.utils.servlet.AdminConsoleResourceServlet.)
+       "/_ah/searchDocumentBody" (org.apache.jsp.ah.searchDocumentBody_jsp.)
+       "/_ah/searchDocumentFinal" (org.apache.jsp.ah.searchDocumentFinal_jsp.)
+       "/_ah/searchDocumentHead" (org.apache.jsp.ah.searchDocumentHead_jsp.)
+       "/_ah/searchIndexBody" (org.apache.jsp.ah.searchIndexBody_jsp.)
+       "/_ah/searchIndexFinal" (org.apache.jsp.ah.searchIndexFinal_jsp.)
+       "/_ah/searchIndexHead" (org.apache.jsp.ah.searchIndexHead_jsp.)
+       "/_ah/searchIndexesListBody" (org.apache.jsp.ah.searchIndexesListBody_jsp.)
+       "/_ah/searchIndexesListFinal" (org.apache.jsp.ah.searchIndexesListFinal_jsp.)
+       "/_ah/searchIndexesListHead" (org.apache.jsp.ah.searchIndexesListHead_jsp.)
        "/_ah/sessioncleanup" (com.google.apphosting.utils.servlet.SessionCleanupServlet.)
-       "/_ah/admin" (com.google.apphosting.utils.servlet.DatastoreViewerServlet.)
-       "/_ah/admin/" (com.google.apphosting.utils.servlet.DatastoreViewerServlet.)
-       "/_ah/admin/datastore" (com.google.apphosting.utils.servlet.DatastoreViewerServlet.)
-       "/_ah/admin/taskqueue" (com.google.apphosting.utils.servlet.TaskQueueViewerServlet.)
-       "/_ah/admin/xmpp" (com.google.apphosting.utils.servlet.XmppServlet.)
-       "/_ah/admin/inboundmail" (com.google.apphosting.utils.servlet.InboundMailServlet.)
-       "/_ah/resources" (com.google.apphosting.utils.servlet.AdminConsoleResourceServlet.)
-       "/_ah/adminConsole" (org.apache.jsp.ah.adminConsole_jsp.)
-       "/_ah/datastoreViewerHead" (org.apache.jsp.ah.datastoreViewerHead_jsp.)
-       "/_ah/datastoreViewerBody" (org.apache.jsp.ah.datastoreViewerBody_jsp.)
-       "/_ah/datastoreViewerFinal" (org.apache.jsp.ah.datastoreViewerFinal_jsp.)
-       "/_ah/entityDetailsHead" (org.apache.jsp.ah.entityDetailsHead_jsp.)
-       "/_ah/entityDetailsBody" (org.apache.jsp.ah.entityDetailsBody_jsp.)
-       "/_ah/entityDetailsFinal" (org.apache.jsp.ah.entityDetailsFinal_jsp.)
-       "/_ah/taskqueueViewerHead" (org.apache.jsp.ah.taskqueueViewerHead_jsp.)
        "/_ah/taskqueueViewerBody" (org.apache.jsp.ah.taskqueueViewerBody_jsp.)
        "/_ah/taskqueueViewerFinal" (org.apache.jsp.ah.taskqueueViewerFinal_jsp.)
-       "/_ah/xmppHead" (org.apache.jsp.ah.xmppHead_jsp.)
+       "/_ah/taskqueueViewerHead" (org.apache.jsp.ah.taskqueueViewerHead_jsp.)
+       "/_ah/upload/*" (servlet (blobstore-upload/make-blob-upload-handler war-root))
        "/_ah/xmppBody" (org.apache.jsp.ah.xmppBody_jsp.)
        "/_ah/xmppFinal" (org.apache.jsp.ah.xmppFinal_jsp.)
-       "/_ah/inboundmailHead" (org.apache.jsp.ah.inboundMailHead_jsp.)
-       "/_ah/inboundmailBody" (org.apache.jsp.ah.inboundMailBody_jsp.)
-       "/_ah/inboundmailFinal" (org.apache.jsp.ah.inboundMailFinal_jsp.)}
+       "/_ah/xmppHead" (org.apache.jsp.ah.xmppHead_jsp.)}
       :port port
       :join? join?))))


Implemented run function, iterating until convergence is reached.

--- src/ai_playground/client/core.cljs
+++ src/ai_playground/client/core.cljs
@@ -90,7 +90,9 @@
     (enable-buttons false))
   (visualize))

-(defn run [])
+(defn run []
+  (step)
+  (when (not= (@state :next-step) :done) (recur)))

 (append-button (dom/query "#legend") "Clear" #(do (swap! state (constantly initial-state)) (visualize)))
 (append-button (dom/query "#legend") "Add Random Cluster" add-random-cluster)


refactored session, changed :documents-changed to :document-changed, which replaces deleted docs atom watcher

--- src/app/cljs/one/sample/model.cljs
+++ src/app/cljs/one/sample/model.cljs
@@ -14,13 +14,10 @@
 (def ^{:doc "An atom representing a collection of all open documents"}
   docs (atom {}))

-(add-watch docs :documents-state-key
-           (fn [k r o n]
-             (dispatch/fire :documents-changed n)))
-
-(dispatch/react-to #{:documents-changed}
+(dispatch/react-to #{:document-changed}
                    (fn [_ d]
-                     (local/set-item! "docs" d)))
+                     (swap! docs assoc (:id d) d)
+                     (local/set-item! "docs" @docs)))

 (defn uuid []
   (let [chars "0123456789abcdef"
@@ -30,19 +27,19 @@
 (defn now [] (.getTime (js/Date.)))

 (defn session [{:keys [who id content title mode cursor born]}]
-  (let [doc-state (atom {})
-        watch     (add-watch doc-state :doc-state-key
-                             (fn [k r o n]
-                               (swap! docs assoc (:id n) n)))
-        init      (swap! doc-state assoc
-                         :who who
-                         :id (or id (uuid))
-                         :content (or content "")
-                         :born (or born (now))
-                         :ts (now)
-                         :title title
-                         :mode (or mode "html")
-                         :cursor (or cursor 0))]
+  (let [doc-state (atom (merge {} {:who     who
+                                   :id      (or id (uuid))
+                                   :content (or content "")
+                                   :born    (or born (now))
+                                   :ts      (now)
+                                   :title   title
+                                   :mode    (or mode "html")
+                                   :cursor  (or cursor 0)}))]
+    (swap! state assoc :document (:id @doc-state))
+    (dispatch/fire :document-changed @doc-state)
+    (add-watch doc-state :doc-state-key
+               (fn [k r o n]
+                 (dispatch/fire :document-changed n)))
     (fn document [command & args]
       (condp = command
         :set! (let [[k v] args]


move (analyze) to top

move (analyze) to top

--- src/babel/francais/morphology.cljc
+++ src/babel/francais/morphology.cljc
@@ -19,7 +19,59 @@
 (declare get-string)
 (declare suffix-of)

-(declare conjugate)
+
+(defn analyze [surface-form lexicon]
+  "Analyze a single surface form into a set of lexical forms."
+  (concat (if (get lexicon surface-form)
+            (get lexicon surface-form))
+          (mapcat
+           (fn [replace-pattern]
+             (let [ ;; regular expression that matches the surface form
+                   from (nth (:p replace-pattern) 0)]
+               (log/debug (str "matching replace-pattern:" replace-pattern " against surface-form: " surface-form))
+               (if (re-matches from surface-form)
+                 (let [;; expression that is used by string/replace along with the first regexp and the surface form,
+                       ;; to create the lexical string
+                       to (nth (:p replace-pattern) 1)
+
+                       ;; unifies with the lexical entry to create the inflected form.
+                       unify-with (if (:u replace-pattern)
+                                    (:u replace-pattern)
+                                    :top) ;; default unify-with
+
+                       lex (string/replace surface-form from to)]
+                   (filter (fn [result] (not (= :fail result)))
+                           (map (fn [lexical-entry]
+                                  (unifyc unify-with lexical-entry))
+                                (get lexicon lex)))))))
+           replace-patterns)))
+
+(defn conjugate [infinitive unify-with]
+  "Conjugate an infinitive into a surface form by taking the first
+   element of replace-patterns where the element's :u unifies successfully with
+   unify-with."
+  (first
+   (take 1
+         (remove #(nil? %)
+                 (map
+                  (fn [replace-pattern]
+                    (let [from (nth (:g replace-pattern) 0)
+                          to (nth (:g replace-pattern) 1)
+                          unify-against (if (:u replace-pattern)
+                                          (:u replace-pattern)
+                                          :top)]
+                      (if (and from to
+                               (re-matches from infinitive)
+                               (not (fail? (unifyc unify-against
+                                                   unify-with))))
+                        (do
+                          (log/debug (str "matched infinitive: " infinitive))
+                          (log/debug (str "from: " from))
+                          (log/debug (str "to: " to))
+                          (log/debug (str "input spec: " (strip-refs unify-with)))
+                          (log/debug (str "pattern spec:"  (strip-refs unify-against)))
+                          (string/replace infinitive from to)))))
+                  replace-patterns)))))

 ;; TODO: separate part-of-speech -related functionality (e.g. the word is a verb) from
 ;; compositional functionality (e.g. the word has an :a and :b, so combine by concatenation, etc)
@@ -567,55 +619,3 @@
                   :lex lex})))
            replace-patterns)))

-(defn analyze [surface-form lexicon]
-  "Analyze a single surface form into a set of lexical forms."
-  (concat (if (get lexicon surface-form)
-            (get lexicon surface-form))
-          (mapcat
-           (fn [replace-pattern]
-             (let [ ;; regular expression that matches the surface form
-                   from (nth (:p replace-pattern) 0)]
-               (log/debug (str "matching replace-pattern:" replace-pattern " against surface-form: " surface-form))
-               (if (re-matches from surface-form)
-                 (let [;; expression that is used by string/replace along with the first regexp and the surface form,
-                       ;; to create the lexical string
-                       to (nth (:p replace-pattern) 1)
-
-                       ;; unifies with the lexical entry to create the inflected form.
-                       unify-with (if (:u replace-pattern)
-                                    (:u replace-pattern)
-                                    :top) ;; default unify-with
-
-                       lex (string/replace surface-form from to)]
-                   (filter (fn [result] (not (= :fail result)))
-                           (map (fn [lexical-entry]
-                                  (unifyc unify-with lexical-entry))
-                                (get lexicon lex)))))))
-           replace-patterns)))
-
-(defn conjugate [infinitive unify-with]
-  "Conjugate an infinitive into a surface form by taking the first
-   element of replace-patterns where the element's :u unifies successfully with
-   unify-with."
-  (first
-   (take 1
-         (remove #(nil? %)
-                 (map
-                  (fn [replace-pattern]
-                    (let [from (nth (:g replace-pattern) 0)
-                          to (nth (:g replace-pattern) 1)
-                          unify-against (if (:u replace-pattern)
-                                          (:u replace-pattern)
-                                          :top)]
-                      (if (and from to
-                               (re-matches from infinitive)
-                               (not (fail? (unifyc unify-against
-                                                   unify-with))))
-                        (do
-                          (log/debug (str "matched infinitive: " infinitive))
-                          (log/debug (str "from: " from))
-                          (log/debug (str "to: " to))
-                          (log/debug (str "input spec: " (strip-refs unify-with)))
-                          (log/debug (str "pattern spec:"  (strip-refs unify-against)))
-                          (string/replace infinitive from to)))))
-                  replace-patterns)))))


Fix start screen

Fix start screen

--- src/robinson/ui/components/robinson.clj
+++ src/robinson/ui/components/robinson.clj
@@ -1686,8 +1686,22 @@

 (zc/def-component StartText
   [this]
-  (let [{:keys [game-state]} (zc/props this)]
-    nil))
+  (let [{:keys [game-state]} (zc/props this)
+        start-text (sg/start-text game-state)]
+    (zc/csx
+	  [:terminal {} [
+		[:group {:id :app} [
+		  [:layer {:id :ui} [
+			[:view {:style {:position :fixed
+							:top 4
+							:left 20}} [
+              [:text {:style {:width 40}} [(str start-text)]]
+              [:text {:style {:top 10}} [
+                [:text {} ["Press "]]
+                [Highlight {} ["any key "]]
+                [:text {} ["to continue and "]]
+                [Highlight {} ["? "]]
+                [:text {} ["to view help."]]]]]]]]]]]])))

 (zc/def-component Popover
   [this]
@@ -2152,20 +2166,6 @@
     nil
 ))

-(zc/def-component StartText
-  [this]
-  (let [{:keys [game-state]} (zc/props this)]
-    (zc/csx
-	  [:terminal {} [
-		[:group {:id :app} [
-		  [:layer {:id :ui} [
-            [:view {:style {:align-items :center
-                            :justify-content :center
-                            :position :fixed
-                            :top 2
-                            :left 30}} [
-              [:text {} ["Start Text"]]]]]]]]]])))
-
 (zc/def-component GameOverDead
   [this]
   (let [{:keys [player cause-of-death madlib days-survived turns-survived points]} (zc/props this)


refactored unused var

refactored unused var

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -215,8 +215,7 @@
       (<! (timeout (:tick-ms @app-state)))
       (<! raf-chan)
       (let [app        @app-state
-            moves      (:moves app)
-            move-count (count moves)
+            move-count (count (:moves app))
             tick       (if (>= tick move-count) 0 tick)]
         (swap! app-state assoc :tick tick)
         (<! (paint-canvas! app tick))


remove this throw and the try/catch

remove this throw and the try/catch

--- src/tabby/log.clj
+++ src/tabby/log.clj
@@ -2,22 +2,17 @@
   (:require [clojure.tools.logging :refer [warn info]]
             [tabby.utils :as utils]))

-;;; Log functions
-;;; TODO: this should be + 1
 (defn last-log-index
   "return the index of the last log entry (1 based)"
   [state]
+  ;; since the log starts with a 'reset' entry
+  ;; the count is actually one based
   (count (:log state)))

 (defn get-log-at
   "gets the log entry at the index specified (1 based)"
-  [state idx]
-  ;; (warn (:id state) " log = " (:log state))
-  (if (or (neg? idx) (> idx (last-log-index state)))
-    (throw (IndexOutOfBoundsException.
-            (format "Invalid index: %d, last-log-index: %d"
-                    idx (last-log-index state))))
-    (get (:log state) (dec idx))))
+  [{log :log} idx]
+  (get log (dec idx)))

 (defn get-log-term [state idx]
   (if (or (< (last-log-index state) 1) (<= idx 0))
@@ -42,13 +37,11 @@

 (defn prev-log-term-equals?
   [state {p-index :prev-log-index p-term :prev-log-term}]
-  (try
+  (if (or (neg? p-index)
+          (> p-index (last-log-index state)))
+    false
     (or (= 0 p-index (last-log-index state))
-        (= (get-log-term state p-index) p-term))
-    (catch Exception ex
-      ;; FIXME: shitty
-      (warn ex "caught exception in prev-log-term-equals?")
-        false)))
+        (= (get-log-term state p-index) p-term))))

 (defn apply-entry [state db]
   (let [log (:log state)


Hide ids in list

Hide ids in list

--- src/tesq/list.clj
+++ src/tesq/list.clj
@@ -18,21 +18,26 @@
 (defn table->html
   "Given db rows, return HTML table."
   [rows table]
+  (println rows)
   (html
    [:p {:class "count"} (str (count rows) " rows found")]
    [:table
 	[:thead
 	 (conj
-	  (for [[k v] (first rows)] [:td (escape-html k)])
+	  (for [[k v] (first rows)
+			:when (not= :id k)]
+		[:td (escape-html k)])
 	  [:td "actions"])
 	 ]
 	(for [row rows]
 	  [:tr
 	   (conj
-		(for [[k v] row] [:td (escape-html (truncate (str v)))])
-		[:td
-		 [:a {:href (str "/view/" table "/" (:id row))} "view"]
-		 ])
+		(for [[k v] row
+			  :when (not= :id k)]
+		  [:td (escape-html (truncate (str v)))]
+		  )
+		[:td [:a {:href (str "/view/" table "/" (:id row))} "view"]]
+		)
 	   ]
 	  )
 	]))


Oops - been using major header all this time

--- src/aeolian/core.clj
+++ src/aeolian/core.clj
@@ -1,16 +1,14 @@
 (ns aeolian.core
-  (:require [aeolian.parser :as parser]
-            [aeolian.composer :as composer]
+  (:require [aeolian.composer :as composer]
             [aeolian.midi.core :as midi]
             [taoensso.timbre :as log]
             [aeolian.abc.header :as h]
             [aeolian.abc.key :as k]
             [aeolian.banner :as banner]
-            [clansi :as ansi]
             [clojure.java.io :as io]))

-(defn build-header-for-key [metrics-file-name key]
-  (str (h/build-major-header metrics-file-name) "\n" midi/header))
+(defn build-header [metrics-file-name key]
+  (str (h/build-common-header metrics-file-name key) "\n" midi/header))

 (defn notation-file-name [original-file-name]
   (str original-file-name ".abc"))
@@ -23,7 +21,7 @@
   (with-open [rdr (clojure.java.io/reader input-file-name)]
     (let [composition-key     (k/determine-key duplicate-metrics)
           composition         (composer/compose (line-seq rdr) composition-key)]
-      (spit output-file-name, (str (build-header-for-key input-file-name composition-key) composition))
+      (spit output-file-name  (str (build-header input-file-name composition-key) composition))
       (log/info "Generated " output-file-name))))

 (defn -main


Getting better.

Getting better.

--- src/api_test/xml.clj
+++ src/api_test/xml.clj
@@ -90,63 +90,49 @@

 (def zipper (zip/xml-zip (parse test-request)))

+(def fmatch (map #(zx/tag= %) '(:x)))
 (def match (map #(zx/tag= %) '(:b :c :d)))
-(pr match)
-(pr (class match))
-
-(def content '("CLIP" "foo"))
-
-(pr (first content))
+
+(def content '("CHSDA" "foo"))

 (def big-match (concat match (map #(zx/text= %) (list (first content)))))
-(pr (count big-match))
-(pr big-match)
-(println (apply zx/xml-> zipper
-           big-match))
-
-
-
-(defn test-set-values
+;(println (apply zx/xml-> zipper fmatch))
+
+
+
+(defn set-values
   "given a lazy sequence of cucumber table values of :tag path and :content reset the :content of the matching paths in the message"
   [values message]
   (loop [zipper (zip/xml-zip (parse message)) line values]
     (if (= () line)
-
       (xml/indent-str (zip/root zipper))
       (do
-        (println "line=" line)
+        (println "ziper=" zipper)
         (let [paths (str/split (:tag (first line)) #">")
               m (map #(zx/tag= (keyword %)) paths)
               c (str/split (:content (first line)) #">")
               content (if (= (count c) 2)
                         (last c)
                         (first c))
-              _ (println (str paths " C=" c "Content=" content "M=" (first c) ":" (count (first c))))
               matches (if (= (count c) 2)
                         (concat m (map #(zx/text= %) (list (first c))))
                         m)
-              _ (println "COUNT OF MATCHES = " (count matches))
               edit { :tag (keyword (last paths)) :content content }
-              new-loc (apply zx/xml-> zipper matches)]
-          (if (= 0 (count new-loc))
+              new-loc (apply zx/xml1-> zipper matches)]
+          (if (= nil new-loc)
             (println "WARNING: " (first line) " NOT FOUND"))
-          (let [loc (if (not= () new-loc)
+          (let [loc (if (not= nil new-loc)
                       (do
-                        (println "edits="  edit)
                         (zip/root (zip/replace new-loc edit)))
-                      (zip/root zipper))]
+                      (do
+                        (zip/root zipper)))]
             (recur (zip/xml-zip loc) (rest line))))))))

-(pr (test-set-values  (lazy-seq '({:tag "a" :content "arglebargle" }
-                              {:tag "b>c>d":content "CHSDA>foo" }
-                              {:tag "b>c>d":content "CLIP>bar" })) test-request))
-
-
-
-(def myvals (lazy-seq '({:tag "a" :content "arglebargle" }
-                              {:tag "b>c>d" :content "foo" }
-                              {:tag "b>c>d" :content "bar" })))
-
+
+(comment (test-set-values  (lazy-seq '({:tag "a" :content "arglebargle" }
+                                  {:tag "b>c>d" :content "CHSDA>foo" }
+                                  {:tag "b>c>d" :content "CLIP>bar" }
+                                  {:tag "x" :content "y"})) test-request))

@@ -156,18 +142,7 @@
               (assoc summaries k (f (summaries k init ) x))))
           {} coll))

-(def rdcd (reduce-by :tag #(conj %1 (:content %2)) [] myvals))
-
-(pr rdcd)
-(pr  (second rdcd))
-`
-(for [line rdcd]
-  (do
-    (pr (key line))
-    (pr (val line))))
-
-
-(defn set-values
+(defn old-set-values
   "given a lazy sequence of cucumber table values of :tag path and :content reset the :content of the matching paths in the message"
   [values message]
   (loop [zipper (zip/xml-zip (parse message)) line values]


Tweaked defpredsummers to filter based on >= rather than just >

--- src/clj/forma/hadoop/predicate.clj
+++ src/clj/forma/hadoop/predicate.clj
@@ -92,11 +92,11 @@
      ([count#] [count#])))

 (defpredsummer [filtered-count [limit]]
-  [val] #(> % limit))
+  [val] #(>= % limit))

 (defpredsummer [bi-filtered-count [lim1 lim2]]
-  [val1 val2] #(and (> %1 lim1)
-                    (> %2 lim2)))
+  [val1 val2] #(and (>= %1 lim1)
+                    (>= %2 lim2)))

 (defpredsummer full-count
   [val] identity)


fixed wrapping of middlewares added example for applying different middlewares to different routes

--- resources/clj/new/closp/src/clj/components/handler.clj
+++ resources/clj/new/closp/src/clj/components/handler.clj
@@ -34,9 +34,16 @@
                                               :dict           locale-dict}
                                              short-languages))))))

+;(defn wrap-api [route db dev?]
+;  (let [handler (-> route
+;                    (wrap-json-response)
+;                    add-locale
+;                    (wrap-custom-authorization db)
+;                    (wrap-json-body {:keywords? true :bigdecimals? true}))]
+;    (if dev? (wrap-reload handler) handler)))

 (defn wrap-base [route dev?]
-  (let [handler (-> (route)
+  (let [handler (-> route
                     (wrap-access-rules {:rules auth/rules})
                     (wrap-authorization auth/auth-backend)
                     add-locale
@@ -46,8 +53,11 @@
 (defn get-handler [config {:keys [db]}]
   (let [dev? (= (:env config "") :dev)]
     (routes
-      (wrap-base home-routes dev?)
-      (wrap-base (partial user-routes config db) dev?)))
+      ;(wrap-api (api-routes db) db dev?)
+      (wrap-base
+        (routes (home-routes) (user-routes config db))
+        dev?)))
+

   #_(routes (-> (#'home-routes)


Avoid completing to non-available-in-this-ns vars

--- src/clj/reply/eval_modes/nrepl.clj
+++ src/clj/reply/eval_modes/nrepl.clj
@@ -87,7 +87,7 @@
        :out print
        :err print
        :session session}
-      (pr-str form))
+      (pr-str `(binding [*ns* (symbol ~(deref current-ns))] ~form)))
     (read-string @results)))

 (defn main


undo my change to iters-next

undo my change to iters-next

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/aurora/join.cljs
+++ src/aurora/join.cljs
@@ -129,14 +129,21 @@
        (when (identical? end? false)
          cur-key))

+
   (iters-next [this]
-              (loop [ix (- len 1)]
-                (when (>= ix 0)
-                  (let [cur (aget iterators ix)]
-                    (.next cur)
-                    (if (.-end? cur)
-                      (recur (- ix 1))
-                      (ainto next-key (.make-min cur)))))))
+              ;;try next on the last iterator
+              (let [last (aget iterators (- len 1))]
+                (.next last)
+                (if-not (.-end? last)
+                  (ainto next-key (.key last))
+                  ;;otherwise walk up and get the min next value
+                  (loop [ix (- len 2)]
+                    (when (>= ix 0)
+                      (let [cur (aget iterators ix)]
+                        (.next cur)
+                        (if (.-end? cur)
+                          (recur (- ix 1))
+                          (ainto next-key (.make-min cur)))))))))

   (seek-join [this]
              ;;while we haven't found a match


small improvement

small improvement

--- src/mandel/core.clj
+++ src/mandel/core.clj
@@ -8,15 +8,17 @@

 (defn mandelbrot
   [^double cx ^double cy ^long max-iterations]
-  (loop [x 0
-         y 0
-         iter 0]
-    (let [abs-squared (+ (* x x) (* y y))]
-      (if (or (> abs-squared 8) (= iter max-iterations))
-        (- iter (/ (Math/log (/ (Math/log abs-squared) (Math/log 4))) (Math/log 2)))
-        (recur (+ (- (* x x) (* y y)) cx)
-               (+ (* 2 x y) cy)
-               (unchecked-inc iter))))))
+  (let [log2 (Math/log 2)
+        log4 (Math/log 4)]
+    (loop [x 0
+           y 0
+           iter 0]
+      (let [abs-squared (+ (* x x) (* y y))]
+        (if (or (> abs-squared 8) (= iter max-iterations))
+          (- iter (/ (Math/log (/ (Math/log abs-squared) log4)) log2))
+          (recur (+ (- (* x x) (* y y)) cx)
+                 (+ (* 2 x y) cy)
+                 (unchecked-inc iter)))))))

 (defn hue-to-rgb ^long
   [^long hue]
@@ -76,6 +78,6 @@
 (defn -main
   "I don't do a whole lot ... yet."
   [& args]
-  (mandel 400 400))
+  (mandel 800 800))


simplify (parses)

simplify (parses)

--- src/babel/parse.cljc
+++ src/babel/parse.cljc
@@ -61,79 +61,36 @@
                    spans)))))

 (defn parses [input n model span-map]
-  (log/debug (str "(parses " n "; span-maps: " (get span-map n) ")"))
   (cond
     (= n 1) input
     (> n 1)
     (let [minus-1 (parses input (- n 1) model span-map)]
       (merge minus-1
              (reduce (fn [x y]
-                       (do
-                         (log/trace (str "merge x: " (keys x)))
-                         (log/trace (str "merge y: " (keys y)))
-                         (merge-with concat x y)))
+                       (merge-with concat x y))
                      (pmap (fn [span-pair]
                              ;; create a new key/value pair: [i,j] => parses,
                              ;; where each parse in parses matches the tokens from [i,j] in the input.
                              {[(first (first span-pair))
                                (second (second span-pair))]
                               (let [left (get minus-1 (first span-pair))
-                                    right (get minus-1 (second span-pair))]
-                                (log/debug (str "span-pair: " span-pair))
-                                (log/debug (str "left: " ((:morph model)
-                                                          left)))
-                                (log/debug (str "right: " ((:morph model)
-                                                           right)))
-                                (let [left-strings (set (filter string? left))
-                                      right-strings (set (filter string? right))
-                                      left-lexemes (mapcat (:lookup model)
-                                                           left-strings)
-                                      right-lexemes (mapcat (:lookup model)
-                                                            right-strings)
-                                      left-signs (concat left-lexemes (filter map? left))
-                                      right-signs (concat right-lexemes (filter map? right))
-                                      debug (do (if (not (empty? left-signs))
-                                                  (log/debug (str "left-signs: " ((:morph model)
-                                                                                left-signs))))
-                                                (if (not (empty? right-signs))
-                                                  (log/debug (str "right-signs: " ((:morph model)
-                                                                                right-signs))))
-                                                (if (not (empty? left-strings))
-                                                  (log/debug (str "left-strings: " (string/join "," left-strings))))
-                                                (if (not (empty? right-strings))
-                                                  (log/debug (str "right-strings: " (string/join "," right-strings))))
-                                                (if (not (empty? left-strings))
-                                                  (log/debug (str "looked-up left-strings:" (string/join ","  (map (:morph model)
-                                                                                (mapcat (:lookup model)
-                                                                                left-strings))))))
-                                                (if (not (empty? right-strings))
-                                                  (log/debug (str "looked-up right-strings:" (string/join "," (map (:morph model)
-                                                                                (mapcat (:lookup model)
-                                                                                right-strings)))))))
-                                      result
-                                      (concat
-                                       (if (and (not (empty? left-signs))
-                                                (not (empty? right-signs)))
-                                         (do
-                                           (log/debug (str "span-pair: " span-pair))
-                                           (over (:grammar model) left-signs right-signs)))
-
-                                       ;; TODO: explain why we can use (first) here for the left- and right-strings.
-                                       ;; Throw an exception if (> 1 (count left-strings)) or (> 1 (count right-strings))
-                                       [(string/join " " [(first left-strings) (first right-strings)])])]
-                                  (if (not (empty? result))
-                                    (log/debug
-                                     (str "result: "
-                                          [(first (first span-pair))
-                                           (second (second span-pair))] " "
-                                          (string/join "; "
-                                                       (map (fn [each-parse]
-                                                              (str
-                                                               (get each-parse :rule) ":'"
-                                                               ((:morph model) each-parse)
-                                                               "'"))
-                                                            result)))))
-                                  result))})
+                                    right (get minus-1 (second span-pair))
+                                    left-strings (set (filter string? left))
+                                    right-strings (set (filter string? right))
+                                    left-lexemes (mapcat (:lookup model)
+                                                         left-strings)
+                                    right-lexemes (mapcat (:lookup model)
+                                                          right-strings)
+                                    left-signs (concat left-lexemes (filter map? left))
+                                    right-signs (concat right-lexemes (filter map? right))]
+                                (concat
+                                 (if (and (not (empty? left-signs))
+                                          (not (empty? right-signs)))
+                                   (over (:grammar model) left-signs right-signs))
+
+                                 ;; TODO: explain why we can use (first) here for the left- and right-strings.
+                                 ;; Throw an exception if (> 1 (count left-strings)) or (> 1 (count right-strings))
+                                 [(string/join " " [(first left-strings) (first right-strings)])]))})
                            (get span-map n)))))))

 (defn parse [input model]


+target.active=true

+target.active=true

--- src/babel/reader.clj
+++ src/babel/reader.clj
@@ -101,7 +101,8 @@
     ;; ORDER BY the value of the hash function on each row.
     (let [results (db/exec-raw [(str "SELECT target.serialized::text AS target,target.surface
                                         FROM expression AS target
-                                       WHERE target.language=?
+                                       WHERE target.active=true
+                                         AND target.language=?
                                          AND target.structure IS NOT NULL
                                          AND target.surface != ''
                                          AND target.structure @> '" target-json-spec "'


s/:target-root/:root/

s/:target-root/:root/

--- src/babel/reader.clj
+++ src/babel/reader.clj
@@ -232,7 +232,7 @@
                          :source (first (map :source results))
                          :target-spec target-spec
                          :targets-with-roots (map (fn [result]
-                                                    {:target-root (:target_root result)
+                                                    {:root (:target_root result)
                                                      :target (:target result)})
                                                   results)
                          :targets (map :target results)}))))))))))


remove incorrect diagnostic code

remove incorrect diagnostic code

--- src/babel/writer.clj
+++ src/babel/writer.clj
@@ -59,7 +59,7 @@
         semantics (strip-refs (get-in target-language-sentence [:synsem :sem] :top))
         debug (log/debug (str "semantics: " semantics))

-        target-language-surface "wtf??" ;;(target-fo target-language-sentence)
+        target-language-surface (target-fo target-language-sentence)
         debug (log/debug (str "target surface: " target-language-surface))

         source-language (:language (if (future? source-language-model)


Add React key to iterated components

Add React key to iterated components

--- src/braid/client/quests/views.cljs
+++ src/braid/client/quests/views.cljs
@@ -23,6 +23,7 @@
    [:div.content
     [:div.quests
      (for [quest (take 3 quests)]
+       ^{:key (quest :id)}
        [quest-view quest])]]])

 (defn quests-header-view []


Simplify spec abstraction and adapt the code to new abstraction.

--- src/bytebuf/spec.clj
+++ src/bytebuf/spec.clj
@@ -8,13 +8,8 @@
 ;; Abstraction definition
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defprotocol ISpecType
-  (tag [_] "Get the type tag."))
-
-(defprotocol IReadableSpec
-  (read [_ buff start] "Read all data from buffer."))
-
-(defprotocol IWritableSpec
+(defprotocol ISpec
+  (read [_ buff start] "Read all data from buffer.")
   (write [_ buff start data] "Read all data from buffer."))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -53,10 +48,10 @@
       (cond
         (and (even? numparams)
              (keyword? (first params))
-             (satisfies? ISpecType (second params)))
+             (satisfies? ISpec (second params)))
         :associative

-        (every? #(satisfies? ISpecType %) params)
+        (every? #(satisfies? ISpec %) params)
         :indexed))))

 (defmethod spec :associative
@@ -69,14 +64,11 @@
       (count [_]
         (count types))

-      ISpecType
-      (tag [_] :static)
-
       IStaticSize
       (size [_]
         (reduce #(+ %1 (proto/size %2)) 0 types))

-      IReadableSpec
+      ISpec
       (read [_ buff pos]
         (loop [index pos result {} pairs data]
           (if-let [[fieldname type] (first pairs)]
@@ -86,7 +78,6 @@
                      (rest pairs)))
             [(- index pos) result])))

-      IWritableSpec
       (write [_ buff pos data']
         (let [written (reduce (fn [index [fieldname type]]
                                 (let [value (get data' fieldname nil)
@@ -102,14 +93,11 @@
     (count [_]
       (count types))

-    ISpecType
-    (tag [_] :static)
-
     IStaticSize
     (size [_]
       (reduce #(+ %1 (proto/size %2)) 0 types))

-    IReadableSpec
+    ISpec
     (read [_ buff pos]
       (loop [index pos result [] types types]
         (if-let [type (first types)]
@@ -119,7 +107,6 @@
                    (rest types)))
           [(- index pos) result])))

-    IWritableSpec
     (write [_ buff pos data']
       (let [indexedtypes (map-indexed vector types)
             written (reduce (fn [pos [index type]]
@@ -137,14 +124,14 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defn bool
-  "Create a boolean data type."
+  "Boolean type spec constructor."
   ([] (bool nil))
   ([default]
    (reify
-     ISpecType
-     (tag [_] :static)
-
-     IReadableSpec
+     IStaticSize
+     (size [_] 1)
+
+     ISpec
      (read [_ buff pos]
        (let [readed (buffer/read-byte buff pos)]
          [1 (condp = readed
@@ -152,171 +139,137 @@
               (clojure.core/byte 1) true
               nil)]))

-     IWritableSpec
      (write [_ buff pos value]
        (let [value (condp = value
                      true (clojure.core/byte 1)
                      false (clojure.core/byte 0)
                      (clojure.core/byte -1))]
          (buffer/write-byte buff pos value)
-         1))
-
-     IStaticSize
-     (size [_] 1))))
-
+         1)))))

 (defn byte
-  "Create a boolean data type."
+  "Byte type spec constructor."
   ([] (byte (clojure.core/byte 0)))
   ([default]
    (reify
-     ISpecType
-     (tag [_] :static)
-
-     IReadableSpec
+     IStaticSize
+     (size [_] 1)
+
+     ISpec
      (read [_ buff pos]
        (let [readed (buffer/read-byte buff pos)]
          [1 readed]))

-     IWritableSpec
      (write [_ buff pos value]
        (let [value (clojure.core/byte (or value default))]
          (buffer/write-byte buff pos value)
-         1))
-
-     IStaticSize
-     (size [_] 1))))
+         1)))))

 (defn int16
-  "Create a int16 data type."
+  "Short type spec constructor."
   ([] (int16 0))
   ([default]
    (reify
-     ISpecType
-     (tag [_] :static)
-
-     IReadableSpec
+     IStaticSize
+     (size [_] (Short/BYTES))
+
+     ISpec
      (read [_ buff pos]
        [(Short/BYTES)
         (buffer/read-short buff pos)])

-     IWritableSpec
      (write [_ buff pos value]
        (let [value (or value default)]
          (buffer/write-short buff pos value)
-         (Short/BYTES)))
-
-     IStaticSize
-     (size [_]
-       (Short/BYTES)))))
+         (Short/BYTES))))))
+

 (defn int32
-  "Create a int32 data type."
+  "Integer type spec constructor."
   ([] (int32 0))
   ([default]
    (reify
-     ISpecType
-     (tag [_] :static)
-
-     IReadableSpec
+     IStaticSize
+     (size [_] (Integer/BYTES))
+
+     ISpec
      (read [_ buff pos]
        [(Integer/BYTES)
         (buffer/read-int buff pos)])

-     IWritableSpec
      (write [_ buff pos value]
        (let [value (or value default)]
          (buffer/write-int buff pos value)
-         (Integer/BYTES)))
-
-     IStaticSize
-     (size [_]
-       (Integer/BYTES)))))
+         (Integer/BYTES))))))

 (defn int64
-  "Create a int64 data type."
+  "Long type spec constructor."
   ([] (int64 0))
   ([default]
    (reify
-     ISpecType
-     (tag [_] :static)
-
-     IReadableSpec
+     IStaticSize
+     (size [_] (Long/BYTES))
+
+     ISpec
      (read [_ buff pos]
        [(Long/BYTES)
         (buffer/read-long buff pos)])

-     IWritableSpec
      (write [_ buff pos value]
        (let [value (or value default)]
          (buffer/write-long buff pos value)
-         (Long/BYTES)))
-
-     IStaticSize
-     (size [_]
-       (Long/BYTES)))))
+         (Long/BYTES))))))

 (defn real32
-  "Create a real of 32bits type spec."
+  "Float type spec constructor."
   ([] (real32 0))
   ([default]
    (reify
-     ISpecType
-     (tag [_] :static)
-
-     IReadableSpec
+     IStaticSize
+     (size [_] (Float/BYTES))
+
+     ISpec
      (read [_ buff pos]
        [(Float/BYTES)
         (buffer/read-float buff pos)])

-     IWritableSpec
      (write [_ buff pos value]
        (let [value (or value default)]
          (buffer/write-float buff pos value)
-         (Float/BYTES)))
-
-     IStaticSize
-     (size [_]
-       (Float/BYTES)))))
+         (Float/BYTES))))))

 (defn real64
-  "Create a real of 32bits type spec."
+  "Double type spec constructor."
   ([] (real64 0))
   ([default]
    (reify
-     ISpecType
-     (tag [_] :static)
-
-     IReadableSpec
+     IStaticSize
+     (size [_] (Double/BYTES))
+
+     ISpec
      (read [_ buff pos]
        [(Double/BYTES)
         (buffer/read-double buff pos)])

-     IWritableSpec
      (write [_ buff pos value]
        (let [value (or value default)]
          (buffer/write-double buff pos value)
-         (Double/BYTES)))
-
-     IStaticSize
-     (size [_]
-       (Double/BYTES)))))
+         (Double/BYTES))))))

 (defn string
-  "Fixed size string spec constructor."
+  "Fixed size string type spec constructor."
   [^long size]
   (reify
-    ISpecType
-    (tag [_] :static)
-
-    IReadableSpec
+    IStaticSize
+    (size [_] size)
+
+    ISpec
     (read [_ buff pos]
       (let [rawdata (buffer/read-bytes buff pos size)
             length  (- size (bytes/zeropad-count rawdata))
             data (String. rawdata 0 length "UTF-8")]
         [size data]))

-    IWritableSpec
     (write [_ buff pos value]
       (let [input (.getBytes value "UTF-8")
             length (count input)
@@ -329,26 +282,19 @@
           (bytes/zeropad! tmpbuf length))

         (buffer/write-bytes buff pos size tmpbuf)
-        size))
-
-    IStaticSize
-    (size [_] size)))
+        size))))

 (defn string*
-  "Arbitrary size string spec constructor."
+  "Arbitrary length string type spec constructor."
   []
   (reify
-    ISpecType
-    (tag [_] :dynamic)
-
-    IReadableSpec
+    ISpec
     (read [_ buff pos]
       (let [datasize (buffer/read-int buff pos)
             data (buffer/read-bytes buff (+ pos 4) datasize)
             data (String. data 0 datasize "UTF-8")]
         [(+ datasize 4) data]))

-    IWritableSpec
     (write [_ buff pos value]
       (let [input (.getBytes value "UTF-8")
             length (count input)]


check conf validity in local mode

check conf validity in local mode

--- src/clj/backtype/storm/testing.clj
+++ src/clj/backtype/storm/testing.clj
@@ -220,6 +220,8 @@
        )))

 (defn submit-local-topology [nimbus storm-name conf topology]
+  (when-not (Utils/isValidConf conf)
+    (throw (IllegalArgumentException. "Topology conf is not json-serializable")))
   (.submitTopology nimbus storm-name nil (to-json conf) topology))

 (defn submit-mocked-assignment [nimbus storm-name conf topology task->component task->node+port]


dispose map after computation

dispose map after computation

--- src/clj/morpheus/traversal/bfs.clj
+++ src/clj/morpheus/traversal/bfs.clj
@@ -99,15 +99,14 @@
   "Perform parallel and distributed breadth first search"
   (let [task-id (neb/rand-cell-id)
         vertex-id (:*id* vertex)
-        initial-stack [vertex-id]]
+        initial-stack [vertex-id]
+        ^SeqableMap vertices-map (data-map/gen-map task-id on-disk?)]
     (compute/new-task task-id (assoc extra-params :founder @ds/this-server-name))
     (swap! tasks-level assoc task-id 0)
-    (swap! tasks-vertices assoc task-id
-           (data-map/gen-map task-id on-disk?))
+    (swap! tasks-vertices assoc task-id vertices-map)
     (proc-stack task-id initial-stack)
     (loop [level 1]
-      (let [^SeqableMap vertices-map (get @tasks-vertices task-id)
-            vertices-list (.keyColl vertices-map)
+      (let [vertices-list (.keyColl vertices-map)
             unvisited-tr (atom (transient []))
             stop-required? (atom false)]
         (loop [vl   vertices-list]
@@ -129,6 +128,7 @@
     (let [result (get @tasks-vertices task-id)]
       (swap! tasks-vertices dissoc task-id)
       (swap! tasks-level dissoc task-id)
+      (.dispose vertices-map)
       (->> result
            (vals)
            (filter :*visited*)))))


Fix wrong keyword when adding events to db

--- src/clj/my_money/routes/upload.clj
+++ src/clj/my_money/routes/upload.clj
@@ -10,7 +10,7 @@
          total-rows 0]
     (if-let [event (first events)]
       (let [inserted-rows (db/create-event!
-                           {:id (:Arkistointitunnus event)
+                           {:transaction-id (:Arkistointitunnus event)
                             :user-id user-id
                             :transaction-date (date-string->date (:Kirjauspäivä event))
                             :amount (Integer/parseInt (clojure.string/replace (:MääräEUROA event) "," ""))


lookup a specific path

lookup a specific path

attempt to prevent confusing some future cloud with ec2

--- src/clj/runbld/hosting/aws_ec2.clj
+++ src/clj/runbld/hosting/aws_ec2.clj
@@ -39,8 +39,8 @@

 (s/defn this-host? :- s/Bool
   "Is this host in AWS EC2?"
-  ([]
-   (boolean (ec2-meta))))
+  []
+  (boolean (ec2-meta "/ami-id")))

 (defrecord AwsEc2Hosting [facts]
   HostingProvider


Improve url regex a bit.

Improve url regex a bit.


Added an option to pass in an element for write-str and pprint.

--- src/cassidy/shon.clj
+++ src/cassidy/shon.clj
@@ -153,10 +153,11 @@
          :-get-class-attribute (constantly "SHON")})

 (defn- parse-options [options]
-  (let [{:keys [key-fn value-fn]
+  (let [{:keys [key-fn value-fn el]
            :or {key-fn default-write-key-fn
-                value-fn default-value-fn}} options]
-      [key-fn value-fn]))
+                value-fn default-value-fn
+                el :div}} options]
+      [key-fn value-fn el]))

 (defn write-str
   "Converts x into a SHON string. The value of x can be anything though if it is
@@ -170,18 +171,18 @@
   :value-fn - For Maps, Lists and other Collections: A function (fn [k v]) of the
   key and value. The returned value will be substituted for the input value."
   [x & options]
-  (let [[key-fn value-fn] (parse-options options)]
+  (let [[key-fn value-fn el] (parse-options options)]
     (binding [*key-fn* key-fn
               *value-fn* value-fn]
-      (-write-str x :div.shon.root))))
+      (-write-str x (keyword (str (name el) ".shonroot"))))))

 (defn pprint
   "Pretty prints an object as a SHON string. Options are the same as in
   write-str."
   [x & options]
-  (let [[key-fn value-fn] (parse-options options)
+  (let [[key-fn value-fn el] (parse-options options)
         transform-fn (compile-xslt (io/resource "Identity.xslt"))]
-    (if-let [xml (try (compile-xml (write-str x :key-fn key-fn :value-fn value-fn))
+    (if-let [xml (try (compile-xml (write-str x :key-fn key-fn :value-fn value-fn :el el))
                       (catch Exception e (printerr (.getMessage e))))]
       (println (str (transform-fn xml)))
       (pp/pprint x))))


clj->js

clj->js

--- examples/lesson-carousel-starter-kit/src/carousel/core.cljs
+++ examples/lesson-carousel-starter-kit/src/carousel/core.cljs
@@ -82,7 +82,6 @@

 (defn create-pager [root-node]
   (let [pager-node (.. root-node addChild)
-        simulation (PhysicsEngine.)
         url-base "http://demo.famo.us.s3.amazonaws.com/hub/apps/carousel/Museo_del_Prado_-_Goya_-_Caprichos_-_No._"
         image-names ["01_-_Autorretrato._Francisco_Goya_y_Lucientes2C_pintor_thumb.jpg"
                      "02_-_El_si_pronuncian_y_la_mano_alargan_al_primero_que_llega_thumb.jpg"
@@ -97,35 +96,38 @@
                      "12_-_A_caza_de_dientes_thumb.jpg"
                      "13_-_Estan_calientes_thumb.jpg"]
         pages (map (fn [image-name]
-                              (let [_image-url (str url-base image-name)
-                                    image-url (str "url('" _image-url "')")
-                                    image-node (.. root-node addChild)
-                                    el (DOMElement. image-node)
-                                    box (FamousBox. {:mass 100 :size [100 100 100]})
-                                    anchor (Vec3. 1 0 0)
-                                    spring (Spring. nil box {:period 0.5 :dampingRatio 0.5 :anchor anchor})
-                                    quaternion (.. (Quaternion.) (fromEuler 0 (/ (.. js/Math -PI) -2) 0))
-                                    rotational-spring (RotationalSpring. nil box {:period 1 :dampingRatio 0.2 :anchor quaternion})]
-                                (.. image-node
-                                    (setSizeMode ABSOLUTE ABSOLUTE ABSOLUTE)
-                                    (setAbsoluteSize 500 500 0)
-                                    (setAlign 0.5 0.5)
-                                    (setMountPoint 0.5 0.5)
-                                    (setOrigin 0.5 0.5))
-                                (.. el
-                                    (setProperty "backgroundImage" image-url)
-                                    (setProperty "background-repeat" "no-repeat")
-                                    (setProperty "background-size" "cover"))
-                                [image-node el]))
-                            image-names)
-        _ (doall pages)
+                     (let [_image-url (str url-base image-name)
+                           image-url (str "url('" _image-url "')")
+                           image-node (.. root-node addChild)
+                           el (DOMElement. image-node)
+                           box (FamousBox. (clj->js {:mass 100 :size [100 100 100]}))
+                           anchor (Vec3. 1 0 0)
+                           spring (Spring. nil box (clj->js {:period 0.5 :dampingRatio 0.5 :anchor anchor}))
+                           quaternion (.. (Quaternion.) (fromEuler 0 (/ (.. js/Math -PI) -2) 0))
+                           rotational-spring (RotationalSpring. nil box (clj->js {:period 1 :dampingRatio 0.2 :anchor quaternion}))]
+                       (.. image-node
+                           (setSizeMode ABSOLUTE ABSOLUTE ABSOLUTE)
+                           (setAbsoluteSize 500 500 0)
+                           (setAlign 0.5 0.5)
+                           (setMountPoint 0.5 0.5)
+                           (setOrigin 0.5 0.5))
+                       (.. el
+                           (setProperty "backgroundImage" image-url)
+                           (setProperty "background-repeat" "no-repeat")
+                           (setProperty "background-size" "cover"))
+                       {:node image-node
+                        :el el
+                        :box box
+                        :spring spring
+                        :quaternion quaternion
+                        :rotationalSpring rotational-spring
+                        :anchor anchor}))
+                   image-names)
         pager {:node     pager-node
                :currentIndex 0
                :threashold 4000
                :pages pages
-               :pageWidth 0
-               }]
-
+               :pageWidth 0}]
     pager))

 (defn Carousel [selector data]
@@ -140,7 +142,7 @@

         dots-node (create-dots root-node)
         pager (create-pager root-node)
-
+
         back (decorate-arrow-node back-node "<")
         next (decorate-arrow-node next-node ">")
         dots (decorate-dots dots-node)]


:bug: Fixed interactions

:bug: Fixed interactions

--- frontend/src/app/main/ui/workspace/shapes/interactions.cljs
+++ frontend/src/app/main/ui/workspace/shapes/interactions.cljs
@@ -175,11 +175,10 @@

 (mf/defc interactions
   [{:keys [selected] :as props}]
-  (let [data (mf/deref refs/workspace-data)
-        local (mf/deref refs/workspace-local)
+  (let [local (mf/deref refs/workspace-local)
         zoom (mf/deref refs/selected-zoom)
         current-transform (:transform local)
-        objects (:objects data)
+        objects (mf/deref refs/workspace-page-objects)
         active-shapes (filter #(first (get-click-interaction %)) (vals objects))
         selected-shapes (map #(get objects %) selected)
         draw-interaction-to (:draw-interaction-to local)


A PoC of a functional test injector is done in core_test

--- test/clj/hellhound/system/core_test.clj
+++ test/clj/hellhound/system/core_test.clj
@@ -56,13 +56,13 @@
 ;;                          (:clojure.spec.test.alpha/val failure#))})))
 ;;        checks-passed?#)))

+;; (doseq [sym (clojure.spec.test.alpha/enumerate-namespace 'hellhound.system.core)]
+;;   (println (meta (macroexpand (defspec-test sym)))))
+(defn spec-ns
+  [ns-sym]
+  (doseq [[sym actual-var] (ns-publics ns-sym)
+          :let [full-symbol  (symbol (name ns-sym) (name sym))]]
+    (alter-meta! actual-var assoc :test #(check full-symbol))
+    (t/test-var actual-var)))

-(defmacro defspec-test
-  ([name] `(defspec-test ~name nil))
-  ([name opts]
-   (when clojure.test/*load-tests*
-     `(def ~(vary-meta name assoc :test `(hellhound.system.core_test/check ~name))
-        (fn [] (clojure.test/test-var (var ~name)))))))
-
-(doseq [sym (clojure.spec.test.alpha/enumerate-namespace 'hellhound.system.core)]
-  (defspec-test sym))
+(spec-ns 'hellhound.system.core)


Migrate to boot-tools-deps

Migrate to boot-tools-deps

--- build.boot
+++ build.boot
@@ -1,36 +1,14 @@
 (merge-env!
-  :resource-paths #{"src/main/cljc"
-                    "src/spec/cljc"
-                    "src/main/js"}
-  :dependencies   '[;; Clojure and ClojureScript
-                    [org.clojure/clojure         "1.9.0-alpha19"]
-                    [org.clojure/clojurescript   "1.9.908"]
-
-                    ;; utility
-                    [moxaj/macrowbar             "0.1.2"]
-
-                    ;; testing
-                    [org.clojure/test.check      "0.10.0-alpha1" :scope "test"]
-
-                    ;; dev
-                    [nodisassemble               "0.1.3" :scope "test"]
-
-                    ;; documentation
-                    [boot-codox                  "0.10.3" :scope "test"]
-
-                    ;; build script
-                    [adzerk/boot-test            "1.2.0" :scope "test"]
-                    [adzerk/boot-reload          "0.5.1" :scope "test"]
-                    [adzerk/boot-cljs            "2.0.0" :scope "test"]
-                    [adzerk/boot-cljs-repl       "0.3.3" :scope "test"]
-                    [pandeiro/boot-http          "0.8.3" :scope "test"]
-                    [crisptrutski/boot-cljs-test "0.3.0" :scope "test"]
-                    [com.cemerick/piggieback     "0.2.1" :scope "test"]
-                    [weasel                      "0.7.0" :scope "test"]
-                    [org.clojure/tools.nrepl     "0.2.13" :scope "test"]]
-  :repositories   [["clojars" {:url      "https://clojars.org/repo"
-                               :username (System/getenv "CLOJARS_USER")
-                               :password (System/getenv "CLOJARS_PASS")}]])
+  :init-ns      'user
+  :dependencies '[[seancorfield/boot-tools-deps "0.1.4"]]
+  :repositories [["clojars" {:url      "https://clojars.org/repo"
+                             :username (System/getenv "CLOJARS_USER")
+                             :password (System/getenv "CLOJARS_PASS")}]])
+
+(require '[boot-tools-deps.core :as boot-tools-deps])
+
+(boot-tools-deps/load-deps {:resolve-aliases   [:build]
+                            :classpath-aliases [:build]})

 (require '[boot.util :as boot-util]
          '[adzerk.boot-test :as boot-test]
@@ -99,48 +77,21 @@

 ;; Tasks

-(deftask testing
-  "Adds the test files to the fileset."
-  []
-  (merge-env! :resource-paths #{"src/test/cljc"
-                                "src/test/cljs"
-                                "src/test/resources"})
-  identity)
-
-(deftask benchmarking
-  "Adds the benchmark files to the fileset."
-  []
-  (merge-env! :resource-paths #{"src/benchmark/cljc"
-                                "src/benchmark/java"
-                                "src/benchmark/resources"}
-              :dependencies   '[[com.cognitect/transit-clj         "0.8.300"]
-                                [com.cognitect/transit-cljs        "0.8.239"]
-                                [com.damballa/abracad              "0.4.14-alpha2"]
-                                [gloss                             "0.2.6"]
-                                [cheshire                          "5.7.1"]
-                                [funcool/octet                     "1.0.1"]
-                                [com.google.protobuf/protobuf-java "3.3.1"]
-                                [com.taoensso/nippy                "2.14.0-alpha1"]
-                                [criterium                         "0.4.4"]])
-  identity)
-
 (deftask dev
   "Dev task for proto-repl."
   []
-  (merge-env! :init-ns        'user
-              :resource-paths #{"src/dev/clj"}
-              :dependencies   '[[org.clojure/tools.namespace "0.2.11"]
-                                [proto-repl                  "0.3.1" :exclusions [org.clojure/core.async]]])
+  (boot-tools-deps/load-deps {:resolve-aliases   [:dev]
+                              :classpath-aliases [:dev]})
   (require 'clojure.tools.namespace.repl)
-  (apply (resolve 'clojure.tools.namespace.repl/set-refresh-dirs) (get-env :directories))
-  (comp (testing)
-        (benchmarking)
+  (apply (resolve 'clojure.tools.namespace.repl/set-refresh-dirs)
+         (get-env :directories))
+  (comp (boot-tools-deps/deps :aliases [:test :benchmark :dev])
         (javac)))

 (deftask test-clj
   "Runs the tests on JVM."
   []
-  (comp (testing)
+  (comp (boot-tools-deps/deps :aliases [:test])
         (boot-test/test :namespaces clj-test-namespaces)))

 (deftask test-node
@@ -148,7 +99,7 @@
   [o opt          VAL kw   "The optimization level for the cljs compiler."
    s self-hosted?     bool "True if self-hosted."]
   (let [opt (or opt :none)]
-    (comp (testing)
+    (comp (boot-tools-deps/deps :aliases [:test])
           (if self-hosted?
             (with-pass-thru fileset
               (proc "lumo"
@@ -171,7 +122,7 @@
    e js-env VAL kw "The js environment."]
   (let [opt    (or opt :none)
         js-env (or js-env :slimer)]
-    (comp (testing)
+    (comp (boot-tools-deps/deps :aliases [:test])
           (boot-cljs-test/test-cljs :js-env        js-env
                                     :namespaces    cljs-test-namespaces
                                     :optimizations opt
@@ -211,7 +162,7 @@
         (with-pass-thru _ (println "======= Testing cljs | node"))
         (test :platform     :cljs
               :target       :nodejs)
-
+
         (with-pass-thru _ (println "======= Testing cljs | node | self-hosted"))
         (test :platform     :cljs
               :target       :nodejs
@@ -237,8 +188,7 @@
      - (boot-cljs-repl/start-repl)
    localhost:3000"
   [o opt VAL kw  "The compiler optimization level."]
-  (comp (benchmarking)
-        (testing)
+  (comp (boot-tools-deps/deps :aliases [:test :benchmark])
         (javac)
         (boot-http/serve :dir "target/browser")
         (watch)
@@ -251,8 +201,7 @@
 (deftask run-node-repl
   "Runs a node repl."
   []
-  (comp (testing)
-        (benchmarking)
+  (comp (boot-tools-deps/deps :aliases [:test :benchmark])
         (proc "lumo"
               "-c" (str "\"" (System/getProperty "fake.class.path") "\"")
               "-k" "lumo_cache"


fix boot task

fix boot task

--- build.boot
+++ build.boot
@@ -51,4 +51,4 @@
    (jar)))

 (deftask deploy []
-  (comp (build-jar) (push-release)))
+  (comp (build-jar) (push-release :ensure-clean false)))


fix whitespace

fix whitespace

--- build.boot
+++ build.boot
@@ -44,7 +44,7 @@
   []
   (comp (watch)
         (speak)
-        (cljs :optimizations :none
+        (cljs :optimizations :none
               :source-map true
               :compiler-options {:output-to  "public/main.js"
                                  :asset-path "out"})
@@ -59,5 +59,5 @@
   (comp (aot) (pom) (uber) (jar)))

 (defn -main [& args]
-  (binding [riffmuse.core/*version* +version+]
+  (binding [riffmuse.core/*version* +version+]
     (apply (resolve 'riffmuse.core/-main) args)))


Remove JTransforms from the dependencies

--- src/neuhon/core.clj
+++ src/neuhon/core.clj
@@ -2,7 +2,6 @@
   ^{:doc "Main features of the software"
     :author "Antoine Passemiers"}
   (:gen-class)
-  (:import  (org.jtransforms.fft DoubleFFT_1D))
   (:require [clojure.data.csv :as csv]
             [clojure.java.io :as io])
   (:use [clojure.java.io]
@@ -15,11 +14,6 @@
         [neuhon.spectral]
         [neuhon.fft]
         [neuhon.utils]))
-
-
-;; Instance of the JTransforms DoubleFFT_1D class,
-;; with a given spectral window size
-(def jtransformer (DoubleFFT_1D. window-size))

 ;; hardcoded path
 ;; Base folder where the wav files are located
@@ -53,15 +47,13 @@
   "Compute the direct spectral kernel transform of
   an input sequence"
   [frame]
-  (let [frame-array (double-array (* 2 window-size) frame)]
+  (let [frame-array (to-complex-array frame)]
     (do
-      (.realForwardFull jtransformer frame-array)
       (take
         window-size
         (dsk-transform
           (complex-to-real-seq
-            ;; frame-array))))))
-            (iterative-radix2-fft (to-complex-array frame))))))))
+            (iterative-radix2-fft frame-array)))))))

 (defn extract-chromatic-vector
   "Compute the chromatic vector of a song's segment"
@@ -170,7 +162,8 @@
                 (display-result metadata print)
                 (flush)
                 (display-result metadata (fn [s] (.write wrtr s)))))
-            (catch Exception e (println e)))
+            (catch java.io.FileNotFoundException e
+              (println "Warning : file not found")))
           (recur (inc i))))
         (println (format "---> Perfect matches        : %4d" @perfect-matches))
         (println (format "---> Out-by-a-fifth matches : %4d" @out-by-a-fifth-matches))


Update the ABACUS Export API to an XML based format

The weird text format is gone with a newer version of ABACUS

--- src/mdr2/abacus.clj
+++ src/mdr2/abacus.clj
@@ -1,10 +1,10 @@
 (ns mdr2.abacus
   "Import and export files to and from ABACUS

-  Unfortunately the interface to our ERP is very crude: you basically
-  read and write files from an directory. The import from ABACUS is
-  done via XML and the export to ABACUS is done via some form of csv.
-  The interface imports the following notifications:
+  The interface to our ERP is quite crude: you basically read and
+  write files from an directory. Both the import from and the export
+  to ABACUS are done via XML. The interface imports the following
+  notifications:

   - Start (open) a production
   - a production is recorded
@@ -16,6 +16,7 @@
   - meta data of a production changes."
   (:require [clojure.java.io :as io]
             [clojure.xml :as xml]
+            [clojure.data.xml :as data.xml]
             [clojure.zip :as zip]
             [clojure.data.zip.xml :refer [xml-> xml1-> attr= attr text]]
             [clojure.string :as string]
@@ -166,48 +167,48 @@
            ;; updating metadata
            (dissoc :production_type :revision_date))))))

-(defn wrap-rows
-  "Wrap an export record according to ABACUS conventions"
-  [rs]
-  (concat [(list "N" "ADO")] ; 'N' for new
-          rs
-          [(list "S")])) ; 's' for save
-
-(defn create-row
-  "Create a row for export according to ABACUS conventions"
-  [k v]
-  (when v
-    (let [section (if (= k 4) "IBF" "ADO")]
-      (list "D" section k (format "'%s'" v))))) ; all values need to be quoted
-
 (def ^:private date-format "%1$td.%1$tm.%1$tY")

+(defn- export-sexp
+  [{:keys [product_number total_time state audio_format
+           multimedia_type produced_date volumes depth] :as production}]
+  [:AbaConnectContainer
+   [:TaskCount 1]
+   [:Task
+    [:Parameter
+     [:Application "ORDE"]
+    [:Id "Produktstamm"]
+    [:MapId "AbaDefault"]
+    [:Version "2015.00"]]
+   [:Transaction {:id 1}
+    [:ProductData {:mode "SAVE"}
+     [:ProductDataFields {:mode "SAVE"}
+      [:ProductNumber product_number]
+      [:Ascii3 (string/capitalize state)]
+      [:_USERFIELD13 (quot (or total_time 0) (* 1000 60))] ; in minutes
+      [:_USERFIELD52 (and produced_date
+                          (format date-format produced_date))] ; Date of production end
+      [:_USERFIELD54 volumes]
+      [:__USERFIELD53 depth]
+      [:__USERFIELD54 audio_format]
+      [:__USERFIELD55 multimedia_type]]
+     [:ProductDataIndividualUserFields {:mode "SAVE"}
+      [:ProductDataIndividualUserFieldsFields {:mode "SAVE"}
+       [:Ascii1 (prod/dam-number production)]]]]]]])
+
 (defn export
-  "Export the state of a production as a csv-like structure, ready to
-  be consumed by ABACUS"
-  [{:keys [product_number total_time state audio_format multimedia_type
-           date id produced_date volumes depth] :as production}]
-  (->> [(create-row 2 product_number)
-        (create-row 239 (quot (or total_time 0) (* 1000 60))) ; in minutes
-        (create-row 106 (string/capitalize state))
-        (create-row 280 audio_format)
-        (create-row 271 volumes) ; Number of CDs
-        (create-row 279 depth)
-        (create-row 281 multimedia_type)
-        (create-row 256 (and produced_date
-                             (format date-format produced_date))) ; Date of production end
-        (create-row 4 (prod/dam-number production))] ; for legacy purposes
-       (remove nil?) ; remove empty rows
-       wrap-rows ; wrap the payload
-       (map-indexed #(conj %2 (inc %1))) ; number each row starting at 1
-       (map #(string/join "," %))
-       (string/join "\r\n"))) ; use cr/lf as this is consumed only on windows
+  "Export the state of a production, ready to be consumed by ABACUS"
+  [production]
+  (-> production
+      export-sexp
+      data.xml/sexp-as-element
+      data.xml/indent-str))

 (defn export-file
   "Export the state of a production into a special file in
   `export-dir`. The file is named with the `product_number`. Existing
   files are overwritten"
   [{product_number :product_number :as production}]
-  ;; file names are supposed to be "Ax_product_number.txt, e.g. Ax_DY15000.txt"
-  (let [file-name (.getPath (io/file export-dir (str "Ax_" product_number ".txt")))]
+  ;; file names are supposed to be "Ax_product_number.xml, e.g. Ax_DY15000.xml"
+  (let [file-name (.getPath (io/file export-dir (str "Ax_" product_number ".xml")))]
     (spit file-name (export production))))


disable spell check of id fields

disable spell check of id fields

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary_tab.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary_tab.cljs
@@ -55,6 +55,7 @@
                      :style {:float "left" :width column-width
                              :backgroundColor (when (< i (:count-orig @state)) (:background-gray style/colors))}
                      :disabled (< i (:count-orig @state))
+                     :spellCheck false
                      :defaultValue (:userId acl-entry)})
                   (style/create-select
                     {:ref (str "acl-value" i)


added removal form

added removal form

--- src/cljs/forms.cljs
+++ src/cljs/forms.cljs
@@ -15,6 +15,10 @@
             {:name :competition :type :select :options ["--" "Launch" "Ramp" "Presentation"]}
             {:name :score :datatype :int}]})

+(def remove-team
+  {:fields [{:name :h2 :type :heading :text "Remove a team"}
+            {:name :team_name}]})
+
 (def forms
   [create-team
    update-team])


Implement recording payments

Implement recording payments

--- src/invadm/core.clj
+++ src/invadm/core.clj
@@ -23,6 +23,8 @@
    ["-f" "--filename FILENAME" "Attached file"]
    ["-i" "--issue-date ISSUE_DATE" "Issue date"
     :default (unparse-date (t/now))]
+   ["-p" "--paid-on" "Paid on"
+    :default (unparse-date (t/now))]
    ["-n" "--net NET" "Net"
     :parse-fn #(Integer/parseInt %)]
    ["-a" "--amount AMOUNT" "Total amount"
@@ -40,7 +42,10 @@
         "    Lists invoices."
         ""
         "  invadm data {-c CURRENCY, -r CLIENT, -f FILENAME}"
-        "    Dump all the data in a JSON array."]
+        "    Dump all the data in a JSON array."
+        ""
+        "  invadm record-payment [-a AMOUNT] [-p PAID_ON] ID"
+        "    Record a payment of AMOUNT for invoice ID."]
        (string/join \newline)))

 (defn error-msg [errors]
@@ -114,6 +119,16 @@
   (apply println (map pretty-print-invoice (filter (options-to-filter options)
                                                    (read-all-invoices)))))

+(defn record-payment [options arguments]
+  (let [id (get arguments 1)
+        amount (:amount options)
+        invoice (read-invoice id)]
+    (write-invoice id (assoc invoice
+                             "payments" (conj (get invoice "payments")
+                                              {:date (:paid-on options)
+                                               :amount (or (:amount options)
+                                                           (get invoice "amount"))})))))
+
 (defn -main [& args]
   (let [{:keys [options arguments errors summary]} (parse-opts args cli-options)]
     ;; Handle help and error conditions
@@ -125,4 +140,5 @@
       "create" (create options arguments)
       "data" (data options)
       "list" (list_ options)
+      "record-payment" (record-payment options arguments)
       (exit 1 (usage summary)))))


Make the usage text better

Make the usage text better

--- src/invadm/core.clj
+++ src/invadm/core.clj
@@ -140,13 +140,15 @@
         "    Create an invoice."
         ""
         "  invadm list {-c CURRENCY, --from FROM, --to TO, -f FILENAME}"
-        "    List invoices."
+        "    List invoices, filtered according to arguments."
         ""
         "  invadm data {-c CURRENCY, --from FROM, --to TO, -f FILENAME}"
-        "    Dump all the data in a JSON array."
+        "    Dump all the data in a JSON array, filtered according to arguments."
         ""
         "  invadm record-payment [-a AMOUNT] [-p PAID_ON] ID"
-        "    Record a payment of AMOUNT for invoice ID."]
+        "    Record a payment of AMOUNT for invoice ID, paid on PAID_ON if given."
+        ""
+        "All dates should be formatted like YYYY-MM-DD."]
        (string/join \newline)))

 (defn error-msg [errors]


img width restricted to 100% in article

img width restricted to 100% in article

--- src/notehub/css.clj
+++ src/notehub/css.clj
@@ -190,10 +190,13 @@
       (at-media {:screen true :min-width (px 1024)} [:.central-element {:width width}])
       (at-media {:screen true :max-width (px 1023)} [:.central-element {:width "90%"}])

+      ["article img" { :max-width "100%" }]
+
       ["article p" {
                     :font-size (em (* 1.2 text-size-factor))
                     :line-height "140%"
                     }]
+
       ["article > h1:first-child" {
                                    :text-align "center"
                                    :font-size (em (* 2 header-size-factor))


table font changed to helvetica

table font changed to helvetica

--- src/notehub/css.clj
+++ src/notehub/css.clj
@@ -232,7 +232,8 @@
       [:table {
                :width "100%"
                :border-collapse "collapse"
-               }]
+               }
+       helvetica]
       [:th {
             :padding (em 0.3)
             :line-height (em 2.5)


Come on, work

Come on, work

--- src/korhal/core.clj
+++ src/korhal/core.clj
@@ -18,7 +18,7 @@
 (defn korhal-main [& args]
   (let [ai (korhal.core.)
         api (jnibwapi.JNIBWAPI. ai)]
-    (swap! (.state ai) swap-key :api api)
+    (reset! (.state ai) {:api api})
     (.start api)))

 (defn korhal-init [this]


Better name layout

Better name layout

--- src/layzee/core.clj
+++ src/layzee/core.clj
@@ -10,12 +10,12 @@
 (defn- clean[text]
   (.replace text "\n" ""))

-(defn- layout[t]
-  (clojure.pprint/cl-format nil "~65A" t))
+(defn- layout[t width]
+  (clojure.pprint/cl-format nil (format "~%sA" width) t))

 (defn- earl[t]
   ;; https://twitter.com/marick/status/633460947193978880
-  (layout (format "https://twitter.com/%s/status/%s" (util/url-encode (-> t :user :id_str)) (-> t :id))))
+  (layout (format "https://twitter.com/%s/status/%s" (util/url-encode (-> t :user :id_str)) (-> t :id)) 65))

 (def local-date-format
      (f/formatter "dd-MM-yy HH:mm"))
@@ -27,7 +27,7 @@
   (f/unparse local-date-format (t/to-time-zone (f/parse twitter-date-format date) (t/time-zone-for-id "Pacific/Auckland"))))

 (defn- view[t]
-  (format "[%s] %s -- %s %s" (local (:created_at t)) (earl t) (-> t :text clean) (-> t :user :name)))
+  (format "[%s] %s %s %s" (local (:created_at t)) (earl t) (layout (-> t :user :name) 30) (-> t :text clean)))

 (def no-retweets
      #(nil? (:retweeted_status %1)))


Updating the ingest app to use the umm.core namespace.

--- src/cmr/ingest/services/ingest.clj
+++ src/cmr/ingest/services/ingest.clj
@@ -8,8 +8,7 @@
             [cmr.common.services.errors :as serv-errors]
             [cmr.common.services.messages :as cmsg]
             [cmr.common.date-time-parser :as p]
-            [cmr.umm.echo10.collection :as c]
-            [cmr.umm.echo10.granule :as g]
+            [cmr.umm.core :as umm]
             [clojure.string :as string]
             [cmr.system-trace.core :refer [deftracefn]]))

@@ -20,7 +19,7 @@

 (defmethod add-extra-fields :collection
   [context concept]
-  (let [collection (c/parse-collection (:metadata concept))
+  (let [collection (umm/parse-concept concept)
         {{:keys [short-name version-id]} :product
          {:keys [delete-time]} :data-provider-timestamps
          entry-title :entry-title} collection]
@@ -31,7 +30,7 @@

 (defmethod add-extra-fields :granule
   [context concept]
-  (let [granule (g/parse-granule (:metadata concept))
+  (let [granule (umm/parse-concept concept)
         {:keys [collection-ref granule-ur]
          {:keys [delete-time]} :data-provider-timestamps} granule
         params (merge {:provider-id (:provider-id concept)} collection-ref)


Add key to error message from `system-using`

--- src/com/stuartsierra/component.clj
+++ src/com/stuartsierra/component.clj
@@ -56,7 +56,7 @@
    (fn [system key dependencies]
      (let [component (get system key)]
        (when-not component
-         (throw (ex-info "Missing component from system"
+         (throw (ex-info (str "Missing component " key " from system")
                          {:reason ::missing-component
                           :component-key key
                           :system system})))


Fix optimization on ast during joins

Fix optimization on ast during joins

--- src/com/wsscode/pathom/parser.cljc
+++ src/com/wsscode/pathom/parser.cljc
@@ -218,15 +218,14 @@
 (defn parser [{:keys [read mutate]}]
   (fn self [env tx]
     (tracing env {::pt/event ::parse-loop}
-      (let [{:keys [children] :as tx-ast} (or (::ast tx) (query->ast tx))
+      (let [{:keys [children] :as tx-ast} (or (::ast (meta tx)) (query->ast tx))
             tx  (vary-meta tx assoc ::ast tx-ast)
-            env (-> env
-                    (assoc :parser self))]
+            env (assoc env :parser self)]
         (loop [res {}
                [{:keys [query key type params] :as ast} & tail] children]
           (if ast
             (let [_     (trace env {::pt/event ::process-key :key key})
-                  query (cond-> query (vector? query) (vary-meta assoc ::ast tx-ast))
+                  query (cond-> query (vector? query) (vary-meta assoc ::ast ast))
                   env   (cond-> (merge env {:ast ast :query query})
                           (nil? query) (dissoc :query)
                           (= '... query) (assoc :query tx))
@@ -251,15 +250,14 @@
   (fn self [env tx]
     (go-catch
       (tracing env {::pt/event ::parse-loop}
-        (let [{:keys [children] :as tx-ast} (or (::ast tx) (query->ast tx))
+        (let [{:keys [children] :as tx-ast} (or (::ast (meta tx)) (query->ast tx))
               tx  (vary-meta tx assoc ::ast tx-ast)
-              env (-> env
-                      (assoc :parser self))]
+              env (assoc env :parser self)]
           (loop [res {}
                  [{:keys [query key type params] :as ast} & tail] children]
             (if ast
               (let [_     (trace env {::pt/event ::process-key :key key})
-                    query (cond-> query (vector? query) (vary-meta assoc ::ast tx-ast))
+                    query (cond-> query (vector? query) (vary-meta assoc ::ast ast))
                     env   (cond-> (merge env {:ast ast :query query})
                             (nil? query) (dissoc :query)
                             (= '... query) (assoc :query tx))


(maint) Fix `db-exists?` when DB subname is a URI

--- test/puppetlabs/jdbc_util/core_test.clj
+++ test/puppetlabs/jdbc_util/core_test.clj
@@ -3,6 +3,7 @@
            [org.postgresql.util PSQLException PSQLState])
   (:require [cheshire.core :as json]
             [clojure.java.jdbc :as jdbc]
+            [clojure.string :as str]
             [clojure.test :refer :all]
             [clojure.test.check :as tc]
             [clojure.test.check.generators :as tc-gen]
@@ -145,8 +146,14 @@
       (with-redefs [jdbc/query (fn [_ _] (Thread/sleep 5000) [{:answer 42}])]
         (is (false? (db-up? nil)))))))

+(defn- subname->db-name
+  [subname]
+  (-> (java.net.URI. subname)
+    .getPath
+    (str/replace #"^\/" "")))
+
 (deftest db-exists?-test
-  (is (true? (db-exists? test-db (:subname test-db))))
+  (is (true? (db-exists? test-db (-> test-db :subname subname->db-name))))
   (is (false? (db-exists? test-db "no-database-here"))))

 (defn- rand-db-name [] (str "jdbc-util-test-db-" (ks/rand-str :alpha-lower 12)))


Renamed several functions, added function to compute elapsed time

--- src/emender_jenkins/time_utils.clj
+++ src/emender_jenkins/time_utils.clj
@@ -13,22 +13,27 @@
 (ns emender-jenkins.time-utils
      "Module that contains helper functions to work with time.")

-(defn minutes-to-seconds
+(defn minutes->seconds
     "Convert minutes to seconds."
     [minutes]
     (* minutes 60))

-(defn seconds-to-ms
+(defn seconds->ms
     "Convert seconds to milliseconds."
     [seconds]
     (* seconds 1000))
+
+(defn ms->seconds
+    "Convert milliseconds to seconds."
+    [ms]
+    (/ ms 1000))

 (defn compute-sleep-amount
     "Convert sleep amount specified in minutes into millisesonds."
     [minutes]
     (-> minutes
-        minutes-to-seconds
-        seconds-to-ms))
+        minutes->seconds
+        seconds->ms))

 (defn get-formatted-time
     "Returns formatted time."
@@ -37,3 +42,10 @@
           result-date (new java.util.Date ms)]
           (.format sdf result-date)))

+(defn elapsed-time
+    "Compute time elapsed from the given timestamp."
+    [timestamp]
+    (let [current-time (ms->seconds (System/currentTimeMillis))]
+        (if timestamp
+            (- current-time timestamp))))
+


add another pre-check rule

add another pre-check rule

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -59,7 +59,9 @@
    ;; TODO: language-specific rules should be supplied from their respective namespaces.
    (check-vals parent child [:head :espanol :espanol]       [:espanol :espanol])
    (check-vals parent child [:head :italiano :italiano]     [:italiano :italiano])
-  ))
+   (check-vals parent child [:head :synsem :comp-type]      [:synsem :comp-type])
+
+   ))

 (defn comp-pre-checks [parent child]
   (or


Simply conj all is wrong, we must conj each new message.

--- src/fm/simrunner/gui/rendering.clj
+++ src/fm/simrunner/gui/rendering.clj
@@ -135,7 +135,7 @@

 (defn add-messages [app-state messages]
   (if (seq messages)
-    (update-in app-state [:ui :model :messages] conj messages)
+    (update-in app-state [:ui :model :messages] #(reduce conj % messages))
     app-state))

 (defn log-messages! [app & messages]


Support string as renderer.

Support string as renderer.

--- src/quil/applet.clj
+++ src/quil/applet.clj
@@ -37,7 +37,7 @@
   (set! (.finished applet) true))

 (defn- prepare-applet-frame
-  [applet title renderer]
+  [applet title]
   (let [m              (meta applet)
         keep-on-top?   (:keep-on-top m)
         frame          (.frame applet)
@@ -74,7 +74,7 @@
                      (str "--bgcolor" "=" (str (:bgcolor (meta applet)))))
                     "--hide-stop" title])))
    applet)
-  (prepare-applet-frame applet title renderer))
+  (prepare-applet-frame applet title))

 (def ^{:private true}
@@ -87,9 +87,12 @@

 (defn resolve-renderer
   "Converts keyword to Processing renderer string constant.
-  This string can be passed to native Processing methods."
+  This string can be passed to native Processing methods.
+  If renderer passed as String - do nothing and simply return it"
   [renderer]
-  (resolve-constant-key renderer renderer-modes))
+  (cond (keyword? renderer) (resolve-constant-key renderer renderer-modes)
+        (string? renderer) renderer
+        :default (throw (RuntimeException. ":renderer should be keyword or string"))))

 (defn- display-size
   "Returns size of screen. If there are 2 or more screens it probably return size of


removed start delay

removed start delay

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -347,7 +347,7 @@
                   :ctx         (.getContext canvas "2d")
                   :show-about? (not skip-howto?)
                   :media-error nil})
-                (js/setTimeout start! 500)
+                (start!)
                 (.setItem js/localStorage ls-key "1"))))
            (aset "srcObject" data)))
        (do


remove unused binding

remove unused binding

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -188,7 +188,7 @@
       cells))))

-(defn move! [{:keys [moves win-state] :as app} n]
+(defn move! [{:keys [moves] :as app} n]
   (let [new-layout (swap-cell (:cells app) n)]
     (om/update! app :cells new-layout)
     (om/update! app :moves (conj moves (capture-move app new-layout)))))


Support chained keywords

Support chained keywords

--- src/eq/core.cljs
+++ src/eq/core.cljs
@@ -21,9 +21,15 @@
     (= (.indexOf expr ":") 0)
       (keyword (.substring expr 1))

-    ;; ".foo" = alias for ":foo"
-    (= (.lastIndexOf expr ".") 0)
-      (keyword (.substring expr 1))
+    ;; ".foo.bar" -> (-> :foo :bar)
+    (re-matches #"(?:\.[a-z][a-zA-Z0-9-]*)+" expr)
+      (let [kws (->> (cs/split (.substring expr 1) #"\.")
+                     (map keyword))]
+        (fn [o]
+          (reduce (fn [o kw]
+                    (get o kw))
+                  o
+                  kws)))

     :else
       ;identity


Update core.clj

Update core.clj

--- src/styles/core.clj
+++ src/styles/core.clj
@@ -50,7 +50,7 @@
      :text-align "center"
      :letter-spacing (em 0.025)
      :font-size (px 9)
-     :color "#45484e"
+     :color "#555961"
      :background-color "rgba(255, 255, 255, 0.3)"
      :line-height (px 20)
      :position "fixed"


wrong password there

wrong password there

--- src/survey/core.clj
+++ src/survey/core.clj
@@ -9,13 +9,12 @@
 (def db-spec {:classname "org.postgresql.Driver"
               :subprotocol "postgresql"
               :subname "//localhost:5432/survey"
-              :user "sulmanen"
-              :password "pftvppeh"})
+              :user "pepsi"
+              :password "pepsi"})

 ; Import the SQL query as a function.
 (defquery write-answer "survey/write_answer.sql"
    {:connection db-spec})
-

 (defroutes app


Add align

Add align

--- src/play_clj/ui.clj
+++ src/play_clj/ui.clj
@@ -66,6 +66,7 @@
         :fill (.fill cell ^boolean a1 ^boolean a2)
         :fill-x (.fillX cell)
         :fill-y (.fillY cell)
+        :align (.align cell (int a1))
         :center (.center cell)
         :top (.top cell)
         :left (.left cell)


changed MongoDB connection logic, now it requires a mongo connection string provided via MONGOLAB_URI env variable

--- src/ttt/handler.clj
+++ src/ttt/handler.clj
@@ -31,9 +31,10 @@
     :bad-request  {:status 400 :body (generate-string {:error "bad request"})}
     (generate-string {:error "unknown error"})))

-(let [conn (mg/connect)
-      db   (mg/get-db conn "ttt")
-      coll "games"]
+(let [
+       uri (System/getenv "MONGOLAB_URI")
+       {:keys [conn db]} (mg/connect-via-uri uri)
+       coll "games"]

   (defn get-all-games
     "Returns a list of games available on the server"


typos around js globals

typos around js globals

--- src/main/clojure/cljs/compiler.cljc
+++ src/main/clojure/cljs/compiler.cljc
@@ -201,10 +201,10 @@
 #?(:clj
    (defmethod emit-constant clojure.lang.BigInt [x] (emits (.doubleValue ^clojure.lang.BigInt x))))

-(defmethod emit-constant js/String [x]
+(defmethod emit-constant #?(:clj String :cljs js/String) [x]
   (emits (wrap-in-double-quotes (escape-string x))))

-(defmethod emit-constant js/Boolean [x] (emits (if x "true" "false")))
+(defmethod emit-constant #?(:clj Boolean :cljs js/Boolean) [x] (emits (if x "true" "false")))

 #?(:clj
    (defmethod emit-constant Character [x]


Fix producer names

Fix producer names

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -131,33 +131,47 @@

 (def producer-raw-to-producer
   "Mapping between producer-raw and producer"
-  {1 "DBh, Marburg"
-   101 "DBh, Marburg"
-   2 "BHB, Berlin"
-   4 "NBH, Hamburg"
-   5 "BBH, München"
-   6 "WBH, Münster"
-   8 "SBH, Stuttgart"
-   11 "DKBB, Bonn"
-   13 "SBS, Zürich"
+  {1   "DBH, Marburg"
+   2   "BBH, Berlin"
+   4   "NBH, Hamburg"
+   5   "BBH, München"
+   6   "WBH, Münster"
+   7   "Blindenhörbücherei des Saarlandes"
+   8   "SBH, Stuttgart"
+   9   "EBS, Marburg"
+   11  "DKBB, Bonn"
+   13  "SBS, Zürich"
+   24  "DZB, Leipzig"
+   25  "CAB, Landschlacht"
+   26  "Reformierte Blindenpflege Zürich"
+   32  "Paderborn"
+   40  "BIT, München"
+   50  "BSVÖ, Wien"
    100 "SBS, Zürich"
-   24 "DZB, Leipzig"
+   101 "Blista, Marburg"
    102 "DZB, Leipzig"
-   25 "CAB, Landschlacht"
-   32 "Blindenschrift-Verlag, Paderborn"
-   40 "BIT, München"
-   50 "BSVÖ, Wien"
-   103 "Blindenschrift-Verlag, Paderborn"
+   103 "Paderborn"
    104 "VzFB, Hannover"
+   105 "BIT, München"
    106 "BBI, Wien"
-   108 "Stiftung für blinde und sehbehinderte Kinder und Jugendliche"
+   107 "EBS, Wernigerode"
+   108 "Zollikofen"
+   109 "ONCE, Madrid"
    110 "SZB, St. Gallen"
    111 "RNIB, London"
    112 "Velen Integrationsspiel"
+   113 "Monza"
    114 "IKS, Kassel"
+   115 "DBB, Kopenhagen"
+   116 "AVH, Paris"
+   117 "VA, Melbourne"
+   118 "SALB, Grahamstown"
+   119 "ABWA"
    120 "Braillists, Princeton"
    121 "Bartkowski, München"
-   122 "Freunde blinder und sehbehinderter Kinder, Hamburg"})
+   122 "Freunde blinder und sehbehinderter Kinder, Hamburg"
+   123 "Braille-Kinderbücher, Düren"
+   124 "Berlin, Anderes Sehen"})

 (def genre-code-to-genre
   "Mapping between genre-code and genre. Used for movies"


Fix misplaced docstring (found with clj-kondo).

--- src/cheshire/core.clj
+++ src/cheshire/core.clj
@@ -121,11 +121,12 @@
 (def ^:dynamic ^JsonGenerator *generator*)
 (def ^:dynamic *opt-map*)

-(defmacro with-writer [[writer opt-map] & body]
+(defmacro with-writer
   "Start writing for series objects using the same json generator.
    Takes writer and options map as arguments.
    Expects its body as sequence of write calls.
    Returns a given writer."
+  [[writer opt-map] & body]
   `(let [c-wr# ~writer]
      (binding [*generator* (create-generator c-wr#)
                *opt-map* ~opt-map]


CLJS-281: cache hash on records, use hash-imap

NB. records do share their hashing algorithm with maps in Clojure.

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -456,7 +456,7 @@
   (let [hinted-fields fields
         fields (vec (map #(with-meta % nil) fields))
         base-fields fields
-	fields (conj fields '__meta '__extmap)
+	fields (conj fields '__meta '__extmap (with-meta '__hash {:mutable true}))
         pmasks (prepare-protocol-masks env tagname impls)
 	adorn-params (fn [sig]
                        (cons (vary-meta (second sig) assoc :cljs.compiler/fields fields)
@@ -480,7 +480,7 @@
 		 impls
 		 ['IRecord
 		  'IHash
-		  `(~'-hash [this#] (hash-coll this#))
+		  `(~'-hash [this#] (caching-hash this# ~'hash-imap ~'__hash))
 		  'IEquiv
 		  `(~'-equiv [this# other#]
         (if (and other#
@@ -512,14 +512,15 @@
 		  `(~'-assoc [this# k# ~gs]
                      (condp identical? k#
                        ~@(mapcat (fn [fld]
-                                   [(keyword fld) (list* `new tagname (replace {fld gs} fields))])
+                                   [(keyword fld) (list* `new tagname (replace {fld gs '__hash nil} fields))])
                                  base-fields)
-                       (new ~tagname ~@(remove #{'__extmap} fields) (assoc ~'__extmap k# ~gs))))
+                       (new ~tagname ~@(remove #{'__extmap '__hash} fields) (assoc ~'__extmap k# ~gs) nil)))
 		  'IMap
 		  `(~'-dissoc [this# k#] (if (contains? #{~@(map keyword base-fields)} k#)
                                             (dissoc (with-meta (into {} this#) ~'__meta) k#)
                                             (new ~tagname ~@(remove #{'__extmap} fields)
-                                                 (not-empty (dissoc ~'__extmap k#)))))
+                                                 (not-empty (dissoc ~'__extmap k#))
+                                                 nil)))
 		  'ISeqable
 		  `(~'-seq [this#] (seq (concat [~@(map #(list `vector (keyword %) %) base-fields)]
                                               ~'__extmap)))


CLJS-1157: Stacktrace unmunging blindly use locals

Use a little discretion when replacing munged names
with local (unmunged) names: Only do so if we can
munge them back.

The function used in merge-with in this patch makes a
best effort at trying to see if we can munge back.

--- src/clj/cljs/repl.clj
+++ src/clj/cljs/repl.clj
@@ -302,8 +302,12 @@
                      :column   column'}
                     (when url
                       {:url url}))))]
-          ;; take each non-nil :call and merge it into :function one-level up
-          (map merge
+          ;; take each non-nil :call and optionally merge it into :function one-level up
+          ;; to avoid replacing with local symbols, we only replace munged name if we can munge call symbol back to it
+          (map #(merge-with (fn [munged-fn-name unmunged-call-name]
+                              (if (= munged-fn-name (string/replace (cljs.compiler/munge unmunged-call-name) "." "$"))
+                                unmunged-call-name
+                                munged-fn-name)) %1 %2)
             (map #(dissoc % :call) with-calls)
             (concat (rest (map #(if (:call %)
                                  (hash-map :function (:call %))