add signup features

add signup features

--- src/cljs/lesezeichen/core.cljs
+++ src/cljs/lesezeichen/core.cljs
@@ -1,6 +1,5 @@
 (ns lesezeichen.core
   (:require [figwheel.client :as figw :include-macros true]
-            [weasel.repl :as ws-repl]
             [cljs.core.async :refer [put! chan <! >! alts! timeout close!] :as async]
             [cljs.reader :refer [read-string] :as read]
             [kioo.om :refer [content set-attr do-> substitute listen]]
@@ -19,22 +18,13 @@

 (def ssl? (= (.getScheme uri) "https"))

-(def app-state (atom {:bookmarks []}))
-
-
-;; fire up repl
-#_(do
-    (ns weasel.startup)
-    (require 'weasel.repl.websocket)
-    (cemerick.piggieback/cljs-repl
-        :repl-env (weasel.repl.websocket/repl-env
-                   :ip "0.0.0.0" :port 9001)))
-
+(def app-state (atom {:bookmarks []
+                      :user nil
+                      :ws []}))

 ;; weasel websocket, development only
-#_(if (= "localhost" (.getDomain uri))
+(if (= "localhost" (.getDomain uri))
   (do
-    #_(ws-repl/connect "ws://localhost:9001" :verbose true)
     (figw/watch-and-reload
      :jsload-callback (fn [] (print "reloaded")))))

@@ -48,20 +38,44 @@

 (defn send-bookmark
   "Send bookmark via websocket to server"
-  [state owner]
+  [app owner]
   (let [url (om/get-state owner :url-input-text)
-        ws-in (om/get-state owner :ws-in)]
+        {[in _] :ws user :user} (-> app deref)]
     (if (clojure.string/blank? url)
       (println "INFO: no input")
+      (if user
+        (do
+          (go (>! in {:topic :add-bookmark :data {:email user :url url}}))
+          (om/set-state! owner :url-input-text ""))
+        (println "not registered yet!")))))
+
+
+(defn send-registry
+  "Send mail for sign up"
+  [app owner]
+  (let [email (om/get-state owner :signup-text)
+        [in _] (-> app deref :ws)]
+    (if (clojure.string/blank? email)
+      (println "INFO: no mail")
       (do
-        (go (>! ws-in {:topic :add-bookmark :data {:email "eve@topiq.es" :url url}}))
-        (om/set-state! owner :url-input-text "")))))
+        (go (>! in {:topic :sign-up :data {:email email}}))
+        (om/transact! app :user (fn [old] email))
+        (om/set-state! owner :signup-text "")))))
+

 ;; --- NAVBAR ---

 (deftemplate nav "templates/navbar.html"
-  [app owner]
-  {[:#brand] (content "Lesezeichen")})
+  [app owner state]
+  {[:#brand] (content "Lesezeichen")
+   [:#sign-up-input] (do-> (set-attr :value (:signup-text state))
+                           (listen :on-change #(handle-text-change % owner :signup-text)
+                                   :on-key-down #(if (= (.-keyCode %) 10)
+                                                   (send-registry app owner)
+                                                   (when (= (.-which %) 13)
+                                                     (when (.-ctrlKey %)
+                                                       (send-registry app owner))))))
+   [:#modal-signup-btn] (listen :on-click (fn [e] (send-registry app owner)))})

 ;; --- MAIN VIEW ---
@@ -79,27 +93,33 @@
    [:#url-input] (do-> (set-attr :value (:url-input-text state))
                        (listen :on-change #(handle-text-change % owner :url-input-text)
                                :on-key-down #(if (= (.-keyCode %) 10)
-                                               (send-bookmark state owner)
+                                               (send-bookmark app owner)
                                                (when (= (.-which %) 13)
                                                  (when (.-ctrlKey %)
-                                                   (send-bookmark state owner))))))
+                                                   (send-bookmark app owner))))))
    [:#search-input] (do-> (set-attr :value (:search-text state))
                           (listen :on-change #(handle-text-change % owner :search-text)))
-   [:#url-list] (content (map #(url %) (sort-by :ts > app)))
-   [:#bookmark-btn] (listen :on-click (fn [e]
-                                        (send-bookmark state owner)))})
+   [:#url-list] (content (let [bms (if (blank? (:search-text state))
+                                     (:bookmarks app)
+                                     (remove
+                                      (fn [bookmark]
+                                        (nil?
+                                         (re-find
+                                          (-> state :search-text trim lower-case re-pattern)
+                                          (-> bookmark :title lower-case))))
+                                      (:bookmarks app)))]
+                           (map #(url %) (sort-by :ts > bms))))
+   [:#bookmark-btn] (listen :on-click (fn [e] (send-bookmark app owner)))})

-;; --- INIT ---
-(defn bookmark-view
-  "Central view containing bookmarks and url input field"
+;; --- VIEWS ---
+(defn nav-view
+  "Navbar view handling sin-up and log-in menu"
   [app owner]
   (reify
     om/IInitState
     (init-state [_]
-      {:url-input-text ""
-       :search-text ""
-       :ws-in (chan)})
+      {:signup-text ""})
     om/IWillMount
     (will-mount [_]
       (go
@@ -109,8 +129,8 @@
                              (when (= (.getDomain uri) "localhost")
                                (str ":" 8087 #_(.getPort uri)))
                              "/bookmark/ws")))]
-          (om/set-state! owner :ws-in in)
-          (>! in {:topic :get-user-bookmarks :data "eve@topiq.es"})
+          (om/transact! app :ws (fn [old] [in out]))
+          (>! in {:topic :get-user-bookmarks :data "konny@topiq.es"})
           (loop [{:keys [topic data]} (<! out)]
             (case topic
               :get-user-bookmarks (om/transact! app :bookmarks (fn [old] data))
@@ -120,22 +140,27 @@
               (recur package))))))
     om/IRenderState
     (render-state [this state]
-      (bookmarks (if (blank? (:search-text state))
-                   (:bookmarks app)
-                   (remove
-                    (fn [bookmark]
-                      (nil?
-                       (re-find
-                        (-> state :search-text trim lower-case re-pattern)
-                        (-> bookmark :title lower-case))))
-                    (:bookmarks app)))
-                 owner state))))
+      (nav app owner state))))

-;; --- VIEWS ROOT ---
+
+(defn bookmark-view
+  "Central view containing bookmarks and url input field"
+  [app owner]
+  (reify
+    om/IInitState
+    (init-state [_]
+      {:url-input-text ""
+       :search-text ""})
+    om/IRenderState
+    (render-state [this state]
+      (bookmarks app owner state))))
+
+
+;; --- ROOT ---

 (om/root
- #(om/component (nav %1 %2))
+ nav-view
  app-state
  {:target (. js/document (getElementById "navbar-container"))})


Add decode/encode functions to jws implementation (that returns a monadic either instead nil).

--- src/clojure/buddy/sign/jws.clj
+++ src/clojure/buddy/sign/jws.clj
@@ -70,6 +70,10 @@
   (to-timestamp [obj]
     (quot (jodac/to-long obj) 1000)))

+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Implementation details
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
 (defn- normalize-date-claims
   "Normalize date related claims and return transformed object."
   [data]
@@ -84,16 +88,16 @@
   [data]
   (into {} (remove (comp nil? second) data)))

