almost working solution

almost working solution

--- src/hackerrank/fp/perimeter-polygon.clj
+++ src/hackerrank/fp/perimeter-polygon.clj
@@ -7,6 +7,11 @@
 ;; https://www.mathsisfun.com/algebra/distance-2-points.html

 (def point vector)
+
+(defn point
+  ([v] (vector (first v) (second v)))
+  ([a b] (vector a b)))
+
 (def x first)
 (def y second)
 ;; https://clojuredocs.org/clojure.core/memfn
@@ -28,12 +33,34 @@

 (distance (point 0 0) (point 0 1)) ; => 1

+(point [0 0])
+
 (def input [[0 0]
             [0 1]
             [1 1]
             [1 0]])

-;; (reduce #(+ %1 (distance )))
+(drop 1 (take 5 (cycle input)))
+(drop 1 input)
+
+;; (partition 2 (interleave input (drop 1 (take 5 (cycle input)))))
+;; main solution
+(->> (cycle input)
+     (take 5)
+     (drop 1)
+     (interleave input)
+     (partition 2)
+     (reduce #(+ %1 (distance (first %2) (second %2))) 0))
+
+(defn solution [input]
+  (->> (cycle input)
+       (take 5)
+       (drop 1)
+       (interleave input)
+       (partition 2)
+       (reduce #(+ %1 (distance (first %2) (second %2))) 0)))
+
+(reduce #(+ %1 (distance % )) (take 5 (cycle input)))

 (def input
 "4\n
@@ -51,5 +78,8 @@
                          (take-nth 2 (vec (read-line))))]
         (println numbers)))))

-(map #(Integer/parseInt (str %)) (take-nth 2 (vec "1 0")))
+;; todo: gather input in list
+;; then call on it (solution input)

+;; (map #(Integer/parseInt (str %)) (take-nth 2 (vec "1 0")))
+


CMR-2531: Added comments.

CMR-2531: Added comments.

--- search-app/src/cmr/search/services/query_service.clj
+++ search-app/src/cmr/search/services/query_service.clj
@@ -93,17 +93,14 @@
   (-> (select-keys params (filter keyword? (keys params)))
       common-params/sanitize-params))

-(def ignored-params
-  "A list of unsupported parameters that will be ignored by parameter search."
-  [:tag-namespace])
-
+;; CMR-2553 Remove this function.
 (defn- drop-ignored-params
   "At times, there are unsupported search params in parameter search that we simply want to ignore
-  rather than raise error. This function removes them from the params and returns the end result."
+  rather than raise error. This function removes tag-namespace from the params and returns the params."
   [params]
   (let [drop-params-fn (fn [p]
                          (if (map? p)
-                           (let [p (apply dissoc p ignored-params)]
+                           (let [p (dissoc p :tag-namespace)]
                              (when (seq p) p))
                            p))]

@@ -121,6 +118,7 @@
   (let [[query-creation-time query] (u/time-execution
                                       (->> params
                                            common-params/sanitize-params
+                                           ;; CMR-2553 remove the following line
                                            drop-ignored-params
                                            ;; handle legacy parameters
                                            lp/replace-parameter-aliases


(PDB-1290) fix inner join in migration 29

This fixes an issue with migrations from stable->master if facts exist in the
database without reports. Migration 29 was using an inner join
where a left outer join was required, which was causing the new certnames
table to leave behind everything without an associated report.

To reproduce the original problem,
git checkout stable
* start puppet, puppetdb
git checkout 1aafe0637f59bebf39ae61a1125907f5655b1e59
lein run benchmark -c postgres.ini -F acceptance/benchmark/facts -n 5 -N 20 -r 10
* stop puppetdb, puppet
git checkout master
* restart puppet, puppetdb
<migration fails>

--- src/puppetlabs/puppetdb/scf/migrate.clj
+++ src/puppetlabs/puppetdb/scf/migrate.clj
@@ -962,7 +962,7 @@
       "INSERT INTO certnames_transform(name,latest_report_id,deactivated)
        SELECT c.name, rt.id as latest_report_id, c.deactivated FROM
        certnames c left outer join latest_reports lr on c.name=lr.certname
-       inner join reports_transform rt on lr.report=rt.hash"
+       left outer join reports_transform rt on lr.report=rt.hash"

       "ALTER TABLE edges DROP CONSTRAINT edges_certname_fkey"
       "ALTER TABLE catalogs DROP CONSTRAINT catalogs_certname_fkey"


fixed erlang is-os syntax error

fixed erlang is-os syntax error

--- config/software/erlang.clj
+++ config/software/erlang.clj
@@ -42,7 +42,7 @@
              "--with-ssl=/opt/opscode/embedded"
              "--disable-debug"])
       env (cond
-           (and (is-os? "darwin" (is-machine? "x86_64")))
+           (and (is-os? "darwin") (is-machine? "x86_64"))
            { "CFLAGS" "-arch x86_64 -m64 -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"
              "LDFLAGS" "-arch x86_64 -R/opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"}
            (is-os? "linux")


Fix yada.juxt.pro vhost

Fix yada.juxt.pro vhost

--- dev/src/yada/dev/system.clj
+++ dev/src/yada/dev/system.clj
@@ -71,7 +71,9 @@
          (new-webserver
           {:port 8090
            :raw-stream? true}
-          [{:scheme :http :host "localhost:8090"}]
+          [{:scheme :http :host "localhost:8090"}
+           {:scheme :https :host "yada.juxt.pro"}
+           {:scheme :http :host "yada.juxt.pro"}]
           )
          ::docsite-router (new-router)))


Cleanup

Cleanup


Clean up some indentation

Clean up some indentation

--- test/fcms/integration/api/item/item_retrieval.clj
+++ test/fcms/integration/api/item/item_retrieval.clj
@@ -90,8 +90,7 @@
     (fact "a normal item with the wrong Accept type"
       (item/create-item e i {:description "An item."})
       (let [response (api-request :get "/e/i"
-                                  {:headers {
-                                             :Accept (mime-type :collection)
+                                  {:headers {:Accept (mime-type :collection)
                                              :Content-Type (mime-type :item)}})]
         (:status response) => 406
         (response-mime-type response) => (mime-type :text)
@@ -103,11 +102,8 @@
           (item/create-item e i {:description "An item."})

           ;; Retrieve the item
-          (let [response (api-request :get "/e/i" {
-                                                   :headers {
-                                                             :Accept (mime-type :item)
-                                                             :Content-Type (mime-type :item)
-                                                             }})]
+          (let [response (api-request :get "/e/i" {:headers {:Accept (mime-type :item)
+                                                             :Content-Type (mime-type :item)}})]
             (:status response) => 200
             (response-mime-type response) => (mime-type :item)
             (json? response) => true
@@ -127,10 +123,8 @@
     (fact "a normal item with the wrong Accept-Charset header"
           (item/create-item e i {:description "An item."})
           (let [response (api-request :get "/e/i" {
-                                                   :headers {
-                                                             :Accept (mime-type :item)
-                                                             :Accept-Charset "iso-8859-1"
-                                                             }})]
+                                                   :headers {:Accept (mime-type :item)
+                                                             :Accept-Charset "iso-8859-1"}})]
             (:status response) => 406
             (response-mime-type response) => (mime-type :text)
             (let [item (body-from-response response)]
@@ -139,9 +133,7 @@

     (fact "a collection doesn't exist"
           (let [response (api-request :get "/not-here/i" {
-                                                   :headers {
-                                                             :Accept (mime-type :item)
-                                                             }})]
+                                                   :headers {:Accept (mime-type :item)}})]
             (:status response) => 404
             (response-mime-type response) => (mime-type :text)
             (let [item (body-from-response response)]
@@ -149,9 +141,7 @@

     (fact "an item doesn't exist"
           (let [response (api-request :get "/c/not-here" {
-                                                   :headers {
-                                                             :Accept (mime-type :item)
-                                                             }})]
+                                                   :headers {:Accept (mime-type :item)}})]
             (:status response) => 404
             (let [item (body-from-response response)]
               (.contains item "") => true)))))


Fixes renaming bug introduced in 01ff57be3087c0f30398606fca2703acae94910c

--- src/active/clojure/match.clj
+++ src/active/clojure/match.clj
@@ -384,7 +384,7 @@
         :path-matches-with-binding ::path-matches-with-binding
         :optional-key-exists-with-binding ::optional-key-exists-with-binding
         :optional-path-exists-with-binding ::optional-path-exists-with-binding
-        :optional-key-with-default-binding ::optional-key-matches-with-binding
+        :optional-key-with-default-binding ::optional-key-with-default-binding
         :optional-path-with-default-binding ::optional-path-with-default-binding))

 (defn match-value->matcher


Update is enough for single segment path

--- src/asciinema/player/vt.cljc
+++ src/asciinema/player/vt.cljc
@@ -169,11 +169,11 @@
   ([vt] (scroll-up vt 1))
   ([{:keys [width top-margin bottom-margin char-attrs] :as vt} n]
    (let [filler (empty-line width char-attrs)]
-     (update-in vt [:lines] (fn [lines]
-                              (vec (concat
-                                    (take top-margin lines)
-                                    (scroll-up-lines (subvec lines top-margin (inc bottom-margin)) n filler)
-                                    (drop (inc bottom-margin) lines))))))))
+     (update vt :lines (fn [lines]
+                         (vec (concat
+                               (take top-margin lines)
+                               (scroll-up-lines (subvec lines top-margin (inc bottom-margin)) n filler)
+                               (drop (inc bottom-margin) lines))))))))

 (defn scroll-down-lines [lines n filler]
   (let [height (count lines)
@@ -186,11 +186,11 @@
   ([vt] (scroll-down vt 1))
   ([{:keys [width top-margin bottom-margin char-attrs] :as vt} n]
    (let [filler (empty-line width char-attrs)]
-     (update-in vt [:lines] (fn [lines]
-                              (vec (concat
-                                    (take top-margin lines)
-                                    (scroll-down-lines (subvec lines top-margin (inc bottom-margin)) n filler)
-                                    (drop (inc bottom-margin) lines))))))))
+     (update vt :lines (fn [lines]
+                         (vec (concat
+                               (take top-margin lines)
+                               (scroll-down-lines (subvec lines top-margin (inc bottom-margin)) n filler)
+                               (drop (inc bottom-margin) lines))))))))

 (defn move-cursor-to-col [vt x]
   (-> vt
@@ -442,22 +442,22 @@
                (repeat (- (count line) x) (empty-cell char-attrs)))))

 (defn clear-to-end-of-screen [{{:keys [x y]} :cursor :keys [width height char-attrs] :as vt}]
-  (update-in vt [:lines] (fn [lines]
-                           (let [top-lines (take y lines)
-                                 curr-line (clear-line-right (nth lines y) x char-attrs)
-                                 bottom-lines (repeat (- height y 1) (empty-line width char-attrs))]
-                             (vec (concat top-lines [curr-line] bottom-lines))))))
+  (update vt :lines (fn [lines]
+                      (let [top-lines (take y lines)
+                            curr-line (clear-line-right (nth lines y) x char-attrs)
+                            bottom-lines (repeat (- height y 1) (empty-line width char-attrs))]
+                        (vec (concat top-lines [curr-line] bottom-lines))))))

 (defn clear-line-left [line x char-attrs]
   (vec (concat (repeat (inc x) (empty-cell char-attrs))
                (drop (inc x) line))))

 (defn clear-to-beginning-of-screen [{{:keys [x y]} :cursor :keys [width height char-attrs] :as vt}]
-  (update-in vt [:lines] (fn [lines]
-                           (let [top-lines (repeat y (empty-line width char-attrs))
-                                 curr-line (clear-line-left (nth lines y) x char-attrs)
-                                 bottom-lines (drop (inc y) lines)]
-                             (vec (concat top-lines [curr-line] bottom-lines))))))
+  (update vt :lines (fn [lines]
+                      (let [top-lines (repeat y (empty-line width char-attrs))
+                            curr-line (clear-line-left (nth lines y) x char-attrs)
+                            bottom-lines (drop (inc y) lines)]
+                        (vec (concat top-lines [curr-line] bottom-lines))))))

 (defn clear-screen [{:keys [width height char-attrs] :as vt}]
   (assoc-in vt [:lines] (empty-screen width height char-attrs)))
