adding map arg option

adding map arg option

--- src/celestial/provider.clj
+++ src/celestial/provider.clj
@@ -38,26 +38,27 @@

 (defn selections
   "Select group of keys from map"
-  [kys]
-  (letfn [(select [k] (fn [m] (select-keys m k)))]
-    (apply juxt (map select kys))))
+  ([m kys] ((selections kys) m))
+  ([kys]
+   (letfn [(select [k] (fn [m] (select-keys m k)))]
+     (apply juxt (map select kys)))))

 (defn os->template
   "Os key to vmware template"
   [hyp]
   (fn [os]
-   (let [ks [hyp :ostemplates os]]
-     (try+
-      (apply hypervisor ks)
-      (catch [:type :celestial.common/missing-conf] e
-        (throw+ {:type :missing-template}
-          (<< "no matching vmware template found for ~{os} add one to configuration under ~{ks}")))))))
+    (let [ks [hyp :ostemplates os]]
+      (try+
+        (apply hypervisor ks)
+        (catch [:type :celestial.common/missing-conf] e
+          (throw+ {:type :missing-template}
+                  (<< "no matching vmware template found for ~{os} add one to configuration under ~{ks}")))))))

 (defn transform
   "specific model transformations"
   [res ts]
-    (reduce
-      (fn [res [k v]] (update-in res [k] v)) res ts))
+  (reduce
+    (fn [res [k v]] (update-in res [k] v)) res ts))

 (defn wait-for
   "A general wait for pred function"
@@ -72,14 +73,14 @@
         (throw+ (merge err timings) message)))))

 (defn wait-for-ssh [address user timeout]
-    {:pre [address user timeout]}
-    (wait-for {:timeout timeout}
-      #(try
-         (ssh-up? {:host address :port 22 :user user})
-       (catch Throwable e false))
-      {:type ::ssh-failed :timeout timeout} "Timed out while waiting for ssh"))
+  {:pre [address user timeout]}
+  (wait-for {:timeout timeout}
+            #(try
+               (ssh-up? {:host address :port 22 :user user})
+               (catch Throwable e false))
+            {:type ::ssh-failed :timeout timeout} "Timed out while waiting for ssh"))

 ; common validations
 (validation :ip
-   (when-not-nil (partial re-find #"\d+\.\d+\.\d+\.\d+") "must be a legal ip address"))
+            (when-not-nil (partial re-find #"\d+\.\d+\.\d+\.\d+") "must be a legal ip address"))
 (test #'mappings)


small bugfix to 'wrap-with-puppet-version-header'

--- src/clj/puppetlabs/master/services/ca/certificate_authority_core.clj
+++ src/clj/puppetlabs/master/services/ca/certificate_authority_core.clj
@@ -66,7 +66,10 @@
   [handler version]
   (fn [request]
     (let [response (handler request)]
-      (rr/header response "X-Puppet-Version" version))))
+      ; Our compojure app returns nil responses sometimes.
+      ; In that case, don't add the header.
+      (when response
+        (rr/header response "X-Puppet-Version" version)))))

 (schema/defn ^:always-validate
   compojure-app


tests for Curtain Wall and Wraparound

tests for Curtain Wall and Wraparound

--- src/clj/test/cards-ice.clj
+++ src/clj/test/cards-ice.clj
@@ -31,6 +31,21 @@
       (core/trash state :corp (get-in @state [:corp :hand 0]))
       (is (= (get-in @state [:corp :discard 0 :title]) "Architect"))
       (is (= (get-in @state [:corp :discard 1 :title]) "Architect")))))
+
+(deftest curtain-wall
+  "Curtain Wall - Strength boost when outermost ICE"
+  (do-game
+    (new-game (default-corp [(qty "Curtain Wall" 1) (qty "Paper Wall" 1)])
+              (default-runner))
+    (core/gain state :corp :credit 10)
+    (play-from-hand state :corp "Curtain Wall" "HQ")
+    (let [curt (get-in @state [:corp :servers :hq :ices 0])]
+      (core/rez state :corp curt)
+      (is (= 10 (:current-strength (refresh curt))) "Curtain Wall has +4 strength as outermost ICE")
+      (play-from-hand state :corp "Paper Wall" "HQ")
+      (let [paper (get-in @state [:corp :servers :hq :ices 1])]
+        (core/rez state :corp paper)
+        (is (= 6 (:current-strength (refresh curt))) "Curtain Wall back to default 6 strength")))))

 (deftest lotus-field-unlowerable
   "Lotus Field strength cannot be lowered"
@@ -98,3 +113,16 @@
       (prompt-choice :corp 0)
       (prompt-choice :runner 0)
       (is (not (get-in (refresh tmi) [:rezzed]))))))
+
+(deftest wraparound
+  "Wraparound - Strength boosted when no fracter is installed"
+  (do-game
+    (new-game (default-corp [(qty "Wraparound" 1)])
+              (default-runner [(qty "Corroder" 1)]))
+    (play-from-hand state :corp "Wraparound" "HQ")
+    (let [wrap (get-in @state [:corp :servers :hq :ices 0])]
+      (core/rez state :corp wrap)
+      (is (= 7 (:current-strength (refresh wrap))) "Wraparound +7 strength with no fracter in play")
+      (take-credits state :corp)
+      (play-from-hand state :runner "Corroder")
+      (is (= 0 (:current-strength (refresh wrap))) "Wraparound 0 strength after Corroder installed"))))


Fix error hiding faction settings when no event is passed to hide-settings

This happens because hide-settings is used as both the on-hide handler
for the popup and the on-click handler for the cancel button.

--- src/clj/zetawar/views.cljs
+++ src/clj/zetawar/views.cljs
@@ -290,18 +290,17 @@
 (defn faction-settings [{:as views-ctx :keys [conn dispatch translate]}]
   (with-let [faction (subs/faction-to-configure conn)
              selected-player-type (r/atom nil)
-             hide-settings #(do
-                              (.preventDefault %)
-                              (dispatch [::events.ui/hide-faction-settings]))
+             hide-settings (fn [ev]
+                             (when ev (.preventDefault ev))
+                             (dispatch [::events.ui/hide-faction-settings]))
              select-player-type #(reset! selected-player-type (.-target.value %))
-             set-player-type #(do
-                                (.preventDefault %)
-                                (when-let [player-type-id (->> (or @selected-player-type :human)
-                                                               (keyword 'zetawar.players))]
-                                  (reset! selected-player-type nil)
-                                  (dispatch [::events.ui/set-faction-player-type @faction player-type-id]))
-
-                                (dispatch [::events.ui/hide-faction-settings]))]
+             set-player-type (fn [ev]
+                               (.preventDefault ev)
+                               (when-let [player-type-id (->> (or @selected-player-type :human)
+                                                              (keyword 'zetawar.players))]
+                                 (reset! selected-player-type nil)
+                                 (dispatch [::events.ui/set-faction-player-type @faction player-type-id]))
+                               (dispatch [::events.ui/hide-faction-settings]))]
     [:> js/ReactBootstrap.Modal {:show (some? @faction)
                                  :on-hide hide-settings}
      [:> js/ReactBootstrap.Modal.Header {:close-button true}


:bug: Removed reflection warnings from clj-http.multipart

--- src/clj_http/multipart.clj
+++ src/clj_http/multipart.clj
@@ -96,17 +96,22 @@
     (throw (Exception. (str "Multipart byte array body must contain "
                             "at least :content and :name")))))

+(defmulti  ^java.nio.charset.Charset encoding-to-charset class)
+(defmethod encoding-to-charset nil                      [encoding] nil)
+(defmethod encoding-to-charset java.nio.charset.Charset [encoding] encoding)
+(defmethod encoding-to-charset java.lang.String         [encoding] (java.nio.charset.Charset/forName encoding))
+
 (defmethod make-multipart-body String
   ;; Create a StringBody object from the given map, requiring at least :content.
   ;; If :encoding is specified, it will be created using the Charset for that
   ;; encoding.
-  [{:keys [mime-type ^String content encoding]}]
+  [{:keys [^String mime-type ^String content encoding]}]
   (cond
     (and content mime-type encoding)
-    (StringBody. content (ContentType/create mime-type encoding))
+    (StringBody. content (ContentType/create mime-type (encoding-to-charset encoding)))

     (and content encoding)
-    (StringBody. content (ContentType/create "text/plain" encoding))
+    (StringBody. content (ContentType/create "text/plain" (encoding-to-charset encoding)))

     content
     (StringBody. content (ContentType/create "text/plain" Consts/ASCII))))


Changed so deletes from trash folder permanently delete.

--- src/cljs/bookmarx/add.cljs
+++ src/cljs/bookmarx/add.cljs
@@ -105,7 +105,8 @@
   [doc]
   (log/debugf "save %s" @doc)
   (cond (:add? @doc) (add-bookmark doc)
-        (:delete? @doc) (if (:folder? @doc)
+        (:delete? @doc) (if (or (:folder? @doc)
+                                (= (get-in @doc[:bookmark/parent :db/id]) (session/get :trash)))
                           (delete-bookmark doc)
                           (trash-bookmark doc))
          :else (upsert-bookmark doc))
@@ -116,9 +117,7 @@

 (defn rating-star "Renders a bookmark rating star."
   [index doc]
-  [:span {:class (if (<= index (if (get-in @doc [:rating-clicked])
-                                 (get-in @doc [:bookmark/rating])
-                                 (get-in @doc [:rating])))
+  [:span {:class (if (<= index (if (:rating-clicked @doc) (:bookmark/rating @doc) (:rating @doc)))
                    "glyphicon glyphicon-star"
                    "glyphicon glyphicon-star-empty")
           :key (str "rating-star-" index) :data-index index
@@ -147,7 +146,8 @@
                                (session/update-in! [:add :orig-parent] (fn [] (:bookmark/parent @doc)))
                                (session/put! :add @doc)))
                 :href (str (:prefix env) "/folder")}
-   (:bookmark/title (session/get (-get-active doc)))])
+   (let [title (:bookmark/title (session/get (-get-active doc)))]
+     (if (= title "~Trash") "Trash" title))])

 (defn icon-selector "Render icon selection."
   [doc]


Fix tests

Fix tests

--- modules/bidi/test/modular/bidi_tests.clj
+++ modules/bidi/test/modular/bidi_tests.clj
@@ -3,7 +3,7 @@
 (ns modular.bidi-tests
   (:require
    [clojure.test :refer :all]
-   [modular.bidi :refer (WebService request-handlers uri-context routes ->ComponentAddressable ->Router)]
+   [modular.bidi :refer (WebService request-handlers uri-context routes ->KeywordToHandler ->Router)]
    [bidi.bidi :as bidi :refer (match-route path-for)]
    [com.stuartsierra.component :as component])
   )


Add :type meta to Routers

Add :type meta to Routers

--- modules/reitit-core/src/reitit/core.cljc
+++ modules/reitit-core/src/reitit/core.cljc
@@ -154,6 +154,7 @@
                         (if name (assoc nl name f) nl)]))
                    [[] {}] compiled)
          lookup (impl/fast-map nl)]
+     ^{:type ::router}
      (reify
        Router
        (router-name [_]
@@ -199,6 +200,7 @@
                         nl)]) [{} {}] compiled)
          data (impl/fast-map pl)
          lookup (impl/fast-map nl)]
