Integration tests now use ES native client

--- test/kixi/integration/base.clj
+++ test/kixi/integration/base.clj
@@ -6,15 +6,16 @@
              [test :refer :all]]
             [clojure.core.async :as async]
             [clojure.java.io :as io]
-            [clojure.spec.test :as stest]
-            [clojurewerkz.elastisch.rest :as esr]
-            [clojurewerkz.elastisch.rest.index :as esi]
+            [clojure.spec.test :as stest]
+            [clojurewerkz.elastisch.native :as esr]
+            [clojurewerkz.elastisch.native.index :as esi]
             [digest :as d]
             [environ.core :refer [env]]
             [kixi.comms :as c]
             [kixi.datastore
              [communication-specs :as cs]
              [filestore :as fs]
+             [elasticsearch :as es]
              [metadatastore :as ms]
              [schemastore :as ss]]
             [user :as user])
@@ -25,7 +26,9 @@
 (def wait-emit-msg (Integer/parseInt (env :wait-emit-msg "5000")))
 (def run-against-staging (Boolean/parseBoolean (env :run-against-staging "false")))
 (def es-host (env :es-host "localhost"))
-(def es-port (Integer/parseInt (env :es-port "9200")))
+(def es-port (Integer/parseInt (env :es-native-port "9300")))
+(def es-discover-url (env :es-discover-url))
+(def es-cluster (env :es-cluster))

 (def every-count-tries-emit (int (/ wait-emit-msg wait-per-try)))

@@ -41,12 +44,17 @@

 (defn refresh-indexes
   []
-  (let [conn (esr/connect (str "http://" es-host ":" es-port)
-                          {:connection-manager (clj-http.conn-mgr/make-reusable-conn-manager {:timeout 10})})]
-    (esi/refresh conn
-                 kixi.datastore.metadatastore.elasticsearch/index-name)
-    (esi/refresh conn
-                 kixi.datastore.schemastore.elasticsearch/index-name)))
+  (let [{:keys [native-host-ports]} (if es-discover-url
+                                      (es/discover-executor es-discover-url)
+                                      {:native-host-ports [[es-host es-port]]})]
+    (with-open [conn (esr/connect native-host-ports
+                          (merge {}
+                                 (when es-cluster
+                                   {:cluster.name es-cluster})))]
+      (esi/refresh conn
+                   kixi.datastore.metadatastore.elasticsearch/index-name)
+      (esi/refresh conn
+                   kixi.datastore.schemastore.elasticsearch/index-name))))

 (defmacro is-submap
   [expected actual & [msg]]


Remove now-dead functions.

Remove now-dead functions.

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -280,17 +280,6 @@
                     :href (str path "?t=" (.getTime (js/Date.)))})]
     (.appendChild (.-head js/document) link)))

