Clear up docstring.

Clear up docstring.

--- project/analyze-data/src/analyze_data/evaluate_model.clj
+++ project/analyze-data/src/analyze_data/evaluate_model.clj
@@ -22,7 +22,10 @@

 (defn evaluate-model-file
   "Like evaluate-model, but take file path arguments for both model and test
-  data."
+  data.
+
+  tf-idf-model-file: path to a file containing serialized tf-idf-model
+  test-file: path to a csv with 'document-name' and 'document-text' headers"
   [tf-idf-model-file test-file]
   (with-open [in (io/reader test-file)]
     (let [model (read-object tf-idf-model-file)


Two tests for function format-date-time

Two tests for function format-date-time

--- test/clj_calendar/calendar_test.clj
+++ test/clj_calendar/calendar_test.clj
@@ -342,6 +342,20 @@
             (.set calendar 2000 00 01 00 00 00)
             (is (= "2000-01-01 00:00:00" (format-date-time calendar))))))

+(deftest test-format-date-time-6
+    "Check the function clj-calendar.calendar/format-date-time"
+    (testing "the function clj-calendar.calendar/format-date-time"
+        (let [calendar (get-calendar)]
+            (.set calendar 1000 00 01 00 00 00)
+            (is (= "1000-01-01 00:00:00" (format-date-time calendar))))))
+
+(deftest test-format-date-time-7
+    "Check the function clj-calendar.calendar/format-date-time"
+    (testing "the function clj-calendar.calendar/format-date-time"
+        (let [calendar (get-calendar)]
+            (.set calendar 10000 00 01 00 00 00)
+            (is (= "10000-01-01 00:00:00" (format-date-time calendar))))))
+
 (deftest test-get-year
     "Check the function clj-calendar.calendar/get-year"
     (testing "the function clj-calendar.calendar/get-year"


Add skewness

Add skewness

--- src/clj/clojurewerkz/statistiker/statistics.clj
+++ src/clj/clojurewerkz/statistiker/statistics.clj
@@ -126,3 +126,20 @@
   "Slow (and memory consuming but correct) way to claculate Kurtosis"
   [data]
   (.getKurtosis (DescriptiveStatistics. (double-array data))))
+
+(defn skewness
+  "
+                [n / (n - 1) (n - 2)] * sum[(x_i - mean)^3]
+    skewness = ---------------------------------------------
+                                    std^3
+"
+  [xs]
+  (let [mu    (mean xs)
+        sigma (sd xs)
+        n     (count xs)]
+    (/ (* (/ n
+             (* (- n 1) (- n 2)))
+          (->> xs
+               (map #(pow (- % mu) 3))
+               (reduce +)))
+       (pow sigma 3))))


Jeff jeff

Jeff jeff

--- src/clj_simple_chart/ssb/nettoksprogdiagram.clj
+++ src/clj_simple_chart/ssb/nettoksprogdiagram.clj
@@ -27,14 +27,14 @@
 (def header (opentype/stack
               {:width available-width}
               [{:text "Statens netto kontantstraum frå petroleumsverksemda" :font "Roboto Bold" :font-size 28}
-               {:text "Røynd (søyler) og anslag frå statsbudsjettet (linje)" :font "Roboto Bold" :font-size 16 :margin-top 2 :margin-bottom 10}
+               {:text "Røynd (søyler) og anslag frå Statsbudsjettet for kommande år (linje)" :font "Roboto Bold" :font-size 16 :margin-top 2 :margin-bottom 10}

                {:text "Netto kontantstraum" :font "Roboto Bold" :font-size 16 :valign :bottom :align :right}
                {:text "Milliardar kroner" :font "Roboto Bold" :font-size 16 :valign :bottom :align :right}]))

 (def footer (opentype/stack
               {:width available-width}
-              [{:margin-top 8 :text "Kjelder: SSB, Statsbudsjettet 2000-2016" :font "Roboto Regular" :font-size 14}
+              [{:margin-top 8 :text "Kjelder: SSB, Statsbudsjettet 2000–2018" :font "Roboto Regular" :font-size 14}
                {:text "Diagram © Refsdal.Ivar@gmail.com" :font "Roboto Regular" :font-size 14 :valign :bottom :align :right}]))

 (def xx {:type          :ordinal
@@ -59,6 +59,16 @@
                      :x      xx
                      :y      yy}))

+(def blue "rgb(31, 119, 180)")
+(def orange "rgb(255, 127, 14)")
+(def green "rgb(44, 160, 44)")
+(def brown "rgb(140, 86, 75)")
+(def red "rgb(214, 39, 40)")
+(def pink "rgb(227, 119, 194)")
+(def gusjegul "rgb(188, 189, 34)")
+(def lilla "rgb(148, 103, 189)")
+(def cyan "rgb(23, 190, 207)")
+
 (defn diagram []
   [:svg {:xmlns "http://www.w3.org/2000/svg" :width svg-width :height svg-height}
    [:g {:transform (translate marg marg)}
@@ -66,19 +76,19 @@
     [:g {:transform (translate (:margin-left c) (+ (:height (meta header)) (:margin-top c)))}
      (axis/render-axis (:y c))
      (rect/bars c
-                {:p :year
-                 :fill "yellow"
-                 :h :netto-kontantstraum}
+                {:p    :year
+                 :fill green
+                 :h    :netto-kontantstraum}
                 data)
-     (line/line c {:p :year
-                   :h :netto-kontantstraum
-                   :dot true
-                   :dot-style {:r 4.5
-                               :fill "green"
-                               :stroke "black"
-                               :stroke-width 1.5}
-                   :path {:stroke "black"
-                          :stroke-width 3}} prognose/gul-bok)
+     (line/line c {:p         :year
+                   :h         :netto-kontantstraum
+                   :dot       true
+                   :dot-style {:r            4.5
+                               :fill         orange
+                               :stroke       "black"
+                               :stroke-width 2.0}
+                   :path      {:stroke       "black"
+                               :stroke-width 3}} prognose/gul-bok)
      (axis/render-axis (:x c))]
     [:g {:transform (translate-y (+ (:height (meta header)) available-height))} footer]]])


Redirect with access token submitted

Redirect with access token submitted

--- src/cljs/wombats_web_client/panels/welcome.cljs
+++ src/cljs/wombats_web_client/panels/welcome.cljs
@@ -31,9 +31,11 @@
    [:div.welcome-message-content welcome-message-1]
    [:div.welcome-message-content welcome-message-2]])

-(defn render-welcome-button[]
-  [:div.welcome-button-container
-   [:a "get started now"]])
+(defn render-welcome-button [cmpnt-state]
+  (let [url (str github-signin-url "?access-key=" (:access-key @cmpnt-state))]
+    [:div.welcome-button-container
+     [:a {:href url}
+      "get started now"]]))

 (defn render-access-form [cmpnt-state]
   [:div.access-form
@@ -41,7 +43,7 @@
                            :label "Access Key"
                            :state cmpnt-state
                            :is-password false}]
-   [render-welcome-button]])
+   [render-welcome-button cmpnt-state]])

 (defn render-login-prompt []
   [:div.login-prompt


block clicking on 'NO ACCESS' workspaces and provide title text explanation

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspaces_list.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspaces_list.cljs
@@ -1,6 +1,6 @@
 (ns org.broadinstitute.firecloud-ui.page.workspaces-list
   (:require
-    [clojure.string :refer [split join replace split-lines]]
+    [clojure.string :refer [split join split-lines]]
     [dmohs.react :as react]
     [org.broadinstitute.firecloud-ui.common :as common]
     [org.broadinstitute.firecloud-ui.common.components :as comps]
@@ -19,15 +19,24 @@

 (def row-height-px 56)

+(def disabled-text
+  (str "This workspace contains controlled access data. You can only access the contents of this workspace if you are "
+       "dbGaP authorized for TCGA data and have linked your FireCloud account to your eRA Commons account."))

 (react/defc StatusCell
   {:render
    (fn [{:keys [props]}]
-     (let [status (get-in props [:data :status])]
-       [:a {:href (nav/create-href (:nav-context props) (get-in props [:data :href]))
+     (let [{:keys [nav-context data]} props
+           {:keys [href status disabled?]} data]
+       [:a {:href (if disabled?
+                    "javascript:;"
+                    (nav/create-href nav-context href))
             :style {:display "block" :backgroundColor (style/color-for-status status)
                     :margin "2px 0 0 2px" :height (- row-height-px 4)
-                    :position "relative"}}
+                    :cursor (when disabled? "default")
+                    :WebkitFilter (when disabled? "grayscale()")
+                    :position "relative"}
+            :title (when disabled? disabled-text)}
         [:span {:style {:display "block" :backgroundColor "rgba(0,0,0,0.2)"
                         :position "absolute" :top 0 :right 0 :bottom 0 :left 0}}]
         (style/center {}
@@ -41,13 +50,18 @@
   {:render
    (fn [{:keys [props]}]
      (let [{:keys [nav-context data]} props
-           {:keys [href status protected?]} data
+           {:keys [href status protected? disabled?]} data
            color (style/color-for-status status)]
-       [:a {:href (nav/create-href nav-context href)
+       [:a {:href (if disabled?
+                    "javascript:;"
+                    (nav/create-href nav-context href))
             :style {:display "block"
                     :backgroundColor color
                     :color "white" :textDecoration "none"
-                    :height (- row-height-px 4)}}
+                    :cursor (when disabled? "default")
+                    :WebkitFilter (when disabled? "grayscale()")
+                    :height (- row-height-px 4)}
+            :title (when disabled? disabled-text)}
         (when protected?
           [:span {:style {:display "block" :position "relative"}}
            [:span {:style {:display "block" :position "absolute" :left -16 :top 17
@@ -164,12 +178,13 @@
           :num-total-rows (count (:workspaces props))
           :->row (fn [ws]
                    (let [ws-name (get-workspace-name-string ws)
-                         ws-href (let [x (ws "workspace")] (str (x "namespace") ":" (x "name")))]
-                     [{:name ws-name :href ws-href :status (:status ws)}
-                      {:name ws-name :href ws-href :status (:status ws)
+                         ws-href (let [x (ws "workspace")] (str (x "namespace") ":" (x "name")))
+                         disabled? (= (ws "accessLevel") "NO ACCESS")]
+                     [{:name ws-name :href ws-href :status (:status ws) :disabled? disabled?}
+                      {:name ws-name :href ws-href :status (:status ws) :disabled? disabled?
                        :protected? (get-in ws ["workspace" "realm"])}
                       (get-workspace-description ws)
-                      (get-in ws ["accessLevel"])
+                      (ws "accessLevel")
                       nil]))}]]))})

@@ -214,7 +229,7 @@
       (fn [index segment]
         (if (zero? index)
           {:text "Workspaces" :href "#workspaces"}
-          {:text (replace (js/decodeURIComponent segment) ":" "/")
+          {:text (clojure.string/replace (js/decodeURIComponent segment) ":" "/")
            :href (str "#" (join "/" (subvec segments 0 (inc index))))}))
       segments)))


annotate unknown :constant nodes as 'any

--- src/main/clojure/clojure/tools/analyzer/passes/js/annotate_tag.clj
+++ src/main/clojure/clojure/tools/analyzer/passes/js/annotate_tag.clj
@@ -46,7 +46,10 @@

 (defmethod -annotate-tag :const
   [ast]
-  ((get-method -annotate-tag (:type ast)) ast))
+  (let [ast ((get-method -annotate-tag (:type ast)) ast)]
+    (if (:tag ast)
+      ast
+      (assoc ast :tag 'any))))

 (defmethod -annotate-tag :nil
   [ast]


Make interpretation->tbox tidy up the resulting TBox

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

--- src/conexp/contrib/dl/languages/description_graphs.clj
+++ src/conexp/contrib/dl/languages/description_graphs.clj
@@ -325,7 +325,11 @@
 (defn interpretation->tbox
   "Converts a given interpretation to its corresponding tbox."
   [interpretation]
-  (description-graph->tbox (interpretation->description-graph interpretation)))
+  (let [tbox (description-graph->tbox (interpretation->description-graph interpretation))
+        tbox (if (not-empty (tbox-definitions tbox))
+               (first (tidy-up-ttp [tbox (first (defined-concepts tbox))]))
+               tbox)]
+    tbox))

 ;;;


server-upgrades: adding docstring to image-library

--- src/main/untangled/components/server/image_library.clj
+++ src/main/untangled/components/server/image_library.clj
@@ -59,7 +59,19 @@
     (assoc this :middleware
       (image-library-middleware this))))

-(defn image-library [opts]
+(defn image-library
+  "Parameters:
+   :owner-fn - (Required) Gets the owner for a specified ImageMeta,
+                          (fn [env ImageMeta] -> (assoc ImageMeta :owner ...))
+   :auth-fn - (Optional) Asserts request is valid based on an ImageMeta, (fn [env ImageMeta loc] -> anything or throws),
+                         where loc is one of #{:read :read-all :store} as the location in which it's called dictates what the ImageMeta will contain.
+   :assets-root - (Optional) Images url prefix (defaults to '/assets/')
+
+   System dependencies (Required):
+   [untangled.components.server.image-library.storage :as storage]
+   ::storage/blob - Must implement storage/IBlobStorage for grabbing the image contents.
+   ::storage/meta - Must implement storage/IMetaStorage for grabbing image meta data (eg: id, name, owner, etc...)"
+  [opts]
   (assert (fn? (:owner-fn opts)))
   (component/using
     (map->ImageLibrary


logviewer tries to determine log directory via logback configuration, falls back to storm.home/logs

--- storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -3,11 +3,15 @@
   (:use [hiccup core page-helpers])
   (:use [backtype.storm config util log])
   (:use [ring.adapter.jetty :only [run-jetty]])
+  (:import [org.slf4j LoggerFactory])
+  (:import [ch.qos.logback.classic Logger])
   (:import [org.apache.commons.logging LogFactory])
   (:import [org.apache.commons.logging.impl Log4JLogger])
+  (:import [ch.qos.logback.core FileAppender])
   (:import [org.apache.log4j Level])
   (:require [compojure.route :as route]
-            [compojure.handler :as handler])
+            [compojure.handler :as handler]
+            [clojure.string :as string])
   (:gen-class))

 (defn tail-file [path tail]
@@ -25,8 +29,17 @@
       (.toString output))
     ))

+(defn log-root-dir
+  []
+  (let [appender (first (iterator-seq (.iteratorForAppenders (LoggerFactory/getLogger Logger/ROOT_LOGGER_NAME))))]
+    (if (and appender (instance? FileAppender appender))
+      (string/join
+       "/" (butlast
+            (string/split (.getFile appender) #"/")))
+      (str (System/getProperty "storm.home") "/logs/"))))
+
 (defn log-page [file tail grep]
-  (let [path (str (System/getProperty "storm.home") "/logs/" file)
+  (let [path (str (log-root-dir) "/" file)
         tail (if tail
                (min 10485760 (Integer/parseInt tail))
                10240)


CMR-286: Added unit tests for page_num validation.

--- test/cmr/search/test/services/parameter_validation.clj
+++ test/cmr/search/test/services/parameter_validation.clj
@@ -46,7 +46,16 @@
            (pv/page-size-validation :collection (assoc valid-params :page_size 2001)))))
   (testing "Non-numeric page size"
     (is (= ["page_size must be a number between 1 and 2000"]
-           (pv/page-size-validation :collection (assoc valid-params :page_size "ABC"))))))
+           (pv/page-size-validation :collection (assoc valid-params :page_size "ABC")))))
+  (testing "Valid page_num"
+    (is (= []
+           (pv/page-num-validation :collection (assoc valid-params :page_num 5)))))
+  (testing "Page num less than one"
+    (is (= ["page_num must be a number greater than or equal to 1"]
+           (pv/page-num-validation :collection (assoc valid-params :page_num 0)))))
+  (testing "Non-numeric page num"
+    (is (= ["page_num must be a number greater than or equal to 1"]
+           (pv/page-num-validation :collection (assoc valid-params :page_num "ABC"))))))

 (deftest temporal-format-validation :collection-start-date-test


Introduce multi-write.

Introduce multi-write.

--- src/fleetdb/core.clj
+++ src/fleetdb/core.clj
@@ -187,6 +187,14 @@
     (map (fn [query] (exec db query))
          queries)))

+(defn- q-multi-write [db queries]
+  (reduce
+    (fn [[int-db int-results] query]
+      (let [[aug-db result] (exec int-db query)]
+        [aug-db (conj int-results result)]))
+    [db []]
+    queries))
+
 (def- query-fns
   {:select       q-select
    :count        q-count
@@ -196,7 +204,8 @@
    :create-index q-create-index
    :drop-index   q-drop-index
    :list-indexes q-list-indexes
-   :multi-read   q-multi-read})
+   :multi-read   q-multi-read
+   :multi-write  q-multi-write})

 (defn exec [db [query-type opts]]
   (if-let [queryfn (query-fns query-type)]


Use keydown instead of keyup for title edition on image collections.

--- src/uxbox/ui/dashboard/images.cljs
+++ src/uxbox/ui/dashboard/images.cljs
@@ -85,10 +85,16 @@
               (swap! local assoc :edit false))
             (on-title-edited [e]
               (cond
-                (kbd/esc? e) (swap! local assoc :edit false)
-                (kbd/enter? e) (on-title-save e)
-                :else (let [content (dom/event->inner-text e)]
-                        (swap! local assoc :coll-name content))))
+                (kbd/esc? e)
+                (swap! local assoc :edit false)
+
+                (kbd/enter? e)
+                (do (dom/stop-propagation e)
+                    (on-title-save e))
+
+                :else
+                (let [content (dom/event->inner-text e)]
+                  (swap! local assoc :coll-name content))))
             (on-title-edit [e]
               (swap! local assoc :edit true :coll-name (:name coll)))
             (on-delete [e]
@@ -100,7 +106,7 @@
            [:div.dashboard-title-field
             [:span.edit
              {:content-editable ""
-              :on-key-up on-title-edited}
+              :on-key-down on-title-edited}
              (:name coll)]
             [:span.close
              {:on-click #(swap! local assoc :edit false)}


Go out up to 6 hops

Go out up to 6 hops

--- src/kevin/search.clj
+++ src/kevin/search.clj
@@ -74,7 +74,7 @@
            q1 (list start)   ; queue of outgoing things to check
            q2 (list end)     ; queue of incoming things to check
            iter 1]
-      (when (and (seq q1) (seq q2) (< iter 11)) ; 5 "hops" or fewer
+      (when (and (seq q1) (seq q2) (< iter 13)) ; 6 "hops" or fewer
         (if (<= (count q1) (count q2))
           (let [pairs (find-pairs q1 preds)
                 preds (map-set-pairs preds pairs)


fix return value from tests

fix return value from tests

--- src/leiningen/new/reagent_liveedit/testenv.cljs
+++ src/leiningen/new/reagent_liveedit/testenv.cljs
@@ -19,7 +19,7 @@
   (core/init!)

   (let [results (t/run-all-tests)]
-    (t/on-testing-complete results #(exit (t/successful? %))))
+    (t/on-testing-complete results #(exit (if (t/successful? %) 0 1))))

   (catch js/Object e
     (print (.-stack e))


Avoid internal id to keyword coersion.

Avoid internal id to keyword coersion.

--- src/lentes/core.cljc
+++ src/lentes/core.cljc
@@ -410,7 +410,7 @@
   ([lens src {:keys [read-only? check-equals?]
               :or {read-only? false
                    check-equals? true}}]
-   (let [id (keyword (gensym "lentes-derived-atom"))]
+   (let [id (gensym "lentes-derived-atom")]
      (if read-only?
        (ROFocus. id lens src check-equals? nil +empty+ +empty+ +empty+)
        (RWFocus. id lens src check-equals? nil +empty+ +empty+ +empty+)))))


update with CSP2 values

update with CSP2 values

--- src/nevergreen/wrap_content_security_policy.clj
+++ src/nevergreen/wrap_content_security_policy.clj
@@ -4,14 +4,16 @@

 (def ^:private default-src "default-src 'self'")
 (def ^:private script-src "script-src 'self' 'unsafe-eval'")
+(def ^:private worker-src "worker-src 'self'")
 (def ^:private style-src "style-src 'self' 'unsafe-inline'")
 (def ^:private img-src "img-src * data:")
 (def ^:private font-src "font-src 'self' data:")
 (def ^:private media-src "media-src *")
 (def ^:private connect-src "connect-src 'self' https://api.github.com https://gist.githubusercontent.com")
 (def ^:private object-src "object-src 'none'")
-(def ^:private child-src "child-src 'none'")
-(def ^:private sources [default-src script-src style-src img-src font-src media-src connect-src object-src child-src])
+(def ^:private child-src "child-src 'self'")
+(def ^:private frame-src "frame-src 'none'")
+(def ^:private sources [default-src script-src worker-src style-src img-src font-src media-src connect-src object-src child-src frame-src])

 (defn wrap-content-security-policy [app]
   (fn [req]


Disabling EPAM visualizer until it supports all features (#1201)

--- src/cljs/main/broadfcui/page/method_repo/method/wdl.cljs
+++ src/cljs/main/broadfcui/page/method_repo/method/wdl.cljs
@@ -10,8 +10,9 @@

 (react/defc WDLViewer
   {:render
-   (fn [{:keys [props state]}]
-     (let [{:keys [mode]} @state
+   (fn [{:keys [props #_state]}] ; TODO: uncomment state when re-enabling
+     [CodeMirror {:text (:wdl props) :read-only? true}] ; TODO: remove this line when re-enabling
+     #_(let [{:keys [mode]} @state ; TODO: un-comment this when re-enabling
            {:keys [wdl]} props
            mode (or mode :code)
            tab (fn [mode-key label]


CMR-621: Added relevance score field to atom results.

--- src/cmr/search/results_handlers/atom_results_handler.clj
+++ src/cmr/search/results_handlers/atom_results_handler.clj
@@ -33,7 +33,8 @@
    "browsable"
    "coordinate-system"
    "ords-info"
-   "ords"])
+   "ords"
+   "_score"])

 (defmethod elastic-search-index/concept-type+result-format->fields [:granule :atom]
   [concept-type result-format]
@@ -59,6 +60,7 @@
 (defn- collection-elastic-result->query-result-item
   [elastic-result]
   (let [{concept-id :_id
+         score :_score
          {[short-name] :short-name
           [version-id] :version-id
           [summary] :summary
@@ -82,6 +84,7 @@
         end-date (when end-date (str/replace (str end-date) #"\+0000" "Z"))
         atom-links (map #(json/decode % true) atom-links)]
     {:id concept-id
+     :score score
      :title entry-title
      :short-name short-name
      :version-id version-id
@@ -205,7 +208,7 @@
 (defn- collection-atom-reference->xml-element
   "Converts a collection search result atom reference into an XML element"
   [reference]
-  (let [{:keys [id title short-name version-id summary updated dataset-id collection-data-type
+  (let [{:keys [id score title short-name version-id summary updated dataset-id collection-data-type
                 processing-level-id original-format data-center archive-center start-date end-date
                 atom-links associated-difs online-access-flag browse-flag coordinate-system shapes]} reference]
     (x/element :entry {}
@@ -228,12 +231,13 @@
                (map atom-spatial/shape->xml-element shapes)
                (map #(x/element :echo:difId {} %) associated-difs)
                (x/element :echo:onlineAccessFlag {} online-access-flag)
-               (x/element :echo:browseFlag {} browse-flag))))
+               (x/element :echo:browseFlag {} browse-flag)
+               (when score (x/element :relevance:score {} score)))))

 (defn- granule-atom-reference->xml-element
   "Converts a granule search result atom reference into an XML element"
   [reference]
-  (let [{:keys [id title updated dataset-id producer-gran-id size original-format
+  (let [{:keys [id size title updated dataset-id producer-gran-id size original-format
                 data-center start-date end-date atom-links online-access-flag browse-flag
                 day-night cloud-cover coordinate-system shapes]} reference]
     (x/element :entry {}
@@ -286,9 +290,15 @@

         items (if (= :granule concept-type)
                 (append-collection-links context items)
-                items)]
+                items)
+        ;; add relence url to header attributes if our entries have scores
+        header-attributes ATOM_HEADER_ATTRIBUTES
+        header-attributes (if (:score (first items))
+                            (merge header-attributes
+                                   {:xmlns:relevance
+                                    "http://a9.com/-/opensearch/extensions/relevance/1.0/"}))]
     (xml-fn
-      (x/element :feed ATOM_HEADER_ATTRIBUTES
+      (x/element :feed header-attributes
                  (x/element :updated {} (str (time/now)))
                  (x/element :id {} (url/atom-request-url context concept-type result-format))
                  (x/element :title {:type "text"} (concept-type->atom-title concept-type))


when opening a new window make sure it has focus

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

--- src/lt/objs/app.cljs
+++ src/lt/objs/app.cljs
@@ -143,7 +143,7 @@
                   :triggers #{:show}
                   :reaction (fn [this]
                               ;(dom/focus (dom/$ :body))
-                              ;(.focus win)
+                              (.focus win)
                               ))

 (behavior ::run-on-init


[ISSUE #3246] Fixed regression when opening URL

Signed-off-by: Eric Dvorsak <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@dvorsak.fr>

--- src/status_im/ui/components/list_selection.cljs
+++ src/status_im/ui/components/list_selection.cljs
@@ -29,8 +29,8 @@

 (defn browse [link]
   (show {:title       (i18n/label :t/browsing-title)
-         :options     [{:text   (i18n/label :t/browsing-open-in-browser)
-                        :action (re-frame/dispatch [:open-browser {:url link}])}
-                       {:text   (i18n/label :t/browsing-open-in-web-browser)
-                        :action (.openURL react/linking link)}]
+         :options     [{:label  (i18n/label :t/browsing-open-in-browser)
+                        :action #(re-frame/dispatch [:open-browser {:url link}])}
+                       {:label  (i18n/label :t/browsing-open-in-web-browser)
+                        :action #(.openURL react/linking link)}]
          :cancel-text (i18n/label :t/browsing-cancel)}))


Remove unneeded binding

Remove unneeded binding

--- src/mavlink/core.clj
+++ src/mavlink/core.clj
@@ -695,8 +695,7 @@
   {:pre [(instance? Byte a-byte)
          (fn? @decode-sm)]}
   (swap! statistics assoc :bytes-received (inc (:bytes-received @statistics)))
-  (when-let [message (@decode-sm channel a-byte)]
-    message))
+  (@decode-sm channel a-byte))

 (defn decode-bytes
   "Decodes a MAVLink message from a byte array.


Filter contains only at top level

Filter contains only at top level

--- src/com/wsscode/pathom/connect/graphql.cljc
+++ src/com/wsscode/pathom/connect/graphql.cljc
@@ -225,8 +225,9 @@
                     ::keys   [prefix]
                     :as      env}
                    ent]
-  (->> parent-query om/query->ast (filter-ast #(and (not (contains? ent (:key %)))
-                                                    (str/starts-with? (namespace (:key %)) prefix))) :children
+  (->> parent-query om/query->ast (filter-ast #(str/starts-with? (namespace (:key %)) prefix))
+       :children
+       (filterv #(not (contains? ent (:key %))))
        (mapv #(ast->graphql (assoc env :ast %) ent))
        (reduce p.merge/merge-queries)))


rest/v2 logout url

rest/v2 logout url

--- src/ontrail/core.clj
+++ src/ontrail/core.clj
@@ -169,7 +169,6 @@
       (json-response {:message "wrong-password"} 400)))

   (POST "/rest/v2/login" {params :params headers :headers}
-        (.info logger (str headers))
         (let [username (:username params)
               password (:password params)
               new-location (if-let [referer (headers "referer")] referer "/m/index.html")]
@@ -180,8 +179,8 @@
               {:status 301
                :headers {"Content-Type" "text/html"
                          "Location" new-location}
-               :cookies {"authToken" {:value authToken}
-                         "authUser" {:value authUser}}
+               :cookies {"authToken" {:value authToken :max-age (* 60 60 24 2 365) }
+                         "authUser" {:value authUser :max-age  (* 60 60 24 2 365) }}
                :body ""
                })
             {:status 301
@@ -190,6 +189,15 @@
                        "X-Ontrail-Status" "login-failed"}
              :body ""
              })))
+
+  (POST "/rest/v2/logout" {headers :headers}
+        (let [new-location (if-let [referer (headers "referer")] referer "/m/index.html")]
+          {:status 301
+           :headers {"Content-Type" "text/html"
+                     "Location" new-location}
+           :cookies {"authToken" {:value "" :max-age 0}
+                     "authUser" {:value "" :max-age  0 }}
+           :body ""}))

   (POST "/rest/v1/login" [username password]
         (if (authenticate username password)


Make monitoring test more reliable.

Make monitoring test more reliable.

--- test/onyx/peer/monitoring_test.clj
+++ test/onyx/peer/monitoring_test.clj
@@ -71,15 +71,17 @@
     (with-test-env [test-env [3 env-config peer-config]]
       (doseq [n (range n-messages)]
         (>!! @in-chan {:n n}))
-      (close! @in-chan)
-
       (let [{:keys [job-id]} (onyx.api/submit-job peer-config
                                                   {:catalog catalog
                                                    :workflow workflow
                                                    :lifecycles lifecycles
                                                    :task-scheduler :onyx.task-scheduler/balanced})
+            ;; wait for job to fully start up before counting our metrics
+            _ (Thread/sleep 1000)
+            _ (is (> (count (jmx/mbean-names "metrics:*")) 50))
+            ;; close after we've counted
+            _ (close! @in-chan)
             _ (onyx.test-helper/feedback-exception! peer-config job-id)
             results (take-segments! @out-chan 50)
             expected (set (map (fn [x] {:n (inc x)}) (range n-messages)))]
-        (is (= expected (set results))))
-      (is (> (count (jmx/mbean-names "metrics:*")) 50)) )))
+        (is (= expected (set results)))))))


Fixed button to NOT stretch when placed in v-boxes...  - fixed link to spinner image

--- src/re_com/core.cljs
+++ src/re_com/core.cljs
@@ -51,7 +51,7 @@
                 See: http://getbootstrap.com/css/#buttons"
   [:button
    {:class    (str "btn " class)
-    :style    (merge {:flex "none"} style)
+    :style    (merge {:flex "none" :align-self "flex-start"} style)
     :on-click on-click}
    label])

@@ -117,7 +117,7 @@
   "Render an animated gif spinner"
   [:div {:style {:display "flex"
                  :margin "10px"}}
-   [:img {:src "img/spinner.gif"
+   [:img {:src "resources/img/spinner.gif"
           :style {:margin "auto"}}]])


Taiko drums

Taiko drums

--- src/rule110/midi.clj
+++ src/rule110/midi.clj
@@ -14,8 +14,37 @@
   []
   (.close ^javax.sound.midi.Synthesizer synth))

+
+
+(defn set-instrument
+  [channels channel-number instrument-num]
+  (let [inst (aget (.getAvailableInstruments ^Synthesizer synth)
+                   instrument-num)]
+    (.programChange (aget channels channel-number)
+
+                    (.getProgram (.getPatch inst)))))
+
+;; (def instruments [[0 108] ; kalimba
+;;                   [1 114] ; steel drums
+;;                   [2 116] ; taiko
+;;                   [3 118] ; Syn Drum
+;;                   [4 238]]) ; Tuned Drum
+
+(def instruments [[0 116] ; kalimba
+                  [1 116] ; steel drums
+                  [2 116] ; taiko
+                  [3 116] ; Syn Drum
+                  [4 238] ; Tuned Drum
+                  [5 116]
+                  [6 116]
+                  ])
+
 (def channels (delay (start)
-                     (.getChannels ^javax.sound.midi.Synthesizer synth)))
+                     (let [chans (.getChannels ^javax.sound.midi.Synthesizer synth)]
+                       (doseq [[chan-num inst] instruments]
+                         (set-instrument chans chan-num inst))
+                       chans
+                       )))

 (defn play-note
   "Play a note on channel with note and velocity"
@@ -44,12 +73,20 @@
 ;; 0-15 channels and but 129 notes but not all play on a channel
 ;; channel 10 has lots of game like sounds 10-80
 ;; channel 12 has drum/bell stay less than 80 though
-(def max-channels 4)
-(def idx-channel-map {
-                      0 0
-                      1 10
-                      2 12
-                      3 15})
+;; (def max-channels 8)
+;; (def idx-channel-map {
+;;                       0 0
+;;                       1 10
+;;                       2 12
+;;                       3 15
+;;                       4 2
+;;                       5 14
+;;                       6 8
+;;                       7 4})
+
+(def max-channels (count instruments))
+(def idx-channel-map (fn [n] n))
+

 (defn default-note-fn
   [grid]
@@ -57,7 +94,8 @@
     (map
      (fn [[a b c d :as rows] idx]
        (let [channel-number (idx-channel-map (mod idx max-channels))
-             sum (int (Math/pow (apply + rows) (inc idx)))
+             osum (int (Math/pow (apply + rows) (inc idx)))
+             sum (Integer/parseInt (apply str rows) 2)
              #_( mults (map #(int (Math/pow * %2 %2)) (partition max-channels)))
              note (mod sum 129)
              velocity (min 100 (max 10 (mod sum 100)))]


removed unnecessary print

removed unnecessary print

--- src/server/core.cljs
+++ src/server/core.cljs
@@ -44,12 +44,11 @@
                   (let [num-of-users (count users)]
                     (.llen redis-client (str (.toString room-reply) ":sync-track-start")
                       (fn [err reply]
-                        (println reply)
-                        (println num-of-users)
                         (if (= num-of-users reply)
-                          (println "starting track!")
-                          (.emit (.to io (.toString room-reply)) "sync-start")
-                          (.del (str (.toString room-reply) ":sync-track-start"))))))))))))))
+                          (do
+                            (println "starting track!")
+                            (.emit (.to io (.toString room-reply)) "sync-start")
+                            (.del redis-client (str (.toString room-reply) ":sync-track-start")))))))))))))))
   (.on socket "file-upload-progress"
     (fn [upload-progress]
       (rooms/get-room-from-id (.-id socket)


with-connection

with-connection

--- src/kvm/provider.clj
+++ src/kvm/provider.clj
@@ -11,6 +11,9 @@

 (ns kvm.provider
   (:require
+    [clojure.core.strint :refer (<<)]
+    [kvm.clone :refer (clone-domain)]
+    [kvm.common :refer (connect)]
     [celestial.provider :refer (wait-for wait-for-ssh map-key)]
     [supernal.sshj :refer (ssh-up?)]
     [celestial.core :refer (Vm)]
@@ -21,9 +24,18 @@

 (timbre/refer-timbre)

-(defrecord Domain []
+(defn connection [{:keys [host user port]}]
+  (connect (<< "qemu+ssh://~{user}@~{host}:~{port}/system")))
+
+(defmacro with-connection [& body]
+  `(let [~'connection (connection ~'node)] (do ~@body)))
+
+(defrecord Domain [node domain]
   Vm
-  (create [this])
+  (create [this]
+    (with-connection
+      (let [{:keys [image target]} domain]
+        (clone-domain connection image target))))

   (delete [this])

@@ -40,5 +52,6 @@
   )

 (defmethod vconstruct :kvm [{:keys [digital-ocean machine] :as spec}]
+
   )


lein-release plugin: bumped version from 0.1.12 to 0.1.13-SNAPSHOT for next development cycle

--- re_db/project.clj
+++ re_db/project.clj
@@ -1,4 +1,4 @@
-(defproject re-db "0.1.12"
+(defproject re-db "0.1.13-SNAPSHOT"
   :description "in-memory javascript key-value store inspired by Datomic and DataScript"
   :url "https://www.github.com/braintripping/re-view/tree/master/re_db"
   :license {:name "Eclipse Public License"


Actually pass the user in.

Actually pass the user in.

--- src-cljs/frontend/components/aside.cljs
+++ src-cljs/frontend/components/aside.cljs
@@ -261,7 +261,7 @@
                         {:react-key (project-model/id project)
                          :opts {:login (:login opts)}}))]]])))))

-(defn aside-nav [app owner opts]
+(defn aside-nav [app owner {user :user}]
   (reify
     om/IDisplayName (display-name [_] "Aside Nav")
     om/IDidMount
@@ -283,7 +283,7 @@
                         :data-trigger "hover"
                         :title "Settings"
                         :href "/account"}
-         [:img {:src (gh-utils/make-avatar-url opts)}]]
+         [:img {:src (gh-utils/make-avatar-url user)}]]

         [:a.aside-item {:title "Documentation"
                         :data-placement "right"
@@ -334,5 +334,5 @@
             avatar-url (gh-utils/make-avatar-url user)]
         (html
          [:aside.app-aside-left
-          (om/build aside-nav app {:opts user})
+          (om/build aside-nav app {:opts {:user user}})
           (om/build activity app {:opts {:login login}})])))))


upgraded figwheel

upgraded figwheel

--- cljx/plongeur-cljs/project.clj
+++ cljx/plongeur-cljs/project.clj
@@ -12,7 +12,7 @@
                  [com.rpl/specter "0.9.3"]
                  [prismatic/dommy "1.1.0"]]

-  :plugins [[lein-figwheel "0.5.2"]
+  :plugins [[lein-figwheel "0.5.3-1"]
             [lein-cljsbuild "1.1.3" :exclusions [[org.clojure/clojure]]]
             [lein-npm "0.6.2"]]

@@ -63,4 +63,6 @@
                    :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}

   :figwheel {:css-dirs ["resources/public/css"] ;; watch and update CSS
-             :nrepl-port 7888})
+             :nrepl-port 7888}
+
+  )


add react key to fix display bug when (un)subing

--- src/chat/client/views/pages/channels.cljs
+++ src/chat/client/views/pages/channels.cljs
@@ -64,7 +64,7 @@
                   (dom/h2 nil "Subscribed")
                   (apply dom/div #js {:className "tags"}
                     (map (fn [tag]
-                           (om/build tag-info-view tag))
+                           (om/build tag-info-view tag {:react-key (tag :id)}))
                          subscribed-tags)))))

               (let [recommended-tags
@@ -76,5 +76,5 @@
                     (dom/h2 nil "Recommended")
                     (apply dom/div #js {:className "tags"}
                       (map (fn [tag]
-                             (om/build tag-info-view tag))
+                             (om/build tag-info-view tag {:react-key (tag :id)}))
                            recommended-tags)))))))))))


Support for changing palette colors using input

--- src/cljs/koeeoadi/components/palette.cljs
+++ src/cljs/koeeoadi/components/palette.cljs
@@ -2,7 +2,7 @@
   (:require [goog.style :refer [setStyle]]
             [goog.events :as gevents]
             [goog.array :refer [forEach]]
-            [goog.dom :refer [getElement]]
+            [goog.dom :refer [getActiveElement getDocument getElement getElementsByTagNameAndClass]]
             [om.dom :as dom]
             [om.next :as om :refer-macros [defui]]
             [koeeoadi.util :as util]
@@ -14,10 +14,19 @@
 (declare Palette)
 (declare PaletteWidget)

-(defn color-update [comp active-color closure-comp]
-  (om/transact! comp
-    `[(color/update {:color/id ~(:color/id active-color)
-                     :color/hex ~(.getColor closure-comp)}) :palette]))
+(defn widget-input-elem [comp]
+  (aget (query "input" (getElement (dom/node comp))) 0))
+
+(defn color-update
+  ([comp]
+   (let [{:keys [:palette-widget/active-color
+                 :palette-widget/closure-comp]} (om/props comp)]
+     (color-update comp active-color closure-comp (.getColor closure-comp))))
+  ([comp active-color closure-comp color-hex]
+   (when (not= color-hex (:color/hex active-color))
+     (om/transact! comp
+       `[(color/update {:color/id  ~(:color/id active-color)
+                        :color/hex ~(.getColor closure-comp)}) :palette]))))

 (defn color-remove [comp {:keys [color/id] :as color} e]
   (.preventDefault e)
@@ -101,24 +110,27 @@
 (def color-adder (om/factory ColorAdder))

 (defn handle-action [comp e]
-  (let [{:keys [palette-widget/active-color palette-widget/face-classes-by-color-type]} (om/props comp)
+  (let [{:keys [palette-widget/active-color
+                palette-widget/face-classes-by-color-type]} (om/props comp)
         hex-temp (util/target-color e)]
-    ;; TODO refactor this so its in the state, its wasteful to calculate this on each run through, could maybe even use the element references themeselves
-    (let [{:keys [bg-faces fg-faces]} face-classes-by-color-type
-          color-editable-selector (str ".color-" (:color/id active-color))
-          [code-bg-selector face-bg-color-selector] (selectors-for-colorize bg-faces :face/color-bg)
-          [code-fg-selector face-fg-color-selector] (selectors-for-colorize fg-faces :face/color-fg)]
+    (if  (= (widget-input-elem comp) (getActiveElement (getDocument)))
+      (color-update comp)
+      ;; TODO refactor this so its in the state, its wasteful to calculate this on each run through, could maybe even use the element references themeselves
+      (let [{:keys [bg-faces fg-faces]} face-classes-by-color-type
+            color-editable-selector (str ".color-" (:color/id active-color))
+            [code-bg-selector face-bg-color-selector] (selectors-for-colorize bg-faces :face/color-bg)
+            [code-fg-selector face-fg-color-selector] (selectors-for-colorize fg-faces :face/color-fg)]

-      ;; TODO combine these
-      (colorize-faces color-editable-selector "background-color" hex-temp)
+        ;; TODO combine these
+        (colorize-faces color-editable-selector "background-color" hex-temp)

-      (when-not (empty? fg-faces)
-        (colorize-faces code-fg-selector "color" hex-temp)
-        (colorize-faces face-fg-color-selector "background-color" hex-temp))
+        (when-not (empty? fg-faces)
+          (colorize-faces code-fg-selector "color" hex-temp)
+          (colorize-faces face-fg-color-selector "background-color" hex-temp))

-      (when-not (empty? bg-faces)
-        (colorize-faces code-bg-selector "background-color" hex-temp)
-        (colorize-faces face-bg-color-selector "background-color" hex-temp)))))
+        (when-not (empty? bg-faces)
+          (colorize-faces code-bg-selector "background-color" hex-temp)
+          (colorize-faces face-bg-color-selector "background-color" hex-temp))))))

 (defui PaletteWidget
   static om/IQuery
@@ -130,14 +142,15 @@

   Object
   (componentDidMount [this]
-    (let [{:keys [palette-widget/active-color faces/list] :as props} (om/props this)
-          palette-widget (HsvPalette. nil nil "goog-hsv-palette-sm")]
-      (.render palette-widget (getElement (dom/node this "paletteWidget")))
-      (.setColor palette-widget (:color/hex active-color))
-      (gevents/listen palette-widget "action" #(handle-action this %))
-      (om/transact! this `[(palette-widget/update
-                             {:palette-widget/face-classes-by-color-type ~(util/faces-to-colorize list (:color/id active-color))
-                              :palette-widget/closure-comp               ~palette-widget})])))
+    (let [{:keys        [palette-widget/active-color faces/list] :as props} (om/props this)
+          widget        (HsvPalette. nil nil "goog-hsv-palette-sm")]
+      (.render widget (getElement (dom/node this "paletteWidget")))
+      (let [input (widget-input-elem this)]
+        (.setColor widget (:color/hex active-color))
+        (gevents/listen widget EventType.ACTION #(handle-action this %))
+        (om/transact! this `[(palette-widget/update
+                               {:palette-widget/face-classes-by-color-type ~(util/faces-to-colorize list (:color/id active-color))
+                                :palette-widget/closure-comp ~widget})]))))

   (componentDidUpdate [this {id-prev :color/id} _]
     (let [{:keys [palette-widget/active-color
@@ -148,10 +161,10 @@

   (render [this]
     (let [{:keys [palette-widget/closure-comp
-                  palette-widget/active-color] :as props} (om/props this)
-          update-func #(color-update this active-color closure-comp)]
+                  palette-widget/active-color] :as props} (om/props this)]

-      (dom/div #js {:onMouseUp update-func
+      (dom/div #js {:onMouseUp #(color-update this)
+                    :id  "palette-widget"
                     ;;:onTouchEnd #(color-update this active-color closure-comp)
                     :ref "paletteWidget"} nil))))

@@ -172,7 +185,7 @@
     (let [{colors/list         :colors/list
            palette-widget-data :palette-widget} (om/props this)
           callback (partial color-add this)]
-      (dom/div #js {:className "widget"
+      (dom/div #js {:className "widget"
                     :id        "palette"}
         (util/widget-title "Palette")
         (apply dom/div #js {:id "palette-colors"


add links, improve copy for pen and paper post

--- src/pc/views/blog/replace_pen_and_paper.clj
+++ src/pc/views/blog/replace_pen_and_paper.clj
@@ -7,11 +7,14 @@
    :body
    (list
     [:article
-     [:p "Jason Fried wrote a post that explained why his team avoids Photoshop for UI design. "
-         "The problem is that some tools add more cognitive load to a process than they offer in value. "
-         "I admire this type of process refinement through reflection. "
-         "I also think it's relevant to other parts of design, such as the ideation. "]
-     [:p "Someone asked the following question in the comments section of that post.
+     [:p "Jason Fried wrote a "
+         [:a {:href "https://signalvnoise.com/posts/1061-why-we-skip-photoshop"} "post"]
+         " that explained why his team avoids Photoshop for UI design.
+         The problem is that some tools add more cognitive load to a process than they offer in value.
+         I admire this type of process refinement through reflection.
+         I also think it's relevant to other parts of design, such as the ideation. "]
+     [:p [:a {:href "https://signalvnoise.com/posts/1061-why-we-skip-photoshop#comment_26681"} "Henry Balanon"]
+         " asked the following question in the comments section of that post.
          The question seems so simple, and yet it outlines a very complicated problem."]]

     [:article
@@ -19,12 +22,12 @@

     [:article
      [:h3 "Remote collaboration is hard with pen and paper."]
-     [:p "I've worked with many remote teammates and trying to share paper sketches with them is almost impossible. "
-         "I remember practicing the ol' email-a-photo technique myself. "
-         "Interestingly, further down from the quote above, others admitted that they actually scan their drawings. Whoa."]
-     [:p "This is enough of a problem that I bet we could make another list similar to the Photoshop list. "
-         "We'll even reference another hallmark of the tradition design process; pen and paper. "
-         "Only this time we'll focus on the ideation/brainstorming stage of design."]]
+     [:p "I've worked with many remote teammates and trying to share paper sketches with them is almost impossible.
+         I remember practicing the ol' email-a-photo technique myself.
+         Interestingly, further down from the quote above, others admitted that they actually scan their drawings. Whoa."]
+     [:p "This is enough of a problem that I bet we could make another list similar to the Photoshop list.
+         We'll even reference another hallmark of the tradition design process; pen and paper.
+         Only this time we'll focus on the ideation/brainstorming stage of design."]]

     [:article
      [:h3 "Here are a few reasons we want to replace pen and paper:"]
@@ -61,9 +64,10 @@

     [:article
      [:h3 "Prototypes deserve more than just a pen and paper."]
-     [:p "None of this is to say that I think pen and paper has no place anymore.
-         I still use it for disposable ideas when I'm not close to my computer or tablet.
+     [:p "None of this is to say that I think pen and paper have no place anymore.
+         I still use them for disposable ideas when I'm not close to a computer or tablet.
          But I want something better for my prototypes; something just as fast and simple to share as it is to use."]
      [:p "My friend, Daniel and I looked for something like this and didn't find it, so we built it ourselves.
-         We only started a few weeks ago, but we already have a more creative and collaborative workflow as a result.
-         Precursor allows us to be productive as a team in a way that pen and paper never will."]])})
+         We only started a few weeks ago, but we already have a more creative and collaborative workflow as a result. "
+         [:a {:href "/"} "Precursor"]
+         " allows us to be productive as a team in a way that pen and paper never will."]])})


do parallax stars with no modification to vector

--- src/splash/core.cljs
+++ src/splash/core.cljs
@@ -19,7 +19,8 @@
    {:expand true
     :engine :auto
     :layers [:stars :ui]
-    :background 0x505050}))
+    :background 0x000000 ;0x505050
+    }))

 (defonce render-go-block (go (while true
                (<! (events/next-frame))
@@ -34,12 +35,14 @@

 (def num-stars 500)
-(def stars-set (map (fn [n]
-                      (let [depth (math/rand-between 0 8)]
-                        {:x (math/rand-between 0 400)
-                         :y (math/rand-between 0 300)
-                         :z (+ depth (rand))
-                         :depth depth})) (range num-stars)))
+(def stars-set (sort-by
+                :z
+                (map (fn [n]
+                       (let [depth (math/rand-between 0 8)]
+                         {:x (math/rand-between 0 400)
+                          :y (math/rand-between 0 300)
+                          :z (+ depth (rand))
+                          :depth depth})) (range num-stars))))

 (defn main []
   (go
@@ -61,40 +64,41 @@

     (let [scale [4 4]
           text (resources/get-texture :stars :nearest)
-          stars (for [[x y] [[0 0] [8 0] [16 0] ;[24 0]
-                             [0 8] [8 8] [16 8]
+          stars (for [[x y] [[16 8] [8 8] [16 0] [8 0] [0 0] ;[24 0]
+                             [0 8]
                              [0 16] [8 16] [24 24]]]
                   (texture/sub-texture text
-                                        [x y] [8 8]))
+                                       [x y] [8 8]))
           star-spr (for [{:keys [x y z depth]} stars-set]
-                      (sprite/make-sprite
-                         (nth stars depth)
-                         :x (* 4 x)
-                         :y (* 4 y)
-                         :scale scale
-                         :alpha 0.0))]
+                     (sprite/make-sprite
+                      (nth stars depth)
+                      :x (* 4 x)
+                      :y (* 4 y)
+                      :scale scale
+                      :alpha 0.0))]
       (macros/with-sprite-set canvas :stars
         [sprs star-spr]
         (doseq [s sprs] (resources/fadein s :duration 1.5))

-        (go (loop [n 1000 sts stars-set]
+        (go (loop [n 2000 c 0]
               (when (pos? n)
                 (<! (events/next-frame))

+                (doall
+                 (map
+                  (fn [{:keys [x y z] :as old} sprite]
+                    (sprite/set-pos! sprite
+                                     (* 4 (- (mod (- x (* 0.3 c z)) 400) 200))
+                                     (* 4 (- y 150))))
+                  stars-set
+                  star-spr))
+
                 (recur (dec n)
-                       (doall (map
-                               (fn [{:keys [x y z] :as old} sprite]
-                                 (sprite/set-pos! sprite
-                                                  (* 4 (- (mod (- x z) 400) 200))
-                                                  (* 4 (- y 150)))
-                                        ;(println old sprite)
-                                 (assoc old :x (- x z)))
-                               sts
-                               star-spr))
+                       (inc c)
                        ))))

-        (<! (events/wait-time 2000))
+        (<! (events/wait-time 15000))

         (doseq [s sprs] (resources/fadeout s :duration 10))


Replace deprecated clojure.contrib.sh with clojure.java.sh

--- src/omnibus/ohai.clj
+++ src/omnibus/ohai.clj
@@ -19,7 +19,7 @@

 (ns omnibus.ohai
   (:use (clojure.data (json :only [read-json]))
-        (clojure.contrib (shell :only [sh])))
+        (clojure.java (shell :only [sh])))
   (:gen-class))

 (defn ohai


Add option for indenting with 2 spaces

Add option for indenting with 2 spaces

--- src/paredit/core.clj
+++ src/paredit/core.clj
@@ -298,7 +298,7 @@

 (defn indent-column
   "pre-condition: line-offset is already the starting offset of a line"
-  [root-loc line-offset]
+  [root-loc line-offset force-two-spaces-indent]
   (let [loc (loc-for-offset root-loc (dec line-offset))]
     (loop [loc (z/left loc) seen-loc nil indent 0]
       (cond
@@ -310,7 +310,7 @@
             (cond
               (nil? seen-loc)
                 (+ (loc-col loc) (loc-count loc) 1)
-              (or (lisp-form? (loc-text (first seen-loc)))
+              (or force-two-spaces-indent (lisp-form? (loc-text (first seen-loc)))
                   (inline-implementation? (first seen-loc)))
                 (+ (loc-col loc) (loc-count loc) 1)
               (second seen-loc)
@@ -556,7 +556,7 @@

 (defmethod paredit
   :paredit-newline
-  [cmd {:keys #{parse-tree buffer}} {:keys [text offset length] :as t}]
+  [cmd {:keys #{parse-tree buffer}} {:keys [text offset length] :as t} & {:keys [force-two-spaces-indent]}]
   ; no call to with-important-memoized because we almost immediately delegate to :paredit-indent-line
   (let [text (-> text (t/str-remove offset length) (t/str-insert offset "\n"))
         r (paredit :paredit-indent-line
@@ -566,7 +566,8 @@
                    {:text text
                     :offset (inc offset)
                     :length 0
-                    :modifs [{:text *newline* :offset offset :length length}]})]
+                    :modifs [{:text *newline* :offset offset :length length}]}
+                   :force-two-spaces-indent force-two-spaces-indent)]
     (if (-?> r :modifs count (= 2))
       (let [m1 (get-in r [:modifs 0])
             m2 (get-in r [:modifs 1])
@@ -577,7 +578,10 @@

 (defmethod paredit
   :paredit-indent-line
-  [cmd {:keys #{parse-tree buffer}} {:keys [^String text offset length] :as t}]
+  [cmd
+   {:keys #{parse-tree buffer}}
+   {:keys [^String text offset length] :as t}
+   & {:keys [force-two-spaces-indent]}]
   (with-important-memoized
     (if-let [rloc (-?> parse-tree (parsed-root-loc true))]
       (let [line-start (t/line-start text offset)
@@ -585,7 +589,7 @@
             loc (loc-for-offset rloc line-start)]
         (if (and (#{:string, :string-body} (loc-tag loc)) (< (start-offset loc) line-start))
           t
-          (let [indent (indent-column rloc line-start)
+          (let [indent (indent-column rloc line-start force-two-spaces-indent)
                 cur-indent-col (-
                                  (loop [o line-start]
                                    (if (>= o (.length text))


renamed the container used for the chunks to .chunks since .container gets used by the layout already

--- src-cljs/bitfondue/core.cljs
+++ src-cljs/bitfondue/core.cljs
@@ -27,7 +27,7 @@

 (defn chunks
   []
-  [:div.container
+  [:div.chunks
    (for [chunk-row (->> @chunks-state
                         (sort-by :created_on)
                         (partition-all 3))]


cleanup connections when subscriber leaves

--- src-cljs/frontend/sente.cljs
+++ src-cljs/frontend/sente.cljs
@@ -82,7 +82,10 @@
   (swap! app-state subs/add-subscriber-data (:client-id data) data))

 (defmethod handle-message :frontend/subscriber-left [app-state message data]
-  (swap! app-state subs/remove-subscriber (:client-id data)))
+  (let [client-id (:client-id data)]
+    (swap! app-state subs/remove-subscriber client-id)
+    (rtc/cleanup-conns :consumer client-id)
+    (rtc/cleanup-conns :producer client-id)))

 (defmethod handle-message :frontend/mouse-move [app-state message data]
   (swap! app-state subs/maybe-add-subscriber-data (:client-id data) data))


Work around ec2 hang bug. Revert to using the java crate, because the previous workaround didn't.

--- src/circleci/backend/nodes/circleci.clj
+++ src/circleci/backend/nodes/circleci.clj
@@ -20,6 +20,7 @@
   (pallet.core/group-spec
    "CircleCI box"
    :node-spec (pallet.core/node-spec
+               :hardware {:hardware-id "m1.small"} ;; require m1.small or larger right now, because of https://bugs.launchpad.net/ubuntu/+source/linux-ec2/+bug/634487
                :image {:os-family :ubuntu
                        :location-id "us-east-1"
                        :image-id "us-east-1/ami-06ad526f"}
@@ -27,13 +28,13 @@
    :phases {:bootstrap (pallet.phase/phase-fn
                         (automated-admin-user/automated-admin-user))
             :configure (pallet.phase/phase-fn
-                        (package/packages
-                         :aptitude ["openjdk-6-jdk"])
+                        (java/java :openjdk)
                         (git/git)
                         (postgres/settings (postgres/settings-map {:version "8.4"
                                                                    :permissions [{:connection-type "local" :database "all" :user "all" :auth-method "trust"}
                                                                                {:connection-type "host" :database "all" :user "all" :ip-mask "127.0.0.1/32" :auth-method "trust"}
                                                                                {:connection-type "host" :database "all" :user "all" :ip-mask "::1/128" :auth-method "trust"}]}))
+
                         (postgres/postgres)
                         (postgres/initdb)
                         (postgres/hba-conf)


fix goal validity check

fix goal validity check

--- src/cljc/tictag/beeminder_matching.cljc
+++ src/cljc/tictag/beeminder_matching.cljc
@@ -7,6 +7,7 @@
                     (and (#{'not 'and 'or :not :and :or} c)
                          (every? valid? args)))
     (keyword? thing) true
+    (symbol? thing) true
     (string? thing) true))

 (defn match? [thing b]


Remove log statements showing secret keys

They were really useful for debugging, so getting rid of them now might
be premature, but they were also very noisy and dangerous.

And they shouldn't be too difficult to restore as needed.

--- src/com/frereth/common/curve/server.clj
+++ src/com/frereth/common/curve/server.clj
@@ -227,23 +227,9 @@
       ;; so it winds up at the start of the array).
       ;; Note that this is a departure from the reference implementation!
       (let [actual (.array buffer)]
-        (log/info (str "Before encrypting crypto-cookie, it looks like\n"
-                       (with-out-str (b-s/print-bytes actual))))
         (crypto/secret-box actual actual K/server-cookie-length working-nonce minute-key)
-        (log/info (str "Encrypted cookie starting at offset "
-                       (.readerIndex buffer)
-                       ":\n"
-                       (with-out-str (b-s/print-bytes actual))
-                       "which really should match\n"
-                       (with-out-str (b-s/print-bytes buffer))))
         ;; Copy that encrypted cookie into the text working area
         (.getBytes buffer 0 text 32 K/server-cookie-length)
-        (log/info (str "After copying " K/server-cookie-length " bytes of that into text,\n"
-                       "starting at offset 32, "
-                       "it looks like\n"
-                       (with-out-str (b-s/print-bytes text))
-                       "and the reader index has moved to "
-                       (.readerIndex buffer)))
         ;; Along with the nonce
         ;; Note that this overwrites the first 16 bytes of the box we just wrapped.
         ;; Go with the assumption that those are the initial garbage 0 bytes that should
@@ -679,12 +665,6 @@
                        client-short-pk (byte-array K/key-length)]
                    (.getBytes server-short-sk-buffer 0 server-short-sk)
                    (.getBytes client-short-key 0 client-short-pk)
-                   (log/info "Keys from cookie/initiate:\nServer secret:\n"
-                             (shared/bytes->string server-short-sk)
-                             "\nClient hidden public:\n"
-                             (shared/bytes->string (::K/clnt-short-pk cookie))
-                             "\nClient-supplied public:\n"
-                             (shared/bytes->string client-short-key))
                    (let [active-client (configure-shared-secrets active-client
                                                                  server-short-sk
                                                                  client-short-pk)]


Fix missing word in text.

Fix missing word in text.

--- src/klangmeister/ui/music_tutorial.cljs
+++ src/klangmeister/ui/music_tutorial.cljs
@@ -78,4 +78,4 @@
    [render-one :bpm handle! state-atom]
    [render-one :key handle! state-atom]
    [:div
-    [:p "Now that you know how to design synthesisers and compose melodies, " [:a {:href "/performance"} "putting the two together"] "."]]])
+    [:p "Now that you know how to design synthesisers and compose melodies, try " [:a {:href "/performance"} "putting the two together"] "."]]])


Fix a client bug releasing sessions.

Fix a client bug releasing sessions.

--- src/shale/client.clj
+++ src/shale/client.clj
@@ -68,8 +68,9 @@
                            :or {reserved nil
                                 tags nil}}]
   (let [url (map->session-url id)
-        body (merge (if reserved {:reserved reserved})
-                    (if tags {:tags tags}))
+        body (merge (if (not (nil? reserved)) {:reserved reserved})
+                    (if tags {:tags tags})
+                    {})
         response (try+
                    (client/put url
                                {:body (json/generate-string body)


Fix :view-form-args spec to always generate valid form args

--- src/main/workflo/macros/specs/view.cljc
+++ src/main/workflo/macros/specs/view.cljc
@@ -12,8 +12,10 @@
     #(s/gen '#{Foo Bar FooBar})))

 (s/def ::view-form-args
-  #?(:cljs (s/and vector? (s/+ symbol?))
-     :clj  (s/coll-of symbol? :kind vector? :min-count 1)))
+  (s/with-gen
+    #?(:cljs (s/and vector? (s/+ symbol?))
+       :clj  (s/coll-of symbol? :kind vector? :min-count 1))
+    #(s/gen '#{[this] [props] [this props]})))

 (s/def ::view-form
   (s/spec (s/cat :form-name symbol?


fixed start return value

fixed start return value

--- src/sormilla/gui.clj
+++ src/sormilla/gui.clj
@@ -180,6 +180,7 @@
                      (try
                        (deref task)
                        (catch Exception _))
-                     (close frame))))
+                     (close frame)))
+                 config)
                (stop! [this]
                  (task/cancel :gui))))


Fix caching behavior.

Fix caching behavior.

--- src/soy_clj/core.clj
+++ src/soy_clj/core.clj
@@ -32,9 +32,12 @@
   "Given the filename (or a vector of filenames) of a Closure template on the
   classpath, parses the templates and returns a compiled set of templates."
   [file-or-files]
-  (let [files (flatten (vector file-or-files))]
-    (swap! template-cache #(cache/through parse-uncached % files))
-    (get @template-cache files)))
+  (let [files (vec (flatten (vector file-or-files)))]
+    (if-let [found (cache/lookup @template-cache files)]
+      found
+      (let [templates (parse-uncached files)]
+        (swap! template-cache assoc files templates)
+        templates))))

 (defn- dash-split
   [s]


debugger: remove support for bare app actions because they are not supoorted by API anymore

--- examples/_common/middleware/devtools.cljs
+++ examples/_common/middleware/devtools.cljs
@@ -250,15 +250,7 @@
                    (update-in m [::debugger :next-action-id] inc))

              ; looks like originating signal could be already sweeped -> create "unknown signal" to record this action
-             (reconcile model a))
-
-           ; for bare app actions (e.g. when dispatching from REPL) create an "unknown signal" event
-           :else
-           (let [[signal-id _ :as unknown-signal-event] (-signal-event (-> model ::debugger :next-signal-id) ::unknown-signal)]
-             (-> model
-                 (update-in [::debugger :signal-events] concat [unknown-signal-event])
-                 (update-in [::debugger :next-signal-id] inc)
-                 (reconcile [::app-action signal-id action]))))))
+             (reconcile model a)))))

 ;;;;;;;;;;;;;;;;;;;;;;;; View model
 (defn -view-model


make data describing stars

make data describing stars

--- src/splash/core.cljs
+++ src/splash/core.cljs
@@ -32,6 +32,14 @@
   ;; (swap! app-state update-in [:__figwheel_counter] inc)
 )

+
+(def num-stars 50)
+(def stars-set (map (fn [n]
+                      (let [depth (math/rand-between 0 8)]
+                        {:x (math/rand-between 0 400)
+                         :y (math/rand-between 0 300)
+                         :z (+ depth (rand))
+                         :depth depth})) (range num-stars)))

 (defn main []
   (go


do xhr when typing happens, update search results

--- src-cljs/core.cljs
+++ src-cljs/core.cljs
@@ -1,6 +1,7 @@
 ;;; -*- Clojure -*- mode
 (ns sledge.core
   (:require-macros [cljs.core.async.macros :refer [go alt!]])
+  (:import [goog.net XhrIo])
   (:require [goog.events :as events]
             [clojure.string :as string]
             [cljs.core.async :as async :refer [>! <! put! chan]]
@@ -52,6 +53,14 @@

 (defn results-view [app owner]
   (reify
+    om/IWillMount
+    (will-mount [_]
+      (let [channel (om/get-state owner :new-results)]
+        (go (loop []
+              (let [tracks (<! channel)]
+                ;(println [:got :tracks tracks])
+                (om/update! app :results tracks)
+                (recur))))))
     om/IRenderState
     (render-state [this {:keys [enqueue]}]
       (apply dom/div nil
@@ -94,8 +103,17 @@
                            {:init-state {:dequeue dequeue}})
              ))))

-(defn handle-change [e owner {:keys [search-term]}]
-  (om/set-state! owner :search-term (.. e -target -value)))
+(defn handle-change [e owner {:keys [new-results search-term]}]
+  (let [term (.. e -target -value)]
+    (om/set-state! owner :search-term term)
+    (.send XhrIo (str "/tracks.json?artist=" term)
+           (fn [e]
+             (let [xhr (.-target e)
+                   o (.getResponseJson xhr)
+                   r (js->clj o)]
+               (println (keys (first r)))
+               (put! new-results r)))
+           "GET")))

 (defn player-view [app owner]
   (reify
@@ -103,6 +121,7 @@
     (init-state [_]
       {:enqueue (chan)
        :search-term ""
+       :new-results (chan)
        :dequeue (chan)})
     om/IRenderState
     (render-state [this state]


Compl porting LFE version of replace_txt_chunks.js to Clojure.

--- content/src/replace_txt_chunks.clj
+++ content/src/replace_txt_chunks.clj
@@ -25,6 +25,8 @@
 ; Helper constants.
 (defmacro EMPTY-STRING []     "")
 (defmacro SPACE        []    " ")
+(defmacro COMMA        []    ",")
+(defmacro POINT        []    ".")
 (defmacro NEW-LINE     []   "\n")
 (defmacro DBG-PREF     [] "==> ")
 (defmacro SPACE-       []  #"\ ")
@@ -38,22 +40,25 @@
         (when (seq words)
             (let [word     (first words)]
             (let [word-len (count word )]
-            (let [word-pos (if (< (- pos 1) word-len) (subs word pos)
+            (let [word-pos (if (< (- pos 1) word-len) (subs word (- pos 1))
                                                       (EMPTY-STRING))]

-            (println (str (DBG-PREF) word))
+;           (println (str (DBG-PREF) word))

             (if (= word (last words)) (throw (Exception.  (str text- word)))
                                       (recur (rest words) (str text- (cond
-                (< (- pos 1) word-len)
+                (and (< (- pos 1) word-len)
+                    (not= word-pos (COMMA))
+                    (not= word-pos (POINT)))
+
                     (let [word- (str (subs word 0 (- pos 1)) subst
                                      (subs word      pos  ))]

-                    (println (str (DBG-PREF) word-))
+;                   (println (str (DBG-PREF) word-))

                     word-)
                 :else (do
-                    (println (str (DBG-PREF) word ))
+;                   (println (str (DBG-PREF) word ))

                     word))
                 (SPACE))))
@@ -73,7 +78,7 @@
 "evaluates to 'true'."
                      (EMPTY-STRING))]

-    (let [pos   7] ; <== Can be set to either from 1 to infinity.
+    (let [pos   3] ; <== Can be set to either from 1 to infinity.
 ;   (let [subst "callable entity"]
 ;   (let [subst "AAA"]
 ;   (let [subst "+-="]


Refactor generators

Refactor generators

--- test/github_changelog/schema_generators.clj
+++ test/github_changelog/schema_generators.clj
@@ -18,53 +18,47 @@
 (def string-title (gen/fmap (partial apply format "%s(%s): %s")
                             (gen/tuple string-std string-std string-std)))

-(defn complete
-  ([gen] #(complete % gen))
-  ([partial-datum gen]
-   (merge (gen/generate gen) partial-datum)))
+(defn complete [gen partial-datum]
+  (merge (gen/generate gen) partial-datum))

-(defmacro defgen [fn-name & body]
+(defmacro defgen [fn-name kv]
   `(do
-     (def ~fn-name (gen/hash-map ~@body))
-     (def ~(symbol (str "complete-" fn-name)) (complete ~fn-name))))
+     (def ~fn-name (apply gen/hash-map (flatten (seq ~kv))))
+     (def ~(symbol (str "complete-" fn-name)) (partial complete ~fn-name))))
+
+(def pull-data
+  {:title    string-std
+   :number   gen/nat
+   :sha      sha
+   :body     string-std
+   :html_url string-std})

 (defgen config
-  :user string-std
-  :repo string-std)
+  {:user string-std
+   :repo string-std})

 (defgen semver
-  :major gen/nat
-  :minor gen/nat
-  :patch gen/nat)
+  {:major gen/nat
+   :minor gen/nat
+   :patch gen/nat})

 (defgen pull
-  :title string-std
-  :number gen/nat
-  :sha sha
-  :body string-std
-  :html_url string-std)
+  pull-data)

 (defgen valid-pull
-  :title string-title
-  :number gen/nat
-  :sha sha
-  :body string-std
-  :html_url string-std)
+  (merge pull-data {:title string-title}))

 (defgen revert-pull
-  :title revert-title
-  :number gen/nat
-  :sha sha
-  :body revert-body
-  :html_url string-std)
+  (merge pull-data  {:title revert-title
+                     :body  revert-body}))

 (defgen change
-  :type gen/string-ascii
-  :scope gen/string-ascii
-  :subject gen/string-ascii
-  :pull-request pull
-  :issues (gen/vector issue))
+  {:type         gen/string-ascii
+   :scope        gen/string-ascii
+   :subject      gen/string-ascii
+   :pull-request pull
+   :issues       (gen/vector issue)})

 (defgen tag
-  :name string-std
-  :sha sha)
+  {:name string-std
+   :sha  sha})


add rotate piece function

add rotate piece function

--- src/t3tr0s/core.cljs
+++ src/t3tr0s/core.cljs
@@ -90,6 +90,19 @@
   []
   (swap! state assoc :board empty-board))

+(defn rotate-piece [piece]
+  (doall (map (fn [[x y]] [(- y) x]) piece))
+  )
+
+(defn test-rotate-piece
+  "Clear the board, write the piece at 5, 9, rotate the piece, write the piece at 5, 1,
+    print the board."
+  [piece-key]
+  (clear-board)
+  (write-piece-to-board (piece-key pieces) 5 9)
+  (write-piece-to-board (rotate-piece (piece-key pieces)) 5 1)
+  (print-board))
+
 (defn test-piece
   "Clear the board, write a piece at 5,9, and print it."
   [piece-key]


Replaced wrong dom node before to display next piece.

--- src/tetris/core.cljs
+++ src/tetris/core.cljs
@@ -126,7 +126,7 @@
     (dom/setTextContent score-el (str level))))

 (defn render-next-piece [{piece-type :type :as p}]
-  (let [score-el (.getElementById js/document "next-img")]
+  (let [score-el (.getElementById js/document "next-img-container")]
     (dom/removeChildren score-el)
     (dom/appendChild score-el (piece-type PIECE-IMAGES))))


Add devtools to dependencies

Add devtools to dependencies

--- frontend/project.clj
+++ frontend/project.clj
@@ -5,17 +5,18 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}

   :min-lein-version "2.6.1"
-
+
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [org.clojure/clojurescript "1.9.183"]
                  [org.clojure/core.async "0.2.385" :exclusions [org.clojure/tools.reader]]
                  [org.omcljs/om "1.0.0-alpha40"]
+                 [binaryage/devtools "0.8.1" :scope "dev"]
                  [cljs-ajax "0.5.8"]                        ; AJAX for om
                  [com.cognitect/transit-cljs "0.8.239"]     ; Better JSON support
                  [figwheel-sidecar "0.5.3-2" :scope "devcards"]
                  [devcards "0.2.1-7" :scope "devcards" :exclusions [org.clojure/clojurescript]]
                  [devcards-om-next "0.1.1" :scope "devcards"]]
-
+
   :plugins [[lein-figwheel "0.5.4-7"]
             [lein-cljsbuild "1.1.3" :exclusions [[org.clojure/clojure]]]
             [lein-ancient "0.6.10"]
@@ -28,16 +29,10 @@
   :cljsbuild {:builds
               [{:id "dev"
                 :source-paths ["src/cruncher"]
-                ;; the presence of a :figwheel configuration here
-                ;; will cause figwheel to inject the figwheel client
-                ;; into your build
                 :figwheel {:on-jsload "cruncher.core/on-js-reload"
-                           ;; :open-urls will pop open your application
-                           ;; in the default browser once Figwheel has
-                           ;; started and complied your application.
-                           ;; Comment this out once it no longer serves you.
                            :open-urls ["http://localhost:3449/index.html"]}
                 :compiler {:main cruncher.core
+                           :preloads [devtools.preload]
                            :asset-path "js/compiled/out"
                            :output-to "resources/public/js/compiled/cruncher.js"
                            :output-dir "resources/public/js/compiled/out"
@@ -73,7 +68,7 @@
              ;; if you want to embed a ring handler into the figwheel http-kit
              ;; server, this is for simple ring servers, if this
              ;; doesn't work for you just run your own server :) (see lien-ring)
-
+
              ;; :ring-handler hello_world.server/handler

              ;; To be able to open files in your editor from the heads up display
@@ -84,7 +79,7 @@
              ;; emacsclient -n +$2 $1
              ;;
              ;; :open-file-command "myfile-opener"
-
+
              ;; if you are using emacsclient you can just use
              ;; :open-file-command "emacsclient"

@@ -95,12 +90,12 @@
              ;; :server-logfile "tmp/logs/figwheel-logfile.log"
              }

-
+
   ;; setting up nREPL for Figwheel and ClojureScript dev
   ;; Please see:
   ;; https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl
-
-
+
+
   :profiles {:dev {:dependencies [[figwheel-sidecar "0.5.4-7"]
                                   [com.cemerick/piggieback "0.2.1"]]
                    ;; need to add dev source path here to get user.clj loaded


(TK-214) Mark helper fn `sanitize-client-cert` as private

--- src/puppetlabs/ring_middleware/core.clj
+++ src/puppetlabs/ring_middleware/core.clj
@@ -10,6 +10,23 @@
             [slingshot.slingshot :refer [try+]])
   (:import (clojure.lang IFn)
            (java.util.regex Pattern)))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;; Private
+
+(defn sanitize-client-cert
+  "Given a ring request, return a map which replaces the :ssl-client-cert with
+  just the certificate's Common Name at :ssl-client-cert-cn.  Also, remove the
+  copy of the certificate put on the request by TK-auth."
+  [req]
+  (-> (if-let [client-cert (:ssl-client-cert req)]
+        (-> req
+            (dissoc :ssl-client-cert)
+            (assoc :ssl-client-cert-cn (ssl-utils/get-cn-from-x509-certificate client-cert)))
+        req)
+      (ks/dissoc-in [:authorization :certificate])))
+

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;; Schemas
@@ -32,18 +49,6 @@
       rr/response
       (rr/status status)
       (rr/content-type "text/plain; charset=utf-8")))
-
-(defn sanitize-client-cert
-  "Given a ring request, return a map which replaces the :ssl-client-cert with
-  just the certificate's Common Name at :ssl-client-cert-cn.  Also, remove the
-  copy of the certificate put on the request by TK-auth."
-  [req]
-  (-> (if-let [client-cert (:ssl-client-cert req)]
-        (-> req
-            (dissoc :ssl-client-cert)
-            (assoc :ssl-client-cert-cn (ssl-utils/get-cn-from-x509-certificate client-cert)))
-        req)
-      (ks/dissoc-in [:authorization :certificate])))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


fixing build

fixing build

--- test/celestial/test/sshj.clj
+++ test/celestial/test/sshj.clj
@@ -1,4 +1,4 @@
 (ns celestial.test.sshj
-  (:use celestial.sshj clojure.test)
+  (:use supernal.sshj clojure.test)
  )


Restore test

Restore test

--- test/expound/alpha_test.cljc
+++ test/expound/alpha_test.cljc
@@ -1284,8 +1284,6 @@
 (defn no-linum [s]
   (string/replace s #"(.cljc?):\d+" "$1:LINUM"))

-;; TODO - fix to be less brittle, since I don't want to update
-;; this and cut a release every time CLJS or CLJ is updated
 (defn spec-error-in-ex-msg? []
   #?(:cljs
      (not (contains? #{"1.10.439"} *clojurescript-version*))
@@ -3067,9 +3065,9 @@
 "
               (binding [s/*explain-out* expound/printer]
                 (expound/explain-results-str (orch.st/with-instrument-disabled (st/check [`results-str-fn2 `results-str-fn3]))))))))
-  ;; TODO - restore
-  #_(testing "check-fn"
-      (is (= "== Checked <unknown> ========================
+
+  (testing "check-fn"
+    (is (= "== Checked <unknown> ========================

 -- Function spec failed -----------

@@ -3095,9 +3093,9 @@
 -------------------------
 Detected 1 error
 "
-             (binding [s/*explain-out* expound/printer]
+           (binding [s/*explain-out* expound/printer]
              ;; warning will persist until https://dev.clojure.org/jira/browse/CLJS-2980 is fixed
-               (expound/explain-result-str (st/check-fn `results-str-fn1 (s/spec `results-str-fn2)))))))
+             (expound/explain-result-str (st/check-fn `results-str-fn1 (s/spec `results-str-fn2)))))))
   #?(:clj (testing "custom printer"
             (is (= "== Checked expound.alpha-test/results-str-fn4


Fix spelling - s/txp/TCP

Fix spelling - s/txp/TCP

--- src/overtone/sc/machinery/server/args.clj
+++ src/overtone/sc/machinery/server/args.clj
@@ -26,7 +26,7 @@
    :num-rand-seeds           {:default 64     :flag "-r" :desc "Number of random seeds"}
    :load-sdefs?              {:default 1      :flag "-D" :desc "Load synthdefs on boot? 0 or 1"}
    :rendezvous?              {:default 0      :flag "-R" :desc "Publish to rendezvous? 0 or 1"}
-   :max-logins               {:default 64     :flag "-l" :desc "Maximum number of named return addresses stored - also maximum number of txp connections accepted."}
+   :max-logins               {:default 64     :flag "-l" :desc "Maximum number of named return addresses stored - also maximum number of TCP connections accepted."}
    :pwd                      {:default nil    :flag "-p" :desc "When using TCP, the session password must be the first command sent."}
    :realtime?                {:default 1                 :desc "Run in realtime mode? If 0 then the other nrt flags must be set"}
    :nrt-cmd-filename         {:default nil               :desc "Command filename for non-realtime mode"}


Fixed order of evaluation problem.

Fixed order of evaluation problem.

--- src/appengine_magic/core.clj
+++ src/appengine_magic/core.clj
@@ -16,8 +16,9 @@

 (defmacro def-appengine-app [app-var-name handler war-root]
   `(def ~app-var-name
-        (let [war-root# ~war-root]
-          {:handler (wrap-file (environment-decorator ~handler) (str war-root#))
+        (let [handler# ~handler
+              war-root# ~war-root]
+          {:handler (wrap-file (environment-decorator handler#) (str war-root#))
            :war-root war-root#})))


default to setting for production

default to setting for production

--- src/babel/english/writer.clj
+++ src/babel/english/writer.clj
@@ -41,8 +41,8 @@
         debug (log/debug (str "using root:" root))
         debug (log/debug (str "using spec:" (strip-refs spec)))

-        use-map-fn map ;; <- development
-;;        use-map-fn pmap ;; <- production
+;;        use-map-fn map ;; <- development
+        use-map-fn pmap ;; <- production

         model (-> ((-> models :en)) deref)
         type-of-model (type model)


CMR-4172: Added comments to db migration.

--- metadata-db-app/src/migrations/055_setup_services_table.clj
+++ metadata-db-app/src/migrations/055_setup_services_table.clj
@@ -35,7 +35,9 @@

 (defn- create-services-indices
   []
+  ;; Supports queries to find service revisions that are deleted
   (h/sql "CREATE INDEX services_crdi ON METADATA_DB.cmr_services (concept_id, revision_id, deleted)")
+  ;; Supports queries to find services by service name
   (h/sql "CREATE INDEX services_vn ON METADATA_DB.cmr_services (service_name)"))

 (defn- create-services-sequence


Focus management #38 - prevent exception when focusable component is added to the one that does not have :focus-state evolver at all


Prepare user-friendly samples #15 - get rid of :use, cleanup


a non-modular balance getter

a non-modular balance getter

--- src/bitsplit_cli/client.cljs
+++ src/bitsplit_cli/client.cljs
@@ -5,19 +5,22 @@
          Operations send-amounts! new-address!)]
         [bitsplit.storage.protocol :only (all)]
         [bitsplit-cli.constants :only (DIR)]
-        [bitsplit-cli.utils :only (call-method)])
+        [bitsplit-cli.utils :only (call-method callback->channel)])
     (:require [cljs.core.async :as a]))
-(def coined (js/require "coined"))

-(defn- fix-bcoin-issue! []
-    (let [emitter (.-EventEmitter (js/require "events"))
-          old-emit (-> emitter .-prototype .-emit)]
-        (set! (-> emitter .-prototype .-emit)
-            (fn [& args]
-                (this-as self
-                    (when (not= (first args) "error")
-                        (.apply old-emit self
-                            (into-array args))))))))
+(def request
+  (partial
+    callback->channel
+    (js/require "request")))
+
+(defn address->balance [address]
+  (->>
+    (request
+      (str "https://blockchain.info/address/"
+        address "?format=json"))
+    (a/map< second) ; channel will contain "response" and "body" (json? idk)
+    (a/map< #(.parse js/JSON %))
+    (a/map< #(.-final_balance %))))

 (defn- account->amount [account]
     {(.getAddress account)
@@ -81,5 +84,3 @@
          change-dust!
          setup-save-loop!
          (->Client)))
-
-(fix-bcoin-issue!)


Add docs string

Add docs string

--- src/bogo_clojure/bg_char.clj
+++ src/bogo_clojure/bg_char.clj
@@ -46,7 +46,10 @@

 (defn add-accent-char
   "Add mark to a character.
-Avaiable accents: :grave :acute :hook :tilde :dot :none"
+Avaiable accents: :grave :acute :hook :tilde :dot :none. If the given
+  accent is not able to add accent, return the original accent
+Usage: (use-accent-char char accent)"
+
   [char accent]

   (if (single-vowel? char)
@@ -69,8 +72,8 @@

 (defn add-mark-char
   "Add mark to a char.
-available marks are  :hat :breve :horn :bar :nomark
-if given char is not possible to add mark, return the original char"
+Available marks are :hat :breve :horn :bar :nomark . If it is not possible
+  to add mark to given char, then return the original char"
   [char mark]
   (let [c (remove-accent-char (string/lower-case char))
         current-accent (get-accent-char char)


Don't adjust z position if there is no wait time between frames.

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -499,7 +499,8 @@
         z-drive (@state :default-z-drive)
         check-z-ref (and z-drive
                          (or (:autofocus event)
-                             (:wait-time-ms event)))]
+                             (when-let [t (:wait-time-ms event)]
+                               (pos? t))))]
     (filter identity
       (flatten
         (list


Fix bug in slice sequence adjustment

Fix bug in slice sequence adjustment

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -219,14 +219,16 @@
         (core loadPropertySequence d p (str-vector s))))
     (reset! active-property-sequences property-sequences)))

-(defn load-slice-sequence [slice-sequence]
+(defn load-slice-sequence [slice-sequence relative-z]
   (when slice-sequence
+    (println slice-sequence relative-z)
     (let [z (core getFocusDevice)
-          delta-z (- (@state :reference-z-position)
-                     (first slice-sequence))
-          adjusted-slices (map #(+ delta-z %) slice-sequence)
+          ref (@state :reference-z-position)
+          adjusted-slices (if relative-z
+                            (map #(+ ref %) slice-sequence)
+                            slice-sequence)
           new-seq (not= [z adjusted-slices] @active-slice-sequence)]
-      (log "adjusted-slices: " adjusted-slices ";" "reference-z-position" (@state :reference-z-position))
+      (println "adjusted-slices: " adjusted-slices ";" "reference-z-position" (@state :reference-z-position))
       (when new-seq
         (core loadStageSequence z (double-vector adjusted-slices)))
       (reset! active-slice-sequence [z adjusted-slices])
@@ -239,11 +241,11 @@
 (defn start-slice-sequence []
   (core startStageSequence (core getFocusDevice)))

-(defn init-burst [length trigger-sequence]
+(defn init-burst [length trigger-sequence relative-z]
   (core setAutoShutter (@state :init-auto-shutter))
   (println "autoshutter:" (core getAutoShutter))
   (load-property-sequences (:properties trigger-sequence))
-  (let [absolute-slices (load-slice-sequence (:slices trigger-sequence))]
+  (let [absolute-slices (load-slice-sequence (:slices trigger-sequence) relative-z)]
     (start-property-sequences (:properties trigger-sequence))
     (start-slice-sequence)
     (swap! state assoc :burst-init-time (elapsed-time @state))
@@ -326,6 +328,7 @@
           wake-time (if (> now (+ target-time 10)) now target-time)]
       (state-assoc! :last-wake-time wake-time)
       (when-not (core isContinuousFocusEnabled)
+        (println "reference z set")
         (state-assoc! :reference-z-position
                       (get-z-stage-position (core getFocusDevice)))))))

@@ -339,7 +342,8 @@
     (condp = (:task event)
       :snap (apply snap-image shutter-states)
       :burst (init-burst (count (:burst-data event))
-                         (:trigger-sequence event))
+                         (:trigger-sequence event)
+                         (:relative-z event))
       nil)))

 (defn collect [event out-queue]


limit the size of burst popping queue

limit the size of burst popping queue

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -384,7 +384,7 @@

 (defn pop-burst-images
   [n timeout-ms]
-  (let [queue (proxy [LinkedBlockingQueue] []
+  (let [queue (proxy [LinkedBlockingQueue] [10]
                 (take [] (let [item (proxy-super take)]
                            (if (instance? Throwable item)
                              (throw item)


excluding type and name

excluding type and name

--- src/celestial/api/audits.clj
+++ src/celestial/api/audits.clj
@@ -11,6 +11,7 @@

 (ns celestial.api.audits
   "Auditing api"
+  (:refer-clojure :exclude  [name type])
   (:require
     [celestial.persistency.audits :as a]
     [celestial.common :refer (import-logging success wrap-errors conflict bad-req)]
@@ -25,6 +26,7 @@
 (defroutes- audits-ro {:path "/audits" :description "Read only audits api"}
   (GET- "/audits" [] {:nickname "getAudits" :summary "Get all audits"}
         (success {:audits (map a/get-audit (a/all-audits))}))
+
   (GET- "/audits/:name" [^:string name] {:nickname "getAudit" :summary "Get audit by name"}
         (success (a/get-audit name))))


adding delete

adding delete

--- src/celestial/api/stacks.clj
+++ src/celestial/api/stacks.clj
@@ -12,11 +12,12 @@
 (ns celestial.api.stacks
   "Stacks api"
    (:require
+    [slingshot.slingshot :refer  [throw+ try+]]
     [celestial.persistency.stacks :as s]
     [celestial.common :refer (success wrap-errors conflict bad-req)]
     [taoensso.timbre :as timbre]
     [swag.model :refer (defmodel)]
-    [swag.core :refer (GET- POST- PUT- DELETE- defroutes-)])
+    [swag.core :refer (GET- POST- PUT- DELETE- defroutes- errors)])
  )

 (timbre/refer-timbre)
@@ -34,6 +35,15 @@
   (POST- "/stacks" [& ^:stack stack] {:nickname "addStack" :summary "Add stack"}
     (wrap-errors (s/add-stack stack) (success {:message "new stack saved"})))

+  (DELETE- "/stacks/:id" [^:int id] {:nickname "deleteStack" :summary "Delete Stack"
+                                          :errorResponses (errors {:bad-req "Stack does not exist"})}
+         (try+
+             (let [spec (s/get-stack! id) int-id (Integer/valueOf id)]
+               (s/delete-stack! int-id)
+               (success {:message "Stack deleted"}))
+             (catch [:type :celestial.persistency/missing-stack] e
+               (bad-req {:message "Stack does not exist"}))))
+
   (PUT- "/stacks/:id" [^:int id & ^:stack stack] {:nickname "updateStack" :summary "Update stack"}
      (if-not (s/stack-exists? id)
           (conflict {:message "Stack does not exists, use POST /stack first"})


keep system stored in galleon/system

keep system stored in galleon/system

--- src/immutant/init.clj
+++ src/immutant/init.clj
@@ -1,5 +1,5 @@
 (ns immutant.init
   (:require [galleon]))

-(galleon/start-system!)
+(alter-var-root #'galleon/system galleon/start-system!)


CLJ-1958 generator for uri?

CLJ-1958 generator for uri?

Signed-off-by: Rich Hickey <2f3b32171da334ad5d7d0db393d0928eef4308ab@gmail.com>

--- src/clj/clojure/spec/gen.clj
+++ src/clj/clojure/spec/gen.clj
@@ -149,6 +149,7 @@
       simple-symbol? (symbol)
       qualified-symbol? (such-that qualified? (symbol-ns))
       uuid? (uuid)
+      uri? (fmap #(java.net.URI/create (str "http://" % ".com")) (uuid))
       bigdec? (fmap #(BigDecimal/valueOf %)
                     (double* {:infinite? false :NaN? false}))
       inst? (fmap #(java.util.Date. %)


color and font

color and font

--- src/clj/just_married/css.clj
+++ src/clj/just_married/css.clj
@@ -93,7 +93,8 @@
 (def main-page
   [[:.container (:desktop grid-config)]
    [:h3 {:color (:dark-red COLOR-PALLETTE)}]
-
+   [:body {:color (:navy COLOR-PALLETTE)
+           :font-family (:alex-brush FONT-FAMILIES)}]
    [:.countdown {:grid-column 1
                  :grid-row 1
                  ;; :color (:marsala COLOR-PALLETTE)


added some data

added some data

--- src/cljs/geoforms/forms.cljs
+++ src/cljs/geoforms/forms.cljs
@@ -4,7 +4,89 @@
             [reagent-forms.core :refer [bind-fields init-field value-of]]))

-;; Pure example from https://github.com/reagent-project/reagent-forms/tree/master/forms-example
+;; Example taken from https://github.com/reagent-project/reagent-forms/tree/master/forms-example
+
+
+;;; DATA
+
+;; should be in firebase
+
+(defonce app-cms
+  (atom
+   {:title "IdeaBox"
+    :instructions-district "1. Choose your district"
+    :instructions-vote     "2. Check ideas you want to support!"
+    :instructions-add      "3. Add your won ideas"
+    :instructions-sign     "4. Sign your choices"}))
+
+(def app-ideas
+  (atom
+   [{:id "1"
+     :timestamp "2013-08-10 11:20:22"
+     :districts ["Brooklyn"]
+     :idea "New skatepark"
+     :desc "Would be really nice to have a new skatepark"
+     :links ["http://lapresse.ca/article-2"]
+     :supporters [""]
+     :category "Other..."}
+    {:id "2"
+     :timestamp "2013-08-10 11:20:24"
+     :districts ["Manhattan"]
+     :idea "More police to prevent steeling"
+     :desc ""
+     :links ["http://lapresse.ca/article-1"]
+     :supporters [""]
+     :category "Security"}
+    {:id "3"
+     :timestamp "2013-08-10 11:20:26"
+     :districts ["Manhattan"]
+     :idea "Create a park near fifth avenue"
+     :desc "Would be awesome to have a park on broadway near fith avenue."
+     :links ["http://lapresse.ca/article-56"]
+     :supporters ["email@email.com" "email2@email.com" "john@hotmail.com"]
+     :category "Green"}]))
+
+(def app-users
+  (atom
+   [{:created "2013-08-10 11:20:22"
+     :fullname "Leon Talbot"
+     :email "email@email.com"
+     :zip-code "G21 2C5" ;; this is canadian zip code.
+     :age "32"
+     :annual-revenue ""
+     :subscribe-idea-alerts true
+     :subscribe-volonteer-idea-alerts false
+     :subscribe-district-alerts true
+     :comments ""}
+    {:created "2013-08-10 11:20:22"
+     :fullname "John Talbot"
+     :email "john@hotmail.com"
+     :zip-code "G21 2C3"
+     :age "33"
+     :annual-revenue ""
+     :subscribe-idea-alerts true
+     :subscribe-volonteer-idea-alerts false
+     :subscribe-district-alerts true
+     :comments ""}
+    {:created "2013-08-10 11:20:22"
+     :fullname "Marc Talbot"
+     :email "email2@email.com"
+     :zip-code "G21 2C2"
+     :age "34"
+     :annual-revenue ""
+     :subscribe-idea-alerts true
+     :subscribe-volonteer-idea-alerts false
+     :subscribe-district-alerts true
+     :comments "better UX please. Thanks."}]))
+
+(def app-cats
+  (atom
+   ["Shops" "Security" "Green" "Other..."]))
+
+(def app-districts
+  (atom ["Manhattan" "Brooklyn" "Queens"]))
+
+

 (defn row [label input]
   [:div.row
@@ -29,8 +111,17 @@
   [:div

    [:h3 "1. Choose your district"]
+   [:div.btn-group {:field :multi-select :id :every.position}
+    [:button.btn.btn-default {:key :left} "Manhattan"]
+    [:button.btn.btn-default {:key :middle} "Brooklyn"]
+    [:button.btn.btn-default {:key :right} "Queens"]]

    [:h3 "2. Check ideas you want to support!"]
+
+   [:div.checkbox
+    [:label
+     [:input.form-control {:field :checkbox :id :i-123}]
+     "A new park near fifth avenue in Times Square"]]

    [:h3 "3. Add your won ideas"]

@@ -163,7 +254,7 @@
                    :many {:options :bar}})]
     (fn []
       [:div
-       [:div.page-header [:h1 "Sample Form"]]
+       [:div.page-header [:h1 (:title @app-cms)]]

        [bind-fields
         form-template


Prevent error when game not intialized yet

--- src/cljs/netrunner/game.cljs
+++ src/cljs/netrunner/game.cljs
@@ -14,6 +14,7 @@
          :log []
          :side :corp
          :corp {:user {:username "" :emailhash ""}
+                :identity {:side "Corp"}
                 :deck []
                 :hand []
                 :discard []
@@ -25,6 +26,7 @@
                 :agenda-point 0
                 :max-hand-size 5}
          :runner {:user {:username "" :emailhash ""}
+                  :identity {:side "Runner"}
                   :deck []
                   :hand []
                   :discard []


Edits to questions (spelling & proper answer)

--- src/cljs/quiz/questions.cljs
+++ src/cljs/quiz/questions.cljs
@@ -23,9 +23,9 @@
    {:question "In the beginning of the 1st book, planet Earth was demolished to make way for what?"
     :choices ["A sub-etha casino."
               "A Galgafrinchian golf course."
-              "A Hyperspace byypass."
+              "A Hyperspace bypass."
               "A space maze for white mice."]
-    :answer  "A Hyperspace byypass."}
+    :answer  "A Hyperspace bypass."}

    {:question "Yeah, that's *their* cover story - but really?"
     :choices ["To kill Arthur Dent, who was inexplicably woven into the fabric of time and space."
@@ -104,7 +104,7 @@
     :choices ["So long, and thanks for all the fish."
               "It was nice, but now it's gone."
               "Take care, and visit us on Santraginus V."]
-    :answer "It was nice, but now it's gone."}
+    :answer "So long, and thanks for all the fish."}
    {:question "What was the name of the daughter of Arthur Dent and Trillian."
     :choices ["Last Call Amanda"
               "Melody Pond"


If the .tmpl file was executable, set the executable bit for the new file.

--- src/com/okl/tokenmgr/cli.clj
+++ src/com/okl/tokenmgr/cli.clj
@@ -30,7 +30,9 @@
     (with-open [reader (io/reader file)
                 writer (io/writer output-file)]
       (doseq [line (line-seq reader)]
-        (.write writer (str (process-line line tokens) "\n"))))))
+        (.write writer (str (process-line line tokens) "\n"))))
+    (if (.canExecute file)
+      (.setExecutable output-file true false))))

 (defn- find-tmpl-files [dir]
   "find all .tmpl files in this directory and below"


[#1215] Fix out-of-date column titles bug

--- backend/src/akvo/lumen/lib/visualisation/map_metadata.clj
+++ backend/src/akvo/lumen/lib/visualisation/map_metadata.clj
@@ -107,7 +107,7 @@
       (parse-box st-extent))))

 (defn get-column-titles [tenant-conn selector-name selector-value]
-  (let [sql-str "SELECT columns, modified FROM dataset_version WHERE %s='%s' ORDER BY modified DESC LIMIT 1"]
+  (let [sql-str "SELECT columns, modified FROM dataset_version WHERE %s='%s' ORDER BY version DESC LIMIT 1"]
     (map (fn [{:strs [columnName title]}]
            {"columnName" columnName
             "title" title})


Use map instead of for for

Use map instead of for for

--- src/catalog/layout/fop.clj
+++ src/catalog/layout/fop.clj
@@ -334,7 +334,7 @@

 (defn entries-sexp [items]
   [:fo:list-block
-   (for [item items] (entry-sexp item))])
+   (map entry-sexp items)])

 (defn- level-to-h [level]
   (keyword (str "h" level)))