Make main-entry-node copy audio in addition forwarding it

Also apply a few smaller fixes to the other nodes related to audio
processing in web workers.

--- src/main/audio_utils/worker.cljs
+++ src/main/audio_utils/worker.cljs
@@ -7,28 +7,38 @@
   (disconnect [this])
   (process-audio [this data]))

-(defn caller-entry-node
-  "Creates a ScriptProcessorNode in the main UI thread that forwards
-   audio to a worker by posting a :process-audio message to it whenever
-   there is new audio to be processed."
-  [worker ctx {:keys [buffer-size input-channels output-channels]}]
+(defn main-entry-node
+  "Creates a ScriptProcessorNode in the main UI thread that
+   forwards audio to a worker by posting a :worker-process-audio
+   message to it whenever there is new audio to be processed."
+  [worker ctx {:keys [buffer-size input-channels output-channels]
+               :or   {buffer-size     4096
+                      input-channels  1
+                      output-channels 1}}]
   (doto (.createScriptProcessor ctx buffer-size
                                 input-channels
                                 output-channels)
-    (set "onaudioprocess"
-         (fn [event]
-           (let [input-buffer (.-inputBuffer event)
-                 n-channels   (.-numberOfChannels input-buffer)
-                 data         (make-array n-channels)]
-             (dotimes [channel n-channels]
-               (aset data channel (.getChannelData input-buffer channel)))
-             (.postMessage worker #js {:name :process-audio
-                                       :data data}))))))
+    (aset "onaudioprocess"
+          (fn [event]
+            (let [input-buffer  (.-inputBuffer event)
+                  output-buffer (.-outputBuffer event)
+                  n-channels    (.-numberOfChannels input-buffer)
+                  worker-data   (into-array (repeat n-channels #js []))]
+              (dotimes [channel n-channels]
+                (let [input-data  (.getChannelData input-buffer channel)
+                      output-data (.getChannelData output-buffer channel)]
+                  (dotimes [n (.-length input-data)]
+                    (let [sample (aget input-data n)]
+                      (aset output-data n sample)
+                      (.push (aget worker-data channel) sample)))))
+              (.postMessage worker (clj->js {:name :worker-process-audio
+                                             :data worker-data})))))))

 (defn worker-entry-node
   "Creates an IWorkerAudioNode in a worker that receives its audio
-   data from the main UI thread via a :process-audio message. It then
-   forwards the audio to the next IWorkerAudioNode if there is one."
+   data from the main UI thread via a :worker-process-audio message.
+   It then forwards the audio to the next IWorkerAudioNode if
+   there is one."
   []
   (let [next (atom nil)
         node (reify IWorkerAudioNode
@@ -37,32 +47,36 @@
                (disconnect [this]
                  (reset! next nil))
                (process-audio [this data]
-                 (when next
-                   (process-audio next data))))]
-    (set! (.-onmessage js/this)
+                 (when @next
+                   (process-audio @next data))))]
+    (set! (.-onmessage js/self)
           (fn [msg]
-            (let [{:keys [name data]} (js->clj (.-data msg))]
-              (when (= name :process-audio)
+            (let [clj-msg (js->clj (.-data msg))
+                  name    (keyword (clj-msg "name"))
+                  data    (clj-msg "data")]
+              (when (= name :worker-process-audio)
                 (process-audio node data)))))
     node))

-(defn worker-encoded-exit-node
-  "Creates an IWorkerAudioNode that takes encoded (!) audio data from
-   a previous IWorkerAudioNode and forwards it to the main UI thread
-   via a :process-encoded-data message."
+(defn worker-exit-node
+  "Creates an IWorkerAudioNode that takes audio data from a previous
+   IWorkerAudioNode and forwards it to the main UI thread via a
+   :main-process-audio message."
   []
   (reify IWorkerAudioNode
     (connect [this destination])
     (disconnect [this])
     (process-audio [this data]
-      (.postMessage js/this #js {:name :process-encoded-data
-                                 :data data}))))
+      (.postMessage js/self (clj->js {:name :main-process-audio
+                                      :data data})))))

-(defn caller-encoded-exit-node
-  [worker encoded-data-fn]
+(defn main-exit-node
+  [worker data-fn]
   (set! (.-onmessage worker)
         (fn [msg]
-          (let [{:keys [name data]} (js->clj msg)]
-            (when (= name :process-encoded-data)
-              (when encoded-data-fn
-                (encoded-data-fn data)))))))
+          (let [clj-msg (js->clj (.-data msg))
+                name    (keyword (clj-msg "name"))
+                data    (clj-msg "data")]
+            (when (= name :main-process-audio)
+              (when data-fn
+                (data-fn data)))))))


fix ns history tracking

fix ns history tracking

--- src/main/cljs_api_gen/result.clj
+++ src/main/cljs_api_gen/result.clj
@@ -199,8 +199,8 @@
         nss-diff (get-diff prev-nss curr-ns-names)

         make-item
-        (fn [name- {:keys [removed? added? stayed?] :as diff}]
-          (let [prev (get prev-syms name-)
+        (fn [name- prevs {:keys [removed? added? stayed?] :as diff}]
+          (let [prev (get prevs name-)
                 prev-hist (:history prev)
                 curr (get items name-)]
             (cond
@@ -209,10 +209,10 @@
               (contains? stayed? name-)  (assoc curr :history prev-hist)            ;; still here
               :else                      prev)))                                    ;; still removed

-        new-sym-items (map #(make-item % syms-diff) (:all-names syms-diff))
+        new-sym-items (map #(make-item % prev-syms syms-diff) (:all-names syms-diff))
         new-syms (zipmap (map :full-name new-sym-items) new-sym-items)

-        new-ns-items (map #(make-item % nss-diff) (:all-names nss-diff))
+        new-ns-items (map #(make-item % prev-nss nss-diff) (:all-names nss-diff))
         new-nss (zipmap (map :full-name new-ns-items) new-ns-items)

         change (prune-map {:cljs-version *cljs-version*


BigQuery driver: make #standardsql flag case-insenitive to match actual BigQuery api behavior

--- src/metabase/driver/bigquery.clj
+++ src/metabase/driver/bigquery.clj
@@ -122,7 +122,7 @@
    (let [request (doto (QueryRequest.)
                    (.setTimeoutMs (* query-timeout-seconds 1000))
                    ;; if the query contains a `#standardSQL` directive then use Standard SQL instead of legacy SQL
-                   (.setUseLegacySql (not (s/includes? query-string "#standardSQL")))
+                   (.setUseLegacySql (not (s/includes? (s/lower-case query-string) "#standardsql")))
                    (.setQuery query-string))]
      (google/execute (.query (.jobs client) project-id request)))))


cleaned up example config

cleaned up example config

--- deploy/conf/dev2/global-conf.clj
+++ deploy/conf/dev2/global-conf.clj
@@ -3,9 +3,6 @@
  :node-count 1
  :port 3578
  :domains {
-           "tweet-lists" "s3n://hdfs2/data/lyoto/output/customer-stats/tweet-lists" ;;1
-           "tweet-stats" "s3n://hdfs2/data/lyoto/output/customer-stats/tweet-stats" ;;1
-           "user-day-lists" "s3n://hdfs2/data/lyoto/output/customer-stats/user-day-lists" ;;1
-           "user-day-stats" "s3n://hdfs2/data/lyoto/output/customer-stats/user-day-stats" ;;1
+           "domain-name" "s3n://hdfs2/path/.../"
            }
 }


Отладка работы галереи

Отладка работы галереи

--- radiolamp-6P3S/src/ixinfestor/omut.cljs
+++ radiolamp-6P3S/src/ixinfestor/omut.cljs
@@ -3130,78 +3130,100 @@
     (init-state [_]
       {:i          0               :deg            0
        :div-id     (uniq-id "div") :img-id         (uniq-id "img")
-       :div-height nil             :img-margin-top nil})
+       :div-height nil             :img-margin-top nil
+       :img-height nil
+       })
+
+    om/IDidUpdate
+    (did-update [_ _ _]
+      )

     om/IWillReceiveProps
     (will-receive-props [_ next-props]
       (om/set-state! own :i 0))

     om/IRenderState
-    (render-state [_ {:keys [i deg div-id div-height img-id img-margin-top]}]
-      (let [deg-2 (str  "rotate(" deg "deg)")
-            src (get-in @app [i :path] "")]
-        (if (empty? @app)
-          (dom/h2 nil "Изображений нет")
-          (dom/div
-           #js {}
-           (dom/b #js {:style #js {:fontSize "26px"}} "Изображение " (inc i) " из " (count @app))
-
-
-           (dom/div #js {:className "btn-toolbar" :style #js {:float "right"}}
-                    (dom/div #js {:className "btn-group"}
-                             (ui-button
-                              {:text (ui-glyphicon "retweet")
-                               :type :default
-                               :size :lg
-                               :on-click
-                               #(om/update-state!
-                                 own
-                                 (fn [{:keys [deg div-id img-id] :as state}]
-                                   (let [deg (+ deg 90)
-                                         deg (if (> deg 270) 0 deg)
-                                         r? (or (= deg 90) (= deg 270))
-                                         img-w (-> img-id by-id .-clientWidth)
-                                         img-h (-> img-id by-id .-clientHeight)]
-                                     (assoc state
-                                            :deg deg
-                                            :img-margin-top
-                                            (when r? (js/Math.abs (* 0.5 (- img-h img-w))))
-                                            :div-height (when r? (+ 12 img-w))))))}))
-
-                    (dom/div #js {:className "btn-group"}
-                             (ui-button {:text     (ui-glyphicon "chevron-left")
-                                         :type     :default
-                                         :size     :lg
-                                         :on-click (fn [_]
-                                                     (om/update-state!
-                                                      own :i
-                                                      #(let [i (dec %)]
-                                                         (if (< i 0) (dec (count @app)) i)))
-                                                     1)})
-                             (ui-button {:text     (ui-glyphicon "chevron-right")
-                                         :type     :default
-                                         :size     :lg
-                                         :on-click (fn [_]
-                                                     (om/update-state!
-                                                      own :i
-                                                      #(let [i (inc %)]
-                                                         (if (= i (count @app)) 0  i)))
-                                                     1)})))
-           (dom/br nil)
-           (dom/br nil)
-           (dom/div
-            #js {:id div-id :className "thumbnail" :style #js {:height div-height}}
-            (dom/img #js {:id        img-id
-                          :className ""
-                          :src       src
-                          :style     #js {:msTransform     deg-2
-                                          :WebkitTransform deg-2
-                                          :transform       deg-2
-                                          :marginTop       img-margin-top
-                                          }
-                          :onClick #(put! chan-thumb-show-in-full-screen-app-init {:src src})}))
-           (dom/h2 nil (get-in @app [i :top_description] ""))
-           (dom/p nil (get-in @app [i :description] ""))))))))
+    (render-state [_ {:keys [i deg div-id div-height img-id img-margin-top img-height]}]
+      (letfn [(img-on-load []
+                (println "IMG loaded")
+                (om/update-state!
+                 own (fn [{:keys [div-id img-id deg] :as state}]
+                       (let [r?    (or (= deg 90) (= deg 270))
+                             div-w (-> div-id by-id .-clientWidth)
+                             div-h (-> div-id by-id .-clientHeight)
+                             img-w (-> img-id by-id .-clientWidth)
+                             img-h (-> img-id by-id .-clientHeight)
+                             fat?  (>= img-w img-h)]
+                         (println "REP!")
+                         (assoc state
+                                :img-margin-top (when r?
+                                                  (if fat?
+                                                    (* 0.5 (- img-w img-h))
+                                                    nil))
+                                :div-height (when r?
+                                              (if fat?
+                                                (+ 12 img-w)
+                                                nil))
+                                :img-height (when (and r? (not fat?))
+                                              div-w))))))]
+        (let [deg-2 (str  "rotate(" deg "deg)")
+              src   (get-in @app [i :path] "")]
+          (if (empty? @app)
+            (dom/h2 nil "Изображений нет")
+            (dom/div
+             #js {}
+             (dom/b #js {:style #js {:fontSize "26px"}} "Изображение " (inc i) " из " (count @app))
+
+
+             (dom/div #js {:className "btn-toolbar" :style #js {:float "right"}}
+                      (dom/div #js {:className "btn-group"}
+                               (ui-button
+                                {:text (ui-glyphicon "retweet")
+                                 :type :default
+                                 :size :lg
+                                 :on-click
+                                 (fn []
+                                   (om/update-state!
+                                     own :deg
+                                     #(let [deg (+ % 90)]
+                                        (if (> deg 270) 0 deg)))
+                                   (img-on-load))}))
+
+                      (dom/div #js {:className "btn-group"}
+                               (ui-button {:text     (ui-glyphicon "chevron-left")
+                                           :type     :default
+                                           :size     :lg
+                                           :on-click (fn [_]
+                                                       (om/update-state!
+                                                        own :i
+                                                        #(let [i (dec %)]
+                                                          (if (< i 0) (dec (count @app)) i)))
+                                                       1)})
+                               (ui-button {:text     (ui-glyphicon "chevron-right")
+                                           :type     :default
+                                           :size     :lg
+                                           :on-click (fn [_]
+                                                       (om/update-state!
+                                                        own :i
+                                                        #(let [i (inc %)]
+                                                           i (if (= i (count @app)) 0 i)))
+                                                       1)})))
+             (dom/br nil)
+             (dom/br nil)
+             (dom/div
+              #js {:id div-id :className "thumbnail" :style #js {:height div-height}}
+              (dom/img #js {:id        img-id
+                            :className ""
+                            :src       src
+                            :style     #js {:msTransform     deg-2
+                                            :WebkitTransform deg-2
+                                            :transform       deg-2
+                                            :marginTop       img-margin-top
+                                            :height          img-height}
+                            :onClick   #(put! chan-thumb-show-in-full-screen-app-init {:src src})
+                            :onLoad    img-on-load}))
+             (dom/h2 nil (get-in @app [i :top_description] ""))
+             (dom/p nil (get-in @app [i :description] "")))))))))

 ;; END Thumbs
 ;;..................................................................................................