-(defn refresh-css! []
-  (doseq [link (utils/node-list->seqable (goog.dom/getElementsByTagNameAndClass "link"))
-          :when (let [href (.getAttribute link "href")]
-                  (re-find #"/assets/css/app.*?\.css(?:\.less)?" href))]
-    (.removeChild (.-parentNode link) link))
-  (add-css-link "/assets/css/app.css"))
-
-(defn update-ui! []
-  (reinstall-om!)
-  (refresh-css!))
-
 (defn track-intercom-widget! [state]
   (when (config/intercom-enabled?)
     ;; wait a little bit for the intercom widget to load and install itself


Revert accidental local figwheel changes.

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -321,6 +321,5 @@
     (analytics/track-invited-by (:invited-by utils/initial-query-map))
     (when-let [weasel-url (get-in @state [:render-context :weasel_url])]
       (ws-repl/connect weasel-url :verbose true))
-    (setup-figwheel! "ws://localhost:3449/figwheel-ws")
-    #_(when-let [figwheel-url (get-in @state [:render-context :figwheel_url])]
+    (when-let [figwheel-url (get-in @state [:render-context :figwheel_url])]
       (setup-figwheel! figwheel-url))))


Handle infrastucture_fail job status

Handle infrastucture_fail job status

--- src-cljs/frontend/send.cljs
+++ src-cljs/frontend/send.cljs
@@ -46,7 +46,7 @@
 (defn- job-run-status [job-status-str]
   (case job-status-str
     ("fixed" "success") :job-run-status/succeeded
-    ("terminated-unknown" "failed") :job-run-status/failed
+    ("terminated-unknown" "failed" "infrastructure_fail") :job-run-status/failed
     "timedout" :job-run-status/timed-out
     "canceled" :job-run-status/canceled
     ("skipped" "not_run") :job-run-status/not-run


include snapshots/qualified versions in 'get' output.

--- src/leiningen/ancient/get.clj
+++ src/leiningen/ancient/get.clj
@@ -1,4 +1,4 @@
-(ns ^{ :doc "List artifact version information."
+(ns ^{ :doc "List artifact version information."
        :author "Yannick Scherer" }
   leiningen.ancient.get
   (:require [leiningen.ancient.utils.projects :refer [collect-repositories]]
@@ -32,7 +32,7 @@
       (print (str "  * " label " [ "))
       (let [vps (partition 5 5 nil (map first vs))]
         (doseq [v (first vps)] (print (pr-str v) ""))
-        (doseq [vp (rest vps)]
+        (doseq [vp (rest vps)]
           (println)
           (print indent)
           (doseq [v vp] (print (pr-str v) ""))))
@@ -53,8 +53,9 @@
 (def run-get-task!
   (->
     (fn [settings repos package {:keys [group-id artifact-id] :as artifact}]
-      (let [artifact-str (str group-id "/" artifact-id)]
-        (println "Getting Version Information for" (yellow artifact-str)
+      (let [artifact-str (str group-id "/" artifact-id)
+            settings (assoc settings :snapshots? true :qualified? true)]
+        (println "Getting Version Information for" (yellow artifact-str)
                  "from" (count repos) "Repositories ...")
         (let [vs (->> (anc/versions! settings repos artifact)
                       (sort #(v/version-seq-compare (second %1) (second %2)))


Allow getting the release key signing passwords from environment variables

--- src/leiningen/droid/build.clj
+++ src/leiningen/droid/build.clj
@@ -244,14 +244,14 @@
       ;; Create a debug keystore if there isn't one
       (create-debug-keystore keystore-path))
     (ensure-paths unaligned-path keystore-path)
-    (let [storepass (cond storepass storepass
-                          dev-build "android"
-                          :else
-                          (read-password "Enter storepass: "))
-          keypass (cond keypass keypass
-                        dev-build "android"
-                        :else
-                        (read-password "Enter keypass: "))]
+    (let [storepass     (or (when dev-build "android")
+                            storepass
+                            (System/getenv "STOREPASS")
+                            (read-password "Enter storepass: "))
+          keypass       (or (when dev-build "android")
+                            keypass
+                            (System/getenv "KEYPASS")
+                            (read-password "Enter keypass: "))]
       (sh "jarsigner"
           "-sigalg" sigalg
           "-digestalg" "SHA1"


prefix only replaced in file if followed by...

... whitespace or '.'

--- src/leiningen/source_deps.clj
+++ src/leiningen/source_deps.clj
@@ -71,7 +71,7 @@
 (defn- update-file [file prefixes prefix]
   (let [old (slurp file)
         new (-> (str/replace old (re-pattern (str "(\\[\\s*)" prefix "(\\s+\\[?)")) (str "$1" (prefixes prefix) "$2"))
-                (str/replace (re-pattern (str "(\\s+)" prefix)) (str "$1" (prefixes prefix))))]
+                (str/replace (re-pattern (str "(\\s+)" prefix "([\\s\\.])")) (str "$1" (prefixes prefix) "$2")))]
     (when-not (= old new)
       (spit file new))))


Use session code 'default' if event doesn't specify session code

--- src/liber/database/events.clj
+++ src/liber/database/events.clj
@@ -53,7 +53,7 @@
           event-time (get event :event_time store-time)
           event (assoc event :event_time event-time)
           tracker-id (or (:id tracker tracker))
-          session-code (:session_code event)
+          session-code (:session_code event "default")
           session (dao/get-or-create-session! conn tracker-id session-code event-time)
           new-event (dao/create-event! conn tracker-id (:id session) event)
           ext-values (find-ext-values event)


refactor: delete unused test/cljs/runner.cljs

Fixes #100

--- src/leiningen/new/re_frame/test/cljs/runner.cljs
+++ src/leiningen/new/re_frame/test/cljs/runner.cljs
@@ -1,5 +0,0 @@
-(ns {{ns-name}}.runner
-    (:require [doo.runner :refer-macros [doo-tests]]
-              [{{ns-name}}.core-test]))
-
-(doo-tests '{{ns-name}}.core-test)


Ns import copy paste error

Ns import copy paste error

--- src/bfg/core.clj
+++ src/bfg/core.clj
@@ -3,7 +3,7 @@
    [bfg.ws :as ws]
    [ring.middleware.resource :refer (wrap-resource)]
    [ring.middleware.content-type :refer (wrap-content-type)]
-   [ring.middleware.not-modified :refer (wrap-not-modified)])
+   [ring.middleware.not-modified :refer (wrap-not-modified)]
    [immuconf.config :as immuconf]
    [immutant.web             :as web]
    [immutant.web.async       :as async]


:sunglasses::tada:

:sunglasses::tada:

--- src/puns/greyt.clj
+++ src/puns/greyt.clj
@@ -109,7 +109,25 @@
   "Is this grey or not?"
   [word] (some-> (syllables (upper-case word)) ey?'))

-(ann pen-pun (IFn [String -> String]))
+(ann ^:no-check greyify (IFn [String -> AAVecString]))
+(defn greyify [word]
+  (loop [coll :- (U AAVecString (ASeq String)), (syllables word)
+         acc  :- (U (HVec []) (PersistentVector String)), []
+         tail :- String, ""]
+    (if (empty? coll)
+      acc
+      (let [[x y] coll]
+        (if (and y (is-consonant? x) ((starts-with? "EY") y))
+          (if (= "G" tail)
+            (recur (rest (rest coll)) (conj acc "R" y) y)
+            (recur (rest (rest coll)) (conj acc "G" "R" y) y))
+          (recur (rest coll) (conj acc x) x))))))
+
+(ann pen-pun (IFn [String -> (U String AAVecString)]))
 (defn pen-pun
   "TODO: Make greyt puns."
-  [s] s)
+  [s]
+  (let [greyified (greyify s)]
+    (if (ey?' greyified)
+      (or (ldb/get db greyified) greyified)
+      s)))


Whitespace

Whitespace

--- planck-cljs/src/planck/io.cljs
+++ planck-cljs/src/planck/io.cljs
@@ -139,9 +139,9 @@
           (update-in [:modified] #(js/Date. %))))

 (defn delete-file
-    "Delete file f."
-    [f]
-    (js/PLANCK_DELETE (:path (as-file f))))
+  "Delete file f."
+  [f]
+  (js/PLANCK_DELETE (:path (as-file f))))

 ;; These have been moved
 (def ^:deprecated read-line planck.core/read-line)


minor refactoring

minor refactoring

--- src/NoteHub/views/pages.clj
+++ src/NoteHub/views/pages.clj
@@ -60,22 +60,6 @@
                   links (interpose separator links)]
               [:div#panel (map identity links)]))))

-; Routes
-; ======
-
-; Landing Page
-(defpage "/" {}
-  (layout (get-message :page-title)
-          [:div#hero
-           [:h1 (get-message :name)]
-           [:h2 (get-message :title)]
-           [:br]
-           [:a.landing-button {:href "/new" :style "color: white"} (get-message :new-page)]]
-          [:div#dashed-line]
-          [:article.helvetica.bottom-space.markdown {:style "font-size: 1em"}
-           (slurp "LANDING.md")]
-          [:div.centered.helvetica.markdown (get-message :footer)]))
-
 ; input form for the markdown text with a preview area
 (defpartial input-form [form-url command fields content passwd-msg]
   (let [css-class (when (= :publish command) :hidden)]
@@ -93,6 +77,22 @@
                                    :plain-password)
                        (submit-button {:class "button ui-elem"
                                        :id :publish-button} (get-message command))])])))
+
+; Routes
+; ======
+
+; Landing Page
+(defpage "/" {}
+  (layout (get-message :page-title)
+          [:div#hero
+           [:h1 (get-message :name)]
+           [:h2 (get-message :title)]
+           [:br]
+           [:a.landing-button {:href "/new" :style "color: white"} (get-message :new-page)]]
+          [:div#dashed-line]
+          [:article.helvetica.bottom-space.markdown {:style "font-size: 1em"}
+           (slurp "LANDING.md")]
+          [:div.centered.helvetica.markdown (get-message :footer)]))

 ; Update Note Page
 (defpage "/:year/:month/:day/:title/edit" {:keys [year month day title]}


Require lein-kibit in profile.clj.

Require lein-kibit in profile.clj.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -9,6 +9,7 @@
                   [lein-exec "0.3.0"]
                   [org.bodil/lein-noderepl "0.1.10"]
                   [quickie "0.2.1"]
+                  [lein-kibit "0.0.8"]
                   [lein-clojars "0.9.1"]
                   [lein-pprint "1.1.1"]
                   [lein-ring "0.8.0"]


[lein] bump deps

[lein] bump deps

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -2,7 +2,7 @@
                   [lein-fore-prob                    "0.1.2"]

                   ; Check for outdated dependencies
-                  [lein-ancient                      "0.6.10"]
+                  [lein-ancient                      "0.6.14"]

                   ;; lein-test when something changes
                   [com.jakemccrary/lein-test-refresh "0.21.1"]


Skips inactive pools when ranking (#1862)

--- scheduler/src/cook/scheduler/scheduler.clj
+++ scheduler/src/cook/scheduler/scheduler.clj
@@ -1750,7 +1750,7 @@
         pool-name->pending-task-ents (pc/map-vals #(map tools/create-task-ent %1) pool-name->pending-job-ents)
         pool-name->running-task-ents (group-by (comp cached-queries/job->pool-name :job/_instance)
                                                (tools/get-running-task-ents unfiltered-db))
-        pools (pool/all-pools unfiltered-db)
+        pools (->> unfiltered-db pool/all-pools (filter pool/schedules-jobs?))
         using-pools? (-> pools count pos?)
         pool-name->user->dru-divisors (if using-pools?
                                         (pool-map pools (fn [{:keys [pool/name]}]


one more lint fix.

one more lint fix.

--- src/metabase/driver/mongo.clj
+++ src/metabase/driver/mongo.clj
@@ -58,15 +58,15 @@
   (with-mongo-connection [_ database]
     (do-sync-fn)))

-(defn- val->special-type [val]
+(defn- val->special-type [field-value]
   (cond
     ;; 1. url?
-    (and (string? val)
-         (u/is-url? val)) :url
+    (and (string? field-value)
+         (u/is-url? field-value)) :url
     ;; 2. json?
-    (and (string? val)
-         (or (.startsWith "{" val)
-             (.startsWith "[" val))) (when-let [j (u/try-apply json/parse-string val)]
+    (and (string? field-value)
+         (or (.startsWith "{" field-value)
+             (.startsWith "[" field-value))) (when-let [j (u/try-apply json/parse-string field-value)]
                                            (when (or (map? j)
                                                      (sequential? j))
                                              :json))))


[#84] Refactor CSV import

[#84] Refactor CSV import

--- backend/src/org/akvo/dash/import/csv.clj
+++ backend/src/org/akvo/dash/import/csv.clj
@@ -58,11 +58,21 @@
             (s/join ", " src-cols)
             src-table)))

+(defn get-vacuum-sql
+  "Returns a `VACUUM` statement for a given table"
+  [table-name]
+  (format "VACUUM (FULL) %s" table-name))
+
+(defn get-drop-table-sql
+  "Returns a `DROP TABLE` statement for a given table"
+  [table-name]
+  (format "DROP TABLE IF EXISTS %s CASCADE" table-name))
+
 (defn get-headers
   "Returns the first line CSV a file"
   [path separator]
   (with-open [r (io/reader path)]
-    (first (csv/read-csv r :separator separator))))
+    (vec (first (csv/read-csv r :separator separator)))))

 (defn get-num-cols
   "Returns the number of columns based on the
@@ -71,38 +81,31 @@
   (count (get-headers path separator)))

 (defn get-column-tuples
-  "Returns a vector of tuples suitable for a single
-   SQL insert"
-  [dataset-id, names, num-cols, c-type]
+  [col-titles]
   (vec
-   (for [i (range 1 (inc num-cols))]
-     [(str (squuid))
-      dataset-id
-      c-type
-      (if (empty? names) (str "Column " i) (nth names (dec i)))
-      (str "c" i)
-      (* 10 i)])))
+   (map-indexed (fn [idx title]
+                  [title (str "c" (inc idx)) "text"]) col-titles)))

-(defn make-dataset
-  "Creates a dataset from a CSV file"
-  [conn spec]
+(defn make-dataset-data-table
+  "Creates a dataset data table from a CSV file. Some of keys
+  required in `spec`:
+  :path - defines the path to the CSV file on disk
+  :headers? - defines if the CSV file contains headers"
+  [tenant-conn config table-name spec]
   (let [path (:path spec)
         headers? (:headers? spec)
-        dataset-name (:dataset-name spec)
-        col-names (if headers? (get-headers path \,) [])
         n-cols (get-num-cols path \,)
-        table (gen-table-name)
-        temp (str table "_temp")
-        dataset-id (str (squuid))
-        copy-manager (CopyManager. (cast BaseConnection (:connection conn)))]
-    (jdbc/execute! conn [(get-create-table-sql temp n-cols "text" true)])
-    (jdbc/execute! conn [(get-create-table-sql table n-cols "jsonb" false)])
-    (.copyIn copy-manager (get-copy-sql temp n-cols headers?) (io/input-stream path))
-    (jdbc/execute! conn [(get-insert-sql temp table n-cols)])
-    (insert-dataset conn {:id dataset-id
-                          :name dataset-name})
-    (insert-dataset-version conn {:id (str (squuid))
-                                  :dataset-id dataset-id
-                                  :table-name table})
-    (insert-dataset-columns conn {:columns (get-column-tuples dataset-id col-names n-cols "text")})
-    dataset-id))
+        col-names (if headers?
+                    (get-headers path \,)
+                    (vec (for [i (range 1 (inc n-cols))]
+                           (str "Column " i))))
+        temp-table (str table-name "_temp")
+        copy-manager (CopyManager. (cast BaseConnection (:connection tenant-conn)))]
+    (jdbc/execute! tenant-conn [(get-create-table-sql temp-table n-cols "text" true)])
+    (jdbc/execute! tenant-conn [(get-create-table-sql table-name n-cols "jsonb" false)])
+    (.copyIn copy-manager (get-copy-sql temp-table n-cols headers?) (io/input-stream path))
+    (jdbc/execute! tenant-conn [(get-insert-sql temp-table table-name n-cols)])
+    (jdbc/execute! tenant-conn [(get-drop-table-sql temp-table)])
+    (jdbc/execute! tenant-conn [(get-vacuum-sql table-name)])
+    {:success? true
+     :columns (get-column-tuples col-names)}))


[bugfix] pass constructed job to execute-job

--- bigquery/src/clojure/gclouj/bigquery.clj
+++ bigquery/src/clojure/gclouj/bigquery.clj
@@ -343,7 +343,7 @@
     (.maxBadRecords builder (int (or max-bad-records 0)))
     (when schema
       (.schema builder (mkschema schema)))
-    (execute-job service (table-id table))))
+    (execute-job service (.build builder))))

 (def extract-format {:json "NEWLINE_DELIMITED_JSON"
                      :csv  "CSV"


doctype

doctype

--- src/nodecljs/server/core.cljs
+++ src/nodecljs/server/core.cljs
@@ -16,7 +16,8 @@
       (->> (<! jokes-chan)
            (map #(str "<p>" %))
            (string/join "\n")
-           (#(string/join "\n" ["<!html><main>" % "<script src='/js/app.js'>"]))
+           (#(string/join "\n" ["<!DOCTYPE html><main>"
+                                % "</main><script src='/js/app.js'>"]))
            (.send res)))))

 (defn server [handler port cb]


fix derp

fix derp

--- streamparse/bootstrap/project/project.jinja2.clj
+++ streamparse/bootstrap/project/project.jinja2.clj
@@ -5,7 +5,7 @@
   :min-lein-version "2.0.0"
   :jvm-opts ["-client"]
   :dependencies  [[org.apache.storm/storm-core "0.9.2-incubating"]
-                  [com.parsely/streamparse "0.0.3-SNAPSHOT"]
+                  [com.parsely/streamparse "0.0.4-SNAPSHOT"]
                   ]
   :jar-exclusions     [#"log4j\.properties" #"backtype" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
   :uberjar-exclusions [#"log4j\.properties" #"backtype" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]


add a migration to create the precursor team

--- src/pc/datomic/migrations.clj
+++ src/pc/datomic/migrations.clj
@@ -107,6 +107,17 @@
     (document-ids->document-refs db conn)
     (access-entities-ids->refs db conn)))

+(defn add-precursor-team [conn]
+  (let [subdomain "precursor"]
+    (when-not (first (d/q '{:find [?t .]
+                            :where [[?t :team/subdomain ?s]]}
+                          (d/db conn) subdomain))
+      ;; no need to worry about races, unique constraint on subdomain will explode if
+      ;; we try to insert it twice
+      @(d/transact conn [{:db/id (d/tempid :db.part/user)
+                          :team/subdomain subdomain
+                          :team/uuid (d/squuid)}]))))
+
 (def migrations
   "Array-map of migrations, the migration version is the key in the map.
    Use an array-map to make it easier to resolve merge conflicts."
@@ -119,7 +130,8 @@
    5 #'archive/migrate-fake-documents
    6 #'archive/fix-bounding-boxes
    7 #'archive/add-frontend-ids
-   8 #'longs->refs))
+   8 #'longs->refs
+   9 #'add-precursor-team))

 (defn necessary-migrations
   "Returns tuples of migrations that need to be run, e.g. [[0 #'migration-one]]"


fix .threads css error (need to use garden arithmetic + )

--- src/braid/ui/styles/misc.cljs
+++ src/braid/ui/styles/misc.cljs
@@ -181,7 +181,7 @@
   [:.threads
    mixins/flex
    {:position "absolute"
-    :top (+ vars/top-bar-height vars/pad vars/pad)
+    :top (m/+ vars/top-bar-height vars/pad vars/pad)
     :right 0
     :bottom vars/pad
     :left 0


Use domain to generate background color for website embeds

--- src/braid/ui/views/embed.cljs
+++ src/braid/ui/views/embed.cljs
@@ -1,7 +1,8 @@
 (ns braid.ui.views.embed
   (:require [reagent.core :as r]
+            [clojure.string :as string]
             [chat.client.xhr :refer [edn-xhr]]
-            [chat.client.views.helpers :refer [->color]]))
+            [chat.client.views.helpers :refer [->color url->parts]]))

 (defn- arr->rgb [arr]
   ; until embedly provides color alpha, default to transparent background
@@ -12,7 +13,11 @@

 (defn- website-embed-view [content]
   [:div.content.loaded.website
-   {:style {:background-color (->color (content :provider_name))}}
+   {:style {:background-color (-> (content :original_url)
+                                  string/lower-case
+                                  url->parts
+                                  :domain
+                                  ->color)}}
    (if-let [img (get-in content [:images 0])]
      [:img.image {:src (img :url)
                   :style {:background-color


changed borderColor attr to border-color

--- src/braid/ui/views/pills.cljs
+++ src/braid/ui/views/pills.cljs
@@ -15,7 +15,7 @@
                       :tabIndex -1
                       :style {:background-color (id->color (tag :id))
                               :color (id->color (tag :id))
-                              :borderColor (id->color (tag :id))}
+                              :border-color (id->color (tag :id))}
                       :href path}
           [:div.name "#" (tag :name)]]))))

@@ -33,7 +33,7 @@
                        :tabIndex -1
                        :style {:background-color (id->color (user :id))
                                :color (id->color (user :id))
-                               :borderColor (id->color (user :id))}
+                               :border-color (id->color (user :id))}
                        :href path}
           [:span.name (str "@" (user :nickname))]
           [:div {:class (str "status " ((fnil name "") (user :status)))}]]))))


Disable timeout

Disable timeout

--- src/clj/nightcode/editors.clj
+++ src/clj/nightcode/editors.clj
@@ -129,7 +129,8 @@

 (defn eval-code [disable-security? code]
   (->> (es/code->results (edn/read-string code)
-         {:disable-security? disable-security?})
+         {:disable-security? disable-security?
+          :disable-timeout? true})
        (mapv form->serializable)
        pr-str))


test for invalid surge target- not virus

--- src/clj/test/cards-events.clj
+++ src/clj/test/cards-events.clj
@@ -115,7 +115,17 @@

 (deftest surge-target-not-virus
   "Don't fire surge if target is not a virus"
-  )
+  (do-game
+    (new-game (default-corp)
+              (default-runner [(qty "Security Testing" 1) (qty "Surge" 1)]))
+    (take-credits state :corp)
+    (play-from-hand state :runner "Security Testing")
+    (let [st (get-in @state [:runner :rig :resource 0])]
+      (play-from-hand state :runner "Surge")
+      (prompt-select :runner st)
+      (is (not (contains? st :counter)))
+      )
+    ))

 (deftest surge-target-no-token-this-turn
   "Don't fire surge if target does not have virus counter flag set"


New functions: get-calendar, format-date-using-desired-format and format-date-time

--- src/clj_calendar/calendar.clj
+++ src/clj_calendar/calendar.clj
@@ -10,5 +10,22 @@
 ;      Pavel Tisnovsky
 ;

-(ns clj-calendar.calendar)
+(ns clj-calendar.calendar
+    "Namespace that contains various functions for handling calendar and dates.")

+(defn get-calendar
+    "Gets an instance of calendar using the default time zone and default locale."
+    []
+    (java.util.Calendar/getInstance))
+
+(defn format-date-using-desired-format
+    "Format given date using desired format, for example 'yyyy-MM-dd' etc."
+    [calendar desired-format]
+    (let [date-format (new java.text.SimpleDateFormat desired-format)]
+        (.format date-format (.getTime calendar))))
+
+(defn format-date-time
+    "Format given date using the following format: 'yyyy-MM-dd HH:mm:ss'"
+    [calendar]
+    (format-date-using-desired-format calendar "yyyy-MM-dd HH:mm:ss"))
+


RR: add check for calculate fields

RR: add check for calculate fields

--- src/cljs/hatti/ona/forms.cljs
+++ src/cljs/hatti/ona/forms.cljs
@@ -90,6 +90,11 @@
 (defn osm?
   [field]
   (field-type-in-set? #{"osm"} field))
+
+(defn calculate?
+  "Checks whether a field is a calculate field"
+  [field]
+  (field-type-in-set? #{"calculate"} field))

 (defn has-data?
   "Returns false for fields such as note, group, etc. which don't have data"


Broadcasting to every functions.

Broadcasting to every functions.

--- src/clojure/embla/signals.clj
+++ src/clojure/embla/signals.clj
@@ -9,6 +9,8 @@

 ;; Basic signals for handling.
 (def keyboard-input (chan))
+(def custom-signals '())
+

 (defn timer
   "Gives a timer, starting at 0. Count every second."
@@ -21,11 +23,56 @@
     time))

 (defn update-chan
-  "push the value to keyboard-input. Little functions to be used in java."
+  "Push the value to keyboard-input. Little functions to be used in java."
   [key-press state]
   (go (>! keyboard-input (list key-press state))))

+(defn search-signal
+  "Search for the named signal into the existing signals. false if signal does not exist."
+  [name]
+  (loop [[sig & signals] custom-signals]
+    (let [sig-name (first sig)]
+      (if (not= name sig-name)
+        (if-not (empty? signals)
+          (recur signals)
+          false)
+        sig))))

+(defn create-signal
+  "Creates a proper signal for embla."
+  [name]
+  (let [custom (chan)]
+    (if (search-signal name)
+      (throw (Exception. "Trying to create an already existent signal.")))
+    (alter-var-root (var custom-signals) #(cons (list name custom (atom '())) %))))
+
+(defn signal-register
+  "Register the channel fun-sig to the signal named name."
+  [name fun-sig]
+  (let [signal (search-signal name)]
+    (if-not signal
+      (throw (Exception. "Trying to register to inexistent signal."))
+      (let [fun-signals (second (rest signal))]
+        (swap! fun-signals #(cons fun-sig %))))))
+
+(defn defn-sig
+  "Func have to take one channel in parameter."
+  [name func]
+  (let [channel (chan)]
+    (func channel)
+    (signal-register name channel)))
+
+(defn broadcast-all
+  "Transfer the value from the channel to all functions which need it."
+  []
+  (loop [[sig & signals] custom-signals]
+    (let [input  (second sig)
+          output (second (rest sig))]
+      (go-loop []
+        (let [msg (<! input)]
+          (map #(go (>! % msg)) output)))
+      (if-not (empty? signals)
+        (recur signals)))))

 ;;; Historical purposes
 (comment


Make implementing ILifecycle optional

Make implementing ILifecycle optional

Allow a component to not implement ILifecycle if it doesn't need to.

--- src/com/palletops/leaven.cljx
+++ src/com/palletops/leaven.cljx
@@ -7,12 +7,16 @@
 (defn start
   "Start a component."
   [component]
-  (protocols/start component))
+  (if (satisfies? ILifecycle component)
+    (protocols/start component)
+    component))

 (defn stop
   "Stop a component."
   [component]
-  (protocols/stop component))
+  (if (satisfies? ILifecycle component)
+    (protocols/stop component)
+    component))

 (defn status
   "Ask a component for its status."


clothing is inedible

clothing is inedible

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -45,6 +45,7 @@
                       :place true}

    {:clothing true}  {:animate false
+                      :edible false
                       :place false
                       :physical-object true}
    {:consumable


don't show notes in demo mode (:show-notes false)

--- src/babel/english/demo.cljc
+++ src/babel/english/demo.cljc
@@ -3,6 +3,7 @@
    [babel.english :refer [generate]]
    [babel.english.morphology :refer [fo]]
    #?(:cljs [babel.logjs :as log])
+   [clojure.string :as string]
    #?(:clj [clojure.tools.logging :as log])))

 (declare run-demo-with)
@@ -41,8 +42,11 @@
                         (println)
                         (let [expressions (run-demo-with n spec)]
                           (count (pmap (fn [expression]
-                                         (do
-                                           (println (fo expression))))
+                                         (let [formatted (fo expression :show-notes false)]
+                                           (println
+                                            (str (string/capitalize (subs formatted 0 1))
+                                                 (subs formatted 1 (count formatted))
+                                                 "."))))
                                        expressions))))))
                 (if spec
                   (filter #(= (:demo-name %)


made get-users-in-open-group method filterable by status

--- src/braid/common/state.cljs
+++ src/braid/common/state.cljs
@@ -112,8 +112,9 @@
   (reaction (get-in @state [:open-group-id])))

 (defn get-users-in-open-group
-  [state _]
-  (reaction @(get-users-in-group @state [nil (@state :open-group-id)])))
+  [state [_ status]]
+  (reaction (->> @(get-users-in-group @state [nil (@state :open-group-id)])
+                 (filter (fn [u] (= status (u :status)))))))

 (defn get-user-id
   [state _]


asserting system-id

asserting system-id

--- src/celestial/workflows.clj
+++ src/celestial/workflows.clj
@@ -26,7 +26,7 @@
    )
   (:import
     [celestial.puppet_standalone Standalone]
-    [proxmox.provider Container]))
+    ))

 (import-logging)

@@ -65,7 +65,8 @@
 (defn updated-system
    "grabs system and associates system id"
    [system-id]
-   (assoc (s/get-system system-id) :system-id system-id))
+   {:pre [system-id]}
+   (assoc (s/get-system! system-id) :system-id system-id))

 (defn running!
   "Asserts that a VM is running"


Update clj-http to fix error with Clojure 1.8

--- ring-jetty-adapter/project.clj
+++ ring-jetty-adapter/project.clj
@@ -9,7 +9,7 @@
                  [ring/ring-servlet "1.4.0"]
                  [org.eclipse.jetty/jetty-server "9.2.10.v20150310"]]
   :profiles
-  {:dev {:dependencies [[clj-http "1.1.2"]]}
+  {:dev {:dependencies [[clj-http "2.2.0"]]}
    :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
    :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
    :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})


(- X 1) -> (dec X) is more idiomatic

(- X 1) -> (dec X) is more idiomatic

--- src/chessground/render.cljs
+++ src/chessground/render.cljs
@@ -18,10 +18,10 @@
         c (:chess state)
         squares (for [rank (range 1 9)
                       file-n (range 1 9)
-                      :let [file (get "abcdefgh" (- file-n 1))
+                      :let [file (get "abcdefgh" (dec file-n))
                             key (str file rank)
-                            pos {(if white :left :right) (str (* (- file-n 1) 12.5) "%")
-                                 (if white :bottom :top) (str (* (- rank 1) 12.5) "%")}
+                            pos {(if white :left :right) (str (* (dec file-n) 12.5) "%")
+                                 (if white :bottom :top) (str (* (dec rank) 12.5) "%")}
                             p (chess/get-piece c key)]]
                   (square key pos p white))]
     (str "
" (apply str squares) "
")))


Compiled paths now memoized

Compiled paths now memoized

--- src/compojure/http/routes.clj
+++ src/compojure/http/routes.clj
@@ -13,7 +13,8 @@
 ;; keyword :next if they don't match.

 (ns compojure.http.routes
-  (:use [compojure.str-utils :only (re-escape)]))
+  (:use [compojure.str-utils :only (re-escape)])
+  (:use [compojure.control   :only (decorate-with)]))

 ;; Functions for lexing a string

@@ -75,6 +76,9 @@
             splat :*
             word  #(keyword (.group % 1))
             path  nil))))))
+
+;; Don't compile paths more than once.
+(decorate-with memoize compile-path-matcher)

 (defn- assoc-keywords-with-groups
   "Create a hash-map from a series of regex match groups and a collection of


unused

unused

--- src/clj/just_married/db.clj
+++ src/clj/just_married/db.clj
@@ -26,23 +26,8 @@
   []
   (jdbc/query (db-spec) (all-guests)))

-(defn all-groups
-  []
-  (-> (h/select :*)
-      (h/from :guests-group)
-      (sql/format)))
-
-(defn guests-by-group
-  [group-id]
-  (->
-   (h/select :first_name :last_name)
-   (h/from :guest)
-   (h/where [:= :guest.group_id group-id])
-   (sql/format)))
-
 (defn- insert-into!
   [sql-map]
-
   (let [query (-> sql-map
                   (ph/returning :id)
                   sql/format)]


disable definline

disable definline

--- src/cljam/util/sam_util.clj
+++ src/cljam/util/sam_util.clj
@@ -220,13 +220,12 @@
                    [\d \D]    (:d  compressed-bases-low)
                    [\b \B]    (:b  compressed-bases-low)}))

-(definline char->compressed-base-low
+(defn char->compressed-base-low
   "Convert from a char to BAM nybble representation of a base in low-order nybble."
   [base]
-  `(let [base# ~base]
-     (or
-       (_char->compressed-base-low base#)
-       (throw (IllegalArgumentException. (str "Bad type: " base#))))))
+  (or
+   (_char->compressed-base-low base)
+   (throw (IllegalArgumentException. (str "Bad type: " base)))))

 (def ^:private _char->compressed-base-high
   (unfold-ksv-map {[\=]       (:eq compressed-bases-high)
@@ -246,13 +245,12 @@
                    [\d \D]    (:d  compressed-bases-high)
                    [\b \B]    (:b  compressed-bases-high)}))

-(definline char->compressed-base-high
+(defn char->compressed-base-high
   "Convert from a char to BAM nybble representation of a base in high-order nybble."
   [base]
-  `(let [base# ~base]
-     (or
-       (_char->compressed-base-high base#)
-       (throw (IllegalArgumentException. (str "Bad type: " base#))))))
+  (or
+   (_char->compressed-base-high base)
+   (throw (IllegalArgumentException. (str "Bad type: " base)))))

 (def ^:private _compressed-base->char-low
   {(:eq compressed-bases-low) \=
@@ -272,13 +270,12 @@
    (:d  compressed-bases-low) \D
    (:b  compressed-bases-low) \B})

-(definline compressed-base->char-low
+(defn compressed-base->char-low
   "Convert from BAM nybble representation of a base in low-order nybble to a char."
   [base]
-  `(let [base# ~base]
-     (or
-       (_compressed-base->char-low (ubyte (bit-and base# 0xf)))
-       (throw (IllegalArgumentException. (str "Bad type: " base#))))))
+  (or
+   (_compressed-base->char-low (ubyte (bit-and base 0xf)))
+   (throw (IllegalArgumentException. (str "Bad type: " base)))))

 (def ^:private _compressed-base->char-high
   {(:eq compressed-bases-high) \=
@@ -298,13 +295,12 @@
    (:d  compressed-bases-high) \D
    (:b  compressed-bases-high) \B})

-(definline compressed-base->char-high
+(defn compressed-base->char-high
   "Convert from BAM nybble representation of a base in high-order nybble to a char."
   [base]
-  `(let [base# ~base]
-     (or
-       (_compressed-base->char-high (ubyte (bit-and base# 0xf0)))
-       (throw (IllegalArgumentException. (str "Bad type: " base#))))))
+  (or
+   (_compressed-base->char-high (ubyte (bit-and base 0xf0)))
+   (throw (IllegalArgumentException. (str "Bad type: " base)))))

 (defn bytes->compressed-bases [^bytes read-bases]
   (let [rlen (alength read-bases)
@@ -342,10 +338,10 @@

 ;;; fastq and phred

-(definline fastq-char->phred-byte [ch]
-  `(let [ch# (int ~ch)]
-     (assert (<= 33 ch# 126))
-     (byte (- ch# 33))))
+(defn fastq-char->phred-byte [ch]
+  [ch]
+  {:pre [(<= 33 (int ch) 126)]}
+  (byte (- (int ch) 33)))

 (defn fastq->phred [^String fastq]
   (let [length (count fastq)


simple unparse will do here

simple unparse will do here

--- src/cljs/swarmpit/time.cljs
+++ src/cljs/swarmpit/time.cljs
@@ -31,4 +31,4 @@
   (->> datetime
        (parse)
        (to-default-time-zone)
-       (format/unparse-local-date simple-format)))+       (format/unparse simple-format)))


ideas for separation ai and game

ideas for separation ai and game

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -189,7 +189,7 @@
         move (ai-algo @game @current-player)]
     (update-game! play-move move)))

-(defn cancel-last-move ;; TODO - It needs the ai: how to move it in the game?
+(defn cancel-last-move ;; TODO - It needs the ai: how to move it in the game? undo then undo-while
   [old-turns]
   (let [ai-turn? #(contains? (:ai-players %) (:player %))
         new-turns (drop-while ai-turn? (drop 1 old-turns))]


Don't store `:original-content` in meta; get it on demand

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -149,7 +149,7 @@
                                (let [page-filepath (string/replace path #"(?i).[a-z]+$" ".html")
                                      entry (-> entry*
                                                (assoc :has-content true)
-                                               (assoc :original-content parsed)
+                                               (assoc :original-path path)
                                                (assoc :path page-filepath)
                                                (assoc :filename (string/replace filename
                                                                                #"(?i).[a-z]+$" ".html"))
@@ -447,7 +447,13 @@
     (boot/with-pre-wrap fileset
       (let [global-meta   (perun/get-global-meta fileset)
             options       (merge +atom-defaults+ global-meta *opts*)
-            files         (filter (:filterer options) (perun/get-meta fileset))]
+            files         (->> fileset
+                               perun/get-meta
+                               (filter (:filterer options))
+                               (map #(let [f (boot/tmp-get fileset (:original-path %))
+                                           oc (or (-> f perun/+meta-key+ :parsed)
+                                                  (-> f boot/tmp-file slurp))]
+                                       (assoc % :original-content oc))))]
         (perun/assert-base-url (:base-url options))
         (pod/with-call-in @pod
           (io.perun.atom/generate-atom ~(.getPath tmp) ~files ~(dissoc options :filterer)))


Fix cigar parsing

Fix cigar parsing

--- src/clojure/cljam/cigar.clj
+++ src/clojure/cljam/cigar.clj
@@ -25,27 +25,19 @@

 (defn substantial-seq [cigar seq]
   (join
-   (loop [cursor  0
-          matches (re-seq #"([0-9]*)([MIDNSHP=X])" cigar)
+   (loop [matches (parse cigar)
+          cursor  0
           ret     []]
-     (if (first matches)
-       (let [n  (Integer/parseInt (second (first matches)))
-             op (last (first matches))]
-         (condp #(not (nil? (%1 %2))) op
-           #{"M" "=" "X"}
-           (recur (+ cursor n)
-                  (rest matches)
-                  (conj ret (subs seq cursor (+ cursor n))))
-
-           #{"D"}
-           (recur cursor
-                  (rest matches)
-                  (conj ret (join (repeat n "*"))))
-
-           #{"N"}
-           (recur cursor
-                  (rest matches)
-                  (conj ret (join (repeat n ">"))))
-
-           (recur cursor (rest matches) ret)))
+     (if-let [[n op]  (first matches)]
+       (let [[cursor* ret*] (condp #(not (nil? (%1 %2))) op
+                              #{\M \= \X} [(+ cursor n)
+                                           (conj ret (subs seq cursor (+ cursor n)))]
+                              #{\D}       [cursor
+                                           (conj ret (join (repeat n "*")))]
+                              #{\N}       [cursor
+                                           (conj ret (join (repeat n ">")))]
+                              #{\S \I}    [(+ cursor n)
+                                           ret]
+                              [cursor ret])]
+         (recur (rest matches) cursor* ret*))
        ret))))


Center the welcome message vertically.

Center the welcome message vertically.

--- src/afterglow/controllers/ableton_push.clj
+++ src/afterglow/controllers/ableton_push.clj
@@ -963,7 +963,7 @@
 (defn- welcome-animation
   "Provide a fun animation to make it clear the Push is online."
   [controller]
-  (set-display-line controller 0 (concat (repeat 24 \space) (seq (str "Welcome to" (version/title)))))
+  (set-display-line controller 1 (concat (repeat 24 \space) (seq (str "Welcome to" (version/title)))))
   (set-display-line controller 2 (concat (repeat 27 \space)
                               (seq (str "version" (version/tag)))))
   (let [counter (atom 0)


Fix small bug in add-child-sp

Fix small bug in add-child-sp

--- src/angelic/search/implicit/dash_astar.clj
+++ src/angelic/search/implicit/dash_astar.clj
@@ -289,6 +289,7 @@
     (do (out-f) false)
     (do (add-output-watcher! c out-f) true)))

+;;; TODO: why does changing to ts of child matter when assert on ??
 ;; TODO: subsumption should prevent child from gettong output before parent ??
 (defn- add-sp-child! [sp child-sp up?]
    (util/print-debug 2 "AC" sp child-sp)
@@ -299,13 +300,13 @@
      )
    (if (get-output-set child-sp)
     (do (add-sp-child!* sp child-sp))
-    (do (summaries/connect! sp child-sp)
-        (add-output-watcher! sp ;; TODO: this feels hacky...
+    (do (summaries/connect! sp (sp-ts child-sp)) ;; Be safe; child could have children before we get output.
+        (add-output-watcher! sp
           (fn [] (add-output-watcher! child-sp
                    (fn [] (util/assert-is (get-output-set sp) "%s" [sp child-sp])
-                     (assert (empty? (get-children child-sp)))
+;                     (assert (empty? (get-children child-sp)))
                      (add-sp-child!* sp child-sp)
-                     (summaries/disconnect! sp child-sp)
+                     (summaries/disconnect! sp (sp-ts child-sp))
                      (schedule-decrease! sp)))))
         (when up? (schedule-increase! sp)))))


Move command-line parse error handling up in priority

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- src/obcc/core.clj
+++ src/obcc/core.clj
@@ -49,14 +49,14 @@
       (:help options)
       (exit 0 (usage summary))

+      (not= errors nil)
+      (exit -1 "Error: " (string/join errors))
+
       (:version options)
       (exit 0 (version))

       (= (count arguments) 0)
       (exit 0 (usage summary))
-
-      (not= errors nil)
-      (exit -1 "Error: " (string/join errors))

       (not= (count arguments) 1)
       (exit -1 "Error: bad argument count")


insights: clean up legend generation

insights: clean up legend generation

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -27,7 +27,7 @@
   (let [key-mapping {:queued_time_minutes :queued_time_millis
                      :build_time_minutes :build_time_millis}]
     (reduce-kv (fn [accum new-key old-key]
-                 (assoc accum new-key (/ (get build old-key) 1000 60)))
+                 (assoc accum new-key (/ (old-key build) 1000 60)))
                build
                key-mapping)))

@@ -96,9 +96,9 @@
         grid-lines-container (-> svg
                                  (.append "g")
                                  (.attr "class" "grid-line horizontal"))]
-    ;; left legend
+    ;; legend
     (let [{:keys [square-size item-width item-height spacing]} legend-dimensions
-          legend-item (-> svg
+          left-legend-item (-> svg
                           (.selectAll ".legend")
                           (.data (clj->js left-legend))
                           (.enter)
@@ -110,24 +110,8 @@
                                               tr-y (- (- item-height
                                                          (/ (- item-height square-size)
                                                             2)))]
-                                          (gstring/format "translate(%s,%s)" tr-x  tr-y)))}))]
-      (-> legend-item
-          (.append "rect")
-          (.attr #js {"width" (:square-size legend-dimensions)
-                      "height" (:square-size legend-dimensions)
-                      "class" #(.-class_name %)
-                      "transform"
-                      (fn [item i]
-                        (gstring/format "translate(%s,%s)" 0  (- (+ (:square-size legend-dimensions)))))}))
-      (-> legend-item
-          (.append "text")
-          (.attr #js {"x" (+ (:square-size legend-dimensions)
-                             (:spacing legend-dimensions))})
-          (.text #(.-text %))))
-
-    ;; right legend
-    (let [{:keys [square-size item-width item-height spacing]} legend-dimensions
-          legend-item (-> svg
+                                          (gstring/format "translate(%s,%s)" tr-x  tr-y)))}))
+          right-legend-item (-> svg
                           (.selectAll ".legend-right")
                           (.data (clj->js right-legend))
                           (.enter)
@@ -140,20 +124,34 @@
                                                          (/ (- item-height square-size)
                                                             2)))]
                                           (gstring/format "translate(%s,%s)" tr-x  tr-y)))}))]
-      (-> legend-item
+      ;; left legend
+      (-> left-legend-item
           (.append "rect")
-          (.attr #js {"width" (:square-size legend-dimensions)
-                      "height" (:square-size legend-dimensions)
+          (.attr #js {"width" square-size
+                      "height" square-size
                       "class" #(.-class_name %)
                       "transform"
                       (fn [item i]
-                        (gstring/format "translate(%s,%s)" 0  (- (+ (:square-size legend-dimensions)))))}))
-      (-> legend-item
+                        (gstring/format "translate(%s,%s)" 0  (- (+ square-size))))}))
+      (-> left-legend-item
           (.append "text")
-          (.attr #js {"x" (+ (:square-size legend-dimensions)
-                             (:spacing legend-dimensions))})
+          (.attr #js {"x" (+ square-size spacing)})
+          (.text #(.-text %)))
+
+      ;; right legend
+      (-> right-legend-item
+          (.append "rect")
+          (.attr #js {"width" square-size
+                      "height" square-size
+                      "class" #(.-class_name %)
+                      "transform"
+                      (fn [item i]
+                        (gstring/format "translate(%s,%s)" 0  (- (+ square-size))))}))
+      (-> right-legend-item
+          (.append "text")
+          (.attr #js {"x" (+ square-size
+                             spacing)})
           (.text #(.-text %))))
-

     ;; y-axis
     (-> svg


Adds KQueue support for Mac and BSD

Adds KQueue support for Mac and BSD

1. Adds netty Kqueue to the tcp transport.
2. Updates switch to check for:
  a. If "linux" and "amd64" and "netty.epoll.enabled" then use epoll.
  b. if "mac" and "x86_64" and "netty.kqueue.enabled" then use kqueue.
  c. if "freebsd" and "amd64" and "netty.kqueue.enabled" then use
     kqueue.
3. If none of the above default to NIO.

--- src/riemann/transport/tcp.clj
+++ src/riemann/transport/tcp.clj
@@ -78,13 +78,20 @@
   "Provide native implementation of Netty for improved performance on
   Linux only. Provide pure-Java implementation of Netty on all other
   platforms. See http://netty.io/wiki/native-transports.html"
-  (if (and (.contains (. System getProperty "os.name") "Linux")
-           (.contains (. System getProperty "os.arch") "amd64")
-           (.equals (System/getProperty "netty.epoll.enabled" "true") "true"))
-    {:event-loop-group-fn #(EpollEventLoopGroup.)
-     :channel EpollServerSocketChannel}
-    {:event-loop-group-fn #(NioEventLoopGroup.)
-     :channel NioServerSocketChannel}))
+  (cond
+    (and (.contains (. System getProperty "os.name") "Linux")
+         (.contains (. System getProperty "os.arch") "amd64")
+         (.equals (System/getProperty "netty.epoll.enabled" "true") "true"))
+       {:event-loop-group-fn #(EpollEventLoopGroup.)
+         :channel EpollServerSocketChannel}
+    (or (and (.contains (. System getProperty "os.name") "mac") (.contains (. System getProperty "os.arch") "x86_64"))
+        (and (.contains (. System getProperty "os.name") "freebsd") (.contains (. System getProperty "os.arch") "amd64"))
+      (and (.equals (System/getProperty "netty.kqueue.enabled" "true") "true")))
+        {:event-loop-group-fn #(KQueueEventLoopGroup.)
+          :channel KQueueServerSocketChannel}
+    :else
+       {:event-loop-group-fn #(NioEventLoopGroup.)
+          :channel NioServerSocketChannel}))

 (defn tcp-handler
   "Given a core, a channel, and a message, applies the message to core and


don't autocomplete inside a `code block`

--- src/braid/client/ui/views/new_message.cljs
+++ src/braid/client/ui/views/new_message.cljs
@@ -80,6 +80,10 @@
          results))
      [:div.result
       "No Results"])])
+
+(defn inside-code-block?
+  [txt]
+  (odd? (count (re-seq #"`" txt))))

 (defn wrap-autocomplete [config]
   (let [autocomplete-chan (chan)
@@ -218,9 +222,10 @@
            (go (loop []
                  (let [[text ch] (alts! [throttled-autocomplete-chan kill-chan])]
                    (when (= ch throttled-autocomplete-chan)
-                     (set-results!
-                       (seq (mapcat (fn [e] (e text)) engines)))
-                     (highlight-first!)
+                     (when-not (inside-code-block? text)
+                       (set-results!
+                         (seq (mapcat (fn [e] (e text)) engines)))
+                       (highlight-first!))
                      (recur)))))
            (go (loop []
                  (let [[v ch] (alts! [throttled-thread-text-chan


only physical objects can be burnt

only physical objects can be burnt

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -268,7 +268,8 @@

         {:pred :burn
          :subj {:human true}
-         :obj {:human false}}
+         :obj {:human false
+               :physical-object true}}

         {:pred :carry
          :subj {:human true}


+(defn verbcoach-lexical-lookup)

+(defn verbcoach-lexical-lookup)

--- src/babel/italiano/lab.cljc
+++ src/babel/italiano/lab.cljc
@@ -248,33 +248,29 @@
                      babel.generate/grammar grammar]
              (time (generate spec model))))))

+(defn verbcoach-lexical-lookup [spec]
+  (let [lexicon
+        (into {}
+              (for [[k vals] (:lexicon model)]
+                (let [filtered-vals
+                      (filter
+                       #(or (= :verb (u/get-in % [:synsem :cat]))
+                            (and (= :noun (u/get-in % [:synsem :cat]))
+                                 (not (= :acc (u/get-in % [:synsem :case]))))
+                            (and (= :noun (u/get-in % [:synsem :cat]))
+                                 (= :acc (u/get-in % [:synsem :case]))
+                                 (= true (u/get-in % [:synsem :reflexive]))))
+                       vals)]
+                  (if (not (empty? filtered-vals))
+                    [k filtered-vals]))))
+        indices (create-indices lexicon grammar/index-paths)]
+    (lookup-spec spec indices grammar/index-paths)))
+
 ;; (take 10 (generate-for-verbcoach))
 (defn generate-for-verbcoach
   "generate sentences efficiently given specific constraints."
   [& [spec]]
-  (let [example-verbs #{"arrabbiarsi" "chiamarsi" "dormire" "fermarsi" "parlare" "sedersi"}
-        index-fn
-        (let [lexicon
-              (into {}
-                    (for [[k vals] (:lexicon model)]
-                      (let [verbcoach-pronouns
-                            (fn [v]
-                              (or
-                               (and (= :noun (u/get-in v [:synsem :cat]))
-                                    (not (= :acc (u/get-in v [:synsem :case]))))
-                               (and (= :noun (u/get-in v [:synsem :cat]))
-                                    (= :acc (u/get-in v [:synsem :case]))
-                                    (= true (u/get-in v [:synsem :reflexive])))))
-                            filtered-vals
-                            (filter
-                             #(or (= :verb (u/get-in % [:synsem :cat]))
-                                  (verbcoach-pronouns %))
-                             vals)]
-                        (if (not (empty? filtered-vals))
-                          [k filtered-vals]))))
-              indices (create-indices lexicon grammar/index-paths)]
-          (fn [spec]
-            (lookup-spec spec indices grammar/index-paths)))]
+  (let [example-verbs #{"arrabbiarsi" "chiamarsi" "dormire" "fermarsi" "parlare" "sedersi"}]
     (repeatedly
      #(do
         (println
@@ -293,7 +289,7 @@
                    unif
                    spec))
                chosen-spec (unify root-spec tense-spec)]
-           (target-generation chosen-spec index-fn model)))))))
-
-
-
+           (target-generation chosen-spec verbcoach-lexical-lookup model)))))))
+
+
+


Fix iteration limits of RealDiagonalMatrix/equals.

--- src/clojure/uncomplicate/neanderthal/internal/host/buffer_block.clj
+++ src/clojure/uncomplicate/neanderthal/internal/host/buffer_block.clj
@@ -1930,12 +1930,13 @@
   (equals [a b]
     (or (identical? a b)
         (and (instance? RealDiagonalMatrix b) (compatible? a b) (fits? a b)
-             (let [n (.fd stor)
-                   buf-b (.buffer ^RealDiagonalMatrix b)]
+             (let [n (.surface reg)
+                   buf-b (.buffer ^RealDiagonalMatrix b)
+                   ofst-b (.offset ^RealDiagonalMatrix b)]
                (loop [i 0]
                  (if (< i n)
-                   (and (= (.get da buf i) (.get da buf-b i))
-                        (recur (inc i) ))
+                   (and (= (.get da buf (+ i ofst)) (.get da buf-b (+ i ofst-b)))
+                        (recur (inc i)))
                    true))))))
   (toString [a]
     (format "#RealDiagonalMatrix[%s, type%s mxn:%dx%d, offset:%d]"


Redo migration markup again. Use meta-table.

--- src/cadence/views/admin.clj
+++ src/cadence/views/admin.clj
@@ -11,34 +11,34 @@
 (defhtml migration-row
   "Convert a modified migration map to a table row."
   [{:keys [id doc applied? source]}]
-  (let [badge-class (if applied? "label-success" "")
-        badge-icon (if applied? "icon-ok-sign" "icon-remove-sign")
-        badge-text (if applied? "Applied" "Not Applied")
-        button-class (if applied? "btn-inverse" "btn-primary")
-        button-text (if applied? "Rollback" "Apply")
+  (let [[badge-class badge-icon badge-text button-class button-text]
+        (if applied?
+          ["label-success" "icon-ok-sign" "Applied" "btn-inverse" "Rollback"]
+          ["" "icon-remove-sign" "Not Applied" "btn-primary" "Apply"])
+        hdoc (h doc)
         {:keys [up down]}
         (into {} (for [[k source-form] source]
                    [k (common/format-source-code source-form)]))]
-    [:div.migration {:id (str "migration-" id)}
-     [:div.meta.row-fluid
-      [:div.date.span4 (h (str (time-format/unparse
-                                 (:rfc822 time-format/formatters)
-                                 (time-coerce/from-long
-                                   (.getTime (ObjectId. id))))))]
-      [:div.id.span4 [:code (h id)]]
-      [:div.doc.span4 [:p (h doc)]]
-      ]
-
-     [:div.source.row-fluid
-      [:div.span5 [:pre [:code (h up)]]]
-      [:div.span5 [:pre [:code (h down)]]]
-      [:div.span2
-       [:div.controls
-        [:button {:data-object-id id :class (str "btn " button-class)}
-         button-text]]
-       [:div.applied
-        [:span {:class (str "label " badge-class)}
-         [:i {:class (str "icon-white " badge-icon)}] (str " " badge-text)]]]]]))
+    [:div.migration.row-fluid {:id (str "migration-" id)}
+     [:div.left-side.span4
+      [:h3.migration-title hdoc]
+      (common/meta-table {:date (h (common/human-readable-objectid-datetime id))
+                          "Object id" [:code (h id)]
+                          :doc [:p hdoc]
+                          :applied [:span {:class (str "label " badge-class)}
+                                    [:i {:class (str "icon-white " badge-icon)}]
+                                    (str " " badge-text)]})
+      [:div.controls
+       [:button {:data-object-id id :class (str "btn " button-class)}
+        button-text]]]
+     [:div.right-side.source.span8
+      [:div.well
+      [:div.row-fluid
+       [:h3 "Up"]
+       [:pre [:code (h up)]]]
+      [:div.row-fluid
+       [:h3 "Down"]
+       [:pre [:code (h down)]]]]]]))

 (defn migrations
   "A nice place to view migrations."


loading defmethod

loading defmethod

--- src/celestial/workflows.clj
+++ src/celestial/workflows.clj
@@ -16,8 +16,10 @@
     [clojure.core.strint :only (<<)]
     [slingshot.slingshot :only  [throw+ try+]]
     [celestial.model :only (vconstruct pconstruct rconstruct)])
-  (:require ; loading defmethods
+  (:require
+    ; loading defmethods
     gce.provider
+    digital.provider
     proxmox.provider
     freenas.provider
     aws.provider
@@ -38,7 +40,7 @@
    )
   (:import
     [celestial.puppet_standalone Standalone]
-    ))
+    )

 (import-logging)


x and y start position

x and y start position

--- src/cljs/infinitelives/pixi/pixelfont.cljs
+++ src/cljs/infinitelives/pixi/pixelfont.cljs
@@ -46,10 +46,14 @@
 (defn clear-text! [batch]
   (.removeChildren batch))

-(defn make-char-sprite-set [font-key text tint]
+(defn make-char-sprite-set [font-key text &
+                            {:keys [tint x y]
+                             :or
+                             {tint 0xffffff
+                              x 0 y 0}}]
   (let [font (get-font font-key)]
     (loop [[c & l] (seq text)
-           xp 0 yp 0
+           xp x yp y
            last-c nil ;; remember last character for kerning
            sprite-set []]
       (let [char ((:font font) c)


Rename res to data.

Rename res to data.

--- src/clojure_method_call_benchmark/core.clj
+++ src/clojure_method_call_benchmark/core.clj
@@ -316,34 +316,34 @@
   (bar [_ arg]))

 (defrecord MyRec
-  [res]
+  [data]
   MyProt
     (foo [_] 0)
-    (bar [_ arg] (+ res arg))
+    (bar [_ arg] (+ data arg))
   IFn
     (invoke [this arg] (bar this arg)))

 (deftype MyType
-  [res]
+  [data]
   MyProt
     (foo [_] 0)
-    (bar [_ arg] (+ res arg))
+    (bar [_ arg] (+ data arg))
   IFn
     (invoke [this arg] (bar this arg)))

 (defrecord MyRec2
-  [res]
+  [data]
   MyProt
     (foo [_] 0)
-    (bar [_ arg] (+ res arg))
+    (bar [_ arg] (+ data arg))
   IFn
     (invoke [this arg] (.bar this arg)))

 (deftype MyType2
-  [res]
+  [data]
   MyProt
     (foo [_] 0)
-    (bar [_ arg] (+ res arg))
+    (bar [_ arg] (+ data arg))
   IFn
     (invoke [this arg] (.bar this arg)))


Fix bug

Fix bug

--- src/checkin_halake/core.clj
+++ src/checkin_halake/core.clj
@@ -65,7 +65,7 @@
       (wrap-defaults api-defaults)))

 (def app (-> (routes
-              (GET "/")
+              (GET "/" _)
               (context "/api" _
                        api-routes))
              wrap-log))


Replace (apply concat (map ...)) with mapcat

--- src/cljam/io/bcf/writer.clj
+++ src/cljam/io/bcf/writer.clj
@@ -68,8 +68,7 @@
                     (let [{[p] true, f false} (group-by #(= "PASS" (:id %)) xs)]
                       (cons (or p default-pass-filter) f))))
         fif (->> [:filter :info :format]
-                 (map #(map vector (repeat %) (% m)))
-                 (apply concat)
+                 (mapcat #(map vector (repeat %) (% m)))
                  (map-indexed (fn [i [k v]] [k (assoc v :idx (str i))]))
                  (reduce (fn [r [k v]] (update r k (fnil conj []) v)) {}))]
     (-> meta-info


Avoid conversion of float value 0x7F800001 -> Float/NaN (0x7FC00000)

--- src/cljam/io/bcf/writer.clj
+++ src/cljam/io/bcf/writer.clj
@@ -107,7 +107,7 @@
 (def ^:private ^:const int32-special-map
   {nil 0x80000000 :eov 0x80000001 :exists 1})
 (def ^:private ^:const float32-special-map
-  {nil (Float/intBitsToFloat 0x7F800001) :eov (Float/intBitsToFloat 0x7F800002) :exists 1})
+  {nil 0x7F800001 :eov 0x7F800002 :exists 1})

 (defn- encode-typed-value
   "Encodes given value and returns as a byte-array.
@@ -132,7 +132,8 @@
          1 (.put bb (unchecked-byte (get int8-special-map b b)))
          2 (.putShort bb (unchecked-short (get int16-special-map b b)))
          3 (.putInt bb (unchecked-int (get int32-special-map b b)))
-         5 (.putFloat bb (float (get float32-special-map b b)))
+         5 (.putInt bb (unchecked-int (or (get float32-special-map b)
+                                          (Float/floatToRawIntBits b))))
          7 (.put bb (byte b))))
      (.array bb))))

@@ -155,7 +156,10 @@
   (let [chrom-id (:chr v)
         pos (dec (:pos v))
         rlen (:ref-length v)
-        qual (if-let [qual-val (:qual v)] qual-val (byte-array [(float32-special-map nil)]))
+        qual (unchecked-int
+              (if-let [qual-val (:qual v)]
+                (Float/floatToRawIntBits qual-val)
+                (float32-special-map nil)))
         n-allele (inc (count (:alt v)))
         n-info (count (:info v))
         n-allele-info (bit-or (bit-shift-left n-allele 16) n-info)
@@ -178,7 +182,7 @@
       (.putInt chrom-id)
       (.putInt pos)
       (.putInt rlen)
-      (.putFloat qual)
+      (.putInt qual)
       (.putInt n-allele-info)
       (.putInt n-fmt-sample)
       (.put ^bytes id)


Don't read past end of .dem

Don't read past end of .dem

--- src/cljs/demtools/demo.cljs
+++ src/cljs/demtools/demo.cljs
@@ -4,25 +4,6 @@
              [tf2demo])
   (:require-macros
    [cljs.core.async.macros :as asyncm :refer [go go-loop]]))
-
-(def obj-proto (js/Object.getPrototypeOf #js {}))
-
-(extend-type js/tf2demo.PacketEntity
-  IEncodeClojure
-  (-js->clj [x opts]
-    (js/Object.setPrototypeOf x obj-proto)
-    ))
-
-;; (extend-type js/tf2demo.SendProp
-;;   IEncodeClojure
-;;   (-js->clj [x opts] (h/plainify x)))
-;; (extend-type js/tf2demo.SendPropDefinition
-;;   IEncodeClojure
-;;   (-js->clj [x opts] (h/plainify x)))
-;; (extend-type js/tf2demo.ServerClass
-;;   IEncodeClojure
-;;   (-js->clj [x opts] (h/plainify x)))
-

 (defn setImmediate [fn] (js/setTimeout fn 50))

@@ -36,7 +17,7 @@
         (doseq [p packets] (.emit parser "packet" p))
         (when packets
           (.map packets (fn [p] (js-delete p "tables"))))
-        packets))))
+        (or packets (when msg []))))))

 ;; parse the next messages to get at least n packets (may return more than
 ;; the requested n packets), or until end of parser
@@ -49,7 +30,6 @@
             (doseq [p packets]
               (aset chunk @idx p)
               (swap! idx inc))
-;;             (println "loopin loopin" @idx n (not packets) (and packets (< @idx n)))
             (if (and packets (< @idx n))
               (recur)
               @idx)))]
@@ -63,15 +43,6 @@
       (put! output-chan packets
             (fn [result]
               (when result
-                (println (count packets) parse-chunk-size (>= (count packets) parse-chunk-size))
-  ;;              (setImmediate #(parse-loop-async parser output-chan))
-
-            ;;    (if (>= (count packets) parse-chunk-size)
+                (if (>= (count packets) parse-chunk-size)
                   (setImmediate #(parse-loop-async parser output-chan))
-              ;;    )
-
-;;                 (if (>= (count packets) parse-chunk-size)
-;;                   (setImmediate #(parse-loop-async parser output-chan))
-;;                   (close! output-chan))
-
-                ))))))
+                  (close! output-chan))))))))


Uncomment and fix the test

Uncomment and fix the test

It was failing only when run under maven, because
with-redefs is ineffective when a dynamic var is
dynamically bound

--- src/test/clojure/clojure/test/check/clojure_test_test.cljc
+++ src/test/clojure/clojure/test/check/clojure_test_test.cljc
@@ -76,7 +76,7 @@
 (defn ^:private capture-clojure-test-reports
   [func]
   (let [log (atom [])]
-    (with-redefs [test/report #(swap! log conj %)]
+    (binding [test/report #(swap! log conj %)]
       (func))
     @log))

@@ -136,7 +136,6 @@
       (is (= report-counters {:test 1, :pass 0, :fail 0, :error 1}))
       (is (re-find #"ERROR in \(this-throws-an-exception\)" stdout))))

-  #_
   ;;
   ;; Test for TCHECK-118
   ;;


Update wording and icons for the New Canvas menu option

--- src/cljs/goya/appstate.cljs
+++ src/cljs/goya/appstate.cljs
@@ -19,7 +19,7 @@
        :canvas-height 64

        :undo-history
-         [{:action "Opened New Document" :icon "tag"}]
+         [{:action "Opened New Canvas" :icon "tag"}]
       }

      :info
@@ -41,7 +41,7 @@
      :history-menu-items{:undo {:text "Undo"}
                          :redo {:text "Redo"}}

-     :main-menu-items{:new-document {:text "Prime Canvas" :icon "icon-doc-inv" :command :new-doc}
+     :main-menu-items{:new-document {:text "New Canvas" :icon "icon-tag" :command :new-doc}
                       :inspiration {:text "Inspiration from the Masters" :icon "icon-cloud-flash" :command :inspire}
                       :export-document {:text "Export Canvas" :icon "icon-download" :command :export-doc}
                       :export-history-animation {:text "Export History as Animation" :icon "icon-video" :command :export-history-animation}}}))


A very simplistic best-move heuristic, with depth 2 only

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -182,7 +182,7 @@
     #(transduce
        (comp
          (filter move-filter)
-         (map (comp count :taken)))
+         (map (comp count :taken))) ;; TODO - Count taken is bad: select a better evaluation
        + (second %))
     (get-in game [:moves player])))

@@ -197,6 +197,21 @@
   (let [move-filter #(= player (:looser %))
         move (best-immediate-move-with game (:player game) move-filter)]
     (transduce (map (comp count :taken)) + (second move))
+    ))
+
+(defn best-move
+  "[SIMPLISTIC] Return the best move for a player based on:
+   * The immediate gain
+   * The worse immediate lost afterwards"
+  [game player]
+  (let [moves (get-in game [:moves player])
+        outcomes (map (fn [[m _]] [m (play-move game m)]) moves)]
+    (map
+      (fn [[m outcome]]
+        [m (-
+             (get-in outcome [:scores player])
+             (worst-immediate-loss outcome player))])
+      outcomes)
     ))


minor reorg: move the game related topics together

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -47,6 +47,19 @@
 (defn new-game []
   (list (with-ai-data (turn/new-init-turn))))

+(defn cancel-last-move ;; TODO - It needs the ai: how to move it in the game? undo then undo-while
+  [old-turns]
+  (let [ai-turn? #(contains? (:ai-players %) (:player %))
+        new-turns (drop-while ai-turn? (drop 1 old-turns))]
+    (if (empty? new-turns)
+      (take-last 1 old-turns)
+      new-turns)))
+
+
+;; -----------------------------------------
+;; APP STATE
+;; -----------------------------------------
+
 (defonce app-state
   (atom {:games (new-game)
          :help false}))
@@ -73,14 +86,6 @@
   (let [ai-algo (get @ai-players @current-player)
         move (ai-algo @game @current-player)]
     (update-game! turn/play-move move)))
-
-(defn cancel-last-move ;; TODO - It needs the ai: how to move it in the game? undo then undo-while
-  [old-turns]
-  (let [ai-turn? #(contains? (:ai-players %) (:player %))
-        new-turns (drop-while ai-turn? (drop 1 old-turns))]
-    (if (empty? new-turns)
-      (take-last 1 old-turns)
-      new-turns)))

 (defn- handle-game-event!
   [msg]


consume loop support stopping

consume loop support stopping

--- src/cljs/daveconservatorie/audio/core.cljs
+++ src/cljs/daveconservatorie/audio/core.cljs
@@ -9,7 +9,7 @@
             [goog.crypt.base64 :as g64]
             [goog.object :as gobj]
             [cljs.spec :as s]
-            [cljs.core.async :as async :refer [chan promise-chan put! close! <! >!]]
+            [cljs.core.async :as async :refer [chan promise-chan put! close! <! >! alts!]]
             [daveconservatorie.support.specs :as ss]))

 (defonce AudioContext (or js/AudioContext js/webkitAudioContext))
@@ -153,8 +153,7 @@
                  (+ t val))
           (do
             (>! chan {::node-gen val ::time t})
-            (recur (inc i)
-                   t))))))
+            (recur (inc i) t))))))
   chan)

 (s/fdef loop-chan
@@ -164,17 +163,22 @@
   :ret ::sound-point-chan)

 (defn consume-loop [interval chan]
-  (go
-    (loop []
-      (when-let [{:keys [::time] :as sound} (<! chan)]
-        (play sound)
-        (let [cur-time (current-time)]
-          (if-not (< (- time cur-time) (* interval 2))
-            (<! (async/timeout (* interval 1000)))))
-        (recur))))
-  chan)
+  (let [control (async/chan)]
+    (go
+      (loop []
+        (when-let [{:keys [::time] :as sound} (<! chan)]
+          (play sound)
+          (let [cur-time (current-time)]
+            (if-not (< (- time cur-time) (* interval 2))
+              (let [timer (async/timeout (* interval 1000))
+                    [_ c] (alts! [control timer])]
+                (condp = c
+                  timer (recur)
+                  control nil))
+              (recur))))))
+    control))

 (s/fdef consume-loop
   :args (s/cat :interval ::time
                :chan ::sound-point-chan)
-  :ret ::sound-point-chan)
+  :ret ::ss/chan)


