Refactors Edge of World and Snare!

Refactors Edge of World and Snare!

--- src/clj/game/cards-assets.clj
+++ src/clj/game/cards-assets.clj
@@ -192,20 +192,11 @@
                  :msg (msg "place 1 advancement token on " (card-str state target))}]}

    "Edge of World"
-   {:access {:req (req installed)
-             :effect (effect (show-wait-prompt :runner "Corp to use Edge of World")
-                             (resolve-ability
-                               {:optional
-                                {:prompt "Pay 3 [Credits] to use Edge of World ability?"
-                                 :yes-ability {:cost [:credit 3]
-                                               :msg (msg "do " (count (get-in corp [:servers (last (:server run)) :ices]))
-                                                         " brain damage")
-                                               :effect (effect (clear-wait-prompt :runner)
-                                                               (damage :brain
-                                                                       (count (get-in corp [:servers (last (:server (:run @state))) :ices]))
-                                                                       {:card card}))}
-                                 :no-ability {:effect (effect (clear-wait-prompt :runner))}}}
-                               card nil))}}
+   (letfn [(ice-count [state]
+             (count (get-in (:corp @state) [:servers (last (:server (:run @state))) :ices])))]
+       (installed-access-trigger 3 {:msg (msg "do " (ice-count state) " brain damage")
+                                    :effect (effect (damage :brain (ice-count state)
+                                                            {:card card}))}))

    "Elizabeth Mills"
    {:effect (effect (lose :bad-publicity 1)) :msg "remove 1 bad publicity"
@@ -588,13 +579,14 @@
    {:access {:req (req (not= (first (:zone card)) :discard))
              :effect (effect (show-wait-prompt :runner "Corp to use Snare!")
                              (resolve-ability
-                               {:optional {:prompt "Pay 4 [Credits] to use Snare! ability?"
-                                           :yes-ability {:cost [:credit 4]
-                                                         :msg "do 3 net damage and give the Runner 1 tag"
-                                                         :effect (effect (clear-wait-prompt :runner)
-                                                                         (damage :net 3 {:card card})
-                                                                         (tag-runner :runner 1))}
-                                           :no-ability {:effect (effect (clear-wait-prompt :runner))}}} card nil))}}
+                               {:optional
+                                {:prompt "Pay 4 [Credits] to use Snare! ability?"
+                                 :end-effect (effect (clear-wait-prompt :runner))
+                                 :yes-ability {:cost [:credit 4]
+                                               :msg "do 3 net damage and give the Runner 1 tag"
+                                               :effect (effect (damage :net 3 {:card card})
+                                                               (tag-runner :runner 1))}}}
+                               card nil))}}

    "Space Camp"
    {:access {:msg (msg "place 1 advancement token on " (card-str state target))


fix High-Stakes Job identification of valid servers

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -282,8 +282,8 @@
    "High-Stakes Job"
    {:prompt "Choose a server"
     :choices (req (let [unrezzed-ice #(seq (filter (complement rezzed?) (:ices (second %))))
-                        ok-servs (filter unrezzed-ice runnable-servers)]
-                    (map (comp zone->name first) ok-servs)))
+                        ok-servs (filter unrezzed-ice (get-in @state [:corp :servers]))]
+                    (filter #(can-run-server? state %) (map (comp zone->name first) ok-servs))))
     :effect (effect (run target {:end-run {:req (req (:successful run)) :msg " gain 12 [Credits]"
                                            :effect (effect (gain :runner :credit 12))}} card))}


Revert interaction between Apocalypse/Singularity and Hostile Infrastructure.

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -26,9 +26,8 @@
     :effect (req (let [allcorp (->> (all-installed state :corp)
                                     (sort-by #(vec (:zone %)))
                                     (reverse))]
-                   (apply trigger-event state side :runner-trash allcorp)
                    (doseq [c allcorp]
-                     (trash state side c {:suppress-event true})))
+                     (trash state side c)))

                  ;; do hosted cards first so they don't get trashed twice
                  (doseq [c (all-installed state :runner)]
@@ -616,9 +615,8 @@
                        {:msg "trash all cards in the server at no cost"
                         :mandatory true
                         :effect (req (let [allcorp (get-in (:servers corp) (conj (:server run) :content))]
-                                       (apply trigger-event state side :runner-trash allcorp)
                                        (doseq [c allcorp]
-                                         (trash state side c {:suppress-event true}))))}} card))}
+                                         (trash state side c))))}} card))}

    "Social Engineering"
    {:prompt "Choose an unrezzed piece of ICE"


also scan paths from classpaths, not just paths

excluding dev-resources, resources, target/classes, src/java
to avoid including compiled resources

--- src/clj/shadow/cljs/build.clj
+++ src/clj/shadow/cljs/build.clj
@@ -894,17 +894,23 @@

 ;;; COMPILE STEPS

+(defn should-exclude-classpath [exclude path]
+  (boolean (some #(re-find % path) exclude)))
+
 (defn find-resources-in-classpath
-  "finds all cljs resources in .jar files in the classpath
-   ignores PATHS in classpath, add manually if you expect to find cljs there"
-  [state]
-  (with-logged-time
-    [(:logger state) "Find cljs resources in jars"]
-    (->> (classpath-entries)
-         (filter is-jar?)
-         (do-find-resources-in-paths state)
-         (merge-resources state)
-         )))
+  "finds all cljs resources in the classpath (ignores resources)"
+  ([state]
+    (find-resources-in-classpath state {:exclude [#"resources(/?)$"
+                                                  #"classes(/?)$"
+                                                  #"java(/?)$"]}))
+  ([state {:keys [exclude]}]
+   (with-logged-time
+     [(:logger state) "Find cljs resources in classpath"]
+     (->> (classpath-entries)
+          (remove #(should-exclude-classpath exclude %))
+          (do-find-resources-in-paths state)
+          (merge-resources state)
+          ))))

 (defn find-resources
   "finds cljs resources in the given path"


Generate HTML on separate thread

Generate HTML on separate thread

--- src/clojure/nightcode/git.clj
+++ src/clojure/nightcode/git.clj
@@ -122,12 +122,13 @@
     (getChildAt [i] (commit-node (nth commits i)))
     (getChildCount [] (count commits))))

+(defn selected-commit
+  [^JTree sidebar]
+  (some-> sidebar .getSelectionPath .getLastPathComponent .getUserObject))
+
 (defn selected-row
   [^JTree sidebar commits]
-  (when-let [^RevCommit selected-commit (some-> sidebar
-                                                .getSelectionPath
-                                                .getLastPathComponent
-                                                .getUserObject)]
+  (when-let [^RevCommit selected-commit (selected-commit sidebar)]
     (->> (map-indexed vector commits)
          (filter (fn [[index ^RevCommit commit]]
                    (= (some-> commit .getId)
@@ -154,10 +155,15 @@
         (.setSelectionMode TreeSelectionModel/SINGLE_TREE_SELECTION))))

 (defn update-content!
-  [content ^Git git ^RevCommit commit]
-  (doto content
-    (.setText (create-html git commit))
-    (.setCaretPosition 0)))
+  [^JTree sidebar content ^Git git ^RevCommit commit]
+  (future
+    (.setText content "")
+    (let [s (create-html git commit)]
+      (s/invoke-later
+        (when (= commit (selected-commit sidebar))
+          (doto content
+            (.setText s)
+            (.setCaretPosition 0)))))))

 (defn update-sidebar!
   ([]
@@ -186,7 +192,7 @@
           (reify TreeSelectionListener
             (valueChanged [this e]
               (->> (some-> e .getPath .getLastPathComponent .getUserObject)
-                   (update-content! content git)))))
+                   (update-content! sidebar content git)))))
         (.setSelectionRow (or selected-row 0))))))

 (def ^:dynamic *widgets* [])


Fix a function's arity

Fix a function's arity

--- src/clojure/picard/server.clj
+++ src/clojure/picard/server.clj
@@ -47,7 +47,7 @@
   (throw (Exception. "This response is finished")))

 (defn- aborted-req
-  [_ _]
+  [_ _ _ _]
   (throw (Exception. "This request has been aborted")))

 (defn- finalize-resp


Comment on conditional (dynamic) requiring of clojush.pushgp.visualize

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -603,7 +603,8 @@
   (when (:visualize push-argmap) ;; Visualization
     (reset! viz-data-atom {:generation 0
                            :best-total-error-history []})
-    (require 'clojush.pushgp.visualize)))
+    ;; Require conditionally (dynamically), avoiding unintended Quil sketch launch
+    (require 'clojush.pushgp.visualize)))

 (defn final-report


hack for DOMElement tagName

hack for DOMElement tagName

--- src/com/kaicode/infamous.cljs
+++ src/com/kaicode/infamous.cljs
@@ -93,7 +93,11 @@
        (let [component-type (:component/type component-descriptor)]
             (if (keyword? component-type)
               (let [component-constructor (famous-components component-type)
-                    component (component-constructor. famous-node)
+                    component (if (= :DOMElement component-type)
+                                (let [tag-name (:tag-name component-descriptor)
+                                      options (clj->js {:tagName tag-name})]
+                                     (component-constructor. famous-node options))
+                                (component-constructor. famous-node))
                     properties (dissoc component-descriptor :component/type :db/id)]
                    (doseq [p properties
                            :let [name (name (first p))


Update standalone to new Cassandra system structure + indend fix

--- src/containium/standalone.clj
+++ src/containium/standalone.clj
@@ -3,16 +3,15 @@
 ;; file, You can obtain one at http://mozilla.org/MPL/2.0/.

 (ns containium.standalone
-  (:require
-    [containium.systems                :refer (with-systems)]
-    [containium.systems.config         :refer (map-config)]
-    [containium.systems.repl           :as repl]
-    [containium.systems.elasticsearch  :as elastic]
-    [containium.systems.cassandra      :as cassandra]
-    [containium.systems.ring           :refer (test-http-kit)]
-    [ring.middleware.session.memory   :refer (memory-store)]
-    [clojure.java.io                  :as io]
-    ))
+  (:require [containium.systems :refer (with-systems)]
+            [containium.systems.config :refer (map-config)]
+            [containium.systems.repl :as repl]
+            [containium.systems.elasticsearch :as elastic]
+            [containium.systems.cassandra.embedded12 :as cassandra]
+            [containium.systems.ring :refer (test-http-kit)]
+            [ring.middleware.session.memory :refer (memory-store)]
+            [clojure.java.io :as io]))
+

 (defn run [spec containium-map]
   (prn "Ring handler: " (-> containium-map :ring :handler))
@@ -21,15 +20,15 @@
                          :session-store (memory-store)
                          :ring (test-http-kit (-> containium-map :ring :handler))
                          :elastic elastic/embedded
-                         :cassandra cassandra/embedded12
-                         ]
-    ((:start containium-map) systems {
-      :file (io/as-file ".")
-      :profiles []
-      :active-profiles []
-      :dev? true
-      :containium containium-map
-      })
-    (read-line)
-    ((:stop containium-map) systems))
+                         :cassandra cassandra/embedded12]
+    (let [start-fn (:start containium-map)
+          stop-fn (:stop containium-map)]
+      (start-fn systems
+                {:file (io/as-file ".")
+                 :profiles []
+                 :active-profiles []
+                 :dev? true
+                 :containium containium-map})
+      (read-line)
+      (stop-fn systems)))
   (shutdown-agents))


Add more translations and remove unused ones

--- src/discuss/translations.cljs
+++ src/discuss/translations.cljs
@@ -19,10 +19,14 @@
                      :options          "Einstellungen"
                      :save             "Speichern"
                      :show-discuss     "Zeige discuss"
-                     :start-discussion "Starte die Diskussion"}
+                     :start-discussion "Starte die Diskussion"
+                     :that             "dass"}
         :clipboard  {:heading "Clipboard"
                      :instruction "Ziehe diese Referenzen in das Textfeld beim Erzeugen eines neuen Arguments, um die Referenz zu nutzen."}
-        :discussion {:add-argument "Aussage hinzufügen"
+        :discussion {:add-position "Nichts von all dem. Ich habe eine andere Idee"
+                     :add-position-heading "Mein Vorschlag wäre, dass"
+                     :add-position-placeholder "wir dieses oder jenes machen sollten"
+                     :add-reason-placeholder "aus diesen und jenen Gründen"
                      :current      "Aktuelle Diskussion"
                      :restart      "Neustarten"
                      :submit       "Abschicken"}
@@ -31,7 +35,8 @@
                      :hits "Ergebnisse"}
         :login      {:nickname "Benutzername"
                      :password "Passwort"
-                     :hhu-ldap "Wir benutzen das Personenverzeichnug der Heinrich-Heine-Universität Düsseldorf. Alle Daten und Informationen werden natürlich SSL-verschlüsselt gesendet und nach Erhalt unter keinen Umständen an Dritte weitergegeben."}
+                     :hhu-ldap "Wir benutzen das Personenverzeichnug der Heinrich-Heine-Universität Düsseldorf. Alle Daten und Informationen werden natürlich SSL-verschlüsselt gesendet und nach Erhalt unter keinen Umständen an Dritte weitergegeben."
+                     :item "Klicke hier, damit du dich einloggen und eine neue Aussage hinzufügen kannst"}
         :nav        {:home "Start"
                      :find "Suchen"}
         :options    {:heading "Einstellungen"
@@ -61,10 +66,14 @@
                      :options          "Options"
                      :save             "Save"
                      :show-discuss     "Show discuss"
-                     :start-discussion "Start Discussion"}
+                     :start-discussion "Start Discussion"
+                     :that             "that"}
         :clipboard  {:heading "Clipboard"
                      :instruction "Drag a reference into the text-field on new argument creation to link the reference with your argument."}
-        :discussion {:add-argument "Add a new statement"
+        :discussion {:add-position  "Neither of the above, I have a different idea"
+                     :add-position-heading "My suggestion would be that"
+                     :add-position-placeholder "we should do this or that"
+                     :add-reason-placeholder "of this reason"
                      :current "Current Discussion"
                      :restart "Restart"
                      :submit "Submit"}
@@ -73,7 +82,8 @@
                      :hits "Results"}
         :login      {:nickname "Nickname"
                      :password "Password"
-                     :hhu-ldap "We are using the Register of Persons of the Heinrich-Heine-University Düsseldorf. All data and information are of course sent SSL encrypted and will never be passed on to any third parties after receipt."}
+                     :hhu-ldap "We are using the Register of Persons of the Heinrich-Heine-University Düsseldorf. All data and information are of course sent SSL encrypted and will never be passed on to any third parties after receipt."
+                     :item "Click here to authenticate and to be able to submit your own statements"}
         :nav        {:home "Home"
                      :find "Find"}
         :options    {:heading "Options"


Add tools-deps 1.11.1.1165

Add tools-deps 1.11.1.1165


Redirect to root on unauthed access to authed pages

--- src/expensapp/routes/home.clj
+++ src/expensapp/routes/home.clj
@@ -53,6 +53,6 @@
 (def all-routes
   (-> (ring.middleware.session/wrap-session
        (friend/authenticate (routes app-routes account-routes)
-                            {:login-uri "/session"
+                            {:login-uri "/"
                              :default-landing-uri "/session"
                              :workflows [auth-routes]}))))


first pass at getting scatter plot working

--- app/views/viz/plot.cljs
+++ app/views/viz/plot.cljs
@@ -34,17 +34,68 @@
       :line-geo line-geo
       :line-material line-material
       :line (js/THREE.Line. line-geo line-material)
-      :p-mat (js/THREE.ParticleBasicMaterial. (clj->js {:vertexColors true
+      :p-mat (js/THREE.PointCloudMaterial. (clj->js {:vertexColors true
                                                        :size 10}))
       :w w
       :h h
-      :x-scale (-> d3 .-scale (.linear) (.range [-50 50]))
-      :y-scale (-> d3 .-scale (.linear) (.range [-50 50]))
-      :z-scale (-> d3 .-scale (.linear) (.range [-50 50]))
+      :shadow-datoms (atom [])
+      :datoms (atom [])
       }))
   (will-mount
    [_]
-   (let [{:keys [renderer camera scene scatter-plot line w h]} (om/get-state owner)]
+   (let [{:keys [renderer camera scene scatter-plot line-geo line w h datoms]} (om/get-state owner)
+         x-event (-> d3 (.extent @datoms #(:x %)))
+         y-event (-> d3 (.extent @datoms #(:y %)))
+         z-event (-> d3 (.extent @datoms #(:z %)))
+         x-scale (-> d3 .-scale (.linear) (.domain x-event) (.range [-50 50]))
+         y-scale (-> d3 .-scale (.linear) (.domain y-event) (.range [-50 50]))
+         z-scale (-> d3 .-scale (.linear) (.domain z-event) (.range [-50 50]))
+         vpts {:x-max (nth x-event 1)
+               :x-center (/ (+ (nth x-event 1)
+                               (nth x-event 0)) 2)
+               :x-min (nth x-event 0)
+               :y-max (nth y-event 1)
+               :y-center (/ (+ (nth y-event 1)
+                               (nth y-event 0)) 2)
+               :y-min (nth y-event 0)
+               :z-max (nth z-event 1)
+               :z-center (/ (+ (nth z-event 1)
+                               (nth z-event 0)) 2)
+               :z-min (nth z-event 0)}
+         vs [(v (x-scale (:x-min vpts)) (y-scale (:y-center vpts)) (z-scale (:z-center vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-center vpts)) (z-scale (:z-center vpts)))
+             (v (x-scale (:x-center vpts)) (y-scale (:y-min vpts)) (z-scale (:z-center vpts))) (v (x-scale (:x-center vpts)) (y-scale (:y-max vpts)) (z-scale (:z-center vpts)))
+             (v (x-scale (:x-center vpts)) (y-scale (:y-center vpts)) (z-scale (:z-max vpts))) (v (x-scale (:x-center vpts)) (y-scale (:y-center vpts)) (z-scale (:z-min vpts)))
+
+             (v (x-scale (:x-min vpts)) (y-scale (:y-max vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-max vpts)) (z-scale (:z-min vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-min vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-min vpts)) (z-scale (:z-min vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-max vpts)) (z-scale (:z-max vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-max vpts)) (z-scale (:z-max vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-min vpts)) (z-scale (:z-max vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-min vpts)) (z-scale (:z-max vpts)))
+
+             (v (x-scale (:x-min vpts)) (y-scale (:y-center vpts)) (z-scale (:z-max vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-center vpts)) (z-scale (:z-max vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-center vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-center vpts)) (z-scale (:z-min vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-max vpts)) (z-scale (:z-center vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-max vpts)) (z-scale (:z-center vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-min vpts)) (z-scale (:z-center vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-min vpts)) (z-scale (:z-center vpts)))
+
+             (v (x-scale (:x-max vpts)) (y-scale (:y-min vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-max vpts)) (z-scale (:z-min vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-min vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-min vpts)) (y-scale (:y-max vpts)) (z-scale (:z-min vpts)))
+             (v (x-scale (:x-max vpts)) (y-scale (:y-min vpts)) (z-scale (:z-max vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-max vpts)) (z-scale (:z-max vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-min vpts)) (z-scale (:z-max vpts))) (v (x-scale (:x-min vpts)) (y-scale (:y-max vpts)) (z-scale (:z-max vpts)))
+
+             (v (x-scale (:x-center vpts)) (y-scale (:y-min vpts)) (z-scale (:z-max vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-max vpts)) (z-scale (:z-min vpts)))
+             (v (x-scale (:x-center vpts)) (y-scale (:y-min vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-min vpts)) (y-scale (:y-max vpts)) (z-scale (:z-min vpts)))
+             (v (x-scale (:x-max vpts)) (y-scale (:y-min vpts)) (z-scale (:z-center vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-max vpts)) (z-scale (:z-max vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-min vpts)) (z-scale (:z-center vpts))) (v (x-scale (:x-min vpts)) (y-scale (:y-max vpts)) (z-scale (:z-max vpts)))
+
+             (v (x-scale (:x-max vpts)) (y-scale (:y-max vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-max vpts)) (z-scale (:z-max vpts)))
+             (v (x-scale (:x-max vpts)) (y-scale (:y-min vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-min vpts)) (z-scale (:z-max vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-max vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-min vpts)) (y-scale (:y-max vpts)) (z-scale (:z-max vpts)))
+             (v (x-scale (:x-min vpts)) (y-scale (:y-min vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-min vpts)) (y-scale (:y-min vpts)) (z-scale (:z-max vpts)))
+
+             (v (x-scale (:x-min vpts)) (y-scale (:y-center vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-min vpts)) (y-scale (:y-center vpts)) (z-scale (:z-max vpts)))
+             (v (x-scale (:x-max vpts)) (y-scale (:y-center vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-max vpts)) (y-scale (:y-center vpts)) (z-scale (:z-max vpts)))
+             (v (x-scale (:x-center vpts)) (y-scale (:y-max vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-center vpts)) (y-scale (:y-max vpts)) (z-scale (:z-min vpts)))
+             (v (x-scale (:x-center vpts)) (y-scale (:y-min vpts)) (z-scale (:z-min vpts))) (v (x-scale (:x-center vpts)) (y-scale (:y-min vpts)) (z-scale (:z-max vpts)))
+             ]]
      (. renderer (setSize w h))
      (. renderer (setClearColor 0xEEEEEE 1.0))
      (aset camera "position" "x" 200)
@@ -52,14 +103,30 @@
      (aset camera "position" "z" 100)
      (. scene (add scatter-plot))
      (aset scatter-plot "rotation" "y" 0)
+     (-> line-geo .-vertices (.push vs))
      (aset line "type" (.-Lines js/THREE))
      (. scatter-plot (add line))
+     (let [{:keys [ws-chan event-bus]} (om/get-shared owner)
+           e-chan (chan)
+           ws-sub-chan (chan (sliding-buffer 25))]
+       (sub ws-chan :post ws-sub-chan)
+       (async/tap (:bus event-bus) e-chan)
+       (go-loop
+           [[m c] (async/alts! [ws-sub-chan e-chan])]
+         (when m
+           (condp = c
+             ws-sub-chan (om/update-state! owner :datoms #(conj % (:data m)))
+             e-chan (when (= m :reset)
+                      (om/set-state! owner :datoms [])))
+           (recur (async/alts! [ws-sub-chan e-chan])))))
      ))
   (did-mount
    [_]
    (let [{:keys [renderer camera scene scatter-plot w h]} (om/get-state owner)]
+     (.render renderer scene camera)
      (dommy/append! (om/get-node owner "plot") (.-domElement renderer)))
    )
   (render-state
-   [_ state]
-   (html [:div.plot-view {:ref "plot"}])))
+   [_ {:keys [datoms line-geo scence camera renderer]}]
+   (let []
+     (html [:div.plot-view {:ref "plot"}]))))


oops protocols don't support variadic arguments

--- src/org/libraryweasel/ligature/core.clj
+++ src/org/libraryweasel/ligature/core.clj
@@ -23,9 +23,9 @@

 (defprotocol LigatureDataset
   "A Dataset manages a collection of Statements and supports ontologies and querying."
-  (add-statements [this & statements]
+  (add-statements [this statements]
     "Accepts a seq of statement tuples")
-  (remove-statements [this & statements]
+  (remove-statements [this statements]
     "Accepts a seq of statement tuples")
   (all-statements [this]
     "Accepts nothing but returns a seq of all Statements in the Dataset.")
@@ -33,8 +33,8 @@
     "Returns a unique, new identifier in the form _:NUMBER")
   (match-statements [this pattern])
   (dataset-name [this])
-  (add-rules [this & rules])
-  (remove-rules [this & rules])
+  (add-rules [this rules])
+  (remove-rules [this rules])
   (all-rules [this])
   (match-rules [this pattern])
   (sparql-query [this query])


added example of combining vectors and maps

--- src/structural_typing/api/type_repo.clj
+++ src/structural_typing/api/type_repo.clj
@@ -47,12 +47,12 @@
   "A type repo that contains no types and uses the default success and error handlers."
   (->TypeRepo default/default-success-handler default/default-error-handler))

-(def origin
+(defn origin
   "Returns the original description of the `type-signifier` (a sequence of vectors and maps)"
   [type-repo type-signifier]
   (get-in type-repo [:original-type-descriptions type-signifier]))

-(def description
+(defn description
   "Returns the canonical (expanded) description of the `type-signifier`."
   [type-repo type-signifier]
   (get-in type-repo [:canonicalized-type-descriptions type-signifier]))


Use proper initial color value on workspace colorpicker.

--- src/uxbox/ui/workspace/colorpicker.cljs
+++ src/uxbox/ui/workspace/colorpicker.cljs
@@ -52,7 +52,7 @@

         (cp/colorpicker
          :theme :small
-         :value (:stroke shape "#000000")
+         :value (get shape attr "#000000")
          :on-change change-color)

         (recent-colors shape change-color)]))))


Improved handle-delete to select next-sibling or parent node after deletion.

--- evermind.web/src/evermind/web/core.cljs
+++ evermind.web/src/evermind/web/core.cljs
@@ -168,9 +168,15 @@
   [data]
   (om/transact! data [:mindmap]
                 (fn [m]
-                  (d/filter-tree
-                    m
-                    (fn [c] (not (-> c :attributes :selected)))))))
+                  (let [selected (first (selected-node m))
+                        parent (d/parent-node m selected)
+                        next-sibling (next-sibling parent is-selected)
+                        filtered (d/filter-tree
+                                   m
+                                   (fn [c] (not (is-selected c))))]
+                    (if (nil? next-sibling)
+                      (select-node filtered parent)
+                      (select-node filtered next-sibling))))))

 (defn handle-insert
   [data]


Minor label look fix

Minor label look fix

--- flatguiskins/src/flatgui/skins/flat.clj
+++ flatguiskins/src/flatgui/skins/flat.clj
@@ -523,7 +523,7 @@
                 [(setColor cin)
                  (let [d (* r 0.5)]
                    (fillOval (- (/ r 2) (/ d 2)) (- (/ r 2) (/ d 2)) d d))])
-              (label-look-impl foreground text h-alignment v-alignment h 0 w h)]))
+              (label-look-impl foreground text h-alignment v-alignment (if (= h-alignment :left) h 0) 0 w h)]))

 ;;;
 ;;; skin-map


