Fixing the virtual product test.

Fixing the virtual product test.

--- system-int-test/test/cmr/system_int_test/virtual_product_test.clj
+++ system-int-test/test/cmr/system_int_test/virtual_product_test.clj
@@ -350,17 +350,25 @@
         (finally (dev-sys-util/eval-in-dev-sys
                    `(cmr.virtual-product.config/set-virtual-products-enabled! true)))))))

+(defn set-provider-aliases
+  [aliases]
+  (dev-sys-util/eval-in-dev-sys
+    `(cmr.virtual-product.config/set-virtual-product-provider-aliases! ~aliases)))
+
+(defn get-provider-aliases
+  []
+  (dev-sys-util/eval-in-dev-sys
+    `(cmr.virtual-product.config/virtual-product-provider-aliases)))
+
 (defmacro with-provider-aliases
   "Wraps body while using aliases for the provider aliases."
   [aliases body]
-  `(let [orig-aliases# (cmr.virtual-product.config/virtual-product-provider-aliases)]
-    (dev-sys-util/eval-in-dev-sys
-      (cmr.virtual-product.config/set-virtual-product-provider-aliases! ~aliases))
+  `(let [orig-aliases# (get-provider-aliases)]
+    (set-provider-aliases ~aliases)
     (try
       ~body
       (finally
-        (dev-sys-util/eval-in-dev-sys
-          (cmr.virtual-product.config/set-virtual-product-provider-aliases! orig-aliases#))))))
+        (set-provider-aliases orig-aliases#)))))

 (deftest virtual-product-provider-alias-test
   (with-provider-aliases {"LPDAAC_ECS"  #{"LP_ALIAS"}}


Add more logging info whilst connecting

Add more logging info whilst connecting

--- src/overtone/sc/machinery/server/connection.clj
+++ src/overtone/sc/machinery/server/connection.clj
@@ -257,17 +257,20 @@
   []
   (locking connection-info*

-    (log/info "quiting...")
+    (log/info "Shutting down...")
     (sync-event :shutdown)

+    (log/info "Quitting...")
     (try
       (server-snd "/quit")
       (catch Exception e
-        (log/error "Can't quit server gracefully")))
+        (log/error "Can't quit server gracefully with /quit")))

     (when @server-osc-peer*
+      (log/info "Closing OSC peer...")
       (osc-close @server-osc-peer* true))

+    (log/info "Resetting server state and unsatisfying all deps...")
     (dosync
      (ref-set server-osc-peer* nil)
      (ref-set connection-info* {})
@@ -277,6 +280,7 @@
 (defonce _shutdown-hook
      (.addShutdownHook (Runtime/getRuntime)
                        (Thread. (fn []
-                                 (locking connection-info*
-                                   (when (= :connected @connection-status*)
-                                     (shutdown-server)))))))
+                                  (log/info "Shutdown hook activated...")
+                                  (locking connection-info*
+                                    (when (= :connected @connection-status*)
+                                      (shutdown-server)))))))


~(defn plural-en): industry -> industries

--- src/babel/english/morphology.cljc
+++ src/babel/english/morphology.cljc
@@ -771,7 +771,7 @@
          english-verb-phrase)))))

 (defn plural-en [english]
-  (if (re-find #"[t][y]$" english) ;; city => cities
+  (if (re-find #"[rt][y]$" english) ;; city => cities
     (replace english #"[y]$" "ies")
     (if (re-find #"[cs][hsx]$" english) ;; brush => brushes; beach => beaches
       (str english "es")


Added stafett

Added stafett

--- src/skidskytte/namer.clj
+++ src/skidskytte/namer.clj
@@ -152,6 +152,7 @@
                 "skateboard"
                 "skytte"
                 "slalom"
+                "stafett"
                 "styrkelyft"
                 "störtlopp"
                 "snowboard"


3 column var meta

3 column var meta

--- src/clj/clojuredocs/site/vars.clj
+++ src/clj/clojuredocs/site/vars.clj
@@ -42,9 +42,9 @@
        (when (> (count users) 10)
          [:div.contributors
           (count users) " contributors total."])
-       [:div.created
+       #_[:div.created
         "Created " (util/timeago created-at) " ago."]
-       (when-not (= created-at updated-at)
+       #_(when-not (= created-at updated-at)
          [:div.last-updated
           "Updated " (util/timeago updated-at) " ago."])
        [:div.links
@@ -57,20 +57,30 @@
 (defn source-url [{:keys [file line]}]
   (str "https://github.com/clojure/clojure/blob/clojure-1.5.1/src/clj/" file "#L" line))

-(defn $see-also [{:keys [ns name created-at doc] :as sa}]
-  [:div.see-also
+(defn $see-also [{:keys [ns name created-at doc user] :as sa}]
+  [:div.col-sm-6.see-also
    [:div
-    ns "/" name]
-   [:div
+    (util/$var-link ns name
+      [:span.ns ns "/"]
+      [:span.name name])]
+   [:p
     (->> doc
-         (take 50)
-         (apply str))]])
+         (take 100)
+         (apply str))
+    (when (> (count doc) 100)
+      "...")]
+   [:div.meta
+    "Added by " [:a {:href (str "/u/" (:login user))} (:login user)]]])
+
+(defn lookup-var [ns name]
+  (or (mon/fetch-one :vars :where {:name name :ns ns})
+      (search/lookup (str ns "/" name))))

 (defn var-page [ns name]
   (fn [{:keys [user]}]
     (let [name (util/unmunge-name name)
           {:keys [arglists name ns doc runtimes added file] :as v}
-          (mon/fetch-one :vars :where {:name name :ns ns})
+          (lookup-var ns name)
           examples (examples-for v)
           see-alsos (see-alsos-for v)]
       (common/$main
@@ -79,7 +89,7 @@
          :content [:div
                    [:div.row
                     [:div.col-sm-4
-                     [:section
+                     [:section.var-data
                       [:h1 name]
                       [:h2 ns]]]
                     [:div.col-sm-4
@@ -97,18 +107,34 @@
                          [:a {:href (source-url v)} "Source"]])]]]
                    [:div.row
                     [:div.col-sm-12
-                     [:div.docstring
-                      [:pre (-> doc
-                                (str/replace #"\n\s\s" "\n"))]
-                      [:div.copyright
-                       "© Rich Hickey. All rights reserved."
-                       " "
-                       [:a {:href "http://www.eclipse.org/legal/epl-v10.html"}
-                        "Eclipse Public License 1.0"]]]
-                     [:h3 (count examples) " Examples"]
-                     (map $example examples)
-                     [:h3 "See Alsos"]
-                     (map $see-also see-alsos)]]]}))))
+                     [:section
+                      [:div.docstring
+                       (when doc
+                         [:pre (-> doc
+                                   (str/replace #"\n\s\s" "\n"))])
+                       [:div.copyright
+                        "© Rich Hickey. All rights reserved."
+                        " "
+                        [:a {:href "http://www.eclipse.org/legal/epl-v10.html"}
+                         "Eclipse Public License 1.0"]]]]
+                     [:section
+                      [:h3 (util/pluralize (count examples) "Example" "Examples")]
+                      (if (empty? examples)
+                        [:div.null-state
+                         "No examples for " name ", "
+                         [:a {:href "#"} "add one"]
+                         "?"]
+                        (map $example examples))]
+                     [:section
+                      [:h3 "See Also"]
+                      (if (empty? see-alsos)
+                        [:div.null-state
+                         "No see-alsos for " [:code name] ", "
+                         [:a
+                          {:href "#"} "add one"]
+                         "?"]
+                        [:div.row
+                         (map $see-also see-alsos)])]]]]}))))

 (defn $example-history-point [{:keys [user body created-at updated-at] :as ex}]
   [:div.row


fix so direct-nav metadata on vars gets translated appropriately when that var is called as a function

--- src/clj/com/rpl/specter/impl.cljc
+++ src/clj/com/rpl/specter/impl.cljc
@@ -618,8 +618,11 @@
                          (:sym o)
                          (or (-> o :var direct-nav?)
                              (-> o :sym direct-nav?))))
-
-          (:val o))
+          (maybe-direct-nav
+            (:val o)
+            (or (-> o :var direct-nav?)
+                (-> o :sym direct-nav?)
+                (-> o :val direct-nav?))))

         (instance? LocalSym o)
         (->DynamicVal (:sym o))


remove unnecessary screen scrap

remove unnecessary screen scrap

--- src/clj/ikea_clojure_cup/pack.clj
+++ src/clj/ikea_clojure_cup/pack.clj
@@ -59,7 +59,6 @@
       (cs/replace #"scene.fog.color, 1" "0x000000, 0")
       (cs/replace #"antialias: false" "antialias: false, alpha: true")
       (cs/replace #"legend.style.color = \"#ffffff\"" "legend.style.color =\"#000\"")
-      (cs/replace #"contents legend" "Flat packs legend:")
       (cs/replace #"createLegend\(container\);" "")))

 (defn preview [bins items]


provisional listlpv.clj

provisional listlpv.clj

--- src/clj/webapp/routes/listlpv.clj
+++ src/clj/webapp/routes/listlpv.clj
@@ -56,7 +56,7 @@
               [:td [:input#submit
                     {:value "Make Language-Property-Value Lists", :name "submit", :type "submit"}]]]]))))

-(defn csv2table
+(defn csv2table-1
 "Takes sorted 3-col csv list and outputs html table with empty [:td]  for repeated col1 and vec of col3 vals for repeated col2. [IN PROGRESS!]"
  [lpvs]
 (let [curcat1 (atom "")
@@ -67,21 +67,124 @@
  (let [catmap (zipmap [:cat1 :cat2 :cat3] (split lpv #","))
        ;;nextmap (zipmap [:cat1 :cat2 :cat3] (split (first (rest lpvs)) #","))
        ]
-   (if (= (:cat1 catmap) curcat1)
+   (if (= (:cat1 catmap) @curcat1)

-     (if (= (:cat2 catmap) curcat2)
+     (if (= (:cat2 catmap) @curcat2)
        (swap! curcat3 conj (str (:cat3 catmap)))
-       ([:tr [:td] [:td curcat2] [:td curcat3]]
+       (do [:tr [:td] [:td curcat2] [:td curcat3]]
           (reset! curcat2 (str (:cat2 catmap)))))

      ((if (clojure.string/blank? @curcat1)
-        ((reset! curcat1 (str (:cat1 catmap)))
+        (do (reset! curcat1 (str (:cat1 catmap)))
          (reset! curcat2 (str (:cat2 catmap)))
          (swap! curcat3 conj (str (:cat3 catmap))))
-        ([:tr [:td curcat1] [:td curcat2] [:td curcat3]]
+        (do [:tr [:td @curcat1] [:td @curcat2] [:td @curcat3]]
            (reset! curcat1 (str (:cat1 catmap)))
            (reset! curcat2 (str (:cat2 catmap)))
            (reset! curcat3 (str (:cat3 catmap)))))))))]))
+
+(defn csv2table-2
+"Takes sorted 3-col csv list and outputs html table with empty [:td]  for repeated col1 and vec of col3 vals for repeated col2. [IN PROGRESS!]"
+ [lpvs]
+(let  [curcat1 (atom "")
+      curcat2 (atom "")
+      curcat3 (atom [])
+       ]
+ [:table
+(for [lpv lpvs]
+ (let [catmap (zipmap [:cat1 :cat2 :cat3] (split lpv #","))
+       ;;nextmap (zipmap [:cat1 :cat2 :cat3] (split (first (rest lpvs)) #","))
+       ]
+   (if (= (:cat1 catmap) @curcat1)
+     [:tr [:td] [:td (:cat2 catmap)][:td (:cat3 catmap)]]
+     (do (reset! curcat1 (:cat1 catmap))
+         [:tr [:td @curcat1][:td (:cat2 catmap)][:td (:cat3 catmap)]]
+          ))))]))
+
+(defn csv2table
+"Takes sorted 3-col csv list and outputs html table with empty [:td]  for repeated col1 and vec of col3 vals for repeated col2. [IN PROGRESS!]"
+ [lpvs]
+(let  [curcat1 (atom "")
+      curcat2 (atom "")
+      curcat3 (atom [])
+       ]
+ [:table
+(for [lpv lpvs]
+ (let [catmap (zipmap [:cat1 :cat2 :cat3] (split lpv #","))
+       ;;nextmap (zipmap [:cat1 :cat2 :cat3] (split (first (rest lpvs)) #","))
+       ]
+   (if (= (:cat1 catmap) @curcat1)
+
+     (if (= (:cat2 catmap) @curcat2)
+       [:tr [:td] [:td][:td (:cat3 catmap)]]
+       (do (reset! curcat2 (:cat2 catmap))
+           [:tr [:td] [:td @curcat2][:td (:cat3 catmap)]]))
+
+     (do (reset! curcat1 (:cat1 catmap))
+         (reset! curcat2 (:cat2 catmap))
+         [:tr [:td @curcat1][:td @curcat2][:td (:cat3 catmap)]]
+         ))))]))
+
+(defn csv2table-3
+"Takes sorted 3-col csv list and outputs html table with empty [:td]  for repeated col1 and vec of col3 vals for repeated col2. [IN PROGRESS!]"
+ [lpvs]
+(let  [curcat1 (atom "")
+      curcat2 (atom "")
+      curcat3 (atom "")
+       ]
+ [:table
+(for [lpv lpvs]
+ (let [catmap (zipmap [:cat1 :cat2 :cat3] (split lpv #","))
+       ;;nextmap (zipmap [:cat1 :cat2 :cat3] (split (first (rest lpvs)) #","))
+       ]
+   (if (= (:cat1 catmap) @curcat1)
+
+     (if (= (:cat2 catmap) @curcat2)
+       ;;(reset! curcat3 (str @curcat3 " " (:cat3 catmap)))
+       [:td (:cat3 catmap)]
+       (do [:tr [:td] [:td @curcat2][:td @curcat3]]
+          (reset! curcat2 (:cat2 catmap))
+          (reset! curcat3 (:cat3 catmap))
+           ))
+
+     (do (reset! curcat1 (:cat1 catmap))
+         (reset! curcat2 (:cat2 catmap))
+         [:tr [:td @curcat1][:td @curcat2][:td (:cat3 catmap)]]
+         ))))]))
+
+(defn csv2table-4
+"Takes sorted 3-col csv list and outputs html table with empty [:td]  for repeated col1 and vec of col3 vals for repeated col2. [IN PROGRESS!]"
+[lpvs]
+(let  [curcat1 (atom "")
+      curcat2 (atom "")
+      curcat3 (atom [])
+       ]
+ [:table
+(for [lpv lpvs]
+ (let [catmap (zipmap [:cat1 :cat2 :cat3] (split lpv #","))
+       ]
+   (if (= (:cat1 catmap) @curcat1)
+
+     (if (= (:cat2 catmap) @curcat2)
+       (swap! curcat3 conj (:cat3 catmap))
+       (do [:tr [:td] [:td @curcat2][:td @curcat3]]
+           (reset! curcat2 (:cat2 catmap))
+           (reset! curcat3 [])
+           (swap! curcat3 conj (:cat3 catmap))))
+
+    (if (= @curcat1 "")
+     (do (reset! curcat1 (:cat1 catmap))
+         (reset! curcat2 (:cat2 catmap))
+         (swap! curcat3 conj (:cat3 catmap)))
+     (do [:tr [:td @curcat1][:td @curcat2][:td @curcat3]]
+         (reset! curcat1 (:cat1 catmap))
+         (reset! curcat2 (:cat2 catmap))
+         (swap! curcat3 conj (:cat3 catmap)))
+     ))))]))
+
+
+;; try (while) --
+;; cf. "(while (pos? @a) (do (println @a) (swap! a dec)))"

 (defn handle-listlpv-gen
   [ldomain colorder]
@@ -116,7 +219,7 @@
            [:p header]
            [:hr]
            ;;[:pre reqvec]
-           [:pre lpvtable]
+           lpvtable
           [:hr]
           [:h3#clickable "Query:"]
           [:pre query-sparql-pr]])


Add method for getting ip from client

Add method for getting ip from client

--- src/clj/whatishistory/handler.clj
+++ src/clj/whatishistory/handler.clj
@@ -26,6 +26,8 @@
      (include-css (if (env :dev) "css/site.css" "css/site.min.css"))]
     [:body
      mount-target
+     [:script {:type "text/javascript"} "var userip; function getIP() { return myip }"]
+     (include-js "//l2.io/ip.js?var=myip")
      (include-js "//www.parsecdn.com/js/parse-1.6.7.min.js")
      (include-js "js/parse.js")
      (include-js "js/app.js")]]))


Sign out user when API call returns 401 error

--- src/cljs/elevent_client/core.cljs
+++ src/cljs/elevent_client/core.cljs
@@ -73,6 +73,8 @@
 ;; REST
 ;; =============================================================================

+(declare sign-out!)
+
 (defn endpoint [uri element-id state]
   (fn dispatch!
     ([operation params handler error-handler]
@@ -109,9 +111,11 @@
                     (fn [error]
                       (if error-handler
                         (error-handler error)
-                        (if (= (:failure error) :timeout)
-                          (add-message! :negative (str uri " timed out"))
-                          (add-message! :negative (str uri (js->clj error))))))}]
+                        (if (= (:status error) 401)
+                          (sign-out!)
+                          (if (= (:failure error) :timeout)
+                            (add-message! :negative (str uri " timed out"))
+                            (add-message! :negative (str uri (js->clj error)))))))}]
        (let [check-id (fn [op] (if (contains? params element-id)
                                  (op (str uri "/" (params element-id)) options)
                                  (throw (str "Element doesn't contain key \""


Websocket connection on client side tested

--- src/cljs/hellhound/websocket.cljs
+++ src/cljs/hellhound/websocket.cljs
@@ -66,10 +66,13 @@

 (defn connect!
   "Connect to remote websocket server"
-  [url {:keys [packer]
-        :as options
-        :or {packer  (create-json-packer)}}]
+  ([url]
+   (connect! url {}))

-  (if-let [conn (js/WebSocket url)]
-    (set-channels! conn packer)
-    (handle-connection-error)))
+  ([url {:keys [packer]
+         :as options
+         :or {packer  (create-json-packer)}}]
+
+   (if-let [conn (js/WebSocket. url)]
+     (set-channels! conn packer)
+     (handle-connection-error))))


fixed the structure of the code blocks

fixed the structure of the code blocks

--- src/cljs/post_to_screen/core.cljs
+++ src/cljs/post_to_screen/core.cljs
@@ -58,13 +58,13 @@
             (reverse posts))]]
      (when (seq posts)
        [:div.col-md-10
-        [:pre#codeview
-         [:code (get-in posts [selected-post :code])]]])]))
+        [:pre.language-java
+         [:code#codeview (get-in posts [selected-post :code])]]])]))

 (defn colorize-code []
   (let [codeview (-> js/document
                      (.getElementById "codeview"))]
-    (.highlightBlock js/hljs codeview)))
+    (.highlightElement js/hljs codeview)))

 (def code-view
   (with-meta code-view


Fix code-lagging docstring.

Fix code-lagging docstring.

--- src/clojure/parkour/io/sample.clj
+++ src/clojure/parkour/io/sample.clj
@@ -14,7 +14,7 @@
 (defn dseq
   "Distributed sequence which samples from distributed sequence `step`, as
 optionally configured by the map `options`.  Available options are:
-  `:size` -- Sample split size (default 65536);
+  `:size` -- Sample split size (default 131072);
   `:splits` -- Number of splits to sample (default 5);
   `:seed` -- Seed for random sampling process (default 1)."
   ([step] (dseq {} step))


Use semicolons instead of commas in paths


喰赤じゃない局をテスト対象から外した

喰赤じゃない局をテスト対象から外した


(TK-202) Remove unused with-test-logging-debug refer

A previous iteration of test used with-test-logging-debug, but that is
no longer the case so this commit removes the refer.

--- test/puppetlabs/trapperkeeper/services_test.clj
+++ test/puppetlabs/trapperkeeper/services_test.clj
@@ -10,7 +10,7 @@
             [puppetlabs.kitchensink.testutils.fixtures :refer [with-no-jvm-shutdown-hooks]]
             [beckon]
             [puppetlabs.trapperkeeper.internal :as internal]
-            [puppetlabs.trapperkeeper.testutils.logging :refer [with-test-logging with-test-logging-debug]]
+            [puppetlabs.trapperkeeper.testutils.logging :refer [with-test-logging]]
             [puppetlabs.trapperkeeper.core :as tk]
             [puppetlabs.kitchensink.testutils :as ks-testutils])
   (:import (java.util.concurrent ExecutionException)))


No need to use eval to calculate var

No need to use eval to calculate var

--- planck-cljs/src-bundle/cljs/test.clj
+++ planck-cljs/src-bundle/cljs/test.clj
@@ -11,8 +11,7 @@
   (:require [cljs.env :as env]
             [cljs.analyzer :as ana]
             [planck.test.ana-api :as ana-api]
-            [planck.test.template]
-            [planck.core]))
+            [planck.test.template]))

 ;; =============================================================================
 ;; Assertion Macros
@@ -86,7 +85,7 @@
       `(do
          (def ~(vary-meta name assoc :test `(fn [] ~@body))
            (fn [] (cljs.test/test-var (@cljs.test$macros/vars ~id))))
-         (swap! vars assoc ~id (planck.core/eval ~(list 'var name)))
+         (swap! vars assoc ~id (~'var ~name))
          nil))))

 (defmacro async
@@ -194,7 +193,7 @@
                (filter (fn [[_ v]] (:test v)))
                (sort-by (fn [[_ v]] (:line v)))
                (map (fn [[k _]]
-                      `(planck.core/eval ~(list 'var (symbol (name ns) (name k)))))))])
+                      `(~'var ~(symbol (name ns) (name k))))))])
         [(fn []
            (when (nil? env#)
              (cljs.test/clear-env!)))]))))


Change re-lorean toggle button from F8 to F9...

... because the F8 button starts the JS debugger when the Chrome
Developer Tools pane is open, which was quite annoying.


Emit entries in the obi file for markdown headers


More refactoring

More refactoring


Fixed the direction vector.

Fixed the direction vector.


Fix lint warning

Fix lint warning

--- test/com/climate/claypoole_test.clj
+++ test/com/climate/claypoole_test.clj
@@ -439,7 +439,7 @@
       (Thread/sleep 50)
       (cp/shutdown pool)
       (deliver start true)
-      (is (thrown? Exception (doall @results))))))
+      (is (thrown? Exception (dorun @results))))))

 (defn check-fn-exception
   "Check that a pmap function correctly passes exceptions caused by the


Add feedback-exception! call to test

Add feedback-exception! call to test

--- src/leiningen/new/onyx_app/test/onyx_app/jobs/basic_test.clj
+++ src/leiningen/new/onyx_app/test/onyx_app/jobs/basic_test.clj
@@ -22,8 +22,9 @@
           {:keys [in out]} (get-core-async-channels job)]
       (with-test-env [test-env [3 env-config peer-config]]
         (onyx.test-helper/validate-enough-peers! test-env job)
-        (onyx.api/submit-job peer-config job)
-        (doseq [segment segments]
-          (>!! in segment))
+        (let [job-id (:job-id (onyx.api/submit-job peer-config job))]
+          (doseq [segment segments]
+            (>!! in segment))
+          (onyx.test-helper/feedback-exception! peer-config job-id))
         (is (= (set (take-segments! out))
                (set [{:n 2} {:n 3} {:n 4} {:n 5} {:n 6} :done])))))))


Tests for functions that have been moved into utils module

--- test/emender_jenkins/utils_test.clj
+++ test/emender_jenkins/utils_test.clj
@@ -67,6 +67,26 @@
     "Check that the emender-jenkins.utils/get-exception-message definition exists."
     (testing "if the emender-jenkins.utils/get-exception-message definition exists."
         (is (callable? 'emender-jenkins.utils/get-exception-message))))
+
+
+(deftest test-parse-int-existence
+    "Check that the emender-jenkins.utils/parse-int definition exists."
+    (testing "if the emender-jenkins.utils/parse-int definition exists."
+        (is (callable? 'emender-jenkins.utils/parse-int))))
+
+
+(deftest test-parse-float-existence
+    "Check that the emender-jenkins.utils/parse-float definition exists."
+    (testing "if the emender-jenkins.utils/parse-float definition exists."
+        (is (callable? 'emender-jenkins.utils/parse-float))))
+
+
+(deftest test-parse-boolean-existence
+    "Check that the emender-jenkins.utils/parse-boolean definition exists."
+    (testing "if the emender-jenkins.utils/parse-boolean definition exists."
+        (is (callable? 'emender-jenkins.utils/parse-boolean))))
+
+

 ;
 ; Tests for behaviour of all functions
@@ -302,3 +322,115 @@
         (is (thrown? NullPointerException (replaceAll "a" "a" nil)))
         (is (thrown? NullPointerException (replaceAll nil nil "b")))))

+(deftest test-parse-boolean
+    "Check the behaviour of function emender-jenkins.config/parse-boolean."
+    (are [x y] (= x y)
+        true (parse-boolean "true")
+        true (parse-boolean "True")
+        false (parse-boolean "false")
+        false (parse-boolean "False")
+        false (parse-boolean "")
+        false (parse-boolean "unknown")
+        false (parse-boolean nil)))
+
+(deftest test-parse-int-zero
+    "Check the behaviour of function emender-jenkins.config/parse-int."
+    (are [x y] (== x y)
+        0 (parse-int "0")
+        0 (parse-int "00")
+        0 (parse-int "000")
+        0 (parse-int "-0")
+        0 (parse-int "-00")
+        0 (parse-int "-000")))
+
+(deftest test-parse-int-positive-int
+    "Check the behaviour of function emender-jenkins.config/parse-int."
+    (are [x y] (== x y)
+        1          (parse-int "1")
+        2          (parse-int "2")
+        42         (parse-int "42")
+        65535      (parse-int "65535")
+        65536      (parse-int "65536")
+        2147483646 (parse-int "2147483646")))
+
+(deftest test-parse-int-negative-int
+    "Check the behaviour of function emender-jenkins.config/parse-int."
+    (are [x y] (== x y)
+        -1          (parse-int "-1")
+        -2          (parse-int "-2")
+        -42         (parse-int "-42")
+        -65535      (parse-int "-65535")
+        -65536      (parse-int "-65536")
+        -2147483647 (parse-int "-2147483647")))
+
+(deftest test-parse-int-min-int
+    "Check the behaviour of function emender-jenkins.config/parse-int."
+    (is (== Integer/MIN_VALUE (parse-int "-2147483648"))))
+
+(deftest test-parse-int-max-int
+    "Check the behaviour of function emender-jenkins.config/parse-int."
+    (is (== Integer/MAX_VALUE (parse-int "2147483647"))))
+
+(deftest test-parse-int-overflow
+    "Check the behaviour of function emender-jenkins.config/parse-int."
+    (are [x] (thrown? NumberFormatException x)
+        (parse-int "2147483648")
+        (parse-int "-2147483649")))
+
+(deftest test-parse-int-bad-input
+    "Check the behaviour of function emender-jenkins.config/parse-int."
+    (are [x] (thrown? NumberFormatException x)
+        (parse-int "")
+        (parse-int " ")
+        (parse-int "xyzzy")))
+       ; (parse-int "+1"))) ; removed, not compatible with all supported JDKs
+
+(deftest test-parse-float-zero
+    "Check the behaviour of function emender-jenkins.config/parse-float."
+    (are [x y] (== x y)
+        0.0 (parse-float "0")
+        0.0 (parse-float "00")
+        0.0 (parse-float "000")
+        0.0 (parse-float "-0")
+        0.0 (parse-float "-00")
+        0.0 (parse-float "-000")))
+
+(deftest test-parse-float-positive-values
+    "Check the behaviour of function emender-jenkins.config/parse-float."
+    (are [x y] (== x y)
+        0.5 (parse-float "0.5")
+        1.0 (parse-float "1.0")
+        1.5 (parse-float "1.5")
+        2.0 (parse-float "2")
+        1000.0 (parse-float "1000")
+        10000.0 (parse-float "10000")
+        1e10 (parse-float "10000000000")
+        1e10 (parse-float "1e10")))
+
+(deftest test-parse-float-negative-values
+    "Check the behaviour of function emender-jenkins.config/parse-float."
+    (are [x y] (== x y)
+        -0.5 (parse-float "-0.5")
+        -1.0 (parse-float "-1.0")
+        -1.5 (parse-float "-1.5")
+        -2.0 (parse-float "-2")
+        -1000.0 (parse-float "-1000")
+        -10000.0 (parse-float "-10000")
+        -1e10 (parse-float "-10000000000")
+        -1e10 (parse-float "-1e10")))
+
+(deftest test-parse-float-min-value
+    "Check the behaviour of function emender-jenkins.config/parse-int."
+    (is (== Float/MIN_VALUE (parse-float "0x0.000002P-126f"))))
+
+(deftest test-parse-float-max-value
+    "Check the behaviour of function emender-jenkins.config/parse-int."
+    (is (== Float/MAX_VALUE (parse-float "0x1.fffffeP+127f"))))
+
+(deftest test-parse-float-bad-input
+    "Check the behaviour of function emender-jenkins.config/parse-float."
+    (are [x] (thrown? NumberFormatException x)
+        (parse-float "")
+        (parse-float "xyzzy")
+        (parse-float "-1xyzzy")))
+


Added select and delete.  Convert old test functions to new.  Fixed bug in split-path to allow no leading slash.


Oh fine, tests for functions too

Oh fine, tests for functions too

--- test/irresponsible/oolong_test.cljc
+++ test/irresponsible/oolong_test.cljc
@@ -40,8 +40,8 @@
                         (.getMessage e)))))))

 (deftest qualisym?
-  (is (= [true false false false false false false]
-         (mapv u/qualisym? ['foo/bar 'foo 123 "456" [] {} :foo/bar]))))
+  (is (true? (u/qualisym? 'foo/bar)))
+  (is (every? false? (map u/qualisym? ['foo 123 "456" [] {} :foo/bar]))))

 (deftest load-symbol
   (is (= ::caught
@@ -63,29 +63,40 @@
    (is (= 4 (u/run-symbol `twice 2))))
   (deftest system-map
     (is (= {} (u/system-map {} {})))
-    (is (= {:a 4} (u/system-map {:a `twice} {:a 2}))))
+    (is (= {:a 4} (u/system-map {:a `twice} {:a 2})))
+    (is (= {:a 4} (u/system-map {:a twice} {:a 2}))))
   (deftest simple-system
     (is (= :true (u/simple-system `identity :true)))
+    (is (= :true (u/simple-system identity :true)))
     (is (= (u/simple-system {:a `twice} {:a 2}) {:a 4}))
+    (is (= (u/simple-system {:a twice} {:a 2}) {:a 4}))
     (is (= ::caught
            (try (u/simple-system () :true)
              (catch #?(:clj ExceptionInfo :cljs js/Object) e
                ::caught)))))
   (deftest any-list
     (is (= 123     (u/any-list (list 'sys `identity) 123)))
+    (is (= 123     (u/any-list (list 'sys identity) 123)))
     (is (= {:a :b} (u/any-list (list 'sys `identity :bar) {:a :b})))
+    (is (= {:a :b} (u/any-list (list 'sys identity :bar) {:a :b})))
     (is (= {:a :b} (u/any-list (list 'sys {:a `identity}) {:a :b})))
+    (is (= {:a :b} (u/any-list (list 'sys {:a identity}) {:a :b})))
     (is (= 123     (u/any-list (list 'cpt `identity) 123)))
+    (is (= 123     (u/any-list (list 'cpt identity) 123)))
     ;; we can't use a number because that can't hold metadata, a map can though.
     (is (= {:a :b} (u/any-list (list 'cpt `identity :bar) {:a :b})))
+    (is (= {:a :b} (u/any-list (list 'cpt identity :bar) {:a :b})))
     (is (= ::caught
            (try (u/any-list '(sys ()) 1)
              (catch #?(:clj ExceptionInfo :cljs js/Object) e
                ::caught)))))
   (deftest system
     (is (= ::true (u/system `identity ::true)))
+    (is (= ::true (u/system identity ::true)))
     (is (= {:a 4} (u/system {:a `twice} {:a 2})))
-    (is (= ::true (u/system (list 'sys `identity) ::true))))
+    (is (= {:a 4} (u/system {:a twice} {:a 2})))
+    (is (= ::true (u/system (list 'sys `identity) ::true)))
+    (is (= ::true (u/system (list 'sys identity) ::true))))
   (let [config {:app {:a '(cpt irresponsible.oolong.test.a/cpt)
                       :b '(cpt irresponsible.oolong.test.b/cpt :a)}
                 :a {:a1 :foo} :b {}}


lint fix

lint fix


CMR-2815 potential build failed fix

CMR-2815 potential build failed fix

--- access-control-app/src/cmr/access_control/services/acl_service.clj
+++ access-control-app/src/cmr/access_control/services/acl_service.clj
@@ -53,7 +53,7 @@
   ([context acl action]
    (acl-log-message context acl nil action))
   ([context new-acl existing-acl action]
-   (let [user (tokens/get-user-id context (:token context))]
+   (let [user (if (:token context) (tokens/get-user-id context (:token context)) "guest")]
      (case action
            :create (format "User: [%s] Created ACL [%s]" user (pr-str new-acl))
            :update (format "User: [%s] Updated ACL,\n before: [%s]\n after: [%s]"


Add new required keys to Investigation schema, update action mappings

--- src/ctia/entity/investigation.clj
+++ src/ctia/entity/investigation.clj
@@ -17,6 +17,7 @@
             [ctia.stores.es
              [mapping :as em]
              [store :refer [def-es-store]]]
+            [ctim.schemas.common :refer [IdentitySpecification]]
             [ctim.schemas.investigation :as inv]
             [flanders
              [schema :as f-schema]
@@ -29,7 +30,12 @@
 (s/defschema Investigation
   (st/merge (f-schema/->schema inv/Investigation)
             CTIAEntity
-            {s/Keyword s/Any}))
+            {(s/required-key :actions) (s/either s/Str {s/Keyword s/Any})
+             (s/required-key :object_ids) [s/Str]
+             ;; "type:value"
+             (s/required-key :investigated_observables [s/Str])
+             (s/required-key :targets [(f-schema/->schema IdentitySpecification)])
+             s/Keyword s/Any}))

 (f-spec/->spec inv/Investigation "investigation")

@@ -64,7 +70,10 @@
                 :include_in_all false}
    :targets {:type "nested"
              :include_in_all false}
-   :investigated_observables {:type "nested"
+   :investigated_observables {:type "text"
+                              :analyzer "text_analyzer"
+                              :search_quote_analyzer "text_analyzer"
+                              :search_analyzer "search_analyzer"
                               :include_in_all false}})

 (def investigation-mapping


Namespace return as match/return

Namespace return as match/return

--- src/aurora/interpreter.cljs
+++ src/aurora/interpreter.cljs
@@ -26,16 +26,11 @@

 (defn run-node [id->node node inputs output stack]
   (case (:type node)
-    :return (run-return id->node node inputs output stack)
     :data (run-data id->node node inputs output stack)
     :ref (run-ref id->node node inputs output stack)
     :match (run-match id->node node inputs output stack)
     :replace (run-replace id->node node inputs output stack)
     :output (run-output id->node node inputs output stack)))
-
-(defn run-return [id->node node inputs output stack]
-  (assert (= 1 (count inputs)))
-  (first inputs))

 (defn run-data [id->node node inputs output stack]
   (assert (empty? inputs))
@@ -69,7 +64,10 @@
         (try
           (let [vars #js {}]
             (run-match-pattern id->node pattern (:path input) (:value input) output stack vars)
-            (run-node id->node node (map #(aget vars %) inputs) output stack))
+            (case (:type node)
+              :match/return (do (assert (= 1 (count inputs)))
+                              (aget vars (first inputs)))
+              (run-node id->node node (map #(aget vars %) inputs) output stack)))
           (catch MatchFailure _
             (recur branches)))
         (throw (MatchFailure.))))))
@@ -104,9 +102,6 @@

 ;; ast

-(def return
-  {:type :return})
-
 (defn pipe [id inputs & nodes]
   {:type :pipe
    :id id
@@ -147,6 +142,9 @@

 (def any
   {:type :match/any})
+
+(def return
+  {:type :match/return})

 (def replace
   {:type :replace})


Refactor, clean up

Refactor, clean up

--- src/buildviz/testsuites.clj
+++ src/buildviz/testsuites.clj
@@ -24,32 +24,25 @@
     (assoc (average-runtime testcases)
            :failed-count failed-count)))

-(defn- aggregate-runs [unrolled-testcases]
-  (->> unrolled-testcases
+(defn- aggregated-info-by-testcase [test-runs]
+  (->> (transform/test-runs->testcase-list test-runs)
        (group-by transform/testcase->id)
        (map (transform/testcase-with-data
-             (fn [testcase-group] (aggregate-testcase-runs testcase-group))))
-       (into {})))
-
-(defn- aggregated-info-by-testcase [test-runs]
-  (aggregate-runs (transform/test-runs->testcase-list test-runs)))
+             (fn [testcase-group] (aggregate-testcase-runs testcase-group))))))

 (defn aggregate-testcase-info [test-runs]
-  (->> (aggregated-info-by-testcase test-runs)
-       transform/testcase-list->testsuite-tree))
+  (transform/testcase-list->testsuite-tree (aggregated-info-by-testcase test-runs)))

 (defn aggregate-testcase-info-as-list [test-runs]
-  (->> (aggregated-info-by-testcase test-runs)
-       (map transform/testcase->map)))
+  (map transform/testcase->map (aggregated-info-by-testcase test-runs)))

 (defn- average-runs [unrolled-testcases]
   (->> unrolled-testcases
        (group-by transform/testcase->id)
        (map (transform/testcase-with-data
-             (fn [testcase-group] (average-runtime testcase-group))))
-       (into {})))
+             (fn [testcase-group] (average-runtime testcase-group))))))

 (defn- accumulated-runtime [testcases]
   (let [runtimes (map :runtime testcases)]
@@ -99,8 +92,8 @@
              (fn [testcase] {:build build
                              :ok? (junit-xml/is-ok? testcase)})))))

-(defn- flaky-testcases-for-builds [builds test-results-func]
-  (->> builds
+(defn- flaky-testcases-for-builds [builds-with-same-input test-results-func]
+  (->> builds-with-same-input
        (mapcat (fn [build]
                  (unrolled-testcases build test-results-func)))
        (group-by transform/testcase->id)
@@ -120,15 +113,11 @@
      :latest-failure (:start last-build)
      :flaky-count (count unrolled-testcases)}))

-(defn- flaky-testcase-summaries [unrolled-testcases]
-  (->> unrolled-testcases
-       (group-by transform/testcase->id)
-       (map (transform/testcase-with-data
-             (fn [testcases] (flaky-testcase-summary testcases))))))
-
 (defn flaky-testcases-as-list [builds test-results-func]
   (->> builds
        find-flaky-build-candidates
        (mapcat #(flaky-testcases-for-builds % test-results-func))
-       flaky-testcase-summaries
+       (group-by transform/testcase->id)
+       (map (transform/testcase-with-data
+             (fn [testcases] (flaky-testcase-summary testcases))))
        (map transform/testcase->map)))


Improve user feedback.

Improve user feedback.

--- src/cli4clj/cli.clj
+++ src/cli4clj/cli.clj
@@ -213,9 +213,10 @@
           :? :help
           :q :quit
           :enable-trace {:fn (fn [arg]
-                               (when (= java.lang.Boolean (type arg))
+                               (if (instance? java.lang.Boolean arg)
                                  (reset! print-exception-trace arg)
-                                 (println "Set print-exception-trace to:" @print-exception-trace)))
+                                 (println "Error, you need to supply a boolean value: true or false"))
+                                 (println "print-exception-trace is set to:" @print-exception-trace))
                          :short-info "Enable/Disable Printing of Full Exception Traces"
                          :long-info "When set to false (default), only the exception message will be printed when an exception occurs. When set to true, the full traces of exceptions will be printed."}}
    :eval-factory create-cli-eval-fn


Makes flash/put! take a variable number of arguments.

--- src/cadence/model/flash.clj
+++ src/cadence/model/flash.clj
@@ -2,7 +2,7 @@
   (:refer-clojure :exclude [get])
   (:require [noir.session :as sess]))

-(defn put! [t m]
+(defn put! [t & m]
   (sess/flash-put! {:type t :message m}))

 (def get sess/flash-get)


Cleaner mutation code.

Cleaner mutation code.

--- src/cbfg/world-storage.cljs
+++ src/cbfg/world-storage.cljs
@@ -24,8 +24,7 @@

 (defn storage-set [actx storage opaque key cas-old val op]
   (ago storage-set actx
-       (let [cas-new (gen-cas)
-             res (atom nil)]
+       (let [res (atom nil)]
          (swap! storage
                 #(let [s1 (assoc % :next-sq (max (:next-sq %)
                                                  (inc (:max-deleted-sq %))))
@@ -51,21 +50,22 @@
                            (do (reset! res {:opaque opaque :status :not-found
                                             :key key})
                                s1)
-                           (do (reset! res {:opaque opaque :status :ok
-                                            :key key :sq sq-new :cas cas-new})
-                               (let [val-new (case op
-                                               :add val
-                                               :replace val
-                                               :append (str (:val prev-change) val)
-                                               :prepend (str val (:val prev-change))
-                                               val)]
-                                 (-> s1
-                                     (dissoc-in [:changes sq-old])
-                                     (assoc-in [:keys key] sq-new)
-                                     (assoc-in [:changes sq-new]
-                                               {:key key :sq sq-new :cas cas-new
-                                                :val val-new})
-                                     (update-in [:next-sq] inc))))))))))
+                           (let [cas-new (gen-cas)
+                                 val-new (case op
+                                           :add val
+                                           :replace val
+                                           :append (str (:val prev-change) val)
+                                           :prepend (str val (:val prev-change))
+                                           val)]
+                             (reset! res {:opaque opaque :status :ok
+                                          :key key :sq sq-new :cas cas-new})
+                             (-> s1
+                                 (dissoc-in [:changes sq-old])
+                                 (assoc-in [:keys key] sq-new)
+                                 (assoc-in [:changes sq-new]
+                                           {:key key :sq sq-new :cas cas-new
+                                            :val val-new})
+                                 (update-in [:next-sq] inc)))))))))
          @res)))

 (defn storage-del [actx storage opaque key]


Implement CAS checking in delete cmd.

Implement CAS checking in delete cmd.

--- src/cbfg/world-storage.cljs
+++ src/cbfg/world-storage.cljs
@@ -70,19 +70,34 @@
                                      (update-in [:next-sq] inc)))))))))
              @res)))))

-(defn storage-del [actx storage opaque key]
+(defn storage-del [actx storage opaque key old-cas]
   (ago storage-del actx
-       (let [s2 (swap! storage
-                       #(-> %
-                            (assoc :max-deleted-sq (max (get-in % [:keys key])
-                                                        (:max-deleted-sq %)))
-                            (dissoc-in [:changes (get-in % [:keys key])])
-                            (dissoc-in [:keys key])
-                            (assoc-in [:changes (:next-sq %)]
-                                      {:key key :sq (:next-sq %) :deleted true})
-                            (update-in [:next-sq] inc)))]
-         {:opaque opaque :status :ok
-          :key key :sq (dec (:next-sq s2))})))
+       (let [res (atom nil)]
+         (swap! storage
+                #(let [old-sq (get-in % [:keys key])
+                       cas-check (and old-cas (not (zero? old-cas)))
+                       prev-change (when cas-check
+                                     (get-in % [:changes old-sq]))]
+                   (if (not old-sq)
+                     (do (reset! res {:opaque opaque :status :not-found
+                                      :key key})
+                         s1)
+                     (if (and cas-check (not= old-cas (:cas prev-change)))
+                       (do (reset! res {:opaque opaque :status :wrong-cas
+                                        :key key})
+                           s1)
+                       (let [new-sq (:next-sq %)]
+                         (reset! res {:opaque opaque :status :wrong-cas
+                                      :key key :sq new-sq})
+                         (-> %
+                             (assoc :max-deleted-sq (max old-sq
+                                                         (:max-deleted-sq %)))
+                             (dissoc-in [:changes old-sq])
+                             (dissoc-in [:keys key])
+                             (assoc-in [:changes new-sq]
+                                       {:key key :sq new-sq :deleted true})
+                             (update-in [:next-sq] inc)))))))
+         @res)))

 (defn storage-scan [actx storage opaque from to]
   (let [out (achan actx)]
@@ -120,7 +135,7 @@
    "set" [["key" "val"]
           (fn [c] {:rq #(storage-set % storage (:opaque c) (:key c) (:cas c) (:val c) :set)})]
    "del" [["key"]
-          (fn [c] {:rq #(storage-del % storage (:opaque c) (:key c))})]
+          (fn [c] {:rq #(storage-del % storage (:opaque c) (:key c) (:cas c))})]
    "add" [["key" "val"]
           (fn [c] {:rq #(storage-set % storage (:opaque c) (:key c) (:cas c) (:val c) :add)})]
    "replace" [["key" "val"]


adding operations api

adding operations api

--- src/celestial/api/users.clj
+++ src/celestial/api/users.clj
@@ -1,5 +1,6 @@
 (ns celestial.api.users
   (:require
+    [celestial.model :as m]
     [cemerick.friend.credentials :as creds]
     [celestial.persistency.users :as u]
     [celestial.persistency.quotas :as q]
@@ -54,7 +55,12 @@
 (defroutes- users-ro {:path "/user" :description "Read only User data"}

   (GET- "/users" [] {:nickname "getUsers" :summary "Get all users"}
-        (success (map #(dissoc (u/get-user %) :password) (u/all-users)))))
+        (success (map #(dissoc (u/get-user %) :password) (u/all-users))))
+
+  (GET- "/users/operations" [] {:nickname "getUsersOperations" :summary "Get all available operations (not of a specific user)."}
+        (success {:operations (map name m/operations)}))
+
+  )

 (defmodel quota :username :string :quotas {:type :Quotas})


Added trianglestripe. It will be used into mkpol too.

--- src/clj3D/fenvs.clj
+++ src/clj3D/fenvs.clj
@@ -219,6 +219,7 @@

 (def len count)

+
 (defn div
   [& args]
   (reduce #(/ %1 (float %2)) args))
@@ -282,12 +283,20 @@
     (.setColor "Color"  default-color)))

+(defn- optimize
+  "Optimize a Spatial. Internal use."
+  [spatial]
+  (doto (.getChild ^Node (GeometryBatchFactory/optimize spatial) 0)
+    (.setName "structured")))
+
+
 (defhigh merge-geometries

   [geom1 geom2]
   (let [out-mesh (Mesh.)]
     (GeometryBatchFactory/mergeGeometries [geom1 geom2] out-mesh)
     (doto (Geometry. "structured" out-mesh)
+      (optimize)
       (.setMaterial (default-material)))))

@@ -314,7 +323,7 @@
         rev-seq (reverse flattened-args)]
     (reduce (fn [x y]
       (cond-match
-        [[com.jme3.scene.Geometry com.jme3.scene.Geometry] [x y]] (merge-geometries x y)
+        [[com.jme3.scene.Geometry com.jme3.scene.Geometry] [x y]] (+ x y)
         [[com.jme3.scene.Geometry ?func] [x y]] (func x)
         [[?func com.jme3.scene.Geometry] [x y]] (func x)
         [? [x y]] (throw (IllegalArgumentException. "Invalid input for struct")))) rev-seq)))
@@ -330,9 +339,9 @@
     new-node))

-(defn attach
+(defhigh attach
   "Attach a child to the given node."
-  [node child]
+  [^Node node child]
   (.attachChild node child))

@@ -419,7 +428,7 @@
 (def n repeat)

-(defn nn
+(defhigh nn
   [times seq]
   (repeat times (cat seq)))

@@ -550,8 +559,11 @@
 (defn triangle
   "Returns a new 2D triangle in with vertexes v1 v2 v3."
   [v1 v2 v3]
-  (let [triangle-mesh (Mesh.)
-        vertices (float-array (flatten [v1 0 v2 0 v3 0]))
+  (let [v1 (when (= 2 (count v1)) (conj (vec v1) 0))
+	v2 (when (= 2 (count v2)) (conj (vec v2) 0))
+	v3 (when (= 2 (count v3)) (conj (vec v3) 0))
+	triangle-mesh (Mesh.)
+        vertices (float-array (flatten [v1 v2 v3]))
         tex-cord (float-array [0 0 1 0 0 1])
         indexes (int-array [2 0 1 1 0 2])
         normals (float-array (flatten (repeat 3 [0 0 1])))]
@@ -564,6 +576,30 @@
       (.updateBound))

     (doto (Geometry. "triangle" triangle-mesh)
+      (.setMaterial (default-material)))))
+
+
+(defn trianglestripe
+  "Returns a new 2D trianglestripe."
+  [& points]
+  (let [stripe-mesh (Mesh.)
+	points (for [pt points] (if (= 2 (count pt)) (conj (vec pt) 0) pt))
+	size (count points)
+        vertices (float-array (flatten points))
+        tex-cord (float-array (flatten (repeat size [0 0 1])))
+        indexes (int-array
+		 (flatten
+		  (map vector (repeat size 0) (range 1 (dec size)) (range 2 size))))
+        normals (float-array (flatten (repeat (count points) [0 0 1])))]
+
+    (doto ^Mesh stripe-mesh
+      (.setBuffer VertexBuffer$Type/Position 3 vertices)
+      (.setBuffer VertexBuffer$Type/Normal 3 normals)
+      (.setBuffer VertexBuffer$Type/TexCoord 2 tex-cord)
+      (.setBuffer VertexBuffer$Type/Index 1 indexes)
+      (.updateBound))
+
+    (doto (Geometry. "stripe" stripe-mesh)
       (.setMaterial (default-material)))))


Fix report dump

Fix report dump

--- src/clj/introspect/core.clj
+++ src/clj/introspect/core.clj
@@ -126,5 +126,5 @@

   (.addShutdownHook (Runtime/getRuntime)
                     (Thread. #(do
-                                (dump-report)
+                                (dump-report!)
                                 (println (format-report))))))


Add stubs for the other "builtin" functions we need

--- src/clj/minijava/interp.clj
+++ src/clj/minijava/interp.clj
@@ -117,6 +117,8 @@
         args (map (fn [arg] (eval-ir arg env)) (:args exp))]
     (case fn-name
       "print" (println (first args))
+      "newObject" (println "Unimplemented stub")
+      "newArray"  (println "Unimplemented stub")
       (eval-ir (read-method env fn-name) env))))

 (defmethod eval-ir :minijava.ir/Statement [exp env]


Fix misplaced docstrings

Fix misplaced docstrings

--- src/clj/my_money/op_csv.clj
+++ src/clj/my_money/op_csv.clj
@@ -5,8 +5,9 @@
 (defn read-csv [csv-string]
   (csv/read-csv csv-string :separator \;))

-(defn remove-column [csv-vec column]
+(defn remove-column
   "Removes item in given column number from each vector in the vector of vectors"
+  [csv-vec column]
   (let [remove-item (fn [acc row]
                       (if (>= (count row) (inc column))
                         (conj acc
@@ -24,8 +25,9 @@
 (defn remove-columns-by-name [csv-vec column-names]
   (reduce remove-column-by-name csv-vec column-names))

-(defn- header->keyword [header]
+(defn- header->keyword
   "Removes whitespace from string originating from csv header and turns it into a keyword"
+  [header]
   (-> header
       (clojure.string/replace " " "") ; There's some weird space in some column name
       (clojure.string/replace #"\s+" "")


remove commented-out kw-invoke bytecode

remove commented-out kw-invoke bytecode

--- src/clj/wombat/compiler.clj
+++ src/clj/wombat/compiler.clj
@@ -657,15 +657,8 @@
       (doseq [a args]
         (emit env :context/expression gen a))
       (. gen invokeVirtual (asmtype clojure.lang.Var) (Method. "invoke" object-type (into-array Type (repeat (count args) object-type)))))
-    (let [;;is-kw-label (. gen newLabel)
-          ;;end-label (. gen newLabel)
-          ]
+    (do
       (emit env :context/expression gen fun)
-      ;; (. gen dup)
-      ;; (. gen instanceOf (asmtype Keyword))
-      ;; (. gen ifZCmp GeneratorAdapter/NE is-kw-label)
-
-      ;; Not keword
       (. gen dup)
       (. gen checkCast ilambda-type)
       (AsmUtil/pushInt gen (count args))
@@ -675,31 +668,7 @@
       (doseq [a args]
         (emit env :context/expression gen a))
       (. gen invokeVirtual (asmtype MethodHandle)
-         (Method. "invoke" object-type (into-array Type (cons ilambda-type (repeat (count args) object-type)))))
-      ;; (. gen goTo end-label)
-
-      ;; Is keyword
-      ;; (. gen mark is-kw-label)
-      ;; (. gen checkCast (asmtype Keyword))
-      ;; (. gen getField (asmtype Keyword) "sym" (asmtype Symbol))
-      ;; (. gen dup)
-      ;; (. gen invokeVirtual (asmtype Symbol) (Method/getMethod "String getNamespace()"))
-      ;; (let [has-ns (. gen newLabel)]
-      ;;   (. gen dup)
-      ;;   (. gen ifNonNull has-ns)
-      ;;   (. gen pop) ;; pop initial null ns from before dup
-      ;;   (. gen push "clojure.core")
-      ;;   (. gen mark has-ns))
-      ;; (. gen swap)
-      ;; (. gen invokeVirtual (asmtype Symbol) (Method/getMethod "String getName()"))
-      ;; (. gen invokeStatic (asmtype RT) (Method/getMethod "clojure.lang.Var var(String,String)"))
-      ;; (doseq [a args]
-      ;;   (emit env :context/expression gen a))
-      ;; (. gen invokeVirtual (asmtype clojure.lang.Var)
-      ;;    (Method. "invoke" object-type (into-array Type (repeat (count args) object-type))))
-
-      ;; (. gen mark end-label)
-      ))
+         (Method. "invoke" object-type (into-array Type (cons ilambda-type (repeat (count args) object-type)))))))

   (when (= context :context/statement)
     (. gen pop)))


Make pileup concurrent

Make pileup concurrent

--- src/cljam/pileup/pileup.clj
+++ src/cljam/pileup/pileup.clj
@@ -1,6 +1,8 @@
 (ns cljam.pileup.pileup
   "Provides simple pileup functions."
-  (:require [cljam.util.sam-util :as sam-util]
+  (:require [com.climate.claypoole :as cp]
+            [cljam.common :refer [get-exec-n-threads]]
+            [cljam.util.sam-util :as sam-util]
             [cljam.io :as io]
             [cljam.pileup.common :refer [window-width step center]]
             cljam.bam.reader)
@@ -68,15 +70,23 @@
 (defn- pileup*
   "Internal pileup function."
   [rdr rname rlength start end]
-  (let [read-alignments-memo (memoize read-alignments)]
+  (let [n-threads (get-exec-n-threads)
+        count-fn (fn [xs]
+                   (if (= n-threads 1)
+                     (map (fn [[positions alns]]
+                            (count-for-positions alns rname positions)) xs)
+                     (cp/pmap (dec n-threads)
+                              (fn [[positions alns]]
+                                (count-for-positions alns rname positions)) xs)))]
     (->> (grouped-rpositions start end step)
          (map vec)
          (map (fn [positions]
                 (let [pos (if (= (count positions) step)
                             (nth positions center)
                             (nth positions (quot (count positions) 2)))
-                      alns (read-alignments-memo rdr rname rlength pos)]
-                  (count-for-positions alns rname positions))))
+                      alns (doall (read-alignments rdr rname rlength pos))]
+                  [positions alns])))
+         count-fn
          (apply concat))))

 (defn first-pos


Downloading weather based on location

Downloading weather based on location

--- src/cljs/aladin/client.cljs
+++ src/cljs/aladin/client.cljs
@@ -5,6 +5,16 @@

 (enable-console-print!)

-(-> js/navigator
-    (.-geolocation)
-    (.getCurrentPosition println))
+(defn doweather [data]
+   (jqm/let-ajax [weather {:url (str "/weather/"
+                                     (-> data .-coords .-latitude)
+                                     "/"
+                                     (-> data .-coords .-longitude))
+                           :dataType :json}]
+     (println weather)))
+
+(jqm/ready
+  (let [geo (.-geolocation js/navigator)]
+    (if geo
+      (.getCurrentPosition geo doweather)
+      (println "GTFO"))))


Don't start the fancy logging by default.

--- src/cljs/start/logging.cljs
+++ src/cljs/start/logging.cljs
@@ -1,10 +1,18 @@
 (ns start.logging
-  (:use [library.logging :only (get-logger fancy-output info)])
-  (:require [library.dispatch :as dispatch]))
+  (:require [library.dispatch :as dispatch]
+            [library.logging :as log]))

-(def logger (get-logger "events"))
-
-(def fancy (fancy-output "main"))
+(def logger (log/get-logger "events"))

 (dispatch/respond-to identity
-                     (fn [t d] (info logger (str (pr-str t) " - " (pr-str d)))))
+                     (fn [t d] (log/info logger (str (pr-str t) " - " (pr-str d)))))
+
+(comment
+
+  ;; log to the console
+  (log/console-output)
+  ;; log to to the "fancy" window
+  (log/fancy-output "main")
+  ;; change the logging level
+  (log/set-level logger :fine)
+  )


extractmore of the game logic

extractmore of the game logic

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -57,9 +57,8 @@
     (turn/play-move (get-turn game-turns) coord)))

 (defn cancel-last-move ;; TODO - It needs the ai: how to move it in the game? undo then undo-while
-  [old-turns]
-  (let [ai-turn? #(contains? (:ai-players %) (:player %))
-        new-turns (drop-while ai-turn? (drop 1 old-turns))]
+  [old-turns is-ai?]
+  (let [new-turns (drop-while #(is-ai? (:player %)) (drop 1 old-turns))]
     (if (empty? new-turns)
       (take-last 1 old-turns)
       new-turns)))
@@ -101,7 +100,7 @@
   (case msg
     :new-game (swap! app-state assoc-in [:games] (new-game))
     :restart (swap! app-state update-in [:games] #(take-last 1 %))
-    :undo (swap! app-state update-in [:games] cancel-last-move)))
+    :undo (swap! app-state update-in [:games] cancel-last-move #{:red :green})))

 (defn start-game-loop
   "Manage transitions between player moves, ai moves, and generic game events"


Drop jar assertion when validating deploys

--- src/clojars/routes/repo.clj
+++ src/clojars/routes/repo.clj
@@ -217,12 +217,6 @@
           (throw-invalid :central-shadow
                          "shadowing Maven Central artifacts is not allowed. See https://bit.ly/3rTLqxZ"
             meta))))))
-
-(defn assert-jar-uploaded [artifacts pom]
-  (when (and (= :jar (:packaging pom))
-          (not (some (partial match-file-name #"\.jar$") artifacts)))
-    (throw-invalid :missing-jar-file
-                   "no jar file was uploaded")))

 (defn validate-checksums [artifacts]
   (doseq [f artifacts]
@@ -276,7 +270,6 @@
   (assert-non-central-shadow group name)

   (let [artifacts (find-artifacts dir)]
-    (assert-jar-uploaded artifacts pom)
     (validate-checksums artifacts)
     (assert-signatures (remove (partial match-file-name "maven-metadata.xml") artifacts))))


Fix spelling of resilience

Fix spelling of resilience

--- src/clojush/meta_errors.clj
+++ src/clojush/meta_errors.clj
@@ -157,7 +157,7 @@
           0
           1)))))

-(defn resiliance-meta-error
+(defn resilience-meta-error
   [ind evaluated-population argmap]
   (if (not (:print-history argmap))
     (throw


Added utility function for removing disallowed routes.

--- src/dragon/util.clj
+++ src/dragon/util.clj
@@ -202,3 +202,10 @@
   [obj]
   (when (= clojure.lang.Atom (type obj))
     true))
+
+(defn remove-routes
+  [disallowed-set coll]
+  (remove
+    (fn [[route _route-data]]
+      (some true? (map #(string/starts-with? route %) disallowed-set)))
+    coll))


Refresh the view app page each time user clicks on preview button.

--- frontend/src/uxbox/main/ui/workspace/header.cljs
+++ frontend/src/uxbox/main/ui/workspace/header.cljs
@@ -43,7 +43,8 @@
   [event project page]
   (let [token (:share-token project)
         index (:index page)
-        url (str cfg/viewurl "#/" token "/" index)]
+        rval (rand-int 1000000)
+        url (str cfg/viewurl "?v=" rval "#/" token "/" index)]
     (js/open url "new tab" "")))

 (mx/defc header


fix allow-org-members call

fix allow-org-members call

--- src/open_company/api/sections.clj
+++ src/open_company/api/sections.clj
@@ -79,8 +79,9 @@
                             (assoc :section-name section-name)))))})

   ;; Handlers
-  :handle-ok (by-method {
-    :get (fn [ctx] (section-rep/render-section conn (:section ctx) (common/allow-org-members company-slug ctx) (not (nil? as-of))))
+  :handle-ok
+  (by-method
+   {:get (fn [ctx] (section-rep/render-section conn (:section ctx) (common/allow-org-members conn company-slug ctx) (not (nil? as-of))))
     :put (fn [ctx] (section-rep/render-section conn (:updated-section ctx)))
     :patch (fn [ctx] (section-rep/render-section conn (:updated-section ctx)))})
   :handle-not-acceptable (fn [_] (common/only-accept 406 section-rep/media-type))


coerce-pipeline arguments improvements

coerce-pipeline arguments improvements

--- src/pipeline/grafter/pipeline.clj
+++ src/pipeline/grafter/pipeline.clj
@@ -100,19 +100,36 @@
           (let [klass (:class et)]
             (parse-parameter (resolve-parameter-type namespace klass) sa opts))) expected-types supplied-args)))

-(defn ^:no-doc coerce-pipeline-arguments
+
+(defn find-pipeline
+  "Find a pipeline by its fully qualified pipeline.  Accepts either a
+  string or a symbol identifying the pipeline
+  e.g. \"my.namespace/my-pipeline\" or 'my.namespace/my-pipeline"
+  [name]
+  (get @exported-pipelines (symbol name)))
+
+(defmulti coerce-pipeline-arguments
   "Coerce the arguments based on the pipelines stated types.  Receives
-  a fully qualified symbol identifying the pipeline and returns the
-  arguments as coerced values, or raise an error if a coercion isn't
-  possible.
+  a fully qualified name of the pipeline (a symbol or string), or a
+  pipeline-object and returns the arguments as coerced values, or
+  raise an error if a coercion isn't possible.

   Uses the multi-method grafter.pipeline.types/parse-parameter to coerce
   values."
-  [pipeline-sym supplied-args]
-  (let [pipeline (@exported-pipelines pipeline-sym)
-        expected-types (:args pipeline)
+  (fn [pipeline supplied-args]
+    (type pipeline)))
+
+(defmethod coerce-pipeline-arguments clojure.lang.IPersistentMap [pipeline supplied-args]
+  (let [expected-types (:args pipeline)
         namespace (:namespace pipeline)]
     (coerce-arguments namespace expected-types supplied-args)))
+
+(defmethod coerce-pipeline-arguments :default [pipeline-name supplied-args]
+  (let [pipeline (find-pipeline pipeline-name)]
+    (if pipeline
+      (coerce-pipeline-arguments pipeline supplied-args)
+      (throw (ex-info "Could not find pipeline named: " pipeline-name {:error ::pipeline-not-found
+                                                                       ::pipeline-name pipeline-name})))))

 (defn ^:no-doc execute-pipeline-with-coerced-arguments
   "Execute the pipeline specified by pipeline-sym by applying it to
@@ -124,10 +141,3 @@
   (let [coerced-args (coerce-pipeline-arguments pipeline-sym supplied-args)
         pipeline-fn (:var (@exported-pipelines pipeline-sym))]
     (apply pipeline-fn coerced-args)))
-
-(defn find-pipeline
-  "Find a pipeline by its fully qualified pipeline.  Accepts either a
-  string or a symbol identifying the pipeline
-  e.g. \"my.namespace/my-pipeline\" or 'my.namespace/my-pipeline"
-  [name]
-  (get @exported-pipelines (symbol name)))


Raise a better error when failing to parse a pipeline parameter

--- src/pipeline/grafter/pipeline.clj
+++ src/pipeline/grafter/pipeline.clj
@@ -98,7 +98,12 @@
   ([namespace expected-types supplied-args opts]
    (map (fn [et sa]
           (let [klass (:class et)]
-            (parse-parameter (resolve-parameter-type namespace klass) sa opts))) expected-types supplied-args)))
+            (try
+              (parse-parameter (resolve-parameter-type namespace klass) sa opts)
+              (catch Exception ex
+                (throw (ex-info "Unexpected exception parsing pipeline parameter type." {:error ::coerce-argument-error
+                                                                                :expected-type et
+                                                                                :supplied-argument sa} ex)))))) expected-types supplied-args)))

 (defn find-pipeline


Improve how the buttons look

Improve how the buttons look

--- nightweb-desktop/src/nightweb/browser.clj
+++ nightweb-desktop/src/nightweb/browser.clj
@@ -1,15 +1,12 @@
 (ns nightweb.browser
   (:use splendid.jfx)
-  (:import javafx.scene.layout.VBox
-           javafx.scene.layout.HBox
-           javafx.scene.control.TabPane
-           javafx.scene.control.Tab
+  (:import (javafx.scene.layout VBox HBox)
+           (javafx.scene.control TabPane Tab Button TextField)
            javafx.scene.web.WebView
            javafx.scene.layout.Priority
-           javafx.scene.control.Button
-           javafx.scene.control.TextField
            javafx.geometry.Insets
-           javafx.event.EventHandler))
+           javafx.scene.text.Font
+           javafx.geometry.Pos))

 (defn create-tab
   "Creates a new tab."
@@ -17,20 +14,30 @@
   (let [new-tab (Tab. "Main Page")
         tab-view (VBox.)
         nav-bar (HBox.)
-        back-btn (Button. "<-")
-        for-btn (Button. "->")
-        reload-btn (Button. "Reload")
+        back-btn (Button. "<")
+        for-btn (Button. ">")
+        reload-btn (Button. "⟳")
         url-field (TextField.)
         web-view (WebView.)
         index (- (.size (.getTabs tab-bar)) 1)]
+    ; resize the controls
+    (.setFont back-btn (Font. 16))
+    (.setFont for-btn (Font. 16))
+    (.setFont reload-btn (Font. 16))
+    (.setMinHeight url-field 28)
+    (HBox/setHgrow url-field Priority/ALWAYS)
+    ; load the main page
+    (.load (.getEngine web-view) "http://localhost:8080")
+    ; set spacing for the nav bar
+    (.setAlignment nav-bar javafx.geometry.Pos/CENTER)
     (.setPadding nav-bar (Insets. 4))
     (.setSpacing nav-bar 2)
+    ; add everything to the window
     (add nav-bar [back-btn for-btn reload-btn url-field])
-    (HBox/setHgrow url-field Priority/ALWAYS)
     (add tab-view [nav-bar web-view])
-    (.load (.getEngine web-view) "http://localhost:8080")
     (.setContent new-tab tab-view)
     (.add (.getTabs tab-bar) index new-tab)
+    ; select the new tab
     (.select (.getSelectionModel tab-bar) index)))

 (defn start-browser
@@ -39,6 +46,9 @@
   (jfx (let [window (VBox.)
              tab-bar (TabPane.)
              add-tab (Tab. " + ")]
+         (.setTabClosingPolicy
+           tab-bar
+           javafx.scene.control.TabPane$TabClosingPolicy/ALL_TABS)
          (.setClosable add-tab false)
          (.add (.getTabs tab-bar) add-tab)
          (defhandler :onSelectionChanged add-tab (create-tab tab-bar))


Refactor to make compilation code clearer

--- src/hiccup/core.clj
+++ src/hiccup/core.clj
@@ -1,11 +1,13 @@
 (ns hiccup.core
-  "Renders a tree of vectors into a string of HTML. Pre-compiles where
-  possible."
-  (:use clojure.contrib.def
-        clojure.contrib.java-utils)
-  (:import java.util.Map))
-
-(def *html-mode* :xml)
+  "Library for rendering a tree of vectors into a string of HTML.
+  Pre-compiles where possible for performance."
+  (:use [clojure.contrib.def :only (defvar defvar-)]
+        [clojure.contrib.java-utils :only (as-str)])
+  (:import [clojure.lang IPersistentVector
+                         ISeq]))
+
+(defvar *html-mode* :xml
+  "Determines the way tags and attributes are formatted. Defaults to :xml.")

 (defn escape-html
   "Change special characters into HTML character entities."
@@ -16,50 +18,31 @@
     (replace ">"  ">")
     (replace "\"" """)))

-(def h escape-html)  ;; Alias for escape-html
-
-(defn- tag-end
-  "Return the ending part of a self-closing tag."
-  []
-  (if (= *html-mode* :xml)
-    " />"
-    ">"))
-
-(defn- format-attr
-  "Turn a name/value pair into an attribute stringp"
-  [name value]
+(def h escape-html)  ; alias for escape-html
+
+(defn- xml-mode? []
+  (= *html-mode* :xml))
+
+(defn- end-tag []
+  (if (xml-mode?) " />" ">"))
+
+(defn- xml-attribute [name value]
   (str " " (as-str name) "=\"" (escape-html value) "\""))

-(defn- render-attrs
-  "Turn a map into a string of sorted HTML attributes."
-  [attrs]
+(defn- render-attribute [[name value]]
+  (cond
+    (true? value)
+      (if (xml-mode?)
+        (xml-attribute name name)
+        (str " " (as-str name)))
+    (not value)
+      ""
+    :else
+      (xml-attribute name value)))
+
+(defn- render-attr-map [attrs]
   (apply str
-    (sort
-      (for [[attr value] attrs]
-        (cond
-          (true? value)
-            (if (= *html-mode* :xml)
-              (format-attr attr attr)
-              (str " " (as-str attr)))
-          (not value)
-            ""
-          :else
-            (format-attr attr value))))))
-
-(defn- uneval?
-  "True if x is an unevaluated form or symbol."
-  [x]
-  (or (symbol? x)
-      (and (seq? x)
-           (not= (first x) `quote))))
-
-(defn- compile-attrs
-  "Turn a map with unevaluated symbols into an expression that will render the
-  corresponding attributes."
-  [attrs]
-  (if (some uneval? (mapcat identity attrs))
-    `(#'render-attrs ~attrs)
-    (render-attrs attrs)))
+    (sort (map render-attribute attrs))))

 (defvar- re-tag
   #"([^\s\.#]+)(?:#([^\s\.#]+))?(?:\.([^\s#]+))?"
@@ -71,41 +54,79 @@
     "strong" "style" "textarea" "ul" "option"}
   "A list of tags that need an explicit ending tag when rendered.")

-(defn- parse-tag-name
-  "Parse the id and classes from a tag name."
-  [tag]
-  (rest (re-matches re-tag (as-str tag))))
-
-(defn- parse-element
+(defn- normalize-element
   "Ensure a tag vector is of the form [tag-name attrs content]."
   [[tag & content]]
-  (let [[tag id class] (parse-tag-name tag)
-        tag-attrs      {:id id
-                        :class (if class (.replace ^String class "." " "))}
-        map-attrs      (first content)]
+  (let [[_ tag id class] (re-matches re-tag (as-str tag))
+        tag-attrs        {:id id
+                          :class (if class (.replace ^String class "." " "))}
+        map-attrs        (first content)]
     (if (map? map-attrs)
       [tag (merge tag-attrs map-attrs) (next content)]
       [tag tag-attrs content])))

-(declare render-html)
-
-(defn- render-tag
-  "Render a HTML tag represented as a vector."
-  [element]
-  (let [[tag attrs content] (parse-element element)]
+(defmulti render-html
+  "Turn a Clojure data type into a string of HTML."
+  {:private true}
+  type)
+
+(defn- render-element
+  "Render an tag vector as a HTML element."
+  [element]
+  (let [[tag attrs content] (normalize-element element)]
     (if (or content (container-tags tag))
-      (str "<" tag (render-attrs attrs) ">"
+      (str "<" tag (render-attr-map attrs) ">"
            (render-html content)
            "</" tag ">")
-      (str "<" tag (render-attrs attrs) (tag-end)))))
-
-(defn- render-html
-  "Render a Clojure data structure to a string of HTML."
-  [data]
-  (cond
-    (vector? data) (render-tag data)
-    (seq? data) (apply str (map render-html data))
-    :else (as-str data)))
+      (str "<" tag (render-attr-map attrs) (end-tag)))))
+
+(defmethod render-html IPersistentVector
+  [element]
+  (render-element element))
+
+(defmethod render-html ISeq [coll]
+  (apply str (map render-html coll)))
+
+(defmethod render-html :default [x]
+  (as-str x))
+
+(defn- unevaluated?
+  "True if the expression has not been evaluated."
+  [expr]
+  (or (symbol? expr)
+      (and (seq? expr)
+           (not= (first expr) `quote))))
+
+(defn compile-attr-map
+  "Returns an unevaluated form that will render the supplied map as HTML
+  attributes."
+  [attrs]
+  (if (some unevaluated? (mapcat identity attrs))
+    `(#'render-attr-map ~attrs)
+    (render-attr-map attrs)))
+
+(defn- form-name
+  "Get the name of the supplied form."
+  [form]
+  (if (and (seq? form) (symbol? (first form)))
+    (name (first form))))
+
+(defmulti compile-form
+  "Pre-compile certain standard forms, where possible."
+  {:private true}
+  form-name)
+
+(defmethod compile-form "for"
+  [[_ bindings body]]
+  `(apply str (for ~bindings (html ~body))))
+
+(defmethod compile-form "if"
+  [[_ condition & body]]
+  `(if ~condition ~@(for [x body] `(html ~x))))
+
+(defmethod compile-form :default
+  [expr]
+  `(#'render-html ~expr))

 (defn- not-hint?
   "True if x is not hinted to be the supplied type."
@@ -122,125 +143,116 @@
 (defn- literal?
   "True if x is a literal value that can be rendered as-is."
   [x]
-  (and (not (uneval? x))
+  (and (not (unevaluated? x))
        (or (not (or (vector? x) (map? x)))
            (every? literal? x))))
-
-(defn- form-name
-  "Get the name of the supplied form."
-  [form]
-  (if (and (seq? form) (symbol? (first form)))
-    (name (first form))))

 (defn- not-implicit-map?
   "True if we can infer that x is not a map."
   [x]
   (or (= (form-name x) "for")
-      (not (uneval? x))
-      (not-hint? x Map)))
+      (not (unevaluated? x))
+      (not-hint? x java.util.Map)))
+
+(defn- element-compile-strategy
+  "Returns the compilation strategy to use for a given element."
+  [[tag attrs & content :as element]]
+  (cond
+    (every? literal? element)
+      ::all-literal                    ; e.g. [:span "foo"]
+    (and (literal? tag) (map? attrs))
+      ::literal-tag-and-attributes     ; e.g. [:span {} x]
+    (and (literal? tag) (not-implicit-map? attrs))
+      ::literal-tag-and-no-attributes  ; e.g. [:span ^String x]
+    (literal? tag)
+      ::literal-tag                    ; e.g. [:span x]
+    :else
+      ::default))                      ; e.g. [x]

 (declare compile-html)

-(defn- compile-lit-tag+attrs
-  "Compile an element when only the tag and attributes are literal."
-  [tag attrs content]
-  (let [[tag attrs _] (parse-element [tag attrs])]
+(defmulti compile-element
+  "Returns an unevaluated form that will render the supplied vector as a HTML
+  element."
+  {:private true}
+  element-compile-strategy)
+
+(defmethod compile-element ::all-literal
+  [element]
+  (render-element (eval element)))
+
+(defmethod compile-element ::literal-tag-and-attributes
+  [[tag attrs & content]]
+  (let [[tag attrs _] (normalize-element [tag attrs])]
     (if (or content (container-tags tag))
-      `(str ~(str "<" tag) ~(compile-attrs attrs) ">"
+      `(str ~(str "<" tag) ~(compile-attr-map attrs) ">"
             ~@(compile-html content)
             ~(str "</" tag ">"))
-      `(str "<" ~tag ~(compile-attrs attrs) ~(tag-end)))))
-
-(defn- compile-lit-tag
-  "Compile an element when only the tag is literal."
-  [tag [attrs & content :as element]]
-  (let [[tag tag-attrs _] (parse-element [tag])
+      `(str "<" ~tag ~(compile-attr-map attrs) ~(end-tag)))))
+
+(defmethod compile-element ::literal-tag-and-no-attributes
+  [[tag & content]]
+  (compile-element (apply vector tag {} content)))
+
+(defmethod compile-element ::literal-tag
+  [[tag attrs & content]]
+  (let [[tag tag-attrs _] (normalize-element [tag])
         attrs-sym         (gensym "attrs")]
     `(let [~attrs-sym ~attrs]
        (if (map? ~attrs-sym)
          ~(if (or content (container-tags tag))
-            `(str ~(str "<" tag) (#'render-attrs (merge ~tag-attrs ~attrs-sym))
-                  ">" ~@(compile-html content)
+            `(str ~(str "<" tag)
+                  (#'render-attr-map (merge ~tag-attrs ~attrs-sym)) ">"
+                  ~@(compile-html content)
                   ~(str "</" tag ">"))
-            `(str ~(str "<" tag) (#'render-attrs (merge ~tag-attrs ~attrs-sym))
-                  ~(tag-end)))
-         ~(if (or element (container-tags tag))
-            `(str ~(str "<" tag (render-attrs tag-attrs) ">")
+            `(str ~(str "<" tag)
+                  (#'render-attr-map (merge ~tag-attrs ~attrs-sym))
+                  ~(end-tag)))
+         ~(if (or attrs (container-tags tag))
+            `(str ~(str "<" tag (render-attr-map tag-attrs) ">")
                   ~@(compile-html (cons attrs-sym content))
                   ~(str "</" tag ">"))
-            (str "<" tag (render-attrs tag-attrs) (tag-end)))))))
-
-(defn- compile-tag
-  "Pre-compile a single tag vector where possible."
-  [[tag attrs & content :as element]]
-  (cond
-    ;; e.g. [:span "foo"]
-    (every? literal? element)
-      (render-tag (eval element))
-    ;; e.g. [:span {} x]
-    (and (literal? tag) (map? attrs))
-      (compile-lit-tag+attrs tag attrs content)
-    ;; e.g. [:span ^String x]
-    (and (literal? tag) (not-implicit-map? attrs))
-      (compile-lit-tag+attrs tag {} (cons attrs content))
-    ;; e.g. [:span x]
-    (literal? tag)
-      (compile-lit-tag tag (cons attrs content))
-    :else
-      `(#'render-tag
-         [~(first element)
-          ~@(for [x (rest element)]
-              (if (vector? x)
-                (compile-tag x)
-                x))])))
-
-(defmulti compile-form
-  "Pre-compile certain standard forms, where possible."
-  {:private true}
-  form-name)
-
-(defmethod compile-form "for"
-  [[_ bindings body]]
-  `(apply str (for ~bindings (html ~body))))
-
-(defmethod compile-form "if"
-  [[_ condition & body]]
-  `(if ~condition ~@(for [x body] `(html ~x))))
-
-(defmethod compile-form :default
-  [expr]
-  `(#'render-html ~expr))
+            (str "<" tag (render-attr-map tag-attrs) (end-tag)))))))
+
+(defmethod compile-element :default
+  [element]
+  `(#'render-element
+     [~(first element)
+      ~@(for [x (rest element)]
+          (if (vector? x)
+            (compile-element x)
+            x))]))
+
+(defn- compile-html
+  "Pre-compile data structures into HTML where possible."
+  [content]
+  (doall (for [expr content]
+           (cond
+            (vector? expr) (compile-element expr)
+            (literal? expr) expr
+            (hint? expr String) expr
+            (hint? expr Number) expr
+            (seq? expr) (compile-form expr)
+            :else `(#'render-html ~expr)))))

 (defn- collapse-strs
   "Collapse nested str expressions into one, where possible."
   [expr]
   (if (seq? expr)
     (cons
-      (first expr)
-      (mapcat
-       #(if (and (seq? %) (symbol? (first %)) (= (first %) (first expr) `str))
-          (rest (collapse-strs %))
-          (list (collapse-strs %)))
-        (rest expr)))
+     (first expr)
+     (mapcat
+      #(if (and (seq? %) (symbol? (first %)) (= (first %) (first expr) `str))
+         (rest (collapse-strs %))
+         (list (collapse-strs %)))
+      (rest expr)))
     expr))
-
-(defn- compile-html
-  "Pre-compile data structures into HTML where possible."
-  [content]
-  (doall (for [expr content]
-           (cond
-            (vector? expr) (compile-tag expr)
-            (literal? expr) expr
-            (hint? expr String) expr
-            (hint? expr Number) expr
-            (seq? expr) (compile-form expr)
-            :else `(#'render-html ~expr)))))

 (defmacro html
   "Render Clojure data structures to a string of HTML."
   [options & content]
   (letfn [(make-html [content]
-            (collapse-strs `(str ~@(compile-html content))))]
+           (collapse-strs `(str ~@(compile-html content))))]
     (if-let [mode (and (map? options) (:mode options))]
       (binding [*html-mode* mode]
         `(binding [*html-mode* ~mode]


Remove uri-root business from once.

Remove uri-root business from once.

--- src/incise/once.clj
+++ src/incise/once.clj
@@ -13,7 +13,7 @@
   [& {:as config}]
   (conf/merge config)
   (conf/avow!)
-  (let [{:keys [out-dir uri-root precompiles]} (conf/get)]
+  (let [{:keys [out-dir precompiles]} (conf/get)]
     (info "Clearing out" (str \" out-dir \"))
     (delete-recursively (file out-dir))
     (with-options {:mode :production
@@ -22,7 +22,5 @@
       (info "Precompiling assets...")
       (precompile)
       (info "Done.")
-      (with-options (when uri-root
-                      {:generated-assets-root (str \/ uri-root "/assets/")})
-        (load-parsers-and-layouts)
-        (doall (parse-all-input-files))))))
+      (load-parsers-and-layouts)
+      (doall (parse-all-input-files)))))


fix windows node download

fix windows node download

--- src/rksm/cloxp_installer/main.clj
+++ src/rksm/cloxp_installer/main.clj
@@ -15,8 +15,8 @@
          :version (System/getProperty "os.version")
          :arch (System/getProperty "os.arch")})

-(def node-exe-url "http://nodejs.org/dist/latest/node.exe")
-(def node-exe-64-url "http://nodejs.org/dist/latest/x64/node.exe")
+(def node-exe-url "http://nodejs.org/dist/latest/win-x86/node.exe")
+(def node-exe-64-url "http://nodejs.org/dist/latest/win-x64/node.exe")

 (defn- os-dispatch
   [{os-name :name :or {os-name ""}}]
@@ -47,10 +47,7 @@
 (defn download [uri file]
   "downloads a file"
   (let [file (.getCanonicalFile (io/file file))]
-    (with-open [in (io/input-stream uri)
-                out (io/output-stream file)]
-      (io/copy in out))
-    file))
+    (io/copy (io/input-stream uri) file)))

 (defn unzip
   "takes a path to a zip file and a target dir. Will unzip all contents of the
@@ -176,13 +173,13 @@
 (defmethod install-npm-modules "Windows"
   [_]
   (println "3. Installing npm / modules...")
-
+
   (println "3.1 Installing nodejs + npm...")
-
+
   (case (:arch os)
     "amd64" (download node-exe-64-url "node.exe")
     (download node-exe-url "node.exe"))
-
+
   (copy-file (io/file "win" "gnuwin32") (io/file "gnuwin32"))
   (copy-file (io/file "win" "node_modules") (io/file "node_modules"))
   (copy-file (io/file "win" "npm.cmd") (io/file "npm.cmd")))


tests refactored

tests refactored

--- test/etaoin/api_test.clj
+++ test/etaoin/api_test.clj
@@ -235,18 +235,14 @@
     (is (numeric? x))
     (is (numeric? y))))

-;; (deftest test-window-position
-;;   (testing "getting position"
-;;     (let-window-position {:keys [x y]}
-;;       (is (numeric? x))
-;;       (is (numeric? y))))
-;;   (testing "setting position"
-;;     (skip-phantom
-;;      (set-window-position 500 500)
-;;      (with-window-position {:x 222 :y 333}
-;;        (let-window-position {:keys [x y]}
-;;          (is (numeric? x))
-;;          (is (numeric? y)))))))
+(deftest test-window-position
+  (let [{:keys [x y]} (get-window-position *driver*)]
+    (is (numeric? x))
+    (is (numeric? y))
+    (set-window-position *driver* (+ x 10) (+ y 10))
+    (let [{:keys [x' y']} (get-window-position *driver*)]
+      (is (not= x x'))
+      (is (not= y y')))))

 (deftest test-window-size
   (testing "getting size"
@@ -374,14 +370,6 @@
     (skip-firefox *driver*
      (is (str/starts-with? src "<!DOCTYPE html>")))))

-;; (deftest test-element-properties
-;;   (when-firefox
-;;       (let-prop "//*[@id='element-props']" innerHTML
-;;                 (is (= innerHTML "
Inner HTML
")))
-;;     (let-props "//*[@id='element-props']" [innerHTML tagName]
-;;                (is (= innerHTML "
Inner HTML
"))
-;;                (is (= tagName "DIV")))))
-
 (deftest test-screenshot
   (with-tmp-file "screenshot" ".png" path
     (screenshot *driver* path)
@@ -390,24 +378,23 @@
         ImageIO/read
         is)))

-;; (deftest test-js-execute
-;;   (testing "simple result"
-;;     (let [result (js-execute "return 42;")]
-;;       (is (= result 42))))
-;;   (testing "with args"
-;;     (let [script "return {foo: arguments[0], bar: arguments[1]};"
-;;           result (js-execute script {:test 42} [true, nil, "Hello"])]
-;;       (is (= result
-;;              {:foo {:test 42}
-;;               :bar [true nil "Hello"]})))))
-
-;; (deftest test-js-inject
-;;   (let [url (-> "html/test.html" io/resource str)
-;;         js-url (-> "js/inject.js" io/resource str)]
-;;     (testing "adding a script"
-;;       (add-script js-url)
-;;       (let [result (js-execute "return injected_func();")]
-;;         (is (= result "I was injected"))))))
+(deftest test-js-execute
+  (testing "simple result"
+    (let [result (js-execute *driver* "return 42;")]
+      (is (= result 42))))
+  (testing "with args"
+    (let [script "return {foo: arguments[0], bar: arguments[1]};"
+          result (js-execute *driver* script {:test 42} [true, nil, "Hello"])]
+      (is (= result
+             {:foo {:test 42}
+              :bar [true nil "Hello"]})))))
+
+(deftest test-add-script
+  (let [js-url (-> "js/inject.js" io/resource str)]
+    (testing "adding a script"
+      (add-script *driver* js-url)
+      (let [result (js-execute *driver* "return injected_func();")]
+        (is (= result "I was injected"))))))

 (deftest test-set-hash
   (testing "set hash"