revert formatting fubar introduced by 196abcd060c43adb887cf32de4b483f5e0254fbe

--- src/clj/cljs/repl.clj
+++ src/clj/cljs/repl.clj
@@ -273,57 +273,57 @@
           ([repl-env env [_ file :as form] opts]
             (load-file repl-env file opts)))]
     {'in-ns
-                             (fn self
-                               ([repl-env env form]
-                                 (self repl-env env form nil))
-                               ([repl-env env [_ [quote ns-name] :as form] _]
-                                 (when-not (ana/get-namespace ns-name)
-                                   (swap! env/*compiler* assoc-in [::ana/namespaces ns-name] {:name ns-name})
-                                   (-evaluate repl-env "<cljs repl>" 1
-                                     (str "goog.provide('" (comp/munge ns-name) "');")))
-                                 (set! ana/*cljs-ns* ns-name)))
+     (fn self
+       ([repl-env env form]
+         (self repl-env env form nil))
+       ([repl-env env [_ [quote ns-name] :as form] _]
+         (when-not (ana/get-namespace ns-name)
+           (swap! env/*compiler* assoc-in [::ana/namespaces ns-name] {:name ns-name})
+           (-evaluate repl-env "<cljs repl>" 1
+             (str "goog.provide('" (comp/munge ns-name) "');")))
+         (set! ana/*cljs-ns* ns-name)))
      'require
-                             (fn self
-                               ([repl-env env form]
-                                 (self repl-env env form nil))
-                               ([repl-env env [_ & specs :as form] opts]
-                                 (evaluate-form repl-env env "<cljs repl>"
-                                   (with-meta
-                                     `(~'ns ~ana/*cljs-ns*
-                                        (:require
-                                          ~@(map
-                                              (fn [quoted-spec-or-kw]
-                                                (if (keyword? quoted-spec-or-kw)
-                                                  quoted-spec-or-kw
-                                                  (second quoted-spec-or-kw)))
-                                              specs)))
-                                     {:merge true :line 1 :column 1})
-                                   identity opts)))
+     (fn self
+       ([repl-env env form]
+         (self repl-env env form nil))
+       ([repl-env env [_ & specs :as form] opts]
+         (evaluate-form repl-env env "<cljs repl>"
+           (with-meta
+             `(~'ns ~ana/*cljs-ns*
+                (:require
+                  ~@(map
+                      (fn [quoted-spec-or-kw]
+                        (if (keyword? quoted-spec-or-kw)
+                          quoted-spec-or-kw
+                          (second quoted-spec-or-kw)))
+                      specs)))
+             {:merge true :line 1 :column 1})
+           identity opts)))
      'require-macros
-                             (fn self
-                               ([repl-env env form]
-                                 (self repl-env env form nil))
-                               ([repl-env env [_ & specs :as form] opts]
-                                 (evaluate-form repl-env env "<cljs repl>"
-                                   (with-meta
-                                     `(~'ns ~ana/*cljs-ns*
-                                        (:require-macros
-                                          ~@(map
-                                              (fn [quoted-spec-or-kw]
-                                                (if (keyword? quoted-spec-or-kw)
-                                                  quoted-spec-or-kw
-                                                  (second quoted-spec-or-kw)))
-                                              specs)))
-                                     {:merge true :line 1 :column 1})
-                                   identity opts)))
-     'load-file              load-file-fn
+     (fn self
+       ([repl-env env form]
+         (self repl-env env form nil))
+       ([repl-env env [_ & specs :as form] opts]
+         (evaluate-form repl-env env "<cljs repl>"
+           (with-meta
+             `(~'ns ~ana/*cljs-ns*
+                (:require-macros
+                  ~@(map
+                      (fn [quoted-spec-or-kw]
+                        (if (keyword? quoted-spec-or-kw)
+                          quoted-spec-or-kw
+                          (second quoted-spec-or-kw)))
+                      specs)))
+             {:merge true :line 1 :column 1})
+           identity opts)))
+     'load-file load-file-fn
      'clojure.core/load-file load-file-fn
      'load-namespace
-                             (fn self
-                               ([repl-env env form]
-                                 (self env repl-env form nil))
-                               ([repl-env env [_ ns :as form] opts]
-                                 (load-namespace repl-env ns opts)))}))
+     (fn self
+       ([repl-env env form]
+         (self env repl-env form nil))
+       ([repl-env env [_ ns :as form] opts]
+         (load-namespace repl-env ns opts)))}))

 (defn analyze-source
   "Given a source directory, analyzes all .cljs files. Used to populate


Show a prompt any time an agenda is accessed to allow Film Critic interaction.

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -399,6 +399,10 @@

 (defn trash-no-cost [state side]
   (when-let [card (:card (first (get-in @state [side :prompt])))]
+    (when (= (:type card) "Agenda") ; trashing before the :access events actually fire; fire them manually
+      (when-let [access-effect (:access (card-def card))]
+        (resolve-ability state (to-keyword (:side card)) access-effect card nil))
+      (trigger-event state side :access card))
     (trash state side card)
     (swap! state update-in [side :prompt] rest)
     (when-let [run (:run @state)]
@@ -798,6 +802,14 @@
       (concat (get-in @state [:bonus :steal-cost]))
       merge-costs flatten vec))

+(defn resolve-steal [state side c]
+  (let [cdef (card-def c)]
+    (when-let [access-effect (:access cdef)]
+      (resolve-ability state (to-keyword (:side c)) access-effect c nil))
+    (trigger-event state side :access c)
+    (when (or (not (:steal-req cdef)) ((:steal-req cdef) state :runner c nil))
+      (steal state :runner c))))
+
 (defn handle-access [state side cards]
   (swap! state assoc :access true)
   (doseq [c cards]
@@ -806,33 +818,36 @@
     (let [cdef (card-def c)
           c (assoc c :seen true)]
       (when-let [name (:title c)]
-        (when-let [access-effect (:access cdef)]
-          (resolve-ability state (to-keyword (:side c)) access-effect c nil))
-        (trigger-event state side :access c)
-        (when (not= (:zone c) [:discard])
-          (trigger-event state side :pre-trash c)
-          (if-let [trash-cost (trash-cost state side c)]
-            (let [card (assoc c :seen true)]
-              (optional-ability state :runner card (str "Pay " trash-cost "[Credits] to trash " name "?")
-                                {:cost [:credit trash-cost]
-                                 :effect (effect (trash card)
-                                                 (system-msg (str "pays " trash-cost " [Credits] to trash "
-                                                                  (:title card))))} nil))
-            (when-not (= (:type c) "Agenda")
-              (prompt! state :runner c (str "You accessed " (:title c)) ["OK"] {}))))
-        (when (= (:type c) "Agenda")
-          (trigger-event state side :pre-steal-cost c)
-          (if (not (get-in @state [:runner :register :cannot-steal]))
-            (let [cost (steal-cost state side c)]
-              (if (pos? (count cost))
-                (optional-ability state :runner c (str "Pay " (costs-to-symbol cost) " to steal " name "?")
-                                  {:cost cost
-                                   :effect (effect (system-msg (str "pays " (costs-to-symbol cost)
-                                                                    " to steal " (:title c)))
-                                                   (steal c))} nil)
-                (when (or (not (:steal-req cdef)) ((:steal-req cdef) state :runner c nil))
-                  (steal state :runner c))))
-            (prompt! state :runner c (str "You accessed but cannot steal " (:title c)) ["OK"] {})))))))
+        (if (= (:type c) "Agenda")
+          (do (trigger-event state side :pre-steal-cost c)
+              (if (not (get-in @state [:runner :register :cannot-steal]))
+                (let [cost (steal-cost state side c)]
+                  (if (pos? (count cost))
+                    (optional-ability state :runner c (str "Pay " (costs-to-symbol cost) " to steal " name "?")
+                                      {:cost cost
+                                       :effect (effect (system-msg (str "pays " (costs-to-symbol cost)
+                                                                        " to steal " (:title c)))
+                                                       (resolve-steal c))} nil)
+                    (resolve-ability state :runner
+                                     {:prompt (str "You access " (:title c)) :choices ["Steal"]
+                                      :effect (req (resolve-steal state :runner c))} c nil)))
+                (do (when-let [access-effect (:access cdef)]
+                      (resolve-ability state (to-keyword (:side c)) access-effect c nil))
+                    (trigger-event state side :access c)
+                    (prompt! state :runner c (str "You accessed but cannot steal " (:title c)) ["OK"] {}))))
+        (do (when-let [access-effect (:access cdef)]
+              (resolve-ability state (to-keyword (:side c)) access-effect c nil))
+            (trigger-event state side :access c)
+            (trigger-event state side :pre-trash c)
+            (when (not= (:zone c) [:discard])
+              (if-let [trash-cost (trash-cost state side c)]
+                (let [card (assoc c :seen true)]
+                  (optional-ability state :runner card (str "Pay " trash-cost "[Credits] to trash " name "?")
+                                    {:cost [:credit trash-cost]
+                                     :effect (effect (trash card)
+                                                     (system-msg (str "pays " trash-cost " [Credits] to trash "
+                                                                      (:title card))))} nil))
+                (prompt! state :runner c (str "You accessed " (:title c)) ["OK"] {})))))))))

 (defn max-access [state side n]
   (swap! state assoc-in [:run :max-access] n))


Actually delete the jar from the db.

Actually delete the jar from the db.

--- src/clojars/admin.clj
+++ src/clojars/admin.clj
@@ -52,7 +52,7 @@
         (fn []
           (println "Deleting" pretty-coords)
           (repo->backup [group-id jar-id version])
-          #_(apply db/delete-jars coords)))
+          (apply db/delete-jars coords)))
       (println "No artifacts found under" group-id jar-id version))))

 (defn init []


proper pluralization

proper pluralization

--- frontend/components/build_head.cljs
+++ frontend/components/build_head.cljs
@@ -14,6 +14,7 @@
             [frontend.utils.vcs-url :as vcs-url]
             [goog.string :as gstring]
             [goog.string.format]
+            [inflections.core :refer (pluralize)]
             [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true])
   (:require-macros [frontend.utils :refer [html]]))
@@ -245,11 +246,9 @@
               (tests-ad owner)
               [:div.build-tests-info
                [:div.build-tests-summary
-                (str "Your build ran " (count tests) " tests in "
+                (str "Your build ran " (pluralize (count tests) "test") " in "
                      (string/join ", " (map test-model/pretty-source sources))
-                     " with ")
-                [:span.failed-count (str (count failed-tests))]
-                " failures."]
+                     " with " (pluralize (count failed-tests) "failure") ".")]
                (when (seq failed-tests)
                  (for [[source tests] (group-by :source failed-tests)]
                    [:div.build-tests-list-container


add configurable screenshots to aid debugging

--- src/crison/core.clj
+++ src/crison/core.clj
@@ -10,6 +10,7 @@

 (System/setProperty "phantomjs.binary.path" (env :phantom-path))

+(def ^:dynamic *crison-file*)
 (def ^:dynamic *input-dir*)
 (def ^:dynamic *output-dir*)

@@ -20,6 +21,13 @@
   (let [nlocal (t/to-time-zone (t/now) (t/time-zone-for-offset -0))]
     (f/unparse (f/formatter-local "yyyy-MM-dd_hh:mm")
                nlocal)))
+
+(defn screenshot
+  ([name]
+   (let [nm (if name (str "-" name) "")
+         s-file (str *output-dir* "/" (date) "_" (.getName *crison-file*) "-screenshot" nm ".png")]
+      (wc/get-screenshot driver :file s-file)))
+  ([] (screenshot nil)))

 (defn title [] (wc/title driver))

@@ -34,40 +42,38 @@

 (defmulti decode (fn[x] (ffirst x)))

-(defmethod decode :url! [x] (go (:url! x)))
+(defmethod decode :url! [x] (go (:url! x)) (screenshot (:screenshot x)))

 (defmethod decode :click! [x]
   (let [e (:click! x)]
     (if (string? e)
       (-> driver (wc/find-element {:id e}) wc/click)
       (-> driver (wc/find-element e) wc/click))
-    (Thread/sleep 2000)))
+    (Thread/sleep 2000)
+    (screenshot (:screenshot x))))

-(defmethod decode :submit! [{:keys [submit!]}]
+(defmethod decode :submit! [{:keys [submit!] :as x}]
   (let [input (first submit!)
         v (:text! input)
         srch (dissoc input :text!)]
         (-> driver (wc/find-element srch) (wc/input-text v))
-        (-> driver (wc/find-element (last submit!)) wc/click)))
+        (-> driver (wc/find-element (last submit!)) wc/click)
+        (screenshot (:screenshot x))))

 (defmethod decode :search! [x]
-  (wf/quick-fill-submit driver (:search! x)) (Thread/sleep 2000))
+  (wf/quick-fill-submit driver (:search! x)) (Thread/sleep 2000) (screenshot (:screenshot x)))

 (defmethod decode :title [x] (title? (:title x)))

 (defmethod decode :default [x] (? x))

-(defn take-screenshot
-  [driver f]
-  (let [s-file (str *output-dir* "/" (date) "_" (.getName f) "-screenshot.png")]
-    (wc/get-screenshot driver :file s-file)))
-
 (deftest tests
   (wc/resize driver {:width 1024 :height 800})
   (let [fs (do/filter-exts (file-seq (file *input-dir*)) ["csn"])]
     (doseq [f fs]
-      (doseq [t (read-string (slurp f))] (decode t))
-      (take-screenshot driver f))))
+      (binding [*crison-file* f]
+        (doseq [t (read-string (slurp f))] (decode t))
+        (screenshot)))))

 (defn drive [input-d output-d]
   (binding [*input-dir* input-d


tighten up pixi terminology

tighten up pixi terminology

--- src/voke/pixi.cljs
+++ src/voke/pixi.cljs
@@ -28,14 +28,14 @@
     (.beginFill color)
     (.drawRect 0 0 w h)
     (.endFill))
-  (let [graphics-data (aget @graphics "graphicsData")
-        obj (aget graphics-data
-                  (- (.-length graphics-data)
+  (let [graphics-data-list (aget @graphics "graphicsData")
+        graphics-data (aget graphics-data-list
+                  (- (.-length graphics-data-list)
                      1))]
-    (doto (aget obj "shape")
+    (doto (aget graphics-data "shape")
       (aset "x" (- x (/ w 2)))
       (aset "y" (- y (/ h 2))))
-    obj))
+    graphics-data))

 (sm/defn entity->graphics-data!
   [entity :- Entity]
@@ -62,12 +62,12 @@

 (defn remove-entity!
   [entity-id]
-  (let [obj (@graphics-data-by-entity-id entity-id)
-        graphics-data (aget @graphics "graphicsData")
-        index (.indexOf graphics-data obj)]
+  (let [graphics-data (@graphics-data-by-entity-id entity-id)
+        graphics-data-list (aget @graphics "graphicsData")
+        index (.indexOf graphics-data-list graphics-data)]

-    (.splice graphics-data index 1)
-    (.destroy obj)))
+    (.splice graphics-data-list index 1)
+    (.destroy graphics-data)))

 (defn render! [entities]
   (handle-unknown-entities! (filter


CMR-7028: Updated jackson-dataformat (#1156)

--- search-app/project.clj
+++ search-app/project.clj
@@ -4,6 +4,7 @@
   :exclusions [cheshire
                clj-time
                com.fasterxml.jackson.core/jackson-core
+               com.fasterxml.jackson.dataformat/jackson-dataformat-cbor
                commons-codec
                org.apache.httpcomponents/httpclient
                org.clojure/clojure
@@ -16,6 +17,7 @@
                  [com.fasterxml.jackson.core/jackson-annotations "2.12.0"]
                  [com.fasterxml.jackson.core/jackson-core "2.12.0"]
                  [com.fasterxml.jackson.core/jackson-databind "2.12.0"]
+                 [com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.12.1"]
                  [commons-codec/commons-codec "1.11"]
                  [commons-io/commons-io "2.6"]
                  [gov.nasa.earthdata/cmr-site-templates "0.1.1-SNAPSHOT"]


Add filterapply

Add filterapply

--- src/deepfns/core.cljc
+++ src/deepfns/core.cljc
@@ -99,7 +99,9 @@
      (mapcat #(apply map (partial deepfapply %) m ms) fs))))

 (defn- group-keys [ms k]
-  (vals (map #(find % k) ms)))
+  (let [matches (map #(find % k) ms)]
+    (when-not (every? nil? matches)
+        (vals matches))))

 (defn- assc-fapply
   ([fs m]
@@ -185,7 +187,7 @@

 (defn deeppure
   "This is a recursive version of pure. It will replace all values in
-   the given type with val. All keys on maps will be preserved."
+   the given type with value. All keys on maps will also be preserved."
   ([m]
    (fn [value]
      (pure m value)))
@@ -195,3 +197,64 @@
      (coll? m) (coll-pure m value)
      :else
      value)))
+
+
+(declare filterapply)
+
+(defn- assc-filterapply
+  ([fs m]
+   (reduce-kv (fn [acc fk f]
+                (if-let [[_ mv] (find m fk)]
+                  (assoc acc fk (filterapply f mv))
+                  acc))
+     {} fs))
+  ([fs m ms]
+   (let [mcoll (cons m ms)]
+     (reduce-kv (fn [acc fk f]
+                  ;; find all the matching keys in mcoll
+                  (if-let [vals (group-keys mcoll fk)]
+                    (assoc acc fk
+                      ;; eval the nested maps and bind them to the output
+                      (apply (partial filterapply f) vals))
+                    acc))
+       {} fs))))
+
+(defn filterapply
+  "The same as deepfapply but keys not in the applicative will not be
+  propagated."
+  ([f]
+   (fn [m & ms]
+     (if ms
+       (filterapply f m ms)
+       (filterapply f m))))
+  ([fs m]
+   (cond
+     ;; map the fn for sequential/set types
+     (list? fs) (lst-fapply fs m)
+     (seq? fs) (seq-fapply fs m)
+     (vector? fs) (vec-fapply fs m)
+     (set? fs) (set-fapply fs m)
+     ;; match keys for maps and if found apply the fn (otherwise
+     ;;  just leave it)
+     (map? fs) (assc-filterapply fs m)
+     ;; base cases:
+     ;; either use the fn
+     (fn? fs) (fs m)
+     :else
+     ;; or wrap list atoms in a constantly
+     ((constantly fs) m)))
+  ([fs m & ms]
+   (let [mcoll (cons m ms)]
+     (cond
+       ;; mapcat all the results for sequential/set types
+       (list? fs) (lst-fapply fs m ms)
+       (seq? fs) (seq-fapply fs m ms)
+       (vector? fs) (vec-fapply fs m ms)
+       (set? fs) (set-fapply fs m ms)
+       ;; match all keys for maps and apply the fn if ther was a match
+       (map? fs) (assc-filterapply fs m ms)
+       ;; apply the fn to the args
+       (fn? fs) (apply fs mcoll)
+       :else
+       ;; list atoms should be constants
+       (map (constantly fs) mcoll)))))


made scripts directory be optional (like it should be)

--- src/duffel/script.clj
+++ src/duffel/script.clj
@@ -3,10 +3,15 @@
     (:require [duffel.fs-util :as dfs-util]))

 (defn exec-script
+    "Runs root-dir/_SCRIPTS/script-name with args. Returns nil if script doesn't
+    actually exist, otherwise returns output from the execution"
     [root-dir script-name & args]
-    (apply dfs-util/exec-in root-dir (str "_SCRIPTS/" script-name) args))
+    (let [script-rel-path (str "_SCRIPTS/" script-name)]
+        (when (dfs-util/exists? (str root-dir "/" script-rel-path))
+            (apply dfs-util/exec-in root-dir script-rel-path args))))

 (defn is-in-group?
     [root-dir group-name]
-    (= "1" (trim
-        (exec-script root-dir "is-in-group" group-name))))
+    (if-let [ret (exec-script root-dir "is-in-group" group-name)]
+        (= "1" (trim ret))
+        false))


Updated some connection pool settings.

Updated some connection pool settings.

--- src/hateoasql/dao.clj
+++ src/hateoasql/dao.clj
@@ -33,7 +33,7 @@
        :subname (str "//" db-host ":" db-port "/" db-name)
        :user db-user
        :password db-password
-       :max-connection-lifetime 50 * 1000
+       :max-connection-lifetime 10 * 1000
        :test-connection-on-borrow true
        :test-idle-connections-period 10 * 1000
        :test-connection-query "SELECT 1"}


two-minute timeouts for node startup

two-minute timeouts for node startup

--- src/jepsen/voltdb.clj
+++ src/jepsen/voltdb.clj
@@ -9,7 +9,7 @@
                     [nemesis      :as nemesis]
                     [net          :as net]
                     [tests        :as tests]
-                    [util         :as util]]
+                    [util         :as util :refer [meh timeout]]]
             [jepsen.os            :as os]
             [jepsen.os.debian     :as debian]
             [jepsen.control.util  :as cu]
@@ -62,7 +62,7 @@
        ; isolated nodes with requests *before* they kill themselves
        ; but low enough that a new majority is elected and performs
        ; some operations.
-       [:heartbeat {:timeout 1}] ; seconds
+       [:heartbeat {:timeout 2}] ; seconds
        [:commandlog {:enabled true, :synchronous true, :logsize 128}
         [:frequency {:time 2}]]]))) ; milliseconds

@@ -102,14 +102,23 @@
   "Blocks until the logfile reports 'Server completed initialization'."
   [node]
   (info "Waiting for" node "to initialize")
-  (c/sudo username
-          (c/cd base-dir
-                ; hack hack hack
-                (Thread/sleep 5000)
-                (c/exec :tail :-n 1 :-f "log/volt.log"
-                        | :grep :-m 1 "completed initialization"
-                        | :xargs (c/lit "echo \"\" >> log/volt.log \\;")))
-          (info node "initialized")))
+  (timeout 120000
+           (throw (RuntimeException.
+                    (str node " failed to initialize in time; STDOUT:\n\n"
+                         (meh (c/exec :tail :-n 10
+                                      (str base-dir "/log/stdout.log")))
+                         "\n\nLOG:\n\n"
+                         (meh (c/exec :tail :-n 10
+                                      (str base-dir "/log/volt.log")))
+                         "\n\n")))
+           (c/sudo username
+                   (c/cd base-dir
+                         ; hack hack hack
+                         (Thread/sleep 5000)
+                         (c/exec :tail :-n 1 :-f "log/volt.log"
+                                 | :grep :-m 1 "completed initialization"
+                                 | :xargs (c/lit "echo \"\" >> log/volt.log \\;")))
+                   (info node "initialized"))))

 (defn await-rejoin
   "Blocks until the logfile reports 'Node rejoin completed'"


get rid of useless variables and use em instead

--- frontend/components/landing_b.cljs
+++ frontend/components/landing_b.cljs
@@ -162,7 +162,7 @@
                                                                                :path (auth-url)}])}
                  "Log In"]
                 [:a.logo-circleci {:href "/"}
-                 circle-logo]
+                 [:figure circle-logo]]
                 [:a.action {:href (auth-url)
                             :role "button"
                             :on-click #(put! controls-ch [:track-external-link-clicked {:event "Auth GitHub"


make-feed

make-feed

--- src/feedme.clj
+++ src/feedme.clj
@@ -16,10 +16,14 @@
      :title (.getTitle e)
      :updated (.getUpdatedDate e)}))

+(defn- make-feed [url]
+  (let [url (new URL url)
+        reader (new XmlReader url)
+        input (new SyndFeedInput)]
+    (.build input reader)))
+
 (defn parse [url]
-  (let [url (new URL url)
-        input (new SyndFeedInput)
-        feed (.build input (new XmlReader url))]
+  (let [feed (make-feed url)]
     {
      ; FIXME: This can be probably done nicer with a macro
      :author (.getAuthor feed)


get gui instance from MMStudioMainFrame static method

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

--- acqEngine/src/org/micromanager/mm.clj
+++ acqEngine/src/org/micromanager/mm.clj
@@ -25,7 +25,7 @@
 (defn load-mm
 	([gui] (def mmc (.getMMCore gui)))
 	([]
-		(def gui (MMStudioPlugin/getMMStudioMainFrameInstance))
+		(def gui (MMStudioMainFrame/getInstance))
 		(load-mm gui)))

 (defn log [& x]


Add HTML5 application cache manifest MIME type.

--- ring-core/src/ring/util/mime_type.clj
+++ ring-core/src/ring/util/mime_type.clj
@@ -7,6 +7,7 @@
   {"7z"    "application/x-7z-compressed"
    "aac"   "audio/aac"
    "ai"    "application/postscript"
+   "appcache" "text/cache-manifest"
    "asc"   "text/plain"
    "atom"  "application/atom+xml"
    "avi"   "video/x-msvideo"


Include any non-filename in output

Include any non-filename in output

--- src/atom_finder/questions/superfluous_parens.clj
+++ src/atom_finder/questions/superfluous_parens.clj
@@ -89,8 +89,7 @@
   (->> all-paren-lines
    ;(take 10)
    (mapcat (fn [file-map]
-             (->> [:parens :superfluous-parens :operator-precedence]
-                  (select-keys file-map)
+             (->> (dissoc file-map :file)
                   (map-values-kv (fn [k v] (map #(assoc % :selection k) v)))
                   vals
                   (apply concat)


refactored macro imports to use :use-macros and removed redundant function

--- cljs/src/core.cljs
+++ cljs/src/core.cljs
@@ -15,7 +15,7 @@
 ;; limitations under the License.

 (ns vix.core
-  (:require-macros [vix.macros :as macros])
+  (:use-macros [vix.macros :only [routes]])
   (:require [vix.views.editor :as editor]
             [vix.views.feed :as feed]
             [goog.global :as global]
@@ -56,15 +56,7 @@
   (events/listen @*h*
                  event-type/NAVIGATE
                  (fn [e]
-                   (routes global/document.location.pathname))))
-
-; FIXME: get rid!
-(defn get-feed-from-uri []
-  (let [parts (re-find #"/admin/([^/]+)/(.*?)"
-                       global/document.location.pathname)]
-    ;; TODO: throw error if feed isn't found
-    (when (= 3 (count parts))
-      (nth parts 1))))
+                   (execute-routes! global/document.location.pathname))))

 (defn chop-path [path]
   (rest (string/split path #"/")))
@@ -112,30 +104,29 @@
         false))
     true))

-(defn routes [uri-path]
-  (macros/routes uri-path
-                 ["admin" ""]
-                 (feed/list-feeds)
-                 ["admin" "new-feed"]
-                 (feed/display-new-feed-form)
-                 ["admin" "edit-feed" :language :feed-name]
-                 (feed/display-edit-feed-form (:language params)
-                                              (:feed-name params))
-                 ["admin" :language :feed-name "new"]
-                 (editor/start (:language params)
-                               (:feed-name params)
-                               nil
-                               :new)
-                 ["admin" :language :feed-name "edit" :*]
-                 (editor/start (:language params)
-                               (:feed-name params)
-                               (str "/" (:* params))
-                               :edit)
-                 ["admin" :language :feed-name "overview"]
-                 (feed/list-documents (:language params) (:feed-name params))
-                 :fallback
-                 (navigate-replace-state "" "Vix overview")
-                 ))
+(defn execute-routes! [uri-path]
+  (routes uri-path
+          ["admin" ""]
+          (feed/list-feeds)
+          ["admin" "new-feed"]
+          (feed/display-new-feed-form)
+          ["admin" "edit-feed" :language :feed-name]
+          (feed/display-edit-feed-form (:language params)
+                                       (:feed-name params))
+          ["admin" :language :feed-name "new"]
+          (editor/start (:language params)
+                        (:feed-name params)
+                        nil
+                        :new)
+          ["admin" :language :feed-name "edit" :*]
+          (editor/start (:language params)
+                        (:feed-name params)
+                        (str "/" (:* params))
+                        :edit)
+          ["admin" :language :feed-name "overview"]
+          (feed/list-documents (:language params) (:feed-name params))
+          :fallback
+          (navigate-replace-state "" "Vix overview")))

 (defn navigate [token title]
   (. @*h* (setToken token title)))
@@ -146,4 +137,4 @@
 (defn ^:export start-app [uri-path]
   (start-history!) ; in Chrome this triggers an event,
                    ; leading to a (routes) call
-  (routes uri-path))+  (execute-routes! uri-path))


Minor modifications

Minor modifications

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

--- src/conexp/contrib/algorithms/canonical_base.clj
+++ src/conexp/contrib/algorithms/canonical_base.clj
@@ -17,27 +17,28 @@
 ;;; Computing Implicational Closures

 (defn- add-immediate-elements
-  [implications, ^BitSet initial-set, subset-test]
-  (loop [^BitSet conclusions  initial-set,
-         impls        implications,
+  "Destructs input bitset"
+  [implications, ^BitSet input-set, subset-test]
+  (loop [impls        implications,
          unused-impls (transient [])]
     (if-let [^Implication impl (first impls)]
-      (if (subset-test (.premise impl) initial-set)
-        (recur (do (dobits [x (.conclusion impl)]
-                     (.set conclusions x))
-                   conclusions)
-               (rest impls)
-               unused-impls)
-        (recur conclusions
-               (rest impls)
+      (if (subset-test (.premise impl) input-set)
+        (do (dobits [x (.conclusion impl)]
+              (.set input-set x))
+            (recur (rest impls)
+                   unused-impls))
+        (recur (rest impls)
                (conj! unused-impls impl)))
-      [conclusions, (persistent! unused-impls)])))
+      [input-set, (persistent! unused-impls)])))

 (defn close-under-implications
+  "Yields new bitset that is the closure of the input bitset under the given collection of
+  implications of bitsetsn"
   [implications, ^BitSet set]
-  (loop [set   set,
+  (loop [set   (.clone set),
          impls implications]
-    (let [[new impls] (add-immediate-elements impls (.clone set)
+    (let [[new impls] (add-immediate-elements impls
+                                              (.clone set)
                                               (fn [^BitSet A, ^BitSet B]
                                                 (forall-in-bitset [x A]
                                                   (.get B x))))]


Fix line length

Fix line length

--- src/icecap/rest.clj
+++ src/icecap/rest.clj
@@ -10,7 +10,9 @@
             [taoensso.nippy :as nippy]
             [prone.debug :refer [debug]]
             [prone.middleware :refer [wrap-exceptions]]
-            [ring.middleware.defaults :refer [wrap-defaults api-defaults secure-api-defaults]]
+            [ring.middleware.defaults :refer [wrap-defaults
+                                              api-defaults
+                                              secure-api-defaults]]
             [ring.middleware.format :refer [wrap-restful-format]]
             [ring.middleware.reload :refer [wrap-reload]]))


matcher-combinators: Improve intro to the various types of matcher

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
@@ -8,26 +8,51 @@
 ;;;; ___________________________________________________________________________
 ;;;; --- Notes ----

-;;;; TODO: What is an `equals` matcher?
-;;;; TODO: What is an `embeds` matcher?
-
 ;;;; ++use-of-mismatch++
 ;;;; We use `m/mismatch` to demo what would otherwise be failing tests.
 ;;;; Note that `m/mismatch` should generally be avoided.

 ;;;; ___________________________________________________________________________
-;;;; ---- An introduction to the different types of matcher ----
-
-(deftest explicit-use-of-default-matchers-test
-  (testing "Some examples that I think are never needed -- these are the defaults for the data types (TODO: Are there contexts where you would need these?)"
-    (is (match? (m/equals 37)
-                (+ 29 8)))
-    (is (match? (m/regex #"fox")
-                "The quick brown fox jumps over the lazy dog"))
-    (is (match? (m/pred even?)
-                1234))
-    (is (match? (m/embeds {:a 1})
-                {:a 1 :b 2}))))
+;;;; ---- An introduction to the various types of matcher ----
+
+(deftest intro-to-various-types-of-matcher-test
+
+  ;; There are various types of matcher:
+  ;; - equals -- Actual and expected must closely match (as defined later).
+  ;; - embeds -- eg For maps, not all keys of actual have to be present in
+  ;;             expected.
+  ;; - regex
+  ;; - pred.
+
+  (testing "Each Clojure data type has an associated matcher by default"
+
+    (testing "Implicit use of default matchers"
+      (is (match? 37 ; uses an equals matcher
+                  (+ 29 8)))
+      (is (match? [1 2 3] ; uses an equals matcher
+                  (map inc (range 3))))
+      (is (match? {:a 1} ; uses an embeds matcher
+                  {:a 1 :b 2}))
+      (is (match? #"fox" ; uses a regex match?
+                  "The quick brown fox jumps over the lazy dog"))
+      (is (match? even? ; uses a pred matcher
+                  1234)))
+
+    (testing "Unnecessary explicit use of default matchers"
+      ;; These are equivalent to the above tests that use default matchers.
+      (is (match? (m/equals 37) ; unnecessary -- don't copy
+                  37))
+      (is (match? (m/equals [1 2 3]) ; unnecessary -- don't copy
+                  [1 2 3]))
+      (is (match? (m/embeds {:a 1}) ; unnecessary -- don't copy
+                  {:a 1 :b 2}))
+      (is (match? (m/regex #"fox") ; unnecessary -- don't copy
+                  "The quick brown fox jumps over the lazy dog"))
+      (is (match? (m/pred even?) ; unnecessary -- don't copy
+                  1234)))))
+
+;;;; Now that we've introduced the various types of matcher, let's get
+;;;; into more detail.

 ;;;; ___________________________________________________________________________
 ;;;; ---- Scalars ----
@@ -142,6 +167,12 @@
                :c :this-is-all-very-cool})))

 ;;;; ___________________________________________________________________________
+;;;; ---- A deeper explanation of the various types of matcher ----
+
+;;;; TODO: What is an `equals` matcher?
+;;;; TODO: What is an `embeds` matcher?
+
+;;;; ___________________________________________________________________________
 ;;;; ---- Explicit matchers ----

 (deftest explicit-use-of-equals-test


photo tags

photo tags

--- rn-app/src/cljs/meo/ui/photos.cljs
+++ rn-app/src/cljs/meo/ui/photos.cljs
@@ -28,7 +28,8 @@
                                        :longitude lon
                                        :location  loc
                                        :md        ""
-                                       :tags      #{}
+                                       :tags      #{"#import"}
+                                       :perm_tags #{"#photo"}
                                        :mentions  #{}
                                        :media     (dissoc node :location)
                                        :img_file  filename


Remove temp

Remove temp

Former-commit-id: 2a9d6df8d936e3da0e645debbf00b449ccd9ac57

--- src/syng_im/components/chats/chat_list_item.cljs
+++ src/syng_im/components/chats/chat_list_item.cljs
@@ -19,8 +19,7 @@
                                                :delivery-status    :seen
                                                :new-messages-count 3
                                                :timestamp          "13:54"
-                                               :online             true
-                                               :group-chat         false})]]])
+                                               :online             true})]]])

 (comment [view {:style {:flexDirection  "row"
                         :width          260


Added a bit to the demo

Added a bit to the demo

Added a bit to the demo

--- src/webapp/framework/client/components/main.cljs
+++ src/webapp/framework/client/components/main.cljs
@@ -24,6 +24,15 @@
                                         (container
                                             (inline  "10%" (str (<-- :id)))
                                             (inline  "90%" (str (<-- :item)))))
+
+                              (div {:style {:height "30px"}})
+
+                              (select id, user_name from users where user_name like '%'
+                                  {}
+                                      (container
+                                        (inline  "10%" (str (<-- :id)))
+                                        (inline  "90%" (str (<-- :user_name)))))
+
                                 "Build database webapps with Clojure"))


Continued adjustment of complexity for starfield.

--- spectacles/src/spectacles/starfield.clj
+++ spectacles/src/spectacles/starfield.clj
@@ -27,7 +27,7 @@
 (def frame_rate 60)
 (def over_sampling 2) ; This affects the smoothing.  0 will remove smoothing.
 (def reduction 2) ; Change this to modify the scaling.
-(def chance_of_new_line 0.30)
+(def chance_of_new_line 0.60)
 (def wiggle 5) ; Maximum distance the origin can move
 (def degrees_in_circle 360)


fix link to early access

fix link to early access

--- src-cljs/frontend/components/outer.cljs
+++ src-cljs/frontend/components/outer.cljs
@@ -266,7 +266,7 @@
                 "by default and shared with your teammates."]]
               [:div.price-foot
                [:a.price-button
-                {:href "/early-access/team"
+                {:href "/trial/team"
                  :title "Start trial"
                  :role "button"}
                 "Start trial"]]]


CMR-5090, CMR-5241, CMR-5240: update preview gem

--- collection-renderer-lib/project.clj
+++ collection-renderer-lib/project.clj
@@ -14,7 +14,7 @@
    the hardcoded commit id during dev integration with cmr_metadata_preview project.
    The hardcoded commit id should be updated when MMT releases a new version of the gem."
   (or (System/getenv "CMR_METADATA_PREVIEW_COMMIT")
-      "64ae79b9895"))
+      "dcdf307e10d"))

 (def gem-install-path
   "The directory within this library where Ruby gems are installed."


update

update

--- src/panpan/hestia.clj
+++ src/panpan/hestia.clj
@@ -74,15 +74,15 @@
     (fn [& _] "8256158"))) ; }}}

 (defn hestia-handler
-  "^(.+?)\\s*(を)?(開始|始め|はじめ)     - toggl開始
-   ^(再開|さいかい)                     - toggl再開
-   ^(終了|終わった|おわった|おわた)     - toggl停止
-   ^(神様|神さま).*違(い|う)            - toggl削除
-   ^(神様|神さま).*(休憩|一休み)        - toggl休憩エントリー開始
+  "^(.+?).*(を)?(開始|始め|はじめ)           - toggl開始
+   ^(再開|さいかい)                          - toggl再開
+   ^(終了|終わった|おわった|おわた)          - toggl停止
+   ^(神様|神さま).*(違い|違う|消して|けして) - toggl削除
+   ^(神様|神さま).*(休憩|一休み)             - toggl休憩エントリー開始
   "
   [{:keys [user] :as arg}]
   (jh/regexp arg
-    #"^(.+?)\s*(を)?(開始|始め|はじめ)"
+    #"^(.+?).*(を)?(開始|始め|はじめ)"
     (matchfn [desc]
       (toggl/start-entry desc :pid (desc->pid desc))
       (->> MESSAGES :start-entry rand-nth (out "@" user " ")))
@@ -96,7 +96,7 @@
     (matchfn []
       (when (toggl/stop-entry)
         (->> MESSAGES :stop-entry rand-nth (out "@" user " "))))
-    #"^(神様|神さま).*違(い|う)"
+    #"^(神様|神さま).*(違い|違う|消して|けして)"
     (matchfn []
       (let [key (if (toggl/delete-entry) :delete-entry :no-entry-to-delete)]
         (->> MESSAGES


adding timeout for setup latencies

adding timeout for setup latencies

--- sidecar/src/figwheel_sidecar/repl.clj
+++ sidecar/src/figwheel_sidecar/repl.clj
@@ -35,7 +35,8 @@
   cljs.repl/IJavaScriptEnv
   (-setup [this opts]
     (add-repl-print-callback! figwheel-server)
-    (wait-for-connection figwheel-server))
+    (wait-for-connection figwheel-server)
+    (Thread/sleep 500)) ;; just to help with setup latencies
   (-evaluate [_ _ _ js]
     (wait-for-connection figwheel-server)
     (eval-js figwheel-server js))


Add :on-dispose

Add :on-dispose

--- src/play_clj/core.clj
+++ src/play_clj/core.clj
@@ -63,7 +63,8 @@

 (defn defscreen*
   [screen entities
-   {:keys [on-show on-render on-hide on-pause on-resize on-resume on-timer]
+   {:keys [on-show on-render on-hide on-pause
+           on-resize on-resume on-dispose on-timer]
     :as options}]
   (let [execute-fn! (fn [func & {:keys [] :as options}]
                       (when func
@@ -92,6 +93,7 @@
                          [:total-time 0
                           :execute-fn! execute-fn!
                           :update-fn! update-fn!
+                          :options options
                           :on-timer on-timer
                           :input-listeners (input-listeners options execute-fn!)
                           :ui-listeners (ui-listeners options execute-fn!)])
@@ -109,7 +111,8 @@
      :resize (fn [w h]
                (execute-fn! on-resize :width w :height h)
                (update-screen! @screen))
-     :resume #(execute-fn! on-resume)}))
+     :resume #(execute-fn! on-resume)
+     :dispose #(execute-fn! on-dispose)}))

 (defmacro defscreen
   "Defines a screen, and creates vars for all the functions inside of it. All
@@ -505,6 +508,7 @@
   (let [run-fn! (fn [k & args]
                   (doseq [screen screen-objects]
                     (apply (get screen k) args)))]
+    (some-> game-object .getScreen .dispose)
     (.setScreen game-object
       (reify Screen
         (show [this]
@@ -518,7 +522,7 @@
         (pause [this] (run-fn! :pause))
         (resize [this w h] (run-fn! :resize w h))
         (resume [this] (run-fn! :resume))
-        (dispose [this])))))
+        (dispose [this] (run-fn! :dispose))))))

 (defn set-screen-wrapper!
   "Sets a function that wraps around all screen functions, allowing you to


fix macro bug

fix macro bug

--- src/seathree/data.clj
+++ src/seathree/data.clj
@@ -10,7 +10,7 @@
 (def stale (time/minutes 5))

 (defmacro redis [cfg & body]
-  `(wcar {:pool {} :spec (select-keys (:redis cfg) [:host :port])}
+  `(wcar {:pool {} :spec (select-keys (:redis ~cfg) [:host :port])}
          ~@body))

 (defn process-failed? [result] (> (:exit result) 0))


CMR-6745: Updated unit test.

CMR-6745: Updated unit test.

--- search-app/test/cmr/search/test/services/query_execution/granule_counts_results_feature.clj
+++ search-app/test/cmr/search/test/services/query_execution/granule_counts_results_feature.clj
@@ -56,8 +56,8 @@
               2 (and-conds
                  (cqm/string-conditions :collection-concept-id ["C1-PROV1" "C2-PROV1"] true)
                  (spatial-cond 1)
+                 (spatial-cond 2)
                  (not-limit-to-granules (temporal-cond 1))
-                 (spatial-cond 2)
                  (not-limit-to-granules (temporal-cond 2))))
              (gcrf/extract-granule-count-query context coll-query results)))))
   (testing "spatial and temporal query with no results"


Fix displayed query

Fix displayed query

--- src/cljs/cglossa/search_inputs/cwb.cljs
+++ src/cljs/cglossa/search_inputs/cwb.cljs
@@ -104,7 +104,12 @@

 (defn- simple [query-cursor show-remove-btn? remove-query-handler]
   (let [query           (:query @query-cursor)
-        displayed-query (str/replace query #"\[\(?\w+=\"(.+?)\"(?:\s+%c)?\)?\]" "$1")
+        displayed-query (-> query
+                            (->non-headword-query)
+                            (str/replace #"\[\(?\w+=\"(.*?)\"(?:\s+%c)?\)?\]" "$1")
+                            (str/replace #"\"([^\s=]+)\"" "$1")
+                            (str/replace #"\s*\[\]\s*" " .* ")
+                            (str/replace #"^\.\*$" ""))
         phonetic?       (not= -1 (.indexOf query "phon="))]
     [:form {:style {:display "table" :margin-left -30 :margin-bottom 20}}
      [:div {:style {:display "table-row" :margin-bottom 10}}


get fullscreen button working

get fullscreen button working

--- src/cljs/infinitelives/pixi/canvas.cljs
+++ src/cljs/infinitelives/pixi/canvas.cljs
@@ -262,17 +262,17 @@
                               (.mozRequestFullScreen canvas))

                             (cond
-                              (.-exitFullscreen document)
-                              (.exitFullscreen document)
-
-                              (.-webkitExitFullscreen document)
-                              (.webkitExitFullscreen document)
-
-                              (.-msExitFullscreen document)
-                              (.msExitFullscreen document)
-
-                              (.-mozCancelFullScreen document)
-                              (.mozCancelFullScreen document))))
+                              (.-exitFullscreen js/document)
+                              (.exitFullscreen js/document)
+
+                              (.-webkitExitFullscreen js/document)
+                              (.webkitExitFullscreen js/document)
+
+                              (.-msExitFullscreen js/document)
+                              (.msExitFullscreen js/document)
+
+                              (.-mozCancelFullScreen js/document)
+                              (.mozCancelFullScreen js/document))))

           resizer-loop
           (when (:expand opts) (let [c (events/new-resize-chan)]
@@ -288,23 +288,30 @@

       (render)

+      (fullscreen-fn)
+
       (let [canvas (into
                     world
                     {
                      :render-fn render-fn
                      :resize-fn resize-fn
+                     :fullscreen-fn fullscreen-fn
                      :expand-fn expand-fn})]
         (set-default-once! canvas)
         canvas))))

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


Remove unused functions

Remove unused functions

--- src/cljs/love_letter_cljs/handlers.cljs
+++ src/cljs/love_letter_cljs/handlers.cljs
@@ -125,9 +125,6 @@
            (start-next-turn))
        d))))

-(defn update-game [db game]
-  (merge db game))
-
 (defn resolve-effect [db]
   (let [{:keys [card-target active-card guard-guess]} db
         game db


show actions menu only with actions

show actions menu only with actions

--- src/cljs/swarmpit/component/header.cljs
+++ src/cljs/swarmpit/component/header.cljs
@@ -182,11 +182,12 @@
                     {:aria-haspopup "true"
                      :onClick       #(state/update-value [:mobileSearchOpened] true state/layout-cursor)
                      :color         "inherit"} icon/search))
-                (comp/icon-button
-                  {:aria-haspopup "true"
-                   :onClick       (fn [e]
-                                    (state/update-value [:mobileMoreAnchorEl] (.-currentTarget e) state/layout-cursor))
-                   :color         "inherit"} icon/more)])
+                (when (some? actions)
+                  (comp/icon-button
+                    {:aria-haspopup "true"
+                     :onClick       (fn [e]
+                                      (state/update-value [:mobileMoreAnchorEl] (.-currentTarget e) state/layout-cursor))
+                     :color         "inherit"} icon/more))])
              (user-menu menuAnchorEl)))
          (mobile-actions-menu actions mobileMoreAnchorEl)
          (mobile-search search-fn mobileSearchOpened)]))))


Printing configuration

Printing configuration

--- src/cloverage_jenkins_reporter/core.clj
+++ src/cloverage_jenkins_reporter/core.clj
@@ -1,7 +1,7 @@
 ;;;
 ;;;   Statistic about code coverage measured by Cloverage reporter.
 ;;;
-;;; Copyright (c) 2015  Pavel Tisnovsky, Red Hat
+;;; Copyright (c) 2015, 2016  Pavel Tisnovsky, Red Hat
 ;;; All rights reserved.
 ;;;
 ;;; Redistribution and use in source and binary forms, with or without
@@ -32,8 +32,9 @@
 (require '[cloverage-jenkins-reporter.config :as config])

 (defn -main
-    "I don't do a whole lot ... yet."
+    "Entry point to this tool, started by a shell script or from the Leiningen."
     [& args]
     (config/load-configuration "config.cfg")
+    (config/print-configuration)
     (println "Hello, World!"))


Tweak doc strings

Tweak doc strings

--- src/such/readable.clj
+++ src/such/readable.clj
@@ -20,7 +20,7 @@

 (defn set-function-elaborations!
   "Control the way functions are prettified. Note: this does not override
-   any value set in `with-function-elaborations`.
+   any value changed with `with-function-elaborations`.

          (set-function-elaborations! {:anonymous-name 'anon :surroundings \"\"})
 "
@@ -28,7 +28,8 @@
   (alter-var-root #'*function-elaborations* (constantly all)))

 (defmacro with-function-elaborations
-  "Change the function elaborations, execute the body, and revert the elaborations.
+  "Change the function elaborations, execute the body, and revert the
+   elaborations.

         (with-function-elaborations {:anonymous-name 'fun :surroundings \"{{}}\"}
           (fn-symbol (fn []))) => {{fun}}


Removing normalize functions and expand function, making `a` a const inplace of a keyword

--- src/org/libraryweasel/ligature/core.clj
+++ src/org/libraryweasel/ligature/core.clj
@@ -8,6 +8,8 @@

 (ns org.libraryweasel.ligature.core
   (:require [clojure.spec.alpha :as s]))
+
+(def ^:const a "http://www.w3.org/1999/02/22-rdf-syntax-ns#type")

 (defprotocol LigatureStore
   "A Store manages many named Collections."
@@ -114,9 +116,7 @@
 (defn predicate?
   "Accepts a String representing a predicate and returns true or false depending on if it is valid."
   [predicate]
-  (or
-   (identifier? predicate)
-   (= :a predicate)))
+  (identifier? predicate))

 (defn object?
   "Accepts a String or Map representing an object and returns true or false depending on if it is valid."
@@ -150,31 +150,6 @@
   [statement]
   (get statement 3))

-(defn- expand-predicate
-  [predicate]
-  (if (= predicate :a) "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" predicate))
-
-(defn normalize-statement
-  "This function acts as a helper function for working with Statements.
-  This function validates Statements,
-  allows users to shortcut :a for http://www.w3.org/1999/02/22-rdf-syntax-ns#type in the predicate position,
-  and sets the graph position to :default if it is missing."
-  [statement]
-   (if (s/valid? ::statement statement)
-     (if (= (count statement) 3)
-       [(subject statement) (expand-predicate (predicate statement)) (object statement) :default]
-       [(subject statement) (expand-predicate (predicate statement)) (object statement) (graph statement)])
-     (throw (ex-info "Invalid statement." (s/explain ::statement statement)))))
-
-(defn normalize-rule
-  "This function acts as a helper function for working with Rules.
-  This function validates Rules
-  and allows users to shortcut :a for http://www.w3.org/1999/02/22-rdf-syntax-ns#type in the predicate position."
-  [rule]
-   (if (s/valid? ::rule rule)
-    [(subject rule) (expand-predicate (predicate rule)) (object rule)]
-    (throw (ex-info "Invalid statement." (s/explain ::rule rule)))))
-
 (s/def ::literal literal?)

 (s/def ::plain-literal plain-literal?)


human input and submit added

human input and submit added

--- src/webdriver/new.clj
+++ src/webdriver/new.clj
@@ -437,7 +437,7 @@

 (defmulti get-element-location* dispatch-driver)

-(defmethods get-element-location-el
+(defmethods get-element-location*
   [:chrome :phantom :safari]
   [driver el]
   (with-resp driver :get
@@ -980,9 +980,12 @@
 ;;

 (defn fill* [driver el text]
-  (with-resp driver :post
-    [:session (:session @driver) :element el :value]
-    {:value (vec text)} _))
+  (let [keys (if (char? text)
+               (str text)
+               text)]
+    (with-resp driver :post
+      [:session (:session @driver) :element el :value]
+      {:value (vec keys)} _)))

 (defn fill [driver q text]
   (fill* driver (find driver q) text))
@@ -991,6 +994,9 @@
 ;; submit
 ;;

+(defn submit [driver q]
+  (fill driver q keys/enter))
+
 ;;
 ;; forms
 ;;
@@ -998,6 +1004,24 @@
 ;;
 ;; human actions
 ;;
+
+(defn fill-human* [driver el text]
+  (let [mistake-prob 0.1
+        pause-max 0.2
+        rand-char #(-> 26 rand-int (+ 97) char)
+        wait-key #(let [r (rand)]
+                    (wait (if (> r pause-max) pause-max r)))]
+    (doseq [key text]
+      (when (< (rand) mistake-prob)
+        (fill* driver el (rand-char))
+        (wait-key)
+        (fill* driver el keys/backspace)
+        (wait-key))
+      (fill* driver el key)
+      (wait-key))))
+
+(defn fill-human [driver q text]
+  (fill-human* driver (find driver q) text))

 ;;
 ;; screenshot


ui-v2 Remove extra top-nav

ui-v2 Remove extra top-nav

--- src-cljs/frontend/components/app.cljs
+++ src-cljs/frontend/components/app.cljs
@@ -149,9 +149,6 @@
                  ;;     expanding all datastructures.
                  (om/build inspector/inspector app))

-               (when (and inner? logged-in? (feature/enabled? :ui-v2))
-                 (om/build top-nav/top-nav app-without-container-data))
-
                (when (and (feature/enabled? :ui-v2))
                  (om/build header/header app-without-container-data))


Remove pmap due to db/thread problem.

Remove pmap due to db/thread problem.

--- src/cavm/h2.clj
+++ src/cavm/h2.clj
@@ -579,13 +579,13 @@
                   :insert-code code-stmt
                   :insert-gene gene-stmt}
           inserts (apply concat
-                         (chunked-pmap #(load-field-feature
-                                          feature-seq
-                                          field-seq
-                                          scores-seq
-                                          dataset-id
-                                          %)
-                                       (:fields (matrix-fn))))]
+                         (map #(load-field-feature
+                                 feature-seq
+                                 field-seq ; XXX pmap loses our db connection
+                                 scores-seq
+                                 dataset-id
+                                 %)
+                              (:fields (matrix-fn))))]

       (doseq [insert-batch (partition-all batch-size inserts)]
         (jdbc/transaction


Refactor dimensions as app state instead of local component state.

--- ui/src/ui/core.cljs
+++ ui/src/ui/core.cljs
@@ -22,7 +22,13 @@
                           :timer-ids [{:name "Clean the kitchen"
                                        :id "clean-the-kitchen"}
                                       {:name "Take a bath"
-                                       :id "take-a-bath"}]}))
+                                       :id "take-a-bath"}]
+                          :dimensions {
+                                       :width 500
+                                       :height 500
+                                       :x 250
+                                       :y 250
+                                       :r 200}}))

 (defn pie [x y r fill tenth-degrees]
   (let [points (map #(str (+ x (math/angleDx (/ % 10) r)) "," (+ y (math/angleDy (/ % 10) r)))
@@ -46,7 +52,7 @@
     IWillMount
     (will-mount [_]
       (go-loop []
-        (let [start (om/get-state owner :start)
+        (let [start (time-coerce/to-date (get-in data [:timer :Start]))
               interval-seconds (/ (time/in-millis (time/interval start (time/now))) 1000)]
           (om/update-state! owner :elapsed-minutes #(mod (/ interval-seconds 60) 60)))
         (<! (async/timeout 1000))
@@ -55,15 +61,19 @@
     (init-state [_]
       {:elapsed-minutes 0})
     IRenderState
-    (render-state [_ {x :x y :y r :r min :elapsed-minutes init :initialized}]
-      (pie x y r "#d9d9d9" (* 6 10 min)))))
+    (render-state [owner {min :elapsed-minutes}]
+      (let [{x :x y :y r :r} (:dimensions data)]
+        (pie x y r "#d9d9d9" (* 6 10 min))))))

 (defn timer-hours [data owner]
   (reify
+    IDisplayName
+    (display-name [_]
+      "Hours on the timer")
     IWillMount
     (will-mount [_]
       (go-loop []
-        (let [start (om/get-state owner :start)
+        (let [start (time-coerce/to-date (get-in data [:timer :Start]))
               interval-seconds (/ (time/in-millis (time/interval start (time/now))) 1000)]
           (om/update-state! owner :elapsed-hours #(mod (/ interval-seconds 60 60) 24)))
         (<! (async/timeout 10000))
@@ -72,11 +82,15 @@
     (init-state [_]
       {:elapsed-hours 0})
     IRenderState
-    (render-state [_ {x :x y :y r :r hr :elapsed-hours}]
-      (pie x y (/ r 1.4) "#cccccc" (* 30 10 hr)))))
+    (render-state [owner {hr :elapsed-hours}]
+      (let [{x :x y :y r :r} (:dimensions data)]
+        (pie x y (/ r 1.4) "#cccccc" (* 30 10 hr))))))

 (defn timer-seconds [data owner]
   (reify
+    IDisplayName
+    (display-name [_]
+      "Seconds on the timer")
     IWillMount
     (will-mount [_]
       (go-loop []
@@ -87,16 +101,18 @@
         (recur)))
     IInitState
     (init-state [_]
-      {:elapsed-seconds 0})
+      {:elapsed-seconds 0
+       :start (time-coerce/to-date (get-in data [:timer :Start]))})
     IRenderState
-    (render-state [_ {x :x y :y r :r sec :elapsed-seconds}]
-      (dom/line #js {:x1 (+ x (math/angleDx (* 6 sec) (/ r 1.4)))
-                     :y1 (+ y (math/angleDy (* 6 sec) (/ r 1.4)))
-                     :x2 (+ x (math/angleDx (* 6 sec) r))
-                     :y2 (+ y (math/angleDy (* 6 sec) r))
-                     :style #js {:stroke "#bfbfbf"
-                                 :strokeWidth "4px"}
-                     :transform (str "rotate(-90," x "," y")")}))))
+    (render-state [owner {sec :elapsed-seconds}]
+      (let [{x :x y :y r :r} (:dimensions data)]
+        (dom/line #js {:x1 (+ x (math/angleDx (* 6 sec) (/ r 1.4)))
+                       :y1 (+ y (math/angleDy (* 6 sec) (/ r 1.4)))
+                       :x2 (+ x (math/angleDx (* 6 sec) r))
+                       :y2 (+ y (math/angleDy (* 6 sec) r))
+                       :style #js {:stroke "#bfbfbf"
+                                   :strokeWidth "4px"}
+                       :transform (str "rotate(-90," x "," y")")})))))

 (defn timer-text [data owner]
   (reify
@@ -111,15 +127,16 @@
     IWillMount
     (will-mount [_]
       (go-loop []
-        (let [start (om/get-state owner :start)
+        (let [start (time-coerce/to-date (get-in data [:timer :Start]))
               interval-seconds (/ (time/in-millis (time/interval start (time/now))) 1000)]
           (om/update-state! owner :elapsed-minutes #(mod (/ interval-seconds 60) 60))
           (om/update-state! owner :elapsed-hours #(mod (/ interval-seconds 60 60) 24)))
         (<! (async/timeout 1000))
         (recur)))
     IRenderState
-    (render-state [_ {x :x y :y sec :elapsed-seconds min :elapsed-minutes hr :elapsed-hours}]
-      (let [min-only (= 0 (int hr))]
+    (render-state [_ {min :elapsed-minutes hr :elapsed-hours}]
+      (let [{x :x y :y} (:dimensions data)
+            min-only (= 0 (int hr))]
         (dom/text #js {:x (if min-only
                             (- x 50)
                             (- x 130))
@@ -135,25 +152,18 @@
     IDisplayName
     (display-name [_]
       "The timer")
-    IInitState
-    (init-state [_]
-      {:width 500
-       :height 500
-       :radius 200
-       :x 250
-       :y 250})
-    IRenderState
-    (render-state [_ {w :width h :height x :x y :y r :radius}]
-      (let [start-date (time-coerce/to-date (get-in data [:timer :Start]))
-            timer-dim {:x x :y y :r r :start start-date}]
+    IRender
+    (render [_]
+      (let [cursors (select-keys data [:dimensions :timer])
+            {w :width h :height x :x y :y r :r} (:dimensions cursors)]
         (dom/svg #js {:width w
                       :height h}
                  (circle x y (+ r 20) "green")
                  (circle x y r "white")
-                 (om/build timer-minutes nil {:init-state timer-dim})
-                 (om/build timer-hours nil {:init-state timer-dim})
-                 (om/build timer-seconds nil {:init-state timer-dim})
-                 (om/build timer-text nil {:init-state timer-dim}))))))
+                 (om/build timer-minutes cursors)
+                 (om/build timer-hours cursors)
+                 (om/build timer-seconds cursors)
+                 (om/build timer-text cursors))))))

 (defn menu-view [data owner]
   (reify


Define queries

Define queries

--- fulcro-todo/src/main/app/ui.cljs
+++ fulcro-todo/src/main/app/ui.cljs
@@ -4,6 +4,8 @@
             [fulcro.client.core :as fc]))

 (defui ^:once ItemAdder
+  static om/IQuery
+  (query [this] [:item-adder/input-value])
   static
   fc/InitialAppState
   (initial-state [c params] {:item-adder/input-value ""})
@@ -30,6 +32,8 @@
 (def ui-item-adder (om/factory ItemAdder))

 (defui ^:once Item
+  static om/IQuery
+  (query [this] [:item/added-at :item/text :item/checked?])
   static
   fc/InitialAppState
   (initial-state [c {:keys [added-at text]}] {:item/added-at added-at
@@ -63,9 +67,12 @@
 (def ui-item (om/factory Item))

 (defui ^:once ItemList
+  static om/IQuery
+  (query [this] [:item-list/sort-by-desc-added-at {:item-list/items (om/get-query Item)}])
   static
   fc/InitialAppState
-  (initial-state [c params] {:item-list/items [(fc/get-initial-state Item {:added-at 1508175827181
+  (initial-state [c params] {:item-list/sort-by-desc-added-at true
+                             :item-list/items [(fc/get-initial-state Item {:added-at 1508175827181
                                                                            :text "hello"
                                                                            :checked? false})
                                                (fc/get-initial-state Item {:added-at 1508175970713
@@ -102,15 +109,18 @@
 (def ui-item-list (om/factory ItemList))

 (defui ^:once App
+  static om/IQuery
+  (query [this] [:ui/react-key
+                 {:item-adder (om/get-query ItemAdder)}
+                 {:item-list (om/get-query ItemList)}])
   static
   fc/InitialAppState
-  (initial-state [c params] {:app/item-adder (fc/get-initial-state ItemAdder {})
-                             :app/item-list (fc/get-initial-state ItemList {})})
+  (initial-state [c params] {:item-adder (fc/get-initial-state ItemAdder {})
+                             :item-list (fc/get-initial-state ItemList {})})

   Object
   (render [this]
-          (let [{:keys [ui/react-key]} (om/props this)
-                {:keys [app/item-adder app/item-list]} (fc/get-initial-state App {})]
+          (let [{:keys [ui/react-key item-adder item-list]} (om/props this)]
             (dom/div
              #js {:key react-key
                   :className "app"}


Take spyscope out of lien/profiles

Take spyscope out of lien/profiles

I use it so rarely that it isn't worth coping with its dependencies.

Which is pretty laughable considering some of the other things I have in there,
but it's forward progress.

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -46,10 +46,8 @@
                        ;; This approach is long deprecated.
                        ;; See its README and put it into :aliases insted
                        #_[slamhound "1.5.5"]
-                       [slingshot "0.12.2" :exclusions [org.clojure/clojure]]
-                       [spyscope "0.1.5" :exclusions [clj-time]]]
-        :injections [(require 'spyscope.core)
-                     (require '[vinyasa.inject :as inject])
+                       [slingshot "0.12.2" :exclusions [org.clojure/clojure]]]
+        :injections [(require '[vinyasa.inject :as inject])
                      ;; TODO: call install-pretty-exception
                      #_(require 'io.aviso.repl)
                      (inject/in


Remove lein settings

Remove lein settings

They were far from polished and unused, I might as well start over if I
start using it again.

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -1,2 +0,0 @@
-{:user {:plugins [[com.jakemccrary/lein-test-refresh "0.9.0"]
-                 [lein-autoreload "0.1.0"]]}}


remove reference to clojure.spec.gen (#1545)

--- cimi-resources/src/com/sixsq/slipstream/ssclj/resources/spec/service_attribute_namespace.cljc
+++ cimi-resources/src/com/sixsq/slipstream/ssclj/resources/spec/service_attribute_namespace.cljc
@@ -1,17 +1,16 @@
 (ns com.sixsq.slipstream.ssclj.resources.spec.service-attribute-namespace
   (:require
     [clojure.spec.alpha :as s]
-    [clojure.spec.gen.alpha :as gen]
-    [clojure.string :as str]
     [com.sixsq.slipstream.ssclj.resources.spec.common :as c]
     [com.sixsq.slipstream.ssclj.resources.spec.core :as cimi-core]
     [com.sixsq.slipstream.ssclj.util.spec :as su]))

+
 (def prefix-regex #"^[a-z]([a-z0-9-]*[a-z0-9])?$")
-(def char-prefix (gen/fmap char (s/gen (set (concat (range 97 123) (range 48 58) [45])))))
-(def gen-prefix (gen/fmap str/join (gen/vector char-prefix)))
-(s/def :cimi.service-attribute-namespace/prefix (s/with-gen (s/and string? #(re-matches prefix-regex %))
-                                                            (constantly gen-prefix)))
+
+
+(s/def :cimi.service-attribute-namespace/prefix (s/and string? #(re-matches prefix-regex %)))
+

 (s/def :cimi/service-attribute-namespace
   (su/only-keys-maps c/common-attrs


Remove references to file that isn't in source control

--- src/circle/backend/project/circle.clj
+++ src/circle/backend/project/circle.clj
@@ -2,7 +2,6 @@
   (:require [circle.backend.nodes :as nodes])
   (:require [circle.backend.nodes.circle :as circle])
   (:use [circle.backend.build :only (build extend-group-with-revision)])
-  (:use [circle.backend.action.dns :only (update-record)])
   (:use [circle.backend.action.nodes :only (start-nodes stop-nodes)])
   (:use [circle.backend.action.vcs :only (checkout)])
   (:use [circle.backend.action.bash :only (bash)])


attempt overflow fix

attempt overflow fix

--- src/clj/morpheus/models/edge/base.clj
+++ src/clj/morpheus/models/edge/base.clj
@@ -45,11 +45,10 @@
 (def max-list-size
   (-> (Trunk/getMaxObjSize)
       (- neb-header/cell-head-len)
-      (- type_lengths/cidLen)
       (- type_lengths/intLen)
       (/ type_lengths/cidLen)
       (Math/floor) (int)
-      (dec)))
+      (- 2)))

 (defn extract-edge-cid-list [cid-lists edge-schema-id]
   (first (filter
@@ -131,7 +130,7 @@
   append-cids-to-list* [target-cids]
   (when (not (empty? target-cids))
     (if (< list-length max-list-size)
-      (let [cids-num-to-go (- max-list-size list-length)
+      (let [cids-num-to-go (- max-list-size list-length )
             cids-to-go (take cids-num-to-go target-cids)]
         (neb-cell/update-cell*
           trunk hash


fix indentation

fix indentation

--- src/cljc/commos/delta/compscribe.cljc
+++ src/cljc/commos/delta/compscribe.cljc
@@ -156,7 +156,7 @@
                                          ks
                                          (if-let [nested (get deep-hooks ks)]
                                            (map second nested)))))
-                                        new-val))
+                                   new-val))
                        (conj adjusted-deltas delta)))))
       [subs (delta/pack adjusted-deltas)])))


tolerate wrong page values

tolerate wrong page values

--- src/cljs/omnext_routing_one/core.cljs
+++ src/cljs/omnext_routing_one/core.cljs
@@ -367,9 +367,10 @@
 (defmethod readf :countries
   [{:keys [state] :as env} k {:keys [page] :as params}]
   (println "readf" k params)
+  (let [page (or (cljs.reader/parse-int (:page params)) 1)]
   (if-let [v (get @state k)]
     {:value
-     {:page (or (cljs.reader/parse-int (:page params)) 1)
+     {:page page
       :pages (.ceil js/Math
                     (/ (count v)
                        items-per-page
@@ -386,7 +387,7 @@
       }
      }
     {:value nil}
-    )
+    ))
   )

 (defmulti mutatef om/dispatch)


show evidence info in receive page

show evidence info in receive page

--- src/cljs/salava/badge/ui/receive.cljs
+++ src/cljs/salava/badge/ui/receive.cljs
@@ -1,5 +1,5 @@
 (ns salava.badge.ui.receive
-  (:require [clojure.string :refer [replace upper-case]]
+  (:require [clojure.string :refer [replace upper-case blank? starts-with?]]
             [reagent.core :refer [atom cursor]]
             [reagent.session :as session]
             [reagent-modals.modals :as m]
@@ -16,7 +16,7 @@
             [salava.core.helper :refer [dump]]
             [salava.user.ui.helper :as uh]
             [salava.core.ui.modal :as mo]
-            [salava.core.ui.helper :refer [path-for private? js-navigate-to plugin-fun]]
+            [salava.core.ui.helper :refer [path-for private? js-navigate-to plugin-fun hyperlink]]
             [salava.core.time :refer [date-from-unix-time unix-time]]
             [salava.admin.ui.admintool :refer [admintool]]
             [salava.social.ui.follow :refer [follow-badge]]
@@ -82,7 +82,7 @@
   (let [{:keys [id badge_id email owner? issued_on expires_on assertion_url
                 user-logged-in?
                 evidence_url issued_by_obf verified_by_obf obf_url
-                recipient_count assertion  qr_code owner message_count content issuer-endorsements user_exists?]} @state
+                recipient_count assertion  qr_code owner message_count content issuer-endorsements user_exists? evidences]} @state
         expired?                                                                 (bh/badge-expired? expires_on)
         show-recipient-name-atom                                                 (cursor state [:show_recipient_name])
         selected-language                                                        (cursor state [:content-language])
@@ -184,11 +184,33 @@
              [:a.link {:href criteria_url :target "_blank"} (t :badge/Opencriteriapage) "..."]
              [:div {:dangerouslySetInnerHTML {:__html criteria_content}}]]]

-           (if evidence_url
-             [:div.row
+           (when (not (empty? evidences))
+             [:div.row {:id "badge-settings"}
               [:div.col-md-12
-               [:h2.uppercase-header (t :badge/Evidence)]
-               [:div [:a.link {:target "_blank" :href evidence_url} (t :badge/Openevidencepage) "..."]]]])]]]]]]]))
+               [:h2.uppercase-header (if (= (count  evidences) 1)  (t :badge/Evidence) (str (t :badge/Evidence) " (" (count evidences) ")") ) ]
+               (reduce (fn [r evidence]
+                         (let [{:keys [narrative description name id url mtime ctime properties]} evidence
+                               added-by-user? (and (not (blank? description)) (starts-with? description "Added by badge recipient")) ;;use regex
+                               desc (cond
+                                      (not (blank? narrative)) narrative
+                                      (not added-by-user?) description ;;todo use regex to match description
+                                      :else nil)]
+                           (conj r
+                                 [:div.modal-evidence
+                                  (when-not added-by-user? [:span.label.label-success (t :badge/Verifiedevidence)])
+                                  [:div.evidence-icon [:i.fa.fa-link]]
+                                  [:div.content
+                                   (when-not (blank? name) [:div.content-body.name name])
+                                   (when-not (blank? desc) [:div.content-body.description desc])
+                                   [:div.content-body.url
+                                    (hyperlink url)]]])))
+                       [:div ] evidences)]])
+
+           #_(if evidence_url
+               [:div.row
+                [:div.col-md-12
+                 [:h2.uppercase-header (t :badge/Evidence)]
+                 [:div [:a.link {:target "_blank" :href evidence_url} (t :badge/Openevidencepage) "..."]]]])]]]]]]]))


[#15] fix faulty namespace declaration.

[#15] fix faulty namespace declaration.

--- src/clojure/pandect/impl/checksum.clj
+++ src/clojure/pandect/impl/checksum.clj
@@ -3,7 +3,7 @@
              [core :refer :all]
              [hash-generator :refer :all]
              [hmac-generator :refer :all]]
-            [pandect.utils.convert :as c only [long->4-bytes]])
+            [pandect.utils.convert :as c :only [long->4-bytes]])
   (:import [java.util.zip Adler32 CRC32]))

 (set! *warn-on-reflection* true)


uses http-hpack from jetty 9.4.28.v20200408 in jet (#1089)

--- waiter/project.clj
+++ waiter/project.clj
@@ -45,7 +45,7 @@
                  [io.grpc/grpc-core "1.20.0"
                   :exclusions [com.google.guava/guava]
                   :scope "test"]
-                 [twosigma/jet "0.7.10-20191230_163338-g0dabe28"
+                 [twosigma/jet "0.7.10-20200504_104810-g200ef43"
                   :exclusions [org.mortbay.jetty.alpn/alpn-boot]]
                  [twosigma/clj-http "1.0.2-20180124_201819-gcdf23e5"
                   :exclusions [commons-codec commons-io org.clojure/tools.reader potemkin slingshot]]


Better definition for `successive-funcalls`

--- test/com/nomistech/clojure_the_language/c_900_appy_stuff/s_100_science/ss_atomic_orbitals.clj
+++ test/com/nomistech/clojure_the_language/c_900_appy_stuff/s_100_science/ss_atomic_orbitals.clj
@@ -66,13 +66,9 @@
     r2 = (f2 r1)
     r3 = (f3 r2)
     etc."
-  (lazy-seq
-   (if (empty? fs)
-     '()
-     (let [vv ((first fs) v)]
-       (cons vv
-             (successive-funcalls (rest fs)
-                                  vv))))))
+  (rest (reductions (fn [v f] (f v))
+                    v
+                    fs)))

 ;;;; ___________________________________________________________________________


(SERVER-1866) Update cacrl test to move assertion outside loop body

Previously this test had assertions inside the loop body, which is a
little strange. This commit updates the test to simply wrap the loop
with an assertion and updates the loop to return true or false.

--- test/integration/puppetlabs/services/certificate_authority/certificate_authority_int_test.clj
+++ test/integration/puppetlabs/services/certificate_authority/certificate_authority_int_test.clj
@@ -328,11 +328,11 @@
                                            (client-request)
                                            false
                                            (catch ConnectionClosedException e
-                                             (is true)))]
-         (loop [times 30]
-           (cond
-             (ssl-exception-for-request?) (is true)
-             (zero? times) (is false "No exception thrown after revocation")
-             :else (do
-                     (Thread/sleep 500)
-                     (recur (dec times))))))))))
+                                             true))]
+         (is (loop [times 30]
+               (cond
+                 (ssl-exception-for-request?) true
+                 (zero? times) false
+                 :else (do
+                         (Thread/sleep 500)
+                         (recur (dec times)))))))))))


limiting number of booked seats per session

--- src-cljs/kmc_booking/components.cljs
+++ src-cljs/kmc_booking/components.cljs
@@ -21,8 +21,10 @@
    		(fn [[k {s :status}]]
      				(= status s)) @seats))

+(def MAX_SEATS 7)
+
 (defn- can-select-more? [seats]
-	(> 3 (count seats)))
+	(> MAX_SEATS (count seats)))

 (defn new-status [seats id]
 	(let [status (get-in @seats [id :status])]
@@ -176,8 +178,10 @@
 		  booked (seats-by-status seats "your")]
 		(when (seq booked)
 			(if (can-select-more? booked)
-				[:div "MOAR"]
-				[:div "NO WAY"]
+				[:div (pr-str booked)
+					[:button#book "Придбати"]
+					]
+				[:div.message (str "Продаємо не більше " MAX_SEATS " квитків в одні руки!")]
 				)
 			;[:div (pr-str booked)]
 			)


duplicated chat view

duplicated chat view

--- src-cljs/tranjlator/master_view.cljs
+++ src-cljs/tranjlator/master_view.cljs
@@ -57,7 +57,7 @@
 (defn format-chat [{:keys [user-name content]}]
   (str user-name ": " content ))

-(defn chat-view [app owner opts]
+(defn original-view [app owner opts]
   (reify
     om/IRenderState
     (render-state [this state]
@@ -75,6 +75,23 @@
                                           (map (fn [item] (dom/li #js {:className "list-group-item"} (format-chat item)
                                                                  (dom/span #js {:className "badge"} (if show-lan (name (:language item)))))) app)))))))))

+(defn translated-view [app owner opts]
+  (reify
+    om/IRenderState
+    (render-state [this state]
+      (let [label (om/get-state owner :label)
+            glyph (om/get-state owner :glyph)
+            show-lan (om/get-state owner :show-language)]
+        (dom/div #js {:className "col-md-5"}
+                 (dom/div #js {:className "panel panel-primary"}
+                          (dom/div #js {:className "panel-heading"}
+                                   (dom/h4 #js {:className "panel-title"}
+                                           (dom/span #js {:className glyph})
+                                           label))
+                          (dom/div #js {:className "panel-body"}
+                                   (apply dom/ul #js {:className "list-group"}
+                                          (map (fn [item] (dom/li #js {:className "list-group-item"} (format-chat item)
+                                                                 (dom/span #js {:className "badge"} (if show-lan (name (:language item)))))) app)))))))))
 (defn master-view [app owner]
   (reify
     om/IWillMount
@@ -97,10 +114,10 @@
       (let [sender-ch (:sender-ch app)]
         (dom/div nil
                  (om/build users-view (:users app))
-                 (om/build chat-view (:original app) {:init-state {:label " Original"
+                 (om/build original-view (:original app) {:init-state {:label " Original"
                                                                    :glyph "glyphicon glyphicon-globe"
                                                                    :show-language true}})
-                 (om/build chat-view (:translated app) {:init-state {:label " Translated"
+                 (om/build translated-view (:translated app) {:init-state {:label " Translated"
                                                                      :glyph "glyphicon glyphicon-home"
                                                                      :show-language false}})
                  (dom/div #js {:className "form-group col-md-4 col-md-offset-2"}


cominatorics for chart clustering

cominatorics for chart clustering

--- src/atom_finder/results_sandbox.clj
+++ src/atom_finder/results_sandbox.clj
@@ -8,6 +8,7 @@
    [clojure.pprint :refer [pprint]]
    [schema.core :as s]
    [swiss.arrows :refer :all]
+   [clojure.math.combinatorics :as combo]
    )
   )

@@ -79,10 +80,18 @@
      (map start-line)
      ))

+;; count how likely a (spot) matrix of 14 elements, with 7 domains is to have
+;; X number of adjacent domains
+(defn count-adjacent [a]
+  (- (count a) (count (dedupe a))))

-/* Create a power-of-two histogram of the table keys. */
-int counts[UPB_MAXARRSIZE + 1] = {0};
-ARRAY_SIZE(counts)
-
-#define ARRAY_SIZE(x) \
-  ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
+'((->> (range 7)
+     (repeat 2)
+     flatten
+     combo/permutations
+     (map count-adjacent)
+     frequencies
+     sort
+     (map prn)
+     time-mins
+     ))


Use standard argument names

Use standard argument names

--- src/caesium/magicnonce/secretbox.clj
+++ src/caesium/magicnonce/secretbox.clj
@@ -38,14 +38,14 @@

   To decrypt, use [[decrypt]] or [[open]], depending on which argument order
   you prefer."
-  [msg nonce key]
-  (let [msglen (buflen msg)
-        ctextlen (+ s/macbytes msglen)
-        outlen (+ s/noncebytes ctextlen)
+  [m n k]
+  (let [mlen (buflen m)
+        clen (+ s/macbytes mlen)
+        outlen (+ s/noncebytes clen)
         out (byte-array outlen)
-        ctextbuf (ByteBuffer/wrap out s/noncebytes ctextlen)]
-    (System/arraycopy nonce 0 out 0 s/noncebytes)
-    (s/secretbox-easy-to-byte-buf! ctextbuf msg nonce key)
+        cbuf (ByteBuffer/wrap out s/noncebytes ctextlen)]
+    (System/arraycopy n 0 out 0 s/noncebytes)
+    (s/secretbox-easy-to-buf! cbuf m n k)
     out))

 (defn ^:private random-nonce!


Refactor - add `timetable-enumerate-rows-in-day` function

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -632,6 +632,13 @@
               (predFn ttLessonInfo))
             ttRow)))