enable schema validation on backend in dev env

--- resources/leiningen/new/closp/clj/user.clj
+++ resources/leiningen/new/closp/clj/user.clj
@@ -1,8 +1,10 @@
 (ns {{ns}}.user
   (:require [reloaded.repl :refer [go reset stop]]
+            [schema.core :as s]
             [{{ns}}.components.components :refer [dev-system]]))

 (defn start-dev-system []
+  (s/set-fn-validation! true)
   (go))

 (reloaded.repl/set-init! dev-system)


bump boot-cljs and clojurescript dependencies

--- resources/leiningen/new/tenzing/build.boot
+++ resources/leiningen/new/tenzing/build.boot
@@ -1,11 +1,11 @@
 (set-env!
  :source-paths    {{{source-paths}}}
  :resource-paths  #{"resources"}
- :dependencies '[[adzerk/boot-cljs          "0.0-3308-0" :scope "test"]
                  [adzerk/boot-cljs-repl     "0.1.9"      :scope "test"]
                  [adzerk/boot-reload        "0.3.1"      :scope "test"]
+ :dependencies '[[adzerk/boot-cljs          "1.7.48-6"   :scope "test"]
                  [pandeiro/boot-http        "0.6.3"      :scope "test"]
-                 [org.clojure/clojurescript "1.7.58"]{{{deps}}}])
+                 [org.clojure/clojurescript "1.7.122"]{{{deps}}}])

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