Fixes a hiding upstream bug that created a nil key path in the replica.

--- src/onyx/log/commands/common.clj
+++ src/onyx/log/commands/common.clj
@@ -71,11 +71,15 @@
 (defn remove-peers [replica id]
   (let [prev (get (allocations->peers (:allocations replica)) id)]
     (if (and (:job prev) (:task prev))
-      (let [remove-f #(vec (remove (partial = id) %))]
-        (-> replica
-            (update-in [:allocations (:job prev) (:task prev)] remove-f)
-            (update-in [:task-slot-ids (:job prev) (:task prev)] dissoc id)))
+      (let [remove-f #(vec (remove (partial = id) %))
+            deallocated (update-in replica [:allocations (:job prev) (:task prev)] remove-f)]
+        ;; Avoids making a key path to nil if there was no task slot
+        ;; for this peer.
+        (if (get-in replica [:task-slot-ids (:jobs prev) (:task-prev id)])
+          (update-in deallocated [:task-slot-ids (:job prev) (:task prev)] dissoc id)
+          deallocated))
       replica)))
+

 (defn all-inputs-exhausted? [replica job]
   (let [all (get-in replica [:input-tasks job])


Read workflow chunk with rest of TaskInformation

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

 (defrecord TaskInformation
   [id log job-id task-id
-   catalog task flow-conditions windows filtered-windows triggers lifecycles task-map]
+   workflow catalog task flow-conditions windows filtered-windows triggers lifecycles task-map]
   component/Lifecycle
   (start [component]
     (let [catalog (extensions/read-chunk log :catalog job-id)
@@ -471,11 +471,12 @@
           flow-conditions (extensions/read-chunk log :flow-conditions job-id)
           windows (extensions/read-chunk log :windows job-id)
           filtered-windows (wc/filter-windows windows (:name task))
+          workflow (extensions/read-chunk log :workflow job-id)
           triggers (extensions/read-chunk log :triggers job-id)
           lifecycles (extensions/read-chunk log :lifecycles job-id)
           task-map (find-task catalog (:name task))]
       (assoc component
-             :catalog catalog :task task :flow-conditions flow-conditions :windows windows
+             :workflow workflow :catalog catalog :task task :flow-conditions flow-conditions :windows windows
              :filtered-windows filtered-windows :triggers triggers :lifecycles lifecycles :task-map task-map)))
   (stop [component]
     (assoc component
@@ -492,7 +493,7 @@

   (start [component]
     (try
-      (let [{:keys [catalog task flow-conditions windows filtered-windows triggers lifecycles task-map]} task-information
+      (let [{:keys [workflow catalog task flow-conditions windows filtered-windows triggers lifecycles task-map]} task-information
             ;; Number of buckets in the timeout pool is covered over a 60 second
             ;; interval, moving each bucket back 60 seconds / N buckets
             input-retry-timeout (arg-or-default :onyx/input-retry-timeout task-map)
@@ -508,7 +509,7 @@
                            :onyx.core/task-id task-id
                            :onyx.core/task (:name task)
                            :onyx.core/catalog catalog
-                           :onyx.core/workflow (extensions/read-chunk log :workflow job-id)
+                           :onyx.core/workflow workflow
                            :onyx.core/flow-conditions flow-conditions
                            :onyx.core/compiled (->CompiledGroupingFn (g/task-map->grouping-fn task-map))
                            :onyx.core/task->group-by-fn (g/compile-grouping-fn catalog (:egress-ids task))


Fix arity of handle-exception.

Fix arity of handle-exception.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -551,7 +551,7 @@
                  :input-retry-segments-ch input-retry-segments-ch
                  :aux-ch aux-ch)))
       (catch Throwable e
-        (handle-exception log (constantly false) e restart-ch outbox-ch job-id)
+        (handle-exception log e restart-ch outbox-ch job-id)
         component)))

   (stop [component]


Fix scheduler-event issue where nil event would be used

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -554,9 +554,9 @@
       (info (:log-prefix component) "Stopping task lifecycle")
       (warn (:log-prefix component) "Stopping task lifecycle, failed to initialize task set up"))

-    (when-let [event (-> component
-                         :pipeline-data
-                         (assoc :onyx.core/scheduler-event (:scheduler-event component)))]
+    (when-let [event (some-> component
+                             :pipeline-data
+                             (assoc :onyx.core/scheduler-event (:scheduler-event component)))]
       (when-not (empty? (:onyx.core/triggers event))
         (>!! (:onyx.core/state-ch event) [(:scheduler-event component) event #()]))


Properly checkpoint output.

Properly checkpoint output.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -229,16 +229,17 @@
     (advance state)))

 (defn checkpoint-output [state]
-  ; (let [{:keys [onyx.core/job-id onyx.core/task-id
-  ;               onyx.core/slot-id onyx.core/storage
-  ;               onyx.core/tenancy-id]} (get-event state)
-  ;       checkpoint-bytes (checkpoint-compress true)]
-  ;   (checkpoint/write-checkpoint storage tenancy-id job-id (t/replica-version state)
-  ;                                 (t/epoch state) task-id slot-id :output checkpoint-bytes)
-  ;   (println "Checkpointed output" job-id (t/replica-version state)
-  ;            (t/epoch state) task-id slot-id :output)
-  ;   (advance state))
-  (advance state))
+  (let [{:keys [onyx.core/job-id onyx.core/task-id onyx.core/slot-id
+                onyx.core/storage onyx.core/monitoring onyx.core/tenancy-id]} (get-event state)
+        pipeline (get-output-pipeline state)
+        checkpoint (oo/checkpoint pipeline)
+        checkpoint-bytes (checkpoint-compress checkpoint)]
+    (.set ^AtomicLong (:checkpoint-size monitoring) (alength checkpoint-bytes))
+    (checkpoint/write-checkpoint storage tenancy-id job-id (t/replica-version state)
+                                   (t/epoch state) task-id slot-id :input checkpoint-bytes)
+    (println "Checkpointed output" job-id (t/replica-version state)
+             (t/epoch state) task-id slot-id :input)
+    (advance state)))

 (defn completed? [state]
   (sub/completed? (m/subscriber (get-messenger state))))


Revert test sleep.

Revert test sleep.

--- src/onyx/plugin/bench_plugin.clj
+++ src/onyx/plugin/bench_plugin.clj
@@ -42,7 +42,6 @@
                                     :input :generator
                                     :message {:n n
                                               :data hundred-bytes}}))))]
-    (Thread/sleep 500)
     (doseq [m batch]
       (swap! pending-messages assoc (:id m) (:message m)))
     {:onyx.core/batch batch}))


warp: fix unilog call signature

warp: fix unilog call signature

--- src/org/spootnik/warp/config.clj
+++ src/org/spootnik/warp/config.clj
@@ -1,6 +1,6 @@
 (ns org.spootnik.warp.config
-  (:require [clj-yaml.core          :as yaml]
-            [org.spootnik.logconfig :refer [start-logging!]]))
+  (:require [clj-yaml.core :as yaml]
+            [unilog.config :refer [start-logging!]]))

 (defn defaults
   [key config]


Implement projects API.

Implement projects API.

--- web-server/src/clj/hatnik/web/server/projects.clj
+++ web-server/src/clj/hatnik/web/server/projects.clj
@@ -1,42 +1,39 @@
 (ns hatnik.web.server.projects
   (:require [ring.util.response :as resp]
-            [compojure.core :refer :all]))
+            [compojure.core :refer :all]
+            [hatnik.db.storage :as stg]))

-(defn all-projects []
-  (resp/response
-   {:result :ok
-    :projects [{:id "1"
-                :name "Foo"
-                :actions [{:id "100"
-                           :group "org.clojure"
-                           :artifact "clojure"
-                           :last-processed-version "1.6.0"
-                           :type "email"
-                           :address "email@example.com"
-                           :template "Library release: {{LIBRARY}} {{VERSION}}"
-                           :disabled? false}]}
-               {:id "2"
-                :name "Baz"
-                :actions [{:id "200"
-                           :group ""
-                           :artifact "quil"
-                           :last-processed-version "2.2.0"
-                           :type "email"
-                           :address "email@example.com"
-                           :template "Library release: {{LIBRARY}} {{VERSION}}"
-                           :disabled? true}]}]}))
+(defn get-user [req]
+  (-> req :session :user))

-(defn create-project [config]
-  (resp/response {:result :ok :id "23"}))
+(defn load-actions [user-id project]
+  (let [actions (stg/get-actions @stg/storage user-id (:id project))]
+    (assoc project :actions actions)))

