+{:obj :unspec}

+{:obj :unspec}

--- test/babel/test/it.cljc
+++ test/babel/test/it.cljc
@@ -251,9 +251,9 @@
                            #(generate {:synsem {:cat :verb
                                                 :essere true
                                                 :sem {:tense :present
-                                                      :aspect :perfect}
-                                                :subcat ()}}
-                                      :model (small))))]
+                                                      :aspect :perfect
+                                                      :obj :unspec}
+                                                :subcat ()}})))]
     (is (= do-this-many
            (count (map-fn (fn [expr]
                           (let [surface (morph expr)


First version of Downing-Gallier

First version of Downing-Gallier

seems to do what it should, but definitively needs more testing

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/algorithms/linclosure.clj
+++ src/conexp/contrib/algorithms/linclosure.clj
@@ -7,26 +7,65 @@
 ;; You must not remove this notice, or any other, from this software.

 (ns conexp.contrib.algorithms.downing-gallier
-  (:use [conexp.base :only (difference)]
-        [conexp.fca.implications :only (premise conclusion make-implication)]))
+  (:use [conexp.base :only (not-yet-implemented, def-)]
+        [conexp.fca.implications :only (premise conclusion)]))

 ;;;

+(defn implication-graph [base-set implications]
+  (let [implications     (vec implications),
+        where-in-premise (reduce (fn [map [i impl]]
+                                   (reduce (fn [map m]
+                                             (update-in map [m] conj i))
+                                           map
+                                           (premise impl)))
+                                 {}
+                                 (map vector (range) implications))
+        numargs          (into {} (map vector
+                                       (range)
+                                       (map (comp count premise) implications)))]
+    [implications where-in-premise numargs]))

+(defn close-with-network [base-set implications input-set]
+  (let [[implications in-premise numargs] (implication-graph base-set implications),
+        numargs                           (reduce (fn [numargs i]
+                                                    (update-in numargs [i] dec))
+                                                  numargs
+                                                  (mapcat in-premise input-set))
+        empty-premise-implications        (map first
+                                               (filter (fn [[i c]] (zero? c))
+                                                       numargs))]
+    (loop [queue   (into (clojure.lang.PersistentQueue/EMPTY)
+                         empty-premise-implications),
+           numargs numargs
+           result  input-set]
+      (if (empty? queue)
+        result
+        (let [idx             (first queue),
+              _ (println idx)
+              new             (difference (conclusion (implications idx)) result)
+              [numargs queue] (reduce (fn [[numargs queue] i]
+                                        (let [numargs (update-in numargs [i] dec)]
+                                          [numargs (if (pos? (get numargs i))
+                                                     queue
+                                                     (conj queue i))]))
+                                      [numargs (pop queue)]
+                                      (mapcat in-premise new))
+              _ (println numargs)]
+          (recur queue numargs (into result new)))))))

 ;;;

-(comment
+(do

-  (require '[conexp.main :as cm])
+  (def- testing-implications #{(make-implication '#{p_3 p_4} '#{p_5})
+                               (make-implication '#{p_1} '#{p_2})
+                               (make-implication '#{p_2} '#{p_1})
+                               (make-implication '#{p_3} '#{p_4})
+                               (make-implication '#{}    '#{p_3})})

-  (let [subsets-10 (cm/subsets #{1 2 3 4 5 6 7 8 9 10})]
-    (def- impls (cm/set-of (cm/make-implication A B)
-                           [A subsets-10
-                            B subsets-10])))
-
-  (time (close-under-implications impls #{}))
-  (time (cm/close-under-implications impls #{}))
+  (def- network (implication-graph '[p_1 p_2 p_3 p_4 p_5]
+                                   testing-implications))

   nil)


tag summary

tag summary

--- src/ontrail/summary.clj
+++ src/ontrail/summary.clj
@@ -63,6 +63,7 @@
         all-distinct-sports (mc/distinct EXERCISE "sport" cond-with-user)]
     {:user user :sports (sort-by :numericalDuration > (map #(get-summary (assoc cond-with-user :sport %) %) all-distinct-sports))}))

+
 (defn get-year-summary-sport [user year]
   (let [first-day (time/date-time year 1 1)
         last-day (time/date-time year 12 31)
@@ -82,5 +83,9 @@
 (defn get-distinct-tags [condition]
   (filter (partial not= nil) (mc/distinct EXERCISE "tags" condition)))

+(defn get-overall-tags-summary [user]
+  (let [tags (filter (partial not= "") (get-distinct-tags {:user user}))]
+    (sort-by :numericalDuration > (map #(get-summary {:user user :tags %} %) tags))))
+
 (defn get-distinct-sports [condition]
   (mc/distinct EXERCISE "sport" condition))


Allow specifying `:onyx.peer/storage.s3.endpoint`

--- src/onyx/storage/s3.clj
+++ src/onyx/storage/s3.clj
@@ -120,13 +120,13 @@
 (defmethod onyx.checkpoint/storage :s3 [peer-config monitoring]
   (let [id (java.util.UUID/randomUUID)
         region (:onyx.peer/storage.s3.region peer-config)
+        endpoint (:onyx.peer/storage.s3.endpoint peer-config)
         accelerate? (:onyx.peer/storage.s3.accelerate? peer-config)
         bucket (or (:onyx.peer/storage.s3.bucket peer-config)
                    (throw (Exception. ":onyx.peer/storage.s3.bucket must be supplied via peer-config when using :onyx.peer/storage = :s3.")))
         client (new-client peer-config)
-
-
         transfer-manager (cond-> client
+                           endpoint (set-endpoint endpoint)
                            region (set-region region)
                            accelerate? (accelerate-client)
                            true (transfer-manager))


Added third-inversion.

Added third-inversion.

--- src/overtunes/pitch.clj
+++ src/overtunes/pitch.clj
@@ -90,6 +90,7 @@
 (def thirteenth #(assoc (eleventh %) :xiii (raise (:vi major-scale))))
 (def first-inversion #(update-values % (keys-except % [:i]) lower))
 (def second-inversion #(update-values % (keys-except % [:i :iii]) lower))
+(def third-inversion #(update-values % (keys-except % [:i :iii :v]) lower))
 (def with-bass (bass :i))

 ; Qualities


Support 'unbinding'

Support 'unbinding'

--- src/pani/cljs/core.cljs
+++ src/pani/cljs/core.cljs
@@ -92,10 +92,13 @@
      bind-chan))

   ([root type korks cb]
-   (let [c (walk-root root korks)]
-     (.on c (clojure.core/name type)
-          #(when-let [v (clj-val %1)]
-             (cb {:val v, :name (name %1)}))))))
+   (let [n (clojure.core/name type)
+         c (walk-root root korks)
+         f #(when-let [v (clj-val %1)]
+             (cb {:val v, :name (name %1)}))]
+     (.on c n f)
+     ;; return function to close binding
+     #(.off c n f))))

 (defn transact!
   "Use the firebase transaction mechanism to update a value atomically"


remove deprecated either schema

remove deprecated either schema

--- src/er_cassandra/model/types.clj
+++ src/er_cassandra/model/types.clj
@@ -15,8 +15,14 @@
    (s/optional-key :before-save) [CallbackFnSchema]})

 (s/defschema KeySchema
-  (s/either [(s/optional [s/Keyword] []) s/Keyword]
-            [s/Keyword]))
+  (s/conditional
+
+   (fn [k] (-> k first sequential?))
+   [(s/optional [s/Keyword] :compound-parition-key)
+    s/Keyword]
+
+   :else
+   [s/Keyword]))

 (s/defschema SecondaryKeySchema
   s/Keyword)


use the correct function name, too

use the correct function name, too

--- src/riffle/data/utils.clj
+++ src/riffle/data/utils.clj
@@ -97,10 +97,11 @@

 (defn distinct-keys [s]
   (lazy-seq
-    (let [[k v] (first s)]
-      (cons [k v]
-        (distinct-keys
-          (drop-while #(bs/bytes== k (first %)) s))))))
+    (when-not (empty? s)
+      (let [[k v] (first s)]
+        (cons [k v]
+          (distinct-keys
+            (drop-while #(bs/bytes= k (first %)) s)))))))

 (defn merge-sort-by
   "Like sorted-interleave, but takes a specific keyfn, like sort-by."


Translating 3.26 of fpins (using clojure.core.match)

--- src/fpinscala/datastructures.clj
+++ src/fpinscala/datastructures.clj
@@ -419,9 +419,20 @@
   (letfn [(go [t acc]
               (if (nil? t)
                 acc
+                ;my solution is wrong here :| I am passing same acc to both
+                ;left and right path walk
                 (+ (go (:L t) (inc acc)) (go (:R t) (inc acc)))))]
     (+ (go (:L t) 0) (go (:R t) 0))))
-;fpins
+;fpins - no pattern matching
+(defn t-size-fpins [t]
+  (if (and (nil? (:R t)) (nil? (:L t)))
+    1
+    (+ 1 (t-size-fpins (:R t)) (t-size-fpins (:L t)))))
+;fpins - with pattern matching
+(defn t-size-fpins-revisited [t]
+  (match [t]
+         [(:or {:val _ :R nil :L nil} nil)] 1
+         [{:val _ :R r :L l}] (+ 1 (t-size-fpins-revisited r) (t-size-fpins-revisited l))))
 ;-----------------------------------------------------------------------

 ;3.26
@@ -433,8 +444,18 @@
                 (let [val (:val t) new-max (if (nil? acc) val (max val acc))]
                   (max (go (:R t) new-max) (go (:L t) new-max)))))]
     (go t nil)))
-;fpins
-
+;fpins - what is cumbersome here is probably necessity of covering all cases when matching
+;over map but that is limitation of Clojure (or perhaps my own as I am not familiar currently
+;with better options) as Scala variant of FPINS is utilizing matching over two case classes which
+;are extending same Trait. Nevertheless, here it is, how I translated it
+;not though that order of patterns here matters very much as e.g. pattern {:val :L l :R r} captures
+;when l and r are nils as well so explicit match of nil must come before
+(defn t-max-fpins [t]
+  (match t
+         {:val v :L nil :R nil} v
+         {:val v :L nil :R r} (max v (t-max-fpins r))
+         {:val v :L l :R nil} (max v (t-max-fpins l))
+         {:val v :L l :R r}  (max v (t-max-fpins l) (t-max-fpins r))))
 ;-----------------------------------------------------------------------

 ;3.27
@@ -457,4 +478,5 @@
               (if (nil? t)
                 new-t
                 (go (branch t) branch (xconj new-t branch (f (:val t))))))]
-    (go (:L t) :L (go (:R t) :R (xconj nil nil (f (:val t)))))))+    (go (:L t) :L (go (:R t) :R (xconj nil nil (f (:val t)))))))
+


Fix uri-root problem using hiccup's with-base-url.

This is a more robust fix than pushing changes through stefon anyway.

--- src/incise/layouts/impl/base.clj
+++ src/incise/layouts/impl/base.clj
@@ -4,7 +4,9 @@
                                           deflayout
                                           defpartial]])
             [stefon.core :refer [link-to-asset]]
+            [incise.config :as conf]
             (hiccup [core :refer :all]
+                    [util :refer [with-base-url]]
                     [def :refer :all]
                     [page :refer :all]
                     [element :refer :all]))
@@ -45,17 +47,18 @@
 (deflayout base
   "The default page/post layout."
   [{:keys [site-title]} {:keys [title]}]
-  (html5
-    [:head
-     [:title (str site-title (when title (str " - " title)))]
-     [:meta {:charset "UTF-8"}]
-     [:meta {:name "viewport" :content "width=device-width, initial-scale=1.0"}]
-     (apply include-css (remove nil? (stylesheets)))]
-    [:body#page
-     [:div.container
-      (header)
-      [:div#content (content)]
-      (footer)]
-     (apply include-js (remove nil? (javascripts)))]))
+  (with-base-url (when-not (conf/serving?) (str \/ (conf/get :uri-root)))
+    (html5
+      [:head
+       [:title (str site-title (when title (str " - " title)))]
+       [:meta {:charset "UTF-8"}]
+       [:meta {:name "viewport" :content "width=device-width, initial-scale=1.0"}]
+       (apply include-css (remove nil? (stylesheets)))]
+      [:body#page
+       [:div.container
+        (header)
+        [:div#content (content)]
+        (footer)]
+       (apply include-js (remove nil? (javascripts)))])))

 (register [:base] base)


Fix issue whereby routes could overwrite each others' parameter names

--- src/io/aviso/rook/dispatcher.clj
+++ src/io/aviso/rook/dispatcher.clj
@@ -324,18 +324,18 @@
    (fn rook-map-traversal-dispatcher [request]
      (loop [pathvec (second (request-route-spec request))
             dispatch dispatch-map
-            route-params {}]
+            route-params []]
        (if-let [seg (first pathvec)]
          (if (contains? dispatch seg)
            (recur (next pathvec) (get dispatch seg) route-params)
-           (if-let [v (::param-name dispatch)]
-             (recur (next pathvec) (::param-next dispatch)
-                    (assoc route-params v seg))
+           (if-let [dispatch' (::param dispatch)]
+             (recur (next pathvec) dispatch' (conj route-params seg))
              ;; no match on path
              not-found-response))
          (if-let [h (or (get dispatch (:request-method request))
                         (get dispatch :all))]
-           (h (assoc request :route-params route-params))
+           (h (assoc request
+                :route-params (zipmap (:route-params (meta h)) route-params)))
            ;; unsupported method for path
            not-found-response))))))

@@ -502,20 +502,11 @@

 (defn- add-dispatch-entries
   [dispatch-map method pathvec handler]
-  (let [pathvec' (mapv #(if (variable? %) ::param-next %) pathvec)
+  (let [pathvec'      (mapv #(if (variable? %) ::param %) pathvec)
         dispatch-path (conj pathvec' method)
-        binding-names (filter variable? pathvec)
-        binding-paths (keep-indexed
-                        (fn [i seg]
-                          (if (variable? seg)
-                            (-> (subvec pathvec' 0 i)
-                                (into [])
-                                (conj ::param-name))))
-                        pathvec)]
-    (reduce (fn [dispatch-map [name path]]
-              (assoc-in dispatch-map path (keyword name)))
-            (assoc-in dispatch-map dispatch-path handler)
-            (map vector binding-names binding-paths))))
+        route-params  (filterv variable? pathvec)]
+    (assoc-in dispatch-map dispatch-path
+      (with-meta handler {:route-params (mapv keyword route-params)}))))

 (defn- build-dispatch-map
   "Returns a dispatch-map for use with map-traversal-dispatcher."


Update query.clj

Update query.clj

--- src/main/clojure/basex/query.clj
+++ src/main/clojure/basex/query.clj
@@ -3,41 +3,67 @@

 (defn create-query [session query]
   "Creates a new query instance for the given session based on the passed in
-   query string"
+   query string.
+
+   This will cause the query to be prepared but not processed."
   (.query session query))

 (defn bind
+  "Bind a particular value (and optionally a type) to a named variable in the
+   context of the query"
   ([query name value]
    (.bind query name value))
   ([query name value type]
    (.bind query name value type)))

 (defn context
+  "Bind a value (and optionally type) to the global context of the query"
   ([query value]
    (.context query value))
   ([query value type]
    (.context query value type)))

-(defn more? [query]
+(defn more?
+  "Returns an indication if there are any more items left in the queries
+   result set"
+  [query]
   (.more query))

-(defn next [query]
+(defn next
+  "Returns the next result in the result set.  If we are past the end of
+   the results nil will simply be returned. This is a stepped alternative
+  to the execute method."
+  [query]
   (.next query))

-(defn results [query]
+(defn results
+  "A more Clojure-y way to walk the result set of the executed query.
+
+   Lazily executes the `next` function on the query until the query
+   returns nil.  This does not rely on the `more?` method."
+  [query]
   (take-while #(not (nil? %))
               (repeatedly #(next query))))

-(defn execute [query]
+(defn execute
+  "Execute the query as a single batch and return the result as a
+   single string.  Similar to the `session/execute` function."
+  [query]
   (.execute query))

-(defn info [query]
+(defn info
+  "Returns info/status about the query"
+  [query]
   (.info query))

-(defn options [query]
+(defn options
+  "Returns a string with all query serialization parameters."
+  [query]
   (.options query))

-(defn close [query]
+(defn close
+  "Closes and unregisters the query"
+  [query]
   (.close query))

 (defmacro with-query


CMR-1074: Changed date range queries to use the numeric range configuration.

--- search-app/src/cmr/search/data/query_to_elastic.clj
+++ search-app/src/cmr/search/data/query_to_elastic.clj
@@ -151,8 +151,8 @@
     (let [field (query-field->elastic-field field concept-type)]
       {:query {:query_string {:query (fix-double-escapes
                                        (str/replace query-str
-                                                  query-string-reserved-characters-regex
-                                                  "\\\\$1"))
+                                                    query-string-reserved-characters-regex
+                                                    "\\\\$1"))
                               :analyzer :whitespace
                               :default_field field
                               :default_operator :and}}}))
@@ -253,7 +253,9 @@
           from-value (if start-date (h/utc-time->elastic-time start-date) h/earliest-echo-start-date)
           value {:from from-value}
           value (if end-date (assoc value :to (h/utc-time->elastic-time end-date)) value)]
-      {:range { field value }}))
+      {:range {field value
+               :execution (numeric-range-execution-mode)
+               :_cache (numeric-range-use-cache)}}))

   cmr.search.models.query.DateValueCondition
   (condition->elastic


better names

better names

--- server/src/gratefulplace/db/transactions/topics.clj
+++ server/src/gratefulplace/db/transactions/topics.clj
@@ -9,12 +9,12 @@

 (defmapifier record mr/ent->topic {:include [:first-post]})

-(defmapifier topic-txdata* mr/topic->txdata)
-(def topic-txdata (comp remove-nils-from-map topic-txdata*))
+(defmapifier topic-params->txdata* mr/topic->txdata)
+(def topic-params->txdata (comp remove-nils-from-map topic-txdata*))

-(defmapifier watch-txdata mr/watch->txdata)
+(defmapifier watch-params->txdata mr/watch->txdata)

-(defmapifier post-txdata mr/post->txdata)
+(defmapifier post-params->txdata mr/post->txdata)

 ;: TODO refactor with post notification query
 (defn users-to-notify-of-topic
@@ -40,7 +40,7 @@

 (defn- topic-transaction-data
   [params]
-  (map #(% params) [topic-txdata watch-txdata post-txdata]))
+  (map #(% params) [topic-params->txdata post-params->txdata watch-params->txdata]))

 (defn create-topic
   [params]


hide the tooltip when a button is disabled

- this improves the current behavior which can leave the tooltip
  stranded on the screen
  - but it doesn't allow any tooltip for a disabled button
- a better solution would allow the tooltip to show and hide properly
  even when the button is disabled
- the issue of how to provide a tooltip for a disabled button has had a
  fair amount of discussion online
  - the usual advice is to wrap the button in a div and attach the
    tooltip to that
  - here's a representative discussion:
    https://github.com/angular-ui/bootstrap/issues/1025
  - I've been unable to get this to work for re-com's button, but
    someone with more experience likely could

--- src/re_com/buttons.cljs
+++ src/re_com/buttons.cljs
@@ -46,6 +46,8 @@
                              :on-mouse-out  (handler-fn (reset! showing? false))})
                           attr)
                         label]]
+        (when disabled?
+          (reset! showing? false))
         [box
          :class "display-inline-flex"
          :align :start


Commit to using #with-db

Commit to using #with-db

--- src/swanson/models/db.clj
+++ src/swanson/models/db.clj
@@ -2,49 +2,45 @@
   (:require [clojure.java.jdbc :as sql])
   (:import [java.security MessageDigest]
            [javax.xml.bind DatatypeConverter]))
-

 (def db {:subprotocol "postgresql"
          :subname "//localhost/swanson"
          :user "admin"
          :password "admin"})

+(defmacro with-db [f & body]
+  `(sql/with-connection ~db (~f ~@body)))
+
 (defn create-users-table []
-  (sql/with-connection db
-    (sql/create-table
+  (with-db sql/create-table
       :users
       [:id "serial primary key"]
       [:fname "varchar(100) NOT NULL"]
       [:lname "varchar(100) NOT NULL"]
       [:email "varchar(100) NOT NULL"]
-      [:encrypted_password "varchar(100)"])))
+      [:encrypted_password "varchar(100)"]))

 (defn create-transactions-table []
-  (sql/with-connection db
-    (sql/create-table
+  (with-db sql/create-table
       :transactions
       [:id "serial primary key"]
       [:amount "float NOT NULL"]
       [:date "date NOT NULL"]
       [:category_id "int NOT NULL"]
-      [:description "varchar(512) NOT NULL"])))
+      [:description "varchar(512) NOT NULL"]))

 (defn create-categories-table []
-  (sql/with-connection db
-    (sql/create-table
+  (with-db sql/create-table
       :categories
       [:id "serial primary key"]
-      [:name "varchar(512) NOT NULL"])))
-
-(defmacro with-db [f & body]
-  `(sql/with-connection ~db (~f ~@body)))
+      [:name "varchar(512) NOT NULL"]))

 (defn get-user
   [email]
   (with-db sql/with-query-results
     res ["SELECT * FROM users WHERE email = ?" email] (first res)))

-(defn make-user
+(defn create-user
   [fname lname email encrypted-pass]
   (with-db sql/insert-values
       :users
@@ -53,35 +49,27 @@

 (defn get-category
   [name]
-  (sql/with-connection
-    db
-    (sql/with-query-results
-      res ["SELECT * FROM categories WHERE name = ?" name] (first res))))
+  (with-db sql/with-query-results
+      res ["SELECT * FROM categories WHERE name = ?" name] (first res)))

-(defn make-category
+(defn create-category
   [category]
-  (sql/with-connection
-    db
-    (sql/insert-values
+  (with-db sql/insert-values
       :categories
       [:name]
-      [category])))
+      [category]))

 (defn get-transaction
   [id]
-  (sql/with-connection
-    db
-    (sql/with-query-results
-      res ["SELECT * FROM transactions WHERE id = ?" id] (first res))))
+  (with-db sql/with-query-results
+      res ["SELECT * FROM transactions WHERE id = ?" id] (first res)))

-(defn make-transaction
+(defn create-transaction
   [amt dt desc category-id]
-  (sql/with-connection
-    db
-    (sql/insert-values
+  (with-db sql/insert-values
       :transactions
       [:amount :date :category_id :description]
-      [amt dt category-id desc])))
+      [amt dt category-id desc]))

 (defn- sha256-digest [bs]
   (doto (MessageDigest/getInstance "SHA-256") (.update bs)))
@@ -92,8 +80,3 @@
 (defn mk-transaction-id
   [date amount description]
   (sha256 (apply str date amount description)))
-
-(defn create-user "create user record" [user]
-  (sql/with-connection
-    db
-    (sql/insert-record :users user)))


Bug fix

Bug fix


FIX issue 43 with temp dir

FIX issue 43 with temp dir

--- kafka-clj/src/kafka_clj/msg_persist.clj
+++ kafka-clj/src/kafka_clj/msg_persist.clj
@@ -3,6 +3,9 @@
   (:import [org.mapdb DB DBMaker HTreeMap]
            [java.util.concurrent TimeUnit]
            [java.util Map Collection Iterator]))
+
+(defn tmp-dir []
+  (System/getProperty "java.io.tmpdir"))

 (defn closed? [{{:keys [db]} :retry-cache}]
   (.isClosed ^DB db))
@@ -80,7 +83,7 @@
        map (-> db (.getTreeMap "kafka-retry-cache"))]
       {:db db :file file :cache map}))

-(defn create-retry-cache [{:keys [retry-cache-file] :or {retry-cache-file "/tmp/kafka-retry-cache"} :as conf}]
+(defn create-retry-cache [{:keys [retry-cache-file] :or {retry-cache-file (str (tmp-dir) "/kafka-retry-cache")} :as conf}]
   (try
     (_create-retry-cache conf)
     (catch Exception e (do ;delete the file and recreate


Add mode argument to control hue interpolation in blend-hsv.

--- src/org/playasophy/wonderdome/util/color.clj
+++ src/org/playasophy/wonderdome/util/color.clj
@@ -85,17 +85,27 @@

 (defn blend-hsv
   "Generates a color which is composed of linearly interpolated hue,
-  saturation, and value channels between two colors."
-  [p x y]
-  {:pre [(<= 0.0 p 1.0)]}
-  (let [xc (hsv-components x)
-        yc (hsv-components y)]
-    ; FIXME: this doesn't work because hue may wrap around the circle
-    (->>
-      (map - yc xc)
-      (map (partial * p))
-      (map + xc)
-      (apply hsv))))
+  saturation, and value channels between two colors. This direction the hue is
+  interpolated may be controlled with an optional mode argument. Mode may be
+  :closest, :pos, or :neg. The default is :closest."
+  ([p x y]
+   (blend-hsv :closest p x y))
+  ([mode p x y]
+   {:pre [(keyword? mode) (<= 0.0 p 1.0)]}
+   (let [[xh xs xv] (hsv-components x)
+         [yh ys yv] (hsv-components y)
+         dh+ (- (if (< yh xh) (+ yh 1.0) yh) xh)
+         dh- (- 1.0 dh+)]
+     (hsv
+       (case mode
+         :pos (+ xh (* p dh+))
+         :neg (- xh (* p dh-))
+         :closest
+         (if (< dh+ dh-)
+           (+ xh (* p dh+))
+           (- xh (* p dh-))))
+       (+ xs (* p (- ys xs)))
+       (+ xv (* p (- yv xv)))))))

 (defn gradient   ; FIXME


Minor formatting

Minor formatting

--- modules/messaging/src/main/clojure/immutant/messaging.clj
+++ modules/messaging/src/main/clojure/immutant/messaging.clj
@@ -166,8 +166,8 @@
    respond with the result of applying f to the message. queue can
    either be the name of the queue or a javax.jms.Queue. Accepts the
    same options as listen."
-  [queue f & {:keys [decode?] :or {decode?
-   true} :as opts}] {:pre [(queue? queue)]}
+  [queue f & {:keys [decode?] :or {decode? true} :as opts}]
+  {:pre [(queue? queue)]}
   (letfn [(respond* [^javax.jms.Message msg]
             (publish (.getJMSDestination msg)
                      (f (codecs/decode-if decode? msg))


(PDB-5161) engine/required-by-projections: rely on parse-field

--- src/puppetlabs/puppetdb/query_eng/engine.clj
+++ src/puppetlabs/puppetdb/query_eng/engine.clj
@@ -3067,10 +3067,7 @@
                           (remove (comp :query-only? val))
                           keys)))
         ;; Now we need just the base name, i.e. facts.kernel -> facts
-        basename #(let [path-or-field (parse/dotted-query->path %)]
-                    (if (coll? path-or-field)
-                      (first path-or-field)
-                      path-or-field))
+        basename #(-> % parse/parse-field first :name)
         required-joins (map #(get-in proj-info [% :join-deps])
                             (map basename fields))]
     (when (some nil? required-joins)


[ISSUE#3099] Do not hardocde list item height

--- src/status_im/ui/components/list/styles.cljs
+++ src/status_im/ui/components/list/styles.cljs
@@ -5,8 +5,7 @@

 (def item
   {:flex-direction :row
-   :justify-content :center
-   :height          64})
+   :justify-content :center})

 (def item-content-view
   {:flex            1


When test image comparison fails, add actual and expected images to difference png.

--- test/clj/quil/snippet.clj
+++ test/clj/quil/snippet.clj
@@ -33,6 +33,7 @@
 (defn- imagemagick-installed? []
   (try
     (sh/sh "compare" "-version")
+    (sh/sh "convert" "-version")
     true
     (catch java.io.IOException e false)))

@@ -65,9 +66,12 @@
           result     (compare-images expected actual difference)
           threshold  0.02]
       (when (number? result)
-        (when (<= result threshold)
-          (io/delete-file (io/file actual))
-          (io/delete-file (io/file difference)))
+        (if (<= result threshold)
+          (do
+            (io/delete-file (io/file actual))
+            (io/delete-file (io/file difference)))
+          ; add actual and expected images to difference image for easier comparison
+          (sh/sh "convert" actual difference expected "+append" difference))
         (t/is (<= result threshold))))))

 (defn run-snippet-as-test [{:keys [ns name opts setup body body-str mouse-clicked]}]


Adapt portation ns to storage api changes.

--- src/uxbox/portation.clj
+++ src/uxbox/portation.clj
@@ -9,10 +9,10 @@
   (:refer-clojure :exclude [with-open])
   (:require [clojure.java.io :as io]
             [suricatta.core :as sc]
+            [storages.util :as path]
             [uxbox.db :as db]
             [uxbox.sql :as sql]
             [uxbox.util.uuid :as uuid]
-            [uxbox.util.paths :as paths]
             [uxbox.util.closeable :refer (with-open)]
             [uxbox.util.tempfile :as tmpfile]
             [uxbox.util.transit :as t]
@@ -105,7 +105,7 @@
 (defn import!
   "Given a path to the previously exported bundle, try to import it."
   [path]
-  (with-open [istream (io/input-stream (paths/path path))
+  (with-open [istream (io/input-stream (path/path path))
               zstream (snappy/input-stream istream)
               conn (db/connection)]
     (let [reader (t/reader zstream {:type :msgpack})]


Set a fixed user photo until photo upload is implemented.

--- src/uxbox/ui/users.cljs
+++ src/uxbox/ui/users.cljs
@@ -56,7 +56,7 @@
                       :on-mouse-leave #(swap! local assoc :open false)}
       [:span (:fullname profile)]
       [:img {:border "0"
-             :src (:photo profile "/images/avatar.jpg")}]
+             :src "/images/avatar.jpg"}]
       (user-menu (:open @local))])))

 (def user


tests changed to reflect effect, not implementation

--- test/structural_typing/assist/f_defaults.clj
+++ test/structural_typing/assist/f_defaults.clj
@@ -1,18 +1,15 @@
 (ns structural-typing.assist.f-defaults
-  (:require [structural-typing.assist.defaults :as subject]
-            [such.readable :as readable])
-  (:use midje.sweet))
+  (:use midje.sweet
+        structural-typing.type
+        structural-typing.global-type
+        structural-typing.clojure.core
+        structural-typing.assist.testutil))

-(fact "the way functions print"
-  (readable/fn-string even?) => "even?"
-  (readable/fn-string (fn [])) => "<custom-predicate>"
-  (readable/fn-string :key) => ":key"
-  (readable/fn-string #'even?) => "even?"
+(fact "the way functions print by default"
+  (type! :X {:x even?
+             :y (complement even?)})

-  (let [f ( ( (fn [a] (fn [b] (fn [c] (+ a b c)))) 1) 2)]
-    (readable/fn-string f) => "<custom-predicate>")
-
-  (let [f ( ( (fn [a] (fn [b] (fn my:tweedle-dum [c] (+ a b c)))) 1) 2)]
-    (readable/fn-string f) => "my:tweedle-dum"))
-
+  (check-for-explanations :X {:x 1 :y 2})
+  => (just (err:shouldbe :x "even?" 1)
+           (err:shouldbe :y "<custom-predicate>" 2)))


This test doesn't even use messaging.

This test doesn't even use messaging.

--- integration-tests/apps/jobs/test/jobs/at.clj
+++ integration-tests/apps/jobs/test/jobs/at.clj
@@ -16,10 +16,8 @@
 ;; 02110-1301 USA, or see the FSF site: http://www.fsf.org.

 (ns jobs.at
-  (:use clojure.test
-        jobs.helper)
-  (:require [immutant.jobs :as job]
-            [immutant.messaging :as msg])
+  (:use clojure.test)
+  (:require [immutant.jobs :as job])
   (:import java.util.Date))

 (defmacro with-job [action spec & body]


Include clojure-commons

Include clojure-commons

--- src/midje/data/project_state.clj
+++ src/midje/data/project_state.clj
@@ -1,5 +1,6 @@
 (ns ^{:doc "What we know about the changing project file/namespace tree."}
   midje.data.project-state
+  (:use commons.clojure.core)
   (:require [midje.emission.boundaries :as emission-boundary]
             [midje.util.ecosystem :as ecosystem]
             [midje.emission.colorize :as color]


Remove old HornetQ log message.

Remove old HornetQ log message.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -494,7 +494,7 @@

 (dire/with-post-hook! #'inject-batch-resources
   (fn [{:keys [onyx.core/id onyx.core/lifecycle-id]}]
-    (taoensso.timbre/trace (format "[%s / %s] Created new tx session" id lifecycle-id))))
+    (taoensso.timbre/trace (format "[%s / %s] Started a new batch" id lifecycle-id))))

 (dire/with-post-hook! #'read-batch
   (fn [{:keys [onyx.core/id onyx.core/batch onyx.core/lifecycle-id]}]


CMR-3496 Update documentation strings

CMR-3496 Update documentation strings

--- search-app/src/cmr/search/api/community_usage_metrics.clj
+++ search-app/src/cmr/search/api/community_usage_metrics.clj
@@ -1,5 +1,7 @@
 (ns cmr.search.api.community-usage-metrics
-  "Defines the API for humanizer in the CMR."
+  "Defines the API for community usage metrics in the CMR. Community usage metrics come from the EMS
+   as a CSV and are stored in the CMR as JSON with the humanizers. The metrics are used for relevancy
+   scoring based on popularity."
   (:require
    [cheshire.core :as json]
    [cmr.acl.core :as acl]
@@ -11,7 +13,7 @@
    [compojure.route :as route]))

 (defn- community-usage-metrics-response
-  "Creates a successful humanizer response with the given data response"
+  "Creates a successful community usage metrics response with the given data response"
   [status-code data]
   {:status status-code
    :body (json/generate-string data)


Rename pipeline state.

Rename pipeline state.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -93,8 +93,8 @@

 (defn munge-seal-resource
   [{:keys [onyx.core/sync onyx.core/exhaust-node onyx.core/seal-node
-           onyx.core/blocked?] :as event}]
-  (if (:try-seal? @blocked?)
+           onyx.core/pipeline-state] :as event}]
+  (if (:try-seal? @pipeline-state)
     (merge event {:onyx.core/sealed? false})
     (let [seal-response-ch (chan)]
       (extensions/on-change sync seal-node #(>!! seal-response-ch %))
@@ -103,18 +103,18 @@
         (let [path (:path response)
               seal? (extensions/read-node sync path)]
           (if seal?
-            (do (swap! blocked? assoc :try-seal? true :seal? true)
+            (do (swap! pipeline-state assoc :try-seal? true :seal? true)
                 (merge event
                        (p-ext/seal-resource event)
                        {:onyx.core/sealed? true}))
-            (do (swap! blocked? assoc :try-seal? true :seal? false)
+            (do (swap! pipeline-state assoc :try-seal? true :seal? false)
                 (merge event {:onyx.core/sealed? false}))))))))

 (defn munge-complete-task
   [{:keys [onyx.core/sync onyx.core/completion-node
-           onyx.core/cooldown-node onyx.core/blocked? onyx.core/sealed?]
+           onyx.core/cooldown-node onyx.core/pipeline-state onyx.core/sealed?]
     :as event}]
-  (let [state @blocked?]
+  (let [state @pipeline-state]
     (if (or (:complete? state) (not (:try-seal? state)))
       (assoc event :onyx.core/complete-success? false)
       (let [complete-response-ch (chan)]
@@ -124,7 +124,7 @@
           (let [path (:path response)
                 result (extensions/read-node sync path)]
             (if (:completed? result)
-              (do (swap! blocked? assoc :complete? true)
+              (do (swap! pipeline-state assoc :complete? true)
                   (merge event {:onyx.core/complete-success? true}))
               (merge event {:onyx.core/complete-success? true}))))))))

@@ -297,7 +297,7 @@
                          :onyx.core/params (or (get (:fn-params opts) task) [])
                          :onyx.core/queue queue
                          :onyx.core/sync sync
-                         :onyx.core/blocked? (atom {:try-seal? false :seal? false :complete? false})}
+                         :onyx.core/pipeline-state (atom {:try-seal? false :seal? false :complete? false})}

           pipeline-data (assoc pipeline-data :onyx.core/queue (extensions/optimize-concurrently queue pipeline-data))
           pipeline-data (merge pipeline-data (l-ext/inject-lifecycle-resources* pipeline-data))]


At least print stack trace when :init-ns fails to compile/load (fixes #139)

--- boot/core/src/boot/repl_server.clj
+++ boot/core/src/boot/repl_server.clj
@@ -27,7 +27,9 @@
                     init-ns-sentinel true
                     (var *ns*)       (try (require init-ns)
                                           (create-ns init-ns)
-                                          (catch Throwable t (create-ns 'user)))))
+                                          (catch Throwable t
+                                            (.printStackTrace t)
+                                            (create-ns 'user)))))
            (h msg))))]
     (doto wrap-init-ns'
       ;; set-descriptor! currently nREPL only accepts a var


tidy up formatting

tidy up formatting

--- src/overtone/examples/compositions/auto_dubstep.clj
+++ src/overtone/examples/compositions/auto_dubstep.clj
@@ -44,24 +44,24 @@
 ;; Directly translated to Overtone:

 (demo 60
- (let [bpm 120
-       notes [40 41 28 28 28 27 25 35 78]
-       trig (impulse:kr (/ bpm 120))
-       freq (midicps (lag (demand trig 0 (dxrand notes INF)) 0.25))
-       swr (demand trig 0 (dseq [1 6 6 2 1 2 4 8 3 3] INF))
-       sweep (lin-exp (lf-tri swr) -1 1 40 3000)
-       wob (mix (saw (* freq [0.99 1.01])))
-       wob (lpf wob sweep)
-       wob (* 0.8 (normalizer wob))
-       wob (+ wob (bpf wob 1500 2))
-       wob (+ wob (* 0.2 (g-verb wob 9 0.7 0.7)))
+      (let [bpm     120
+            notes   [40 41 28 28 28 27 25 35 78]
+            trig    (impulse:kr (/ bpm 120))
+            freq    (midicps (lag (demand trig 0 (dxrand notes INF)) 0.25))
+            swr     (demand trig 0 (dseq [1 6 6 2 1 2 4 8 3 3] INF))
+            sweep   (lin-exp (lf-tri swr) -1 1 40 3000)
+            wob     (mix (saw (* freq [0.99 1.01])))
+            wob     (lpf wob sweep)
+            wob     (* 0.8 (normalizer wob))
+            wob     (+ wob (bpf wob 1500 2))
+            wob     (+ wob (* 0.2 (g-verb wob 9 0.7 0.7)))

-       kickenv (decay (t2a (demand (impulse:kr (/ bpm 30)) 0 (dseq [1 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0] INF))) 0.7)
-       kick (* (* kickenv 7) (sin-osc (+ 40 (* kickenv kickenv kickenv 200))))
-       kick (clip2 kick 1)
+            kickenv (decay (t2a (demand (impulse:kr (/ bpm 30)) 0 (dseq [1 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0] INF))) 0.7)
+            kick    (* (* kickenv 7) (sin-osc (+ 40 (* kickenv kickenv kickenv 200))))
+            kick    (clip2 kick 1)

-       snare (* 3 (pink-noise [1 1]) (apply + (* (decay (impulse (/ bpm 240) 0.5) [0.4 2]) [1 0.05])))
-       snare (+ snare (bpf (* 4 snare) 2000))
-       snare (clip2 snare 1)]
+            snare   (* 3 (pink-noise [1 1]) (apply + (* (decay (impulse (/ bpm 240) 0.5) [0.4 2]) [1 0.05])))
+            snare   (+ snare (bpf (* 4 snare) 2000))
+            snare   (clip2 snare 1)]

    (clip2 (+ wob kick snare) 1)))


Small refactor to replace zip/replace with zip/edit.


[STORM-1636] - Supervisor shutdown with worker id pass in being nil

--- storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
+++ storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
@@ -592,7 +592,7 @@
         port->worker-id (clojure.set/map-invert (map-val #((nth % 1) :port) valid-allocated))]
     (doseq [p (set/intersection (set (keys existing-assignment))
                                 (set (keys new-assignment)))]
-      (if (not= (:executors (existing-assignment p)) (:executors (new-assignment p)))
+      (if (not= (set (:executors (existing-assignment p))) (set (:executors (new-assignment p))))
         (shutdown-worker supervisor (port->worker-id p))))))

 (defn ->LocalAssignment


(PDB-5452) Disable postgres jit for all connections

Problems with the jit have been reported with the jit, which was added
in pg 11, and enabled by deafult in 12.  In particular, it can cause
some queries to run *much* more slowly, even in situations where there
don't appear to be many rows involved.

So until the problem is resolved, disable the jit for all pdb
connections, by adding a "set session jit = off;" to the hikaricp
connection init string.

--- src/puppetlabs/puppetdb/jdbc.clj
+++ src/puppetlabs/puppetdb/jdbc.clj
@@ -648,9 +648,14 @@
        ;; level to fail (because the pending transaction already
        ;; includes that select).
        (.setIsolateInternalQueries true))
-     (some->> (when expected-schema
-                (block-on-schema-mismatch expected-schema))
-              (.setConnectionInitSql config))
+     (->> [(when read-only? "set transaction read write;")
+           "update pg_settings set setting = false"
+           "  where name = 'jit';"
+           (when read-only? "set transaction read only;")
+           (when expected-schema
+             (block-on-schema-mismatch expected-schema))]
+          (str/join " ")
+          (.setConnectionInitSql config))
      (when rewrite-batched-inserts
        (.setProperty (.getDataSourceProperties config) "reWriteBatchedInserts" rewrite-batched-inserts))
      (some->> pool-name (.setPoolName config))


Support (hypothetical) PSL entries with '.'-prefixed domains.


Tidy up test logging output

Tidy up test logging output

specifically this output
```
09:17:22.976 [main] ERROR akvo.lumen.import - #error {
 :cause Invalid csv file. Varying number of columns
 :data {}
 :via
 [{:type clojure.lang.ExceptionInfo
   :message Invalid csv file. Varying number of columns
   :data {}
   :at [clojure.core$ex_info invokeStatic core.clj 4739]}]
 :trace
 [[clojure.core$ex_info invokeStatic core.clj 4739]
  [clojure.core$ex_info invoke core.clj 4739]
  [akvo.lumen.import.csv$get_column_count invokeStatic csv.clj 72]
  [akvo.lumen.import.csv$get_column_count invoke csv.clj 68]
  [akvo.lumen.import.csv$csv_importer invokeStatic csv.clj 77]
  [akvo.lumen.import.csv$csv_importer invoke csv.clj 74]
  [akvo.lumen.import.csv$eval9604$fn__9606 invoke csv.clj 100]
  [clojure.lang.MultiFn invoke MultiFn.java 233]
  [akvo.lumen.import$do_import invokeStatic import.clj 79]
  [akvo.lumen.import$do_import invoke import.clj 72]
  [akvo.lumen.test_utils$import_file invokeStatic test_utils.clj 46]
  [akvo.lumen.test_utils$import_file invoke test_utils.clj 34]
  [akvo.lumen.import.csv_test$fn__18292 invokeStatic csv_test.clj 53]
  [akvo.lumen.import.csv_test$fn__18292 invoke csv_test.clj 49]
  [clojure.test$test_var$fn__9209 invoke test.clj 716]
  [clojure.test$test_var invokeStatic test.clj 716]
  [clojure.test$test_var invoke test.clj 707]
  [clojure.test$test_vars$fn__9235$fn__9240 invoke test.clj 734]
  [clojure.test$default_fixture invokeStatic test.clj 686]
  [clojure.test$default_fixture invoke test.clj 682]
  [clojure.test$test_vars$fn__9235 invoke test.clj 734]
  [akvo.lumen.fixtures$error_tracker_fixture invokeStatic fixtures.clj 50]
  [akvo.lumen.fixtures$error_tracker_fixture invoke fixtures.clj 46]
  [clojure.test$compose_fixtures$fn__9203$fn__9204 invoke test.clj 693]
  [akvo.lumen.fixtures$tenant_conn_fixture invokeStatic fixtures.clj 41]
  [akvo.lumen.fixtures$tenant_conn_fixture invoke fixtures.clj 36]
  [clojure.test$compose_fixtures$fn__9203$fn__9204 invoke test.clj 693]
  [clojure.test$default_fixture invokeStatic test.clj 686]
  [clojure.test$default_fixture invoke test.clj 682]
  [clojure.test$compose_fixtures$fn__9203 invoke test.clj 693]
  [clojure.test$compose_fixtures$fn__9203 invoke test.clj 693]
  [clojure.test$test_vars invokeStatic test.clj 730]
  [clojure.test$test_all_vars invokeStatic test.clj 736]
  [clojure.test$test_ns invokeStatic test.clj 757]
  [clojure.test$test_ns invoke test.clj 742]
  [user$eval244$fn__305 invoke form-init3969910229572090698.clj 1]
  [clojure.lang.AFn applyToHelper AFn.java 156]
  [clojure.lang.AFn applyTo AFn.java 144]
  [clojure.core$apply invokeStatic core.clj 659]
  [clojure.core$apply invoke core.clj 652]
  [leiningen.core.injected$compose_hooks$fn__174 doInvoke form-init3969910229572090698.clj 1]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [clojure.core$apply invokeStatic core.clj 657]
  [clojure.core$apply invoke core.clj 652]
  [leiningen.core.injected$run_hooks invokeStatic form-init3969910229572090698.clj 1]
  [leiningen.core.injected$run_hooks invoke form-init3969910229572090698.clj 1]
  [leiningen.core.injected$prepare_for_hooks$fn__179$fn__180 doInvoke form-init3969910229572090698.clj 1]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [clojure.lang.AFunction$1 doInvoke AFunction.java 29]
  [clojure.lang.RestFn invoke RestFn.java 408]
  [clojure.core$map$fn__5587 invoke core.clj 2747]
  [clojure.lang.LazySeq sval LazySeq.java 40]
  [clojure.lang.LazySeq seq LazySeq.java 49]
  [clojure.lang.Cons next Cons.java 39]
  [clojure.lang.RT next RT.java 706]
  [clojure.core$next__5108 invokeStatic core.clj 64]
  [clojure.core$reduce1 invokeStatic core.clj 936]
  [clojure.core$reduce1 invokeStatic core.clj 926]
  [clojure.core$merge_with invokeStatic core.clj 3051]
  [clojure.core$merge_with doInvoke core.clj 3043]
  [clojure.lang.RestFn applyTo RestFn.java 139]
  [clojure.core$apply invokeStatic core.clj 659]
  [clojure.test$run_tests invokeStatic test.clj 767]
  [clojure.test$run_tests doInvoke test.clj 767]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [clojure.core$apply invokeStatic core.clj 657]
  [clojure.core$apply invoke core.clj 652]
  [user$eval244$fn__317$fn__350 invoke form-init3969910229572090698.clj 1]
  [user$eval244$fn__317$fn__318 invoke form-init3969910229572090698.clj 1]
  [user$eval244$fn__317 invoke form-init3969910229572090698.clj 1]
  [user$eval244 invokeStatic form-init3969910229572090698.clj 1]
  [user$eval244 invoke form-init3969910229572090698.clj 1]
  [clojure.lang.Compiler eval Compiler.java 7062]
  [clojure.lang.Compiler eval Compiler.java 7052]
  [clojure.lang.Compiler load Compiler.java 7514]
  [clojure.lang.Compiler loadFile Compiler.java 7452]
  [clojure.main$load_script invokeStatic main.clj 278]
  [clojure.main$init_opt invokeStatic main.clj 280]
  [clojure.main$init_opt invoke main.clj 280]
  [clojure.main$initialize invokeStatic main.clj 311]
  [clojure.main$null_opt invokeStatic main.clj 345]
  [clojure.main$null_opt invoke main.clj 342]
  [clojure.main$main invokeStatic main.clj 424]
  [clojure.main$main doInvoke main.clj 387]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [clojure.lang.Var applyTo Var.java 702]
  [clojure.main main main.java 37]]}
```

--- backend/test/akvo/lumen/import/csv_test.clj
+++ backend/test/akvo/lumen/import/csv_test.clj
@@ -5,6 +5,7 @@
                                          *error-tracker*
                                          error-tracker-fixture]]
             [akvo.lumen.test-utils :refer [import-file]]
+            [akvo.lumen.utils.logging-config :refer [with-no-logs]]
             [clojure.string :as string]
             [clojure.test :refer :all]
             [hugsql.core :as hugsql]))
@@ -50,8 +51,9 @@
   (testing "Should fail to import csv file with varying number of columns"
     (is (thrown-with-msg? clojure.lang.ExceptionInfo
                           #"Invalid csv file. Varying number of columns"
-                          (import-file *tenant-conn* *error-tracker* "mixed-column-counts.csv"
-                                       {:dataset-name "Mixed Column Counts"})))))
+                          (with-no-logs
+                            (import-file *tenant-conn* *error-tracker* "mixed-column-counts.csv"
+                                         {:dataset-name "Mixed Column Counts"}))))))

 (deftest ^:functional test-trimmed-columns
   (testing "Testing if whitespace is removed from beginning & end of column titles"


CMR-1321: Retry failure to create jobs due to race conditions up to 3 times

--- common-lib/src/cmr/common/jobs.clj
+++ common-lib/src/cmr/common/jobs.clj
@@ -138,8 +138,24 @@
     (qt/with-identity (qt/key (str job-key ".trigger")))
     (qt/with-schedule (qcron/daily-at-hour-and-minute hour minute))))

+(defn- try-to-schedule-job
+  "Attempts to schedule a job. Swallows the exception if there is an error. Returns
+  true if the job was successfully scheduled and false otherwise."
+  [scheduler job-key quartz-job trigger]
+  (try
+    ;; We delete existing jobs and recreate them
+    (when (qs/get-job scheduler job-key)
+      (qs/delete-job scheduler (qj/key job-key)))
+    (qs/schedule scheduler quartz-job trigger)
+    true
+    (catch Throwable e
+      (warn e)
+      false)))
+
 (defn- schedule-job
-  "Schedules a quartzite job (stopping existing job first)."
+  "Schedules a quartzite job (stopping existing job first). This can fail due to race conditions
+  with other nodes trying to schedule the job at the same time. We will retry up to 3 times to
+  schedule the job."
   [scheduler system-holder-var-name job]
   (let [{:keys [^Class job-type job-key]} job
         job-key (or job-key (str (.getSimpleName job-type) ".job"))
@@ -148,11 +164,11 @@
                      (qj/using-job-data {"system-holder-var-name" system-holder-var-name})
                      (qj/with-identity (qj/key job-key)))
         trigger (create-trigger job-key job)]
-    (when trigger
-      ;; We delete existing jobs and recreate them
-      (when (qs/get-job scheduler job-key)
-        (qs/delete-job scheduler (qj/key job-key)))
-      (qs/schedule scheduler quartz-job trigger))))
+    (loop [max-tries 3]
+      (when-not (try-to-schedule-job scheduler job-key quartz-job trigger)
+        (if (pos? max-tries)
+          (recur (dec max-tries))
+          (warn (format "All retries to schedule job [%s] failed." job-key)))))))

 (defprotocol JobRunner
   "Defines functions for pausing and resuming jobs"


added re-frame example

added re-frame example

--- resources/leiningen/new/closp/cljs/events.cljs
+++ resources/leiningen/new/closp/cljs/events.cljs
@@ -1,6 +1,6 @@
 (ns {{ns}}.events
   (:require [re-frame.core :as re-frame]
-            [de.sveri.estar.db :as db]))
+            [{{ns}}.db :as db]))

 (re-frame/reg-event-db
  ::initialize-db


Type decl

Type decl

--- ros/angelic_planning/src/ros/robot_actions.clj
+++ ros/angelic_planning/src/ros/robot_actions.clj
@@ -233,7 +233,8 @@
     (while (not @a) (.spinOnce nh)) (reset! a false)
     (doseq [action actions]
       (loop []
-	(let [f (future-call #(try (execute-robot-primitive nh action) false
+	(let [f #^java.util.concurrent.Future
+	        (future-call #(try (execute-robot-primitive nh action) false
 				   (catch Exception e (preempt-arm nh true) (preempt-base nh)
 					  (println "Caught exception" e "; trying again.")
 					  (move-arm-to-state nh (arm-joint-state true "tucked"))


cleanup

cleanup

--- test/babel/test/it.cljc
+++ test/babel/test/it.cljc
@@ -378,9 +378,3 @@
                (map (fn [parse]
                       (get-in parse [:synsem :sem]))
                     (mapcat :parses result))))))))
-
-
-
-
-
-


updated dbvis tests

updated dbvis tests

--- test/src/dda/pallet/dda_managed_ide/domain_test.clj
+++ test/src/dda/pallet/dda_managed_ide/domain_test.clj
@@ -161,7 +161,7 @@
                                     :yed
                                     {:download-url
                                      "https://www.yworks.com/resources/yed/demo/yEd-3.18.1.1.zip",}
-                                    :dbvis {:version "10.0.13"}}
+                                    :dbvis {:version "10.0.15"}}
                              :atom {:plugins ["ink"
                                               "minimap"
                                               "busy-signal"
@@ -210,7 +210,7 @@
                                     :yed
                                     {:download-url
                                      "https://www.yworks.com/resources/yed/demo/yEd-3.18.1.1.zip",}
-                                    :dbvis {:version "10.0.13"}}
+                                    :dbvis {:version "10.0.15"}}
                              :java {:java-default-to
                                     "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java"}
                              :atom {:plugins ["ink"
@@ -268,7 +268,7 @@
                                     :yed
                                     {:download-url
                                      "https://www.yworks.com/resources/yed/demo/yEd-3.18.1.1.zip",}
-                                    :dbvis {:version "10.0.13"}}
+                                    :dbvis {:version "10.0.15"}}
                              :devops {:terraform
                                         {:version "0.11.7",
                                          :sha256-hash
@@ -319,7 +319,7 @@
              :yed
              {:download-url
               "https://www.yworks.com/resources/yed/demo/yEd-3.18.1.1.zip"},
-             :dbvis {:version "10.0.13"}},
+             :dbvis {:version "10.0.15"}},
             :atom
             {:plugins
              ["ink"
@@ -362,7 +362,7 @@
              :yed
              {:download-url
               "https://www.yworks.com/resources/yed/demo/yEd-3.18.1.1.zip"},
-             :dbvis {:version "10.0.13"}},
+             :dbvis {:version "10.0.15"}},
             :atom
             {:plugins
              ["ink"


added llamarse

added llamarse

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -433,6 +433,22 @@
                             :reflexive true
                             :sem subject-semantics}}}})

+   "llamarse"
+   (let [subject-semantics (ref {:human true})
+         subject-agr (ref :top)]
+     {:espanol
+      :synsem {:cat :verb
+               :sem {:pred :be-called
+                     :reflexive true
+                     :subj subject-semantics
+                     :obj subject-semantics}
+               :subcat {:1 {:agr subject-agr
+                            :sem subject-semantics}
+                        :2 {:agr subject-agr
+                            :pronoun true
+                            :reflexive true
+                            :sem subject-semantics}}}})
+
    "me" {:synsem {:cat :noun
                   :pronoun true
                   :reflexive true


Rename image var

Rename image var

--- src/silly_image_store/handler.clj
+++ src/silly_image_store/handler.clj
@@ -8,15 +8,15 @@
 (def images-dir
   (env :base-store-dir))

-(defn image-not-found [image-name]
-  (route/not-found (str "No image '" image-name "' found")))
+(defn image-not-found [image]
+  (route/not-found (str "No image '" image "' found")))

-(defn serve-image [image-name]
-  (let [image-file (store/load-image images-dir image-name)]
-    (or image-file (image-not-found image-name))))
+(defn serve-image [image]
+  (let [image-file (store/load-image images-dir image)]
+    (or image-file (image-not-found image))))

 (defroutes app-routes
-  (GET "/image/:image-name" [image-name] (serve-image image-name))
+  (GET "/image/:image" [image] (serve-image image))
   (route/resources "/")
   (route/not-found "Not Found"))


Fixes bug where workout disapears at the end

--- src/cljs/moon/components.cljs
+++ src/cljs/moon/components.cljs
@@ -152,6 +152,6 @@

 (defcomponent app [data owner]
   (render [_]
-          (if (seq (:workout data))
+          (if (:workout data)
             (->show-workout data)
             (->show-workouts (:workouts data)))))


theatralia.utils: Correct Cmeta Bars

theatralia.utils: Correct Cmeta Bars

Grenada has switched from Extensions to Bars. Adapt to that.

--- src/cljs/theatralia/utils.clj
+++ src/cljs/theatralia/utils.clj
@@ -17,7 +17,7 @@

   See the :voyt.ext/macro-requires in the extension metadata for a list of
   namespaces that have to be required in a namespace where this macro is used."
-  {:grenada.cmeta/extensions {:voyt.ext/requires ['theatralia.thomsky]}}
+  {:grenada.cmeta/bars {:voyt.ext/requires ['theatralia.thomsky]}}
   ([handler-sym] `(register-handler* ~handler-sym []))
   ([handler-sym middleware]
    `(do
@@ -40,7 +40,7 @@

   See the :voyt.ext/macro-requires in the extension metadata for a list of
   namespaces that have to be required in a namespace where this macro is used."
-  {:grenada.cmeta/extensions {:voyt.ext/requires ['re-frame.core]}}
+  {:grenada.cmeta/bars {:voyt.ext/requires ['re-frame.core]}}
   [handler-sym]
   `(do
      (re-frame.core/register-sub ~(keyword handler-sym)


New tests: test-parse-int-zero, test-parse-int-positive, and test-parse-int-negative

--- test/zg/config_test.clj
+++ test/zg/config_test.clj
@@ -39,3 +39,33 @@
 ; Test for function behaviours
 ;

+(deftest test-parse-int-zero
+    "Check the behaviour of function zg.config/parse int."
+    (are [x y] (= x y)
+        0 (parse-int "0")
+        0 (parse-int "00")
+        0 (parse-int "000")
+        0 (parse-int "-0")
+        0 (parse-int "-00")
+        0 (parse-int "-000")))
+
+(deftest test-parse-int-positive-int
+    "Check the behaviour of function zg.config/parse int."
+    (are [x y] (= x y)
+        1          (parse-int "1")
+        2          (parse-int "2")
+        42         (parse-int "42")
+        65535      (parse-int "65535")
+        65536      (parse-int "65536")
+        2147483646 (parse-int "2147483646")))
+
+(deftest test-parse-int-negative-int
+    "Check the behaviour of function zg.config/parse int."
+    (are [x y] (= x y)
+        -1          (parse-int "-1")
+        -2          (parse-int "-2")
+        -42         (parse-int "-42")
+        -65535      (parse-int "-65535")
+        -65536      (parse-int "-65536")
+        -2147483647 (parse-int "-2147483647")))
+


Update snippets-data to latest.

Update snippets-data to latest.

--- snippets-data-3.0.0.clj
+++ snippets-data-3.0.0.clj
@@ -219,7 +219,7 @@
   :name "time-and-date",
   :opts {:settings nil},
   :draw
-  "((q/background 255) (q/fill 0) (doseq [[ind capt fn] [[0 \"millis\" q/millis] [1 \"seconds\" q/seconds] [2 \"minute\" q/minute] [3 \"hour\" q/hour] [4 \"day\" q/day] [5 \"month\" q/month] [6 \"year\" q/year]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
+  "((q/background 255) (q/fill 0) (comment \"iterate through all time-related functions\") (comment \"and print their values\") (doseq [[ind capt fn] [[0 \"millis\" q/millis] [1 \"seconds\" q/seconds] [2 \"minute\" q/minute] [3 \"hour\" q/hour] [4 \"day\" q/day] [5 \"month\" q/month] [6 \"year\" q/year]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
   :setup "()",
   :target :cljs}
  {:fns
@@ -233,7 +233,7 @@
   :name "mouse",
   :opts {:settings nil},
   :draw
-  "((q/background 255) (q/fill 0) (doseq [[ind capt fn] [[0 \"mouse-button\" q/mouse-button] [1 \"mouse-pressed?\" q/mouse-pressed?] [2 \"mouse-x\" q/mouse-x] [3 \"mouse-y\" q/mouse-y] [4 \"pmouse-x\" q/pmouse-x] [5 \"pmouse-y\" q/pmouse-y]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
+  "((q/background 255) (q/fill 0) (comment \"iterate through all mouse-related functions\") (comment \"and print their values\") (doseq [[ind capt fn] [[0 \"mouse-button\" q/mouse-button] [1 \"mouse-pressed?\" q/mouse-pressed?] [2 \"mouse-x\" q/mouse-x] [3 \"mouse-y\" q/mouse-y] [4 \"pmouse-x\" q/pmouse-x] [5 \"pmouse-y\" q/pmouse-y]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
   :setup "()",
   :target :cljs}
  {:fns
@@ -242,7 +242,7 @@
   :name "keyboard",
   :opts {:settings nil},
   :draw
-  "((q/background 255) (q/fill 0) (doseq [[ind capt fn] [[0 \"key-as-keyword\" q/key-as-keyword] [1 \"key-code\" q/key-code] [2 \"key-coded?\" (fn* [] (q/key-coded? (q/raw-key)))] [3 \"key-pressed?\" q/key-pressed?] [4 \"raw-key\" q/raw-key]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
+  "((q/background 255) (q/fill 0) (comment \"iterate through all key-related functions\") (comment \"and print their values\") (doseq [[ind capt fn] [[0 \"key-as-keyword\" q/key-as-keyword] [1 \"key-code\" q/key-code] [2 \"key-coded?\" (fn* [] (q/key-coded? (q/raw-key)))] [3 \"key-pressed?\" q/key-pressed?] [4 \"raw-key\" q/raw-key]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
   :setup "()",
   :target :cljs}
  {:fns ["sqrt"],
@@ -610,12 +610,28 @@
   "((q/camera 200 200 200 0 0 0 0 0 -1) (q/with-translation [100 0 0] (q/box 70)) (q/with-translation [0 100 0] (q/box 70 100 50)))",
   :setup "()",
   :target :cljs}
- {:fns ["looping?"],
+ {:fns ["redraw"],
   :ns "quil.snippets.structure",
-  :name "looping?",
-  :opts {:settings nil},
-  :draw
-  "((q/background 255) (q/fill 0) (q/text (str \"(q/looping?) = \" (q/looping?)) 10 20))",
+  :name "redraw",
+  :opts {:settings nil},
+  :draw
+  "((q/background 255) (q/fill 0) (q/text \"click to move\" 10 20) (q/rect (* (q/frame-count) 10) (+ (* (q/frame-count) 10) 40) 50 50))",
+  :setup "(q/no-loop)",
+  :target :cljs}
+ {:fns ["no-loop" "start-loop" "looping?"],
+  :ns "quil.snippets.structure",
+  :name "no-loop-start-loop",
+  :opts {:settings nil},
+  :draw
+  "((q/background 255) (q/fill 0) (comment \"pause sketch on every 10th frame\") (when (zero? (rem (q/frame-count) 10)) (q/no-loop) (q/text \"paused, click to unpause\" 10 20)) (q/text (str \"(q/looping?) = \" (q/looping?)) 10 40) (q/text (str \"frame: \" (q/frame-count)) 10 60))",
+  :setup "()",
+  :target :cljs}
+ {:fns ["exit"],
+  :ns "quil.snippets.structure",
+  :name "exit",
+  :opts {:settings nil},
+  :draw
+  "((q/background 255) (q/fill 0) (comment \"exit sketch on 50th frame\") (q/text (str \"countdown \" (- 50 (q/frame-count))) 20 20) (when (= 50 (q/frame-count)) (q/exit)))",
   :setup "()",
   :target :cljs}
  {:fns ["push-style" "pop-style"],
@@ -631,7 +647,7 @@
   :name "save",
   :opts {:renderer :p3d, :settings nil},
   :draw
-  "((q/camera 150 150 150 0 0 0 0 0 1) (q/box 100) (q/save \"generated/box.png\"))",
+  "((q/camera 150 150 150 0 0 0 0 0 1) (q/box 100) (q/save \"generated/box.png\") (comment \"stop sketch after saving image\") (comment \"otherwise it will show save dialog\") (comment \"on every iteration\") (q/exit))",
   :setup "()",
   :target :cljs}
  {:fns ["point-light"],
@@ -672,7 +688,8 @@
   :opts {:renderer :p3d, :settings nil},
   :draw
   "((if (zero? (.-width (q/state :image))) (q/text \"Loading\" 10 10) (let [gr (q/state :image)] (q/with-translation [50 0] (q/texture gr) (q/plane 200 200)))))",
-  :setup "(q/set-state! :image (q/load-image \"texture.jpg\"))",
+  :setup
+  "(q/set-state! :image (q/load-image \"https://placekitten.com/100/100\"))",
   :target :cljs}
  {:fns ["quadratic-vertex"],
   :ns "quil.snippets.shape.vertex",
@@ -1040,7 +1057,7 @@
   :name "set-state-state",
   :opts {:settings nil},
   :draw
-  "((q/fill 0) (q/text (q/state :text) 10 20) (q/text (str \"Full state: \" (q/state)) 10 40))",
+  "((q/background 255) (q/fill 0) (q/text (q/state :text) 10 20) (q/text (str \"Full state: \" (q/state)) 10 40))",
   :setup "(q/set-state! :text \"I'm state!\" :year (q/year))",
   :target :cljs}
  {:fns ["resize"],
@@ -2613,12 +2630,28 @@
   "((comment \"setup camera\") (q/camera 200 200 200 0 0 0 0 0 -1) (q/no-fill) (comment \"draw box at [0 0 0]\") (q/box 50) (comment \"move positiion by [50 -50 0] and draw box\") (q/apply-matrix 1 0 50 0 1 -50) (q/box 50) (comment \"rotate position and move by [0 50 -50] and draw box\") (let [s (q/sin 1) c (q/cos 1)] (q/apply-matrix 1 0 0 0 0 c s 50 0 (- s) c -50 0 0 0 1)) (q/box 50))",
   :setup "()",
   :target :clj}
- {:fns ["looping?"],
+ {:fns ["redraw"],
   :ns "quil.snippets.structure",
-  :name "looping?",
-  :opts {:settings nil},
-  :draw
-  "((q/background 255) (q/fill 0) (q/text (str \"(q/looping?) = \" (q/looping?)) 10 20))",
+  :name "redraw",
+  :opts {:settings nil},
+  :draw
+  "((q/background 255) (q/fill 0) (q/text \"click to move\" 10 20) (q/rect (* (q/frame-count) 10) (+ (* (q/frame-count) 10) 40) 50 50))",
+  :setup "(q/no-loop)",
+  :target :clj}
+ {:fns ["no-loop" "start-loop" "looping?"],
+  :ns "quil.snippets.structure",
+  :name "no-loop-start-loop",
+  :opts {:settings nil},
+  :draw
+  "((q/background 255) (q/fill 0) (comment \"pause sketch on every 10th frame\") (when (zero? (rem (q/frame-count) 10)) (q/no-loop) (q/text \"paused, click to unpause\" 10 20)) (q/text (str \"(q/looping?) = \" (q/looping?)) 10 40) (q/text (str \"frame: \" (q/frame-count)) 10 60))",
+  :setup "()",
+  :target :clj}
+ {:fns ["exit"],
+  :ns "quil.snippets.structure",
+  :name "exit",
+  :opts {:settings nil},
+  :draw
+  "((q/background 255) (q/fill 0) (comment \"exit sketch on 50th frame\") (q/text (str \"countdown \" (- 50 (q/frame-count))) 20 20) (when (= 50 (q/frame-count)) (q/exit)))",
   :setup "()",
   :target :clj}
  {:fns ["delay"],
@@ -2626,7 +2659,7 @@
   :name "delay",
   :opts {:settings nil},
   :draw
-  "((q/background 127) (q/ellipse (* 5 (q/frame-count)) (* 5 (q/frame-count)) 50 50) (q/delay-frame (rand-int (* 500 (rand-int 4)))))",
+  "((q/background 127) (q/ellipse (* 5 (q/frame-count)) (* 5 (q/frame-count)) 50 50) (comment \"delay frame for random duration between 0 and 2s\") (q/delay-frame (rand-int (* 500 (rand-int 4)))))",
   :setup "()",
   :target :clj}
  {:fns ["push-style" "pop-style"],
@@ -2642,7 +2675,7 @@
   :name "set-state-state",
   :opts {:settings nil},
   :draw
-  "((q/fill 0) (q/text (q/state :text) 10 20) (q/text (str \"Full state: \" (q/state)) 10 40))",
+  "((q/background 255) (q/fill 0) (q/text (q/state :text) 10 20) (q/text (str \"Full state: \" (q/state)) 10 40))",
   :setup "(q/set-state! :text \"I'm state!\" :year (q/year))",
   :target :clj}
  {:fns ["clip" "no-clip"],
@@ -2658,8 +2691,9 @@
   :name "load-shader",
   :opts {:renderer :p2d, :settings nil},
   :draw
-  "((let [gr (q/create-graphics 250 250) path (clojure.java.io/resource \"SimpleShader.glsl\") shd (q/load-shader (.getPath path))] (q/with-graphics gr (q/background 255) (q/fill 255 0 0) (q/triangle 50 30 220 120 20 180)) (q/image gr 0 0) (q/image gr 250 0) (q/shader shd) (q/image gr 0 250) (q/reset-shader) (q/image gr 250 250)))",
-  :setup "()",
+  "((let [gr (q/create-graphics 250 250) shd (q/state :shader)] (when (q/loaded? shd) (q/with-graphics gr (q/background 255) (q/fill 255 0 0) (q/triangle 50 30 220 120 20 180)) (q/image gr 0 0) (q/image gr 250 0) (q/shader shd) (q/image gr 0 250) (q/reset-shader) (q/image gr 250 250))))",
+  :setup
+  "(let [path (clojure.java.io/resource \"SimpleShader.glsl\") shd (q/load-shader (.getPath path))] (q/set-state! :shader shd))",
   :target :clj}
  {:fns ["with-graphics"],
   :ns "quil.snippets.rendering",
@@ -2690,7 +2724,7 @@
   :name "save-frame",
   :opts {:renderer :p3d, :settings nil},
   :draw
-  "((q/camera 150 150 150 0 0 0 0 0 1) (q/background 127) (q/with-rotation [(/ (q/frame-count) 10)] (q/box 100)) (q/save-frame) (q/save-frame \"generated/rotating-box-####.png\"))",
+  "((q/camera 150 150 150 0 0 0 0 0 1) (q/background 127) (q/with-rotation [(/ (q/frame-count) 10)] (q/box 100)) (q/save-frame \"generated/rotating-box-####.png\"))",
   :setup "()",
   :target :clj}
  {:fns ["save"],
@@ -2698,7 +2732,7 @@
   :name "save",
   :opts {:renderer :p3d, :settings nil},
   :draw
-  "((q/camera 150 150 150 0 0 0 0 0 1) (q/box 100) (q/save \"generated/box.png\"))",
+  "((q/camera 150 150 150 0 0 0 0 0 1) (q/box 100) (q/save \"generated/box.png\") (comment \"stop sketch after saving image\") (comment \"otherwise it will show save dialog\") (comment \"on every iteration\") (q/exit))",
   :setup "()",
   :target :clj}
  {:fns ["begin-raw" "end-raw"],
@@ -2714,7 +2748,7 @@
   :name "time-and-date",
   :opts {:settings nil},
   :draw
-  "((q/background 255) (q/fill 0) (doseq [[ind capt fn] [[0 \"millis\" q/millis] [1 \"seconds\" q/seconds] [2 \"minute\" q/minute] [3 \"hour\" q/hour] [4 \"day\" q/day] [5 \"month\" q/month] [6 \"year\" q/year]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
+  "((q/background 255) (q/fill 0) (comment \"iterate through all time-related functions\") (comment \"and print their values\") (doseq [[ind capt fn] [[0 \"millis\" q/millis] [1 \"seconds\" q/seconds] [2 \"minute\" q/minute] [3 \"hour\" q/hour] [4 \"day\" q/day] [5 \"month\" q/month] [6 \"year\" q/year]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
   :setup "()",
   :target :clj}
  {:fns
@@ -2728,7 +2762,7 @@
   :name "mouse",
   :opts {:settings nil},
   :draw
-  "((q/background 255) (q/fill 0) (doseq [[ind capt fn] [[0 \"mouse-button\" q/mouse-button] [1 \"mouse-pressed?\" q/mouse-pressed?] [2 \"mouse-x\" q/mouse-x] [3 \"mouse-y\" q/mouse-y] [4 \"pmouse-x\" q/pmouse-x] [5 \"pmouse-y\" q/pmouse-y]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
+  "((q/background 255) (q/fill 0) (comment \"iterate through all mouse-related functions\") (comment \"and print their values\") (doseq [[ind capt fn] [[0 \"mouse-button\" q/mouse-button] [1 \"mouse-pressed?\" q/mouse-pressed?] [2 \"mouse-x\" q/mouse-x] [3 \"mouse-y\" q/mouse-y] [4 \"pmouse-x\" q/pmouse-x] [5 \"pmouse-y\" q/pmouse-y]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
   :setup "()",
   :target :clj}
  {:fns
@@ -2737,7 +2771,7 @@
   :name "keyboard",
   :opts {:settings nil},
   :draw
-  "((q/background 255) (q/fill 0) (doseq [[ind capt fn] [[0 \"key-as-keyword\" q/key-as-keyword] [1 \"key-code\" q/key-code] [2 \"key-coded?\" (fn* [] (q/key-coded? (q/raw-key)))] [3 \"key-pressed?\" q/key-pressed?] [4 \"raw-key\" q/raw-key] [5 \"key-modifiers\" q/key-modifiers]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
+  "((q/background 255) (q/fill 0) (comment \"iterate through all key-related functions\") (comment \"and print their values\") (doseq [[ind capt fn] [[0 \"key-as-keyword\" q/key-as-keyword] [1 \"key-code\" q/key-code] [2 \"key-coded?\" (fn* [] (q/key-coded? (q/raw-key)))] [3 \"key-pressed?\" q/key-pressed?] [4 \"raw-key\" q/raw-key] [5 \"key-modifiers\" q/key-modifiers]]] (q/text (str capt \" \" (fn)) 10 (+ (* 20 ind) 20))))",
   :setup "()",
   :target :clj}
  {:fns ["resize-sketch"],


Update search parsing tests

Update search parsing tests

--- test/braid/test/server/search.clj
+++ test/braid/test/server/search.clj
@@ -15,19 +15,28 @@
   (testing "can properly parse queries"
     (is (= (search/parse-query "#baz")
            {:text ""
-            :tags ["baz"]}))
+            :tags ["baz"]
+            :users ()}))
     (is (= (search/parse-query "#baz #quux")
            {:text ""
-            :tags ["baz" "quux"]}))
+            :tags ["baz" "quux"]
+            :users ()}))
     (is (= (search/parse-query "baz")
            {:text "baz"
-            :tags []}))
+            :tags []
+            :users ()}))
     (is (= (search/parse-query "foo bar #baz quux")
            {:text "foo bar quux"
-            :tags ["baz"]}))
+            :tags ["baz"]
+            :users ()}))
     (is (= (search/parse-query "#foo bar #baz quux")
            {:text "bar quux"
-            :tags ["foo" "baz"]}))))
+            :tags ["foo" "baz"]
+            :users ()}))
+    (is (= (search/parse-query "#foo a @bar #baz quux")
+           {:text "a quux"
+            :tags ["foo" "baz"]
+            :users ["bar"]}))))

 (deftest searching-threads
   (let [[user-1 user-2] (db/run-txns!


remove old todo

remove old todo

--- src/navigator/schema.clj
+++ src/navigator/schema.clj
@@ -5,8 +5,6 @@
   [[:comp {:attrs [[:id-sk :string "Shared key for 3rd parties" :db.unique/identity]
                    [:name :string :indexed] ; not null
                    [:description :string :indexed]
-
-                   ;; TODO: We need a fn here to ensure that #{:name :version} is unique
                    [:version :string]               ; not null
                    [:status :enum [:active :archived :preactive]] ; not null
                    [:tags :ref :many]]


Center share note and better center logo/name in snapshot email.

--- src/oc/email/content.clj
+++ src/oc/email/content.clj
@@ -10,14 +10,16 @@
   [:table {:class "row header"}
     [:tbody
       [:tr
-        [:th {:class "small-6 large-6 first columns"}
-          [:img {:class "float-right logo"
-                 :style "background-color: #ffffff;border: solid 1px rgba(78, 90, 107, 0.2);"
-                 :height "50"
-                 :width "50"
-                 :src (:logo snapshot)}]]
-        [:th {:class "small-6 large-6 last columns"}
-          [:h4 {:class "name"} (:name snapshot)]]]]])
+        [:th {:class "small-12 large-12 first last columns"}
+          [:center {:data-parsed ""}
+              [:img {:class "logo float-center"
+                     :alt (str (:name snapshot) " logo")
+                     :style "display: inline; background-color: #ffffff;border: solid 1px rgba(78, 90, 107, 0.2);"
+                     :height "50"
+                     :width "50"
+                     :align "center"
+                     :src (:logo snapshot)}]
+              [:h4 {:class "name float-center" :style "padding-left: 18px; display: inline;"} (:name snapshot)]]]]]])

 (defn- title [snapshot]
   [:table {:class "row header"}
@@ -31,7 +33,7 @@
     [:tbody
       [:tr
         [:th {:class "small-12 large-12 first last columns content"}
-          (:note snapshot)]]]])
+          [:p {:class "text-center content"} (:note snapshot)]]]]])

 (defn- attribution [snapshot]
   (let [author (get-in snapshot [:author :name])
@@ -119,8 +121,10 @@
     [:head
       [:meta {:http-equiv "Content-Type", :content "text/html; charset=utf-8"}]
       [:meta {:name "viewport", :content "width=device-width"}]
-      [:link {:rel "stylesheet", :href "resources/css/foundation.css"}]
-      [:link {:rel "stylesheet", :href "resources/css/opencompany.css"}]
+      [:link {:rel "stylesheet", :href "resources/css/foundation.css"}] ; Regular use
+      [:link {:rel "stylesheet", :href "resources/css/opencompany.css"}] ; Regular use
+      ;[:link {:rel "stylesheet", :href "css/foundation.css"}] ; REPL testing
+      ;[:link {:rel "stylesheet", :href "css/opencompany.css"}] ; REPL testing
       [:link {:href "http://fonts.googleapis.com/css?family=Domine", :rel "stylesheet", :type "text/css"}]
       [:link {:href "http://fonts.googleapis.com/css?family=Open+Sans", :rel "stylesheet", :type "text/css"}]
       (body snapshot)]])


Remove not needed quote.

Remove not needed quote.

--- src/oc/email/content.clj
+++ src/oc/email/content.clj
@@ -48,7 +48,7 @@

 (def digest-weekly-title "Your weekly brief")
 (def digest-daily-title "Your daily brief")
-(def digest-message "Hi %s, here are the new posts to the %s digest.”")
+(def digest-message "Hi %s, here are the new posts to the %s digest.")
 (def digest-message-no-name "Here are the new posts to the %s digest.")
 (def digest-go-to-digest-button "go_to_digest")
 (def digest-read-post-button "read_post")


fixing missing ip

fixing missing ip

--- src/proxmox/provider.clj
+++ src/proxmox/provider.clj
@@ -27,7 +27,7 @@
     [proxmox.model :refer (get-node)]
     [proxmox.validations :refer (validate-provider)]
     [me.raynes.fs :refer (delete-dir temp-dir)]
-    [supernal.sshj :refer (copy ssh-up?)]
+    [supernal.sshj :refer (copy ssh-up? execute)]
     [hypervisors.networking :refer (debian-interfaces gen-ip release-ip mark redhat-network-cfg redhat-ifcfg-eth0)]
     [celestial.persistency :as p])
   (:import clojure.lang.ExceptionInfo))
@@ -120,7 +120,8 @@
     )
   )

-(defn wait-for-ssh [{:keys [ip_address]} {:keys [user]} timeout]
+(defn wait-for-ssh [ip_address user timeout]
+  {:pre [ip_address user timeout]}
   (wait-for {:timeout timeout}
      #(try
         (ssh-up? {:host ip_address :port 22 :user user})
@@ -153,13 +154,15 @@
               (prox-delete (str "/nodes/" node "/openvz/" (:vmid ct))))
             (finally
               (when-let [id (extended :system-id)]
-                (release-ip (get-in (p/get-system id) [:machine :ip]) "proxmox")))))
+                (release-ip (p/system-ip id) "proxmox")))))

   (start [this]
          (debug "starting" (:vmid ct))
          (safe
            (prox-post (str "/nodes/" node "/openvz/" (:vmid ct) "/status/start")))
-          (wait-for-ssh network extended [5 :minute]))
+         (let [ip (or (network :ip_address) (p/system-ip (extended :system-id)))]
+            (wait-for-ssh ip (:user extended) [5 :minute]))
+          )

   (stop [this]
         (debug "stopping" (:vmid ct))


Fix the test

Fix the test


Cleaned up should-show-rebuild logic

Cleaned up should-show-rebuild logic

Also if for some future reason the logic covers both rebuild and
cancel, we will now prefer cancel.

[ci skip] because all I changed was a spelling error in the commit message.

--- src-cljs/frontend/components/builds_table.cljs
+++ src-cljs/frontend/components/builds_table.cljs
@@ -54,8 +54,7 @@
 (defn build-row [build owner {:keys [show-actions? show-branch? show-project?]}]
   (let [url (build-model/path-for (select-keys build [:vcs_url]) build)
         raise-build-action! (fn [event] (raise! owner [event (build-model/build-args build)]))
-        should-show-rebuild? (and (#{"timedout" "failed"} (:status build))
-                                  (= "finished" (:lifecycle build)))]
+        should-show-rebuild? (#{"timedout" "failed"} (:outcome build))]
     [:div.build {:class (cond-> [(build-model/status-class build)]
                           (:dont_build build) (conj "dont_build"))}
      [:div.status-area
@@ -67,19 +66,19 @@
       ;; These two cases should be mutually exclusive. Just in case they aren't,
       ;; use a cond so it doesn't try to render both in the same place
       (cond
+        (build-model/can-cancel? build)
+        (build-action
+          {:text "cancel"
+           :loading-text "Cancelling..."
+           :icon "Status-Canceled"
+           :on-click #(raise-build-action! :cancel-build-clicked)})
+
         should-show-rebuild?
         (build-action
           {:text "rebuild"
            :loading-text "Rebuilding..."
            :icon "Rebuild"
            :on-click #(raise-build-action! :retry-build-clicked)})
-
-        (build-model/can-cancel? build)
-        (build-action
-          {:text "cancel"
-           :loading-text "Cancelling..."
-           :icon "Status-Canceled"
-           :on-click #(raise-build-action! :cancel-build-clicked)})

         :else nil)]


FB and Twitter buttons

FB and Twitter buttons

--- src/skidskytte/views.clj
+++ src/skidskytte/views.clj
@@ -1,6 +1,19 @@
 (ns skidskytte.views
   (:require [hiccup.core :as h]
             [hiccup.page :as hp]))
+
+
+(def fb-like-button "

+")
+
+(def tweet-button "Tweeta
+")

 (defn main [name]
   (hp/html5
@@ -9,9 +22,12 @@
      (hp/include-css "/css/custom.css")]
     [:body
      [:div.container
-       [:h1 "Trött på skidskytte?"]
-     [:p "Pröva en annan sätt-ihop-två-sporter-till-en-sport:"]
-     [:p.sport name]
-     [:p.something-else "Det låter trist, jag vill pröva "
-      [:a {:href "/"} "något annat"]]]]))
+       [:div.inner
+        [:h1 "Skidskytteroulette"]
+        [:p "Om du gillar skidskytte så kanske du också gillar"]
+        [:p.sport name]
+        [:p.something-else "Nja, det låter trist, jag vill pröva "
+         [:a {:href "/"} "något annat"]]
+        [:div.fb-like fb-like-button]
+        [:div.tweet-button tweet-button]]]]))


little changes to be consistent with book

--- docs/sc-book/sc-one.clj
+++ docs/sc-book/sc-one.clj
@@ -18,7 +18,7 @@
 ;;///////////// Figure 1.1 Example of additive synthesis
 ;;
 ;;play({
-;;        var sines = 100, speed = 6;
+;;        var sines = 5, speed = 6;
 ;;        Mix.fill(sines,
 ;;        	{arg x;
 ;;        		Pan2.ar(
@@ -34,7 +34,7 @@

 (demo 2 (let [sines 5
-               speed 1000]
+              speed 6]
            (* (mix
                (map #(pan2 (* (sin-osc (* % 100))
                               (max 0 (+ (lf-noise1:kr speed) (line:kr 1 -1 30))))
@@ -75,7 +75,8 @@

 ;;;;;;;;;
-;;page 16
+;;Pages 15-16
+;;(PMOsc.ar(440, MouseY.kr(1, 550), MouseX.kr(1, 15))}.play
 ;;{PMOsc.ar(100, 500, 10, 0, 0.5)}.play
 ;;
 ;;PMOsc isn't an actual ugen, it's actually a pseudo ugen defined for backwards
@@ -97,7 +98,7 @@
 ;;we can use the pm-osc cgen provided by overtone:

 (demo (* 0.5 (pm-osc 100 500 10 0)))
-
+(demo 10 (pm-osc 440 (mouse-y:kr 1 550) (mouse-x:kr 1 15)))

 ;;Page 17


Added cljs-pikaday dependency to the project.

--- app/project.clj
+++ app/project.clj
@@ -19,7 +19,8 @@
                  [com.novemberain/monger "2.0.1"]
                  [clj-time "0.9.0"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
-                 [cljs-http "0.1.31"]]
+                 [cljs-http "0.1.31"]
+                 [cljs-pikaday "0.1.1"]]
   :main ^:skip-aot weather.main
   :target-path "target/%s"
   :profiles {:dev {:resource-paths ["target/dev"]


clean up ol search definitions

clean up ol search definitions

--- pedestal-app/app/src/semtag_web/behavior.clj
+++ pedestal-app/app/src/semtag_web/behavior.clj
@@ -21,7 +21,7 @@
 ;;
 (defn home-deltas []
   [[:transform-enable [:app-model :home :create-url] :create-url [{msg/type :set-value msg/topic [:create-url] (msg/param :value) {}}]]
-   ;; Using add-named-paths creates dynamic focii. With this approach each search result, is
+   ;; Using add-named-paths creates dynamic focii. With this approach each search result is
    ;; navigable via html5 history. Although adding a named path only needs to happen once per unique
    ;; search, the cost of sending an :add-named-paths message is pretty low - just an assoc.
    [:transform-enable [:app-model :home :search] :search [{msg/type :add-named-paths msg/topic msg/app-model (msg/param :name) {} (msg/param :paths) {}}
@@ -46,10 +46,8 @@
 (defn init-all [_]
   [[:node-create [:app-model :all]]])

-(defn init-search [_]
-  [[:node-create [:app-model :search]]])
-
-(defn sub-search [{:keys [new-model]}]
+(defn search-deltas [{:keys [new-model]}]
+  ;; TODO - fix this getting called for more than just :search
   (when (:search new-model)
     [[:node-create [:app-model :search (keyword (str "search-" (hash (sorted-map (:search new-model)))))]]]))

@@ -79,8 +77,7 @@
           {:init init-all}
           [#{[:all-results]} (app/default-emitter [:app-model :all])]

-          ;{:init init-search}
-          [#{[:search]} sub-search]
+          [#{[:search]} search-deltas]
           [#{[:* :search-title] [:* :search-results]} (app/default-emitter [:app-model :search])]

           {:init navbar-deltas}
@@ -90,6 +87,7 @@
            :types [[:app-model :types] [:app-model :navbar]]
            :tag-stats [[:app-model :tag-stats] [:app-model :navbar]]
            :all [[:app-model :all] [:app-model :navbar]]
-           :search [[:app-model :search] [:app-model :home] [:app-model :navbar]]
+           ;; dynamic focii we define with :search transform
+           ;:search-* [[:app-model :search] [:app-model :home] [:app-model :navbar]]
            :default :home}})


Fix ns decl

Fix ns decl

--- test/caesium/crypto/box_test.clj
+++ test/caesium/crypto/box_test.clj
@@ -1,11 +1,11 @@
 (ns caesium.crypto.box-test
   (:require [caesium.crypto.box :as b]
             [caesium.crypto.scalarmult :as s]
+            [caesium.randombytes :as r]
+            [caesium.test-utils :refer [const-test]]
             [caesium.util :as u]
             [caesium.vectors :as v]
-            [caesium.randombytes :as r]
-            [caesium.test-utils :refer [const-test]]
-            [clojure.test :refer [are deftest is testing]]))
+            [clojure.test :refer [deftest is testing]]))

 (const-test
  b/seedbytes 32


Ensure generated ops have right signature.

--- test/smallex/test/generators.clj
+++ test/smallex/test/generators.clj
@@ -1,15 +1,22 @@
 (ns smallex.test.generators
   (:require [simple-check.generators :as gen]
-            [clojure.test :refer :all]))
+            [clojure.test :refer :all]
+            [clojure.pprint :as pprint :refer [pprint]]))

 (defn- set->char-set [s]
-  {:type :char-set :value (apply str s)})
+  (with-meta
+    {:type :char-set :value (apply str s)}
+    {:result :char}))

 (def char-set
   (gen/fmap (comp set->char-set set) (gen/vector gen/char)))

 (defn- string->item-string [s]
-  {:type :string :value s})
+  (with-meta
+    {:type :string :value s}
+    {:result (if (= 1 (count s))
+               :char
+               :string)}))

 (def string
   (gen/fmap string->item-string
@@ -18,17 +25,76 @@
 (defn use-alias [aliases]
   (gen/elements aliases))

-(def op-type
-  (gen/elements [:or :cat :star :plus :opt :not]))
+(def collection-generators [string char-set])

-(defn operation
-  [atom-generators]
-  (fn op [size]
-    (let [smaller-operation (gen/resize (dec size) (gen/sized op))
-          args (cond-> atom-generators
-                       (pos? size) (conj smaller-operation))]
-      (gen/fmap
-       (fn [[op args]]
-         {:type :op, :value op :args args})
-       (gen/tuple op-type
-                  (gen/vector (gen/one-of args) 1 4))))))
+(declare operation)
+
+(defn- operation-generator
+  [{:keys [op max-args type-fn such-that]
+    :or {max-args 4 such-that (constantly true)}}]
+  (gen/sized
+   (fn [size]
+     (let [smaller-ops (gen/resize (dec size) operation)
+           arg-gen (cond-> collection-generators
+                           (pos? size) (conj smaller-ops))]
+       (->> (gen/vector (gen/one-of arg-gen) 1 max-args)
+            (gen/fmap
+             (fn [args]
+               (with-meta {:type :op, :value op, :args args}
+                 {:result (type-fn (map #(-> % meta :result) args))})))
+            (gen/such-that such-that))))))
+
+(def or-op
+  (operation-generator
+   {:op :or
+    :type-fn (fn [args]
+               (if (every? #(= :char %) args)
+                 :char
+                 :string))}))
+
+(def cat-op
+  (operation-generator
+   {:op :cat
+    :type-fn (fn [[f & r]]
+               (if (seq r)
+                 :string
+                 f))}))
+(def star-op
+  (operation-generator
+   {:op :star, :max-args 1, :type-fn (constantly :string)}))
+
+(def plus-op
+  (operation-generator
+   {:op :plus, :max-args 1, :type-fn (constantly :string)}))
+
+(def opt-op
+  (operation-generator
+   {:op :opt, :max-args 1, :type-fn (constantly :string)}))
+
+(def not-op
+  (operation-generator
+   {:op :not, :max-args 1, :type-fn (fn [[f]] f)
+    :such-that #(-> % meta :result (= :char))}))
+
+(def all-op-generators
+  [or-op cat-op star-op plus-op opt-op not-op])
+
+(def operation
+  (gen/sized
+   (fn [size]
+     (let [op-generators (map #(gen/resize size %) all-op-generators)]
+       (gen/one-of op-generators)))))
+
+(defn ppm [obj]
+  (let [orig-dispatch pprint/*print-pprint-dispatch*]
+    (pprint/with-pprint-dispatch
+      (fn [o]
+        (when (meta o)
+          (print "^")
+          (orig-dispatch (meta o))
+          (pprint/pprint-newline :fill))
+        (orig-dispatch o))
+      (pprint obj))))
+
+(deftest ^:examples print-op-result
+  (ppm (gen/sample operation)))


Rename test functions with shorter names


Suppress additional meta printing for unknown types

Fixes #515

--- planck-cljs/src/planck/pprint/data.cljs
+++ planck-cljs/src/planck/pprint/data.cljs
@@ -58,7 +58,7 @@
   (visit-unknown [this x]
     (if (instance? Eduction x)
       (visit this (sequence x))
-      [:text (pr-str x)]))
+      [:text (binding [*print-meta* false] (pr-str x))]))

   (visit-nil [this]
     (wrap-theme :results-font theme "nil"))


Return author-uuid field for contributions response.

--- src/oc/storage/representations/activity.clj
+++ src/oc/storage/representations/activity.clj
@@ -129,17 +129,19 @@
                                                                                :content-type "text/plain"} {})
                  (hateoas/link-map other-sort-rel hateoas/GET other-sort-url {:accept mt/entry-collection-media-type} {}))
                 (hateoas/up-link (org-rep/url org) {:accept mt/org-media-type})
-                (pagination-link org collection-type params activity)])]
+                (pagination-link org collection-type params activity)])
+        base-response (if contributions? {:author-uuid (:author-uuid params)} {})]
     (json/generate-string
-      {:collection {:version hateoas/json-collection-version
-                    :href collection-url
-                    :links links
-                    :total-count (:total-count activity)
-                    :items (map (fn [entry]
-                                  (let [board (first (filterv #(= (:slug %) (:board-slug entry)) boards))
-                                        access-level (access/access-level-for org board user)]
-                                   (render-activity-for-collection org entry
-                                     (entry-rep/comments entry)
-                                     (reaction-res/aggregate-reactions (entry-rep/reactions entry))
-                                     (:access-level access-level) (:user-id user)))) (:activity activity))}}
+      {:collection (merge base-response
+                    {:version hateoas/json-collection-version
+                     :href collection-url
+                     :links links
+                     :total-count (:total-count activity)
+                     :items (map (fn [entry]
+                                   (let [board (first (filterv #(= (:slug %) (:board-slug entry)) boards))
+                                         access-level (access/access-level-for org board user)]
+                                    (render-activity-for-collection org entry
+                                      (entry-rep/comments entry)
+                                      (reaction-res/aggregate-reactions (entry-rep/reactions entry))
+                                      (:access-level access-level) (:user-id user)))) (:activity activity))})}
       {:pretty config/pretty?})))


+comments

+comments


move truncate lower in (generate-all)'s pipeline

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -27,6 +27,8 @@
 ;;(def ^:const randomize-lexemes-before-phrases
   true)

+;; whether to remove [:head] and [:comp] paths from generated trees after generation:
+;; for performance.
 (def ^:const truncate false)

 (declare candidate-parents)
@@ -89,17 +91,18 @@
                                           result))
                                       (cons bolt
                                             (map (fn [path-to-comp]
-                                                   (let [complement (get paths-and-comps path-to-comp)
-                                                         result (assoc-in bolt path-to-comp complement)]
-                                                     (if (= true truncate)
-                                                       (dissoc-paths result [path-to-comp])
-                                                       result)))
+                                                   (let [complement (get paths-and-comps path-to-comp)]
+                                                     (assoc-in bolt path-to-comp complement)))
                                                  paths-to-comps)))]
                           (log/debug (str "generate-all: result: " ((:morph model) result)))
                           result)))
                     bolt-groups)))
      (map #(do-defaults % model)) ;; for each tree, run model defaults.
-     ;; TODO: move truncate here
+
+     (map #(if (= true truncate)
+             (dissoc-paths % [[:head][:comp]])
+             %))
+
      (remove #(= :fail %)))))

 (defn generate


clean up (defn generate)

clean up (defn generate)

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -39,7 +39,7 @@
 ;; FIXME: truncate-children=false (the non-default option) is not propagated through all calls,
 ;; causing trees to be unexpectedly truncated.
 (defn generate
-  "Returns a single expression generated by the given language model, constrained by the given spec."
+  "Return a single expression generated by the given language model, constrained by the given spec."
   [spec language-model
    & {:keys [max-total-depth truncate-children lexicon]
       :or {max-total-depth max-total-depth
@@ -63,16 +63,9 @@
                                                     :max-total-depth max-total-depth
                                                     :truncate-children truncate-children)))]
         (if expression
-          (do
-            (log/debug (str "generate: generated "
-                            (morph-ps expression)
-                            " for spec:" (strip-refs spec)))
-            (log/trace (str "generate: generated "
-                            "'" (morph expression) "';"
-                            " expr spec: "
-                            (unifyc
-                             spec
-                             {:synsem {:sem (strip-refs (get-in expression [:synsem :sem]))}}))))
+          (log/debug (str "generate: generated "
+                          (morph-ps expression)
+                          " for spec:" (strip-refs spec)))
           (log/warn (str "generate: no expression could be generated for spec:" (strip-refs spec))))
         expression))))


remove most pre-checking in (defn candidate-pairs) since number of rules should be minimized and not have :sem or :infl specified.

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -365,15 +365,16 @@
                 (mapfn (fn [rule]
                          (log/trace (str "candidate-parents: testing rule: " (:rule rule)))
                          (if (and (not-fail? (unify (get-in rule [:synsem :cat] :top)
-                                                    (get-in spec [:synsem :cat] :top)))
-                                  (not-fail? (unify (get-in rule [:synsem :infl] :top)
-                                                    (get-in spec [:synsem :infl] :top)))
-                                  (not-fail? (unify (get-in rule [:synsem :sem :tense] :top)
-                                                    (get-in spec [:synsem :sem :tense] :top)))
-                                  (not-fail? (unify (get-in rule [:synsem :modified] :top)
-                                                    (get-in spec [:synsem :modified] :top))))
-                           (unify spec rule)
-                           :fail))
+                                                    (get-in spec [:synsem :cat] :top))))
+                           ;; TODO: add checks for [:synsem :subcat] valence as well as [:synsem :cat].
+                           (do
+                             (log/debug (str "rule: " (:rule rule) " *is* a head candidate for spec:"
+                                             (strip-refs spec)))
+                             (unify spec rule))
+                           (do
+                             (log/trace (str "rule: " (:rule rule) " *is not* a head candidate for spec:"
+                                             (strip-refs spec)))
+                             :fail)))
                        rules))]
     (log/debug (str "candidate-parents for spec: " (strip-refs spec) " : "
                     (string/join "," (map :rule result))))


try to make generate-all a little shorter

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -61,26 +61,22 @@
             (let [paths (find-comp-paths bolt)]
               {:bolt bolt
                :paths paths
-               :comps (map (fn [path]
-                             (lazy-seq (comp-path-to-complements
-                                        bolt path model depth max-depth)))
-                           paths)})))
+               :comps (map #(comp-path-to-complements bolt % model depth max-depth) paths)})))

      (mapcat (fn [{bolt :bolt comps :comps paths :paths}]
                ;; TODO: further flatten this into the overall ->> pipeline
                (map (fn [each-path-through-trellis]
                       {:bolt bolt
                        :paths paths
-                       :comps (zipmap paths each-path-through-trellis)})
+                       :trellis each-path-through-trellis})
                     (apply combo/cartesian-product comps))))

-     (map (fn [{bolt :bolt comps :comps paths :paths}]
+     (map (fn [{bolt :bolt paths :paths trellis :trellis}]
             (cons bolt
                   ;; TODO: further flatten this into the overall ->> pipeline
-                  (map (fn [path-to-comp]
-                         (let [complement (get comps path-to-comp)]
-                           (create-path-in path-to-comp complement)))
-                       paths))))
+                  (map (fn [[path trellis]]
+                         (create-path-in path trellis))
+                       (zipmap paths trellis)))))

      (remove (fn [tree-parts]
                (some #(= :fail %) tree-parts)))


mention @squest for hiccup that seems to work

--- src/belhiccup/pages.clj
+++ src/belhiccup/pages.clj
@@ -12,5 +12,5 @@
      (hp/include-css "/css/foundation.min.css")]
     [:body
      [:center
-      [:h1 "Hellooooww world!"]]]))
+      [:h1 "Helloooow world!"]]]))


more of the api

more of the api

--- src/bitcoinrpc/core.clj
+++ src/bitcoinrpc/core.clj
@@ -24,7 +24,10 @@
       (res "result"))))

-(s/def ::height (s/and integer? #(pos? %) ))
+(def hex-string? (partial re-matches #"[0-9a-fA-F]+"))
+
+(s/def ::height (s/and integer? #(pos? %)))
+(s/def ::hex-string hex-string?)

 (defn help
   ([]
@@ -45,7 +48,12 @@
   `(defn ~name ~(get-description name)
      ([~@args] (btc-rpc ~(str name) ~@args))
      ([~@(butlast args)] (btc-rpc ~(str name) ~@(butlast args)))
-     ))
+     ))
+(defmacro def-rpc-all-opt [name & args]
+  `(defn ~name ~(get-description name)
+     ([~@args] (btc-rpc ~(str name) ~@args))
+     ([] (btc-rpc ~(str name)))
+     ))

 ;;--------RPC calls-----------

@@ -66,11 +74,12 @@

 (s/fdef getblockhash
   :args ::height
-  :ret string?)
+  :ret ::hex-string)
 (def-rpc getblockhash height)

 (s/fdef getblockheader
-  :args (s/alt :verbose (s/cat :hash string?), :choice (s/cat :hash string?, :verbose boolean?)))
+  :args (s/alt :verbose (s/cat :hash string?), :choice (s/cat :hash string?, :verbose boolean?))
+  :ret map?)
 (def-rpc-opt getblockheader hash verbose)

 (s/fdef getchaintips :ret vector?)
@@ -86,7 +95,7 @@
 (def-rpc-opt getrawmempool verbose)
 (def-rpc-opt gettxout txid n include_mempool)

-;(s/def gettxoutproof ["txid",...] ( blockhash )
+(s/fdef gettxoutproof :args (s/alt :verbose (s/cat :txids vector?), :choice (s/cat :txids vector?, :blockhash boolean?)) :ret ::hex-string)
 (def-rpc gettxoutproof txids blockhash)

 (def-rpc gettxoutsetinfo)
@@ -180,7 +189,7 @@
 ;listreceivedbyaddress ( minconf include_empty include_watchonly)
 ;listsinceblock ( "blockhash" target_confirmations include_watchonly)
 ;listtransactions ( "account" count skip include_watchonly)
-;listunspent ( minconf maxconf  ["addresses",...] [include_unsafe] )
+(def-rpc-all-opt listunspent minconf maxconf  addresses include_unsafe)
 ;lockunspent unlock ([{"txid":"txid","vout":n},...])
 ;move "fromaccount" "toaccount" amount ( minconf "comment" )
 (def-rpc removeprunedfunds txid)
@@ -195,8 +204,7 @@
 ;;--------------------------------

-(defn get-block-hashes []
-  (map (partial btc-rpc "getblockhash") (range (btc-rpc "getblockcount"))))
+(defn get-block-hashes [] (map getblockhash (range (getblockcount))))

 (defn block-of [block-hash] (getblock block-hash))