Further work on normalization algorithm

Further work on normalization algorithm

(model-gcis paper-model) works again, but for family-model we get too
much implications. Algorithm is still not complete.

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

--- src/conexp/contrib/dl/languages/description_graphs.clj
+++ src/conexp/contrib/dl/languages/description_graphs.clj
@@ -61,6 +61,18 @@
     (.write out (.trim output))))

 ;;; Normalizing
+
+(defn- conjunctors
+  "Returns the elements of the dl-expression connected by
+  conjunction. If the dl-expression is not a conjunction the singelton
+  set containing the expression is returned."
+  [dl-expr]
+  (if (and (compound? dl-expr)
+	   (= 'and (operator dl-expr)))
+    (set (arguments dl-expr))
+    (set [dl-expr])))
+
+;; tboxes as hash-maps

 (defn- uniquify-tbox-map
   "Renames all defined concepts in the given tbox-map to be globally
@@ -73,16 +85,6 @@
 		[(old->new A) (set (map #(substitute % old->new) def-A))]))
      old->new]))

-(defn- conjunctors
-  "Returns the elements of the dl-expression connected by
-  conjunction. If the dl-expression is not a conjunction the singelton
-  set containing the expression is returned."
-  [dl-expr]
-  (if (and (compound? dl-expr)
-	   (= 'and (operator dl-expr)))
-    (set (arguments dl-expr))
-    (set [dl-expr])))
-
 (defn- tbox->hash-map
   "Transforms given TBox to a hash-map of defined concepts to the sets
   of concepts in the top-level conjunction."
@@ -97,18 +99,60 @@
 		      (make-dl-definition language A (cons 'and def-A)))]
     (make-tbox language (set definitions))))

+;; storing names
+
+(defn- new-names
+  "Returns a fresh data structure for storing new names."
+  []
+  (atom {}))
+
+(defn- add-name
+  "Adds to names the set-of-concepts under name."
+  [names name set-of-concepts]
+  (swap! names conj [name set-of-concepts]))
+
+(defn- add-names
+  "Adds the tbox-map to names."
+  [names tbox-map]
+  (swap! names into tbox-map))
+
+(defn- get-names
+  "Returns all names and their definitions (i.e. their set of
+  concepts) stored in names."
+  [names]
+  @names)
+
+;; normalizing algorithm - preparing the tbox and introducing new definitions
+
 (defn- normalize-for-goal
   "If term satisfies goal, regards it as being normalized. Otherwise
   handles term as tbox and finally introduces a new symbol defining
-  term."
-  [term goal]
+  term. New definitions go into the atom new-names."
+  [term goal new-names]
   (cond
-   (goal term) [term {}]
+   (goal term) term
    (tbox-target-pair? term) (let [[tbox target] (expression term),
 				  [tbox-map trans] (uniquify-tbox-map (tbox->hash-map tbox))]
-			      [(trans target) tbox-map])
+			      (add-names new-names tbox-map)
+			      (trans target))
    :else (let [new-sym (gensym)]
-	   [new-sym {new-sym (conjunctors term)}])))
+	   (add-name new-names new-sym (conjunctors term))
+	   new-sym)))
+
+(defn- normalize-term
+  "Normalizes conjunctor term. New definitions go into the atom new-names."
+  [term new-names]
+  (if (and (compound? term)
+	   (= 'exists (operator term)))
+    (let [[r B] (arguments term),
+	  norm (normalize-for-goal B
+				   #(and (atomic? %)
+					 (not (tbox-target-pair? %))
+					 (not (primitive? %)))
+				   new-names)]
+      (make-dl-expression (expression-language term)
+			  (list 'exists r norm)))
+    (normalize-for-goal term primitive? new-names)))

 (defn- introduce-auxiliary-definitions
   "Introduces auxiliary definitions into the given tbox-map (as
@@ -118,23 +162,17 @@
   [tbox-map]
   (if (empty? tbox-map)
     tbox-map
-    (let [normalizer (fn [term]
-		       (if (and (compound? term)
-				(= 'exists (operator term)))
-			 (let [[r B] (arguments term),
-			       [norm new-defs] (normalize-for-goal B #(and (atomic? %) (not (primitive? %))))]
-			   [(make-dl-expression (expression-language term)
-						(list 'exists r norm))
-			    new-defs])
-			 (normalize-for-goal term primitive?))),
-	  normalized-terms (map (fn [[A def-A]]
-				  [A (set (map normalizer def-A))])
-				tbox-map)]
-      (reduce (fn [tbox-map [target set-of-pairs]]
-		(apply merge tbox-map [target (set (map first set-of-pairs))]
-		                      (introduce-auxiliary-definitions (apply merge (map second set-of-pairs)))))
-	      {}
-	      normalized-terms))))
+    (let [new-names (new-names),
+	  ;; doall needed to store new names in new-names!
+	  normalized-map (doall (map (fn [[A def-A]]
+				       [A (set (map #(normalize-term % new-names) def-A))])
+				     tbox-map)),
+	  new-names-map (introduce-auxiliary-definitions (get-names new-names))]
+      (into normalized-map new-names-map))))
+
+;; normalizing algorithm -- squeezing the concept graph
+
+;; normalizing algorithm -- invokaction point

 (defn- normalize-gfp
   "Normalizes given TBox with gfp-semantics."


[frontend]: Performance improvement

[frontend]: Performance improvement

- ~80ms on 10 000 components

--- frontend/src/warehouse/util.cljs
+++ frontend/src/warehouse/util.cljs
@@ -68,9 +68,10 @@
                   {}
                   (interleave (map :id (:components document))
                               (map (fn [component]
-                                     (into {} (map (fn [[k v]]
-                                                     [k (if (vector? v) (set v) v)])
-                                                   component)))
+                                     (reduce-kv (fn [m k v]
+                                                  (assoc m k (if (vector? v) (set v) v)))
+                                                {}
+                                                component))
                                    (:components document)))))))

 (defn state->document [current-state]


Refactor insert, update, and delete.

Refactor insert, update, and delete.

--- src/fleetdb/core.clj
+++ src/fleetdb/core.clj
@@ -5,44 +5,41 @@
   {:rmap (sorted-map)
    :imap (sorted-map)})

-(defn- indexes-apply [imap apply-fn]
+(defn- rmap-insert [rmap record]
+  (let [id (:id record)]
+    (assert id)
+    (assert (not (contains? rmap id)))
+    (assoc rmap (:id record) record)))
+
+(defn- rmap-update [rmap old-record new-record]
+  (assoc rmap (:id old-record) new-record))
+
+(defn- rmap-delete [rmap old-record]
+  (dissoc rmap (:id old-record)))
+
+(defn- imap-apply [imap apply-fn]
   (reduce
     (fn [int-imap [on index]]
       (assoc int-imap (apply-fn on index)))
     {}
     imap))

-(defn- indexes-insert [imap record]
-  (indexes-apply imap
+(defn- imap-insert [imap record]
+  (imap-apply imap
     (fn [on index]
-      (assoc index (on record) (:id record)))))
-
-(defn- indexes-update [imap old-record new-record]
-  (indexes-apply imap
+      (assoc index (on record) record))))
+
+(defn- imap-update [imap old-record new-record]
+  (imap-apply imap
     (fn [on index]
       (-> index
         (dissoc (on old-record))
-        (assoc  (on new-record) (:id new-record))))))
-
-(defn- indexes-delete [imap record]
-  (indexes-apply imap
+        (assoc  (on new-record) new-record)))))
+
+(defn- imap-delete [imap record]
+  (imap-apply imap
     (fn [on index]
       (dissoc index (on record)))))
-
-(defn- q-insert [db {:keys [records]}]
-  (assert records)
-  (let [{old-rmap :rmap old-imap :imap} db
-        [new-rmap new-imap]
-          (reduce
-            (fn [[int-rmap int-imap] record]
-              (let [id (:id record)]
-                (assert id)
-                (assert (not (contains? int-rmap id)))
-                [(assoc int-rmap id record)
-                 (indexes-insert int-imap record)]))
-            [old-rmap old-imap]
-            records)]
-    [(assoc db :rmap new-rmap :imap new-imap) (count records)]))

 (def- conj-op?
   #{:and :or})
@@ -222,35 +219,31 @@
 (defn- q-count [db opts]
   (count (q-select db opts)))

+(defn- db-apply [db records apply-fn]
+  (let [{old-rmap :rmap old-imap :imap} db
+        [new-rmap new-imap] (reduce apply-fn [old-rmap old-imap] records)]
+    [(assoc db :rmap new-rmap :imap new-imap) (count records)]))
+
+(defn- q-insert [db {:keys [records]}]
+  (assert records)
+  (db-apply db records
+    (fn [[int-rmap int-imap] record]
+      [(rmap-insert int-rmap record)
+       (imap-insert int-imap record)])))
+
 (defn- q-update [db {:keys [with] :as opts}]
   (assert with)
-  (let [{old-rmap :rmap old-imap :imap} db
-        old-records     (q-select db opts)
-        num-old-records (count old-records)
-        [new-rmap new-imap]
-          (reduce
-            (fn [[int-rmap int-imap] old-record]
-              (let [new-record (merge-compact old-record with)
-                    aug-rmap   (assoc int-rmap (:id old-record) new-record)
-                    aug-imap   (indexes-update int-imap old-record new-record)]
-                [aug-rmap aug-imap]))
-            [old-rmap old-imap]
-            old-records)]
-    [(assoc db :rmap new-rmap :imap new-imap) num-old-records]))
+    (db-apply db (q-select db opts)
+      (fn [[int-rmap int-imap] old-record]
+        (let [new-record (merge-compact old-record with)]
+          [(rmap-update int-rmap old-record new-record)
+           (imap-update int-imap old-record new-record)]))))

 (defn- q-delete [db opts]
-  (let [{old-rmap :rmap old-imap :imap} db
-        old-records (q-select db opts)
-        num-old-records (count old-records)
-        [new-rmap new-imap]
-          (reduce
-            (fn [[int-rmap int-imap] old-record]
-              (let [aug-rmap (dissoc int-rmap (:id old-record))
-                    aug-imap (indexes-delete int-imap old-record)]
-                [aug-rmap aug-imap]))
-            [old-rmap old-imap]
-            old-records)]
-    [(assoc db :rmap new-rmap :imap new-imap) num-old-records]))
+  (db-apply db (q-select db opts)
+    (fn [[int-rmap int-imap] old-record]
+      [(rmap-delete int-rmap old-record)
+       (imap-delete int-imap old-record)])))

 (defn- q-explain [db {[query-type opts] :query :as explain-opts}]
   (assert (= query-type :select))


make obvious thread-id param is unused for autocomplete fns

--- src/braid/ui/views/autocomplete.cljs
+++ src/braid/ui/views/autocomplete.cljs
@@ -54,7 +54,7 @@
 (def engines
   [
    ; ... :emoji  -> autocomplete emoji
-   (fn [text thread-id]
+   (fn [text _]
      (let [pattern #"\B[:(](\S{2,})$"]
        (when-let [query (second (re-find pattern text))]
          (->> emoji/unicode
@@ -77,7 +77,7 @@
                                   {:react-key k}])}))))))

    ; ... @<user>  -> autocompletes user name
-   (fn [text thread-id]
+   (fn [text _]
      (let [pattern #"\B@(\S{0,})$"]
        (when-let [query (second (re-find pattern text))]
          (->> (store/users-in-open-group)
@@ -99,7 +99,7 @@
                           [:div.extra "..."]])}))))))

    ; ... #<tag>   -> autocompletes tag
-   (fn [text thread-id]
+   (fn [text _]
      (let [pattern #"\B#(\S{0,})$"]
        (when-let [query (second (re-find pattern text))]
          (let [group-tags (store/tags-in-open-group)


fixed group invite rendering issues

fixed group invite rendering issues

--- src/braid/ui/views/group_invite.cljs
+++ src/braid/ui/views/group_invite.cljs
@@ -13,23 +13,23 @@
         set-collapse! (fn [c?] (reset! collapsed? c?))
         set-invitee-email! (fn [message] (reset! invitee-email message))]
     (fn []
-      (if collapsed?
+      (if @collapsed?
         [:button.invite-open {:on-click
                                 (fn [_]
                                     (set-collapse! false))}
-          "invite"]
+          "Invite"]
         [:div.invite-form
-          [:input {:value invitee-email
+          [:input {:value @invitee-email
                    :type "email"
                    :placeholder "email address"
                    :on-change
                      (fn [e]
                        (set-invitee-email! (.. e -target -value)))}]
-          [:button.invite {:disabled (string/blank? invitee-email)
+          [:button.invite {:disabled (string/blank? @invitee-email)
                            :on-click
                              (fn [_]
-                               (dispatch! :invite {:group-id group-id
-                                                   :invitee-email invitee-email})
+                               (dispatch! :invite {:group-id @group-id
+                                                   :invitee-email @invitee-email})
                                (set-collapse! true)
                                (set-invitee-email! ""))}
             "invite"]


(FIXUP) create schema map for output and change if statement to be clearer

--- src/puppetlabs/trapperkeeper/services_internal.clj
+++ src/puppetlabs/trapperkeeper/services_internal.clj
@@ -57,6 +57,13 @@
    :service-fn-map ServiceFnMap
    :dependencies (schema/pred sequential?)
    :fns-map FnsMap})
+
+(def ProtocolandDependenciesMap
+  "Schema defining the map used to represent the protocol and dependencies
+  of a service."
+  {:fns (schema/pred seq?)
+   :dependencies (schema/pred vector?)
+   :service-protocol-sym (schema/maybe Symbol)})

 (def ServiceMap
   "Schema defining the map used to represent a schema in the output service
@@ -87,14 +94,13 @@
             optional-form (array-map dep optional-dep-default)]
         (recur (rest optional) (conj output optional-form))))))

-(schema/defn ^:always-validate find-prot-and-deps-forms!
-  :- {:fns (schema/pred seq?) :dependencies (schema/pred vector?) :service-protocol-sym (schema/maybe Symbol)}
+(schema/defn ^:always-validate find-prot-and-deps-forms! :- ProtocolandDependenciesMap
   "Given the forms passed to the service macro, find the service protocol
   (if one is provided), the dependency list, and the function definitions.
   Throws `IllegalArgumentException` if the forms do not represent a valid service.
   Returns a map containing the protocol, dependency list, and fn forms."
   [forms :- (schema/pred seq?)]
-  (let [f (if (some true? ((juxt symbol? map? vector?) (first forms)))
+  (let [f (if ((some-fn symbol? map? vector?) (first forms))
             (first forms)
             (throw (IllegalArgumentException.
                     (format


Remove `cats.applicative` namespace.

Remove `cats.applicative` namespace.

--- src/cats/applicative/validation.cljc
+++ src/cats/applicative/validation.cljc
@@ -1,250 +0,0 @@
-;; Copyright (c) 2014-2015 Andrey Antukh <niwi@niwi.nz>
-;; Copyright (c) 2014-2015 Alejandro Gómez <alejandro@dialelo.com>
-;; All rights reserved.
-;;
-;; Redistribution and use in source and binary forms, with or without
-;; modification, are permitted provided that the following conditions
-;; are met:
-;;
-;; 1. Redistributions of source code must retain the above copyright
-;;    notice, this list of conditions and the following disclaimer.
-;; 2. Redistributions in binary form must reproduce the above copyright
-;;    notice, this list of conditions and the following disclaimer in the
-;;    documentation and/or other materials provided with the distribution.
-;;
-;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-;; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-;; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-;; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-;; THEORY OF LIABILITtY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-;; THIS SOFTWARE, EVE N IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-(ns cats.applicative.validation
-  "The Validation applicative implementation and helper functions
-  for validating values. Isomorphic to Either."
-  (:require [cats.protocols :as p]
-            [cats.context :as ctx]
-            [cats.util :as util]
-            [cats.monad.either :as either]))
-
-(declare context)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Type constructor and functions
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(deftype Ok [v]
-  p/Contextual
-  (-get-context [_] context)
-
-  p/Extract
-  (-extract [_] v)
-
-  p/Printable
-  (-repr [_]
-    (str "#<Ok " (pr-str v) ">"))
-
-  #?@(:cljs [cljs.core/IDeref
-             (-deref [_] v)]
-      :clj  [clojure.lang.IDeref
-             (deref [_] v)])
-
-  #?@(:clj
-      [Object
-       (equals [self other]
-         (if (instance? Ok other)
-           (= v (.-v ^Ok other))
-           false))]
-
-      :cljs
-      [cljs.core/IEquiv
-       (-equiv [_ other]
-         (if (instance? Ok other)
-           (= v (.-v ^Ok other))
-           false))]))
-
-(deftype Fail [v]
-  p/Contextual
-  (-get-context [_] context)
-
-  p/Extract
-  (-extract [_] v)
-
-  p/Printable
-  (-repr [_]
-    (str "#<Fail " (pr-str v) ">"))
-
-  #?(:clj clojure.lang.IDeref
-     :cljs IDeref)
-  (#?(:clj deref :cljs -deref) [_] v)
-
-  #?@(:clj
-      [Object
-       (equals [self other]
-         (if (instance? Fail other)
-           (= v (.-v ^Fail other))
-           false))]
-
-      :cljs
-      [cljs.core/IEquiv
-       (-equiv [_ other]
-         (if (instance? Fail other)
-           (= v (.-v ^Fail other))
-           false))]))
-
-(alter-meta! #'->Ok assoc :private true)
-(alter-meta! #'->Fail assoc :private true)
-
-(util/make-printable Ok)
-(util/make-printable Fail)
-
-(defn ok
-  "An Ok type constructor."
-  [v]
-  (Ok. v))
-
-(defn fail
-  "A Fail type constructor."
-  ([]
-   (Fail. []))
-  ([v]
-   (Fail. v)))
-
-(defn ok?
-  "Return true if `v` is an instance
-  of Ok type."
-  [v]
-  (instance? Ok v))
-
-(defn fail?
-  "Return true if `v` is an instance
-  of Fail type."
-  [v]
-  (instance? Fail v))
-
-(defn validation?
-  "Return true in case of `v` is instance
-  of the Validation applicative."
-  [v]
-  (if (satisfies? p/Contextual v)
-    (identical? (p/-get-context v) context)
-    false))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Applicative definition
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(def ^{:no-doc true}
-  context
-  (reify
-    p/Context
-    (-get-level [_] ctx/+level-default+)
-
-    p/Semigroup
-    (-mappend [_ sv sv']
-      (cond
-        (and (fail? sv) (fail? sv'))
-        (fail (let [sv (p/-extract sv)
-                    sv' (p/-extract sv')]
-                (p/-mappend (p/-get-context sv) sv sv')))
-
-        (ok? sv) sv
-        :else sv'))
-
-    p/Monoid
-    (-mempty [_]
-      (fail))
-
-    p/Functor
-    (-fmap [_ f s]
-      (if (ok? s)
-        (ok (f (p/-extract s)))
-        s))
-
-    p/Foldable
-    (-foldl [_ f z mv]
-      (if (ok? mv)
-        (f z (p/-extract mv))
-        z))
-
-    (-foldr [_ f z mv]
-      (if (ok? mv)
-        (f (p/-extract mv) z)
-        z))
-
-    p/Applicative
-    (-pure [_ v]
-      (ok v))
-
-    (-fapply [_ af av]
-      (cond
-        (and (ok? af) (ok? av))
-        (ok ((p/-extract af) (p/-extract av)))
-
-        (and (fail? af) (fail? av))
-        (fail (let [af (p/-extract af)
-                    av (p/-extract av)]
-                (p/-mappend (p/-get-context af) af av)))
-
-        (ok? af) av
-        :else af))
-
-    p/Printable
-    (-repr [_]
-      "#<Validation>")))
-
-(util/make-printable (type context))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Utility functions
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defn branch
-  "Given a validation value and two functions, if the validation is a
-  failure apply the first function to the value it contains; if the
-  validation is a success apply the second function to its value."
-  [v fail-f ok-f]
-  {:pre [(validation? v)]}
-  (if (fail? v)
-    (fail-f (p/-extract v))
-    (ok-f   (p/-extract v))))
-
-(def validation branch)
-
-(defn branch-fail
-  "Given a validation value and a function, if the validation is a
-  failure, apply the function to the value it contains; if the
-  validation is a success, return it."
-  [v fail-f]
-  {:pre [(validation? v)]}
-  (branch v fail-f ok))
-
-(defn branch-ok
-  "Given a validation value and a function, if the validation is a
-  success, apply the function to the value it contains; if the
-  validation is a failure, return it."
-  [v ok-f]
-  {:pre [(validation? v)]}
-  (branch v fail ok-f))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Either isomorphism
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defn validation->either
-  [av]
-  {:pre [(validation? av)]}
-  (if (ok? av)
-    (either/right (.-v ^Ok av))
-    (either/left (.-v ^Fail av))))
-
-(defn either->validation
-  [ae]
-  {:pre [(either/either? ae)]}
-  (if (either/right? ae)
-    (ok (.-v ^cats.monad.either.Right ae))
-    (fail (.-v ^cats.monad.either.Left ae))))


Ignore empty metadata category attributes

--- src/clj/cglossa/data_import/core.clj
+++ src/clj/cglossa/data_import/core.clj
@@ -19,5 +19,6 @@
         data (rest rows)]
     (with-meta
       (for [row data]
-        (into {:db/id (tempid :db.part/user)} (zipmap attr-names row)))
+        (into {:db/id (tempid :db.part/user)}
+              (filter #(seq (val %)) (zipmap attr-names row))))  ;ignore empty strings
       {:from-path path})))


saving.

saving.

--- src/clj/forma/hadoop/jobs/update.clj
+++ src/clj/forma/hadoop/jobs/update.clj
@@ -11,7 +11,7 @@
   [est-start est-end run-date]
   (let [training-end "2005-12-19"]
     {:configurable
-     {:threshold 50
+     {:threshold "50"
       :version "1.0"
       :spatial-res "500"
       :temporal-res "16"
@@ -24,9 +24,9 @@
       :est-end est-end
       :fire-start "2000-11-01"
       :super-eco? false
-      :nodata -9999.0
-      :zoom 17
-      :min-zoom 6}
+      :nodata "-9999.0"
+      :zoom "17"
+      :min-zoom "6"}
      :storage
      {:tmp "/tmp"
       :staging "s3n://formastaging"


[REFACTOR] Add `html-timetable-remove-all-lessons!` function

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

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -800,6 +800,11 @@
         (.addClass $divElem "lesson-droppable-not-hover"))
     $divElem))

+(defn- html-timetable-remove-all-lessons!
+  "Removes all lesson <div>s from the HTML timetable."
+  []
+  (.remove ($ ".lesson")))
+
 (defn- add-module-lesson!
   "Adds a single lesson of a module the timetable.
    Returns a `ModulesSelectedLessonInfo` object augmented with the `:divElem`,
@@ -1524,7 +1529,7 @@
 (defn remove-all-modules
   "Removes all modules from the timetable"
   []
-  (.remove ($ ".lesson"))
+  (html-timetable-remove-all-lessons!)
   (doseq [day (range 5)]
     (let [nrRows   (timetable-day-get-nr-rows day)
           $dayElem (nth HTML-Timetable day)]


Refactor - create `get-set-from-seq-of-maps-with-day-key` function

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

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -135,6 +135,15 @@
    for a lesson group of the module."
   [moduleCode lessonType lessonGroup]
   (get (get-module-lesson-groups-map moduleCode lessonType) lessonGroup))
+
+(defn- get-set-from-seq-of-maps-with-day-key
+  "Returns a set of days from a sequence of maps, where each map has the `:day`
+   key."
+  [s]
+  (reduce (fn [daySet m]
+            (conj daySet (:day m)))
+          #{}
+          s))

 (def ^{:doc     "Width in pixels of a half hour timeslot"
        :private true
@@ -641,10 +650,7 @@
           destLessonGroup (data $helper LESSON-GROUP-CHANGE-KEY)

           affectedDaysSet
-          (reduce (fn [daySet ttLessonInfo]
-                    (conj daySet (:day ttLessonInfo)))
-                  #{}
-                  Lessons-Created-By-Draggable)]
+          (get-set-from-seq-of-maps-with-day-key Lessons-Created-By-Draggable)]

       (doseq [augTTLessonInfo Lessons-Created-By-Draggable]
         (timetable-remove-lesson! (:day augTTLessonInfo)
@@ -664,11 +670,8 @@
       (if (not (nil? destLessonGroup))
           (let [augTTLessonInfoSeq (remove-lesson-group-html moduleCode
                                                              lessonType)
-                affectedDaysSet    (reduce (fn [daySet augTTLessonInfo]
-                                             (conj daySet
-                                                   (:day augTTLessonInfo)))
-                                           #{}
-                                           augTTLessonInfoSeq)]
+                affectedDaysSet    (get-set-from-seq-of-maps-with-day-key
+                                     augTTLessonInfoSeq)]
             ; remove the current lesson group
             (doseq [augTTLessonInfo augTTLessonInfoSeq]
               (let [day          (:day augTTLessonInfo)
@@ -1400,10 +1403,7 @@
                           lessonTypes))

             affectedDaysSet
-            (reduce (fn [daySet augTTLessonInfo]
-                      (conj daySet (:day augTTLessonInfo)))
-                    #{}
-                    augTTLessonInfoSeq)]
+            (get-set-from-seq-of-maps-with-day-key augTTLessonInfoSeq)]

         ; Remove module from `ModulesSelected`
         (set! ModulesSelected (dissoc ModulesSelected moduleCode))


Remove unused require from catacumba.components ns.

--- src/clojure/catacumba/components.clj
+++ src/clojure/catacumba/components.clj
@@ -28,7 +28,6 @@
   (:require [com.stuartsierra.component :as component]
             [catacumba.core :as ct]
             [catacumba.impl.routing :as routing]
-            [catacumba.impl.helpers :as helpers]
             [catacumba.impl.server :refer [run-server]])
   (:import ratpack.handling.Chain
            ratpack.server.RatpackServer))


Typo.

Typo.

--- modules/core/src/main/clojure/immutant/runtime.clj
+++ modules/core/src/main/clojure/immutant/runtime.clj
@@ -56,7 +56,7 @@
          (catch java.io.FileNotFoundException e
            ;; make sure it's a failure to find immutant.init, and not
            ;; something within init throwing a FNFE
-           (if (re-find #"immmutant/init" (.getMessage e))
+           (if (re-find #"immutant/init" (.getMessage e))
              (log/warn "No :init fn or immutant.init namespace found for"
                        (util/app-name)
                        "- no initialization will be performed")


core: run!

core: run!

--- core/data/core.clj
+++ core/data/core.clj
@@ -3810,3 +3810,11 @@
   {:added "1.0"}
   [prob coll]
   (filter (fn [_] (< (rand) prob)) coll))
+
+(defn run!
+  "Runs the supplied procedure (via reduce), for purposes of side
+  effects, on successive items in the collection. Returns nil"
+  {:added "1.0"}
+  [proc coll]
+  (reduce #(proc %2) nil coll)
+  nil)


fix for lazy evaluation of log string

fix for lazy evaluation of log string

--- storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -124,18 +124,17 @@
 (defn cleanup-fn! [log-root-dir]
   (let [now-secs (current-time-secs)
         old-log-files (select-files-for-cleanup *STORM-CONF* (* now-secs 1000) log-root-dir)
-        owner->files (get-dead-worker-files-and-owners *STORM-CONF*
-                                                       now-secs
-                                                       old-log-files
-                                                       log-root-dir)]
+        dead-worker-files (get-dead-worker-files-and-owners *STORM-CONF* now-secs old-log-files log-root-dir)]
     (log-debug "log cleanup: now(" now-secs
-               ") old log files (" (mapcat #(.getName %) old-log-files)
-               ") dead worker files (" (mapcat #(for [{f :files} %
-                                                      :when f]
-                                                  (.getName f))
-                                               owner->files)
+               ") old log files (" (->> old-log-files
+                                        (map #(.getName %))
+                                        (string/join ","))
+               ") dead worker files (" (->> dead-worker-files
+                                            (mapcat (fn [{l :files}] l))
+                                            (map #(.getName %))
+                                            (string/join ","))
                ")")
-    (dofor [{:keys [owner files]} owner->files
+    (dofor [{:keys [owner files]} dead-worker-files
             file files]
       (let [path (.getCanonicalPath file)]
         (log-message "Cleaning up: Removing " path)


fixed some typos on server interactions tutorial

--- src/tutorial/untangled_tutorial/H_Server_Interactions.cljs
+++ src/tutorial/untangled_tutorial/H_Server_Interactions.cljs
@@ -15,13 +15,13 @@

 (defui ^:once CategoryQuery
   static om/IQuery
-  (query [this] [] [:db/id :category/name])
+  (query [this] [:db/id :category/name])
   static om/Ident
   (ident [this props] [:categories/by-id (:db/id props)]))

 (defui ^:once ItemQuery
   static om/IQuery
-  (query [this] [] [:db/id {:item/category (om/get-query CategoryQuery)} :item/name])
+  (query [this] [:db/id {:item/category (om/get-query CategoryQuery)} :item/name])
   static om/Ident
   (ident [this props] [:items/by-id (:db/id props)]))

@@ -38,7 +38,7 @@

 (defui ^:once ToolbarItem
   static om/IQuery
-  (query [this] [] [:db/id :item/name])
+  (query [this] [:db/id :item/name])
   static om/Ident
   (ident [this props] [:items/by-id (:db/id props)])
   Object
@@ -50,7 +50,7 @@

 (defui ^:once ToolbarCategory
   static om/IQuery
-  (query [this] [] [:db/id :category/name {:category/items (om/get-query ItemQuery)}])
+  (query [this] [:db/id :category/name {:category/items (om/get-query ToolbarItem)}])
   static om/Ident
   (ident [this props] [:categories/by-id (:db/id props)])
   Object
@@ -65,7 +65,7 @@

 (defui ^:once Toolbar
   static om/IQuery
-  (query [this] [] [{:toolbar/categories (om/get-query ToolbarCategory)}])
+  (query [this] [{:toolbar/categories (om/get-query ToolbarCategory)}])
   Object
   (render [this]
     (let [{:keys [toolbar/categories]} (om/props this)]


Cleaned up :require(s) in name space

Cleaned up :require(s) in name space

--- pixel-ship-play-clj/desktop/src-common/pixel_ship_play_clj/core.clj
+++ pixel-ship-play-clj/desktop/src-common/pixel_ship_play_clj/core.clj
@@ -1,10 +1,9 @@
 (ns pixel-ship-play-clj.core
-  (:require [play-clj.core :refer :all]
-            [play-clj.ui :refer :all]
+  (:require [play-clj.core :refer [bundle clear! color defgame defscreen key-code
+                                   pixmap* pixmap! render! set-screen! shape stage update!]]
             [play-clj.g2d :refer [texture]]
-            [pixel-ships.core :as psc :refer :all]
-            [pixel-ships.bollinger :as bollinger :refer :all]
-            [clojure.pprint :refer :all])
+            [pixel-ships.core :as psc :refer [create-pixel-ship color-pixel-ship]]
+            [pixel-ships.bollinger :as bollinger :refer [model]])
   (:import [com.badlogic.gdx.graphics Pixmap Texture TextureData Pixmap$Format]))

 (declare create-pixel-ship-play-clj custom-shape play-clj-color hsv-to-rgb change-ship draw-rect-pixelmap)


Make condition constructors fixed arity, for better error messages.

--- src/active/clojure/condition.cljc
+++ src/active/clojure/condition.cljc
@@ -193,19 +193,22 @@
   Each `<accessor>` is bound to a procedure that extracts the
   corresponding field from a condition of type `<condition-type>`."
   [?condition-type ?supertype ?constructor ?predicate & ?field-specs]
-  `(do
-     (let [total-field-count# (+ ~(count ?field-specs) (:total-field-count ~?supertype))]
-       (def ~?condition-type
-         (->ConditionType '~?condition-type ~?supertype
-                          '[~@(map first ?field-specs)] total-field-count#))
-       (defn ~?constructor
-         [& args#]
-         {:pre [(= (count args#) total-field-count#)]}
-         (make-condition [(->ConditionComponent ~?condition-type (vec args#))]))
-       (def ~?predicate (condition-predicate ~?condition-type))
-       ~@(map (fn [[?field-name ?accessor]]
-                `(def ~?accessor (condition-accessor ~?condition-type '~?field-name)))
-              ?field-specs)))))
+  (let [?constructor-params (concat (map (fn [[?field-name _]]
+                                           (gensym ?field-name))
+                                         ?field-specs)
+                                    (map gensym (:field-names (eval ?supertype))))]
+    `(do
+       (let [total-field-count# (+ ~(count ?field-specs) (:total-field-count ~?supertype))]
+         (def ~?condition-type
+           (->ConditionType '~?condition-type ~?supertype
+                            '[~@(map first ?field-specs)] total-field-count#))
+         (defn ~?constructor
+           [~@?constructor-params]
+           (make-condition [(->ConditionComponent ~?condition-type (vector ~@?constructor-params))]))
+         (def ~?predicate (condition-predicate ~?condition-type))
+         ~@(map (fn [[?field-name ?accessor]]
+                  `(def ~?accessor (condition-accessor ~?condition-type '~?field-name)))
+                ?field-specs))))))

 ; These standard condition types correspond directly to R6RS Scheme


Unbreak assert and condition on ClojureScript.

--- src/active/clojure/condition.cljc
+++ src/active/clojure/condition.cljc
@@ -22,9 +22,11 @@
   #?(:clj (:require [io.aviso.exception :as aviso-exception]
                     [io.aviso.columns :as aviso-columns]
                     [io.aviso.ansi :as aviso-ansi]
-                    [clojure.string :as string]))
+                    [clojure.string :as string]
+                    [active.clojure.macro :refer (if-cljs)]))
   #?(:cljs (:require-macros [active.clojure.condition
                              :refer (define-condition-type assert condition raise guard throw-condition)]
+                            [active.clojure.macro :refer (if-cljs)]
                             [cljs.core :as core]))
   #?(:clj (:import clojure.lang.ExceptionInfo)))

@@ -424,7 +426,9 @@
              ;; TODO Waiting on http://dev.clojure.org/jira/browse/CLJ-865:
              ?line  (:line (meta &form))]
          `(when-not ~x
-            (assertion-violation (stack-trace-who (.getStackTrace (Thread/currentThread)))
+            (assertion-violation (if-cljs
+                                   nil
+                                   (stack-trace-who (.getStackTrace (Thread/currentThread))))
                                  (str "Assertion failed")
                                  (make-location-condition '~?ns ~?file ~?line)
                                  '~x)))))
@@ -435,7 +439,9 @@
              ;; TODO Waiting on http://dev.clojure.org/jira/browse/CLJ-865:
              ?line  (:line (meta &form))]
          `(when-not ~x
-            (assertion-violation (stack-trace-who (.getStackTrace (Thread/currentThread)))
+            (assertion-violation (if-cljs
+                                  nil
+                                  (stack-trace-who (.getStackTrace (Thread/currentThread))))
                                  (str "Assert failed: " ~message)
                                  (make-location-condition '~?ns ~?file ~?line)
                                  '~x)))))))
@@ -445,7 +451,9 @@
 (defmacro condition
   [?base ?message & ?irritants]
   `(combine-conditions ~?base
-                       (make-who-condition (stack-trace-who (.getStackTrace (Thread/currentThread))))
+                       (if-cljs
+                        nil
+                        (make-who-condition (stack-trace-who (.getStackTrace (Thread/currentThread)))))
                        (make-message-condition ~?message)
                        (make-irritants-condition [~@?irritants]))))


Revert "Now using (declare x) instead of (def x nil)"

This reverts commit 22a2b62e98bffd0f8b2ff5f1734b849e95e7ca9a.

--- src/hyjinks.clj
+++ src/hyjinks.clj
@@ -31,9 +31,9 @@

 (defn none [pred & xs] (not (apply some pred xs)))

-;; Forward declarations to resolve circular references
-
-(declare extend-tag nil)
+;; Forward definitions to resolve circular references
+
+(def extend-tag nil)

 ;; Core types


Removed test for 404 when deleting non-existent provider.

--- int_test/cmr/metadata_db/int_test/provider_crud_test.clj
+++ int_test/cmr/metadata_db/int_test/provider_crud_test.clj
@@ -38,8 +38,4 @@
     (util/delete-provider "PROV1")
     (let [{:keys [status providers]} (util/get-providers)]
       (is (= status 200))
-      (is (= providers ["PROV2"]))))
-  (testing "Delete provider that doesn't exist"
-    (let [{:keys [status errors]} (util/delete-provider "PROV3")]
-      (is (= status 404))
-      (is (= (first errors) (messages/provider-does-not-exist "PROV3"))))))+      (is (= providers ["PROV2"])))))


[#199] All of clojure.core is copied over from the original

--- priv/clojure/core.clj
+++ priv/clojure/core.clj
@@ -294,8 +294,17 @@
                 (recur (conj ret (first s)) (next s))
                 (seq ret)))))

-(def ^:macro defn
-  (fn* [form env name & fdecl]
+(def
+  ^{:doc "Same as (def name (fn [params* ] exprs*)) or (def
+    name (fn ([params* ] exprs*)+)) with any doc-string or attrs added
+    to the var metadata. prepost-map defines a map with optional keys
+    :pre and :post that contain collections of pre or post conditions."
+    :arglists '([name doc-string? attr-map? [params*] prepost-map? body]
+                [name doc-string? attr-map? ([params*] prepost-map? body)+ attr-map?])
+    :added "1.0"
+    :macro true}
+  defn
+  (fn* [&form &env name & fdecl]
        (if (symbol? name)
          nil
          (throw "First argument to defn must be a symbol"))
@@ -1120,14 +1129,6 @@
   [num div]
   (erlang/rem.e num div))

-(defn rationalize
-  "returns the rational value of num"
-  {:added "1.0"
-   :static true}
-  [num]
-  (throw "unimplemented ratio")
-  #_(. clojure.lang.Numbers (rationalize num)))
-
 ;;Bit ops

 (defn bit-not
@@ -2329,7 +2330,7 @@

 (defmacro io!
   "If an io! block occurs in a transaction, throws an
-  IllegalStateException, else runs body in an implicit do. If the
+  error, else runs body in an implicit do. If the
   first expression in body is a literal string, will use that as the
   exception message."
   {:added "1.0"}
@@ -3380,45 +3381,12 @@
       m
       (+ m div))))

-(defn ratio?
-  "Returns true if n is a Ratio"
-  {:added "1.0"
-   :static true}
-  [n]
-  (throw "unimplemented ratio")
-  #_(instance? clojure.lang.Ratio n))
-
-(defn numerator
-  "Returns the numerator part of a Ratio."
-  {:tag BigInteger
-   :added "1.2"
-   :static true}
-  [r]
-  (throw "unimplemented ratio")
-  #_(.numerator ^clojure.lang.Ratio r))
-
-(defn denominator
-  "Returns the denominator part of a Ratio."
-  {:tag BigInteger
-   :added "1.2"
-   :static true}
-  [r]
-  (throw "unimplemented ratio")
-  #_(.denominator ^clojure.lang.Ratio r))
-
 (defn float?
   "Returns true if n is a floating point number"
   {:added "1.0"
    :static true}
   [n]
   (erlang/is_float.e n))
-
-(defn rational?
-  "Returns true if n is a rational number"
-  {:added "1.0"
-   :static true}
-  [n]
-  (throw "unimplemented ratio"))

 (defn bigint
   "Coerce to BigInt"
@@ -4713,6 +4681,7 @@
   once, but any effects on Refs will be atomic."
   {:added "1.0"}
   [& exprs]
+  (throw "unsupported refs")
   #_`(sync nil ~@exprs))

 #_ ((defmacro with-precision
@@ -5288,7 +5257,7 @@
   the rows in the java.sql.ResultSet rs"
   {:added "1.0"}
   [^java.sql.ResultSet rs]
-  (throw "unsupported sql resultste"))
+  (throw "unsupported sql result set"))

 (defn iterator-seq
   "Returns a seq on a java.util.Iterator. Note that most collections
@@ -5405,7 +5374,6 @@
         references (remove #(= :gen-class (first %)) references)
         ;ns-effect (clojure.core/in-ns name)
         name-metadata (meta name)]
-
     `(do
        (clojure.core/in-ns '~name)
        (with-loading-context
@@ -5453,7 +5421,7 @@
   *loading-verbosely* false)

 (defn- throw-if
-  "Throws a CompilerException with a message if pred is true"
+  "Throws an error with a message if pred is true"
   [pred fmt & args]
   (when pred
     (let [message   (apply format fmt (map str args))
@@ -5626,7 +5594,9 @@
   multiple libs whose names share a common prefix, or a flag that modifies
   how all the identified libs are loaded. Use :require in the ns macro
   in preference to calling this directly.
+
   Libs
+
   A 'lib' is a named set of resources in classpath whose contents define a
   library of Clojure code. Lib names are symbols and each lib is associated
   with a Clojure namespace and a Java package that share its name. A lib's
@@ -5634,27 +5604,35 @@
   package name to classpath-relative path mapping. All resources in a lib
   should be contained in the directory structure under its root directory.
   All definitions a lib makes should be in its associated namespace.
+
   'require loads a lib by loading its root resource. The root resource path
   is derived from the lib name in the following manner:
   Consider a lib named by the symbol 'x.y.z; it has the root directory
   <classpath>/x/y/, and its root resource is <classpath>/x/y/z.clj. The root
   resource should contain code to create the lib's namespace (usually by using
   the ns macro) and load any additional lib resources.
+
   Libspecs
+
   A libspec is a lib name or a vector containing a lib name followed by
   options expressed as sequential keywords and arguments.
+
   Recognized options:
   :as takes a symbol as its argument and makes that symbol an alias to the
     lib's namespace in the current namespace.
   :refer takes a list of symbols to refer from the namespace or the :all
     keyword to bring in all public vars.
+
   Prefix Lists
+
   It's common for Clojure code to depend on several libs whose names have
   the same prefix. When specifying libs, prefix lists can be used to reduce
   repetition. A prefix list contains the shared prefix followed by libspecs
   with the shared prefix removed from the lib names. After removing the
   prefix, the names that remain must not contain any periods.
+
   Flags
+
   A flag is a keyword.
   Recognized flags: :reload, :reload-all, :verbose
   :reload forces loading of all the identified libs even if they are
@@ -5662,9 +5640,12 @@
   :reload-all implies :reload and also forces loading of all libs that the
     identified libs directly or indirectly load via require or use
   :verbose triggers printing information about each load, alias, and refer
+
   Example:
+
   The following would load the libraries clojure.zip and clojure.set
   abbreviated as 's'.
+
   (require '(clojure zip [set :as s]))"
   {:added "1.0"}

@@ -5954,8 +5935,7 @@
   predicate as its argument, the result of that call being the return
   value of condp. A single default expression can follow the clauses,
   and its value will be returned if no clause matches. If no default
-  expression is provided and no clause matches, an
-  IllegalArgumentException is thrown."
+  expression is provided and no clause matches, an error is thrown."
   {:added "1.0"}

   [pred expr & clauses]
@@ -5970,7 +5950,7 @@
                      more   (second res)
                      n (count clause)]
                  (cond
-                   (= 0 n) `(throw (IllegalArgumentException. (str "No matching clause: " ~expr)))
+                   (= 0 n) `(throw (str "No matching clause: " ~expr))
                    (= 1 n) a
                    (= 2 n) `(if (~pred ~a ~expr)
                               ~b
@@ -6112,6 +6092,22 @@
   particular scope by binding *read-eval* to :unknown
   "
   {:added "1.0"})
+
+(defn future?
+  "Returns true if x is a future"
+  {:added "1.1"
+   :static true}
+  [x]
+  (throw "unimplemented future")
+  #_(instance? java.util.concurrent.Future x))
+
+(defn future-done?
+  "Returns true if future f is done"
+  {:added "1.1"
+   :static true}
+  [^java.util.concurrent.Future f]
+  (throw "unimplemented future")
+  #_(.isDone f))

 (defmacro letfn
   "fnspec ==> (fname [params*] exprs) or (fname ([params*] exprs)+)
@@ -6167,7 +6163,7 @@
   test-constant, the corresponding result-expr is returned. A single
   default expression can follow the clauses, and its value will be
   returned if no clause matches. If no default expression is provided
-  and no clause matches, an IllegalArgumentException is thrown.
+  and no clause matches, an error is thrown.

   Unlike cond and condp, case does a constant-time dispatch, the
   clauses are not considered sequentially.  All manner of constant
@@ -6356,68 +6352,191 @@
     (erlang.io.IWriter/write.e w (str content))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; futures (needs proxy);;;;;;;;;;;;;;;;;;
-
-;; A lot of missing stuff
-
-(defn reader-conditional?
-  "Return true if the value is the data representation of a reader conditional"
-  {:added "1.7"}
-  [value]
-  (instance? clojerl.reader.ReaderConditional value))
-
-(defn reader-conditional
-  "Construct a data representation of a reader conditional.
-  If true, splicing? indicates read-cond-splicing."
-  {:added "1.7"}
-  [form ^Boolean splicing?]
-  (new clojerl.reader.ReaderConditional form splicing?))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; data readers ;;;;;;;;;;;;;;;;;;
-
-(def ^{:added "1.4"} default-data-readers
-  "Default map of data reader functions provided by Clojure. May be
-  overridden by binding *data-readers*."
-  {'inst #'clojure.instant/read-instant-date
-   'uuid #'clojure.uuid/default-uuid-reader})
-
-(def ^{:added "1.4" :dynamic true} *data-readers*
-  "Map from reader tag symbols to data reader Vars.
-
-  When Clojure starts, it searches for files named 'data_readers.clj'
-  at the root of the classpath. Each such file must contain a literal
-  map of symbols, like this:
-
-      {foo/bar my.project.foo/bar
-       foo/baz my.project/baz}
-
-  The first symbol in each pair is a tag that will be recognized by
-  the Clojure reader. The second symbol in the pair is the
-  fully-qualified name of a Var which will be invoked by the reader to
-  parse the form following the tag. For example, given the
-  data_readers.clj file above, the Clojure reader would parse this
-  form:
-
-      #foo/bar [1 2 3]
-
-  by invoking the Var #'my.project.foo/bar on the vector [1 2 3]. The
-  data reader function is invoked on the form AFTER it has been read
-  as a normal Clojure data structure by the reader.
-
-  Reader tags without namespace qualifiers are reserved for
-  Clojure. Default reader tags are defined in
-  clojure.core/default-data-readers but may be overridden in
-  data_readers.clj or by rebinding this Var."
-  {})
-
-(def ^{:added "1.5" :dynamic true} *default-data-reader-fn*
-  "When no data reader is found for a tag and *default-data-reader-fn*
-  is non-nil, it will be called with two arguments,
-  the tag and the value.  If *default-data-reader-fn* is nil (the
-  default), an exception will be thrown for the unknown tag."
-  nil)
-
-;;------------------------------------------------------------------------------
-;;------------------------------------------------------------------------------
+(defn future-call
+  "Takes a function of no args and yields a future object that will
+  invoke the function in another thread, and will cache the result and
+  return it on all subsequent calls to deref/@. If the computation has
+  not yet finished, calls to deref/@ will block, unless the variant
+  of deref with timeout is used. See also - realized?."
+  {:added "1.1"
+   :static true}
+  [f]
+  (throw "unimplemented future")
+  #_(let [f (binding-conveyor-fn f)
+        fut (.submit clojure.lang.Agent/soloExecutor ^Callable f)]
+    (reify
+     clojure.lang.IDeref
+     (deref [_] (deref-future fut))
+     clojure.lang.IBlockingDeref
+     (deref
+      [_ timeout-ms timeout-val]
+      (deref-future fut timeout-ms timeout-val))
+     clojure.lang.IPending
+     (isRealized [_] (.isDone fut))
+     java.util.concurrent.Future
+      (get [_] (.get fut))
+      (get [_ timeout unit] (.get fut timeout unit))
+      (isCancelled [_] (.isCancelled fut))
+      (isDone [_] (.isDone fut))
+      (cancel [_ interrupt?] (.cancel fut interrupt?)))))
+
+(defmacro future
+  "Takes a body of expressions and yields a future object that will
+  invoke the body in another thread, and will cache the result and
+  return it on all subsequent calls to deref/@. If the computation has
+  not yet finished, calls to deref/@ will block, unless the variant of
+  deref with timeout is used. See also - realized?."
+  {:added "1.1"}
+  [& body] `(future-call (^{:once true} fn* [] ~@body)))
+
+
+(defn future-cancel
+  "Cancels the future, if possible."
+  {:added "1.1"
+   :static true}
+  [^java.util.concurrent.Future f]
+  (throw "unimplemented future")
+  #_(.cancel f true))
+
+(defn future-cancelled?
+  "Returns true if future f is cancelled"
+  {:added "1.1"
+   :static true}
+  [^java.util.concurrent.Future f]
+  (throw "unimplemented future")
+  #_(.isCancelled f))
+
+(defn pmap
+  "Like map, except f is applied in parallel. Semi-lazy in that the
+  parallel computation stays ahead of the consumption, but doesn't
+  realize the entire result unless required. Only useful for
+  computationally intensive functions where the time of f dominates
+  the coordination overhead."
+  {:added "1.0"
+   :static true}
+  ([f coll]
+   (let [n (+ 2 (erlang/system_info.e :logical_processors_available))
+         rets (map #(future (f %)) coll)
+         step (fn step [[x & xs :as vs] fs]
+                (lazy-seq
+                 (if-let [s (seq fs)]
+                   (cons (deref x) (step xs (rest s)))
+                   (map deref vs))))]
+     (step rets (drop n rets))))
+  ([f coll & colls]
+   (let [step (fn step [cs]
+                (lazy-seq
+                 (let [ss (map seq cs)]
+                   (when (every? identity ss)
+                     (cons (map first ss) (step (map rest ss)))))))]
+     (pmap #(apply f %) (step (cons coll colls))))))
+
+(defn pcalls
+  "Executes the no-arg fns in parallel, returning a lazy sequence of
+  their values"
+  {:added "1.0"
+   :static true}
+  [& fns] (pmap #(%) fns))
+
+(defmacro pvalues
+  "Returns a lazy sequence of the values of the exprs, which are
+  evaluated in parallel"
+  {:added "1.0"
+   :static true}
+  [& exprs]
+  `(pcalls ~@(map #(list `fn [] %) exprs)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; clojure version number ;;;;;;;;;;;;;;;;;;;;;;
+
+(def ^:dynamic *clojure-version*
+  (let [properties (second (application/get_all_key.e :clojerl))
+        vsn        (proplists/get_value.e :vsn properties)
+        version-string (erlang/list_to_binary.e vsn)
+        [_ major minor incremental qualifier snapshot]
+        (re-matches
+         #"(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9_]+))?(?:-(SNAPSHOT))?"
+         version-string)
+        clojure-version {:major       (erlang/binary_to_integer.e major)
+                         :minor       (erlang/binary_to_integer.e minor)
+                         :incremental (erlang/binary_to_integer.e incremental)
+                         :qualifier   (if (= qualifier "SNAPSHOT") nil qualifier)}]
+    (if (clojerl.String/contains.e version-string "SNAPSHOT")
+      (assoc clojure-version :interim true)
+      clojure-version)))
+
+(add-doc-and-meta *clojure-version*
+  "The version info for Clojure core, as a map containing :major :minor
+  :incremental and :qualifier keys. Feature releases may increment
+  :minor and/or :major, bugfix releases will increment :incremental.
+  Possible values of :qualifier include \"GA\", \"SNAPSHOT\", \"RC-x\" \"BETA-x\""
+  {:added "1.0"})
+
+(defn
+  clojure-version
+  "Returns clojure version as a printable string."
+  {:added "1.0"}
+  []
+  (str (:major *clojure-version*)
+       "."
+       (:minor *clojure-version*)
+       (when-let [i (:incremental *clojure-version*)]
+         (str "." i))
+       (when-let [q (:qualifier *clojure-version*)]
+         (when (pos? (count q)) (str "-" q)))
+       (when (:interim *clojure-version*)
+         "-SNAPSHOT")))
+
+(defn promise
+  "Returns a promise object that can be read with deref/@, and set,
+  once only, with deliver. Calls to deref/@ prior to delivery will
+  block, unless the variant of deref with timeout is used. All
+  subsequent derefs will return the same delivered value without
+  blocking. See also - realized?."
+  {:added "1.1"
+   :static true}
+  []
+  (throw "unimplemented promise")
+  #_(let [d (java.util.concurrent.CountDownLatch. 1)
+        v (atom d)]
+    (reify
+     clojure.lang.IDeref
+       (deref [_] (.await d) @v)
+     clojure.lang.IBlockingDeref
+       (deref
+        [_ timeout-ms timeout-val]
+        (if (.await d timeout-ms java.util.concurrent.TimeUnit/MILLISECONDS)
+          @v
+          timeout-val))
+     clojure.lang.IPending
+      (isRealized [this]
+       (zero? (.getCount d)))
+     clojure.lang.IFn
+     (invoke
+      [this x]
+      (when (and (pos? (.getCount d))
+                 (compare-and-set! v d x))
+        (.countDown d)
+        this)))))
+
+(defn deliver
+  "Delivers the supplied value to the promise, releasing any pending
+  derefs. A subsequent call to deliver on a promise will have no effect."
+  {:added "1.1"
+   :static true}
+  [promise val]
+  (throw "unimplemented promise")
+  #_(promise val))
+
+
+(defn flatten
+  "Takes any nested combination of sequential things (lists, vectors,
+  etc.) and returns their contents as a single, flat sequence.
+  (flatten nil) returns an empty sequence."
+  {:added "1.2"
+   :static true}
+  [x]
+  (filter (complement sequential?)
+          (rest (tree-seq sequential? seq x))))

 (defn group-by
   "Returns a map of the elements of coll keyed by the result of
@@ -6431,6 +6550,336 @@
      (let [k (f x)]
        (assoc ret k (conj (get ret k []) x))))
    {} coll))
+
+(defn partition-by
+  "Applies f to each value in coll, splitting it each time f returns a
+   new value.  Returns a lazy seq of partitions.  Returns a stateful
+   transducer when no collection is provided."
+  {:added "1.2"
+   :static true}
+  ([f]
+   #_(fn [rf]
+    (let [a (java.util.ArrayList.)
+          pv (volatile! ::none)]
+      (fn
+        ([] (rf))
+        ([result]
+           (let [result (if (.isEmpty a)
+                          result
+                          (let [v (vec (.toArray a))]
+                            ;;clear first!
+                            (.clear a)
+                            (unreduced (rf result v))))]
+             (rf result)))
+        ([result input]
+           (let [pval @pv
+                 val (f input)]
+             (vreset! pv val)
+             (if (or (identical? pval ::none)
+                     (= val pval))
+               (do
+                 (.add a input)
+                 result)
+               (let [v (vec (.toArray a))]
+                 (.clear a)
+                 (let [ret (rf result v)]
+                   (when-not (reduced? ret)
+                     (.add a input))
+                   ret)))))))))
+  ([f coll]
+     (lazy-seq
+      (when-let [s (seq coll)]
+        (let [fst (first s)
+              fv (f fst)
+              run (cons fst (take-while #(= fv (f %)) (next s)))]
+          (cons run (partition-by f (seq (drop (count run) s)))))))))
+
+(defn frequencies
+  "Returns a map from distinct items in coll to the number of times
+  they appear."
+  {:added "1.2"
+   :static true}
+  [coll]
+  (reduce (fn [counts x]
+            (assoc counts x (inc (get counts x 0))))
+          {} coll))
+
+(defn reductions
+  "Returns a lazy seq of the intermediate values of the reduction (as
+  per reduce) of coll by f, starting with init."
+  {:added "1.2"}
+  ([f coll]
+     (lazy-seq
+      (if-let [s (seq coll)]
+        (reductions f (first s) (rest s))
+        (list (f)))))
+  ([f init coll]
+     (if (reduced? init)
+       (list @init)
+       (cons init
+             (lazy-seq
+              (when-let [s (seq coll)]
+                (reductions f (f init (first s)) (rest s))))))))
+
+(defn rand-nth
+  "Return a random element of the (sequential) collection. Will have
+  the same performance characteristics as nth for the given
+  collection."
+  {:added "1.2"
+   :static true}
+  [coll]
+  (nth coll (rand-int (count coll))))
+
+(defn partition-all
+  "Returns a lazy sequence of lists like partition, but may include
+  partitions with fewer than n items at the end.  Returns a stateful
+  transducer when no collection is provided."
+  {:added "1.2"
+   :static true}
+  #_([^long n]
+   (fn [rf]
+     (let [a (java.util.ArrayList. n)]
+       (fn
+         ([] (rf))
+         ([result]
+            (let [result (if (.isEmpty a)
+                           result
+                           (let [v (vec (.toArray a))]
+                             ;;clear first!
+                             (.clear a)
+                             (unreduced (rf result v))))]
+              (rf result)))
+         ([result input]
+            (.add a input)
+            (if (= n (.size a))
+              (let [v (vec (.toArray a))]
+                (.clear a)
+                (rf result v))
+              result))))))
+  ([n coll]
+     (partition-all n n coll))
+  ([n step coll]
+     (lazy-seq
+      (when-let [s (seq coll)]
+        (let [seg (doall (take n s))]
+          (cons seg (partition-all n step (nthrest s step))))))))
+
+(defn shuffle
+  "Return a random permutation of coll"
+  {:added "1.2"
+   :static true}
+  [^java.util.Collection coll]
+  (throw "unimplemented shuffle")
+  #_(let [al (java.util.ArrayList. coll)]
+      (java.util.Collections/shuffle al)
+      (clojure.lang.RT/vector (.toArray al))))
+
+(defn map-indexed
+  "Returns a lazy sequence consisting of the result of applying f to 0
+  and the first item of coll, followed by applying f to 1 and the second
+  item in coll, etc, until coll is exhausted. Thus function f should
+  accept 2 arguments, index and item. Returns a stateful transducer when
+  no collection is provided."
+  {:added "1.2"
+   :static true}
+  ([f]
+   #_(fn [rf]
+     (let [i (volatile! -1)]
+       (fn
+         ([] (rf))
+         ([result] (rf result))
+         ([result input]
+          (rf result (f (vswap! i inc) input)))))))
+  ([f coll]
+   (throw "unimplemented letfn*")
+   #_(letfn [(mapi [idx coll]
+                 (lazy-seq
+                   (when-let [s (seq coll)]
+                     (if (chunked-seq? s)
+                       (let [c (chunk-first s)
+                             size (int (count c))
+                             b (chunk-buffer size)]
+                         (dotimes [i size]
+                           (chunk-append b (f (+ idx i) (.nth c i))))
+                         (chunk-cons (chunk b) (mapi (+ idx size) (chunk-rest s))))
+                       (cons (f idx (first s)) (mapi (inc idx) (rest s)))))))]
+     (mapi 0 coll))))
+
+(defn keep
+  "Returns a lazy sequence of the non-nil results of (f item). Note,
+  this means false return values will be included.  f must be free of
+  side-effects.  Returns a transducer when no collection is provided."
+  {:added "1.2"
+   :static true}
+  ([f]
+   (fn [rf]
+     (fn
+       ([] (rf))
+       ([result] (rf result))
+       ([result input]
+          (let [v (f input)]
+            (if (nil? v)
+              result
+              (rf result v)))))))
+  ([f coll]
+   (lazy-seq
+    (when-let [s (seq coll)]
+      (if (chunked-seq? s)
+        (let [c (chunk-first s)
+              size (count c)
+              b (chunk-buffer size)]
+          (dotimes [i size]
+            (let [x (f (nth c i))]
+              (when-not (nil? x)
+                (chunk-append b x))))
+          (chunk-cons (chunk b) (keep f (chunk-rest s))))
+        (let [x (f (first s))]
+          (if (nil? x)
+            (keep f (rest s))
+            (cons x (keep f (rest s))))))))))
+
+(defn every-pred
+  "Takes a set of predicates and returns a function f that returns true if all of its
+  composing predicates return a logical true value against all of its arguments, else it returns
+  false. Note that f is short-circuiting in that it will stop execution on the first
+  argument that triggers a logical false result against the original predicates."
+  {:added "1.3"}
+  ([p]
+     (fn ep1
+       ([] true)
+       ([x] (boolean (p x)))
+       ([x y] (boolean (and (p x) (p y))))
+       ([x y z] (boolean (and (p x) (p y) (p z))))
+       ([x y z & args] (boolean (and (ep1 x y z)
+                                     (every? p args))))))
+  ([p1 p2]
+     (fn ep2
+       ([] true)
+       ([x] (boolean (and (p1 x) (p2 x))))
+       ([x y] (boolean (and (p1 x) (p1 y) (p2 x) (p2 y))))
+       ([x y z] (boolean (and (p1 x) (p1 y) (p1 z) (p2 x) (p2 y) (p2 z))))
+       ([x y z & args] (boolean (and (ep2 x y z)
+                                     (every? #(and (p1 %) (p2 %)) args))))))
+  ([p1 p2 p3]
+     (fn ep3
+       ([] true)
+       ([x] (boolean (and (p1 x) (p2 x) (p3 x))))
+       ([x y] (boolean (and (p1 x) (p2 x) (p3 x) (p1 y) (p2 y) (p3 y))))
+       ([x y z] (boolean (and (p1 x) (p2 x) (p3 x) (p1 y) (p2 y) (p3 y) (p1 z) (p2 z) (p3 z))))
+       ([x y z & args] (boolean (and (ep3 x y z)
+                                     (every? #(and (p1 %) (p2 %) (p3 %)) args))))))
+  ([p1 p2 p3 & ps]
+     (let [ps (list* p1 p2 p3 ps)]
+       (fn epn
+         ([] true)
+         ([x] (every? #(% x) ps))
+         ([x y] (every? #(and (% x) (% y)) ps))
+         ([x y z] (every? #(and (% x) (% y) (% z)) ps))
+         ([x y z & args] (boolean (and (epn x y z)
+                                       (every? #(every? % args) ps))))))))
+
+(defn some-fn
+  "Takes a set of predicates and returns a function f that returns the first logical true value
+  returned by one of its composing predicates against any of its arguments, else it returns
+  logical false. Note that f is short-circuiting in that it will stop execution on the first
+  argument that triggers a logical true result against the original predicates."
+  {:added "1.3"}
+  ([p]
+     (fn sp1
+       ([] nil)
+       ([x] (p x))
+       ([x y] (or (p x) (p y)))
+       ([x y z] (or (p x) (p y) (p z)))
+       ([x y z & args] (or (sp1 x y z)
+                           (some p args)))))
+  ([p1 p2]
+     (fn sp2
+       ([] nil)
+       ([x] (or (p1 x) (p2 x)))
+       ([x y] (or (p1 x) (p1 y) (p2 x) (p2 y)))
+       ([x y z] (or (p1 x) (p1 y) (p1 z) (p2 x) (p2 y) (p2 z)))
+       ([x y z & args] (or (sp2 x y z)
+                           (some #(or (p1 %) (p2 %)) args)))))
+  ([p1 p2 p3]
+     (fn sp3
+       ([] nil)
+       ([x] (or (p1 x) (p2 x) (p3 x)))
+       ([x y] (or (p1 x) (p2 x) (p3 x) (p1 y) (p2 y) (p3 y)))
+       ([x y z] (or (p1 x) (p2 x) (p3 x) (p1 y) (p2 y) (p3 y) (p1 z) (p2 z) (p3 z)))
+       ([x y z & args] (or (sp3 x y z)
+                           (some #(or (p1 %) (p2 %) (p3 %)) args)))))
+  ([p1 p2 p3 & ps]
+     (let [ps (list* p1 p2 p3 ps)]
+       (fn spn
+         ([] nil)
+         ([x] (some #(% x) ps))
+         ([x y] (some #(or (% x) (% y)) ps))
+         ([x y z] (some #(or (% x) (% y) (% z)) ps))
+         ([x y z & args] (or (spn x y z)
+                             (some #(some % args) ps)))))))
+
+(defn- ^{:dynamic true} assert-valid-fdecl
+  "A good fdecl looks like (([a] ...) ([a b] ...)) near the end of defn."
+  [fdecl]
+  (when (empty? fdecl) (throw "Parameter declaration missing"))
+  (let [argdecls (map
+                   #(if (seq? %)
+                      (first %)
+                      (throw (if (seq? (first fdecl))
+                               (str "Invalid signature \""
+                                    %
+                                    "\" should be a list")
+                               (str "Parameter declaration \""
+                                    %
+                                    "\" should be a vector"))))
+                   fdecl)
+        bad-args (seq (remove #(vector? %) argdecls))]
+    (when bad-args
+      (throw (str "Parameter declaration \"" (first bad-args)
+                  "\" should be a vector")))))
+
+(defn with-redefs-fn
+  "Temporarily redefines Vars during a call to func.  Each val of
+  binding-map will replace the root value of its key which must be
+  a Var.  After func is called with no args, the root values of all
+  the Vars will be set back to their old values.  These temporary
+  changes will be visible in all threads.  Useful for mocking out
+  functions during testing."
+  {:added "1.3"}
+  [binding-map func]
+  (throw "unimplemented with-redefs-fn")
+  #_(let [root-bind (fn [m]
+                    (doseq [[a-var a-val] m]
+                      (.bindRoot ^clojure.lang.Var a-var a-val)))
+        old-vals (zipmap (keys binding-map)
+                         (map #(.getRawRoot ^clojure.lang.Var %) (keys binding-map)))]
+    (try
+      (root-bind binding-map)
+      (func)
+      (finally
+        (root-bind old-vals)))))
+
+(defmacro with-redefs
+  "binding => var-symbol temp-value-expr
+
+  Temporarily redefines Vars while executing the body.  The
+  temp-value-exprs will be evaluated and each resulting value will
+  replace in parallel the root value of its Var.  After the body is
+  executed, the root values of all the Vars will be set back to their
+  old values.  These temporary changes will be visible in all threads.
+  Useful for mocking out functions during testing."
+  {:added "1.3"}
+  [bindings & body]
+  `(with-redefs-fn ~(zipmap (map #(list `var %) (take-nth 2 bindings))
+                            (take-nth 2 (next bindings)))
+                    (fn [] ~@body)))
+
+(defn realized?
+  "Returns true if a value has been produced for a promise, delay, future or lazy sequence."
+  {:added "1.3"}
+  [^clojure.lang.IPending x]
+  (throw "unimplemented realized?")
+  #_(.isRealized x))

 (defmacro cond->
   "Takes an expression and a set of test/form pairs. Threads expr (via ->)
@@ -6505,6 +6954,215 @@
        ~(if (empty? steps)
           g
           (last steps)))))
+
+(defn ^:private preserving-reduced
+  [rf]
+  #(let [ret (rf %1 %2)]
+     (if (reduced? ret)
+       (reduced ret)
+       ret)))
+
+(defn cat
+  "A transducer which concatenates the contents of each input, which must be a
+  collection, into the reduction."
+  {:added "1.7"}
+  [rf]
+  (let [rrf (preserving-reduced rf)]
+    (fn
+      ([] (rf))
+      ([result] (rf result))
+      ([result input]
+         (reduce rrf result input)))))
+
+(defn dedupe
+  "Returns a lazy sequence removing consecutive duplicates in coll.
+  Returns a transducer when no collection is provided."
+  {:added "1.7"}
+  ([]
+   (fn [rf]
+     (let [pv (volatile! ::none)]
+       (fn
+         ([] (rf))
+         ([result] (rf result))
+         ([result input]
+            (let [prior @pv]
+              (vreset! pv input)
+              (if (= prior input)
+                result
+                (rf result input))))))))
+  ;; TODO: this expression is generating invalid AST
+  #_([coll] (sequence (dedupe) coll)))
+
+(defn random-sample
+  "Returns items from coll with random probability of prob (0.0 -
+  1.0).  Returns a transducer when no collection is provided."
+  {:added "1.7"}
+  ([prob]
+     (filter (fn [_] (< (rand) prob))))
+  ([prob coll]
+     (filter (fn [_] (< (rand) prob)) coll)))
+
+(deftype Eduction [xform coll]
+  ;; Iterable
+  ;; (iterator [_]
+  ;;   (clojure.lang.TransformerIterator/create xform (clojure.lang.RT/iter coll)))
+
+  ;; TODO: this expression is generating invalid AST
+  ;; clojerl.IReduce
+  ;; (reduce [this f init]
+  ;;   ;; NB (completing f) isolates completion of inner rf from outer rf
+  ;;   (transduce xform (completing f) init coll))
+
+  clojerl.ISequential)
+
+(defn eduction
+  "Returns a reducible/iterable application of the transducers
+  to the items in coll. Transducers are applied in order as if
+  combined with comp. Note that these applications will be
+  performed every time reduce/iterator is called."
+  {:arglists '([xform* coll])
+   :added "1.7"}
+  [& xforms]
+  (new Eduction (apply comp (butlast xforms)) (last xforms)))
+
+(defmethod print-method Eduction [c, ^Writer w]
+  (if *print-readably*
+    (do
+      (print-sequential "(" pr-on " " ")" c w))
+    (print-simple c w)))
+
+(defn run!
+  "Runs the supplied procedure (via reduce), for purposes of side
+  effects, on successive items in the collection. Returns nil"
+  {:added "1.7"}
+  [proc coll]
+  (reduce #(proc %2) nil coll)
+  nil)
+
+
+(defn tagged-literal?
+  "Return true if the value is the data representation of a tagged literal"
+  {:added "1.7"}
+  [value]
+  (instance? clojerl.reader.TaggedLiteral value))
+
+(defn tagged-literal
+  "Construct a data representation of a tagged literal from a
+  tag symbol and a form."
+  {:added "1.7"}
+  [^clojure.lang.Symbol tag form]
+  (new clojerl.reader.TaggedLiteral tag form))
+
+(defn reader-conditional?
+  "Return true if the value is the data representation of a reader conditional"
+  {:added "1.7"}
+  [value]
+  (instance? clojerl.reader.ReaderConditional value))
+
+(defn reader-conditional
+  "Construct a data representation of a reader conditional.
+  If true, splicing? indicates read-cond-splicing."
+  {:added "1.7"}
+  [form ^Boolean splicing?]
+  (new clojerl.reader.ReaderConditional form splicing?))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; data readers ;;;;;;;;;;;;;;;;;;
+
+(def ^{:added "1.4"} default-data-readers
+  "Default map of data reader functions provided by Clojure. May be
+  overridden by binding *data-readers*."
+  {'inst #'clojure.instant/read-instant-date
+   'uuid #'clojure.uuid/default-uuid-reader})
+
+(def ^{:added "1.4" :dynamic true} *data-readers*
+  "Map from reader tag symbols to data reader Vars.
+
+  When Clojure starts, it searches for files named 'data_readers.clj'
+  at the root of the classpath. Each such file must contain a literal
+  map of symbols, like this:
+
+      {foo/bar my.project.foo/bar
+       foo/baz my.project/baz}
+
+  The first symbol in each pair is a tag that will be recognized by
+  the Clojure reader. The second symbol in the pair is the
+  fully-qualified name of a Var which will be invoked by the reader to
+  parse the form following the tag. For example, given the
+  data_readers.clj file above, the Clojure reader would parse this
+  form:
+
+      #foo/bar [1 2 3]
+
+  by invoking the Var #'my.project.foo/bar on the vector [1 2 3]. The
+  data reader function is invoked on the form AFTER it has been read
+  as a normal Clojure data structure by the reader.
+
+  Reader tags without namespace qualifiers are reserved for
+  Clojure. Default reader tags are defined in
+  clojure.core/default-data-readers but may be overridden in
+  data_readers.clj or by rebinding this Var."
+  {})
+
+(def ^{:added "1.5" :dynamic true} *default-data-reader-fn*
+  "When no data reader is found for a tag and *default-data-reader-fn*
+  is non-nil, it will be called with two arguments,
+  the tag and the value.  If *default-data-reader-fn* is nil (the
+  default), an exception will be thrown for the unknown tag."
+  nil)
+
+;; (defn- data-reader-urls []
+;;   (let [cl (.. Thread currentThread getContextClassLoader)]
+;;     (concat
+;;       (enumeration-seq (.getResources cl "data_readers.clj"))
+;;       (enumeration-seq (.getResources cl "data_readers.cljc")))))
+
+;; (defn- data-reader-var [sym]
+;;   (intern (create-ns (symbol (namespace sym)))
+;;           (symbol (name sym))))
+
+;; (defn- load-data-reader-file [mappings ^java.net.URL url]
+;;   (with-open [rdr (clojure.lang.LineNumberingPushbackReader.
+;;                    (java.io.InputStreamReader.
+;;                     (.openStream url) "UTF-8"))]
+;;     (binding [*file* (.getFile url)]
+;;       (let [read-opts (if (.endsWith (.getPath url) "cljc")
+;;                         {:eof nil :read-cond :allow}
+;;                         {:eof nil})
+;;             new-mappings (read read-opts rdr)]
+;;         (when (not (map? new-mappings))
+;;           (throw (ex-info (str "Not a valid data-reader map")
+;;                           {:url url})))
+;;         (reduce
+;;          (fn [m [k v]]
+;;            (when (not (symbol? k))
+;;              (throw (ex-info (str "Invalid form in data-reader file")
+;;                              {:url url
+;;                               :form k})))
+;;            (let [v-var (data-reader-var v)]
+;;              (when (and (contains? mappings k)
+;;                         (not= (mappings k) v-var))
+;;                (throw (ex-info "Conflicting data-reader mapping"
+;;                                {:url url
+;;                                 :conflict k
+;;                                 :mappings m})))
+;;              (assoc m k v-var)))
+;;          mappings
+;;          new-mappings)))))
+
+;; (defn- load-data-readers []
+;;   (alter-var-root #'*data-readers*
+;;                   (fn [mappings]
+;;                     (reduce load-data-reader-file
+;;                             mappings (data-reader-urls)))))
+
+;; (try
+;;  (load-data-readers)
+;;  (catch Throwable t
+;;    (.printStackTrace t)
+;;    (throw t)))
+
+;;------------------------------------------------------------------------------
+;;------------------------------------------------------------------------------

 (defmacro simple-benchmark
   "Runs expr iterations times in the context of a let expression with


Remove some overzealous printouts

Remove some overzealous printouts

--- src/player/core.cljs
+++ src/player/core.cljs
@@ -171,7 +171,7 @@
                      transitions))))

 (defn enter-state [has ha state now]
-  (println "enter state" (keys has) (:id ha) state now)
+  #_(println "enter state" (keys has) (:id ha) state now)
   (let [now (floor-time now time-unit)
         _ (assert (>= now (:entry-time ha)) "Time must be monotonic")
         ; set the current state to this state
@@ -327,7 +327,7 @@
       (= min-t qnow) (do #_(println "clean border")
                        (assoc scene :now now
                                     :objects (follow-transitions has transitions)))
-      :else (do (println "messy border overflow" (- now min-t))
+      :else (do #_(println "messy border overflow" (- now min-t))
                 (update-scene (assoc scene :now min-t
                                            :objects (follow-transitions has transitions))
                               now
@@ -396,12 +396,10 @@
                ; x - x2 > 16
                (map #(make-edge :right (moving-dec :x 16 %) #{:required [:this id] [:other %]}) others)))))

-(def scene-a-walls #{[0 0 104 8]
-                     [0 8 8 16]
-                     [96 8 8 16]})
-
 (defn make-scene-a [x] (let [ids #{:ga :gb :gc :gd}
-                             walls scene-a-walls
+                             walls #{[0 0 104 8]
+                                     [0 8 8 16]
+                                     [96 8 8 16]}
                              objects [(goomba :ga x 8 16 :right ids walls)
                                       (goomba :gb (+ x 18) 8 16 :left ids walls)
                                       (goomba :gc (+ x 38) 8 16 :right ids walls)
@@ -417,7 +415,8 @@
                           :then          0
                           :playing       false
                           :pause-on-play false
-                          :objects       obj-dict}))
+                          :objects       obj-dict
+                          :walls         walls}))
 (defn reset-scene-a! []
   (swap! scene-a (fn [_]
                    (make-scene-a 8))))
@@ -492,45 +491,45 @@
                              :position        "relative"}}
                (when show-transition-thresholds
                  (map (fn [ha i]
-                       (let [trans-count (count (required-transitions ha))
-                             trans-h (/ line-h trans-count)]
-                         [:div
-                          (map (fn [trans j]
-                                 (let [[s e] (:interval trans)
-                                       sx (* scale (:x (extrapolate ha s)))
-                                       ex (* scale (:x (extrapolate ha e)))
-                                       line-top (+ (* i line-h) (* j trans-h))]
-                                   [:div {:style {:height        trans-h :width (.abs js/Math (- sx ex))
-                                                  :top           line-top :left (.min js/Math sx ex)
-                                                  :position      "absolute" :backgroundColor "grey"
-                                                  :pointerEvents "none"}}
-                                    [:div {:style {:position        "absolute"
-                                                   :width           "100px"
-                                                   :backgroundColor "rgba(255,255,255,0.5)"
-                                                   :pointerEvents   "none"}}
-                                     (str (:id ha) "-" (:target (:transition trans)))]
-                                    [:div {:style {:height          "100%" :width "2px"
-                                                   :position        "absolute" :left (if (< sx ex) "0%" "100%")
-                                                   :backgroundColor "green"
-                                                   :pointerEvents   "none"}}]
-                                    [:div {:style {:height          "100%" :width "2px"
-                                                   :position        "absolute" :left (if (< sx ex) "100%" "0%")
-                                                   :backgroundColor "red"
-                                                   :pointerEvents   "none"}}]]))
-                               (transition-intervals (:objects @scene)
-                                                     ha
-                                                     Infinity
-                                                     (required-transitions ha))
-                               (range 0 trans-count))]))
-                     (map #(extrapolate % (:now @scene)) (vals (:objects @scene)))
-                     (range 0 ct)))
+                        (let [trans-count (count (required-transitions ha))
+                              trans-h (/ line-h trans-count)]
+                          [:div
+                           (map (fn [trans j]
+                                  (let [[s e] (:interval trans)
+                                        sx (* scale (:x (extrapolate ha s)))
+                                        ex (* scale (:x (extrapolate ha e)))
+                                        line-top (+ (* i line-h) (* j trans-h))]
+                                    [:div {:style {:height        trans-h :width (.abs js/Math (- sx ex))
+                                                   :top           line-top :left (.min js/Math sx ex)
+                                                   :position      "absolute" :backgroundColor "grey"
+                                                   :pointerEvents "none"}}
+                                     [:div {:style {:position        "absolute"
+                                                    :width           "100px"
+                                                    :backgroundColor "rgba(255,255,255,0.5)"
+                                                    :pointerEvents   "none"}}
+                                      (str (:id ha) "-" (:target (:transition trans)))]
+                                     [:div {:style {:height          "100%" :width "2px"
+                                                    :position        "absolute" :left (if (< sx ex) "0%" "100%")
+                                                    :backgroundColor "green"
+                                                    :pointerEvents   "none"}}]
+                                     [:div {:style {:height          "100%" :width "2px"
+                                                    :position        "absolute" :left (if (< sx ex) "100%" "0%")
+                                                    :backgroundColor "red"
+                                                    :pointerEvents   "none"}}]]))
+                                (transition-intervals (:objects @scene)
+                                                      ha
+                                                      Infinity
+                                                      (required-transitions ha))
+                                (range 0 trans-count))]))
+                      (map #(extrapolate % (:now @scene)) (vals (:objects @scene)))
+                      (range 0 ct)))
                (map (fn [[x y w h]]
                       [:div {:style {:width           (str (* scale w) "px") :height (str (* scale h) "px")
                                      :backgroundColor "white"
                                      :position        "absolute"
                                      :left            (str (* scale x) "px")
                                      :bottom          (str (* scale y) "px")}}])
-                    scene-a-walls)
+                    (:walls @scene))
                (map (fn [{x :x y :y w :w h :h :as ha}]
                       [:div
                        [:div {:style {:width           (str (* scale w) "px") :height (str (* scale h) "px")


Add attr argument to checkbox

Add attr argument to checkbox

--- src/re_com/misc.cljs
+++ src/re_com/misc.cljs
@@ -202,7 +202,7 @@
 ;; TODO: when disabled?, should the text appear "disabled".
 (defn checkbox
   "I return the markup for a checkbox, with an optional RHS label"
-  [& {:keys [model on-change label disabled? style label-class label-style]
+  [& {:keys [model on-change label disabled? style label-class label-style attr]
       :as   args}]
   {:pre [(validate-args-macro checkbox-args-desc args "checkbox")]}
   (let [cursor      "default"
@@ -214,14 +214,16 @@
      :align    :start
      :class    "noselect"
      :children [[:input
-                 {:class     "rc-checkbox"
-                  :type      "checkbox"
-                  :style     (merge (flex-child-style "none")
-                                    {:cursor cursor}
-                                    style)
-                  :disabled  disabled?
-                  :checked   model
-                  :on-change (handler-fn (callback-fn))}]
+                 (merge
+                   {:class     "rc-checkbox"
+                    :type      "checkbox"
+                    :style     (merge (flex-child-style "none")
+                                      {:cursor cursor}
+                                      style)
+                    :disabled  disabled?
+                    :checked   model
+                    :on-change (handler-fn (callback-fn))}
+                   attr)]
                 (when label
                   [:span
                    {:on-click (handler-fn (callback-fn))


All tests now working. Removed most redundant code.

--- src/re_com/time.cljs
+++ src/re_com/time.cljs
@@ -239,7 +239,7 @@
                      :model (first deref-model)
                      :callback callback
                      :minimum-time minimum-time
-                     :maximum-time (last  deref-model)
+                     :maximum-time (last deref-model)
                      :style style]
                    (when to-label [:label to-label])
                    [time-input


CMR-1341: Fixing the cubby application cache test.

--- system-int-test/test/cmr/system_int_test/admin/cache_api_test.clj
+++ system-int-test/test/cmr/system_int_test/admin/cache_api_test.clj
@@ -177,7 +177,9 @@
            (url/search-read-caches-url) "token-imp" [["ABC-1" "read"] ["ABC-2" "read"]]
            (url/search-read-caches-url) "token-sid" []
            (url/search-read-caches-url) "xsl-transformer-templates" []
-           (url/cubby-read-caches-url) "token-imp" [["ABC-2" "read"] ["ABC-1" "read"]])
+           (url/cubby-read-caches-url) "token-imp" [["ABC-3" "update"] [nil "update"] ["ABC-4" "update"]
+                                                    ["mock-echo-system-token" "update"] ["ABC-1" "update"]
+                                                    ["ABC-2" "update"] ["ABC-2" "read"] ["ABC-1" "read"]])
       (s/only-with-real-database
         (testing "list cache keys for bootstrap"
           (let [response (list-cache-keys (url/bootstrap-read-caches-url) "token-imp" admin-read-token)]


Add copyright banner

Add copyright banner

--- modules/http-kit/src/modular/http_kit.clj
+++ modules/http-kit/src/modular/http_kit.clj
@@ -1,3 +1,17 @@
+;; Copyright © 2014, JUXT LTD. All Rights Reserved.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;;     http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
 (ns modular.http-kit
   (:require
    [com.stuartsierra.component :as component]


import shader namespace

import shader namespace

--- src/splash/core.cljs
+++ src/splash/core.cljs
@@ -8,7 +8,7 @@
               [infinitelives.pixi.font :as font]
               [infinitelives.utils.math :as math]
               [infinitelives.utils.sound :as sound]
-              ;[splash.macros :refer-macros [ignore]]
+              [splash.shaders :as shaders]
               [cljs.core.async :refer [<!]]
               [PIXI])
     (:require-macros [cljs.core.async.macros :refer [go]]


enable schema validation for dev

enable schema validation for dev

--- resources/leiningen/new/closp/env/dev/cljs/dev.cljs
+++ resources/leiningen/new/closp/env/dev/cljs/dev.cljs
@@ -1,5 +1,8 @@
 (ns {{name}}.dev
-  (:require [{{ns}}.core :as core]))
+  (:require [schema.core :as s]
+            [{{ns}}.core :as core]))
+
+(s/set-fn-validation! true)

 (enable-console-print!)


Integrated, tests failing

Integrated, tests failing

--- src/ctia/flows/hooks/event_hooks.clj
+++ src/ctia/flows/hooks/event_hooks.clj
@@ -72,9 +72,8 @@
       (some-> (:judgement store/stores)
               deref
               (store/calculate-verdict event)
-              )
-      (when-let [judgement-store (:judgement store/stores)]
-        (store/calculate-verdict @judgement-store event)))  ;; TODO: send this to the verdict store
+              ;; TODO: store in verdict store. Issue #277
+              ))
     event))

 (s/defn register-hooks :- {s/Keyword [(s/protocol Hook)]}


Update to latest bidi

Update to latest bidi

--- modules/bidi/src/modular/bidi.clj
+++ modules/bidi/src/modular/bidi.clj
@@ -5,26 +5,33 @@
    [schema.core :as s]
    [modular.ring :refer (WebRequestHandler)]
    [com.stuartsierra.component :as component :refer (Lifecycle)]
-   [bidi.bidi :as bidi :refer (match-route resolve-handler RouteProvider handler)]
+   [bidi.bidi :as bidi :refer (match-route resolve-handler RouteProvider tag)]
    [bidi.ring :refer (resources-maybe make-handler redirect archive)]
    [clojure.tools.logging :refer :all]
    [clojure.java.io :as io]))

-(defrecord WebResources [uri-context resource-prefix key]
+(defrecord WebResources [uri-context resource-prefix key maybe?]
   RouteProvider
   (routes [_]
-    [uri-context (handler key (bidi.ring/resources {:prefix resource-prefix}))]))
+    [uri-context
+     (-> ((if maybe?
+            bidi.ring/resources-maybe
+            bidi.ring/resources)
+          {:prefix resource-prefix})
+         (tag key))]))

 (def new-web-resources-schema
   {:uri-context s/Str
    :resource-prefix s/Str
-   :key s/Keyword})
+   :key s/Keyword
+   :maybe? s/Bool})

 (defn new-web-resources [& {:as opts}]
   (->> opts
        (merge {:uri-context "/"
                :resource-prefix ""
-               :key :web-resources})
+               :key :web-resources
+               :maybe? true})
     (s/validate new-web-resources-schema)
     (map->WebResources)))


bidi routes can be constructed with fn

bidi routes can be constructed with fn

--- modules/bidi/src/modular/bidi.clj
+++ modules/bidi/src/modular/bidi.clj
@@ -37,17 +37,28 @@

 (defrecord BidiRoutes [routes context]
   component/Lifecycle
-  (start [this] this)
+  (start [this]
+    (let [routes (cond-> routes
+                         (fn? routes) (apply [this]))]
+      (assoc this :routes routes)))
   (stop [this] this)
+
   BidiRoutesContributor
-  (routes [this] routes)
+  (routes [this] (:routes this))
   (context [this] context))

 (def bidi-routes-options-schema {:context s/Str})

-(defn new-bidi-routes [routes & {:as opts}]
-  (let [{:keys [context]} (->> (merge {:context ""} opts)
-                               (s/validate bidi-routes-options-schema))]
+(defn new-bidi-routes
+  "Create a component with a given set of bidi routes. An optional web
+  context can be given as a keyword argument using the :context key. The
+  routes can be a bidi route structure, or a function that returns
+  one. When using a function, the component is passed as a single
+  argument."
+  [routes & {:as opts}]
+  (let [{:keys [context]}
+        (->> (merge {:context ""} opts)
+             (s/validate bidi-routes-options-schema))]
     (new BidiRoutes routes context)))

 (defn wrap-routes


Exception handling to provide more context

--- modules/bidi/src/modular/bidi.clj
+++ modules/bidi/src/modular/bidi.clj
@@ -132,7 +132,9 @@
            (apply merge
                   (for [[k v] this
                         :when (satisfies? WebService v)]
-                    {k (ring-handler-map v)})))]
+                    (try
+                      {k (ring-handler-map v)}
+                      (catch Throwable e (throw (ex-info "Failed to call ring-handler-map" {:k k :v v} e)))))))]

       (assoc this
         :handlers handlers


Adjust tests to new features

Adjust tests to new features

--- test/src/dda/pallet/dda_managed_vm/domain_test.clj
+++ test/src/dda/pallet/dda_managed_vm/domain_test.clj
@@ -108,19 +108,26 @@
           {:dda-managed-vm
            {:vm-user :test,
             :bookmarks [{:name "Bookmarks Toolbar", :links [["https://domaindrivenarchitecture.org/" "dda"]], :childs [{:name "WebConf", :links [["https://meet.jit.si/dda-pallet" "jitsi dda-pallet"] ["http://meetingwords.com/" "MeetingWords"] ["https://web.telegram.org/" "Telegram"] ["http://www.meebl.de/" "meebl"]]}]}],
-            :settings #{:install-os-analysis :install-git
-                        :install-open-jdk-11 :configure-no-swappiness
-                        :install-xfce-desktop,}
+            :settings
+            #{:install-os-analysis :install-zip-utils :install-git
+              :remove-ubuntu-unused :install-bash-utils :install-openconnect
+              :install-open-jdk-11 :remove-xubuntu-unused :install-vpnc
+              :configure-no-swappiness :install-xfce-desktop :install-audio
+              :install-openvpn :install-timesync}
             :tightvnc-server {:user-password "test"}}}
           (sut/infra-configuration config-1)))
     (is (=
           {:dda-managed-vm
             {:vm-user :test,
              :bookmarks [{:name "Bookmarks Toolbar", :links [["https://domaindrivenarchitecture.org/" "dda"]], :childs [{:name "WebConf", :links [["https://meet.jit.si/dda-pallet" "jitsi dda-pallet"] ["http://meetingwords.com/" "MeetingWords"] ["https://web.telegram.org/" "Telegram"] ["http://www.meebl.de/" "meebl"]]}]}],
-                    :settings #{:install-os-analysis :install-chromium :install-keymgm :install-git :install-open-jdk-11
-                                :install-spellchecking-de :install-telegram :configure-no-swappiness :install-inkscape
-                                :install-desktop-wiki :install-libreoffice :remove-power-management
-                                :install-gopass :install-virtualbox-guest},
+                    :settings
+                    #{:install-os-analysis :install-chromium :install-enigmail :install-keymgm
+                      :install-zip-utils :install-git :remove-ubuntu-unused :install-bash-utils
+                      :install-diagram :install-openconnect :install-open-jdk-11 :install-spellchecking-de
+                      :remove-xubuntu-unused :install-vpnc :install-telegram :configure-no-swappiness
+                      :install-inkscape :install-remina :install-audio :install-desktop-wiki
+                      :install-libreoffice :install-openvpn :remove-power-management :install-gopass
+                      :install-virtualbox-guest :install-timesync,}
                     :fakturama {:app-download-url "https://files.fakturama.info/release/v2.0.2/Fakturama_linux_x64_2.0.2.1.deb",
                                 :doc-download-url "https://files.fakturama.info/release/v2.0.2/Handbuch-Fakturama_2.0.2.pdf"}}}
           (sut/infra-configuration config-2)))))


don't need a function here

don't need a function here

--- src/tabby/leader.clj
+++ src/tabby/leader.clj
@@ -101,7 +101,7 @@

 (defn- make-peer-map [state f]
   (into {} (for [[p _] (:peers state)]
-             [p (f)])))
+             [p f])))

 (defn check-and-update-append-entries [state p]
   (check-commit-index (update-match-and-next state p)))
@@ -120,9 +120,9 @@
       (merge
           {:type :leader
            :leader-id (:id state)
-           :next-timeout (make-peer-map state (fn [] (peer-next-timeout state)))
-           :next-index (make-peer-map state  #(inc (count (:log state))))
-           :match-index (make-peer-map state (constantly 0))})
+           :next-timeout (make-peer-map state (peer-next-timeout state))
+           :next-index (make-peer-map state (inc (count (:log state))))
+           :match-index (make-peer-map state 0)})
       (broadcast-heart-beat)))

 (defn check-backlog


Remove unused bytes->json

Remove unused bytes->json

read-json was deprecated and removed from clojure/data.json
bytes->json however is not used anywhere, so just removing the code.

--- pigpen-pig/src/main/clojure/pigpen/pig/runtime.clj
+++ pigpen-pig/src/main/clojure/pigpen/pig/runtime.clj
@@ -89,11 +89,6 @@
   [b]
   (clojure.string/join (mapv #(format "%02X" %) b)))

-(defn bytes->json
-  "Convert bytes into a string & then parses json"
-  [b]
-  (if b (json/read-json (String. (bytes b)))))
-
 (defn cast-bytes
   "Converts a byte array into the specified type. Similar to a cast in pig."
   [type value]


better logging

better logging

--- src/spq/lib.clj
+++ src/spq/lib.clj
@@ -104,7 +104,7 @@
              (not dont-mark-retry))
       (do (dq/complete! task)
           (timbre/error "task retried more than max retries, dropping:" (:item val))
-          (assert false (str "task retried more than max retries, dropping: " (:item val))))
+          (assert false (str "task retried more than max retries, dropping: " queue-name " " (:item val))))
       (do (dq/put! queue queue-name (update-in val [:retries] (if dont-mark-retry
                                                                 identity
                                                                 inc)))


Display various user statuses

Display various user statuses

--- src/trak/ui/app.cljs
+++ src/trak/ui/app.cljs
@@ -22,14 +22,33 @@
   (let [albums (db/get-albums *db)]
     [:.columns (map (fn [album] [:.column.col-6.col-xs-12 {:key (:db/id album)} (album-card album)]) albums)]))

+(rum/defc profile-login []
+  (components/link
+    {:href (globals/spotify-authorization-link "user-read-private user-read-email") :class-name "btn btn-primary"}
+    "Log in"))
+
+(rum/defc profile [me]
+  [:div [:h2 (:me/display_name me)] (:me/country me)])
+
+(rum/defc profile-base [*db]
+  (let [me (db/me *db)]
+    (utils/info me (:me/status me))
+    (cond
+      (nil? me) (profile-login)
+      (= :logged-out (:me/status me)) (profile-login)
+      (= :logged-in (:me/status me)) (profile me)
+      (= :loading (:me/status me)) [:div "Loading..."])))
+
 (rum/defc app [*db]
   (when-let [match (utils/current-path *db)]
     (utils/info "Application mounted. Matched: " match)
     [:div
-     (cond
-       (empty? (db/me *db)) (components/link
-                              {:href (globals/spotify-authorization-link "user-read-private user-read-email") :class-name "btn btn-primary"}
-                              "Log in")
-       :else "noi")
+     (profile-base *db)
+     ;
+     ;(cond
+     ;  (empty? (db/me *db)) (components/link
+     ;                         {:href (globals/spotify-authorization-link "user-read-private user-read-email") :class-name "btn btn-primary"}
+     ;                         "Log in")
+     ;  :else "noi")
      (cond
        (= (:handler (utils/current-path *db)) :index) (albums *db))]))


Fix uploads on mobile

Fix uploads on mobile

--- src/braid/client/mobile/core.cljs
+++ src/braid/client/mobile/core.cljs
@@ -5,6 +5,8 @@
             [braid.client.routes :as routes]
             [re-frame.core :as rf :refer [dispatch-sync dispatch]]
             [braid.client.state.remote-handlers]
+            braid.client.uploads.subs
+            braid.client.uploads.events
             braid.client.core.subs
             braid.client.core.events))


Универсальные имена лоадеров

Универсальные имена лоадеров

--- radiolamp-6P3S/src/r6p3s/cpt/images_gallery_1.cljs
+++ radiolamp-6P3S/src/r6p3s/cpt/images_gallery_1.cljs
@@ -62,7 +62,7 @@
                   image-loader (new goog.net.ImageLoader)]
               (println "update image:" src)
               ;; Сначала ставим гифку прогресса
-              (om/set-state! own :src "/images/preloader_1_128.gif")
+              (om/set-state! own :src "/images/loader_media.svg")
               ;; Теперь по загрузчику
               (events/listen image-loader goog.net.EventType.COMPLETE
                              (fn []