CMR-1122: Commented out db synchronization job.

--- bootstrap-app/src/cmr/bootstrap/system.clj
+++ bootstrap-app/src/cmr/bootstrap/system.clj
@@ -43,7 +43,7 @@
                     ;; Setting the parent-collection-cache to cache parent collection umm
                     ;; of granules during bulk indexing.
                     (assoc-in [:caches g/parent-collection-cache-key]
-                           (cache/create-cache :lru {} {:threshold 2000}))
+                              (cache/create-cache :lru {} {:threshold 2000}))
                     ;; Specify an Elasticsearch http retry handler
                     (assoc-in [:db :config :retry-handler] bi/elastic-retry-handler))
         sys {:log (log/create-logger)
@@ -65,12 +65,14 @@
              :collection-index-channel (chan 100)

              ;; Channel for asynchronously sending database synchronization requests
-             :db-synchronize-channel (chan)
+             ;; Uncomment the following line before enabling db synchronization job
+             ;:db-synchronize-channel (chan)

              :catalog-rest-user (mdb-config/catalog-rest-db-username)
              :db (oracle/create-db (mdb-config/db-spec "bootstrap-pool"))
              :web (web/create-web-server (transmit-config/bootstrap-port) routes/make-api)
-             :scheduler (jobs/create-clustered-scheduler `system-holder bootstrap-jobs/jobs)
+             ;; Uncomment the following line to enable db synchronization job
+             ;:scheduler (jobs/create-clustered-scheduler `system-holder bootstrap-jobs/jobs)
              :zipkin (context/zipkin-config "bootstrap" false)
              :relative-root-url (transmit-config/bootstrap-relative-root-url)}]
     (transmit-config/system-with-connections sys [:metadata-db])))
@@ -86,7 +88,7 @@
         started-system (update-in started-system [:metadata-db] mdb-system/start)
         started-system (reduce (fn [system component-name]
                                  (update-in system [component-name]
-                                            #(lifecycle/start % system)))
+                                            #(when % (lifecycle/start % system))))
                                started-system
                                component-order)]

@@ -105,7 +107,7 @@
   (info "bootstrap System shutting down")
   (let [stopped-system (reduce (fn [system component-name]
                                  (update-in system [component-name]
-                                            #(lifecycle/stop % system)))
+                                            #(when % (lifecycle/stop % system))))
                                this
                                (reverse component-order))
         stopped-system (update-in stopped-system [:metadata-db] mdb-system/stop)


Allow entities to be stored in maps

Allow entities to be stored in maps

--- src/play_clj/entities.clj
+++ src/play_clj/entities.clj
@@ -11,11 +11,20 @@
 (defprotocol Entity
   (draw-entity! [this screen batch] "Draws the entity"))

+(defn draw-map!
+  [m screen batch]
+  (doseq [[k v] m]
+    (try
+      (draw-entity! v screen batch)
+      (catch Exception _))))
+
 (extend-protocol Entity
   clojure.lang.PersistentArrayMap
-  (draw-entity! [this screen batch])
+  (draw-entity! [this screen batch]
+    (draw-map! this screen batch))
   clojure.lang.PersistentHashMap
-  (draw-entity! [this screen batch])
+  (draw-entity! [this screen batch]
+    (draw-map! this screen batch))
   nil
   (draw-entity! [this screen batch]))


remove unused function added back in bad merge

--- src/hundred_pushups/android/core.cljs
+++ src/hundred_pushups/android/core.cljs
@@ -212,11 +212,6 @@
                                               (dispatch [:db/save]))}
             [text {:style {:color "white" :text-align "center" :font-weight "bold"}} "Remove"]]])]]])))

-
-(defn invalid-mode []
-  [view {:style {:flex-direction "column" :align-items "center"}}
-   [text {:style {:font-size 20 :font-weight "100" :margin-bottom 10 :text-align "center"}} "Bad user, how did you get here."]])
-
 (defn show-stage [stage]
   [view {:style {:flex-direction "column" :align-items "center"}}
     [show-header "100 Pushup Challenge", "Become a pushup master"]


Refactored & added docstrings to the lambda-blog.templates.entries namespace.

--- src/lambda_blog/templates/entries.clj
+++ src/lambda_blog/templates/entries.clj
@@ -18,6 +18,7 @@
                (apply a {:href url} contents)))))

 (defn entry
+  "Creates an HTML `atricle` representing an `ent`ry."
   [{:keys [author contents next path-to-root previous timestamp title] :as ent}]
   (article
    (header
@@ -46,9 +47,14 @@
                     (i {:class [:fa :fa-chevron-right]})))))))
    contents))

-(def entry-page (partial page entry))
+(defn entry-page
+  "Creates an HTML page containing an `ent`ry formatted by [[entry]]."
+  [ent]
+  (page entry ent))

-(defn entry-summary [{:keys [author contents path path-to-root tags timestamp title] :as ent}]
+(defn entry-summary
+  "Creates an HTML article representing a summarized `ent`ry."
+  [{:keys [author contents path path-to-root tags timestamp title] :as ent}]
   (article
    (header
     (panel
@@ -59,10 +65,12 @@
        (p "Posted on " (time (format-date timestamp))
           " by " author)
        (entry-tags ent)))))
-   contents))
+   contents)) ;; FIXME This should be shortened somehow.