-(defn- make-headers
+(defn- encode-header
   "Encode jws header"
-  [alg extra-headers]
-  (-> (or extra-headers {})
-      (merge {:alg (.toUpperCase (name alg)) :typ "JWS"})
-      (json/generate-string)
-      (codecs/str->bytes)
-      (codecs/bytes->safebase64)))
-
-(defn- make-claims
+  [alg extra]
+  (let [algorithm (.toUpperCase (name alg))]
+    (-> (merge {:alg algorithm :typ "JWS"} extra)
+        (json/generate-string)
+        (codecs/str->bytes)
+        (codecs/bytes->safebase64))))
+
+(defn- encode-claims
   "Encode jws claims."
   [input exp nbf iat]
   (-> (normalize-nil-claims {:exp exp :nbf nbf :iat iat})
@@ -129,14 +133,14 @@
 (defn- get-verifier-for-algorithm
   "Get verifier function for algorithm name."
   [^Keyword alg]
-  (when (contains? gsign/*signers-map* alg)
-    (get-in gsign/*signers-map* [alg :verifier])))
+  (when (contains? *signers-map* alg)
+    (get-in *signers-map* [alg :verifier])))

 (defn- get-signer-for-algorithm
   "Get signer function for algorithm name."
   [^Keyword alg]
-  (when (contains? gsign/*signers-map* alg)
-    (get-in gsign/*signers-map* [alg :signer])))
+  (when (contains? *signers-map* alg)
+    (get-in *signers-map* [alg :signer])))

 (defn- safe-encode
   "Properly encode string into
@@ -146,7 +150,7 @@
       (codecs/str->bytes)
       (codecs/bytes->safebase64)))

-(defn- make-signature
+(defn- calculate-signature
   "Make a jws signature."
   [pkey alg header claims]
   (let [candidate (str/join "." [header claims])
@@ -154,35 +158,63 @@
     (-> (signer candidate pkey)
         (codecs/bytes->safebase64))))

-(defn sign
-  "Sign arbitrary length string/byte array using json web signature."
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Public Api
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn encode
+  "Sign arbitrary length string/byte array using
+  json web token/signature."
   [claims pkey & [{:keys [alg exp nbf iat headers] :or {alg :hs256 headers {}}}]]
   {:pre [(map? claims)]}
-  (let [headers-data (make-headers alg headers)
-        claims-data  (make-claims claims exp nbf iat)
-        signature    (make-signature pkey alg headers-data claims-data)]
-    (str/join "." [headers-data claims-data signature])))
-
-(defn unsign
-  "Unsings jws and return clear caims as clojure map."
+  (let [header (encode-header alg headers)
+        claims (encode-claims claims exp nbf iat)
+        signature (calculate-signature pkey alg header claims)]
+    (either/right (str/join "." [header claims signature]))))
+
+(defn decode
+  "Given a signed message, verify it and return
+  the decoded claims.
+
+  This function returns a monadic either instance,
+  and if some error is happens in process of decoding
+  and verification, it will be reported in an
+  either/left instance."
   [input pkey & [{:keys [maxage] :as opts}]]
   {:pre [(string? input)]}
-  (let [[header claims signature] (str/split input #"\." 3)]
-    (maybe-let [candidate (str/join "." [header claims])
-                header    (parse-header header)
-                claims    (parse-claims claims)
-                algorithm (parse-algorithm header)
-                signature (codecs/safebase64->bytes signature)
-                verifier  (get-verifier-for-algorithm algorithm)
-                now       (-> (jodat/now) (to-timestamp))]
-      (when-let [isok? (verifier candidate signature pkey)]
-        (maybe-let [_ (if (:exp claims)
-                        (or (< now (:exp claims)) nil)
-                        true)
-                    _ (if (:nbf claims)
-                        (or (< now (:nbf claims)) nil)
-                        true)
-                    _ (if (and (:iat claims) maxage)
-                        (or (< (- now (:iat claims)) maxage) nil)
-                        true)]
-          claims)))))
+  (let [[header claims signature] (str/split input #"\." 3)
+        candidate (str/join "." [header claims])
+        header (parse-header header)
+        claims (parse-claims claims)
+        algorithm (parse-algorithm header)
+        signature (codecs/safebase64->bytes signature)
+        verifier (get-verifier-for-algorithm algorithm)
+        result (verifier candidate signature pkey)]
+    (if (false? result)
+      (either/left "Invalid token.")
+      (let [now (to-timestamp (jodat/now))]
+        ;; (println 2222 (> now (:exp claims)))
+        (cond
+          (and (:exp claims) (> now (:exp claims)))
+          (either/left (format "Token is older than :exp (%s)" (:exp claims)))
+
+          (and (:nbf claims) (> now (:nbf claims)))
+          (either/left (format "Token is older than :nbf (%s)" (:nbf claims)))
+
+          (and (:iat claims) (number? maxage) (< (- now (:iat claims)) maxage))
+          (either/left (format "Token is older than :iat (%s)" (:iat claims)))
+
+          :else
+          (either/right claims))))))
+
+(defn sign
+  "Not monadic version of encode."
+  [& args]
+  (either/from-either (apply encode args)))
+
+(defn unsign
+  "Not monadic version of decode."
+  [& args]
+  (let [result (apply decode args)]
+    (when (either/right? result)
+      result)))


Aded proper xmlns support for elements (via binding *xml-namespaces*). Removed unnecessary cals to get-dom-node.

--- src/clojure/freactive/dom.cljs
+++ src/clojure/freactive/dom.cljs
@@ -106,11 +106,10 @@

 (defn- dispose-node
   ([dom-node]
-   (println "disposing" dom-node)
-   (time
-     (let [node-id (get-node-id dom-node)
-           state (aget element-state-lookup node-id)]
-       (dispose-node node-id state))))
+   ;(println "disposing" dom-node)
+   (let [node-id (get-node-id dom-node)
+         state (aget element-state-lookup node-id)]
+     (dispose-node node-id state)))
   ([child-key state]
    (when state
      (set! (.-disposed state) true)
@@ -329,13 +328,22 @@
        :private true}
      re-tag #"([^\s\.#]+)(?:#([^\s\.#]+))?(?:\.([^\s#]+))?")

+(def ^:dynamic *xml-namespaces* nil)
+
+(defn- get-xml-namespace [kw-ns]
+  (let [xmlns (get *xml-namespaces* kw-ns)]
+    (assert xmlns (str "Don't know how to handle namespace " kw-ns))))
+
 (defn- create-dom-node [kw]
   (let [tag-ns (namespace kw)
         [_ tag id class] (re-matches re-tag (name kw))
-        node (case tag-ns
-               "svg" (.createElementNS js/document "http://www.w3.org/2000/svg" tag)
-               nil (.createElement js/document tag)
-               (assert false (str "Don't know how to handle tag ns " tag-ns)))]
+        node (if tag-ns
+               (let [resolved-ns
+                     (if (= tag-ns "svg")
+                       "http://www.w3.org/2000/svg"
+                       (get-xml-namespace tag-ns))]
+                 (.createElementNS js/document resolved-ns tag))
+               (.createElement js/document tag))]
     (when id (set! (.-id node) id))
     (when class (set! (.-className node) (.replace class "." " ")))
     node))
@@ -348,7 +356,8 @@
   (= (.-nodeType dom-node) 3))

 (defn- replace-child [parent new-elem-spec cur-elem]
-  (let [cur-dom-node (get-dom-node cur-elem)
+  (let [cur-dom-node cur-elem                                       ;;
+  ;; (get-dom-node cur-elem)
         new-virtual-dom (get-virtual-dom new-elem-spec)]
     (if (and
           (string? new-virtual-dom)
@@ -359,8 +368,10 @@
         cur-elem)
       (let [new-elem (build-element new-elem-spec)]
         (.replaceChild
-          (get-dom-node parent)
-          (get-dom-node new-elem)
+          ;(get-dom-node parent)
+          ;(get-dom-node new-elem)
+          parent
+          new-elem
           cur-dom-node)
         (dispose-node cur-dom-node)
         new-elem))))
@@ -368,7 +379,8 @@
 (defn- append-child [parent new-elem]
   (let [new-elem (build-element new-elem)]
     (.appendChild
-      (get-dom-node parent)
+      ;(get-dom-node parent)
+      parent
       new-elem)
     new-elem))

@@ -403,7 +415,9 @@
      (do-show-element parent new-elem cur-elem))))

 (defn- clear-children! [parent]
-  (let [dom-node (get-dom-node parent)]
+  (let [dom-node parent
+  ;(get-dom-node parent)
+        ]
     (loop []
       (let [last-child (.-lastChild dom-node)]
         (when last-child
@@ -541,6 +555,8 @@
     node))

 (defn mount! [element child]
-  (when-let [last-child (.-lastChild (get-dom-node element))]
+  (when-let [last-child (.-lastChild element
+                        ;; (get-dom-node element)
+                          )]
     (remove! last-child))
   (append-child! element child))


Added support for converting numbers, booleans and nils to virtual DOM as strings. Fixes #13.

--- src/clojure/freactive/dom.cljs
+++ src/clojure/freactive/dom.cljs
@@ -30,11 +30,14 @@
 (defn- get-element-state [x]
   ;;(get element-state-lookup x)
   (when-let [node-id (get-node-id x)]
-    (aget element-state-lookup node-id))
-  )
+    (aget element-state-lookup node-id)))
+
+(extend-protocol IElementSpec
+  boolean
+  (-get-virtual-dom [x] (str x)))

 (defn- get-virtual-dom [x]
-  (when x
+  (if x
     (cond
       (dom-node? x)
       (when-let [state (get-element-state x)]
@@ -44,7 +47,12 @@

       (vector? x) x

-      :default (-get-virtual-dom x))))
+      (number? x) (str x)
+
+      :default (-get-virtual-dom x))
+
+    ;; nil values treated as empty "placeholder" text nodes
+    ""))

 (defn- reset-element-spec! [dom-node spec]
   (set! (.-element-spec (get-element-state dom-node)) spec))


Clear LWJGL key buffer when control is lifted

--- src/clojure/nightmod/input.clj
+++ src/clojure/nightmod/input.clj
@@ -5,6 +5,8 @@
            [nightmod KeyCodeConverter]
            [org.lwjgl.input Keyboard]
            [org.lwjgl.opengl InputImplementation]))
+
+(def ^:const meta-keys #{KeyEvent/VK_CONTROL KeyEvent/VK_META})

 (defn awt->lwjgl
   "Translates key code from AWT to LWJGL."
@@ -32,10 +34,10 @@
       (reify KeyListener
         (keyReleased [this e]
           ; clear the LWJGL key buffer
-          ; when the OS X command key is lifted, we must clear it
-          ; completely because it seems to swallow keyReleased events
+          ; when a meta key is lifted, we must clear it completely
+          ; to prevent it from getting "stuck"
           (.set impl-field nil impl)
-          (if (= (.getKeyCode e) KeyEvent/VK_META)
+          (if (contains? meta-keys (.getKeyCode e))
             (doseq [i (range (.capacity key-buf))]
               (.put key-buf i (byte 0)))
             (.put key-buf (awt->lwjgl (.getKeyCode e)) (byte 0)))


Re-assemble images on read

Re-assemble images on read

--- src/doctopus/db.clj
+++ src/doctopus/db.clj
@@ -98,6 +98,12 @@
   (prepare add-updated)
   (prepare ->shallow-snake-keys)
   (transform ->kebab-keys)
+  (transform (fn [ent]
+               (if (= (:body ent) :image)
+                 (-> ent
+                     (assoc :body (:image ent))
+                     (dissoc :image))
+                 (dissoc ent :image))))
   (belongs-to tentacles)
   (entity-fields :name :uri :tentacle_name :body))


Fixed linting errors.

Fixed linting errors.

--- src/dragon/util.clj
+++ src/dragon/util.clj
@@ -183,8 +183,8 @@
 (defn boolean
   "A filter that returns `true` if the post should be published on the front
   page."
-  [post key]
-  (if (= (string/lower-case (or (key post) "")) "false")
+  [post bool-key]
+  (if (= (string/lower-case (or (bool-key post) "")) "false")
     false
     true))


Changed eastwood options for 0.2.0.

Changed eastwood options for 0.2.0.

--- src/gbu/webhook.clj
+++ src/gbu/webhook.clj
@@ -7,6 +7,7 @@
   (:import java.io.File))

 (def github-basic-auth (or (System/getenv "GITHUB_BASIC_AUTH") ""))
+(def warnings-file "eastwood-results.txt")

 (defn clone-repo
   [url sha]
@@ -21,11 +22,12 @@

 (defn- run-eastwood
   [path]
-  (let [lein      (popen/popen ["lein" "eastwood" "{:results-file true}"] :redirect true :dir path)
+  (let [opts      (str "{:out \"" warnings-file "\" :warning-format :map-v2}")
+        lein      (popen/popen ["lein" "eastwood" opts] :redirect true :dir path)
         _         (println "Running eastwood...")
         code      (popen/join lein)]
     (when-not (zero? code)
-      (let [results-txt (slurp (str path "/eastwood-results.txt"))]
+      (let [results-txt (slurp (str path "/" warnings-file))]
         (read-string (str "[" results-txt "]"))))))

 (defn- result-full-path


Remove last traces of node-webkit menu

Remove last traces of node-webkit menu

Menu doesn't have a type property so there isn't a need for create-menu.
MenuItem doesn't have :key or :modifiers

--- src/lt/objs/menu.cljs
+++ src/lt/objs/menu.cljs
@@ -11,13 +11,6 @@
 (def remote (js/require "remote"))
 (def Menu (.require remote "menu"))
 (def MenuItem (.require remote "menu-item"))
-
-(defn create-menu
-  ([] (create-menu nil))
-  ([type]
-     (if type
-       (Menu. (js-obj "type" type))
-       (Menu.))))

 (declare submenu)

@@ -38,7 +31,7 @@
     (MenuItem. (clj->js opts))))

 (defn submenu [items]
-  (let [menu (create-menu)]
+  (let [menu (Menu.)]
     (doseq [i items
             :when i]
       (.append menu (menu-item i)))
@@ -124,19 +117,19 @@
                                        {:label "Hide Others" :accelerator "Command+Alt+H" :selector "hideOtherApplications:"}
                                        {:type "separator"}
                                        (cmd-item "Quit Light Table" :quit {:accelerator "Command+Q"})]})
-                {:label "File" :submenu [(cmd-item "New file" :new-file {:key "n"})
-                                         (cmd-item "Open file" :open-file {:key "o" :modifiers "cmd-shift"})
+                {:label "File" :submenu [(cmd-item "New file" :new-file)
+                                         (cmd-item "Open file" :open-file)
                                          {:label "Open folder" :click #(do
                                                                          (cmd/exec! :workspace.show :force)
                                                                          (cmd/exec! :workspace.add-folder))}
                                          (cmd-item "Open recent workspace" :workspace.show-recents {})
-                                         (cmd-item "Save file" :save {:key "s"})
-                                         (cmd-item "Save file as.." :save-as {:key "s" :modifiers "cmd-shift"})
-                                         {:type "separator"}
-                                         (cmd-item "New window" :window.new {:key "n" :modifiers "cmd-shift"})
-                                         (cmd-item "Close window" :window.close {:key "w" :modifiers "cmd-shift"})
-                                         {:type "separator"}
-                                         (cmd-item "Close file" :tabs.close {:key "w"})
+                                         (cmd-item "Save file" :save)
+                                         (cmd-item "Save file as.." :save-as)
+                                         {:type "separator"}
+                                         (cmd-item "New window" :window.new)
+                                         (cmd-item "Close window" :window.close)
+                                         {:type "separator"}
+                                         (cmd-item "Close file" :tabs.close)
                                          ]}
                 (if (platform/mac?)
                   {:label "Edit" :submenu [(cmd-item "Undo" :editor.undo {:selector "undo:" :accelerator "CommandOrControl+Z"})


no need to save the removing-chan code

no need to save the removing-chan code

--- src/tranjlator/chat_room.clj
+++ src/tranjlator/chat_room.clj
@@ -23,13 +23,7 @@
   [pub user-name user-chan topics]
   (doseq [t +user-default-topics+]
     (a/sub pub t user-chan))
-  user-chan
-
-  ;; (let [removing-chan (chan 10 (remove-own-chats user-name))]
-  ;; (a/pipe removing-chan user-chan)
-  ;; (a/sub pub t removing-chan)
-  ;; removing-chan)
-  )
+  user-chan)

 (defrecord ChatRoom
     [initial-users initial-history pub-chan process-chan]


/ping commands should render regardless of existence of target.

--- src/tranjlator/chat_room.clj
+++ src/tranjlator/chat_room.clj
@@ -202,8 +202,8 @@
                          (log/warn "ChatRoom shutting down due to \"clojure\" channel closing")))
             ping ([{:keys [text target language user-name] :as msg}]
                     (if-not (nil? msg)
-                      (do (when-let [target-chan (get users target)]
-                            (>! pub-chan (msg/->chat user-name language text "ping"))
+                      (do (>! pub-chan (msg/->chat user-name language text "ping"))
+                          (when-let [target-chan (get users target)]
                             (>! target-chan msg))
                           (recur users history translators try-clj-cookie))
                       (log/warn "ChatRoom shutting down due to \"ping\" channel closing"))))))))


update misaki.server to print message when compile is finished

--- src/misaki/server.clj
+++ src/misaki/server.clj
@@ -57,7 +57,8 @@
             (print-compile-result (str tag-name " tag") (compile-tag tag-name))))
       (do (print-compile-result "all templates" (every? #(compile-template %) tmpls))
           (print-compile-result "all tags"      (every? #(compile-tag (:name %)) tags))))
-    (print-compile-result "clojurescripts" (compile-clojurescripts))))
+    (print-compile-result "clojurescripts" (compile-clojurescripts))
+    (println " * Finish Compiling")))

 ; =do-compile
 (defn do-compile
@@ -85,7 +86,8 @@
         ; compile tag
         (if-let [tags (-> file parse-template-option :tag)]
           (doseq [{tag-name :name} tags]
-            (print-compile-result "tag" (compile-tag tag-name))))))))
+            (print-compile-result "tag" (compile-tag tag-name)))))
+      (println " * Finish Compiling"))))

 ;; ## Template Watcher


msg does not exists

msg does not exists

--- src/hooks/hubot.clj
+++ src/hooks/hubot.clj
@@ -15,7 +15,7 @@

 (defn notify-hubot
   "notify a hubot instance that a machine is up"
-  [{:keys [event workflow system-id hubot-host msg]}]
+  [{:keys [event workflow system-id hubot-host]}]
   {:pre [hubot-host]}
   (client/post (<< "~{hubot-host}/hubot/creation-notify")
                {:body (<< "{\"id\": \"~{system-id}\", \"msg\": \"~(reply workflow event)\"}")


fixing test

fixing test

--- src/hydrox/core.clj
+++ src/hydrox/core.clj
@@ -63,7 +63,7 @@
                   (util/all-files project :test-paths ".clj"))))

 (defn start-regulator
-  [obj]
+  [{:keys [project state] :as obj}]
   (let [folio (-> (create-folio project)
                   (init-folio))]
     (mount-folio state folio)
@@ -73,7 +73,7 @@
     obj))

 (defn stop-regulator
-  [obj]
+  [{:keys [project state] :as obj}]
   (unmount-folio @state)
   (reset! state nil)
   (event/signal [:log {:msg (str "Regulator for " (:name project) " stopped.")}])


add make task to copy changed files to cache

--- tasklib/src/migae/boot_gae.clj
+++ tasklib/src/migae/boot_gae.clj
@@ -25,6 +25,18 @@
   ;; (let [mod (-> (boot/get-env) :gae :module :name)]
   ;;   (str (if mod (str mod "/")) "WEB-INF")))

+;; http://stackoverflow.com/questions/2751033/clojure-program-reading-its-own-manifest-mf
+(defn manifest-map
+  "Returns the mainAttributes of the manifest of the passed in class as a map."
+  [j]
+  (println "JAR: " j (type j))
+  (->> (str "jar:file:" j "!/META-INF/MANIFEST.MF")
+       clojure.java.io/input-stream
+       java.util.jar.Manifest.
+       .getMainAttributes
+       (map (fn [[k v]] [(str k) v]))
+       (into {})))
+
 (defn expand-home [s]
   (if (or (.startsWith s "~") (.startsWith s "$HOME"))
     (str/replace-first s "~" (System/getProperty "user.home"))
@@ -33,11 +45,11 @@
 (def sdk-string (let [jars (pod/resolve-dependency-jars (boot/get-env) true)
                       zip (filter #(.startsWith (.getName %) "appengine-java-sdk") jars)]
                   (if (empty? zip)
-                    nil
+                    (println "appengine-java-sdk zipfile not found")
                     (let [fname (first (for [f zip] (.getName f)))
                           sdk-string (subs fname 0 (.lastIndexOf fname "."))]
                       ;; (println "sdk-string: " sdk-string)
-                     sdk-string))))
+                      sdk-string))))

 (def config-map (merge {:build-dir "target"
                         :sdk-root (let [dir (str (System/getenv "HOME") "/.appengine-sdk")]
@@ -336,8 +348,7 @@
         ]
     (comp
      (boot/with-pre-wrap [fileset]
-       (let [web-xml-edn-files (->> (boot/fileset-diff @prev-pre fileset)
-                                    boot/input-files
+       (let [web-xml-edn-files (->> (boot/user-files fileset)
                                     (boot/by-re [(re-pattern (str web-xml-edn "$"))]))
                     ;; (boot/by-name [web-xml-edn]))
              web-xml-edn-f (condp = (count web-xml-edn-files)
@@ -351,9 +362,8 @@
              fileset
              (do
                ;; (add-appstats! reloader-impl-ns urls in-file out-file)
-               (let [appstats-fs (->> (boot/fileset-diff @prev-pre fileset)
-                                     boot/input-files
-                                     (boot/by-name [appstats-edn]))]
+               (let [appstats-fs (->> (boot/input-files fileset)
+                                      (boot/by-name [appstats-edn]))]
                  (if (> (count appstats-fs) 1)
                    (throw (Exception. (str "only one " appstats-edn " file allowed"))))
                  (if (= (count appstats-fs) 0)
@@ -372,6 +382,39 @@
                            (boot/add-source edn-tmp)
                            boot/commit!))))))

+(boot/deftask cache
+  "control cache: retrieve, save, clean"
+  [c clean bool "clean config - clear cache first"
+   t trace bool "dump cache to stdout if verbose=true"
+   r retrieve bool "retrieve cached master edn config file and sync to fileset (default)"
+   s save bool "save master edn config file from fileset to cache"
+   v verbose bool "verbose"]
+  ;; default to retrieve
+  (if (and retrieve save)
+    (util/exit-error
+     (util/fail "boot-gae/cache: only one of :retrieve and :save may be specified\n")))
+  (let [retrieve (or retrieve (not save))
+        save (or (not retrieve) save)]
+    (boot/with-pre-wrap fileset
+      (let [cache-dir (boot/cache-dir! :boot-gae/build)]
+        (if verbose (println "cache-dir: " (.getPath cache-dir)))
+        (if clean
+          (do (if verbose (util/info (str "Clearing boot-gae cache\n")))
+              (boot/empty-dir! cache-dir)
+              (boot/commit! fileset))
+          (if retrieve
+            (do (println "RETRIEVING " (type cache-dir))
+                (let [;;fs (boot/add-cached-asset fileset (io/file "boot-gae/build") identity)
+                      fs (boot/add-asset fileset cache-dir)]
+                  #_(println "FS: " fs)
+                  (boot/commit! fs)))
+            (if save
+              (let [_ (println "SAVING")
+                    fs (into [] (boot/output-dirs fileset))]
+                ;;(println "fs: " fs (type fs))
+                (apply boot/sync! cache-dir fs)
+                fileset)
+              fileset)))))))

 ;; FIXME: generate correct reloaders. do it by hand for now
 (boot/deftask ear
@@ -382,15 +425,87 @@
    v verbose bool "Print trace messages."]
   (println "EAR: " modules)
   (let [paths (set (map #(:war %) modules))
-        m (or meta-inf "./")]
-        ;; pipeline (map #(reloader :module (:name %)) modules)]
-    (println "META-INF:" m)
+        m (or meta-inf "./")
+        tmpdir (boot/tmp-dir!)
+
+        dfl-scopes #{"compile" "runtime" "provided"}
+        scopes dfl-scopes
+        ;; scopes     (-> dfl-scopes
+        ;;                (set/union include-scope)
+        ;;                (set/difference exclude-scope))
+        scope?     #(contains? scopes (:scope (util/dep-as-map %)))
+        checkouts  (->> (boot/get-checkouts)
+                        (filter (comp scope? :dep val))
+                        (into {}))
+        co-jars    (->> checkouts (map (comp :jar val)))
+        co-dirs    (->> checkouts (map (comp :dir val)))
+
+        ;; coords '[tmp/greetings "0.1.0-SNAPSHOT"]
+        ;; jar-path (pod/resolve-dependency-jar (boot/get-env) coords)
+        jar-path (.getPath (first co-jars))
+        target-path "greetings"
+
+        out (io/file (.getPath tmpdir) target-path)
+
+        ;; pod-env (update-in (boot/get-env) [:dependencies]
+        ;;                    #(identity %2)
+        ;;                    (concat '[[boot/aether "2.6.0-SNAPSHOT"]
+        ;;                              [boot/core "2.6.0-SNAPSHOT"]
+        ;;                              [boot/pod "2.6.0-SNAPSHOT"]
+        ;;                              [tmp/greetings "0.1.0-SNAPSHOT"]]))
+        ;;                              ;; (vector coords)))
+        ;; ear-pod (future (pod/make-pod pod-env))
+        ]
+    (println "boot-env deps: " (:dependencies (boot/get-env)))
+    ;; (println "pod-env deps: " (:dependencies pod-env))
+    (println "jar-path:" jar-path)
+    (println "out path:" out)
+    (println "checkouts: " checkouts)
+    (println "co-jars: " (type (first co-jars)))
+    (println "co-dirs: " co-dirs)
+    ;; (builtin/sift :move {(re-pattern (.getPath (first co-dirs))) "foobar"})
+    ;; (builtin/sift :add-asset #{"foobar"})
     (comp
-     (builtin/sift :add-asset #{m}
-                   :include #{#"^META-INF.*$"})
-     (builtin/sift :add-asset paths)
-     ;; (apply comp pipeline)
-     (builtin/target))))
+     (builtin/sift :add-asset #{(.getPath (first co-dirs))})
+     (builtin/sift :move {#"(^.*)" "foo/$1"})
+     (builtin/sift :add-asset #{"assets"}))
+    ))
+    ;; #_(comp
+    ;;  (boot/with-pre-wrap [fileset]
+    ;;    (pod/unpack-jar jar-path out)
+    ;;    (-> fileset
+    ;;        (boot/add-asset tmpdir)
+    ;;        boot/commit!))
+    ;;  (builtin/sift :include #{#"greetings.*META-INF.*$"} :invert true)
+
+    ;;  #_(boot/with-pre-wrap [fileset]
+    ;;    (pod/with-eval-in @ear-pod
+    ;;      (require '[boot.pod :as pod]
+    ;;               '[boot.core :as boot]
+    ;;               '[boot.util :as util]
+    ;;               '[boot.task.built-in :as builtin]
+    ;;               '[clojure.java.io :as io])
+    ;;      ;; (boot/with-pre-wrap [fs]
+    ;;      (let [jar-path ~(pod/resolve-dependency-jar (boot/get-env) coords)
+    ;;            out (io/file ~(.getPath tmpdir) ~target-path)
+    ;;            ]
+    ;;        (println (str "jar-path 2:" jar-path))
+    ;;        (println (str "module: " (get ~(manifest-map jar-path) "module")))
+    ;;        (println (str "out:" out))
+    ;;        (pod/unpack-jar jar-path out)))
+    ;;    (-> fileset
+    ;;        (boot/add-asset tmpdir)
+    ;;        boot/commit!))
+    ;;  #_(builtin/sift :include #{#"greetings.*META-INF.*$"} :invert true)
+    ;;  )))
+
+  ;;  (builtin/show :fileset true))
+      ;; fileset)))
+
+      ;;    #_(builtin/sift :add-asset paths)
+      ;;    ;; (apply comp pipeline)
+      ;;    #_(builtin/target)))
+      ;; fileset)))

 (boot/deftask deploy
   "Installs a new version of the application onto the server, as the default version for end users."
@@ -490,9 +605,8 @@
              fileset
              (do
                ;; step 0: read the edn files
-               (let [filters-edn-files (->> (boot/fileset-diff @prev-pre fileset)
-                            boot/input-files
-                            (boot/by-name [filters-edn]))]
+               (let [filters-edn-files (->> (boot/input-files fileset)
+                                            (boot/by-name [filters-edn]))]
                  (if (> (count filters-edn-files) 1)
                    (throw (Exception. "only one filters.edn file allowed")))
                  (if (= (count filters-edn-files) 0)
@@ -543,9 +657,9 @@
    v verbose bool "Print trace messages"]
   ;;NB: java property expected by kickstart is "appengine.sdk.root"
   ;; (print-task "install-sdk" *opts*)
-  (let [release (or release "LATEST")
+  (let [release (or release "RELEASE")
         coords (vector 'com.google.appengine/appengine-java-sdk
-                       "LATEST"
+                       "RELEASE"
                        :extension "zip")
         jar-path (pod/resolve-dependency-jar (boot/get-env) coords)
         sdk-dir (io/as-file (:sdk-root config-map))
@@ -557,7 +671,7 @@
                 tools-api-jar (str/join file-sep [(:sdk-root config-map) "lib" "appengine-tools-api.jar"])]
             (if (not (.exists (io/as-file tools-api-jar)))
               (do
-                (println "Found sdk-dir but not its contents; re-exploding")
+                (println (str "Found sdk-dir " sdk-dir " but not its contents; re-exploding"))
                 (boot/empty-dir! sdk-dir)
                 (println "Exploding SDK\n from: " jar-path "\n to: " (.getPath sdk-dir))
                 (pod/unpack-jar jar-path (.getParent sdk-dir)))
@@ -569,12 +683,13 @@
           (pod/unpack-jar jar-path (.getParent sdk-dir))))
       fileset)))

+;; FIXME:  for dev phase, we want to include deps in test scope
 (boot/deftask libs
   ""
   [v verbose bool "Print trace messages."]
   (comp
-   (builtin/uber :as-jars true)
-   (builtin/sift :include #{#"zip$"} :invert true)
+   (builtin/uber :as-jars true :exclude-scope #{"provided"})
+   ;; (builtin/sift :include #{#"zip$"} :invert true)
    ;; (builtin/sift :include #{#".*appengine-api-.*jar$"} :invert true)
    (builtin/sift :move {#"(.*\.jar$)" (str lib-dir "/$1")})))

@@ -852,9 +967,8 @@
              fileset
              (do
                ;; step 0: read the edn files
-               (let [servlets-edn-files (->> (boot/fileset-diff @prev-pre fileset)
-                            boot/input-files
-                            (boot/by-name [servlets-edn]))]
+               (let [servlets-edn-files (->> (boot/input-files fileset)
+                                             (boot/by-name [servlets-edn]))]
                  (if (> (count servlets-edn-files) 1)
                    (throw (Exception. "only one servlets.edn file allowed")))
                  (if (= (count servlets-edn-files) 0)
@@ -955,13 +1069,14 @@
           (builtin/sift :move {#"(.*\.clj$)" (str mod "/" classes-dir "/$1")})
           (builtin/target :no-clean true))))

-(boot/deftask dev
+(boot/deftask assemble
   "make a dev build - including reloader"
   [k keep bool "keep intermediate .clj and .edn files"
    v verbose bool "verbose"]
   (let [keep (or keep false)
         verbose (or verbose false)
         mod (str (-> (boot/get-env) :gae :module))]
+    ;; (println "MODULE: " mod)
     (comp (install-sdk)
           (libs :verbose verbose)
           (logging :verbose verbose)
@@ -976,6 +1091,53 @@
           (builtin/sift :move {#"(.*\.class$)" (str classes-dir "/$1")})
           (builtin/target :dir #{(str "target/" mod)})
           )))
+
+(boot/deftask build
+  "dev build, source only"
+  [k keep bool "keep intermediate .clj and .edn files"
+   v verbose bool "verbose"]
+  (let [keep (or keep false)
+        verbose (or verbose false)
+        mod (str (-> (boot/get-env) :gae :module))]
+    (println "MODULE: " mod)
+    (comp ;; (install-sdk)
+          (logging :verbose verbose)
+          (appstats :verbose verbose)
+          (builtin/javac)
+          (reloader :keep keep :verbose verbose)
+          (filters :keep keep :verbose verbose)
+          (servlets :keep keep :verbose verbose)
+          (webxml :verbose verbose)
+          (appengine :verbose verbose)
+          (builtin/sift :move {#"(.*clj$)" (str classes-dir "/$1")})
+          (builtin/sift :move {#"(.*\.class$)" (str classes-dir "/$1")})
+          ;; FIXME: use cache instead?
+          ;; (builtin/target :dir #{(str "target/" mod)})
+          )))
+
+(boot/deftask make
+  "dev build, source only"
+  [v verbose bool "verbose"]
+  (let [mod (str (-> (boot/get-env) :gae :module))
+        rgx (re-pattern (str "(^" mod "/.*clj$)"))
+        prev (atom nil)]
+    (println "MODULE: " mod)
+    (println "REGEX: " rgx)
+    ;; (comp
+    (boot/with-pre-wrap [fileset]
+      (let [changes (->> (boot/fileset-diff @prev fileset)
+                         boot/output-files
+                         (map :path))
+            fs (boot/new-fileset)
+            cache-dir (boot/cache-dir! :boot-gae/build)]
+        (doseq [path changes]
+          (if verbose (util/info (str "changed: " path "\n")))
+          (let [in-file (boot/tmp-file (boot/tmp-get fileset path))
+                out-file (if (str/ends-with? path "clj")
+                           (doto (io/file cache-dir classes-dir path) io/make-parents)
+                           (doto (io/file cache-dir path) io/make-parents))]
+            (io/copy in-file out-file))))
+      (reset! prev fileset))))

 (boot/deftask prod
   "make a prod build"


using simple query

using simple query

--- src/ophion/search.clj
+++ src/ophion/search.clj
@@ -36,8 +36,10 @@
       (name index)
       (name mapping)
       :query
-      {:match
-       {:_all query}}
+      {:simple_query_string
+       {:query query}}
+      ;; {:match
+      ;;  {:_all query}}
       :size 1000)
      [:hits :hits])))


Delete iolist.clj

Delete iolist.clj

--- src/iyye/iolist.clj
+++ src/iyye/iolist.clj
@@ -1,38 +0,0 @@
-; Iyye - AI agent
-; Copyright (C) 2016-2017  Sasha Yumzya
-
-; This program is free software: you can redistribute it and/or modify
-; it under the terms of the GNU Affero General Public License as
-; published by the Free Software Foundation, either version 3 of the
-; License, or (at your option) any later version.
-
-; This program is distributed in the hope that it will be useful,
-; but WITHOUT ANY WARRANTY; without even the implied warranty of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-; GNU Affero General Public License for more details.
-
-; You should have received a copy of the GNU Affero General Public License
-; along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-(ns iyye.iolist
-  (:require [extras.lispychat :as lispychat]
-            [iyye.persistence :as persistence]
-            [clojure.tools.logging :as log]))
-
-(def AvatarsIOList (ref ()))
-
-(defn init-avatars-list []
-  (dosync
-    (alter AvatarsIOList conj lispychat/lispy-chat-IO)))
-
-(defn init-io []
-  (letfn [(start-all [l]
-            (doall (for [func (map :start-function l) :when func] (func))))]
-    (doall [
-      (init-avatars-list)
-      (start-all @AvatarsIOList)
-      (start-all (:inputs-list @AvatarsIOList))
-      (start-all (:outputs-list @AvatarsIOList))])))
-
-(defn load-io-state []
-  )


fix import in tests

fix import in tests

--- test/bifurcan/durable_test.clj
+++ test/bifurcan/durable_test.clj
@@ -36,7 +36,7 @@
     Util
     BlockPrefix
     BlockPrefix$BlockType
-    DurableAccumulator
+    AccumulatorOutput
     ChunkSort]))

 (set! *warn-on-reflection* true)
@@ -94,7 +94,7 @@

 (defspec test-vlq-roundtrip iterations
   (prop/for-all [n gen-pos-int]
-    (let [out (doto (DurableAccumulator.)
+    (let [out (doto (AccumulatorOutput.)
                 (.writeVLQ n))
           in  (->> out
                 .contents
@@ -107,7 +107,7 @@
 (defspec test-prefixed-vlq-roundtrip iterations
   (prop/for-all [n gen-pos-int
                  bits (gen/choose 0 6)]
-    (let [out (DurableAccumulator.)
+    (let [out (AccumulatorOutput.)
           _   (Util/writePrefixedVLQ 0 bits n out)
           in  (->> out .contents DurableInput/from)]
       (try
@@ -122,7 +122,7 @@
                  type (->> (BlockPrefix$BlockType/values)
                         (map gen/return)
                         gen/one-of)]
-    (let [out (DurableAccumulator.)
+    (let [out (AccumulatorOutput.)
           p   (BlockPrefix. n type)
           _   (.encode p out)
           in  (->> out .contents DurableInput/from)]


Updated streamable to remove database updating code

--- streamable.clj
+++ streamable.clj
@@ -14,122 +14,30 @@
          '[clj-http.client :as http]
          '[throttler.core :refer [throttle-fn]])

-(def sqll (kdb/sqlite3 {:db "movies.db"}))
+(def sqll (kdb/sqlite3 {:db "episodes.db"}))
 (kdb/defdb db sqll)
-(kcore/defentity movies)
-
-(def movie-ids
-  (reduce
-    (fn [ids record]
-      (assoc
-        ids
-        (:episode_id record)
-        {:imdb (:imdb_id record)
-         :cisi (:cisi_id record)
-         :rt (:rt_id record)}))
-    {}
-    (kcore/select movies)))
-
-(defn sanitize-title [title]
-  (-> title
-      (clojure.string/replace #"(?i:at nerdtacular \d+)" "")
-      (clojure.string/replace #"(?i:live (watch|sack|viewing)( of)?)" "")
-      (clojure.string/replace #"(?:\(?LIVE\)?)" "")
-      (clojure.string/replace #"(?:NEWER)" "")
-      (clojure.string/replace #"(?i:commentary track( edition)?)" "")
-      (clojure.string/replace #"(?i:(: )?bonus sack:?)" "")
-      (clojure.string/replace #"(?i:the one about)" "")
-      (clojure.string/replace #"\s+" " ")
-      (clojure.string/trim)))
-
-(defn parse-title [ep]
-  (let [normal-title
-          #"Film Sack \#?(\d+):\s*[\"|“]?([^\"\!”]+)[\!]?[\"|”]?\s*"
-        bonus-sack-title
-          #"BONUS SACK:  Commentary Track for ()[\"|“]?([^\"\!”]+)[\!]?[\"|”]?\s*"
-        commentary-title
-          #"Film Sack COMMENTARY TRACK: ()[\"|“]?([^\"\!”]+)[\!]?[\"|”]?\s*"
-        title (:title ep)
-        parsed (or
-                 (re-matches normal-title title)
-                 (re-matches bonus-sack-title title)
-                 (re-matches commentary-title title))]
-    (when parsed
-      (assoc
-        ep
-        :episode-id (when
-                      (not= (second parsed) "")
-                      (Integer. (second parsed)))
-        :media-title (sanitize-title (last parsed))))))
-
-(defn get-episodes []
-  (->> "http://feeds.frogpants.com/filmsack_feed.xml"
-       feedparser/parse-feed
-       :entries
-       (map #(select-keys % [:title :pubDate]))
-       (keep parse-title)))
-
-(defn extract-imdb-id [movie-data]
-  (when-let
-    [url (-> movie-data :links :imdb)]
-    (last
-      (clojure.string/split url #"/"))))
-
-(defn get-cisi-id [ep imdb-id]
-  (println "Attempting to add CISI id for" (:title ep))
-  (let [resp (http/get
-               "http://www.canistream.it/services/search"
-               {:query-params {:movieName (:media-title ep)}
-                :accept :json
-                :as :json})]
-    (if-let [matching-result (first
-                               (filter
-                                 #(= imdb-id (extract-imdb-id %))
-                                 (:body resp)))]
-      (do
-        (kcore/update movies
-          (kcore/set-fields {:cisi_id (:_id matching-result)})
-          (kcore/where {:episode_id (:episode-id ep)}))
-        (assoc
-          ep
-          :cisi-id
-          (:_id matching-result)))
-      (println "*** No CISI ID found for" (:title ep) "***"))))
-
-(def throttled-id (throttle-fn get-cisi-id 1 :second))
-
-(defn assoc-cisi-id [ep]
-  (let [ids (-> ep :episode-id movie-ids)]
-    (cond
-      (:cisi ids) (assoc ep :cisi-id (:cisi ids))
-      (:imdb ids) (throttled-id ep (:imdb ids))
-      ids (println "*** No IMDB ID found for" (:title ep) "***")
-      (:episode-id ep) (do
-                         (kcore/insert movies
-                           (kcore/values {:episode_id (:episode-id ep)
-                                          :title (:media-title ep)}))
-                         (println "Adding empty entry for" (:title ep)))
-      :else (println "Skipping" (:title ep)))))
+(kcore/defentity episodes)

 (defn assoc-streaming-options [ep]
-  (println "Getting options for" (:media-title ep))
+  (println "Getting options for" (:media_title ep))
+  (flush)
   (let [resp (http/get
                "http://www.canistream.it/services/query"
-               {:query-params {:movieId (:cisi-id ep)
+               {:query-params {:movieId (:cisi_id ep)
                                :attributes true
                                :mediaType "streaming"}
                 :accept :json
                 :as :json})]
     (assoc
       ep
-      :streaming-options
+      :streaming_options
       (->> resp :body vals (map :friendlyName) set))))

 (def throttled-options (throttle-fn assoc-streaming-options 1 :second))

 (defn format-results [eps]
   (let [streaming-sites (->> eps
-                             (mapcat :streaming-options)
+                             (mapcat :streaming_options)
                              set
                              (sort-by #(if (= % "Netflix Instant") "AAA" %)))]
     (apply str
@@ -142,18 +50,19 @@
           "\n"
           (for [ep eps]
             (list
-              (:title ep)
+              (:episode_title ep)
               (for [site streaming-sites]
                 (if
-                  ((:streaming-options ep) site)
+                  ((:streaming_options ep) site)
                   "|✓"
                   "|"))
               "\n")))))))

-(let [results (->> (get-episodes)
-                   (map assoc-cisi-id)
-                   (filter identity)
-                   (map throttled-options)
-                   (remove (comp empty? :streaming-options)))]
-  (println "----------------")
-  (print (format-results (reverse results))))
+(let [episode-data (kcore/select episodes
+                     (kcore/where {:ignore 0}))]
+  (->> episode-data
+       (map throttled-options)
+       (remove (comp empty? :streaming_options))
+       (sort-by :episode_id)
+       format-results
+       print))


Put Welcome Panel back up the top

Put Welcome Panel back up the top

--- src/re_demo/core.cljs
+++ src/re_demo/core.cljs
@@ -36,14 +36,15 @@
 (enable-console-print!)

 (def tabs-definition
-  [{:id ::button                 :label "Button"             :panel button/panel}
+  [
+   {:id ::welcome                :label "Welcome"            :panel welcome/panel}
+   {:id ::button                 :label "Button"             :panel button/panel}
    {:id ::md-circle-icon-button  :label "Circle Icon Button" :panel md-circle-icon-button/panel}
    {:id ::md-icon-button         :label "Icon Button"        :panel md-icon-button/panel}
    {:id ::info-button            :label "Info Button"        :panel info-button/panel}
    {:id ::row-button             :label "Row Button"         :panel row-button/panel}
    {:id ::hyperlink              :label "Hyperlink"          :panel hyperlink/panel}
    {:id ::hyperlink-href         :label "Hyperlink (href)"   :panel hyperlink-href/panel}
-   {:id ::welcome                :label "Welcome"            :panel welcome/panel}
    {:id ::checkbox               :label "Checkbox"           :panel checkbox/panel}
    {:id ::radio-button           :label "Radio Button"       :panel radio-button/panel}
    {:id ::input-text             :label "Input Text"         :panel input-text/panel}


t/async must be the return value of deftest body

--- test/reagenttest/testwrap.cljs
+++ test/reagenttest/testwrap.cljs
@@ -101,108 +101,116 @@

 (deftest test-wrap
   (when r/is-client
-    (doseq [compiler test-compilers]
-      (let [state (r/atom {:foo {:bar {:foobar 1}}})
-            ran (r/atom 0)
-            grand-state (clojure.core/atom nil)
-            grand-child (fn [v]
-                          (swap! ran inc)
-                          (reset! grand-state v)
-                          [:div (str "value:" (:foobar @v) ":")])
-            child (fn [v]
-                    [grand-child (r/wrap (:bar @v)
-                                         swap! v assoc :bar)])
-            parent (fn []
-                     [child (r/wrap (:foo @state)
-                                    swap! state assoc :foo)])]
-        (t/async done
-          (u/with-mounted-component-async [parent] done compiler
-            (fn [c div done]
-              (u/run-fns-after-render
-               (fn []
-                 (is (= "value:1:" (.-innerText div)))
-                 (is (= 1 @ran))
-
-                 (reset! @grand-state {:foobar 2}))
-               (fn []
-                 (is (= {:foo {:bar {:foobar 2}}} @state))
-                 (is (= 2 @ran))
-                 (is (= "value:2:" (.-innerText div)))
-
-                 (swap! state update-in [:foo :bar] assoc :foobar 3))
-               (fn []
-                 (is (= 3 @ran))
-                 (is (= "value:3:" (.-innerText div)))
-                 (reset! state {:foo {:bar {:foobar 3}}
-                                :foo1 {}}))
-               (fn []
-                 (is (= 3 @ran))
-                 (reset! @grand-state {:foobar 3}))
-               (fn []
-                 (is (= 3 @ran))
-
-                 (reset! state {:foo {:bar {:foobar 2}}
-                                :foo2 {}}))
-               (fn []
-                 (is (= "value:2:" (.-innerText div)))
-                 (is (= 4 @ran))
-
-                 (reset! @grand-state {:foobar 2}))
-               (fn []
-                 (is (= "value:2:" (.-innerText div)))
-                 (is (= 5 @ran))
-
-                 (reset! state {:foo {:bar {:foobar 4}}})
-                 (reset! @grand-state {:foobar 4}))
-               (fn []
-                 (is (= "value:4:" (.-innerText div)))
-                 (is (= 6 @ran))
-
-                 (reset! @grand-state {:foobar 4}))
-               (fn []
-                 (is (= "value:4:" (.-innerText div)))
-                 (is (= 7 @ran)))
-               done))))))))
+    (t/async done
+      ((reduce
+         (fn [next-done compiler]
+           (fn []
+             (let [state (r/atom {:foo {:bar {:foobar 1}}})
+                   ran (r/atom 0)
+                   grand-state (clojure.core/atom nil)
+                   grand-child (fn [v]
+                                 (swap! ran inc)
+                                 (reset! grand-state v)
+                                 [:div (str "value:" (:foobar @v) ":")])
+                   child (fn [v]
+                           [grand-child (r/wrap (:bar @v)
+                                                swap! v assoc :bar)])
+                   parent (fn []
+                            [child (r/wrap (:foo @state)
+                                           swap! state assoc :foo)])]
+               (u/with-mounted-component-async [parent] next-done compiler
+                 (fn [c div done]
+                   (u/run-fns-after-render
+                     (fn []
+                       (is (= "value:1:" (.-innerText div)))
+                       (is (= 1 @ran))
+
+                       (reset! @grand-state {:foobar 2}))
+                     (fn []
+                       (is (= {:foo {:bar {:foobar 2}}} @state))
+                       (is (= 2 @ran))
+                       (is (= "value:2:" (.-innerText div)))
+
+                       (swap! state update-in [:foo :bar] assoc :foobar 3))
+                     (fn []
+                       (is (= 3 @ran))
+                       (is (= "value:3:" (.-innerText div)))
+                       (reset! state {:foo {:bar {:foobar 3}}
+                                      :foo1 {}}))
+                     (fn []
+                      (is (= 3 @ran))
+                      (reset! @grand-state {:foobar 3}))
+                    (fn []
+                      (is (= 3 @ran))
+
+                      (reset! state {:foo {:bar {:foobar 2}}
+                                     :foo2 {}}))
+                    (fn []
+                      (is (= "value:2:" (.-innerText div)))
+                      (is (= 4 @ran))
+
+                      (reset! @grand-state {:foobar 2}))
+                    (fn []
+                      (is (= "value:2:" (.-innerText div)))
+                      (is (= 5 @ran))
+
+                      (reset! state {:foo {:bar {:foobar 4}}})
+                      (reset! @grand-state {:foobar 4}))
+                    (fn []
+                      (is (= "value:4:" (.-innerText div)))
+                      (is (= 6 @ran))
+
+                      (reset! @grand-state {:foobar 4}))
+                    (fn []
+                      (is (= "value:4:" (.-innerText div)))
+                      (is (= 7 @ran)))
+                    done))))))
+        done
+        test-compilers)))))

 (deftest test-cursor
   (when r/is-client
-    (doseq [compiler test-compilers]
-      (let [state (r/atom {:a {:v 1}
-                           :b {:v 2}})
-            a-count (r/atom 0)
-            b-count (r/atom 0)
-            derefer (fn derefer [cur count]
-                      (swap! count inc)
-                      [:div "" @cur])
-            comp (fn test-cursor []
-                   [:div
-                    [derefer (r/cursor state [:a]) a-count]
-                    [derefer (r/cursor state [:b]) b-count]])]
-        (t/async done
-          (u/with-mounted-component-async [comp] done compiler
-            (fn [c div done]
-              (u/run-fns-after-render
-               (fn []
-                 (is (= 1 @a-count))
-                 (is (= 1 @b-count))
-
-
-                 (swap! state update-in [:a :v] inc)
-                 (is (= 1 @a-count)))
-               (fn []
-                 (is (= 2 @a-count))
-                 (is (= 1 @b-count))
-
-                 (reset! state {:a {:v 2} :b {:v 2}}))
-               (fn []
-                 (is (= 2 @a-count))
-                 (is (= 1 @b-count))
-
-                 (reset! state {:a {:v 3} :b {:v 2}}))
-               (fn []
-                 (is (= 3 @a-count))
-                 (is (= 1 @b-count)))
-               done))))))))
+    (t/async done
+      ((reduce
+         (fn [next-done compiler]
+           (fn []
+             (let [state (r/atom {:a {:v 1}
+                                  :b {:v 2}})
+                   a-count (r/atom 0)
+                   b-count (r/atom 0)
+                   derefer (fn derefer [cur count]
+                             (swap! count inc)
+                             [:div "" @cur])
+                   comp (fn test-cursor []
+                          [:div
+                           [derefer (r/cursor state [:a]) a-count]
+                           [derefer (r/cursor state [:b]) b-count]])]
+               (u/with-mounted-component-async [comp] next-done compiler
+                 (fn [c div done]
+                   (u/run-fns-after-render
+                     (fn []
+                       (is (= 1 @a-count))
+                       (is (= 1 @b-count))
+
+
+                       (swap! state update-in [:a :v] inc)
+                       (is (= 1 @a-count)))
+                     (fn []
+                       (is (= 2 @a-count))
+                       (is (= 1 @b-count))
+
+                       (reset! state {:a {:v 2} :b {:v 2}}))
+                     (fn []
+                       (is (= 2 @a-count))
+                       (is (= 1 @b-count))
+
+                       (reset! state {:a {:v 3} :b {:v 2}}))
+                     (fn []
+                       (is (= 3 @a-count))
+                       (is (= 1 @b-count)))
+                     done))))))
+         done
+         test-compilers)))))

 (deftest test-fn-cursor
  (doseq [compiler test-compilers]


Modify the :host configuration in influx tests

--- test/riemann/influxdb_test.clj
+++ test/riemann/influxdb_test.clj
@@ -121,7 +121,7 @@
     (reset! calls [])
     (testing "deprecated influx stream with default opts"
       (let [k (influxdb/influxdb
-               {:host "aphyr.com"
+               {:host "127.0.0.1"
                 :version :deprecated
                 :db "foodb"
                 :port 9999
@@ -285,7 +285,7 @@
     (reset! calls [])
     (testing "new influxdb stream with default opts"
       (let [k (influxdb/influxdb
-               {:host "aphyr.com"
+               {:host "127.0.0.1"
                 :version :new-stream
                 :db "foodb"
                 :port 9999


src/riemann/xymon.clj: small refactoring, fixed clojure.string namespace reference

--- src/riemann/xymon.clj
+++ src/riemann/xymon.clj
@@ -130,7 +130,7 @@
 (defn- make-combo [messages]
   (if (= (count messages) 1)            ; messages must not be empty
     (first messages)
-    (str combo-header (clojure.string/join "\n\n" messages) "\n\n")))
+    (str combo-header (s/join "\n\n" messages) "\n\n")))

 (defn events->combo
   "Returns a lazy sequence of combo messages. Each message is at most
@@ -171,10 +171,8 @@
   java.net.Socket documentation.
   "
   [opts]
-  (let [formatter (or (:formatter opts) event->status)
-        formatter (if (:combo opts false)
-                    (partial events->combo formatter)
-                    (partial map formatter))]
+  (let [formatter (partial (if (:combo opts false) events->combo map)
+                           (or (:formatter opts) event->status))]
     (fn [events]
       (doseq [message (formatter
                        (filter #(and (:service %) (:state %))


fixing unit tets

fixing unit tets

--- test/shuppet/unit/campfire.clj
+++ test/shuppet/unit/campfire.clj
@@ -8,17 +8,17 @@
 (fact-group :unit

             (fact "campfire message is sent when aws error"
-                  (with-messages {:env "env" :app-name "app-name"} (throw+  {:type :shuppet.util/aws})) => (throws clojure.lang.ExceptionInfo)
+                  (with-messages {:environment "env" :app-name "app-name"} (throw+  {:type :shuppet.util/aws})) => (throws clojure.lang.ExceptionInfo)
                   (provided
-                   (error {:env "env" :app-name "app-name" :type :shuppet.util/aws}) => nil))
+                   (error {:environment "env" :app-name "app-name" :type :shuppet.util/aws}) => nil))

             (fact "campfire message is sent when compilation error"
-                  (with-messages {:env "env" :app-name "app-name"} (throw (clojure.lang.Compiler$CompilerException. "message" 0 0 (Throwable.)))) => (throws clojure.lang.Compiler$CompilerException)
+                  (with-messages {:environment "env" :app-name "app-name"} (throw (clojure.lang.Compiler$CompilerException. "message" 0 0 (Throwable.)))) => (throws clojure.lang.Compiler$CompilerException)
                   (provided
                    (error anything) => nil))

             (fact "messages are sent to default rooms"
-                  (with-messages {:env "env"
+                  (with-messages {:environment "env"
                                   :app-name "app-name"}
                     (info "info")
                     (error {})) => anything
@@ -34,7 +34,7 @@
                      (cf/message ..default-error.. "error") => ..response..))

             (fact "messages are sent to all the rooms"
-                  (with-messages {:env "env"
+                  (with-messages {:environment "env"
                                   :app-name "app-name"
                                   :config {:Campfire {:Info "info"
                                                       :Error "error"}}}


cleanup

cleanup

--- src/sormilla/main.clj
+++ src/sormilla/main.clj
@@ -35,21 +35,3 @@
 )

 "application ready"
-
-(require '[clojure.core.async :refer [>! >!! <! <!! go] :as a])
-
-(def c (a/chan (a/sliding-buffer 1)))
-(a/close! c)
-(defn f []
-  (future
-    (go
-      (println "f: got" (<! c)))))
-
-(defn b [v]
-  (future
-    (go
-      (>! c v)
-      (println "b: sent" v))))
-
-(f)
-(b :foozaa)


Getting copy-file to work.

Getting copy-file to work.

--- src/tyranitar/git.clj
+++ src/tyranitar/git.clj
@@ -265,14 +265,14 @@

 (defn copy-file
   [resource-name dest-path]
-  (let [source (resource resource-name)
-        dest (file dest-path)]
+  (let [source (as-file (resource resource-name))
+        dest (as-file dest-path)]
     (copy source dest)))

 (defn- write-default-properties
   [repo-name]
   (let [repo-path (repo-path repo-name)]
-    (copy-file "application-properties.json")))
+    (copy-file "application-properties.json" "/tmp/wibble.json")))

 (defn- commit-and-push
   [repo-name])


#69: fixing comments "start" => "stop"

#69: fixing comments "start" => "stop"

--- src/mount/core.cljc
+++ src/mount/core.cljc
@@ -254,14 +254,14 @@
 (defn stop [& states]
   (let [fs (-> states first)]
     (if (coll? fs)
-      (if-not (empty? fs)                      ;; (mount/start) vs. (mount/start #{}) vs. (mount/start #{1 2 3})
+      (if-not (empty? fs)                      ;; (mount/stop) vs. (mount/stop #{}) vs. (mount/stop #{1 2 3})
         (apply stop fs)
         {:stopped #{}})
       (let [states (or (seq states)
                        (find-all-states))
-            _ (dorun (map unsub states))       ;; unmark substitutions marked by "start-with"
+            _ (dorun (map unsub states))       ;; unmark substitutions marked by "start-with" / "swap-states"
             stopped (bring states down >)]
-        (dorun (map rollback! states))         ;; restore to origin from "start-with"
+        (dorun (map rollback! states))         ;; restore to origin from "start-with" / "swap-states"
         {:stopped stopped}))))

 ;; composable set of states


Degrade gracefully where title or creator are empty

when creating a DTBook template

--- src/mdr2/dtbook.clj
+++ src/mdr2/dtbook.clj
@@ -22,7 +22,8 @@
     :contributors "Mitwirkende"
     :enclosures "Hörbuchbeilagen"
     :end "Ende des Buches"
-    :title_creator_fmt "%s von %s"}
+    :title_creator_fmt "%s von %s"
+    :unknown_title "Unbekannter Titel"}
    :en
    {:about "About this DAISY book"
     :bib "Bibliographic information"
@@ -31,7 +32,8 @@
     :contributors "Contributors"
     :enclosures "Talking book enclosures"
     :end "End of book"
-    :title_creator_fmt "%s by %s"}})
+    :title_creator_fmt "%s by %s"
+    :unknown_title "Unknown title"}})

 (def ^:private doctype
   (str
@@ -49,16 +51,25 @@
 (def ^:private formatter (f/formatters :date))
 (defn- format-date [date] (when date (f/unparse formatter (from-date date))))

+(defn- default-book-title
+  [title creator language]
+  (let [t (partial translate language)
+        present? (complement s/blank?)]
+    (cond
+      (and (present? creator) (present? title)) (format (t :title_creator_fmt) title creator)
+      (present? title) title
+      (present? creator) (format (t :title_creator_fmt) (t :unknown_title) creator)
+      :else (t :unknown_title))))
+
 (defn default-book
   "Return an default book sexp"
   [title creator language]
-  (let [t (partial translate language)]
-    [:book
-     [:frontmatter
-      [:doctitle (format (t :title_creator_fmt) title creator)]
-      [:docauthor creator]]
-     [:bodymatter
-      [:level1 [:h1] [:p]]]]))
+  [:book
+   [:frontmatter
+    [:doctitle (default-book-title title creator language)]
+    [:docauthor creator]]
+   [:bodymatter
+    [:level1 [:h1] [:p]]]])

 (defn periodical
   "Return an default periodical sexp"


Check also stderr when testing the result of pipeline1

in particular when encoding stderr can contain errors.

--- src/mdr2/encode.clj
+++ src/mdr2/encode.clj
@@ -112,9 +112,11 @@
    (encode production bitrate (sampling-rate production)))
   ([production bitrate sample-rate]
    (doseq [volume (range 1 (inc (:volumes production)))]
-     (let [result (encode-production production bitrate volume sample-rate)]
-       (if (not= 0 (:exit result))
-         (log/errorf "Encoding failed with %s" (:err result))
+     (let [{exit :exit error :err} (encode-production production bitrate volume sample-rate)]
+       (if (or (not= 0 exit)
+               (not (s/blank? error)))
+         (log/errorf "Encoding of %s (%s) failed with exit %s and message \"%s\""
+                     (:id production) volume exit error)
          (do
            ;; update meta data
            (xml/update-meta-data! production)


Load messaging component on demand #125

Load messaging component on demand #125

--- src/onyx/system.clj
+++ src/onyx/system.clj
@@ -5,9 +5,6 @@
             [onyx.peer.virtual-peer :refer [virtual-peer]]
             [onyx.messaging.acking-daemon :refer [acking-daemon]]
             [onyx.messaging.messenger-buffer :refer [messenger-buffer]]
-            [onyx.messaging.http-kit :refer [http-kit-websockets]]
-            [onyx.messaging.aeron :refer [aeron]]
-            [onyx.messaging.netty-tcp :refer [netty-tcp-sockets]]
             [onyx.log.zookeeper :refer [zookeeper]]
             [onyx.log.commands.prepare-join-cluster]
             [onyx.log.commands.accept-join-cluster]
@@ -28,10 +25,14 @@

 (def peer-components [:log :messenger-buffer :messenger :acking-daemon :virtual-peer])

-(def messenger
-  {:http-kit-websockets http-kit-websockets
-   :netty-tcp netty-tcp-sockets
-   :aeron aeron})
+(defn messenger [k]
+  (case k
+    :aeron (do (require 'onyx.messaging.aeron)
+               (ns-resolve 'onyx.messaging.aeron 'aeron))
+    :http-kit-websockets (do (require 'onyx.messaging.http-kit)
+                             (ns-resolve 'onyx.messaging.http-kit 'http-kit-websockets))
+    :netty-tcp (do (require 'onyx.messaging.netty-tcp)
+                   (ns-resolve 'onyx.messaging.netty-tcp 'netty-tcp-sockets))))

 (defn rethrow-component [f]
   (try
@@ -68,7 +69,7 @@
      #(component/stop-system this peer-components))))

 (defn messenger-ctor [config]
-  (let [rets ((get messenger (:onyx.messaging/impl config)) config)]
+  (let [rets ((messenger (:onyx.messaging/impl config)) config)]
     (when-not rets
       (throw (ex-info "Could not find Messaging implementation" {:impl (:onyx.messaging/impl config)})))
     rets))


Update test for keyword fetch keys.

Update test for keyword fetch keys.

--- test/cavm/db_test.clj
+++ test/cavm/db_test.clj
@@ -68,12 +68,12 @@
           probes (cdb/run-query db {:select [:*] :from [:field]})
           positions (cdb/run-query db {:select [:*] :from [:field_position]})
           genes (cdb/run-query db {:select [:*] :from [:field_gene]})
-          data (cdb/fetch db [{'table "id1"
-                               'columns ["probe1" "probe2"]
-                               'samples ["sample2" "sample1"]}])
-          data2 (cdb/fetch db [{'table "id1"
-                                'columns ["probe1" "probe2"]
-                                'samples ["sample1" "sample3"]}])]
+          data (cdb/fetch db [{:table "id1"
+                               :columns ["probe1" "probe2"]
+                               :samples ["sample2" "sample1"]}])
+          data2 (cdb/fetch db [{:table "id1"
+                                :columns ["probe1" "probe2"]
+                                :samples ["sample1" "sample3"]}])]
       (ct/is (= exp [{:NAME "id1"}]))
       (ct/is (= samples
                 [{:NAME "sample1"}
@@ -105,11 +105,11 @@
                  {:FIELD_ID 3 :ROW 1 :GENE "ACK"}
                  {:FIELD_ID 3 :ROW 1 :GENE "BLAH"}]))
       (let [[probe1 probe2]
-            (vec (map #(into [] %) (map ((first data) 'data) ["probe1" "probe2"])))]
+            (vec (map #(into [] %) (map ((first data) :data) ["probe1" "probe2"])))]
         (ct/is (nearly-equal 0.0001 probe1 [1.2 1.1]))
         (ct/is (nearly-equal 0.0001 probe2 [2.2 2.1])))
       (let [[probe1 probe2]
-            (vec (map #(into [] %) (map ((first data2) 'data) ["probe1" "probe2"])))]
+            (vec (map #(into [] %) (map ((first data2) :data) ["probe1" "probe2"])))]
         (ct/is (nearly-equal 0.0001 probe1 [1.1 Double/NaN]))
         (ct/is (nearly-equal 0.0001 probe2 [2.1 Double/NaN]))))))

@@ -272,12 +272,12 @@
                    (cdb/run-query db)
                    (#(for [{:keys [ORDERING VALUE]} %] [ORDERING VALUE]))
                    (into {}))]
-    (->> [{'table table
-           'columns [field]
-           'samples samples}]
+    (->> [{:table table
+           :columns [field]
+           :samples samples}]
          (cdb/fetch db)
          (first)
-         (#(% 'data))
+         (#(% :data))
          (#(% field))
          (into [])
          (map (comp codes int)))))


Support doubleclicking on datastructures to edit them

--- src/ankha/core.cljs
+++ src/ankha/core.cljs
@@ -188,7 +188,10 @@

     om/IRenderState
     (render-state [_ {:keys [open? vacant? editing? edited-data editing-error-message open-editor save-editor cancel-editor]}]
-      (dom/div #js {:className class}
+      (dom/div #js {:className class
+                    :onDoubleClick (fn [e]
+                                     (.stopPropagation e)
+                                     (open-editor))}
         (toggle-button owner {:disable? vacant?})

         (when open?


more pre-checks before expensive copying in (moreover-head)

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -4,7 +4,7 @@
    [clojure.string :as string]
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
-   [dag_unify.core :refer [copy fail? fail-path get-in merge strip-refs unify unifyc]]
+   [dag_unify.core :refer [copy fail? fail-path fail-path-between get-in merge strip-refs unify unifyc]]
    [babel.lexiconfn :refer [get-fail-path sem-impl]]))

 (defn exception [error-string]
@@ -92,16 +92,23 @@

 (def ^:dynamic *extra-diagnostics* false)
 (def ^:dynamic *check-parent-and-head-child-cat-equal* true)
+(def ^:dynamic *check-infl* true)

 (defn moreover-head [parent child lexfn-sem-impl morph]
   (let [morph (if morph morph (fn [x] x))]
     (log/trace (str "moreover-head (candidate) parent: [" (get-in parent [:rule]) "] '" (morph parent) "' sem:    " (strip-refs (get-in parent '(:synsem :sem) :no-semantics))))
     (log/trace (str "moreover-head (candidate) head child: [" (get-in parent [:child]) "] '" (morph child) "' sem:" (strip-refs (get-in child '(:synsem :sem) :top))))
     (let [result
-          (if (and
-               *check-parent-and-head-child-cat-equal*
-               (not (= (get-in parent [:synsem :cat])
-                       (get-in child [:synsem :cat]))))
+          (if (or (and
+                   *check-parent-and-head-child-cat-equal*
+                   (not (= (get-in parent [:synsem :cat])
+                           (get-in child [:synsem :cat]))))
+                  (and
+                   *check-infl*
+                   (or (fail? (unify (get-in parent [:head :synsem :infl] :top)
+                                     (get-in child [:synsem :infl] :top)))
+                       (fail? (unify (get-in parent [:head :synsem :sem :tense] :top)
+                                     (get-in child [:synsem :sem :tense] :top))))))
                :fail
                (unify
                 (merge
@@ -116,6 +123,13 @@
                                     ":'" (morph result) "'"))
               debug (log/debug (str "moreover-head: pass:     " (strip-refs (get-in parent [:rule])) " -> "
                                     "[" (get-in child [:surface]) "]"))
+              debug
+              (let [p-sc (get-in parent [:head :synsem :subcat :1 :cat] :top)
+                    c-sc (get-in child [:synsem :subcat :1 :cat] :top)]
+                (if (fail? (unify p-sc c-sc))
+                  (do
+                    (log/debug (str "moreover-head: pass: parent sc:" (get-in parent [:head :synsem :subcat :1 :cat] :none)))
+                    (log/debug (str "moreover-head: pass: head sc:  " (get-in child [:synsem :subcat :1 :cat] :none))))))
               debug (log/trace (str " resulting sem: " (strip-refs (get-in result '(:synsem :sem)))))]
           result)

@@ -143,13 +157,21 @@
                            (get-in child [:synsem :cat])))
                    (not *check-parent-and-head-child-cat-equal*))
             (log/warn (str "moreover-head: CHILD CAT DIFFERS FROM HEAD CAT!")))
+          (if (fail? (unify (get-in parent [:head :synsem :subcat :1 :cat])
+                            (get-in child [:synsem :subcat :1 :cat])))
+            (log/trace (str "moreover-head: SUBCAT parent head subcat 1:" (get-in parent [:head :synsem :subcat :1 :cat]) ";"
+                            "moreover-head: SUBCAT        head subcat 1:" (get-in child [:synsem :subcat :1 :cat]))))
           (if (= (get-in parent [:synsem :cat])
                  (get-in child [:synsem :cat]))
-            (log/debug (str "moreover-head: failcat== " (strip-refs (get-in parent [:rule])) "; "
-                            "child: " (get-in child [:surface]) ""))
-            (log/debug (str "moreover-head: failcat!= " (strip-refs (get-in parent [:rule])) "; "
+            (log/trace (str "moreover-head: failcat== " (strip-refs (get-in parent [:rule])) "; "
                             "child: " (get-in child [:surface]) "")))
-
+          (if (and false ;; TODO (if no-pre-checks-have-caught-this ..)
+                   (get-in parent [:head :synsem :infl])
+                   (get-in comp [:synsem :infl]))
+            (log/debug (str "moreover-head: fail-path-between:"
+                            (fail-path-between parent {:head child}))))
+          (log/trace (str "moreover-head: failcat!= " (strip-refs (get-in parent [:rule])) "; "
+                          "child: " (get-in child [:surface]) ""))
           :fail)))))

 ;; Might be useful to set the following variable to true,
@@ -161,7 +183,7 @@
 (defn moreover-comp [parent child lexfn-sem-impl]
   (log/trace (str "moreover-comp type parent: " (type parent)))
   (log/trace (str "moreover-comp type comp:" (type child)))
-
+
   (let [result
         (if (and *check-parent-and-head-child-cat-equal*
                  (not (= (get-in parent [:comp :synsem :cat])
@@ -170,7 +192,7 @@
           (unify
            (merge
             (copy parent)
-            ;; TODO: don't merge this in: surface-calculation should happen on-demand, not in this
+            ;; TODO: don't merge :surface in here: surface-calculation should happen on-demand, not in this
             ;; time-critical code. i.e. build surface of tree by doing a depth-first traversal, not
             ;; storing stuff within tree in case someone is interested.
             {:surface (str


Add basic keydown detection

Add basic keydown detection

--- src/cas/client.cljs
+++ src/cas/client.cljs
@@ -6,6 +6,9 @@
 (def state (atom {:world []
                   :player {:pos {:x 0 :y 0}
                            :mov-time [0 0]}}))
+
+(def keystate (atom {}))
+
 (defn setup! []
   (let [world (world/new-simple-world 80 60 20 30 40)]
     (swap! state assoc :world world)))
@@ -65,9 +68,21 @@
 (defn update! []
   (update-player!))

+(defn is-key-down [key]
+  (@keystate key))
+
+(.addEventListener js/document "keydown"
+  (fn [e] (swap! keystate assoc (.-keyCode e) true)))
+
+(.addEventListener js/document "keyup"
+  (fn [e] (swap! keystate assoc (.-keyCode e) false)))
+
+;; Set up the event loop
 (defn tick! []
+  (println @keystate)
   (update!)
   (render!))
+(js/setInterval tick! 1000)

-(js/setInterval tick! 1000)
+;; Set up the basic program structure
 (setup!)


added ability to toggle number labels

added ability to toggle number labels

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -135,10 +135,14 @@
           (dom/label nil (inc n))))))

-(defn grid [{:keys [grid-px] :as app}]
+(defn grid [{:keys [cells grid-px show-nums] :as app}]
   (om/component
-    (apply dom/div #js {:className "grid" :style #js {:width grid-px :height grid-px}}
-      (map (partial cell app) (:cells app)))))
+    (apply dom/div #js {
+      :className (str "grid" (when show-nums " show-nums"))
+      :style #js {:width grid-px :height grid-px}}
+
+      (map (partial cell app) cells))))
+

 (defn set-grid-size! [app size]
   (when (and (integer? size) (> size 1) (< size 10))
@@ -154,13 +158,13 @@

 (defn paint-canvas! [{:keys [moves grid-size]} tick]
   (take! (@img-cache tick) (fn [img]
-    (let [ts (/ capture-size grid-size)]
+    (let [s (/ capture-size grid-size)]
       (.clearRect playback-ctx 0 0 capture-size capture-size)
       (doseq [[idx pos] (:cells (moves tick))]
         (if-not (= idx :empty)
           (let [[x1 y1] (get-cell-xy idx grid-size)
                 [x2 y2] (get-cell-xy pos grid-size)]
-            (.drawImage playback-ctx img (* x1 ts) (* y1 ts) ts ts (* x2 ts) (* y2 ts) ts ts))))
+            (.drawImage playback-ctx img (* x1 s) (* y1 s) s s (* x2 s) (* y2 s) s s))))
       (.drawImage playback-ctx img 0 capture-size)))))

 (defonce app-state (atom {}))
@@ -217,7 +221,7 @@

 (om/root
-    (fn [{:keys [stream cells win-state moves tick tick-ms grid-size media-error?] :as app} _]
+    (fn [{:keys [stream cells win-state moves tick-ms grid-size media-error? show-nums] :as app} _]
       (reify
         om/IDidMount
         (did-mount [_]
@@ -259,8 +263,13 @@
                       #js {:className "move-count"}
                       (str move-count " move" (when (> move-count 1) "s")))

-                    (dom/label nil "grid-size:")
-                    (dom/label nil (str grid-size \× grid-size))
+                    (dom/label nil "show numbers?")
+                    (dom/input #js {
+                      :type     "checkbox"
+                      :checked  show-nums
+                      :onChange #(om/update! app :show-nums (not show-nums))})
+
+                    (dom/label nil (str "grid-size (" grid-size \× grid-size ")"))
                     (dom/input #js {
                       :type     "range"
                       :value    grid-size
@@ -269,7 +278,7 @@
                       :step     "1"
                       :onChange #(set-grid-size! app (js/parseInt (.. % -target -value)))})

-                    (dom/label nil "playback speed:")
+                    (dom/label nil "playback speed")
                     (dom/input #js {
                       :type     "range"
                       :value    (- tick-ms)


destructuring is nice

destructuring is nice

--- src/clj/pw/core.clj
+++ src/clj/pw/core.clj
@@ -36,21 +36,21 @@
    (resources "/")
    (GET "/" [] (index))
    (POST "/pass/*" [* password]
-          (let [out (sh "gpg"
+          (let [{:keys [out err]} (sh "gpg"
                         "--batch"
                         "-d"
                         "--passphrase-fd" "0"
                         (format "%s/%s.gpg" path *)
                         :in password)]
             (cond
-             (re-find #"No such file or directory" (:err out))
+             (re-find #"No such file or directory" err)
              (edn-response {:error "Bad service or password"})

-             (= "" (:out out))
+             (= "" out)
              (edn-response {:error "Bad service or password"})

              :else
-             (edn-response {:pass (clojure.string/trim-newline (:out out))}))))
+             (edn-response {:pass (clojure.string/trim-newline out)}))))

    (not-found "404")))


Use tap function for add side effects to streams.

Instead of creating a subscription.

--- src/beicon/core.cljs
+++ src/beicon/core.cljs
@@ -364,6 +364,22 @@
   {:pre [(observable? ob) (fn? f)]}
   (.tap ob f))

+(defn log
+  "Print all values passed through the given
+  observable sequence."
+  ([ob]
+   (tap #(println %) ob))
+  ([prefix ob]
+   (tap #(println (str prefix %)) ob)))
+
+(defn pr-log
+  "Print all values passed through the given
+  observable sequence using pr-str."
+  ([ob]
+   (tap #(println (pr-str %)) ob))
+  ([prefix ob]
+   (tap #(println (str prefix (pr-str %))) ob)))
+
 (defn throttle
   "Returns an observable sequence that emits only the
   first item emitted by the source Observable during
@@ -422,18 +438,6 @@
    (.bufferWithCount ob n))
   ([n skip ob]
    (.bufferWithCount ob n skip)))
-
-(defn pr-log
-  ([ob]
-   (on-value ob #(println (pr-str %))))
-  ([prefix ob]
-   (on-value ob #(println (str prefix (pr-str %))))))
-
-(defn log
-  ([ob]
-   (on-value ob #(println %)))
-  ([prefix ob]
-   (on-value ob #(println (str prefix %)))))

 (defn to-atom
   "Materialize the observable sequence into an atom."


Add two more commands

Add two more commands

--- src/bolt/config.cljs
+++ src/bolt/config.cljs
@@ -19,12 +19,14 @@
     :clojuredocs {:alias "cd" :url "http://clojuredocs.org/search?q=%s"}
     :flickr {:alias "fl" :url "http://www.flickr.com/search/?q=%s"}
     :imdb {:url "http://www.imdb.com/find?q=%s&s=all"}
+    :rotten {:url "http://www.rottentomatoes.com/search/?search=%s"}
     :domain {:url "https://domai.nr/?q=%s"}
     :freebase {:alias "fb" :url "http://www.freebase.com/search?query=%s"}
     :twitter {:url "https://twitter.com/search?q=%s"}
     :urbandictionary {:alias "urban" :url "http://www.urbandictionary.com/define.php?term=%s"}
     :github-lucky {:alias "ghl" :url "http://tagaholic.me/github-lucky/?query=%s"}
     :crossclj {:alias "cclj" :url "http://crossclj.info/search?q=%s"}
+    :drive {:alias "dr" :url "https://drive.google.com/drive/search?q=%s"}

     ;; not used on phone
     :google-group {:alias "ggs" :url "http://groups.google.com/groups/dir?q=%s"}


[Add] func confusion-matrix

[Add] func confusion-matrix

for experiment

--- src/clj_elm/core.clj
+++ src/clj_elm/core.clj
@@ -97,7 +97,7 @@
          betas (c/to-vect (c/mmult (pseudo-inverse-matrix H) T))]
      (Model. ass bs betas))))

-(defn predict
+(defn predict
   ([model xs]
    {:pre [(instance? Model model) (coll? xs)]}
    (predict (:ass model) (:bs model) (:betas model) xs))
@@ -115,14 +115,24 @@
     (and (= pred -1) (= fact -1)) (assoc exp :TN (inc (:TN exp)))
     (and (= pred -1) (= fact 1)) (assoc exp :FN (inc (:FN exp)))))

+(defn confusion-matrix [preds facts exp]
+  {:pre [(coll? preds) (coll? facts) (map? exp)]}
+  (if (or (empty? preds) (empty? facts))
+    (let [TP (:TP exp) FP (:FP exp)
+          TN (:TN exp) FN (:FN exp)]
+      (-> exp
+          (assoc :Accuracy (/ (+ TP TN) (+ TP FP TN FN)))
+          (assoc :Recall (/ TP (+ TP FN)))
+          (assoc :Precision (/ TP (+ TP FP)))))
+    (let [pred (first preds)
+          fact (first facts)]
+      (recur (rest preds) (rest facts) (update-exp-data pred fact exp)))))
+
 (defn evaluation
-  ([results expdata facts]
+  ([results facts expdata]
    {:pre [(coll? results) (coll? facts) (map? expdata)]}
    (let [numd (count results)]
-     (->> (pmap #(= %1 %2) results facts)
-          (filter true?)
-          (count)
-          (#(/ % numd))))))
+     (confusion-matrix results facts expdata))))

 (defn select-count
   ([cond coll]
@@ -144,8 +154,7 @@
                    :Accuracy 0.0 :Recall 0.0 :Precision 0.0 :TP 0 :FP 0 :TN 0 :FN 0 }]
      (-> (train-model sample L)
          (#(pmap (fn [feature] (predict % feature)) (:features test)))
-         (evaluation (:classes test))
-         (as-> eva (do [eva exp-data]))))))
+         (#(evaluation (:classes test) % exp-data))))))

 (defn cross-validate
   ([dataset L k]
@@ -154,8 +163,8 @@
          numd (count (:classes norm-dataset)) ; number of data
          groupn (quot numd k)]                ; number of one group's element
      (->> (take k (iterate #(+ % groupn) 0))
-          (pmap #(let [[eva exp-data] (_cross-validate norm-dataset % (+ % (dec groupn)) L)]
-                   (dorun (println exp-data))
-                   eva))
-          (reduce +)
+          (pmap #(let [eva (_cross-validate norm-dataset % (+ % (dec groupn)) L)]
+                   (dorun (println eva))
+                   (:Accuracy eva)))
+          (reduce +)
           (* (/ 1 k))))))


work in progress on loudness

work in progress on loudness

--- src/clojure/core.clj
+++ src/clojure/core.clj
@@ -8,11 +8,16 @@
            [xtract_window_types_]
            [xtract_spectrum_]
            [xtract_subband_scales_]
+           [xtractConstants]

           [javax.sound.sampled AudioSystem]))

 (defonce xtract-spectrum (.swigValue (xtract_features_/XTRACT_SPECTRUM)))
 (defonce xtract-windowed (.swigValue (xtract_features_/XTRACT_WINDOWED)))
+(defonce xtract-bark-coefficents (.swigValue (xtract_features_/XTRACT_BARK_COEFFICIENTS)))
+
+(defonce xtract-bark-bands (xtractConstants/XTRACT_BARK_BANDS))
+
 (defonce xtract-hann     (.swigValue (xtract_window_types_/XTRACT_HANN)))

 (defonce xtract-equal-gain (.swigValue (xtract_mfcc_types_/XTRACT_EQUAL_GAIN)))
@@ -134,7 +139,11 @@
         block-size 512
         half-block-size (/ 512 2)

-        mel-filters  (xtract/create_filterbank  MFCC_FREQ_BANDS block-size)]
+        mel-filters  (xtract/create_filterbank  MFCC_FREQ_BANDS block-size)
+
+      ;;  bark-band-limits (xtract/new_int_array 0)
+    ;;    _ (xtract/int_array_setitem bark-band-limits 0 0)
+        ]

     (xtract/xtract_init_mfcc (/ block-size 2)
                              (/ SAMPLERATE 2)
@@ -143,6 +152,11 @@
                              MFCC_FREQ_MAX
                              MFCC_FREQ_BANDS
                              (xtract_mel_filter/.getFilters mel-filters))
+
+    ;;  public static int xtract_init_bark(int N, double sr, SWIGTYPE_p_int band_limits) {
+  ;;  (xtract/xtract_init_bark block-size SAMPLERATE bark-band-limits)
+
+;;    (println (xtract/int_array_getitem bark-band-limits 0))

     (let [w    (xtract/xtract_init_window block-size xtract-hann)
           subw (xtract/xtract_init_window half-block-size xtract-hann)
@@ -189,6 +203,9 @@
 ;;                            public static int xtract_rms_amplitude(SWIGTYPE_p_double data, int N, SWIGTYPE_p_void argv, double[] result)

                             (let [rms (double-array [0])
+                                  noiseness (double-array [0])
+                                  loudness (double-array [0])
+                                  tonality (double-array [0])
                                   argv [(/ SAMPLERATE block-size)]

                                   spectral-inharmonicity (spectral-inharmonicity
@@ -196,10 +213,26 @@
                                                           f0 0.5 NUM_HARMONICS 0)]

                               (xtract/xtract_rms_amplitude ds block-size (apply xtract-args argv) rms)
+;;                              (xtract/xtract_noisiness     ds block-size (xtract-args NUM_HARMONICS ) noiseness)
+
+                              (let [_ 10
+                                    ;;bark-cofficents (make-double (range 0 xtract-bark-bands))
+                                   ]
+
+                               ;; (println :BAND bark-band-limits)
+;;                                (xtract/xtract_bark_coefficients spectrum half-block-size (xtract-args ) bark-cofficents)
+;;                                (xtract/xtract_loudness      ds block-size (apply xtract-args argv) loudness)
+                                )
+
+                              ;;TODO
+                              (xtract/xtract_tonality      ds block-size (xtract-args ) tonality)

                               {(* idx SAMPLERATE)
                                {:spectral-inharmonicity spectral-inharmonicity
                                 :rms_amplitude (first rms)
+                                ;;                              :noisiness (first noiseness)
+                                ;;                                :loudness (first loudness)
+                                ;;                               :tonality (first tonality)
                                 :midi midi
                                 :f0 f0}
                                }))


Require float instructions for autoconstruction.

--- src/clojush/args.clj
+++ src/clojush/args.clj
@@ -369,7 +369,7 @@
   (when (:autoconstructive @push-argmap)
     (swap! push-argmap assoc :genetic-operator-probabilities {:autoconstruction 1.0})
     (swap! push-argmap assoc :epigenetic-markers [:close :silent])
-    (doseq [instr (registered-for-stacks [:integer :boolean :exec :genome])]
+    (doseq [instr (registered-for-stacks [:integer :boolean :exec :genome :float])]
       (when (not (some #{instr} (:atom-generators @push-argmap)))
         (swap! push-argmap assoc :atom-generators (conj (:atom-generators @push-argmap) instr))))
     (dotimes [n (:autoconstructive-integer-rand-enrichment @push-argmap)]


Added *debug* option

Added *debug* option

--- src/control/core.clj
+++ src/control/core.clj
@@ -5,6 +5,7 @@
         [clojure.contrib.def :only [defvar- defvar]]))

 (defvar  *enable-color* true)
+(defvar  *debug* false)
 (defvar-  *enable-logging* true)
 (defvar-  *runtime* (Runtime/getRuntime))
 (defvar- bash-reset "\033[0m")
@@ -181,6 +182,8 @@
                                    item))
                                item))
                            body)]
+    (if *debug*
+      (prn new-body))
     `(swap! tasks
             assoc
             ~name


Rename function

Rename function

--- src/play_clj/ui.clj
+++ src/play_clj/ui.clj
@@ -161,7 +161,7 @@
   (add-to-group! [group children])
   group)

-(defn ^:private init-group
+(defn ^:private create-group
   [^WidgetGroup group children]
   (-> (doto group
         (.setFillParent true))
@@ -170,15 +170,15 @@

 (defn horizontal*
   [children]
-  (init-group (HorizontalGroup.) children))
+  (create-group (HorizontalGroup.) children))

 (defn vertical*
   [children]
-  (init-group (VerticalGroup.) children))
+  (create-group (VerticalGroup.) children))

 (defn table*
   [children]
-  (init-group (Table.) children))
+  (create-group (Table.) children))

 (defmacro horizontal
   [children & options]


Improves memo-test function some.

Improves memo-test function some.

--- src/tumblr_identity_manager/utility.clj
+++ src/tumblr_identity_manager/utility.clj
@@ -28,12 +28,12 @@
   "Given a string, converts it to kebab-case.  Excludes _id." [s]
   (if (= s "_id") s (memoized->kebab-case s)))

-(defn memo-test [data]
-  ;; Run the test in increments of 256.
+(defn memo-test
+  "Test a range of fifo/threshold values in increments of 2." [data]
   (for [x (range 2 48 2)]
     (with-redefs [memoized->camelCase (memo/fifo ck/->kebab-case :fifo/threshold x)]
-      (println "Testing fifo threshold of" x)
-      (time (count (doall (kebab->camel data)))))))
+      (print (format "Testing fifo/threshold of %2d -> " x))
+      (time (doall (kebab->camel data) nil)))))

 ;;; General utility functions.


Remove checking for file's existence, as it may or may not be a file

--- src/degasolv/cli.clj
+++ src/degasolv/cli.clj
@@ -921,19 +921,7 @@
     (let [{:keys [options arguments]}
           (parseplz! subcommand (rest arguments) subcmd-cli)
           config-files
-          (get (reduce (fn [[seen result] {^java.io.File new :file read-fn :read-fn
-                                      :as unit}]
-                    (let [abs-path (.getAbsolutePath new)]
-                      (if (or (seen abs-path)
-                              (not (.exists new)))
-                        [seen result]
-                        [(conj seen abs-path)
-                         (conj result unit)])))
-                  [#{} []]
-                  (reduce
-                    into
-                    []
-                    [(if-let [app-data (System/getenv "AppData")]
+          (as-> [(if-let [app-data (System/getenv "AppData")]
                        [
                         {:file (io/file (string/join java.io.File/separator
                                                      [app-data
@@ -966,7 +954,8 @@
                        :read-fn #(json/parse-string % true)}
                       ]
                      (:config-files env-vars)
-                     (:config-files global-options)])) 1)
+                 (:config-files global-options)] it
+                (reduce into [] it))
           config
           (get-config config-files)
           expanded-cfg (expand-option-packs config)


More defaults.

More defaults.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -12,7 +12,8 @@
               [onyx.peer.function :as function]
               [onyx.peer.operation :as operation]
               [onyx.extensions :as extensions]
-              [onyx.compression.nippy])
+              [onyx.compression.nippy]
+              [onyx.static.default-vals :refer [defaults]])
     (:import [java.security MessageDigest]
              [uk.co.real_logic.aeron.exceptions.DriverTimeoutException]))

@@ -389,8 +390,10 @@
             catalog-entry (find-task catalog (:name task))
             ;; Number of buckets in the timeout pool is covered over a 60 second
             ;; interval, moving each bucket back 60 seconds / N buckets
-            replay-interval (or (:onyx/replay-interval catalog-entry) 1000)
-            pending-timeout (or (:onyx/pending-timeout catalog-entry) 60000)
+            replay-interval (or (:onyx/replay-interval catalog-entry)
+                                (:onyx/replay-interval defaults))
+            pending-timeout (or (:onyx/pending-timeout catalog-entry)
+                                (:onyx/pending-timeout defaults))
             n-buckets (int (Math/ceil (/ pending-timeout replay-interval)))
             buckets (vec (repeat n-buckets []))


Make note about performance in run-task-lifecycle loop

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

 (defn run-task-lifecycle
   "The main task run loop, read batch, ack messages, etc."
+  ;; For performance, pre lookup event values that will not change between batches.
+  ;; These should be passed in to the event loop calls where possible
   [{:keys [onyx.core/task-map
            onyx.core/pipeline
            onyx.core/replica


Exception in log entry application should be logged to error

--- src/onyx/peer/virtual_peer.clj
+++ src/onyx/peer/virtual_peer.clj
@@ -54,7 +54,7 @@
             (when (:lifecycle state)
               (component/stop @(:lifecycle state)))))))
     (catch Throwable e
-      (taoensso.timbre/info e))
+      (taoensso.timbre/error e))
     (finally
      (taoensso.timbre/info "Fell out of processing loop"))))