+     ^{:type ::router}
      (reify Router
        (router-name [_]
          :lookup-router)
@@ -235,6 +237,7 @@
                         (if name (assoc nl name f) nl)]))
                    [nil {}] compiled)
          lookup (impl/fast-map nl)]
+     ^{:type ::router}
      (reify
        Router
        (router-name [_]
@@ -272,6 +275,7 @@
          [[p data result] :as compiled] (compile-routes routes opts)
          p #?(:clj (.intern ^String p) :cljs p)
          match (->Match p data result {} p)]
+     ^{:type ::router}
      (reify Router
        (router-name [_]
          :single-static-path-router)
@@ -305,6 +309,7 @@
          wildcard-router (prefix-tree-router wild opts)
          static-router (->static-router lookup opts)
          names (find-names routes opts)]
+     ^{:type ::router}
      (reify Router
        (router-name [_]
          :mixed-router)


make webrtc work with talaria

make webrtc work with talaria

--- src-cljs/frontend/sente.cljs
+++ src-cljs/frontend/sente.cljs
@@ -258,7 +258,8 @@
 (defn init [app-state]
   (if (:use-talaria? @app-state)
     (let [tal-state (:tal @app-state)]
-      (tal/start-recv-queue tal-state (partial handle-tal-msg app-state)))
+      (tal/start-recv-queue tal-state (partial handle-tal-msg app-state))
+      (subs/add-recording-watcher app-state (fn [d] (send-msg tal-state [:rtc/signal (merge d {:document/id (:document/id @app-state)})]))))
     (let [{:keys [chsk ch-recv send-fn state] :as sente-state}
           (sente/make-channel-socket! "/chsk" {:type :auto
                                                :chsk-url-fn (fn [& args]


:sparkles: Adapt websockets code to the vertx module changes.

--- backend/src/uxbox/http/ws.clj
+++ backend/src/uxbox/http/ws.clj
@@ -17,9 +17,9 @@
    [uxbox.util.uuid :as uuid]
    [uxbox.util.transit :as t]
    [uxbox.util.blob :as blob]
-   [vertx.core :as vc]
    [vertx.http :as vh]
    [vertx.web :as vw]
+   [vertx.impl :as vi]
    [vertx.util :as vu]
    [vertx.eventbus :as ve])
   (:import
@@ -88,7 +88,7 @@
 (defn handler
   [{:keys [user] :as req}]
   (letfn [(on-init [ws]
-            (let [ctx (vc/current-context)
+            (let [ctx (vu/current-context)
                   fid (get-in req [:path-params :file-id])
                   ws  (assoc ws
                              :user-id user
@@ -128,14 +128,14 @@
       (-> (p/do! (on-init @local))
           (p/then (fn [data]
                     (vreset! local data)
-                    (.textMessageHandler ws (vu/fn->handler
+                    (.textMessageHandler ws (vi/fn->handler
                                              (fn [msg]
                                                (-> (p/do! (on-message @local msg))
                                                    (p/then (fn [data]
                                                              (when (instance? WebSocket data)
                                                                (vreset! local data))
                                                              (.fetch ws 1)))))))
-                    (.closeHandler ws (vu/fn->handler (fn [& args] (on-close @local))))))))))
+                    (.closeHandler ws (vi/fn->handler (fn [& args] (on-close @local))))))))))

 (defn ws-websocket
   []


Reduce max-msg-count to 30

Reduce max-msg-count to 30

--- src/yetibot/core/chat.clj
+++ src/yetibot/core/chat.clj
@@ -17,7 +17,7 @@
 (def send-msg (mk-sender :msg))
 (def send-paste (mk-sender :paste))

-(def max-msg-count 50)
+(def max-msg-count 30)

 (defn send-msg-for-each [msgs]
   (doseq [m (take max-msg-count msgs)] (send-msg m))


matcher-combinators: Improve description of overriding default matchers

--- 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
@@ -145,6 +145,7 @@
 (deftest nested-test

   ;; Nested items are matched based on their types.
+  ;; For maps, keys of expected and actual must be equal.

   (is (match? [#"red"
                #"violet"]
@@ -177,34 +178,30 @@
                :z :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
-
-  (testing "`m/equals` overrides default treatment of functions as predicates"
+;;;; ---- Overriding default matchers ----
+
+(deftest overriding-default-matchers-test
+
+  ;; Some examples.
+
+  (testing "`m/equals` does not treat a function as a predicate"
     (is (match? (m/equals even?)
                 even?)))

-  (testing "`m/equals` checks that all map entries are present"
+  (testing "`m/equals` on a map checks that all entries are present"
     (is (match? (m/equals {:a 1 :b 2})
                 {:a 1 :b 2}))
     (is (match? (m/mismatch ; see ++use-of-mismatch++ at top of file
                  (m/equals {:a 1}))
                 {:a 1 :b 2})))

+  (testing "`m/embeds` on a sequence checks that each element of expected is in actual -- order is not relevant"
+    (is (match? (m/embeds [1 3 5])
+                [5 4 3 2 1])))
+
   (testing "The overriding does not effect how nested matching works"
     (is (match? (m/equals {:a 1 :b even?})
                 {:a 1 :b 1234}))))
-
-(deftest explicit-use-of-embeds-test ; TODO
-  (is (match? (m/embeds [1 3 5])
-              [1 2 3 4 5])))

 ;;;; ___________________________________________________________________________
 ;;;; ---- Exceptions ----


4Clojure problem 102

4Clojure problem 102

--- src/fourclojure/4_clojure.clj
+++ src/fourclojure/4_clojure.clj
@@ -11,4 +11,6 @@
 ;problem 70
 ((fn [s]
    (let [[a & others] (clojure.string/split s (re-pattern "-"))]
-     (apply str a (map #(let [[x & ys] %] (apply str (Character/toUpperCase x) ys)) others)))) "multi-word-key")+     (apply str a
+            (map #(let [[x & ys] %]
+                    (apply str (Character/toUpperCase x) ys)) others)))) "multi-word-key")


Fix issue with add-tmp fileset protocol where it did nothing at all

--- boot/pod/src/boot/tmpdir.clj
+++ boot/pod/src/boot/tmpdir.clj
@@ -84,7 +84,7 @@
   (add-tmp [this dest-dir tmpfiles]
     (assert ((set (map file dirs)) dest-dir)
             (format "dest-dir not in dir set (%s)" dest-dir))
-    (reduce #(assoc %1 (path %2) (assoc %2 :dir dest-dir)) this tmpfiles))
+    (reduce #(assoc-in %1 [:tree (path %2)] (assoc %2 :dir dest-dir)) this tmpfiles))
   (mv [this from-path to-path]
     (if (= from-path to-path)
       this


throw exception when mv source does not exist; fixes #325

--- boot/pod/src/boot/tmpdir.clj
+++ boot/pod/src/boot/tmpdir.clj
@@ -95,8 +95,9 @@
   (mv [this from-path to-path]
     (if (= from-path to-path)
       this
-      (if-let [f (assoc (get-in this [:tree from-path]) :path to-path)]
-        (update-in this [:tree] #(-> % (assoc to-path f) (dissoc from-path)))
+      (if-let [from (get-in this [:tree from-path])]
+        (update-in this [:tree] #(-> % (assoc to-path (assoc from :path to-path))
+                                       (dissoc from-path)))
         (throw (Exception. (format "not in fileset (%s)" from-path))))))
   (cp [this src-file dest-tmpfile]
     (let [hash (digest/md5 src-file)


RR: remove keyword conversation to app-type

--- src/hatti/views/dataview.cljs
+++ src/hatti/views/dataview.cljs
@@ -104,9 +104,7 @@

 (defn activate-integrated-apps-view! [view settings-section app-type]
   (let [view (keyword view)
-        active-section (keyword app-type)
         settings-section (keyword settings-section)
-        views (-> @shared/app-state :views :all)
         settings-views (-> @shared/app-state :views :settings :all)]
     (when (contains? (set settings-views) settings-section)
       (transact!
@@ -116,7 +114,7 @@
              (assoc-in [:views] {:selected view})
              (assoc-in [:views :settings] {:active-tab settings-section})
              (assoc-in [:views :settings :integrated-apps]
-                       {:active-section active-section}))))
+                       {:active-section app-type}))))
       (if (= app-type "google_sheets")
         (merge-into-app-state! shared/app-state
                                [:views :settings :integrated-apps]


simplify join-group handler, fix bug joining group

--- src/braid/client/events.cljs
+++ src/braid/client/events.cljs
@@ -642,13 +642,11 @@
 (reg-event-db
   :join-group
   (fn [state [_ {:keys [group tags]}]]
-    (let [state (-> state
-                    (helpers/add-tags tags)
-                    (helpers/add-group group))])
-    (reduce (fn [s tag]
-              (helpers/subscribe-to-tag s (tag :id)))
-            state
-            tags)))
+    (-> state
+        (helpers/add-tags tags)
+        (helpers/add-group group)
+        (update-in [:user :subscribed-tag-ids]
+                   set/union (set (map :id tags))))))

 (reg-event-fx
   :notify-if-client-out-of-date


Correctly fetch projects

Correctly fetch projects

--- src/circle/backend/build.clj
+++ src/circle/backend/build.clj
@@ -72,7 +72,7 @@

 (defn project-name [b]
   {:pre [(-> @b :_project_id)]}
-  (-> @b :_project_id (mongo/fetch-by-id :projects) :name))
+  (-> @b :_project_id (project/get-by-id) :name))

 (defn build [{:keys [build_num    ;; int
                      vcs_url


Removed unused configuration for distribution splits

--- src/cljs/db_quiz/config.cljs
+++ src/cljs/db_quiz/config.cljs
@@ -19,18 +19,8 @@
              :missed "#333333"
              :player-1 "#fc4349"
              :player-2 "#354d65"}
-   :data {:sparql {:difficulty-distribution {; Minimum size of a difficulty interval
-                                             :min-size 50
-                                             ; Parameters of the exponential distribution
-                                             :params {:b 0.12}
-                                             ; Angles (in degrees) of the distribution's tangent delimiting
-                                             ; its first and second third.
-                                             :split-angles {:easy 179
-                                                            :normal 135}}
-                   :endpoint-urls {:cs "http://cs.dbpedia.org/sparql"
+   :data {:sparql {:endpoint-urls {:cs "http://cs.dbpedia.org/sparql"
                                    :en "http://lod2.vse.cz:8890/sparql"}
-                   ; Maximum number of results per query
-                   :page-size 5000
                    :query-files {:cs {:alphabetic "sparql/cs_dbpedia_az.mustache"
                                       :numeric "sparql/cs_dbpedia.mustache"}
                                  :en {:alphabetic ""


Add text to explain drag n drop

Add text to explain drag n drop

--- src/discuss/clipboard.cljs
+++ src/discuss/clipboard.cljs
@@ -58,5 +58,6 @@
   (when (pos? (count (get-stored-selections)))
     (dom/div nil
              (dom/h5 nil "Clipboard")
+             (dom/p nil "Drag and drop these arguments to the reference field when adding a new statement.")
              (apply dom/div nil
                     (map #(om/build clipboard-item (lib/merge-react-key %)) (get-stored-selections))))))


add some set benchmarks

add some set benchmarks

--- benchmark/cljs/benchmark_runner.cljs
+++ benchmark/cljs/benchmark_runner.cljs
@@ -195,7 +195,6 @@
              [:q 16] [:r 17] [:s 18] [:t 19] [:u 20] [:v 21] [:w 22] [:x 23]
              [:y 24] [:z 25] [:a0 26] [:b0 27] [:c0 28] [:d0 29] [:e0 30] [:f0 31]]))
 (simple-benchmark [key :f0] (hash key) 1000000)
-(simple-benchmark [key :unsynchronized-mutable] (hash key false) 1000000)
 (simple-benchmark [key :unsynchronized-mutable] (hash key) 1000000)
 (def hash-coll-test
   (loop [i 0 r []]
@@ -222,6 +221,9 @@
 (simple-benchmark [v [1 2 3]] (set v) 1000000)
 (simple-benchmark [] (hash-set 1 2 3) 1000000)
 (simple-benchmark [coll #{1 2 3}] (conj coll 4) 1000000)
+(simple-benchmark [coll #{1 2 3}] (get coll 2) 1000000)
+(simple-benchmark [coll #{1 2 3}] (contains? coll 2) 1000000)
+(simple-benchmark [coll #{1 2 3}] (coll 2) 1000000)
 (println)

 (println ";;; seq ops")


improve name to jvm-time-ms

improve name to jvm-time-ms

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -72,7 +72,7 @@

 ;; time

-(defn clock-ms []
+(defn jvm-time-ms []
   (quot (System/nanoTime) 1000000))

 (defn compute-time-from-core [tags]
@@ -83,7 +83,7 @@
          (@state :burst-init-time)))))

 (defn elapsed-time [state]
-  (if (state :start-time) (- (clock-ms) (state :start-time)) 0))
+  (if (state :start-time) (- (jvm-time-ms) (state :start-time)) 0))

 ;; image metadata

@@ -323,7 +323,7 @@

 (defn interruptible-sleep [time-ms]
   (let [sleepy (CountDownLatch. 1)]
-    (state-assoc! :sleepy sleepy :next-wake-time (+ (clock-ms) time-ms))
+    (state-assoc! :sleepy sleepy :next-wake-time (+ (jvm-time-ms) time-ms))
     (.await sleepy time-ms TimeUnit/MILLISECONDS)))

 (defn acq-sleep [interval-ms]
@@ -332,11 +332,11 @@
     (not (core isContinuousFocusEnabled)))
       (core enableContinuousFocus true))
   (let [target-time (+ (@state :last-wake-time) interval-ms)
-        delta (- target-time (clock-ms))]
+        delta (- target-time (jvm-time-ms))]
     (when (pos? delta)
       (interruptible-sleep delta))
     (await-resume)
-    (let [now (clock-ms)
+    (let [now (jvm-time-ms)
           wake-time (if (> now (+ target-time 10)) now target-time)]
       (state-assoc! :last-wake-time wake-time))))

@@ -376,7 +376,8 @@
 (defn store-new-z-reference []
   (let [z-drive (@state :default-z-drive)]
     (when (and (or (not (core isContinuousFocusEnabled))
-                   (core isContinuousFocusDrive z-drive)))
+                   (core isContinuousFocusDrive z-drive))
+               (not (z-in-msp z-drive)))
       (state-assoc! :reference-z (get-z-stage-position z-drive)))))

 ;; startup and shutdown
@@ -391,12 +392,12 @@
       :stop false
       :running true
       :finished false
-      :last-wake-time (clock-ms)
+      :last-wake-time (jvm-time-ms)
       :last-stage-positions (into {} [[default-z-drive z]
                                 [default-xy-stage xy]])
       :last-position nil
       :reference-z z
-      :start-time (clock-ms)
+      :start-time (jvm-time-ms)
       :init-auto-shutter (core getAutoShutter)
       :init-exposure (core getExposure)
       :default-z-drive default-z-drive
@@ -437,33 +438,32 @@
                          (-> current-position get-msp (z-in-msp z-drive) not)
                          (or (:autofocus event)
                              (:wait-time-ms event)))]
-    (filter identity
-            (flatten
-              (list
-                #(log event)
-                (for [[axis pos] (:axes (MultiStagePosition-to-map (get-msp current-position))) :when pos]
-                  #(apply set-stage-position axis pos))
-                (for [[d p v] (get-in event [:channel :properties])]
-                  #(set-property [d p v]))
-                #(when-lets [exposure (:exposure event)
-                             camera (core getCameraDevice)]
-                            (device-best-effort camera (core setExposure exposure)))
-                #(when check-z-ref
-                   (set-stage-position z-drive (@state :reference-z)))
-                #(when-let [wait-time-ms (:wait-time-ms event)]
-                   (acq-sleep wait-time-ms))
-                #(when (:autofocus event)
-                   (run-autofocus))
-                #(when check-z-ref
-                   (store-new-z-reference))
-                #(when z-drive
-                   (let [z (compute-z-position event)]
-                     (set-stage-position z-drive z)))
-                (event :runnables)
-                #(do (wait-for-pending-devices)
-                     (expose event)
-                     (collect event out-queue)
-                     (stop-trigger)))))))
+    (flatten
+      (list
+        #(log event)
+        (for [[axis pos] (:axes (MultiStagePosition-to-map (get-msp current-position))) :when pos]
+          #(apply set-stage-position axis pos))
+        (for [[d p v] (get-in event [:channel :properties])]
+          #(set-property [d p v]))
+        #(when-lets [exposure (:exposure event)
+                     camera (core getCameraDevice)]
+           (device-best-effort camera (core setExposure exposure)))
+        #(when check-z-ref
+           (set-stage-position z-drive (@state :reference-z)))
+        #(when-let [wait-time-ms (:wait-time-ms event)]
+           (acq-sleep wait-time-ms))
+        #(when (:autofocus event)
+           (run-autofocus))
+        #(when check-z-ref
+           (store-new-z-reference))
+        #(when z-drive
+           (let [z (compute-z-position event)]
+             (set-stage-position z-drive z)))
+        (event :runnables)
+        #(do (wait-for-pending-devices)
+             (expose event)
+             (collect event out-queue)
+             (stop-trigger))))))

 (defn execute [event-fns]
   (doseq [event-fn event-fns :while (not (:stop @state))]


make bit depth work on contrast panel

make bit depth work on contrast panel

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -157,7 +157,7 @@
       {
        "AxisPositions" (when-let [axes (get-in event [:position :axes])] (JSONObject. axes))
        "Binning" (core getProperty (core getCameraDevice) "Binning")
-       "CameraBitDepth" (core getImageBitDepth)
+       "BitDepth" (core getImageBitDepth)
        "Channel" (get-in event [:channel :name])
        "ChannelIndex" (:channel-index event)
        "ElapsedTime-ms" (if (state :start-time) (- (clock-ms) (state :start-time)) 0)


stop live mode before starting acquisition

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -497,6 +497,7 @@
       ;(proxy [TaggedImageAnalyzer] []
         ;(analyze [img] (log "pretending to analyze"))))
     (when-not (:stop @(.state this))
+      (. gui enableLiveMode false)
       (.start acq-thread)
       (swap! (.state this) assoc :display display)
       (.start display))))


don't interrogate z-drive for every image

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -151,7 +151,7 @@
        "Time" (get-current-time-str)
        "UUID" (UUID/randomUUID)
        "Width"  (@state :init-width)
-       "ZPositionUm" (core getPosition (core getFocusDevice))
+       "ZPositionUm" (@state :last-z-position)
       }))))

 ;; acq-engine


Fix incorrect content type for one endpoint

--- src/env_logger/handler.clj
+++ src/env_logger/handler.clj
@@ -58,17 +58,19 @@
                                                       (t/minutes 45))
                                              (t/local-date-time)
                                              (:ruuvitag-locations env)))))]
-        (j/write-value-as-string
-         (if-not data
-           {:status 500}
-           {:status 200
-            :body {:data (assoc data :recorded
-                                (convert-epoch-ms-to-string (:recorded data)))
-                   :rt-data (for [item rt-data]
-                              (assoc item :recorded
-                                     (convert-epoch-ms-to-string
-                                      (:recorded item))))
-                   :weather-data (get-fmi-weather-data)}}))))))
+        (if-not data
+          (resp/status 500)
+          (resp/content-type
+           (resp/response
+            (j/write-value-as-string
+             {:data (assoc data :recorded
+                           (convert-epoch-ms-to-string (:recorded data)))
+              :rt-data (for [item rt-data]
+                         (assoc item :recorded
+                                (convert-epoch-ms-to-string
+                                 (:recorded item))))
+              :weather-data (get-fmi-weather-data)}))
+           "application/json"))))))

 (defn get-plot-page-data
   "Returns data needed for rendering the plot page."


unlogged batches

unlogged batches

--- src/kixi/hecuba/data/misc.clj
+++ src/kixi/hecuba/data/misc.clj
@@ -16,7 +16,7 @@
 (defn metadata-is-spike? [{:keys [reading_metadata] :as m}]
   (truthy? (get reading_metadata "median-spike")))

-(defn where-from
+(defn where-from
   "Takes measurement or sensor and returns where clause"
   [m]
   [[= :device_id (:device_id m)] [= :type (:type m)]])
@@ -50,7 +50,7 @@
   [store]
   (db/with-session [session (:hecuba-session store)]
     (let [all-sensors-metadata (db/execute session (hayt/select :sensor_metadata))]
-      (map #(merge (first (db/execute session
+      (map #(merge (first (db/execute session
                                       (hayt/select :sensors
                                                    (hayt/where [[= :device_id (:device_id %)] [= :type (:type %)]]))))
                    %) all-sensors-metadata))))
@@ -72,7 +72,7 @@
   (let [parsed-dates (map #(tc/from-date (:timestamp %)) measurements)]
     (reduce (fn [{:keys [min-date max-date]} timestamp]
               {:min-date (if (t/before? timestamp min-date) timestamp min-date)
-               :max-date (if (t/after? timestamp max-date) timestamp max-date)})
+               :max-date (if (t/after? timestamp max-date) timestamp max-date)})
             {:min-date (first parsed-dates)
              :max-date (last parsed-dates)} parsed-dates)))