@@ -490,28 +490,28 @@
 (defn execute-il [{:keys [bottom-margin width height char-attrs] {y :y} :cursor :as vt}]
   (let [n (get-param vt 0 1)
         filler (empty-line width char-attrs)]
-    (update-in vt [:lines] (fn [lines]
-                             (vec (if (<= y bottom-margin)
-                                    (concat
-                                     (take y lines)
-                                     (scroll-down-lines (subvec lines y (inc bottom-margin)) n filler)
-                                     (drop (inc bottom-margin) lines))
-                                    (concat
-                                     (take y lines)
-                                     (scroll-down-lines (drop y lines) n filler))))))))
+    (update vt :lines (fn [lines]
+                        (vec (if (<= y bottom-margin)
+                               (concat
+                                (take y lines)
+                                (scroll-down-lines (subvec lines y (inc bottom-margin)) n filler)
+                                (drop (inc bottom-margin) lines))
+                               (concat
+                                (take y lines)
+                                (scroll-down-lines (drop y lines) n filler))))))))

 (defn execute-dl [{:keys [bottom-margin width height char-attrs] {y :y} :cursor :as vt}]
   (let [n (get-param vt 0 1)
         filler (empty-line width char-attrs)]
-    (update-in vt [:lines] (fn [lines]
-                             (vec (if (<= y bottom-margin)
-                                    (concat
-                                     (take y lines)
-                                     (scroll-up-lines (subvec lines y (inc bottom-margin)) n filler)
-                                     (drop (inc bottom-margin) lines))
-                                    (concat
-                                     (take y lines)
-                                     (scroll-up-lines (drop y lines) n filler))))))))
+    (update vt :lines (fn [lines]
+                        (vec (if (<= y bottom-margin)
+                               (concat
+                                (take y lines)
+                                (scroll-up-lines (subvec lines y (inc bottom-margin)) n filler)
+                                (drop (inc bottom-margin) lines))
+                               (concat
+                                (take y lines)
+                                (scroll-up-lines (drop y lines) n filler))))))))

 (defn execute-dch [{{:keys [x y]} :cursor :keys [width char-attrs] :as vt}]
   (let [vt (if (>= x width) (move-cursor-to-col vt (dec width)) vt)


Simplified the implementation of the user service.

--- src/appengine_magic/services/user.clj
+++ src/appengine_magic/services/user.clj
@@ -2,29 +2,24 @@
   (:import [com.google.appengine.api.users User UserService UserServiceFactory]))

-(defonce *default-user-service* (atom nil))
+(defonce *user-service* (atom nil))

-(defn- get-user-service [& {:keys [service]}]
-  (if (nil? service)
-      (do (when (nil? @*default-user-service*)
-            (reset! *default-user-service* (UserServiceFactory/getUserService)))
-          @*default-user-service*)
-      service))
+(defn get-user-service []
+  (when (nil? @*user-service*)
+    (reset! *user-service* (UserServiceFactory/getUserService)))
+  @*user-service*)

-(defn current-user [& {:keys [service]}]
-  (let [service (get-user-service :service service)]
-    (.getCurrentUser service)))
+(defn current-user []
+  (.getCurrentUser (get-user-service)))

-(defn login-url [& {:keys [service destination]
+(defn login-url [& {:keys [destination]
                     :or {destination "/"}}]
-  (let [service (get-user-service :service service)]
-    (.createLoginURL service destination)))
+  (.createLoginURL (get-user-service) destination))

-(defn logout-url [& {:keys [service destination]
+(defn logout-url [& {:keys [destination]
                      :or {destination "/"}}]
-  (let [service (get-user-service :service service)]
-    (.createLogoutURL service destination)))
+  (.createLogoutURL (get-user-service) destination))


adding docker validation

adding docker validation

--- src/celestial/persistency/systems.clj
+++ src/celestial/persistency/systems.clj
@@ -21,6 +21,7 @@
     [celestial.common :refer (import-logging)]
     [physical.validations :as ph]
     [proxmox.validations :as pv]
+    [docker.validations :as dv]
     [aws.validations :as av]
     [vc.validations :as vc]
     [subs.core :as subs :refer (validate! validation when-not-nil)]
@@ -78,6 +79,7 @@
 (def hyp-to-v {
                :physical ph/validate-entity
                :proxmox pv/validate-entity
+               :docker dv/validate-entity
                :aws av/validate-entity
                :vcenter vc/validate-entity})

@@ -86,10 +88,10 @@
 (validation :user-exists (when-not-nil p/user-exists? "user not found"))

 (def system-base {
-                  :owner #{:required :user-exists}
-                  :type #{:required :type-exists}
-                  :env #{:required :Keyword}
-                  })
+   :owner #{:required :user-exists}
+   :type #{:required :type-exists}
+   :env #{:required :Keyword}
+  })

 (defn validate-system
   [system]


removed om search bar

removed om search bar

--- src/chat/client/views/search_bar.cljs
+++ src/chat/client/views/search_bar.cljs
@@ -1,40 +0,0 @@
-(ns chat.client.views.search-bar
-  (:require-macros [cljs.core.async.macros :refer [go]])
-  (:require [om.core :as om]
-            [om.dom :as dom]
-            [clojure.string :as string]
-            [cljs.core.async :as async :refer [<! put! chan]]
-            [chat.client.dispatcher :refer [dispatch!]]
-            [chat.client.store :as store]
-            [chat.client.views.helpers :refer [debounce]]
-            [chat.client.routes :as routes]))
-
-(defn search-bar-view [data owner]
-  (reify
-    om/IInitState
-    (init-state [_]
-      {:search-chan (chan)})
-    om/IWillMount
-    (will-mount [_]
-      (let [search (debounce (om/get-state owner :search-chan) 500)]
-        (go (while true
-              (let [{:keys [query]} (<! search)]
-                (store/set-search-results! {})
-                (if (string/blank? query)
-                  (do
-                    (routes/go-to! (routes/inbox-page-path {:group-id (routes/current-group)})))
-                  (do
-                    (routes/go-to! (routes/search-page-path {:group-id (routes/current-group)
-                                                             :query query}))
-                    ; consider moving this dispatch! into search-page-view
-                    (dispatch! :search-history [query (@store/app-state :open-group-id)]))))))))
-    om/IRenderState
-    (render-state [_ {:keys [search-chan]}]
-      (dom/div #js {:className "search-bar"}
-        (dom/input #js {:type "search" :placeholder "Search History"
-                        :value (:search-query data)
-                        :onChange
-                        (fn [e]
-                          (let [query (.. e -target -value)]
-                            (store/set-search-query! query)
-                            (put! search-chan {:query query})))})))))


Add support for platform based conditional

Signed-off-by: Greg Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- src/chaintool/build/core.clj
+++ src/chaintool/build/core.clj
@@ -15,10 +15,16 @@
 ;; specific language governing permissions and limitations
 ;; under the License.
 (ns chaintool.build.core
-  (:require [chaintool.build.golang :as golang])
+  (:require [chaintool.build.golang :as golang]
+            [chaintool.util :as util])
   (:refer-clojure :exclude [compile]))

-(defn compile [params]
-  ;; generate golang output (shim, protobufs, etc)
-  ;; FIXME: we need to switch on the Platform type
-  (golang/compile params))
+(def handlers
+  {"org.hyperledger.chaincode.golang" golang/compile})
+
+(defn compile [{:keys [config] :as params}]
+  ;; generate platform output (shim, protobufs, etc)
+  (let [platform (->> config :Platform :Name)]
+    (if-let [handler (handlers platform)]
+      (handler params)
+      (util/abort -1 (str "Unknown platform type: \"" platform "\"")))))


Removed redundant require of date-time

Removed redundant require of date-time

--- src/clj/forma/hadoop/jobs/scatter.clj
+++ src/clj/forma/hadoop/jobs/scatter.clj
@@ -9,7 +9,6 @@
   (:require [cascalog.ops :as c]
             [forma.utils :only (throw-illegal)]
             [forma.reproject :as r]
-            [forma.date-time :as date]
             [forma.schema :as schema]
             [forma.trends.stretch :as stretch]
             [forma.hadoop.predicate :as p]


also sum time tracked in custom fields

also sum time tracked in custom fields

--- src/clj/iwaswhere_web/graph/stats.clj
+++ src/clj/iwaswhere_web/graph/stats.clj
@@ -18,18 +18,36 @@
                          (update-in acc [book] #(+ v (or % 0)))))]
     (reduce book-reducer {} by-story)))

+(defn summed-durations
+  "Calculate time spent as tracked in custom fields."
+  [entry]
+  (let [custom-fields (:custom-fields entry)
+        duration-secs (filter identity (map (fn [[k v]]
+                                              (let [dur (:duration v)]
+                                               (if (= k "#audio")
+                                                 dur
+                                                 (* 60 (or dur 0)))))
+                                            custom-fields))]
+    (apply + duration-secs)))
+
 (defn time-by-stories
   "Calculate time spent per story, plus total time."
   [g nodes]
   (let [story-reducer (fn [acc entry]
                         (let [comment-for (:comment-for entry)
-                              parent (uc/attrs g comment-for)
-                              story (or (:linked-story parent) :no-story)
+                              parent (when comment-for (uc/attrs g comment-for))
+                              story (or (:linked-story parent)
+                                        (:linked-story entry)
+                                        :no-story)
                               acc-time (get acc story 0)
-                              completed-time (:completed-time entry)]
-                          (assoc-in acc [story] (+ acc-time completed-time))))
+                              completed (get entry :completed-time 0)
+                              manual (summed-durations entry)
+                              summed (+ acc-time completed manual)]
+                          (if (pos? summed)
+                            (assoc-in acc [story] summed)
+                            acc)))
         by-story (reduce story-reducer {} nodes)]
-    {:total-time    (apply + (map :completed-time nodes))
+    {:total-time    (apply + (map #(or (:completed-time %) 0) nodes))
      :time-by-story by-story
      :time-by-book  (time-by-books g by-story)}))

@@ -50,7 +68,7 @@
                             :total       (count pomo-nodes)
                             :completed   (count completed)
                             :started     (count started)}
-                           (time-by-stories g pomo-nodes))]
+                           (time-by-stories g day-nodes-attrs))]
       [date-string day-stats])))

 (defn tasks-mapper


debugging

debugging

--- src/clj/rumahsewa141/routes/admin.clj
+++ src/clj/rumahsewa141/routes/admin.clj
@@ -83,6 +83,13 @@
                                         nil
                                         (get-content-fn)))))