+(defn- timetable-enumerate-rows-in-day
+  "Returns a sequence of [rowIndex, timetableRow], where `rowIndex` is the
+   0-indexed row in the day, and `timetableRow` is the corresponding row."
+  [day]
+  (let [ttDay (timetable-get-day day)]
+    (map vector (range (timetable-day-get-nr-rows ttDay)) ttDay)))
+
 (defn- timetable-day-get-empty-and-non-empty-rows
   "Returns a hash like this:
    {
@@ -639,15 +646,12 @@
      :nonEmptyRows -> vector of non empty row indices for the day
    }"
   [day]
-  (let [ttDay (timetable-get-day day)]
-    (reduce (fn [dayPartition [rowIdx ttRow]]
-              (if (timetable-row-empty? ttRow)
-                  (update-in dayPartition [:emptyRows] #(conj %1 rowIdx))
-                  (update-in dayPartition [:nonEmptyRows] #(conj %1 rowIdx))))
-            {:emptyRows [], :nonEmptyRows []}
-            (map vector
-                 (range (timetable-day-get-nr-rows ttDay))
-                 ttDay))))
+  (reduce (fn [dayPartition [rowIdx ttRow]]
+            (if (timetable-row-empty? ttRow)
+                (update-in dayPartition [:emptyRows] #(conj %1 rowIdx))
+                (update-in dayPartition [:nonEmptyRows] #(conj %1 rowIdx))))
+          {:emptyRows [], :nonEmptyRows []}
+          (timetable-enumerate-rows-in-day day)))

 (defn- create-lesson-div
   "Creates a <div> element for a new lesson using jQuery"


bump up to reframe 0.2.0

bump up to reframe 0.2.0

--- src/cljs/phonecat_re_frame/core.cljs
+++ src/cljs/phonecat_re_frame/core.cljs
@@ -19,9 +19,15 @@
    (reaction (:search-input @db))))

 (re-frame/register-sub        ;; a new subscription handler
+<<<<<<< HEAD
  :phones             ;; usage (subscribe [:phones])
  (fn [db]
    (reaction (:phones @db))))  ;; pulls out :phones
+=======
+   :phones             ;; usage (subscribe [:phones])
+   (fn [db]
+     (reaction (:phones @db))))  ;; pulls out :phones
+>>>>>>> d540ae1... bump up to reframe 0.2.0

 (re-frame/register-sub
  :search-input
@@ -29,6 +35,19 @@
    (reaction (:search-input @db))))

 (re-frame/register-sub
+ :phone-query
+ (fn [db [_ phone-id]]
+   (let [phone-details-reaction (reaction (:phone-details @db))]
+     (reaction ((fn []
+                  ((keyword phone-id) @phone-details-reaction)))))))
+
+(re-frame/register-sub
+ :phone-details
+ (fn [db]
+   (reaction (:phone-details @db))))
+
+(re-frame/register-sub
+>>>>>>> d540ae1... bump up to reframe 0.2.0
  :order-prop
  (fn [db]
    (reaction (:order-prop @db))))


step-5 fully working

step-5 fully working

--- src/cljs/phonecat_re_frame/core.cljs
+++ src/cljs/phonecat_re_frame/core.cljs
@@ -136,7 +136,6 @@
         [:option (mark-selected {:value "age"} @order-prop "age") "Newest"]]])))

 (defn home-page []
-  [phones-component])
   [:div {:class "container-fluid"}
    [:div {:class "row"}
     [:div {:class "col-md-2"}


fix keying of attribute

fix keying of attribute

--- src/cljs/phonecat_re_frame/core.cljs
+++ src/cljs/phonecat_re_frame/core.cljs
@@ -269,7 +269,7 @@
    [:span section-title]
    [:dl
     (map (fn [attribute]
-           ^{:key attribute} [:div
+           ^{:key (:name attribute)} [:div
                               [:dt (:name attribute)]
                               [:dd (condp = (:value attribute)
                                      true "\u2713"


Use ->(>) for the impl

Use ->(>) for the impl

--- src/desdemona/lifecycles/logging.clj
+++ src/desdemona/lifecycles/logging.clj
@@ -1,10 +1,16 @@
 (ns desdemona.lifecycles.logging
   (:require [taoensso.timbre :refer [info]]))

-  (let [task-name (:onyx/name (:onyx.core/task-map event))]
-    (doseq [m (map :message (mapcat :leaves (:tree (:onyx.core/results event))))]
 (defn log-batch
   [event lifecycle]
+  (let [task-name (-> event
+                      :onyx.core/task-map
+                      :onyx/name)]
+    (doseq [m (->> event
+                   :onyx.core/results
+                   :tree
+                   (mapcat :leaves)
+                   (map :message))]
       (info task-name "logging segment:" m)))
   {})


Log requests with middleware.

Log requests with middleware.

--- src/incise/middlewares/impl/base.clj
+++ src/incise/middlewares/impl/base.clj
@@ -1,8 +1,32 @@
 (ns incise.middlewares.impl.base
   (:require [incise.utils :refer [normalize-uri wrap-log-exceptions]]
+            [taoensso.timbre :refer [color-str info]]
             (ring.middleware [reload :refer [wrap-reload]]
                              [stacktrace :refer [wrap-stacktrace-web]])
             [incise.middlewares.core :refer [register]]))
+
+(def ^:private colors-by-code
+  {2 :green
+   3 :blue
+   4 :yellow
+   5 :red})
+
+(defn- status->color [status]
+  (colors-by-code (int (/ status 100)) :reset))
+
+(defn- color-status [status]
+  (color-str (status->color status)
+             status))
+
+(defn wrap-log-request [handler]
+  (fn [{:keys [uri] :as request}]
+    (let [uniq-id (gensym "REQUEST ")]
+      (info (color-str :white uniq-id " START ┄┅┄ ~") uri)
+      (let [{:keys [status] :as resp} (handler request)]
+        (info (color-str :white uniq-id " END  ")
+               (color-status status)
+               (color-str :white \~) uri)
+        resp))))

 (defn wrap-static-index [handler]
   (fn [{:keys [uri] :as request}]
@@ -10,5 +34,6 @@

 (register 200 wrap-static-index)
 (register 300 wrap-reload :dirs ["src"])
+(register 700 wrap-log-request)
 (register 800 wrap-log-exceptions)
 (register 900 wrap-stacktrace-web)


Modifies classify and evaluate functions.

Increases number of folds for cross-validation in evaluate classiier.
Changes classify-cadence so that it returns either :good or :bad. Also
adds a function to interpret options from the classifier.

--- src/cadence/pattern_recognition.clj
+++ src/cadence/pattern_recognition.clj
@@ -68,11 +68,23 @@
 (defn evaluate-classifier
   "Does a simple cross-valiadation on the given classifier map."
   [{:keys [classifier dataset]}]
-  (classifier-evaluate classifier :cross-validation dataset 10))
+  (classifier-evaluate classifier :cross-validation dataset 30))

 (defn classify-cadence
   "Returns whether the given cadence is authentic or not."
   [classifier cadence]
-  (classifier-classify
-    (:classifier classifier)
-    (cadence-to-instance (:dataset classifier) :good cadence)))
+  (let [inst (cadence-to-instance (:dataset classifier) :good cadence)
+        classification (classifier-classify (:classifier classifier)
+                                            inst)]
+    (keyword (.value (.classAttribute inst) (int classification)))))
+
+(defn interpret-classifier-options
+  "Takes a sequence of classifier options and interprets them."
+  [options]
+  (replace {"-M" :fit-logistic-models
+            "-W" :random-seed
+            "-P" :epsilon-for-error-round-off
+            "-L" :tolerance
+            "-N" :normailze ; 0 = Normailize, 1 = Standardize, 2 = neither
+            "-K" :kernel-class}
+           options))


using new copy

using new copy

--- src/celestial/puppet_standalone.clj
+++ src/celestial/puppet_standalone.clj
@@ -12,7 +12,7 @@

 (defn copy-module [{:keys [host]} {:keys [src name]}]
   "Copy a puppet module into server"
-  (copy host (<< "file:/~{src}~{name}.tar.gz")  "/tmp"))
+  (copy host src  "/tmp"))

 (defrecord Standalone [server module]
   Provision


slightly better

slightly better

--- lancet/ant/ant.clj
+++ lancet/ant/ant.clj
@@ -43,34 +43,33 @@
     (throw-if (nil? obj) (str "No task named " name))
     (set-properties! obj props)
     obj))
-
+
 (defmacro define-ant-task [task-name]
-  `(defn ~(symbol (eval task-name))
-     ([] (~(symbol (eval task-name)) {}))
-     ([props#]
-	(let [task# (instantiate-task ant-project ~task-name props#)]
-	  (.execute task#)))))
+  `(defn ~task-name
+    ([]
+       (~task-name {}))
+    ([props#]
+       (let [task# (instantiate-task ant-project ~(str task-name) props#)]
+	 (.execute task#)))))

-(defmacro define-data-type [type-name]
-  `(defn ~(symbol (eval type-name))
-     ([] (~(symbol (eval type-name)) {}))
-     ([props#]
-	(instantiate-data-type ant-project ~type-name props#))))
+;; (defmacro define-data-type [type-name]
+;;   `(defn ~type-name
+;;      ([] (~type-name {}))
+;;      ([props#]
+;; 	(instantiate-data-type ant-project ~type-name props#))))

-; this would reflect across all task-defs, but it doesn't work.
-; Don't know why yet
-;(doseq td (.getTaskDefinitions ant-project)
-;  (do
-;    (println (.getKey td)))
-;    (define-ant-task (.getKey td)))
+(doseq td (.getTaskDefinitions ant-project)
+ (do
+   (println (.getKey td))
+   (define-ant-task (.getKey td))))

 ; TODO: replace with reflective approach (above)
-(define-ant-task "echo")
-(define-ant-task "tstamp")
-(define-ant-task "mkdir")
-(define-ant-task "javac")
-(define-ant-task "delete")
-(define-ant-task "jar")
+;; (define-ant-task echo)
+;; (define-ant-task tstamp)
+;; (define-ant-task mkdir)
+;; (define-ant-task javac)
+;; (define-ant-task delete)
+;; (define-ant-task jar)

-(define-data-type "fileset")
+;; (define-data-type fileset)


Don't show tooltip on hover

Don't show tooltip on hover

--- src/net/sekao/nightcode/shortcuts.clj
+++ src/net/sekao/nightcode/shortcuts.clj
@@ -60,8 +60,8 @@
 (defn add-tooltip! [^Node control ^String text]
   (.setTooltip control
     (doto (Tooltip.)
-      (.setText text)
-      (.setAutoHide false))))
+      (.setOpacity 0)
+      (.setText text))))

 (fdef add-tooltips!
   :args (s/alt
@@ -91,9 +91,11 @@
                         (/ (.getWidth tooltip) 4))
           half-height (- (/ (.getHeight control) 2)
                          (/ (.getHeight tooltip) 4))]
-      (.show tooltip stage
-        (double (+ (.getX point) (.getX scene) (-> scene .getWindow .getX) half-width))
-        (double (+ (.getY point) (.getY scene) (-> scene .getWindow .getY) half-height))))))
+      (doto tooltip
+        (.setOpacity 1)
+        (.show stage
+          (double (+ (.getX point) (.getX scene) (-> scene .getWindow .getX) half-width))
+          (double (+ (.getY point) (.getY scene) (-> scene .getWindow .getY) half-height)))))))

 (fdef show-tooltips!
   :args (s/cat :stage spec/stage?))
@@ -106,7 +108,10 @@
 (fdef hide-tooltip!
   :args (s/cat :control spec/node?))
 (defn hide-tooltip! [^Node control]
-  (some-> control .getTooltip .hide))
+  (when-let [tooltip (.getTooltip control)]
+    (doto tooltip
+      (.setOpacity 0)
+      (.hide))))

 (fdef hide-tooltips!
   :args (s/cat :node (s/or :node spec/node? :stage spec/scene?)))


add badge status update route

add badge status update route

--- src/clj/salava/metabadge/routes.clj
+++ src/clj/salava/metabadge/routes.clj
@@ -3,6 +3,7 @@
             [ring.util.http-response :refer :all]
             [salava.core.access :as access]
             [salava.metabadge.metabadge :as mb]
+            [salava.badge.main :as b]
             [salava.core.layout :as layout]
             salava.core.restructure))

@@ -28,4 +29,11 @@
                   :summary "check if badge is a metabadge"
                   :current-user current-user
                   (ok (mb/milestone? ctx assertion_url )))
+
+             (POST "/update_status/:badgeid" []
+                   :path-params [badgeid :- String]
+                   :summary "change badge status from declined to accepted"
+                   :auth-rules access/authenticated
+                   :current-user current-user
+                   (ok (b/set-status! ctx badgeid "accepted"(:id current-user) )))
              )))


CLJS-831: Extending EventType to js/Element breaks Nashorn

--- src/cljs/clojure/browser/event.cljs
+++ src/cljs/clojure/browser/event.cljs
@@ -27,18 +27,21 @@
              [(keyword (.toLowerCase k))
               v])
            (merge
-            (js->clj EventType)))))
+            (js->clj EventType))))))

