add a helper for displaying text bounding boxes

--- src-cljs/frontend/components/canvas.cljs
+++ src-cljs/frontend/components/canvas.cljs
@@ -133,6 +133,25 @@
                                                        :x (:x text-props)}
                                                   text)))
                                   [] (str/split (:layer/text layer) #"\n")))))))
+
+;; debug method for showing text with bounding box
+#_(defmethod svg-element :layer.type/text
+    [layer]
+    (let [text-props (svg/layer->svg-text layer)]
+      (dom/g nil
+        (svg-element (assoc layer
+                            :layer/type :layer.type/rect
+                            :key (str (:db/id layer) "-text-bbox")
+                            :style #js {:stroke "yellow"}))
+        (-> text-props
+          (maybe-add-classes layer)
+          (clj->js)
+          (#(apply dom/text % (reduce (fn [tspans text]
+                                        (conj tspans (dom/tspan
+                                                      #js {:dy (if (seq tspans) "1em" "0")
+                                                           :x (:x text-props)}
+                                                      text)))
+                                      [] (str/split (:layer/text layer) #"\n"))))))))

 (defmethod svg-element :layer.type/line
   [layer]


fix managed-ajax

fix managed-ajax

--- src-cljs/frontend/utils/ajax.cljs
+++ src-cljs/frontend/utils/ajax.cljs
@@ -90,30 +90,29 @@
                            (clj-ajax/transform-opts format-opts))))

 ;; This is all very mess, it should be cleaned up at some point
-(defn managed-ajax [method url & {:keys [params keywords? headers format response-format]
+(defn managed-ajax [method url & {:keys [params keywords? headers format]
                                   :or {keywords? true
-                                       response-format :json
                                        format :edn}}]
   (let [channel (chan)
-        format (get {:xml (xml-request-response)
-                     :json (merge (clj-ajax/json-request-format)
-                                  (json-response-format {:keywords? keywords? :url url :method method}))
-                     :edn (clj-ajax/edn-format)}
-                    format)
-        accept-header (get {:xml "application/xml"
-                            :json "application/json"
-                            :edn "application/edn"}
-                           response-format)]
+        opt-format (get {:xml (xml-request-response)
+                         :json (merge (clj-ajax/json-request-format)
+                                      (json-response-format {:keywords? keywords? :url url :method method}))
+                         :edn (clj-ajax/edn-format)}
+                        format)
+        accept-header (utils/inspect (get {:xml "application/xml"
+                                           :json "application/json"
+                                           :edn "application/edn"}
+                                          (utils/inspect format)))]
     (clj-ajax/ajax-request url method
                            (clj-ajax/transform-opts
-                            {:format format
-                             :response-format response-format
+                            {:format opt-format
+                             :response-format opt-format
                              :keywords? keywords?
                              :params params
                              :headers (merge (when accept-header
                                                {:Accept accept-header})
                                              (when (re-find #"^/" url)
-                                               {:X-CSRFToken (utils/csrf-token)})
+                                               {:X-CSRF-Token (utils/csrf-token)})
                                              headers)
                              :handler #(put! channel (assoc % :status :success))
                              ;; TODO: clean this up


Tidying.

Tidying.

--- src-cljs/githubcomments/core.cljs
+++ src-cljs/githubcomments/core.cljs
@@ -14,15 +14,6 @@
                      (take 10 comments))
              "</ul>")))

-(defn rendered-comment [repo comment]
-  "Render the given comment in the context of the given repository."
-  (go (let [response (async/<!
-                       (render-user-content-markdown (:body comment) repo))]
-        (:body response))))
-
-(defn rendered-comments [repo comments]
-  (map :body_html comments))
-
 (defn init []
   (go (let [element (dom/getElement "github-comments")
             repo [(dataset/get element "repositoryOwner")
@@ -30,7 +21,7 @@
             path (dataset/get element "path")
             response (async/<! (repo-comments repo "html"))
             relevant (filter #(= (:path %1) path) (:body response))
-            comments (rendered-comments repo relevant)]
-        (display-comments comments element))))
+            comments-html (map :body_html relevant)]
+        (display-comments comments-html element))))

 (init)


Restored Projects table in tables.html (in user interface)

--- src-cljs/kixi/hecuba/main_om.cljs
+++ src-cljs/kixi/hecuba/main_om.cljs
@@ -10,7 +10,7 @@
 (defn table-row [data owner]
   (om/component
       (dom/tr #js {:onClick (fn [e] (.log js/console "ooh!"))}
-           (dom/td nil (:name data))
+           (dom/td nil (:hecuba/name data))
            (dom/td nil (apply str (interpose ", " (:leaders data)))))))

 (defn table [data owner]
@@ -26,7 +26,7 @@
                 (dom/tbody nil
                      (om/build-all table-row
                          (:projects data)
-                         {:key :name})))))))
+                         {:key :hecuba/name})))))))

 (def nav-model
   (atom {:messages []


(SERVER-880) Improve docstring

(SERVER-880) Improve docstring

Improve the docstring for `static-file-content-request-handler`
to make it more clear what the function actually does.

--- src/clj/puppetlabs/services/master/master_core.clj
+++ src/clj/puppetlabs/services/master/master_core.clj
@@ -81,7 +81,9 @@
    ring/wrap-params))

 (defn static-file-content-request-handler
-  "Build the main request handler for the /static_file_content endpoint"
+  "Returns a function which is the main request handler for the
+  /static_file_content endpoint, utilizing the provided implementation of
+  `get-code-content`"
   [get-code-content]
   (fn [req]
     (let [environment (get-in req [:params "environment"])


fix running of attached runnables

fix running of attached runnables

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@8192 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -34,7 +34,7 @@
                                          ProcessorStack SequenceSettings MMImageCache
                                          TaggedImageStorageRam VirtualAcquisitionDisplay]
            [org.micromanager.utils ReportingUtils]
-           [mmcorej TaggedImage Configuration Metadata MMCoreJ]
+           [mmcorej TaggedImage Configuration Metadata]
            [java.util.prefs Preferences]
            [java.net InetAddress]
            [java.util.concurrent TimeUnit CountDownLatch]
@@ -498,7 +498,8 @@
           #(when z-drive
              (let [z (compute-z-position event)]
                (set-stage-position z-drive z)))
-          (event :runnables)
+          (doseq [runnable (event :runnables)]
+            (.run runnable))
           #(do (wait-for-pending-devices)
                (expose event)
                (collect event out-queue)
@@ -587,7 +588,6 @@
         super-channels (all-super-channels simple-channels (get-camera-channel-names))]
      (JSONObject. {
       "BitDepth" (core getImageBitDepth)
-      "Binning" (core getProperty (core getCameraDevice) "Binning")
       "Channels" (count super-channels)
       "ChNames" (JSONArray. (map :name super-channels))
       "ChColors" (JSONArray. (map #(.getRGB (:color %)) super-channels))
@@ -655,7 +655,7 @@
 		summary-metadata (make-summary-metadata summary)
 		cache (doto (MMImageCache. (TaggedImageStorageRam. summary-metadata))
 						(.setSummaryMetadata summary-metadata))]
-    (doto (VirtualAcquisitionDisplay. cache nil)
+		(doto (VirtualAcquisitionDisplay. cache nil)
                            (.promptToSave false)
                            (initialize-display-ranges))))

@@ -703,32 +703,14 @@

 ;; live mode

-(def live-mode-running (atom false))
-
-(defn need-new-win? []
-      (if-not @snap-window true
-    (let [old-height (.get (.getSummaryMetadata @snap-window) "Height")
-          old-width (.get (.getSummaryMetadata @snap-window) "Width")
-          old-pixel-type (.get (.getSummaryMetadata @snap-window) "PixelType")
-          old-binning (.get (.getSummaryMetadata @snap-window) "Binning")
-          new-height (core getImageHeight)
-          new-width (core getImageWidth)
-          new-pixel-type (get-pixel-type)
-          new-binning (core getProperty (core getCameraDevice) "Binning")]
-      (or (not= old-height new-height) (not= old-width new-width)
-          (not= old-pixel-type new-pixel-type) (not= old-binning new-binning)   ))))
-
-
+(def live-mode-running (ref false))

 (defn enable-live-mode [^Boolean on]
   (if on
     (let [event (create-basic-event)
           state (create-basic-state)
-          start-time (jvm-time-ms)   ]
-     (when (need-new-win?)
-        (when @snap-window
-         (.close @snap-window) ) )
-      (reset! live-mode-running true)
+          start-time (jvm-time-ms)]
+      (dosync (ref-set live-mode-running true))
       (core startContinuousSequenceAcquisition 0)
       (log "started sequence acquisition")
       (.start (Thread.
@@ -739,19 +721,16 @@
                                   elapsed-time-ms (- (jvm-time-ms) start-time)
                                   img (annotate-image raw-image event state elapsed-time-ms)
                                   this-time (System/currentTimeMillis)
-                                  dt (- 33 (- this-time last-time))]
-                              (if first-image (reset-snap-window img)  )
-                                 (Thread/sleep (max 0 dt))
+                                  dt (- 33 (- this-time last-time))]
+                              (if first-image (reset-snap-window img)  )
+                              (Thread/sleep (max 0 dt))
                               (if (.windowClosed @snap-window)
                                 (edt (.enableLiveMode gui false))
                                 (show-image @snap-window img first-image)  )
                               (recur this-time false))))
                         (core stopSequenceAcquisition))
                 "Live mode (clojure)")))
-    (reset! live-mode-running false)  ))
-
-
-
+    (dosync (ref-set live-mode-running false))))

 ;; java interop


Adds resuming test using official java client

--- test/org/akvo/resumed_test.clj
+++ test/org/akvo/resumed_test.clj
@@ -151,4 +151,29 @@
           (is (> (.getOffset uploader) 0))
           (recur (.uploadChunk uploader))))
       (.finish uploader)
+      (.stop srv)))
+  (testing "Java client - resuming"
+    (let [handler (make-handler)
+          port (+ 3000 (int (rand 100)))
+          srv (jetty/run-jetty handler {:port port :join? false})
+          client (TusClient.)
+          _ (.setUploadCreationURL client (URL. (format "http://localhost:%s/" port)))
+          _ (.enableResuming client (TusURLMemoryStore.) )
+          f (io/file (io/resource "resources/pg11.txt"))
+          limit (/ (.length f) 2)
+          upload1 (TusUpload. f)
+          upldr (.resumeOrCreateUpload client upload1)
+          chunk-size 1024
+          _ (.setChunkSize upldr chunk-size)
+          _ (loop [up (.uploadChunk upldr)] ;; upload first half
+              (when (and (> up -1) (< (.getOffset upldr) limit))
+                (recur (.uploadChunk upldr))))
+          upload2 (TusUpload. f) ;; resume
+          upldr2 (.resumeOrCreateUpload client upload2)
+          _ (.setChunkSize upldr2 chunk-size)]
+      (loop [up (.uploadChunk upldr2)]
+        (when (> up -1)
+          (is (> (.getOffset upldr2) 0))
+          (recur (.uploadChunk upldr2))))
+      (.finish upldr2)
       (.stop srv))))


Safe swap! in 'set-keys!'

Safe swap! in 'set-keys!'

--- src/cyanite_cache/cache.clj
+++ src/cyanite_cache/cache.clj
@@ -82,18 +82,19 @@
   [mkeys tenant period rollup time path ttl fn-get fn-agg fn-store]
   (let [tkeys (set-tkeys! mkeys tenant period rollup)
         pkeys (set-pkeys! mkeys tkeys tenant period rollup time ttl fn-get
-                          fn-agg fn-store)
-        exists (contains? pkeys path)]
-    (when-not exists
-      (swap! pkeys conj path))
-    exists))
+                          fn-agg fn-store)]
+    (swap! pkeys
+           (fn [pkeys]
+             (if (contains? pkeys path)
+               pkeys
+               (conj pkeys path))))))

 (defn simple-cache
   [fn-agg fn-store]
   (let [caches (atom {})
         get-fns (atom {})
         mkeys (atom {})
-        get-cache
+        get-cache!
         (fn [rollup]
           (swap! caches
                  (fn [caches]
@@ -107,7 +108,7 @@
         create-fn-get
         (fn [cache]
           (fn [key]))
-        get-get-fn
+        get-get-fn!
         (fn [rollup]
           (let [rollup (int rollup)]
             (swap! get-fns
@@ -115,12 +116,12 @@
                      (if (contains? get-fns rollup)
                        get-fns
                        (assoc get-fns rollup
-                              (create-fn-get (get-cache rollup)))))))
+                              (create-fn-get (get-cache! rollup)))))))
           (get @get-fns rollup))]
     (reify
       StoreCache
       (push! [this tenant period rollup time path data ttl]
-        (set-keys! mkeys tenant period rollup time path ttl (get-get-fn rollup)
+        (set-keys! mkeys tenant period rollup time path ttl (get-get-fn! rollup)
                    fn-agg fn-store)
         )
       )))


