merging in mac fixes

merging in mac fixes

--- src/overtone/sc.clj
+++ src/overtone/sc.clj
@@ -1,12 +1,11 @@
 (ns overtone.sc
- (:import
+ (:import
      (java.net InetSocketAddress)
      (java.util.regex Pattern)
      (java.util.concurrent TimeUnit TimeoutException)
      (java.io BufferedInputStream))
-  (:require [overtone.log :as log]
-     [clojure.zip :as zip])
-  (:use
+  (:require [overtone.log :as log])
+  (:use
      clojure.contrib.shell-out
      clojure.contrib.seq-utils
      clj-backtrace.repl
@@ -17,7 +16,7 @@
 ; TODO: Make this work correctly
 ; NOTE: "localhost" doesn't work, at least on my laptopt
 (def SERVER-HOST "127.0.0.1")
-(def SERVER-PORT nil) ; nil means a random port
+(def SERVER-PORT nil) ; nil means a random port

 ; Max number of milliseconds to wait for a reply from the server
 (def REPLY-TIMEOUT 300)
@@ -37,16 +36,16 @@
 (defmacro defcounter [counter-name start-id]
   (let [next-fn (symbol (str "next-" (name counter-name) "-id"))]
     `(do
-       (dosync
+       (dosync
          (alter *counters assoc ~counter-name (ref ~start-id))
          (alter *counter-defaults assoc ~counter-name ~start-id))
-       (defn ~next-fn []
-         (dec
+       (defn ~next-fn []
+         (dec
            (dosync (alter (~counter-name @*counters) inc)))))))

 (defn reset-id-counters []
   (doseq [[cname counter] @*counters]
-    (dosync
+    (dosync
     (ref-set counter (cname @*counter-defaults)))))

 (defcounter :group START-GROUP-ID)
@@ -58,13 +57,13 @@

 (declare boot)

-(defn snd
-  "Creates an OSC message and either sends it to the server immediately
+(defn snd
+  "Creates an OSC message and either sends it to the server immediately
   or if a bundle is currently being formed it adds it to the list of messages."
   [path & args]
   (if (nil? @server*)
     (throw (Exception. "Not connected to a SuperCollider server.")))
-      (osc-snd-msg @server*
+      (osc-snd-msg @server*
                    (apply osc-msg path (osc-type-tag args) args)))

 (defmacro at
@@ -76,7 +75,7 @@
   [path & [timeout]]
   (osc-recv @server* path timeout))

-(defn connect
+(defn connect
   ([] (connect SERVER-HOST SERVER-PORT))
   ([host port]
    (log/info "(connect " host ":" port)
@@ -120,7 +119,7 @@
 ; Wait until SuperCollider has completed all asynchronous commands currently in execution.
 (defn wait-sync [& [timeout]]
   (let [sync-id (rand-int 999999)
-        _ (snd "/sync" sync-id)
+        _ (snd "/sync" sync-id)
         reply (osc-recv @server* "/synced" (if timeout timeout REPLY-TIMEOUT))
         reply-id (first (:args reply))]
     (= sync-id reply-id)))
@@ -136,7 +135,7 @@

 (defn- boot-thread [cmd]
   (reset! running?* true)
-  (let [proc (.exec (Runtime/getRuntime) cmd)
+  (let [proc (.exec (Runtime/getRuntime) cmd)
         in-stream (BufferedInputStream. (.getInputStream proc))
         err-stream (BufferedInputStream. (.getErrorStream proc))
         read-buf (make-array Byte/TYPE 256)]
@@ -146,40 +145,45 @@
       (Thread/sleep 250))
     (.destroy proc)))

-(defn connect-jack-ports
+(defn connect-jack-ports
   "Maybe this isn't necessary, since we can use the SC_JACK_DEFAULT_OUTPUTS
   environment variable..."
   [n-channels]
   (let [port-list (sh "jack_lsp")
         sc-outputs (re-find #"SuperCollider.*:out_" port-list)]
   (doseq [i (range n-channels)]
-    (sh "jack_connect"
+    (sh "jack_connect"
         (str sc-outputs (+ i 1))
         (str "system:playback_" (+ i 1))))))

 (def SC-PATHS {:linux "scsynth"
                :windows "C:/Program Files/SuperCollider/scsynth.exe"
-               :mac "scsynth"})
+               :mac  "/Applications/SuperCollider/scsynth" })
+
+(def SC-ARGS  {:linux []
+               :windows []
+               :mac   ["-U" "/Applications/SuperCollider/plugins"] })

 (def SC-PATH (SC-PATHS (config :os)))
+(def SC-ARG (SC-ARGS (config :os)))

 (defn boot
   ([] (boot SERVER-HOST SERVER-PORT))
   ([host port]
-   (if (not @running?*)
-     (let [port (if (nil? port) (+ (rand-int 50000) 2000) port)
-           cmd (into-array String [SC-PATH "-u" (str port)])
-           sc-thread (Thread. #(boot-thread cmd))]
-       (.setDaemon sc-thread true)
-       (log/info "Booting SuperCollider server (scsynth)...")
-       (.start sc-thread)
-       (dosync (ref-set server-thread* sc-thread))
-       (Thread/sleep 1000)
-       (log/info "Connecting to server...")
-       (connect host port)
-       (log/info "status check: " (status))))))
-
-(defn quit
+  (if (not @running?*)
+    (let [port (if (nil? port) (+ (rand-int 50000) 2000) port)
+          cmd (into-array String (concat [SC-PATH "-u" (str port)] SC-ARG))
+          sc-thread (Thread. #(boot-thread cmd))]
+      (.setDaemon sc-thread true)
+      (log/info "Booting SuperCollider server (scsynth)...")
+      (.start sc-thread)
+      (dosync (ref-set server-thread* sc-thread))
+      (Thread/sleep 1000)
+      (log/info "Connecting to server...")
+      (connect host port)
+      (log/info "status check: " (status))))))
+
+(defn quit
   "Quit the SuperCollider synth process."
   []
   (log/info "quiting supercollider")
@@ -191,7 +195,7 @@
 (defn notify [& [notify?]]
   (snd "/notify" (if (false? notify?) 0 1)))

-; Synths, Busses, Controls and Groups are all Nodes.  Groups are linked lists,
+; Synths, Busses, Controls and Groups are all Nodes.  Groups are linked lists
 ; and group zero is the root of the graph.  Nodes can be added to a group in
 ; one of these 5 positions relative to either the full list, or a specified node.
 (def POSITION
@@ -211,7 +215,7 @@
     (apply snd "/s_new" synth-name id position target args)
     id))

-(defn node-free
+(defn node-free
   "Instantly remove a node from the graph."
   [node-id & node-ids]
   (apply snd "/n_free" node-id node-ids))
@@ -240,7 +244,7 @@

 ; This can be extended to support setting multiple ranges at once if necessary...
 (defn node-control-range
-  "Set a range of controls all at once, or if node-id is a group control
+  "Set a range of controls all at once, or if node-id is a group control
   all nodes in the group."
   [node-id ctl-start & ctl-vals]
   (apply snd "/n_setn" node-id ctl-start (count ctl-vals) ctl-vals))
@@ -250,7 +254,7 @@
   [node-id & names-busses]
   (apply snd "/n_map" node-id names-busses))

-(defn group
+(defn group
   "Create a new group as a child of the target group."
   [position target-id]
   (let [id (next-group-id)]
@@ -262,24 +266,24 @@
   [group-id & group-ids]
   (apply node-free group-id group-ids))

-(defn node-free
+(defn node-free
   "Instantly remove a node from the graph."
   [node-id & node-ids]
   (apply snd "/n_free" node-id node-ids))

-(defn post-tree
+(defn post-tree
   "Posts a representation of this group's node subtree, i.e. all the groups and
   synths contained within it, optionally including the current control values
   for synths."
   [id & [with-args?]]
   (snd "/g_dumpTree" id with-args?))
-
+
 ;/g_queryTree				get a representation of this group's node subtree.
 ;	[
 ;		int - group ID
 ;		int - flag: if not 0 the current control (arg) values for synths will be included
 ;	] * N
-;
+;
 ; Request a representation of this group's node subtree, i.e. all the groups and
 ; synths contained within it. Replies to the sender with a /g_queryTree.reply
 ; message listing all of the nodes contained within the group in the following
@@ -313,17 +317,17 @@
         (set! *data* new-data)
         {:synth sname
          :controls ctls})
-      (do
+      (do
         (set! *data* (next *data*))
         {:synth sname}))))

 (defn- parse-node-tree-helper [ctls?]
   (let [[id n-children & new-data] *data*]
     (set! *data* new-data)
-    (cond
+    (cond
       (neg? n-children) (parse-synth-tree ctls?) ; synth
       (= 0 n-children) {:group id :children nil}
-      (pos? n-children)
+      (pos? n-children)
       {:group id
        :children (doall (map (fn [i] (parse-node-tree-helper ctls?)) (range n-children)))})))

@@ -336,7 +340,7 @@
 ; Thus child nodes (those contained within a group) are listed immediately
 ; following their parent. See the method Server:queryAllNodes for an example of
 ; how to process this reply.
-(defn node-tree
+(defn node-tree
   "Returns a data structure representing the current arrangement of groups and synthesizer
   instances residing on the audio server."
   [id & [ctls?]]
@@ -345,22 +349,22 @@
     (let [tree (:args (osc-recv @server* "/g_queryTree.reply" REPLY-TIMEOUT))]
       (parse-node-tree tree))))

-(defn prepend-node
+(defn prepend-node
   "Add a node to the end of a group list."
   [g n]
   (snd "/g_head" g n))

-(defn append-node
+(defn append-node
   "Add a node to the end of a group list."
   [g n]
-  (snd "/g_tail" g n))
+  (snd "/g_tail" g n))

 (defn group-clear
   "Free all child synth nodes in a group."
   [group-id]
   (snd "/g_freeAll" group-id))

-(defn clear-msg-queue
+(defn clear-msg-queue
   "Remove any scheduled OSC messages from the run queue."
   []
   (snd "/clearSched"))
@@ -371,7 +375,7 @@
   (recv "/synced"))

 ; size is in samples
-(defn buffer
+(defn buffer
   "Allocate a new buffer for storing audio data."
   [size]
   (let [id (next-buffer-id)]
@@ -390,13 +394,13 @@
 (defn buffer-write [buf start len data]
   (snd "/b_setn" (:id buf) start len data))

-(defn save-buffer
+(defn save-buffer
   "Save the float audio data in an audio buffer to a wav file."
   [buf path]
   (assert (buffer? buf))
   (snd "/b_write" (:id buf) path "wav" "float"))
-
-(defn load-sample
+
+(defn load-sample
   "Load a wav file into memory so it can be played as a sample."
   [path]
   (let [id (next-buffer-id)]
@@ -409,7 +413,7 @@
 (defn sample? [s]
   (and (map? s) (= :sample (:type s))))

-(defn load-synth
+(defn load-synth
   "Load a Clojure synth definition onto the audio server."
   [sdef]
   (assert (synthdef? sdef))
@@ -420,7 +424,7 @@
   [path]
   (snd "/d_recv" (synthdef-bytes (synthdef-read path))))

-(defn reset
+(defn reset
   "Clear all synthesizers, groups and pending messages from the audio server."
   []
   (try
@@ -437,11 +441,11 @@
     (do
       (log/level :debug)
       (snd "/dumpOSC" 1))
-    (do
+    (do
       (log/level :error)
       (snd "/dumpOSC" 0))))

-(defn restart
+(defn restart
   "Reset everything and restart the SuperCollider process."
   []
   (reset)
@@ -450,7 +454,7 @@

 ; Turn hit into a multimethod
 ; Convert samples to be a map object instead of an ID
-(defn hit
+(defn hit
   "Fire off a synth or sample at a specified time.
   These are the same:
       (hit :kick)
@@ -465,7 +469,7 @@
   ([] (hit (now) "sin" :pitch (+ 30 (rand-int 40))))
   ([& args]
    (let [[time-ms synth args] (if (= Long (type (first args)))
-                                [(first args) (second args) (nnext args)]
+                                [(first args) (second args) (nnext args)]
                                 [(now) (first args) (next args)])
          id (next-node-id)
          synth (cond
@@ -473,7 +477,7 @@
                  (sample? synth) synth
                  (keyword? synth) (name synth)
                  (string? synth) synth
-                 :default (throw
+                 :default (throw
                             (Exception. "Hit doesn't know how to play the given synth: " synth)))
          args (-> args (stringify) (floatify))]
      (if (sample? synth)
@@ -492,18 +496,18 @@

 (defn ctl
   "Modify synth parameters, optionally at a specified time.
-
-  (hit :sin :pitch 50) => 1000
+
+  (hit :sin :pitch 50) => 1000
   (ctl 1000 :pitch 40)
   (ctl (+ (now) 2000) 1000 :pitch 60)
-
+
   "
   [& args]
   (let [[time-ms synth-id ctls] (if (odd? (count args))
                                     [(now) (first args) (next args)]
                                     [(first args) (second args) (drop 2 args)])]
     (println time-ms synth-id ": " ctls)
-    (at time-ms
+    (at time-ms
         (apply node-control synth-id (stringify ctls)))))

 (defn kill
@@ -512,9 +516,9 @@
   a handle for the synth node that was created.
       (let [handle (hit :sin)] ; returns => synth-handle
         (kill (+ 1000 (now)) handle))
-
+
       ; a single handle without a time kills immediately
-      (kill handle)
+      (kill handle)

       ; or a seq of synth handles can be removed at once
       (kill (+ (now) 1000) [(hit) (hit) (hit)])
@@ -523,7 +527,7 @@
   (let [[time-ms ids] (if (= 1 (count args))
                         [(now) (flatten args)]
                         [(first args) (flatten (next args))])]
-        (at time-ms
+        (at time-ms
             (apply node-free ids))))

 (defn load-instruments []
@@ -540,7 +544,7 @@
 ;;    (dosync (alter *fx conj new-effect))
 ;;    new-effect))
 ;
-;(defn update
+;(defn update
 ;  "Update a voice or standalone synth with new settings."
 ;  [voice & args]
 ;  (let [[names vals] (synth-args (apply hash-map args))


progress

progress

--- src/s7p/core.clj
+++ src/s7p/core.clj
@@ -1,110 +1,124 @@
 (ns s7p.core
   (:require [clojure.data.json :as json]
             [org.httpkit.client :as http]
-            [clojure.core.async :as a]))
+            [clojure.core.async :refer [go go-loop chan close! <! <!! >!]]))

 (def options {:timeout 100
               :keepalive 3000})

-(def urls ["http://dsp-no-bid.compe"])
+(def dsps (atom
+           [{:id "1"
+             :url "http://dsp-no-bid.compe"
+             :winnotice "http://dsp-no-bid.compe"}
+            {:id "2"
+             :url "http://dsp-no-bid.compe"
+             :winnotice "http://dsp-no-bid.compe"}
+            {:id "3"
+             :url "http://dsp-no-bid.compe"
+             :winnotice "http://dsp-no-bid.compe"}
+            {:id "4"
+             :url "http://dsp-no-bid.compe"
+             :winnotice "http://dsp-no-bid.compe"}
+            {:id "5"
+             :url "http://dsp-no-bid.compe"
+             :winnotice "http://dsp-no-bid.compe"}
+            {:id "6"
+             :url "http://dsp-no-bid.compe"
+             :winnotice "http://dsp-no-bid.compe"}
+            {:id "7"
+             :url "http://dsp-no-bid.compe"
+             :winnotice "http://dsp-no-bid.compe"}]))
+
+(def advertisers [{:id "1"} {:id "2"} {:id "3"} {:id "4"}])

 (def request
-  {:id "id"
-   :floorPrice 0.1
-   :site "http://github.com/KeenS"
-   :device "Android"
-   :user "user-1"
-   :test 1})
+  {:req {:id "id"
+    :floorPrice 0.1
+    :site "http://github.com/KeenS"
+    :device "Android"
+    :user "user-1"
+    :test 1}
+   :result [true]})

-(defn validate [{:keys [status body error]}]
-  ;; FIXME: implement
-  (and
-   (= status 200)
-   ;; TODO: treat 204 and the others
+(defn validate [[dsp res]]
+  (let [{:keys [status body error]} @res
+        body (and body (json/read-str body :key-fn keyword))
+        {:keys [id bidPrice advertiserId]} body
+        ret (cond
+              (= status 204) {:nobid "no bid"}

-   (:id body)
-   ;; and string
-
-   (:bidPrice body)
-   ;; and double
-
-   (:advertiserId body)
-   ;; and string
-
-   )
-  {:valid body}
-  )
-
-(defn succeed? [res]
-  ;; FIXME: implement
-  {:valid res}
-  true
-  )
+              (not (= status 200)) {:invalid "not succeed" :status status}

-(defn argmaxes-and-second [default key col]
-  ;; FIXME: implement
-  )
+              body {:invalid "no body"}
+
+              (not id) {:invalid "no id"}
+              (not (instance? String id)) {:invalid "id not string" :id id}
+
+              (not bidPrice) {:invalid "no bid price"}
+              (not (instance? Double bidPrice)) {:invalid "bidPrice not double" :bidPrice bidPrice}
+
+              (not advertiserId) {:invalid "no advertiser id"}
+              (not (instance? String advertiserId)) {:invalid "advertiserId not string" :advertiserId advertiserId}
+              true   {:valid body})]
+    [dsp ret]))
+
+(defn succeed? [[_ res]]
+  (:valid res))
+

 (defn pick-winner-and-second-price [floor-price resps]
-  ;; TODO: second price
-  (->> resps
-       ;; shuffle
-       ;; sort
-       ;; take2
-       (argmaxes-and-second floor-price :bidPrice)
-       ;; branch the size of maxes
-       (rand-nth)))
+  (case  (count resps)
+    ;; TODO: log no contest
+    0 nil
+    1 (let [res (first resps)
+            fp (or floor-price (:bidPrice res))]
+        [res fp])
+    _ (let [[res second-price] (->> (conj {:bidPrice floor-price} resps)
+                             (shuffle)
+                             (take 2))]
+        [res (:bidPrice second-price)])))

-(defn winnotice [request result response]
-  ;; FIXME: implement
+(defn click? [result response]
+  (result (.indexOf advertisers (:advertiserId response))))
+
+(defn winnotice [request result [[dsp response] second-price]]
+  ;; TODO: log
   (println response)
-  (http/post (:winnotic-url response)
-             (assoc merge {:id "id" :price 0.1 :isClick true}))
-  )

-(defn xf [options]
-  (comp
-   (map (fn [url] (http/post url (conj options))))
-   (map (fn [future] @future))
-   (map validate)
-   ;; log validated responses
-   (filter succeed?)
-   (map :res)))
-
-
-
-(defn floor-price [req]
-  ;; FIXME: implement
-  0
-  )
+  (http/post (:winnotice dsp)
+             {:id (:advertiserId response)
+              :price (+ 1 second-price)
+              :isClick (click? result response)}))

 (defn gen-request [n]
-  (let [c (a/chan)]
-    (a/go-loop [i n]
-      (a/>! c request)
+  (let [c (chan)]
+    (go-loop [i n]
+      (>! c request)
       (if (< 0 i)
         (recur (- i 1))
-        (a/close! c)))
+        (close! c)))
     c))

-(defn process [chan]
-  (let [sig (a/chan)]
-   (a/go-loop []
-     (if-let [{:keys [req result]} (a/<! chan)]
-       (do
-         (a/go
-           (some->> (sequence (xf (assoc options :body (json/write-str req)))
-                              urls)
-                    (pick-winner-and-second-price (floor-price req))
-                    ;; log winner
-                    (winnotice req result)))
+(defn process [c]
+  (let [sig (chan)]
+   (go-loop []
+     (if-let [{:keys [req result]} (<! c)]
+       (let [xf (comp
+                 (map (fn [dsp] [dsp (http/post (:url dsp) (assoc options :body (json/write-str req)))]))
+                 (map validate)
+                 ;; TODO: log validated responses
+                 (filter succeed?)
+                 (map (fn [[_ res]] (:valid res))))]
+         (some->> (sequence xf @dsps)
+                  (pick-winner-and-second-price (:floorPrice req))
+                  (winnotice req result))
          (recur))
-       (do
-         (a/close! sig))))))
+       (close! sig)))
+   sig))

 (defn -main []
-  (let [c (gen-request 1)
-        sig (process c)]
-    (println (a/<!! sig))))
+  (time (let [c (gen-request 100)
+         sig (process c)]
+     (<!! sig))))


fix incorrect vec being passed to reset-resources

should be a set

--- src/main/shadow/build/api.clj
+++ src/main/shadow/build/api.clj
@@ -391,7 +391,7 @@
        (vals)
        (filter (macro-test-fn macros))
        (map :resource-id)
-       (into [])))
+       (into #{})))

 (defn reset-resources-using-macros [state macros]
   {:pre [(set? macros)]}


Return the a :role with value :admin from access-level-for.

--- src/oc/storage/api/access.clj
+++ src/oc/storage/api/access.clj
@@ -60,12 +60,11 @@
         org-uuid (:uuid org)
         org-authors (set (:authors org))]
     (cond
+      ;; an admin of this org's team
+      ((set admin) (:team-id org)) {:access-level :author :role :admin}

       ;; a named author of this org
       (org-authors user-id) {:access-level :author}
-
-      ;; an admin of this org's team
-      ((set admin) (:team-id org)) {:access-level :author}

       ;; a team member of this org
       ((set teams) (:team-id org)) {:access-level :viewer}
@@ -74,7 +73,7 @@
       (and
         (seq (board-res/list-boards-by-index conn "org-uuid-access" [[org-uuid "public"]]))
         (not (-> org :content-visibility :disallow-public-board)))
-        {:access-level :public}
+      {:access-level :public}

       ;; no access
       :else false)))
@@ -119,11 +118,11 @@
            (:publisher-board board))
       {:access-level (if (= (str board-res/publisher-board-slug-prefix user-id) (:slug board)) :author :viewer)}

+      ;; an admin of this org's team for this non-private board
+      (and (not= board-access :private) ((set admin) (:team-id org))) {:access-level :author :role :admin}
+
       ;; an org author of this non-private board
       (and (not= board-access :private) (org-authors user-id)) {:access-level :author}
-
-      ;; an admin of this org's team for this non-private board
-      (and (not= board-access :private) ((set admin) (:team-id org))) {:access-level :author}

       ;; a named viewer of this board
       (and (= board-access :private) (board-viewers user-id)) {:access-level :viewer}


CLJS-1178: Compiler does not know Math ns is not not-native

Math functions with static-fns true compilation modes would emit
arity checks or use .call() for invocation. Now they use direct invocation.

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -759,7 +759,7 @@
         opt-not? (and (= (:name info) 'cljs.core/not)
                       (= (ana/infer-tag env (first (:args expr))) 'boolean))
         ns (:ns info)
-        js? (= ns 'js)
+        js? (or (= ns 'js) (= ns 'Math))
         goog? (when ns
                 (or (= ns 'goog)
                     (when-let [ns-str (str ns)]


Indulge naming pedantry

Indulge naming pedantry

--- src/cljs/fatlip/core.cljs
+++ src/cljs/fatlip/core.cljs
@@ -38,12 +38,12 @@
     (map->Node (assoc input :id node-id :layer-id layer-id))))

-(defn- add-p-q-nodes [graph last-node node edge-characters]
+(defn- add-p-q-nodes [graph last-node node characters]
   "When an edge would span more than 2 layers, two helper nodes are created. P nodes
   are placed on the layer following last-node's layer, and q nodes are placed on the
   layer preceding node's layer. Edges are then drawn from last-node -> p node and from
   p node to q node, regardless of the span between the p node and the q node"
-  (let [proto-node {:characters edge-characters}
+  (let [proto-node {:characters characters}
         p-layer-id (inc (:layer-id last-node))
         q-layer-id (dec (:layer-id node))
         p-node (make-node graph p-layer-id proto-node)
@@ -53,33 +53,33 @@
               (update-in [:layers q-layer-id :nodes] conj q-node)
               (update-in [:p] conj p-node)
               (update-in [:q] conj q-node)
-              (add-edge last-node p-node edge-characters)
-              (add-edge p-node q-node edge-characters))]
+              (add-edge last-node p-node characters)
+              (add-edge p-node q-node characters))]
     [g q-node]))

-(defn- add-r-node [graph last-node node edge-characters]
+(defn- add-r-node [graph last-node node characters]
   "R nodes are created to assist in drawing the graph, when an edge skips over a layer.
   In that case, the r node is placed in the intervening layer, and an edge is created
   from last-node to r node"
   (let [r-layer-id (inc (:layer-id last-node ))
-        r-node (make-node graph r-layer-id {:characters edge-characters})
+        r-node (make-node graph r-layer-id {:characters characters})
         g (-> graph
               (update-in [:layers r-layer-id :nodes] conj r-node)
               (update-in [:r] conj r-node)
-              (add-edge last-node r-node edge-characters))]
+              (add-edge last-node r-node characters))]
     [g r-node]))

-(defn- process-edge-characters [graph last-node node edge-characters]
+(defn- process-edge-characters [graph last-node node characters]
   "Create edges and possibly new helper nodes for a set of characters that
   remain together from last-node to node"
   (let [span (- (:layer-id node) (:layer-id last-node))
         [g last-n] (cond
-                    (= span 2) (add-r-node graph last-node node edge-characters)
-                    (> span 2) (add-p-q-nodes graph last-node node edge-characters)
+                    (= span 2) (add-r-node graph last-node node characters)
+                    (> span 2) (add-p-q-nodes graph last-node node characters)
                     :else [graph last-node])]
-    (add-edge g last-n node edge-characters)))
+    (add-edge g last-n node characters)))

 (defn- process-characters


[Fix #66] filters out inlined deps from resolve missing

... candidates

--- src/refactor_nrepl/ns/resolve_missing.clj
+++ src/refactor_nrepl/ns/resolve_missing.clj
@@ -23,8 +23,16 @@
   [candidates]
   (map #(list % (get-type %)) candidates))

+(defn- inlined-dependency? [candidate]
+  (-> candidate str (.startsWith "deps.")))
+
 (defn resolve-missing [{sym :symbol}]
   (when-not (and sym (string? sym) (seq sym))
     (throw (IllegalArgumentException.
             (str "Invalid input to resolve missing: '" sym "'"))))
-  (some->> sym symbol candidates collate-type-info pr-str))
+  (some->> sym
+           symbol
+           candidates
+           (remove inlined-dependency?)
+           collate-type-info
+           pr-str))


Added dependency application-registry on oauth-app component definition


Remove unused mouse event channels

Remove unused mouse event channels

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -43,19 +43,6 @@
   (require-devtools!)
   (s/set-fn-validation! true))

-;; Overcome some of the browser limitations around DnD
-(def mouse-move-ch
-  (chan (sliding-buffer 1)))
-
-(def mouse-down-ch
-  (chan (sliding-buffer 1)))
-
-(def mouse-up-ch
-  (chan (sliding-buffer 1)))
-
-(js/window.addEventListener "mousedown" #(put! mouse-down-ch %))
-(js/window.addEventListener "mouseup"   #(put! mouse-up-ch   %))
-(js/window.addEventListener "mousemove" #(put! mouse-move-ch %))

 (def controls-ch
   (chan))
@@ -89,10 +76,7 @@
                  :api       api-ch
                  :errors    errors-ch
                  :nav       navigation-ch
-                 :ws        ws-ch
-                 :mouse-move {:ch mouse-move-ch}
-                 :mouse-down {:ch mouse-down-ch}
-                 :mouse-up {:ch mouse-up-ch}}))
+                 :ws        ws-ch}))

 (defn log-channels?
   "Log channels in development, can be overridden by the log-channels query param"


log the time a query is updated

log the time a query is updated

So that the client can compare against the timestamps

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -548,6 +548,7 @@
             ]
         (swap! the-query assoc  :records      result-id-vector)
         (swap! the-query assoc  :count        record-count)
+        (swap! the-query assoc  :timestamp    (java.util.Date.))
         ))))


Enabled console print to help in debugging

Added `(enable-console-print!)` so that click events such as the input `:onClick (fn [e] (println "TODO ex 3"))` can be instructive as they now print to console.

--- src/tutorial/untangled_tutorial/B_UI_Exercises.cljs
+++ src/tutorial/untangled_tutorial/B_UI_Exercises.cljs
@@ -3,6 +3,8 @@
   (:require [om.next :as om :refer-macros [defui]]
             [om.dom :as dom]
             [devcards.core :as dc :refer-macros [defcard defcard-doc]]))
+
+(enable-console-print!)

 (defcard-doc


more illustrations of speed improvements with grammar subsets

--- src/babel/italiano/lab.cljc
+++ src/babel/italiano/lab.cljc
@@ -248,10 +248,6 @@
                               :tense :present}
                         :subcat []}})))

-(defn basecamp []
-  (repeatedly
-   #(println (morph (time (with-shrunken-model))))))
-
 (defn svegliarsi []
   (repeatedly
    #(println (pprint
@@ -278,3 +274,31 @@
                 {:m (morph expr)
                  :ps (morph-ps expr)})))))

+(defn with-shrunken-model-2 []
+  (binding [babel.generate/truncate? true
+            babel.generate/println? false
+            babel.generate/index-fn (:index-fn model)
+            babel.generate/morph-ps (:morph-ps model)
+            babel.generate/grammar
+            (filter
+             (fn [rule]
+               (or
+                (= (:rule rule) "s-aux")
+                (= (:rule rule) "noun-phrase1")
+                (= (:rule rule) "noun-phrase2")
+                (= (:rule rule) "nbar1")
+                (= (:rule rule) "nbar2")
+                (= (:rule rule) "vp-pronoun-phrasal")
+                (= (:rule rule) "vp-32")
+                (= (:rule rule) "vp-aux-22-phrasal-comp")))
+             (:grammar model))]
+    (generate {:modified false
+               :root {:italiano {:italiano "chiamarsi"}}
+               :synsem {:cat :verb
+                        :sem {:aspect :progressive
+                              :tense :present}
+                        :subcat []}})))
+
+(defn basecamp []
+  (repeatedly
+   #(println (morph (time (with-shrunken-model-2))))))


Fix some issues with psql store

Fix some issues with psql store

Seems to work fine for now.

--- src/rill/event_store/psql.clj
+++ src/rill/event_store/psql.clj
@@ -1,33 +1,47 @@
 (ns rill.event-store.psql
   (:require [rill.event-store :refer [EventStore]]
+            [rill.event-stream :refer [all-events-stream-id]]
             [clojure.java.jdbc :as sql]
             [rill.message :as message]
-            [miner.tagged :as tagged]))
+            [miner.tagged :as tagged]
+            [clojure.tools.logging :as log]))

 (defrecord PsqlEventStore [spec]
   EventStore
   (retrieve-events-since [this stream-id cursor wait-for-seconds]
-    (or (map (fn [r]
-               (assoc (tagged/read-string (:payload r))
-                 ::message/number (:stream_order r)))
-             (sql/query spec ["SELECT payload, stream_order FROM rill_events WHERE stream_id = ? AND stream_order > ? ORDER BY insert_order ASC" stream-id
-                              (if (number? cursor)
-                                cursor
-                                (or (message/number cursor)
-                                    (throw (ex-info (str "Not a valid cursor: " cursor) {:cursor cursor}))))]))
-        (do (Thread/sleep 1000)
-            nil)))
+    (let [cursor (if (number? cursor)
+                   cursor
+                   (or (message/number cursor)
+                       (throw (ex-info (str "Not a valid cursor: " cursor) {:cursor cursor}))))]
+      (or (seq (map (fn [r]
+                      (with-meta (assoc (tagged/read-string (:payload r))
+                                   ::message/number (or (:insert_order r)
+                                                        (:stream_order r)))
+                        {:cursor (or (:insert_order r)
+                                     (:stream_order r))}))
+                    (if (= stream-id all-events-stream-id)
+                      (sql/query spec ["SELECT payload, insert_order FROM rill_events WHERE insert_order > ? ORDER BY insert_order ASC"
+                                       cursor])
+                      (sql/query spec ["SELECT payload, stream_order FROM rill_events WHERE stream_id = ? AND stream_order > ? ORDER BY insert_order ASC"
+                                       (str stream-id)
+                                       cursor]))))
+          (when (< 0 wait-for-seconds)
+            (Thread/sleep 200)
+            nil))))
+
   (append-events [this stream-id from-version events]
     (try
-      (sql/with-db-transaction [t spec]
-        (doseq [[i e] (map-indexed vector events)]
-          (sql/insert! t "rill_events" {:event_id (message/id e)
-                                        :stream_id stream-id
-                                        :stream_order (+ 1 i from-version)
-                                        :payload (pr-str e)})))
+      (apply sql/db-do-prepared spec "INSERT INTO rill_events (event_id, stream_id, stream_order, payload) VALUES (?, ?, ?, ?)"
+             (map-indexed (fn [i e]
+                            [(str (message/id e))
+                             (str stream-id)
+                             (+ 1 i from-version)
+                            (pr-str e)])
+              events))
       true
       (catch org.postgresql.util.PSQLException e
         nil))))

 (defn psql-event-store [spec]
-  (->PsqlEventStore spec))
+  (let [es (->PsqlEventStore spec)]
+    (assoc es :store es)))


Removing the cache variable for now.

Removing the cache variable for now.

--- storm-core/src/clj/backtype/storm/daemon/nimbus.clj
+++ storm-core/src/clj/backtype/storm/daemon/nimbus.clj
@@ -105,7 +105,6 @@
      :id->sched-status (atom {})
      :cred-renewers (AuthUtils/GetCredentialRenewers conf)
      :nimbus-autocred-plugins (AuthUtils/getNimbusAutoCredPlugins conf)
-     :nimbuses-cache (atom {}) ;;TODO need to figure out how to keep the cache upto date, one more thread
      }))

 (defn inbox [nimbus]


Add support for price on request

Add support for price on request

--- src/catalog/layout/text.clj
+++ src/catalog/layout/text.clj
@@ -64,8 +64,8 @@
     (wrap library-signature "Ausleihe: ")))

 (defn- verkauf
-  [product-number price]
-  (when product-number
+  [{:keys [product-number price price-on-request?]}]
+  (when (or product-number price-on-request?)
     (str "Verkauf: "
          (wrap price "" ". " false)
          (layout/braille-signatures product-number))))
@@ -99,7 +99,7 @@
   [{:keys [creator title subtitles name-of-part source-publisher
            source-date genre-text description producer-brief
            rucksackbuch? rucksackbuch-number
-           library-signature product-number price] :as item}]
+           library-signature] :as item}]
   (join
    (entry-heading-str item)
    (genre-str genre-text)
@@ -108,33 +108,34 @@
      (producer-str producer-brief rucksackbuch-number)
      (producer-str producer-brief))
    (ausleihe library-signature)
-   (verkauf product-number price)))
+   (verkauf item)))

 (defmethod entry-str :musiknoten
   [{:keys [creator title subtitles name-of-part source-publisher
            source-date genre-text description producer-brief
-           library-signature product-number price] :as item}]
+           library-signature] :as item}]
   (join
    (entry-heading-str item)
    (description-str description)
    (producer-str producer-brief)
    (ausleihe library-signature)
-   (verkauf product-number price)))
+   (verkauf item)))

 (defmethod entry-str :taktilesbuch
   [{:keys [creator title subtitles name-of-part source-publisher
            source-date genre-text description producer-brief
-           library-signature product-number price] :as item}]
+           library-signature] :as item}]
   (join
    (entry-heading-str item)
    (description-str description)
    (producer-str producer-brief)
    (ausleihe library-signature)
-   (verkauf product-number price)))
+   (verkauf item)))

 (defmethod entry-str :hörbuch
   [{:keys [genre-text description duration narrators producer-brief
-           produced-commercially? library-signature product-number price] :as item}]
+           produced-commercially? library-signature
+           product-number price price-on-request?] :as item}]
   (join
    (entry-heading-str item)
    (genre-str genre-text)
@@ -144,18 +145,19 @@
      (wrap producer-brief "" ", Hörbuch aus dem Handel")
      (producer-str producer-brief))
    (ausleihe-simple library-signature)
-   (when product-number
-     (str "Verkauf: " product-number ", " price))))
+   (when (or product-number price-on-request?)
+     (str "Verkauf: " (when product-number (str product-number ", ")) price))))

 (defmethod entry-str :grossdruck
-  [{:keys [genre-text description library-signature volumes product-number price] :as item}]
+  [{:keys [genre-text description library-signature volumes
+           product-number price price-on-request?] :as item}]
   (join
    (entry-heading-str item)
    (genre-str genre-text)
    (description-str description)
    (when library-signature
      (str "Ausleihe: " library-signature (wrap volumes ", " " Bd. " false)))
-   (when product-number
+   (when (or product-number price-on-request?)
      (str "Verkauf: " price))))

 (defmethod entry-str :e-book
@@ -180,8 +182,7 @@

 (defmethod entry-str :ludo
   [{:keys [source-publisher genre-text description
-           game-description accompanying-material library-signature
-           product-number price] :as item}]
+           game-description accompanying-material library-signature] :as item}]
   (join
    (entry-heading-str item)
    (wrap source-publisher)
@@ -189,7 +190,7 @@
    (description-str description)
    (wrap game-description)
    (ausleihe library-signature)
-   (verkauf product-number price)))
+   (verkauf item)))

 (defn- level-str [items path path-to-numbers]
   (str


use env not config in handler

use env not config in handler

routes get set up before mount/start, so can't use config yet

--- src/chat/server/handler.clj
+++ src/chat/server/handler.clj
@@ -18,7 +18,6 @@
             [braid.server.routes.api :refer [api-private-routes
                                             api-public-routes]]
             [environ.core :refer [env]]
-            [braid.server.conf :refer [config]]
             ; requiring so mount sees state
             [chat.server.email-digest :refer [email-jobs]]))

@@ -40,7 +39,7 @@

 (defn assoc-cookie-conf [defaults]
   (-> defaults
-      (assoc-in [:session :cookie-attrs :secure] (= (config :environment) "prod"))
+      (assoc-in [:session :cookie-attrs :secure] (= (env :environment) "prod"))
       (assoc-in [:session :cookie-attrs :max-age] (* 60 60 24 7))
       (assoc-in [:session :store] session-store)))


Use POST method to accept strokes from the client

--- src/clj/calc_angle/core.clj
+++ src/clj/calc_angle/core.clj
@@ -176,7 +176,7 @@
            (GET "/set-angle" [a b c] (if (and a b c)
                                        (set-angle a b c)
                                        "/set-angle?a=<base>&b=<large>&c="))
-           (GET "/write-character" _ (write-strokes (calc-angle-seq character-str)))
+           (POST "/write-character" [strokes] (write-strokes (calc-angle-seq strokes)))
            (resources "/")
            (not-found "
not found
"))


don't escape slashes when encoding source map


reboot option added

reboot option added

--- src/clueweb_disqus/main.clj
+++ src/clueweb_disqus/main.clj
@@ -3,9 +3,11 @@
   (:gen-class :main true)
   (:require [clojure.tools.cli :refer [parse-opts]]
             [clueweb-disqus.core :as core]
-            [clueweb-disqus.read-stats :as read-stats]))
+            [clueweb-disqus.read-stats :as read-stats]
+            [clueweb-disqus.recover :as recover]))

-(def options [["-r" "--recover TS" "Timestamp"]
+(def options [["-b" "-reboot" "Reboot the crawl"]
+              ["-r" "--recover TS" "Timestamp"]
               ["-s" "--stats" "Read stats"]])

 (defn -main
@@ -15,4 +17,7 @@
           (core/threads-since (:recover options))

           (:stats options)
-          (read-stats/-main))))
+          (read-stats/-main)
+
+          (:reboot options)
+          (recover/restart-to-recover-jobs))))


Moved message regex util to cmr-common-lib.

--- src/cmr/common/dev/util.clj
+++ src/cmr/common/dev/util.clj
@@ -1,7 +1,8 @@
 (ns cmr.common.dev.util
   "This contains utility functions for development"
   (:require [clojure.java.shell :as sh]
-            [clojure.java.io :as io])
+            [clojure.java.io :as io]
+            [clojure.string :as str])
   (:import java.awt.datatransfer.StringSelection
            java.awt.datatransfer.Clipboard
            java.awt.Toolkit))
@@ -40,3 +41,12 @@
   [s]
   (let [clipboard (.getSystemClipboard (Toolkit/getDefaultToolkit))]
     (.setContents clipboard (StringSelection. s) nil)))
+
+(defn message->regex
+  "Converts an expected message into the a regular expression that matches the exact string.
+  Handles escaping special regex characters"
+  [msg]
+  (-> msg
+      (str/replace #"\[" "\\\\[")
+      (str/replace #"\]" "\\\\]")
+      re-pattern))


add function invoke optimization behind :shadow-tweaks setting

shouldn't be enabled by default since it breaks code that works
in regular CLJS using uncommon patterns.

fixes #783

--- src/main/shadow/build/cljs_hacks.cljc
+++ src/main/shadow/build/cljs_hacks.cljc
@@ -848,15 +848,25 @@

       ;; cases where (thing foo bar) should be invoked directly as thing(foo, bar)
       ;; without going through further CLJS related checks for variadic/IFn support
-      (or (ana/js-tag? ftag)
-          (= 'function ftag)
+      (or (= 'function ftag)
           (:foreign info)
           (let [ns (:ns info)]
             ;; thing resolved to fully qualified ns, invoke as function if no analyzer data is found for ns
             ;; likely means JS namespaces (eg. goog.string, ...)
             (or (= 'js ns)
                 (= 'Math ns)
-                (and ns (not (contains? (::ana/namespaces @env/*compiler*) ns))))))
+                (and ns (not (contains? (::ana/namespaces @env/*compiler*) ns)))))
+          ;; opt-in option to optimize function invoke for known JS types assumed to be functions
+          ;; this breaks stuff when JS objects implement IFn but are ^js tagged
+          ;; (defn do-something [^js thing]
+          ;;   (thing "foo" "bar"))
+          ;; will try to call thing as a regular function only when enabled
+          ;; otherwise will use the usual thing.cljs$invoke$arity2 ? ... : thing.call(null, "foo", "bar")
+          ;; with arg rebinding. could probably be a little smarter about this.
+          ;; mostly want to optimize invokes for JS required code where most of the time it will be a function
+          ;; and very very rarely (never in my code) something that implements IFn
+          (and (:shadow.build/tweaks env)
+               (ana/js-tag? ftag)))
       (make-invoke :fn env form fexpr @args-exprs)

       ;; no further optimizations for development code, always go through .call


remove rogue prn

remove rogue prn

--- src/main/shadow/build/cljs_hacks.cljc
+++ src/main/shadow/build/cljs_hacks.cljc
@@ -227,8 +227,6 @@
                (not (string/includes? sprop "$arity$"))
                ;; set in cljs.core/extend-prefix hack below
                (not (some-> prop meta :shadow/protocol-prop)))
-
-      (prn [:infer-warning target-tag])

       (warning :infer-warning env {:warn-type :target :form form}))


fix release! api fn

fix release! api fn

it is supposed to return the build-state, matching compile!

--- src/main/shadow/cljs/devtools/api.clj
+++ src/main/shadow/cljs/devtools/api.clj
@@ -346,8 +346,7 @@
   ([build opts]
    (with-runtime
      (let [build-config (config/get-build! build)]
-       (release* build-config opts)))
-   :done))
+       (release* build-config opts)))))

 (defn release
   ([build]


Detexified docstrings of context functions

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

--- src/conexp/fca/contexts.clj
+++ src/conexp/fca/contexts.clj
@@ -408,12 +408,12 @@
 ;;; Common Operations with Contexts

 (defn dual-context
-  "Dualizes context ctx, that is $(G,M,I)$ gets $(M,G,I^{-1})$."
+  "Dualizes context ctx, that is (G,M,I) gets (M,G,I^{-1})."
   [ctx]
   (make-context-nc (attributes ctx) (objects ctx) (set-of [m g] [[g m] (incidence ctx)])))

 (defn invert-context
-  "Inverts context ctx, that is $(G,M,I)$ gets $(G,M,(G\\times M)\\setminus I)$."
+  "Inverts context ctx, that is (G,M,I) gets (G,M,(G x M) \\ I)."
   [ctx]
   (make-context-nc (objects ctx) (attributes ctx) (set-of [g m] [g (objects ctx)
                                                                  m (attributes ctx)
@@ -442,9 +442,9 @@

 (defn context-composition
   "Returns context composition of ctx-1 and ctx-2, that is
-  \\[
-      (G_1,M_1,I_1)\\circ(G_2,M_2,I_2) := (G_1,M_2,I_1\\circ I_2).
-  \\]."
+
+    (G_1,M_1,I_1) o (G_2,M_2,I_2) := (G_1,M_2,I_1 o I_2).
+  "
   [ctx-1 ctx-2]
   (make-context-nc (objects ctx-1)
                    (attributes ctx-2)
@@ -458,9 +458,9 @@

 (defn context-apposition
   "Returns context apposition of ctx-1 and ctx-2, that is
-  \\[
-     (G_1,M_1,I_1) | (G_1,M_2,I_2) := (G_1,M_1\\cup M_2,I_1\\cup I_2).
-  \\]"
+
+   (G_1,M_1,I_1) | (G_1,M_2,I_2) := (G_1,M_1 dunion M_2,I_1 dunion I_2).
+  "
   [ctx-1 ctx-2]
   (if (not= (objects ctx-1) (objects ctx-2))
     (illegal-argument "Cannot do context apposition, since object sets are not equal."))
@@ -472,9 +472,11 @@

 (defn context-subposition
   "Returns context subposition of ctx-1 and ctx-2, that is
-  \\[
-     \\frac{(G_1,M_1,I_1)}{(G_2,M_1,I_2)} := (G_1\\cup G_2,M_1,I_1\\cup I_2).
-  \\]"
+
+     (G_1,M_1,I_1)
+    --------------- := (G_1 dunion G_2, M_1, I_1 union I_2).
+     (G_2,M_1,I_2)
+  "
   [ctx-1 ctx-2]
   (if (not= (attributes ctx-1) (attributes ctx-2))
     (illegal-argument "Cannot do context subposition, since attribute sets are not equal."))
@@ -520,17 +522,17 @@
   (make-context base-set base-set =))

 (defn adiag-context
-  "Returns $\\neq$ on base-set as context."
+  "Returns not= on base-set as context."
   [base-set]
   (make-context base-set base-set not=))

 (defn context-sum
   "Computes the context sum of ctx-1 and ctx-2, that is
-  \\begin{multline}
-    (G_1,M_1,I_1) + (G_2,M_2,I_2) := \\\\
-      (G_1\\cup G_2, M_1\\cup M_2, I_1\\cup I_2
-      \\cup (G_1\\times M_2) \\cup (G_2\\times M_1)
-  \\end{multline}
+
+    (G_1,M_1,I_1) + (G_2,M_2,I_2) :=
+      (G_1 dunion G_2, M_1 dunion M_2, I_1 dunion I_2
+       dunion (G_1 x M_2) dunion (G_2 x M_1))
+
   where all set unions are disjoint set unions."
   [ctx-1 ctx-2]
   (let [new-objs (union (set-of [g_1 1] [g_1 (objects ctx-1)])
@@ -551,14 +553,14 @@

 (defn context-product
   "Computes the context product of ctx-1 and ctx-2, that is
-  \\[
-    (G_1,M_1,I_1) \\times (G_2,M_2,I_2) :=
-      (G_1\\times G_2, M_1\\times M_2, \\nabla)
-  \\]
+
+    (G_1,M_1,I_1) x (G_2,M_2,I_2) :=
+      (G_1 x G_2, M_1 x M_2, nabla)
+
   where
-  \\[
-    (g_1,g_2)\\nabla(m_1,m_2) \\iff g_1I_1m_1 \\text{ or } g_2I_2m_2.
-  \\]"
+
+    (g_1,g_2) nabla (m_1,m_2) <=> g_1I_1m_1 or g_2I_2m_2.
+  "
   [ctx-1 ctx-2]
   (let [new-objs (cross-product (objects ctx-1) (objects ctx-2))
         new-atts (cross-product (attributes ctx-1) (attributes ctx-2))
@@ -573,15 +575,15 @@

 (defn context-semiproduct
   "Computes the context semiproduct of ctx-1 and ctx-2, where for
-  contexts $(G_1,M_1,I_1)$ and $(G_2,M_2,I_2)$ their semidirect
-  product is defined as
-  \\[
-    (G_1\\times G_2, M_1\\cup M_2, \\nabla)
-  \\]
+  contexts (G_1,M_1,I_1) and (G_2,M_2,I_2) their semidirect product is
+  defined as
+
+    (G_1 x G_2, M_1 dunion M_2, nabla)
+
   where
-  \\[
-    (g_1,g_2)\\nabla(j,m) \\iff g_jI_jm \\qquad\\text{for $j\\in\\set{1,2}$}.
-  \\]"
+
+    (g_1,g_2) nabla (j,m) <=> g_jI_jm for j in {1,2}.
+  "
   [ctx-1 ctx-2]
   (let [new-objs (cross-product (objects ctx-1) (objects ctx-2))
         new-atts (disjoint-union (attributes ctx-1) (attributes ctx-2))
@@ -594,14 +596,14 @@

 (defn context-xia-product
   "Computes Xia's product of ctx-1 and ctx-2, where for two contexts
-  $(G_1,M_1,I_1)$ and $(G_2,M_2,I_2)$ their Xia product is defined as
-  \\[
-    (G_1\\times G_2, M_1\\times M_2, \\tilde)
-  \\]
+  (G_1,M_1,I_1) and (G_2,M_2,I_2) their Xia product is defined as
+
+    (G_1 x G_2, M_1 x M_2, ~)
+
   where
-  \\[
-    (g_1,g_2) \\tilde (m_1,m_2) \\iff (g_1I_1m_1\\iff g_2I_2m_2).
-  \\]."
+
+    (g_1,g_2) ~ (m_1,m_2) <=> (g_1I_1m_1 <=> g_2I_2m_2).
+  "
   [ctx-1 ctx-2]
   (let [G_1 (objects ctx-1)
         G_2 (objects ctx-2)


Päivitetään tools.reader

Päivitetään tools.reader

--- mtg-pairings-server/project.clj
+++ mtg-pairings-server/project.clj
@@ -2,11 +2,11 @@
   :license {:name "MIT License"
             :url "http://www.opensource.org/licenses/mit-license.php"}
   :dependencies [[org.clojure/clojure "1.8.0"]
-                 [org.clojure/core.cache "0.6.4"]
+                 [org.clojure/core.cache "0.6.5"]
                  [ring "1.2.1"]
                  [ring/ring-core "1.4.0"]
                  [http-kit "2.1.18"]
-                 [org.clojure/tools.reader "1.0.0-alpha3"]
+                 [org.clojure/tools.reader "1.0.0-beta1"]
                  [clj-time "0.11.0"]
                  [korma "0.4.2"]
                  [org.postgresql/postgresql "9.4.1208"]


changed PPP Url in header menu

changed PPP Url in header menu

--- src/statuses/views/common.clj
+++ src/statuses/views/common.clj
@@ -32,7 +32,7 @@
                      [:li.active
                       [:a {"href" "/statuses/updates"} "Statuses"]]
                      [:li
-                      [:a {"href" "https://internal.innoq.com/blogging/"} "PPP"]]]]]]]
+                      [:a {"href" "/blogging/"} "PPP"]]]]]]]
                 [:div.container
                  [:div.row
                   [:div.span10 content]


2nd part day #12

2nd part day #12

--- src/adventofcode1/twelf.clj
+++ src/adventofcode1/twelf.clj
@@ -132,7 +132,11 @@

 (defn main
   ;;([](main (parse-cmds (str/split-lines sample-data)) (init-computer)))
-  ([](main (parse-cmds (str/split-lines puzzle-input-a)) (init-computer)))
+  ;; first puzzle
+  ;;([](main (parse-cmds (str/split-lines puzzle-input-a)) (init-computer)))
+  ;; 2nd puzzle
+  ([](main (parse-cmds (cons "cpy 1 c" (str/split-lines puzzle-input-a)))
+           (init-computer)))
   ([cmds comp]
    (let [{:keys [ip regs]} comp]
      ;; we are finished if there is no more cmds to run


Comment out non-loadable test function.

Comment out non-loadable test function.

--- src/afterglow/transform.clj
+++ src/afterglow/transform.clj
@@ -156,7 +156,7 @@
     (taoensso.timbre/info "Euler transformed:\n" euler-point)
     (taoensso.timbre/info "Equal?" (.equals compound-point euler-point))))

-(defn show-head-positions
+#_(defn show-head-positions
   [fixture-key]
   (map #(select-keys % [:x :y :z]) (:heads ((keyword fixture-key) @(:fixtures afterglow.examples/sample-show)))))


style update

style update

--- src/styles/nossal/simple.cljc
+++ src/styles/nossal/simple.cljc
@@ -63,6 +63,7 @@
      :font-size (em 1.4)
      :max-width "80vw"
      :margin "auto"
+     :margin-bottom (em 1)
      :font-weight 300
      :line-height 1.45455
      :letter-spacing (em 0.016)}


Disabled optimisations to simplify build output.

--- src/cornwalltechjam/web.clj
+++ src/cornwalltechjam/web.clj
@@ -78,7 +78,7 @@
 (def export-dir "build")

 (defn export []
-  (let [assets (optimizations/all (get-assets) {})]
+  (let [assets (optimizations/none (get-assets) {})]
     (stasis/empty-directory! export-dir)
     (optimus.export/save-assets assets export-dir)
     (stasis/export-pages (get-pages) export-dir {:optimus-assets assets})


Make code more Clojure-idiomatic

Make code more Clojure-idiomatic

--- src/cyanite_remover/cli.clj
+++ src/cyanite_remover/cli.clj
@@ -27,22 +27,23 @@
 (defn- usage
   "Construct usage message."
   [options-summary]
-  (->> ["A Cyanite data removal tool"
-        ""
-        "Usage: "
-        "  cyanite-remover [options] remove-metrics <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
-        "  cyanite-remover [options] remove-paths <tenant> <path,...> <elasticsearch_url>"
-        "  cyanite-remover [options] remove-obsolete-data <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
-        "  cyanite-remover [options] remove-empty-paths <tenant> <path,...> <elasticsearch_url>"
-        "  cyanite-remover [options] list-metrics <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
-        "  cyanite-remover [options] list-paths <tenant> <path,...> <elasticsearch_url>"
-        "  cyanite-remover [options] list-obsolete-data <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
-        "  cyanite-remover [options] list-empty-paths <tenant> <path,...> <elasticsearch_url>"
-        "  cyanite-remover help"
-        ""
-        "Options:"
-        options-summary]
-       (str/join \newline)))
+  (str/join
+   \newline
+   ["A Cyanite data removal tool"
+    ""
+    "Usage: "
+    "  cyanite-remover [options] remove-metrics <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
+    "  cyanite-remover [options] remove-paths <tenant> <path,...> <elasticsearch_url>"
+    "  cyanite-remover [options] remove-obsolete-data <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
+    "  cyanite-remover [options] remove-empty-paths <tenant> <path,...> <elasticsearch_url>"
+    "  cyanite-remover [options] list-metrics <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
+    "  cyanite-remover [options] list-paths <tenant> <path,...> <elasticsearch_url>"
+    "  cyanite-remover [options] list-obsolete-data <tenant> <rollup,...> <path,...> <cassandra_host,...> <elasticsearch_url>"
+    "  cyanite-remover [options] list-empty-paths <tenant> <path,...> <elasticsearch_url>"
+    "  cyanite-remover help"
+    ""
+    "Options:"
+    options-summary]))

 (defn- error-msg
   "Combine error messages."
@@ -53,7 +54,7 @@
 (defn- exit
   "Print message and exit with status."
   [status msg]
-  (if (= status 0)
+  (if (zero? 0)
     (println msg)
     (binding [*out* *err*]
       (println msg)))
@@ -73,7 +74,7 @@
   [command valid-options options]
   (doseq [option (keys options)]
     (when (and (not (contains? valid-options option))
-               (not (= option :raw-arguments)))
+               (not= option :raw-arguments))
       (exit 1 (error-msg
                [(format "Option \"--%s\" conflicts with the command \"%s\""
                         (name option) command)])))))
@@ -226,11 +227,11 @@
     :validate [#(<= 0 %) "Must be a number >= 0"]]
    ["-t" "--to TO" "To time (Unix epoch)"
     :parse-fn #(Integer/parseInt %)
-    :validate [#(< 0 %) "Must be a number > 0"]]
+    :validate [pos? "Must be a number > 0"]]
    ["-T" "--threshold THRESHOLD" (str "Threshold in seconds. Default: "
                                       core/default-obsolete-metrics-threshold)
     :parse-fn #(Integer/parseInt %)
-    :validate [#(< 0 %) "Must be a number > 0"]]
+    :validate [pos? "Must be a number > 0"]]
    ["-r" "--run" "Force normal run (dry run using on default)"]
    ["-e" "--exclude-paths PATHS"
     "Exclude path. Example: \"requests.apache.*;sum.cpu.?\""
@@ -238,45 +239,45 @@
    ["-s" "--sort" "Sort paths in alphabetical order"]
    ["-j" "--jobs JOBS" "Number of jobs to run simultaneously"
     :parse-fn #(Integer/parseInt %)
-    :validate [#(< 0 %) "Must be a number > 0"]]
+    :validate [pos? "Must be a number > 0"]]
    [nil "--cassandra-keyspace KEYSPACE"
     (str "Cassandra keyspace. Default: " mstore/default-cassandra-keyspace)]
    ["-O" "--cassandra-options OPTIONS"
     "Cassandra options. Example: \"{:compression :lz4}\""
-    :parse-fn #(read-string %)
+    :parse-fn read-string
     :validate [#(= clojure.lang.PersistentArrayMap (type %))]]
    [nil "--cassandra-channel-size SIZE"
     (str "Cassandra channel size. Default: "
          mstore/default-cassandra-channel-size)
     :parse-fn #(Integer/parseInt %)
-    :validate [#(< 0 %) "Must be a number > 0"]]
+    :validate [pos? "Must be a number > 0"]]
    [nil "--cassandra-batch-size SIZE"
     (str "Cassandra batch size. Default: " mstore/default-cassandra-batch-size)
     :parse-fn #(Integer/parseInt %)
-    :validate [#(< 0 %) "Must be a number > 0"]]
+    :validate [pos? "Must be a number > 0"]]
    [nil "--cassandra-batch-rate RATE" "Cassandra batch rate (batches per second)"
     :parse-fn #(Integer/parseInt %)
-    :validate [#(< 0 %) "Must be a number > 0"]]
+    :validate [pos? "Must be a number > 0"]]
    [nil "--elasticsearch-index INDEX"
     (str "Elasticsearch index. Default: " pstore/default-es-index)]
    [nil "--elasticsearch-scroll-batch-size SIZE"
     (str "Elasticsearch scroll batch size. Default: "
          pstore/default-es-scroll-batch-size)
     :parse-fn #(Integer/parseInt %)
-    :validate [#(< 0 %) "Must be a number > 0"]]
+    :validate [pos? "Must be a number > 0"]]
    [nil "--elasticsearch-scroll-batch-rate RATE"
     "Elasticsearch scroll batch rate (batches per second)"
     :parse-fn #(Integer/parseInt %)
-    :validate [#(< 0 %) "Must be a number > 0"]]
+    :validate [pos? "Must be a number > 0"]]
    [nil "--elasticsearch-delete-request-rate RATE"
     "Elasticsearch delete request rate (requests per second)"
     :parse-fn #(Integer/parseInt %)
-    :validate [#(< 0 %) "Must be a number > 0"]]
+    :validate [pos? "Must be a number > 0"]]
    ["-l" "--log-file FILE" (str "Log file. Default: " clog/default-log-file)]
    ["-L" "--log-level LEVEL"
     (str "Log level (all, trace, debug, info, warn, error, fatal, off). "
          "Default: " clog/default-log-level)
-    :validate [#(or (= (count %) 0)
+    :validate [#(or (zero? (count %))
                     (not= (get logconfig/levels % :not-found) :not-found))
                "Invalid log level"]]
    ["-S" "--stop-on-error" "Stop on first non-fatal error"]
@@ -287,7 +288,7 @@
   "Run command."
   [arguments options summary]
   (let [command (first arguments)]
-    (when (not (contains? cli-commands command))
+    (when-not (contains? cli-commands command)
       (exit 1 (error-msg [(format "Unknown command: \"%s\"" command)])))
     (apply (resolve (symbol (str "cyanite-remover.cli/run-" command)))
            [command (drop 1 arguments) options summary])))


columns with row num

columns with row num


惰性序列结束

惰性序列结束


add schema

add schema

--- src/clj/puppetlabs/master/certificate_authority.clj
+++ src/clj/puppetlabs/master/certificate_authority.clj
@@ -133,7 +133,7 @@
     (str/join "\n" found-files)
     (str/join "\n" missing-files))))

-(schema/defn get-subject
+(schema/defn get-subject :- String
   [cert :- (schema/pred utils/certificate?)]
   (-> cert
       (.getSubjectX500Principal)


Upgrade cider dependencies

Upgrade cider dependencies

--- dot/lein/profiles.clj
+++ dot/lein/profiles.clj
@@ -2,6 +2,8 @@
  {:plugins [[lein-vanity "0.2.0" :exclusions [org.clojure/clojure]]
             [lein-ancient "0.6.5"]
             [jonase/eastwood "0.2.0"]
-            [cider/cider-nrepl "0.9.0-SNAPSHOT"]]
-  :dependencies [[slamhound "1.5.5"]]
+            [cider/cider-nrepl "0.10.0-SNAPSHOT"]
+            [refactor-nrepl "1.1.0-SNAPSHOT"]]
+  :dependencies [[slamhound "1.5.5"]
+                 [org.clojure/tools.nrepl "0.2.10"]]
   :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}


RS & AB | #33 | Render 404 page when trying to view diff for first draft

--- src/objective8/handlers/front_end.clj
+++ src/objective8/handlers/front_end.clj
@@ -562,7 +562,7 @@
                                                               :current-draft-diffs
                                                               utils/hiccup->html))
              :headers {"Content-Type" "text/html"}})))
-      {:status 404})))
+      (error-404-response request))))

 (defn draft-list [{{:keys [id]} :route-params :as request}]
   (let [objective-id (Integer/parseInt id)


Make Eastwood happy. Thanks Eastwood!

Make Eastwood happy. Thanks Eastwood!

--- src/oc/storage/async/notification.clj
+++ src/oc/storage/async/notification.clj
@@ -3,7 +3,6 @@
   Async publish of notification events to AWS SNS.
   "
   (:require [clojure.core.async :as async :refer (<!! >!!)]
-            [defun.core :refer (defun defun-)]
             [taoensso.timbre :as timbre]
             [cheshire.core :as json]
             [amazonica.aws.sns :as sns]


Fix typo.

Fix typo.

--- test/benchmark_test/method_call_tests.clj
+++ test/benchmark_test/method_call_tests.clj
@@ -271,7 +271,7 @@
         m {:bar (fn [arg] (+ res arg))}]
     (cc/with-progress-reporting
       (cc/quick-bench
-        ((m :bar) "bar")
+        ((m :bar) 2)
         :verbose))))

 (deftest map-benchmark-1


Use addition as example instead of string concatenation.

--- test/benchmark_test/method_call_tests.clj
+++ test/benchmark_test/method_call_tests.clj
@@ -6,13 +6,13 @@
   (println "\nRunning: baseline-0")
   (cc/with-progress-reporting
     (cc/quick-bench
-      (str "foo" "bar")
+      (+ 1 2)
       :verbose)))

 (deftest baseline-1
   (println "\nRunning: baseline-1")
   (let [f (fn []
-            (str "foo"))]
+            2)]
     (cc/with-progress-reporting
       (cc/quick-bench
         (f)
@@ -21,57 +21,57 @@
 (deftest baseline-2
   (println "\nRunning: baseline-2")
   (let [f (fn [arg]
-            (str arg))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f "bar")
+            arg)]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (f 2)
         :verbose))))

 (deftest baseline-3
   (println "\nRunning: baseline-3")
   (let [f (fn [arg]
-            (str "foo" arg))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f "bar")
+            (+ 1 arg))]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (f 2)
         :verbose))))

 (deftest baseline-4
   (println "\nRunning: baseline-4")
-  (let [res "foo"
-        f (fn [arg]
-            (str res arg))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f "bar")
+  (let [res 1
+        f (fn [arg]
+            (+ res arg))]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (f 2)
         :verbose))))

 (deftest condp-benchmark-0
   (println "\nRunning: condp-benchmark-0")
-  (let [res "foo"
+  (let [res 1
         f (fn [arg]
             (condp = arg
-              (str res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f "bar")
+              (+ res arg)))]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (f 2)
         :verbose))))

 (deftest condp-benchmark-1
   (println "\nRunning: condp-benchmark-1")
-  (let [res "foo"
+  (let [res 1
         f (fn [arg]
             (condp = arg
               :foo_0 0
-              (str res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f "bar")
+              (+ res arg)))]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (f 2)
         :verbose))))

 (deftest condp-benchmark-2
   (println "\nRunning: condp-benchmark-2")
-  (let [res "foo"
+  (let [res 1
         f (fn [arg]
             (condp = arg
               :foo_0 0
@@ -84,15 +84,15 @@
               :foo_7 7
               :foo_8 8
               :foo_9 9
-              (str res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f "bar")
+              (+ res arg)))]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (f 2)
         :verbose))))

 (deftest condp-benchmark-3
   (println "\nRunning: condp-benchmark-3")
-  (let [res "foo"
+  (let [res 1
         f (fn [arg]
             (condp = arg
               :foo_0 0
@@ -115,15 +115,15 @@
               :foo_17 17
               :foo_18 18
               :foo_19 19
-              (str res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f "bar")
+              (+ res arg)))]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (f 2)
         :verbose))))

 (deftest condp-benchmark-4
   (println "\nRunning: condp-benchmark-4")
-  (let [res "foo"
+  (let [res 1
         f (fn [arg]
             (condp = arg
               :foo_0 0
@@ -156,15 +156,15 @@
               :foo_27 27
               :foo_28 28
               :foo_29 29
-              (str res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f "bar")
+              (+ res arg)))]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (f 2)
         :verbose))))

 (deftest condp-benchmark-5
   (println "\nRunning: condp-benchmark-5")
-  (let [res "foo"
+  (let [res 1
         f (fn [arg]
             (condp = arg
               :foo_0 0
@@ -207,18 +207,18 @@
               :foo_37 37
               :foo_38 38
               :foo_39 39
-              (str res arg)))]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (f "bar")
+              (+ res arg)))]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (f 2)
         :verbose))))

 (deftest if-condp-benchmark-0
   (println "\nRunning: if-condp-benchmark-0")
-  (let [res "foo"
+  (let [res 1
         f (fn [arg]
             (if (not (keyword? arg))
-              (str res arg)
+              (+ res arg)
               (condp = arg
                 :foo_0 0
                 :foo_1 1
@@ -262,13 +262,13 @@
                 :foo_39 39)))]
     (cc/with-progress-reporting
       (cc/quick-bench
-        (f "bar")
+        (f 2)
         :verbose))))

 (deftest map-benchmark-0
   (println "\nRunning: map-benchmark-0")
-  (let [res "foo"
-        m {:bar (fn [arg] (str res arg))}]
+  (let [res 1
+        m {:bar (fn [arg] (+ res arg))}]
     (cc/with-progress-reporting
       (cc/quick-bench
         ((m :bar) "bar")
@@ -276,36 +276,36 @@

 (deftest map-benchmark-1
   (println "\nRunning: map-benchmark-1")
-  (let [res "foo"
-        m {:foo_0 0
-           :bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((m :bar) "bar")
+  (let [res 1
+        m {:foo_0 0
+           :bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((m :bar) 2)
         :verbose))))

 (deftest map-benchmark-2
   (println "\nRunning: map-benchmark-2")
-  (let [res "foo"
-        m {:foo_0 0
-           :foo_1 1
-           :foo_2 2
-           :foo_3 3
-           :foo_4 4
-           :foo_5 5
-           :foo_6 6
-           :foo_7 7
-           :foo_8 8
-           :foo_9 9
-           :bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((m :bar) "bar")
+  (let [res 1
+        m {:foo_0 0
+           :foo_1 1
+           :foo_2 2
+           :foo_3 3
+           :foo_4 4
+           :foo_5 5
+           :foo_6 6
+           :foo_7 7
+           :foo_8 8
+           :foo_9 9
+           :bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((m :bar) 2)
         :verbose))))

 (deftest map-benchmark-3
   (println "\nRunning: map-benchmark-3")
-  (let [res "foo"
+  (let [res 1
         m {:foo_0 0
            :foo_1 1
            :foo_2 2
@@ -326,15 +326,15 @@
            :foo_17 17
            :foo_18 18
            :foo_19 19
-           :bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((m :bar) "bar")
+           :bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((m :bar) 2)
         :verbose))))

 (deftest map-benchmark-4
   (println "\nRunning: map-benchmark-4")
-  (let [res "foo"
+  (let [res 1
         m {:foo_0 0
            :foo_1 1
            :foo_2 2
@@ -365,15 +365,15 @@
            :foo_27 27
            :foo_28 28
            :foo_29 29
-           :bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((m :bar) "bar")
+           :bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((m :bar) 2)
         :verbose))))

 (deftest map-benchmark-5
   (println "\nRunning: map-benchmark-5")
-  (let [res "foo"
+  (let [res 1
         m {:foo_0 0
            :foo_1 1
            :foo_2 2
@@ -414,15 +414,15 @@
            :foo_37 37
            :foo_38 38
            :foo_39 39
-           :bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((m :bar) "bar")
+           :bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((m :bar) 2)
         :verbose))))

 (deftest map-cached-benchmark-0
   (println "\nRunning: map-cached-benchmark-0")
-  (let [res "foo"
+  (let [res 1
         m {:foo_0 0
            :foo_1 1
            :foo_2 2
@@ -463,54 +463,54 @@
            :foo_37 37
            :foo_38 38
            :foo_39 39
-           :bar (fn [arg] (str res arg))}
+           :bar (fn [arg] (+ res arg))}
         f (m :bar)]
     (cc/with-progress-reporting
       (cc/quick-bench
-        (f "bar")
+        (f 2)
         :verbose))))

 (deftest map-rev-benchmark-0
   (println "\nRunning: map-rev-benchmark-0")
-  (let [res "foo"
-        m {:bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((:bar m) "bar")
+  (let [res 1
+        m {:bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((:bar m) 2)
         :verbose))))

 (deftest map-rev-benchmark-1
   (println "\nRunning: map-rev-benchmark-1")
-  (let [res "foo"
-        m {:foo_0 0
-           :bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((:bar m) "bar")
+  (let [res 1
+        m {:foo_0 0
+           :bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((:bar m) 2)
         :verbose))))

 (deftest map-rev-benchmark-2
   (println "\nRunning: map-rev-benchmark-2")
-  (let [res "foo"
-        m {:foo_0 0
-           :foo_1 1
-           :foo_2 2
-           :foo_3 3
-           :foo_4 4
-           :foo_5 5
-           :foo_6 6
-           :foo_7 7
-           :foo_8 8
-           :foo_9 9
-           :bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((:bar m) "bar")
+  (let [res 1
+        m {:foo_0 0
+           :foo_1 1
+           :foo_2 2
+           :foo_3 3
+           :foo_4 4
+           :foo_5 5
+           :foo_6 6
+           :foo_7 7
+           :foo_8 8
+           :foo_9 9
+           :bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((:bar m) 2)
         :verbose))))

 (deftest map-rev-benchmark-3
   (println "\nRunning: map-rev-benchmark-3")
-  (let [res "foo"
+  (let [res 1
         m {:foo_0 0
            :foo_1 1
            :foo_2 2
@@ -531,15 +531,15 @@
            :foo_17 17
            :foo_18 18
            :foo_19 19
-           :bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((:bar m) "bar")
+           :bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((:bar m) 2)
         :verbose))))

 (deftest map-rev-benchmark-4
   (println "\nRunning: map-rev-benchmark-4")
-  (let [res "foo"
+  (let [res 1
         m {:foo_0 0
            :foo_1 1
            :foo_2 2
@@ -570,15 +570,15 @@
            :foo_27 27
            :foo_28 28
            :foo_29 29
-           :bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((:bar m) "bar")
+           :bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((:bar m) 2)
         :verbose))))

 (deftest map-rev-benchmark-5
   (println "\nRunning: map-rev-benchmark-5")
-  (let [res "foo"
+  (let [res 1
         m {:foo_0 0
            :foo_1 1
            :foo_2 2
@@ -619,10 +619,10 @@
            :foo_37 37
            :foo_38 38
            :foo_39 39
-           :bar (fn [arg] (str res arg))}]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        ((:bar m) "bar")
+           :bar (fn [arg] (+ res arg))}]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        ((:bar m) 2)
         :verbose))))

 (defprotocol MyProt
@@ -633,27 +633,27 @@
   [res]
   MyProt
   (foo [_] 0)
-  (bar [_ arg] (str res arg)))
+  (bar [_ arg] (+ res arg)))

 (deftest defrecord-benchmark-0
   (println "\nRunning: defrecord-benchmark-0")
-  (let [r (MyRec. "foo")]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (.bar r "bar")
+  (let [r (MyRec. 1)]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (.bar r 2)
         :verbose))))

 (deftype MyType
   [res]
   MyProt
   (foo [_] 0)
-  (bar [_ arg] (str res arg)))
+  (bar [_ arg] (+ res arg)))

 (deftest deftype-benchmark-0
   (println "\nRunning: deftype-benchmark-0")
-  (let [t (MyType. "foo")]
-    (cc/with-progress-reporting
-      (cc/quick-bench
-        (.bar t "bar")
-        :verbose))))
-
+  (let [t (MyType. 1)]
+    (cc/with-progress-reporting
+      (cc/quick-bench
+        (.bar t 2)
+        :verbose))))
+


Remove prototype run-graph tests from connect test

--- test/com/wsscode/pathom/connect_test.cljc
+++ test/com/wsscode/pathom/connect_test.cljc
@@ -3200,498 +3200,6 @@
              :account/id  {#{:purchase/id} #{account}}})
          '#{})))

-(defn compute-run-graph [resolvers options]
-  (pc/compute-run-graph (merge options (register-index resolvers))))
-
-(defn compute-run-graph* [resolvers options]
-  (pc/compute-run-graph* (merge options {::pc/id-counter (atom 0)
-                                         ::pc/run-paths  []} (register-index resolvers))))
-
-(comment
-  (compute-run-graph
-    [{::pc/sym    'global
-      ::pc/output [:global]}]
-    {::eql/query [:global]})
-
-  (compute-run-graph*
-    [{::pc/sym    'a
-      ::pc/output [:a]}
-     {::pc/sym    'b
-      ::pc/input  #{:a}
-      ::pc/output [:b]}
-     {::pc/sym    'c
-      ::pc/input  #{:b}
-      ::pc/output [:c]}]
-    {::eql/query    [:c]
-     ::pc/run-paths []
-     ::pc/run-nodes {}})
-
-  (compute-run-graph*
-    [{::pc/sym    'a
-      ::pc/output [:a]}
-     {::pc/sym    'b
-      ::pc/output [:b]}
-     {::pc/sym    'c
-      ::pc/input  #{:b :a}
-      ::pc/output [:c]}]
-    {::eql/query    [:c]
-     ::pc/run-paths []
-     ::pc/run-nodes {}})
-
-  (compute-run-graph
-    [{::pc/sym    'a
-      ::pc/output [:a]}
-     {::pc/sym    'b
-      ::pc/input  #{:a}
-      ::pc/output [:b]}]
-    {::eql/query [:b]})
-
-  (compute-run-graph
-    [{::pc/sym    'a
-      ::pc/output [:a]}
-     {::pc/sym    'b
-      ::pc/input  #{:a}
-      ::pc/output [:b]}
-     {::pc/sym    'c
-      ::pc/input  #{:b}
-      ::pc/output [:c]}]
-    {::eql/query [:c]})
-
-  (compute-run-graph
-    [{::pc/sym    'a
-      ::pc/output [:a]}
-     {::pc/sym    'b
-      ::pc/input  #{:a}
-      ::pc/output [:b]}
-     {::pc/sym    'b2
-      ::pc/input  #{:a}
-      ::pc/output [:b]}]
-    {::eql/query [:b]})
-
-  (compute-run-graph
-    [{::pc/sym    'a
-      ::pc/output [:a]}
-     {::pc/sym    'a2
-      ::pc/output [:a]}
-     {::pc/sym    'b
-      ::pc/input  #{:a}
-      ::pc/output [:b]}]
-    {::eql/query [:b]})
-
-  (compute-run-graph
-    [{::pc/sym    'a
-      ::pc/output [:a]}
-     {::pc/sym    'b
-      ::pc/output [:b]}
-     {::pc/sym    'c
-      ::pc/input  #{:a :b}
-      ::pc/output [:c]}]
-    {::eql/query [:c]})
-
-  (compute-run-graph
-    [{::pc/sym    'a
-      ::pc/output [:a]}
-     {::pc/sym    'b
-      ::pc/input  #{:a}
-      ::pc/output [:b]}
-     {::pc/sym    'c
-      ::pc/input  #{:a}
-      ::pc/output [:c]}
-     {::pc/sym    'd
-      ::pc/input  #{:b :c}
-      ::pc/output [:d]}]
-    {::eql/query [:d]})
-
-  (compute-run-graph
-    [{::pc/sym    'z
-      ::pc/output [:z]}
-     {::pc/sym    'a
-      ::pc/input  #{:z}
-      ::pc/output [:a]}
-     {::pc/sym    'b
-      ::pc/input  #{:a}
-      ::pc/output [:b]}
-     {::pc/sym    'c
-      ::pc/input  #{:a}
-      ::pc/output [:c]}
-     {::pc/sym    'd
-      ::pc/input  #{:b :c}
-      ::pc/output [:d]}]
-    {::eql/query [:d]}))
-
-(deftest test-optimize-fork-node
-  (testing "nothing to optimize"
-    (is (= (pc/optimize-fork-node {}
-             {::pc/run-node-id 1
-              ::pc/run-and     #{[2] [3]}}
-
-             '[#::pc{:run-nodes {2 #::pc{:attribute   :c
-                                         :sym         c
-                                         :run-node-id 2}}
-                     :run-paths [2]}
-               #::pc{:run-nodes {3 #::pc{:attribute   :b
-                                         :sym         b
-                                         :run-node-id 3}}
-                     :run-paths [3]}])
-           {::pc/run-node-id 1
-            ::pc/run-and     #{[2] [3]}})))
-
-  (testing "one step optimization"
-    (is (= (pc/optimize-fork-node {}
-             {::pc/run-node-id 1
-              ::pc/run-and     #{[3] [5]}}
-             '[#::pc{:run-nodes {2 #::pc{:attribute   :c
-                                         :sym         c
-                                         :run-node-id 2}
-                                 3 #::pc{:attribute   :a
-                                         :sym         a
-                                         :run-node-id 3
-                                         :run-next    [2]}}
-                     :run-paths [3]
-                     :run-edges [2]}
-               #::pc{:run-nodes {4 #::pc{:attribute   :b
-                                         :sym         b
-                                         :run-node-id 4}
-                                 5 #::pc{:attribute   :a
-                                         :sym         a
-                                         :run-node-id 5
-                                         :run-next    [4]}}
-                     :run-paths [5]
-                     :run-edges [4]}])
-           {::pc/run-node-id 1
-            ::pc/run-and     #{[3] [5]}})))
-
-  (testing "one step optimization, also add one non optimizable path"
-    (is (= (pc/optimize-fork-node {}
-             {::pc/run-node-id 1
-              ::pc/run-and     #{[3] [5]}}
-             '[#::pc{:run-nodes {2 #::pc{:attribute   :c
-                                         :sym         c
-                                         :run-node-id 2}
-                                 3 #::pc{:attribute   :a
-                                         :sym         a
-                                         :run-node-id 3
-                                         :run-next    [2]}}
-                     :run-paths [3]
-                     :run-edges [2]}
-               #::pc{:run-nodes {4 #::pc{:attribute   :b
-                                         :sym         b
-                                         :run-node-id 4}
-                                 5 #::pc{:attribute   :a
-                                         :sym         a
-                                         :run-node-id 5
-                                         :run-next    [4]}}
-                     :run-paths [5]
-                     :run-edges [4]}])))))
-
-(deftest test-compute-run-graph*
-  (testing "simple global lookup"
-    (is (= (compute-run-graph*
-             [{::pc/sym    'global
-               ::pc/output [:global]}]
-             {::eql/query [:global]})
-           {::pc/run-nodes {1 {::pc/sym         'global
-                               ::pc/attribute   :global
-                               ::pc/run-node-id 1}}
-            ::pc/run-paths [1]
-            ::pc/run-edges nil})))
-
-  (testing "lookup with single dependency"
-    (is (= (compute-run-graph*
-             [{::pc/sym    'a
-               ::pc/output [:a]}
-              {::pc/sym    'b
-               ::pc/input  #{:a}
-               ::pc/output [:b]}]
-             {::eql/query [:b]})
-           '#::pc{:run-nodes {1 #::pc{:attribute   :b
-                                      :sym         b
-                                      :run-node-id 1}
-                              2 #::pc{:attribute   :a
-                                      :sym         a
-                                      :run-node-id 2
-                                      :run-next    [1]}}
-                  :run-paths [2]
-                  :run-edges [1]})))
-
-  (testing "multi step chain"
-    (is (= (compute-run-graph*
-             [{::pc/sym    'a
-               ::pc/output [:a]}
-              {::pc/sym    'b
-               ::pc/input  #{:a}
-               ::pc/output [:b]}
-              {::pc/sym    'c
-               ::pc/input  #{:b}
-               ::pc/output [:c]}
-              {::pc/sym    'd
-               ::pc/input  #{:c}
-               ::pc/output [:d]}]
-             {::eql/query [:d]})
-           '#::pc{:run-nodes {1 #::pc{:attribute   :d
-                                      :sym         d
-                                      :run-node-id 1}
-                              2 #::pc{:attribute   :c
-                                      :sym         c
-                                      :run-node-id 2
-                                      :run-next    [1]}
-                              3 #::pc{:attribute   :b
-                                      :sym         b
-                                      :run-node-id 3
-                                      :run-next    [2]}
-                              4 #::pc{:attribute   :a
-                                      :sym         a
-                                      :run-node-id 4
-                                      :run-next    [3]}}
-                  :run-paths [4]
-                  :run-edges [3]})))
-
-  (testing "multiple alternatives on the edge"
-    (is (= (compute-run-graph*
-             [{::pc/sym    'a
-               ::pc/output [:a]}
-              {::pc/sym    'b
-               ::pc/input  #{:a}
-               ::pc/output [:b]}
-              {::pc/sym    'b2
-               ::pc/input  #{:a}
-               ::pc/output [:b]}]
-             {::eql/query [:b]})
-           '#::pc{:run-nodes {1 #::pc{:attribute   :b
-                                      :sym         b2
-                                      :run-node-id 1}
-                              2 #::pc{:attribute   :b
-                                      :sym         b
-                                      :run-node-id 2}
-                              3 #::pc{:attribute   :a
-                                      :sym         a
-                                      :run-node-id 3
-                                      :run-next    [1 2]}}
-                  :run-paths [3]
-                  :run-edges [1 2]})))
-
-  (testing "multiple alternatives on the root"
-    (is (= (compute-run-graph*
-             [{::pc/sym    'a
-               ::pc/output [:a]}
-              {::pc/sym    'a2
-               ::pc/output [:a]}
-              {::pc/sym    'b
-               ::pc/input  #{:a}
-               ::pc/output [:b]}]
-             {::eql/query [:b]})
-           '#::pc{:run-nodes {1 #::pc{:attribute   :b
-                                      :sym         b
-                                      :run-node-id 1}
-                              2 #::pc{:attribute   :a
-                                      :sym         a
-                                      :run-node-id 2
-                                      :run-next    [1]}
-                              3 #::pc{:attribute   :a
-                                      :sym         a2
-                                      :run-node-id 3
-                                      :run-next    [1]}}
-                  :run-paths [2 3]
-                  :run-edges [1]}
-
-           '#::pc{:run-nodes {1 #::pc{:attribute   :b
-                                      :sym         b
-                                      :run-node-id 1}
-                              2 #::pc{:attribute   :a
-                                      :sym         a
-                                      :run-node-id 2}
-                              3 #::pc{:attribute   :a
-                                      :sym         a2
-                                      :run-node-id 3}
-                              4 #::pc{:run-node-id 4
-                                      :run-or      [2 3]
-                                      :run-next    1}}
-                  :run-root  4})))
-
-  (testing "multiple dependencies forking"
-    (is (= (compute-run-graph*
-             [{::pc/sym    'a
-               ::pc/output [:a]}
-              {::pc/sym    'b
-               ::pc/output [:b]}
-              {::pc/sym    'c
-               ::pc/input  #{:a :b}
-               ::pc/output [:c]}]
-             {::eql/query [:c]})
-           '#::pc{:run-nodes {2 #::pc{:attribute   :b
-                                      :sym         b
-                                      :run-node-id 2}
-                              3 #::pc{:attribute   :a
-                                      :sym         a
-                                      :run-node-id 3}
-                              4 #::pc{:run-node-id 4
-                                      :run-and     #{[3]
-                                                     [2]}
-                                      :run-next    [1]}}
-                  :run-paths [4]
-                  :run-edges nil})))
-
-  (testing "diamond shape dependencies"
-    (is (= (compute-run-graph*
-             [{::pc/sym    'a
-               ::pc/output [:a]}
-              {::pc/sym    'a2
-               ::pc/output [:a]}
-              {::pc/sym    'b
-               ::pc/input  #{:a}
-               ::pc/output [:b]}
-              {::pc/sym    'c
-               ::pc/input  #{:a}
-               ::pc/output [:c]}
-              {::pc/sym    'd
-               ::pc/input  #{:b :c}
-               ::pc/output [:d]}]
-             {::eql/query [:d]})
-           [{::pc/run-and  #{[{::pc/sym       'a
-                               ::pc/attribute :a
-                               ::pc/run-next  [{::pc/sym       'c
-                                                ::pc/attribute :c}]}]
-                             [{::pc/sym       'a
-                               ::pc/attribute :a
-                               ::pc/run-next  [{::pc/sym       'b
-                                                ::pc/attribute :b}]}]}
-             ::pc/run-next [{::pc/sym       'd
-                             ::pc/attribute :d}]}]
-
-           #_[{::pc/sym       'a
-               ::pc/attribute :a
-               ::pc/run-next  [{::pc/run-and  #{[{::pc/sym       'b
-                                                  ::pc/attribute :b}]
-                                                [{::pc/sym       'c
-                                                  ::pc/attribute :c}]}
-                                ::pc/run-next [{::pc/sym       'd
-                                                ::pc/attribute :d}]}]}]))))
-
-(deftest test-compute-run-graph
-  (testing "simple global lookup"
-    (is (= (compute-run-graph
-             [{::pc/sym    'global
-               ::pc/output [:global]}]
-             {::eql/query [:global]})
-           [{::pc/sym       'global
-             ::pc/attribute :global}])))
-
-  (testing "lookup with single dependency"
-    (is (= (compute-run-graph
-             [{::pc/sym    'a
-               ::pc/output [:a]}
-              {::pc/sym    'b
-               ::pc/input  #{:a}
-               ::pc/output [:b]}]
-             {::eql/query [:b]})
-           [{::pc/sym       'a
-             ::pc/attribute :a
-             ::pc/run-next  [{::pc/sym       'b
-                              ::pc/attribute :b}]}])))
-
-  (testing "multi step chain"
-    (is (= (compute-run-graph
-             [{::pc/sym    'a
-               ::pc/output [:a]}
-              {::pc/sym    'b
-               ::pc/input  #{:a}
-               ::pc/output [:b]}
-              {::pc/sym    'c
-               ::pc/input  #{:b}
-               ::pc/output [:c]}]
-             {::eql/query [:c]})
-           [{::pc/sym       'a
-             ::pc/attribute :a
-             ::pc/run-next  [{::pc/sym       'b
-                              ::pc/attribute :b
-                              ::pc/run-next  [{::pc/sym       'c
-                                               ::pc/attribute :c}]}]}])))
-
-  (is (= (compute-run-graph
-           [{::pc/sym    'a
-             ::pc/output [:a]}
-            {::pc/sym    'b
-             ::pc/input  #{:a}
-             ::pc/output [:b]}
-            {::pc/sym    'b2
-             ::pc/input  #{:a}
-             ::pc/output [:b]}]
-           {::eql/query [:b]})
-         [{::pc/sym       'a
-           ::pc/attribute :a
-           ::pc/run-next  [{::pc/sym       'b2
-                            ::pc/attribute :b}
-                           {::pc/sym       'b
-                            ::pc/attribute :b}]}]))
-
-  (is (= (compute-run-graph
-           [{::pc/sym    'a
-             ::pc/output [:a]}
-            {::pc/sym    'a2
-             ::pc/output [:a]}
-            {::pc/sym    'b
-             ::pc/input  #{:a}
-             ::pc/output [:b]}]
-           {::eql/query [:b]})
-         [{::pc/sym       'a
-           ::pc/attribute :a
-           ::pc/run-next  [{::pc/sym       'b
-                            ::pc/attribute :b}]}
-
-          {::pc/sym       'a2
-           ::pc/attribute :a
-           ::pc/run-next  [{::pc/sym       'b
-                            ::pc/attribute :b}]}]))
-
-  (is (= (compute-run-graph
-           [{::pc/sym    'a
-             ::pc/output [:a]}
-            {::pc/sym    'b
-             ::pc/output [:b]}
-            {::pc/sym    'c
-             ::pc/input  #{:a :b}
-             ::pc/output [:c]}]
-           {::eql/query [:c]})
-         [{::pc/run-and  #{[{::pc/sym       'a
-                             ::pc/attribute :a}]
-                           [{::pc/sym       'b
-                             ::pc/attribute :b}]}
-           ::pc/run-next [{::pc/sym       'c
-                           ::pc/attribute :c}]}]))
-
-  (is (= (compute-run-graph
-           [{::pc/sym    'a
-             ::pc/output [:a]}
-            {::pc/sym    'b
-             ::pc/input  #{:a}
-             ::pc/output [:b]}
-            {::pc/sym    'c
-             ::pc/input  #{:a}
-             ::pc/output [:c]}
-            {::pc/sym    'd
-             ::pc/input  #{:b :c}
-             ::pc/output [:d]}]
-           {::eql/query [:d]})
-         [{::pc/run-and  #{[{::pc/sym       'a
-                             ::pc/attribute :a
-                             ::pc/run-next  [{::pc/sym       'c
-                                              ::pc/attribute :c}]}]
-                           [{::pc/sym       'a
-                             ::pc/attribute :a
-                             ::pc/run-next  [{::pc/sym       'b
-                                              ::pc/attribute :b}]}]}
-           ::pc/run-next [{::pc/sym       'd
-                           ::pc/attribute :d}]}]
-
-         #_[{::pc/sym       'a
-             ::pc/attribute :a
-             ::pc/run-next  [{::pc/run-and  #{[{::pc/sym       'b
-                                                ::pc/attribute :b}]
-                                              [{::pc/sym       'c
-                                                ::pc/attribute :c}]}
-                              ::pc/run-next [{::pc/sym       'd
-                                              ::pc/attribute :d}]}]}])))
-
 (defonce quick-parser-trace* (atom []))

 #?(:clj


Clicking data goes to the database explorer

Ok, so this currently only works on my local machine, but I am checking
it in anyway

--- idecode/myappshare/mainapp.cljs
+++ idecode/myappshare/mainapp.cljs
@@ -186,7 +186,14 @@
   (div {}
        (realtime select   id, application_name, application_glyph   from appshare_applications where id = ? {:params [(read-ui app [:app-id])]}
                  (div {:style {:marginLeft "20px" :padding "5px"}}
-                      (span {:onClick #(go  (write-ui app [:mode] "editdata"))} "Data")
+;                      (span {:onClick #(go  (write-ui app [:mode] "editdata"))} "Data")
+                      (span {:onClick #(go  (write-ui app [:mode] "view")
+                                                       ;(write-ui app [:submode] "editappname")
+                                                       (write-ui app [:app-id] 81)
+                                                       (evalapp 81)
+                                                       )} "Data")
+
+

                       (let [glyphicon (if (<-- :application_glyph)  (<-- :application_glyph) "glyphicon-align-left")]


+(defn create-index-fn)

+(defn create-index-fn)

--- src/babel/italiano/lab.cljc
+++ src/babel/italiano/lab.cljc
@@ -296,22 +296,43 @@

 (def verbcoach-grammar
   #{
-    "s-aux"
-    "s-conditional-nonphrasal"
-    "s-conditional-phrasal"
-    "s-future-nonphrasal"
-    "s-future-phrasal"
-    "s-imperfetto-nonphrasal"
-    "s-imperfetto-phrasal"
-    "s-present-nonphrasal"
-    "s-present-phrasal"
+    ;;    "adjective-phrase"
+    ;;    "intensifier-phrase"
+    ;;    "nbar1"
+    ;;    "nbar2"
+    ;;    "noun-phrase1"
+    ;;    "noun-phrase2"
+    ;;    "np-to-n-pp"
+    ;;    "prepositional-phrase"
+    ;;    "s-aux"
+    ;;    "s-modified-modifier-first"
+    ;;    "s-modified-modifier-last"
+    ;;    "s-modifier"
+    ;;    "sentence-nonphrasal-head"
+    "sentence-phrasal-head"
+    ;;    "vp"
+    ;;    "vp-32"
     "vp-aux-22-nonphrasal-comp"
+    "vp-aux-22-phrasal-comp"
+    "vp-aux-nonphrasal-complement"
     "vp-aux-phrasal-complement"
-    "vp-aux-nonphrasal-complement"
-    "vp-32"
-    "vp-pronoun-nonphrasal"
-    "vp-pronoun-phrasal"
-    })
+    "vp-aux-phrasal-complement-essere-false"
+    "vp-infinitive"
+    ;;    "vp-past"
+    "vp-present"
+    "vp-pronoun-nonphrasal"})
+;;    "vp-pronoun-phrasal"
+
+
+
+(def verbcoach-pronouns
+  (fn [v]
+    (or
+     (and (= :noun (u/get-in v [:synsem :cat]))
+          (not (= :acc (u/get-in v [:synsem :case]))))
+     (and (= :noun (u/get-in v [:synsem :cat]))
+          (= :acc (u/get-in v [:synsem :case]))
+          (= true (u/get-in v [:synsem :reflexive]))))))

 (def verbcoach-index-fn
   (let [index-lexicon-on-paths
@@ -327,22 +348,45 @@
             (into {}
                   (for [[k vals] (:lexicon model)]
                     (let [filtered-vals
-                          (filter (fn [v]
-                                    (or (not (= :noun (u/get-in v [:synsem :cat])))
-                                        (and (= :noun (u/get-in v [:synsem :cat]))
-                                             (not (= :acc (u/get-in v [:synsem :case]))))
-                                        (and (= :noun (u/get-in v [:synsem :cat]))
-                                             (= :acc (u/get-in v [:synsem :case]))
-                                             (= true (u/get-in v [:synsem :reflexive])))))
+                          (filter verbcoach-pronouns
                                   vals)]
                       (if (not (empty? filtered-vals))
                         [k filtered-vals]))))]
         (lookup-spec spec (create-indices lexicon index-lexicon-on-paths) index-lexicon-on-paths)))))

+(def
+  verbcoach-index-paths
+  [[:italiano :italiano]
+   [:synsem :aux]
+   [:synsem :cat]
+   [:synsem :essere]
+   [:synsem :infl]
+   [:synsem :sem :pred]])
+
+(defn create-index-fn [verb-set grammar]
+  (fn [spec]
+    (let [lexicon
+          (into {}
+                (for [[k vals] (:lexicon model)]
+                  (let [filtered-vals
+                        (filter
+                         (fn [v]
+                           (or
+                            (and (= :verb (u/get-in v [:synsem :cat]))
+                                 (contains? verb-set
+                                            (u/get-in v [:italiano :italiano])))
+                            (verbcoach-pronouns v)))
+                         vals)]
+                    (if (not (empty? filtered-vals))
+                      [k filtered-vals]))))]
+      (lookup-spec spec (create-indices lexicon verbcoach-index-paths)
+                   verbcoach-index-paths))))
+
 (defn arrabbiarsi
   "generate arrabiarsi sentences with a grammar subset."
   []
-  (let [grammar
+  (let [verb-set #{"arrabbiarsi" "essere" "fermarsi" "parlare" "sedersi"}
+        grammar
         (filter
          #(contains? verbcoach-grammar (u/get-in % [:rule]))
          (:grammar model))
@@ -351,14 +395,15 @@
                        :modified false
                        :sem {:tense :past
                              :aspect :progressive}
-                       :subcat []}}]
+                       :subcat []}}
+        index-fn (create-index-fn verb-set grammar)]
     (repeatedly
      #(println
-       (morph-ps (binding [babel.generate/println? true
-                           babel.generate/truncate? false
-                           babel.generate/grammar grammar
-                           babel.generate/index-fn verbcoach-index-fn]
-                   (time (generate spec model))))))))
+       (morph (binding [babel.generate/println? false
+                        babel.generate/truncate? true
+                        babel.generate/grammar grammar
+                        babel.generate/index-fn index-fn]
+                (time (generate spec model))))))))

 (defn stampare
   "generate arrabiarsi sentences with a grammar subset."


(MAINT) Fix issue with 4.2.x merge

(MAINT) Fix issue with 4.2.x merge

--- test/puppetlabs/puppetdb/command_test.clj
+++ test/puppetlabs/puppetdb/command_test.clj
@@ -1561,7 +1561,7 @@
                        (tqueue/coerce-to-stream
                         {:certname "foo.local" :producer_timestamp input-stamp}))
       (is (svc-utils/wait-for-server-processing svc-utils/*server* default-timeout-ms)
-          (format "Server didn't process received commands after %dms" default-timeout-ms)
+          (format "Server didn't process received commands after %dms" default-timeout-ms))

       ;; While we're here, check the value in the database too...
       (is (= expected-stamp