+(defn admin-page-test [section get-content-fn
+                       {{username :username} :identity} & [subsection]]
+  (layout/render "member.html" {:username username
+                                :admin true
+                                :section section
+                                :subsection subsection}))
+
 (defn settings-page [subsection req & [get-content-fn]]
   (admin-page "settings" get-content-fn req subsection))

@@ -90,7 +97,7 @@
   {:allowed (:value (db/get-registration-config))})

 (defroutes admin-routes
-  (GET "/admin" req (admin-page "overview" all-users-summary req))
+  (GET "/admin" req (admin-page-test "overview" all-users-summary req))
   (GET "/admin/billing" req (admin-page "billing" all-users req))
   (GET "/admin/payment" req (admin-page "payment" all-users req))
   (GET "/admin/manage" req (admin-page "manage" (other-users req) req))


extract-hooks docstr

extract-hooks docstr

--- src/cljc/commos/delta/compscribe.cljc
+++ src/cljc/commos/delta/compscribe.cljc
@@ -57,15 +57,20 @@
     m))

 (defn- extract-hooks
-  "Return a map of required subscriptions and unsubscriptions with the
-  following keys:
+  "Return [hooks delta]
+
+  Where hooks is a map of required subscriptions and unsubscriptions
+  with the following keys:

   :subs-one ks->val - subscribe hook at ks with val
   :subs-many ks->vals - subscribe hooks at ks with vals
   :unsubs [ks+] - unsubscribe subscriptions at ks

   Subs and unsubs may overlap, unsubs are assumed to be applied
-  first."
+  first.
+
+  delta is adjusted so that it does not assert at keys that are
+  compscribed."
   [spec-map delta]
   (loop [[delta & deltas] (delta/unpack delta)
          subs {}
@@ -331,3 +336,7 @@
                      (some-> (swap-out! chs ch)
                              (unsubs-fn)))))
                spec id)))