@@ -157,11 +157,10 @@
 (defn insert-batch [session batch]
   (db/execute session (prepare-batch batch)))

-(defn insert-measurements
+(defn insert-measurements
   "Takes store, lazy sequence of measurements and
    size of the batches and inserts them into the database."
   [store measurements page]
   (db/with-session [session (:hecuba-session store)]
     (doseq [batch (partition-all page measurements)]
       (insert-batch session batch))))
-


taking `inline-deps` opts from both CLI and project map, fixes #49

--- src/leiningen/inline_deps.clj
+++ src/leiningen/inline_deps.clj
@@ -5,8 +5,14 @@
             [mranderson.util :as u])
   (:import [java.util UUID]))

-(defn lookup-opt [opt-key opts]
-  (second (drop-while #(not= % opt-key) opts)))
+(defn- lookup-opt
+  ([opt-key cli-opts project-opts]
+   (lookup-opt opt-key cli-opts project-opts nil))
+
+  ([opt-key cli-opts project-opts not-found]
+   (if-let [cli-subseq (seq (drop-while #(not= % opt-key) cli-opts))]
+     (second cli-subseq)
+     (get project-opts opt-key not-found))))

 (defn- generate-default-project-prefix []
   (str "mranderson" (->  (UUID/randomUUID)
@@ -15,17 +21,14 @@

 (defn- lein-project->ctx
   [{:keys [root target-path name version mranderson]} args]
-  (let [opts                        (map #(edn/read-string %) args)
-        project-prefix-opt          (lookup-opt :project-prefix opts)
-        project-prefix              (or (and project-prefix-opt (clojure.core/name project-prefix-opt))
-                                        (and (nil? project-prefix-opt) (:project-prefix mranderson))
-                                        (generate-default-project-prefix))
-        skip-repackage-java-classes (lookup-opt :skip-javaclass-repackage opts)
-        prefix-exclusions           (lookup-opt :prefix-exclusions opts)
+  (let [cli-opts                    (map edn/read-string args)
+        project-prefix              (some-> (lookup-opt :project-prefix cli-opts mranderson
+                                                        (generate-default-project-prefix))
+                                            clojure.core/name)
+        skip-repackage-java-classes (lookup-opt :skip-javaclass-repackage cli-opts mranderson)
+        prefix-exclusions           (lookup-opt :prefix-exclusions cli-opts mranderson)
         srcdeps-relative            (str (apply str (drop (inc (count root)) target-path)) "/srcdeps")
-        project-source-dirs         (filter fs/directory? (.listFiles (fs/file (str target-path "/srcdeps/"))))
-        unresolved-tree-opt         (lookup-opt :unresolved-tree opts)
-        unresolved-tree             (or unresolved-tree-opt (and (nil? unresolved-tree-opt) (:unresolved-tree mranderson)))]
+        project-source-dirs         (filter fs/directory? (.listFiles (fs/file (str target-path "/srcdeps/"))))]
     (u/debug "skip repackage" skip-repackage-java-classes)
     (u/debug "project mranderson" (prn-str mranderson))
     (u/info "project prefix: " project-prefix)
@@ -36,10 +39,10 @@
      :srcdeps                     srcdeps-relative
      :prefix-exclusions           prefix-exclusions
      :project-source-dirs         project-source-dirs
-     :unresolved-tree             unresolved-tree
-     :overrides                   (:overrides mranderson)
-     :expositions                 (:expositions mranderson)
-     :watermark                   (:watermark mranderson :mranderson/inlined)}))
+     :unresolved-tree             (lookup-opt :unresolved-tree cli-opts mranderson)
+     :overrides                   (lookup-opt :overrides cli-opts mranderson)
+     :expositions                 (lookup-opt :expositions cli-opts mranderson)
+     :watermark                   (lookup-opt :watermark cli-opts mranderson :mranderson/inlined)}))

 (defn- initial-paths [target-path pprefix]
   {:src-path        (fs/file target-path "srcdeps" (u/sym->file-name pprefix))


Support non-multiplexed (aka no replicates or no barcodes) sequencer samples

--- src/aerobio/htseq/common.clj
+++ src/aerobio/htseq/common.clj
@@ -46,7 +46,7 @@
    [aerial.bio.utils.filters :as fil]

    [aerobio.params :as pams]
-   [aerobio.htseq.paired :refer [demux-R2-samp]]
+   [aerobio.htseq.paired :refer [demux-R2-samp demux-R2-samp-no-replicates]]
    [aerobio.pgmgraph :as pg]])

@@ -549,6 +549,10 @@
           (. fd close))))))

+(defn link-hack [R1infq R1otfqs]
+  (doseq [R1otfq R1otfqs]
+    (pg/ln "-s" R1infq R1otfq)))
+
 (defn split-filter-fastqs
   [eid sqxform-fn & {:keys [baseqc% sqc% no-barcodes?]
                      :or {baseqc% 0.96 sqc% 0.97 no-barcodes? false}}]
@@ -582,20 +586,27 @@
       (let [ibc (sample-illumina-xref samp)
             sid ibc]
         (when (barcode-maps ibc)
-          (split-barcodes (sample-ifq-xref samp)
-                          sqxform-fn
-                          (bc-file-specs ibc)
-                          no-barcodes?
-                          (barcode-maps ibc)
-                          (red1codes sid)
-                          qc-ctpt sqc%))))
+          (if no-barcodes?
+            (link-hack (sample-ifq-xref samp)
+                       (vals (bc-file-specs ibc)))
+
+            (split-barcodes (sample-ifq-xref samp)
+                            sqxform-fn
+                            (bc-file-specs ibc)
+                            no-barcodes?
+                            (barcode-maps ibc)
+                            (red1codes sid)
+                            qc-ctpt sqc%)))))

     ;; If we have paired reads (R2 has data) demultiplex R2s
     ;;