Refactor code for processing matches. (#2147)

Co-authored-by: Scott Crosby <23e8f75489aff47cf2cd5a529e9a769a24e9501c@twosigma.com>

--- scheduler/src/cook/scheduler/scheduler.clj
+++ scheduler/src/cook/scheduler/scheduler.clj
@@ -1172,7 +1172,10 @@

 (defn handle-resource-offers!
   "Gets a list of offers from mesos. Decides what to do with them all--they should all
-   be accepted or rejected at the end of the function."
+   be accepted or rejected at the end of the function.
+
+   Returns true if we matched the head or didn't match anything (so that we will not reduce
+   max-considerable next iteration)"
   [conn fenzo-state pool-name->pending-jobs-atom mesos-run-as-user
    user->usage user->quota num-considerable offers rebalancer-reservation-atom pool-name compute-clusters
    job->acceptable-compute-clusters-fn]
@@ -1326,23 +1329,21 @@
               (reset! front-of-job-queue-mem-atom (or (:mem first-considerable-job-resources) 0))
               (reset! front-of-job-queue-cpus-atom (or (:cpus first-considerable-job-resources) 0))

-              (let [matched-head-or-no-matches?
+              (let [no-matches? (empty? matches)
+                    matched-head-or-no-matches? (or no-matches? matched-considerable-jobs-head?)
                     ;; Possible innocuous reasons for no matches: no offers, or no pending jobs.
                     ;; Even beyond that, if Fenzo fails to match ANYTHING, "penalizing" it in the form of giving
                     ;; it fewer jobs to look at is unlikely to improve the situation.
                     ;; "Penalization" should only be employed when Fenzo does successfully match,
                     ;; but the matches don't align with Cook's priorities.
-                    (if (empty? matches)
-                      true
-                      (do
+                    _ (when-not no-matches?
                         (swap! pool-name->pending-jobs-atom
                                remove-matched-jobs-from-pending-jobs
                                matched-job-uuids pool-name)
                         (log-structured/debug (print-str "Updated pool-name->pending-jobs-atom:" @pool-name->pending-jobs-atom)
                                               {:pool pool-name})
                         (launch-matched-tasks! matches conn db (:fenzo fenzo-state) mesos-run-as-user pool-name)
-                        (update-host-reservations! rebalancer-reservation-atom matched-job-uuids)
-                        matched-considerable-jobs-head?))
+                        (update-host-reservations! rebalancer-reservation-atom matched-job-uuids))
                     ; Absolute maximum jobs we will consider autoscaling to.
                     {:keys [max-jobs-for-autoscaling autoscaling-scale-factor]} (config/kubernetes)
                     ; The fraction of jobs we tried to match that didn't actually get matched.


writing a gene-tweak function

writing a gene-tweak function

--- ws/Alex-Sandpit.clj
+++ ws/Alex-Sandpit.clj
@@ -152,5 +152,31 @@
 ;; <=

 ;; @@
+(def power_max 4)
+
+(defn gene-tweak
+  [indv]
+  (let [n (rand-int (count indv)) gene (nth indv n) new-gene (assoc gene (rand-int (count gene)) (rand-int power_max))]
+    (assoc indv n new-gene)
+    ))
+;; @@
+;; =>
+;;; {"type":"html","content":"#'goliath/gene-tweak","value":"#'goliath/gene-tweak"}
+;; <=

 ;; @@
+(gene-tweak
+      [[1 3 4 1] [2 3 4 5]])
+
+;; @@
+
+;; @@
+(count [1 2 0 0])
+;; @@
+;; =>
+;;; {"type":"html","content":"4","value":"4"}
+;; <=
+
+;; @@
+
+;; @@


some updates and lol spelling a stupid word

--- src/benjaminwarfield/views.clj
+++ src/benjaminwarfield/views.clj
@@ -26,7 +26,7 @@
     [:div.content content]])

 (defhtml index-content []
-  [:h2 "Hey ya'll"]
+  [:h2 "Hey y'all"]
   [:p [:a.about {:href "/about"} "Who do I think I am?"]])

 (defhtml about-content []
@@ -34,8 +34,8 @@
   [:div.around_the_web
     [:ul
       [:li [:a {:href "http://twitter.com/benjaminws"} "Twitter"]]
-      [:li [:a {:href "http://github.com/benjaminws"} "Github"]]
-      [:li [:a {:href "http://designinginteractive.com"} "Designing Interactive"]]
+      [:li [:a {:href "http://github.com/benjaminws"} "GitHub"]]
+      [:li [:a {:href "http://www.dreamhost.com"} "DreamHost"] " — Sr. Systems Engineer"]
       [:li [:a {:href "http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EA10315498C1579"} "GPG Key"]]]])

 (def articles-root (str (System/getProperty "user.dir") "/articles/"))


Added kbd, output tags and glossary helper

--- src/shared/hyjinks/core.cljc
+++ src/shared/hyjinks/core.cljc
@@ -265,12 +265,12 @@

 (deftags h1 h2 h3 h4 h5 h6 (hr void-element) (br void-element))
 (deftags ul ol li dl dt dd)
-(deftags b i u s del ins small sup sub code dfn em strong)
+(deftags b i u s del ins small sup sub code kbd dfn em strong)
 (deftags pre q blockquote cite mark)
 (deftags a (img void-element))
 (deftags (embed void-element) (object void-element) (param void-element))
 (deftags iframe audio video canvas)
-(deftags p span div textarea)
+(deftags p span div textarea output)
 (deftags table thead tbody tfoot th tr td caption colgroup (col void-element))
 (deftags address article header footer main section aside nav)
 (deftags figure figcaption legend)
@@ -308,19 +308,15 @@
   ([type url] (link {:rel "shortcut icon" :type type :href url}))
   ([url] (link {:rel "shortcut icon" :href url})))

-(defn- comp-tag [t u] (fn [& items] (t (map u (flatten items)))))
-
-(def bullet-list
+(defn bullet-list
   "Makes arguments into items in an unordered list."
-  (comp-tag ul li))
-
-(def number-list
+  [& contents]
+  (ul (map li (flatten contents))))
+
+(defn number-list
   "Makes arguments into items in an ordered list."
-  (comp-tag ol li))
-
-(def row-cells
-  "Makes arguments into table cells in a table row."
-  (comp-tag tr td))
+  [& contents]
+  (ol (map li (flatten contents))))

 (defn make-table
   "Makes a <table> with a <tbody> out of a 2D seq (seq of seqs)."
@@ -340,6 +336,14 @@
     (fn [[text value]] [(radio param value) (label text {:for value})])
     (partition 2 opts)))

+(defn glossary
+  "Builds a defintion list (<dl>/<dt>/<dd>) of the given
+   name-value pairs, sorted in alphabetical order."
+  [dict] (->> dict
+              (sort-by first)
+              (map (fn [[term value]] [(dt term) (dd value)]))
+              dl))
+
 (defn abbr
   "Creates an abbreviation
    ex: (abbr \"NASA\" \"National Aeronautics and Space Administration\")"


change do-task-heart to use StormClusterState.worker-heartbeat

--- test/clj/backtype/storm/nimbus_test.clj
+++ test/clj/backtype/storm/nimbus_test.clj
@@ -19,10 +19,21 @@
     (count (reverse-map (:task->node+port assignment)))
     ))

-(defn do-task-heartbeat [cluster storm-id task-id]
-  (let [state (:storm-cluster-state cluster)]
-    (.task-heartbeat! state storm-id task-id (TaskHeartbeat. (current-time-secs) 10 {}))
-    ))
+(defn mk-task->node+port+taskbeats [state storm-id]
+  (let [task->node+port (:task->node+port (.assignment-info state storm-id nil))
+        node+port->taskbeats (into {} (for [node+port (set (vals task->node+port))]
+                                        {node+port (atom {})}))]
+    (into {} (for [[task node+port] task->node+port
+                   :let [taskbeats (->> task (get task->node+port) (get node+port->taskbeats))]]
+               {task {:node+port node+port :taskbeats taskbeats}}))))
+
+(defn do-task-heartbeat [cluster storm-id task-id task->node+port+taskbeats]
+  (log-message "TASKBATS: " task->node+port+taskbeats)
+  (let [state (:storm-cluster-state cluster)
+        [node port] (-> task->node+port+taskbeats (get task-id) :node+port)
+        taskbeats (-> task->node+port+taskbeats (get task-id) :taskbeats)]
+    (swap! taskbeats assoc task-id (TaskHeartbeat. (current-time-secs) 10 {}))
+    (.worker-heartbeat! state storm-id node port {:storm-id storm-id :taskbeats @taskbeats})))

 (defn task-assignment [cluster storm-id task-id]
   (let [state (:storm-cluster-state cluster)
@@ -188,7 +199,9 @@
       (submit-local-topology (:nimbus cluster) "test3" {TOPOLOGY-MESSAGE-TIMEOUT-SECS 5} topology)
       (bind storm-id3 (get-storm-id state "test3"))
       (bind task-id (first (.task-ids state storm-id3)))
-      (do-task-heartbeat cluster storm-id3 task-id)
+      (bind task->node+port+taskbeats (mk-task->node+port+taskbeats state storm-id3))
+
+      (do-task-heartbeat cluster storm-id3 task-id task->node+port+taskbeats)
       (.killTopology (:nimbus cluster) "test3")
       (advance-cluster-time cluster 6)
       (is (= 0 (count (.task-storms state))))
@@ -227,25 +240,26 @@
       (bind [task-id1 task-id2]  (.task-ids state storm-id))
       (bind ass1 (task-assignment cluster storm-id task-id1))
       (bind ass2 (task-assignment cluster storm-id task-id2))
-
+      (bind task->node+port+taskbeats (mk-task->node+port+taskbeats state storm-id))
+
       (advance-cluster-time cluster 59)
-      (do-task-heartbeat cluster storm-id task-id1)
-      (do-task-heartbeat cluster storm-id task-id2)
+      (do-task-heartbeat cluster storm-id task-id1 task->node+port+taskbeats)
+      (do-task-heartbeat cluster storm-id task-id2 task->node+port+taskbeats)

       (advance-cluster-time cluster 13)
       (is (= ass1 (task-assignment cluster storm-id task-id1)))
       (is (= ass2 (task-assignment cluster storm-id task-id2)))
-      (do-task-heartbeat cluster storm-id task-id1)
-
-      (advance-cluster-time cluster 11)
-      (do-task-heartbeat cluster storm-id task-id1)
+      (do-task-heartbeat cluster storm-id task-id1 task->node+port+taskbeats)
+
+      (advance-cluster-time cluster 11)
+      (do-task-heartbeat cluster storm-id task-id1 task->node+port+taskbeats)
       (is (= ass1 (task-assignment cluster storm-id task-id1)))
       (check-consistency cluster "test")

       ; have to wait an extra 10 seconds because nimbus may not
       ; resynchronize its heartbeat time till monitor-time secs after
       (advance-cluster-time cluster 11)
-      (do-task-heartbeat cluster storm-id task-id1)
+      (do-task-heartbeat cluster storm-id task-id1 task->node+port+taskbeats)
       (is (= ass1 (task-assignment cluster storm-id task-id1)))
       (check-consistency cluster "test")

@@ -266,8 +280,8 @@
       (kill-supervisor cluster active-supervisor)

       (doseq [i (range 12)]
-        (do-task-heartbeat cluster storm-id task-id1)
-        (do-task-heartbeat cluster storm-id task-id2)
+        (do-task-heartbeat cluster storm-id task-id1 task->node+port+taskbeats)
+        (do-task-heartbeat cluster storm-id task-id2 task->node+port+taskbeats)
         (advance-cluster-time cluster 10)
         )
       ;; tests that it doesn't reassign tasks if they're heartbeating even if supervisor times out


Add descriptions to database tests

Add descriptions to database tests

--- test/clj/comic_reader/database_test.clj
+++ test/clj/comic_reader/database_test.clj
@@ -4,29 +4,34 @@
             [comic-reader.database :as sut]
             [datomic.api :as d]))

-(deftest database-component-test
+(deftest test-database-component
   (let [db (sut/new-database)]
-    (is (sut/database? db))
-    (is (sut/database? (component/start db)))
+    (testing "constructor and start always returns a database"
+      (is (sut/database? db))
+      (is (sut/database? (component/start db))))

-    (is (nil? (:conn (component/start db))))
+    (testing "with no config, no connection is started"
+      (is (nil? (:conn (component/start db)))))

     (let [config {:database-uri "datomic:mem://comics-test"
                   :norms-dir nil}
           db (assoc db :config config)]
-      (is (nil? (sut/get-conn db)))
+      (testing "connection is nil before start"
+        (is (nil? (:conn db))))

-      (let [started-db (component/start db)]
-        (is (not (nil? (:conn started-db))))))
+      (testing "connection is non-nil after successful start"
+        (let [started-db (component/start db)]
+          (is (not (nil? (:conn started-db)))))))

-    (let [config {:database-uri "datomic:mem://comics-test"
-                  :norms-dir "database/test-norms"}
-          db (-> db
-                 (assoc :config config)
-                 component/start)]
-      (is (= 1
-             (count
-              (d/q '[:find ?e
-                     :in $
-                     :where [?e :db/ident :test.enum/one]]
-                   (d/db (:conn db)))))))))
+    (testing "norms conformation happens on startup"
+      (let [config {:database-uri "datomic:mem://comics-test"
+                    :norms-dir "database/test-norms"}
+            db (-> db
+                   (assoc :config config)
+                   component/start)]
+        (is (= 1
+               (count
+                (d/q '[:find ?e
+                       :in $
+                       :where [?e :db/ident :test.enum/one]]
+                     (d/db (:conn db))))))))))