-  js/Element
-  (event-types
-    [this]
-    (into {}
-          (map
-           (fn [[k v]]
-             [(keyword (.toLowerCase k))
-              v])
-           (merge
-            (js->clj EventType))))))
+(when (exists? js/Element)
+  (extend-protocol IEventType
+
+    js/Element
+    (event-types
+      [this]
+      (into {}
+            (map
+             (fn [[k v]]
+               [(keyword (.toLowerCase k))
+                v])
+             (merge
+              (js->clj EventType)))))))

 (defn listen
   ([src type fn]


Comment out genome_two_point_crossover

Comment out genome_two_point_crossover

--- src/clojush/instructions/genome.clj
+++ src/clojush/instructions/genome.clj
@@ -563,7 +563,7 @@
                         :genome)))
       state)))

-(define-registered
+#_(define-registered
   genome_two_point_crossover
   ^{:stack-types [:genome]}
   (fn [state]


Fix scalarmult-to-buf! arg order in test

--- test/caesium/crypto/scalarmult_test.clj
+++ test/caesium/crypto/scalarmult_test.clj
@@ -42,7 +42,7 @@
   (testing "-to-buf! and regular API work identically"
     (let [q (bb/alloc s/bytes)
           r (s/scalarmult scalar-1)]
-      (s/scalarmult-to-buf! scalar-1 q)
+      (s/scalarmult-to-buf! q scalar-1 )
       (is (u/array-eq r q))))
   (testing "base point mult uses the base point"
     (is (u/array-eq


PDOK-5878  Modify schema validation schema for uniqueVersions

--- src/pdok/featured_to_extracts/api.clj
+++ src/pdok/featured_to_extracts/api.clj
@@ -46,6 +46,7 @@
    :changeLog                 URI
    (s/optional-key :format)   (s/enum "csv" "zip")
    :extractTypes              [s/Str]
+   (s/optional-key :uniqueVersions) s/Bool
    (s/optional-key :callback) URI})

 (def TemplateRequest


s/warn/debug/

s/warn/debug/

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -602,7 +602,7 @@
               (= :top (get-in word '(:agr :number)))))
      ;; not enough information.
      (do
-       (log/warn (str "not enough agreement specified to conjugate: " (get-in word '(:passato)) " (irreg past)]"))
+       (log/debug (str "not enough agreement specified to conjugate: " (get-in word '(:passato)) " (irreg past)]"))
        (get-in word '(:passato)))

      ;; TODO: do not use brackets: if there's an error about there being


Inbox: Allow click on documents in search.

--- src-cljs/pepa/workflows/inbox2.cljs
+++ src-cljs/pepa/workflows/inbox2.cljs
@@ -280,9 +280,9 @@
                                 (add-column! current-columns [:search nil]))))}
        "Open"]]]))

-(ui/defcomponent search-result-row [document]
+(ui/defcomponent search-result-row [document owner {:keys [on-click]}]
   (render [_]
-    [:li
+    [:li {:on-click (fn [e] (on-click (om/value document)))}
      (om/build page/thumbnail (first (:pages document)))
      [:.meta
       [:.title (:title document)]
@@ -312,7 +312,11 @@
        [:button {:type "submit"}
         "Search"]]]
      [:ul.search-results
-      (om/build-all search-result-row (map #(get-in state [:documents %]) documents))]]))
+      (om/build-all search-result-row (map #(get-in state [:documents %]) documents)
+                    {:opts {:on-click (fn [document]
+                                        (let [columns (->> (current-columns state)
+                                                           (remove #(= % [:search nil])))]
+                                          (add-column! columns [:document (:id document)])))}})]]))

 (defn ^:private inbox-handle-drop! [state owner page-cache target source page-ids target-idx]
   (let [columns (om/get-state owner :columns)


Removed test_runner.cljs as it's no longer needed

Previously it was used by the built-in test lib that ClojureScript, now it's not needed, because cemerick's clojurescript.test already ships with one.

--- test/test_runner.cljs
+++ test/test_runner.cljs
@@ -1,12 +0,0 @@
-(ns test-runner
-  (:require [cljs.test :refer-macros [run-tests]]
-            [ultimate-ttt.game.board-test]))
-
-(enable-console-print!)
-
-(defn runner []
-  (if (cljs.test/successful?
-       (run-tests
-        'ultimate-ttt.game.board-test))
-    0
-    1))