Remove same typo

Remove same typo

--- src/squelch/audio_buffer.cljs
+++ src/squelch/audio_buffer.cljs
@@ -55,10 +55,7 @@
   "Copies the samples to the specified channel of the AudioBuffer, from the
   source array."
   ([buffer source channel-number]
-   (.copyFromChannelbbuffer buffer source channel-number))
+   (.copyFromChannel buffer source channel-number))

   ([buffer source channel-number start-in-channel]
-   (.copyFromChannelbbuffer buffer
-                            source
-                            channel-number
-                            start-in-channel)))
+   (.copyFromChannel buffer source channel-number start-in-channel)))


working on deep trace

working on deep trace

--- src/com/billpiel/mem_tracer/util/other.clj
+++ src/com/billpiel/mem_tracer/util/other.clj
@@ -216,35 +216,81 @@
   `(alter-meta! ~body assoc :source '~body))

 (defn back-into
+  "Puts the contents of `noob` into a collection of the same type as `orig`."
   [orig noob]
-
-  (let [r ((if (seq? orig)
-             reverse
-             identity)
-           (into (or (empty orig)
-                     [])
-                 noob))]
-    r))
+  ((if (seq? orig)
+     reverse
+     identity)
+   (into (or (empty orig)
+             [])
+         noob)))

 (defn swap-in-path-syms
   [form & [path]]
   (cond
     (special-operator? form) form
-    (coll? form)  (back-into form (doall (map-indexed #(swap-in-path-syms %2
-                                                                          (conj (or path
-                                                                                [])
-                                                                                %))
-                                                      form)))
+    (coll? form)  (back-into form
+                             (doall (map-indexed #(swap-in-path-syms %2
+                                                                     (conj (or (not-empty path)
+                                                                               [])
+                                                                           %))
+                                                 form)))
     :else (symbol (apply str
                          "___"
                          (clojure.string/join "-"
                                               path)))))

-(defn deep-zipmap
+(defn deep-zipmap-no-colls
        [a b]
        (zipmap (filter (comp not coll?) (tree-seq coll? seq a))
                (filter (comp not coll?) (tree-seq coll? seq b))))

+
+(defn deep-zipmap
+       [a b]
+       (zipmap (tree-seq coll? seq a)
+               (tree-seq coll? seq b)))
+
+
+(defn get-path->form-maps
+  [src]
+  (let [sx #spy/d (-> src swap-in-path-syms clojure.walk/macroexpand-all)
+        sx-seq #spy/d (->> sx
+                           (tree-seq list? seq)
+                           (filter list?))
+        pair-fn (fn [form]
+                  (interleave (seq #spy/d form)
+                              (repeat form)))]
+    (apply hash-map
+           #spy/d (mapcat pair-fn
+                          sx-seq))))
+
+(clojure.pprint/pprint (get-path->form-maps '(a (b 1) c)))
+
+(defn mk-expr-mapping
+  [src]
+  (let [xs->sx (deep-zipmap-all (-> src clojure.walk/macroexpand-all swap-in-path-syms)
+                                (-> src swap-in-path-syms clojure.walk/macroexpand-all))
+        xs->x  (deep-zipmap-all (-> src clojure.walk/macroexpand-all swap-in-path-syms)
+                                (-> src clojure.walk/macroexpand-all))
+        s->o (deep-zipmap (-> src swap-in-path-syms)
+                          src)
+        sx->s (get-path->form-maps src)
+        f (fn [k]
+            {k {:xs k
+                :sx (get xs->sx k)
+                :x  (get xs->x k)
+                :s (->> k
+                        (get xs->sx)
+                        (get sx->s))
+                :o (->> k
+                        (get xs->sx)
+                        (get sx->s)
+                        (get s->o))}})]
+    (apply merge (map f (keys xs->sx)))))
+
+(clojure.pprint/pprint (mk-expr-mapping '(a b c)))
+
 #_ (do

@@ -255,8 +301,8 @@
       )

-
      (def src '(defn f1 [a] (let [[b] [4 5]] {a (-> a (+ b) dec)})))
+
      '(def f1 (fn* ([a]
                     (let* [vec__21418 [4 5]
                            b (clojure.core/nth vec__21418 0
@@ -294,5 +340,11 @@
                   (swap-in-path-syms
                    (clojure.walk/macroexpand-all src)))

+     (clojure.pprint/pprint
+      (deep-zipmap-all (swap-in-path-syms src)
+                                         src)
+
+                            )
+
      (swap-in-path-syms
       (clojure.walk/macroexpand-all src)))


fix typo

fix typo

--- src-cljs/frontend/models/test.cljs
+++ src-cljs/frontend/models/test.cljs
@@ -48,6 +48,6 @@
   (take n (by-time-descending tests)))

 (defn slowest-test
-  "Given a seq of tests, return the sloqest one."
+  "Given a seq of tests, return the slowest one."
   [tests]
   (first (slowest-n-tests 1 tests)))


Inbox: Fix tag-order in input-field.

Inbox: Fix tag-order in input-field.

--- src-cljs/pepa/workflows/inbox.cljs
+++ src-cljs/pepa/workflows/inbox.cljs
@@ -399,7 +399,8 @@
 (defn new-document [documents pages & [from]]
   (when pages (assert from))
   (let [document (data/map->Document {:id (gensym)
-                                      :pages []})
+                                      :pages []
+                                      :tags []})
         documents (assoc documents (:id document) document)]
     (if from
       (move-pages documents pages from (:id document))


Remove unneeded special handling for nil join-with.

--- clj_record/query.clj
+++ clj_record/query.clj
@@ -11,9 +11,7 @@
                 (fn [operator-params value]
                   (conj operator-params (if (nil? value) (throw (Exception. "A query argument must not be nil.")) "?"))) [] values)
             clause-params
-              (if (nil? join-with)
-                (apply str clause-params-vector)
-                (str-utils/str-join join-with clause-params-vector))]
+              (str-utils/str-join join-with clause-params-vector)]
         [(format (str "%s " operator-format) (name attribute) clause-params) (filter (complement nil?) values)]))))

 (defn equal [value] (operator-fn "= %s" [value]))


Fix typo

Fix typo

--- src/flatland/useful/utils.clj
+++ src/flatland/useful/utils.clj
@@ -275,10 +275,10 @@
        ~default)))

 (defmacro with-timing
-  "Same as clojure.core/time but returns a vector of a the result of
+  "Same as clojure.core/time but returns a vector of the result of
    the code and the milliseconds rather than printing a string. Runs
    the code in an implicit do."
   [& body]
   `(let [start# (System/nanoTime)
          ret# ~(cons 'do body)]
-     [ret# (/ (double (- (System/nanoTime) start#)) 1000000.0)]))+     [ret# (/ (double (- (System/nanoTime) start#)) 1000000.0)]))


disabled comment tapping

disabled comment tapping

--- src/hackernews/shared/components/list.cljs
+++ src/hackernews/shared/components/list.cljs
@@ -25,9 +25,12 @@
                    :render-row (fn [js-item]
                                  (let [item (js->clj js-item :keywordize-keys true)]
                                    (r/as-element
-                                    [rn/touchable-highlight {:on-press #(on-press (:id item))
-                                                             :key (:id item)}
-                                     (render-row item)])))
+                                    (if on-press
+                                      [rn/touchable-highlight {:on-press #(on-press (:id item))
+                                                               :key (:id item)}
+                                       (render-row item)]
+                                      [rn/view
+                                       (render-row item)]))))
                    :renderSeparator (fn [section-id row-id]
                                       (r/as-element
                                        [row-separator section-id row-id]))