Updated version to 0.1.0-beta2

Updated version to 0.1.0-beta2

--- clients/clojure/project.clj
+++ clients/clojure/project.clj
@@ -1,4 +1,4 @@
-(defproject samsara/samsara-client "0.1.0-beta"
+(defproject samsara/samsara-client "0.1.0-beta2"
   :description "Clojure SDK for Samsara"
   :url "http://samsara.github.io"
   :license {:name "Apache License 2.0"


Whitespace

Whitespace

--- test/oxcart/passes/lambda_lift_test.clj
+++ test/oxcart/passes/lambda_lift_test.clj
@@ -47,7 +47,7 @@
                (ll/lift-lambdas {})
                (eclj/emit-clojure {})
                (eval)))))
-
+
   ;; Side by side letfn case
   ;; -----------------------
   (let [case '(let [x 1]
@@ -82,7 +82,7 @@
                (ll/lift-lambdas {})
                (eclj/emit-clojure {})
                (eval)))))
-
+
   ;; Closure of closures case
   ;; ------------------------
   (let [case '(let [x 1]


(maint) Clean up ns declaration in master_service_test

There were a couple of namespaces imported multiple times

--- test/integration/puppetlabs/services/master/master_service_test.clj
+++ test/integration/puppetlabs/services/master/master_service_test.clj
@@ -1,30 +1,28 @@
 (ns puppetlabs.services.master.master-service-test
   (:require
     [clojure.test :refer :all]
+    [puppetlabs.services.master.master-service :refer :all]
+    [cheshire.core :as json]
     [clojure.set :as setutils]
-    [puppetlabs.services.master.master-service :refer :all]
-    [puppetlabs.services.jruby.jruby-puppet-service :as jruby]
-    [puppetlabs.services.protocols.jruby-metrics :as jruby-metrics]
+    [clojure.string :as str]
+    [me.raynes.fs :as fs]
+    [puppetlabs.http.client.sync :as http-client]
+    [puppetlabs.kitchensink.core :as ks]
     [puppetlabs.puppetserver.bootstrap-testutils :as bootstrap-testutils]
-    [puppetlabs.trapperkeeper.app :as tk-app]
-    [puppetlabs.trapperkeeper.testutils.logging :as logutils]
-    [me.raynes.fs :as fs]
-    [puppetlabs.kitchensink.core :as ks]
-    [puppetlabs.http.client.sync :as http-client]
-    [cheshire.core :as json]
-    [puppetlabs.services.jruby.jruby-puppet-service :as jruby-service]
-    [puppetlabs.trapperkeeper.services :as tk-services]
     [puppetlabs.puppetserver.testutils :as testutils]
     [puppetlabs.services.jruby.jruby-metrics-core :as jruby-metrics-core]
-    [schema.core :as schema]
+    [puppetlabs.services.jruby.jruby-puppet-service :as jruby-service]
+    [puppetlabs.services.jruby.jruby-puppet-testutils :as jruby-testutils]
     [puppetlabs.services.master.master-core :as master-core]
+    [puppetlabs.services.protocols.jruby-metrics :as jruby-metrics]
+    [puppetlabs.services.protocols.puppet-profiler :as profiler-protocol]
     [puppetlabs.services.puppet-profiler.puppet-profiler-core :as puppet-profiler-core]
-    [puppetlabs.services.protocols.puppet-profiler :as profiler-protocol]
+    [puppetlabs.trapperkeeper.app :as tk-app]
+    [puppetlabs.trapperkeeper.services :as tk-services]
     [puppetlabs.trapperkeeper.services.metrics.metrics-core :as metrics-core]
     [puppetlabs.trapperkeeper.services.metrics.metrics-testutils :as metrics-testutils]
-    [puppetlabs.trapperkeeper.services :as tk]
-    [clojure.string :as str]
-    [puppetlabs.services.jruby.jruby-puppet-testutils :as jruby-testutils]
+    [puppetlabs.trapperkeeper.testutils.logging :as logutils]
+    [schema.core :as schema]
     [schema.test :as schema-test]))

 (def test-resources-path "./dev-resources/puppetlabs/services/master/master_service_test")
@@ -325,7 +323,7 @@
                          :max-active-instances 1}
           :webserver {:port 8081}}
          (let [jruby-service (tk-app/get-service app :JRubyPuppetService)]
-           (jruby/with-jruby-puppet
+           (jruby-service/with-jruby-puppet
             jruby-puppet jruby-service :ca-files-test
             (letfn [(test-path!
                       [setting expected-path]
@@ -598,7 +596,7 @@
                (jruby-testutils/return-instance jruby-service jruby-instance :http-client-metrics-test)))))))))

 (deftest ^:integration add-metric-ids-to-http-client-metrics-list-test
-  (let [test-service (tk/service
+  (let [test-service (tk-services/service
                       [[:MasterService add-metric-ids-to-http-client-metrics-list!]]
                       (init [this context]
                             (add-metric-ids-to-http-client-metrics-list! [["foo" "bar"]


Support scrolling through effect list with Shift.

--- src/afterglow/controllers/ableton_push.clj
+++ src/afterglow/controllers/ableton_push.clj
@@ -756,10 +756,10 @@
         fx-info @(:active-effects (:show controller))
         fx (:effects fx-info)
         fx-meta (:meta fx-info)
-        num-skipped (- (count fx-meta) room)]
+        num-skipped (- (count fx-meta) room @(:effect-offset controller))]
     (if (seq fx)
-      (do (loop [fx (drop num-skipped fx)
-                 fx-meta (drop num-skipped fx-meta)
+      (do (loop [fx (take room (drop num-skipped fx))
+                 fx-meta (take room (drop num-skipped fx-meta))
                  x first-cell]
             (let [effect (:effect (first fx))
                   info (first fx-meta)
@@ -771,12 +771,72 @@
               (aset (:next-top-pads controller) (* 2 x) (top-pad-state :dim :red))
               (when (seq (rest fx))
                 (recur (rest fx) (rest fx-meta) (inc x)))))
+          ;; Draw indicators if there are effects hidden from view in either direction
           (when (pos? num-skipped)
-            (aset (get (:next-display controller) 3) (* first-cell 17) (util/ubyte (:left-arrow special-symbols)))))
+            (aset (get (:next-display controller) 3) (* first-cell 17) (util/ubyte (:left-arrow special-symbols))))
+          (when (pos? @(:effect-offset controller))
+            (aset (get (:next-display controller) 3) 67 (util/ubyte (:right-arrow special-symbols)))))
       (do (write-display-cell controller 2 1 "       No effects")
           (write-display-cell controller 2 2 "are active.")))))

 (declare enter-stop-mode)
+
+(defn- find-effect-offset-range
+  "Determine the valid offset range for scrolling through the effect
+  list, based on how many effects are running, and how many currently
+  fit on the display. If we are currently scrolled beyond the sensible
+  range, correct that. Returns a tuple of the current offset, the
+  maximum sensible offset, and the number of effects displayed."
+  [controller]
+  (let [room (room-for-effects controller)
+        size (count (:effects @(:active-effects (:show controller))))
+        max-offset (max 0 (- size room))
+        ;; If we are offset more than now makes sense, fix that.
+        offset (swap! (:effect-offset controller) min max-offset)]
+    [offset max-offset room]))
+
+(defn- update-scroll-arrows
+  "Activate the arrow buttons for directions in which scrolling is
+  possible."
+  [controller]
+  (if @(:shift-mode controller)
+    ;; In shift mode, scroll through the effects list
+    (let [[offset max-offset] (find-effect-offset-range controller)]
+      ;; If there is an offset, user can scroll to the right
+      (when (pos? offset)
+        (swap! (:next-text-buttons controller)
+               assoc (:right-arrow control-buttons)
+               (button-state (:right-arrow control-buttons) :dim))
+        (swap! (:next-text-buttons controller)
+               assoc (:down-arrow control-buttons)
+               (button-state (:down-arrow control-buttons) :dim)))
+      ;; Is there room to scroll to the left?
+      (when (< offset max-offset)
+        (swap! (:next-text-buttons controller)
+               assoc (:left-arrow control-buttons)
+               (button-state (:left-arrow control-buttons) :dim))
+        (swap! (:next-text-buttons controller)
+               assoc (:up-arrow control-buttons)
+               (button-state (:up-arrow control-buttons) :dim))))
+
+    ;; In unshifted mode, scroll through the cue grid
+    (let [[origin-x origin-y] @(:origin controller)]
+      (when (pos? origin-x)
+        (swap! (:next-text-buttons controller)
+               assoc (:left-arrow control-buttons)
+               (button-state (:left-arrow control-buttons) :dim)))
+      (when (pos? origin-y)
+        (swap! (:next-text-buttons controller)
+               assoc (:down-arrow control-buttons)
+               (button-state (:down-arrow control-buttons) :dim)))
+      (when (> (- (controllers/grid-width (:cue-grid (:show controller))) origin-x) 7)
+        (swap! (:next-text-buttons controller)
+               assoc (:right-arrow control-buttons)
+               (button-state (:right-arrow control-buttons) :dim)))
+      (when (> (- (controllers/grid-height (:cue-grid (:show controller))) origin-y) 7)
+        (swap! (:next-text-buttons controller)
+               assoc (:up-arrow control-buttons)
+               (button-state (:up-arrow control-buttons) :dim))))))

 (defn- update-interface
   "Determine the desired current state of the interface, and send any
@@ -803,26 +863,8 @@
                          (if @(:shift-mode controller) :bright :dim)))

     (render-cue-grid controller)
-
-    ;; Activate the arrow buttons for directions in which scrolling is possible.
-    (let [[origin-x origin-y] @(:origin controller)]
-      (when (pos? origin-x)
-        (swap! (:next-text-buttons controller)
-              assoc (:left-arrow control-buttons)
-              (button-state (:left-arrow control-buttons) :dim)))
-      (when (pos? origin-y)
-        (swap! (:next-text-buttons controller)
-              assoc (:down-arrow control-buttons)
-              (button-state (:down-arrow control-buttons) :dim)))
-      (when (> (- (controllers/grid-width (:cue-grid (:show controller))) origin-x) 7)
-        (swap! (:next-text-buttons controller)
-              assoc (:right-arrow control-buttons)
-              (button-state (:right-arrow control-buttons) :dim)))
-      (when (> (- (controllers/grid-height (:cue-grid (:show controller))) origin-y) 7)
-        (swap! (:next-text-buttons controller)
-              assoc (:up-arrow control-buttons)
-              (button-state (:up-arrow control-buttons) :dim))))
-
+    (update-scroll-arrows controller)
+
     ;; Make the User button bright, since we live in User mode
     (swap! (:next-text-buttons controller)
            assoc (:user-mode control-buttons)
@@ -1225,31 +1267,56 @@

     44 ; Left arrow
     (when (pos? (:velocity message))
-      (let [[x y] @(:origin controller)]
-        (when (pos? x)
-          (reset! (:origin controller) [(max 0 (- x 8)) y])
-          (add-button-held-feedback-overlay controller (:left-arrow control-buttons)))))
+      (if @(:shift-mode controller)
+        ;; Trying to scroll back to older effects
+        (let [[offset max-offset room] (find-effect-offset-range controller)
+              new-offset (+ offset room)]
+          (reset! (:effect-offset controller) (min max-offset new-offset)))
+
+        ;; Trying to scroll left in cue grid
+        (let [[x y] @(:origin controller)]
+          (when (pos? x)
+            (reset! (:origin controller) [(max 0 (- x 8)) y])
+            (add-button-held-feedback-overlay controller (:left-arrow control-buttons))))))

     45 ; Right arrow
     (when (pos? (:velocity message))
-      (let [[x y] @(:origin controller)]
-        (when (> (- (controllers/grid-width (:cue-grid (:show controller))) x) 7)
-          (reset! (:origin controller) [(+ x 8) y])
-          (add-button-held-feedback-overlay controller (:right-arrow control-buttons)))))
+      (if @(:shift-mode controller)
+        ;; Trying to scroll forward to newer effects
+        (let [[offset max-offset room] (find-effect-offset-range controller)
+              new-offset (- offset room)]
+          (reset! (:effect-offset controller) (max 0 new-offset)))
+
+        ;; Trying to scroll right in cue grid
+        (let [[x y] @(:origin controller)]
+          (when (> (- (controllers/grid-width (:cue-grid (:show controller))) x) 7)
+            (reset! (:origin controller) [(+ x 8) y])
+            (add-button-held-feedback-overlay controller (:right-arrow control-buttons))))))

     46 ; Up arrow
     (when (pos? (:velocity message))
-      (let [[x y] @(:origin controller)]
-        (when (> (- (controllers/grid-height (:cue-grid (:show controller))) y) 7)
-          (reset! (:origin controller) [x (+ y 8)])
-          (add-button-held-feedback-overlay controller (:up-arrow control-buttons)))))
+      (if @(:shift-mode controller)
+        ;; Jump back to oldest effect
+        (let [[_ max-offset] (find-effect-offset-range controller)]
+          (reset! (:effect-offset controller) max-offset))
+
+        ;; Trying to scroll up in cue grid
+        (let [[x y] @(:origin controller)]
+          (when (> (- (controllers/grid-height (:cue-grid (:show controller))) y) 7)
+            (reset! (:origin controller) [x (+ y 8)])
+            (add-button-held-feedback-overlay controller (:up-arrow control-buttons))))))

     47 ; Down arrow
     (when (pos? (:velocity message))
-      (let [[x y] @(:origin controller)]
-        (when (pos? y)
-          (reset! (:origin controller) [x (max 0 (- y 8))])
-          (add-button-held-feedback-overlay controller (:down-arrow control-buttons)))))
+      (if @(:shift-mode controller)
+        ;; Jump forward to newest effect
+        (reset! (:effect-offset controller) 0)
+
+        ;; Trying to scroll down in cue grid
+        (let [[x y] @(:origin controller)]
+          (when (pos? y)
+            (reset! (:origin controller) [x (max 0 (- y 8))])
+            (add-button-held-feedback-overlay controller (:down-arrow control-buttons))))))

     59 ; User mode button
     (when (pos? (:velocity message))
@@ -1350,8 +1417,11 @@
   [controller note]
   (let [room (room-for-effects controller)
         fx-info @(:active-effects (:show controller))
-        fx (vec (drop (- (count (:effects fx-info)) room) (:effects fx-info)))
-        fx-meta (vec (drop (- (count (:meta fx-info)) room) (:meta fx-info)))
+        fx (:effects fx-info)
+        fx-meta (:meta fx-info)
+        num-skipped (- (count fx-meta) room @(:effect-offset controller))
+        fx (vec (drop num-skipped (:effects fx-info)))
+        fx-meta (vec (drop num-skipped (:meta fx-info)))
         offset (- 4 room)
         x (quot note 2)
         index (- x offset)
@@ -1479,6 +1549,7 @@
         {:id (swap! controller-counter inc)
          :show show
          :origin (atom [0 0])
+         :effect-offset (atom 0)
          :refresh-interval refresh-interval
          :port-in (midi/midi-find-device (amidi/open-inputs-if-needed!) device-name)
          :port-out (midi/midi-find-device (amidi/open-outputs-if-needed!) device-name)


Websocket component migrated to Units

Websocket component migrated to Units

--- src/clj/hellhound/components/websocket.clj
+++ src/clj/hellhound/components/websocket.clj
@@ -4,15 +4,16 @@
   have to do is, either use `websocket-server` function with
   `hellhound.system.defsystem` macro or use the `make-websocket` with a
   traditional system map."
-  (:require [hellhound.connection                   :refer [event-router]]
-            [hellhound.system                        :refer [get-system]]
-            [com.stuartsierra.component              :as component]
-            [taoensso.sente.packers.transit          :as packer]
-            [taoensso.sente                          :as sente]
-            [taoensso.sente.server-adapters.immutant :refer [get-sch-adapter]]))
+  (:require
+   [hellhound.connection                    :refer [event-router]]
+   [hellhound.system                        :refer [get-system]]
+   [hellhound.units.core                    :as unit]
+   [taoensso.sente.packers.transit          :as packer]
+   [taoensso.sente                          :as sente]
+   [taoensso.sente.server-adapters.immutant :refer [get-sch-adapter]]))

 (defrecord WebSocketServer [web-server-adapter handler options adapter]
-  component/Lifecycle
+  unit/Structure
   (start [component]
     (let [{:keys [ch-recv send-fn ajax-post-fn ajax-get-or-ws-handshake-fn connected-uids]}
           (sente/make-channel-socket-server! adapter  options) ;;web-server-adapter


Implemented restful route and functions for getting all available examples.

--- src/clj_formal_specifications_app/core.clj
+++ src/clj_formal_specifications_app/core.clj
@@ -3,9 +3,27 @@
             [compojure.route :as route]
             [ring.middleware.defaults :refer :all]
             [ring.util.response :as resp]
-            [org.httpkit.server :refer [run-server]]))
+            [org.httpkit.server :refer [run-server]]
+            [clojure.string :as str]))

-(defroutes api-routes)
+(defn filename-as-text
+  [filename]
+  (str/capitalize
+   (str/replace
+    (str/replace (peek (str/split filename #"/")) #".clj" "")
+    #"_" " ")))
+
+(defn files-as-list
+  [dir]
+  (rest (map str (file-seq (clojure.java.io/file dir)))))
+
+(defn example-listing
+  [req]
+  (let [filelist (files-as-list "resources/public/examples/")]
+    (zipmap (map filename-as-text filelist) filelist)))
+
+(defroutes api-routes
+  (GET "/api/examples" [] example-listing))

 (defn index
   [req]


Implemented route and handler for exporting the specification.

--- src/clj_formal_specifications_app/core.clj
+++ src/clj_formal_specifications_app/core.clj
@@ -11,10 +11,25 @@
     (resp/resource-response "index.html" {:root "public"})
     "text/html"))

+(defn as-clj-file
+  [fname contents]
+  {:status 200
+   :body contents
+   :headers {"Content-Disposition" (str "attachment; filename=\"" fname "\"")
+             "Content-Type" "text/plain"}})
+
+(defroutes api-routes
+  (POST "/api/export" [contents] (as-clj-file "specification.clj" contents)))
+
 (defroutes site-routes
   (GET "/" [] index)
   (route/resources "/")
   (route/not-found "Not found!"))

-(defn -main []
-  (run-server (wrap-defaults site-routes site-defaults) {:port 5000}))
+
+(def app-routes (routes (wrap-defaults api-routes api-defaults)
+                        (wrap-defaults site-routes site-defaults)))
+
+(defn -main
+  []
+  (run-server app-routes {:port 5000}))


Validate arguments with :pre/:post

Validate arguments with :pre/:post

--- src/com/palletops/domain_fn/middleware.clj
+++ src/com/palletops/domain_fn/middleware.clj
@@ -139,17 +139,17 @@
         elements (arg-elements refs)]
     (assoc arity
       :args (mapv first args-and-refs)
-      :body `(do
-               (schema/validate
-                ~(arg-schema (rest sig) elements varargs?)
-                ~(if (and varargs? (not (map? (last args))))
-                   `(concat
-                     ~(vec (butlast elements))
-                     ~(last elements))
-                   elements))
-               (let [r# (do ~@body)]
-                 (schema/validate ~(first sig) r#)
-                 r#)))))
+      :conditions (-> (or conditions {})
+                      (update-in [:pre] (fnil conj [])
+                                 `(schema/validate
+                                   ~(arg-schema (rest sig) elements varargs?)
+                                   ~(if (and varargs? (not (map? (last args))))
+                                      `(concat
+                                        ~(vec (butlast elements))
+                                        ~(last elements))
+                                      elements)))
+                      (update-in [:post] (fnil conj [])
+                                 `(schema/validate ~(first sig) ~'%))))))

 (defn validate-arguments
   "A middleware that takes :sig metadata as a sequence of schema


Remove some restrictions on matrix constructor.

--- src/uxbox/util/matrix.cljs
+++ src/uxbox/util/matrix.cljs
@@ -26,9 +26,7 @@
   of elements of the collection."
   [coll]
   {:pre [(coll? coll)
-         (coll? (first coll))
-         (= (count coll)
-            (count (first coll)))]}
+         (coll? (first coll))]}
   (Matrix. (clj->js coll)))

 (defn multiply


add exception for noun plural "uomini"

add exception for noun plural "uomini"


Keys for the react key god

Keys for the react key god


Add generate 'build' function

Add generate 'build' function


Renaming options to modules on command line

--- lein-template/src/leiningen/new/modular.clj
+++ lein-template/src/leiningen/new/modular.clj
@@ -250,12 +250,12 @@

               }]

-    (main/info (format "Generating a new modular project named %s with options :-\n%s"
+    (main/info (format "Generating a new modular project named %s with modules :-\n%s"
                        name
                        (->> manifest :assemblies
                             (filter select-assembly?)
-                            (map :assembly)
-                            (interpose "\n")
+                            (map (comp clojure.core/name :assembly))
+                            (interpose ", ")
                             (apply str))))

     (letfn [(proc-file [{:keys [target template close-parens? file]}]


add comment

add comment

--- src/babel/writer.clj
+++ src/babel/writer.clj
@@ -375,6 +375,7 @@
     (let [spec (unify {:root {target-language-keyword {target-language-keyword verb}}}
                        spec)]
       (log/debug (str "fill-verb spec: " spec))
+      ;; use (map) for debugging
       (pmap (fn [tense] (fill-by-spec (unify spec
                                              tense)
                                       count


Set SSO to true for Auth0  and removed comments

--- src/checkin/auth.clj
+++ src/checkin/auth.clj
@@ -14,7 +14,8 @@
   {:authentication-uri {:url   "https://loneworker.auth0.com/authorize"
                         :query {:client_id    (:client-id client-config)
                                 :redirect_uri (format-config-uri client-config)
-                                :scope        "openid name email"}}
+                                :scope        "openid name email"
+                                :sso          true}}

    :access-token-uri   {:url   "https://loneworker.auth0.com/oauth/token"
                         :query {:client_id     (:client-id client-config)
@@ -32,11 +33,11 @@
   (let [jwt-string (:access-token token)
         jwt (jwt/str->jwt jwt-string)
         user-id (get-in jwt [:claims :sub])                 ; TODO: verify JWT
-        user-name (get-in jwt [:claims :name])]              ; TODO: verify JWT
+        user-name (get-in jwt [:claims :name])]             ; TODO: verify JWT

-    {:identity user-id
+    {:identity  user-id
      :user-name user-name
-     :roles    #{:user}}))
+     :roles     #{:user}}))

 (def friend-config
   {:workflows [(oauth2/workflow
@@ -48,16 +49,3 @@
                   })
                ]})

-;jwt-string (:id_token parsed-response-body)
-;_ (println "raw JWT is " jwt-string)
-;parsed-jwt (str->jwt jwt-string)
-;parsed-jwt
-;
-;(defn process-auth-response [params]
-;  (let [params-as-keys (keywordize-keys params)
-;        code (:code params-as-keys)
-;        jwt (exchange-auth-code-for-token code)
-;        user-id (get-in jwt [:claims :sub]) ; TODO: verify JWT
-;        user-name (get-in jwt [:claims :name])] ; TODO: verify JWT
-;    (str "Hello " user-name ", your user Id is " user-id)))
-


Fixed bug in combined-idset query: missing slash

--- src/kabob/build/id_sets/id_set_triples.clj
+++ src/kabob/build/id_sets/id_set_triples.clj
@@ -226,7 +226,7 @@
   (let [query-pat `((?/id skos/exactMatch ?/id2)
                      (?/id rdf/type ?/id_type)
                      (?/id_type [rdfs/subClassOf *] obo/IAO_0000578 ) ;centrally registered identifier
-                     (?/id2 rdf/type ?id_type2)
+                     (?/id2 rdf/type ?/id_type2)
                      (?/id_type2 [rdfs/subClassOf *] obo/IAO_0000578) ;centrally registered identifier
                      (!= ?/id  ?/id2))]
     (binding [*use-inference* false


[Add] LUDecomposition

[Add] LUDecomposition

--- src/clj_elm/core.clj
+++ src/clj_elm/core.clj
@@ -6,7 +6,7 @@
             [clojure.core.match :refer [match]]
             [taoensso.timbre.profiling :refer [profile p]])
   (:import [clj_elm.data DataSet]
-           [Jama Matrix])
+           [Jama Matrix LUDecomposition])
   (:gen-class))

 (def ^:dynamic *sign-reverse* false)


Split (write-object) out of (write-blob). Fixed (make-parents) issue.

--- src/clj_git/core.clj
+++ src/clj_git/core.clj
@@ -50,16 +50,20 @@

 ; TODO: This should throw if file exists
 ;   Even better, check that existing contents match..?
-(defn write-blob
-  [text]
-  (let [full-text (str "blob " (count text) "\0" text)
-        hash-text (hash-str text)
+(defn write-object
+  [full-text]
+  (let [hash-text (sha-1-hex full-text)
         [d-name f-name] (map #(apply str %) (split-at 2 hash-text))
         filepath (str (git-root) "objects/" d-name "/" f-name)
         data (byte-array (map byte full-text))
         bdata (compress-zlib data)]
+    (make-parents filepath)
     (with-open [wrtr (output-stream filepath)]
       (.write wrtr bdata))))
+
+(defn write-blob
+  [text]
+  (write-object (str "blob " (count text) "\0" text)))

 (defn store-file
   [filepath]
@@ -209,4 +213,6 @@
        (filter #(not= 0 (.compareTo (nth % 1) (nth % 2))))
        (map first)))

-(defn to-commit []) ;TODO; This
+(defn files-to-commit []) ;TODO; This
+
+


fix Inspect page sometimes missing updates

--- src/main/shadow/cljs/ui/pages/inspect.cljs
+++ src/main/shadow/cljs/ui/pages/inspect.cljs
@@ -27,6 +27,9 @@
 (def date-format (DateTimeFormat. "yyyy-MM-dd HH:mm:ss"))
 (def time-format (DateTimeFormat. "HH:mm:ss"))

+(defn refresh-ui [idents]
+  (fc/transact! env/app [] {:refresh idents}))
+
 (defonce tool-ref (atom nil))
 (defonce rpc-id-seq (atom 0))
 (defonce rpc-ref (atom {}))
@@ -65,8 +68,7 @@
       {:obj-result
        (fn [{:keys [result] :as msg}]
          (swap! state assoc-in [::oid oid :value] result)
-         (fc/transact! env/app [[::oid oid]])
-         )}))
+         (refresh-ui [[::oid oid]]))}))

   (when (contains? (:supports summary) :fragment)
     (let [max (min 35 (:entries summary))]
@@ -83,8 +85,7 @@
           {:obj-result
            (fn [{:keys [result] :as msg}]
              (swap! state update-in [::oid oid :fragment] merge result)
-             (fc/transact! env/app [[::oid oid]])
-             )})))))
+             (refresh-ui [[::oid oid]]))})))))

 (defn add-new-tap-obj
   "fetches enough info for new object to display as tap"
@@ -111,7 +112,7 @@
              {:obj-result
               (fn [{:keys [result] :as msg}]
                 (swap! state assoc-in [::oid oid :edn-limit] result)
-                (fc/transact! env/app [[::oid oid]])
+                (refresh-ui [[::oid oid]])
                 )}))))}))

 (defn add-new-nav-obj
@@ -127,7 +128,7 @@
      (fn [{:keys [summary] :as msg}]
        (swap! state assoc-in [::oid oid :summary] (add-ts summary))
        ;; FIXME: don't rerender just yet?
-       (fc/transact! env/app [[::oid oid]])
+       (refresh-ui [[::oid oid]])
        (maybe-fetch-initial-fragment state (get-in @state [::oid oid])))}))

 (defn add-first [prev head max]
@@ -157,7 +158,7 @@
         {:obj-result
          (fn [{:keys [result] :as msg}]
            (swap! state update-in [::oid oid :fragment] merge result)
-           (fc/transact! env/app [[::oid oid]])
+           (refresh-ui [[::oid oid]])
            )}))))

 (defmutation select-runtime [{:keys [rid] :as params}]
@@ -183,6 +184,7 @@
          :supported-ops
          (fn [{:keys [ops] :as msg}]
            (swap! state assoc-in [::rid rid ::supported-ops] ops)
+           (refresh-ui [[::rid rid]])

            (when (contains? ops :request-tap-history)

@@ -199,7 +201,9 @@
                             :when (not (get-in data [::oid oid :summary]))]
                       (add-new-tap-obj state rid oid)))