-(defn recent-entries [ent]
-  (page (fn [{:keys [archives entries path-to-root]}]
+(defn recent-entries
+  "Creates an HTML page containing a list of [[entry-summary]]'ies of 15 most recent `entries` and a link to the `archives`."
+  [{:keys [archives entries path-to-root] :as ent}]
+  (page (fn [_]
           [(map (juxt entry-summary (constantly (hr)))
                 (->> entries
                      (sort-by :timestamp)
@@ -76,8 +84,10 @@
                panel)])
         ent))

-(defn entries-by-tag [{:keys [id] :as ent}]
-  (page (fn [{:keys [archives entries path-to-root]}]
+(defn entries-by-tag
+  "Creates an HTML page containing a list of [[entry-summary]]'ies of `entries` tagged with a tag identified by `id` and a link to the `archives`."
+  [{:keys [archives entries id path-to-root] :as ent}]
+  (page (fn [_]
           [(panel (text-centered (h1 (format "Tagged %s" id))))
            (map (juxt entry-summary (constantly (hr)))
                 (->> entries


fix js-reserved type

fix js-reserved type

--- src/main/cljs/cljs/core.cljs
+++ src/main/cljs/cljs/core.cljs
@@ -10014,7 +10014,7 @@
        "null"])

 (def
-  ^{:jsdoc ["@type {*}"]}
+  ^{:jsdoc ["@type {null|Object}"]}
   js-reserved nil)

 (defn- js-reserved? [x]


Redirect / to index.html

Redirect / to index.html

--- src/replme/web/routes.clj
+++ src/replme/web/routes.clj
@@ -1,12 +1,14 @@
 (ns replme.web.routes
-  (:require [compojure.core :refer [routes ANY]]
+  (:require [compojure.core :refer [routes ANY GET]]
             [compojure.route :as route]
             [compojure.handler :as handler]
+            [ring.util.response :as resp]
             [liberator.core :refer [resource]]))

 (defn- main-routes
   []
   (routes
+   (GET "/" [] (resp/resource-response "index.html" {:root "public"}))
    (route/resources "/")
    (route/not-found "/404.html")))


selfdual.clj: added a main entry point.

selfdual.clj: added a main entry point.

--- clojure/org/gavrog/clojure/selfdual2d.clj
+++ clojure/org/gavrog/clojure/selfdual2d.clj
@@ -49,3 +49,8 @@
           dsym (lazy-seq (DefineBranching2d. dset 3 3 Whole/ZERO))
           :when (good? dsym)]
     (.canonical dsym))))
+
+;; Main entry point when used as a script
+
+(defn -main [& args]
+  (doseq [ds (d-syms (Integer/parseInt (first args)))] (println (str ds))))


Fix bug relating to rand-nth on empty collection

--- src/robinson/crafting.clj
+++ src/robinson/crafting.clj
@@ -887,20 +887,24 @@
               (filter (comp (partial item-satisfies-requirement-clause? item) second))
               vec))

-  (let [idx (->> requirements
-              ; add index
-              (map-indexed vector)
-              ; remove the 'each symbol at the head
-              rest
-              ; filter where item satisfies the clause (keeping [index clause] strucuture
-              (filter (comp (partial item-satisfies-requirement-clause? item) second))
-              ; random [index clause]
-              rand-nth
-              ; extract index of clause to replace
-              first)]
-    (log/info "idx" idx)
-    ; replace clause with
-    (assoc requirements idx [:item/id (get item :item/id)])))
+  (let [index-clauses (->> requirements
+                        ; add index
+                        (map-indexed vector)
+                        ; remove the 'each symbol at the head
+                        rest
+                        ; filter where item satisfies the clause (keeping [index clause] strucuture
+                        (filter (comp (partial item-satisfies-requirement-clause? item) second)))]
+    (if (seq index-clauses)
+      (let [idx (-> index-clauses
+                  ; random [index clause]
+                  rand-nth
+                  ; extract index of clause to replace
+                  first)]
+        (log/info "idx" idx)
+        ; replace clause with
+        (assoc requirements idx [:item/id (get item :item/id)]))
+      ; if not clauses - don't update requirements
+      requirements)))

 (defn save-recipe
   [state]


Find starting point at the expense of starting place creation

--- src/robinson/worldgen.clj
+++ src/robinson/worldgen.clj
@@ -4,6 +4,7 @@
         robinson.common
         robinson.viewport
         robinson.world
+        [robinson.lineofsight :exclude [-main]]
         robinson.npc
         [robinson.mapgen :exclude [-main]])
   (:require
@@ -78,6 +79,25 @@

 (def island-fns
   (vec (map cliskn/compile-fn (:nodes island-node))))
+
+(defn find-starting-pos [seed max-x max-y]
+  (let [angle (dg/rand-nth (range (* 2 Math/PI)))
+        radius (/ (min max-x max-y) 2)
+        [cx cy] [(/ max-x 2) (/ max-y 2)]
+        [x y]   [(+ (* radius (Math/cos angle)) cx)
+                 (+ (* radius (Math/sin angle)) cy)]
+        points  (line-segment [x y] [cx cy])
+        samples (take-nth 5 points)
+        _       (cliskp/seed-simplex-noise! seed)
+        non-water-samples (remove
+          (fn [[x y]]
+            (let [s (mapv #(.calc ^clisk.IFunction % (double (/ x max-x)) (double (/ y max-y)) (double 0.0) (double 0.0))
+                              island-fns)]
+            (or (= s [0.0 0.4 0.5])
+                (= s [0.0 0.5 0.6]))))
+          samples)
+        [sx sy] (first non-water-samples)]
+    (xy->pos sx sy)))

 (defn init-island
   "Create an island block. `x` and `y` denote the coordinates of the upper left cell in the block."
@@ -204,9 +224,11 @@
         remaining-hotkeys      (set (clojure.string/join (second hotkey-groups)))
         ;; calculate place-id and viewport position using minimal state information
         place-id               (xy->place-id {:world {:viewport {:width width :height height}}} x y)
-        [vx vy]                (place-id->anchor-xy {:world {:viewport {:width width :height height}}} place-id)
-        starting-pos           {:x (int (+ vx (/ width 2)))
-                                :y (int (+ vy (/ height 2)))}
+
+        starting-pos           (find-starting-pos seed max-x max-y)
+        viewport-state         {:world {:viewport {:width width :height height}}}
+        [vx vy]                (place-id->anchor-xy viewport-state
+                                                    (apply xy->place-id viewport-state (pos->xy starting-pos)))
         _ (debug "starting-pos" starting-pos)
         place-0                (init-island seed vx vy width height max-x max-y)
         fruit-ids              [:red-fruit :orange-fruit :yellow-fruit :green-fruit :blue-fruit :purple-fruit :white-fruit :black-fruit]


stringify list for notes as well

stringify list for notes as well

same as for documents and photos, notes map to a list in cassandra.

--- src/kixi/hecuba/api/entities.clj
+++ src/kixi/hecuba/api/entities.clj
@@ -24,6 +24,7 @@
                                                             (dissoc :device-ids)
                                                             (update-stringified-lists [:documents])
                                                             (update-stringified-lists [:photos])
+                                                            (update-stringified-lists [:notes])
                                                             (update-in [:property-data] json/encode)
                                                             ))}))))


Support added default imports for 0.18 projects

--- src/lt/plugins/elm_light/elm_ast.cljs
+++ src/lt/plugins/elm_light/elm_ast.cljs
@@ -332,13 +332,14 @@

 (defn get-core-modules [all-modules]
   (->> (filter #(= "elm-lang/core" (-> % :package :name)) all-modules)
-                     (group-by #(-> % :ast :moduleDeclaration :value))))
+       (group-by #(-> % :ast :moduleDeclaration :value))))

 ;; TODO: Could potentially be memoized...
 (defn get-default-candidates
   "Get candidates for Elm default imports as per
   https://github.com/elm-lang/core"
   [modules]
+  (println (-> (get modules "String") first :package))
   (->> (concat
          (->> (get modules "Basics")
               (mapcat get-exposed-declarations)
@@ -384,8 +385,13 @@
               (map #(assoc % :candidate-tokens
                       (if (= "::" (:value %))
                         #{"::"}
-                        #{(str "List." (:value %))})))))
-      (map #(assoc % :default-candidate? true))))
+                        #{(str "List." (:value %))}))))
+
+         ;; 0.18 specific
+         (->> (get modules "Tuple")
+              (mapcat get-exposed-declarations)
+              (map #(assoc % :candidate-tokens #{(str "Tuple." (:value %))}) )))
+       (map #(assoc % :default-candidate? true))))

 (def get-default-candidates-memo


add clojure 1.8 to retrieved API versions


LaTeX backslash interfered with clojure.

--- src/main/clojure/conexp/math/util.clj
+++ src/main/clojure/conexp/math/util.clj
@@ -79,7 +79,7 @@

 ;;; Combinatorics
 (defn binomial-coefficient
-   "Straight forward computing of ${n\choose k}$ by multiplying
+   "Straight forward computing of ${n\\choose k}$ by multiplying
   all (n-k) factors, where `run' is incremented up to k, divided by
   the incrementing divisor `run'"
   [n k]


Clear cache in teardown method of MemoizedFixture

--- src/main/clojure/lazytest/fixture.clj
+++ src/main/clojure/lazytest/fixture.clj
@@ -39,11 +39,12 @@
   (setup [this]
 	 (swap! cache (fn [value]
 			(if (= ::unset value) (f) value))))
-  (teardown [this] nil))
+  (teardown [this]
+	    (reset! cache ::unset)))

 (defn memoized-fixture
   "Returns a fixture whose setup method calls, returns, and caches the
-  value of f. The fixture's teardown method does nothing."
+  value of f. The fixture's teardown method clears the cache."
   [f]
   {:pre [(fn? f)]}
   (MemoizedFixture. f (atom ::unset)))


Added Content-Type to Access-Control-Allow-Headers, so that non-standard content types (application/json) can be used. Fixes #26.

--- src/ruuvi_server/util.clj
+++ src/ruuvi_server/util.clj
@@ -98,7 +98,7 @@
                  {:headers
                   (merge (:headers response)
                          {"Access-Control-Allow-Origin" "*"
-                          "Access-Control-Allow-Headers" "X-Requested-With"
+                          "Access-Control-Allow-Headers" "X-Requested-With, Content-Type"
                           "Access-Control-Allow-Methods" options})})]
       cors-response
       )))


only add github link if source present

only add github link if source present

--- src/main/cljs_api_gen/result.clj
+++ src/main/cljs_api_gen/result.clj
@@ -44,9 +44,10 @@

 (defn add-github-link
   [{:keys [lines repo tag filename] :as source}]
-  (let [url (str "https://github.com/clojure/" repo "/blob/" tag "/" filename
-              "#" (string/join "-" (map #(str "L" %) lines)))]
-    (assoc source :url url)))
+  (when source
+    (let [url (str "https://github.com/clojure/" repo "/blob/" tag "/" filename
+                "#" (string/join "-" (map #(str "L" %) lines)))]
+      (assoc source :url url))))

 (defn add-github-links
   [item]


comment load-image internals

comment load-image internals

--- src-cljs/jasons-game/ui.cljs
+++ src-cljs/jasons-game/ui.cljs
@@ -116,13 +116,18 @@
 (defn load-image [id]
   (if-let [img (images id)]
     (if (symbol? img)
+      ; s/load-image on the base64 image data
       (let [ext (last (split id #"\."))
             url (str "data:image/" ext ";base64," img)
             loaded-image (s/load-image url)]
         (def images (assoc images id loaded-image)))
+      ; return the cached image
       img)
+
+    ; not loaded yet, go get it via alax call
     (GET (str "/image/" id) {:handler (fn [response]
-                                        (def images (assoc images id response)))})))
+                                        ; can't call s/load-image here because we're not in the dynamic scope for the *processing* binding
+                                        (def images (assoc images id response)))})))  ; so just store the base64 image data in the map

 (defn init []
   (js/Processing.


filter contacts according to existing pernoal chats

--- src_practitioner/practitioner/subs.cljs
+++ src_practitioner/practitioner/subs.cljs
@@ -27,9 +27,13 @@
  (fn [db _]
    (let [remote-data (:patients db)
          data-key (get-data-key remote-data)
-         patients (vals (get remote-data data-key))]
+         all-patients (get remote-data data-key)
+         patients-ids (set (keys all-patients))
+         personal-chats @(subscribe [:personal-chats])
+         personal-chats-ids (map :id personal-chats)
+         patients (select-keys all-patients (apply disj patients-ids personal-chats-ids))]
      (if (= (:status remote-data) :succeed)
-       (assoc remote-data data-key patients)
+       (assoc remote-data data-key (vals patients))
        remote-data))))

 (reg-sub


Remove 'built with' link from apidocs.

Remove 'built with' link from apidocs.

--- docs/src/main/clojure/immutant/docs/generate_codox_docs.clj
+++ docs/src/main/clojure/immutant/docs/generate_codox_docs.clj
@@ -52,7 +52,6 @@

 (defn our-header [project]
   [:div#header
-   [:h2 "Generated by " (link-to "https://github.com/weavejester/codox" "Codox")]
    [:h2 (link-to "../index.html" "Immutant Manual")]
    [:h2 (link-to "http://immutant.org/" "Immutant Home")]
    [:h1 (link-to "index.html" (h (#'html/project-title project)))]])


passed some values through that I need to create a correct funnel

--- src-cljs/frontend/components/build.cljs
+++ src-cljs/frontend/components/build.cljs
@@ -204,7 +204,7 @@
                         (not (:dismiss-config-errors build-data)))
                (om/build build-config/config-errors build))]]]])))))

-(defn upgrade-banner [{:keys [build view]} owner]
+(defn upgrade-banner [{:keys [build project-data user view]} owner]
   (reify
     om/IRender
     (render [_]
@@ -252,6 +252,8 @@
                      (not (get-in project-data [:project :feature_flags :oss]))
                      (= :banner (om/get-shared owner  [:ab-tests :upgrade_banner])))
                (om/build upgrade-banner {:build build
+                                         :project-data project-data
+                                         :user user
                                          :view view}))
              (om/build notices {:build-data (dissoc build-data :container-data)
                                 :project-data project-data


Heating Systems.

Heating Systems.

--- src-cljs/kixi/hecuba/tabs/profiles.cljs
+++ src-cljs/kixi/hecuba/tabs/profiles.cljs
@@ -441,6 +441,57 @@
                   [(text-control item state owner :age ":age")
                    (text-control item state owner :construction_date ":construction_date")]))]
               [:p "No extensions."]))])]))))
+
+(defn heating-systems-row [profiles owner]
+  (reify
+    om/IRenderState
+    (render-state [_ state]
+      (html
+       [:div.col-md-12
+        (for [profile profiles]
+          [:div {:class (profile-column-width)}
+           (bs/panel
+            "Heating Systems"
+            (if-let [heating-systems (seq (:heating-systems profile))]
+              [:div {:class (profile-column-width)}
+               (for [item heating-systems]
+                 (bs/panel
+                  "Heating System"
+                  [(text-control item state owner :heating_type "Heating Type")
+                   (text-control item state owner :heat_source "Heat Source")
+                   (text-control item state owner :heat_transport "Heat Transport")
+                   (text-control item state owner :heat_delivery "Heat Delivery")
+                   (text-control item state owner :heat_delivery_source "Heat Delivery Source")
+                   (text-control item state owner :efficiency_derivation "Efficiency Derivation")
+                   (text-control item state owner :boiler_type "Boiler Type")
+                   (text-control item state owner :boiler_type_other "Boiler Type Other")
+                   (text-control item state owner :fan_flue "Fan Flue")
+                   (text-control item state owner :open_flue "Open Flue")
+                   (text-control item state owner :fuel "Fuel")
+                   (text-control item state owner :heating_system "Heating System")
+                   (text-control item state owner :heating_system_other "Heating System Other")
+                   (text-control item state owner :heating_system_type "Heating System Type")
+                   (text-control item state owner :heating_system_type_other "Heating System Type Other")
+                   (text-control item state owner :heating_system_solid_fuel "Heating System Solid Fuel")
+                   (text-control item state owner :heating_system_solid_fuel_other "Heating System Solid Fuel Other")
+                   (text-control item state owner :bed_index "Bed Index")
+                   (text-control item state owner :make_and_model "Make and Model")
+                   (text-control item state owner :controls "Controls")
+                   (text-control item state owner :controls_other "Controls Other")
+                   (text-control item state owner :controls_make_and_model "Controls Make and Model")
+                   (text-control item state owner :emitter "Emitter")
+                   (text-control item state owner :trvs_on_emitters "TRVs on Emitters")
+                   (text-control item state owner :use_hours_per_week "Use Hours per Week")
+                   (text-control item state owner :installer "Installer")
+                   (text-control item state owner :installer_engineers_name "Installer Engineers Name")
+                   (text-control item state owner :installer_registration_number "Installer Registration Number")
+                   (text-control item state owner :commissioning_date "Commissioning Date")
+                   (text-control item state owner :inspector "Inspector")
+                   (text-control item state owner :inspector_engineers_name "Inspector Engineers Name")
+                   (text-control item state owner :inspector_registration_number "Inspector Registration Number ")
+                   (text-control item state owner :inspection_date "Inspection Date")
+                   (text-control item state owner :efficiency "Efficiency")]))]
+              [:p "No heating systems."]))])]))))

 (defn profile-rows [profiles owner]
   (reify
@@ -472,8 +523,8 @@

          ;; dwelling details
          (om/build conservatories-row profiles)
-         ;; (om/build heating-systems profiles)
          (om/build extensions-row profiles)
+         (om/build heating-systems-row profiles)
          ;; (om/build hot-water-systems profiles)
          ;; (om/build storeys profiles)
          ;; (om/build walls profiles)


Send AB properties on tracking

Send AB properties on tracking

--- src-cljs/frontend/analytics/core.cljs
+++ src-cljs/frontend/analytics/core.cljs
@@ -134,7 +134,7 @@
 (def BuildEvent
   (analytics-event-schema {:build {s/Keyword s/Any}}))

-(defn- add-properties-to-track-from-state [current-state]
+(defn- properties-to-track-from-state [current-state]
   "Get a map of the mutable properties we want to track out of the
   state. Also add a timestamp."
   {:user (get-in current-state state/user-login-path)
@@ -146,9 +146,9 @@
 (defn- supplement-tracking-properties [{:keys [properties current-state]}]
   "Fill in any unsuppplied property values with those supplied
   in the current app state."
-  (-> current-state
-      (add-properties-to-track-from-state)
-      (merge properties)))
+  (merge (properties-to-track-from-state current-state)
+         {:ab-test-treatments (ab/ab-test-treatments)}
+         properties))

 (defn- current-subpage
   "Get the subpage for a pageview. If there is a subpage as well as a tab, the subpage


attempting to get timers to start properly

--- src/terraboot/cluster.clj
+++ src/terraboot/cluster.clj
@@ -16,11 +16,11 @@
                     {:name "dcos-download.service" :content (snippet "systemd/dcos-download.service")}
                     {:name "dcos-setup.service" :command "start" :content (clojure.string/trim-newline (snippet "systemd/dcos-setup.service")) :enable true}
                     {:name "cadvisor.service" :command "start" :content (snippet "systemd/cadvisor.service") :enable true}
-                    {:name "docker-cleanup.service" :command "start" :content (snippet "systemd/docker-cleanup.service")}
-                    {:name "docker-cleanup.timer" :command "start" :content (snippet "systemd/docker-cleanup.timer") :enable true}
+                    {:name "docker-cleanup.service" :content (snippet "systemd/docker-cleanup.service")}
+                    {:name "docker-cleanup.timer" :command "start" :content (snippet "systemd/docker-cleanup.timer")}
                     {:name "install-confd.service" :command "start" :content (snippet "systemd/install-confd.service")}
                     {:name "confd.service" :command "start" :content (snippet "systemd/confd.service") :enable true}
-                    {:name "install-awscli.service" :command "start" :content (snippet "systemd/install-awscli.service")}]
+                    {:name "install-awscli.service" :command "start" :content (snippet "systemd/install-awscli.service") :enable true}]
             :update {:reboot-strategy "off"}}
    :write_files [{:path "/etc/mesosphere/setup-packages/dcos-provider-aws--setup/pkginfo.json"
                   :content "{}\n"}
@@ -86,7 +86,7 @@
                                                 :content (snippet "system-files/backup-witan.sh")
                                                 :permissions "0744"}]})
                     (add-to-systemd [{:name "backup.service" :content (snippet "systemd/backup.service")}
-                                     {:name "backup.timer" :command "start" :content (snippet "systemd/backup.timer") :enable true}] )  )))
+                                     {:name "backup.timer" :command "start" :content (snippet "systemd/backup.timer")}] )  )))

 (defn mesos-public-slave-user-data
   []


주기적 트윗 코드 추가.

주기적 트윗 코드 추가.

--- src/tweetbook/handler.clj
+++ src/tweetbook/handler.clj
@@ -7,11 +7,18 @@
             [compojure.route :as route]
             [noir.session :as session]
             [ring.middleware.session.memory :refer [memory-store]]
+            [overtone.at-at :refer [every mk-pool]]
+            [tweetbook.models.config :refer [tweet-interval]]
+            [tweetbook.models.tweet :refer [tweet-random]]
             [tweetbook.routes.auth :refer [auth-routes]]
             [tweetbook.routes.home :refer [home-routes]]))