-    (when (ifastqs :R2)
-      (let [futs (mapv #(pg/future+ (demux-R2-samp eid %))
-                       (vals illumina-sample-xref))]
-        (mapv deref futs)))
+    (if no-barcodes?
+      (doseq [samp (vals illumina-sample-xref)]
+        (demux-R2-samp-no-replicates eid samp))
+      (when (ifastqs :R2)
+        (let [futs (mapv #(pg/future+ (demux-R2-samp eid %))
+                         (vals illumina-sample-xref))]
+          (mapv deref futs))))

     :success))


Version of compare-bytes that does unsigned comparisons.

Could use some more work to speed it up; I've had a heck of a time
getting clojure to do primitive math on byte objects, and it's very
wasteful to: box to Byte; check it's a Number; convert to Long;
unbox to long; do math; downgrade to byte; upgrade *back* to a long;
compare with (long)0.

--- src/flatland/useful/io.clj
+++ src/flatland/useful/io.clj
@@ -53,11 +53,11 @@
 (defn compare-bytes [^"[B" a ^"[B" b]
   (let [alen (alength a)
         blen (alength b)
-        len (int (min alen blen))]
+        len (min alen blen)]
     (loop [idx 0]
       (if (= idx len)
         (compare alen blen)
-        (let [diff (unchecked-subtract (aget a idx) (aget b idx))]
+        (let [diff (unchecked-byte (unchecked-subtract (aget a idx) (aget b idx)))]
           (if (zero? diff)
             (recur (unchecked-inc-int idx))
             diff))))))