+
+;; New
+
+


avoid field confusion

avoid field confusion

--- src/cljs/clj_money/views/budgets.cljs
+++ src/cljs/clj_money/views/budgets.cljs
@@ -423,24 +423,30 @@

 (defn- period-fields-per-total
   [item]
-  [:div
-   [forms/decimal-field item [:spec :total] {:validate [:required]}]])
+  ^{:key "period-field-total"}
+  [forms/decimal-field item [:spec :total] {:validate [:required]}])

 (defn- period-fields-per-average
   [item]
+  ^{:key "period-field-average"}
   [forms/decimal-field item [:spec :average] {:validate [:required]}])

 (defn- period-fields-weekly
   [item]
-  [:div
+  [:<>
+  ^{:key "period-field-amount-per"}
    [forms/decimal-field item [:spec :amount-per] {:validate [:required]}]
+  ^{:key "period-field-start-date"}
    [forms/date-field item [:spec :start-date] {:validate [:required]}]
+  ^{:key "period-field-week-count"}
    [forms/integer-field item [:spec :week-count] {:validate [:required]}]])

 (defn- period-fields-historical
   [item]
-  [:div
+  [:<>
+  ^{:key "period-field-start-date"}
    [forms/date-field item [:spec :start-date] {:validate [:required]}]
+  ^{:key "period-field-round-to"}
    [forms/integer-field item [:spec :round-to]]])

 (defn- deref-and-calc-periods


Remove the weird translucent rect when making a selection

--- src/cljs/goya/components/drawing.cljs
+++ src/cljs/goya/components/drawing.cljs
@@ -332,11 +332,6 @@
         (set! (.-fillStyle preview-context) "rgba(127,127,127,0.3)")
         (let [adjusted-doc-x (inc doc-x)
               adjusted-doc-y (inc doc-y)]
-          (.fillRect preview-context
-             (* mouse-down-x zoom-factor)
-             (* mouse-down-y zoom-factor)
-             (* (- adjusted-doc-x mouse-down-x) zoom-factor)
-             (* (- adjusted-doc-y mouse-down-y) zoom-factor))
           (set! (.-strokeStyle preview-context) "#ffffff")
           (.setLineDash preview-context #js [5])
           (.rect preview-context


fix verified image alignment

fix verified image alignment

--- src/cljs/salava/badge/ui/receive.cljs
+++ src/cljs/salava/badge/ui/receive.cljs
@@ -127,9 +127,9 @@
       [:div#badge-info
        [m/modal-window]
        [:div.panel
-        [:div.panel-body
+        [:div.panel-body
          (if (or verified_by_obf issued_by_obf)
-           (bh/issued-by-obf obf_url verified_by_obf issued_by_obf))
+           [:div.row.flip (bh/issued-by-obf obf_url verified_by_obf issued_by_obf)])
          [:div {:class "row row_reverse"}
           [:div {:class "col-md-3 badge-image"}
            [:div.row


Duration can take a long

Duration can take a long

--- src/clj/flambo/streaming.clj
+++ src/clj/flambo/streaming.clj
@@ -28,7 +28,7 @@

 (defmulti checkpoint (fn [context arg] (class arg)))
 (defmethod checkpoint java.lang.String [streaming-context path] (.checkpoint streaming-context path))
-(defmethod checkpoint java.lang.Long [dstream interval] (.checkpoint dstream (duration (Integer. interval))))
+(defmethod checkpoint java.lang.Long [dstream interval] (.checkpoint dstream (duration interval)))

 (defn socket-text-stream [context ip port]
   (.socketTextStream context ip port))


Remove uses of deprecated ^ macro.

Remove uses of deprecated ^ macro.

--- src/clj/fleetdb/embedded.clj
+++ src/clj/fleetdb/embedded.clj
@@ -10,16 +10,16 @@
     :multi-write :checked-write})

 (defn- dba? [dba]
-  (? (:write-pipe ^dba)))
+  (? (:write-pipe (meta dba))))

 (defn- persistent? [dba]
-  (? (:write-dos ^dba)))
+  (? (:write-dos (meta dba))))

 (defn- ephemeral? [dba]
   (not (persistent? dba)))

 (defn- compacting? [dba]
-  (? (:write-buf ^dba)))
+  (? (:write-buf (meta dba))))

 (defn- replay-command [db query]
   (first (core/query db query)))
@@ -61,8 +61,8 @@
     (init* db {:write-dos write-dos :write-path read-write-path})))

 (defn close [dba]
-  (exec/join-executor (:write-pipe ^dba) 60)
-  (if-let [write-dos (:write-dos ^dba)]
+  (exec/join-executor (:write-pipe (meta dba)) 60)
+  (if-let [write-dos (:write-dos (meta dba))]
     (io/dos-close write-dos))
   (assert (compare-and-set! dba @dba nil))
   true)
@@ -81,19 +81,19 @@
 (defn compact [dba]
   (assert (persistent? dba))
   (assert (not (compacting? dba)))
-  (exec/execute (:write-pipe ^dba)
+  (exec/execute (:write-pipe (meta dba))
     #(let [tmp-path      (io/tmp-path "/tmp" "compact")
            db-comp-start @dba]
        (alter-meta! dba assoc :write-buf (ArrayList.))
        (exec/spawn (fn []
          (write-to db-comp-start tmp-path)
-         (exec/execute (:write-pipe ^dba)
+         (exec/execute (:write-pipe (meta dba))
            (fn []
              (let [dos (io/dos-init tmp-path)]
-               (doseq [post-comp-command (:write-buf ^dba)]
+               (doseq [post-comp-command (:write-buf (meta dba))]
                  (io/dos-write dos post-comp-command))
-               (io/mv tmp-path (:write-path ^dba))
-               (io/dos-close (:write-dos ^dba))
+               (io/mv tmp-path (:write-path (meta dba)))
+               (io/dos-close (:write-dos (meta dba)))
                (alter-meta! dba dissoc :write-buf)
                (alter-meta! dba assoc  :write-dos dos))))))
        true)))
@@ -101,12 +101,12 @@
 (defn query [dba [query-type :as q]]
   (assert (dba? dba))
   (if (write-query-type? query-type)
-    (exec/execute (:write-pipe ^dba)
+    (exec/execute (:write-pipe (meta dba))
       #(let [old-db          @dba
              [new-db result] (core/query old-db q)]
-         (when-let [write-dos (:write-dos ^dba)]
+         (when-let [write-dos (:write-dos (meta dba))]
            (io/dos-write write-dos q)
-           (when-let [#^ArrayList write-buf (:write-buf ^dba)]
+           (when-let [#^ArrayList write-buf (:write-buf (meta dba))]
              (.add write-buf q)))
          (assert (compare-and-set! dba old-db new-db))
          result))


check if pinned resource exist #387

check if pinned resource exist
#387

--- src/clj/swarmpit/handler.clj
+++ src/clj/swarmpit/handler.clj
@@ -407,6 +407,9 @@
     {:keys [usr]}  :identity
     {:keys [data]} :reitit.core/match}]
   (let [user (api/user-by-username (:username usr))]
+    (case (:name data)
+      :service-dashboard (api/service (:id path))
+      :node-dashboard (api/node (:id path)))
     (api/update-dashbboard user (:name data) conj (:id path))
     (resp-ok)))


don't use single map atom

don't use single map atom

--- src/cljs/clj_money/core.cljs
+++ src/cljs/clj_money/core.cljs
@@ -3,7 +3,7 @@
             [secretary.core :as secretary :include-macros true]
             [accountant.core :as accountant]))

-(def app-state (r/atom {}))
+(def current-entity (r/atom nil))

 (def entities
   [{:id 1 :name "Personal"}
@@ -33,23 +33,23 @@
          :data-toggle "dropdown"
          :role "button"
          :aria-haspopup true}
-        (-> @app-state :current-entity :name)
+        (:name @current-entity)
         [:span.caret]]
        [:ul.dropdown-menu
-        (concat
-          (for [entity entities]
-            ^{:key entity} [:li {:class (when (= (:id entity)
-                                                 (:id (:current-entity @app-state)))
-                                          "active")}
-                            [:a {:href "#"
-                                 :on-click (fn []
-                                             (.log js/console "selected entity")
-                                             (swap! app-state
-                                                    #(assoc % :currency-entity entity)))}
-                             (:name entity)]])
-          [[:li.divider {:role "separator"}]
-           [:li
-            [:a {:href "#"} "Manage Entities"]]])]]]]]])
+        (doall
+          (concat
+            (for [entity entities]
+              ^{:key entity} [:li {:class (when (= (:id entity)
+                                                   (:id @current-entity))
+                                            "active")}
+                              [:a {:href "#"
+                                   :on-click (fn []
+                                               (.log js/console "selected entity " (prn-str entity))
+                                               (reset! current-entity entity))}
+                               (:name entity)]])
+            [^{:key :entities-separator} [:li.divider {:role "separator"}]
+             ^{:key :manage-entities} [:li
+              [:a {:href "#"} "Manage Entities"]]]))]]]]]])

 (defn home-page []
   [:div
@@ -70,6 +70,4 @@
   (accountant/dispatch-current!)
   (mount-root))

-(swap! app-state #(assoc % :current-entity (first entities)))
-
 (init!)


Missed class for hexagon fields

Missed class for hexagon fields

--- src/cljs/db_quiz/layout.cljs
+++ src/cljs/db_quiz/layout.cljs
@@ -63,7 +63,9 @@
             disabled? (not (nil? current-field))
             availability (if (or loading? disabled? (not (#{"default" "missed"} ownership)))
                              "unavailable"
-                             "available")]
+                             (case ownership
+                                   "default" "available"
+                                   "missed" "missed"))]
         [:g {:class (join-by-space "hexagon" availability (when (= ownership "active") "active"))
              :on-click (partial logic/pick-field id)}
          [:polygon.hex-outer {:fill (str "url(#" ownership "-outer)")


Working create ideas (hard-coded to all districts)

--- src/cljs/geoforms/forms.cljs
+++ src/cljs/geoforms/forms.cljs
@@ -58,6 +58,35 @@
   "Ensure the signing user exists and their support is noted."
   [doc]
   (db/create-user! (:person doc) @db/supported-ideas))
+
+(defn normalize-idea [idea]
+  (-> idea
+      (update :urls #(into [] (vals (apply sorted-set %))))
+      ;; just add to all districts for now
+      (assoc :districts @db/districts)))
+
+(defn submit-idea!
+  [doc]
+  (prn doc)
+  (db/create-idea! doc))
+
+;; forms
+
+(defonce user-doc
+  (atom {:person {:first-name       "Blake"
+                  :last-name        "Hake"
+                  :email            "blake@hake.fake.com"
+                  :age              :18-24
+                  :alert-ideas?     true
+                  :alert-volunteer? true
+                  :alert-districts? true}}))
+
+(defonce idea-doc
+  (atom {:title     nil
+         :desc      nil
+         :districts nil
+         :category  nil
+         :links     nil}))

 ;;; view helpers

@@ -103,13 +132,16 @@
      [district-toggle d])])

 (defn select-cat-component []
-    [:div.form-group
-     [:select.form-control {:field :list :id :idea.category}
-      [:option
-       {:value "" :disabled true :selected true}
-       "Pick a category..."]
-      (for [c @db/categories]
-        [:option {:value c :key c} c])]])
+  [:div.form-group
+   [:select.form-control
+    {:value (get-in @idea-doc [:category])
+     :on-change #(swap! idea-doc assoc-in [:category]
+                        (-> % .-target .-value))}
+    [:option
+     {:value "" :disabled true :selected true}
+     "Pick a category..."]
+    (for [c @db/categories]
+      [:option {:value c :key (symbol c)} c])]])

 (defn list-idea-blocks-component []
   (let [districts @db/districts]
@@ -130,25 +162,28 @@
          [:a.btn.btn-xs.btn-default {:disabled true} (str "Add idea to " d)]
          [:br]]))]))

