change java.sql.ResultSet argument position in fetch functions

--- src/asphalt/core.clj
+++ src/asphalt/core.clj
@@ -269,10 +269,10 @@
   "Given a java.sql.ResultSet instance fetch a vector of rows using row-maker, an arity-2 function that accepts
   java.sql.ResultSet and column-count, and by default returns a vector of column values."
   ([^ResultSet result-set]
-    (fetch-rows i/read-result-row nil result-set))
-  ([result-column-types ^ResultSet result-set]
-    (fetch-rows i/read-result-row result-column-types result-set))
-  ([row-maker ^ints result-column-types ^ResultSet result-set]
+    (fetch-rows result-set i/read-result-row nil))
+  ([^ResultSet result-set result-column-types]
+    (fetch-rows result-set i/read-result-row result-column-types))
+  ([^ResultSet result-set row-maker ^ints result-column-types]
     (let [rows (transient [])]
       (if (seq result-column-types)
         (while (.next result-set)
@@ -288,10 +288,10 @@
   "Given a java.sql.ResultSet instance ensure it has exactly one row and fetch it using row-maker, an arity-2 function
   that accepts java.sql.ResultSet and column-count, and by default returns a vector of column values."
   ([^ResultSet result-set]
-    (fetch-single-row i/read-result-row nil result-set))
-  ([result-column-types ^ResultSet result-set]
-    (fetch-single-row i/read-result-row result-column-types result-set))
-  ([row-maker ^ints result-column-types ^ResultSet result-set]
+    (fetch-single-row result-set i/read-result-row nil))
+  ([^ResultSet result-set result-column-types]
+    (fetch-single-row result-set i/read-result-row result-column-types))
+  ([^ResultSet result-set row-maker ^ints result-column-types]
     (if (.next result-set)
       (let [row (if (seq result-column-types)
                   (row-maker result-set result-column-types)
@@ -308,10 +308,10 @@
   "Given a java.sql.ResultSet instance ensure it has exactly one row and one column, and fetch it using column-reader,
   an arity-1 function that accepts java.sql.ResultSet and returns the column value."
   ([^ResultSet result-set]
-    (fetch-single-value i/read-column-value nil result-set))
-  ([result-column-types ^ResultSet result-set]
-    (fetch-single-value i/read-column-value result-column-types result-set))
-  ([column-reader result-column-types ^ResultSet result-set]
+    (fetch-single-value result-set i/read-column-value nil))
+  ([^ResultSet result-set result-column-types]
+    (fetch-single-value result-set i/read-column-value result-column-types))
+  ([^ResultSet result-set column-reader ^ints result-column-types]
     (let [^ResultSetMetaData rsmd (.getMetaData result-set)
           column-count (.getColumnCount rsmd)]
       (when (not= 1 column-count)


Fixed duplicate queue counter names.

Fixed duplicate queue counter names.

--- src/baleen/queue.clj
+++ src/baleen/queue.clj
@@ -22,8 +22,7 @@
   (with-open [redis-connection (redis/get-connection context)]
     (let [queue-key-name (str (bcontext/get-app-name context) "-" queue-name)
           log-key-name (str (bcontext/get-app-name context) "-" queue-name "-" (btime/format-ymd event-time))
-          counter-key-name (str (bcontext/get-app-name context) "-" queue-name "-count")
-          ]
+          counter-key-name (str (bcontext/get-app-name context) "-" queue-name "-received-count")]

       ; Increment counter.
       (inc-counter context counter-key-name)
@@ -52,7 +51,7 @@
     (let [queue-key-name (str (bcontext/get-app-name context) "-" queue-name)
           working-queue-key-name (str (bcontext/get-app-name context) "-" queue-name "-working")
           done-queue-key-name (str (bcontext/get-app-name context) "-" queue-name "-done")
-          counter-queue-name (str (bcontext/get-app-name context) "-" queue-name "-count")]
+          counter-queue-name (str (bcontext/get-app-name context) "-" queue-name "-processed-count")]
       (loop []
         (let [item-str (.brpoplpush redis-connection queue-key-name working-queue-key-name 0)
               success (function item-str)]


require

require

--- src/clj/neb/core.clj
+++ src/clj/neb/core.clj
@@ -6,7 +6,8 @@
             [cluster-connector.distributed-store.lock :as d-lock]
             [neb.schema :as s]
             [neb.utils :refer :all]
-            [neb.base :refer [schemas-lock]])
+            [neb.base :refer [schemas-lock]]
+            [neb.statistics])
   (:import (java.util UUID)
            (com.google.common.hash Hashing MessageDigestHashFunction HashCode HashFunction)
            (java.nio.charset Charset)


[Add] information of validate

[Add] information of validate

--- src/clj_elm/core.clj
+++ src/clj_elm/core.clj
@@ -132,7 +132,8 @@
                    :length-train-cover (select-count #(= % -1) (:classes sample))
                    :length-test-cover (select-count #(= % -1) (:classes test))
                    :length-train-stego (select-count #(= % 1) (:classes sample))
-                   :length-test-stego (select-count #(= % 1) (:classes test))}]
+                   :length-test-stego (select-count #(= % 1) (:classes test))
+                   :Accuracy 0.0 :Recall 0.0 :Precision 0.0 :TP 0 :FP 0 :TN 0 :FN 0 }]
      (-> (train-model sample L)
          (#(pmap (fn [feature] (predict % feature)) (:features test)))
          (evaluation (:classes test))


Removing the protocol mask stuff

Removing the protocol mask stuff

--- src/cljs/go/core.clj
+++ src/cljs/go/core.clj
@@ -808,28 +808,6 @@
           {:current-symbol type-sym :suggested-symbol (js-base-type type-sym)}))
     `(do ~@(mapcat #(assign-impls env resolve type-sym type %) impl-map))))

-(defn- prepare-protocol-masks [env impls]
-  (let [resolve  (partial resolve-var env)
-        impl-map (->impl-map impls)
-        fpp-pbs  (seq
-                   (keep fast-path-protocols
-                     (map resolve
-                       (keys impl-map))))]
-    (if fpp-pbs
-      (let [fpps  (into #{}
-                    (filter (partial contains? fast-path-protocols)
-                      (map resolve (keys impl-map))))
-            parts (as-> (group-by first fpp-pbs) parts
-                    (into {}
-                      (map (juxt key (comp (partial map peek) val))
-                        parts))
-                    (into {}
-                      (map (juxt key (comp (partial reduce core/bit-or) val))
-                        parts)))]
-        [fpps (reduce (fn [ps p] (update-in ps [p] (fnil identity 0)))
-                parts
-                (range fast-path-protocol-partitions-count))]))))
-
 (defn annotate-specs [annots v [f sigs]]
   (conj v
     (vary-meta (cons f (map #(cons (second %) (nnext %)) sigs))
@@ -867,25 +845,17 @@

 (defmacro deftype [t fields & impls]
   (let [r (:name (cljs.analyzer/resolve-var (dissoc &env :locals) t))
-        [fpps pmasks] (prepare-protocol-masks &env impls)
         protocols (collect-protocols impls &env)
         t (vary-meta t assoc
-            :protocols protocols
-            :skip-protocol-flag fpps) ]
+            :protocols protocols) ]
     (if (seq impls)
       `(do
-         (deftype* ~t ~fields ~pmasks)
-         ;; (set! (.-cljs$lang$type ~t) true)
-         ;; (set! (.-cljs$lang$ctorStr ~t) ~(core/str r))
-         ;; (set! (.-cljs$lang$ctorPrWriter ~t) (fn [this# writer# opt#] (-write writer# ~(core/str r))))
+         (deftype* ~t ~fields nil)
          (extend-type ~t ~@(dt->et t impls fields true))
          ~(build-positional-factory t r fields)
          ~t)
       `(do
-         (deftype* ~t ~fields ~pmasks)
-         ;; (set! (.-cljs$lang$type ~t) true)
-         ;; (set! (.-cljs$lang$ctorStr ~t) ~(core/str r))
-         ;; (set! (.-cljs$lang$ctorPrWriter ~t) (fn [this# writer# opts#] (-write writer# ~(core/str r))))
+         (deftype* ~t ~fields nil)
          ~(build-positional-factory t r fields)
          ~t))))

@@ -958,13 +928,11 @@
                                     (concat [~@(map #(core/list `vector (keyword %) %) base-fields)]
                                             ~'__extmap))))
                   ])
-          [fpps pmasks] (prepare-protocol-masks env impls)
           protocols (collect-protocols impls env)
           tagname (vary-meta tagname assoc
-                    :protocols protocols
-                    :skip-protocol-flag fpps)]
+                    :protocols protocols)]
       `(do
-         (~'defrecord* ~tagname ~hinted-fields ~pmasks)
+         (~'defrecord* ~tagname ~hinted-fields nil)
          (extend-type ~tagname ~@(dt->et tagname impls fields true))))))

 (defn- build-map-factory [rsym rname fields]
@@ -982,9 +950,6 @@
                assoc :internal-ctor true)]
     `(let []
        ~(emit-defrecord &env rsym r fields impls)
-       (set! (.-cljs$lang$type ~r) true)
-       (set! (.-cljs$lang$ctorPrSeq ~r) (fn [this#] (core/list ~(core/str r))))
-       (set! (.-cljs$lang$ctorPrWriter ~r) (fn [this# writer#] (-write writer# ~(core/str r))))
        ~(build-positional-factory rsym r fields)
        ~(build-map-factory rsym r fields)
        ~r)))
@@ -1032,42 +997,16 @@
   [psym x]
   (let [p          (:name
                     (cljs.analyzer/resolve-var
-                      (dissoc &env :locals) psym))
-        prefix     (protocol-prefix p)
-        xsym       (bool-expr (gensym))
-        [part bit] (fast-path-protocols p)
-        msym       (symbol
-                      (core/str "-cljs$lang$protocol_mask$partition" part "$"))]
-    `(let [~xsym ~x]
-       (if ~xsym
-         (let [bit# ~(if bit `(unsafe-bit-and (. ~xsym ~msym) ~bit))]
-           (if (or bit#
-                 ~(bool-expr `(. ~xsym ~(symbol (core/str "-" prefix)))))
-             true
-             false))
-         false))))
+                      (dissoc &env :locals) psym))]
+    `(cljs.core/native-satisfies? ~psym ~x)))

 (defmacro satisfies?
   "Returns true if x satisfies the protocol"
   [psym x]
   (let [p          (:name
                      (cljs.analyzer/resolve-var
-                       (dissoc &env :locals) psym))
-         prefix     (protocol-prefix p)
-         xsym       (bool-expr (gensym))
-         [part bit] (fast-path-protocols p)
-         msym       (symbol
-                      (core/str "-cljs$lang$protocol_mask$partition" part "$"))]
-    `(let [~xsym ~x]
-       (if ~xsym
-         (let [bit# ~(if bit `(unsafe-bit-and (. ~xsym ~msym) ~bit))]
-           (if (or bit#
-                 ~(bool-expr `(. ~xsym ~(symbol (core/str "-" prefix)))))
-             true
-             (if (coercive-not (. ~xsym ~msym))
-               (cljs.core/native-satisfies? ~psym ~xsym)
-               false)))
-         (cljs.core/native-satisfies? ~psym ~xsym)))))
+                       (dissoc &env :locals) psym))]
+    `(cljs.core/native-satisfies? ~psym ~x)))

 (defmacro lazy-seq [& body]
   `(new cljs.core/LazySeq nil (fn [] ~@body) nil nil))


More test case.

More test case.

--- src/cbfg/fence.clj
+++ src/cbfg/fence.clj
@@ -55,9 +55,10 @@
      :out out-channel}))

 (def test-requests
-  [{:rq #(add-two 1 3000)}
+  [{:rq #(add-two 1 2000)}
    {:rq #(add-two 4 1000)}
-   {:rq #(add-two 10 6000) :fence true}
+   {:rq #(add-two 10 500) :fence true}
+   {:rq #(range-to 40 45 100) :fence true}
    {:rq #(add-two 9 1000)}
    {:rq #(add-two 9 1000)}
    {:rq #(range-to 0 5 500)}


Remove println statement

Remove println statement

Signed-off-by: Andrea Maria Piana <39e16ece3c2d27e1889178b15ddb376e524032f8@gmail.com>

--- src/status_im/network/core.cljs
+++ src/status_im/network/core.cljs
@@ -207,7 +207,6 @@

 (fx/defn handle-connection-status-change
   [{:keys [db] :as cofx} is-connected?]
-  (println "ChANGED" is-connected?)
   (fx/merge cofx
             {:db (assoc db :network-status (if is-connected? :online :offline))}
             (mailserver/network-connection-status-changed is-connected?)))


Document the fast way to generate HTML docs for the search-app

--- search-app/project.clj
+++ search-app/project.clj
@@ -1,3 +1,7 @@
+;; Use the docs profile when generating the HTML documentation for the search application:
+;; lein with-profile docs generate-docs
+;;
+;; All other lein tasks can use the default profile.
 (defproject nasa-cmr/cmr-search-app "0.1.0-SNAPSHOT"
   :description "Provides a public search API for concepts in the CMR."
   :url "***REMOVED***projects/CMR/repos/cmr/browse/search-app"


Only render project description and copyright if they are set

--- src/web/components/project.cljs
+++ src/web/components/project.cljs
@@ -9,19 +9,21 @@
     [:node (:name props)])
   static om/IQuery
   (query [this]
-    [:name :title :description :copyright :sort-by])
+    [:name :title :description :copyright])
   Object
   (render [this]
     (let [{:keys [name title description
                   copyright sort-by]} (om/props this)]
       (dom/div #js {:className "node node-root"}
         (dom/h2 #js {:className "node-header"} title)
-        (dom/div #js {:className "project-description"}
-          (markdown {:text description}))
-        (dom/div #js {:className "project-copyright"}
-          (dom/h3 #js {:className "project-copyright-header"}
-            "Copyright")
-          (dom/div #js {:className "project-copyright-text"}
-            (markdown {:text copyright})))))))
+        (if description
+          (dom/div #js {:className "project-description"}
+            (markdown {:text description})))
+        (if copyright
+          (dom/div #js {:className "project-copyright"}
+            (dom/h3 #js {:className "project-copyright-header"}
+              "Copyright")
+            (dom/div #js {:className "project-copyright-text"}
+              (markdown {:text copyright}))))))))

 (def project (om/factory Project {:key-fn :name}))


Use `dir-img` and `dir-log` if passed (#223)

--- src/etaoin/api.clj
+++ src/etaoin/api.clj
@@ -2544,9 +2544,9 @@
         file-src (apply format file-tpl (conj params "html"))
         file-log (apply format file-tpl (conj params "json"))

-        path-img (join-path dir-src file-img)
+        path-img (join-path dir-img file-img)
         path-src (join-path dir-src file-src)
-        path-log (join-path dir-src file-log)]
+        path-log (join-path dir-log file-log)]

     (log/debugf "Writing screenshot: %s" path-img)
     (screenshot driver path-img)


refactor upload handler, extract collection-presets, image-version-producer & handle-uploaded-images, update new coll handler to use model

--- src/imago/core.clj
+++ src/imago/core.clj
@@ -123,6 +123,53 @@
             (api-response req "Error handling route" 500)))
         (api-response req err 400)))
     (invalid-api-response)))
+
+(defn collection-presets
+  [coll-id]
+  (->> (config/query-spec :collection-presets coll-id)
+       (gapi/query graph)
+       (vals)
+       (map first)
+       (map #(let [{:syms [?preset ?w ?h ?crop ?filter ?mime ?restrict]} %]
+               [?preset ?w ?h ?crop ?filter ?mime ?restrict]))))
+
+(defn image-version-producer
+  "Takes a source image file to process and returns a fn accepting an
+  Image instance and version preset spec. Produces resized version and
+  adds it to storage. Returns updated Image instance w/ new version
+  added."
+  [src]
+  (fn [img [pid w h crop flt mime restrict]]
+    (let [version (model/make-media-version {:id (str (:id img) "-" pid) :preset pid})
+          tmp     (File/createTempFile "imago" nil)]
+      (image/resize-image
+       {:src src
+        :dest tmp
+        :type (subs (config/mime-ext mime) 1)
+        :width w
+        :height h
+        :crop crop
+        :filter flt})
+      (sapi/put-object
+       storage tmp
+       (str (:id version) (config/mime-ext mime)) {})
+      (.delete tmp)
+      (update-in img [:versions] conj version))))
+
+(defn handle-uploaded-images
+  "Take a map of Image keys w/ file path vals and a seq of preset
+  specs as returned by `collection-presets`. Produces resized versions
+  for each, adds them to storage. Returns vector of Image
+  instances (each populated w/ the various versions produced."
+  [images presets]
+  (->> images
+       (reduce-kv
+        (fn [acc img file]
+          (->> presets
+               ;; TODO restrict check/filter
+               (reduce (image-version-producer file) img)
+               (conj acc)))
+        [])))

 (def user-routes
   (routes
@@ -186,46 +233,15 @@
           (fn [req params]
             (let [user-id (-> params :user :id)
                   files (filter :tempfile (vals (:params req)))
-                  presets (->> (config/query-spec :collection-presets coll-id)
-                               (gapi/query graph)
-                               (vals)
-                               (map first)
-                               (map #(let [{:syms [?preset ?w ?h ?crop ?filter ?mime ?restrict]} %]
-                                       [?preset ?w ?h ?crop ?filter ?mime ?restrict])))
-                  images  (zipmap
+                  presets (collection-presets coll-id)
+                  img-map (zipmap
                            (repeatedly #(model/make-image {:coll-id coll-id :publisher user-id}))
                            (map :tempfile files))
-                  tmp     (File/createTempFile "imago" nil)
-                  now     (utils/timestamp)
-                  _ (info :files (map :filename files))
-                  _ (info :presets presets)
-                  images  (->> images
-                               (reduce-kv
-                                (fn [acc img file]
-                                  (->> presets
-                                       ;; TODO restrict check
-                                       (reduce
-                                        (fn [img [pid w h crop flt mime restrict]]
-                                          (let [version (model/make-media-version
-                                                         {:id (str (:id img) "-" pid)
-                                                          :preset pid})]
-                                            (image/resize-image
-                                             {:src file
-                                              :dest tmp
-                                              :type (subs (config/mime-ext mime) 1)
-                                              :width w
-                                              :height h
-                                              :crop crop
-                                              :filter flt})
-                                            (sapi/put-object
-                                             storage tmp
-                                             (str (:id version) (config/mime-ext mime)) {})
-                                            (update-in img [:versions] conj version)))
-                                        img)
-                                       (conj acc)))
-                                []))]
+                  _       (info :img-map img-map)
+                  _       (info :presets presets)
+                  images  (handle-uploaded-images img-map presets)]
               (->> images
-                   (concat [[coll-id (:modifie dcterms) now]])
+                   (concat [[coll-id (:modified dcterms) (utils/timestamp)]])
                    (trio/triple-seq)
                    (gapi/add-triples graph))
               (api-response req (mapv :id images) 200)))))
@@ -234,20 +250,10 @@
          req (assoc (:params req) :user (get-in req [:session :user])) :new-collection
          (fn [req {:keys [user title]}]
            (info :new-coll user title)
-           (let [user-id (:id user)
-                 coll-id (utils/new-uuid)
-                 title   (or title "Untitled collection")
-                 now     (utils/timestamp)
-                 triples (trio/triple-seq
-                          {coll-id
-                           {(:type rdf) (:MediaCollection imago)
-                            (:title dcterms) title
-                            (:creator dcterms) user-id
-                            (:created dcterms) now
-                            (:modified dcterms) now
-                            (:accessRights dcterms) (:PublicRights imago)}})]
-             (gapi/add-triples graph triples)
-             (api-response req {:id coll-id :title title} 201)))))))
+           (let [coll (model/make-collection-with-rights
+                       {} {:user (:id user) :perm (:canEditColl imago)})]
+             (gapi/add-triples graph (trio/triple-seq coll))
+             (api-response req coll 201)))))))

 (defroutes all-routes
   (GET "/" [:as req]


Remove `item` fn from story.

Remove `item` fn from story.

--- src/isla/story.clj
+++ src/isla/story.clj
@@ -20,8 +20,7 @@
   (item [this name]))

 (defprotocol QueryableStory
-  (items [this])
-  (item [this name]))
+  (items [this]))

 (defprotocol Playable
   (go [this arguments-str])
@@ -42,9 +41,6 @@
   QueryableStory
   (items [this]
     (concat (map (fn [x] (:items x)) rooms)))
-  (item [this name]
-    (if-let [item (first (filter (fn [y] (= name (:name y))) (items this)))]
-      item)) ;; item getter untested because didn't have items when wrote it

   Playable
   (go [this arguments-str]


One more attempt to simplify recommendation-ids

It works as intended this time:

```
user=> (let [recs [1 2 3 4 5] completed (set [2 4 6 8])] (filter #(not (contains? completed %)) recs))
(1 3 5)
user=> (let [recs [1 2 3 4 5] completed (set [2 4 6 8])] (remove completed recs))
(1 3 5)
```

--- src/kmg/domain.clj
+++ src/kmg/domain.clj
@@ -51,7 +51,7 @@
 (defn recommendation-ids [db user]
   (let [recs (recommendations-for-user db user)
         completed (set (recommendations-completed-by-user db user))]
-    (filter #(not (contains? completed %)) recs)))
+    (remove completed recs)))

 ;; (recommendation-ids (db) "user1")
 ;; (recommendation-ids (db) "user2")


Make end-to-end-test to use identity-file parameter

--- test/lambdacd_git/end_to_end_test.clj
+++ test/lambdacd_git/end_to_end_test.clj
@@ -115,7 +115,9 @@
 (deftest ^:e2e-with-auth end-to-end-with-auth-test
   (testing "a complete pipeline with all features against private repositories using https and ssh"
     (doseq [repo-config [{:repo-uri (or (System/getenv "LAMBDACD_GIT_TESTREPO_SSH") "git@gitlab.com:flosell-test/testrepo.git")
-                          :git      {:ssh {:strict-host-key-checking "no"}}}
+                          :git      {:ssh {:strict-host-key-checking "no"
+                                           :identity-file "~/.ssh/id_rsa_gitlab-test"
+                                           :use-agent false}}}
                          {:repo-uri (or (System/getenv "LAMBDACD_GIT_TESTREPO_HTTPS") "https://gitlab.com/flosell-test/testrepo.git")
                           :git      {:credentials-provider (UsernamePasswordCredentialsProvider. (System/getenv "LAMBDACD_GIT_TESTREPO_USERNAME")
                                                                                (System/getenv "LAMBDACD_GIT_TESTREPO_PASSWORD"))}}]]


escaped-name is probably better-implemented as a plain function instead of method on DatabaseDefinition

--- test/metabase/test/data/interface.clj
+++ test/metabase/test/data/interface.clj
@@ -26,15 +26,10 @@
                                ;; for long -- they can adjust connection behavior, e.g. choosing simple connections instead of creating pools.
                                ^Boolean short-lived?])

-
-(defprotocol IEscapedName
-  (^String escaped-name [this]
-    "Return escaped version of DATABASE-NAME suitable for use as a filename / database name / etc."))
-
-(extend-protocol IEscapedName
-  DatabaseDefinition
-  (escaped-name [this]
-    (s/replace (:database-name this) #"\s+" "_")))
+(defn escaped-name
+  "Return escaped version of database name suitable for use as a filename / database name / etc."
+  ^String [^DatabaseDefinition database-definition]
+  (s/replace (:database-name database-definition) #"\s+" "_"))

 (defprotocol IMetabaseInstance


Split units still buggy but will do

Split units still buggy but will do

--- src/obb_demo/boardground.cljs
+++ src/obb_demo/boardground.cljs
@@ -210,6 +210,14 @@
   "Checks if click is goto"
   [game-data game coord elem]
   (and (nil? elem)
+       (= (:selected-quantity game-data) (element/element-quantity (:selected-element game-data)))
+       (get (:possible-destinations game-data) coord)))
+
+(defn- move?
+  "Checks if click is move"
+  [game-data game coord elem]
+  (and (nil? elem)
+       (not= (:selected-quantity game-data) (element/element-quantity (:selected-element game-data)))
        (get (:possible-destinations game-data) coord)))

 (defn register-action
@@ -225,6 +233,15 @@
                                 (with-selected-element coord)))
       (println result))))

+(defn- process-move
+  "Processes a move action"
+  [game-data game coord elem]
+  (let [selected-coord (:selected-coord game-data)
+        player (element/element-player (:selected-element game-data))
+        quantity (:selected-quantity game-data)
+        action [:move selected-coord coord quantity]]
+    (register-action game-data game player action coord)))
+
 (defn- process-goto
   "Processes a goto action"
   [game-data game coord elem]
@@ -254,6 +271,8 @@
   (cond
     (goto? game-data game coord elem)
       (process-goto game-data game coord elem)
+    (move? game-data game coord elem)
+      (process-move game-data game coord elem)
     (attack? game-data game coord elem)
       (process-attack game-data game coord elem)
     (selected-coord? game-data game coord elem)


Remove logging.

Remove logging.

--- src/onyx/coordinator/impl.clj
+++ src/onyx/coordinator/impl.clj
@@ -1,6 +1,6 @@
 (ns ^:no-doc onyx.coordinator.impl
     (:require [com.stuartsierra.component :as component]
-              [taoensso.timbre :refer [info] :as timbre]
+              [taoensso.timbre :as timbre]
               [onyx.extensions :as extensions]
               [onyx.sync.zookeeper])
     (:import [onyx.sync.zookeeper ZooKeeper]))
@@ -165,7 +165,6 @@

         ;; Peer may have died just after completion, hence n may be 0
         (complete-task sync (:task-node peer-state))
-        (info "Successfully completed " (:task-node peer-state))
         (extensions/write-node sync cooldown-down {:completed? true})
         {:n-peers n :peer-state peer-state})
       (do (extensions/write-node sync cooldown-down {:completed? true})


Remove printing

Remove printing

--- src/dotfor/core.cljs
+++ src/dotfor/core.cljs
@@ -53,8 +53,6 @@
       (if b
         (let [x (+ 50 (* 40 (mod ix 6)))
               y (+ 30 (* 40 iy))]
-              (prn "ix iy (" ix iy)
-              (prn "x y (" x y)
         (q/ellipse x y 20 20))))
   )


Refactored out unneeded add-result helper func.

--- src/cbfg/net.cljs
+++ src/cbfg/net.cljs
@@ -11,11 +11,6 @@
        (doseq [[result-ch msg] results]
          (aclose cleanup result-ch)))
   :done)
-
-(defn add-result [results result-ch result]
-  (if result-ch
-    (conj results [result-ch :ok])
-    results))

 (defn make-net [actx request-listen-ch request-connect-ch & opts]
   (ago-loop net actx
@@ -99,20 +94,21 @@
                  (net-clean-up net listens streams results))
                (some #(= ch %) send-chs)
                (let [send-ch ch
-                     stream (get streams send-ch)
-                     [msg result-ch] v]
-                 (if v
+                     stream (get streams send-ch)]
+                 (if-let [[msg result-ch] v]
                    (recur (inc ts) listens
                           (if (:recv-ch stream)
                             (update-in streams [send-ch :msgs]
                                        conj [(+ ts (get opts :delivery-delay 0)) msg])
                             streams)
-                          (add-result results result-ch :ok))
+                          (if result-ch
+                            (conj results [result-ch :ok])
+                            results))
                    (recur (inc ts) listens
                           (if (:recv-ch stream)
                             (assoc-in streams [send-ch :send-closed] true)
                             (dissoc streams send-ch))
-                          (add-result results result-ch :ok))))
+                          results)))
                :else ; Test if it's a completed deliverable (recv-ch aput'ed).
                (if-let [stream (first (filter #(= (:recv-ch %) ch) (vals streams)))]
                  (let [stream2 (update-in stream [:msgs] rest)]


Fix for import aliases

Fix for import aliases

--- src/grimoire/doc.clj
+++ src/grimoire/doc.clj
@@ -35,17 +35,19 @@
   [v]
   {:pre [(var? v)]}
   (when-let [filepath (:file (meta v))]
-    (when-let [strm (.getResourceAsStream (RT/baseLoader) filepath)]
-      (with-open [rdr (LineNumberReader. (InputStreamReader. strm))]
+    (when-let [strm (.getResourceAsStream (clojure.lang.RT/baseLoader) filepath)]
+      (with-open [rdr (java.io.LineNumberReader. (java.io.InputStreamReader. strm))]
         (dotimes [_ (dec (:line (meta v)))] (.readLine rdr))
         (let [text (StringBuilder.)
-              pbr (proxy [PushbackReader] [rdr]
+              pbr (proxy [java.io.PushbackReader] [rdr]
                     (read [] (let [i (proxy-super read)]
                                (.append text (char i))
                                i)))]
           (if (= :unknown *read-eval*)
-            (throw (IllegalStateException. "Unable to read source while *read-eval* is :unknown."))
-            (read (PushbackReader. pbr)))
+            (throw
+             (IllegalStateException.
+              "Unable to read source while *read-eval* is :unknown."))
+            (read (java.io.PushbackReader. pbr)))
           (str text))))))

 (defn write-docs-for-var


Fixed early loop termination bug

Fixed early loop termination bug

--- src/hangman/core.clj
+++ src/hangman/core.clj
@@ -101,8 +101,8 @@

 (defn main
   ( []
-    (let [game-words    all-words
-          tgt-word      "uniformed"
+    (let [tgt-word      "toxics"
+          game-words    all-words
           words-map     (group-by count game-words)  ; map keyed by word length
           word-list     (words-map (count tgt-word)) ; words of correct length
       ]
@@ -122,8 +122,7 @@
                   new-clue        (make-clue tgt-word guessed-chars) ]
               (log-msg "clue: " clue "  new-guess" new-guess
                 "  guessed-chars (" (count guessed-chars) ")" guessed-chars)
-              (when (some #(= \- %) new-clue)
-                (recur  (conj guessed-chars new-guess)  new-clue ) )
+              (recur  (conj guessed-chars new-guess)  new-clue )
             )
           )
         ))


cleanup

cleanup

--- src/holston/core.clj
+++ src/holston/core.clj
@@ -3,9 +3,8 @@
             [compojure.handler :as handler]
             [compojure.route :as route]
             [cemerick.friend :as friend]
-            [cheshire.core :as j]
             [holston.auth :as auth]
-            [holston.repository :as repo])
+            [holston.restapi :as api])
   (:use [compojure.route :only [files resources not-found]]
         [compojure.handler :only [site]]
         [ring.util.response :only [response]]
@@ -15,25 +14,25 @@

 (defroutes ring-app
   (GET "/" request "open.")
-  (GET "/api/tastings/count" request (response (str (repo/get-number-of-tastings))) )
-  (GET "/status" request
-       (let [count (:count (:session request) 0)
-             session (assoc (:session request) :count (inc count))]
-         (-> (response
-              (str "
We've hit the session page " (:count session)
-                   " times.

The current session: " session "
"))
-             (assoc :session session))))
+
+  ;; API methods
+  (GET "/api/tastings/count" request (api/count-of-tastings))
+
+  ;; Dummy stuff which "tests" now authorization, to be removed
   (GET "/authlink" request
        (friend/authorize #{::user} "Authorized page."))
   (GET "/authlink2" request
        (friend/authorize #{::user} "Authorized page 2."))
+  (GET "/admin" request
+       (friend/authorize #{::admin} "Only admins can see this page."))
+
+  ;; Authentication stuff
   (GET "/logged-in" request
        (str (:cemerick.friend/identity (:session request))))
   (GET "/dlogin" request
        (friend/authenticated "Dummy login page"))
-  (GET "/admin" request
-       (friend/authorize #{::admin} "Only admins can see this page."))
   (friend/logout (ANY "/logout" request (ring.util.response/redirect "/")))
+
   (files "/"))

 (def app


Change boilerplate component to be recieved as dep instead of argument constructors This change easy the dependency injection for boilerplate on system config

--- modules/bootstrap/src/modular/bootstrap/cylon/user_forms.clj
+++ modules/bootstrap/src/modular/bootstrap/cylon/user_forms.clj
@@ -2,6 +2,7 @@

 (ns modular.bootstrap.cylon.user-forms
   (:require
+   [com.stuartsierra.component :as component]
    [clojure.tools.logging :refer :all]
    [modular.bootstrap :refer (ContentBoilerplate wrap-content-in-boilerplate)]
    [cylon.impl.authentication :refer (LoginFormRenderer)]
@@ -112,46 +113,47 @@
         [:button.btn.btn-lg.btn-primary.btn-block {:type "submit"} "Sign up"]

         ]])))
-   EmailVerifiedRenderer
-   (render-email-verified [this req model]
-     (boilerplate
-      this req
-      (html
-       [:div
-        [:style (styles)]
-        (:message model)
-        ]))
-     )

-    ResetPasswordRenderer
-    (render-reset-password [this req model]
-      (boilerplate
-       this req
-       (html
-        [:div
-         [:style (styles)]
-         [:form.form-signin {:role :form
-                             :method (-> model :form :method)
-                             :style "border: 1px dotted #555"
-                             :action (-> model :form :action)}
+  EmailVerifiedRenderer
+  (render-email-verified [this req model]
+    (boilerplate
+     this req
+     (html
+      [:div
+       [:style (styles)]
+       (:message model)
+       ]))
+    )

-          [:h2.form-signin-heading reset-pw-prompt]
+  ResetPasswordRenderer
+  (render-reset-password [this req model]
+    (boilerplate
+     this req
+     (html
+      [:div
+       [:style (styles)]
+       [:form.form-signin {:role :form
+                           :method (-> model :form :method)
+                           :style "border: 1px dotted #555"
+                           :action (-> model :form :action)}

-          (for [[n {:keys [name password? placeholder required autofocus value]}]
-                (map vector (range) (-> model :form :fields))]
-            [:input.form-control
-             (merge
-              {:name name
-               :type (if password? "password" "text")
-               :value value}
-              (when placeholder {:placeholder placeholder})
-              (when required {:required required})
-              (when autofocus {:autofocus autofocus}))])
+        [:h2.form-signin-heading reset-pw-prompt]

-          [:button.btn.btn-lg.btn-primary.btn-block {:type "submit"} "Reset Pw"]
+        (for [[n {:keys [name password? placeholder required autofocus value]}]
+              (map vector (range) (-> model :form :fields))]
+          [:input.form-control
+           (merge
+            {:name name
+             :type (if password? "password" "text")
+             :value value}
+            (when placeholder {:placeholder placeholder})
+            (when required {:required required})
+            (when autofocus {:autofocus autofocus}))])

-          ]]))
-      )
+        [:button.btn.btn-lg.btn-primary.btn-block {:type "submit"} "Reset Pw"]
+
+        ]]))
+    )

   )

@@ -162,9 +164,11 @@
    :reset-pw-prompt s/Str})

 (defn new-bootstrap-user-form-renderer [& {:as opts}]
-  (->> opts
-       (merge {:login-prompt "Please sign in&#8230"
-               :signup-prompt "Please sign up&#8230"
-               :reset-pw-prompt "Reset your password&#8230"})
-       (s/validate new-bootstrap-user-form-renderer-schema)
-       map->BootstrapUserFormRenderer))
+  (component/using
+   (->> opts
+        (merge {:login-prompt "Please sign in&#8230"
+                :signup-prompt "Please sign up&#8230"
+                :reset-pw-prompt "Reset your password&#8230"})
+        (s/validate new-bootstrap-user-form-renderer-schema)
+        map->BootstrapUserFormRenderer)
+   [:boilerplate]))


Only display controller :params deprecating warning once

--- modules/reitit-frontend/src/reitit/frontend/controllers.cljs
+++ modules/reitit-frontend/src/reitit/frontend/controllers.cljs
@@ -3,6 +3,9 @@

 (defn- pad-same-length [a b]
   (concat a (take (- (count b) (count a)) (repeat nil))))
+
+(def ^:private params-warning
+  (delay (js/console.warn "Reitit-frontend controller :params is deprecated. Replace with :identity or :parameters option.")))

 (defn get-identity
   "Get controller identity given controller and match.
@@ -19,7 +22,7 @@
   (assert (not (and identity parameters))
           "Use either :identity or :parameters for controller, not both.")
   (when params
-    (js/console.warn "Controller :params is deprecated. Replace with :identity or :parameters option."))
+    @params-warning)
   (cond
     parameters
     (into {} (for [[param-type ks] parameters]


Make run consistent with submit when parsing option arguments

This is applying the same change to run.clj originally applied to submit_topology.clj:

Fix stupid issue where git hashes and email address couldn't be parsed by read-str in submit_topology.clj

--- jvm/src/streamparse/commands/run.clj
+++ jvm/src/streamparse/commands/run.clj
@@ -3,7 +3,8 @@
   (:require [clojure.string :as string]
             [streamparse.cli :refer [cli]]
             [clojure.stacktrace :refer [print-stack-trace]]
-            [clojure.core :refer [fn?]])
+            [clojure.core :refer [fn?]]
+            [clojure.data.json :as json])
   (:use [backtype.storm clojure config])
   (:import  [backtype.storm LocalCluster])
   (:gen-class))
@@ -40,10 +41,19 @@
         ""]
         (string/join \newline)))

+(defn smart-read-str [val]
+  "Read JSON string and don't convert git hashes to numbers"
+  ;; issue with literals that start with digits, but contain letters
+  (if (not= (re-find #"\d+[A-Za-z]" val) nil)
+    val
+    (try
+      (json/read-str val)
+      (catch Exception e val))))
+
 (defn -parse-topo-option [val-str]
   "Parse topology --option in option.key=val form."
   (let [[key val] (string/split val-str #"=")
-       parsed-val (read-string val)]
+       parsed-val (smart-read-str val)]
        {key parsed-val}))

 (defn -assoc-topo-option [previous key val]


CMR-1805: Added additional comments per PR comments

--- search-app/src/cmr/search/models/query.clj
+++ search-app/src/cmr/search/models/query.clj
@@ -51,6 +51,8 @@
    skip-acls?

    ;; Flag to indicate an all revisions search instead of the default revision search.
+   ;; If this is true all revisions of the concept will be searched. If false, the default,
+   ;; then the latest revisions of the concept type will be searched.
    all-revisions?
    ])

@@ -362,9 +364,9 @@
                 :all-revisions? false}})

 (defn query
-  "Constructs a query with the given type, page-size, page-num, result-format, all-revisions?
-  and root condition. If root condition is not provided it matches everything.
-  If page-size, page-num, or result-format are not specified then they are given default values."
+  "Constructs a query with the given attributes and root condition. If root condition is not
+  provided it matches everything. If page-size, page-num, or result-format are not specified
+  then they are given default values."
   [attribs]
   (let [concept-type (:concept-type attribs)]
     (map->Query (merge-with (fn [default-v v]


Made the initialization safe by using await

Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>

--- Clojure/src/snake/agents_helpers.clj
+++ Clojure/src/snake/agents_helpers.clj
@@ -15,12 +15,12 @@
   start-agent-and-initialize

   [initial-state]
-  (def new-agent
-    (agent initial-state))
-  ; for this to work, we rely the semantics that when the following
-  ; send gets enqueued, every other send will be enqueued after it
-  ; on the same queue (this is really not too safe, they could go fancy and screw
-  ; with this assumption, I suppose...)
-  (send new-agent (fn [agent-state] (assoc agent-state :self new-agent))))
+
+  (def  new-agent (agent initial-state))
+
+  (send  new-agent (fn [agent-state] (assoc agent-state :self new-agent)))
+  (await new-agent)  ; make sure the initialization is completed
+
+  new-agent)

  ; (test #'start-agent-and-initialize)


Remove Debug Handle Exception from Study Handler

--- src/lens/handler.clj
+++ src/lens/handler.clj
@@ -357,11 +357,7 @@
     (fnk [error] error)

     :handle-not-found
-    (error-body path-for "Study not found.")
-
-    :handle-exception
-    (fnk [exception]
-      (println exception))))
+    (error-body path-for "Study not found.")))

 (defn create-study-handler [path-for]
   (resource


Mark `getter` function as deprecated.

Mark `getter` function as deprecated.

--- src/lentes/core.cljc
+++ src/lentes/core.cljc
@@ -144,9 +144,12 @@

 (defn getter
   "A simple readonly lense that runs arbitrary
-  code on focus."
+  code on focus.
+  DEPRECATED: use `lens` function that now has the
+  setter as optional parameter."
+  {:deprecated true}
   [f]
-  (lens f #(throw (ex-info "Read only lens." {}))))
+  (lens f))

 (defn in
   "Given a path and optionally a default value, return a lens that


deftask: warn on override, fixes #133

deftask: warn on override, fixes #133

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -603,7 +603,12 @@
 (defmacro deftask
   "Define a boot task."
   [sym & forms]
-  `(cli2/defclifn ~(vary-meta sym assoc ::task true) ~@forms))
+  `(do
+     (when-let [existing-deftask# (resolve '~sym)]
+       (when (= *ns* (-> existing-deftask# meta :ns))
+         (boot.util/warn
+          "Warning: deftask %s/%s was overridden\n" *ns* '~sym)))
+     (cli2/defclifn ~(vary-meta sym assoc ::task true) ~@forms)))

 ;; Boot Lifecycle ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Delete core.clj

Delete core.clj

--- src/iyye/core.clj
+++ src/iyye/core.clj
@@ -1,116 +0,0 @@
-; Iyye - AI agent
-; Copyright (C) 2016-2017  Sasha Yumzya
-
-; This program is free software: you can redistribute it and/or modify
-; it under the terms of the GNU Affero General Public License as
-; published by the Free Software Foundation, either version 3 of the
-; License, or (at your option) any later version.
-
-; This program is distributed in the hope that it will be useful,
-; but WITHOUT ANY WARRANTY; without even the implied warranty of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-; GNU Affero General Public License for more details.
-
-; You should have received a copy of the GNU Affero General Public License
-; along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-(ns iyye.core
-  (:require [iyye.iolist :as iolist]
-            [iyye.resource :as resource]
-            [iyye.persistence :as persistence]
-            [clojure.tools.logging :as log]
-            [clojure.tools.cli :refer [parse-opts]]
-            [clojure.string :as str]))
-
-(def DAY_CHECK_TIME_MILLIS 1000)
-
-; wake sleep state machine
-(defn main-loop []
-    (while true
-      (let [current-day (resource/create-day)]
-        (resource/start-day current-day)
-
-        (while (not (resource/is-day-over? current-day))
-          (Thread/sleep DAY_CHECK_TIME_MILLIS))
-
-        (resource/stop-day current-day)
-
-        (let [current-night (resource/create-night current-day)]
-          (resource/start-night current-night)
-          (while (not (resource/is-night-over? current-night))
-            (Thread/sleep DAY_CHECK_TIME_MILLIS))
-
-          (resource/stop-night current-night)))))
-
-(defn- load-state [name]
-  (log/info "first day load")
-  (println "first day load !!")
-  (persistence/load-current-iyye name)
-  (resource/load-day!)
-  (iolist/load-io-state))
-
-(defn- init-state [name]
-  (log/info "first day")
-  (println "first day !!")
-  (persistence/set-current-iyye name))
-
-(defn usage [options-summary]
-  (->> ["Usage: iyye action/option"
-        ""
-        "Options:"
-        options-summary
-        ""
-        "Actions:"
-        "  list    list IYYE"
-        "  load     load IYYE"
-        "  create   create IYYE"
-        ""]
-       (str/join \newline)))
-
-(def cli-options
-  ;; An option with a required argument
-  [["-n" "--name IYYE" "IYYE name"
-    :default "new"]
-   ;   :validate [#(iyye-exists? %) "Does not exist"]]
-    ["-h" "--help"]])
-
-(defn error-msg [errors]
-  (str "The following errors occurred while parsing your command:\n\n"
-       (str/join \newline errors)))
-
-(defn validate-args
-  "Validate command line arguments. Either return a map indicating the program
-  should exit (with a error message, and optional ok status), or a map
-  indicating the action the program should take and the options provided."
-  [args]
-  (let [{:keys [options arguments errors summary]} (parse-opts args cli-options)]
-    ;       (println "opt:" options "args:" arguments "err:" errors "summary:" summary)
-    (cond
-      (:help options) ; help => exit OK with usage summary
-      {:exit-message (usage summary) :ok? true}
-
-      errors ; errors => exit with description of errors
-      {:exit-message (error-msg errors)}
-
-      (and (= 1 (count arguments))
-           (#{"create" "list" "load"} (first arguments)))
-      {:action (first arguments) :options options}
-      :else ; failed custom validation => exit with usage summary
-      {:exit-message (usage summary)})))
-
-(defn exit [status msg]
-  (println msg)
-  (System/exit status))
-
-(defn -main [& args]
-  (let [{:keys [action options exit-message ok?]} (validate-args args)]
-    (if exit-message
-      (exit (if ok? 0 1) exit-message)
-      (case action
-        "list"   (doall (println (persistence/list-iyye) ) (exit 0 ""))
-        "create" (if (persistence/iyye-exists? (:name options)) (exit -1 "Already exists") (init-state (:name options)))
-        "load"  (if (persistence/iyye-exists? (:name options)) (load-state (:name options)) (exit -1 "Does not exist")))))
-
-  (doall  (iolist/init-io))
-; Start in a thread so that I can use REPL too
-  (-> (Thread. main-loop) .start))


Rename ab-test-treatment to junit-ab-test for consistency

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -367,7 +367,7 @@
                          "https://circleci.com/docs/test-metadata/#metadata-collection-in-custom-test-steps")
         track-junit #((om/get-shared owner :track-event) {:event-type :set-up-junit-clicked
                                                           :properties {:language language
-                                                                       :ab-test-treatment (feature/ab-test-treatment :junit-ab-test)}})]
+                                                                       :junit-ab-test (feature/ab-test-treatment :junit-ab-test)}})]
     (case (feature/ab-test-treatment :junit-ab-test)
       :junit-button (button/link (open-ext {:href junit-link
                                             :class "junit-link"
@@ -498,7 +498,7 @@
     om/IDidMount
     (did-mount [_]
       ((om/get-shared owner :track-event) {:event-type :set-up-junit-impression
-                                           :properties {:ab-test-treatment (feature/ab-test-treatment :junit-ab-test)}}))
+                                           :properties {:junit-ab-test (feature/ab-test-treatment :junit-ab-test)}}))
     om/IRender
     (render [_]
       (let [source-hash (->> tests


Fix a frontend.utils warning

Fix a frontend.utils warning

--- src-cljs/frontend/components/pieces/map.cljs
+++ src-cljs/frontend/components/pieces/map.cljs
@@ -1,10 +1,10 @@
 (ns frontend.components.pieces.map
   (:require [clojure.string :as string]
+            [frontend.utils :refer-macros [html]]
             [loom.alg :as alg]
             [loom.graph :as g])
   (:require-macros
-   [devcards.core :as dc :refer [defcard]]
-   [frontend.utils :refer [html]]))
+   [devcards.core :as dc :refer [defcard]]))

 (defn roots [g]
   (filter (comp zero? (partial g/in-degree g)) (g/nodes g)))


safeguard against setting tempo to nil

safeguard against setting tempo to nil

--- src/mantra/time.cljs
+++ src/mantra/time.cljs
@@ -12,7 +12,9 @@
 (defn get-tempo [] @*tempo*)

 (defn set-tempo [bpm]
-  (reset! *tempo* bpm))
+  (if bpm
+    (reset! *tempo* bpm)
+    (throw (js/Error. "You must supply a tempo. e.g.: (set-tempo 120)"))))

 (defn update-tempo [f & args]
   (apply swap! *tempo* f args))


fn for listing a user's friends

fn for listing a user's friends

note that the user ids returned in this request can be used to
fetch books from those user's shelves, their reviews, etc.

--- src/myshelf/core.clj
+++ src/myshelf/core.clj
@@ -263,3 +263,17 @@
                             access-token
                             add-url
                             params)))
+
+(defn get-user-friends
+  [consumer access-token user-id]
+  (let [friends-url "https://www.goodreads.com/friend/user.xml"
+        params {:id user-id}
+        resp (make-auth-request-GET consumer
+                                    access-token
+                                    friends-url
+                                    params)]
+    (->> resp
+         :content
+         second
+         :content
+         (map element->map))))


Correct ZooKeeper capitalisation

Correct ZooKeeper capitalisation

--- src/cljs/onyx_dashboard/components/main.cljs
+++ src/cljs/onyx_dashboard/components/main.cljs
@@ -42,7 +42,7 @@
                               (g/row {:class "no-gutter"}
                                 (g/col {:xs 12 :md 12}
                                   (dom/div {:class "alert alert-danger"}
-                                    "Zookeeper connection problem. Trying to reconnect..."))))
+                                    "ZooKeeper connection problem. Trying to reconnect..."))))
                             (g/row {:class "no-gutter"}
                                    (g/col {:xs 4 :md 4}
                                           (dom/div {:class "left-nav-deployment"}


fix null features bug

fix null features bug

--- src/clojure/zensols/nlparse/feature/lang.clj
+++ src/clojure/zensols/nlparse/feature/lang.clj
@@ -74,6 +74,7 @@
         tc (count tokens)]
     (->> (map :pos-tag tokens)
          (map pt/pos-tag-type)
+         (remove nil?)
          (reduce (fn [ret ttype]
                    (merge ret {ttype (inc (or (get ret ttype) 0))}))
                  {})


For Word Stats problem, lowered population size and number of training cases

--- src/clojush/problems/software/word_stats.clj
+++ src/clojush/problems/software/word_stats.clj
@@ -158,7 +158,7 @@
           (apply str (take 100 (cycle (list \. \tab))))
           (apply str (take 100 (cycle (list \? \newline \y \space))))
           (apply str (take 100 (cycle (list \5 \!))))) 36 0] ;; "Special" inputs covering most base cases
-   [(fn [] (word-stats-input (inc (lrand-int 100)))) 164 2000] ;; Random inputs
+   [(fn [] (word-stats-input (inc (lrand-int 100)))) 64 1000] ;; Random inputs
    ])

 ;;Can make Word Stats test data like this:
@@ -266,8 +266,8 @@
 (def argmap
   {:error-function (word-stats-error-function word-stats-data-domains)
    :atom-generators word-stats-atom-generators
-   :max-points 1000
-   :max-points-in-initial-program 500
+   :max-points 800
+   :max-points-in-initial-program 400
    :evalpush-limit 6000
    :population-size 1000
    :max-generations 300
@@ -282,6 +282,7 @@
    :uniform-mutation-rate 0.01
    :problem-specific-report word-stats-report
    :print-behavioral-diversity true
+   :print-homology-data true
    :report-simplifications 0
    :final-report-simplifications 5000
    :error-threshold 0.02


add search catalyst integration

add search catalyst integration

--- src/wb_es/web/integration.clj
+++ src/wb_es/web/integration.clj
@@ -7,8 +7,37 @@
      :label (:label doc-source)
      :taxonomy (:species doc-source)}))

+(defn- get-obj [doc]
+  (let [search-obj (pack-search-obj doc)
+        doc-source (:_source doc)]
+    {:name search-obj
+     :description (:description doc-source)
+     :taxonomy nil}))
+
 (defn wrap-search [handler]
-  handler)
+  (fn [request]
+    (let [params (:params request)
+          page (get params :page 1)
+          page_size (get params :page_size 10)
+          params-new (assoc params
+                            :size page_size
+                            :from (->> page
+                                       (Integer.)
+                                       (dec)
+                                       (* page_size)))
+          request-new (assoc request :params params-new)
+          response (handler request-new)
+          body-new {
+                    :matches (->> (get-in response [:body :hits :hits])
+                                  (map get-obj))
+                    :query (:q params)
+                    :querytime (->> (get-in response [:body :took])
+                                    (Integer.)
+                                    (#(/ % 1000.0)))
+                    :count (get-in response [:body :hits :total])
+                    :page page
+                    :page_size page_size}]
+      (assoc response :body body-new))))

 (defn wrap-autocomplete [handler]
   handler)
@@ -19,7 +48,7 @@
           content-new (->> (get-in response [:body :hits :hits])
                            (map pack-search-obj)
                            (first))]
-      (do (prn request) (assoc response :body content-new)))))
+      (assoc response :body content-new))))

 (defn wrap-count [handler]
   handler)


ARM: davinci: da850: generate dtbs for da850 boards

This helps generating device tree blobs for DaVinci DA850 boards with
command:

    'make ARCH=arm dtbs'.

Signed-off-by: Sekhar Nori <946cfb81282bb55c59f600e7ee3d3b2c6973f7a3@ti.com>

--- arch/arm/mach-davinci/Makefile.boot
+++ arch/arm/mach-davinci/Makefile.boot
@@ -11,3 +11,5 @@
 params_phys-y	:= 0x80000100
 initrd_phys-y	:= 0x80800000
 endif
+
+dtb-$(CONFIG_MACH_DA8XX_DT)	+= da850-enbw-cmc.dtb da850-evm.dtb


if deleted node -> show id instead of node name

--- src/clj/swarmpit/docker/mapper/inbound.clj
+++ src/clj/swarmpit/docker/mapper/inbound.clj
@@ -65,7 +65,7 @@

 (defn ->task-node
   [node-id nodes]
-  (or (first (filter #(= (:ID %) node-id) nodes)) node-id))
+  (first (filter #(= (:ID %) node-id) nodes)))

 (defn ->task-service
   [service-id services]
@@ -101,7 +101,7 @@
       :status {:error (get-in task [:Status :Err])}
       :desiredState (:DesiredState task)
       :serviceName service-name
-      :nodeName node-name)))
+      :nodeName (or node-name node-id))))

 (defn ->tasks
   [tasks nodes services]


More compact single-line output of show-fns.

--- src/quil/core.clj
+++ src/quil/core.clj
@@ -4258,27 +4258,30 @@
   If a category is specified, it will not print out the fns in any of
   cat's subcategories."
   [q]
-  (letfn [(show-fns-by-cat-idx [cat-idx]
-            (let [res (get (all-category-map) (str cat-idx))]
-              (println cat-idx (:name res))
-              (dorun
-               (map #(println "  -" %) (:fns res)))))
+  (letfn [(list-category [cid c & {:keys [only]}]
+            (let [category-fns (:fns c)
+                  display-fns (if (nil? only)
+                                category-fns
+                                (clojure.set/intersection
+                                 (set only) (set category-fns)))
+                  names (sort (map str display-fns))]
+              (if (not (empty? names))
+                (do
+                  (println cid (:name c))
+                  (println "   " (apply str (interpose " " names)))))))
+          (show-fns-by-cat-idx [cat-idx]
+            (let [c (get (all-category-map) (str cat-idx))]
+              (list-category cat-idx c)))
           (show-fns-by-name-regex [re]
             (doseq [[cid c] (sort-by key (all-category-map))]
-              (let [in-cat-name? (or (re-find re (.toLowerCase (:name c)))
-                                     (re-find re (:name c)))
-                    in-fn-names? (some #(re-find re (str %)) (:fns c))]
+              (let [in-cat-name? (re-find re (:name c))
+                    matching-fns (filter #(re-find re (str %)) (:fns c))
+                    in-fn-names? (not (empty? matching-fns))]
                 (cond
-                 in-cat-name? (do   ;; print an entire category
-                                (println cid (:name c))
-                                (doseq [f (:fns c)] (println "  -" f)))
-                 in-fn-names? (do   ;; print only matching fns
-                                (println cid (:name c))
-                                (doseq [f (:fns c)]
-                                  (if (re-find re (str f))
-                                    (println "  -" f))))))))]
+                 in-cat-name? (list-category cid c) ;; print an entire category
+                 in-fn-names? (list-category cid c :only matching-fns)))))]
     (cond
-     (string? q) (show-fns-by-name-regex (re-pattern q))
+     (string? q) (show-fns-by-name-regex (re-pattern (str "(?i)" q)))
      (isa? (type q) java.util.regex.Pattern) (show-fns-by-name-regex q)
      :else (show-fns-by-cat-idx q))))


CMR-7853: Add GET endpoint to check state

--- ingest-app/src/cmr/ingest/api/routes.clj
+++ ingest-app/src/cmr/ingest/api/routes.clj
@@ -87,19 +87,30 @@
            (acl/verify-ingest-management-permission ctx :update)
            (subscriptions-helper/trigger-email-subscription-processing ctx params)
            {:status 200})
+     (GET  "/toggle-email-subscription-processing"
+       {ctx :request-context}
+       (acl/verify-ingest-management-permission ctx :update)
+       (let [qzsched (get-in ctx [:system :scheduler :qz-scheduler])
+             get-trigger-state #(str (. qzsched getTriggerState %))
+             job-key-str jobs/EMAIL_SUBSCRIPTION_PROCESSING_JOB_KEY
+             trigger-key-str (str job-key-str ".trigger")
+             trigger-key (qt/key trigger-key-str)
+             trigger-state (get-trigger-state trigger-key)]
+         {:status 200 :body (json/generate-string {:state trigger-state})}))
      (POST "/toggle-email-subscription-processing"
        {ctx :request-context}
        (acl/verify-ingest-management-permission ctx :update)
        (let [qzsched (get-in ctx [:system :scheduler :qz-scheduler])
+             get-trigger-state #(str (. qzsched getTriggerState %))
              job-key-str jobs/EMAIL_SUBSCRIPTION_PROCESSING_JOB_KEY
              job-key (qj/key job-key-str)
              trigger-key-str (str job-key-str ".trigger")
              trigger-key (qt/key trigger-key-str)
-             trigger-state (str (. qzsched getTriggerState trigger-key))]
+             trigger-state (get-trigger-state trigger-key)]
          (if (= trigger-state "NORMAL")
            (qs/pause-job qzsched job-key)
            (qs/resume-job qzsched job-key))
-         {:status 200 :body (json/generate-string {:new-state (str (. qzsched getTriggerState trigger-key))})})))))
+         {:status 200 :body (json/generate-string {:new-state (get-trigger-state trigger-key)})})))))

 (def ingest-routes
   (routes


[up] Add event extractor from fee.

[up] Add event extractor from fee.

--- src/ombs/dbold.clj
+++ src/ombs/dbold.clj
@@ -18,6 +18,7 @@
 (sql/defentity events
   (sql/many-to-many users :pays {:lfk :events_id :rfk :users_id})
   (sql/has-one goods)
+  (sql/has-one fees)
   )

 (sql/defentity pays
@@ -223,3 +224,9 @@

 (defn parts-price [eid parts]
   (* parts (f/part-price (get-price eid) (get-parts eid))))
+
+(defn event-from-fee [fid]
+  (first (sql/select events
+                     (sql/with fees
+                       (sql/fields)
+                       (sql/where {:id fid})))))


change for every? true? -> doseq + is

change for every? true? -> doseq + is

--- test/cljs/cljs/core_test.cljs
+++ test/cljs/cljs/core_test.cljs
@@ -1155,12 +1155,10 @@
             (no-dispatch-value {:test :test})
             (catch js/Error e
               (not= -1 (.indexOf (.-message e) "cljs.core-test/no-dispatch-value")))))
-      (is (every? true?
-            (for [m [(obj-map) (array-map) (hash-map) (sorted-map)]]
-              (my-map? m))))
-      (is (every? true?
-            (for [not-m [[] 1 "asdf" :foo]]
-              (not (my-map? not-m)))))
+      (doseq [m [(obj-map) (array-map) (hash-map) (sorted-map)]]
+        (is (my-map? m)))
+      (doseq [not-m [[] 1 "asdf" :foo]]
+        (is (not (my-map? not-m))))
       ;; multimethod hashing
       (is (= foo2' (ffirst {foo2' 1})))
 )))
@@ -1481,16 +1479,15 @@
     (is (= (pr-str (PrintMe. 1 2)) "#cljs.core-test.PrintMe{:a 1, :b 2}"))
     (is (= (pr-str (js/Date. "2010-11-12T13:14:15.666-05:00"))
           "#inst \"2010-11-12T18:14:15.666-00:00\""))
-    (is (every? true?
-          (for [month (range 1 13)
-                day   (range 1 29)
-                hour  (range 1 23)]
-            (let [pad (fn [n]
-                        (if (< n 10)
-                          (str "0" n)
-                          n))
-                  inst (str "2010-" (pad month) "-" (pad day) "T" (pad hour) ":14:15.666-00:00")]
-              (= (pr-str (js/Date. inst)) (str "#inst \"" inst "\""))))))
+    (doseq [month (range 1 13)
+            day   (range 1 29)
+            hour  (range 1 23)]
+      (let [pad (fn [n]
+                  (if (< n 10)
+                    (str "0" n)
+                    n))
+            inst (str "2010-" (pad month) "-" (pad day) "T" (pad hour) ":14:15.666-00:00")]
+        (is (= (pr-str (js/Date. inst)) (str "#inst \"" inst "\"")))))
     (let [uuid-str "550e8400-e29b-41d4-a716-446655440000"
           uuid (UUID. uuid-str)]
       (is (= (pr-str uuid) (str "#uuid \"" uuid-str "\""))))
@@ -1864,12 +1861,11 @@
                     (fn [r k v] (-> r (conj [k v])))
                     [] data)))))]
     (testing "Testing IKVReduce"
-      (is (every? true?
-            (for [[data expect] [[(obj-map :k0 :v0 :k1 :v1) [[:k0 :v0] [:k1 :v1]]]
-                                 [(hash-map :k0 :v0 :k1 :v1) [[:k0 :v0] [:k1 :v1]]]
-                                 [(array-map :k0 :v0 :k1 :v1) [[:k0 :v0] [:k1 :v1]]]
-                                 [[:v0 :v1] [[0 :v0] [1 :v1]]]]]
-              (kvr-test data expect))))
+      (doseq [[data expect] [[(obj-map :k0 :v0 :k1 :v1) [[:k0 :v0] [:k1 :v1]]]
+                             [(hash-map :k0 :v0 :k1 :v1) [[:k0 :v0] [:k1 :v1]]]
+                             [(array-map :k0 :v0 :k1 :v1) [[:k0 :v0] [:k1 :v1]]]
+                             [[:v0 :v1] [[0 :v0] [1 :v1]]]]]
+        (is (kvr-test data expect)))
       (is (= {:init :val} (reduce-kv assoc {:init :val} nil))))))

 (deftest test-data-conveying-exceptions
@@ -2096,22 +2092,19 @@

 (deftest test-767
   (testing "Testing CLJS-767, invalid assoc"
-    (is (every? true?
-          (for [n [nil "-1" "" "0" "1" false true (js-obj)]]
-            (and
-              (= :fail (try (assoc [1 2] n 4)
-                            (catch js/Error e :fail)))
-              (= :fail (try (assoc (subvec [1 2 3] 2) n 4)
-                            (catch js/Error e :fail)))
-              (= :fail (try (assoc (range 1 3) n 4)
-                            (catch js/Error e :fail)))))))))
+    (doseq [n [nil "-1" "" "0" "1" false true (js-obj)]]
+      (is (= :fail (try (assoc [1 2] n 4)
+                        (catch js/Error e :fail))))
+      (is (= :fail (try (assoc (subvec [1 2 3] 2) n 4)
+                     (catch js/Error e :fail))))
+      (is (= :fail (try (assoc (range 1 3) n 4)
+                     (catch js/Error e :fail)))))))

 (deftest test-768
   (testing "Testing CLJS-768, invalid assoc!"
-    (is (every? true?
-          (for [n [nil "-1" "" "0" "1" false true (js-obj)]]
-            (= :fail (try (assoc! (transient [1 2]) n 4)
-                          (catch js/Error e :fail))))))))
+    (doseq [n [nil "-1" "" "0" "1" false true (js-obj)]]
+      (is (= :fail (try (assoc! (transient [1 2]) n 4)
+                        (catch js/Error e :fail)))))))

 (defn cljs-739 [arr names]
   (let [name (first names)]
@@ -2129,28 +2122,26 @@

 (deftest test-728
   (testing "Testing CLJS-728, lookup with default"
-    (is (every? true?
-          (for [n [nil "-1" "" "0" "1" false true (js-obj)]]
-            (and
-              (nil? (get [1 2] n))
-              (= :fail (try (nth [1 2] n) (catch js/Error e :fail)))
-              (= 4 (get [1 2] n 4))
-              (= :fail (try (nth [1 2] n 4) (catch js/Error e :fail)))
-
-              (nil? (get (subvec [1 2] 1) n))
-              (= :fail (try (nth (subvec [1 2] 1) n) (catch js/Error e :fail)))
-              (= 4 (get (subvec [1 2] 1) n 4))
-              (= :fail (try (nth (subvec [1 2] 1) n 4) (catch js/Error e :fail)))
-
-              (nil? (get (transient [1 2]) n))
-              (= :fail (try (nth (transient [1 2]) n) (catch js/Error e :fail)))
-              (= 4 (get (transient [1 2]) n 4))
-              (= :fail (try (nth (transient [1 2]) n 4) (catch js/Error e :fail)))
-
-              (nil? (get (range 1 3) n))
-              (= :fail (try (nth (range 1 3) n) (catch js/Error e :fail)))
-              (= 4 (get (range 1 3) n 4))
-              (= :fail (try (nth (range 1 3) n 4) (catch js/Error e :fail))))))))
+    (doseq [n [nil "-1" "" "0" "1" false true (js-obj)]]
+      (is (nil? (get [1 2] n)))
+      (is (= :fail (try (nth [1 2] n) (catch js/Error e :fail))))
+      (is (= 4 (get [1 2] n 4)))
+      (is (= :fail (try (nth [1 2] n 4) (catch js/Error e :fail))))
+
+      (is (nil? (get (subvec [1 2] 1) n)))
+      (is (= :fail (try (nth (subvec [1 2] 1) n) (catch js/Error e :fail))))
+      (is (= 4 (get (subvec [1 2] 1) n 4)))
+      (is (= :fail (try (nth (subvec [1 2] 1) n 4) (catch js/Error e :fail))))
+
+      (is (nil? (get (transient [1 2]) n)))
+      (is (= :fail (try (nth (transient [1 2]) n) (catch js/Error e :fail))))
+      (is (= 4 (get (transient [1 2]) n 4)))
+      (is (= :fail (try (nth (transient [1 2]) n 4) (catch js/Error e :fail))))
+
+      (is (nil? (get (range 1 3) n)))
+      (is (= :fail (try (nth (range 1 3) n) (catch js/Error e :fail))))
+      (is (= 4 (get (range 1 3) n 4)))
+      (is (= :fail (try (nth (range 1 3) n 4) (catch js/Error e :fail))))))
   )

 (deftest test-778
@@ -2175,30 +2166,28 @@

 (deftest test-784
   (testing "Testing CLJS-784, conj on maps"
-    (is (every? true?
-          (for [m [(array-map) (hash-map) (sorted-map)]]
-            (and (= :ok
-                      (try
-                        (conj m "foo")
-                        (catch js/Error _
-                          :ok)))
-                  (= {:foo 1} (conj m [:foo 1]))
-                  (= {:foo 1} (conj m {:foo 1}))
-                  (= {:foo 1} (conj m (list [:foo 1])))))))
-    (is (every? true?
-          (for [mt [array-map hash-map sorted-map]]
-            (= {:foo 1 :bar 2 :baz 3}
-              (conj (mt :foo 1)
-                ((fn make-seq [from-seq]
-                   ;; this tests specifically for user defined seq's, that implement the bare minimum, i.e. no INext
-                   (when (seq from-seq)
-                     (reify
-                       ISeqable
-                       (-seq [this] this)
-                       ISeq
-                       (-first [this] (first from-seq))
-                       (-rest [this] (make-seq (rest from-seq))))))
-                 [[:bar 2] [:baz 3]])))))))
+    (doseq [m [(array-map) (hash-map) (sorted-map)]]
+      (is (= :ok
+            (try
+              (conj m "foo")
+              (catch js/Error _
+                :ok))))
+      (is (= {:foo 1} (conj m [:foo 1])))
+      (is (= {:foo 1} (conj m {:foo 1})))
+      (is (= {:foo 1} (conj m (list [:foo 1])))))
+    (doseq [mt [array-map hash-map sorted-map]]
+      (is (= {:foo 1 :bar 2 :baz 3}
+            (conj (mt :foo 1)
+              ((fn make-seq [from-seq]
+                 ;; this tests specifically for user defined seq's, that implement the bare minimum, i.e. no INext
+                 (when (seq from-seq)
+                   (reify
+                     ISeqable
+                     (-seq [this] this)
+                     ISeq
+                     (-first [this] (first from-seq))
+                     (-rest [this] (make-seq (rest from-seq))))))
+               [[:bar 2] [:baz 3]]))))))
   )

 (deftest test-case-keyword


serverside validation for existing username

--- src/ontrail/core.clj
+++ src/ontrail/core.clj
@@ -101,7 +101,7 @@
          (if (= "" duration)
            (json-response {:message "invalid-duration"} 400)
            (json-response {:success true :time duration}))))
-
+
   (GET "/rest/v1/parse-distance/:distance" [distance]
        (json-response {:distance (to-human-distance (parse-distance distance))}))

@@ -132,6 +132,12 @@
       (let [user (register-user params)]
         (json-response {"token" (auth-token user) "username" (:username user)} 200)))

+  (GET "/rest/v1/username-available/:username" [username] ;; XXX throws
+    (let [user (get-user username)]
+      (if (= user nil)
+        (json-response {:success true})
+        (json-response {:message "username-exists"} 400))))
+
   (route/resources "/")
   (route/not-found {:status 404}))


Add new entries to schema.

Add new entries to schema.

--- src/onyx/schema.cljc
+++ src/onyx/schema.cljc
@@ -464,7 +464,9 @@
   {:fn s/Keyword
    :args {s/Any s/Any}
    (s/optional-key :message-id) s/Int
-   (s/optional-key :created-at) s/Int})
+   (s/optional-key :created-at) s/Int
+   (s/optional-key :peer-src) s/Uuid
+   (s/optional-key :entry-src) s/Int})

 (def Reactions
   (s/maybe [LogEntry]))


Fix pigpen.pig/set-options after store command

--- pigpen-pig/src/main/clojure/pigpen/pig.clj
+++ pigpen-pig/src/main/clojure/pigpen/pig.clj
@@ -96,4 +96,4 @@
   Note: Pig options are global and apply to the entire script.
 "
   [opts relation]
-  (raw/noop$ {:pig-options opts} relation))
+  (update-in relation [:opts :pig-options] merge opts))


reversing index result order

reversing index result order

--- src/ophion/store.clj
+++ src/ophion/store.clj
@@ -16,7 +16,7 @@
       :query pure})
     (let [{:keys [results commit]} (query/perform graph pure)
           index (map-indexed
-                 (fn [result index]
+                 (fn [index result]
                    {:key key
                     :order index
                     :result result})


convert all h1 to h4 elements to markdown, this is still a work in progress function


Update play-clj.net

Update play-clj.net

--- minicraft-online/desktop/project.clj
+++ minicraft-online/desktop/project.clj
@@ -13,7 +13,7 @@
                   :classifier "natives-desktop"]
                  [org.clojure/clojure "1.6.0"]
                  [play-clj "0.3.11"]
-                 [play-clj.net "0.1.0"]
+                 [play-clj.net "0.1.1"]
                  [prismatic/schema "0.2.6"]]

   :source-paths ["src" "src-common"]


Fixed formatting of COM03 evidence

Fixed formatting of COM03 evidence

--- src/alfresco_technical_validation/source_validation.clj
+++ src/alfresco_technical_validation/source_validation.clj
@@ -168,8 +168,8 @@
   (let [matches (filter #(= :com03 (:regex-id %)) content-index)
         message (str "Module identifier(s):\n"
                      (s/join "\n"
-                             (map #(str (subs (str (:file %)) (.length ^String source)) " line " (:line-number %) ": " (:line %))
-                                  matches)))]
+                             (distinct (map #(second (first (:re-seq %)))
+                                        matches))))]
       (build-bookmark-map "COM03"
                           (not-empty matches)
                           (if (empty? matches) "No module identifier provided." (str message "\n#### Manual followup required - check that module identifier is sufficiently unique. ####")))))


added a :modifs attribute to the returned result with delta modifications from the original

--- src/paredit/core.clj
+++ src/paredit/core.clj
@@ -332,10 +332,12 @@

 (defn insert
   "insert what at offset. offset shifted by what's length, selection length unchanged"
-  [{:keys [#^String text offset length] :as where} #^String what]
-  (assoc where
-    :text (str (.substring text 0 offset) what (.substring text offset))
-    :offset (+ offset (.length what))))
+  [{:keys [#^String text offset length modifs] :as where :or {:modifs []}} #^String what]
+  (let [new-offset (+ offset (.length what))]
+    (assoc where
+      :text (str (.substring text 0 offset) what (.substring text offset))
+      :offset new-offset
+      :modifs (conj modifs {:text what, :offset offset, :length 0}))))

 (defn shift-offset
   "shift offset, the selection is also shifted"


Fix obsolete set-variable reference.

Fix obsolete set-variable reference.

--- src/afterglow/show.clj
+++ src/afterglow/show.clj
@@ -241,7 +241,7 @@
                         (fn [midi-val] (float (+ max (/ (* midi-val range) 127))))))]
     (midi/add-control-mapping midi-device-name channel control-number (str "show:" (:id show) ":var" (keyword variable))
                               (fn [msg] (with-show show
-                                          (set-variable variable (calc-fn (:velocity msg))))))))
+                                          (set-variable! variable (calc-fn (:velocity msg))))))))

 (defn remove-midi-control-to-var-mapping
   "Cease updating the specified variable in [[*show*]] when the


rename fn params

rename fn params

--- cljs/sledge/core.cljs
+++ cljs/sledge/core.cljs
@@ -231,17 +231,17 @@
                (dom/button #js {:onClick #(dequeue-track index)}
                            "-")))))

-(defn audio-el [app owner]
+(defn audio-el [state owner]
   (reify
     om/IDidMount
-    (did-mount [this]
+    (did-mount [_]
       (let [el (om/get-node owner)]
         ;; last arg "true" is cos audio events don't bubble
         ;; http://stackoverflow.com/questions/11291651/why-dont-audio-and-video-events-bubble
         (.addEventListener el "ended" player-next true)
         (.addEventListener el "timeupdate" player-playing true)))
     om/IRender
-    (render [this]
+    (render [_]
       (html [:audio {:ref "player"}]))))

 (defn swallowing [h]


FIX: NilAttribute was never found, and apparently a symbol is enough ;)

--- src/main/clojure/pdok/featured/feature.clj
+++ src/main/clojure/pdok/featured/feature.clj
@@ -47,14 +47,7 @@
 (def nil-attribute-reader
   (transit/read-handler
    (fn [v]
-     (let [[ns class] (as-> v x
-                            (str/reverse x)
-                            (str/split x #"\." 2)
-                            (map str/reverse x)
-                            (reverse x))
-           ns (create-ns (symbol ns))
-            class (ns-resolve ns (symbol class))]
-       (->NilAttribute class)))))
+     (->NilAttribute (symbol v)))))

 (pg/register-transit-write-handler pdok.featured.feature.NilAttribute nil-attribute-writer)
 (pg/register-transit-read-handler "x" nil-attribute-reader)


Turned db-spec into a memoized, nullary function; heroku doesn't compile with env variables present

--- src/polismath/db.clj
+++ src/polismath/db.clj
@@ -27,7 +27,7 @@

 (def db-spec
-  (heroku-db-spec (env/env :database-url)))
+  (memoize #(heroku-db-spec (env/env :database-url))))

 (declare users conversations votes participants)
@@ -59,7 +59,7 @@
   "Query for all data since last-timestamp, given a db-spec"
   [last-timestamp]
   (try
-    (kdb/with-db db-spec
+    (kdb/with-db (db-spec)
       (ko/select votes
         (ko/where {:created [> last-timestamp]})
         (ko/order [:zid :tid :pid :created] :asc))) ; ordering by tid is important, since we rely on this ordering to determine the index within the comps, which needs to correspond to the tid
@@ -129,7 +129,7 @@

 (defn get-users-by-uid
   [uids]
-  (kdb/with-db db-spec
+  (kdb/with-db (db-spec)
     (->
       get-users-with-stats
       (ko/where (in :uid uids))
@@ -138,7 +138,7 @@

 (defn get-users-by-email
   [emails]
-  (kdb/with-db db-spec
+  (kdb/with-db (db-spec)
     (->
       get-users-with-stats
       (ko/where (in :email emails))


making it possible to have 2 sliders - one extra for hospital detail

--- src/prais2/data.cljs
+++ src/prais2/data.cljs
@@ -272,19 +272,19 @@

 ;; returns a bootstrap slider mixin
-(def bs-slider
+(defn bs-slider [hashed-id change-key]
   {:did-mount (fn [state]
                 (prn "mounting-slider")
-                (let [slider (new js/Slider "#slider"
-                                                       (clj->js {
-                                                                 :tooltip "hide"
-                                                                 :min 0
-                                                                 :max 1
-                                                                 :step 0.1
-                                                                 :value (:slider-axis-value @core/app)
-                                                                 }))
+                (let [slider (new js/Slider hashed-id
+                                  (clj->js {
+                                            :tooltip "hide"
+                                            :min 0
+                                            :max 1
+                                            :step 0.1
+                                            :value (:slider-axis-value @core/app)
+                                            }))
                       handler #(do
-                                 (put! event-bus [:slider-axis-value (.getValue slider) %]))
+                                 (put! event-bus [change-key (.getValue slider) %]))
                       state' (assoc state ::slider slider ::handler handler)]

                   (.on slider "slide" handler)
@@ -305,7 +305,7 @@
                        (.destroy slider))
                      (dissoc state ::slider ::handler)))})

-(rum/defcs slider-control < bs-slider rum/static [state value event-bus min max step]
+(rum/defcs slider-control < (bs-slider "#slider" :slider-axis-value) rum/static [state value min max step]
   #_(prn "called slider-control with " value)
   (let [s [:#slider.slider
            [:input {:type "text"
@@ -318,6 +318,17 @@
       (.setValue slider value))
     s))

+(rum/defcs slider2-control < (bs-slider "#slider2" :slider2-axis-value) rum/static [state value min max step]
+  (let [s [:#slider2.slider
+           [:input {:type "text"
+                    :data-slider-min min
+                    :data-slider-max max
+                    :data-slider-step step
+                    }]]
+        slider (::slider state)]
+    (when slider
+      (.setValue slider value))
+    s))

 (rum/defc axis-container < rum/static [slider-axis-value]
   [:.axis-container
@@ -367,14 +378,14 @@
         [:br {:key :br}]
         title])]))

-(rum/defc slider-widget < rum/static [headers slider-axis-value]
+(rum/defc slider-widget < rum/static [headers control slider-axis-value]
   [:div
    (map-indexed key-with
                 [(slider-title headers)
                  (slider-labels)
                  (do
                    #_(prn "calling slider-control with " slider-axis-value)
-                   (slider-control slider-axis-value event-bus 0 1 0.01))
+                   (control slider-axis-value 0 1 0.01))
                  (axis-container slider-axis-value)])]  )

 (rum/defc table-head < rum/static [ap headers column-keys event-bus slider-axis-value]
@@ -398,7 +409,7 @@
                 }}
        [:.slider-container
         {:style {:height (px (:height (:observed headers)))}}
-        (slider-widget headers)
+        (slider-widget headers slider-control)
         ]]]]))

@@ -633,6 +644,6 @@
     (when-let [selected-row (h-code ((rows-by-code (:datasource ap))))]
       [:div
        [:h3 (:h-name selected-row)]
-       [:.slider]
+       (slider-widget {} slider2-control)
        (chart-cell selected-row 1)
        (interpretation selected-row)])))


Eliminate :def-emits-var

Eliminate :def-emits-var

(This is used for REPL compilation.)

--- ClojureScript/replete/script/build.clj
+++ ClojureScript/replete/script/build.clj
@@ -19,8 +19,7 @@
 (defn edn->js [e]
   (env/with-compiler-env (env/default-compiler-env)
     (let [env (assoc (ana/empty-env) :context :expr
-                                 :ns {:name 'cljs.core}
-                                 :def-emits-var true)
+                                 :ns {:name 'cljs.core})
         form (edn/read-string (str "(quote " e ")"))
         ast (ana/analyze env form)
         js (with-out-str (c/emit ast))]


small changes and fixes

small changes and fixes

--- src/main/clojure/conexp/layouts/dim_draw.clj
+++ src/main/clojure/conexp/layouts/dim_draw.clj
@@ -7,7 +7,7 @@
             [conexp.base :exclude [transitive-closure] :refer :all]
             [rolling-stones.core :as sat :refer :all]))

-(defn- lt-seq
+(defn lt-seq
   "Constructs a constraint stating that at most `k` of the given variables `xs` are true.

   This is from ??.
@@ -16,7 +16,8 @@
   ([xs k]
    (lt-seq xs k (Math/random)))
   ([xs k prefix]
-   (if (> k 0)
+   (assert (>= k 0))
+   (if (and (> k 0) (not (empty? xs)))
      (let [n (count xs)
            s prefix]
        (concat
@@ -35,11 +36,6 @@
          [[(! (xs (- n 1))) (! [:tmp s (- n 2) (- k 1)])]]))
      (vec (map #(vec [(! %)]) xs)))))

-(def cnf (lt-seq [:x1 :x2 :x3] 0 "s"))
-(println cnf)
-(println)
-(doseq [line (sat/solutions-symbolic-cnf cnf)]
-  (println line))

 (defn sat-reduction
   "Reduces the problem of finding a maximum bipartite subgraph to satisfiability.
@@ -50,12 +46,8 @@
    (first (drop-while #(= % nil) (map #(sat-reduction g %) (range)))))
   ([g k]
    (let [node-clauses (mapcat
-                        #(vec [[[% 1] [% 2] [% 3]]])        ;either V_{i,1}, V_{i,2}, or V_{i,3} is true
+                        #(vec [[[% 1] [% 2] [% 3]]])        ; alt least one of V_{i,1}, V_{i,2}, or V_{i,3} is true
                         (nodes g))
-         ;edge-clauses (mapcat
-         ;               #(let [vi (:src %) vj (:dest %)]
-         ;                  [[[vi 1] [vj 1]] [[vi 2] [vj 2]]])
-         ;               (lg/edges g))
          edge-clauses (mapcat
                         #(let [vi (:src %) vj (:dest %)]
                            [[(! [vi 1]) (! [vj 1])]
@@ -66,7 +58,9 @@
                                             k "s")
          clauses (concat node-clauses edge-clauses no-more-than-k-bad-edges-clauses)
          raw-solution (sat/solve-symbolic-cnf clauses)
-         C (map first (filter #(and (sat/positive? %) (= (% 1) 3)) raw-solution))]
+         C (if (= raw-solution nil)
+             nil
+             (map first (filter #(and (sat/positive? %) (= (% 1) 3)) raw-solution)))]
      ;(println node-clauses)
      ;(println edge-clauses)
      ;(println no-more-than-k-bad-edges-clauses)
@@ -75,7 +69,7 @@
      ;(println C)
      C)))

-(sat-reduction (uber/graph [:a :b] [:a :c] [:b :e] [:c :e] [:a :e]) 1)
+;(sat-reduction (uber/graph [:a :b] [:a :c] [:b :e] [:c :e] [:a :e]) 1)

 (defn compute-conjugate-order
   [P <=]
@@ -98,10 +92,15 @@
   (let [<=as-set (map edge->vec (lg/edges (make-digraph-from-condition P <=)))
         <=C
         (let [<=C' (compute-conjugate-order P <=)]
+          (println "<=C': " <=C')
           (if (= <=C' nil)
             (let [I (incompatibility-graph P <=)
-                  C (sat-reduction I)]
-              (compute-conjugate-order P (union <= (transitive-closure C))))
+                  C (sat-reduction I)
+                  C-bar-graph (transitive-closure (apply uber/digraph C))]
+              (uber/pprint I)
+              (println C-bar-graph)
+              (compute-conjugate-order P #(or (<= %1 %2) (lg/has-edge? C-bar-graph %1 %2)))
+              )
             <=C'))
         <=1 (union <=as-set <=C)
         <=2 (union <=as-set (map reverse <=C))
@@ -111,11 +110,11 @@
                        [% [x1 x2]]) P)]
     coords))

-(println (compute-conjugate-order
-           #{1 2 3 4 5} (non-strict #(or (= 1 %1) (= 5 %2)))))
-
-(println (compute-coordinates
-           #{1 2 3 4 5} (non-strict #(or (= 1 %1) (= 5 %2)))))
+;(println (compute-conjugate-order
+;           #{1 2 3 4 5} (non-strict #(or (= 1 %1) (= 5 %2)))))
+;
+;(println (compute-coordinates
+;           #{1 2 3 4 5} (non-strict #(or (= 1 %1) (= 5 %2)))))

 (defn- replicate-str
   [s i]
@@ -125,7 +124,7 @@
   [coords]
   (let [x-step 2
         size (count coords)
-        spaces (.substring (replicate-str "   " (* size x-step)) (* size x-step))
+        spaces (replicate-str "  " (* size x-step))
         line-contents (map (fn [i] (filter
                                      #(= i (+ (first (last %)) (last (last %))))
                                      coords))
@@ -134,7 +133,9 @@
                                           (- (first (last %)) (last (last %)))])
                                    line))
                    line-contents)
-        min-x (apply min (map #(apply min (cons 0 (map last %))) lines))
+        min-x (if (empty? lines)
+                0
+                (apply min (map #(apply min (cons 0 (map last %))) lines)))
         positioned-lines (map (fn [line] (map #(vec [(first %)
                                                      (* (- (last %) min-x) x-step)])
                                               line))
@@ -148,16 +149,13 @@
                        0
                        (last p))
                      (first p)))
-                 "" pos-line))
-      )
-    ))
+                 "" (sort-by last pos-line))))))

-(draw-ascii (compute-coordinates
-              #{1 2 3 4 5} (non-strict #(or (= 1 %1) (= 5 %2)))))
-
-(draw-ascii (compute-coordinates
-              #{1 2 3 4 5} (non-strict #(or (= 1 %1) (= 5 %2) (and (= %1 2) (= %2 3))))))
+;(draw-ascii (compute-coordinates
+;              #{1 2 3 4 5} (non-strict #(or (= 1 %1) (= 5 %2)))))
+;
+;(draw-ascii (compute-coordinates
+;              #{1 2 3 4 5} (non-strict #(or (= 1 %1) (= 5 %2) (and (= %1 2) (= %2 3))))))

-
-nil+nil


Fix context handling in console runner

Fix context handling in console runner

--- src/main/clojure/lazytest/runner/console.clj
+++ src/main/clojure/lazytest/runner/console.clj
@@ -14,7 +14,7 @@
       (print (colorize "." :green))
       (print (colorize "F" :red)))
     (flush)
-    (setup-contexts tc)
+    (teardown-contexts tc)
     result))

 (defn run-suite [ste]
@@ -26,7 +26,7 @@
 				      :else (throw (IllegalArgumentException.
 						    "Non-test given to run-suite."))))
 			      ste-seq))]
-      (setup-contexts ste-seq)
+      (teardown-contexts ste-seq)
       (suite-result ste-seq results))))

 (defn run-tests


found a prisoner

found a prisoner

--- test/acceptance/push_prison.clj
+++ test/acceptance/push_prison.clj
@@ -54,16 +54,20 @@
   {
     :program

-    '[:exec-comprehension :generator-savestack #{89.0625 :chars-conj :ref-storestack ([\ \$ \7 \space \] :refs-replace [3283 429 2491 888 2889] :string-liftstack :input!6) "²¿h³1ie?¼8ÆiwWh" :input!1 :vector-conj :vector-later} ":ÓÚf±" false 93.43359375 :vector-rotate 168.6328125 [true true true false false false false false true] :scalars-yankdup :vector-replacefirst [619 520 1857 4357 1029 1437 681 2331 4810] :scalars-nth [] (:scalar-notequal? [0.13671875 0.12109375] :boolean-equal? "e£º<É~pUÒbNx" 104.1328125) :input!5 false :booleans-later :input!4 :scalars-indexof :scalar-shove :vector-do*each (:generator-jumpsome :vector-do*each :char<? :exec-later 417513075) :string-swap :boolean-flipstack :string≤? :code-extract :strings-take :string-yankdup :set-store :refs-stackdepth :strings-rest :refs-byexample :input!6 59.1953125 #{:refs-comprehension :generator-rerunall :strings-echo [3155 4578 1460 324] [2026 4530 1654] 178729576 false :tagspace-againlater} [0.046875 0.12109375 0.109375 0.15234375] [0.125 0.109375 0.01171875 0.0625 0.10546875 0.10546875 0.0859375 0.12890625] :vector-echo ([0.078125 0.13671875 0.0078125 0.09765625] :strings-occurrencesof :scalar-save 327256309M :tagspace-lookup) :refs-againlater [4697 1749 2519 655 486 3358 4479] 23/168 855190559M \Z :code-print 129.49609375 :string-echoall 177115118 195842895 [] :error-empty? \´ \Õ false :code-empty? \ 288.90234375 :chars-length :code-liftstack :input!4 284.14453125 ["=*AwÆ¿·" "V²j" "&8©"] 49/23 :input!2 :strings-save (:scalars-echo :scalars-later \× true ["-E£«È'" "8T¸1ÐvÐ" "QÄH°ÔrÍ¨\\" "WI\\H" "Å*ÖÊØiÆ©|(ÒË=WQ=¶"]) #{\ :code-equal? "Ä?DÌÇª" (:refs-portion 385177551M :exec-swap 7/17 :booleans-concat) ([3984 2614] "Ø*¸½-ä" 9.3515625 :string-replacechar :boolean-later) :scalarsign->boolean 939146697M :vector-sampler} "ÇÃ+1Û+6ã}h" :boolean-return 497148066 :exec-empty? :input!6 :generator-dup :scalars-echoall 43.375 799845144 :string≤? :char-uppercase? :refs-dup 460407015 ["/}¤¾´³®v@"] :scalar-shove (:strings-return :exec-pop :vector-yankdup :refs-sampler :string-shove) ["{ªE3Î" "ÇYKÄâ" "@_%si#PX¤V\"6%ck$Û&" "]§%³LhvUlÚE¶t:7Æ" "×zÌTÑCSÒ\\æ*µM" "sáæPAQÎMË/WÔ¹Ú"] 353.40234375 :code-comprehension [\] [\Z \Ý \Ù \u] :code-sampler false :input!9 131/158 [] 69/16 :scalar-E 325.83984375 (125/76 :environment-begin 41/29 (["âttoA¤pÕ(lÂk¼NC?¡" "¹¹s³ÉlähÌª±-¢´Z" "|R4-6å>#"] 53.8515625 (:strings-generalizeall :input!5 :scalar<? :tagspace-rerunall :strings-liftstack) ",B>©" [\A \Z \×]) :string-flush) :code->set ["KÉÂÏZ1ØÐ¼ÆÔfbx¯¡m"] [false false true false true false false false true] [\w \Å \S \] :set-subset? "eNi" :scalar-cosine 549950427 :chars-return 654660858 \ :vector-flush :scalars-cutflip true :scalar-tag :code-container :boolean-stackdepth ["q{!Q0." "A~Ü|1ÀßÉ®$ÂÊË± ÛØÇ%" "[jÅËÄ>ÃD" "ÓL*Ô\"HäXÃk$" "" "tY(&" "L³6Du¹³"] :input!2 :scalars-tag [0.11328125 0.1328125 0.03515625 0.0546875 0.12109375 0.07421875 0.04296875] [\U \w \ \a \ã] :char>? :booleans-emptyitem? [\ \N \9 \^ \ \8 \l \]] [333 829] [0.0078125 0.0234375 0.00390625 0.0703125 0.046875 0.0078125 0.15234375] [\± \¾ \Z \²] :booleans-yankdup \O :chars-replace 889185812M :code-length :input!7 :code-rotate 115.9296875 "+G£h©àh%JwbCH×1-" :strings-generalize :generator-swap #{:chars-set :chars-cutflip [] [true false false true false false false true] :exec-later :strings-liftstack \> :tagspace-return-pop} :code-liftstack [0.0390625 0.14453125] #{:exec-pop :error-stackdepth [true false false true false false true false false] :boolean-3bittable 724967931 [\±] :boolean->integer :print-empty?} :code-contains? :chars-take :strings-new :set-flipstack [\X \x \K] :refs-cycler [false true true false true true] :chars-againlater (:vector-tag :code-list :code-do*times \1 208.42578125) "¨Ú+" :boolean-pop :code->set :refs-length 919753246M :code-points [\ \¿] false :refs-length :input!8 [0.09375 0.0078125 0.02734375] :input!3 :generator-shove :booleans-take :scalars-reverse :input!7 :scalar-rerunall (:exec-do*times :vector-liftstack :input!10 "Ötf" 48/91) :scalars-return-pop :boolean-and :strings-remove :char-whitespace? :chars-reverse :code-cons [1972 3949 3789 4744 2961 406] :vector-echo "dÒ`pfM¤M9Üç'sG" :string-solid? :code-againlater 67/71 (\£ #{214.953125 :boolean->float #{368534717 5/79 :boolean-empty? :scalars-last :string->code 25/77 "lOµ" [false]} :char-return ["W¡z¨£Ê´8" "ÐAZZµ'§D<GÓP9K7" "ÉÜç4" "^£r@µ" "Ó" "¨¦àGw®7¸ÜA*\"°"] :string-return-pop #{:char-whitespace? :chars->code ["ÂrjS[¦" "]}8" "gmKEDÄ·Ç%/h"] :exec-return 93/38 "×OµÂÁ¸" :input!6 :tagspace-save} 167/90} true [true true true true false] \¯) ["N®? ÃsEeÉÉª±ÍRÐÉ`" "gråQ(Ê" "b¶" "ÎoÙ" "~Ôçusge·«" "_" "ÉÏÕ2¹½ªÔXHF" "':ßBÁ¿%" "¿"] :scalar>? (:tagspace-scale #{:input!9 [] ["k®" "/¤%^ØN±ÖF" "´¹½±Ñ]" "¸¥POM¨Ú" "fLÒ¹zcÇZ[ I°Jæ" "x)æufÕX,"] :char-cutstack :vector-do*each 81/68 348432515 :chars-empty?} :scalars-tag :scalar-many "_áGqÒ") :booleans-pop (:generator-return :scalars-cycler [false true true true false false] (:vector-return-pop 173.3125 :input!9 ["g«" "¿`1" "r×!-" "E8?Md¬°#" "ã2±LqÔ-DyC" "6?É1½¢YA2a" "\\ÂÁ2·Y3[£QD" "E\\uÔVÅo¦®C"] :char-store) [4785]) \¥ :code-yank :refs-echo :ref-new (#{322.5703125 :string-sampler [3590 3877] :vector->code :environment-new :push-bindings \R :print-newline} :input!6 (:scalars-first ["À4fåu!!ÁD&Y:Ó8A(" "t&@¨" "$RzÚÙ1x°@" "I1¶Ó(yZ¨´8ØåÒ" "Z-A©/Â²§§7E£fp" "\"ÛcV0;¶S" "ZPF¡âyq"] (:code->set :set-yankdup :booleans-againlater :strings-replacefirst :scalar-cutflip) :boolean-xor :char-letter?) :booleans-nth ["FáÑ¹¼Ý-X#¾T±ß²à°D" "§PL®³Ú«" "TÚ,eJB!Oæ" "åÝ:AWzmIZaã^" "ÅÚY5µIË[9" ")Sv-°u" "à§o®i^¬k " "B-¼ÐÖ"]) :string-yank :scalar-fractional :string-store 660275624M ["ÇØdfÑ@»Ub'YÈ±¬" "7+D\\" "³åÊpXvÊp¥" "up" "ÜZ¤q}a¯gÖl(5!Û½¿" "DÖ´"] :exec-flush :generator-echo ([] :scalars-cutflip false :scalar-float? []) :input!4]
+    '[["®f^Ô¾" "LwÊ0±Zr¸\"æË+´C¤Á8" "¾AQ'³ã¸" "(¶PaÓ0¡;4:g{WO¯" "y&ÞÛmk,2+4>ua©ÝÒ" "tYFà " "1"] [3940 2883 4981 3328 785 3540 286 2154] :vector-byexample 448484856M :scalar-sqrt :code-do* [] #{293.5078125 :complexes-rotate 44/137 [false false true true true] false :booleans-conj :tagspace-empty?} 537323333M 671301091M 931325092 299764497 :chars-print :input!8 "t`/CN" :scalar-dup :exec-cutstack [false false true false true true false true] :exec-stackdepth ["çUWÛ{XÉ§¾Ç¿(+Bå" "t¨Ñ" "R\"" "\\¼º¦-º;lçË¼:Z " "i§JÚ" "ºX°Ý.Æ¸Æ!8å0" "YNÒ.gOF¥x¹¨I7" "L!T¥¦¤+@(âr²"] "µàk¾y×IÛÙ?V" :code-do ["¿c°É·+¿£{ç«aÏ" "l%" "ÃÔÉ" "¡ÉÍÌDv<¤jKÀ(ÞP"] 11/191 \K :refs-build 45/52 :complexes-comprehension "u¼yP«'-E¤!Á'w;Ï'" \G [0.0078125 0.06640625 0.09375 0.109375 0.14453125 0.02734375 0.04296875 0.03125 0.05859375] [\¾ \Ï \æ \& \ \u] :scalars-last [\O] :complexes-yankdup 313.67578125 "|¡·-N!¬>ÍV" :vector-reverse [] (#{:char≤? #{170.2109375 :scalar->code :refs-byexample ["¬ÇÑv" "Ö &6\"Ëg ¬:~çW§" "_Ø+ÐÔ'c¿ " " S©O/¬i[Þâ" "0s|\\´4ÊÜtÅP¤lgBA" "W2ÞØÍ*v£t «ªo" ">ç*" "½dWh"] :strings-echoall :refs-store ["â%ß5BÌÁ+ÅáÌÀ" "åAâÁ°qÝÔÃÃ¥z¡«" "3¶~T´[%$³y]." "&Hps¤Ñ^#^kªÂç"] [0.0625 0.12890625 0.08203125 0.01953125 0.140625 0.13671875 0.0078125]} :boolean-stackdepth :set-shove [true true true false] :print-newline [2106 2742 140 4422] :code-flush} :boolean->float #{(41/66 :vector-liftstack :tagspace-return 16/5 [800 1105 1944 2293 2461 545 1058]) :scalar-lots :code-rotate #{:complexes-print [\á \< \M \ \Y \d] [\G \K \`] 352790041M :snapshot-new [true true true] [\5 \| \Õ \à \# \+] :push-bindingcount} :boolean-xor :vector->set :complexes-save [410]} [2081 2859 2190 348 2357] false) [] "ØÉ Z+ÁM·7Asm" [0.1171875 0.09765625 0.03515625 0.0703125 0.1484375 0.15234375 0.15234375] [] \& :exec-print :scalars-take 193/67 :string-occurrencesofchar 215.5546875 :booleans-byexample :snapshot-cutflip :refs-shatter :set-superset? :strings-notequal? "+@°MS,¨" [false false false true true true true] :scalars-butlast :refs-tag :exec-yank [\ß \Ì \· \s \ \A] 92/83 :scalar-savestack :scalars-dup \2 ["u,>_¦KßÝ" "ÖßÇg7s" "Råd>"] :chars-emptyitem? :refs-cycler [2286 4225 1638 3240 917 2797 3237 571] :input!7 [\ \~ \º \¢ \Õ \¥ \l \\ \à] \T :set-stackdepth [1023 1605 45 3801 1525 1221] :vector-return-pop :input!6 [2219 1214 4006 4316 2870] 138562483 :scalars-shove 14.33203125 :complexes-pop :strings-echo :input!5 :complexes-flipstack :tagspace-merge :booleans-store [\7 \W \Â \¿ \Ë \3 \| \] :string-splitonspaces :string-flipstack [0.0390625 0.046875 0.01953125 0.0625 0.08203125] :string-save :complexes-tag :boolean->code :booleans-yankdup :vector-savestack 355949968 :chars-occurrencesof "}Ä2¹µ+³7ÏÐ:¤ÆÛàÉ" :snapshot-cutflip :code->set :vector-cutflip :scalar->string 136.78125 :input!8 :string-pop :code-yankdup :refs-concat [501 4435 3822 4813 930] :complexes-emptyitem? :scalar-add [\ \¼] :scalar-min [true] [\ \Ç \æ \Ô \1 \3 \S] [\ \µ] :scalar-flipstack :ref-swap :input!9 :booleans-return-pop 270637605 :exec-empty? :ref-storestack [0.08203125] :tagspace-keys :chars-return-pop 63.6875 :exec-y :generator-echoall :complexes->tagspace ["ÞPuKL´" "-0^T©]¤ª¤RNÚ=gC]" "5Ýæg#ÞnÎs" "Y;_zlÀå¸ã"] :string-save 222.015625 [true false true true false false true true false] :scalar-ln1p 177.91015625 :chars-shove #{:string-swap :refs-conj [\Ø \á \ \2] [] ["}}}å4ºÄÑ" "NsÓVÑ¢ÉU_Ú" ".u5" "AÆ ]±Ñ½vª~®" "x]²¨ " "¹×2\\4Ï"] :scalars-emptyitem? #{:complex-stackdepth [true true false] :exec-againlater :vector-set :tagspace-sampler :vector-sampler (:code-subst :scalar-log10 [false true true true true false true true] :vector-replacefirst 17/9) (:exec-yankdup :complex-add 49717942M 164/43 :scalars-echo)} :char->integer} :code-atom? :push-discardARGS [0.125] [] 649282339M :scalars-print :vector-storestack :input!7 \/ false :ref-known? 533993519M false :exec-return false :refs-cutstack :input!5 498499265M [247 1938 2947 825 1961 1450 2022 508 4549] :refs-replace :generator-storestack 659703882 [\¶ \[ \r \¤ \R \] :ref->code :ref-flipstack :tagspace-lookupscalars [0.01953125 0.0390625 0.0625 0.00390625 0.12109375 0.1328125 0.07421875] :complexes-new :complexes-notequal? (:tagspace-tag :booleans-tag :chars-replace true ["¯ÁjSCC9%k{Ô~" "¦gæk§ÀcÍªtà©VbH³«" "¨Í×8ã\\!cCPs" "½?`t·M^l4" "µ!fÍãª_M¤f¿²I78<'" "%Rja+¡5ä§Pic¥ºÈZ" "å·Â£^SÛ2Ð" "2Cç{¹Æ¿¹KvÙ" "Å¢(3C*Á9ap¦odÃÍ"]) :snapshot-new 452483708M :scalars-cutstack :scalars-flush :strings-build :exec-sampler 41169269 :generator-stepper :scalar-return-pop :tagspace-tag 603462467 :boolean-arity2 :push-storeARGS :log-empty? :boolean-arity3 :code-pop true :string-return-pop :ref-exchange :booleans-first 5/6 :booleans-swap :set-shove 172410281 :booleans-new (785740557 :string-last [4540 3255 4407 3610 4276] [0.14453125 0.0859375 0.05078125 0.08203125 0.1015625 0.078125 0.0078125 0.10546875 0.0625] \a) "»" [\0 \½ \Á \V \ \A \f \&] \k :string->code :complex-dup :generator-cutflip 391392013M]

     :bindings

-    '{:input!2 (true), :input!9 (:scalars-set), :input!3 (:vector-rerunall), :input!10 (45/82), :input!1 (true), :input!8 (#{"Ç¸ÌI¨và°U½®ÔÆ@2fµ" [false true false false false false false true true] true "q:&n·Sa<×[ÑR" :string-containschar? :chars-save :ref-againlater "±ÃI=dp"}), :input!4 (:char-pop), :input!7 (115/71), :input!5 (:chars-reverse), :input!6 (:scalar-power)}
+    '{:input!1 (:complexes-first), :input!2 ([\ \¯ \¯ \!]), :input!3 ([0.13671875 0.140625 0.04296875 0.13671875 0.0625 0.02734375]), :input!4 ([false false false true true]), :input!5 (:exec-while), :input!6 (:complexes-liftstack), :input!7 ([false true]), :input!8 (true), :input!9 (:code-rest)}

 }


Fixed error message "DB is not setup" -> "DB is not set up"

--- src/toucan/db.clj
+++ src/toucan/db.clj
@@ -91,7 +91,7 @@
   (or *db-connection*
       *transaction-connection*
       @default-db-connection
-      (throw (Exception. "DB is not setup. Make sure to bind call set-default-db-connection! or bind *db-connection*."))))
+      (throw (Exception. "DB is not set up. Make sure to bind call set-default-db-connection! or bind *db-connection*."))))

 (defn do-in-transaction
   "Execute F inside a DB transaction. Prefer macro form `transaction` to using this directly."