renamed conj* to insert*

renamed conj* to insert*

--- examples/progress_download.clj
+++ examples/progress_download.clj
@@ -26,19 +26,19 @@
        (print (str "[" (render-bar) "] "
                    progress "/?"))))))

-(defn conj-at [v idx val]
+(defn insert-at [v idx val]
   "Addes value into a vector at an specific index."
   (-> (subvec v 0 idx)
       (conj val)
       (concat (subvec v idx))))

-(defn conj-after [v needle val]
+(defn insert-after [v needle val]
   "Finds an item into a vector and adds val just after it.
    If needle is not found, the input vector will be returned."
   (let [index (.indexOf v needle)]
     (if (neg? index)
       v
-      (conj-at v (inc index) val))))
+      (insert-at v (inc index) val))))

 (defn wrap-downloaded-bytes-counter
   "Middleware that provides an CountingInputStream wrapping the stream output"
@@ -52,7 +52,7 @@
 (defn download-with-progress [url target]
   (http/with-middleware
     (-> http/default-middleware
-        (conj-after http/wrap-redirects wrap-downloaded-bytes-counter)
+        (insert-after http/wrap-redirects wrap-downloaded-bytes-counter)
         (conj http/wrap-lower-case-headers))
     (let [request (http/get url {:as :stream})
           length (Integer. (get-in request [:headers "content-length"] 0))


Update to ClojureScript 1.9.225

Update to ClojureScript 1.9.225

--- planck-cljs/project.clj
+++ planck-cljs/project.clj
@@ -1,11 +1,11 @@
 (defproject planck "0.1.0"
   :profiles {:dev
-             {:dependencies [[org.clojure/clojurescript "1.9.216"]
+             {:dependencies [[org.clojure/clojurescript "1.9.225"]
                              [tubular "1.0.0"]]
               :source-paths ["dev"]}
              :build {}}
   :dependencies [[org.clojure/clojure "1.8.0"]
-                 [org.clojure/clojurescript "1.9.216"]       ; comment if building own, and revise planck-cljs/script/build
+                 [org.clojure/clojurescript "1.9.225"]       ; comment if building own, and revise planck-cljs/script/build
                  [org.clojure/tools.reader "1.0.0-beta3"]
                  [tailrecursion/cljson "1.0.7"]
                  [com.cognitect/transit-clj "0.8.285"]


Send more events.

Send more events.

--- src/cbfg/ago.clj
+++ src/cbfg/ago.clj
@@ -9,7 +9,9 @@
          ago-id# (swap! (:last-id w#) inc)
          ~child-actx-binding-name (conj ~actx
                                         ['~child-actx-binding-name ago-id#])]
-     (go ~@body)))
+     (go (cljs.core.async/>! (:event-ch (actx-top ~actx))
+                             ["ago" ~child-actx-binding-name])
+         ~@body)))

 (defmacro ago-loop [child-actx-binding-name actx bindings & body]
   `(ago ~child-actx-binding-name ~actx (loop ~bindings ~@body)))
@@ -20,14 +22,17 @@
 (defmacro achan-buf [actx buf-or-size]
   `(let [ch# (cljs.core.async/chan)
          w# (actx-top ~actx)]
-     (println "achan-buf" ~actx ~buf-or-size ch#)
+     (println "achan-buf"
+              ~actx ~buf-or-size ch#) ; No event since might be outside go block.
      (swap! (:tot-chs w#) inc)
      (swap! (:chs w#) assoc ch# [])
      ch#))

 (defmacro aclose [actx ch]
-  `(do (cljs.core.async/>! (:event-ch (actx-top ~actx)) ["aclose" ~actx ~ch])
-       (cljs.core.async/close! ~ch)))
+  `(let [w# (actx-top ~actx)]
+     (cljs.core.async/>! (:event-ch w#) ["aclose" ~actx ~ch])
+     (swap! (:chs w#) dissoc ch#)
+     (cljs.core.async/close! ~ch)))

 (defmacro atake [actx ch]
   `(do (cljs.core.async/>! (:event-ch (actx-top ~actx)) ["atake" ~actx ~ch])
@@ -38,4 +43,5 @@
        (cljs.core.async/>! ~ch ~msg)))

 (defmacro aalts [actx chs]
-  `(cljs.core.async/alts! ~chs))+  `(do (cljs.core.async/>! (:event-ch (actx-top ~actx)) ["aalts" ~actx ~chs])
+       (cljs.core.async/alts! ~chs)))


[scamp] add 'do-comms

[scamp] add 'do-comms

--- modules/scamp/src/scamp/core.clj
+++ modules/scamp/src/scamp/core.clj
@@ -397,6 +397,16 @@
           (assoc :message-envelopes (concatv message-envelopes new-message-envelopes))
           (assoc-in [:network destination-node-id] new-destination-node)))))

+(s/defn do-comms :- WorldSchema
+  "Take 'world and 'n. Process up to 'n messages. Return new 'world.
+   If 'world has no :message-envelopes before 'n messages have been
+   processed, 'world is returned immediately."
+  [world :- WorldSchema
+   n :- s/Int]
+  (if (or (zero? n)
+          (empty? (:message-envelopes world)))
+    world
+    (recur (do-comm world) (dec n))))

 (comment
   [1] "Peer-to-Peer Membership Management for Gossip-Based Protocols"


Update copyright notice on core ns.

Update copyright notice on core ns.

--- src/cats/core.cljc
+++ src/cats/core.cljc
@@ -1,5 +1,5 @@
-;; Copyright (c) 2014, Andrey Antukh
-;; Copyright (c) 2014, Alejandro Gómez
+;; Copyright (c) 2014-2015 Andrey Antukh <niwi@niwi.nz>
+;; Copyright (c) 2014-2015 Alejandro Gómez <alejandro@dialelo.com>
 ;; All rights reserved.
 ;;
 ;; Redistribution and use in source and binary forms, with or without


Removing scratch clojure code.

Removing scratch clojure code.

--- zipkin_test.cljs
+++ zipkin_test.cljs
@@ -1,340 +0,0 @@
-(do
-  (require '[clj-zipkin.tracer :as t])
-
-  (require '[thrift-clj.core :as thrift])
-  (require '[clojure.data.codec.base64 :as b64])
-  (require '[clj-scribe :as scribe])
-  (require '[thrift-clj.gen.core :as c])
-  (require '[byte-streams])
-  (require '[clj-time.core :as time])
-  (require '[clj-time.coerce :as time-coerce])
-
-  (thrift/import
-    (:types [com.twitter.zipkin.gen
-             Span Annotation BinaryAnnotation AnnotationType Endpoint
-             LogEntry StoreAggregatesException AdjustableRateException])
-    (:clients com.twitter.zipkin.gen.ZipkinCollector))
-  )
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;; Defining an api
-
-(defn create-context
-  "Creates a context object. The service name is the name of the service to use in the trace.
-  The ip-address should be for the current host."
-  [service-name ip-address]
-  (let [scribe-logger (scribe/async-logger :host "127.0.0.1"
-                                           :port 9410
-                                           :category "zipkin")]
-    {:system {:zipkin {:endpoint (Endpoint. (t/ip-str-to-int ip-address) 0 service-name)
-                       :scribe-logger scribe-logger}}
-     :request {:tracing-enabled? true
-               :trace-info {
-                            :span-name nil
-                            :span-id nil
-                            :parent-span-id nil
-                            :trace-id nil}}}))
-
-(defn record-span
-  "Records the span info as a new span with annotations in Zipkin."
-  [zipkin-info trace-info start-time stop-time]
-  (let [{:keys [endpoint scribe-logger]} zipkin-info
-        {:keys [span-name span-id parent-span-id trace-id]} trace-info
-        a1 (Annotation. (* 1000 (time-coerce/to-long start-time))
-                        (str "start:" span-name) endpoint 0)
-        a2 (Annotation. (* 1000 (time-coerce/to-long stop-time))
-                        (str "end:" span-name) endpoint 0)
-        span (t/thrift->base64 (Span. trace-id span-name span-id parent-span-id [a1 a2] [] 0))]
-    (clojure.pprint/pprint trace-info)
-    (scribe/log scribe-logger [span])))
-
-(defn new-span-trace-info
-  "Takes existing trace info from the context and the span name and creates a new trace info
-  for this new span."
-  [context span-name]
-  (let [parent-trace-info (get-in context [:request :trace-info])]
-    {:trace-id (or (:trace-id parent-trace-info) (t/create-id))
-                    :parent-span-id (:span-id parent-trace-info)
-                    :span-name span-name
-                    :span-id (t/create-id)}))
-
-(defn proto-trace
-  "A prototype function to write code before attempting a macro."
-  [span-name context block-fn]
-  (let [trace-info (new-span-trace-info context span-name)
-        start-time (time/now)
-        result (block-fn (assoc-in context [:request :trace-info] trace-info))
-        stop-time (time/now)]
-    (record-span (-> context :system :zipkin) trace-info start-time stop-time)
-    result))
-
-;; TODO consider reversing span name and context
-(defmacro trace
-  [span-name context & body]
-  `(let [trace-info# (new-span-trace-info ~context ~span-name)
-         start-time# (time/now)
-         ~'context (assoc-in ~context [:request :trace-info] trace-info)
-         result (block-fn (assoc-in context [:request :trace-info] trace-info))
-         stop-time (time/now)]
-     (record-span (-> context :system :zipkin) trace-info start-time stop-time)
-     result))
-
-
-(defn tracefn
-  "TODO"
-  [span-name f]
-  (fn [context & args]
-    (let [trace-info (new-span-trace-info context span-name)
-          start-time (time/now)
-          new-context (assoc-in context [:request :trace-info] trace-info)
-          result (apply f new-context args)
-          stop-time (time/now)]
-      (record-span (-> context :system :zipkin) trace-info start-time stop-time)
-      result)))
-
-(tracefn "building something"
-         (fn [context y]
-           (Thread/sleep y)))
-
-(defmacro deftracefn
-  "TODO"
-  ;; TODO make it more robust to take defn style with metadata and without a docstring
-  [var-name doc-string bindings & body]
-  `(def ~var-name
-     ~doc-string
-     (tracefn ~(str var-name)
-              (fn ~bindings ~@body))))
-
-
-(macroexpand '(deftracefn build-something
-  "Blah blah blah"
-  [context arg1]
-  (println "hi")))
-
-(def build-something
-  "Blah blah blah"
-  (tracefn "build-something" (fn [context arg1] (println "hi"))))
-
-
-
-(comment
-  (let [context (create-context "Search" "127.0.0.1")]
-    (trace "search" context
-           (trace "apply-acls" context (Thread/sleep 100))
-           (trace "simplify" context (Thread/sleep 100))
-           (trace "execute-query" context (Thread/sleep 100))
-           (trace "get-results" context
-                  (trace "transform" context
-                         (trace "get-metadata" context (Thread/sleep 100))
-                         (trace "convert-xml" context (Thread/sleep 100)))))))))
-
-  (let [context (create-context "Search" "127.0.0.1")
-        sleeper (fn [_] (Thread/sleep 100))]
-    (proto-trace
-      "search" context
-      (fn [context]
-
-        (proto-trace "apply-acls" context sleeper)
-        (proto-trace "simplify" context sleeper)
-        (proto-trace "execute-query" context sleeper)
-        (proto-trace
-          "get-results" context
-          (fn [context]
-            (proto-trace
-              "transform" context
-              (fn [context]
-                (proto-trace "get-metadata" context sleeper)
-                (proto-trace "convert-xml" context sleeper))))))))
-
-
-
-
-
-)
-
-
-
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defn anno-time [t name]
-  (Annotation. (+ (* t 1000) (* 1000 (time-coerce/to-long (time/now))))
-               name
-               (t/host->endpoint "127.0.0.1")
-               0))
-
-(defn anno-duration [t length name]
-  (let [start-time (+ (* t 1000) (* 1000 (time-coerce/to-long (time/now))))]
-    (Annotation. start-time
-                 name
-                 (t/host->endpoint "127.0.0.1")
-                 length)))
-
-(let [logger (scribe/async-logger :host "127.0.0.1"
-                                  :port 9410
-                                  :category "zipkin")
-      trace-id (t/create-id)
-      root-id (t/create-id)
-      span-root (t/thrift->base64
-                  (Span. trace-id
-                         "root3"
-                         root-id
-                         nil
-                         [(anno-time 1 "root") (anno-time 10 "root")]
-                         []
-                         0))
-      span-child1 (t/thrift->base64
-                    (Span. trace-id
-                           "child1"
-                           (t/create-id)
-                           root-id
-                           [(anno-time 2 "child1") (anno-time 5 "child1")]
-                           []
-                           0))
-      span-child2 (t/thrift->base64
-                    (Span. trace-id
-                           "child2"
-                           (t/create-id)
-                           root-id
-                           [(anno-time 6 "child2") (anno-time 8 "child2")]
-                           []
-                           0))]
-  (scribe/log logger [span-root])
-  (Thread/sleep 100)
-  (scribe/log logger [span-child1])
-  (Thread/sleep 100)
-  (scribe/log logger [span-child2])
-  )
-
-(let [root-id (t/create-id)
-      main-options {:host "127.0.0.1"
-                    :trace-id (t/create-id)
-                    :scribe {:host "127.0.0.1" :port 9410}}
-      trace-id (t/create-id)]
-  (t/trace {:span "root2" :span-id root-id :host "127.0.0.1"
-            :trace-id (t/create-id)
-            :scribe {:host "127.0.0.1" :port 9410}}
-           (do
-             (Thread/sleep 100)
-             (t/trace {:span "child1" :span-id (t/create-id) :parent-span-id root-id
-                       :host "127.0.0.1"
-                       :trace-id (t/create-id)
-                       :scribe {:host "127.0.0.1" :port 9410}}
-                      (Thread/sleep 100))
-             (Thread/sleep 100)
-             (t/trace {:span "child2" :span-id (t/create-id) :parent-span-id root-id
-                       :host "127.0.0.1"
-                       :trace-id (t/create-id)
-                       :scribe {:host "127.0.0.1" :port 9410}}
-                      (Thread/sleep 100)))))
-
-
-(defmacro trace
-  [name span-id & body]
-  `(t/trace {:trace-id 1 :span-id ~span-id :span ~name :host "127.0.0.1"  :scribe {:host "127.0.0.1" :port 9410}}
-            (do
-              ~@body)))
-
-(defmacro trace-child
-  [name parent-span-id & body]
-  `(t/trace {:span-id (t/create-id) :trace-id 1 :parent-span-id ~parent-span-id :span ~name :host "127.0.0.1" :scribe {:host "127.0.0.1" :port 9410}}
-            (do
-              ~@body)))
-
-(defn do-stuff []
-  (t/trace {:span "println" :host "127.0.0.1"  :scribe {:host "127.0.0.1" :port 9410}}
-           (println "hello")))
-
-
-(let [psi (t/create-id)]
-  (trace "TOP12" psi
-         (trace-child "println" psi
-                      (println "hi")
-                      (Thread/sleep 10))
-         (trace-child "println" psi
-                      (println "hi")
-                      (Thread/sleep 10))
-         (trace-child "sleeping" psi
-                      (Thread/sleep 100))
-         (trace-child "sleeping" psi
-                      (Thread/sleep 100))))
-
-
-(clojure.walk/macroexpand-all '(trace-span "this" (println "jason")))
-
-(let* [logger (clj-scribe/async-logger
-                :host (-> {:host "127.0.0.1", :port 9410} :host)
-                :port (-> {:host "127.0.0.1", :port 9410} :port)
-                :category "zipkin")
-       trace-id 1
-       span-list (atom [])
-       span-id nil
-       result (clj-zipkin.tracer/trace*
-                {:host "127.0.0.1",
-                 :scribe {:host "127.0.0.1", :port 9410},
-                 :span "this",
-                 :trace-id 1,
-                 :span-id (clj-zipkin.tracer/create-id)}
-                (do (println "jason")))
-       _ (clj-scribe/log logger @span-list)]
-      result)
-
-
-(let* [logger (clj-scribe/async-logger
-                :host
-                (:host {:host "127.0.0.1", :port 9410})
-                :port
-                (:port {:host "127.0.0.1", :port 9410})
-                :category
-                "zipkin")
-       trace-id (let* [or_d 1]
-                      (if or_d
-                        or_d
-                        (clj-zipkin.tracer/create-id)))
-       span-list (clojure.core/atom [])
-       span-id nil
-       result (let* [parent-id span-id
-                     span-id (let* [or_d (clj-zipkin.tracer/create-id)]
-                                   (if or_d
-                                     or_d
-                                     (clj-zipkin.tracer/create-id)))
-                     start-time (clj-time.core/now)
-                     result2 (do (println "jason"))
-                     end-time (clj-time.core/now)
-                     span (clj-zipkin.tracer/create-timestamp-span
-                            "this"
-                            "127.0.0.1"
-                            trace-id
-                            span-id
-                            parent-id
-                            start-time
-                            end-time)
-                     _ (clojure.core/swap!
-                         span-list
-                         (fn* ([l]
-                               (clojure.core/cons span l))))]
-                    result2)
-       _ (clj-scribe/log logger @span-list)]
-      result)
-
-
-(t/trace {:trace-id (t/create-id)
-          :span-id (t/create-id)
-          :host "127.0.0.1" :span "GET" :scribe {:host "127.0.0.1" :port 9410}}
-         (do
-           (do-stuff)
-           (Thread/sleep 300)
-
-           #_(t/trace {:span "sleep1"}
-                      (Thread/sleep 300))
-           #_(t/trace {:span "sleep2"}
-                      (Thread/sleep 200))
-           #_(t/trace {:span "sleep3"}
-                      (Thread/sleep 100))
-
-           #_(t/trace {:span "println"}
-                      (println "hello2"))
-
-
-           ))


Add Cayenne bio placeholder

Add Cayenne bio placeholder


add image paths to about team object

add image paths to about team object

--- frontend/components/about.cljs
+++ frontend/components/about.cljs
@@ -92,6 +92,7 @@
     :bio ["Nick is an aspiring merman who spends most of his time outside of the Circle office in the ocean; surfing, diving, sailing, and swimming. He lived in Japan for 3 years as a student, consultant, actor, and vagabond and wrote his senior thesis on the cultural importance of baseball in the country. He won a hackathon by building a social haiku app for iPhone (which is still in the App Store). Eventually he came back to the US and got his first ‘real job’ at a digital consultancy where he optimized conversion rates for websites that comprise hundreds of thousands of visitors and generate millions in revenue every month.",
           "In 2012 Nick was lured to San Francisco by the prospect of hitting it big with his own startup, which crashed and burned, but he liked the place so decided to stick around. He loves the open work culture at Circle which allows him to fulfill his constant need to get-shit-done while helping developers do the same. One day he will unplug his computer and sail around the world."]}
    {:name "Emile Snyder"
+    :img-path (stefon/asset-path "/img/outer/about/emile.png")
     :visible true
     :role "Backend Developer"
     :github "esnyder"
@@ -104,6 +105,7 @@
     :github "startling"
     :email "tim@circleci.com"}
    {:name "Ian Duncan"
+    :img-path (stefon/asset-path "/img/outer/about/ian.png")
     :visible true
     :role "Developer"
     :github "iand675"
@@ -118,17 +120,20 @@
     :twitter "iamkevinbell"
     :email "kevin@circleci.com"}
    {:name "Cayenne Geis"
+    :img-path (stefon/asset-path "/img/outer/about/cayenne.png")
     :visible true
     :role "Developer"
     :github "cayennes"
     :email "cayenne@circleci.com"}
    {:name "Jonathan Irving"
+    :img-path (stefon/asset-path "/img/outer/about/jonathan.png")
     :visible true
     :role "Developer"
     :github "j0ni"
     :twitter "j0ni"
     :email "jonathan@circleci.com"}
    {:name "Tim Reinke"
+    :img-path (stefon/asset-path "/img/outer/about/timr.png")
     :visible true
     :role "Developer Success"
     :github "musicalchair"


Fix different spellings of the word changelog

--- frontend/components/aside.cljs
+++ frontend/components/aside.cljs
@@ -227,7 +227,7 @@

           [:a.aside-item {:data-placement "right"
                           :data-trigger "hover"
-                          :title "Change Log"
+                          :title "Changelog"
                           :href "/changelog"}
            [:i.fa.fa-bell]
            [:span "Changelog"]]


mark builds as :missing when there is an error in a build above them

--- src-cljs/cljsbuild_ui/pages/main.cljs
+++ src-cljs/cljsbuild_ui/pages/main.cljs
@@ -244,14 +244,21 @@
     assoc :error errors
           :state :done-with-error))

+(defn- mark-missing! [prj-key bld-id]
+  (let [state-path [:projects prj-key :builds bld-id :state]
+        bld-state (get-in @state state-path)]
+    (when (= bld-state :waiting)
+      (swap! state assoc-in state-path :missing))))
+
 (defn- compiler-done!
   "Mark a project as being finished with compiling. ie: idle state"
   [prj-key bld-ids]
   (swap! state assoc-in [:projects prj-key :state] :idle)

-  ;; TODO: make sure all the builds are in a "finished" state
-  ;; clear any "Waiting" with "Output missing"
-  )
+  ;; any build still in :waiting state at this point is due to compiler error
+  ;; mark those builds as :missing
+  (doall
+    (map #(mark-missing! prj-key %) bld-ids)))

 (defn- show-lein-startup! [prj-key bld-id]
   (swap! state assoc-in [:projects prj-key :builds bld-id :state] :lein-startup))


pass cust to outer

pass cust to outer

--- src-cljs/frontend/components/app.cljs
+++ src-cljs/frontend/components/app.cljs
@@ -45,7 +45,8 @@
             (when (:show-landing? app)
               (om/build outer/outer (select-keys app [:show-landing?
                                                       :document/id
-                                                      :navigation-point])
+                                                      :navigation-point
+                                                      :cust])
                         {:react-key "outer"}))

             (cond (:show-landing? app)


Add "stats" to reserved names

Add "stats" to reserved names

This will allow us to nest stats under "repo.clojars.org/stats/".

--- src/clojars/db.clj
+++ src/clojars/db.clj
@@ -58,6 +58,7 @@
     "search"
     "settings"
     "snapshots"
+    "stats"
     "status"
     "terms"
     "test"


Fix main.

Fix main.

--- src/dsbdp/main.clj
+++ src/dsbdp/main.clj
@@ -133,13 +133,13 @@
                                        [(fn [i _] (pcap-fn i))])
                          "pcap-json-inc" (combine-proc-fns-vec
                                            fn-mapping
-                                           sample-pcap-processing-definition-json))
+                                           sample-pcap-processing-definition-json)
                          "pcap-csv" (let [pcap-fn (create-proc-fn sample-pcap-processing-definition-csv)]
                                       [(fn [i _] (pcap-fn i))])
                          "pcap-csv-inc" (combine-proc-fns-vec
                                           fn-mapping
                                           sample-pcap-processing-definition-csv)
-                       out-fn))
+                       out-fn)))
           batch-delay (:batch-delay options)
           batch-size (:batch-size options)
           in-loop (ProcessingLoop.


Fix file encoding

Fix file encoding

--- src/refactor_nrepl/find/symbols_in_file.clj
+++ src/refactor_nrepl/find/symbols_in_file.clj
@@ -1,61 +1,61 @@
-(ns refactor-nrepl.find.symbols-in-file
-  (:require [clojure.tools.reader :as reader]
-            [clojure.tools.reader.reader-types :as readers]
-            [clojure.walk :as walk]
-            [refactor-nrepl
-             [core :as core]
-             [util :as util]]))
-
-(defn- find-symbol-ns [{:keys [:require :require-macros] :as dependencies} sym]
-  (some->> (into require require-macros)
-           (filter (fn [{:keys [refer refer-macros] :as libspec}]
-                     (or
-                      (and (sequential? refer)
-                           (some (partial = (symbol sym)) refer))
-                      (some (partial = (symbol sym)) refer-macros))))
-           first
-           :ns))
-
-(defn- fix-ns-of-backquoted-symbols [dependencies sym]
-  (if (= (core/prefix sym) (str (ns-name *ns*)))
-    (if-let [prefix (find-symbol-ns dependencies (core/suffix sym))]
-      (str prefix "/" (core/suffix sym))
-      sym)
-    sym))
-
-(defn- normalize-ctor-call
-  "Date. -> \"Date\""
-  [sym]
-  (let [s (str sym)]
-    (symbol (if (.endsWith s ".")
-              (.substring s 0 (dec (.length s)))
-              s))))
-
-(defn symbols-in-file
-  "Return a set of all the symbols occurring in the file at path.
-
-  This includes all regular symbols like foo, but also ctor calls like
-  Foo. (returned as Foo), and classes used in typehints.
-
-  Dialect defaults to :clj."
-  ([path parsed-ns] (symbols-in-file path parsed-ns :clj))
-  ([path parsed-ns dialect]
-   (util/with-additional-ex-data [:file path]
-     (binding [*ns* (or (find-ns (symbol (:ns parsed-ns))) *ns*)]
-       (let [rdr (-> path slurp core/file-content-sans-ns
-                     readers/indexing-push-back-reader)
-             dialect (or dialect (core/file->dialect path))
-             rdr-opts {:read-cond :allow :features #{dialect} :eof :eof}
-             syms (atom #{})
-             collect-symbol (fn [form]
-                              ;; Regular symbol
-                              (when (symbol? form)
-                                (swap! syms conj (normalize-ctor-call form)))
-                              ;; Classes used in typehints
-                              (when-let [t (:tag (meta form))] (swap! syms conj t))
-                              form)]
-         (loop [form (reader/read rdr-opts rdr)]
-           (when (not= form :eof)
-             (walk/prewalk collect-symbol form)
-             (recur (reader/read rdr-opts rdr))))
-         (set (map (partial fix-ns-of-backquoted-symbols (dialect parsed-ns)) @syms)))))))
+(ns refactor-nrepl.find.symbols-in-file
+  (:require [clojure.tools.reader :as reader]
+            [clojure.tools.reader.reader-types :as readers]
+            [clojure.walk :as walk]
+            [refactor-nrepl
+             [core :as core]
+             [util :as util]]))
+
+(defn- find-symbol-ns [{:keys [:require :require-macros] :as dependencies} sym]
+  (some->> (into require require-macros)
+           (filter (fn [{:keys [refer refer-macros] :as libspec}]
+                     (or
+                      (and (sequential? refer)
+                           (some (partial = (symbol sym)) refer))
+                      (some (partial = (symbol sym)) refer-macros))))
+           first
+           :ns))
+
+(defn- fix-ns-of-backquoted-symbols [dependencies sym]
+  (if (= (core/prefix sym) (str (ns-name *ns*)))
+    (if-let [prefix (find-symbol-ns dependencies (core/suffix sym))]
+      (str prefix "/" (core/suffix sym))
+      sym)
+    sym))
+
+(defn- normalize-ctor-call
+  "Date. -> \"Date\""
+  [sym]
+  (let [s (str sym)]
+    (symbol (if (.endsWith s ".")
+              (.substring s 0 (dec (.length s)))
+              s))))
+
+(defn symbols-in-file
+  "Return a set of all the symbols occurring in the file at path.
+
+  This includes all regular symbols like foo, but also ctor calls like
+  Foo. (returned as Foo), and classes used in typehints.
+
+  Dialect defaults to :clj."
+  ([path parsed-ns] (symbols-in-file path parsed-ns :clj))
+  ([path parsed-ns dialect]
+   (util/with-additional-ex-data [:file path]
+     (binding [*ns* (or (find-ns (symbol (:ns parsed-ns))) *ns*)]
+       (let [rdr (-> path slurp core/file-content-sans-ns
+                     readers/indexing-push-back-reader)
+             dialect (or dialect (core/file->dialect path))
+             rdr-opts {:read-cond :allow :features #{dialect} :eof :eof}
+             syms (atom #{})
+             collect-symbol (fn [form]
+                              ;; Regular symbol
+                              (when (symbol? form)
+                                (swap! syms conj (normalize-ctor-call form)))
+                              ;; Classes used in typehints
+                              (when-let [t (:tag (meta form))] (swap! syms conj t))
+                              form)]
+         (loop [form (reader/read rdr-opts rdr)]
+           (when (not= form :eof)
+             (walk/prewalk collect-symbol form)
+             (recur (reader/read rdr-opts rdr))))
+         (set (map (partial fix-ns-of-backquoted-symbols (dialect parsed-ns)) @syms)))))))


reload page button

reload page button

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

--- src/status_im/ui/screens/browser/views.cljs
+++ src/status_im/ui/screens/browser/views.cljs
@@ -12,7 +12,7 @@
             [status-im.ui.components.react :as components]
             [reagent.core :as reagent]
             [status-im.ui.components.chat-icon.screen :as chat-icon.screen]
-            [status-im.ui.components.icons.vector-icons :as vector-icons]
+            [status-im.ui.components.icons.vector-icons :as icons]
             [status-im.i18n :as i18n]
             [status-im.utils.ethereum.core :as ethereum]
             [status-im.ui.components.toolbar.actions :as actions]
@@ -130,14 +130,17 @@
                                     :style               (when-not can-go-back? styles/disabled-button)
                                     :accessibility-label :previou-page-button}
          [react/view
-          [vector-icons/icon :icons/arrow-left]]]
+          [icons/icon :icons/arrow-left]]]
         [react/touchable-highlight {:on-press            #(re-frame/dispatch [:browser-nav-forward browser])
                                     :disabled            (not can-go-forward?)
                                     :style               (merge styles/forward-button
                                                                 (when-not can-go-forward? styles/disabled-button))
                                     :accessibility-label :next-page-button}
          [react/view
-          [vector-icons/icon :icons/arrow-right]]]]
+          [icons/icon :icons/arrow-right]]]
+        [react/view {:flex 1}]
+        [react/touchable-highlight {:on-press #(.reload @webview)}
+         [icons/icon :icons/refresh]]]
        (when-not dapp?
          [tooltip/bottom-tooltip-info
-          (i18n/label :t/browser-warning)])])))
+          (i18n/label :t/browser-warning)])])))


Fix calling syntax in tests to use :key-fn

--- src/test/clojure/clojure/data/json_test.clj
+++ src/test/clojure/clojure/data/json_test.clj
@@ -51,12 +51,12 @@

 (deftest can-read-objects
   (is (= {:a 1, :b 2} (parse-string "{\"a\": 1, \"b\": 2}"
-                                    :keywordize true))))
+                                    :key-fn keyword))))

 (deftest can-read-nested-structures
   (is (= {:a [1 2 {:b [3 "four"]} 5.5]}
          (parse-string "{\"a\":[1,2,{\"b\":[3,\"four\"]},5.5]}"
-                       :keywordize true))))
+                       :key-fn keyword))))

 (deftest disallows-non-string-keys
   (is (thrown? Exception (parse-string "{26:\"z\""))))


remove println

remove println

--- src/test/clojure/clojure/tools/cli_test.clj
+++ src/test/clojure/clojure/tools/cli_test.clj
@@ -86,8 +86,7 @@
                  ["-s" "--server" :description "Server name"])]
         (is (= {:server "localhost"} options))
         (is (empty? args))
-        (is (re-find #"This program does something awesome" banner))
-        (println banner)))))
+        (is (re-find #"This program does something awesome" banner))))))

 (deftest all-together-now
   (let [[options args _] (cli ["-p" "8080"


index: ensure our cassandra index is seen

--- src/io/cyanite.clj
+++ src/io/cyanite.clj
@@ -5,6 +5,7 @@
             [io.cyanite.signals         :as sig]
             [io.cyanite.input           :as input]
             [io.cyanite.index           :as index]
+            [io.cyanite.index.cassandra]
             [io.cyanite.engine.queue    :as queue]
             [io.cyanite.store           :as store]
             [com.stuartsierra.component :as component]


indenting

indenting

--- src/celestial/persistency/systems.clj
+++ src/celestial/persistency/systems.clj
@@ -1,13 +1,13 @@
 (comment
-   Celestial, Copyright 2012 Ronen Narkis, narkisr.com
-   Licensed under the Apache License,
-   Version 2.0  (the "License") you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.)
+  Celestial, Copyright 2012 Ronen Narkis, narkisr.com
+  Licensed under the Apache License,
+  Version 2.0  (the "License") you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.)

 (ns celestial.persistency.systems
   "systems persistency layer"
@@ -28,14 +28,14 @@
     [puny.migrations :refer (Migration register)]
     [celestial.model :refer (clone hypervizors figure-virt)]
     [clojure.core.strint :refer (<<)]
-     proxmox.model aws.model))
+    proxmox.model aws.model))

 (import-logging)

 (declare perm validate-system)

 (entity {:version 1} system :indices [type env]
-   :intercept {:create [perm] :read [perm] :update [perm] :delete [perm]} )
+        :intercept {:create [perm] :read [perm] :update [perm] :delete [perm]} )

 (defn assert-access [env ident]
   {:pre [(current-user)]}


Fix broken day 13 solution.

Fix broken day 13 solution.

--- clojure/src/advent2017/day13.clj
+++ clojure/src/advent2017/day13.clj
@@ -42,9 +42,7 @@
                     severity))))))))

 (defn solve-1 [input]
-  (->> input
-       (solve 0)
-       (apply +)))
+  (solve 0 input))

 (defn solve-2 [input]
   (loop [t 0]


prevent behaviors from getting reverse ordered when converted to triggers

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/lt/object.cljs
+++ src/lt/object.cljs
@@ -35,7 +35,7 @@
   (let [result (atom (transient {}))]
     (doseq [beh behs
             t (:triggers (->behavior beh))]
-      (swap! result assoc! t (conj (or (get @result t) []) beh)))
+      (swap! result assoc! t (conj (or (get @result t) '()) beh)))
     (persistent! @result)))

 (defn specificity-sort [xs dir]


fix url redirect

fix url redirect

--- src/nossal/web.clj
+++ src/nossal/web.clj
@@ -68,7 +68,7 @@

 (defn dot [req]
-  (res/redirect "https://raw.githubusercontent.com/nossal/dotfiles/master/dot"))
+  (res/redirect "https://raw.githubusercontent.com/nossal/dotfiles/master/bin/dot"))

 (defroutes app


model: Don't return documents with empty pages.

--- src/pepa/model.clj
+++ src/pepa/model.clj
@@ -314,6 +314,7 @@
   (->> (db/query db ["SELECT t.name, COUNT(dt.document)
                       FROM tags AS t
                       JOIN document_tags AS dt ON dt.tag = t.id
+                      WHERE (SELECT COUNT(*) FROM document_pages WHERE document = dt.document) > 0
                       GROUP BY t.name"])
        (map (juxt :name :count))
        (into {})))
@@ -322,7 +323,7 @@
   (->> (db/query db ["SELECT dt.document
                       FROM document_tags AS dt
                       JOIN tags AS t ON dt.tag = t.id
-                      WHERE t.name = ?
+                      WHERE t.name = ? AND (SELECT COUNT(*) FROM document_pages WHERE document = dt.document) > 0
                       GROUP BY dt.document"
                      tag])
        (mapv :document)))


Only send one notification when adding multiple files.

--- src/pepa/model.clj
+++ src/pepa/model.clj
@@ -19,24 +19,32 @@
   (->> (db/query db ["SELECT id FROM pages WHERE file = ? ORDER BY number" file])
        (map :id)))

-(defn store-file! [db {:keys [content-type origin name data]}]
+(defn ^:private store-file*! [db {:keys [content-type origin name data]}]
   (assert content-type)
   (assert origin)
   (assert data)
-  (let [file (db/insert! db
-                         :files
-                         {:content_type content-type
-                          :origin origin
-                          :name name
-                          :data data})]
-    (db/notify! db :files/new)
-    (first file)))
+  (let [[file] (db/insert! db
+                           :files
+                           {:content_type content-type
+                            :origin origin
+                            :name name
+                            :data data})]
+
+    file))
+
+(defn store-file! [db attrs]
+  (db/with-transaction [db db]
+    (let [file (store-file*! db attrs)]
+      (db/notify! db :files/new {:files [(:id file)]})
+      file)))

 (defn store-files! [db files extra-attrs]
   (db/with-transaction [db db]
-    (doall (map (fn [file]
-                  (store-file! db (merge extra-attrs file)))
-                files))))
+    (let [files (mapv (fn [file]
+                        (store-file*! db (merge extra-attrs file)))
+                      files)]
+      (db/notify! db :files/new {:files (mapv :id files)})
+      files)))

 (defn file-documents
   "Returns a list of document-ids which are linked to FILE."


Fix default ShouldComponentUpdate for case where state is null.

--- src/quiescent.cljs
+++ src/quiescent.cljs
@@ -26,8 +26,10 @@
                                   (or
                                     (not= (aget (.-props this) "value")
                                           (aget next-props "value"))
-                                    (not= (aget (.-state this) "value")
-                                          (aget next-state "value")))))
+                                    (let [this-state (or (.-state this) (js-obj))
+                                          next-state (or next-state (js-obj))]
+                                      (not= (aget this-state "value")
+                                            (aget next-state "value"))))))
                       :render
                        (fn []
                          (this-as this


Add `of-micros`

Add `of-micros`

--- src/tick/core.cljc
+++ src/tick/core.cljc
@@ -583,6 +583,10 @@
   [n]
   (new-duration n :nanos))

+(defn of-micros
+  "Takes a java.lang.Long n and returns a duration of n micros."
+  [n]
+  (new-duration n :micros))
 ;; Coercions

 (extend-protocol p/IExtraction


call distinct in map-to to prevent duplicate function calls

--- src/useful/map.clj
+++ src/useful/map.clj
@@ -129,7 +129,7 @@
   "Returns a map from each item in coll to f applied to that item."
   [f coll]
   (into {}
-        (for [item coll]
+        (for [item (distinct coll)]
           (map-entry item (f item)))))

 (defn index-by


format code

format code

--- src/leiningen/remote_test_refresh.clj
+++ src/leiningen/remote_test_refresh.clj
@@ -9,7 +9,7 @@
             [clojure.java.shell :as sh]
             [clojure.java.io :as io]))

-;;; Transfer steps
+;;; TRANSFER STEPS
 (def verbose false)
 (def local-patch-file-name "test-refresh-local.patch")
 (def remote-patch-file-name "test-refresh.remote.patch")
@@ -45,7 +45,10 @@
       {:step :apply-patch :status :success}
       {:step :apply-patch :status :failed :error (:err result-apply-patch)})))

-;;; Transfer logic
+;;; TRANSFER LOGIC
+
+(def TRANSFER-STEPS [create-patch! upload-patch! apply-patch!])
+(def WAIT-TIME 500)

 (defn transfer-per-ssh [parameters session run-steps]
   (let [failed-steps (->> run-steps
@@ -56,16 +59,7 @@
       {:status :success :msg "* Change has been transfered successfully to your remote repository"}
       {:status :failed :msg (str "* Transfer per SSH failed in: " failed-steps)})))

-(defn find-asset-paths [project]
-  (->> (concat (:source-paths project ["src"])
-               (:resource-paths project ["resources"])
-               (:test-paths project ["test"]))
-       (vec)))
-
-;;;; Main
-
-(def TRANSFER-STEPS [create-patch! upload-patch! apply-patch!])
-(def WAIT-TIME 500)
+;;; MAIN

 (defn sync-code-change
   ([console session dirs parameters]
@@ -86,7 +80,7 @@
     (with-open [rdr (io/reader output)]
       (doseq [line (line-seq rdr)] (m/info line)))))

-(defn log-console [console]
+(defn log [console]
   (while true
     (let [{msg :msg} (async/<!! console)]
       (m/info "\n" msg "\n")
@@ -114,7 +108,7 @@
 (defn start-remote-routine [session asset-paths parameters]
   (let [console (async/chan)]
     (future (sync-code-change console session asset-paths parameters))
-    (future (log-console console))
+    (future (log console))
     (run-command-and-forward-port session parameters)))

 (defn session-option [parameters with-system-agent?]
@@ -125,7 +119,7 @@
       (merge default-option {:password (get-in parameters [:auth :password])}))))

 (defn create-session [parameters]
-  (m/info "\n" "* Starting with the parameters:" (assoc-in parameters [:auth :password] "***"))
+  (m/info "\n* Starting with the parameters:" (assoc-in parameters [:auth :password] "***"))
   (let [with-system-agent? (get-in parameters [:auth :with-system-agent])
         agent (ssh/ssh-agent {:use-system-ssh-agent with-system-agent?})
         session-params (session-option parameters with-system-agent?)
@@ -191,6 +185,12 @@
      :forwarding-port forwarding-port
      :remote-path     (normalize-remote-path path)}))

+(defn find-asset-paths [project]
+  (->> (concat (:source-paths project ["src"])
+               (:resource-paths project ["resources"])
+               (:test-paths project ["test"]))
+       (vec)))
+
 (defn remote-test-refresh [project & _]
   (m/info "* Remote-Test-Refresh version:" (u/artifact-version))
   (try


Fix for emit-element holding onto the head of the lazy-seq of elements (http://dev.clojure.org/jira/browse/DXML-5).

--- src/main/clojure/clojure/data/xml.clj
+++ src/main/clojure/clojure/data/xml.clj
@@ -34,8 +34,10 @@
       (.writeAttribute writer (name k) (str v)))))

 ; Represents a node of an XML tree
-(defrecord Element [tag attrs content]
-  Emit
+(defrecord Element [tag attrs content])
+
+(extend-protocol Emit
+  Element
   (emit-element [e writer]
     (let [nspace (namespace (:tag e))
           qname (name (:tag e))


re-tried adding fall

re-tried adding fall

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -641,9 +641,9 @@
                      :sem {:pred :faint}
                      :subcat {:2 '()}}}

-    "fall" {:english {:past "fell"}
-          :synsem {:cat :verb
-                   :sem {:pred :fall}}}
+    "fall" {:synsem {:cat :verb
+                     :sem {:pred :fall}}
+          :english {:past "fell"}}

     "fall asleep"
    (let [subject-semantics (atom :top)]


fixed model border

fixed model border

--- src-clj/mappt/server/styles.clj
+++ src-clj/mappt/server/styles.clj
@@ -121,7 +121,8 @@
    :border-style :solid
    :border-color :black
    :border-radius (px 7)
-   :box-shadow "0px -3px 9px 2px rgba(50, 50, 50, 0.25)"})
+   :box-shadow "0px -3px 9px 2px rgba(50, 50, 50, 0.25)"
+   :overflow :hidden})

 (defstylesheet main
   {:output-to "resources/public/css/main.css"}
@@ -220,9 +221,7 @@
     :left (px 0)
     :right (px 0)
     :height (px 40)
-    :background-color (default-colors :grey)
-    :border-top-right-radius (modal-style :border-radius)
-    :border-top-left-radius (modal-style :border-radius)}]
+    :background-color (default-colors :grey)}]
   [:#modal-content
    {:position :absolute
     :top (px 40)
@@ -235,6 +234,4 @@
     :right (px 0)
     :bottom (px 0)
     :height (px 30)
-    :background-color (color/lighten (default-colors :grey) 10)
-    :border-bottom-right-radius (modal-style :border-radius)
-    :border-bottom-left-radius (modal-style :border-radius)}])
+    :background-color (color/lighten (default-colors :grey) 10)}])


fix typo

fix typo

--- src/babel/francais/grammar.clj
+++ src/babel/francais/grammar.clj
@@ -410,7 +410,7 @@
 (defn morph-walk-tree [tree]
   (log/debug (str "morph-walk-tree: " (fo tree)))
   (merge
-   {:surface (fo (get-in tree [:italiano]))}
+   {:surface (fo (get-in tree [:français]))}
    (if (get-in tree [:comp])
      {:comp (morph-walk-tree (get-in tree [:comp]))}
      {})


move definition of get-num-messages out of manage-filesystem

--- src/brainbot/nozzle/manage.clj
+++ src/brainbot/nozzle/manage.clj
@@ -57,17 +57,21 @@
     (rmq/close ch)
     (rmq/close conn)))

+(defn get-num-messages
+  "return number of messages in the given rabbitmq vhost for the given
+  filesystem and id/prefix"
+  [vhost id filesystem]
+  (num-messages-from-queue-state
+   (rmqapi/list-queues)
+   vhost
+   {:id id
+    :filesystem filesystem}))

 (defn manage-filesystem*
   [rmq-settings id {:keys [fsid sleep-between-sync]}]
   (let [qname (rk/routing-key-string-from-map {:id id :filesystem fsid :command "*"})
-        get-num-messages (fn []
-                           (num-messages-from-queue-state
-                            (rmqapi/list-queues)
-                            "/"
-                            {:id id
-                             :filesystem fsid}))
-        wait-idle (partial wait-for-zero-messages get-num-messages)]
+        get-num-messages* #(get-num-messages "/" id fsid)
+        wait-idle #(wait-for-zero-messages get-num-messages*)]
     (logging/debug "waiting for" qname "to become idle")
     (wait-idle)
     (while true


responded to pull req comments; added better docs

--- src/clj/forma/ops/classify.clj
+++ src/clj/forma/ops/classify.clj
@@ -8,9 +8,10 @@

 (defn unpack-feature-vec
   "Creates a persistent vector from forma- and neighbor-val objects;
-  building the vector for the logistic classifier."
+  building the vector for the logistic classifier.  The `[1]`
+  indicates the mandatory intercept in the logistic regression."
   [forma-val neighbor-val]
-  {:pre [(instance? forma.schema.FormaValue forma-val)
+  {:pre [(instance? forma.schema.FormaValueforma-val)
          (instance? forma.schema.NeighborValue neighbor-val)]}
   (let [[fire short long t-stat break] (thrift/unpack forma-val)
         fire-seq (thrift/unpack fire)
@@ -24,11 +25,11 @@
   vector resulting from a logistic regression."
   [tuples]
   (let [make-binary  (fn [x] (if (zero? x) 0 1))
-        clean (for [x tuples]
-                (let [[label val neighbor] x]
-                  [(make-binary label) (unpack-feature-vec val neighbor)]))]
-    [[(logistic-beta-vector (to-double-rowmat (map first clean))
-                            (to-double-matrix (map second clean))
+        pixel-features (for [x tuples]
+                         (let [[label val neighbor] x]
+                           [(make-binary label) (unpack-feature-vec val neighbor)]))]
+    [[(logistic-beta-vector (to-double-rowmat (map first pixel-features))
+                            (to-double-matrix (map second pixel-features))
                             r c m)]]))

 (defn logistic-prob-wrap


don't boost Troll trace w/ scored Improved Tracers

--- src/clj/game/cards-agendas.clj
+++ src/clj/game/cards-agendas.clj
@@ -295,7 +295,7 @@
    {:effect (req (update-all-ice state side))
     :events {:pre-ice-strength {:req (req (has-subtype? target "Tracer"))
                                 :effect (effect (ice-strength-bonus 1 target))}
-             :pre-init-trace {:req (req (ice? target))
+             :pre-init-trace {:req (req (has-subtype? target "Tracer"))
                               :effect (effect (init-trace-bonus 1))}}}

    "Labyrinthine Servers"


Sudah bisa menghitung progress yang menjawab

--- src/clj/mobile_survey/core.clj
+++ src/clj/mobile_survey/core.clj
@@ -70,8 +70,10 @@

 (defn detail-survey [id]
     (let [{:keys [name description created_on content status]} (models/get-survey-with-id id)
-          duration (get-duration (from-date created_on))]
-        (t/base (t/detail-snippet id name description content duration (status_code status) 100 10)
+          duration (get-duration (from-date created_on))
+          numbers (models/get-numbers-for-survey id)
+          replied-cnt (count (for [x numbers :when (not= x "")] x))]
+        (t/base (t/detail-snippet id name description content duration (status_code status) (count numbers) replied-cnt)
                 (create-js-script-for :detail))))

 (defn delete-survey [id]


changed more buttons/menu-items to actions, like require, fqn-listing/categorize...

--- src/clj_ns_browser/browser.clj
+++ src/clj_ns_browser/browser.clj
@@ -111,7 +111,8 @@
   Get the actions later thru the keyword: (get app-action-map kw).
   See also select-id."
   [kw actn]
-  (swap! app-action-map (fn [m k a] (assoc m k a)) kw actn))
+  (swap! app-action-map (fn [m k a] (assoc m k a)) kw actn)
+  actn)

 (defn select-id
@@ -162,7 +163,7 @@
 (def all-buttons-with-atoms
   "Used to auto-generate atoms and '-atom' keywords"
   [:ns-require-btn :browse-btn :edit-btn :clojuredocs-offline-rb :clojuredocs-online-rb
-   :update-clojuredocs-btn :var-trace-btn :inspect-btn :color-coding-cb])
+   :update-clojuredocs-btn :var-trace-btn :inspect-btn :color-coding-cb :vars-fqn-listing-cb])

 (defn make-atom-kw [kw] (keyword (str (clj-ns-browser.utils/fqname kw) "-atom")))

@@ -348,8 +349,10 @@
   (action :name "Manual Refresh"
           :key  "menu R"
           :handler (fn [e]
-            (let [id (partial select-id (to-root e))]
-              (auto-refresh-browser-handler {:root (to-root e)})
+            (let [root (to-root e)
+                  id (partial select-id root)]
+              (show! (pack! root))
+              (auto-refresh-browser-handler {:root root})
               (ensure-selection-visible (id :ns-lb))
               (ensure-selection-visible (id :vars-lb))))))

@@ -390,6 +393,42 @@
                                        (alert (str "Untraced all traced-vars in namespace: " ns-str)))
                                    (alert (str "Not a valid/loaded namespace: " ns-str)))))))))

+(add-app-action :vars-categorized-cb-action
+  (action :name "Categorized Listing"
+          :selected? false
+          :handler
+            (fn [e] (let [root (to-root e)]
+                      (letfn [(id [kw] (select-id root kw))]
+                        (swap! group-vars-by-object-type-atom
+                               (fn [_] (config (id :vars-categorized-cb-action) :selected?))))))))
+
+(add-app-action :vars-fqn-listing-cb-action
+  (action :name "FQN Listing"
+          :selected? false
+          :handler
+            (fn [e] (let [root (to-root e)]
+                      (letfn [(id [kw] (select-id root kw))]
+                        (swap! (id :vars-fqn-listing-cb-atom)
+                               (fn [_] (config (id :vars-fqn-listing-cb-action) :selected?))))))))
+
+(add-app-action :vars-unmap-btn-action
+  (action :name "Un-Map"
+          :enabled? false))
+
+(add-app-action :vars-unalias-btn-action
+  (action :name "Un-Alias"
+          :enabled? false))
+
+(add-app-action :ns-require-btn-action
+  (action :name "Require"
+          :enabled? false
+          :handler (fn [e]
+                     (let [root (to-root e)]
+                       (letfn [(id [kw] (select-id root kw))]
+                         (swap! (id :ns-require-btn-atom) not))))))
+
+
+
 ;; Init functions called during construction of a frame with its widget hierarchy

 (defn init-before-bind
@@ -402,8 +441,6 @@
     (config! (id :ns-lb) :selection-mode :multi-interval) ;; experimental...
     (config! (id :vars-lb) :model [])
     (config! (id :ns-entries-lbl) :text "0")
-    (config! (id :ns-require-btn) :enabled? false)
-    (config! (id :ns-require-btn) :text "Require")
     (config! (id :doc-cbx) :model doc-cbx-value-list)
     (config! (id :edit-btn) :enabled? false)
     (config! (id :browse-btn) :enabled? false)
@@ -411,8 +448,8 @@
     (config! (id :inspect-btn) :enabled? false)
     (listen (id :inspect-btn)
       :action (fn [event] (swap! (id :inspect-btn-atom) not)))
-    (listen (id :ns-require-btn)
-      :action (fn [event] (swap! (id :ns-require-btn-atom) not)))
+    (config! (id :ns-require-btn) :action (id :ns-require-btn-action))
+    (config! (id :ns-require-btn-action) :enabled? false)
     (config! (id :var-trace-btn)
       :action (id :var-trace-btn-action))
     (listen (id :browse-btn)
@@ -486,7 +523,7 @@
               (if (and ns (some #(= ns %) @all-ns-unloaded-atom))
                 true
                 false)))
-            (b/property (id :ns-require-btn) :enabled?))
+            (b/property (id :ns-require-btn-action) :enabled?))
           (b/bind
             (b/transform (fn [ns-str]
               (if (and ns-str (find-ns (symbol ns-str)))
@@ -858,8 +895,11 @@
           clojuredocs-online-rb (radio-menu-item :text "ClojureDocs Online" :id :clojuredocs-online-rb :group clojuredocs-access-btn-group)
           clojuredocs-offline-rb (radio-menu-item :text "ClojureDocs Offline/Local" :id :clojuredocs-offline-rb :group clojuredocs-access-btn-group)

-          vars-fqn-listing-cb (checkbox-menu-item :text "FQN Listing" :id :vars-fqn-listing-cb)
-          vars-categorized-cb (checkbox-menu-item :text "Categorized Listing" :id :vars-categorized-cb)
+          vars-fqn-listing-cb (checkbox-menu-item :action (id :vars-fqn-listing-cb-action) :id :vars-fqn-listing-cb)
+
+          vars-categorized-cb (checkbox-menu-item :action (id :vars-categorized-cb-action)
+                                                  :id :vars-categorized-cb)
+
           vars-search-doc-also-cb (checkbox-menu-item :text "Search Docs Also" :id :vars-search-doc-also-cb)

           auto-refresh-browser-cb (checkbox-menu-item :action (id :auto-refresh-browser-action) :id :auto-refresh-browser-cb)
@@ -886,9 +926,12 @@
       (config! edit-menu :items [(id :copy-fqn-action) (id :fqn-from-clipboard-action)
                                  (id :fqn-from-selection-action) (id :open-url-from-selection-action)])

-      (config! ns-menu :items ["Require" :separator (id :ns-trace-btn-action) (id :ns-untrace-btn-action)])
-
-      (config! vars-menu :items [(id :var-trace-btn-action) "Un-Map" "Un-Alias" :separator vars-categorized-cb vars-fqn-listing-cb vars-search-doc-also-cb])
+      (config! ns-menu :items [(id :ns-require-btn-action) :separator (id :ns-trace-btn-action) (id :ns-untrace-btn-action)])
+
+      (config! vars-menu :items
+        [(id :var-trace-btn-action) :separator (id :vars-unmap-btn-action)
+         (id :vars-unalias-btn-action) :separator vars-categorized-cb
+         vars-fqn-listing-cb vars-search-doc-also-cb])

       (config! auto-refresh-browser-cb
@@ -896,15 +939,7 @@
                                    (.start auto-refresh-browser-timer)
                                    (.stop auto-refresh-browser-timer)))]
         :selected? false)
-
-      (config! vars-categorized-cb
-         :listen [:action (fn [e] (swap! group-vars-by-object-type-atom (fn [_] (config vars-categorized-cb :selected?))))]
-        :selected? false)
-
-      (config! vars-fqn-listing-cb
-         :listen [:action (fn [e] (swap! vars-fqn-listing-cb-atom (fn [_] (config vars-fqn-listing-cb :selected?))))]
-        :selected? false)
-
+
       (config! vars-search-doc-also-cb
          :listen [:action (fn [e] (swap! vars-search-doc-also-cb-atom (fn [_] (config vars-search-doc-also-cb :selected?))))]
         :selected? false)
@@ -934,21 +969,32 @@
                                     (id :zoom-in-action) (id :zoom-out-action)])

       (config! (id :ns-lb) :popup ns-lb-popup)
-      (config! ns-lb-popup :items [(id :new-browser-action) :separator (id :copy-fqn-action)
-                                    (id :fqn-from-clipboard-action) (id :fqn-from-selection-action)
-                                    (id :open-url-from-selection-action) :separator
-                                    "Require" :separator
+      (config! ns-lb-popup :items [ (id :new-browser-action)
+                                    :separator
+                                    (id :copy-fqn-action)
+                                    (id :fqn-from-clipboard-action)
+                                    (id :fqn-from-selection-action)
+                                    (id :open-url-from-selection-action)
+                                    :separator
+                                    (id :ns-require-btn-action)
+                                    :separator
                                     (id :ns-trace-btn-action) (id :ns-untrace-btn-action)
                                     ;;:separator auto-refresh-browser-cb
                                     ])

       (config! (id :vars-lb) :popup vars-lb-popup)
-      (config! vars-lb-popup :items [(id :new-browser-action) :separator (id :copy-fqn-action)
-                                    (id :fqn-from-clipboard-action) (id :fqn-from-selection-action)
-                                    (id :open-url-from-selection-action) :separator
-                                    (id :var-trace-btn-action) :separator "Un-Map" "Un-Alias"
-                                    ;;:separator vars-categorized-cb
-                                    ;;vars-fqn-listing-cb vars-search-doc-also-cb
+      (config! vars-lb-popup :items [(id :new-browser-action)
+                                    :separator
+                                    (id :copy-fqn-action) (id :fqn-from-clipboard-action)
+                                    (id :fqn-from-selection-action) (id :open-url-from-selection-action)
+                                    :separator
+                                    (id :var-trace-btn-action)
+                                    :separator
+                                    (id :vars-unmap-btn-action) (id :vars-unalias-btn-action)
+                                    :separator
+                                    (checkbox-menu-item :action (id :vars-categorized-cb-action))
+                                    (checkbox-menu-item :action (id :vars-fqn-listing-cb-action))
+                                    ;; vars-search-doc-also-cb
                                     ;;:separator auto-refresh-browser-cb
                                     ])


Fix chunk merge

Fix chunk merge

--- src/cljam/bam_index/writer.clj
+++ src/cljam/bam_index/writer.clj
@@ -205,8 +205,16 @@

 (defn- merge-chunks
   [chunks1 chunks2]
-  (-> (concat chunks1 chunks2)
-      (chunk/optimize-chunks 0)))
+  (loop [[f & r] (sort chunk/compare (concat chunks1 chunks2))
+         chunks' []]
+    (if f
+      (if-let [last-chunk (last chunks')]
+        (if (bgzf-util/same-or-adjacent-blocks? (:end last-chunk) (:beg f))
+          (let [l (assoc last-chunk :end (:end f))]
+            (recur r (conj (pop chunks') l)))
+          (recur r (conj chunks' f)))
+        (recur r (conj chunks' f)))
+      chunks')))

 (defn- merge-bins
   [bin-map1 bin-map2]


Start screen

Start screen

--- src/cljs/dragonspawn/core.cljs
+++ src/cljs/dragonspawn/core.cljs
@@ -7,14 +7,21 @@
             [goog.events.KeyCodes :as kcs]
             [goog.events.EventType :as event-type]))

-(def game-width 800)
-(def game-height 600)
-(def cell-size 32)
+(def game-width 2560)
+(def game-height 1440)
+(def cell-size 128)
 (def aspectRatio (float (/ 4 3)))
 (def time-limit 10)
 (def number-bones-needed 10)
 (def win-message "You won and can build a dragon")
 (def lose-message "You lost! The villagers will kill you now :(")
+(def reset-message "[Press n to start over]")
+(def title-message "Dragon Spawn")
+(def start-message ["You stole all the cabages! Oh noes!"
+                    "Some villagers are coming to find and kill you."
+                    (str "You have " time-limit " seconds to find " number-bones-needed)
+                    "dragon bones to build a dragon to defend yourself."
+                    "[Press any key to begin]"])

 (defn abs
   [number]
@@ -59,18 +66,18 @@

 (defn initial-state
   []
-  {:start-time (js/Date.)
-   :game-state :playing
+  {:game-state :start
    :item-locations (random-spawns)
    :inventory []
-   :player start-position} )
+   :player start-position})

 (def keycode->key
   {kcs/SPACE :space
    kcs/W :forward
    kcs/A :left
    kcs/S :back
-   kcs/D :right})
+   kcs/D :right
+   kcs/N :new-game})

 (def sprites
   {:bones (dom/getElement "bones")
@@ -97,11 +104,12 @@
     (.drawImage draw-context sprite x y size size)))

 (defn draw-text
-  ([state x y text] (draw-text state x y text "top"))
-  ([state x y text baseline] (draw-text state x y text baseline "right"))
-  ([state x y text baseline align]
+  ([state x y text] (draw-text state x y text "middle"))
+  ([state x y text baseline] (draw-text state x y text baseline "center"))
+  ([state x y text baseline align] (draw-text state x y text baseline align "4em"))
+  ([state x y text baseline align font-size]
    (let [[x y] (cell->coords x y)]
-     (set! (.-font draw-context) "bold 1.5em sans-serif")
+     (set! (.-font draw-context) (str "bold " font-size " sans-serif"))
      (set! (.-textBaseline draw-context) baseline)
      (set! (.-textAlign draw-context) align)
      (.fillText draw-context text x y))))
@@ -118,15 +126,27 @@
   [inventory]
   (>= (bone-count inventory) number-bones-needed))

+(defn draw-grass
+  [state]
+  (doseq [x (range game-x-cells) y (range game-y-cells)]
+    (draw-sprite state x y cell-size :grass)))
+
 (defmulti render :game-state)
+
+(defmethod render :start
+  [state]
+  (draw-grass state)
+  (let [x-mid (int (/ game-x-cells 2))]
+    (draw-text state x-mid 2 title-message "middle" "center" "5em")
+    (doseq [[y message] (map vector (range (count start-message)) start-message)]
+      (draw-text state x-mid (+ 3 y) message))))

 (defmethod render :playing
   [state]
   (let [{:keys [player start-time item-locations inventory]} state
         countdown (- time-limit (elapsed-time start-time))
         [player-x player-y] player]
-    (doseq [x (range game-x-cells) y (range game-y-cells)]
-      (draw-sprite state x y cell-size :grass))
+    (draw-grass state)
     (doseq [[[x y] sprite] item-locations]
       (draw-sprite state x y cell-size sprite))
     (draw-sprite state player-x player-y cell-size :player)
@@ -136,12 +156,14 @@
 (defmethod render :win
   [state]
   (let [x (int (/ game-x-cells 2))]
-    (draw-text state x 0 win-message "top" "center")))
+    (draw-text state x 0 win-message "top" "center")
+    (draw-text state x 1 reset-message "top" "center")))

 (defmethod render :lose
   [state]
   (let [x (int (/ game-x-cells 2))]
-    (draw-text state x 0 lose-message "top" "center")))
+    (draw-text state x 0 lose-message "top" "center")
+    (draw-text state x 1 reset-message "top" "center")))

 (defn render-world
   [state]
@@ -155,48 +177,69 @@

 (defn move-player
   [state direction]
-  (when (= :playing (:game-state @state))
-    (swap! state
-           (fn [current]
-             (let [{:keys [player inventory item-locations]} current
-                   [player-x player-y] player
-                   new-player (boundary
-                                (condp = direction
-                                  :left [(dec player-x) player-y]
-                                  :right [(inc player-x) player-y]
-                                  :forward [player-x (dec player-y)]
-                                  :back [player-x (inc player-y)]
-                                  player))
-                   item-at-player (get item-locations new-player)
-                   new-inventory (if item-at-player
-                                   (conj inventory item-at-player)
-                                   inventory)
-                   new-item-locations (if item-at-player
-                                        (dissoc item-locations new-player)
-                                        item-locations)]
-               (assoc current
-                      :player new-player
-                      :inventory new-inventory
-                      :item-locations new-item-locations))))))
+  (swap! state
+         (fn [current]
+           (let [{:keys [player inventory item-locations]} current
+                 [player-x player-y] player
+                 new-player (boundary
+                              (condp = direction
+                                :left [(dec player-x) player-y]
+                                :right [(inc player-x) player-y]
+                                :forward [player-x (dec player-y)]
+                                :back [player-x (inc player-y)]
+                                player))
+                 item-at-player (get item-locations new-player)
+                 new-inventory (if item-at-player
+                                 (conj inventory item-at-player)
+                                 inventory)
+                 new-item-locations (if item-at-player
+                                      (dissoc item-locations new-player)
+                                      item-locations)]
+             (assoc current
+                    :player new-player
+                    :inventory new-inventory
+                    :item-locations new-item-locations)))))

 (defn timeup?
   [start-time]
   (>= (elapsed-time start-time) time-limit))

+(defn playing?
+  [{:keys [game-state]}]
+  (= game-state :playing))
+
 (defn check-game
+  [state]
+  (when (playing? @state)
+    (swap! state
+           (fn [current]
+             (let [{:keys [game-state start-time inventory]} current]
+               (assoc current :game-state
+                      (cond
+                        (enough-bones? inventory) :win
+                        (timeup? start-time) :lose
+                        :else game-state)))))))
+
+(defn start-game
   [state]
   (swap! state
          (fn [current]
-           (let [{:keys [game-state start-time inventory]} current]
-             (assoc current :game-state
-                    (cond
-                      (enough-bones? inventory) :win
-                      (timeup? start-time) :lose
-                      :else game-state))))))
+           (assoc current
+                  :game-state :playing
+                  :start-time (js/Date.)))))
+
+(defn reset-game
+  [state keyevent]
+  (when (= keyevent :new-game)
+    (reset! state (initial-state))))

 (defn handle-keyevent
   [state keyevent]
-  (move-player state keyevent)
+  (let [{:keys [game-state]} @state]
+    (condp = game-state
+      :playing (move-player state keyevent)
+      :start (start-game state)
+      (reset-game state keyevent)))
   (log-state @state))

 (defn translate-keyboard-event


Implement new function of Context protocol for maybe monad.

--- src/cljx/cats/monad/maybe.cljx
+++ src/cljx/cats/monad/maybe.cljx
@@ -35,8 +35,8 @@

 (deftype Just [v]
   proto/Context
-  (get-context [_]
-    maybe-monad)
+  (get-context [_] maybe-monad)
+  (get-value [_] v)

   #+clj
   Object
@@ -59,8 +59,8 @@

 (deftype Nothing []
   proto/Context
-  (get-context [_]
-    maybe-monad)
+  (get-context [_] maybe-monad)
+  (get-value [_] nil)

   #+clj
   Object


don't return compiler state as output for REPL commands

it prints several hundred MB of data which blows up CIDER or Cursive

closes #71

--- src/main/shadow/cljs/devtools/api.clj
+++ src/main/shadow/cljs/devtools/api.clj
@@ -141,6 +141,7 @@
    (try
      (let [build-config (config/get-build! build)]
        (compile* build-config opts))
+     :done
      (catch Exception e
        (e/user-friendly-error e)))))


Shore up some unit test results

Shore up some unit test results

--- src/degasolv/resolver_core.clj
+++ src/degasolv/resolver_core.clj
@@ -262,6 +262,7 @@
             (let [children (filter
                              #(and
                                 (not (get already-visited %))
+                                (not (exclude %))
                                 (not (get parents %)))
                              (get package-graph children-of))]
               (if (empty? children)
@@ -706,7 +707,10 @@
                                present-packages)))
            (list-packages
              (second result)
-             :list-strat list-strat))
+             :list-strat list-strat
+             :exclude (reduce (fn [c [k v]] (into c v))
+                                #{}
+                               present-packages)))
          :install-graph
          (make-install-graph
            (second result)
@@ -722,5 +726,5 @@
   (let [r (resolve-dependencies-deluxe requirements query options)]
     (if (= (:result r) :successful)
            [:successful (:packages r)]
-           [(:result r) r])))
-
+           [(:result r) (dissoc r :result)])))
+


Misc user ns updates.

Misc user ns updates.

--- dev/user.clj
+++ dev/user.clj
@@ -2,39 +2,34 @@
   "Custom repl customization for local development."
   (:require
     [byte-streams :as bytes :refer [bytes=]]
-    (blocks
-      [core :as block]
-      [data :as data]
-      [store :as store])
-    (blocks.store
-      [buffer :refer [buffer-block-store]]
-      [cache :refer [caching-block-store]]
-      [file :refer [file-block-store]]
-      [memory :refer [memory-block-store]]
-      [replica :refer [replica-block-store]]
-      [tests :as tests])
+    [blocks.core :as block]
+    [blocks.data :as data]
+    [blocks.store :as store]
+    [blocks.store.buffer :refer [buffer-block-store]]
+    [blocks.store.cache :refer [caching-block-store]]
+    [blocks.store.file :refer [file-block-store]]
+    [blocks.store.memory :refer [memory-block-store]]
+    [blocks.store.replica :refer [replica-block-store]]
     [clojure.java.io :as io]
     [clojure.repl :refer :all]
+    [clojure.stacktrace :refer [print-cause-trace]]
     [clojure.string :as str]
     [clojure.test.check :as check]
     [clojure.test.check.generators :as gen]
     [clojure.test.check.properties :as prop]
-    [multihash.core :as multihash]
-    [multihash.digest :as digest])
+    [clojure.tools.namespace.repl :refer [refresh]]
+    [multiformats.hash :as mhash])
   (:import
     blocks.data.Block
-    multihash.core.Multihash))
+    multiformats.hash.Multihash))

-; Conditional imports from clj-stacktrace and clojure.tools.namespace:
-(try (require '[clojure.stacktrace :refer [print-cause-trace]]) (catch Exception e nil))
-(try (require '[clojure.tools.namespace.repl :refer [refresh]]) (catch Exception e nil))
-
-
+#_
 (def test-blocks
   (tests/generate-blocks! 10 1024))

+#_
 (def tbs
   "Temporary block store in target."
   (file-block-store "target/blocks"))


Clean dev user namespace

Clean dev user namespace

--- dev/user.clj
+++ dev/user.clj
@@ -1,37 +1,7 @@
 (ns user
   (:require [cljs.repl :as repl]
-            [cljs.repl.browser :as browser]
-            [gol.server :refer [app]]
-            [ns-tracker.core :refer [ns-tracker]]
-            [ring.util.serve :refer [serve]]
-            [ring.mock.request :refer [request]]))
+            [cljs.repl.browser :as browser]))

 (defn cljs-repl
   []
   (repl/repl (browser/repl-env)))
-
-(defn- ns-reload [track]
-  (try
-    (doseq [ns-sym (track)]
-      (require ns-sym :reload))
-    (catch Throwable e (.printStackTrace e))))
-
-(defn watch
-  ([] (watch ["src" "dev"]))
-  ([src-paths]
-   (let [track (ns-tracker src-paths)
-         done (atom false)]
-     (doto
-         (Thread.
-           (fn []
-             (while (not @done)
-               (ns-reload track)
-               (Thread/sleep 500))))
-       (.setDaemon true)
-       (.start))
-     (fn [] (swap! done not)))))
-
-(defn restart
-  []
-  (serve app 3000)
-  (watch))


DRY up the code for `shutdown-on-error` a bit

--- src/puppetlabs/trapperkeeper/core.clj
+++ src/puppetlabs/trapperkeeper/core.clj
@@ -178,6 +178,19 @@
   (doseq [f @shutdown-fns]
     (f)))

+(defn- create-shutdown-on-error-fn
+  [shutdown-reason]
+  (fn shutdown-fn
+    ([f]
+     (shutdown-fn f nil))
+    ([f on-error-fn]
+     (try
+       (f)
+       (catch Throwable t
+         (deliver shutdown-reason {:type         :service-error
+                                   :error        t
+                                   :on-error-fn  on-error-fn}))))))
+
 (defn- register-shutdown-hooks!
   "Walk the graph and register all shutdown functions. The functions
   will be called when the JVM shuts down, or by calling `shutdown!`."
@@ -186,20 +199,9 @@
                                 (partial wrap-with-shutdown-registration shutdown-fns)
                                 graph)
         shutdown-reason       (promise)
-        shutdown-on-error     (fn
-                                ([f]
-                                  (try
-                                    (f)
-                                    (catch Throwable t
-                                      (deliver shutdown-reason {:type  :service-error
-                                                                :error t}))))
-                                ([f on-error-fn]
-                                  (try
-                                    (f)
-                                    (catch Throwable t
-                                      (deliver shutdown-reason {:type         :service-error
-                                                                :error        t
-                                                                :on-error-fn  on-error-fn})))))
+        shutdown-on-error     (create-shutdown-on-error-fn shutdown-reason)
+
+
         shutdown-service      (service :shutdown-service
                                        {:depends  []
                                         :provides [request-shutdown wait-for-shutdown shutdown-on-error]}


added some notes

added some notes

--- core/src/samsara_core/kernel.clj
+++ core/src/samsara_core/kernel.clj
@@ -8,6 +8,28 @@
   (:require [samsara.utils :refer [to-json from-json invariant]])
   (:require [samsara.trackit :refer [track-time track-rate
                                      count-tracker distribution-tracker]]))
+
+;;
+;;   THIS NEED TO BE COMPLETELY RE-DESIGNED!!!!
+;;
+;; Things to keep in mind:
+;; * stream impedence format
+;;   [topic, part, key, msg] -> [state, [event]] ->
+;;   -> [topic, key, msg]
+;; * batching of messages not a single message
+;; * a processable stream will contain data
+;;   from multiple topics (ingestion, ingestion-kv)
+;;   which need to be processed in a single thread,
+;;   here there is a conflict with the idea of batching
+;;   which assume items of the same type.
+;; * should be able to support raw/untouched streams
+;;   which can be in different formats
+;; * support for global kv-state
+;; * support for stream with no output
+;; * support for orthogonal concerns such as
+;;   logging, and metrics collecting
+;; * handling of exception on a message level
+;;

 ;; runtime pipeline initialized by init-pipeline!
 (def ^:dynamic *config*       nil)


simplify code in symbol_solver/funcs

simplify code in symbol_solver/funcs

--- src/app/symbol_solver/funcs.clj
+++ src/app/symbol_solver/funcs.clj
@@ -2,37 +2,9 @@
   (:use [app.model.protocols])
   (:use [app.model.javaparser])
   (:use [app.javaparser.navigation])
-  (:use [app.operations])
-  (:use [app.itemsOnLifecycle])
   (:use [app.utils])
-  (:require [instaparse.core :as insta])
-  (:import [app.operations Operation])
-  (:use [app.symbol_solver.type_solver])
   (:use [app.symbol_solver.scope]))

-(import com.github.javaparser.JavaParser)
-(import com.github.javaparser.ast.CompilationUnit)
-(import com.github.javaparser.ast.Node)
-(import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration)
-(import com.github.javaparser.ast.body.EnumDeclaration)
-(import com.github.javaparser.ast.body.EnumConstantDeclaration)
-(import com.github.javaparser.ast.body.ConstructorDeclaration)
-(import com.github.javaparser.ast.body.FieldDeclaration)
-(import com.github.javaparser.ast.body.MethodDeclaration)
-(import com.github.javaparser.ast.body.ModifierSet)
-(import com.github.javaparser.ast.body.TypeDeclaration)
-(import com.github.javaparser.ast.body.VariableDeclaratorId)
-(import com.github.javaparser.ast.stmt.ExpressionStmt)
-(import com.github.javaparser.ast.stmt.BlockStmt)
-(import com.github.javaparser.ast.expr.MethodCallExpr)
-(import com.github.javaparser.ast.expr.NameExpr)
-(import com.github.javaparser.ast.expr.IntegerLiteralExpr)
-(import com.github.javaparser.ast.expr.AssignExpr)
-(import com.github.javaparser.ast.expr.VariableDeclarationExpr)
-(import com.github.javaparser.ast.body.VariableDeclarator)
-(import com.github.javaparser.ast.body.VariableDeclaratorId)
-(import com.github.javaparser.ast.visitor.DumpVisitor)
-(import com.github.javaparser.ast.type.PrimitiveType)

 (defn solveNameExpr [nameExpr]
   ; TODO consider local variables


more TODO

more TODO

--- test/com/billpiel/sayid/core_test.clj
+++ test/com/billpiel/sayid/core_test.clj
@@ -950,16 +950,16 @@
 ~ profile simulated tracer fn
 x FIX return values of `false` aren't displayed
 X should be able to query for func by func
-- profiling interface in core
+x profiling interface in core
 - FIX deep-traced fn returning fn blows up -- has no parent context -- throw explaining exception??
 - rec-save-as should accept keyword or string
 - never return ws or recs from core fns
 x deep trace (inside fn)
 x trace individual fns
-- re-exec traces
+x re-exec traces
 x query selector funcs
-  - special output
-  - toggle output components
+  x special output
+  x toggle output components
 - query output by line/column position -- for emacs plugin
 - cursors
    - bisect recording trees to find bugs


Remove whitespace.

Remove whitespace.

--- src/lib/clj/one/dev_server.clj
+++ src/lib/clj/one/dev_server.clj
@@ -29,7 +29,7 @@
 (defroutes app-routes
   (:api-routes config)
   (GET "/development" request (make-host-page request))
-  (GET "/production" request (make-host-page request) )
+  (GET "/production" request (make-host-page request))
   (GET "/design*" {{file :*} :route-params}
        (when (.endsWith file ".html")
          (load-html (.substring file 1))))


add new usage examples we will target

add new usage examples we will target

--- src/main/cljs_api_gen/core.clj
+++ src/main/cljs_api_gen/core.clj
@@ -19,10 +19,14 @@
 ;;--------------------------------------------------------------------------------

 (def usage-examples
-  [{:opts  {:catalog :all}    :desc "Start or resume building docs catalog for all cljs versions"}
-   {:opts  {:catalog 3}       :desc "Start or resume the next 3 cljs versions"}
-   {:opts  {:version "r3211"} :desc "Process and output docs for single cljs version r3211"}
-   {:opts  {:version :latest} :desc "Process and output docs for latest cljs version"}])
+  [{:opts  {:full :latest, :repo? true}     :desc "Build/resume docs catalog for all cljs versions"}
+   {:opts  {:full 6,       :repo? true}     :desc "Build/resume docs catalog for next 3 cljs versions"}
+
+   {:opts  {:single "r3211"}                :desc "Create docs for single cljs version r3211 (WITHOUT history)"}
+   {:opts  {:single :latest}                :desc "Create docs for latest cljs version       (WITHOUT history)"}
+
+   {:opts  {:full "r3211", :pages :latest}  :desc "Create docs for single cljs version r3211 (WITH history)"}
+   ])

 (defn show-usage-and-exit! []
   (binding [*out* *err*]


~(defn model-plus-lexicon): +optional grammar-filter-rule

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -706,7 +706,7 @@
 ;; TODO: factor out language-independent parts of this to babel.lexiconfn.
 (defn model-plus-lexicon
   "create a language model for Italian with the supplied lexicon."
-  [lexicon]
+  [lexicon & [grammar-filter-rule]]
   (let [debug (log/info "  loading lexicon..")
         debug (log/info "  filtering lexicon..")
         lexicon
@@ -720,6 +720,13 @@

         debug (log/info "  lexicon for generation..")
         lexicon-for-generation (lexicon-for-generation lexicon)
+
+        grammar-filter-rule
+        (or grammar-filter-rule (fn [rule] true))
+
+        grammar (filter grammar-filter-rule
+                        grammar)
+
         rules (map #(keyword (get-in % [:rule])) grammar)

         ;; indices from paths to subsets of the lexicon


+ "a" <time>

+ "a" <time>

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -39,6 +39,7 @@
                    :human true}
              :propernoun true}}
    "a"
+   ;; "a casa"
    [(let [location (atom {:place true})]
       {:synsem {:cat :prep
                 :sem {:pred :a
@@ -49,10 +50,19 @@
                              :subcat '()
                              :sem location}
                          :2 '()}}})
+    ;; "a Roma"
     {:synsem {:cat :prep
               :sem {:pred :in}
               :subcat {:1 {:cat :noun
                            :sem {:city true}}}}}
+
+    ;; "a mezzogiorno"
+    {:synsem {:cat :prep
+              :sem {:pred :a}
+              :subcat {:1 {:cat :noun
+                           :sem {:time true}}
+                       :2 {:cat :verb
+                           :subcat '()}}}}

     ;; e.g. "a ridere": tu hai fatto bene a ridere (you did well to laugh)"
 ;    (let [complement-semantics (atom {:pred :a


+"lo" {:cat :det}

+"lo" {:cat :det}

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -1491,8 +1491,11 @@
        :italiano {:initial true  ;; TODO: verify that 'lo' above and this below are being unified correctly.
                   :pronoun true
                   :cat :noun
-                  :case pronoun-acc}}]
-
+                  :case pronoun-acc}}
+    {:synsem {:cat :det
+              :def :def
+              :agr {:gender :masc
+                    :number :sing}}}]
    "loro"
    [{:synsem {:cat :noun
               :pronoun true


remove all dire's infinitive's exceptions

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -958,8 +958,7 @@

    "dire" (let [shared-part-of-dire
                 {:synsem {:cat :verb}
-                 :italiano {:infinitive-for-conjugation "dicere"
-                            :drop-e false
+                 :italiano {:drop-e false
                             :passato "detto"
                             :future-stem "dir"
                             :present {:2plur "dite"}}}]


Protect system start function from NPEs

Protect system start function from NPEs

--- src/clj/comic_reader/system.clj
+++ src/clj/comic_reader/system.clj
@@ -35,7 +35,8 @@
     (constantly (comic-reader-system))))

 (defn start []
-  (alter-var-root #'system component/start))
+  (when (deref #'system)
+    (alter-var-root #'system component/start)))

 (defn stop []
   (alter-var-root #'system


Fix card-counter widget

Fix card-counter widget

--- src/cljs/decktouch/widgets.cljs
+++ src/cljs/decktouch/widgets.cljs
@@ -33,8 +33,15 @@
                   [mana-symbol m n])))]
       [:br]]))

+(defn get-card-quantity [card]
+  (let [q (get card "quantity")]
+    (if (> 1 q)
+      0
+      q)))
+
 (defn card-counter [cards]
-  [:h3 [:p.text-right (count cards) " cards"]])
+  (let [card-count (reduce + (map get-card-quantity cards))]
+    [:h3 [:p.text-right card-count " cards"]]))

 (defn card-types [cards]
   [:div


Add info about season-episode filtering format

--- src/cljs/subman/components.cljs
+++ src/cljs/subman/components.cljs
@@ -88,6 +88,8 @@
                                [:code ":source name"]
                                ", by default used: "
                                (edit-option options :sources :current-source)]
+                              [:p "And you can filter by source and season with "
+                               [:code "S01E01"] " format."]
                               [:p "Total indexed subtitles count: "
                                @total-count
                                "."]


Fix get-tabpane

Fix get-tabpane

Check if panel is an instance of JTabbedPane, not
whether its class is JTabbedPane

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

--- src/conexp/contrib/gui/util.clj
+++ src/conexp/contrib/gui/util.clj
@@ -340,7 +340,7 @@
 (defn- get-tabpane
   "Returns tabpane of the given frame."
   [frame]
-  (get-component frame #(= (class %) javax.swing.JTabbedPane)))
+  (get-component frame #(instance? javax.swing.JTabbedPane %)))

 (defn- make-tab-button
   "Creates and returns a button for a tab component in tabpane to


Fix a error in logging

Fix a error in logging

--- src/cyanite_remover/logging.clj
+++ src/cyanite_remover/logging.clj
@@ -4,12 +4,12 @@
             [clojure.tools.logging :as log]
             [org.spootnik.logconfig :as logconfig]))

-(defmacro disable-logging!
-  "Disable logging."
+(defmacro log-disable-logging!
+  "Disable logging macro."
   []
   `(logconfig/start-logging! {:level "off" :console false :files ""}))

-(disable-logging!)
+(log-disable-logging!)

 (def ^:const default-log-file "cyanite-remover.log")
 (def ^:const default-log-level "info")
@@ -27,7 +27,7 @@
   (if-not @disable-log?
     (logconfig/start-logging! {:level (:log-level options default-log-level)
                                :files [(:log-file options default-log-file)]})
-    (disable-logging!)))
+    (log-disable-logging!)))

 (defn disable-logging!
   "Disable logging."
@@ -35,7 +35,7 @@
   (swap! print-log? (fn [_] true))
   (swap! disable-log? (fn [_] true))
   (swap! stop-on-error? (fn [_] true))
-  (logconfig/start-logging! {:level "off" :console false :files ""}))
+  (log-disable-logging!))

 (defmacro log-log
   [f msg throwable]


actively remove old database-sync events from the activity feed now that we are not planning to have those in the feeds.

--- src/metabase/db/migrations.clj
+++ src/metabase/db/migrations.clj
@@ -3,7 +3,9 @@
   (:require [clojure.tools.logging :as log]
             [korma.core :as k]
             [metabase.db :as db]
-            (metabase.models [card :refer [Card]]
+            [metabase.events.activity-feed :refer [activity-feed-topics]]
+            (metabase.models [activity :refer [Activity]]
+                             [card :refer [Card]]
                              [database :refer [Database]]
                              [table :refer [Table]]
                              [setting :as setting])
@@ -87,3 +89,10 @@
   (when-not (setting/get :admin-email)
     (when-let [email (db/sel :one :field ['User :email] (k/where {:is_superuser true :is_active true}))]
       (setting/set :admin-email email))))
+
+
+;; Remove old `database-sync` activity feed entries
+(defmigration remove-database-sync-activity-entries
+  (when-not (contains? activity-feed-topics :database-sync-begin)
+    (k/delete Activity
+      (k/where {:topic "database-sync"}))))


it's just easier to spit;

it's just easier to spit;

--- src/mustached_hipster/core.clj
+++ src/mustached_hipster/core.clj
@@ -9,13 +9,13 @@
    ;; work around dangerous default behaviour in Clojure
    (alter-var-root #'*read-eval* (constantly false))

-   (with-open
-      [out (clojure.java.io/writer "foo.txt")]
-      (.write out
+   (spit "foo.txt"
+      (str
          (join
             "\n"
             (map
                #(first (split (trim %) #"\?"))
                (filter
                   #(not= \# (first %))
-                  (split-lines (:body (http/get url)))))))))
+                  (split-lines (:body (http/get url))))))
+         "\n")))


Incremente turn on player

Incremente turn on player

--- src/obb_demo/views/player.cljs
+++ src/obb_demo/views/player.cljs
@@ -94,6 +94,7 @@
         game (-> (:game game-data)
                  (game-mode/process)
                  (dissoc :action-results))
+        turn-num (:turn-num game-data)
         actions (firingsquad/actions game :p2)
         result (turn/process-actions game :p2 actions)]
     (println actions)
@@ -105,7 +106,7 @@
                                :previous-game new-game
                                :previous-player :p2
                                :action-points 0
-                               :turn-num 0}))
+                               :turn-num (+ 1 turn-num)}))
         (println result))))

 (defn- rotate-button


Check if we need to delete a section on entry publish and update.

After an entry is updated or published, if it's moved to another section we may need to delete the old containin section if it's a draft section and it's empty.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -65,6 +65,8 @@
     (let [new-board-slug (:board-slug entry-props) ; check if they are moving the entry
           new-board (when new-board-slug ; look up the board it's being moved to
                           (board-res/get-board conn (:org-uuid existing-entry) new-board-slug))
+          old-board (when new-board
+                      (board-res/get-board conn (:board-uuid existing-entry)))
           new-board-uuid (:uuid new-board)
           props (if new-board-uuid
                   (assoc entry-props :board-uuid new-board-uuid)
@@ -74,6 +76,7 @@
       (if (lib-schema/valid? common-res/Entry updated-entry)
         {:existing-entry existing-entry
          :existing-board new-board
+         :moving-board old-board
          :updated-entry updated-entry}
         [false, {:updated-entry updated-entry}])) ; invalid update

@@ -150,11 +153,16 @@
   (timbre/info "Updating entry for:" entry-for)
   (if-let* [org (:existing-org ctx)
             board (:existing-board ctx)
+            old-board (:moving-board ctx)
             user (:user ctx)
             entry (:existing-entry ctx)
             updated-entry (:updated-entry ctx)
             updated-result (entry-res/update-entry! conn (:uuid updated-entry) updated-entry user)]
-    (do
+    (do
+      ;; If we are moving the entry from a draft board, check if we need to remove the board itself.
+      (when old-board
+        (let [remaining-entries (entry-res/list-all-entries-by-board conn (:uuid old-board))]
+          (board-res/maybe-delete-draft-board conn org old-board remaining-entries user)))
       (timbre/info "Updated entry for:" entry-for)
       (notification/send-trigger! (notification/->trigger :update org board {:old entry :new updated-result} user nil))
       {:updated-entry updated-result})
@@ -166,11 +174,16 @@
   (if-let* [user (:user ctx)
             org (:existing-org ctx)
             board (:existing-board ctx)
+            old-board (:moving-board ctx)
             entry (:existing-entry ctx)
             updated-entry (:updated-entry ctx)
             publish-result (entry-res/publish-entry! conn (:uuid updated-entry) updated-entry user)]
     (do
       (undraft-board conn user org board)
+      ;; If we are moving the entry from a draft board, check if we need to remove the board itself.
+      (when old-board
+        (let [remaining-entries (entry-res/list-all-entries-by-board conn (:uuid old-board))]
+          (board-res/maybe-delete-draft-board conn org old-board remaining-entries user)))
       (timbre/info "Published entry for:" (:uuid updated-entry))
       (auto-share-on-publish conn ctx publish-result)
       (timbre/info "Published entry:" entry-for)
@@ -186,16 +199,9 @@
             _delete-result (entry-res/delete-entry! conn (:uuid entry))]
     (do
       ;; If deleting a draft on a draft board
-      (when (and (= (keyword (:status entry)) :draft) (:draft board))
-        ;; check how many entries the section still have
+      (when (= (keyword (:status entry)) :draft)
         (let [remaining-entries (entry-res/list-all-entries-by-board conn (:uuid board))]
-          ;; if we are deleting the last draft
-          (when (zero? (count remaining-entries))
-            (timbre/info "Deleting board:" (:uuid board) "because last draft was removed.")
-            ;; Remove also the board
-            (board-res/delete-board! conn (:uuid board) remaining-entries)
-            (timbre/info "Deleted board:" (:uuid board))
-            (notification/send-trigger! (notification/->trigger :delete org {:old board} (:user ctx))))))
+          (board-res/maybe-delete-draft-board conn org board remaining-entries (:user ctx))))
       (timbre/info "Deleted entry for:" entry-for)
       (notification/send-trigger! (notification/->trigger :delete org board {:old entry} (:user ctx) nil))
       true)