Removed SQL tasks

Removed SQL tasks

--- src/desdemona/tasks/sql.clj
+++ src/desdemona/tasks/sql.clj
@@ -1,18 +0,0 @@
-(ns desdemona.tasks.sql
-  (:require [schema.core :as s]
-            [taoensso.timbre :refer [info]]))
-
-;; TODO, add read-rows function task
-
-(defn add-sql-insert-output
-  "Adds an sql insert rows output task to a job"
-  [job task opts]
-  (-> job
-      (update :catalog conj (merge {:onyx/name task
-                                    :onyx/plugin :onyx.plugin.sql/write-rows
-                                    :onyx/type :output
-                                    :onyx/medium :sql
-                                    :onyx/doc "Writes segments from the :rows keys to the SQL database"}
-                                   opts))
-      (update :lifecycles conj {:lifecycle/task task
-                                :lifecycle/calls :onyx.plugin.sql/write-rows-calls})))


Add more extensions

Add more extensions

--- src/discuss/extensions.cljs
+++ src/discuss/extensions.cljs
@@ -2,12 +2,59 @@

 (enable-console-print!)

-(when (js* "typeof NodeList != \"undefined\"")
-  (extend-type js/NodeList
-    ISeqable
-    (-seq [array] (array-seq array 0))))
+(extend-type js/HTMLCollection
+  ISeqable
+  (-seq [array] (array-seq array 0))

-(extend-type js/HTMLCollection
+  ICounted
+  (-count [a] (alength a))
+
+  IIndexed
+  (-nth
+    ([array n]
+     (if (< n (alength array)) (aget array n)))
+    ([array n not-found]
+     (if (< n (alength array)) (aget array n)
+                               not-found)))
+  ILookup
+  (-lookup
+    ([array k]
+     (aget array k))
+    ([array k not-found]
+     (-nth array k not-found)))
+  IReduce
+  (-reduce
+    ([array f]
+     (ci-reduce array f))
+    ([array f start]
+     (ci-reduce array f start))))
+
+(extend-type js/NodeList
+  ISeqable
+  (-seq [array] (array-seq array 0))
+  ICounted
+  (-count [a] (alength a))
+  IIndexed
+  (-nth
+    ([array n]
+     (if (< n (alength array)) (aget array n)))
+    ([array n not-found]
+     (if (< n (alength array)) (aget array n)
+                               not-found)))
+  ILookup
+  (-lookup
+    ([array k]
+     (aget array k))
+    ([array k not-found]
+     (-nth array k not-found)))
+  IReduce
+  (-reduce
+    ([array f]
+     (ci-reduce array f))
+    ([array f start]
+     (ci-reduce array f start))))
+
+(extend-type js/HTMLDocument
   ISeqable
   (-seq [array] (array-seq array 0)))


add fontset

add fontset

Signed-off-by: Yen-Chin Lee <082d453d72dce940e12089a4ad48b97cfe1f3ec4@gmail.com>


clj-uuid is not a dep!

clj-uuid is not a dep!

--- src/er_cassandra/record.clj
+++ src/er_cassandra/record.clj
@@ -4,7 +4,6 @@
    [plumbing.core :refer :all]
    [manifold.deferred :as d]
    [qbits.hayt :as h]
-   [clj-uuid :as uuid]
    [er-cassandra.key :refer [make-sequential extract-key-equality-clause]]
    [er-cassandra.session :as session]))


Add 'live' environment for registration

Add 'live' environment for registration

--- src/eureka/registration.clj
+++ src/eureka/registration.clj
@@ -15,7 +15,8 @@
    "poke" ["poke" "cq1" "cq3"]
    "cq1" ["cq1"]
    "cq3" ["poke" "cq3"]
-   "prod" ["prod" "live"]})
+   "prod" ["prod" "live"]
+   "live" ["prod" "live"]})

 (defn ^:private service-discoveries [environment-name]
   (reduce #(conj %1 (service-discovery *curator-framework* %2)) #{} (environments (lower-case environment-name))))


Add new route

Add new route

--- src/discuss/views.cljs
+++ src/discuss/views.cljs
@@ -180,6 +180,7 @@
       (= view :reference-agree-disagree) (om/build ref/agree-disagree-view {})
       (= view :reference-dialog) (om/build ref/dialog-view {})
       (= view :reference-usages) (om/build ref/usages-view {})
+      (= view :reference-create) (om/build ref/create-view {})
       :else (discussion-elements data))))

 (defn main-content-view


Finish action for warehouse.

Finish action for warehouse.

--- src/angelic/domains/warehouse.clj
+++ src/angelic/domains/warehouse.clj
@@ -302,7 +302,7 @@
         tops  (for [x (range 1 (inc w))]
                 [x (last (take-while #(and (<= % h) (state/get-var state ['someblockat x %])) (range 1 (inc h))))])]
     (util/cons-when
-     (when (goal-fn state) [])
+     (when (goal-fn state) [(env-util/make-finish-action env)])
      (for [[bx by] tops
            :let [b (state/get-var state ['blockat bx by])]
            :when (and (> by 1) (not (= b block-off-limits)))


indicate sub status of tags in autocomplete

--- src/braid/client/ui/views/autocomplete.cljs
+++ src/braid/client/ui/views/autocomplete.cljs
@@ -140,7 +140,14 @@
                         (fn []
                           [:div.tag-match
                            [:div.color-block
-                            {:style {:backgroundColor (id->color (tag :id))}}]
+                            {:style
+                             (merge
+                               {:borderColor (id->color (tag :id))
+                                :borderWidth "3px"
+                                :borderStyle "solid"
+                                :borderRadius "3px"}
+                               (when (store/is-subscribed-to-tag? (tag :id))
+                                 {:backgroundColor (id->color (tag :id))}))}]
                            [:div.name (tag :name)]
                            [:div.extra (tag :description)]])}))
                 (cons (when-not (or exact-match? (string/blank? query))


Add error handler for search ajax

Add error handler for search ajax

--- src/cljs/ikea_clojure_cup/select_items.cljs
+++ src/cljs/ikea_clojure_cup/select_items.cljs
@@ -19,7 +19,10 @@
          {:params {:region (:code region)
                    :lang (:lang region)
                    :query term}
-          :handler (fn [resp] (async/put! data-ch (take number-search-results resp)))})
+          :handler (fn [resp] (async/put! data-ch (take number-search-results resp)))
+          :error-handler (fn [resp]
+                           (println "*** ERROR While performing search ***")
+                           (async/put! data-ch []))})
     data-ch))

 (defn item-preview


Update index.clj

Update index.clj

--- src/clojure_car_price/controllers/index.clj
+++ src/clojure_car_price/controllers/index.clj
@@ -4,7 +4,7 @@
     [clojure_car_price.models.cars :as cars-model]
     [clojure_car_price.models.manufracturer :as man-model]
     [clojure_car_price.models.country :as country-model]
-	 [clojure_car_price.models.city :as city-model]))
+    [clojure_car_price.models.city :as city-model]))

 (defn read-template [template-name]
@@ -41,4 +41,4 @@
 										   :cities (city-model/allCities)}))

 ;(defn datamin []
-;  (render-template "datamin" {:cars (cars-model/allCars)}))+;  (render-template "datamin" {:cars (cars-model/allCars)}))


4clojure:: impl a func that finds the first x prime nums