-                  (swap! state assoc-in [::rid rid ::objects] (as-idents ::oid oids)))})))}))))
+                  (swap! state assoc-in [::rid rid ::objects] (as-idents ::oid oids))
+                  (refresh-ui [[::rid rid]])
+                  )})))}))))

 (defmutation unselect-object [{:keys [oid] :as params}]
   (action [{:keys [state] :as env}]
@@ -280,12 +284,12 @@
              (fn [{:keys [e] :as msg}]
                (js/console.log "request-pprint failed" msg)
                (swap! state assoc-in [::oid oid :pprint] (str "Failed: " e))
-               (fc/transact! env/app [[::oid oid]]))
+               (refresh-ui [[::oid oid]]))

              :obj-result
              (fn [{:keys [result] :as msg}]
                (swap! state assoc-in [::oid oid :pprint] result)
-               (fc/transact! env/app [[::oid oid]]))}))
+               (refresh-ui [[::oid oid]]))}))

         ;; FIXME: repeated code
@@ -299,12 +303,13 @@
              (fn [{:keys [e] :as msg}]
                (js/console.log "request-edn failed" msg)
                (swap! state assoc-in [::oid oid :edn] (str "Failed: " e))
-               (fc/transact! env/app [[::oid oid]]))
+               (refresh-ui [[::oid oid]]))

              :obj-result
              (fn [{:keys [result] :as msg}]
                (swap! state assoc-in [::oid oid :edn] result)
-               (fc/transact! env/app [[::oid oid]]))}))
+               (refresh-ui [[::oid oid]])
+               )}))

         ;; don't need to do anything for :browse
         nil))))