more comments

more comments

--- src/frontend/devtools.cljs
+++ src/frontend/devtools.cljs
@@ -19,6 +19,7 @@
     :actions        (list)
     :next-action-id 0}

+   ; start by dispatching initial component signal
    (when component-signal
      [:component component-signal])])


Rainbow tweaks

Rainbow tweaks

--- src/art/teardrop_rainbow.clj
+++ src/art/teardrop_rainbow.clj
@@ -22,9 +22,10 @@
         y (rand-int (q/height))
         r (random-color)
         g (random-color)
-        b (random-color)]
-    (q/fill r g b)
-    (teardrop x y 50)
+        b (random-color)
+        s (+ 10 (rand-int 50))]
+    (q/fill r g b 220)
+    (teardrop x y s)
     ))

 (defn setup []


better handling of generation failures

better handling of generation failures

--- src/babel/espanol/writer.clj
+++ src/babel/espanol/writer.clj
@@ -74,15 +74,17 @@
                                                        (let [debug (log/debug (str "generating from spec(pre-person):" spec))
                                                              unify-with {:comp {:synsem {:agr {:person person}}}}
                                                              unified (unify/unify spec unify-with)
-
+                                                             debug (if (fail? unified)
+                                                                     (do
+                                                                       (log/info (str "spec=fail:tried to generate with spec(pre-person):" spec))
+                                                                       (log/info (str "spec=fail:tried to generate with unify-with      : " unify-with))))
                                                              spec
                                                              (if (fail? unified)
-                                                               (let [message
-                                                                     (log/warn (str "could not unify " spec " with person specification:" unify-with "."))]
+                                                               (let [message (str "could not unify " spec " with person specification:" unify-with ".")]
                                                                  (if true
                                                                    (do
-                                                                     (log/warn message)
-                                                                     (log/warn (str "Ignoring and continuing."))
+                                                                     (log/debug message)
+                                                                     (log/debug (str "Ignoring and continuing."))
                                                                      unified)
                                                                    (do
                                                                      (log/error message)
@@ -100,12 +102,16 @@
                                                                                {:comp {:synsem {:agr {:number number}}}})]
                                                                    (log/debug (str "generating from spec(2): " spec))
                                                                    (try
-                                                                     (process [{:fill-one-language
-                                                                                {:count 1
-                                                                                :spec spec
-                                                                                :model small
-                                                                                }}]
-                                                                              "es")
+                                                                     (if (fail? spec)
+                                                                       (do
+                                                                         (log/debug (str "ignoring failed spec."))
+                                                                         0)
+                                                                       (process [{:fill-one-language
+                                                                                {:count 1
+                                                                                :spec spec
+                                                                                :model small
+                                                                                }}]
+                                                                                "es"))

                                                                      ;; TODO: move this to *before*
                                                                      ;; attempting generation that fails.
@@ -117,7 +123,7 @@
                                                                          ;; The spec was :fail.
                                                                          (= spec :fail)
                                                                          (if true
-                                                                           (log/warn (str "ignoring spec: :fail : can't generate anything from that."))
+                                                                           (log/warn (str "spec is fail!"))
                                                                            (let [message "spec is fail!"]
                                                                              (log/error message)
                                                                              (throw (Exception. message))))
@@ -135,16 +141,28 @@
                                                                                :2nd)))
                                                                          (log/info (str "ignoring exception(funcionar-is-only-nonhuman): " e))

+
+                                                                         ;; The verb is "funzionare" (which takes a non-human
+                                                                         ;; subject), but we're trying to generate a non-pronoun complement;
+                                                                         ;; there are no such single words in the lexicon that are both
+                                                                         ;; non-human and non-pronoun. There are *human* non-pronouns in the lexicon,
+                                                                         ;; however: proper names like "Juan". If we added a place (e.g. "Madrid"), then
+                                                                         ;; we would have a non-human non-pronoun in the lexicon.
+                                                                         (and
+                                                                          (= (get-in spec [:root :espanol :espanol])
+                                                                             "funcionar")
+                                                                          (= (get-in spec [:comp :synsem :pronoun])
+                                                                             false))
+                                                                         (log/info (str "ignoring exception(funcionar-is-only-pronoun): " e))
+
                                                                          ;; "llamarse": there is currently only singular
-                                                                         ;; proper male names, so any attempt to use
+                                                                         ;; proper singular names, so any attempt to use
                                                                          ;; plural number with this verb will fail.
                                                                          (and
                                                                           (= (get-in spec [:root :espanol :espanol])
                                                                              "llamarse")
                                                                           (or (= (get-in spec [:comp :synsem :agr :number])
                                                                                :plur)
-                                                                              (= (get-in spec [:comp :synsem :agr :gender])
-                                                                                :fem)
                                                                               (and (not (= (get-in spec [:synsem :sem :tense])
                                                                                :present))
                                                                                (not (= (get-in spec [:synsem :sem :aspect])
@@ -154,6 +172,14 @@
                                                                                (= (get-in spec [:synsem :sem :aspect])
                                                                                :progressive))))
                                                                          (log/info (str "ignoring exception(llamarse-is-only-singular and present): " e))
+
+                                                                         ;; "llamarse": subject must be a pronoun
+                                                                         (and
+                                                                          (= (get-in spec [:root :espanol :espanol])
+                                                                             "llamarse")
+                                                                          (= (get-in spec [:comp :synsem :pronoun])
+                                                                             false))
+                                                                         (log/info (str "ignoring exception(llamarse-requires-pronoun-as-subject): " e))

                                                                          true
                                                                          (do


Unbreak schema-reduce on nested sequence schema.

--- src/active/clojure/config.cljc
+++ src/active/clojure/config.cljc
@@ -489,6 +489,7 @@
 (declare schema-range)

 (defn- schema-reduce
+  ;; FIXME: docstring
   [schema range path f res val]
   (cond
     (map-schema? schema)
@@ -503,20 +504,25 @@
                    (conj path (setting-key setting))
                    f res v)
                   ;; if not a setting, it must be a section:
-                  (let [section (get sections k)]
-                    (schema-reduce (section-schema section)
-                                   (schema-range (section-schema section))
+                  (let [section (get sections k)
+                        schema (section-schema section)]
+                    (schema-reduce schema
+                                   (schema-range schema)
                                    (conj path (section-key section))
                                    f res v))))
               res
               cmap))

+    ;; FIXME: test for this case
     (sequence-schema? schema)
     (let [v ((range-completer range) range path val)
-          element-schema (sequence-schema-element-schema schema)]
+          element-schema (sequence-schema-element-schema schema)
+          element-range (schema-range element-schema)]
       (c/assert (not (range-error? v)) (pr-str v))
       (reduce (fn [res [i x]]
-                (schema-reduce element-schema (conj path i) f res x))
+                (schema-reduce element-schema
+                               element-range
+                               (conj path i) f res x))
               res
               (map-indexed vector v)))))


Fix missing space before nil function ranges.

--- src/afterglow/fixtures/qxf.clj
+++ src/afterglow/fixtures/qxf.clj
@@ -113,7 +113,7 @@
          (str " {:type " (keyword (sanitize-name (str prefix (:label cap))))
               "\n" (apply str (repeat (+ 32 (count (str (:min cap)))) " ")) ":label \"" (:label cap)
               "\"\n" (apply str (repeat (+ 32 (count (str (:min cap)))) " ")) ":range :variable}")
-         "nil")))
+         " nil")))

 (defn- define-channel
   "Generates a function call which defines the specified


Change all ;;; to ;;.

Change all ;;; to ;;.

--- test/com/nomistech/clojure_the_language/clojure_numerics_test.clj
+++ test/com/nomistech/clojure_the_language/clojure_numerics_test.clj
@@ -4,9 +4,9 @@
 ;;;; ___________________________________________________________________________
 ;;;; ---- Terminology ----

-;;; The phrase "equivalent value" is used when two numbers, possibly of
-;;; different types, are the same value as seen from the point of view of
-;;; mathematics. So, for example, 2 and 2.0 are equivalent values.
+;; The phrase "equivalent value" is used when two numbers, possibly of
+;; different types, are the same value as seen from the point of view of
+;; mathematics. So, for example, 2 and 2.0 are equivalent values.

 ;;;; ___________________________________________________________________________
 ;;;; ---- Clojure's numeric types ----
@@ -51,17 +51,17 @@
 (fact "Ratios are turned into Longs if possible"
   (type 4/2) => Long)

-;;; From /Clojure Programming/, p427: "double is the only representation that
-;;; is inherently inexact".
+;; From /Clojure Programming/, p427: "double is the only representation that
+;; is inherently inexact".

 ;;;; ___________________________________________________________________________
 ;;;; ---- `identical?` ----
 ;;;; The doc string:
 ;;;;   Tests whether two arguments are the same object.

-;;; /Clojure Programming/ p433 says:
-;;;   In general, numbers will never be identical?, even if provided as
-;;;   literals.
+;; /Clojure Programming/ p433 says:
+;;   In general, numbers will never be identical?, even if provided as
+;;   literals.

 (fact "In general, two numbers created from two same-looking literals are not identical"
   (fact (identical? 2000 2000) => false)
@@ -104,26 +104,26 @@
 ;;;;   structures define equals() (and thus =) as a value, not an identity,
 ;;;;   comparison.

-;;; I think there's a problem with the doc string:
-;;; - What does it mean by "in a type-independent manner"?
-;;;   - Is this defined in any authoritative place?
-;;;   - The doc string for `==` uses the phrase "type-independent" with a
-;;;     different (and, to me, intuitive) meaning.
-;;; - I would expect e.g. (= 2 2M) => true, but that's not so.
-;;;   - I'm not the only one:
-;;;     - See http://dev.clojure.org/jira/browse/CLJ-1333.
-
-;;; Jeez, Clojure is poorly specified in places.
-
-;;; /Clojure Programming/ p433-444 was helpful.
-
-;;; We need the notion of categories of numbers. (Is this defined in any
-;;; authoritative place?)
-;;; - We have:
-;;;   - integers (e.g. 2, 2N)
-;;;   - ratios (e.g. 2/3)
-;;;   - arbitrary-precision decimals (e.g. 2M, 2.0M)
-;;;   - limited-precision decimals (e.g. 2.0, (Float. 2.0))
+;; I think there's a problem with the doc string:
+;; - What does it mean by "in a type-independent manner"?
+;;   - Is this defined in any authoritative place?
+;;   - The doc string for `==` uses the phrase "type-independent" with a
+;;     different (and, to me, intuitive) meaning.
+;; - I would expect e.g. (= 2 2M) => true, but that's not so.
+;;   - I'm not the only one:
+;;     - See http://dev.clojure.org/jira/browse/CLJ-1333.
+
+;; Jeez, Clojure is poorly specified in places.
+
+;; /Clojure Programming/ p433-444 was helpful.
+
+;; We need the notion of categories of numbers. (Is this defined in any
+;; authoritative place?)
+;; - We have:
+;;   - integers (e.g. 2, 2N)
+;;   - ratios (e.g. 2/3)
+;;   - arbitrary-precision decimals (e.g. 2M, 2.0M)
+;;   - limited-precision decimals (e.g. 2.0, (Float. 2.0))

 ;;;; ---------------------------------------------------------------------------
 ;;;; ---- Things that are fine ----
@@ -162,51 +162,51 @@
   (fact (= 2N 2M)    => false)
   (fact (= 1.25 5/4) => false))

-;;; From /Clojure Programming/:
-;;;   Clojure’s `=` could obviate these type differences (as Ruby and Python
-;;;   do), but doing so would impose some runtime cost that would be
-;;;   unappreciated by those who need to maximize the performance of programs
-;;;   that work with homogeneous numeric data.
+;; From /Clojure Programming/:
+;;   Clojure’s `=` could obviate these type differences (as Ruby and Python
+;;   do), but doing so would impose some runtime cost that would be
+;;   unappreciated by those who need to maximize the performance of programs
+;;   that work with homogeneous numeric data.

 ;;;; ---------------------------------------------------------------------------
 ;;;; ---- My playing ----

-;;; Shows that "same category" is A Thing, as /Clojure Programming/ says. Shows
-;;; that the doc string's "type-independent manner" is wrong (according to what
-;;; I think that should mean).
-
-;;; Summary, showing the equivalence classes apart from Ratios:
+;; Shows that "same category" is A Thing, as /Clojure Programming/ says. Shows
+;; that the doc string's "type-independent manner" is wrong (according to what
+;; I think that should mean).
+
+;; Summary, showing the equivalence classes apart from Ratios:
 ;;;