-(defn add-idea-form []
-  [:div
-   (input "Idea title" :text :idea.idea)
+(def idea-template
+  [:div
+   (input "Idea title" :text :title)
    [select-cat-component]
    [:p
     [:textarea.form-control
-     {:rows "4" :placeholder "If necessary, add a description"}]]
+     {:rows        "4"
+      :placeholder "If necessary, add a description"
+      :field       :textarea
+      :id          :desc}]]
    (for [i (range 3)]
      [:div {:key i}
-      (input-placeholder "Add a reference URL" :text (symbol (str "idea.url." i)))])])
+      (input "URL" :text (str ":urls." i))])])

 (defn add-idea-component []
   [:div
+   [bind-fields
+    idea-template
+    idea-doc
+    #_ (fn [k v _] (prn k v _))]
    [:button.btn.btn-default
-    {:on-click #(db/create-idea! {:title     "More pizza"
-                                  :desc      "Food for me"
-                                  :districts ["Brooklyn"]
-                                  :category  "Green"
-                                  :links     []})}
+    {:on-click #(-> @idea-doc normalize-idea submit-idea!)}
     "Add your idea"]])

 (defn signature-component []
@@ -218,15 +253,6 @@

 ;;; PAGE
-
-(defonce user-doc
-  (atom {:person {:first-name       "Blake"
-                  :last-name        "Hake"
-                  :email            "blake@hake.fake.com"
-                  :age              :18-24
-                  :alert-ideas?     true
-                  :alert-volunteer? true
-                  :alert-districts? true}}))

 (defn page []
   (fn []


updated help page

updated help page

--- src/cljs/netrunner/help.cljs
+++ src/cljs/netrunner/help.cljs
@@ -145,7 +145,10 @@
                          [:a {:href "https://www.fantasyflightgames.com/en/products/android-netrunner-the-card-game/"} "the official FFG page"] "."]
                         [:p "Decks that are valid and fit within tournament restrictions are marked \"Tournament legal\". "
                          "Decks that fit within the printed influence limit, but not within the tournament restrictions, "
-                         "are marked \"Casual play only\". Decks that do not fit basic deckbuilding rules are marked \"Invalid\"."])}
+                         "are marked \"Casual play only\". Decks that do not fit basic deckbuilding rules are marked \"Invalid\"."]
+                        [:p "Putting cards in your deck that are not yet available for sale (i.e. future spoilers) or ones that are "
+                         "out of competetive rotation will also result in your deck being marked as casual. Such cards "
+                         "should be easy to identify - they are highlighted in the deckbuilder."])}
             {:id "rezaccess"
              :title "How do I rez cards as Corp in the 4.3 run timing window?"
              :content [:p "Sadly, this window is currently unimplemented - you need to ask the Runner manually. "


Cleanup unsued code.

Cleanup unsued code.

--- src/clum/app/components.cljs
+++ src/clum/app/components.cljs
@@ -5,8 +5,7 @@

 (defn button
   [x y state]
-  (let [component-state              (r/atom {:sound-playing? false})
-        {:keys [tick] :as state-val} @state
+  (let [{:keys [tick] :as state-val} @state
         highlighted?                 (-> state-val
                                          (get-in [x y])
                                          :highlighted?
@@ -21,9 +20,6 @@
                                            :div.app-button)]
     [btn-class {:key      (str "button." x "." y)
                 :on-click (fn [evt]
-                            ;;(println "doing the thing with the stuff...")
-                            ;;(audio/play-sine x y)
-                            ;;(swap! component-state update-in [:sound-playing?] not)
                             (ws/send-transit-msg! {:action "button-clicked"
                                                    :type   "broadcast"
                                                    :data   {:x x


Less Unicode rubbish

Less Unicode rubbish

--- test/asciinema/player/vt_test.cljc
+++ test/asciinema/player/vt_test.cljc
@@ -1798,7 +1798,7 @@
   (let [vt (-> (make-vt 4 3) (assoc-in [:parser :param-chars] [0x3b 0x3b 0x31 0x32 0x3b 0x3b 0x32 0x33 0x3b 0x31 0x3b]))]
     (is (= (get-params vt) [0 0 12 0 23 1]))))

-(def gen-unicode-rubbish (gen/vector (gen/choose 0 0x10ffff) 1 100))
+(def gen-unicode-rubbish (gen/vector (gen/choose 0 0x10ffff) 1 20))

 (def gen-color (gen/one-of [(gen/return nil)
                             (gen/choose 0 15)


+TODO

+TODO

--- src/babel/lexiconfn.cljc
+++ src/babel/lexiconfn.cljc
@@ -349,6 +349,7 @@
         true
         lexical-entry))

+  ;; TODO: for here and other rules, allow compiler to emit error message if rule fails like "subject must look like: <verb-subjective>"
 (defn verb-rule [lexical-entry]
   "every verb has at least a subject."
   (cond (and (= (get-in lexical-entry [:synsem :cat]) :verb)


Test for function show-help

Test for function show-help

--- test/emender_jenkins/core_test.clj
+++ test/emender_jenkins/core_test.clj
@@ -13,6 +13,8 @@
 (ns emender-jenkins.core-test
   (:require [clojure.test :refer :all]
             [emender-jenkins.core :refer :all]))
+
+(require '[clojure.tools.cli       :as cli])

 ;
 ; Common functions used by tests.
@@ -160,3 +162,16 @@
         (is (thrown? AssertionError (get-and-check-port "65537")))
         (is (thrown? AssertionError (get-and-check-port "1000000")))))

+(deftest test-show-help
+    "Check the function emender-jenkins.core/show-help."
+    (testing "the function emender-jenkins.core/show-help.")
+        (let [options (cli/parse-opts nil cli-options)]
+            (is (= (with-out-str (show-help (:summary options)))
+                   (str "Usage:\n"
+                        "  -h, --help                     show help\n"
+                        "  -p, --port   PORT              port number on which Emender Jenkins should accepts requests\n"
+                        "  -j, --jenkins-url url          url to Jenkins, for example: http://10.20.30.40:8080/\n"
+                        "  -t, --test-jobs-suffix suffix  test jobs suffix, for example 'test'\n"
+                        "  -f, --fetch-only               just start job fetcher once, then stop processing\n"
+                        "  -c, --config                   just show the actual configuration\n")))))
+


Releasing lein-template

Releasing lein-template

--- lein-template/project.clj
+++ lein-template/project.clj
@@ -1,7 +1,7 @@
 ;; Copyright © 2014 JUXT LTD.

 ;; We call this project modular to make the invocation: lein new modular appname
-(defproject modular/lein-template "0.6.10"
+(defproject modular/lein-template "0.6.11"
   :description "Leiningen template for a full-featured component based app using modular extensions."
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}


+imperfect for 'fare'

+imperfect for 'fare'

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -1088,10 +1088,16 @@
                         :drop-e false
                         :passato "fatto"
                         :future-stem "far"
+                        :imperfect {:1sing "facevo"
+                                     :2sing "facevi"
+                                     :3sing "faceva"
+                                     :1plur "facevamo"
+                                     :2plur "facevate"
+                                     :3plur "facevano"}
                         :present {:1sing "faccio"
                                   :2sing "fai"
                                   :3sing "fa"
-                                    :1plur "facciamo"
+                                  :1plur "facciamo"
                                   :2plur "fate"
                                   :3plur "fanno"}}}]
         [(merge shared-part-of-fare


fix that parameter bug

fix that parameter bug

--- src/ceres_collector/datomic.clj
+++ src/ceres_collector/datomic.clj
@@ -10,11 +10,11 @@
   Database
   (transact [this entry]))

-(defn init-schema [conn path]
+#_(defn init-schema [conn path]
   (d/transact conn (-> path slurp read-string)))

-(defn init [& {:keys [uri schema]} :as opts]
+#_(defn init [& {:keys [uri schema] :as opts}]
   (info "DATOMIC - creating connection ...")
   (let [db-uri (or uri (str "datomic:mem://" (d/squuid)))
         _ (when-not uri


Datasucker only works on rezzed ICE.

Datasucker only works on rezzed ICE.

Otherwise, you can cheat and use it on unrezzed ICE and it will tell you
the name of the ICE in the log.

--- src/clj/game/cards-programs.clj
+++ src/clj/game/cards-programs.clj
@@ -102,7 +102,7 @@
                                                  (ice-strength-bonus state side (- c))))}
                :pass-ice ds :run-ends ds})
     :abilities [{:counter-cost 1 :msg (msg "give -1 strength to " (:title current-ice))
-                 :req (req current-ice)
+                 :req (req (and current-ice (:rezzed current-ice)))
                  :effect (req (update! state side (update-in card [:datasucker-count] (fnil #(+ % 1) 0)))
                               (update-ice-strength state side current-ice))}]}


add number of credits lost to the message

--- src/clj/game/cards-upgrades.clj
+++ src/clj/game/cards-upgrades.clj
@@ -102,7 +102,7 @@
                        (when (< clicknew clickold)
                          (resolve-ability ref side
                            {:req (req this-server)
-                            :msg "force the Runner to lose all credits" :once :per-run
+                            :msg (msg "force the Runner to lose all " (:credit runner) " [Credits]") :once :per-run
                             :effect (effect (lose :runner :credit :all))}
                           card nil))))))
     :leave-play (req (remove-watch state (keyword (str "heinlein" (:cid card)))))}


remove redundant if

remove redundant if

--- src/clj_money/authorization.clj
+++ src/clj_money/authorization.clj
@@ -9,12 +9,11 @@
 (defn get-resource-tag
   "Returns a keyword identifying the type of the resource"
   [resource]
-  (let [result (if (keyword? resource)
-                 resource
-                 (-> resource meta ::resource-type))]
-    (if result
-      result
-      (throw (ex-info "Unable to determine the resource type." {:resource resource})))))
+  (if-let [result (if (keyword? resource)
+                    resource
+                    (-> resource meta ::resource-type))]
+    result
+    (throw (ex-info "Unable to determine the resource type." {:resource resource}))))

 (defn tag-resource
   "Adds meta data to identity the type of the specified resource"


Use helper functions to simplify comic-list component

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -74,13 +74,9 @@
          (when cl-filter
            [:h3 "Filtered by " cl-filter])
          (when (and site comic-list)
-           [:ul (map (id-btn-for-callback
-                      (fn [item]
-                        (r/read-path {:site site
-                                      :comic (:id item)
-                                      :chapter 1
-                                      :page 1})))
-                     comic-list)])]))))
+           [:ul (->> comic-list
+                     (filter-comics cl-filter)
+                     (comic-buttons site))])]))))

 (defn img-component [site
                      {:keys [comic]}


Use slidein animation for ticker

Use slidein animation for ticker

--- src/cljs/hacker_agent/core.cljs
+++ src/cljs/hacker_agent/core.cljs
@@ -62,10 +62,12 @@
     :render (fn [this]
               [:div.nav
                {:style (if (:updated? (r/state this))
-                         {}
-                         {:overflow :hidden
-                          :transition "all 3s ease-in"
-                          :opacity 0})}
+                         {:position :absolute
+                          :top :-25px}
+                         {:top :-25px
+                          :position :absolute
+                          :-webkit-animation  "slidein 3s"
+                          :animation "slidein 3s"})}
                [:p (:value (r/props this))]])}))

 (declare comment-list)