carry-reagent: turn release signing off for :clojars

--- contrib/reagent/project.clj
+++ contrib/reagent/project.clj
@@ -16,7 +16,4 @@

   :source-paths ["src"]

-  :repositories {"snapshots" {:url           "https://clojars.org/repo"
-                              :sign-releases false}
-                 "releases"  {:url           "https://clojars.org/repo"
-                              :sign-releases false}})
+  :repositories {"clojars" {:sign-releases false}})


update to version 3 endpoints

update to version 3 endpoints

--- alerta.clj
+++ alerta.clj
@@ -4,8 +4,8 @@
 (def version "1.0.0")

 (def alerta-endpoints
-	{:alert "http://localhost:8080/alerta/api/v2/alerts/alert.json"
-	:heartbeat "http://localhost:8080/alerta/api/v2/heartbeats/heartbeat.json"})
+	{:alert "http://localhost:8080/api/alert"
+	:heartbeat "http://localhost:8080/api/heartbeat"})

 (defn post-to-alerta
   "POST to the Alerta REST API."


lock temporary-state around the assoc-ins so we dont lose state in case of 2 async requests

--- src/bzzz/state.clj
+++ src/bzzz/state.clj
@@ -61,7 +61,8 @@
   ;;=> { :foo { :bar 1, :baz 2 } }
   "
   [data]
-  (doseq [[k v] data] (swap! temporary-state assoc-in k v)))
+  (locking temporary-state
+    (doseq [[k v] data] (swap! temporary-state assoc-in k v))))

 (defn temp-empty
   "Erases the data saved in the temporary state."


Shorter code.

Shorter code.

--- src/cbfg/core.cljs
+++ src/cbfg/core.cljs
@@ -185,11 +185,8 @@
       ((get run-controls (.-id (.-target (<! run-control-ch)))))
       (recur run-control-ch))
     (go-loop [num-events 0]
-      (let [ed @event-delay]
-        (when (> ed 0)
-          (<! (timeout ed)))
-        (when (< ed 0)
-          (<! step-ch)))
+      (when (> @event-delay 0) (<! (timeout @event-delay)))
+      (when (< @event-delay 0) (<! step-ch))
       (let [[actx event] (<! event-ch)
             [verb step & args] event
             vis-event-handler (get (get vis-event-handlers verb) step)]


add deps

add deps

--- dependencies.boot
+++ dependencies.boot
@@ -2,5 +2,8 @@
  [org.clojure/clojurescript "1.9.293"  ]
  [adzerk/boot-cljs          "1.7.228-2"]
  [adzerk/bootlaces          "0.1.13"   ]
+ [degree9/boot-nodejs       "0.0.0"    ]
+ [degree9/boot-exec         "0.5.0"    ]
  [degree9/boot-semver       "1.3.6"    ]
- [degree9/boot-semgit       "0.2.1"    ]]
+ [degree9/boot-semgit       "0.2.1"    ]
+ [degree9/featherscript     "0.1.0"    ]]