+(def thread-pool (mk-pool))
+
 (defn init []
-  (println "tweetbook is starting"))
+  (do
+    (println "tweetbook is starting")
+    (every tweet-interval #(tweet-random) thread-pool)))

 (defn destroy []
   (println "tweetbook is shutting down"))


Move out unused plugin code from main-area

--- src/omchaya/components/main_area.cljs
+++ src/omchaya/components/main_area.cljs
@@ -2,145 +2,23 @@
   (:require [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer put! close!]]
             [clojure.string :as string]
             [omchaya.datetime :as dt]
-            [omchaya.emoticons :as emoticons]
+            [omchaya.plugins :as plugins]
             [omchaya.utils :as utils]
             [om.core :as om]
             [sablono.core :as html :refer-macros [html]]))

 (def delimiter-re #" ")

-(defn mention [name]
-  [:span [:span.mention name] " "])
-
-(defn mentions [activity-pieces current-user-email users settings author]
-  (map (fn [piece]
-         (let [[_ pre username post] (re-find #"(.*)@(\w+)(.*)" piece)]
-           (if-let [at (and (string? piece)
-                            (some #{username} (map (comp :username second) users)))]
-             (list pre (mention username) post)
-             piece)))
-       activity-pieces))
-
-(defn emoticon [emoji]
-  [:img.emoticon-embed.small {:src   (:src emoji)
-                              :class (:css emoji)
-                              :title (:title emoji)}])
-
-(defn emoticons [activity-pieces]
-  (let [helper (fn [piece]
-                 (if (string? piece)
-                   (if-let [emoji (get emoticons/known-emoticons (string/trim piece))]
-                     (emoticon emoji)
-                     piece)
-                   piece))]
-    (map helper activity-pieces)))
-
-(defn links [activity-pieces]
-  (let [helper (fn [piece]
-                 (if-let [link (and (string? piece)
-                                    (re-find #"https?://.*" piece))]
-                   [:a.href {:target "_blank"
-                             :href link} link]
-                   piece))]
-    (map helper activity-pieces)))
-
-(defn pastie [activity-pieces]
-  (let [max-preview-length 300
-        max-preview-lines  4
-        original           (string/join " " activity-pieces)]
-    (if (re-find #"\n.*\n" original)
-      [[:pre.pastie
-        [:a.pastie-link {:href "#"
-                         :on-click (constantly false)} "View pastie"]
-        [:br]
-        (let [preview (as-> original preview
-                            (if (> (count (string/split #"\n" preview)) max-preview-lines)
-                              (string/join "\n" (take max-preview-lines (string/split #"\n" preview)))
-                              preview)
-                            (if (> (count preview) max-preview-length)
-                              (subs preview 0 max-preview-length)
-                              preview))]
-          (list preview (when (not= (count preview) (count original)) "...")))]]
-      activity-pieces)))
-
-(defn slash-me [activity-pieces current-user-email users]
-  (if (= (first activity-pieces) "/me")
-    (let [user (get users current-user-email)]
-      (assoc-in activity-pieces [0] (:username user)))
-    activity-pieces))
-
-(defn slash-play [activity-pieces]
-  ;; Should actually insert a audio player component
-  (let [[command url & rest] activity-pieces]
-    (if (= command "/play")
-      (concat [[:strong
-                [:a.audio-play "Playing "
-                 [:a {:target "_blank"
-                      :href url} url]]]] rest)
-      activity-pieces)))
-
-(defn rgb-embed [activity-pieces]
-  (map (fn [piece]
-         (if-let [[_ pre r g b post] (re-find #"(.*)rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)(.*)" piece)]
-           (list pre
-                 [:span.color-preview
-                  {:style #js {:background-color (str "rgb(" r "," g "," b ")")}}]
-                 post)
-           piece)) activity-pieces))
-
-(defn hex-embed [activity-pieces]
-  (map (fn [piece]
-         (if-let [[_ pre hex post] (re-find #"(.*)#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})(.*)" piece)]
-           (list pre
-                 [:span.color-preview
-                  {:style #js {:background-color (str "#" hex)}}]
-                 post)
-           piece)) activity-pieces))
-
-(defn image-embed [activity-pieces]
-  (map (fn [piece]
-         (if (re-find #"http.*\.(jpg|jpeg|gif|png)" piece)
-           [:div.image-preview
-            [:a {:target "_blank"
-                 :href piece}
-             [:img.image-embed {:src piece}]]]
-           piece)) activity-pieces))
-
-(defn youtube-embed [activity-pieces]
-  (map (fn [piece]
-         (if-let [[_ video-id] (and (re-find #"https?.+www.youtube.com.+watch" piece)
-                                    (re-find #"\Wv=([\w|\-]*)" piece))]
-           [:div.youtube-preview
-            [:iframe {:width "560"
-                      :height "315"
-                      :src (str "http://www.youtube.com/embed/" video-id)
-                      :frameBorder 0
-                      :allowFullScreen true}]]
-           piece)) activity-pieces))
-
-(defn vimeo-embed [activity-pieces]
-  (map (fn [piece]
-         (if-let [[_ video-id] (re-find #"^https?://vimeo.com/(\d+)" piece)]
-           [:div.vimeo-preview
-            [:iframe {:width "500"
-                      :height "281"
-                      :src (str "http://player.vimeo.com/video/" video-id)
-                      :frameBorder 0
-                      :webkitAllowFullScreen true
-                      :mozAllowFullScreen true
-                      :allowFullScreen true}]]
-           piece)) activity-pieces))
-
 (defn activity-content [current-user-email users settings author activity]
   (let [content (-> (string/split (:content activity) delimiter-re)
-                    pastie
-                    (mentions current-user-email users settings author)
-                    (slash-me current-user-email users)
-                    slash-play
-                    emoticons
-                    links
-                    rgb-embed
-                    hex-embed)]
+                    plugins/pastie
+                    (plugins/mentions current-user-email users settings author)
+                    (plugins/slash-me current-user-email users)
+                    plugins/slash-play
+                    plugins/emoticons
+                    plugins/links
+                    plugins/rgb-embed
+                    plugins/hex-embed)]
     (interpose " " content)))

 (defn activity-entry [current-user-email users settings author activity]


Pass the original event through.

Pass the original event through.

--- src/onyx/peer/pipeline_extensions.clj
+++ src/onyx/peer/pipeline_extensions.clj
@@ -18,7 +18,7 @@
 (defn merge-api-levels [f event]
   (reduce
    (fn [result g]
-     (merge result (f g)))
+     (merge result (f g result)))
    event
    [name-dispatch ident-dispatch type-and-medium-dispatch type-dispatch]))


Sketch new solver

Sketch new solver

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -454,123 +454,74 @@
 ;;   failed (no possible solutions)
 ;;   changed (possible solutions, los/his changed)
 ;;   unchanged (possible solutions, los/his unchanged)
-;; propagate may assume that los and his are within its current bounds
-;; push stores the current state of the constraint
-;; split either:
-;;   breaks the solutions into two branches, sets one branch and stores the other, returns true
+;; split-left either:
+;;   breaks the solutions into two branches, sets the left branch, returns true
 ;;   has only one possible solution, does nothing, returns false
-;; pop restores the last push/split state
-
-(def unchanged 0)
-(def changed 1)
-(def failed 2)
-
-;; lower and upper are inclusive
-(deftype Contains [iterator ^:mutable lower ^:mutable upper ixes pushed|split pushed-nodes pushed-ixes split-lowers split-uppers]
+;; split-right:
+;;   breaks the solutions into two branches, sets the right branch
+
+;; solver remembers ixes, handles copying los/his
+;; solver push los/his when splitting and remembers who split
+;; solver checks changed/failed, sets dirty
+
+(deftype Contains [iterator right-los failed-los]
   Object
   (reset [this]
-         (.reset iterator)
-         (dotimes [i (alength lower)]
-           (aset lower i least)
-           (aset upper i greatest))
-         (let [key (.seek-gte iterator lower)]
-           (aset lower 0 (aget key 0)))
-         (aclear pushed-nodes)
-         (aclear pushed-ixes)
-         (aclear split-lowers)
-         (aclear split-uppers))
+         (.reset iterator))
   (propagate [this los his]
-             (check (key-lte los his) (pr-str los his))
-             (check (key-lte lower upper) (pr-str lower upper))
-             (debug :before-propagate lower upper los his)
-             (let [this-changed? false]
+             ;; widen los/his to just the bounds we can use here
+             (loop [i 0]
+               (when (< i (alength los))
+                 (if (identical? (aget los i) (aget his i))
+                   (recur (+ i 1))
+                   (loop [i (+ i 1)]
+                     (when (< i (alength los))
+                       (aset los i least)
+                       (aset his i greatest)
+                       (recur (+ i 1)))))))
+             ;; update los
+             (let [new-los (or (.seek-gte iterator los) failed-los)]
                (loop [i 0]
-                 (when (< i (alength ixes))
-                   (let [ix (aget ixes i)
-                         old-lo (aget lower i)
-                         old-hi (aget upper i)
-                         new-lo (aget los ix)
-                         new-hi (aget his ix)]
-                     (when (val-lt old-lo new-lo)
-                       (aset lower i new-lo)
-                       (set!! this-changed? true))
-                     (when (val-lt new-hi old-hi)
-                       (aset upper i new-hi)
-                       (set!! this-changed? true))
-                     (when (identical? new-lo new-hi)
-                       (recur (+ i 1))))))
-               ;; TODO only seek on change, including split as change
-               (let [key (.seek-gte iterator lower)
-                     that-changed? false]
-                 (debug :propagate-with key)
-                 (if (or (nil? key)
-                         (key-lt upper key))
-                   failed
-                   (loop [i 0]
-                     (let [ix (aget ixes i)
-                           old-lo (aget los ix)
-                           old-hi (aget his ix)
-                           new-lo (aget key i)
-                           new-hi (aget upper i)]
-                       (if (val-lt old-hi new-lo)
-                         failed
-                         (do
-                           (aset lower i new-lo)
-                           (when (val-lt old-lo new-lo)
-                             (aset los ix new-lo)
-                             (set!! that-changed? true))
-                           (when (val-lt new-hi old-hi)
-                             (aset his ix new-hi)
-                             (set!! that-changed? true))
-                           (if (and (< (+ i 1) (alength ixes)) (identical? new-lo new-hi))
-                             (recur (+ i 1))
-                             (do
-                               (debug :after-propagate lower upper los his)
-                               (check (key-lte los his) (pr-str los his))
-                               (check (key-lte lower upper) (pr-str lower upper))
-                               (if (true? that-changed?)
-                                 changed
-                                 unchanged)))))))))))
-  (push [this]
-        (apush pushed|split true)
-        (apush pushed-nodes (.-node iterator))
-        (apush pushed-ixes (.-ix iterator)))
-  (split [this]
-         ;; split by value of next unset var
-         (loop [i 0]
-           (if (< i (alength ixes))
-             (if (identical? (aget lower i) (aget upper i))
-               (recur (+ i 1))
-               (do
-                 (apush pushed|split false)
-                 (apush split-uppers (aclone upper))
-                 (let [old-lo (aget lower i)
-                       new-lo (aget (.seek-gte iterator lower) i)]
-                   (if (val-lt new-lo old-lo)
-                     (aset upper i old-lo)
-                     (aset upper i new-lo)))
-                 (apush split-lowers (aclone upper)) ;; the lower for right-hand branch is the next key after the upper for the left-hand branch
-                 true))
-             false)))
-  (pop [this]
-       (if (true? (.pop pushed|split))
-         (do
-           (set! (.-node iterator) (.pop pushed-nodes))
-           (set! (.-ix iterator) (.pop pushed-ixes)))
-         (do
-           (set! lower (.seek-gt iterator (.pop split-lowers)))
-           (set! upper (.pop split-uppers))))))
-
-(defn contains [iterator ixes]
-  (let [lower (least-key (alength ixes))
-        upper (greatest-key (alength ixes))
-        key (.seek-gte iterator lower)]
-    (aset lower 0 (aget key 0))
-    (Contains. iterator lower upper ixes #js [] #js [] #js [] #js [] #js [])))
+                 (when (< i (alength los))
+                   (aset los i (aget new-los i))
+                   (if (identical? (aget new-los i) (aget his i))
+                     (recur (+ i 1)))))))
+  (split-left [this los his]
+              ;; fix the value of the first non-fixed var
+              (loop [i 0]
+                (when (< i (alength los))
+                  (if (identical? (aget los i) (aget his i))
+                    (recur (+ i 1))
+                    (aset his i (aget los i))))))
+  (split-right [this los his]
+               ;; copy the los
+               (dotimes [i (alength los)]
+                 (aset right-los i (aget los i)))
+               ;; find the his for the left branch...
+               (loop [i 0]
+                 (when (< i (alength right-los))
+                   (if (identical? (aget right-los i) (aget his i))
+                     (recur (+ i 1))
+                     (loop [i (+ i 1)]
+                       (when (< i (alength right-los))
+                         (aset right-los i greatest)
+                         (recur (+ i 1)))))))
+               ;; ...and then seek past it
+               (let [new-los (or (.seek-gt iterator right-los) failed-los)]
+                 (loop [i 0]
+                   (when (< i (alength los))
+                     (aset los i (aget new-los i))
+                     (if (identical? (aget new-los i) (aget his i))
+                       (recur (+ i 1))))))))
+
+(defn contains [iterator]
+  (let [key-len (.-key-len (.-tree iterator))]
+    (Contains. iterator (make-array key-len) (greatest-key key-len))))

 ;; SOLVER

-(deftype Solver [constraints ^:mutable los ^:mutable his ^:mutable depth pushed-los pushed-his ^:mutable end?]
+;; TODO replace last-changed with dirty tracking
+(deftype Solver [constraints constraint->ixes constraint->los constraint->his ^:mutable los ^:mutable his ^:mutable depth pushed-los pushed-his pushed-splitters ^:mutable failed?]
   Object
   (reset [this]
          (dotimes [i (alength constraints)]
@@ -581,58 +532,87 @@
          (set! depth 0)
          (aclear pushed-los)
          (aclear pushed-his)
+         (aclear pushed-splitters)
          (set! end? false))
+  (write-bounds [this current]
+                (let [current-ixes (aget constraint->ixes current)
+                      current-los (aget constraint->los current)
+                      current-his (aget constraint->his current)]
+                 (dotimes [i (alength current-ixes)]
+                   (let [ix (aget current-ixes i)]
+                     (aset current-los i (aget los ix))
+                     (aset current-his i (aget his ix))))))
+  (read-bounds [this current]
+               (let [current-ixes (aget constraint->ixes current)
+                     current-los (aget constraint->los current)
+                     current-his (aget constraint->his current)
+                     changed? false]
+                 (dotimes [i (alength current-ixes)]
+                   (let [ix (aget current-ixes i)
+                         new-lo (aget current-los i)
+                         new-hi (aget current-his i)]
+                     (when (val-lt (aget los ix) new-lo)
+                       (set!! changed? true)
+                       (aset los ix new-lo))
+                     (when (val-lt new-hi (aget his ix))
+                       (set!! changed? true)
+                       (aset his ix new-hi))
+                     (when (val-lt (aget his ix) (aget los ix))
+                       (set! failed? true))))
+                 changed?))
   (split [this current]
-         (debug :splitting los his)
+         (debug :splitting los his (map #(.-lower %) constraints) (map #(.-upper %) constraints))
+         (apush pushed-los (aclone los))
+         (apush pushed-his (aclone his))
+         (set! depth (+ depth 1))
          (loop [splitter current]
-           (if (true? (.split (aget constraints splitter)))
-             (do
-               (apush pushed-los (aclone los))
-               (apush pushed-his (aclone his))
-               (set! depth (+ depth 1))
-               (dotimes [i (alength constraints)
-                         :when (not (identical? i splitter))]
-                 (.push (aget constraints i)))
-               splitter)
+           (.write-bounds this splitter)
+           (.split-left (aget constraints splitter) (aget constraint->los splitter) (aget constraint->his splitter))
+           (if (true? (.read-bounds this splitter))
+             (apush pushed-splitters splitter)
              (let [new-splitter (mod (+ splitter 1) (alength constraints))]
                (if (identical? new-splitter current)
                  (assert false "Can't split anything!")
                  (recur new-splitter))))))
-  (pop [this]
-       (set! los (.pop pushed-los))
-       (set! his (.pop pushed-his))
-       (set! depth (- depth 1))
-       (dotimes [i (alength constraints)]
-         (.pop (aget constraints i))))
+  (backtrack [this]
+             (set! los (.pop pushed-los))
+             (set! his (.pop pushed-his))
+             (set! depth (- depth 1))
+             (let [splitter (.pop pushed-splitters)]
+               (.write-bounds this splitter)
+               (.split-right (aget constraints splitter) (aget constraint->los splitter) (aget constraint->his splitter))
+               (.read-bounds this splitter)))
   (next [this]
         (debug :next los his pushed-los pushed-his)
-        (when (false? end?)
-          (loop [current 0
-                 last-changed (- (alength constraints) 1)]
-            (let [result (.propagate (aget constraints current) los his)]
-              (debug :next-loop current result los his pushed-los pushed-his)
-              (condp identical? result
-                changed (recur (mod (+ current 1) (alength constraints)) current)
-                unchanged (if (not (identical? current last-changed))
-                            (recur (mod (+ current 1) (alength constraints)) last-changed)
-                            (if (key= los his)
-                              (let [result (aclone los)]
-                                (if (> depth 0)
-                                  (.pop this)
-                                  (set! end? true))
-                                result)
-                              (let [splitter (.split this current)]
-                                (recur splitter (mod (+ splitter 1) (alength constraints))))))
-                failed (if (> depth 0)
-                         (do
-                           (.pop this)
-                           (recur current (mod (- current 1) (alength constraints))))
-                         (do
-                           (set! end? true)
-                           nil))))))))
-
-(defn solver [constraints num-vars]
-  (Solver. constraints (least-key num-vars) (greatest-key num-vars) 0 #js [] #js [] false))
+        (loop [current 0
+               last-changed (- (alength constraints) 1)]
+          (if (true? failed?)
+            (when (> depth 0)
+              (.backtrack this)
+              (recur current (- (alength constraints) 1)))
+            (do
+              (.write-bounds this current)
+              (.propagate (aget constraints current) (aget constraint->los current) (aget constraint->his current))
+              (if (.read-bounds this current)
+                (recur (mod (+ current 1) (alength constraints)) current)
+                (if (== current last-changed)
+                  (if (key= los his)
+                    (do
+                      (set! failed? true) ;; force solver to backtrack next time
+                      (aclone los))
+                    (do
+                      (.split this current)
+                      (recur 0 (- (alength constraints) 1))))
+                  (recur (mod (+ current 1) (alength constraints)) last-changed))))))))
+
+(defn solver [num-vars constraints constraint->ixes]
+  (let [constraint->los (amake [i (alength constraint->ixes)]
+                               (make-array (alength (aget constraint->ixes i))))
+        constraint->his (amake [i (alength constraint->ixes)]
+                               (make-array (alength (aget constraint->ixes i))))
+        los (least-key num-vars)
+        his (greatest-key num-vars)]
+    (Solver. constraints constraint->ixes constraint->los constraint->his los his 0 #js [] #js [] #js [] false)))

 ;; TESTS

@@ -995,9 +975,11 @@
       _ (.assoc! tree2 #js ["c" "b"] 0)
       _ (.assoc! tree2 #js ["d" "c"] 0)
       _ (.assoc! tree2 #js ["b" "d"] 0)
-      s (solver #js [(contains (iterator tree1) #js [0 2])
-                     (contains (iterator tree2) #js [1 2])]
-                3)
+      s (solver 3
+                #js [(contains (iterator tree1))
+                     (contains (iterator tree2))]
+                #js [#js [0 2]
+                     #js [1 2]])
       ]
   [(.next s) (.next s) (.next s)]
   )


Second star

Second star

--- src/adventofcode/mmxvii/solutions.clj
+++ src/adventofcode/mmxvii/solutions.clj
@@ -22,4 +22,6 @@
                          (partition 2 1 c))))))

 (defn captcha2 [c]
-  (map-indexed #(vector %1 %2) c))+  (let [n (count c)
+        d (/ n 2)]
+    (map-indexed #(vector %1 %2) c)))


sliding buffer for channel that inspect fn puts all messages onto

--- src/clj/com/matthiasnehlsen/inspect.clj
+++ src/clj/com/matthiasnehlsen/inspect.clj
@@ -8,9 +8,9 @@
    [clojure.pprint :as pp]
    [clj-time.core :as t]
    [clj-time.format :as f]
-   [clojure.core.async :as async :refer [<! chan put! timeout go-loop]]))
+   [clojure.core.async :as async :refer [<! chan put! timeout go-loop sliding-buffer]]))

-(def in-chan (chan))
+(def in-chan (chan (sliding-buffer 1000)))

 (def built-in-formatter (f/formatters :date-time))


also require cljx on change

also require cljx on change

--- src/clj/rksm/cloxp_cljs/compilation.clj
+++ src/clj/rksm/cloxp_cljs/compilation.clj
@@ -37,8 +37,9 @@

 (defn compile-cljs-in-project
   [changed-ns file project-dir & [compiler-env]]
-  (if changed-ns
-    (cljx/ns-compile-cljx->cljs changed-ns file project-dir))
+  (when (and changed-ns (re-find #"\.cljx$" (str file)))
+    (cljx/ns-compile-cljx->cljs changed-ns file project-dir)
+    (cljx/require-ns changed-ns (str file)))
   (let [build-opts (default-build-options project-dir)
         cljs-source-paths (cljs-source-paths project-dir)
         compiler-env (or compiler-env (env/default-compiler-env))]


improve the fullscreen default

improve the fullscreen default

--- src/cljs/infinitelives/pixi/canvas.cljs
+++ src/cljs/infinitelives/pixi/canvas.cljs
@@ -302,16 +302,12 @@

 (defn add-fullscreen-button! [{:keys [fullscreen-fn]}]
   (let [div (dom/create-element :div)
-        img (dom/create-element :img)
-        ]
+        img (dom/create-element :img)]
     (dom/append! div img)
-    (set! (.-src img) "https://cdn0.iconfinder.com/data/icons/cosmo-player/40/window_fullscreen_1-512.png")
-    (.setAttribute img "style" "bottom: 0; position: absolute; padding-bottom: 20px; padding-left: 20px; z-index: 200; width: 64; height: 64; background-color: blue;")
-    (.setAttribute div "style" "bottom: 0; position: absolute; padding-bottom: 20px; padding-left: 20px; z-index: 200; width: 64; height: 64; background-color: red;")
+    (set! (.-src img) "http://runrunitshim.com/images/fullscreenIcon.png")
+    (.setAttribute img "style" "bottom: 0; position: absolute; padding-bottom: 20px; padding-left: 20px; z-index: 200;")
+    (.setAttribute div "style" "bottom: 0; position: absolute; padding-bottom: 0px; padding-left: 0px; z-index: 200;")
     (.addEventListener img "click" #(fullscreen-fn true))
-    (log "!" (.-body js/document))
     (dom/append! (.-body js/document) div)
-    (log div)
-    (set! (.-style img) "bottom: 0; position: absolute; padding-bottom: 20px; padding-left: 20px; z-index: -200; width: 64; height: 64;")
     div
     ))


Add blocking type of handler.

Add blocking type of handler.

--- src/clojure/catacumba/impl/handlers.clj
+++ src/clojure/catacumba/impl/handlers.clj
@@ -410,6 +410,20 @@
                            (when (satisfies? IHandlerResponse response)
                              (handle-response response context)))))))))

+(defmethod adapter :catacumba/blocking
+  [handler]
+  (reify Handler
+    (^void handle [_ ^Context ctx]
+      (let [context (ctx/context ctx)
+            context-params (ctx/context-params context)
+            route-params (ctx/route-params context)
+            context' (-> (merge context context-params)
+                         (assoc :route-params route-params))]
+        (-> (ch/blocking
+             (handler context'))
+            (ch/then (fn [response]
+                       (when (satisfies? IHandlerResponse response)
+                         (handle-response response context)))))))))

 (defmethod adapter :catacumba/cps
   [handler]


Filter out empties in youth-bias.

Filter out empties in youth-bias.

--- src/clojush/pushgp/parent_selection.clj
+++ src/clojush/pushgp/parent_selection.clj
@@ -55,13 +55,15 @@
   (if (not lexicase-youth-bias)
     pop
     (let [rand-val (lrand)
+          non-empties (filter #(not (empty? (:genome %))) pop)
+          candidates (if (empty? non-empties) pop non-empties)
           age-limit (if (<= rand-val (first lexicase-youth-bias))
                       @min-age
                       (if (<= rand-val (apply + lexicase-youth-bias))
                         @max-age
-                        (lrand-nth (distinct (map :age pop)))))]
+                        (lrand-nth (distinct (map :age candidates)))))]
       (filter (fn [ind] (<= (:age ind) age-limit))
-              pop))))
+              candidates))))

 (defn lexicase-selection
   "Returns an individual that does the best on the fitness cases when considered one at a
@@ -277,3 +279,4 @@

+


Remove 'EXPERIMENTAL!' from log messages for reports

--- src/com/puppetlabs/puppetdb/command.clj
+++ src/com/puppetlabs/puppetdb/command.clj
@@ -374,7 +374,7 @@
     (with-transacted-connection db
       (scf-storage/maybe-activate-node! certname timestamp)
       (scf-storage/add-report! report timestamp))
-    (log/info (format "[%s] [%s (EXPERIMENTAL!)] puppet v%s - %s"
+    (log/info (format "[%s] [%s] puppet v%s - %s"
                 id (command-names :store-report)
                 (:puppet-version report) (:certname report)))))


corrected comments

corrected comments

--- src/brevis/matrix.clj
+++ src/brevis/matrix.clj
@@ -116,7 +116,7 @@
   (.multiplyRight m1 m2)); this needs to change to .multiply when switching to v38

 (defn elmult
-  "Matrix multiply"
+  "Matrix multiply by elements"
   [^BasicMatrix m1 ^BasicMatrix m2]
   (.multiplyElements m1 m2))


Doc string for grouper.

Doc string for grouper.

--- src/cbfg/grouper.cljs
+++ src/cbfg/grouper.cljs
@@ -1,16 +1,17 @@
 (ns cbfg.grouper
   (:require-macros [cbfg.act :refer [act-loop achan aclose aalts]]))

-(defn make-grouper [actx put-ch take-all-ch max-entries-per-take]
+(defn make-grouper
   "A grouper manages a put-ch, take-all-ch, and a set of entries.
-   Multiple producers can put to the put-ch, and a consumer can grab
-   all the collected entries in one shot by a take on the take-all-ch.
-   During a put, an entry is a [key update-fn], so producers can merge
-   or group entries, to de-dupe or piggy-backing requests.  Puts will
-   block when there are more than max-entries-per-take number of
-   entries already.  A take on take-all-ch will receive a map of
-   key to update-fn-result.  grouper closes take-all-ch after put-ch
-   is closed and all entries are taken."
+   Multiple producers can aput to the put-ch, and consumers can grab
+   all the collected entries in one shot by atake on the take-all-ch.
+   During aput, an entry is a [key update-fn], so producers can merge
+   or group entries, to de-dupe or piggy-backing requests.  The aputs
+   will block when there are more than max-entries-per-take number of
+   entries already.  atake on take-all-ch will receive a map of key
+   to update-fn-result.  grouper closes take-all-ch after put-ch is
+   closed and all entries are taken."
+  [actx put-ch take-all-ch max-entries-per-take]
   (act-loop grouper actx
             [entries {}
              max-entries-per-take max-entries-per-take


Fixed bool? matcher to look for suffix only.

--- src/cbfg/zgo/core.clj
+++ src/cbfg/zgo/core.clj
@@ -56,7 +56,7 @@
      (= p0 "name") "string"
      (= p0 "max") "int"
      (= p0 "min") "int"
-     (re-find #"\?" plast) "bool" ; When ends with '?'.
+     (re-find #"\?$" plast) "bool" ; When ends with '?'.
      :default (string/capitalize plast))))

 (defn process-fn-params [params]


#99 spaces?

#99 spaces?

--- src/cheshire/core.clj
+++ src/cheshire/core.clj
@@ -1,315 +1,315 @@
 (ns cheshire.core
-	"Main encoding and decoding namespace."
-	(:require [cheshire.factory :as factory]
-						[cheshire.generate :as gen]
-						[cheshire.generate-seq :as gen-seq]
-						[cheshire.parse :as parse])
-	(:import (com.fasterxml.jackson.core JsonParser JsonFactory
-																			 JsonGenerator
-																			 JsonGenerator$Feature)
-					 (com.fasterxml.jackson.dataformat.smile SmileFactory)
-					 (cheshire.prettyprint CustomPrettyPrinter)
-					 (java.io StringWriter StringReader BufferedReader BufferedWriter
-										ByteArrayOutputStream OutputStream Reader Writer)))
+  "Main encoding and decoding namespace."
+  (:require [cheshire.factory :as factory]
+            [cheshire.generate :as gen]
+            [cheshire.generate-seq :as gen-seq]
+            [cheshire.parse :as parse])
+  (:import (com.fasterxml.jackson.core JsonParser JsonFactory
+                                       JsonGenerator
+                                       JsonGenerator$Feature)
+           (com.fasterxml.jackson.dataformat.smile SmileFactory)
+           (cheshire.prettyprint CustomPrettyPrinter)
+           (java.io StringWriter StringReader BufferedReader BufferedWriter
+                    ByteArrayOutputStream OutputStream Reader Writer)))

 (def ^:private default-pretty-print-options
-	{:indentation 2
-	 :indent-arrays? false
-	 :indent-objects? true
-	 :before-array-values nil
-	 :after-array-values nil
-	 :object-field-value-separator nil})
+  {:indentation 2
+   :indent-arrays? false
+   :indent-objects? true
+   :before-array-values nil
+   :after-array-values nil
+   :object-field-value-separator nil})

 (defn- create-pretty-printer
-	"Returns an instance of CustomPrettyPrinter based on the configuration
-	provided as argument"
-	[options]
-	(let [{:keys [indentation
-								indent-arrays?
-								indent-objects?
-								before-array-values
-								after-array-values
-								object-field-value-separator]} (merge default-pretty-print-options options)]
-		(-> (new CustomPrettyPrinter)
-				(.setIndentation indentation indent-objects? indent-arrays?)
-				(.setBeforeArrayValues before-array-values)
-				(.setAfterArrayValues after-array-values)
-				(.setObjectFieldValueSeparator object-field-value-separator))))
+  "Returns an instance of CustomPrettyPrinter based on the configuration
+  provided as argument"
+  [options]
+  (let [{:keys [indentation
+                indent-arrays?
+                indent-objects?
+                before-array-values
+                after-array-values
+                object-field-value-separator]} (merge default-pretty-print-options options)]
+    (-> (new CustomPrettyPrinter)
+        (.setIndentation indentation indent-objects? indent-arrays?)
+        (.setBeforeArrayValues before-array-values)
+        (.setAfterArrayValues after-array-values)
+        (.setObjectFieldValueSeparator object-field-value-separator))))

 ;; Generators
 (defn ^String generate-string
-	"Returns a JSON-encoding String for the given Clojure object. Takes an
-	optional date format string that Date objects will be encoded with.
-
-	The default date format (in UTC) is: yyyy-MM-dd'T'HH:mm:ss'Z'"
-	([obj]
-	 (generate-string obj nil))
-	([obj opt-map]
-	 (let [sw (StringWriter.)
-				 generator (.createGenerator
-										^JsonFactory (or factory/*json-factory*
-																		 factory/json-factory)
-										^Writer sw)
-				 print-pretty (:pretty opt-map)]
-		 (when print-pretty
-			 (if (= true print-pretty)
-				 (.useDefaultPrettyPrinter generator)
-				 (.setPrettyPrinter generator (create-pretty-printer print-pretty))))
-		 (when (:escape-non-ascii opt-map)
-			 (.enable generator JsonGenerator$Feature/ESCAPE_NON_ASCII))
-		 (gen/generate generator obj
-									 (or (:date-format opt-map) factory/default-date-format)
-									 (:ex opt-map)
-									 (:key-fn opt-map))
-		 (.flush generator)
-		 (.toString sw))))
+  "Returns a JSON-encoding String for the given Clojure object. Takes an
+  optional date format string that Date objects will be encoded with.
+
+  The default date format (in UTC) is: yyyy-MM-dd'T'HH:mm:ss'Z'"
+  ([obj]
+   (generate-string obj nil))
+  ([obj opt-map]
+   (let [sw (StringWriter.)
+         generator (.createGenerator
+                    ^JsonFactory (or factory/*json-factory*
+                                     factory/json-factory)
+                    ^Writer sw)
+         print-pretty (:pretty opt-map)]
+     (when print-pretty
+       (if (= true print-pretty)
+         (.useDefaultPrettyPrinter generator)
+         (.setPrettyPrinter generator (create-pretty-printer print-pretty))))
+     (when (:escape-non-ascii opt-map)
+       (.enable generator JsonGenerator$Feature/ESCAPE_NON_ASCII))
+     (gen/generate generator obj
+                   (or (:date-format opt-map) factory/default-date-format)
+                   (:ex opt-map)
+                   (:key-fn opt-map))
+     (.flush generator)
+     (.toString sw))))

 (defn ^BufferedWriter generate-stream
-	"Returns a BufferedWriter for the given Clojure object with the JSON-encoded
-	data written to the writer. Takes an optional date format string that Date
-	objects will be encoded with.
-
-	The default date format (in UTC) is: yyyy-MM-dd'T'HH:mm:ss'Z'"
-	([obj ^BufferedWriter writer]
-	 (generate-stream obj writer nil))
-	([obj ^BufferedWriter writer opt-map]
-	 (let [generator (.createGenerator
-										^JsonFactory (or factory/*json-factory*
-																		 factory/json-factory)
-										^Writer writer)
-				 print-pretty (:pretty opt-map)]
-		 (when print-pretty
-			 (if (= true print-pretty)
-				 (.useDefaultPrettyPrinter generator)
-				 (.setPrettyPrinter generator (create-pretty-printer print-pretty))))
-		 (when (:escape-non-ascii opt-map)
-			 (.enable generator JsonGenerator$Feature/ESCAPE_NON_ASCII))
-		 (gen/generate generator obj (or (:date-format opt-map)
-																		 factory/default-date-format)
-									 (:ex opt-map)
-									 (:key-fn opt-map))
-		 (.flush generator)
-		 writer)))
+  "Returns a BufferedWriter for the given Clojure object with the JSON-encoded
+  data written to the writer. Takes an optional date format string that Date
+  objects will be encoded with.
+
+  The default date format (in UTC) is: yyyy-MM-dd'T'HH:mm:ss'Z'"
+  ([obj ^BufferedWriter writer]
+   (generate-stream obj writer nil))
+  ([obj ^BufferedWriter writer opt-map]
+   (let [generator (.createGenerator
+                    ^JsonFactory (or factory/*json-factory*
+                                     factory/json-factory)
+                    ^Writer writer)
+         print-pretty (:pretty opt-map)]
+     (when print-pretty
+       (if (= true print-pretty)
+         (.useDefaultPrettyPrinter generator)
+         (.setPrettyPrinter generator (create-pretty-printer print-pretty))))
+     (when (:escape-non-ascii opt-map)
+       (.enable generator JsonGenerator$Feature/ESCAPE_NON_ASCII))
+     (gen/generate generator obj (or (:date-format opt-map)
+                                     factory/default-date-format)
+                   (:ex opt-map)
+                   (:key-fn opt-map))
+     (.flush generator)
+     writer)))

 (defn create-generator [writer]
-	"Returns JsonGenerator for given writer."
-	(.createGenerator
-	 ^JsonFactory (or factory/*json-factory*
-										factory/json-factory)
-	 ^Writer writer))
+  "Returns JsonGenerator for given writer."
+  (.createGenerator
+   ^JsonFactory (or factory/*json-factory*
+                    factory/json-factory)
+   ^Writer writer))

 (def ^:dynamic ^JsonGenerator *generator*)
 (def ^:dynamic *opt-map*)

 (defmacro with-writer [[writer opt-map] & body]
-	"Start writing for series objects using the same json generator.
-	 Takes writer and options map as arguments.
-	 Expects its body as sequence of write calls.
-	 Returns a given writer."
-	`(let [c-wr# ~writer]
-		 (binding [*generator* (create-generator c-wr#)
-							 *opt-map* ~opt-map]
-			 ~@body
-			 (.flush *generator*)
-			 c-wr#)))
+  "Start writing for series objects using the same json generator.
+   Takes writer and options map as arguments.
+   Expects its body as sequence of write calls.
+   Returns a given writer."
+  `(let [c-wr# ~writer]
+     (binding [*generator* (create-generator c-wr#)
+               *opt-map* ~opt-map]
+       ~@body
+       (.flush *generator*)
+       c-wr#)))

 (defn write
-	"Write given Clojure object as a piece of data within with-writer.
-	List of wholeness acceptable values:
-	- no value - the same as :all
-	- :all - write object in a regular way with start and end borders
-	- :start - write object with start border only
-	- :start-inner - write object and its inner object with start border only
-	- :end - write object with end border only."
-	([obj] (write obj nil))
-	([obj wholeness]
-	 (gen-seq/generate *generator* obj (or (:date-format *opt-map*)
-																				 factory/default-date-format)
-										 (:ex *opt-map*)
-										 (:key-fn *opt-map*)
-										 :wholeness wholeness)))
+  "Write given Clojure object as a piece of data within with-writer.
+  List of wholeness acceptable values:
+  - no value - the same as :all
+  - :all - write object in a regular way with start and end borders
+  - :start - write object with start border only
+  - :start-inner - write object and its inner object with start border only
+  - :end - write object with end border only."
+  ([obj] (write obj nil))
+  ([obj wholeness]
+   (gen-seq/generate *generator* obj (or (:date-format *opt-map*)
+                                         factory/default-date-format)
+                     (:ex *opt-map*)
+                     (:key-fn *opt-map*)
+                     :wholeness wholeness)))

 (defn generate-smile
-	"Returns a SMILE-encoded byte-array for the given Clojure object.
-	Takes an optional date format string that Date objects will be encoded with.
-
-	The default date format (in UTC) is: yyyy-MM-dd'T'HH:mm:ss'Z'"
-	([obj]
-	 (generate-smile obj nil))
-	([obj opt-map]
-	 (let [baos (ByteArrayOutputStream.)
-				 generator (.createGenerator ^SmileFactory
-																		 (or factory/*smile-factory*
-																				 factory/smile-factory)
-																		 ^OutputStream baos)]
-		 (gen/generate generator obj (or (:date-format opt-map)
-																		 factory/default-date-format)
-									 (:ex opt-map)
-									 (:key-fn opt-map))
-		 (.flush generator)
-		 (.toByteArray baos))))
+  "Returns a SMILE-encoded byte-array for the given Clojure object.
+  Takes an optional date format string that Date objects will be encoded with.
+
+  The default date format (in UTC) is: yyyy-MM-dd'T'HH:mm:ss'Z'"
+  ([obj]
+   (generate-smile obj nil))
+  ([obj opt-map]
+   (let [baos (ByteArrayOutputStream.)
+         generator (.createGenerator ^SmileFactory
+                                     (or factory/*smile-factory*
+                                         factory/smile-factory)
+                                     ^OutputStream baos)]
+     (gen/generate generator obj (or (:date-format opt-map)
+                                     factory/default-date-format)
+                   (:ex opt-map)
+                   (:key-fn opt-map))
+     (.flush generator)
+     (.toByteArray baos))))

 (defn generate-cbor
-	"Returns a CBOR-encoded byte-array for the given Clojure object.
-	Takes an optional date format string that Date objects will be encoded with.
-
-	The default date format (in UTC) is: yyyy-MM-dd'T'HH:mm:ss'Z'"
-	([obj]
-	 (generate-cbor obj nil))
-	([obj opt-map]
-	 (let [baos (ByteArrayOutputStream.)
-				 generator (.createGenerator ^CBORFactory
-																		 (or factory/*cbor-factory*
-																				 factory/cbor-factory)
-																		 ^OutputStream baos)]
-		 (gen/generate generator obj (or (:date-format opt-map)
-																		 factory/default-date-format)
-									 (:ex opt-map)
-									 (:key-fn opt-map))
-		 (.flush generator)
-		 (.toByteArray baos))))
+  "Returns a CBOR-encoded byte-array for the given Clojure object.
+  Takes an optional date format string that Date objects will be encoded with.
+
+  The default date format (in UTC) is: yyyy-MM-dd'T'HH:mm:ss'Z'"
+  ([obj]
+   (generate-cbor obj nil))
+  ([obj opt-map]
+   (let [baos (ByteArrayOutputStream.)
+         generator (.createGenerator ^CBORFactory
+                                     (or factory/*cbor-factory*
+                                         factory/cbor-factory)
+                                     ^OutputStream baos)]
+     (gen/generate generator obj (or (:date-format opt-map)
+                                     factory/default-date-format)
+                   (:ex opt-map)
+                   (:key-fn opt-map))
+     (.flush generator)
+     (.toByteArray baos))))

 ;; Parsers
 (defn parse-string
-	"Returns the Clojure object corresponding to the given JSON-encoded string.
-	An optional key-fn argument can be either true (to coerce keys to keywords),
-	false to leave them as strings, or a function to provide custom coercion.
-
-	The array-coerce-fn is an optional function taking the name of an array field,
-	and returning the collection to be used for array values.
-
-	If the top-level object is an array, it will be parsed lazily (use
-	`parse-strict' if strict parsing is required for top-level arrays."
-	([string] (parse-string string nil nil))
-	([string key-fn] (parse-string string key-fn nil))
-	([^String string key-fn array-coerce-fn]
-	 (when string
-		 (parse/parse
-			(.createParser ^JsonFactory (or factory/*json-factory*
-																			factory/json-factory)
-										 ^Reader (StringReader. string))
-			key-fn nil array-coerce-fn))))
+  "Returns the Clojure object corresponding to the given JSON-encoded string.
+  An optional key-fn argument can be either true (to coerce keys to keywords),
+  false to leave them as strings, or a function to provide custom coercion.
+
+  The array-coerce-fn is an optional function taking the name of an array field,
+  and returning the collection to be used for array values.
+
+  If the top-level object is an array, it will be parsed lazily (use
+  `parse-strict' if strict parsing is required for top-level arrays."
+  ([string] (parse-string string nil nil))
+  ([string key-fn] (parse-string string key-fn nil))
+  ([^String string key-fn array-coerce-fn]
+   (when string
+     (parse/parse
+      (.createParser ^JsonFactory (or factory/*json-factory*
+                                      factory/json-factory)
+                     ^Reader (StringReader. string))
+      key-fn nil array-coerce-fn))))

 ;; Parsing strictly
 (defn parse-string-strict
-	"Returns the Clojure object corresponding to the given JSON-encoded string.
-	An optional key-fn argument can be either true (to coerce keys to keywords),
-	false to leave them as strings, or a function to provide custom coercion.
-
-	The array-coerce-fn is an optional function taking the name of an array field,
-	and returning the collection to be used for array values.
-
-	Does not lazily parse top-level arrays."
-	([string] (parse-string-strict string nil nil))
-	([string key-fn] (parse-string-strict string key-fn nil))
-	([^String string key-fn array-coerce-fn]
-	 (when string
-		 (parse/parse-strict
-			(.createParser ^JsonFactory (or factory/*json-factory*
-																			factory/json-factory)
-										 ^Writer (StringReader. string))
-			key-fn nil array-coerce-fn))))
+  "Returns the Clojure object corresponding to the given JSON-encoded string.
+  An optional key-fn argument can be either true (to coerce keys to keywords),
+  false to leave them as strings, or a function to provide custom coercion.
+
+  The array-coerce-fn is an optional function taking the name of an array field,
+  and returning the collection to be used for array values.
+
+  Does not lazily parse top-level arrays."
+  ([string] (parse-string-strict string nil nil))
+  ([string key-fn] (parse-string-strict string key-fn nil))
+  ([^String string key-fn array-coerce-fn]
+   (when string
+     (parse/parse-strict
+      (.createParser ^JsonFactory (or factory/*json-factory*
+                                      factory/json-factory)
+                     ^Writer (StringReader. string))
+      key-fn nil array-coerce-fn))))

 (defn parse-stream
-	"Returns the Clojure object corresponding to the given reader, reader must
-	implement BufferedReader. An optional key-fn argument can be either true (to
-	coerce keys to keywords),false to leave them as strings, or a function to
-	provide custom coercion.
-
-	The array-coerce-fn is an optional function taking the name of an array field,
-	and returning the collection to be used for array values.
-
-	If the top-level object is an array, it will be parsed lazily (use
-	`parse-strict' if strict parsing is required for top-level arrays.
-
-	If multiple objects (enclosed in a top-level `{}' need to be parsed lazily,
-	see parsed-seq."
-	([rdr] (parse-stream rdr nil nil))
-	([rdr key-fn] (parse-stream rdr key-fn nil))
-	([^BufferedReader rdr key-fn array-coerce-fn]
-	 (when rdr
-		 (parse/parse
-			(.createParser ^JsonFactory (or factory/*json-factory*
-																			factory/json-factory)
-										 ^Reader rdr)
-			key-fn nil array-coerce-fn))))
+  "Returns the Clojure object corresponding to the given reader, reader must
+  implement BufferedReader. An optional key-fn argument can be either true (to
+  coerce keys to keywords),false to leave them as strings, or a function to
+  provide custom coercion.
+
+  The array-coerce-fn is an optional function taking the name of an array field,
+  and returning the collection to be used for array values.
+
+  If the top-level object is an array, it will be parsed lazily (use
+  `parse-strict' if strict parsing is required for top-level arrays.
+
+  If multiple objects (enclosed in a top-level `{}' need to be parsed lazily,
+  see parsed-seq."
+  ([rdr] (parse-stream rdr nil nil))
+  ([rdr key-fn] (parse-stream rdr key-fn nil))
+  ([^BufferedReader rdr key-fn array-coerce-fn]
+   (when rdr
+     (parse/parse
+      (.createParser ^JsonFactory (or factory/*json-factory*
+                                      factory/json-factory)
+                     ^Reader rdr)
+      key-fn nil array-coerce-fn))))

 (defn parse-smile
-	"Returns the Clojure object corresponding to the given SMILE-encoded bytes.
-	An optional key-fn argument can be either true (to coerce keys to keywords),
-	false to leave them as strings, or a function to provide custom coercion.
-
-	The array-coerce-fn is an optional function taking the name of an array field,
-	and returning the collection to be used for array values."
-	([bytes] (parse-smile bytes nil nil))
-	([bytes key-fn] (parse-smile bytes key-fn nil))
-	([^bytes bytes key-fn array-coerce-fn]
-	 (when bytes
-		 (parse/parse
-			(.createParser ^SmileFactory (or factory/*smile-factory*
-																			 factory/smile-factory) bytes)
-			key-fn nil array-coerce-fn))))
+  "Returns the Clojure object corresponding to the given SMILE-encoded bytes.
+  An optional key-fn argument can be either true (to coerce keys to keywords),
+  false to leave them as strings, or a function to provide custom coercion.
+
+  The array-coerce-fn is an optional function taking the name of an array field,
+  and returning the collection to be used for array values."
+  ([bytes] (parse-smile bytes nil nil))
+  ([bytes key-fn] (parse-smile bytes key-fn nil))
+  ([^bytes bytes key-fn array-coerce-fn]
+   (when bytes
+     (parse/parse
+      (.createParser ^SmileFactory (or factory/*smile-factory*
+                                       factory/smile-factory) bytes)
+      key-fn nil array-coerce-fn))))

 (defn parse-cbor
-	"Returns the Clojure object corresponding to the given CBOR-encoded bytes.
-	An optional key-fn argument can be either true (to coerce keys to keywords),
-	false to leave them as strings, or a function to provide custom coercion.
-
-	The array-coerce-fn is an optional function taking the name of an array field,
-	and returning the collection to be used for array values."
-	([bytes] (parse-cbor bytes nil nil))
-	([bytes key-fn] (parse-cbor bytes key-fn nil))
-	([^bytes bytes key-fn array-coerce-fn]
-	 (when bytes
-		 (parse/parse
-			(.createParser ^CBORFactory (or factory/*cbor-factory*
-																			factory/cbor-factory) bytes)
-			key-fn nil array-coerce-fn))))
+  "Returns the Clojure object corresponding to the given CBOR-encoded bytes.
+  An optional key-fn argument can be either true (to coerce keys to keywords),
+  false to leave them as strings, or a function to provide custom coercion.
+
+  The array-coerce-fn is an optional function taking the name of an array field,
+  and returning the collection to be used for array values."
+  ([bytes] (parse-cbor bytes nil nil))
+  ([bytes key-fn] (parse-cbor bytes key-fn nil))
+  ([^bytes bytes key-fn array-coerce-fn]
+   (when bytes
+     (parse/parse
+      (.createParser ^CBORFactory (or factory/*cbor-factory*
+                                      factory/cbor-factory) bytes)
+      key-fn nil array-coerce-fn))))

 (def ^{:doc "Object used to determine end of lazy parsing attempt."}
-	eof (Object.))
+  eof (Object.))

 ;; Lazy parsers
 (defn- parsed-seq*
-	"Internal lazy-seq parser"
-	[^JsonParser parser key-fn array-coerce-fn]
-	(lazy-seq
-	 (let [elem (parse/parse-strict parser key-fn eof array-coerce-fn)]
-		 (when-not (identical? elem eof)
-			 (cons elem (parsed-seq* parser key-fn array-coerce-fn))))))
+  "Internal lazy-seq parser"
+  [^JsonParser parser key-fn array-coerce-fn]
+  (lazy-seq
+   (let [elem (parse/parse-strict parser key-fn eof array-coerce-fn)]
+     (when-not (identical? elem eof)
+       (cons elem (parsed-seq* parser key-fn array-coerce-fn))))))

 (defn parsed-seq
-	"Returns a lazy seq of Clojure objects corresponding to the JSON read from
-	the given reader. The seq continues until the end of the reader is reached.
-
-	The array-coerce-fn is an optional function taking the name of an array field,
-	and returning the collection to be used for array values.
-	If non-laziness is needed, see parse-stream."
-	([reader] (parsed-seq reader nil nil))
-	([reader key-fn] (parsed-seq reader key-fn nil))
-	([^BufferedReader reader key-fn array-coerce-fn]
-	 (when reader
-		 (parsed-seq* (.createParser ^JsonFactory
-																 (or factory/*json-factory*
-																		 factory/json-factory)
-																 ^Reader reader)
-									key-fn array-coerce-fn))))
+  "Returns a lazy seq of Clojure objects corresponding to the JSON read from
+  the given reader. The seq continues until the end of the reader is reached.
+
+  The array-coerce-fn is an optional function taking the name of an array field,
+  and returning the collection to be used for array values.
+  If non-laziness is needed, see parse-stream."
+  ([reader] (parsed-seq reader nil nil))
+  ([reader key-fn] (parsed-seq reader key-fn nil))
+  ([^BufferedReader reader key-fn array-coerce-fn]
+   (when reader
+     (parsed-seq* (.createParser ^JsonFactory
+                                 (or factory/*json-factory*
+                                     factory/json-factory)
+                                 ^Reader reader)
+                  key-fn array-coerce-fn))))

 (defn parsed-smile-seq
-	"Returns a lazy seq of Clojure objects corresponding to the SMILE read from
-	the given reader. The seq continues until the end of the reader is reached.
-
-	The array-coerce-fn is an optional function taking the name of an array field,
-	and returning the collection to be used for array values."
-	([reader] (parsed-smile-seq reader nil nil))
-	([reader key-fn] (parsed-smile-seq reader key-fn nil))
-	([^BufferedReader reader key-fn array-coerce-fn]
-	 (when reader
-		 (parsed-seq* (.createParser ^SmileFactory
-																 (or factory/*smile-factory*
-																		 factory/smile-factory)
-																 ^Reader reader)
-									key-fn array-coerce-fn))))
+  "Returns a lazy seq of Clojure objects corresponding to the SMILE read from
+  the given reader. The seq continues until the end of the reader is reached.
+
+  The array-coerce-fn is an optional function taking the name of an array field,
+  and returning the collection to be used for array values."
+  ([reader] (parsed-smile-seq reader nil nil))
+  ([reader key-fn] (parsed-smile-seq reader key-fn nil))
+  ([^BufferedReader reader key-fn array-coerce-fn]
+   (when reader
+     (parsed-seq* (.createParser ^SmileFactory
+                                 (or factory/*smile-factory*
+                                     factory/smile-factory)
+                                 ^Reader reader)
+                  key-fn array-coerce-fn))))

 ;; aliases for clojure-json users
 (def encode "Alias to generate-string for clojure-json users" generate-string)


(PDB-764) Malformed post conditions in query.clj.

This fixes some trivial typos in query.clj that had previously caused some
post-conditions to go unenforced.

--- src/com/puppetlabs/puppetdb/query.clj
+++ src/com/puppetlabs/puppetdb/query.clj
@@ -364,7 +364,7 @@
   "Compile a resource query, returning a vector containing the SQL and
   parameters for the query. All resource columns are selected, and no order is applied."
   [ops query]
-  {:post [valid-jdbc-query? %]}
+  {:post [(valid-jdbc-query? %)]}
   (let [{:keys [where params]} (compile-term ops query)
         sql (format "SELECT %s
                        FROM (SELECT c.hash as catalog, e.name as environment, catalog_id, resource,
@@ -381,7 +381,7 @@
   "Compile a fact query, returning a vector containing the SQL and parameters
   for the query. All fact columns are selected, and no order is applied."
   [ops query]
-  {:post [valid-jdbc-query? %]}
+  {:post [(valid-jdbc-query? %)]}
   (let [{:keys [where params]} (compile-term ops query)
         sql (format "SELECT %s FROM (select cf.certname, cf.name, cf.value, env.name as environment
                                      FROM certname_facts cf INNER JOIN certname_facts_metadata cfm on cf.certname = cfm.certname
@@ -394,7 +394,7 @@
   "Compile a node query, returning a vector containing the SQL and parameters
   for the query. All node columns are selected, and no order is applied."
   [version ops query]
-  {:post [valid-jdbc-query? %]}
+  {:post [(valid-jdbc-query? %)]}
   (let [sql (case version
               (:v1 :v2 :v3)
               (format "SELECT %s FROM certnames"
@@ -435,7 +435,7 @@
   "Compile a environments query, returning a vector containing the SQL and parameters
   for the query. All node columns are selected, and no order is applied."
   [ops query]
-  {:post [valid-jdbc-query? %]}
+  {:post [(valid-jdbc-query? %)]}
   (let [{:keys [where params]} (when query (compile-term ops query))
         projection (format "SELECT %s FROM environments " (column-map->sql environments-columns))
         where-clause (when where
@@ -446,7 +446,7 @@
   "Compile a node query, returning a vector containing the SQL and parameters
   for the query. All node columns are selected, and no order is applied."
   [version ops query]
-  {:post [valid-jdbc-query? %]}
+  {:post [(valid-jdbc-query? %)]}
   (let [sql (format "SELECT %s FROM (SELECT
                      reports.hash,
                      reports.certname,


Add more files to init, to make sure they compile

--- src/circleci/init.clj
+++ src/circleci/init.clj
@@ -6,7 +6,8 @@
   (:require circleci.repl)
   (:require circleci.logging)
   (:require circleci.backend.nodes)
-  (:require circleci.backend.project.rails))
+  (:require circleci.backend.project.rails)
+  (:require circleci.backend.project.circleci))

 (def init*
   (delay


fix state not updating correctly with :added-virus-counter

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -468,13 +468,17 @@
 (defn add-prop
   ([state side card key n] (add-prop state side card key n nil))
   ([state side card key n {:keys [placed] :as args}]
-   (if (= (:subtype card) "Virus") (update! state side (assoc card :added-virus-counter true)))
-   (update! state side (update-in card [key] #(+ (or % 0) n)))
-   (if (= key :advance-counter)
-     (do (when (and (#{"ICE"} (:type card)) (:rezzed card)) (update-ice-strength state side card))
-         (when (not placed)
-           (trigger-event state side :advance (get-card state card))))
-     (trigger-event state side :counter-added (get-card state card)))))
+   (let [updated-card (if (re-find #"Virus" (:subtype card))
+                        (assoc card :added-virus-counter true)
+                        (card)
+                        )]
+     (update! state side (update-in updated-card [key] #(+ (or % 0) n)))
+     (if (= key :advance-counter)
+       (do (when (and (#{"ICE"} (:type updated-card)) (:rezzed updated-card)) (update-ice-strength state side updated-card))
+           (when (not placed)
+             (trigger-event state side :advance (get-card state updated-card))))
+       (trigger-event state side :counter-added (get-card state updated-card)))
+     )))

 (defn set-prop [state side card & args]
   (update! state side (apply assoc (cons card args))))


dont give a flatline victory to the Corp if there is already a winner

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -734,8 +734,9 @@
 )

 (defn flatline [state]
-  (system-msg state :runner "is flatlined")
-  (win state :corp "Flatline"))
+  (when-not (:winner state)
+    (system-msg state :runner "is flatlined")
+    (win state :corp "Flatline")))

 (defn resolve-damage [state side type n {:keys [unpreventable unboostable card] :as args}]
   (swap! state update-in [:damage :defer-damage] dissoc type)


removing processing for now

removing processing for now

--- src/codemash/core.clj
+++ src/codemash/core.clj
@@ -177,9 +177,6 @@
 (piano/piano :note 50)
 (s-piano/sampled-piano :note 50)

-;;Processing GUI
-;;(require '[quil.core :as q :refer [defsketch]])
-
 ;;;;;;;;;;
 ;;Timing;;
 ;;;;;;;;;;
@@ -217,7 +214,6 @@
 (defonce beat-count   (counter [:after beat-trigger] :in-bus beat-trigger-bus :out-bus beat-count-bus))

 (defsynth get-beat [] (send-trig (in:kr beat-trigger-bus) count-trigger-id (+ (in:kr beat-count-bus) 1)))
-

 (defonce beat (get-beat [:after beat-count]))


Argh how did I almost delete the whole thing

--- src/compound/core.clj
+++ src/compound/core.clj
@@ -1,38 +1,104 @@
 (ns compound.core
-  (:require [compound.compound :as c]
-            [compound.indexes.multi]
-            [compound.indexes.unique]))
+  (:require [clojure.set :as set]
+            [clojure.spec.alpha :as s]))

-(c/empty-compound #{{:compound.index/id :id
-                     :compound.index/conflict-behaviour :compound.conflict-behaviours/upsert
-                     :compound.index/key-fn :id
-                     :compound.index/type :compound.index.types/primary}
-                    {:compound.index/id :b
-                     :compound.index/key-fn :b
-                     :compound.index/type :compound.index.types/unique}})
-(comment
-  (index-def  :b)
+(defn indexes [compound]
+  (get compound :compound/indexes))

-  (-> (empty-compound #{{:compound.index/id :id
-                         :compound.index/conflict-behaviour :compound.conflict-behaviours/upsert
-                         :compound.index/key-fn :id
-                         :compound.index/type :compound.index.types/primary}
-                        {:compound.index/id :a
-                         :compound.index/key-fn :a
-                         :compound.index/type :compound.index.types/unique}})
-      (add [{:id 1 :a 3} {:id 2 :a 2} {:id 4 :a 4}]))
+(defn index [compound id]
+  (get-in compound [:compound/indexes id]))

-  (-> (empty-compound #{{:compound.index/id :id
-                         :compound.index/conflict-behaviour :compound.conflict-behaviours/upsert
-                         :compound.index/key-fn :id
-                         :compound.index/type :compound.index.types/primary}
-                        {:compound.index/id :b
-                         :compound.index/key-fn :b
-                         :compound.index/type :compound.index.types/unique}
-                        {:compound.index/id :c
-                         :compound.index/key-fn :c
-                         :compound.index/type :compound.index.types/multi}})
+(defn primary-index-id [compound]
+  (get compound :compound/primary-index-id))

-      (add [{:id 1 :b 1 :c 3} {:id 2 :c 4 :b 2} {:id 3 :c 3 :b 3}])
-      (remove [1 ]))
-  )
+(defn index-defs [compound]
+  (get compound :compound/index-defs))
+
+(defn index-def [compound id]
+  (get (index-defs compound) id))
+
+(defn primary-index-def [compound]
+  (index-def compound (primary-index-id compound)))
+
+(defn primary-index [compound]
+  (index compound (primary-index-id compound)))
+
+(defn secondary-indexes [compound]
+  (dissoc (indexes compound) (primary-index-id compound)))
+
+(defmulti index-def->behaviour :compound.index/type)
+
+(defmulti index-def->spec :compound.index/type)
+
+(def index-def->behaviour-memoized (memoize index-def->behaviour))
+
+(defmethod index-def->spec :compound.index.types/primary
+  [_]
+  (s/keys :req [:compound.index/key-fn :compound.index/id :compound.index/type :compound.index/conflict-behaviour]))
+
+(defn add [compound items]
+  (let [{:compound.index/keys [id key-fn conflict-behaviour]} (primary-index-def compound)
+        [new-primary-index added removed] (reduce (fn add-items-to-primary-index
+                                                    [[index added removed] item]
+                                                    (let [k (key-fn item)
+                                                          existing (get index k)]
+                                                      (cond
+                                                        (and existing (= conflict-behaviour :compound.conflict-behaviours/throw))
+                                                        (throw (ex-info "Duplicate key " {:k k, :index id, :item item}))
+
+                                                        (and existing (= conflict-behaviour :compound.conflict-behaviours/upsert))
+                                                        [(assoc! index k item)
+                                                         (conj! added item)
+                                                         (conj! removed existing)]
+
+                                                        :else [(assoc! index k item)
+                                                               (conj! added item)
+                                                               removed])))
+                                                  [(transient (primary-index compound)) (transient #{}) (transient #{})]
+                                                  items)
+        [added removed] [(persistent! added) (persistent! removed)]
+        new-secondary-indexes (reduce-kv (fn update-secondary-indexes [indexes index-id index]
+                                           (let [{:compound.index.behaviour/keys [add remove]} (index-def->behaviour-memoized (index-def compound index-id))]
+                                             (assoc! indexes index-id (-> (add index added)
+                                                                          (remove removed)))))
+                                         (transient {})
+                                         (secondary-indexes compound))
+        new-indexes (assoc! new-secondary-indexes (primary-index-id compound) (persistent! new-primary-index))]
+    (assoc compound :compound/indexes (persistent! new-indexes))))
+
+(defn remove [compound ks]
+  (let [{:compound.index/keys [id key-fn]} (primary-index-def compound)
+        [new-primary-index removed] (reduce (fn remove-items-from-primary-index
+                                              [[index removed] k]
+                                              (let [item (get index k)]
+                                                [(dissoc! index k)
+                                                 (conj! removed item)]))
+                                            [(transient (primary-index compound)) (transient #{})]
+                                            ks)
+        removed (persistent! removed)
+        new-secondary-indexes (reduce-kv (fn [m index-id index]
+                                           (let [{:compound.index.behaviour/keys [remove]} (index-def->behaviour-memoized (index-def compound index-id))]
+                                             (assoc! m index-id (remove index removed))))
+                                         (transient {})
+                                         (secondary-indexes compound))
+        new-indexes (assoc! new-secondary-indexes (primary-index-id compound) (persistent! new-primary-index))]
+    (assoc compound :compound/indexes (persistent! new-indexes))))
+
+(defn empty-compound [index-defs]
+  (s/assert :compound/index-defs index-defs)
+  (let [{:keys [index-defs-by-id index-defs-by-type]} (reduce (fn [m index-def]
+                                                                (let [{:compound.index/keys [id type]} index-def]
+                                                                  (-> (assoc-in m [:index-defs-by-id id] index-def)
+                                                                      (update-in [:index-defs-by-type type] (fnil conj #{}) index-def))))
+                                                              {}
+                                                              index-defs)
+        primary-index-def (first (get index-defs-by-type :compound.index.types/primary))
+        primary-index-id (get primary-index-def :compound.index/id)
+        secondary-index-defs (dissoc index-defs-by-id primary-index-id)]
+    {:compound/index-defs index-defs-by-id
+     :compound/indexes (reduce-kv (fn make-indexes [indexes index-id index-def]
+                                    (let [{:compound.index.behaviour/keys [empty]} (index-def->behaviour-memoized index-def)]
+                                      (assoc indexes index-id empty)))
+                                  {primary-index-id {}}
+                                  secondary-index-defs)
+     :compound/primary-index-id primary-index-id}))


Some cleanup

Some cleanup

--- src/foreclojure/users.clj
+++ src/foreclojure/users.clj
@@ -267,12 +267,11 @@
 (defn datatable-paging [users start length]
   (take length (drop start users)))

-(defn datatable-sort-cols [users sort-col]
-  (case sort-col
-        0 (sort-by :rank users)
-        1 (sort-by :user users)
-        2 (sort-by (comp :solved count) users)
-        users))
+(let [column-sorts [:rank :user (comp :solved count)]]
+  (defn datatable-sort-cols [users sort-col]
+    (if-let [sort-fn (get column-sorts sort-col)]
+      (sort-by sort-fn users)
+      users)))

 (defn datatable-sort-dir [users sort-dir]
   (if (= sort-dir "asc")
@@ -282,9 +281,9 @@
 (defn datatable-sort [users sort-col sort-dir]
   (-> users (datatable-sort-cols sort-col) (datatable-sort-dir sort-dir)))

-(defn datatable-filter [users str]
-  (if str
-    (filter #(< -1 (.indexOf (if (:user %) (:user %) "") str)) users)
+(defn datatable-filter [users search]
+  (if search
+    (filter #(.contains (:user % "") search) users)
     users))

 (defn datatable-process [users params]


some extra logging.

some extra logging.

--- src/metabase/driver/sync.clj
+++ src/metabase/driver/sync.clj
@@ -143,6 +143,7 @@
   [driver table]
   (let [database @(:db table)]
     ;; Now do the syncing for Table's Fields
+    (log/debug (format "Determining active Fields for Table '%s'..." (:name table)))
     (let [active-column-names->type (active-column-names->type driver table)
           field-name->id (sel :many :field->id [Field :name] :table_id (:id table) :active true)]
       (assert (map? active-column-names->type) "active-column-names->type should return a map.")
@@ -237,6 +238,7 @@
   [driver field]
   {:pre [driver
          field]}
+  (log/debug (format "Syncing field '%s.%s'..." (:name @(:table field)) (:name field)))
   (sync-field->> field
                  (mark-url-field! driver)
                  mark-category-field!


remove unneeded declare

remove unneeded declare

--- src/metabase/http_client.clj
+++ src/metabase/http_client.clj
@@ -6,7 +6,6 @@

 (declare authenticate
          build-url
-         client
          -client)

 ;; ## API CLIENT


cjl - Remove dumb comment

cjl - Remove dumb comment

--- src/icfp2015/gameplay.clj
+++ src/icfp2015/gameplay.clj
@@ -1,8 +1,5 @@
 (ns icfp2015.gameplay
   (:require [icfp2015.board :refer [make-board transition-board]]))
-
-; (defprotocol AI
-;   (get-move [board] "Returns a [new board, command] vector"))

 (defn handle-unit
   [ai initial-board unit]