Updated to use locate state & tie form to state

--- src/cljs/htt_schedule/core.cljs
+++ src/cljs/htt_schedule/core.cljs
@@ -83,41 +83,60 @@

 (defn add-session [cursor component]
   (reify
-    om/IRender
-    (render [this]
+    om/IInitState
+    (init-state [this]
+      {:title ""
+       :description ""
+       :twitter-handle ""})
+    om/IRenderState
+    (render-state [this state]
       (dom/div nil
         (dom/h3 nil "Add New Session")
         (dom/form #js {:className "form-horizontal"}
                   (dom/input #js {:type "text"
                                   :className "form-control"
+                                  :value (:title state)
+                                  :onChange (fn [event]
+                                              (om/set-state! component :title
+                                                (-> event .-target .-value)))
                                   :placeholder "Session Title"})
                   (dom/textarea #js {:className "form-control"
                                      :placeholder "Session description"
+                                     :value (:description state)
+                                     :onChange (fn [event]
+                                                 (om/set-state! component :description
+                                                   (-> event .-target .-value)))
                                      :rows "5"})
                   (dom/input #js {:type "text"
                                   :className "form-control"
+                                  :value (:twitter-handle state)
+                                  :onChange (fn [event]
+                                              (om/set-state! component :twitter-handle
+                                                (-> event .-target .-value)))
                                   :placeholder "Twitter handle"})
                   (dom/button #js {:className "btn btn-primary"
                                    :onClick (fn [e]
                                               (.preventDefault e)
-                                              (om/transact! cursor :entries
-                                                            (fn [items]
-                                                              ((fnil conj []) items
-                                                               {:title "summary"
-                                                                :description "date-time"
-                                                                :twitter-handle "notes"}))))}
+                                              (om/transact! cursor :schedule
+                                                            (fn [new-talk]
+                                                              ((fnil conj []) new-talk
+                                                               {:title (:title state)
+                                                                :description (:description state)
+                                                                :twitter-handle (:twitter-handle state)}))))}
                               "Add New Session"))
                ))))