-;;;   Key to the table entries:
+;;   Key to the table entries:
 ;;;
-;;;         =   means   (= x y) is true
-;;;         .   means   (= x y) is false
-;;;             where x is the row value and y is the column value
+;;         =   means   (= x y) is true
+;;         .   means   (= x y) is false
+;;             where x is the row value and y is the column value
 ;;;
-;;;       F2.0  means   (Float. 2.0)
+;;       F2.0  means   (Float. 2.0)
 ;;;
-;;;
-;;;              --------------------------------------
-;;;        =     |   2  2N   |  2M 2.0M  |  2.0  F2.0 |
-;;;     -----------------------------------------------
-;;;     |        |           |           |            |
-;;;     |  2     |   =   =   |   .   .   |   .   .    |
-;;;     |        |           |           |            |
-;;;     |  2N    |   =   =   |   .   .   |   .   .    |
-;;;     |        |           |           |            |
-;;;     -----------------------------------------------
-;;;     |        |           |           |            |
-;;;     |  2M    |   .   .   |   =   =   |   .   .    |
-;;;     |        |           |           |            |
-;;;     |  2.0M  |   .   .   |   =   =   |   .   .    |
-;;;     |        |           |           |            |
-;;;     -----------------------------------------------
-;;;     |        |           |           |            |
-;;;     |  2.0   |   .   .   |   .   .   |   =   =    |
-;;;     |        |           |           |            |
-;;;     |  F2.0  |   .   .   |   .   .   |   =   =    |
-;;;     |        |           |           |            |
-;;;     -----------------------------------------------
+;;
+;;              --------------------------------------
+;;        =     |   2  2N   |  2M 2.0M  |  2.0  F2.0 |
+;;     -----------------------------------------------
+;;     |        |           |           |            |
+;;     |  2     |   =   =   |   .   .   |   .   .    |
+;;     |        |           |           |            |
+;;     |  2N    |   =   =   |   .   .   |   .   .    |
+;;     |        |           |           |            |
+;;     -----------------------------------------------
+;;     |        |           |           |            |
+;;     |  2M    |   .   .   |   =   =   |   .   .    |
+;;     |        |           |           |            |
+;;     |  2.0M  |   .   .   |   =   =   |   .   .    |
+;;     |        |           |           |            |
+;;     -----------------------------------------------
+;;     |        |           |           |            |
+;;     |  2.0   |   .   .   |   .   .   |   =   =    |
+;;     |        |           |           |            |
+;;     |  F2.0  |   .   .   |   .   .   |   =   =    |
+;;     |        |           |           |            |
+;;     -----------------------------------------------

 (fact "Two numbers of the same type and with equivalent value are equal using `=`"
@@ -260,13 +260,13 @@
 ;;;;   Returns non-nil if nums all have the equivalent value (type-independent),
 ;;;;   otherwise false.

-;;; The doc string uses the phrase "type-independent" in a way that is (to me)
-;;; intuitive, but which has a different meaning to that in the doc string for
-;;; `=`.
-
-;;; From /Clojure Programming/:
-;;;   Clojure opts to provide a third notion of equality, specifically to
-;;;   address the need for type-insensitive equivalence tests.
+;; The doc string uses the phrase "type-independent" in a way that is (to me)
+;; intuitive, but which has a different meaning to that in the doc string for
+;; `=`.
+
+;; From /Clojure Programming/:
+;;   Clojure opts to provide a third notion of equality, specifically to
+;;   address the need for type-insensitive equivalence tests.

 (fact "Numbers with an equivalent value are equal using `==`"
   (== (Byte. (byte 2))


Protect in case of missing <pre> in highlight

The patch adds a some-> so that we avoid NullPointerExceptions if <pre> tags
are missing in the posts.

--- src/io/perun/highlight.clj
+++ src/io/perun/highlight.clj
@@ -8,12 +8,12 @@

 (defn- extract-code
   [highlighted]
-  (-> highlighted
-      java.io.StringReader.
-      enlive/html-resource
-      (enlive/select [:pre])
-      first
-      :content))
+  (some-> highlighted
+          java.io.StringReader.
+          enlive/html-resource
+          (enlive/select [:pre])
+          first
+          :content))

 (defn- highlight [node]
   (let [code (->> node :content (apply str))


Fix read-binary function.

Fix read-binary function.

--- src/konserve/filestore.clj
+++ src/konserve/filestore.clj
@@ -373,7 +373,7 @@
             (write-edn-key serializer write-handlers read-handlers (str folder "/meta/") fn {:key key :format :binary} config)
             (delete-entry (str "/B_" fn) folder config)
             (read-binary f res-ch folder fn key locked-cb)))
-        (async/thread (read-binary f res-ch folder fn key locked-cb)))))
+        (read-binary f res-ch folder fn key locked-cb))))

   (-bassoc [this key input]
     (let [file-name  (uuid key)


Add new t2.large instances

Add new t2.large instances

--- src/maestro/validators.clj
+++ src/maestro/validators.clj
@@ -76,6 +76,7 @@
     "r3.8xlarge"
     "r3.large"
     "r3.xlarge"
+    "t2.large"
     "t2.medium"
     "t2.micro"
     "t2.small"})


Read product name from statistic-for-week

--- src/arachnida/db_interface.clj
+++ src/arachnida/db_interface.clj
@@ -118,6 +118,7 @@
 (defn read-statistic-for-week-from-db
     [first-day last-day author]
     (jdbc/query db-spec/data-db ["select repo,
+                                         (select name from products where products.id=commits.product) as product,
                                          (select name from repos where repos.id=commits.repo) as reponame,
                                          count(*) as commits,
                                          sum(files_changed) as files,
@@ -127,7 +128,7 @@
                                  where date between ? and ?
                                    and author=?
                                  group by repo
-                                 order by repo" first-day last-day author]))
+                                 order by product, repo" first-day last-day author]))

 (defn read-commits-for-week
     [first-day last-day author]


fix typo

fix typo

--- src/clj/lesezeichen/core.clj
+++ src/clj/lesezeichen/core.clj
@@ -71,7 +71,7 @@
         (case topic
           :get-user-bookmarks {:topic topic :data (get-user-bookmarks conn data)}
           :get-all-bookmarks {:topic topic :data (get-all-bookmarks conn)}
-          :sign-up {:topic topic :data (add-user conn (:assoc data :host (:mail-host state)))}
+          :sign-up {:topic topic :data (add-user conn (assoc data :host (:mail-host state)))}
           :register-device {:topic topic :data (register-device conn data)}
           :add-bookmark {:topic topic :data (add-bookmark conn (assoc data :title (fetch-url-title (:url data))))}
           :verify-token (handle-token state channel msg)


add slider

add slider

--- src/cljs/calligrid/core.cljs
+++ src/cljs/calligrid/core.cljs
@@ -3,7 +3,7 @@

 (enable-console-print!)

-(defonce app-state (atom {:number-of-lines 7
+(defonce app-state (atom {:number-of-lines 10
                           :distance 30}))

 (defn line [y]
@@ -12,13 +12,17 @@
 (defn lines [nol dist]
   (for [y (range 5 (* nol dist) dist)]
     (line y)))
+
+(defn change-function [e] (.log js/console (.. e -target -value)))
+
+(defn slider-change [event] (.log js/console event))

 (defn page []
   (let [{:keys [number-of-lines distance]} @app-state]
     [:div
+     [:input {:type "range" :min 10 :max 30 :step 1 :on-change slider-change}]
      [:h1 (str "number of lines: " number-of-lines)]
      [:svg {:width 600 :height 800}
       (lines number-of-lines distance)]]))

 (reagent/render [page] (js/document.getElementById "app"))
-


Fix grammar for game count when there are zero games

This is not going to be seen often by users (hopefully).  But it may in
the case when the game server is down.  It just bugs me when I'm running
the server during development.

--- src/cljs/netrunner/main.cljs
+++ src/cljs/netrunner/main.cljs
@@ -50,7 +50,7 @@
     [:div
      [:div.float-right
       (let [c (count (:games cursor))]
-        (str c " Game" (when (> c 1) "s")))]
+        (str c " Game" (when (not= c 1) "s")))]
      (when-let [game (some #(when (= (:gameid cursor) (:gameid %)) %) (:games cursor))]
        (when (:started game)
          [:div.float-right


cleanup

cleanup

--- src/babel/english/grammar.cljc
+++ src/babel/english/grammar.cljc
@@ -181,8 +181,7 @@
    hc-agreement
    head-principle
    head-last
-   {
-    :schema-symbol 'c11 ;; used by over-each-parent to know where to put children.
+   {:schema-symbol 'c11 ;; used by over-each-parent to know where to put children.
     :comment "c11"}))

 ;; TODO: names like "c11-comp-subcat-1" have no human-discernible meaning:


+sem.gender = masc; sem.person = sing

+sem.gender = masc; sem.person = sing

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -842,7 +842,9 @@
              :subcat '()}}

    "his" {:synsem {:cat :det
-                   :sem {:pred :lui}
+                   :sem {:pred :lui
+                         :gender :masc
+                         :person :sing}
                    :def :possessive}}

    "hit" {:english {:past "hit"}


pronoun=false for 2nd arg

pronoun=false for 2nd arg

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -148,6 +148,7 @@
                                        :2 {:cat :noun
                                            :agr subj-agr
                                            :sem the-obj
+                                           :pronoun false
                                            :propernoun true ;; "John" in "My name is John"
                                            }
                                        } ;; subcat {


whitespace

whitespace

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -358,7 +358,6 @@
                     :reflexive false
                     :subj {:animate true}
                     :obj {:drinkable true}}}}
-
    "bianco"
    (unify adjective
           {:synsem {:cat :adjective
@@ -369,7 +368,6 @@
            :italiano {:masc {:plur "bianchi"}
                       :fem {:plur "bianche"}
                       :cat :adjective}})
-
    "birra"
    (unify agreement-noun
            drinkable-noun


pred from tenere to hold

pred from tenere to hold

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -752,6 +752,8 @@
       "desiderare"  {:synsem {:cat :verb
                               :sem {:pred :desire}}}

+
+
       "di"
       {:synsem {:cat :prep
                 :sem {:pred :di
@@ -1744,7 +1746,7 @@
                            :sem {:pred :telefonare}}}

    "tenere"  {:synsem {:cat :verb
-                      :sem {:pred :tenere}}
+                      :sem {:pred :hold}}
               :italiano {:passato "tenuto"
                          :present {:1sing "tengo"
                                    :2sing "tieni"


Remove debug logging :page_facing_up:

Remove debug logging :page_facing_up:

--- src/metabase/api/field.clj
+++ src/metabase/api/field.clj
@@ -39,7 +39,6 @@

   (let-404 [field (Field id)]
     (write-check field)
-    (println "special_type:" special_type) ; NOCOMMIT
     (let [special_type       (keyword (get body :special_type (:special_type field)))
           visibility_type    (or visibility_type (:visibility_type field))
           ;; only let target field be set for :fk type fields, and if it's not in the payload then leave the current value


update task descriptions

update task descriptions

--- src/metabase/api/setup.clj
+++ src/metabase/api/setup.clj
@@ -108,9 +108,9 @@
       :link        "/admin/databases/create"
       :completed   has-dbs?
       :triggered   :always}
-     {:title       "Set email credentials"
+     {:title       "Set up email"
       :group       "Get connected"
-      :description "TODO - Write something good here"
+      :description "Add email credentials so you can more easily invite team members and get updates via Pulses."
       :link        "/admin/settings/?section=Email"
       :completed   (email/email-configured?)
       :triggered   :always}
@@ -120,29 +120,29 @@
       :link        "/admin/settings/?section=Slack"
       :completed   (slack/slack-configured?)
       :triggered   :always}
-     {:title       "Invite other users"
+     {:title       "Invite team members"
       :group       "Get connected"
-      :description "TODO - Write something good here"
+      :description "Share answers and data with the rest of your team."
       :link        "/admin/people/"
       :completed   (>= num-users 1)
       :triggered   (or has-dashboards?
                        has-pulses?
                        (>= num-cards 5))}
-     {:title       "Hide tables"
+     {:title       "Hide irrelevant tables"
       :group       "Curate your data"
-      :description "TODO - Write something good here"
+      :description "If your data contains technical or irrelevant info you can hide it."
       :link        "/admin/datamodel/database"
       :completed   has-hidden-tables?
       :triggered   (>= num-tables 20)}
      {:title       "Organize questions"
       :group       "Curate your data"
-      :description "TODO - Write something good here"
+      :description "Have a lot of saved questions in Metabase? Create labels to help manage them and add context."
       :link        "/questions/all"
       :completed   (not has-labels?)
       :triggered   (>= num-cards 30)}
      {:title       "Create metrics"
       :group       "Curate your data"
-      :description "TODO - Write something good here"
+      :description "Define canonical metrics to make it easier for the rest of your team to get the right answers."
       :link        "/admin/datamodel/database"
       :completed   has-metrics?
       :triggered   (>= num-cards 30)}
@@ -152,9 +152,9 @@
       :link        "/admin/datamodel/database"
       :completed   has-segments?
       :triggered   (>= num-cards 30)}
-     {:title       "Create getting started guide"
+     {:title       "Create a getting started guide"
       :group       "Curate your data"
-      :description "TODO - Write something good here"
+      :description "Have a lot of data in Metabase? A getting started guide can help your team find their way around."
       :completed   false                               ; TODO - how do we determine this?
       :triggered   (and (>= num-cards 10)
                         (>= num-users 5))}]))


Add comments in wpml/img fn.

Add comments in wpml/img fn.

--- src/bakyeono/litedocx/wpml.clj
+++ src/bakyeono/litedocx/wpml.clj
@@ -701,7 +701,20 @@
   "Returns XML tag node of image.

   Parameters:
-  ..."
+  - resource-id: <string> Resource id of image. You set this id with make-resource function.
+  - & options: option, value, ...
+
+  Options:
+  - table-align: Alignment of table itself. Values: left, right, both, ...
+  - cell-margin-top: Margin in this side of cell. Value: numbers.
+  - cell-margin-left: Same as above.
+  - cell-margin-bottom: Same as above.
+  - cell-margin-right: Same as above.
+  - cell-h-align: Horizontal alignment inside cells. Values: left, right, both, ...
+  - cell-v-align: Vertical alignment inside cells. Values: top, bottom, center, ...
+
+  Examples:
+  - TODO"
   [resource-id
    & {:as options
       :keys [name desc width height
@@ -731,4 +744,3 @@
                                                             :noChangeAspect (if no-change-aspect? true false)}))
                           ;; Graphic
                           (graphic resource-id options))))))
-


Tweak uncaught exception handler to use timbre's exception logging

--- src/braid/core/server/core.clj
+++ src/braid/core/server/core.clj
@@ -37,8 +37,7 @@
   (Thread/setDefaultUncaughtExceptionHandler
    (reify Thread$UncaughtExceptionHandler
      (uncaughtException [_ thread ex]
-       (timbre/errorf "Uncaught exception %s on %s" ex (.getName thread))
-       (.printStackTrace ex)))))
+       (timbre/errorf ex "Uncaught exception on %s" (.getName thread))))))

 (defstate thread-handler
   :start (set-default-exception-handler))


Polish output of the '--list-obsolete-data' command

--- src/cyanite_remover/core.clj
+++ src/cyanite_remover/core.clj
@@ -18,7 +18,7 @@

 (def ^:const pbar-width 35)

-(def stats-processed (atom 0))
+(def inspecting? (atom false))

 (def list-metrics-str "Path: %s, rollup: %s, period: %s, time: %s, data: %s")
 (def starting-str "==================== Starting ====================")
@@ -36,6 +36,11 @@
   (pp-get-title [this])
   (pp-process [this path])
   (pp-show-stats [this errors]))
+
+(defn- set-inspecting-on!
+  "Set the inspecting flag on."
+  []
+  (swap! inspecting? (fn [_] true)))

 (defn- lookup-paths
   "Lookup paths."
@@ -252,6 +257,7 @@
   [tenant rollups paths cass-hosts es-url options]
   (try
     (clog/disable-logging!)
+    (set-inspecting-on!)
     (process-metrics tenant rollups paths cass-hosts
                      (pstore/elasticsearch-path-store es-url options) options
                      list-metrics-processor)
@@ -327,19 +333,22 @@
   [tenant paths es-url options]
   (try
     (clog/disable-logging!)
+    (set-inspecting-on!)
     (process-paths tenant paths (pstore/elasticsearch-path-store es-url options)
                    options list-paths-processor)
     (catch Exception e
       (clog/unhandled-error e))))

 (defn- check-metric-obsolete
+  "Check a metric for obsolescence."
   [mstore tenant from path rollup-def]
   (let [rollup (first rollup-def)
         period (last rollup-def)]
-    (clog/info (str "Checking metrics: "
-                    "path: " path ", "
-                    "rollup: " rollup ", "
-                    "period: " period))
+    (when-not @inspecting?
+      (clog/info (str "Checking metrics: "
+                      "path: " path ", "
+                      "rollup: " rollup ", "
+                      "period: " period)))
     (let [data (mstore/fetch mstore tenant rollup period path from nil 1)
           obsolete? (not (seq data))]
       (if obsolete?
@@ -359,11 +368,12 @@
      "[:bar] :percent :done/:total Elapsed :elapseds ETA :etas")
     (prog/config-progress-bar! :width pbar-width)
     (newline)
-    (clog/info (str title ":"))
-    (clog/info (str "Threshold: " threshold ", "
-                    "from: " from " ("
-                    (timef/unparse (:rfc822 timef/formatters)
-                                   (timec/from-long (* from 1000))) ")"))
+    (clog/info (str title (if @inspecting? "..." ":")))
+    (when-not @inspecting?
+      (clog/info (str "Threshold: " threshold ", "
+                      "from: " from " ("
+                      (timef/unparse (:rfc822 timef/formatters)
+                                     (timec/from-long (* from 1000))) ")")))
     (when-not @clog/print-log?
       (println title)
       (prog/init (count paths-rollups)))
@@ -447,6 +457,7 @@
   [tenant rollups paths cass-hosts es-url options]
   (try
     (clog/disable-logging!)
+    (set-inspecting-on!)
     (let [tpool (get-thread-pool options)
           mstore (mstore/cassandra-metric-store cass-hosts options)
           pstore (pstore/elasticsearch-path-store es-url options)


Return a delayed map instead of future in new producer/send.

--- src/clj_kafka/new/producer.clj
+++ src/clj_kafka/new/producer.clj
@@ -3,7 +3,7 @@
   http://kafka.apache.org/082/javadoc/org/apache/kafka/clients/producer/package-summary.html"}
   clj-kafka.new.producer
   (:refer-clojure :exclude [send])
-  (:import [org.apache.kafka.clients.producer Callback KafkaProducer ProducerRecord]
+  (:import [org.apache.kafka.clients.producer Callback KafkaProducer ProducerRecord RecordMetadata]
            [org.apache.kafka.common.serialization Serializer ByteArraySerializer StringSerializer]))

 (defn string-serializer [] (StringSerializer.))
@@ -32,17 +32,26 @@
   ([topic partition key value]
    (ProducerRecord. topic partition key value)))

+(defn- record-metadata->map
+  [^RecordMetadata m]
+  {:topic (.topic m)
+   :partition (.partition m)
+   :offfset (.offset m)})
+
 (defn send
-  "Asynchronously send a record to Kafka. Returns a `Future` with
-  `RecordMetadata`. Optionally provide a callback fn that will be
-  called when operation completes. Callback should be a fn of two
-  arguments, a `RecordMetadata` instance, and an exception. Exception
-  will be nil if operation succeeded.
+  "Asynchronously send a record to Kafka. Returns a map with `:topic`,
+  `:partition` and `:offset` keys, wrapped in a delay. Derefing delay
+  will block until the underlying future completes. Optionally provide
+  a callback fn that will be called when the operation completes.
+  Callback should be a fn of two arguments, a map as above, and an
+  exception. Exception will be nil if operation succeeded.

   For details on behaviour, see http://kafka.apache.org/082/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord,org.apache.kafka.clients.producer.Callback)"
   ([^KafkaProducer producer record]
-   (.send producer record))
+   (let [fut (.send producer record)]
+     (delay (record-metadata->map @fut))))
   ([^KafkaProducer producer record callback]
-   (.send producer record (reify Callback
-                            (onCompletion [_ metadata exception]
-                              (callback metadata exception))))))
+   (let [fut (.send producer record (reify Callback
+                                      (onCompletion [_ metadata exception]
+                                        (callback (and metadata (record-metadata->map metadata)) exception))))]
+     (delay (record-metadata->map @fut)))))


Set default language

Set default language

--- src/cljc/salava/core/i18n.cljc
+++ src/cljc/salava/core/i18n.cljc
@@ -25,7 +25,7 @@
 #?(:clj  (defn t [key] (get-t "en" key))

    :cljs (defn t [& keylist]
-           (let [lang (session/get-in [:user :lang])]
+           (let [lang (or (session/get-in [:user :lang]) :en)]
              (if (session/get :i18n-editable)
                (tr/get-editable translation lang keylist)
                (apply str (map (fn [k] (if (keyword? k) (get-t lang k) k)) keylist))))))


switch rscs btns order

switch rscs btns order

--- src/cljs/lokate/resources.cljs
+++ src/cljs/lokate/resources.cljs
@@ -15,10 +15,10 @@
     (om/build c/drawer-nav-panel
       [drawer
        (c/title-return-banner "resources" #(u/route! % :home))
-       [(om/build c/btn ["icon-flow-line rsc-btn"
-                         #(async/put! % [:add-resource])])
-        (om/build c/btn ["icon-flow-tree rsc-btn"
-                         #(async/put! % [:add-resource-cluster])])]])))
+       [(om/build c/btn ["icon-flow-tree rsc-btn"
+                         #(async/put! % [:add-resource-cluster])])
+        (om/build c/btn ["icon-flow-line rsc-btn"
+                         #(async/put! % [:add-resource])])]])))

 (defn rsc-types-drawer-view
   [[view-data resources] owner]


C views: Add two TODOs about searching

C views: Add two TODOs about searching

--- src/cljs/theatralia/views.cljs
+++ src/cljs/theatralia/views.cljs
@@ -85,6 +85,10 @@
       (kioo/component "templates/sandbox.html" [:#search-results]
         {[:ol] (kioo/content (map result-item @results-ra))}))))

+;; TODO: Show a warning when the search string begins with ? or *. – They are
+;;       not allowed in full text queries. On the other hand: we are not going
+;;       to use Datomic full text search as our search anyway. (RM 2015-09-10)
+;; TODO: Prevent empty searches. (RM 2015-09-10)
 (defn search-view
   "A group of components for searching materials."
   []


Updated routes for deployment.

Updated routes for deployment.

--- src/cmr/opendap/rest/route.clj
+++ src/cmr/opendap/rest/route.clj
@@ -17,7 +17,7 @@

 (defn ous
   [httpd-component]
-  [["/opendap/ous/collections" {
+  [["/ous/collections" {
     :post {
       :handler collection-handler/batch-generate
       ;; XXX protecting collections will be a little different than
@@ -28,7 +28,7 @@
       ;:permission #{...}
       }
     :options core-handler/ok}]
-   ["/opendap/ous/collection/:concept-id" {
+   ["/ous/collection/:concept-id" {
     :get {
       :handler collection-handler/generate-urls
       :permissions #{:read}}
@@ -44,7 +44,7 @@
 (defn static
   [httpd-component]
   (let [docroot (config/http-docroot httpd-component)]
-    [["/static/*" {
+    [["/site/*" {
       :get (core-handler/static-files docroot)}]]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


fix: [bug] class "radio" not getting applied

--- src/bulk_trader/core.cljs
+++ src/bulk_trader/core.cljs
@@ -113,7 +113,7 @@
     (render [this]
       (dom/form #js {:action "#"}
                (dom/h3 nil "Select Trader")
-               (apply dom/div "radio"
+               (apply dom/div #js {:className "radio"}
                       (om/build-all trader-view traders))
                (dom/div nil
                         (dom/label nil


New problem added

New problem added