Fix typo in clojure project dependencies. (#11582)

--- contrib/clojure-package/project.clj
+++ contrib/clojure-package/project.clj
@@ -22,7 +22,7 @@

                  ;; Jars from Nexus
                  ;[org.apache.mxnet/mxnet-full_2.11-osx-x86_64-cpu "1.2.1"]
-                 ;[org.apache.mxnet/mxnet-full_2.11-linux-x86_64-gpu "1.2.1"]
+                 ;[org.apache.mxnet/mxnet-full_2.11-linux-x86_64-cpu "1.2.1"]
                  ;[org.apache.mxnet/mxnet-full_2.11-linux-x86_64-gpu "1.2.1"]

                  ;;; CI


lein-release plugin: preparing 0.3.5 release

--- backend/project.clj
+++ backend/project.clj
@@ -1,4 +1,4 @@
-(defproject lambdaui "0.3.5-SNAPSHOT"
+(defproject lambdaui "0.3.5"
   :description "LambdaCD-Plugin that provides a modern UI for your pipeline."
   :url "https://github.com/sroidl/lambda-ui"
   :license {:name "Apache License 2.0"


Allow symlinks to other template folders to work.

--- src/fleet/loader.clj
+++ src/fleet/loader.clj
@@ -29,8 +29,8 @@
 (defn- relative-path
   "File path relative to root. Only if file inside root."
   [^File root ^File file]
-  (let [file-path (.getCanonicalPath file)
-        root-path (.getCanonicalPath root)]
+  (let [file-path (.getAbsolutePath file)
+        root-path (.getAbsolutePath root)]
     (if (= file-path root-path)
       ""
       (path-diff root-path file-path))))


Add clojure.java.io require back to reagentdemo.syntax

Src-of macro requires io namespace. This namespace is only used when
building Reagent webpage so this should not prevent using Reagent as
library with self-host.

--- demo/reagentdemo/syntax.clj
+++ demo/reagentdemo/syntax.clj
@@ -1,5 +1,6 @@
 (ns reagentdemo.syntax
-  (:require [clojure.string :as string]))
+  (:require [clojure.java.io :as io]
+            [clojure.string :as string]))

 ;;; Source splitting


Close db after benchmark.

Close db after benchmark.

--- test/cavm/benchmark/core.clj
+++ test/cavm/benchmark/core.clj
@@ -249,21 +249,24 @@
       (:input options) (print-results (edn/read-string (slurp (:input options))))
       :else (let [xena (h2/create-xenadb dbfile)
                   results (atom [])]
-              (when-let [error (mkdir (io/file "." ".benchmark"))]
-                (binding [*out* *err*]
-                  (println error)
-                  (System/exit 1)))
-              (doseq [{:keys [id desc params body]} (filter test-filter tests)]
-                (let [params (if (:load options)
-                               (edn/read-string
-                                 (slurp (io/file "." ".benchmark" (name id))))
-                               (params))
-                      result (apply body xena params)]
-                  (when (not (:load options))
-                    (spit (io/file "." ".benchmark" (name id)) (pr-str params)))
-                  (swap! results conj {:id id :result result})
-                  (println (report desc result))))
-              (spit (:output options) (pr-str @results))))))
+              (try
+                (when-let [error (mkdir (io/file "." ".benchmark"))]
+                  (binding [*out* *err*]
+                    (println error)
+                    (System/exit 1)))
+                (doseq [{:keys [id desc params body]} (filter test-filter tests)]
+                  (let [params (if (:load options)
+                                 (edn/read-string
+                                   (slurp (io/file "." ".benchmark" (name id))))
+                                 (params))
+                        result (apply body xena params)]
+                    (when (not (:load options))
+                      (spit (io/file "." ".benchmark" (name id)) (pr-str params)))
+                    (swap! results conj {:id id :result result})
+                    (println (report desc result))))
+                (spit (:output options) (pr-str @results))
+                (finally
+                  (cdb/close xena)))))))

 (comment


Remove unnecessary footer

Remove unnecessary footer

--- dev/src/yada/dev/manual.clj
+++ dev/src/yada/dev/manual.clj
@@ -89,6 +89,7 @@
          (..
           (org.asciidoctor.AttributesBuilder/attributes)
           (tableOfContents (case toc true org.asciidoctor.Placement/LEFT false))
+          (noFooter true)
           (imagesDir "img")
           (styleSheetName "juxt.css")
           #_(stylesDir "resources/asciidoctor/stylesheets")


Implement a better reading API

Implement a better reading API

--- src/grimoire/api.clj
+++ src/grimoire/api.clj
@@ -122,3 +122,92 @@
   [c thing name]
   (let [h (thing->handle c :examples thing)]
     (io/file h (str name ".clj"))))
+
+(defn read-docs [config thing]
+  (let [thing  (ensure-thing thing)
+        handle (thing->handle config :docs thing)]
+    (->> handle io/reader json/parse-stream)))
+
+(defn list-groups [config]
+  (let [handle (io/file (-> config :datastore :docs))]
+    (for [d (.listFiles handle)
+          :when (.isDirectory d)]
+      (->T :group nil (.getName d)))))
+
+(defn list-artifacts [config thing]
+  (let [thing  (ensure-thing thing)
+        thing  (thing->group thing)
+        _      (assert thing)
+        handle (thing->handle config :else thing)]
+    (for [d (.listFiles handle)
+          :when (.isDirectory d)]
+      (->T :artifact thing (.getName d)))))
+
+(defn list-versions [config thing]
+  (let [thing    (ensure-thing thing)
+        artifact (thing->artifact thing)
+        _        (assert artifact)
+        handle   (thing->handle config :else artifact)]
+    (for [d     (.listFiles handle)
+          :when (.isDirectory d)]
+      (->T :version artifact (.getName d)))))
+
+(defn list-namespaces [config thing]
+  (let [thing   (ensure-thing thing)
+        _       (assert thing)
+        version (thing->version thing)
+        _       (assert version)
+        handle  (thing->handle config :else version)]
+    (for [d     (.listFiles handle)
+          :when (.isDirectory d)]
+      (->T :namespace version (.getName d)))))
+
+(defn list-defs [config thing]
+  (let [thing     (ensure-thing thing)
+        _         (assert thing)
+        namespace (thing->namespace thing)
+        _         (assert namespace)
+        handle    (thing->handle config :else namespace)]
+    (for [d     (.listFiles handle)
+          :when (.isFile d)]
+      (->T :def namespace (string/replace (.getName d) #".clj" "")))))
+
+(defn- thing->prior-versions
+  "Returns a sequence of things representing itself at earlier or equal versions."
+
+  [config thing]
+  (let [thing    (ensure-thing thing)
+        currentv (thing->version thing) ;; version handle
+        current  (:name currentv)       ;; version string
+        added    (:added (read-docs config thing)) ;; version string
+        versions (list-versions config (:parent currentv))
+        unv-path (thing->relative-path :version thing)]
+    (for [v     versions
+          :when (>= (semver/cmp v added) 0)
+          :when (<= (semver/cmp v current) 0)]
+      (path->thing (str (thing->path v) "/" unv-path)))))
+
+(defn read-examples
+  "Returns a sequence of pairs [version example-text] for all examples on prior
+  or equal versions of the given thing."
+
+  [config thing]
+  (let [thing  (ensure-thing thing)]
+    (for [thing (thing->prior-versions config thing)
+          :let  [v (:name (thing->version thing))
+                 h (thing->handle config :examples thing)]
+          ex    (.listFiles h)
+          :when (.isFile ex)]
+      [v (slurp ex)])))
+
+(defn read-notes
+  "Returns a sequence of pairs [version note-text] for all notes on
+  prior or equal versions of the given thing."
+  [config thing]
+  (let [thing  (ensure-thing thing)]
+    (for [thing (thing->prior-versions config thing)
+          :let  [v (:name (thing->version thing))
+                 h (thing->notes-handle config thing)]
+          :when (.exists h)
+          :when (.isFile h)]
+      [v (slurp h)])))


small todo added

small todo added

--- src/etaoin/api.clj
+++ src/etaoin/api.clj
@@ -2236,7 +2236,7 @@
   -- `:desired-capabilities`: an alias for `:capabilities`.

   See https://www.w3.org/TR/webdriver/#capabilities"
-  [driver & [opt]]
+  [driver & [opt]] ;; move params here
   (wait-running driver)
   (let [type (:type @driver)
         _ (swap! driver drv/set-capabilities (get-in defaults [type :capabilities]))


Remove duplicate function.

Remove duplicate function.


added docs and better common line ops

added docs and better common line ops

--- src/k_means/core.clj
+++ src/k_means/core.clj
@@ -2,7 +2,8 @@
   (:gen-class)
   (:require [taoensso.timbre.profiling :as profiling :refer (p profile)])
   (:require [k-means.cluster :as cluster]
-            [k-means.vector :as vector]))
+            [k-means.vector  :as vector]
+            [clojure.string  :as string]))

 (defn choose-initial-centroids
@@ -44,15 +45,37 @@
           (recur l k c g (dec max-iterations))
         :else g))))

+(def usage
+  (->> ["Concurrent k-means for INB375 at QUT"
+        "Harry Scells 2015"
+        "Usage: k-means [action] [options]"
+        ""
+        "Actions:"
+        "  testseq        Test the sequential algorithm with [k] clusters and [n] points"
+        "  testpar        Test the parallel algorithm with [k] clusters and [n] points"
+        "  seq            Run the sequential algorithm with [k] clusters on [dataset]"
+        "  par            Run the parallel algorithm with [k] clusters on [dataset]"
+        ""
+        "Please refer to the README for more information."]
+       (string/join \newline)))
+
 (defn -main
   "Main function for k-means"
   [& args]
-  (println cluster/n-cpu)
   (cond
+    (not (= 3 (count args))) (println usage)
+    (= (first args) "testseq")
+      (let [c (profile :info :Arithmetic (k-means (vector/make-list-rand (Integer/parseInt (nth args 2))) (Integer/parseInt (second args)) 100)) => "Done"]
+        (spit "k-means.txt" (vec c)))
+    (= (first args) "testpar")
+      (let [c (profile :info :Arithmetic (k-means-p (vector/make-list-rand (Integer/parseInt (nth args 2))) (Integer/parseInt (second args)) 100)) => "Done"]
+        (spit "k-means.txt" (vec c)))
     (= (first args) "seq")
-      (let [c (profile :info :Arithmetic (k-means (vector/make-list-rand 500000) 5 100)) => "Done"]
+      (let [c (profile :info :Arithmetic (k-means (read-string (nth args 2)) (Integer/parseInt (second args)) 100)) => "Done"]
         (spit "k-means.txt" (vec c)))
     (= (first args) "par")
-      (let [c (profile :info :Arithmetic (k-means-p (vector/make-list-rand 500000) 5 100)) => "Done"]
-        (spit "k-means.txt" (vec c))))
+      (let [c (profile :info :Arithmetic (k-means-p (read-string (nth args 2)) (Integer/parseInt (second args)) 100)) => "Done"]
+        (spit "k-means.txt" (vec c)))
+    :else
+      (println usage))
   (shutdown-agents))


Updated the test format-seconds

Updated the test format-seconds

--- test/clj_calendar/format_datetime_test.clj
+++ test/clj_calendar/format_datetime_test.clj
@@ -85,15 +85,15 @@
     "Check the function clj-calendar.format-datetime/format-time-."
     (testing "the function clj-calendar.format-datetime/format-time-."
         (are [x y] (= x y)
-              "2 minutes ago"                (format-time- 2 0 "minute" "second")
-              "2 minutes and one second ago" (format-time- 2 1 "minute" "second")
-              "2 minutes and 2 seconds ago"  (format-time- 2 2 "minute" "second")
-              "2 days ago"                   (format-time- 2 0 "day" "hour")
-              "2 days and one hour ago"      (format-time- 2 1 "day" "hour")
-              "2 days and 2 hours ago"       (format-time- 2 2 "day" "hour")
-              "2 months ago"                 (format-time- 2 0 "month" "year")
-              "2 months and one year ago"    (format-time- 2 1 "month" "year")
-              "2 months and 2 years ago"     (format-time- 2 2 "month" "year"))))
+              "2 minutes ago"                 (format-time- 2 0 "minute" "second")
+              "2 minutes and one second ago"  (format-time- 2 1 "minute" "second")
+              "2 minutes and 2 seconds ago"   (format-time- 2 2 "minute" "second")
+              "2 days ago"                    (format-time- 2 0 "day" "hour")
+              "2 days and one hour ago"       (format-time- 2 1 "day" "hour")
+              "2 days and 2 hours ago"        (format-time- 2 2 "day" "hour")
+              "2 months ago"                  (format-time- 2 0 "month" "year")
+              "2 months and one year ago"     (format-time- 2 1 "month" "year")
+              "2 months and 2 years ago"      (format-time- 2 2 "month" "year"))))

 (deftest test-format-time
     "Check the function clj-calendar.format-datetime/format-time."
@@ -122,12 +122,12 @@
     "Check the function clj-calendar.format-datetime/format-month."
     (testing "the function clj-calendar.format-datetime/format-month."
         (are [x y] (= x y)
-              "2 months ago" (format-month 2 1)
-              "2 months ago" (format-month 2 2)
-              "2 months ago" (format-month 2 100)
-              "4 months ago" (format-month 4 1)
-              "4 months ago" (format-month 4 2)
-              "4 months ago" (format-month 4 100)
+              "2 months ago"   (format-month 2 1)
+              "2 months ago"   (format-month 2 2)
+              "2 months ago"   (format-month 2 100)
+              "4 months ago"   (format-month 4 1)
+              "4 months ago"   (format-month 4 2)
+              "4 months ago"   (format-month 4 100)
               "100 months ago" (format-month 100 1)
               "100 months ago" (format-month 100 2)
               "100 months ago" (format-month 100 100))))