-(defn update-project [id config]
+(defn all-projects [user]
+  (let [projects (->> (stg/get-projects @stg/storage (:id user))
+                      (map #(dissoc % :user-id))
+                      (map #(load-actions (:id user) %)))]
+    (resp/response
+     {:result :ok
+      :projects projects})))
+
+(defn create-project [user data]
+  (let [project (assoc data :user-id (:id user))
+        id (stg/create-project! @stg/storage project)]
+    (resp/response {:result :ok :id id})))
+
+(defn update-project [user id data]
+  (let [project (assoc data :user-id (:id user))]
+    (stg/update-project! @stg/storage (:id user) id project))
   (resp/response {:result :ok}))

-(defn delete-project [id]
+(defn delete-project [user id]
+  (stg/delete-project! @stg/storage (:id user) id)
   (resp/response {:result :ok}))

 (defroutes projects-api
-  (GET "/" [] (all-projects))
-  (POST "/" req (create-project (:body req)))
-  (PUT "/:id" [id :as req] (update-project id (:body req)))
-  (DELETE "/:id" [id :as req] (delete-project id)))
+  (GET "/" req (all-projects (get-user req)))
+  (POST "/" req (create-project (get-user req) (:body req)))
+  (PUT "/:id" [id :as req] (update-project (get-user req) id (:body req)))
+  (DELETE "/:id" [id :as req] (delete-project (get-user req) id)))


Make sure validation-messages are nil when navigating to a chat

--- src/status_im/chat/handlers.cljs
+++ src/status_im/chat/handlers.cljs
@@ -274,6 +274,8 @@
                                {:chat-id  chat-id
                                 :function :init
                                 :context  {:from current-account-id}}))]
+       ; Reset validation messages, if any
+       (dispatch [:set-chat-ui-props {:validation-messages nil}])
        (dispatch [:load-requests! chat-id])
         ;; todo rewrite this. temporary fix for https://github.com/status-im/status-react/issues/607
        #_(dispatch [:load-commands! chat-id])


Remove unused destructured key.

Remove unused destructured key.

--- src/task_tracker/server/core.clj
+++ src/task_tracker/server/core.clj
@@ -6,7 +6,7 @@
             [task-tracker.server.nrepl     :as nrepl]))

 (defn make-system
-  [{:keys [nrepl db webserver app] :as config-options}]
+  [{:keys [nrepl db webserver] :as config-options}]
   (-> (component/system-map
        :db           (db/new-database (:host db) (:port db))
        :nrepl-server (nrepl/new-nrepl-server (:port nrepl))


Fix some erronious indentation.

Fix some erronious indentation.

--- src/frmr/dstt.clj
+++ src/frmr/dstt.clj
@@ -93,40 +93,40 @@
   [body]
   {:body body})

-  (def cli-options
-    [["-r" "--requests REQUESTS" "Number of requests"
-      :id :requests
-      :parse-fn #(Integer/parseInt %)
-      :missing "Number of requests (-r) is required."]
+(def cli-options
+  [["-r" "--requests REQUESTS" "Number of requests"
+    :id :requests
+    :parse-fn #(Integer/parseInt %)
+    :missing "Number of requests (-r) is required."]

-     ["-t" "--time TIME" "Time in seconds"
-      :id :time
-      :parse-fn #(Integer/parseInt %)
-      :missing "Time in seconds (-t) is required."]
+   ["-t" "--time TIME" "Time in seconds"
+    :id :time
+    :parse-fn #(Integer/parseInt %)
+    :missing "Time in seconds (-t) is required."]

-     [nil "--method METHOD" "HTTP method."
-      :id :method
-      :default "GET"
-      :validate-fn #(some #{%} ["GET" "POST"])]
+   [nil "--method METHOD" "HTTP method."
+    :id :method
+    :default "GET"
+    :validate-fn #(some #{%} ["GET" "POST"])]

-     [nil "--body BODY" "HTTP post body."
-      :id :body]
+   [nil "--body BODY" "HTTP post body."
+    :id :body]

-     [nil "--header HEADER" "HTTP header to set, multiple possible."
-      :id :headers
-      :parse-fn parse-header
-      :assoc-fn (fn [map key value]
-                  (update-in map
-                             [key]
-                             #(conj % value)))]
+   [nil "--header HEADER" "HTTP header to set, multiple possible."
+    :id :headers
+    :parse-fn parse-header
+    :assoc-fn (fn [map key value]
+                (update-in map
+                           [key]
+                           #(conj % value)))]

-     [nil "--handler HANDLER" "Custom handler file."
-      :id :handler
-      :default nil]
+   [nil "--handler HANDLER" "Custom handler file."
+    :id :handler
+    :default nil]

-     ["-h" "--help"]
+   ["-h" "--help"]

-     ["-v" "--verbose"]])
+   ["-v" "--verbose"]])

 (defn -main
   "Main entry point.


clean up inject*, extracting the defn? predicate out of it

--- src/keypin/di.clj
+++ src/keypin/di.clj
@@ -20,19 +20,23 @@
      (apply ~f ~@args args#)))

+(defn defn?
+  "Return true if argument is a var created using defn, false otherwise."
+  [df]
+  (and (var? df)
+    (contains? (meta df) :arglists)))
+
+
 (defn inject*
   "Given a var defined with defn and an argument map, look up the :inject metadata on arguments and return a partially
   applied function."
   ([v args {:keys [inject-meta-key]
             :or {inject-meta-key :inject}}]
-    (when-not (and (var? v)
-                (contains? (meta v) :arglists))
-      (i/expected "a var created with clojure.core/defn" v))
-    (when-not (map? args)
-      (i/expected "a map" args))
-    (let [{name-sym :name
-           arglists :arglists} (meta v)
-          prepared (map (partial i/inject-prepare inject-meta-key v) arglists)
+    (i/expected defn? "a var created with clojure.core/defn" v)
+    (i/expected map? "a map" args)
+    (let [prepared (->> (meta v)
+                     :arglists
+                     (map (partial i/inject-prepare inject-meta-key v)))
           bindings (->> prepared
                      (mapcat first)
                      (mapcat (fn [{:keys [sym inject-key]}]


prepare to store more data

prepare to store more data

--- src/otto/repositories.clj
+++ src/otto/repositories.clj
@@ -16,10 +16,10 @@
   (items [this organization]
     (filter (fn [[k v]]
               (let [[o n] k]
-                (= (:name organization) o))) @a))
+                (= (:name organization) o))) (:repositories @a)))
   (update [this organization repository-data]
     (let [k (repository-key organization repository-data)]
-      (dosync (alter a assoc-in [k] repository-data)))))
+      (dosync (alter a assoc-in [:repositories k] repository-data)))))

 (defn make-repository
   [attributes]
@@ -33,5 +33,5 @@

 (defn make-repositories
   []
-  (let [repos (ref (sorted-map))]
+  (let [repos (ref {:repositories (sorted-map)})]
     (->RepositoryList repos)))


Remove strange flattening of map within synth-player fn and replace it with auto :id extraction. Fixes #242.

--- src/overtone/sc/synth.clj
+++ src/overtone/sc/synth.clj
@@ -504,11 +504,10 @@
           args              (or args [])
           [target pos args] (extract-target-pos-args args (foundation-default-group) :tail)
           args              (idify args)
-          args              (mapcat (fn [x] (if (map? x)
-                                             (flatten (seq x))
-                                             [x]))
-                                    args)
-          args              (idify args)
+          args              (map (fn [arg] (if-let [id (:id arg)]
+                                            id
+                                            arg))
+                                 args)
           defaults          (into {} (map (fn [{:keys [name value]}]
                                             [(keyword name) @value])
                                           params))


bring loading bar to front

bring loading bar to front

--- src/cljs/daveconservatoire/site/ui.cljs
+++ src/cljs/daveconservatoire/site/ui.cljs
@@ -1268,7 +1268,7 @@
       100))

   (render [this]
-    (dom/div #js {:style #js {:position "fixed" :top 0 :left 0 :right 0}}
+    (dom/div #js {:style #js {:position "fixed" :top 0 :left 0 :right 0 :zIndex 100}}
       (dom/div #js {:className "loading-bar"
                     :style     #js {:background "#F7941E"
                                     :transition "width 200ms"


Helps to actually `require` the namespace for a var.

--- src/clojure/parkour/mapreduce/tasks.clj
+++ src/clojure/parkour/mapreduce/tasks.clj
@@ -9,8 +9,8 @@
   ([conf key]
      (let [fqname (conf/get conf (str "parkour." key ".var"))
            [ns sym] (str/split fqname #"/" 2)
-           ns (if-not (.startsWith ^String ns "#'") ns (subs ns 2))
-           f (ns-resolve (symbol ns) (symbol sym))
+           ns (symbol (if-not (.startsWith ^String ns "#'") ns (subs ns 2)))
+           f (do (require ns) (ns-resolve ns (symbol sym)))
            args (some->> (conf/get conf (str "parkour." key ".args"))
                          (edn/read-string {:readers *data-readers*}))]
        [f args]))


Added WCS-style temporal range parameter.

--- src/cmr/opendap/ous/query/params/v1.clj
+++ src/cmr/opendap/ous/query/params/v1.clj
@@ -23,7 +23,10 @@
    ;;  `?subset=lat(22,34)&subset=lon(169,200)`
    ;; giving values like so:
    ;;  `["lat(22,34)" "lon(169,200)"]`
-   subset])
+   subset
+   ;; `timeposition` is used to indicate temporal subsetting with starting
+   ;; and ending values being ISO 8601 datetime stamps, separated by a comma.
+   timeposition])

 (def params-keys
   (set/difference
@@ -42,4 +45,5 @@
     (assoc params :format (or (:format params)
                               const/default-format)
                   :coverage (util/->seq (:coverage params))
-                  :rangesubset (util/->seq (:rangesubset params)))))
+                  :rangesubset (util/->seq (:rangesubset params))
+                  :timeposition (util/->seq (:timeposition params)))))


making progress in inner trace 3 ??

making progress in inner trace 3 ??

--- src/com/billpiel/sayid/inner_trace3.clj
+++ src/com/billpiel/sayid/inner_trace3.clj
@@ -149,14 +149,119 @@
              (map f)
              (apply merge))))

+(defn deref-children
+  [tree-atom]
+  (if (util/atom? tree-atom)
+    (do
+      (swap! (:children @tree-atom)
+             #(mapv deref-children %))
+      @tree-atom)
+    tree-atom))

 (defn record-trace-tree!
   [tree-atom]
-  :NOT-IMPLEMENTED)
+  (let [children (some-> (@tree-atom nil)
+                         deref-children
+                         :children
+                         deref)]
+    (doseq [child children]
+      (swap! (:children trace/*trace-log-parent*)
+             conj
+             child))))
+
+(defn get-temp-root-tree
+  []
+  (-> trace/*trace-log-parent*
+      (select-keys [:depth :path])
+      (assoc :children (atom [])
+             :inner-path nil)
+      atom))
+
+(defn push-to-tree-atom!
+  [new-tree tree-atom]
+  (swap! tree-atom
+         assoc
+         (:inner-path @new-tree)
+         new-tree))
+
+(declare produce-recent-tree-atom!)
+
+(defn update-tree!
+  [tree tree-atom]
+  (reset! (-> tree
+              :inner-path
+              (@tree-atom))
+          tree))
+
+(defn conj-to-parent!
+  [node-atom parent-atom]
+  (swap! (:children @parent-atom)
+         conj
+         node-atom))
+
+(defn mk-recent-tree-at-inner-path
+  [path path-parents tree-atom]
+  (if (empty? path) ;; TODO is this the right way to detect root?
+    (let [new-tree (get-temp-root-tree)]
+      (push-to-tree-atom!  new-tree
+                           tree-atom)
+      new-tree)
+    (let [parent (produce-recent-tree-atom! (path-parents path)
+                                            path-parents
+                                            tree-atom)
+          new-tree (-> (trace/mk-tree :parent @parent)
+                       (assoc :inner-path path
+                              :parent-path (:path @parent))
+                       atom)]
+      (push-to-tree-atom! new-tree
+                          tree-atom)
+      (conj-to-parent! new-tree
+                       parent)
+      new-tree)))
+
+(defn get-recent-tree-at-inner-path
+  [path tree-atom & {:keys [skip-closed-check]}]
+  (let [entry (@tree-atom path)]
+    (if (or skip-closed-check
+            (not (some->> entry
+                          deref
+                          keys
+                          (some #{:return :throw}))))
+      entry
+      nil)))
+
+(defn produce-recent-tree-atom!
+  [path path-parents tree-atom & {:keys [skip-closed-check]}]
+  (if-let [tree-atom (get-recent-tree-at-inner-path (path-parents path)
+                                                    tree-atom
+                                                    :skip-closed-check skip-closed-check)]
+    tree-atom
+    (mk-recent-tree-at-inner-path path path-parents tree-atom)))

 (defn tr-fn
-  [template f tree-atom & args]
-  :NOT-IMPLEMENTED)
+  [template tree-atom f & args]
+  (let [this (-> (produce-recent-tree-atom! (:inner-path template)
+                                            (:path-parents template)
+                                            tree-atom)
+                 deref
+                 (merge template)
+                 (assoc :args (vec args)
+                        :arg-map nil
+                        :started-at (trace/now)))
+        _ (update-tree! this tree-atom)
+        [value throw] (binding [trace/*trace-log-parent* this]
+                        (try
+                          [(apply f args) nil]
+                          (catch Throwable t
+                            ;; TODO what's the best we can do here?
+                            [nil (trace/Throwable->map** t)])))
+        this' (assoc this
+                     :return value
+                     :throw throw ;;TODO not right
+                     :ended-at (trace/now))]
+    (update-tree! this'
+                  tree-atom)
+    value))

 (defn mk-tree-template
   [src-map frm-meta fn-meta path & {:keys [macro?]}]
@@ -349,8 +454,10 @@
                       (apply merge))
    :form (map (fn [m]
                 `(~(:args m)
-                  (let [~'$$ (atom [])]
-                    ~@(apply list (:form m)))))
+                  (let [~'$$ (atom {})
+                        ~'$$return (do ~@(apply list (:form m)))]
+                    (record-trace-tree! ~'$$)
+                    ~'$$return)))
               traced-bods)})

 (defn xpand-fn*
@@ -360,7 +467,7 @@
                   (map-indexed (partial xpand-body
                                         parent-fn-meta))
                   prep-traced-bods)]
-    `(let [~'$$paths ~(:paths bods)
+    `(let [~'$$paths ~(:path-parents bods)
            ~@(:templates bods)]
        (fn ~@(:form bods)))))

@@ -390,9 +497,31 @@
            (clojure.pprint/pprint traced-form)
            (throw e)))))

+
+(defn ^{::trace/trace-type :inner-fn} composed-tracer-fn
+  [m _]
+  (->> m
+       inner-tracer
+       (trace/shallow-tracer m)))
+
+(defmethod trace/trace* :inner-fn
+  [_ fn-sym workspace]
+  (-> fn-sym
+      resolve
+      (trace/trace-var* (util/assoc-var-meta-to-fn composed-tracer-fn
+                                                   ::trace/trace-type)
+                        workspace)))
+
+(defmethod trace/untrace* :inner-fn
+  [_ fn-sym]
+  (-> fn-sym
+      resolve
+      trace/untrace-var*))
+
+
 (defn f1
   [a]
-  (inc a))
+  (inc (dec a)))

 #_(let [$paths {:... :...}
         $0-0-inc (partial tr-fn {:... :...} $paths)]
@@ -415,3 +544,19 @@
                   :meta' {:ns 'com.billpiel.sayid.inner-trace3
                           :name 'com.billpiel.sayid.inner-trace3/f1}
                  :ns' 'com.billpiel.sayid.inner-trace3})
+
+#_ (binding [trace/*trace-log-parent* {:id :root1 :children (atom [])}]
+     (let [f1 (inner-tracer {:qual-sym 'com.billpiel.sayid.inner-trace3/f1
+                            :meta' {:ns 'com.billpiel.sayid.inner-trace3
+                          :name 'com.billpiel.sayid.inner-trace3/f1}
+                            :ns' 'com.billpiel.sayid.inner-trace3})]
+       (f1 2)
+       (clojure.pprint/pprint trace/*trace-log-parent*)))
+
+#_ (binding [trace/*trace-log-parent* @com.billpiel.sayid.core/workspace]
+     (let [f1 (inner-tracer {:qual-sym 'com.billpiel.sayid.inner-trace3/f1
+                            :meta' {:ns 'com.billpiel.sayid.inner-trace3
+                          :name 'com.billpiel.sayid.inner-trace3/f1}
+                            :ns' 'com.billpiel.sayid.inner-trace3})]
+       (f1 2)
+       #_       (clojure.pprint/pprint trace/*trace-log-parent*)))


Update the test after deleting that branch

--- test/circle/backend/test_git.clj
+++ test/circle/backend/test_git.clj
@@ -31,7 +31,7 @@
    :author_date "1323636643"
    :committer_name "Allen Rohner"
    :body ""
-   :branch "remotes/origin/pairing"
+   :branch "remotes/origin/nginx_ssl~68"
    :committer_email "arohner@gmail.com"})

 (fact "committer-email works"


Remove print.

Remove print.

--- test/onyx/peer/grouping_test.clj
+++ test/onyx/peer/grouping_test.clj
@@ -64,7 +64,6 @@

 (defn sum-balance [state {:keys [name amount] :as segment}]
   (swap! state (fn [v] (assoc v name (+ (get v name 0) amount))))
-;  (prn "I have: " @state)
   [])

 (def workflow {:in {:sum-balance :out}})


AB & RS | 7 | Add unit test for enlive response to check it injects app name

--- test/stonecutter/test/helper.clj
+++ test/stonecutter/test/helper.clj
@@ -20,9 +20,17 @@
 (fact "If context has an alternative theme, then enlive-response swaps in that one"
       (let [html "<link data-clojure-id=\"theme-link\" href=\"stylesheets/application.css\" />"
             enlive-m (html/html-snippet html)]
-        (fact "there is no theme in session"
+        (fact "there is no theme in context"
               (-> (helper/enlive-response enlive-m {}) get-response-enlive-m get-link-href)
                   => "stylesheets/application.css")
-        (fact "theme called dcent in session modifiers the header to point to dcent_theme.css"
+        (fact "theme called dcent in context modifiers the header to point to dcent_theme.css"
               (-> (helper/enlive-response enlive-m {:theme {:theme "dcent"}}) get-response-enlive-m get-link-href)
                   => "stylesheets/dcent_theme.css")))
+
+(fact "Enlive response injects the app name anywhere where class is clj--app-name"
+      (let [html "

"
+            enlive-m (html/html-snippet html)]
+        (-> (helper/enlive-response enlive-m {:theme {:app-name "My App"}}) get-response-enlive-m
+            (html/select [:h1]) first html/text) => "My App"
+        (-> (helper/enlive-response enlive-m {:theme {:app-name "My App"}}) get-response-enlive-m
+            (html/select [:span]) first html/text) => "My App"))


Starting to sketch out component system stuff

--- src/strange_coop/core.clj
+++ src/strange_coop/core.clj
@@ -105,7 +105,42 @@
     :else :night))

-(defn check [] (println "compiled!"))
+(defrecord StateMachine [config channels]
+
+
+
+(def system nil)
+
+(def create-system [config-overrides]
+  (component/system-map
+    :config   (create-config config-overrides)
+    :pins     (component/using (create-pins) [:config])
+    :channels (component/using (create-channels) [:config])
+    :nrepl    (component/using (create-nrepl) [:config])))
+
+(defn start
+  ([config-overrides]
+   (when-not system
+     (alter-var-root #'system (constantly (create-system config-overrides))))
+   (alter-var-root #'system component/start))
+  ([] (start {})))
+
+
+(defn stop
+  []
+  (alter-var-root #'system component/stop))
+
+(defn restart
+  "Restart (stop then start) the system with whatever configurations were running in the previous
+  system, except for overrides as specified by the optional config-overrides arg (works by calling
+  deep-merge on the current config or {} if none with config-overrides, and passing that as
+  config-overrides to the config component)."
+  ([config-overrides]
+   (let [current-config (or (:config (:config system)) {})
+         new-config-overrides (config/deep-merge current-config config-overrides)]
+     (stop)
+     (start new-config-overrides)))
+  ([] (restart {})))

 (defn -main []
@@ -136,21 +171,3 @@
         (recur (trans-sm! timer light-level))))))

-(defn play []
-  (println "ready to initialize")
-  (let [g  (button/button :P8 11 :normally-off)
-        a1 (ain 33)
-        a2 (ain 35)]
-    (println "initialized successfully")
-    (doseq [_ (range)]
-      (try
-        (println "Reading light" (safe-read! a1))
-        (println "Reading temp" (safe-read! a2))
-        (println "Btn closed?" (button/closed? g))
-        (println "")
-        (catch Exception e
-          (println "Had an exception")
-          (println e)))
-      (Thread/sleep 1000))))
-
-


Started adding row-permutation-feature to table control

--- src/conexp/contrib/gui/editors/util.clj
+++ src/conexp/contrib/gui/editors/util.clj
@@ -268,7 +268,10 @@

 ;;;  Table

-(defrecord table-control [widget control hooks model])
+(defrecord table-control [widget control hooks model row-permutator])
+;; row-permutator is a two-element vector of functions, where the first-row
+;; element transforms view-rows to index-rows and the second element is
+;; the inverse function transforming index-rows to view-rows.
 (derive ::table-control ::control)
 (derive ::table-control :conexp.contrib.gui.util.hookable/hookable)

@@ -347,19 +350,22 @@
 (defn-typecheck get-row-index ::table-control
   "Returns the tables model index of the specified row in view."
   [otable row]
-  row)
+  (let [p (:row-permutator otable)]
+    ((first p) row)))

 (defn-typecheck get-index-row ::table-control
   "Returns the row in the view that corresponds
   to the specified table model index."
   [otable index]
-  index)
+  (let [p (:row-permutator otable)]
+    ((second p) index)))

 (defn-typecheck get-row-index-permutator ::table-control
   "Returns a function that will map the current view rows to
    the according index values."
   [otable]
-  identity)
+  (let [p (:row-permutator otable)]
+    (first p)))

 (defn-typecheck-swing get-column-index-permutator ::table-control
   "Returns a function that will map the current view
@@ -504,6 +510,20 @@
          col-model (.getColumnModel control) ]
     (.moveColumn col-model old-view new-view)))

+(defn-typecheck-swing-threads* move-row ::table-control
+  "Moves the row at view index old-view to be viewed at view index
+   new-view."
+  [otable old-view new-view]
+  (let [p (:row-permutator otable)
+        row-count (get-row-count otable)]
+    (if (and (>= new-view 0)
+         (< new-view row-count)
+          (not= old-view new-view))
+      (if (< old-view new-view)
+        nil
+        nil
+        ))))
+
 (defn- table-change-hook
   [otable column first-row last-row type]
   (if (and (= 0 type)
@@ -531,7 +551,8 @@
                                                 ActionEvent/CTRL_MASK false),

         hooks           (:hooks (make-hookable)),
-        widget          (table-control. pane table hooks model),
+        widget          (table-control. pane table hooks model
+                          [identity identity]),
         change-listener (proxy [TableModelListener] []
                           (tableChanged [event]
                             (with-swing-threads*


Added new config option.

Added new config option.

--- src/midje/doc.clj
+++ src/midje/doc.clj
@@ -305,6 +305,9 @@

   :check-after-creation         ; Should facts be checked as they're loaded?
                                 ; Default true.
+
+  :emitter                      ; Namespace or pathname that contains
+                                  an \"emitter\" of custom output.

   :visible-deprecation          ; Whether information about deprecated
                                 ; features or functions is printed.


consume list header first

consume list header first

--- src/neuseg/db.clj
+++ src/neuseg/db.clj
@@ -19,7 +19,8 @@
 (defn- process-line [vecmodel name data]
   (let [[[wd nvec] idx] data]
       (do
-        (if (= (mod idx 1000) 0) (print "."))
+        (if (= (mod idx 1000) 0)
+          (do (print ".") (.flush System/out)))
         (swap! (get registry name) assoc wd idx)
         (set-row! vecmodel idx nvec))))

@@ -35,7 +36,7 @@
           (dorun
             (map (partial process-line vecmodel name)
               (partition-by #(if (number? %1) (reset! last %1) (+ @last 1))
-                (interleave (map splited-line data)
+                (interleave (map splited-line (reset data))
                             (iterate inc 0)))))
           vecmodel)))


route to tell the frontend to reload

route to tell the frontend to reload

--- src/pc/server.clj
+++ src/pc/server.clj
@@ -18,6 +18,7 @@
             [pc.http.datomic :as datomic]
             [pc.http.doc :refer (duplicate-doc)]
             [pc.http.sente :as sente]
+            [pc.assets]
             [pc.auth :as auth]
             [pc.auth.google :refer (google-client-id)]
             [pc.models.access-grant :as access-grant-model]
@@ -224,6 +225,10 @@
         {:status 200
          :body (blog/render-page slug)})

+   ;; TODO: protect this route with admin credentials
+   (POST "/admin/reload-assets" []
+         (pc.assets/reload-assets))
+
    (ANY "*" [] {:status 404 :body "Page not found."})))

 (defn log-request [req resp ms]


change status to response

change status to response

--- src/rrms/core.clj
+++ src/rrms/core.clj
@@ -89,8 +89,8 @@

   (GET "/documents/id/:id" [id]
        (rr/content-type
-        (rr/status (db/get-documents-by-id
-                    {:id (parse-int id)}))
+        (rr/response (db/get-documents-by-id
+                {:id (parse-int id)}))
         content-type))

   (POST "/documents/add" {body :body}


add time to event

add time to event

--- src/redbrick_20/components/data.cljs
+++ src/redbrick_20/components/data.cljs
@@ -20,7 +20,7 @@
   :event-location "Opium Cafe, Wexford St, Dublin"
   :event-tickets "https://ti.to/Redbrick-DCU/redbricks-20th-birthday"
   :event-date "9th of April"
-  :event-information "TBA"}))
+  :event-information "From 19:00 - 23:00"}))

 (def donationGoals (reagent/atom [
     {


jetty reload

jetty reload


Setting the time isn't working properly so bye

--- src/cljs/kenny/core.cljs
+++ src/cljs/kenny/core.cljs
@@ -409,10 +409,7 @@
                                     (dom/th nil "Blue Trampoline")
                                     (om/build table-cell (get-in app [:settings :blue-trampete]) {:init-state {:options (mapv (fn [i] [i]) (range 1 5))}})
                                     )
-                            (dom/tr nil
-                                    (dom/th nil "Spiel Dauer")
-                                    (om/build table-cell (get-in app [:hero :time]) {:init-state {:options (mapv (fn [i] [i]) (range 30 130 10))}})
-                                    )
+
                             )

                  )


always use english for fallback text

always use english for fallback text

Signed-off-by: andrey <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/chat/models/input.cljs
+++ src/status_im/chat/models/input.cljs
@@ -174,7 +174,7 @@
             {:chat-id      chat-id
              :content-type constants/content-type-image
              :image-path   (utils/safe-replace uri #"file://" "")
-             :text         (i18n/label :t/update-to-see-image)})
+             :text         (i18n/label :t/update-to-see-image {"locale" "en"})})
           images)))

 (fx/defn clean-input [{:keys [db] :as cofx} current-chat-id]
@@ -227,7 +227,7 @@
                                      :content-type      constants/content-type-audio
                                      :audio-path        audio-path
                                      :audio-duration-ms duration
-                                     :text              (i18n/label :t/update-to-listen-audio)})))
+                                     :text              (i18n/label :t/update-to-listen-audio {"locale" "en"})})))

 (fx/defn send-sticker-message
   [cofx {:keys [hash pack]} current-chat-id]
@@ -236,7 +236,7 @@
                                      :content-type constants/content-type-sticker
                                      :sticker {:hash hash
                                                :pack pack}
-                                     :text    (i18n/label :t/update-to-see-sticker)})))
+                                     :text    (i18n/label :t/update-to-see-sticker {"locale" "en"})})))

 (fx/defn send-edited-message [{:keys [db] :as cofx} text {:keys [message-id]}]
   (fx/merge


fixed qr data

fixed qr data

--- src/status_im/components/camera.cljs
+++ src/status_im/components/camera.cljs
@@ -29,5 +29,4 @@
   (r/create-element default-camera (clj->js (merge {:inverted true} props))))

 (defn get-qr-code-data [code]
-  (when (= "QR_CODE" (.-type code))
-    (.-data code)))+  (.-data code))


add exception handling

add exception handling

--- src/leiningen/jshint.clj
+++ src/leiningen/jshint.clj
@@ -2,6 +2,7 @@
   leiningen.jshint
   (:require [leiningen.npm :as npm]
             [leiningen.npm.process :as process]
+            [leiningen.core.main :as main]
             [leiningen.help :as help]
             [leiningen.compile]
             [cheshire.core :as json]
@@ -19,6 +20,9 @@
   (doto (io/file file)
     (spit content)
     (.deleteOnExit)))
+
+(defn joine [& data]
+  (string/join "\r\n" data))

 ; Internal API: Configuration
@@ -61,7 +65,7 @@

 (defn- generate-exclude-files [project]
   (let [excludes (exclude-files project)
-        content (string/join "\r\n" excludes)]
+        content (joine excludes)]
     (create-tmp-file (ignore-file project) content)))

 (defn- invoke [project & args]
@@ -70,14 +74,21 @@
    (cons "jshint" args)))

 (defn- proc [project & args]
-  (npm/environmental-consistency project)
-  (let [file (config-file project)
-        content (generate-config-file project)
-        includes (include-files project)
-        sources (remove empty? (concat (apply vec args) includes))]
-    (npm/with-json-file file content project
-                        (generate-exclude-files project)
-                        (apply invoke project sources))))
+  (try
+    (npm/environmental-consistency project)
+    (let [file (config-file project)
+          content (generate-config-file project)
+          includes (include-files project)
+          sources (remove empty? (concat (apply vec args) includes))]
+      (npm/with-json-file file content project
+                          (generate-exclude-files project)
+                          (apply invoke project sources)))
+    (catch Throwable t
+      (println (joine "Can't execute jshint application."
+                      "Check that JSHint is:"
+                      " - installed correctly: npm install jshint -g"
+                      " - configured correctly: https://github.com/vbauer/lein-jshint.git"))
+      (main/abort))))

 ; External API: Task


the first entry in a map is a pair

the first entry in a map is a pair

--- src/ophion/aggregate.clj
+++ src/ophion/aggregate.clj
@@ -128,8 +128,7 @@
 (defn mark-field
   [label]
   (if (map? label)
-    (let [key (first label)
-          value (last label)
+    (let [[key value] (first label)
           path (str "_history." key)]
       {path (dollar value)})
     (let [path (str "_history." label)]


Update schema benchmarks to use s/checker over s/validate

--- src/validation_benchmark/lib/schema.clj
+++ src/validation_benchmark/lib/schema.clj
@@ -6,69 +6,65 @@
   (:import [validation_benchmark.common Person]))

-(defn atomic-keyword [v]
-  (s/validate s/Keyword v))
+(def atomic-keyword
+  (s/checker s/Keyword))

-(defn atomic-number [v]
-  (s/validate s/Num v))
+(def atomic-number
+  (s/checker s/Num))

-(defn nil-allowed-bool [v]
-  (s/validate (s/maybe s/Bool) v))
+(def nil-allowed-bool
+  (s/checker (s/maybe s/Bool)))

-(defn nil-allowed-number [v]
-  (s/validate (s/maybe s/Num) v))
+(def nil-allowed-number
+  (s/checker (s/maybe s/Num)))

-(defn nil-allowed-string [v]
-  (s/validate (s/maybe s/Str) v))
+(def nil-allowed-string
+  (s/checker (s/maybe s/Str)))

-(defn person-map [v]
-  (s/validate {:name s/Str, :saiyan? s/Bool, :age s/Int} v))
+(def person-map
+  (s/checker {:name s/Str, :saiyan? s/Bool, :age s/Int}))

-(defn person-record [v]
-  (s/validate (s/record Person
-                        {:name s/Str, :saiyan? s/Bool, :age s/Int}
-                        map->Person) v))
+(def person-record
+  (s/checker (s/record Person
+                       {:name s/Str, :saiyan? s/Bool, :age s/Int}
+                       map->Person)))

-(defn primes [v]
-  (s/validate (s/pred prime?) v))
+(def primes
+  (s/checker (s/pred prime?)))

-(defn range-check [v]
-  (s/validate [(s/one (s/pred (partial in-range? 0.0 1.0)) "f")
-               (s/one (s/pred (partial in-range? 1 10)) "g")
-               (s/one (s/pred (partial in-range? 1 100)) "h")] v))
+(def range-check
+  (s/checker [(s/one (s/pred (partial in-range? 0.0 1.0)) "f")
+              (s/one (s/pred (partial in-range? 1 10)) "g")
+              (s/one (s/pred (partial in-range? 1 100)) "h")]))

-(defn set-of-keywords [v]
-  (s/validate #{s/Keyword} v))
+(def set-of-keywords
+  (s/checker #{s/Keyword}))

-(defn three-tuple [v]
-  (s/validate [(s/one s/Keyword "k")
-               (s/one s/Str "s")
-               (s/one s/Num "n")]
-              v))
+(def three-tuple
+  (s/checker [(s/one s/Keyword "k")
+              (s/one s/Str "s")
+              (s/one s/Num "n")]))

-(defn vector-of-two-elements [v]
-  (s/validate [(s/one s/Any "first") (s/one s/Any "second")] v))
+(def vector-of-two-elements
+  (s/checker [(s/one s/Any "first") (s/one s/Any "second")]))

-(defn vector-of-variable-length [v]
-  (s/validate (s/conditional vector? [s/Any]) v))
+(def vector-of-variable-length
+  (s/checker (s/conditional vector? [s/Any])))

 (defn wrapper [f valid?]
   (fn [v]
-    (= (try
-         (f v)
-         true
-         (catch Exception e false))
+    (= (not (f v))
        valid?)))


fix missing data

fix missing data

--- cloc-webapp/src-cljs/dash/dash.cljs
+++ cloc-webapp/src-cljs/dash/dash.cljs
@@ -6,24 +6,27 @@
             [cljs-http.client :as http])
   (:import [goog.net Cookies]))

+(enable-console-print!)
+
 (def app-state (atom {}))

 (defn repo-list-view [state owner]
   (reify
-    om/IRenderState
-    (render-state [this state]
+    om/IRender
+    (render [this]
       (apply dom/ul nil
-        (map (fn [repo] (dom/li nil (:full_name repo))) state)))))
+        (map (fn [repo] (dom/li nil (get repo "full_name"))) state)))))

 (defn widget [state owner]
   (reify
     om/IInitState
     (init-state [_]
-      {:me (json/parse (.-cloc_me js/window))
+      {:me (js->clj (json/parse (.-cloc_me js/window)))
        :auth (.get (Cookies. js/document) "session_id")})

     om/IRenderState
     (render-state [this state]
-      (build repo-list-view {:state (:repo state)}))))
+      (dom/div nil
+        (om/build repo-list-view (get-in state [:me "repos"]))))))

 (om/root widget app-state {:target (.getElementById js/document "content")})


comment edit

comment edit

--- clojure/cljs/kuroi/page_parser.cljs
+++ clojure/cljs/kuroi/page_parser.cljs
@@ -283,8 +283,6 @@
    :default thread))

 ;; tree scrapper ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;; (flat scrapper isn't implemented)

 (defmulti parse-threads trade-dispatch)

@@ -359,6 +357,7 @@
   ([threads target]
      (parse-structured threads "table .reply" target)))

+;; flat scrapper ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defn parse-flat [doc-tree target]
   (let [elts (select* doc-tree "form#delform > input[type='checkbox'],
@@ -633,7 +632,8 @@
 (defmethod extract-navbar "dobrochan.ru" [dom target]
   (when-let [navbar-elt (select dom ".adminbar")]
     (transform-navbar dom target (seq (.-childNodes navbar-elt))
-                      #(re-matches #"/[a-zA-Z0-9-]+/index.xhtml" (.getAttribute % "href"))
+                      #(when-let [href (.getAttribute % "href")]
+                         (re-matches #"/[a-zA-Z0-9-]+/index.xhtml" href))
                       #(let [l (.getAttribute % "href")]
                          (set! (.-href %) (str io/*scheme* (:domain target)
                                                (.substring l 0 (.lastIndexOf l "/"))))


Put the nav in logical order.

Put the nav in logical order.

--- src/klangmeister/ui/view.cljs
+++ src/klangmeister/ui/view.cljs
@@ -14,9 +14,9 @@
   [:div {:id "menu"}
    [:ul
     [:li [:a {:href "/synthesis"} "Synthesis"]]
-    [:li [:a {:href "/jam"} "Jam"]]
-    [:li [:a {:href "/about"} "About"]]
-    [:li [:a {:href "/music"} "Music"]]]])
+    [:li [:a {:href "/music"} "Music"]]
+    [:li [:a {:href "/jam"} "Jamming"]]
+    [:li [:a {:href "/about"} "About"]]]])

 (defn frame [content]
   [:div


default to notifications

default to notifications

--- frontend/components/account.cljs
+++ frontend/components/account.cljs
@@ -39,7 +39,6 @@
              (fn [org]
                (let [org-url    (routes/v1-org-settings-subpage {:org     (:login org)
                                                                  :subpage "plans"})
-                     ;; XXX Is there a nicer helper for sized avatar urls?
                      avatar-url (if-let [avatar-url (:avatar_url org)]
                                   (str avatar-url "25")
                                   (gh-utils/gravatar-url {:gravatar_id (:gravatar_id org)
@@ -60,10 +59,6 @@
                   [:br]]))
              user-and-orgs)]]])))))

-;; XXX 1. How can we re-enable the form after it's been processed?
-;; 2. I don't want the submit event to fire unless there's actually
-;; input (or some other predicate is met), but the managed-button
-;; seems to wrap/override my on-click event
 (defn heroku-key [app owner]
   (reify
     om/IInitState
@@ -252,7 +247,7 @@
                          :heroku        heroku-key
                          :api           api-tokens
                          :plans         plans}
-            subpage-com (get coms subpage)]
+            subpage-com (get coms subpage notifications)]
         (html
          [:div#account-settings
           [:div.account-top


added content to detail list

added content to detail list

--- src/app/cljs/one/hfp/data.cljs
+++ src/app/cljs/one/hfp/data.cljs
@@ -10,6 +10,7 @@
 (def details-2 (list (list true "https://github.com/huntfunc/huntfunc-one/wiki/huntfunc-one-project-wiki" "Description")
                    (list true "https:/github.com/huntfunc/huntfunc-one" "GitHub Link")
                    (list true "https://github.com/huntfunc/huntfunc-one/wiki/Road-Map" "Road Map")
+                   (list true "https://github.com/huntfunc/huntfunc-one/issues" "Issues")
                    (list false "In Development" "Status")))
 (def details-1 (list (list true "https://github.com/huntfunc/huntfunc-one/wiki/The-Virtual-Lending-Library" "Description")
                    (list true "/images/vllUML.png" "A UML (sorta) of the VLL project")


New function: read-statistic-for-author

New function: read-statistic-for-author

--- src/arachnida/db_interface.clj
+++ src/arachnida/db_interface.clj
@@ -15,11 +15,17 @@
                                   from   products
                                   order  by name;"))

+(defn read-product-id
+    [product-name]
+    (:id (first (jdbc/query db-spec/data-db ["select id
+                                              from products
+                                              where name=?" product-name]))))
+
 (defn read-repo-list
     [product-id]
     (jdbc/query db-spec/data-db ["select id, name, url
                                   from   repos
-                                  where  product=? order by id;" product-id]))
+                                  where  product=? order by name;" product-id]))

 (defn read-commit-id
     [db product repo sha]
@@ -59,11 +65,12 @@
                                 :insertions insertions
                                 :deletions deletions}))

-(defn read-autor-names
+(defn read-author-names
     []
     (jdbc/query db-spec/data-db
                                ["select author
                                  from commits
+                                 where date between '2015-01-01' and '2015-12-31'
                                  group by author order by author"]))

 (defn read-authors
@@ -77,6 +84,18 @@
                                  from commits
                                  where date between '2015-01-01' and '2015-12-31'
                                  group by author order by author"]))
+
+(defn read-statistic-for-author
+    [author-name]
+    (first
+    (jdbc/query db-spec/data-db
+                               ["select count(*) as commits_count,
+                                        sum(files_changed) as files_changed,
+                                        sum(insertions) as insertions,
+                                        sum(deletions) as deletions
+                                 from commits
+                                 where date between '2015-01-01' and '2015-12-31'
+                                 and author=?" author-name])))

 (defn read-stat-per-weeks-from-db
     [first-day last-day]


add :past-perfect for "forgot"

add :past-perfect for "forgot"

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -736,6 +736,7 @@
    "forget" {:synsem {:cat :verb
                       :sem {:pred :forget}}
              :english {:past "forgot"
+                       :past-perfect "forgotten"
                        :participle "forgetting"}}

    "form" {:synsem {:cat :verb


'prendre' => "grab" or "take"

'prendre' => "grab" or "take"

--- src/babel/francais/lexicon.clj
+++ src/babel/francais/lexicon.clj
@@ -484,10 +484,12 @@
 ;  "profiter (de)" {:synsem {:cat :verb
 ;                            :sem {:pred :take-advantage-of}}}

-  "prendre" {:synsem {:cat :verb
-                         :past-participle "pris"
-                         :sem {:pred :grab}}}
-
+  "prendre" [{:synsem {:cat :verb
+                       :past-participle "pris"
+                       :sem {:pred :grab}}}
+             {:synsem {:cat :verb
+                       :past-participle "pris"
+                       :sem {:pred :take}}}]
   "pouvoir"
    (let [shared-part-of-pouvoir
          {:synsem {:essere false


core: pr-str, prn-str, print-str, println-str

--- core/data/core.clj
+++ core/data/core.clj
@@ -2458,6 +2458,38 @@
   `(binding [*in* (buffer* ~s)]
      ~@body))

+(defn pr-str
+  "pr to a string, returning it"
+  {:tag String
+  :added "1.0"}
+  [& xs]
+  (with-out-str
+    (apply pr xs)))
+
+(defn prn-str
+  "prn to a string, returning it"
+  {:tag String
+  :added "1.0"}
+  [& xs]
+  (with-out-str
+    (apply prn xs)))
+
+(defn print-str
+  "print to a string, returning it"
+  {:tag String
+  :added "1.0"}
+  [& xs]
+  (with-out-str
+    (apply print xs)))
+
+(defn println-str
+  "println to a string, returning it"
+  {:tag String
+  :added "1.0"}
+  [& xs]
+  (with-out-str
+    (apply println xs)))
+
 (defn hash
   "Returns the hash code of its argument."
   {:added "1.0"}


more node config options

more node config options

--- src/main/shadow/cljs/node.clj
+++ src/main/shadow/cljs/node.clj
@@ -52,13 +52,21 @@
                     :main-fn main-fn
                     :main main
                     :output-to output-to
-                    :public-dir public-dir)]
+                    :public-dir public-dir)
+
+        main-call
+        (-> node-config :main (make-main-call-js))
+
+        module-opts
+        (-> opts
+            (select-keys [:prepend :append :prepend-js :append-js])
+            (update :append-js str "\n" main-call))]

     (-> state
         (assoc :node-config node-config)
         (assoc :public-dir public-dir)
         (cljs/reset-modules)
-        (cljs/configure-module module-name [(symbol main-ns)] #{} {:append-js (-> node-config :main (make-main-call-js))})
+        (cljs/configure-module module-name [(symbol main-ns)] #{} module-opts)
         )))

 (defn compile [state]


Add missing #+cljs marks on testrunner.cljx file.

--- test/cats/testrunner.cljx
+++ test/cats/testrunner.cljx
@@ -12,8 +12,10 @@
             [cats.monad.continuation-spec]
             [cljs.nodejs :as nodejs]))

+#+cljs
 (nodejs/enable-util-print!)

+#+cljs
 (defn runner
   []
   (if (cljs.test/successful? (run-tests 'cats.builtin-spec
@@ -28,4 +30,5 @@
     0
     1))

+#+cljs
 (set! *main-cli-fn* runner)


Remove unused requires.

Remove unused requires.

--- test/clj/quil/snippet.clj
+++ test/clj/quil/snippet.clj
@@ -1,7 +1,5 @@
 (ns quil.snippet
-  (:require [quil.util :refer [clj-compilation?]]
-            [quil.core :as q]
-            [quil.util :refer [no-fn]]
+  (:require [quil.core :as q]
             [quil.snippets.all-snippets :as as]
             [clojure.test :as t :refer [is]]
             [clojure.string :as cstr]


updated to fix date format

updated to fix date format

--- src/clinvar_submitter/form.clj
+++ src/clinvar_submitter/form.clj
@@ -31,7 +31,7 @@
         (let [c (compare bi ai)]
           (if (= c 0) (compare a b) c)))))

-
+;*** Interpretation related transformations ***
 (defn interp-id
    "Return the id portion of the @id url by taking the last part
     of the url for VariantInterpretation. If id is null return error message"
@@ -54,70 +54,80 @@
    in order to prevent Excel from converting it to a date internally.
    ClinVar requires that the yyyy-MM-dd format is maintained in their submission."
   [t i r]
-  (if(nil? (ld-> t i "contribution")) (report/append-to-report r "\n\n*E-401: Interpretation evaluation date not provided"))
+  (if(nil? (ld-> t i "contribution")) (report/append-to-report r "\n\n*E-403: Interpretation evaluation date not provided"))
   (let [contribution (ld-> t i "contribution")]
-    (if (nil? (get contribution "onDate")) ""
+    (if (nil? (get contribution "onDate")) "*E-403"
       (try
       (.format
         (java.text.SimpleDateFormat. "'=\"'yyyy-MM-dd'\"'")
         (.parse
           (java.text.SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXX")
           (get contribution "onDate")))
-       (catch Exception e (report/append-to-report r "\n\n*E-404: Interpretation evaluation date format not valid") (get contribution "onDate") "*E-404")))))
-
+       (catch Exception e
+         (report/append-to-report r "\n\n*E-404: Interpretation evaluation date format not valid")  (get contribution "onDate") "*E-404")))))
+
   (defn get-interpretation
-    "Returns a map of all interpretation related fields needed for the
+   "Returns a map of all interpretation related fields needed for the
     clinvar 'variant' submission sheet."
-    [t i r]
-    {:id (interp-id i r),
-     :significance (interp-significance t i r),
-     :eval-date (interp-eval-date t i r)})
-
-
+   [t i r]
+   {:id (interp-id i r),
+    :significance (interp-significance t i r),
+    :eval-date (interp-eval-date t i r)})
+
+;*** Variant related transformations ***
+
  (defn variant-identifier
-  "Return variant identifier, typically the ClinGen AlleleReg id."
-  [v]
-  (csv-colval (get v "CanonicalAllele") "ERROR-variant-identifier"))
-
+   "Return variant identifier, typically the ClinGen AlleleReg id."
+   [v r]
+   (if (nil? v) (report/append-to-report r "\n\n*E-202: Variant identifier not provided."))
+   (csv-colval (get v "CanonicalAllele") "*E-202"))
+
+
   (defn variant-alt-designations
   "Return variant hgvs representations"
-  [v]
-  (csv-colval (get v "alleleName name") "ERROR-variant-alt-designations"))
+  [v r]
+  (if (nil? v) (report/append-to-report r "\n\n*W-251: Preferred variant alternate designation not provided"))
+  (csv-colval (get v "alleleName name") "*W-251"))

  (defn variant-refseq
   "Return the variant reference sequence."
-  [t v]
+  [t v r]
   (let [refseq (ld-> t v "referenceCoordinate" "referenceSequence")]
-    (csv-colval (get refseq "display") "ERROR-variant-refseq")))
-
- (defn variant-start
+  (if (nil? refseq) (report/append-to-report r "\n\n*E-204: Preferred variant reference sequence not provided."))
+    (csv-colval (get refseq "display") "*E-204")))
+
+(defn variant-start
   "Return the variant reference sequence start pos (0-to-1-based transform)."
-  [t v]
-  ; if ref is not null add 1 to start otherwise as-is
+  [t v r]
+   ;if ref is not null add 1 to start otherwise as-is
   (let [ref (ld-> t v "referenceCoordinate" "refAllele")
         alt (get v "allele")
         start (ld-> t v "referenceCoordinate" "start")]
-    (csv-colval (if (str/blank? ref) (get start "index") (+ 1 (get start "index"))) "ERROR-variant-start")))
-
- (defn variant-stop
+    (if (nil? start) (report/append-to-report r "\n\n*E-205: Preferred variant start coordinate not provided."))
+    (csv-colval (if (str/blank? ref) (get start "index") (+ 1 (get start "index"))) "*E-205")))
+
+(defn variant-stop
   "Return the variant reference sequence stop pos (0-to-1-based transform)."
-  [t v]
-  ; if ref is blank and alt is not add 1 to stop otherwise as-is
+  [t v r]
+   ;if ref is blank and alt is not add 1 to stop otherwise as-is
   (let [ref (ld-> t v "referenceCoordinate" "refAllele")
         alt (get v "allele")
         stop (ld-> t v "referenceCoordinate" "end")]
-    (csv-colval (if (and (str/blank? ref) (not (str/blank? alt))) (+ 1 (get stop "index")) (get stop "index")) "ERROR-variant-stop")))
+    (if (nil? stop) (report/append-to-report r "\n\n*E-206: Preferred variant stop coordinate not provided."))
+    (csv-colval (if (and (str/blank? ref) (not (str/blank? alt))) (+ 1 (get stop "index")) (get stop "index")) "*E-206")))

  (defn variant-ref
   "Return the variant ref allele sequence."
-  [t v]
+  [t v r]
   (let [refcoord (ld-> t v "referenceCoordinate")]
-    (csv-colval (get refcoord "refAllele") "ERROR-variant-ref")))
+    (if (nil? v) (report/append-to-report r "\n\n*E-207: Preferred variant reference allele not provided."))
+    (csv-colval (get refcoord "refAllele") "*E-207")))

  (defn variant-alt
    "Return the variant alt allele sequence."
-   [v]
-   (csv-colval (get v "allele") "ERROR-variant-alt"))
+   [v r]
+   (if (nil? v) (report/append-to-report r "\n\n*E-208: Preferred variant alternate allele not provided."))
+   (csv-colval (get v "allele") "*E-208"))

  (defn get-variant
   "Returns a map of all variant related fields needed for the clinvar
@@ -132,47 +142,50 @@
   [t i r]
   (let [v (ld1-> t i "variant" "relatedContextualAllele" (prop= t true "preferred"))]
   (if (nil? v ) (log/error (str "Exception in get-variant: relatedContextualAllele not found")))
-    {:variantIdentifier (variant-identifier v),
-     :altDesignations (variant-alt-designations v),
-     :refseq (variant-refseq t v),
-     :start (variant-start t v),
-     :stop  (variant-stop t v),
-     :ref (variant-ref t v),
-     :alt (variant-alt v)}))
-
- ; *** Condition related transformations
+    {:variantIdentifier (variant-identifier v r),
+     :altDesignations (variant-alt-designations v r),
+     :refseq (variant-refseq t v r),
+     :start (variant-start t v r),
+     :stop  (variant-stop t v r),
+     :ref (variant-ref t v r),
+     :alt (variant-alt v r)}))
+
+;*** Condition related transformations
+
  (defn condition-name
   "Returns clinvar condition name based on available content.
   May log warnings if available content does not conform to
   clinvar specifcations."
-  [t c]
+  [t c r]
   (if (not (nil? c))
   (let [name (get c "name")]
-    (csv-colval (if (nil? name) "" name) "ERROR-condition-name"))
-  (log/error (str "ERROR-condition-name: condition name not found"))))
+    (csv-colval (if (nil? name) "" name) "*E-301"))
+  (report/append-to-report r "\n\n*E-301: Condition disease code or name not provided.")))

 (defn condition-idtype
   ;TODO modify to deal with phenotypes and multi-values for satisfying clinvar specs.
-  [t c]
+  [t c r]
   (if (not (nil? c))
   (let [disease-coding (ld-> t c "disease" "coding")]
     (let [disease-code (get disease-coding "code")]
-      (csv-colval (if (nil? disease-code) "" (get (re-find #"(.*)\_(.*)" disease-code) 1)) "ERROR-condition-idtype")))
-  (log/error (str "ERROR-condition-idtype: condition idt type not found"))))
+      (csv-colval (if (nil? disease-code) "" (get (re-find #"(.*)\_(.*)" disease-code) 1)) "*E-301")))
+  (report/append-to-report r "\n\n*E-301: Condition disease code or name not provided.")))
+

 (defn condition-idvals
-   ;TODO modify to deal with phenotypes and multi-values for satisfying clinvar specs.
-  [t c]
-  (if (not (nil? c))
-  (let [disease-coding (ld-> t c "disease" "coding")]
-    (let [disease-code (get disease-coding "code")]
-      (csv-colval (if (nil? disease-code) "" (get (re-find #"(.*)\_(.*)" disease-code) 2)) "ERROR-condition-idvals")))
-  (log/error (str "Exception in function condition-idvals: condition id not found"))))
+;TODO modify to deal with phenotypes and multi-values for satisfying clinvar specs.
+[t c r]
+(if (not (nil? c))
+(let [disease-coding (ld-> t c "disease" "coding")]
+(let [disease-code (get disease-coding "code")]
+(csv-colval (if (nil? disease-code) "" (get (re-find #"(.*)\_(.*)" disease-code) 2)) "*E-301")))
+(report/append-to-report r "\n\n*E-301: Condition disease code or name not provided.")))
+

 (defn condition-moi
-  [t c]
-  (if (not (nil? c)) (csv-colval (if (nil? (ld-> t c "modeOfInheritance" "display")) "" (ld-> t c "modeOfInheritance" "display")) "ERROR-condition-moi")
-  (log/error (str "Exception in function condition-moi: condition moi not found"))))
+  [t c r]
+  (if (not (nil? c)) (csv-colval (if (nil? (ld-> t c "modeOfInheritance" "display")) "" (ld-> t c "modeOfInheritance" "display")) "*E-302")
+  (report/append-to-report r "\n\n*E-302: Mode of Inheritance display value not provided.")))

 (defn get-condition
   "Processes the condition element to derive the ClinVar sanctioned fields:
@@ -199,10 +212,10 @@
   [t i r]
   (let [c (ld-> t i "condition")]
      (if (nil? c) (log/debug (str "Exception in function get-condition: condition not found")))
-     {:name (if (nil? c) "" (condition-name t c)),
-      :idtype (if (nil? c) "" (condition-idtype t c)),
-      :idvalue (if (nil? c) "" (condition-idvals t c)),
-      :moi (if (nil? c) "" (condition-moi t c))}))
+     {:name (if (nil? c) "" (condition-name t c r)),
+      :idtype (if (nil? c) "" (condition-idtype t c r)),
+      :idvalue (if (nil? c) "" (condition-idvals t c r)),
+      :moi (if (nil? c) "" (condition-moi t c r))}))

   (defn evidence-rule-strength
     "Returns the translated strength based on the clingen/acmg recommended
@@ -234,10 +247,7 @@
     (let [crits (ld-> t e "information" "criterion")]
       (map #(get % "id") crits)))

-  (defn evidence-summary
-    "Returns a standard formatted summarization of the rules that were met."
-    [t e]
-    (str "The following criteria were met: " (csv-colval (clojure.string/join ", " (criteria-assessments t e)) "ERROR-evidence-summary")))
+  (defn evidence-summary    "Returns a standard formatted summarization of the rules that were met."    [t e]    (str "The following criteria were met: " (csv-colval (clojure.string/join ", " (criteria-assessments t e)) "ERROR-evidence-summary")))

   (defn re-extract
     "Returns a map of matching regex group captures for any vector, list, map which can be flattened."
@@ -249,7 +259,7 @@
     [t e]
     (let [info-sources (ld-> t e "information" "evidence" "information" "source")
           pmids (re-extract info-sources #"https\:\/\/www\.ncbi\.nlm\.nih\.gov\/pubmed\/(\p{Digit}*)" 1)]
-      (csv-colval (clojure.string/join ", " (map #(apply str "PMID:" %) pmids)) "")))
+      (csv-colval (clojure.string/join ", " (map #(apply str "PMID:" %) pmids)) "*W-551")))

   (defn get-met-evidence
    "Returns a collated map of all 'met' evidence records needed for the


Log remaining GitHub rate after requests.

--- src/clj/clj_templates/jobs.clj
+++ src/clj/clj_templates/jobs.clj
@@ -24,10 +24,17 @@
        (map clojars-data/adapt-template-to-db)
        (github/update-templates-github-info)))

+(defn log-github-rate []
+  (let [{:keys [remaining] :as rate} (github/get-github-rate-limit)]
+    (timbre/info "GithHb rate:" rate)
+    (when (< remaining 2000)
+      (timbre/warn "Remaining GitHub rate is low:" remaining))))
+
 (defn do-jobs [db]
   (timbre/info "Starting job: Refresh template info")
   (->> (assemble-templates)
-       (upsert-rows db)))
+       (upsert-rows db))
+  (log-github-rate))

 (defn init-scheduled-jobs [db hours-between-jobs]
   (chime-at (rest (periodic-seq (t/now) (t/hours hours-between-jobs)))


Add allow-robots? config var

Add allow-robots? config var

--- src/clj/clojuredocs/config.clj
+++ src/clj/clojuredocs/config.clj
@@ -12,4 +12,6 @@

 (def cljs-dev? (env/bool :cljs-dev false))

+(def allow-robots? (env/bool :allow-robots true))
+
 (defn url [& s] (apply str base-url s))


A few steps ahead

A few steps ahead

--- src/clj/communitics/server.clj
+++ src/clj/communitics/server.clj
@@ -64,6 +64,7 @@
   (fn [req]
     (f (assoc req ::database database))))

+
 (defn make-handler [database]
   (-> (routes
         (resources "/")
@@ -73,36 +74,39 @@
       (wrap-app-component database)
       api))

+
 (defrecord WebServer [github-crawler database port]
   component/Lifecycle
   (start [component]
     (do
       (if is-dev? (start-figwheel))
       (let [port (Integer. (or port (env :port) 10555))]
-        (print "Starting web server on port" port ".\n")
-        (assoc component :jetty (run-jetty (make-handler database) {:port port :join? false})))))
+        (println "Starting web server on port" port ".\n")
+        (println "database:" database)
+        (assoc component
+          :jetty (run-jetty (make-handler database) {:port port :join? false})))))
   (stop [component]
     (.stop (:jetty component))))

 (defn make-database [uri]
-  (Database. uri nil))
+  (map->Database {:uri uri}))

 (defn make-github-crawler [config-options]
   (component/using
-    (let [gc (GithubCrawler. nil nil)]
-      (assoc gc :serveraddress (:github-address config-options)))
+    (map->GithubCrawler {:serveraddress (:github-address config-options)})
     [:database]))

 (defn prod-system [config-options]
-  (let [{:keys [datomic-uri]} config-options]
-    (component/system-map
-      :database (make-database datomic-uri)
-      :github-crawler (make-github-crawler config-options))))
+  (component/system-map
+    :database (make-database (:datomic-uri config-options))
+    :github-crawler (make-github-crawler config-options)))

 (defn -main [& [port]]
-  (component/start (prod-system {:github-address "http://github.com/api/v3"
-                                 :datomic-uri "datomic:dev://localhost:4334/mbrainz-1968-1973"})))
+  (component/start
+    (prod-system
+      {:github-address "http://github.com/api/v3"
+       :datomic-uri "datomic:dev://localhost:4334/mbrainz-1968-1973"})))


give unit test a unique name

give unit test a unique name

--- src/clj/test/cards-agendas.clj
+++ src/clj/test/cards-agendas.clj
@@ -227,7 +227,7 @@
         (core/score state :corp {:card (refresh napd)})
         (is (= 2 (:agenda-point (get-corp))) "Scored NAPD for 2 points after 5 advancements"))))

-(deftest napd-contract
+(deftest napd-contract-corporate-scandal
   "NAPD Contract - scoring requirement increases with bad publicity from Corporate Scandal"
   (do-game
     (new-game (default-corp [(qty "NAPD Contract" 1)])


Get rid of manually created channel variable by using channel that go block will return anyway

--- src/clj_gatling/simulation.clj
+++ src/clj_gatling/simulation.clj
@@ -11,7 +11,7 @@
     (partial http/async-http-request url)
     (:fn request)))

-(defn async-function-with-timeout [request timeout user-id context result-channel]
+(defn async-function-with-timeout [request timeout user-id context]
   (let [start    (now)
         response (async/chan)
         function (memoize (request-fn request))
@@ -25,23 +25,21 @@
       (function user-id context callback)
       (let [[result c] (alts! [response (async/timeout timeout)])]
         (if (= c response)
-          (>! result-channel result)
-          (>! result-channel [{:name (:name request)
-                               :id user-id
-                               :start start
-                               :end (now)
-                               :result false} (first context)]))))))
+          result
+          [{:name (:name request)
+            :id user-id
+            :start start
+            :end (now)
+            :result false} (first context)])))))

 (defn- run-requests [requests timeout user-id result-channel]
-  (let [c (async/chan)]
-    (go-loop [r requests
-              context {}
-              results []]
-      (async-function-with-timeout (first r) timeout user-id context c)
-      (let [[result new-ctx] (<! c)]
-        (if (empty? (rest r))
-          (>! result-channel (conj results result))
-          (recur (rest r) new-ctx (conj results result)))))))
+  (go-loop [r requests
+            context {}
+            results []]
+    (let [[result new-ctx] (<! (async-function-with-timeout (first r) timeout user-id context))]
+      (if (empty? (rest r))
+        (>! result-channel (conj results result))
+        (recur (rest r) new-ctx (conj results result))))))

 (defn- response->result [scenario result]
   {:name (:name scenario)


restore accounts/show

restore accounts/show

--- src/clj_money/web/accounts.clj
+++ src/clj_money/web/accounts.clj
@@ -320,10 +320,11 @@
 (defn show
   "Renders account details, including transactions"
   ([req] (show req {}))
-  ([{{account :account :as params} :params} options]
-   (authorize :show account params)
-   (with-accounts-layout (format "Account - %s" (:name account)) (:entity-id account) options
-     (show-account account params))))
+  ([{{id :id :as params} :params} options]
+   (let [account (accounts/find-by-id (env :db) id)]
+     (authorize :show account params)
+     (with-accounts-layout (format "Account - %s" (:name account)) (:entity-id account) options
+       (show-account account params)))))

 (defn- form-fields
   "Renders the form fields for an account"


Fix docstring codestyle on kdf ns.

Fix docstring codestyle on kdf ns.

--- src/clojure/buddy/core/kdf.clj
+++ src/clojure/buddy/core/kdf.clj
@@ -151,7 +151,7 @@

 (defn dpimkdf
   "Double-Pipeline Iteration Mode KDF defined by the publicly
-available NIST SP 800-108 specification."
+  available NIST SP 800-108 specification."
   [^bytes keydata ^bytes salt ^Keyword alg & [{:keys [r use-counter] :or {r 32 use-counter true}}]]
   (let [params  (if use-counter
                   (KDFDoublePipelineIterationParameters/createWithCounter keydata salt r)


Fixes a couple of bugs in clj-chess.game namespace.

--- src/clojure/clj_chess/game.clj
+++ src/clojure/clj_chess/game.clj
@@ -185,7 +185,7 @@
   returns nil."
   [game predicate]
   (when-let [node (find-node-matching game predicate)]
-    (assoc g13 :current-node node)))
+    (assoc game :current-node node)))

 (defn goto-node-id
@@ -298,7 +298,7 @@
             (let [board (node :board)
                   children (node :children)]
               (str
-               (when children
+                (when children
                   (str
                     ;; SAN of first child move (main variation):
                     (let [m (-> (first children) :board board/last-move)
@@ -348,7 +348,7 @@
   [game & {:keys [include-comments? include-variations?]
            :or {include-comments? true include-variations? true}}]
   (str (apply str (map #(cl-format nil "[~a ~s]\n" (first %) (second %))
-                       (g :tags)))
+                       (game :tags)))
        "\n"
        (WordUtils/wrap (move-text game
                                   :include-comments? include-comments?


simplify rootpath

simplify rootpath

--- src/clojure/confgraph/core.clj
+++ src/clojure/confgraph/core.clj
@@ -11,15 +11,13 @@
 (def raw-edges (zipmap vertices (for [x defs] (extends x))))

 (def rootpath
-  (memoize (fn [src]
-             (let [dst (raw-edges src)]
-               (if (nil? dst)
-                 {}
-                 (conj {src dst} (rootpath dst)))))))
+  (memoize #(let [dst (raw-edges %)]
+              (if (nil? dst) {} (conj {% dst} (rootpath dst))))))

 (defn edges [prefix]
   (let [re (re-pattern (str prefix ".*"))]
-    (into {} (for [[src dst] raw-edges :when (re-matches re src)] (rootpath src)))))
+    (into {} (for [[src dst] raw-edges :when (re-matches re src)]
+               (rootpath src)))))

 (defn -main [& args]
   (alter-var-root #'*read-eval* (constantly false))


Update beta

Update beta

--- test/misaki/test/post.clj
+++ test/misaki/test/post.clj
@@ -1,6 +1,6 @@
 (ns misaki.test.post
   (:use [misaki core config]
-        [misaki.util seq]
+        [misaki.util sequence]
         [hiccup.core :only [html]]
         misaki.test.common
         clojure.test)


GAWB-2175: reset Submission Details page to 1 on filter button click (#870)

* Migrate WorkflowsTable to new table (mostly by Matt P)

--- src/cljs/main/broadfcui/page/workspace/monitor/submission_details.cljs
+++ src/cljs/main/broadfcui/page/workspace/monitor/submission_details.cljs
@@ -8,7 +8,8 @@
    [broadfcui.common.icons :as icons]
    [broadfcui.common.modal :as modal]
    [broadfcui.common.style :as style]
-   [broadfcui.common.table :refer [Table]]
+   [broadfcui.common.table.style :as table-style]
+   [broadfcui.common.table.table :refer [Table]]
    [broadfcui.endpoints :as endpoints]
    [broadfcui.nav :as nav]
    [broadfcui.page.workspace.monitor.common :as moncommon]
@@ -27,11 +28,11 @@
         (moncommon/all-success? submission) [icons/CompleteIcon {:size 36}]
         :else [icons/ExceptionIcon {:size 36}]))

-
 (react/defc- WorkflowsTable
   {:get-initial-state
-   (fn []
-     {:active-filter :all})
+   (fn [{:keys [props]}]
+     {:filter-group-index 0
+      :filtered-data (:workflows props)})
    :render
    (fn [{:keys [this props]}]
      (let [{:keys [workflow-id]} props]
@@ -39,66 +40,80 @@
          (this :render-workflow-details workflow-id)
          (this :render-table))))
    :render-table
-   (fn [{:keys [props]}]
+   (fn [{:keys [props state refs]}]
      [Table
-      {:empty-message "No Workflows"
-       :columns [{:starting-width 50
-                  :as-text (constantly "View workflow details")
-                  :resizable? false :sort-by :none :reorderable? false
-                  :content-renderer
-                  (fn [id]
-                    (when id
-                      (style/create-link
-                       {:text "View"
-                        :href (nav/get-link :workspace-workflow
-                                            (:workspace-id props)
-                                            (:submission-id props)
-                                            id)})))}
-                 {:header "Data Entity" :starting-width 200
-                  :as-text
-                  (fn [entity]
-                    (str (:entityName entity) " (" (:entityType entity) ")"))
-                  :sort-by :text}
-                 {:header "Last Changed" :starting-width 280 :as-text moncommon/render-date}
-                 {:header "Status" :starting-width 120
-                  :content-renderer (fn [status]
-                                      [:div {}
-                                       (moncommon/icon-for-wf-status status)
-                                       status])}
-                 {:header "Messages" :starting-width 300
-                  :content-renderer (fn [message-list]
-                                      [:div {}
-                                       (map (fn [message]
-                                              [:div {} message])
-                                            message-list)])}
-                 {:header "Workflow ID" :starting-width 300
-                  :as-text
-                  (fn [workflow] (:workflowId workflow))
-                  :sort-by :text
-                  :content-renderer
-                  (fn [workflow]
-                    (let [{:keys [submission-id bucketName]} props
-                          inputs (second (second (first (:inputResolutions workflow))))
-                          input-names (string/split inputs ".")
-                          workflow-name (first input-names)
-                          workflowId (:workflowId workflow)]
-                      (style/create-link {:text workflowId
-                                          :target "_blank"
-                                          :style {:color "-webkit-link" :textDecoration "underline"}
-                                          :href (str moncommon/google-cloud-context bucketName "/" submission-id "/"
-                                                     workflow-name "/" workflowId "/")})))}]
-       :filter-groups
-       (vec (cons {:text "All" :pred (constantly true)}
-                  (map (fn [status] {:text status :pred #(= status (:status %))})
-                       moncommon/wf-all-statuses)))
-       :data (:workflows props)
-       :->row (fn [row]
-                [(:workflowId row)
-                 (:workflowEntity row)
-                 (:statusLastChangedDate row)
-                 (:status row)
-                 (:messages row)
-                 row])}])
+      {:ref "table"
+       :data (:filtered-data @state)
+       :body
+       {:empty-message "No Workflows"
+        :style table-style/table-heavy
+        :behavior {:fixed-column-count 1}
+        :columns [{:id "view"
+                   :column-data :workflowId
+                   :initial-width 50
+                   :as-text (constantly "View workflow details")
+                   :hidden? true
+                   :resizable? false :sortable? false :filterable? false
+                   :render
+                   (fn [id]
+                     (when id
+                       (style/create-link
+                        {:text "View"
+                         :href (nav/get-link :workspace-workflow
+                                             (:workspace-id props)
+                                             (:submission-id props)
+                                             id)})))}
+                  {:header "Data Entity" :initial-width 200
+                   :column-data :workflowEntity
+                   :as-text
+                   (fn [entity]
+                     (str (:entityName entity) " (" (:entityType entity) ")"))
+                   :sort-by :text}
+                  {:header "Last Changed" :initial-width 280
+                   :column-data :statusLastChangedDate
+                   :sort-initial :desc
+                   :as-text moncommon/render-date}
+                  {:header "Status" :initial-width 120
+                   :column-data :status
+                   :render (fn [status]
+                             [:div {}
+                              (moncommon/icon-for-wf-status status)
+                              status])}
+                  {:header "Messages" :initial-width 300
+                   :column-data :messages
+                   :render (fn [message-list]
+                             [:div {}
+                              (map (fn [message]
+                                     [:div {} message])
+                                   message-list)])}
+                  {:header "Workflow ID" :initial-width 300
+                   :as-text :workflowId :sort-by :text
+                   :render
+                   (fn [workflow]
+                     (let [{:keys [submission-id bucketName]} props
+                           inputs (second (second (first (:inputResolutions workflow))))
+                           input-names (string/split inputs ".")
+                           workflow-name (first input-names)
+                           workflowId (:workflowId workflow)]
+                       (style/create-link {:text workflowId
+                                           :target "_blank"
+                                           :style {:color "-webkit-link" :textDecoration "underline"}
+                                           :href (str moncommon/google-cloud-context bucketName "/" submission-id "/"
+                                                      workflow-name "/" workflowId "/")})))}]}
+       :toolbar
+       {:items
+        (constantly
+         [[comps/FilterGroupBar
+           {:data (:workflows props)
+            :selected-index (:filter-group-index @state)
+            :on-change (fn [index data]
+                         (swap! state assoc
+                                :filter-group-index index
+                                :filtered-data data)
+                         ((@refs "table") :update-query-params {:page-number 1}))
+            :filter-groups (vec (cons {:text "All" :pred (constantly true)}
+                                      (map (fn [status] {:text status :pred #(= status (:status %))})
+                                           moncommon/wf-all-statuses)))}]])}}])
    :render-workflow-details
    (fn [{:keys [props]} workflowId]
      (let [workflows (:workflows props)