--- src/clojure_learning/4clojure-exercises.clj
+++ src/clojure_learning/4clojure-exercises.clj
@@ -2245,3 +2245,35 @@
 (empty? (filter false? [true false])) ;; same as using filter + empty
 ((comp empty? (partial filter false?)) [true false]) ;; false -> using func composition and partial application
 ((comp empty? (partial filter false?)) [true true]) ;; true
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Prime Numbers
+;; Difficulty:	Medium
+;; Topics:	primes
+;; Write a function which returns the first x number of prime numbers.
+;; (= (__ 2) [2 3])
+;; (= (__ 5) [2 3 5 7 11])
+(take 5 (range)) ; (0 1 2 3 4)
+(filter #(zero? (rem 5 %)) (range 2 5)) ;; (5)
+
+(defn prime-nums
+  [bound]
+  (letfn [(prime? [x]
+            (empty? (filter #(zero? (rem x %)) (range 2 x))))]
+    (filter prime? (range 2 bound))))
+
+;; demo:
+(prime-nums 15) ;; (2 3 5 7 11 13)
+
+;; well we should change the impl to return the actually prime-nums primes? x n
+(defn first-x-prime-nums
+  [bound]
+  (letfn [(prime? [x]
+            (empty? (filter #(zero? (rem x %)) (range 2 x))))]
+    (take bound (nnext (filter prime? (range))))))
+
+(first-x-prime-nums 5) ;; (2 3 5 7 11)
+(first-x-prime-nums 2) ;; (2 3)
+
+;; work:
+(filter prime? (nnext (range))) ;; (2 3 5 ... lazyseq to infinite)


Sort Private Workbooks by Name

Sort Private Workbooks by Name

--- src/lens/api.clj
+++ src/lens/api.clj
@@ -1,5 +1,6 @@
 (ns lens.api
   (:require [clojure.core.reducers :as r]
+            [clojure.string :as str]
             [datomic.api :as d]
             [lens.util :refer [uuid? entity?]]
             [lens.util :as util])
@@ -46,9 +47,12 @@
   (->> (:query-cell/_col query)
        (sort-by :query-cell/rank)))

-(defn private-workbooks [user]
+(defn private-workbooks
+  "Returns all private worksbooks of the user worted by name"
+  [user]
   {:pre [(:user/id user)]}
-  (:user/private-workbooks user))
+  (->> (:user/private-workbooks user)
+       (sort-by (comp str/lower-case :workbook/name))))

 ;; ---- Creations -------------------------------------------------------------


remove old TODO

remove old TODO

--- src/babel/forest.cljc
+++ src/babel/forest.cljc
@@ -71,7 +71,6 @@
                   (add-complements-to-bolts [:head :comp])
                   (add-complements-to-bolts [:comp]))))))

-;; TODO: add usage of rule-to-lexicon cache (rather than using lexicon directly)
 (defn lightning-bolt [grammar lexicon spec depth index morph]
   "Returns a lazy-sequence of all possible trees given a spec, where
 there is only one child for each parent, and that single child is the


Decide whether to load swank at runtime, to work around a bug in Heroku not liking us starting up swank

--- src/circleci/init.clj
+++ src/circleci/init.clj
@@ -14,7 +14,10 @@
   (delay
    (try
      (circleci.logging/init)
-     ;; (circleci.swank/init)
+     ;; workaround for Heroku not liking us starting up swank
+     (when (System/getenv "SWANK")
+       (require 'circleci.swank)
+       (.invoke (ns-resolve 'circleci.swank 'init)))
      (circleci.db/init)
      (circleci.db.migrations/init)
      (circleci.web/init)


change login info to be remembered in sessionStorage instead of localStorage, so we can simulate different users using different tabs

--- src/client/login.cljs
+++ src/client/login.cljs
@@ -31,22 +31,22 @@
 (defn get-username
   "Gets the currently stored username."
   []
-  (if-let [username (aget js/localStorage "username")]
+  (if-let [username (aget js/sessionStorage "username")]
     username
     ""))

 (defn get-color
   "Gets the currently stored user color."
   []
-  (if-let [color (aget js/localStorage "color")]
+  (if-let [color (aget js/sessionStorage "color")]
     color
     0))

 (defn store-login!
   "Stores the given username and a random color(0-6)"
   [username]
-  (aset js/localStorage "username" username)
-  (aset js/localStorage "color" (rand-int 7)))
+  (aset js/sessionStorage "username" username)
+  (aset js/sessionStorage "color" (rand-int 7)))

 (defn send-login!
   "Send the login information to the server."


* src/clj/cljs/core.clj: fix ctor calls in core.clj macros file

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -604,14 +604,14 @@
          (cljs.core/type_satisfies_ ~psym ~xsym)))))

 (defmacro lazy-seq [& body]
-  `(new cljs.core.LazySeq nil false (fn [] ~@body)))
+  `(new cljs.core/LazySeq nil false (fn [] ~@body) nil))

 (defmacro delay [& body]
   "Takes a body of expressions and yields a Delay object that will
   invoke the body only the first time it is forced (with force or deref/@), and
   will cache the result and return it on all subsequent force
   calls."
-  `(new cljs.core.Delay (atom {:done false, :value nil}) (fn [] ~@body)))
+  `(new cljs.core/Delay (atom {:done false, :value nil}) (fn [] ~@body)))

 (defmacro binding
   "binding => var-symbol init-expr
@@ -957,13 +957,13 @@
                method-cache# (atom {})
                cached-hierarchy# (atom {})
                hierarchy# (get ~options :hierarchy cljs.core/global-hierarchy)]
-           (cljs.core.MultiFn. ~(name mm-name) ~dispatch-fn ~default hierarchy#
+           (cljs.core/MultiFn. ~(name mm-name) ~dispatch-fn ~default hierarchy#
                                method-table# prefer-table# method-cache# cached-hierarchy#))))))

 (defmacro defmethod
   "Creates and installs a new method of multimethod associated with dispatch-value. "
   [multifn dispatch-val & fn-tail]
-  `(-add-method ~(with-meta multifn {:tag 'cljs.core.MultiFn}) ~dispatch-val (fn ~@fn-tail)))
+  `(-add-method ~(with-meta multifn {:tag 'cljs.core/MultiFn}) ~dispatch-val (fn ~@fn-tail)))

 (defmacro time
   "Evaluates expr and prints the time it took. Returns the value of expr."


added support for http-proxy

added support for http-proxy

--- src/clj_http/core.clj
+++ src/clj_http/core.clj
@@ -1,11 +1,12 @@
 (ns clj-http.core
   "Core HTTP request/response implementation."
-  (:import (org.apache.http HttpRequest HttpEntityEnclosingRequest HttpResponse Header))
+  (:import (org.apache.http HttpRequest HttpEntityEnclosingRequest HttpResponse Header HttpHost))
   (:import (org.apache.http.util EntityUtils))
   (:import (org.apache.http.entity ByteArrayEntity))
   (:import (org.apache.http.client.methods HttpGet HttpHead HttpPut HttpPost HttpDelete))
   (:import (org.apache.http.client.params CookiePolicy ClientPNames))
-  (:import (org.apache.http.impl.client DefaultHttpClient)))
+  (:import (org.apache.http.impl.client DefaultHttpClient))
+  (:import (org.apache.http.conn.params ConnRoutePNames)))

 (defn- parse-headers [#^HttpResponse http-resp]
   (into {} (map (fn [#^Header h] [(.toLowerCase (.getName h)) (.getValue h)])
@@ -24,6 +25,12 @@
       (-> http-client
         (.getParams)
         (.setParameter ClientPNames/COOKIE_POLICY CookiePolicy/BROWSER_COMPATIBILITY))
+      (if (nil? (#{"localhost" "127.0.0.1"} server-name))
+        (if-let [proxy-host (System/getProperty (str scheme ".proxyHost"))]
+          (let [proxy-port (Integer/parseInt (System/getProperty (str scheme ".proxyPort")))]
+            (-> http-client
+              (.getParams)
+              (.setParameter ConnRoutePNames/DEFAULT_PROXY (HttpHost. proxy-host proxy-port))))))
       (let [http-url (str scheme "://" server-name
                           (if server-port (str ":" server-port))
                           uri


Fix issue where `boolean?` was used for older clojure versions

--- src/clj_http/core.clj
+++ src/clj_http/core.clj
@@ -262,7 +262,7 @@
                     revalidation-queue-size
                     shared-cache
                     weak-etag-on-put-delete-allowed]} cc]
-        (when (boolean? allow-303-caching)
+        (when (instance? Boolean allow-303-caching)
           (.setAllow303Caching config allow-303-caching))
         (when asynchronous-worker-idle-lifetime-secs
           (.setAsynchronousWorkerIdleLifetimeSecs
@@ -271,7 +271,7 @@
           (.setAsynchronousWorkersCore config asynchronous-workers-core))
         (when asynchronous-workers-max
           (.setAsynchronousWorkersMax config asynchronous-workers-max))
-        (when (boolean? heuristic-caching-enabled)
+        (when (instance? Boolean heuristic-caching-enabled)
           (.setHeuristicCachingEnabled config heuristic-caching-enabled))
         (when heuristic-coefficient
           (.setHeuristicCoefficient config heuristic-coefficient))
@@ -291,9 +291,9 @@
         ;;    config never-cache-http10-responses-with-query-string))
         (when revalidation-queue-size
           (.setRevalidationQueueSize config revalidation-queue-size))
-        (when (boolean? shared-cache)
+        (when (instance? Boolean shared-cache)
           (.setSharedCache config shared-cache))
-        (when (boolean? weak-etag-on-put-delete-allowed)
+        (when (instance? Boolean weak-etag-on-put-delete-allowed)
           (.setWeakETagOnPutDeleteAllowed config weak-etag-on-put-delete-allowed))
         (.build config)))))


Use a modern API for an unsigned conversion

--- src/cljam/io/util.clj
+++ src/cljam/io/util.clj
@@ -176,7 +176,7 @@
         i (-> (ByteBuffer/wrap ba)
               (.order ByteOrder/LITTLE_ENDIAN)
               (.getInt)
-              (bit-and 0xffffffff))]
+              (Integer/toUnsignedLong))]
     (case i
       0x888ffc26 :bigwig
       (0x1A412743 0x4327411A) :2bit


Fixup comment.

Fixup comment.

--- src/cljs/c2/core.cljs
+++ src/cljs/c2/core.cljs
@@ -118,7 +118,4 @@
               (append! container $new-node))))))

     ;;Run post-fn, if it was given
-    (when post-fn
-      ;;Give the browser 10 ms to get its shit together, if the post-fn involves advanced layout.
-      ;;Without this delay, CSS3 animations sometimes don't happen.
-      (request-animation-frame #(post-fn data)))))
+    (when post-fn (request-animation-frame #(post-fn data)))))


REPL output history

REPL output history


Travis: try test.check alpha1

Travis: try test.check alpha1

--- build.boot
+++ build.boot
@@ -5,7 +5,7 @@
                     [moxaj/macrowbar             "0.1.2"]

                     ;; test
-                    [org.clojure/test.check      "0.10.0-alpha2" :scope "test"]
+                    [org.clojure/test.check      "0.10.0-alpha1" :scope "test"]

                     ;; script
                     [adzerk/boot-test            "1.2.0"  :scope "test"]


add deploy task

add deploy task

--- build.boot
+++ build.boot
@@ -22,7 +22,7 @@
     :bucket "blog.hashobject.com"
     :access-key (System/getenv "AWS_ACCESS_KEY")
     :secret-key (System/getenv "AWS_SECRET_KEY")
-    :source "/app/target/public"
+    :source "target/public"
     :options {"Cache-Control" "max-age=315360000, no-transform, public"}})

 (deftask build-dev
@@ -42,11 +42,12 @@
   (comp (build-dev)
         (sitemap :filename "sitemap.xml")
         (rss :title "Hashobject" :description "Hashobject blog" :link "http://blog.hashobject.com")
-        (gzip :regex [#".html$" #".css$" #".js$"])
-        (show :fileset true)
-        (show :env true)
-        (show :classpath true)
-        (s3-sync)))
+        (gzip :regex [#".html$" #".css$" #".js$"])))
+
+(deftask deploy
+  "Deploy to S3"
+  []
+  (s3-sync))

 (deftask dev
   []


Both Korma and Lobos want JDBC, so need to lock that down

--- build.boot
+++ build.boot
@@ -16,8 +16,9 @@
                  [org.clojure/tools.namespace "0.2.10"]
                  [org.danielsz/system "0.1.9" :exclusions [org.clojure/tools.namespace]]
                  [environ "1.0.0"]
-                 [lobos "1.0.0-beta3"]
+                 [lobos "1.0.0-beta3" :exclude [org.clojure/java.jdbc]]
                  [org.xerial/sqlite-jdbc "3.8.11.2"]
+                 [org.clojure/java.jdbc "0.3.7"]
                  [korma "0.4.2"]

                  [http-kit "2.1.18"]


Start 2.5.4-SNAPSHOT

Start 2.5.4-SNAPSHOT

--- build.boot
+++ build.boot
@@ -29,7 +29,7 @@
 (task-options!
   sift {:include #{#"\.jar$"}}
   pom {:project 'nightcode
-       :version "2.5.3"
+       :version "2.5.4-SNAPSHOT"
        :description "An IDE for Clojure"
        :url "https://github.com/oakes/Nightcode"
        :license {"Public Domain" "http://unlicense.org/UNLICENSE"}}


Organize deps

Organize deps

--- build.boot
+++ build.boot
@@ -2,40 +2,44 @@
  :source-paths #{"src/clj" "src/js" "src/scss" "test/clj" "site"}
  :resource-paths #{"assets"}
  :dependencies
- '[[adzerk/boot-cljs "1.7.228-2" :scope "test"]
+ '[;; Dev
+   [adzerk/boot-cljs "1.7.228-2" :scope "test"]
    [adzerk/boot-cljs-repl "0.3.3" :scope "test"]
    [adzerk/boot-reload "0.4.13" :scope "test"]
    [binaryage/devtools "0.8.3" :scope "test"]
    [boot-codox "0.10.1" :scope "test"]
+   [com.cemerick/piggieback "0.2.1" :scope "test"]
+   [crisptrutski/boot-cljs-test "0.2.2" :scope "test"]
+   [deraen/boot-sass "0.3.0" :scope "test"]
+   [devcards "0.2.2" :scope "test"]
+   [org.clojure/tools.nrepl "0.2.12" :scope "test"]
+   [org.martinklepsch/boot-gzip "0.1.2" :scope "test"]
+   [org.slf4j/slf4j-nop "1.7.21" :scope "test"]
+   [pandeiro/boot-http "0.7.6" :scope "test"]
+   [perun "0.3.0" :scope "test"]
+   [weasel "0.7.0" :scope "test"]
+
+   ;; App
    [cljsjs/clipboard "1.5.9-0"]
    [cljsjs/react "15.3.1-0"]
    [cljsjs/react-bootstrap "0.30.6-0"]
    [cljsjs/react-dom "15.3.1-0"]
    [cljsjs/react-dom-server "15.3.1-0"]
-   [com.cemerick/piggieback "0.2.1" :scope "test"]
    [com.cognitect/transit-cljs "0.8.239"]
+   [com.gfredericks/test.chuck "0.2.7"]
    [com.stuartsierra/component "0.3.1"]
    [com.taoensso/timbre "4.7.4"]
-   [crisptrutski/boot-cljs-test "0.2.2" :scope "test"]
    [danielsz/boot-autoprefixer "0.0.9"]
    [datascript "0.15.4"]
-   [deraen/boot-sass "0.3.0" :scope "test"]
-   [devcards "0.2.2" :scope "test"]
    [hiccup "1.0.5"]
    [org.clojure/clojure "1.9.0-alpha14"]
    [org.clojure/clojurescript "1.9.293"]
    [org.clojure/core.async "0.2.395"]
    [org.clojure/test.check "0.9.0"]
-   [org.clojure/tools.nrepl "0.2.12" :scope "test"]
-   [org.martinklepsch/boot-gzip "0.1.2" :scope "test"]
-   [org.slf4j/slf4j-nop "1.7.21" :scope "test"]
    [org.webjars/bootstrap-sass "3.3.7"]
    [org.webjars/font-awesome "4.7.0"]
-   [pandeiro/boot-http "0.7.6" :scope "test"]
-   [perun "0.3.0" :scope "test"]
    [posh "0.5.5"]
-   [reagent "0.6.0"]
-   [weasel "0.7.0" :scope "test"]])
+   [reagent "0.6.0"]])

 (require
  '[adzerk.boot-cljs :refer :all]


update boot-sass to latest patch version, 0.2.1

--- build.boot
+++ build.boot
@@ -17,7 +17,7 @@
    [adzerk/boot-cljs-repl "0.3.2" :scope "test"]
    [adzerk/boot-reload "0.4.11" :scope "test"]
    [weasel "0.7.0" :scope "test"] ;; Websocket Server
-   [deraen/boot-sass "0.2.0" :scope "test"]
+   [deraen/boot-sass "0.2.1" :scope "test"]
    [reloaded.repl "0.2.1" :scope "test"]

    [org.clojure/clojure "1.8.0"]


Add dependency on DataScript

Add dependency on DataScript

--- build.boot
+++ build.boot
@@ -21,7 +21,9 @@
                  [org.clojure/data.json "0.2.6"]

                  ;; Development dependencies
-                 [devcards "0.2.1-7"]])
+                 [devcards "0.2.1-7"]
+                 [datascript "0.15.2"]])
+

 (require '[adzerk.boot-cljs :refer [cljs]]
          '[adzerk.boot-reload :refer [reload]]


Add exponential base to maths namespace.

--- src/cljx/c2/maths.cljx
+++ src/cljx/c2/maths.cljx
@@ -5,8 +5,9 @@
          (:use-macros [c2.util :only [combine-with]]))

-(def Pi 3.141592653589793)
+(def Pi Math/PI)
 (def Tau (* 2 Pi))
+(def e Math/E)
 (def radians-per-degree (/ Pi 180))
 (defn rad [x] (* radians-per-degree x))


Fix missing styles on elements with registered tags

--- src/freactive/dom.cljs
+++ src/freactive/dom.cljs
@@ -454,7 +454,7 @@
         (set! node elem)
         (set! (.-freactive-state node) this)
         (set! attr-binder (bind-attrs! node attrs))
-        (aset elem "cereus/child-dom" child-dom)
+        (aset elem "cereus/child-dom" (if (map? (first child-dom)) (rest child-dom) child-dom))
         (doseq [child children]
           (ui/velem-insert child this nil)))))
   (onAttached [this]
@@ -580,6 +580,7 @@
 (defn element*
   ([elem-factory append-children-fn]
    (fn [ns-uri tag tail]
+     (println "element" tag tail)
      (let [[_ tag-name id class] (re-matches re-tag (name tag))
            attrs? (first tail)
            have-attrs (map? attrs?)
@@ -661,8 +662,7 @@
         (= true head)
         (let [elem-spec (rest elem-spec)
               tag-name (first elem-spec)
-              tail (rest elem-spec)
-              tail (if (map? tail) (rest tail) tail)]
+              tail (rest elem-spec)]
           (child-dom-element nil tag-name tail))

         :default


made beep less obnoxious

made beep less obnoxious

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -296,4 +296,4 @@
   (fn []
     (.createSound js/soundManager #js {
       :id "join-sound"
-      :url "http://www.soundjay.com/button/beep-01a.mp3"})))
+      :url "http://www.soundjay.com/button/beep-03.mp3"})))


Patch in haste, repent at leisure.

Patch in haste, repent at leisure.

--- src/kixi/hecuba/data/entities.clj
+++ src/kixi/hecuba/data/entities.clj
@@ -91,8 +91,8 @@
         (try
           (json/parse-string (:property_data entity) keyword)
           (catch Throwable t
-            (log/errorf t "Could not parse property_data %s for entity %s" (:property_data entity) entity)))
-             {})
+            (log/errorf t "Could not parse property_data %s for entity %s" (:property_data entity) entity)
+            {})))
       (decode-tech-icons)))

 (defn decode [entity]


Change styling

Change styling

Looks a lot nicer now!

--- src/graphito/core.cljs
+++ src/graphito/core.cljs
@@ -47,7 +47,7 @@
       (.append "rect")
       (.attr "width" width)
       (.attr "height" height)
-      (.attr "fill" "#ccc")
+      (.attr "fill" "#EDF0F2")
       (.attr "stroke" 0)))

 (defn setup-svg! [selector width height]
@@ -153,8 +153,8 @@
         .enter
         (.append "line")
         (.attr "class" "link")
-        (.style "stroke" "black")
-        (.style "stroke-width" 1)
+        (.style "stroke" "#C9CBCB")
+        (.style "stroke-width" 3)
         (.attr "x1" #(-> % :source positions :x))
         (.attr "y1" #(-> % :source positions :y))
         (.attr "x2" #(-> % :target positions :x))
@@ -167,6 +167,7 @@
         .enter
         (.append "circle")
         (.attr "class" "node")
+        (.style "fill" "#777A7A")
         (.attr "cx" (fn [d i] (:x (positions i))))
         (.attr "cy" (fn [d i] (:y (positions i))))
         (.attr "r" (fn [d i] (project-radius (distances-from-camera i)))))))


Some code structure for representing state

--- src/graphito/core.cljs
+++ src/graphito/core.cljs
@@ -9,24 +9,59 @@
 (def $ js/$)
 (def Raphael js/Raphael)

-(defn disable-touchmove [$element]
+;; Paper setup
+
+(defn disable-touchmove! [$element]
   (.on $element "touchmove" #(.preventDefault %)))

-(defn add-background [paper width height]
+(defn add-background! [paper width height]
   (let [rect (.rect paper 0 0 width height)]
     (.attr rect (js-obj "fill" "270-#ccc-#888"
                         "stroke" 0))))

-(defn setup-paper [$container]
-  (disable-touchmove $container)
-  (let [width (.width $container)
-        height (.height $container)
-        containerElem (.get $container 0)
+(defn setup-paper! [$container width height]
+  (disable-touchmove! $container)
+  (let [containerElem (.get $container 0)
         paper (Raphael containerElem width height)]
-    (add-background paper width height)
+    (add-background! paper width height)
     paper))
+
+;; State management
+
+(defn initial-state [paper width height]
+  {:paper paper
+   :view-width width
+   :view-height height
+   :camera-x 0
+   :camera-y 0
+   :nodes []})
+
+(defn create-node-element!
+  "Adds a new node element to the paper and returns it."
+  [paper]
+  (let [elem (.circle paper 20 20 10)]
+    (.attr elem (js-obj "fill" "blue"
+                        "stroke" "gray"
+                        "stroke-width" 2))
+    elem))
+
+(defn add-node!
+  "Adds a new node element to the paper and returns an updated state which
+  references this element."
+  [state title x y]
+  (let [elem (create-node-element! (:paper state))
+        new-node {:title title
+                  :x x
+                  :y y
+                  :element elem}]
+    (update state :nodes conj new-node)))
+
+;; Exported function to do magic

 (defn ^:export inhabit [selector]
   (let [$container ($ selector)
-        paper (setup-paper $container)]
-    nil))
+        width (.width $container)
+        height (.height $container)
+        paper (setup-paper! $container width height)
+        state (initial-state paper width height)]
+    (add-node! state "Hello Node" 0 0)))


Fix db schema

Fix db schema

--- src/clj/cglossa/models/schema.clj
+++ src/clj/cglossa/models/schema.clj
@@ -9,23 +9,23 @@
            (fields
              [name :string]
              [short-name :string :unique-identity]
-             [metadata-categories :ref :many :component :index]))
+             [metadata-categories :ref :many :component :indexed]))

    (schema metadata-category
            (fields
-             [short-name :string :index]
+             [short-name :string :indexed]
              [name :string]
              [widget-type :enum [:list :range]]
-             [values :ref :many :index]))
+             [values :ref :many :indexed]))

    (schema metadata-value
            (fields
              ; connect the metadata value to one or more text IDs (i.e.
              ; metadata values in the 'tid' category)
-             [tids :ref :many :index]
-             [text-value :string :index]
-             [numeric-value :long :index]
-             [bool-value :boolean :index]))
+             [tids :ref :many :indexed]
+             [text-value :string :indexed]
+             [numeric-value :long :indexed]
+             [bool-value :boolean :indexed]))

    (schema search
            (fields


eliminate compiler performance warning regarding case

--- src/clj/com/rpl/specter/impl.cljx
+++ src/clj/com/rpl/specter/impl.cljx
@@ -544,7 +544,8 @@
       (assoc v 0 (afn val))
       ))
   (update-last [v afn]
-    (let [c (vec-count v)]
+    ;; type-hinting vec-count to ^int caused weird errors with case
+    (let [c (int (vec-count v))]
       (case c
         1 (let [[e] v] [(afn e)])
         2 (let [[e1 e2] v] [e1 (afn e2)])


fix Exile to work on Corp turn too

fix Exile to work on Corp turn too

--- src/clj/game/cards-identities.clj
+++ src/clj/game/cards-identities.clj
@@ -47,11 +47,8 @@
    "Exile: Streethawk"
    {:effect (effect (gain :link 1))
     :events {:runner-install {:req (req (and (has? target :type "Program")
-                                             (= (:active-player @state) :runner)
-                                             ;; only trigger when played a programm from heap
                                              (some #{:discard} (:previous-zone target))))
                               :msg (msg "draw a card") :effect (effect (draw 1))}}}
-

    "Gabriel Santiago: Consummate Professional"
    {:events {:successful-run {:msg "gain 2 [Credits]" :once :per-turn


Add a good hint to the repository type error message.

This message typically comes from executing in the wrong directory,
so point any humans reading it toward that as the first thing to
check for.

--- src/clj/runbld/vcs/middleware.clj
+++ src/clj/runbld/vcs/middleware.clj
@@ -32,7 +32,8 @@

       :else
       (let [msg (str source-dir ": unknown repository type "
-                     "(only know about git and svn currently)")
+                     "(only know about git and svn currently). "
+                     "Most common cause: run from the wrong directory.")
             f (io/file source-dir)
             exists? (.exists f)]
         (debug/log msg


extract data preparation functions

extract data preparation functions

--- src/clj_money/models/accounts.clj
+++ src/clj_money/models/accounts.clj
@@ -4,12 +4,27 @@
             [honeysql.core :as sql]
             [honeysql.helpers :as h]))

+(defn prepare-accounts-for-save
+  "Adjusts account data for saving in the database"
+  [accounts]
+  ; convert account type from keyword to string
+  (map #(update-in % [:type] name)
+       accounts))
+
 (defn create
   "Creates a new account in the system"
   [data-store account]
-  (let [sql (sql/format (-> (h/insert-into :accounts)
-                            (h/values [(update-in account [:type] name)])))]
+  (let [values (prepare-accounts-for-save [account])
+        sql (sql/format (-> (h/insert-into :accounts)
+                            (h/values values)))]
     (jdbc/execute! data-store sql)))
+
+(defn prepare-account-data-from-db
+  "Adjusts account data read from the database for use"
+  [accounts]
+  ; change account type to a keyword
+  (map #(update-in % [:type] keyword)
+       accounts))

 (defn select
   "Returns a list of all accounts in the system"
@@ -17,4 +32,4 @@
   (let [sql (sql/format (-> (h/select :*)
                             (h/from :accounts)))]
     (->> (jdbc/query data-store sql)
-         (map #(update-in % [:type] keyword)))))
+         (prepare-account-data-from-db))))


* src/cljs/clojure/browser/dom.cljs: Vector -> PersistentVector

--- src/cljs/clojure/browser/dom.cljs
+++ src/cljs/clojure/browser/dom.cljs
@@ -62,10 +62,10 @@
            (gdom/createDom (name this)
                            str-attrs)))))

-  Vector
+  PersistentVector
   (-element
     [this]
-    (log "Vector (-element " this ")")
+    (log "PersistentVector (-element " this ")")
     (let [tag      (first this)
           attrs    (second this)
           children (drop 2 this)]


small fix

small fix

--- src/cljs/salava/page/ui/edit.cljs
+++ src/cljs/salava/page/ui/edit.cljs
@@ -318,7 +318,7 @@

 (defn profile-block [block-atom]
   (let [block (first (plugin-fun (session/get :plugins) "block" "userprofileinfo"))]
-    (if block [block] [:div ""])))
+    (if block [block nil] [:div ""])))

 (defn contenttype [{:keys [block-atom index]}]
   (let [block-type-map (if (some #(= "profile" (:type %)) @block-atom)


fix buttons

fix buttons

--- src/cljs/salava/page/ui/view.cljs
+++ src/cljs/salava/page/ui/view.cljs
@@ -118,17 +118,14 @@
        [:div {:id "page-buttons-share"}
         [:div {:id "buttons"
                :class "text-right"}
-         [:a {:class "btn btn-primary edit-btn"
-              :href  (path-for (str "/profile/page/edit/" (:id page)))}
-          (t :page/Edit)]
-         [:button {:class "btn btn-primary print-btn"
-                   :on-click #(.print js/window)}
-          (t :core/Print)]
+         [:a.btn.btn-primary {:href (path-for (str "/profile/page/edit/" (:id page))) :style {:text-decoration "none"}}
+          [:i.fa.fa-pencil-square-o.fa-fw.fa-lg](t :page/Edit)]
+         [:a.btn.btn-primary {:href "#" :on-click #(.print js/window) :style {:text-decoration "none"}} [:i.fa.fa-print.fa-fw.fa-lg](t :core/Print)]
          [:button {:class "btn btn-primary"
                    :on-click #(do (.preventDefault %)
                                   (swap! state assoc :pdf-header "false")
                                   (m/modal![export-to-pdf-modal state] {:size :lg}))}
-          (t :badge/Exporttopdf)]]
+          [:i.fa.fa-file-pdf-o.fa-fw.fa-lg] (t :badge/Exporttopdf)]]
         (if-not (private?)
           [:div {:class (str "checkbox " @visibility-atom)}
            [:label


Fix incognito read handlers.

Fix incognito read handlers.

--- src/incognito/fressian.cljs
+++ src/incognito/fressian.cljs
@@ -12,10 +12,10 @@
   [write-handlers]
   (fn [w rec]
     (let [{:keys [tag] :as r} (if (isa? (type rec) incognito.base.IncognitoTaggedLiteral)
-                          (into {} rec)
-                          (incognito-writer @write-handlers rec))]
+                                (into {} rec)
+                                (incognito-writer @write-handlers rec))]
       (write-tag w "record" 2)
-      (write-object w (str tag))
+      (write-object w tag)
       (write-tag w "map" 1)
       (beginClosedList w)
       (doseq [[field value] r]
@@ -30,7 +30,7 @@
     (let [tag   (read-object rdr)
           value (read-object rdr)]
       (incognito-reader @read-handlers
-                        {:tag tag :value val}))))
+                        {:tag tag :value (:value value)}))))

 (defn- plist-reader [reader _ _]
   (let [len (readInt reader)]
@@ -70,26 +70,18 @@
 (defn incognito-write-handlers [write-handlers]
   {cljs.core/List             plist-writer
    cljs.core/EmptyList        plist-writer
-   "record"                   (record-writer write-handlers) ;; conversion to pk lib ;:record->name {SomeRecord "SomeRec"
+   "record"                   (record-writer write-handlers)
    cljs.core/LazySeq          plist-writer
    cljs.core/PersistentVector pvec-writer})

 (comment

   (do
-    (prn "---->>> Start Test <<<<------")
-    (defrecord SomeRecord [f1 f2]) ; map->SomeRecord is now implicitly def3ned
-    (def rec (SomeRecord. "field1" "field2"))
-    (def buf (fress.api/byte-stream))
-    (def writer (fress.api/create-writer buf :handlers
-                                         (incognito-write-handlers (atom {'incognito.fressian.SomeRecord (fn [foo] (println "foos") (assoc foo :c "donkey"))})) ))
+   (defrecord SomeRecord [f1 f2])
+   (def rec (SomeRecord.  [1 2 2] {:c "213"}))
+   (def buf (fress.api/byte-stream))
+   (def writer (fress.api/create-writer buf :handlers (incognito-write-handlers (atom {'incognito.fressian.SomeRecord (fn [foo] (println "foos") (assoc foo :c "donkey"))}))))
+   (fress.api/write-object writer rec)
+   (fress.api/read buf :handlers (incognito-read-handlers (atom {}))))

-    (prn "write object------------")
-    (w/writeObject writer rec)
-    (prn "read object------------")
-    (prn (fress.api/read buf :handlers (incognito-read-handlers (atom {}))))
-    (prn "---->>> End Test <<<<------"))
-
-
-
-)
+  )


adjusted migration

adjusted migration

--- src/kmc_booking/db.clj
+++ src/kmc_booking/db.clj
@@ -120,7 +120,7 @@
 (defn create-booking [name phone seats]
 	(let [booking-id (gen-id)
 		  records (for [rows (range 3 4)
-                 	  cols (range 1 40)]
+                 	  cols (range 4 37)]
                       {:id (str rows "-" cols)
                        :status "paid"
                        :booking_id booking-id})]


Working basic deep comment thing

Working basic deep comment thing

--- src/langnostic/comments.clj
+++ src/langnostic/comments.clj
@@ -23,10 +23,10 @@
      (let [target (conj comment-path :replies)
            new-ix (count (db/get-at tx (concat [:posts post-id :comments] target)))
            path (conj target new-ix)]
-       (-> tx
-           (db/update-at
-            (concat [:posts post-id :comments] target)
-            #(conj % {:user user :path path :content content :replies []})))))))
+       (db/update-at
+        tx [:posts post-id :comments]
+        (fn [comments]
+          (update-in comments target #(conj % {:user user :path path :content content :replies []}))))))))

 (defn edit-comment!
   [user comment-path new-content]


Return full URL for ZeroMQ socket

Return full URL for ZeroMQ socket

--- src/lazubot/docker.clj
+++ src/lazubot/docker.clj
@@ -28,9 +28,10 @@
 (defn container-address
   "Return the IP address of a container by its ID."
   [container-id]
-  (get-in (client/get (docker-uri "containers/" container-id "/json")
-                      {:as :json})
-          [:body :NetworkSettings :IPAddress]))
+  (let [ip (get-in (client/get (docker-uri "containers/" container-id "/json")
+                               {:as :json})
+                   [:body :NetworkSettings :IPAddress])]
+    (str "http://" ip ":" (:expose-port config))))

 (defn register-worker!
   "Add a worker doc to the workers ref."


levels on inputs

levels on inputs

--- src/lights/my_show.clj
+++ src/lights/my_show.clj
@@ -203,7 +203,7 @@
   (if (= interface "uno")
     (do
       (show/add-midi-control-to-var-mapping
-        "USB Uno MIDI Interface" 9 0 :audio-drums :max 50)
+        "USB Uno MIDI Interface" 9 0 :audio-drums :min -10 :max 50)

       (show/add-midi-control-to-var-mapping
         "USB Uno MIDI Interface" 9 1 :audio-bass :max 50)
@@ -212,7 +212,7 @@
         "USB Uno MIDI Interface" 9 2 :audio-solo :max 50)

       (show/add-midi-control-to-var-mapping
-        "USB Uno MIDI Interface" 9 3 :audio-voice :max 50)
+        "USB Uno MIDI Interface" 9 3 :audio-voice :min -120 :max 50)

       (show/add-midi-control-to-var-mapping
         "USB Uno MIDI Interface" 9 4 :audio-percussion :max 50)


dimmers cues

dimmers cues

--- src/lights/my_show.clj
+++ src/lights/my_show.clj
@@ -249,6 +249,8 @@
       (show/add-midi-control-to-cue-mapping "Automap MIDI" 10 :control 58 7 7)

       ; Defaults
+      (afterglow.show/set-variable! :sparkle-chance 0.1)
+      (afterglow.show/set-variable! :sparkle-fade 100)
       (afterglow.show/set-variable! :lightness-min-general 0)
       (afterglow.show/set-variable! :lightness-max-front 50)
       (afterglow.show/set-variable! :lightness-max-back 50)
@@ -382,6 +384,9 @@
 )

 (shutter-open)
+
+; Shut down heads temporary
+(show/add-effect! :dimmers (afterglow.effects.dimmer/dimmer-effect 0 (show/fixtures-named "head")))

 (defn calibrate-heads
   "Helper functions to calibrate heads"
@@ -451,6 +456,22 @@
       (fn [_] (afterglow.rhythm/metro-start (:metronome *show*) 1)
               (afterglow.effects/blank))
         :held true))
+
+  (ct/set-cue! (:cue-grid *show*) 0 6
+    (cues/cue :dimmers (fn [_] (dimmer-effect 255 (show/all-fixtures)))
+        :short-name "All dimmers up"
+        ))
+
+  (ct/set-cue! (:cue-grid *show*) 1 6
+    (cues/cue :dimmers (fn [_] (dimmer-effect 0 (show/all-fixtures)))
+        :short-name "All dimmers down"
+        ))
+
+  (ct/set-cue! (:cue-grid *show*) 2 6
+    (cues/cue :dimmers (fn [_] (dimmer-effect 0 (show/fixtures-named "head")))
+        :short-name "Heads down"
+        ))
+

   (ct/set-cue! (:cue-grid *show*) 0 3
     (cues/cue :color  (fn [_] (afterglow.effects/scene
@@ -495,6 +516,15 @@
       )
     ))))

+  (ct/set-cue! (:cue-grid *show*) 2 1
+    (cues/cue :color  (fn [_] (afterglow.effects/scene
+      "Sine All"
+      (let [light-param (params/build-oscillated-param
+        (oscillators/sine-beat :beat-ratio :osc-beat-ratio :down? true) :min :lightness-min-general :max :audio-drums)]
+        (global-color-effect (params/build-color-param :h :main-hue :s 100 :l light-param))
+      )
+    ))))
+
   (ct/set-cue! (:cue-grid *show*) 0 0
     (cues/cue :set-main-hue (fn [_] (var-fx/variable-effect @var-binder :main-hue 0))
       :short-name "Red"


restructure & remove old code

restructure & remove old code

--- src/lights/my_show.clj
+++ src/lights/my_show.clj
@@ -285,28 +285,6 @@
 (afterglow.show/set-variable! :lightness-max-front-percent 0.2)
 (afterglow.show/set-variable! :use-hue-chase false)

-;(midi-help "automap")
-
-(defn light-sawtooth
-  "Change light according to sawtooth osc"
-  []
-  (let [light-param (params/build-oscillated-param
-    (oscillators/sawtooth-beat :beat-ratio :osc-beat-ratio :down? true) :max :max-lightness)]
-    (show/add-effect! :color (global-color-effect
-      (params/build-color-param :h :main-hue :s 100 :l light-param)))
-  )
-)
-
-(defn light-sine
-  "Change light according to sine osc"
-  []
-  (let [light-param (params/build-oscillated-param
-    (oscillators/sine-beat :beat-ratio :osc-beat-ratio :down? true :phase 0.5) :max :max-lightness)]
-    (show/add-effect! :color (global-color-effect
-      (params/build-color-param :h :main-hue :s 100 :l light-param)))
-  )
-)
-
 (defn light-sawtooth-phase
   "Change light of fixtures with phase shift. WIP."
   []
@@ -350,8 +328,6 @@
       (params/build-color-param :h :main-hue :s 100 :l param)))
   )
 )
-
-(fiat-lux)

 (defn shutter-open
   "Open shutters on heads in London show"
@@ -399,6 +375,8 @@
   )

 ;(london-init)
+
+(fiat-lux)

 (defn head-aim-center
   "Direct head to the center of dancefloor"


Added support for JSON serialization of soft reference cache data.

--- src/cmr/opendap/http/response.clj
+++ src/cmr/opendap/http/response.clj
@@ -6,6 +6,7 @@
   by single use or composition."
   (:require
    [cheshire.core :as json]
+   [cheshire.generate :as json-gen]
    [clojure.data.xml :as xml]
    [clojure.string :as string]
    [cmr.authz.errors :as authz-errors]
@@ -14,6 +15,8 @@
    [ring.util.http-response :as ring-response]
    [taoensso.timbre :as log]
    [xml-in.core :as xml-in])
+  (:import
+    (java.lang.ref SoftReference))
   (:refer-clojure :exclude [error-handler]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -32,6 +35,26 @@
 (def errors response/errors)
 (def error response/error)
 (def not-allowed response/not-allowed)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;   Utility functions   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn soft-reference->json!
+  "Given a soft reference object and a Cheshire JSON generator, write the
+  data stored in the soft reference to the generator as a JSON string."
+  [soft-ref json-generator]
+  (let [data @(.get soft-ref)
+        data-str (json/generate-string data)]
+    (log/trace "Encoder got data: " data)
+    (.writeString json-generator data-str)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;   Global operations   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; This adds support for JSON-encoding the data cached in a SoftReference.
+(json-gen/add-encoder SoftReference soft-reference->json!)

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;   Custom Response Functions   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -77,6 +100,7 @@

 (defn json
   [_request data]
+  (log/trace "Got data for JSON:" data)
   (-> data
       process-results
       (assoc :body (json/generate-string data))


Add specs to trace

Add specs to trace

--- src/com/wsscode/pathom/trace.cljc
+++ src/com/wsscode/pathom/trace.cljc
@@ -5,7 +5,17 @@
                 :cljs com.wsscode.common.async-cljs)
              :refer [let-chan]]
             [clojure.walk :as walk]
-            [com.wsscode.pathom.misc :as p.misc]))
+            [com.wsscode.pathom.misc :as p.misc]
+            [com.fulcrologic.guardrails.core :refer [>def >defn >fdef => | <- ?]]))
+
+(>def ::event keyword?)
+(>def ::label string?)
+(>def ::direction #{::enter ::leave})
+(>def ::timestamp pos-int?)
+(>def ::relative-timestamp pos-int?)
+(>def ::duration nat-int?)
+(>def ::style "Map with CSS styles to apply in the trace bar." map?)
+(>def ::details (s/coll-of (s/keys)))

 (defn now []
   #?(:clj  (System/currentTimeMillis)


Adding some tests for contexts

Adding some tests for contexts

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

--- src/conexp/tests/fca/contexts.clj
+++ src/conexp/tests/fca/contexts.clj
@@ -206,11 +206,49 @@
   (with-testing-data [ctx testing-data]
     (clarified? (clarify-context ctx))))

-;; down-arrows
-;; up-arrows
-;; up-down-arrows
-;; reduce-clarified-context
-;; reduce-context-{object,attribute}s
+(deftest test-down-arrows
+  (with-testing-data [ctx testing-data]
+    (forall [[g m] (down-arrows ctx)]
+      (and (not (contains? (incidence ctx) [g m]))
+           (forall [h (objects ctx)]
+             (=> (proper-subset? (object-derivation ctx #{g})
+                                 (object-derivation ctx #{h}))
+                 (contains? (incidence ctx) [h m])))))))
+
+(deftest test-up-arrows
+  (with-testing-data [ctx testing-data]
+    (forall [[g m] (up-arrows ctx)]
+      (and (not (contains? (incidence ctx) [g m]))
+           (forall [n (attributes ctx)]
+             (=> (proper-subset? (attribute-derivation ctx #{m})
+                                 (attribute-derivation ctx #{n}))
+                 (contains? (incidence ctx) [g n])))))))
+
+(deftest test-up-down-arrows
+  (with-testing-data [ctx testing-data]
+    (= (up-down-arrows ctx)
+       (intersection (up-arrows ctx)
+                     (down-arrows ctx)))))
+
+(deftest test-reduce-clarified-context
+  (with-testing-data [ctx testing-data]
+    (=> (clarified? ctx)
+        (let [rctx (reduce-clarified-context ctx),
+              arrs (up-down-arrows rctx)]
+          (and (= (objects rctx) (set-of g | [g _] arrs))
+               (= (attributes rctx) (set-of m | [_ m] arrs)))))))
+
+(deftest test-reduce-context-objects
+  (with-testing-data [ctx testing-data]
+    (let [rctx (reduce-context-objects ctx),
+          arrs (down-arrows rctx)]
+      (= (objects rctx) (set-of g | [g _] arrs)))))
+
+(deftest test-reduce-context-attributes
+  (with-testing-data [ctx testing-data]
+    (let [rctx (reduce-context-attributes ctx),
+          arrs (up-arrows rctx)]
+      (= (attributes rctx) (set-of m | [_ m] arrs)))))

 (deftest test-reduced?
   (is (not (reduced? test-ctx-01)))
@@ -308,7 +346,12 @@
        #{1 2 3 282 392 23}
        #{nil 4 * -}))

-;; context-{union,intersection,{comp,ap,sub}position,transitive-closure}
+;; context-union
+;; context-intersection
+;; context-composition
+;; context-apposition
+;; context-subposition
+;; context-transitive-closure

 (deftest test-rand-context
   (is (context? (rand-context [1 2 3 4] 0.5)))
@@ -317,8 +360,15 @@
   (is (= '#{x y z v} (attributes (rand-context [1 2 3 4] '[x y z v] 0.6))))
   (is (thrown? IllegalArgumentException (rand-context [] 'a))))

-;; random-contexts
-;; context-{sum,product,semiproduct,xia-product}
+(deftest test-random-contexts
+  (with-testing-data [ctx (random-contexts 11 23)]
+    (and (<= (count (objects ctx)) 23)
+         (<= (count (attributes ctx)) 23))))
+
+;; context-sum
+;; context-product
+;; context-semiproduct
+;; context-xia-product

 ;;;


yield measurement added

yield measurement added


Add fns for ranking and adding books

Add fns for ranking and adding books

--- src/myshelf/worker.clj
+++ src/myshelf/worker.clj
@@ -10,7 +10,11 @@
                                   get-consumer
                                   get-request-token
                                   get-user-id]]
-            [myshelf.books :refer [find-book-by-title]])
+            [myshelf.books :refer [find-book-by-title]]
+            [myshelf.friends :refer [get-user-friends]]
+            [myshelf.rank :refer [rank-books]]
+            [myshelf.shelves :refer [add-book-to-shelf
+                                     get-all-books-on-shelf]])
   (:gen-class))

 (def default-exchange "")
@@ -64,6 +68,32 @@
                   :sent-cmd "find-book"
                   :results books}))))

+(defn add-book
+  [channel user-handle consumer access-token book-id shelf]
+  (let [result (add-book-to-shelf consumer access-token book-id shelf)]
+    (lb/publish channel default-exchange reply-queue
+                (json/generate-string
+                 {:user-handle user-handle
+                  :sent-cmd "add-book"
+                  :results result}))))
+
+(defn rank-books-on-shelf
+  [consumer access-token user-id shelf]
+  (let [books (get-all-books-on-shelf consumer access-token
+                                      user-id shelf)
+        friends (get-user-friends consumer access-token user-id)]
+    (rank-books consumer access-token books friends)))
+
+(defn rank-to-read-books
+  [channel user-handle consumer access-token user-id]
+  (let [results (take 10 (rank-books-on-shelf consumer access-token
+                                              user-id "to-read"))]
+    (lb/publish channel default-exchange reply-queue
+                (json/generate-string
+                 {:user-handle user-handle
+                  :sent-cmd "rank-books"
+                  :results results}))))
+
 (defn process-command
   [channel user-handle cmd [arg-1 arg-2]]
   (let [handle (keyword user-handle)
@@ -73,7 +103,13 @@
                                 user-handle
                                 consumer
                                 access-token
-                                arg-1))))
+                                arg-1)
+      (= "rank" cmd) (rank-to-read-books channel user-handle
+                                         consumer access-token
+                                         user-id)
+      (= "add" cmd) (add-book channel user-handle
+                              consumer access-token
+                              arg-1 "to-read"))))

 (defn handle-message
   [channel metadata body]


Change signature of await-job-completion.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -213,14 +213,16 @@
        (component/stop client)
        true)))

-(defn ^{:added "0.6.0"} await-job-completion
+(defn ^{:added "0.7.4"} await-job-completion
   "Blocks until job-id has had all of its tasks completed or the job is killed.
    Returns true if the job completed successfully, false if the job was killed."
-  ([peer-config job-id monitoring-config timeout-ms]
+  ([peer-config job-id]
+     (await-job-completion peer-config job-id {:monitoring :no-op}))
+  ([peer-config job-id {:keys [monitoring-config timeout-ms]}]
    (let [job-id (validator/coerce-uuid job-id)
          client (component/start (system/onyx-client peer-config monitoring-config))
          ch (chan 100)
-         tmt (timeout timeout-ms)]
+         tmt (if timeout-ms (timeout timeout-ms) (chan))]
      (loop [replica (extensions/subscribe-to-log (:log client) ch)]
        (let [[v c] (alts!! [(go (extensions/apply-log-entry (<!! ch) replica))
                             tmt]


Use destructured value in mavlink-xml

Use destructured value in mavlink-xml

--- src/mavlink/mavlink_xml.clj
+++ src/mavlink/mavlink_xml.clj
@@ -321,7 +321,7 @@
                                      {:cause :missing-xml-include})))))))]
     (let [sources-with-zippers
             (mapv #(let [{:keys [xml-file xml-source]} %
-                         zipper (-> (:xml-source %) xml/parse zip/xml-zip)
+                         zipper (-> xml-source xml/parse zip/xml-zip)
                          file-name (or (zip-xml/xml1-> zipper :mavlink (zip-xml/attr :file))
                                        xml-file)]
                      (when-not file-name


Make keywordize a macro, rather then a function

--- src/mavlink/mavlink_xml.clj
+++ src/mavlink/mavlink_xml.clj
@@ -10,15 +10,12 @@

 (def ^:const MAX-MESSAGE-SIZE 300)  ; the maximum message size

-(defn- keywordize
+(defmacro keywordize
   "Take a string, replace all _ with - and put it in lower case,
    then convert to a keyword and return it.
    Not intended for use on type-names"
-  [^String s]
-  (if s
-    (keyword (string/lower-case (string/replace s \_ \-)))
-    (throw (ex-info "keywordize: null pointer"
-                    {:cause :null-pointer}))))
+  [s]
+  `(keyword (string/lower-case (string/replace ^String ~s \_ \-))))

 (defn- get-value
   "Take a string, if it is nil, return it, otherwise convert the string to a long
@@ -283,21 +280,24 @@
                            " there are conflicts with the following enums"
                            conflicts
                            ". The new values will override the existing values.")
-                      {:cause :enum-conflicts}))))
+                      {:cause :enum-conflicts
+                       :conflicts conflicts}))))
   (let [conflicts (filterv #(get messages-by-id %) (keys (:messages-by-id new-part)))]
     (when-not (empty? conflicts)
       (throw (ex-info (str "Adding " source
                            " there are conflicts with the following message ids:"
                            conflicts
                            ". The new values will override the existing values.")
-                      {:cause :message-id-conflicts}))))
+                      {:cause :message-id-conflicts
+                       :conflicts conflicts}))))
   (let [conflicts (filterv #(% messages-by-keyword) (keys (:messages-by-keyword new-part)))]
     (when-not (empty? conflicts)
       (throw (ex-info (str "Adding " source
                            " there are conflicts with the following message names:"
                            conflicts
                            ". The new values will override the existing values.")
-                      {:cause :message-name-conflicts}))))
+                      {:cause :message-name-conflicts
+                       :conflicts conflicts}))))
   {:descriptions (merge descriptions (:descriptions new-part))
    :enum-to-value (merge enum-to-value (:enum-to-value new-part))
    :enums-by-group (merge enums-by-group (:enums-by-group new-part))


Don't need to normalize

Don't need to normalize

--- src/mekena/logistic-reg.clj
+++ src/mekena/logistic-reg.clj
@@ -62,8 +62,9 @@
    -1/m Sigma (1,m)[ y.log( h(theta.x) ) + (1 - y).log( 1 - h(theta.x) )]
    input xs is dataset "
   [xs y theta]
-  (let [normalized-x (normalize-features xs)
-        theta-x      (i/mmult normalized-x theta)
+  (let [;normalized-x (normalize-features xs)
+        ;theta-x      (i/mmult normalized-x theta)
+        theta-x      (i/mmult xs theta)
         h-tx         (i/matrix-map hypothesis theta-x)
         y-1-term     (i/mmult (i/trans (i/log h-tx)) y)
         y-0-term     (i/mmult (i/trans (i/log (i/minus 1 h-tx))) (i/minus 1 y))
@@ -72,22 +73,12 @@
         (i/plus y-0-term)
         (i/div (- m)))))

-  ;(let [normalized-x (normalize-features xs)
-        ;theta-x      (i/mmult normalized-x theta)
-        ;h-tx         (i/matrix-map hypothesis theta-x)
-        ;y-1-term     (i/mmult (i/trans y) (i/log h-tx))
-        ;y-0-term     (i/mmult (i/trans (i/minus 1 y)) (i/log (i/minus 1 h-tx)))
-        ;m            (count y)]
-    ;(-> y-1-term
-        ;(i/plus y-0-term)
-        ;(i/div (- m))))
-;; J(θ) =−1m(log(g(Xθ))Ty+(log(1−g(Xθ)))T(1−y))
 ;; deftest : compute-cost xs y [0 0 0] => 0.693
 ;; where: xs : (sel training-data :except-cols (dec (ncol training-data)))
 ;; y : (def y (sel training-data :cols (dec (ncol training-data))))

 (def alpha 0.01)
-(def iterations 1500)
+(def iterations 400)

 (defn calc-theta
   "Gradient descent is: theta - (alpha/m).x^T(g(x.theta) - y)


linty fix

linty fix

--- src/metabase/api/common.clj
+++ src/metabase/api/common.clj
@@ -451,7 +451,7 @@
      ;; a separate multimethod or protocol so other models besides DB can write optimized
      ;; implementations. Currently, we always fetch an *entire* object to do read checking,
      ;; which is wasteful.
-     (= (name entity) "Database") `true
+     (= (name entity) "Database") `nil
      :else                        `(read-check (sel :one ~entity :id ~id)))))

 (defmacro write-check


minor code simplifcation :yum:

minor code simplifcation :yum:

--- src/metabase/query_processor/parameters.clj
+++ src/metabase/query_processor/parameters.clj
@@ -21,11 +21,11 @@
     "lastyear"})

 (defn- start-of-quarter [quarter year]
-  (case quarter
-    "Q1" (t/first-day-of-the-month (.withMonthOfYear (t/date-time year) DateTimeConstants/JANUARY))
-    "Q2" (t/first-day-of-the-month (.withMonthOfYear (t/date-time year) DateTimeConstants/APRIL))
-    "Q3" (t/first-day-of-the-month (.withMonthOfYear (t/date-time year) DateTimeConstants/JULY))
-    "Q4" (t/first-day-of-the-month (.withMonthOfYear (t/date-time year) DateTimeConstants/OCTOBER))))
+  (t/first-day-of-the-month (.withMonthOfYear (t/date-time year) (case quarter
+                                                                   "Q1" DateTimeConstants/JANUARY
+                                                                   "Q2" DateTimeConstants/APRIL
+                                                                   "Q3" DateTimeConstants/JULY
+                                                                   "Q4" DateTimeConstants/OCTOBER))))

 ;(defn- week-range [^DateTime dt]
 ;  ;; weeks always start on SUNDAY and end on SATURDAY


crawl output now contains xpath

crawl output now contains xpath

--- src/crawler/crawl.clj
+++ src/crawler/crawl.clj
@@ -82,8 +82,10 @@
         (println :total-score (/ sum-score num-decisions))
         (println :cur-page-score score)
         (write
-         {:url url
-          :body body}
+         {:url       url
+          :body      body
+          :src-url   (-> queue first :source)
+          :src-xpath (-> queue first :src-xpath)}
          "crawl.json")
         (if (or paginated?
                 (< (* 0.75


Fixed gamepad listener breakage under advanced compilation.

--- src/cljs/infinitelives/utils/events.cljs
+++ src/cljs/infinitelives/utils/events.cljs
@@ -319,6 +319,9 @@
 ; make the gamepad handler a singleton
 (def gamepad-handler-installed (atom false))

+; extract the javascripty bits from gamepad events
+(defn get-gamepad-event-index [ev] (aget (aget ev "gamepad") "index"))
+
 ; singleton function for initiating the listeners and polling loop
 (defn install-gamepad-handler! []
   (when (compare-and-set! gamepad-handler-installed false true)
@@ -329,9 +332,9 @@
           (when gamepad-data
             (set-gamepad-atom! gamepad-index gamepad-data)))))
     ; catch gamepad connect events and fire the callback
-    (js/window.addEventListener "gamepadconnected" (fn [ev] (set-gamepad-atom! ev.gamepad.index ev.gamepad) (initiate-gamepad-callbacks ev.gamepad.index ev.gamepad)))
+    (js/window.addEventListener "gamepadconnected" (fn [ev] (set-gamepad-atom! (get-gamepad-event-index ev) (aget ev "gamepad")) (initiate-gamepad-callbacks (get-gamepad-event-index ev) (aget ev "gamepad"))))
     ; catch gamepad disconnect events and reset the relevant atom
-    (js/window.addEventListener "gamepaddisconnected" (fn [ev] (set-gamepad-atom! ev.gamepad.index nil) (initiate-gamepad-callbacks ev.gamepad.index nil)))
+    (js/window.addEventListener "gamepaddisconnected" (fn [ev] (set-gamepad-atom! (get-gamepad-event-index ev) nil) (initiate-gamepad-callbacks (get-gamepad-event-index ev) nil)))
     ; start the polling loop that will continuously query gamepads for updated data
     ; because the API does not include events except for connect and disconnect
     (js/setInterval get-gamepads 25)))


configurable default event handling

configurable default event handling

--- src/cljs/infinitelives/utils/events.cljs
+++ src/cljs/infinitelives/utils/events.cljs
@@ -15,6 +15,20 @@
 ;; true meaning pressed, and false or nil meaning raised
 ;;
 (def key-state (atom {}))
+
+;; configuration of event handling behavoir.
+;; this is because interoperating with other libraries on a
+;; html page could require event to propagate, but gamejams
+;; you want that stuff automatically set up and configured
+;; to sane defaults
+(defonce key-config
+  (atom {:prevent-defaults true}))
+
+(defn set-prevent-key-defaults [b]
+  (swap! key-config assoc :prevent-defaults b))
+
+(def prevent-key-defaults (partial set-prevent-key-defaults true))
+(def allow-key-defaults (partial set-prevent-key-defaults false))

 (defn ascii
   "A clojurescript version of ascii value of. javascript doesn't have
@@ -107,7 +121,10 @@
     false

     ;; else prevent event propagation (cursor keys scroll body on mozilla)
-    (.preventDefault ev)))
+    (if (:prevent-defaults @key-config)
+      (.preventDefault ev)
+      false)
+    ))

 (defn handle-keyup-event
   "the basic event handler for key up events. Takes the keycode
@@ -116,9 +133,9 @@
   (swap! key-state (fn [old] (dissoc old (.-keyCode ev))))

   ;; stop event propagation on mozilla
-  (.preventDefault ev)
-
-  true)
+  (if (:prevent-defaults @key-config)
+      (.preventDefault ev)
+      true))

 (defn install-key-handler!
   "install the keyup and keydown event handlers"


url-keyword is pretty generic. moved from pixi

--- src/cljs/infinitelives/utils/string.cljs
+++ src/cljs/infinitelives/utils/string.cljs
@@ -7,3 +7,11 @@

 (defn starts-with? [str start]
   (= 0 (.indexOf str start)))
+
+(defn url-keyword [url]
+  (-> url
+      (.split "/")
+      last
+      (.split ".")
+      first
+      keyword))


small fix

small fix

--- src/cljs/salava/social/ui/dashboard.cljs
+++ src/cljs/salava/social/ui/dashboard.cljs
@@ -275,7 +275,7 @@
            [:div.badge-columns
              ;[:div.pending [:p.header (str (t :social/Youdonthaveanyanybadgesyet) ".")]]
              (when (seq badges)
-              [:div.badges {:style {:display "inline-block"}}
+              [:div.badges
                 [:p.header (t :social/Lastestearnedbadges)]
                 (reduce (fn [r badge]
                           (conj r [:a {:href "#" :on-click #(do


Resize image

Resize image

--- src/export_server/browser/raw.clj
+++ src/export_server/browser/raw.clj
@@ -8,7 +8,10 @@
            (org.openqa.selenium.chrome ChromeOptions ChromeDriver)
            (java.util ArrayList)
            (org.openqa.selenium.remote DesiredCapabilities)
-           (org.openqa.selenium.phantomjs PhantomJSDriver PhantomJSDriverService)))
+           (org.openqa.selenium.phantomjs PhantomJSDriver PhantomJSDriverService)
+           (javax.imageio ImageIO)
+           (java.io ByteArrayInputStream ByteArrayOutputStream)
+           (java.awt.image BufferedImage)))

 ;=======================================================================================================================
@@ -93,6 +96,25 @@
   (System/exit status))

+(defn resize-image [screenshot options]
+  (let [img (ImageIO/read (ByteArrayInputStream. screenshot))
+
+        ; new-img (.getSubimage img 0 0 (:image-width options) (:image-height options))
+        new-img (BufferedImage. (:image-width options) (:image-height options) (.getType img))
+        g (.getGraphics new-img)
+        _ (.drawImage g img 0 0
+                      (min (.getWidth img) (:image-width options))
+                      (min (.getHeight img) (:image-height options))
+                      nil)
+        _  (.dispose g)
+
+        baos (ByteArrayOutputStream.)
+        _ (ImageIO/write new-img "png" baos)
+        bytes (.toByteArray baos)]
+    (.close baos)
+    bytes))
+
+
 ;=======================================================================================================================
 ; Script --> SVG | PNG
 ;=======================================================================================================================
@@ -107,6 +129,10 @@
           new-handle (first (clojure.set/difference (set new-handles) (set prev-handles)))
           prev-handle (first prev-handles)]
       (.window (.switchTo d) new-handle)
+
+      (.setSize (.window (.manage d)) (Dimension. (:image-width options) (+ (:image-height options)
+                                                                            (if (= :firefox (:engine @state/options)) 75 0))))
+
       ;(prn "prev handles: " prev-handles)
       ;(prn "Current: " (.getWindowHandle (:webdriver d)))
       (let [startup
@@ -170,6 +196,7 @@
               (catch Exception e (str "Failed to take SVG Structure\n" (.getMessage e))))

             screenshot (.getScreenshotAs d OutputType/BYTES)
+            screenshot (resize-image screenshot options)

             error (some #(when (not (nil? %)) %) [startup binary script waiting])]

@@ -239,6 +266,7 @@
             {:ok false :result error})
           {:ok true :result screenshot})))))

+
 (defn svg-to-png [svg quit-ph exit-on-error width height]
   (if-let [driver (if quit-ph (create-driver) (get-free-driver))]
     (let [svg (rasterizator/clear-svg svg)


almost working sort-table

almost working sort-table

--- src/hackerrank/security/keyword_transposition.clj
+++ src/hackerrank/security/keyword_transposition.clj
@@ -51,9 +51,12 @@

   (map #(transpose-row table %) (range (count (first table)))))

+(defn find-first-starts-with [table letter]
+  (first (filter #(str/starts-with? % letter) table)))
+
 (defn sort-table [transposed string]
   (let [s (join (sort (distinct-string string)))]
-    transposed))
+    (map #(find-first-starts-with table %) s)))

 (defn keyword-transposition

@@ -82,7 +85,7 @@
 ;; (str/join (set/difference (set (seq "abcdsport")) (set (seq "sport"))))

 ;;;; transpose-table
-;; (def table ["safku" "pbglv" "ochmw" "rdinx" "tejqy"])
+(def table ["safku" "pbglv" "ochmw" "rdinx" "tejqy"])
 ;; (def a (map first table))
 ;; (def b (map second table))
 ;; (def c (map #(nth % 2) table))
@@ -100,4 +103,7 @@
 ;; (map #(transpose-row table %) (range (count (first table))))

-;; (join (sort "sport"))
+(def s (join (sort "sport")))
+
+(map identity s)
+(first (filter #(str/starts-with? % "o") table))


re-organize examples and contact

re-organize examples and contact


ysmiraak.sugar

ysmiraak.sugar


include date in tooltip

include date in tooltip

--- src/pc/views/admin.clj
+++ src/pc/views/admin.clj
@@ -13,6 +13,9 @@
                         :avet
                         :cust/email))))

+(defn title [{:keys [user-count time]}]
+  (str user-count " " (time/month time) "/" (time/day time)))
+
 (defn users-graph []
   (let [db (pcd/default-db)
         now (time/now)
@@ -23,16 +26,23 @@
                           (iterate #(clj-time.core/plus % (clj-time.core/days 1))
                                    earliest))

-        user-counts (map (partial count-users db) times)
-        users-per-day (map (fn [a b] (- b a)) (cons 0 user-counts) user-counts)
+        user-counts (map (fn [time]
+                           {:time time
+                            :user-count (count-users db time)})
+                         times)
+        users-per-day (map (fn [a b] {:time (:time b)
+                                      :user-count (- (:user-count b)
+                                                     (:user-count a))})
+                           (cons {:user-count 0} user-counts)
+                           user-counts)
         width 1000
         height 500
         x-tick-width (/ 1000 (count times))

-        max-users-per-day (apply max users-per-day)
+        max-users-per-day (apply max (map :user-count users-per-day))
         y-tick-width (/ 500 max-users-per-day)

-        max-users (apply max user-counts)
+        max-users (apply max (map :user-count user-counts))
         y-cumulative-tick-width (/ 500 max-users)
         padding 20]
     (list
@@ -49,12 +59,11 @@
       (map-indexed (fn [i user-count]
                      [:g
                       [:circle {:cx (+ padding (* x-tick-width i))
-                                :cy (+ padding (- 500 (* y-tick-width user-count)))
+                                :cy (+ padding (- 500 (* y-tick-width (:user-count user-count))))
                                 :r 5
                                 :fill "blue"
                                 }]
-                      [:title user-count]])
-
+                      [:title (title user-count)]])
                    users-per-day)]
      [:svg {:width 1200 :height 600}
       [:rect {:x 20 :y 20 :width 1000 :height 500
@@ -69,10 +78,10 @@
       (map-indexed (fn [i user-count]
                      [:g
                       [:circle {:cx (+ padding (* x-tick-width i))
-                                :cy (+ padding (- 500 (* y-cumulative-tick-width user-count)))
+                                :cy (+ padding (- 500 (* y-cumulative-tick-width (:user-count user-count))))
                                 :r 5
                                 :fill "blue"}]
-                      [:title user-count]])
+                      [:title (title user-count)]])
                    user-counts)])))

 (defn early-access-users []


better admin page for teams

better admin page for teams

--- src/pc/views/admin.clj
+++ src/pc/views/admin.clj
@@ -15,6 +15,7 @@
             [pc.models.cust :as cust-model]
             [pc.models.chat :as chat-model]
             [pc.models.doc :as doc-model]
+            [pc.models.plan :as plan-model]
             [pc.models.permission :as permission-model]
             [pc.replay :as replay]
             [pc.stripe.dev :as stripe-dev]
@@ -246,17 +247,6 @@
                    (d/datoms db :aevt :team/subdomain))]
     (list
      [:style "td, th { padding: 5px; text-align: left }"]
-     [:form {:action "/create-team" :method "post"}
-      (anti-forgery/anti-forgery-field)
-      [:table
-       [:tr
-        [:td "Subdomain"]
-        [:td [:input {:type "text" :name "subdomain"}]]]
-       [:tr
-        [:td "Customer email address"]
-        [:td [:input {:type "text" :name "cust-email"}]]]
-       [:tr [:td {:colspan 2}
-             [:input {:type "submit" :value "Create team"}]]]]]
      (if-not (seq teams)
        [:h4 "Couldn't find any teams :("]
        (list
@@ -264,13 +254,32 @@
          [:table {:border 1}
           [:tr
            [:th "subdomain"]
+           [:th "status"]
+           [:th "creator"]
+           [:th "active"]
            [:th "members"]]
-          (for [team teams]
+          (for [team teams
+                :let [plan (:team/plan team)]]
             [:tr
              [:td [:a {:href (urls/root :subdomain (h/h (:team/subdomain team)))}
                    (h/h (:team/subdomain team))]]
+             [:td (cond (:plan/paid? plan) "paid"
+                        (not (plan-model/trial-over? plan)) "trial"
+                        :else "trial expired")]
+             [:td [:a {:href (str "/user/" (:cust/email (:team/creator team)))}
+                   (:cust/email (:team/creator team))]]
+             [:td (let [active (:plan/active-custs plan)]
+                    (interleave (map (fn [cust]
+                                       [:a {:href (str "/user/" (:cust/email cust))}
+                                        (:cust/email cust)])
+                                     active)
+                                (repeat " ")))]
              [:td (let [permissions (permission-model/find-by-team db team)]
-                    (clojure.string/join ", " (map (comp :cust/email :permission/cust-ref) permissions)))]])]])))))
+                    (interleave (map (fn [p] (let [cust (:permission/cust-ref p)]
+                                               [:a {:href (str "/user/" (:cust/email cust))}
+                                                (:cust/email cust)]))
+                                     permissions)
+                                (repeat " ")))]])]])))))

 (defn format-runtime [ms]
   (let [h (int (Math/floor (/ ms (* 1000 60 60))))


restrict CLJS-3235 style requires to CLJS files only

JS files requiring JS files shouldn trigger this as they can't
use this feature anyways and likely mean actual filenames with $.

--- src/main/shadow/build/resolve.clj
+++ src/main/shadow/build/resolve.clj
@@ -68,7 +68,11 @@
   (throw (ex-info "invalid [:js-options :js-provider] config" {})))

 (defn find-resource-for-string [state require-from require was-symbol?]
-  (if (str/includes? require "$")
+  ;; only allow (:require ["foo$bar.baz" :as x]) requires from CLJS and the REPL
+  ;; but requires with $ in their name from JS should look up actual files
+  (if (and (str/includes? require "$")
+           (or (nil? require-from)
+               (= :cljs (:type require-from))))
     ;; syntax sugar
     ;; (:require ["some$nested.access" :as foo])
     ;; results in 2 separate resources, one doing the require "some" the other doing "nested.access"


Implement slow-scan

Implement slow-scan

--- src/kixi/datastore/filestore/migrators/dynamodb/migrator_20171221_ttl.clj
+++ src/kixi/datastore/filestore/migrators/dynamodb/migrator_20171221_ttl.clj
@@ -26,11 +26,25 @@
   [profile]
   (:alerts (read-config @config-location profile)))

+(defn slow-scan
+  [conn table-name prim-kv & [{:keys [limit] :or {limit 5}}]]
+  (letfn [(scan [tok]
+            (far/scan conn table-name
+                      (merge {:limit limit}
+                             (when tok
+                               {:last-prim-kvs {prim-kv tok}}))))]
+    (loop [out []
+           r (scan nil)]
+      (println (count r) (count (set out)))
+      (if (empty? r)
+        out
+        (recur (concat out r) (scan (get (last r) prim-kv)))))))
+
 (defn up
   [db]
   (let [profile (name @profile)
         conn (get-db-config db)
-        items (not-empty (far/scan conn (fsdb/primary-upload-cache-table profile)))]
+        items (not-empty (slow-scan conn (fsdb/primary-upload-cache-table profile) (keyword fsdb/id-col)))]
     ;; Set ttl column
     (when-not (= "local" profile)
       (far/update-ttl conn (fsdb/primary-upload-cache-table profile) true ttl-col))
@@ -40,7 +54,7 @@
       (run! #(db/merge-data conn
                             (fsdb/primary-upload-cache-table profile)
                             fsdb/id-col
-                            (:kixi.datastore.filestore_id %)
+                            (get % fsdb/id-col)
                             {::fsu/ttl (three-days-from-now)}) items))))
 (defn down
   [db]


should return nil

should return nil

--- test/celestial/integration/workflows/openstack.clj
+++ test/celestial/integration/workflows/openstack.clj
@@ -63,5 +63,5 @@
               (status tenant id) => :in-use
               (wf/destroy (spec)) => nil
               (status tenant id) => :available
-              (delete id tenant))
+              (delete id tenant) => nil)
          ))))


Revert "(SERVER-262) Remove JARS_NO_REQUIRE failing test"

This reverts commit 15acf46176e3b0f1f5ff11579633668542e20c15.

--- test/unit/puppetlabs/puppetserver/cli/gem_test.clj
+++ test/unit/puppetlabs/puppetserver/cli/gem_test.clj
@@ -14,6 +14,9 @@
       (is (= "/fake/path" ((cli-gem-environment fake-config fake-env)
                             "GEM_HOME"))
           "has GEM_HOME set to /fake/path from the provided config")
+      (is (= "true" ((cli-gem-environment fake-config fake-env)
+                      "JARS_NO_REQUIRE"))
+          "has JARS_NO_REQUIRE set to true")
       (is (= "1" ((cli-gem-environment fake-config fake-env)
                       "FOO_DEBUG"))
           "preserves arbitrary environment vars for the end user"))))


Analyze the replacement in the same context

In order to write (partial f x y ...) x, y and soforth need to be in
scope which we only know they can be at the point where f was
eliminated. Thus we have to pull the env out of f and reuse it to
analyze the replacement term. Nicola OK'd it and it works so it stays.

--- src/oxcart/passes/lambda_lift.clj
+++ src/oxcart/passes/lambda_lift.clj
@@ -106,7 +106,8 @@
                                       (rewrite-fn* used-locals)))
               partial-form `(partial ~(symbol sym) ~@used-locals)
               def-ast      (util/ast def-form)
-              partial-ast  (util/ast partial-form)]
+              partial-ast  (util/ast partial-form
+                                     (:env ast))]

           (println def-form)


url 업데이트.

url 업데이트.

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 (defproject tweetbook "0.1.0"
   :description "Tweet snippets from books"
-  :url "http://{app-engine-id}.appspot.com"
+  :url "http://ntalbs-twtr.appspot.com"
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [compojure "1.1.6"]
                  [liberator "0.11.1"]


Back to snapshot version.

Back to snapshot version.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clj-record "1.1.1"
+(defproject clj-record "1.1.2-SNAPSHOT"
   :description "A pseudo-port of ActiveRecord to the Clojure programming language"
   :url "http://github.com/duelinmarkers/clj-record"
   :dependencies [[org.clojure/clojure "1.3.0"]


Version 1.5.1

Version 1.5.1

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject puppetlabs/lein-ezbake "1.5.1-SNAPSHOT"
+(defproject puppetlabs/lein-ezbake "1.5.1"
   :description "A system for building packages for trapperkeeper-based applications"
   :url "https://github.com/puppetlabs/ezbake"
   :license {:name "Apache License 2.0"


Bump version

Bump version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject buildviz "0.1.0"
+(defproject buildviz "0.2.0"
   :description "Transparency for your build pipeline's results and runtime."
   :url "https://github.com/cburgmer/buildviz"
   :license {:name "BSD 2-Clause"


Version 2.0.3-SNAPSHOT

Version 2.0.3-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject puppetlabs/lein-ezbake "2.0.2"
+(defproject puppetlabs/lein-ezbake "2.0.3-SNAPSHOT"
   :description "A system for building packages for trapperkeeper-based applications"
   :url "https://github.com/puppetlabs/ezbake"
   :license {:name "Apache License 2.0"


#28 update url

#28 update url

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 (defproject tamaki "0.1.8-SNAPSHOT"
-  :description "plugins of kalar"
-  :url "https://github.com/satokazuma/kalar-plugins"
+  :description "Tamaki, a static site generator"
+  :url "https://github.com/satokazuma/tamaki"
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/mit-license.php"}
   :dependencies [[org.clojure/clojure "1.7.0"]


Fix CSV, load the reads by item instead of by org.

--- src/oc/storage/api/orgs.clj
+++ src/oc/storage/api/orgs.clj
@@ -176,13 +176,7 @@
     (vec (remove nil? (cons updated-self (vec updated-other-users))))))

 (defn read-data-for-entries [org allowed-boards-map entries active-users user-id]
-  (let [entry-uuids (map :uuid entries)
-        all-read-data (read/retrieve-by-org config/dynamodb-opts (:uuid org))
-        entry-uuid-set (set entry-uuids)
-        cleaned-users (sort-users user-id active-users)
-        filtered-read-data (filter (comp entry-uuid-set :item-id) all-read-data)
-        entry-user-key (fn [entry-id user-id] (str entry-id "-" user-id))
-        all-reads-map (into {} (map #(hash-map (entry-user-key (:item-id %) (:user-id %)) %) filtered-read-data))
+  (let [cleaned-users (sort-users user-id active-users)
         users-for-board-cache (atom {})
         csv-users-for-entry (fn [board entry]
                               (let [cached-users-list (get @users-for-board-cache (:uuid board))
@@ -192,11 +186,13 @@
                                                    (filterv #(or ((set (:viewers board)) (:user-id %))
                                                                 ((set (:authors board)) (:user-id %)))
                                                            cleaned-users)
-                                                   cleaned-users))]
+                                                   cleaned-users))
+                                    item-reads (read/retrieve-by-item config/dynamodb-opts (:uuid entry))
+                                    item-reads-map (zipmap (map :user-id item-reads) item-reads)]
                                 (when-not cached-users-list
                                   (swap! users-for-board-cache assoc (:uuid board) users-list))
                                 (map #(assoc % :read-at
-                                            (get-in all-reads-map [(entry-user-key (:uuid entry) (:user-id %)) :read-at]))
+                                            (get-in item-reads-map [(:user-id %) :read-at]))
                                     users-list)))
         with-entries-data (map #(let [board (get allowed-boards-map (:board-uuid %))
                                       csv-users (csv-users-for-entry board %)


Version 0.1.18-SNAPSHOT

Version 0.1.18-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject day8.re-frame/trace "0.1.17"
+(defproject day8.re-frame/trace "0.1.18-SNAPSHOT"
   :description "Tracing and developer tools for re-frame apps"
   :url "https://github.com/Day8/re-frame-trace"
   :license {:name "MIT"}


Include board links w/ org create response.

--- src/oc/storage/api/orgs.clj
+++ src/oc/storage/api/orgs.clj
@@ -297,13 +297,13 @@
                                   org-id (:uuid new-org)
                                   boards (board-res/list-boards-by-org conn org-id [:created-at :updated-at])
                                   board-reps (map #(board-rep/render-board-for-collection slug % 0)
-                                                boards)
+                                                (map #(assoc % :access-level :author) boards))
                                   authors (:authors org)
                                   author-reps (map #(org-rep/render-author-for-collection org % (:access-level ctx))
                                                 authors)
                                   org-for-rep (-> new-org
                                                 (assoc :authors author-reps)
-                                                (assoc :boards boards))]
+                                                (assoc :boards board-reps))]
                               (api-common/location-response
                                 (org-rep/url slug)
                                 (org-rep/render-org org-for-rep :author (-> ctx :user :user-id))