@@ -150,12 +150,12 @@
     "Check the function clj-calendar.format-datetime/format-day."
     (testing "the function clj-calendar.format-datetime/format-day."
         (are [x y] (= x y)
-              "2 days and one hour ago"  (format-day 2 1)
-              "2 days and 2 hours ago"   (format-day 2 2)
-              "2 days and 100 hours ago" (format-day 2 100)
-              "4 days and one hour ago"  (format-day 4 1)
-              "4 days and 2 hours ago"   (format-day 4 2)
-              "4 days and 100 hours ago" (format-day 4 100)
+              "2 days and one hour ago"    (format-day 2 1)
+              "2 days and 2 hours ago"     (format-day 2 2)
+              "2 days and 100 hours ago"   (format-day 2 100)
+              "4 days and one hour ago"    (format-day 4 1)
+              "4 days and 2 hours ago"     (format-day 4 2)
+              "4 days and 100 hours ago"   (format-day 4 100)
               "100 days and one hour ago"  (format-day 100 1)
               "100 days and 2 hours ago"   (format-day 100 2)
               "100 days and 100 hours ago" (format-day 100 100))))
@@ -178,12 +178,12 @@
     "Check the function clj-calendar.format-datetime/format-hours."
     (testing "the function clj-calendar.format-datetime/format-hours."
         (are [x y] (= x y)
-              "2 hours and one minute ago"   (format-hours 2 1)
-              "2 hours and 2 minutes ago"    (format-hours 2 2)
-              "2 hours and 100 minutes ago"  (format-hours 2 100)
-              "4 hours and one minute ago"   (format-hours 4 1)
-              "4 hours and 2 minutes ago"    (format-hours 4 2)
-              "4 hours and 100 minutes ago"  (format-hours 4 100)
+              "2 hours and one minute ago"     (format-hours 2 1)
+              "2 hours and 2 minutes ago"      (format-hours 2 2)
+              "2 hours and 100 minutes ago"    (format-hours 2 100)
+              "4 hours and one minute ago"     (format-hours 4 1)
+              "4 hours and 2 minutes ago"      (format-hours 4 2)
+              "4 hours and 100 minutes ago"    (format-hours 4 100)
               "100 hours and one minute ago"   (format-hours 100 1)
               "100 hours and 2 minutes ago"    (format-hours 100 2)
               "100 hours and 100 minutes ago"  (format-hours 100 100))))
@@ -206,12 +206,12 @@
     "Check the function clj-calendar.format-datetime/format-minutes."
     (testing "the function clj-calendar.format-datetime/format-minutes."
         (are [x y] (= x y)
-              "2 minutes and one second ago"   (format-minutes 2 1)
-              "2 minutes and 2 seconds ago"    (format-minutes 2 2)
-              "2 minutes and 100 seconds ago"  (format-minutes 2 100)
-              "4 minutes and one second ago"   (format-minutes 4 1)
-              "4 minutes and 2 seconds ago"    (format-minutes 4 2)
-              "4 minutes and 100 seconds ago"  (format-minutes 4 100)
+              "2 minutes and one second ago"     (format-minutes 2 1)
+              "2 minutes and 2 seconds ago"      (format-minutes 2 2)
+              "2 minutes and 100 seconds ago"    (format-minutes 2 100)
+              "4 minutes and one second ago"     (format-minutes 4 1)
+              "4 minutes and 2 seconds ago"      (format-minutes 4 2)
+              "4 minutes and 100 seconds ago"    (format-minutes 4 100)
               "100 minutes and one second ago"   (format-minutes 100 1)
               "100 minutes and 2 seconds ago"    (format-minutes 100 2)
               "100 minutes and 100 seconds ago"  (format-minutes 100 100))))
@@ -221,5 +221,7 @@
     (testing "the function clj-calendar.format-datetime/format-seconds."
         (are [x y] (= x y)
               "one second ago"                 (format-seconds 1)
-              "2 seconds ago"                  (format-seconds 2))))
-
+              "2 seconds ago"                  (format-seconds 2)
+              "4 seconds ago"                  (format-seconds 4)
+              "100 seconds ago"                (format-seconds 100))))
+


small fix to test

small fix to test

--- test/com/billpiel/mem_tracer/core_test.clj
+++ test/com/billpiel/mem_tracer/core_test.clj
@@ -517,7 +517,7 @@
           trace (mt/deref-workspace!)]

       (fact "find node by name and all parents"
-        (mt/q a* [:name] #".*func3-4")
+        (mt/q :a [:name] #".*func3-4")
         =>  [{:path [:root10]
               :children
               [{:args [3 8]


Fix NPE on Missing Subject Sex

Fix NPE on Missing Subject Sex

--- src/lens/handler.clj
+++ src/lens/handler.clj
@@ -714,7 +714,7 @@
         (- (t/in-years (t/interval (c/from-date edat) (c/from-date birth-date))))))))

 (defn sex [visit]
-  (-> visit :visit/subject :subject/sex name keyword))
+  (some-> visit :visit/subject :subject/sex name keyword))

 (defn age-decade [age]
   {:pre [age]}
@@ -722,9 +722,14 @@

 (defn visit-count-by-age-decade-and-sex [visits]
   (->> (group-by #(some-> (age-at-visit %) age-decade) visits)
-       (reduce-kv #(if %2 (assoc %1 %2 %3) %1) {})
-       (map-vals #(->> (group-by sex %)
-                       (map-vals count)))))
+       (reduce-kv
+         (fn [r age-decade visits]
+           (if age-decade
+             (assoc r age-decade (->> (r/map sex visits)
+                                      (r/remove nil?)
+                                      (frequencies)))
+             r))
+         {})))

 (defn subject-count [visits]
   (->> (r/map :visit/subject visits)


added wrapper function from quiescent

added wrapper function from quiescent

--- src/kioo/util.cljx
+++ src/kioo/util.cljx
@@ -1,6 +1,30 @@
 (ns kioo.util
   (:refer-clojure :exclude [replace])
   (:require [clojure.string :refer [replace]]))
+
+#+cljs
+(def ^:dynamic *component* nil)
+
+#+cljs
+(def wrap-component
+  "Wrapper component used to mix-in lifecycle methods
+   This was pulled from quiescent"
+  (.createClass js/React
+     #js {:render
+          (fn [] (this-as this (aget (.-props this) "wrappee")))
+          :componentDidUpdate
+          (fn [prev-props prev-state node]
+            (this-as this
+              (when-let [f (aget (.-props this) "onUpdate")]
+                (binding [*component* this]
+                  (f node)))))
+          :componentDidMount
+          (fn [node]
+            (this-as this
+              (when-let [f (aget (.-props this) "onMount")]
+                       (f node))))}))
+
+

 (defn convert-attrs [attrs]
   (let [style  (when (:style attrs)


Первый рабочий вариант/прототип, развернутый на сервере.

--- src/lotsbox/core.clj
+++ src/lotsbox/core.clj
@@ -157,7 +157,7 @@
 (def my-pool (at/mk-pool))

 (defn run-task1 []
-  (at/every (* 5 60 1000)
+  (at/every (* 15 60 1000)
             task-fn-1
             my-pool))

@@ -168,9 +168,167 @@

   (print "STARTING SCHEDULLER -> ")

+  (run-task1)
+
   (print "[ok]")

   )
+
+
+
+;; WEB ---------------------------------------------------------------------------------------------
+
+
+(defn s1 [{qp :params}]
+  (letfn [(select-add [s p w]
+            (if (or (empty? p) (nil? p)) s (w s)))
+
+          (parse-date [p d]
+            (if (or (empty? p) (nil? p)) d
+                (tc/to-sql-date (tf/parse (tf/formatter "yyyy-MM-dd") p))))
+
+          (parse-number [p d]
+            (if (or (empty? p) (nil? p)) nil
+                (bigdec p)))
+
+
+          ]
+
+    (-> (select* lots)
+
+        (select-add (qp :ff-bdate) #(where % (>= :bdate (parse-date (qp :bdate) nil))))
+        (select-add (qp :ff-edate) #(where % (<= :edate (parse-date (qp :edate) nil))))
+
+        (select-add (qp :ff-bsum) #(where % (>= :sum_all (parse-number (qp :bsum) nil))))
+        (select-add (qp :ff-esum) #(where % (<= :sum_all (parse-number (qp :esum) nil))))
+
+        (select-add (qp :limit) #(limit % (parse-number (qp :limit) 100)))
+
+                                        ;(as-sql)
+
+        (exec)
+
+                                        ;(sql-only)
+
+
+        )))
+
+
+(defn query-form [{qp :params}]
+  (form-to [:get "/"]
+
+           [:hgroup
+            ;;[:h3 "Поиск по лотам"]
+            ]
+
+           [:fieldset
+            [:legend "Параметры поиска:"]
+
+
+
+            (label {} "ff-bdate" "по дате:")
+
+            (check-box {} :ff-bdate (qp :ff-bdate))
+            "от "(text-field {:type "date" :pattern "\\d{4}-\\d{2}-\\d{2}"  :placeholder "дата в формате yyyy-MM-dd" } :bdate (qp :bdate))
+
+            (check-box {} :ff-edate (qp :ff-edate))
+            " до " (text-field {:type "date" :pattern "\\d{4}-\\d{2}-\\d{2}" :placeholder "дата в формате yyyy-MM-dd" } :edate (qp :edate))
+
+
+
+            (label {} :ff-from-sum "по сумме:")
+
+            (check-box {} :ff-bsum (qp :ff-bsum))
+            "от "(text-field {:type "number" :pattern "\\d+(\\.\\d{2})?" :placeholder "сумма" } :bsum (qp :bsum))
+
+            (check-box {} :ff-esum (qp :ff-esum))
+            " до " (text-field {:type "number" :pattern "\\d+(\\.\\d{2})?" :placeholder "сумма" } :esum (qp :esum))
+
+
+            (label {} "limit" "Вывести строк:")
+            (text-field {:type "number" :pattern "\\d+" :placeholder "вывести строк" } :limit (qp :limit))
+
+
+            ]
+
+           (submit-button "Послать запрос")
+
+           ))
+
+
+
+(defn result-table [rows]
+  [:table {:class "tg"}
+
+   [:tr
+    [:th {:colspan="1" :class="tg-s6z2"} "№" ]
+    [:th {:colspan="1" :class="tg-s6z2"} "Наименование" ]
+    [:th {:colspan="1" :class="tg-s6z2"} "Описание" ]
+    [:th {:colspan="1" :class="tg-s6z2"} "Сумма" ]
+    [:th {:colspan="1" :class="tg-s6z2"} "Метод закупки" ]
+    [:th {:colspan="1" :class="tg-s6z2"} "Дата нач." ]
+    [:th {:colspan="1" :class="tg-s6z2"} "Дата кон." ]
+    [:th {:colspan="1" :class="tg-s6z2"} "Место поставки" ]
+    [:th {:colspan="1" :class="tg-s6z2"} "Место закупки" ]
+    [:th {:colspan="1" :class="tg-s6z2"} "Организатор" ]
+    [:th {:colspan="1" :class="tg-s6z2"} "Заказчик"]
+    ]
+
+
+   (for [row rows]
+     [:tr
+      [:td (row :keyname)]
+      [:td (row :caption)]
+      [:td (row :description)]
+      [:td (row :sum_all)]
+      [:td (row :method)]
+      [:td (row :bdate)]
+      [:td (row :edate)]
+      [:td (row :place_to)]
+      [:td (row :place_in)]
+      [:td (row :org)]
+      [:td (row :zak_name)]
+
+      ]
+
+     )]
+  )
+
+
+
+(def head
+  [:head
+   [:title "Lots Box"]
+   (include-css "/css/custom.css")
+
+   ])
+
+
+(def page-header
+  [:nav ]
+  )
+
+
+(def page-footer
+  [:footer "Подвал!!!"])
+
+
+(defn main-page [request]
+  (html5 head
+         [:body
+          page-header
+
+          (query-form request)
+
+          ;;request
+
+          ;;(result-table (select lots))
+          (result-table (s1 request))
+
+          page-footer
+          ]
+         ))
+

@@ -179,8 +337,13 @@

 (defroutes app-routes
   ;;(GET "/" [] "Hello World!!!!!!")
-  (GET "/" [] "") ;; В таком варианте появляется скрипт для автообновления страници который включается от :auto-refresh? true
+  ;;(GET "/" [] "") ;; В таком варианте появляется скрипт для автообновления страници который включается от :auto-refresh? true
   ;;(GET "/" [] (main-page))
+
+  ;;(GET "/" [] (str (select lots)))
+
+  (GET "/" request (main-page request))
+

   (route/resources "/")
   (route/not-found "Not Found"))