Fix a few bugs in git-branch workflow.

Fix a few bugs in git-branch workflow.

--- src/incise/deploy/workflows/git_branch.clj
+++ src/incise/deploy/workflows/git_branch.clj
@@ -19,14 +19,17 @@
       (.getDirectory)
       (file subdir)))

+(defn work-tree [repo]
+  (-> repo
+      (.getRepository)
+      (.getWorkTree)))
+
 (defmacro with-repo [path & body]
-  `(binding [*repo* (load-repo ~path)
-             *out-dir* (git-sub-dir-from-repo *repo*)
-             *work-dir* (-> *repo*
-                            (.getRepository)
-                            (.getWorkTree))]
-     (with-sh-dir *work-dir*
-       ~@body)))
+  `(binding [~'*repo* (load-repo ~path)]
+     (binding [~'*out-dir* (git-sub-dir-from-repo ~'*repo*)
+               ~'*work-dir* (work-tree ~'*repo*)]
+       (with-sh-dir *work-dir*
+         ~@body))))

 (defn branch-exists?
   [branch]
@@ -69,7 +72,7 @@

 (defn add-files [files]
   (doseq [afile files]
-    (git-add *repo* (.getPath output-file))))
+    (git-add *repo* (.getPath afile))))

 (defn deploy
   "Deploy to the given branch. Follow options for commit and push behaviour."
@@ -81,7 +84,7 @@
   {:pre [(string? branch)]}
   (with-repo path
     (let [{source-commit-hash :id} (head-info)
-          output-files (once-in-git-dir)]
+          output-files (once-in-out-dir)]
       (setup-branch)
       (->> output-files
           (map move-to-work-dir)


Minor improvements on color picker gradients.

--- src/uxbox/ui/colorpicker.cljs
+++ src/uxbox/ui/colorpicker.cljs
@@ -36,16 +36,16 @@
     (set! (.-fillStyle context) color)
     (.fillRect context 0 0 width width)

-    ;;    Transparency gradient
-    (.addColorStop gradient2 0 "rgba(255,255,255,1)")
+    ;; White gradient
+    (.addColorStop gradient2 0.1 "rgba(255,255,255,1)")
     (.addColorStop gradient2 1 "rgba(0,0,0,0)")

     (set! (.-fillStyle context) gradient2)
     (.fillRect context 0 0 width width)

-    ;; Color gradient
-    (.addColorStop gradient1 0 "rgba(0,0,0,1)")
-    (.addColorStop gradient1 0.8 "rgba(0,0,0,0)")
+    ;; Black gradient
+    (.addColorStop gradient1 0.05 "rgba(0,0,0,1)")
+    (.addColorStop gradient1 1 "rgba(0,0,0,0)")

     (set! (.-fillStyle context) gradient1)
     (.fillRect context 0 0 width width)))
@@ -91,10 +91,9 @@
     (add-watch local ::key
                (fn [_ _ o v]
                  (when (not= (:color o) (:color v))
-                   (println "KAKAKA" v)
                    (draw-color-gradient context1 type (:color v)))))
+
     (reset! local {:color "#FF0000"})
-    ;; (draw-color-gradient context1 type "#FF0000")

     (set! (.-src img) img-path)
     (let [key1 (events/listen img EventType.LOAD #(.drawImage context2 img 0 0))]


CMR-1863 Adds examples for multiple platform types.

--- umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
@@ -14,10 +14,7 @@
   (umm-c/map->UMM-C
     {:Platforms [(umm-cmn/map->PlatformType
                   {:ShortName "Platform 1"
-                   :LongName "Example Platform Long Name 1"
-                   ;; TODO This is a valid DIF 10 type; replace it with something that can't be
-                   ;; round-tripped and handle that in expected-conversion.
-                   :Type "Aircraft"})]
+                   :LongName "Example Platform Long Name 1"})]
      :ProcessingLevel (umm-c/map->ProcessingLevelType {})
      :RelatedUrls [(umm-cmn/map->RelatedUrlType {:URLs ["http://google.com"]})]
      :ResponsibleOrganizations [(umm-cmn/map->ResponsibilityType {:Role "RESOURCEPROVIDER"
@@ -74,11 +71,22 @@
                                  :PeriodCycleDurationUnit "DAY"
                                  :PeriodCycleDurationValue 3}])})})

+(def platform-types
+  {"DIF-supported platform type"
+   "Aircraft"
+
+   "Non-DIF platform type"
+   "A Platform Type"})
+
 (def example-records
   "A seq of example records for each of the example temporal extents above."
   (into {}
-        (for [[example-name temporal] temporal-extents]
-          [example-name (assoc example-base :TemporalExtents [temporal])])))
+        (for [[temporal-example-name temporal] temporal-extents
+              [platform-type-example-name platform-type] platform-types]
+          [(str temporal-example-name ", " platform-type-example-name)
+           (-> example-base
+               (assoc :TemporalExtents [temporal])
+               (update-in [:Platforms 0] assoc :Type platform-type))])))

 (defn xml-round-trip
   "Returns record after being converted to XML and back to UMM through