+
 (defn root-component [app owner]
   (reify
     om/IRender
     (render [_]
-      (dom/div #js {:className "container"}
+      (dom/div #js {:className "container"}  ;; creates javascript {className : "container"}
                (dom/p #js {:className "jumbotron" :style #js {:fontSize "42px"} } (:text app))
                (om/build schedule app)
                (om/build add-session app)))))
+

 ;; content header options
 ;; jumbotron


fix parsets sort by sub aggs

fix parsets sort by sub aggs

--- src/cljs/searchbot/parsets.cljs
+++ src/cljs/searchbot/parsets.cljs
@@ -7,11 +7,25 @@
             [searchbot.es :refer [es-agg filtered-agg]]
             [searchbot.input.labels :as labels]))

+(defn- build-sub-aggs [sub-aggs]
+  (if sub-aggs {:aggs sub-aggs} {}))
+
+(defn- sort-sub [sub-aggs]
+  (if-let [sort-field (-> sub-aggs keys first)]
+    {:order {sort-field "desc"}}
+    {}))
+
 (defn- build-parsets-agg
   [terms sub-aggs]
   (reduce (fn [agg-query a-term]
-            {:aggs {(keyword a-term) (merge {:terms {:field a-term}} agg-query)}})
-          (if sub-aggs {:aggs sub-aggs} {}) terms))
+            {:aggs (merge
+                    {(keyword a-term) (merge
+                                       {:terms (merge
+                                                {:field a-term}
+                                                (sort-sub sub-aggs))}
+                                       agg-query)}
+                    sub-aggs)})
+          (build-sub-aggs sub-aggs) terms))

 (defn- walk-buckets [de-buck bucket prefix steps value-path]
   (map #(de-buck % de-buck prefix (first steps) (rest steps) value-path)


Don't make large data structure a const

Don't make large data structure a const

--- src/clojure/nightcode/utils.clj
+++ src/clojure/nightcode/utils.clj
@@ -64,53 +64,53 @@

 (def ^:const clojure-exts #{"clj" "cljs" "cljx" "edn"})
 (def ^:const wrap-exts #{"md" "txt"})
-(def ^:const styles {"as"         SyntaxConstants/SYNTAX_STYLE_ACTIONSCRIPT
-                     "asm"        SyntaxConstants/SYNTAX_STYLE_ASSEMBLER_X86
-                     "bat"        SyntaxConstants/SYNTAX_STYLE_WINDOWS_BATCH
-                     "c"          SyntaxConstants/SYNTAX_STYLE_C
-                     "cc"         SyntaxConstants/SYNTAX_STYLE_C
-                     "cl"         SyntaxConstants/SYNTAX_STYLE_LISP
-                     "cpp"        SyntaxConstants/SYNTAX_STYLE_CPLUSPLUS
-                     "css"        SyntaxConstants/SYNTAX_STYLE_CSS
-                     "clj"        SyntaxConstants/SYNTAX_STYLE_CLOJURE
-                     "cljs"       SyntaxConstants/SYNTAX_STYLE_CLOJURE
-                     "cljx"       SyntaxConstants/SYNTAX_STYLE_CLOJURE
-                     "cs"         SyntaxConstants/SYNTAX_STYLE_CSHARP
-                     "dtd"        SyntaxConstants/SYNTAX_STYLE_DTD
-                     "edn"        SyntaxConstants/SYNTAX_STYLE_CLOJURE
-                     "groovy"     SyntaxConstants/SYNTAX_STYLE_GROOVY
-                     "h"          SyntaxConstants/SYNTAX_STYLE_C
-                     "hpp"        SyntaxConstants/SYNTAX_STYLE_CPLUSPLUS
-                     "htm"        SyntaxConstants/SYNTAX_STYLE_HTML
-                     "html"       SyntaxConstants/SYNTAX_STYLE_HTML
-                     "java"       SyntaxConstants/SYNTAX_STYLE_JAVA
-                     "js"         SyntaxConstants/SYNTAX_STYLE_JAVASCRIPT
-                     "json"       SyntaxConstants/SYNTAX_STYLE_JAVASCRIPT
-                     "jsp"        SyntaxConstants/SYNTAX_STYLE_JSP
-                     "jspx"       SyntaxConstants/SYNTAX_STYLE_JSP
-                     "lisp"       SyntaxConstants/SYNTAX_STYLE_LISP
-                     "lua"        SyntaxConstants/SYNTAX_STYLE_LUA
-                     "makefile"   SyntaxConstants/SYNTAX_STYLE_MAKEFILE
-                     "markdown"   SyntaxConstants/SYNTAX_STYLE_NONE
-                     "md"         SyntaxConstants/SYNTAX_STYLE_NONE
-                     "mustache"   SyntaxConstants/SYNTAX_STYLE_NONE
-                     "pas"        SyntaxConstants/SYNTAX_STYLE_DELPHI
-                     "properties" SyntaxConstants/SYNTAX_STYLE_PROPERTIES_FILE
-                     "php"        SyntaxConstants/SYNTAX_STYLE_PHP
-                     "pl"         SyntaxConstants/SYNTAX_STYLE_PERL
-                     "pm"         SyntaxConstants/SYNTAX_STYLE_PERL
-                     "py"         SyntaxConstants/SYNTAX_STYLE_PYTHON
-                     "rb"         SyntaxConstants/SYNTAX_STYLE_RUBY
-                     "s"          SyntaxConstants/SYNTAX_STYLE_ASSEMBLER_X86
-                     "sbt"        SyntaxConstants/SYNTAX_STYLE_SCALA
-                     "scala"      SyntaxConstants/SYNTAX_STYLE_SCALA
-                     "sh"         SyntaxConstants/SYNTAX_STYLE_UNIX_SHELL
-                     "sql"        SyntaxConstants/SYNTAX_STYLE_SQL
-                     "tcl"        SyntaxConstants/SYNTAX_STYLE_TCL
-                     "tex"        SyntaxConstants/SYNTAX_STYLE_LATEX
-                     "txt"        SyntaxConstants/SYNTAX_STYLE_NONE
-                     "xhtml"      SyntaxConstants/SYNTAX_STYLE_XML
-                     "xml"        SyntaxConstants/SYNTAX_STYLE_XML})
+(def styles {"as"         SyntaxConstants/SYNTAX_STYLE_ACTIONSCRIPT
+             "asm"        SyntaxConstants/SYNTAX_STYLE_ASSEMBLER_X86
+             "bat"        SyntaxConstants/SYNTAX_STYLE_WINDOWS_BATCH
+             "c"          SyntaxConstants/SYNTAX_STYLE_C
+             "cc"         SyntaxConstants/SYNTAX_STYLE_C
+             "cl"         SyntaxConstants/SYNTAX_STYLE_LISP
+             "cpp"        SyntaxConstants/SYNTAX_STYLE_CPLUSPLUS
+             "css"        SyntaxConstants/SYNTAX_STYLE_CSS
+             "clj"        SyntaxConstants/SYNTAX_STYLE_CLOJURE
+             "cljs"       SyntaxConstants/SYNTAX_STYLE_CLOJURE
+             "cljx"       SyntaxConstants/SYNTAX_STYLE_CLOJURE
+             "cs"         SyntaxConstants/SYNTAX_STYLE_CSHARP
+             "dtd"        SyntaxConstants/SYNTAX_STYLE_DTD
+             "edn"        SyntaxConstants/SYNTAX_STYLE_CLOJURE
+             "groovy"     SyntaxConstants/SYNTAX_STYLE_GROOVY
+             "h"          SyntaxConstants/SYNTAX_STYLE_C
+             "hpp"        SyntaxConstants/SYNTAX_STYLE_CPLUSPLUS
+             "htm"        SyntaxConstants/SYNTAX_STYLE_HTML
+             "html"       SyntaxConstants/SYNTAX_STYLE_HTML
+             "java"       SyntaxConstants/SYNTAX_STYLE_JAVA
+             "js"         SyntaxConstants/SYNTAX_STYLE_JAVASCRIPT
+             "json"       SyntaxConstants/SYNTAX_STYLE_JAVASCRIPT
+             "jsp"        SyntaxConstants/SYNTAX_STYLE_JSP
+             "jspx"       SyntaxConstants/SYNTAX_STYLE_JSP
+             "lisp"       SyntaxConstants/SYNTAX_STYLE_LISP
+             "lua"        SyntaxConstants/SYNTAX_STYLE_LUA
+             "makefile"   SyntaxConstants/SYNTAX_STYLE_MAKEFILE
+             "markdown"   SyntaxConstants/SYNTAX_STYLE_NONE
+             "md"         SyntaxConstants/SYNTAX_STYLE_NONE
+             "mustache"   SyntaxConstants/SYNTAX_STYLE_NONE
+             "pas"        SyntaxConstants/SYNTAX_STYLE_DELPHI
+             "properties" SyntaxConstants/SYNTAX_STYLE_PROPERTIES_FILE
+             "php"        SyntaxConstants/SYNTAX_STYLE_PHP
+             "pl"         SyntaxConstants/SYNTAX_STYLE_PERL
+             "pm"         SyntaxConstants/SYNTAX_STYLE_PERL
+             "py"         SyntaxConstants/SYNTAX_STYLE_PYTHON
+             "rb"         SyntaxConstants/SYNTAX_STYLE_RUBY
+             "s"          SyntaxConstants/SYNTAX_STYLE_ASSEMBLER_X86
+             "sbt"        SyntaxConstants/SYNTAX_STYLE_SCALA
+             "scala"      SyntaxConstants/SYNTAX_STYLE_SCALA
+             "sh"         SyntaxConstants/SYNTAX_STYLE_UNIX_SHELL
+             "sql"        SyntaxConstants/SYNTAX_STYLE_SQL
+             "tcl"        SyntaxConstants/SYNTAX_STYLE_TCL
+             "tex"        SyntaxConstants/SYNTAX_STYLE_LATEX
+             "txt"        SyntaxConstants/SYNTAX_STYLE_NONE
+             "xhtml"      SyntaxConstants/SYNTAX_STYLE_XML
+             "xml"        SyntaxConstants/SYNTAX_STYLE_XML})

 (defn get-extension
   "Returns the extension in the given path name."