Spacing fixes

Spacing fixes

--- src/terraboot/core.clj
+++ src/terraboot/core.clj
@@ -2,8 +2,7 @@
   (:require [clojure.string :as string]
             [cheshire.core :as json]
             [stencil.core :as mustache]
-            [clojure.pprint :refer [pprint]]
-            ))
+            [clojure.pprint :refer [pprint]]))

 (letfn [(merge-in* [a b]
           (if (map? a)
@@ -85,13 +84,11 @@

 (defn aws-instance [name spec]
   (let [default-sgs ["allow_outbound"]
-        default-sg-ids (map (partial id-of "aws_security_group") default-sgs)
-        ]
+        default-sg-ids (map (partial id-of "aws_security_group") default-sgs)]
     (resource "aws_instance" name (-> {:tags {:Name name}
                                        :instance_type "t2.micro"
                                        :key_name "ops"
-                                       :monitoring true
-                                       }
+                                       :monitoring true}
                                       (merge-in spec)
                                       (update-in [:vpc_security_group_ids] concat default-sg-ids)))))

@@ -159,9 +156,9 @@
                       (let [subnet-name (stringify "public" "-" az)
                             nat-eip (stringify subnet-name "-nat")]
                         [["aws_subnet" subnet-name {:tags {:Name subnet-name}
-                                            :vpc_id (id-of "aws_vpc" vpc-name)
-                                            :cidr_block (get-in cidr-block [:public az])
-                                            :availability_zone (stringify region az)
+                                                    :vpc_id (id-of "aws_vpc" vpc-name)
+                                                    :cidr_block (get-in cidr-block [:public az])
+                                                    :availability_zone (stringify region az)
                                                     }]
                          ["aws_route_table_association" subnet-name {:route_table_id (id-of "aws_route_table" "public")
                                                                      :subnet_id (id-of "aws_subnet" subnet-name)
@@ -179,9 +176,9 @@
                       (let [subnet-name (stringify "private-" az)
                             public-subnet-name (stringify "public-" az)]
                         [["aws_subnet" subnet-name {:tags {:Name subnet-name}
-                                            :vpc_id (id-of "aws_vpc" vpc-name)
-                                            :cidr_block (get-in cidr-block [:private az])
-                                            :availability_zone (stringify region az)
+                                                    :vpc_id (id-of "aws_vpc" vpc-name)
+                                                    :cidr_block (get-in cidr-block [:private az])
+                                                    :availability_zone (stringify region az)
                                                     }]
                          ["aws_route_table" subnet-name {:tags {:Name subnet-name}
                                                          :vpc_id (id-of "aws_vpc" vpc-name)


bugfix, cleanup

bugfix, cleanup

--- src/seathree/handler.clj
+++ src/seathree/handler.clj
@@ -25,7 +25,6 @@
 (defn map-keys-to-keywords
   "Given a map, convert its keys to keywords"
   [m]
-  (println m)
   (into {}
         (for [[k v] m]
           [(keyword k) v])))
@@ -55,7 +54,7 @@

 (defn handler [request]
   (if (valid? request)
-    (success (map-keys-to-keywords (:body request)))
+    (success (map map-keys-to-keywords (:body request)))
     (fail)))

 ; TODO wrap-gzip


before entities re-implementation

before entities re-implementation

--- src/shelver/user_dao.clj
+++ src/shelver/user_dao.clj
@@ -17,6 +17,26 @@
                                   :default v)]
                     (vector new-key new-val)))
                 model)))
+
+(defn ->entities [ns model]
+  (loop [entity {}
+         sub-entities '()
+         [[k v] & kvs] (seq model)]
+    (if k
+      (let [new-key (if (= "id" (name k))
+                      (keyword "db" (name k))
+                      (keyword ns (name k)))
+            [sube & _ :as subes] (when (map? v)
+                           (-> (->entities (name k) v)
+                               (update-in [0 :db/id] #(or % (d/tempid :db.part/user)))))
+            new-val (cond
+                      (keyword? v) (->enum ns k v)
+                      (some? sube) (get sube :db/id)
+                      :default v)]
+        (recur (assoc entity new-key new-val)
+               (concat sub-entities subes)
+               kvs))
+      (vec (conj sub-entities entity)))))

 (defn ->model [entity]
   (into {} (map (fn [[k v]]


Added function generating timestamps.

Added function generating timestamps.

--- src/test_utils/core.cljs
+++ src/test_utils/core.cljs
@@ -27,4 +27,10 @@
 (defn rand-alphas
   "Return a string a n random, alphabetic characters."
     ([] (repeatedly rand-alpha))
-    ([n] (apply str (take n (rand-alphas)))))
+    ([n] (apply str (take n (rand-alphas)))))i
+
+(defn rand-timestamp
+	[begin-year end-year]
+	"Return a vector with random timestamp elements with years in the range [begin-year, end-year)."
+	[(rand-range begin-year end-year) (rand-range 1 13) (rand-int 31) (rand-int 24) (rand-int 60) (rand-int 60)])
+


Adds skeleton functions for classifier storage.

--- src/cadence/model.clj
+++ src/cadence/model.clj
@@ -76,3 +76,18 @@
                           {:users user-id :random_point {"$near" (rand)}}
                           {:users {$ne user-id} :random_point {"$near" (rand)}})
                         {:phrase 1})))
+
+(defn store-classifier
+  "Stores the given classifier with the given user/phrase pair."
+  [user-id phrase-id classifier]
+  ; TODO Implement
+  true)
+
+(defn get-classifier
+  "Gets the classifier needed for the specified user/phrase."
+  [user-id phrase-id]
+  (if-let [result (mc/find-one-as-map "classifiers" {:user_id user-id :phrase_id phrase-id})]
+    result
+    (let [classifier (patrec/gen-phrase-classifier)] ; TODO Correct call to make-classifier
+      (store-classifier user-id phrase-id classifier)
+      classifier)))


Import CBORFactory for type hint

Import CBORFactory for type hint

Relates to #111

--- src/cheshire/core.clj
+++ src/cheshire/core.clj
@@ -7,6 +7,7 @@
   (:import (com.fasterxml.jackson.core JsonParser JsonFactory
                                        JsonGenerator PrettyPrinter
                                        JsonGenerator$Feature)
+           (com.fasterxml.jackson.dataformat.cbor CBORFactory)
            (com.fasterxml.jackson.dataformat.smile SmileFactory)
            (cheshire.prettyprint CustomPrettyPrinter)
            (java.io StringWriter StringReader BufferedReader BufferedWriter


need to bind cljs.repl/*repl-opts* sooner for IJavaScriptEnv -setup so cljs form evaluations work

--- src/clj/cljs/repl.clj
+++ src/clj/cljs/repl.clj
@@ -692,7 +692,8 @@
                  :undeclared-var warn-on-undeclared
                  :undeclared-ns warn-on-undeclared
                  :undeclared-ns-form warn-on-undeclared)
-               ana/*cljs-static-fns* static-fns]
+               ana/*cljs-static-fns* static-fns
+               *repl-opts* opts]
        ;; TODO: the follow should become dead code when the REPL is
        ;; sufficiently enhanced to understand :cache-analysis - David
        (let [env {:context :expr :locals {}}


Printing command line arguments when -h is passed as the command line argument.

--- src/gcal2org/core.clj
+++ src/gcal2org/core.clj
@@ -3,6 +3,7 @@
             [gcal2org.calendar :as calendar]
             [gcal2org.org :as org]
             [gcal2org.cli :as cli]
+            [clojure.string :as string]
             [clojure.java.io :as io]
             [clojure.string :as str]
             [clj-time.local :as l]
@@ -31,12 +32,20 @@
   (str (org/create-file-header category)
        (str/join "\n" (map org/create-org-event-entry events))))

+(defn usage [options-summary]
+  (->> ["Options:"
+        options-summary
+        ""
+        "Please go to https://github.com/dtulig/gcal2org for more information."]
+       (string/join \newline)))
+
 (defn -main [& args]
-  (let [{:keys [options] :as cmd-args} (cli/get-cmd-line-args args)]
-    (println cmd-args)
-    (io/make-parents (:output options))
-    (let [client (client/build-client (:store options) (str (:data options) "/client_secrets.json"))]
-      (->> (get-events client (:calendar options) min-time max-time)
-           (create-org-output (:category options))
-           (spit (:output options))))))
+  (let [{:keys [options summary] :as cmd-args} (cli/get-cmd-line-args args)]
+    (if-not (:help options)
+      (do (io/make-parents (:output options))
+        (let [client (client/build-client (:store options) (str (:data options) "/client_secrets.json"))]
+          (->> (get-events client (:calendar options) min-time max-time)
+               (create-org-output (:category options))
+               (spit (:output options)))))
+      (println (usage summary)))))


Cap creation

Cap creation

--- src/icecap/crypto.clj
+++ src/icecap/crypto.clj
@@ -11,7 +11,19 @@
   ;; (:require [caesium.crypto.generichash :refer [blake2b]]
   ;;           [caesium.crypto.secretbox :as secretbox])
   ;; (:import java.util Arrays)
-  )
+  (:require [crypto.random :as csprng]))
+
+(def cap-bits
+  "The size of a cap, in bits."
+  256)
+
+(def cap-bytes
+  "See cap-bits."
+  (/ cap-bits 8))
+
+(def make-cap
+  "Makes a new capability identifier."
+  (partial csprng/bytes cap-bytes))

 (def master-key-bits
   "The size of the master key, in bits."


simplify tests as 'gets' and 'sets'

simplify tests as 'gets' and 'sets'

--- test/nml/core_test.clj
+++ test/nml/core_test.clj
@@ -5,22 +5,18 @@

 (let [tree (nml-tree (slurp "test/nml/nl"))]

-  (deftest get-string
+  (deftest gets
     (is (= (nml-get tree "na" "C0") "'foo'"                                         ))
     (is (= (nml-get tree "NA" "c1") "'BAR'"                                         ))
     (is (= (nml-get tree "nA" "c2") "\"baz\""                                       ))
     (is (= (nml-get tree "Na" "C3") "'qu\nx'"                                       ))
     (is (= (nml-get tree "Na" "c4") "'a','b'"                                       ))
     (is (= (nml-get tree "Na" "c5") "'c','d'"                                       ))
-    (is (= (nml-get tree "Na" "x0") ""                                              )))
-
-  (deftest get-integer
+    (is (= (nml-get tree "Na" "x0") ""                                              ))
     (is (= (nml-get tree "nb" "I0") "88"                                            ))
     (is (= (nml-get tree "nb" "I1") "+88"                                           ))
     (is (= (nml-get tree "NB" "i2") "-88"                                           ))
-    (is (= (nml-get tree "nb" "i3") ""                                              )))
-
-  (deftest get-logical
+    (is (= (nml-get tree "nb" "i3") ""                                              ))
     (is (= (nml-get tree "NC" "t0") "t"                                             ))
     (is (= (nml-get tree "NC" "t1") "t"                                             ))
     (is (= (nml-get tree "NC" "t2") "t"                                             ))
@@ -32,39 +28,25 @@
     (is (= (nml-get tree "nc" "f2") "f"                                             ))
     (is (= (nml-get tree "nc" "f3") "f"                                             ))
     (is (= (nml-get tree "nc" "f4") "f"                                             ))
-    (is (= (nml-get tree "nc" "f5") "f"                                             )))
-
-  (deftest get-complex
+    (is (= (nml-get tree "nc" "f5") "f"                                             ))
     (is (= (nml-get tree "nd" "C0") "(1.,2.)"                                       ))
-    (is (= (nml-get tree "nd" "C1") "(1.1,2.2)"                                     )))
-
-  (deftest get-real
+    (is (= (nml-get tree "nd" "C1") "(1.1,2.2)"                                     ))
     (is (= (nml-get tree "ne" "r0") "1.,1.0,-1.0,+1.0"                              ))
     (is (= (nml-get tree "ne" "r1") "1.1e2,1.1d2,1.1e-2,1.1d+2"                     ))
-    (is (= (nml-get tree "ne" "r2") "-1.1e2,+1.1e2,-1.1d-2,+1.1d+2"                 )))
-
-  (deftest get-empty
+    (is (= (nml-get tree "ne" "r2") "-1.1e2,+1.1e2,-1.1d-2,+1.1d+2"                 ))
     (is (= (nml-get tree "nf" "x0") ""                                              ))
     (is (= (nml-get tree "zz" "x0") ""                                              )))

-  (deftest set-string
+  (deftest sets
     (is (= (nml-get (nml-set tree "na" "c0" "'FOO'") "na" "c0") "'FOO'"             ))
     (is (= (nml-get (nml-set tree "na" "x0" "'FOO'") "na" "x0") "'FOO'"             ))
-    (is (= (nml-get (nml-set tree "zz" "x0" "'FOO'") "zz" "x0") "'FOO'"             )))
-
-  (deftest set-integer
+    (is (= (nml-get (nml-set tree "zz" "x0" "'FOO'") "zz" "x0") "'FOO'"             ))
     (is (= (nml-get (nml-set tree "nb" "i0" "99") "nb" "i0") "99"                   ))
     (is (= (nml-get (nml-set tree "nb" "x0" "1, +2 -3") "nb" "x0") "1,+2,-3"        ))
-    (is (= (nml-get (nml-set tree "nb" "x0" "1\n2") "nb" "x0") "1,2"                )))
-
-  (deftest set-logical
+    (is (= (nml-get (nml-set tree "nb" "x0" "1\n2") "nb" "x0") "1,2"                ))
     (is (= (nml-get (nml-set tree "nc" "f0" "T,F") "nc" "f0") "t,f"                 ))
     (is (= (nml-get (nml-set tree "nc" "f0" ".false.,.true.") "nc" "f0") "f,t"      ))
     (is (= (nml-get (nml-set tree "nc" "x0" ".t1234") "nc" "x0") "t"                ))
-    (is (= (nml-get (nml-set tree "ZZ" "F0" ".fasdf") "zz" "f0") "f"                )))
-
-  (deftest set-complex
-    (is (= (nml-get (nml-set tree "ND" "C0" "(3.14,2.18)") "nd" "c0") "(3.14,2.18)" )))
-
-  (deftest set-real
+    (is (= (nml-get (nml-set tree "ZZ" "F0" ".fasdf") "zz" "f0") "f"                ))
+    (is (= (nml-get (nml-set tree "ND" "C0" "(3.14,2.18)") "nd" "c0") "(3.14,2.18)" ))
     (is (= (nml-get (nml-set tree "NE" "R0" "+314.e-2") "ne" "r0") "+314.e-2"       ))))


+(defn init-db)

+(defn init-db)

--- test/babel/test/test.clj
+++ test/babel/test/test.clj
@@ -2,6 +2,12 @@
   (:require
    [clojure.string :as string]
    [clojure.test :refer [deftest is]]))
+
+(defn init-db []
+  (->
+   "postgres://postgres@localhost:5432/babel"
+   babel.korma/init-db
+   babel.korma/create-tables))

 (defn generate-speed-test [spec model & [times]]
   "generate an expression according to the given _spec_ and _model_."


more tests for capitalize

more tests for capitalize

--- test/str/core_test.clj
+++ test/str/core_test.clj
@@ -101,6 +101,14 @@
                  c gen/char-alpha]
     (reduce lower-case-ascii-if-letter?
             (.substring (str/capitalize (str c s)) 1))))
+
+(deftest capitalize
+  (are [expected actual] (= expected actual)
+    "Foo" (str/capitalize "foo" )
+    "Foo" (str/capitalize "FOO")
+    "Foo" (str/capitalize "FoO")
+    "Foo" (str/capitalize "FoO")
+    "Foo." (str/capitalize "FoO.")))

 (defspec invert-case-does-not-change-length 100
   (prop/for-all [s gen/string]


Improved silent-fact and note-that

Improved silent-fact and note-that

`note-that` now refers specifically to the preceding `silent-fact`.

--- test/midje/test_util.clj
+++ test/midje/test_util.clj
@@ -7,7 +7,8 @@
         [clojure.set :only [subset?]]
         [midje.util.form-utils :only [macro-for]])
   (:require [midje.clojure-test-facade :as ctf]
-            [midje.config :as config]))
+            [midje.config :as config]
+            [midje.emission.state :as state]))

 (def reported (atom []))
@@ -48,31 +49,36 @@
        (>= (:fail (ctf/counters)) (:fail stashed-counters#)) midje.sweet/=> true)))

+(def silent-fact-failures (atom :unset))
+
+(defn output-counters []
+  @state/output-counters)
+
 (defmacro silent-fact [& args]
-  `(run-silently  ;; Scheduled to be deleted once reporting rewritten.
-    (without-externally-visible-changes
-     (midje.sweet/fact ~@args))))
-
-(defn fact-passes []
-  (empty? @reported))
-
-(def fact-fails (complement fact-passes))
-
-(defn failure-count []
-  (count @reported))
+  `(do
+     (let [result# (run-silently  ;; Scheduled to be deleted once reporting rewritten.
+                    (without-externally-visible-changes
+                     (state/reset-output-counters!)
+                     (midje.sweet/fact ~@args)
+                     (reset! silent-fact-failures (state/output-counters:midje-failures))))]
+       result#)))
+
+
+(defn fact-fails []
+  (pos? @silent-fact-failures))
+(def fact-passes (complement fact-fails))

 (defmacro note-that [& claims]
   (let [clauses (reduce (fn [so-far claim]
                           (cond (symbol? claim)
                                 (conj so-far `(~claim) '=> true)
-
+
                                 (= (first claim) 'fails)
-                                (conj so-far '(failure-count) '=> (second claim))))
+                                (conj so-far '@silent-fact-failures '=> (second claim))))
                         []
                         claims)]
-
     (with-meta `(midje.sweet/fact ~@clauses) (meta &form))))
-
+


Add map extension test.

Add map extension test.

--- test/puget/data_test.clj
+++ test/puget/data_test.clj
@@ -30,6 +30,15 @@
             #{'howdy 'doody}
             {:x 1 :y 2}
             t]))))
+
+
+(defrecord TestRecord [x y])
+(extend-tagged-map TestRecord test/record)
+
+(deftest tagged-value-extension
+  (let [rec (TestRecord. :foo :bar)]
+    (is (= 'test/record (edn-tag rec)))
+    (is (= {:x :foo, :y :bar} (edn-value rec)))))

 (deftest built-in-tagged-values


Allow usage of hotkeys while typing

Allow usage of hotkeys while typing

--- src/tabswitcher/views.cljs
+++ src/tabswitcher/views.cljs
@@ -6,9 +6,11 @@
 (defn query-input []
   [:div#query
    [:input {:type "text"
-            :on-key-up (fn [event]
-                         (dispatch [:filter
-                                    (-> event .-target .-value)]))}]])
+            :on-key-press (fn [event]
+                         (if (.-altKey event)
+                           (.preventDefault event)
+                           (dispatch [:filter
+                                      (-> event .-target .-value)])))}]])

 (defn result-item [idx result selection]
   [:li.result-item


implement search in mutations

implement search in mutations

--- src_cljs/rrm/corecljs.cljs
+++ src_cljs/rrm/corecljs.cljs
@@ -25,6 +25,8 @@
                           :current-page 1
                           :total-pages 1
                           :page-location nil
+                          :districts nil
+                          :subdivisions nil
                           :villages {}
                           :o2mutations {}
                           :o4mutations {}
@@ -171,16 +173,17 @@
                                                     (c/from-string (.-date %)))) data)))

-(defn get-search-url [mn dt]
-  (let [mnv (st/blank? mn)
-        dtv (st/blank? dt)
-        purl (str serverhost "mutations/search?")]
-    (cond (and (not mnv) dtv ) (str purl "mutationNumber=" mn)
-          (and mnv (not dtv))  (str purl  "value=" dt)
-          :else (str purl "mutationNumber="mn"&value="dt))))
-
-(defn get-index-url [is-searched-results sel-page mn dt]
-  (cond (= true is-searched-results)(str (get-search-url mn dt)"&pageIndex="sel-page"&pageSize=10")
+(defn get-search-url [vid mutno fp
+                      sp nop kkn
+                      o2n tit kn]
+  (let [purl (str serverhost "mutations/search?")]
+
+    (cond (not (st/blank? mutno)) (str purl "mutationNo="mutno)
+          :else (str purl "villageId="(int vid)"&firstparty="fp"&secondparty="sp"&nameofpo="nop"&khatakhatuninumber="kkn"&o2number="o2n"&title="tit"&khasranumber="kn))))
+
+(defn get-index-url [is-searched-results sel-page vid
+                     mutno fp sp nop kkn o2n tit kn]
+  (cond (= true is-searched-results)(str (get-search-url vid mutno fp sp nop kkn o2n tit kn)"&pageIndex="sel-page"&pageSize=10")
         :else (str serverhost "mutations?pageIndex="sel-page "&pageSize=10")))

 (defn get-new-page-data [data current-page total-pages]
@@ -213,8 +216,15 @@
 (def pager-elem (r/adapt-react-class (aget js/ReactBootstrap "Pagination")))

 (defn set-pager-data [sel-page-no]
-  (let [mt (.-value (.getElementById js/document "mutationnumber"))
-        v (.-value (.getElementById js/document "dt"))
+  (let [mn   (.-value (.getElementById js/document "mutationnumber"))
+        st   (.-value (.getElementById js/document "stitle"))
+        vid  (.-value (.getElementById js/document "src-vill"))
+        po   (.-value (.getElementById js/document "svillagename"))
+        so2  (.-value (.getElementById js/document "so2number"))
+        knum (.-value (.getElementById js/document "skhasranumber"))
+        kknum (.-value (.getElementById js/document "skhatakhatuninumber"))
+        fp (.-value (.getElementById js/document "snameofthefirstparty"))
+        sp (.-value (.getElementById js/document "snameofthesecondparty"))
         onres (fn[json]
                 (let [dt (getdata json)]
                   (set-key-value :mutations (.-data dt))
@@ -223,7 +233,8 @@
                                  [render-mutations (get-value! :mutations)])))]
     (http-get (get-index-url (get-value! :is-searched-results)
                              (dec (get-value! :current-page))
-                             mt v)
+                             vid mn fp sp po
+                             kknum so2 st knum)
               onres)))

 (defn pager [value total-rec]
@@ -289,19 +300,33 @@
 ;;.............. End of Tab Events ......

 (defn search [event]
-  (let [mn  (.-value (.getElementById js/document "mutationnumber"))
-        dt  (.-value (.getElementById js/document "dt"))
+  (let [mn   (.-value (.getElementById js/document "mutationnumber"))
+        st   (.-value (.getElementById js/document "stitle"))
+        vid  (.-value (.getElementById js/document "src-vill"))
+        po   (.-value (.getElementById js/document "svillagename"))
+        so2  (.-value (.getElementById js/document "so2number"))
+        knum (.-value (.getElementById js/document "skhasranumber"))
+        kknum (.-value (.getElementById js/document "skhatakhatuninumber"))
+        fp (.-value (.getElementById js/document "snameofthefirstparty"))
+        sp (.-value (.getElementById js/document "snameofthesecondparty"))
         onres (fn [json] (let [data (getdata json)]
                           (set-key-value :mutations (.-data data))
                           (set-key-value :total-pages
                                          (get-total-rec-no (.-pagesCount data)))
-                          (js/console.log (get-value! :total-pages))
-                                                    (set-key-value :page-location
+                          (set-key-value :page-location
                                          [render-mutations (get-value! :mutations)])))]
     (set-key-value :current-page 1)
     (set-key-value :is-searched-results true)
-    (http-get (str (get-search-url mn dt) "&pageIndex=0&pageSize=10")
-              onres)))
+    (http-get (str (get-search-url
+                    vid mn fp sp po
+                    kknum so2 st knum)"&pageIndex=0&pageSize=10") onres)))
+
+
+(defn input [label type id]
+  (row label [:input.form-control {:type type :id id :on-change on-change}]))
+
+;; --------------------------------------------------------------------------
+;; mutation form

 (defn form-validator [data-set]
@@ -316,7 +341,6 @@
                      :khasranumber [[v/required :message "Field is required"]]
                      :area [[v/required :message "Field is required"]]
                      :khatakhatuninumber [[v/required :message "Field is required"]]
-                     :subdivisionname  [[v/required :message "Field is required"]]
                      :o2number [[v/required :message "Field is required"]]
                      :o4number [[v/required :message "Field is required"]]
                      :o6number [[v/required :message "Field is required"]]
@@ -337,69 +361,6 @@
                            [:b (str (first ((form-validator @data-set) id)))]])
                         [:div])]])))

-
-(defn add-form-onclick [data-set focus]
-  (if (= nil (form-validator @data-set))
-    (do (reset! data-set (assoc @data-set :villageid
-                                (int (.-value (.getElementById js/document "districts")))))
-        (let [onres (fn[json]
-                      (secretary/dispatch! "/"))]
-          (http-post (str serverhost "mutations")
-                     onres  (.serialize (Serializer.) (clj->js @data-set)))))
-    (reset! focus "on")))
-
-
-(defn update-form-onclick [data-set focus]
-  (if (= nil (form-validator @data-set))
-    (do (reset! data-set (assoc @data-set :villageid
-                                (int (.-value (.getElementById js/document "districts")))))
-        (let [onres (fn[data]
-                      (secretary/dispatch! "/"))]
-          (http-put (str serverhost "mutations/" (:id @data-set))
-                    onres (.serialize (Serializer.) (clj->js @data-set)))))
-    (reset! focus "on")))
-
-(defn form-cancel [event]
-  (secretary/dispatch! "/"))
-
-(defn on-change [event]
-  (let [ele (.getElementById js/document "id")
-        eval (.-value ele)
-        onresp (fn [json]
-                 ;; (let [dt  (aggre-str (getdata json))]
-                 ;;   (set! (.-value ele) (if(empty? dt) eval dt))))]
-                 (let [dt (getdata json)]
-                   (set-key-value :villages dt)))]
-
-    (set-key-value :villages [])
-    (when-not ( >  1 (.-length eval))
-      (http-get (str serverhost "villages/search?name=" eval)
-                onresp))))
-
-(defn input [label type id]
-  (row label [:input.form-control {:type type :id id :on-change on-change}]))
-
-(defn get-villages []
-  (let [onres (fn[json]((set-key-value :villages (getdata json))))]
-    (http-get (str serverhost "villages") onres)))
-
-(defn tags-template [data-set]
-  (cond (nil? (:villageid @data-set)) [:select.form-control {:id "districts"}
-                                       (for [d (get-value! :villages)]
-                                         ^{:key (.-id d)} [:option {:value (.-id d)} (.-villagename d)])]
-        :else [:select.form-control {:id "districts" :defaultValue (:villageid @data-set)}
-               (doall (for [d (get-value! :villages)]
-                        ^{:key (.-id d)} [:option {:value (.-id d)} (.-villagename d)]))]))
-
-
-(defn form-input-select [label data-set focus]
-  (let [input-focus (r/atom nil)]
-    (fn []
-      [:div.form-group
-       [:label.col-sm-3.control-label label]
-       [:div#tagdiv.col-sm-6 [tags-template data-set]]
-       [:div.col-sm-3 [:div]]])))
-
 (defn datalist []
   [:datalist {:id "combo"}
    (let [name-po ["Kumar" "Sai" "Bhaskar" "Rajesh"]]
@@ -429,14 +390,74 @@
                            [:b (str (first ((form-validator @data-set) id)))]])
                         [:div])]])))

+(defn dist-onchange [id]
+  (let [res (fn [json]
+              (let [dt (getdata json)]
+                (set-key-value :subdivisions dt)
+                (set-key-value :villages nil)))]
+    (http-get (str  "http://localhost:9000/districts/" id  "/subdivisions") res)))
+
+(defn dist-sel-tag [id data data-set]
+  [:select.form-control {:id id
+                         :value (@data-set id)
+                         :on-change #(dist-onchange (-> % .-target .-value)) }
+   [:option {:value 0} "--Select--"]
+   (for [d  data]
+     ^{:key (.-id d)}
+     [:option {:value (.-id d)} (.-name d)])])
+
+(defn form-dist-sel [label id opt-data data-set]
+  [:div.form-group
+   [:label.col-sm-3.control-label label]
+   [:div.col-sm-6 [dist-sel-tag id opt-data data-set]]
+   [:div.col-sm-3 [:div]]])
+
+(defn sub-onchange [id]
+  (let [res (fn [json]
+              (let [dt (getdata json)]
+                (set-key-value :villages dt)))]
+    (http-get (str  "http://localhost:9000/subdivisions/" id  "/villages") res)))
+
+(defn sub-sel-tag [id data data-set]
+  [:select.form-control {:id id
+                         :value (@data-set id)
+                         :on-change #(sub-onchange (-> % .-target .-value))}
+   [:option {:value 0} "--Select--"]
+   (for [d  data]
+     ^{:key (.-id d) }
+     [:option {:value (.-id d)} (.-subdivisionname d)])])
+
+(defn form-sub-sel [label id opt-data data-set]
+  [:div.form-group
+   [:label.col-sm-3.control-label label]
+   [:div.col-sm-6 [sub-sel-tag id opt-data data-set]]
+   [:div.col-sm-3 [:div]]])
+
+
+(defn villages-sel-tag [id data data-set ]
+  [:select.form-control {:id id
+                         :value (@data-set id)
+                         :on-change #(swap! data-set assoc id (js/parseInt (-> % .-target .-value)))}
+   [:option {:value 0} "--Select--"]
+   (for [d  data]
+     ^{:key (.-id d) }
+     [:option {:value (.-id d)} (.-villagename d)])])
+
+(defn form-villages-sel [label id opt-data data-set]
+  [:div.form-group
+   [:label.col-sm-3.control-label label]
+   [:div.col-sm-6 [villages-sel-tag id opt-data data-set]]
+   [:div.col-sm-3 [:div]]])
+
+
 (defn mutation-template [doc-name data-set focus save-function]
- [:div.container
-  [:div.col-md-12
-   [:div.box.box-info
-    [:div.box-header.with-border
-     [:h2.box-title doc-name]]
-    [:div.form-horizontal
-     [:div.box-body
+  [:div.container
+   [:div.col-md-12
+    [:div.box.box-info
+     [:div.box-header.with-border
+      [:h2.box-title doc-name]]
+     [:div.form-horizontal
+      [:div.box-body
        [form-input-element :mutationnumber "Mutation Number" "text" data-set focus]
        [form-input-element :nameofthefirstparty "Name of the First Party" "text" data-set focus ]
        [form-input-element :nameofthesecondparty "Name of the Second Party" "text" data-set focus]
@@ -447,22 +468,24 @@
        [form-input-element :khasranumber "Khasra Number" "text" data-set focus]
        [form-input-element :area "Area" "text" data-set focus]
        [form-input-element :khatakhatuninumber "Khata Khatuni Number" "text" data-set focus]
-       [form-input-select "Village Name" data-set focus]
-       [form-input-element :subdivisionname "Sub division Name" "text" data-set focus]
+       [form-dist-sel "District" :districtid (:districts @storage) data-set]
+       [form-sub-sel "Sub-division Name" :subdivisionid (:subdivisions @storage) data-set]
+       [form-villages-sel "Village Name" :villageid (:villages @storage) data-set]
        [form-input-element :o2number "O2 Number" "text" data-set focus]
        [form-input-element :o4number "O4 Number" "text" data-set focus]
        [form-input-element :o6number "O6 Number" "text" data-set focus]
        [form-input-element :racknumber "Rack Number" "text" data-set focus]
        [form-input-element :receiveddate "Received Date" "date" data-set focus]
        [form-input-element :remarks "Remarks" "text" data-set focus]]
-     [:div.box-footer
-      [:button.btn.btn-default {:on-click form-cancel} "Cancel"]
-      [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]])
+      [:div.box-footer
+       [:button.btn.btn-default {:on-click form-cancel} "Cancel"]
+       [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]])

 (defn mutation-add-template []
   (let [add-data (r/atom {:isactive true})
         focus (r/atom nil)]
     (fn [] [mutation-template "Mutation Add Form" add-data focus #(add-form-onclick add-data focus)])))
+

 (defn mutation-update-template [id dmt]
   (let [update-data (r/atom {:id (int id)
@@ -476,24 +499,42 @@
                              :khasranumber (.-khasranumber dmt)
                              :khatakhatuninumber (.-khasranumber dmt)
                              :area (.-area dmt)
-                             :subdivisionname (.-subdivisionname dmt)
-                             :villageid (.-villageid dmt)
                              :o2number (.-o2number dmt)
                              :o4number (.-o4number dmt)
                              :o6number (.-o6number dmt)
                              :racknumber (.-racknumber dmt)
                              :receiveddate (.-receiveddate dmt)
                              :remarks (.-remarks dmt)
-                             :villagename (.-villagename dmt)
-                             :districtname (.-districtname dmt)
+                             :villageid (.-villageid dmt)
+                             :subdivisionid (.-subdivisionid dmt)
+                             :districtid (.-districtid dmt)
                              :isactive true})
         focus (r/atom nil)]
     (fn [] [mutation-template
             "Mutation Update Form"
             update-data
             focus
-            #(update-form-onclick update-data focus)])))
-
+            #(update-form-onclick update-data focus) sub-division-id])))
+
+
+(defn add-form-onclick [data-set focus]
+  (if (= nil (form-validator @data-set))
+    (let [onres (fn[json]
+                  (secretary/dispatch! "/"))]
+      (http-post (str serverhost "mutations")
+                     onres  (.serialize (Serializer.) (clj->js @data-set))))
+    (reset! focus "on")))
+
+(defn update-form-onclick [data-set focus]
+  (if (= nil (form-validator @data-set))
+     (let [onres (fn[data]
+                      (secretary/dispatch! "/"))]
+          (http-put (str serverhost "mutations/" (:id @data-set))
+                    onres (.serialize (Serializer.) (clj->js @data-set)))))
+    (reset! focus "on"))
+
+(defn form-cancel [event]
+  (secretary/dispatch! "/"))

 (defn click-update[id]
   (secretary/dispatch! (str "/mutations/update/" id)))
@@ -519,105 +560,94 @@
     (http-get (str serverhost "mutations?pageIndex=0&pageSize=10") onres)))

-(defn districtlist []
-  [:datalist {:id "distcombo"}
-   (let [district ["Kumar" "Sai" "Bhaskar" "Rajesh"]]
-     (for [i district]
-       ^{:key i}
-       [:option {:value i}]))])
-
-(defn divisionlist []
-  [:datalist {:id "divcombo"}
-   (let [division ["Kumar" "Sai" "Bhaskar" "Rajesh"]]
-     (for [i division]
-       ^{:key i}
-       [:option {:value i}]))])
-
-(defn villagelist []
-  [:datalist {:id "villagecombo"}
-   (let [village ["Kumar" "Sai" "Bhaskar" "Rajesh"]]
-     (for [i village]
-       ^{:key i}
-       [:option {:value i}]))])
-
-(defn nameofpolist []
-  [:datalist {:id "nameofpocombo"}
-   (let [po ["Kumar" "Sai" "Bhaskar" "Rajesh"]]
-     (for [i po]
-       ^{:key i}
-       [:option {:value i}]))])
+(defn src-dist-sel-tag []
+  [:select.form-control {:id :src-dist
+                         :placeholder "District Name"
+                         :on-change #(dist-onchange (-> % .-target .-value)) }
+   [:option {:value 0} "--Select--"]
+   (for [d  (@storage :districts)]
+     ^{:key (.-id d)}
+     [:option {:value (.-id d)} (.-name d)])])
+
+(defn src-sub-sel-tag []
+  [:select.form-control {:id :src-sub
+                         :placeholder "Sub Division Name"
+                         :on-change  #(sub-onchange (-> % .-target .-value)) }
+   [:option {:value 0} "--Select--"]
+   (for [d  (@storage :subdivisions)]
+     ^{:key (.-id d)}
+     [:option {:value (.-id d)} (.-subdivisionname d)])])
+
+(defn src-vill-sel-tag []
+  [:select.form-control {:id :src-vill
+                         :placeholder "Village Name"
+                          }
+   [:option {:value 0} "--Select--"]
+   (for [d  (@storage :villages)]
+     ^{:key (.-id d)}
+     [:option {:value (.-id d)} (.-villagename d)])])
+

 (defn render-mutations [mutations]
   [:div
-   ;; [:div.padding]
-   ;; [:div.page-header [:h1 "Record Room Management System"]]
-   [:div#add]
-   [:div#update]
    [:div {:class "box"}
     [:div {:class "box-header"}
      [:h3 "List of Mutations"]]
-      [:div.col-md-12
-       ;; [:div.col-sm-2 [:input.form-control {:id "dt1" :type "date"}]]
-       ;; [:div.col-sm-2 [:input.form-control {:id "dt2" :type "date"}]]
-       [:div.form-group
-        [:div.row
-         [:div.col-sm-2 "Mutation Number"
-          [:input.form-control {:id "mutationnumber"
+    [:div.col-md-12
+     [:div.form-group
+      [:div.row
+       [:div.col-sm-2 "Mutation Number"
+        [:input.form-control {:id "mutationnumber"
                               :type "text"
-                                :placeholder "Enter search by mutationnumber"}]]
-         [:div.col-sm-2 "Enter Search Text"
-          [:input.form-control {:id "dt" :type "text"
-                                               :placeholder "Enter search text.."}]]]]
-       [:div.form-group
-        [:div.row
-         [:div.col-sm-2 "District Name"
-          [:input.form-control {:id "sdistrictname"
-                                :list "combo"
-                                :placeholder "District Name"}[districtlist]]]
-         [:div.col-sm-2 "Sub Division Name"
-          [:input.form-control {:id "ssubdivisionname"
-                                :list "combo"
-                                :placeholder "Sub Division Name"}[divisionlist]]]
-         [:div.col-sm-2 "Village Name"
-          [:input.form-control {:id "svillagename"
-                                :list "combo"
-                                :placeholder "Village Name"}[villagelist]]]
-        [:div.col-sm-2 "O2 Number"
-         [:input.form-control {:id "so2number"
-                               :type "text"
-                               :placeholder "O2 Number"}]]
-        [:div.col-sm-2 "Name of the First Party"
-         [:input.form-control {:id "snameofthefirstparty"
-                               :type "text"
-                               :placeholder "Name of the First Party"}]]]]
-       [:div.form-group
-        [:div.row
-         [:div.col-sm-2 "Name of the Second Party"
-          [:input.form-control {:id "snameofthesecondparty"
-                                :type "text"
-                                :placeholder "Name of the Second Party"}]]
-         [:div.col-sm-2 "Name Of P.O"
-          [:input.form-control {:id "svillagename"
-                                :list "combo"
-                                :placeholder "Name Of P.O"}[nameofpolist]]]
-          [:div.col-sm-2 "Title"
-           [:input.form-control {:id "stitle"
-                                 :type "text"
-                                 :placeholder "Title"}]]
-         [:div.col-sm-2 "Khasra Number"
-          [:input.form-control {:id "skhasranumber"
-                                :type "text"
-                                :placeholder "Khasra Number"}]]
-         [:div.col-sm-2 "Khata khatuni Number"
-          [:input.form-control {:id "skhatakhatuninumber"
-                                :type "text"
-                                :placeholder "Khata Khatuni Number"}]]]
-        [:div.form-group
-         [:div.row
-          [:div.col-sm-2.col-md-offset-5 {:style {:padding-top "20px"}}
-           [:input.btn.btn-primary {:type "button" :value "Search" :on-click search}]
-           [:input.btn.btn-primary {:type "button" :value "Add" :on-click add}]
-           [:input.btn.btn-primary {:id "getall" :type "button" :value "Refresh":on-click get-all-click}]]]]]]
+                              :placeholder "Enter search by mutationnumber"}]]
+       [:div.col-sm-2 "Enter Search Text"
+        [:input.form-control {:id "dt" :type "text"
+                              :placeholder "Enter search text.."}]]]]
+
+     [:div.form-group
+      [:div.row
+       [:div.col-sm-2 "Title"
+        [:input.form-control {:id "stitle"
+                              :type "text"
+                              :placeholder "Title"}]]
+       [:div.col-sm-2 "District Name"
+        [src-dist-sel-tag]]
+       [:div.col-sm-2 "Sub Division Name"
+        [src-sub-sel-tag]]
+       [:div.col-sm-2 "Village Name"
+        [src-vill-sel-tag]]
+       [:div.col-sm-2 "Name Of P.O"
+        [:input.form-control {:id "svillagename"
+                              :list "combo"
+                              :placeholder "Name Of P.O"}[datalist]]]]]
+     [:div.form-group
+      [:div.row
+       [:div.col-sm-2 "O2 Number"
+        [:input.form-control {:id "so2number"
+                              :type "text"
+                              :placeholder "O2 Number"}]]
+       [:div.col-sm-2 "Khasra Number"
+        [:input.form-control {:id "skhasranumber"
+                              :type "text"
+                              :placeholder "Khasra Number"} ]]
+       [:div.col-sm-2 "Khata khatuni Number"
+        [:input.form-control {:id "skhatakhatuninumber"
+                              :type "text"
+                              :placeholder "Khata Khatuni Number"}]]
+       [:div.col-sm-2 "Name of the First Party"
+        [:input.form-control {:id "snameofthefirstparty"
+                              :type "text"
+                              :placeholder "Name of the First Party"}]]
+       [:div.col-sm-2 "Name of the Second Party"
+        [:input.form-control {:id "snameofthesecondparty"
+                              :type "text"
+                              :placeholder "Name of the Second Party"}]]]]
+     [:div.form-group
+      [:div.row
+       [:div.col-sm-2.col-md-offset-5 {:style {:padding-top "20px"}}
+        [:input.btn.btn-primary {:type "button" :value "Search" :on-click search}]
+        [:input.btn.btn-primary {:type "button" :value "Add" :on-click add}]
+        [:input.btn.btn-primary {:id "getall" :type "button" :value "Refresh":on-click get-all-click}]]]]]

     [:div {:class "box-body"}
      [:table {:class "table table-bordered table-striped dataTable"}
@@ -628,7 +658,7 @@
         [:th "Name of The SecondParty"]
         [:th "Date of Institution"]
         [:th "Name of P.O"]
-        [:th "Name of Districts"]
+        ;;  [:th "Name of Districts"]
         [:th "Name of Village"]
         [:th "SubDivisionName"]
         [:th " "]
@@ -640,20 +670,15 @@
                             [:td (.-mutationnumber mt)]
                             [:td (.-nameofthefirstparty mt)]
                             [:td (.-nameofthesecondparty mt)]
-                            ;;  [:td  (f/unparse (f/formatter "dd-MMM-yyyy")(f/parse (.-dateofinstitution dn)))]
                             [:td (.-dateofinstitution mt)]
                             [:td (.-nameofpo mt)]
-                            [:td (.-districtname mt)]
+                            ;; [:td (.-districtname mt)]
                             [:td (.-villagename mt)]
                             [:td (.-subdivisionname mt)]
-                            ;; [:td [:input {:type "button" :on-click #(click-update(.-id dn))
-                            ;;               :class "glyphicon glyphicon-edit" :value "Update"}
-                            ;;       ]]
                             [:td [:a {:href "javascript:;" :on-click  #(click-update (.-id mt))  :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]]
-                            ;; [:td [:input {:type "button" :on-click #(delete(.-id dn))
-                            ;;               :class "glyphicon glyphicon-remove"  :value "Delete"}]]
                             [:td  [:a {:href "javascript:;" :on-click #(delete(.-id mt))  :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}] ]])]]
-       [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]])
+     [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]])
+

 (defroute mutations-list "/mutations" []
   (let [onres (fn [json]
@@ -661,23 +686,47 @@
                   (set-key-value :mutations (.-data dt))
                   (set-key-value :total-pages (get-total-rec-no (.-pagesCount dt)))
                   (set-key-value :page-location  [render-mutations (get-value! :mutations)])))]
-    (set-key-value :is-searched-results false)
-    (http-get (str serverhost "mutations?pageIndex="(dec (get-value! :current-page))"&pageSize=10") onres)))
+          (set-key-value :is-searched-results false)
+      (http-get (str serverhost "mutations?pageIndex="(dec (get-value! :current-page))"&pageSize=10") onres)))

 (defroute documents-path "/mutations/add" []
   (let [onres (fn[json](
-                        (set-key-value :villages (getdata json))
+                        (set-key-value :districts (getdata json))
                         (set-page! [mutation-add-template])))]
-    (http-get (str serverhost "villages") onres)))
+    (http-get (str serverhost "districts") onres)))

 (defroute documents-path1 "/mutations/update/:id" [id]
-  (let [onres (fn[json](
-                       (set-key-value :villages (getdata json))
-                       (set-page! [mutation-update-template id
-                                   (first (filter (fn[obj]
-                                                    (=(.-id obj) (.parseInt js/window id))) (get-value! :mutations)))])))]
-    (http-get (str serverhost "villages") onres)))
+  (let [upd-data (first (filter (fn[obj] (=(.-id obj) (.parseInt js/window id))) (get-value! :mutations)))
+
+        ;; sub-id  (r/atom nil)
+        ;; dist-id  (r/atom nil)
+
+        vill-res (fn[json](set-key-value :villages (getdata json)))
+        sub-res (fn[json](set-key-value :subdivisions (getdata json)))
+        dist-res (fn[json] ((set-key-value :districts (getdata json))
+                            (set-page! [mutation-update-template id upd-data])))]
+    (do
+      ;; (http-get (str serverhost "villages/" (.-villageid upd-data))
+      ;;           (fn [json]
+      ;;             (let [dt (getdata json)]
+      ;;               (reset! sub-id dt ))))
+
+      ;; (http-get (str  serverhost "subdivisions/" (.-subdivisionid sub-id))
+      ;;             (fn [json]
+      ;;               (reset! dist-id (getdata json))))
+
+      ;; (js/console.log upd-data)
+      ;; (js/console.log sub-id)
+      ;; (js/console.log )
+      (http-get (str serverhost "districts") dist-res)
+      ;; (http-get (str serverhost "districts" (.-districtid dist-id) "subdivisions") sub-res)
+      ;; (http-get (str serverhost "subdivisions" (.-subdivionid sub-id) "villages") vill-res)
+      (http-get (str serverhost "villages") vill-res)
+      (http-get (str serverhost "subdivisions") sub-res)
+      )))
+
+

 ;; ---------------------------------------------------------
 ;; rvenue-records
@@ -730,13 +779,13 @@

 (defn revenue-template [doc-name data-set focus save-function]
- [:div.container
-  [:div.col-md-12
-   [:div.box.box-info
-    [:div.box-header.with-border
-     [:h2.box-title doc-name]]
-    [:div.form-horizontal
-     [:div.box-body
+  [:div.container
+   [:div.col-md-12
+    [:div.box.box-info
+     [:div.box-header.with-border
+      [:h2.box-title doc-name]]
+     [:div.form-horizontal
+      [:div.box-body
        [revenue-input-int-row :serialnumber "Serial Number" "text" data-set focus]
        [revenue-input-select "Village Name" data-set focus ]
        [revenue-input-row :subdivisionname "Sub Division Name" "text" data-set focus]
@@ -744,9 +793,9 @@
        [revenue-input-row :year "Year" "date" data-set focus]
        [revenue-input-row :racknumber "Rack Number" "text" data-set focus]
        [revenue-input-row :description "description" "text" data-set focus]
-    [:div.box-footer
-      [:button.btn.btn-default {:on-click revenue-form-cancel} "Cancel"]
-      [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])
+       [:div.box-footer
+        [:button.btn.btn-default {:on-click revenue-form-cancel} "Cancel"]
+        [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])

 (defn revenue-add-form-onclick [data-set focus]
@@ -798,10 +847,10 @@
 (defn revenue-add-template []
   (let [add-data (r/atom {:isactive true})
         focus (r/atom nil)]
-    (fn [] [revenue-template
-    	    "Revenue Add Form"
-    	      add-data focus
-    	       #(revenue-add-form-onclick add-data focus)])))
+    (fn [] [revenue-template
+           "Revenue Add Form"
+           add-data focus
+           #(revenue-add-form-onclick add-data focus)])))

 (defn revenue-update-template [id dmt]
   (let [update-data (r/atom {:id (int id)
@@ -816,9 +865,9 @@
                              :isactive true})
         focus (r/atom nil)]
     (fn [] [revenue-template
-            "Revenue Update Form"
-            update-data focus
-            #(revenue-update-form-onclick update-data focus)])))
+           "Revenue Update Form"
+           update-data focus
+           #(revenue-update-form-onclick update-data focus)])))

 (defn revenue-update[id]
@@ -866,7 +915,7 @@
      [:div.col-md-12
       [:div.form-group
        [:input {:type "button" :value "Add"
-                :class "btn btn-primary" :on-click revenue-add}]
+                :class "btn btn-primary" :on-click revenue-add}]
        ;; [:input {:id "getall" :type "button" :value "Refresh"
        ;;          :class "btn btn-primary" :on-click get-all-click}]
        ]
@@ -945,13 +994,13 @@

 (defn khasragirdwani-template [doc-name data-set focus save-function]
- [:div.container
-  [:div.col-md-12
-   [:div.box.box-info
-    [:div.box-header.with-border
-     [:h2.box-title doc-name]]
-    [:div.form-horizontal
-     [:div.box-body
+  [:div.container
+   [:div.col-md-12
+    [:div.box.box-info
+     [:div.box-header.with-border
+      [:h2.box-title doc-name]]
+     [:div.form-horizontal
+      [:div.box-body
        [khasragirdwani-input-int-row :serialnumber "Serial Number" "text" data-set focus]
        [khasragirdwani-input-select "Village Name" data-set focus ]
        [khasragirdwani-input-row :subdivisionname "Sub Division Name" "text" data-set focus]
@@ -959,9 +1008,9 @@
        [khasragirdwani-input-row :year "Year" "date" data-set focus]
        [khasragirdwani-input-row :racknumber "Rack Number" "text" data-set focus]
        [khasragirdwani-input-row :description "description" "text" data-set focus]
-    [:div.box-footer
-      [:button.btn.btn-default {:on-click khasragirdwani-form-cancel} "Cancel"]
-      [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])
+       [:div.box-footer
+        [:button.btn.btn-default {:on-click khasragirdwani-form-cancel} "Cancel"]
+        [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])

 (defn khasragirdwani-add-form-onclick [data-set focus]
@@ -1016,10 +1065,10 @@
 (defn khasragirdwani-add-template []
   (let [add-data (r/atom {:isactive true})
         focus (r/atom nil)]
-    (fn [] [khasragirdwani-template
-          "khasragirdwani Add Form"
-            add-data focus
-             #(khasragirdwani-add-form-onclick add-data focus)])))
+    (fn [] [khasragirdwani-template
+           "khasragirdwani Add Form"
+           add-data focus
+           #(khasragirdwani-add-form-onclick add-data focus)])))

 (defn khasragirdwani-update-template [id dmt]
   (let [update-data (r/atom {:id (int id)
@@ -1085,7 +1134,7 @@
      [:div.col-md-12
       [:div.form-group
        [:input {:type "button" :value "Add"
-                :class "btn btn-primary" :on-click khasragirdwani-add}]
+                :class "btn btn-primary" :on-click khasragirdwani-add}]
        ;; [:input {:id "getall" :type "button" :value "Refresh"
        ;;          :class "btn btn-primary" :on-click get-all-click}]
        ]
@@ -1163,13 +1212,13 @@

 (defn masavi-template [doc-name data-set focus save-function]
- [:div.container
-  [:div.col-md-12
-   [:div.box.box-info
-    [:div.box-header.with-border
-     [:h2.box-title doc-name]]
-    [:div.form-horizontal
-     [:div.box-body
+  [:div.container
+   [:div.col-md-12
+    [:div.box.box-info
+     [:div.box-header.with-border
+      [:h2.box-title doc-name]]
+     [:div.form-horizontal
+      [:div.box-body
        [masavi-input-int-row :serialnumber "Serial Number" "text" data-set focus]
        [masavi-input-select "Village Name" data-set focus ]
        [masavi-input-row :subdivisionname "Sub Division Name" "text" data-set focus]
@@ -1177,9 +1226,9 @@
        [masavi-input-row :year "Year" "date" data-set focus]
        [masavi-input-row :racknumber "Rack Number" "text" data-set focus]
        [masavi-input-row :description "description" "text" data-set focus]
-    [:div.box-footer
-      [:button.btn.btn-default {:on-click masavi-form-cancel} "Cancel"]
-      [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])
+       [:div.box-footer
+        [:button.btn.btn-default {:on-click masavi-form-cancel} "Cancel"]
+        [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])

 (defn masavi-add-form-onclick [data-set focus]
@@ -1231,10 +1280,10 @@
 (defn masavi-add-template []
   (let [add-data (r/atom {:isactive true})
         focus (r/atom nil)]
-    (fn [] [masavi-template
-          "masavi Add Form"
-            add-data focus
-             #(masavi-add-form-onclick add-data focus)])))
+    (fn [] [masavi-template
+           "masavi Add Form"
+           add-data focus
+           #(masavi-add-form-onclick add-data focus)])))

 (defn masavi-update-template [id dmt]
   (let [update-data (r/atom {:id (int id)
@@ -1298,7 +1347,7 @@
      [:div.col-md-12
       [:div.form-group
        [:input {:type "button" :value "Add"
-                :class "btn btn-primary" :on-click masavi-add}]
+                :class "btn btn-primary" :on-click masavi-add}]
        ;; [:input {:id "getall" :type "button" :value "Refresh"
        ;;          :class "btn btn-primary" :on-click get-all-click}]
        ]
@@ -1377,13 +1426,13 @@

 (defn consolidation-template [doc-name data-set focus save-function]
- [:div.container
-  [:div.col-md-12
-   [:div.box.box-info
-    [:div.box-header.with-border
-     [:h2.box-title doc-name]]
-    [:div.form-horizontal
-     [:div.box-body
+  [:div.container
+   [:div.col-md-12
+    [:div.box.box-info
+     [:div.box-header.with-border
+      [:h2.box-title doc-name]]
+     [:div.form-horizontal
+      [:div.box-body
        [consolidation-input-int-row :serialnumber "Serial Number" "text" data-set focus]
        [consolidation-input-select "Village Name" data-set focus ]
        [consolidation-input-row :subdivisionname "Sub Division Name" "text" data-set focus]
@@ -1391,9 +1440,9 @@
        [consolidation-input-row :year "Year" "date" data-set focus]
        [consolidation-input-row :racknumber "Rack Number" "text" data-set focus]
        [consolidation-input-row :description "description" "text" data-set focus]
-    [:div.box-footer
-      [:button.btn.btn-default {:on-click consolidation-form-cancel} "Cancel"]
-      [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])
+       [:div.box-footer
+        [:button.btn.btn-default {:on-click consolidation-form-cancel} "Cancel"]
+        [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])

 (defn consolidation-add-form-onclick [data-set focus]
@@ -1445,10 +1494,10 @@
 (defn consolidation-add-template []
   (let [add-data (r/atom {:isactive true})
         focus (r/atom nil)]
-    (fn [] [consolidation-template
-          "consolidation Add Form"
-            add-data focus
-             #(consolidation-add-form-onclick add-data focus)])))
+    (fn [] [consolidation-template
+           "consolidation Add Form"
+           add-data focus
+           #(consolidation-add-form-onclick add-data focus)])))

 (defn consolidation-update-template [id dmt]
   (let [update-data (r/atom {:id (int id)
@@ -1512,7 +1561,7 @@
      [:div.col-md-12
       [:div.form-group
        [:input {:type "button" :value "Add"
-                :class "btn btn-primary" :on-click consolidation-add}]
+                :class "btn btn-primary" :on-click consolidation-add}]
        ;; [:input {:id "getall" :type "button" :value "Refresh"
        ;;          :class "btn btn-primary" :on-click get-all-click}]
        ]
@@ -1590,13 +1639,13 @@

 (defn fieldbook-template [doc-name data-set focus save-function]
- [:div.container
-  [:div.col-md-12
-   [:div.box.box-info
-    [:div.box-header.with-border
-     [:h2.box-title doc-name]]
-    [:div.form-horizontal
-     [:div.box-body
+  [:div.container
+   [:div.col-md-12
+    [:div.box.box-info
+     [:div.box-header.with-border
+      [:h2.box-title doc-name]]
+     [:div.form-horizontal
+      [:div.box-body
        [fieldbook-input-int-row :serialnumber "Serial Number" "text" data-set focus]
        [fieldbook-input-select "Village Name" data-set focus ]
        [fieldbook-input-row :subdivisionname "Sub Division Name" "text" data-set focus]
@@ -1604,9 +1653,9 @@
        [fieldbook-input-row :year "Year" "date" data-set focus]
        [fieldbook-input-row :racknumber "Rack Number" "text" data-set focus]
        [fieldbook-input-row :description "description" "text" data-set focus]
-    [:div.box-footer
-      [:button.btn.btn-default {:on-click fieldbook-form-cancel} "Cancel"]
-      [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])
+       [:div.box-footer
+        [:button.btn.btn-default {:on-click fieldbook-form-cancel} "Cancel"]
+        [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])

 (defn fieldbook-add-form-onclick [data-set focus]
@@ -1658,10 +1707,10 @@
 (defn fieldbook-add-template []
   (let [add-data (r/atom {:isactive true})
         focus (r/atom nil)]
-    (fn [] [fieldbook-template
-          "fieldbook Add Form"
-            add-data focus
-             #(fieldbook-add-form-onclick add-data focus)])))
+    (fn [] [fieldbook-template
+           "fieldbook Add Form"
+           add-data focus
+           #(fieldbook-add-form-onclick add-data focus)])))

 (defn fieldbook-update-template [id dmt]
   (let [update-data (r/atom {:id (int id)
@@ -1725,7 +1774,7 @@
      [:div.col-md-12
       [:div.form-group
        [:input {:type "button" :value "Add"
-                :class "btn btn-primary" :on-click fieldbook-add}]
+                :class "btn btn-primary" :on-click fieldbook-add}]
        ;; [:input {:id "getall" :type "button" :value "Refresh"
        ;;          :class "btn btn-primary" :on-click get-all-click}]
        ]
@@ -1803,31 +1852,31 @@

 (defn misc-template [doc-name data-set focus save-function]
- [:div.container
-  [:div.col-md-12
-   [:div.box.box-info
-    [:div.box-header.with-border
-     [:h2.box-title doc-name]]
-    [:div.form-horizontal
-     [:div.box-body
+  [:div.container
+   [:div.col-md-12
+    [:div.box.box-info
+     [:div.box-header.with-border
+      [:h2.box-title doc-name]]
+     [:div.form-horizontal
+      [:div.box-body
        [misc-input-row :filenumber "File Numbar" "text" data-set focus]
        [misc-input-row :subject "Subject" "text" data-set focus]
        [misc-input-row :title "Title" "text" data-set focus]
        [misc-input-row :remarks "Remarks" "text" data-set focus]
        [misc-input-row :dispatcheddate "Dispatched Date" "date" data-set focus]
        [misc-input-row :receiveddate "Recevied Date" "date" data-set focus]
-    [:div.box-footer
-      [:button.btn.btn-default {:on-click misc-form-cancel} "Cancel"]
-      [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])
+       [:div.box-footer
+        [:button.btn.btn-default {:on-click misc-form-cancel} "Cancel"]
+        [:button.btn.btn-info.pull-right {:on-click save-function} "Save"]]]]]]])

 (defn misc-add-template []
   (let [add-data (r/atom {:isactive true})
         focus (r/atom nil)]
-    (fn [] [misc-template
-              "misc Add Form"
-               add-data
-               focus
-               #(misc-add-form-onclick add-data focus)])))
+    (fn [] [misc-template
+           "misc Add Form"
+           add-data
+           focus
+           #(misc-add-form-onclick add-data focus)])))

 (defn misc-update-template [id dmt]
   (let [update-data (r/atom {:id (int id)
@@ -1840,10 +1889,10 @@
                              })
         focus (r/atom nil)]
     (fn [] [misc-template
-            "misc Update Form"
-            update-data
-            focus
-            #(misc-update-form-onclick update-data focus)])))
+           "misc Update Form"
+           update-data
+           focus
+           #(misc-update-form-onclick update-data focus)])))

 (defn misc-add-form-onclick [data-set focus]
@@ -2005,7 +2054,8 @@
     (swap! data-set assoc :nameofthefirstparty nil)
     (swap! data-set assoc :racknumber nil)
     (swap! data-set assoc :mutationid nil)
-    (swap! data-set assoc :villagename "")))
+    (swap! data-set assoc :villagename "")
+    (swap! data-set assoc :o2number nil)))

 (defn on-o2-change [data-set]
   (let [selval (.-value (.getElementById js/document "O2-select"))
@@ -2029,7 +2079,7 @@
   [:div.container
    [:div.col-md-12
     [:div.box.box-info
-     [:div.box-header.with-border
+     [:div.box-header.with-border
       [:h2.box-title doc-name]]
      [:div.form-horizontal
       [:div.box-body
@@ -2096,8 +2146,8 @@
 (defn o2register-add-template []
   (let [add-data (r/atom {:isactive true})
         focus (r/atom nil)]
-    (fn [] [o2register-template
-           "o2register Add Form"
+    (fn [] [o2register-template
+           "o2register Add Form"
            add-data focus
            #(o2register-add-form-onclick add-data focus)])))

@@ -2148,8 +2198,8 @@
   (let [onres (fn[json](
                        (set-key-value :villages (getdata json))
                        (set-page! [o2register-add-template])))
-        ono2resp (fn [json] ((set-key-value :o2mutations
-                                           (clj->js (cons "select" (js->clj (getdata json)))))))]
+        ono2resp (fn [json] (set-key-value :o2mutations
+                                          (clj->js (cons "select" (js->clj (getdata json))))))]
     (http-get (str serverhost "mutations/o2numbers/search") ono2resp)
     (http-get (str serverhost "villages") onres)))

@@ -2159,8 +2209,8 @@
                        (set-page! [o2register-update-template id
                                    (first (filter (fn[obj]
                                                     (=(.-id obj) (.parseInt js/window id))) (get-value! :o2registers)))])))
-        ono2resp (fn [json] ((set-key-value :o2mutations
-                                           (clj->js (cons "select" (js->clj (getdata json)))))))]
+        ono2resp (fn [json] (set-key-value :o2mutations
+                                          (clj->js (cons "select" (js->clj (getdata json))))))]
     (http-get (str serverhost "mutations/o2numbers/search") ono2resp)
     (http-get (str serverhost "villages") onres)))

@@ -2176,7 +2226,7 @@
      [:div.col-md-12
       [:div.form-group
        [:input {:type "button" :value "Add"
-                :class "btn btn-primary" :on-click o2register-add}]
+                :class "btn btn-primary" :on-click o2register-add}]
        ;; [:input {:id "getall" :type "button" :value "Refresh"
        ;;          :class "btn btn-primary" :on-click get-all-click}]
        ]
@@ -2252,7 +2302,7 @@
   [:div.container
    [:div.col-md-12
     [:div.box.box-info
-     [:div.box-header.with-border
+     [:div.box-header.with-border
       [:h2.box-title doc-name]]
      [:div.form-horizontal
       [:div.box-body
@@ -2271,11 +2321,11 @@
 (defn o4register-add-template []
   (let [add-data (r/atom {:isactive true})
         focus (r/atom nil)]
-    (fn [] [o4register-template
-              "o4register Add Form"
-               add-data
-               focus
-               #(o4register-add-form-onclick add-data focus)])))
+    (fn [] [o4register-template
+           "o4register Add Form"
+           add-data
+           focus
+           #(o4register-add-form-onclick add-data focus)])))

 (defn o4register-update-template [id dmt]
   (let [update-data (r/atom {:id (int id)
@@ -2293,7 +2343,7 @@
         focus (r/atom nil)]
     (fn [] [o4register-template
            "o4register Update Form"
-           update-data
+           update-data
            focus
            #(o4register-update-form-onclick update-data focus)])))

@@ -2315,11 +2365,12 @@
     (swap! data-set assoc :khasranumber nil)
     (swap! data-set assoc :area nil)
     (swap! data-set assoc :mutationid nil)
-    (swap! data-set assoc :villagename "")))
+    (swap! data-set assoc :villagename "")
+    (swap! data-set assoc :o4number nil)))

 (defn on-o4-change [data-set]
   (let [selval (.-value (.getElementById js/document "O4-select"))
-        onres (fn [json] (let [d (first (getdata json))]
+        onres (fn [json] (let [d (aget (getdata json) 0)]
                           (set-o4-fields data-set d)))]
     (if (= selval "select") (reset-o4-fields data-set)
         (http-get (str serverhost "o4registers/"selval"/mutations")
@@ -2345,7 +2396,7 @@

 (defn o4register-update-form-onclick [data-set focus]
-
+  (reset! data-set (assoc @data-set :o4number  (.-value (.getElementById js/document "O4-select"))))
   (if (= nil (o4register-form-validator @data-set))
     (let [onres (fn[data] (secretary/dispatch! "/o4register"))]
       (http-put (str serverhost "o4registers/" (:id @data-set)) onres (.serialize (Serializer.) (clj->js @data-set))))
@@ -2380,14 +2431,14 @@
   (let [onres (fn[json](
                        (set-key-value :villages (getdata json))
                        (set-page! [o4register-add-template])))
-        ono4resp (fn [json] ((set-key-value :o4mutations
-                                           (clj->js (cons {:id 0 :o4number "select"} (js->clj (getdata json)))))))]
+        ono4resp (fn [json] (set-key-value :o4mutations
+                                          (clj->js (cons {:id 0 :o4number "select"} (js->clj (getdata json))))))]
     (http-get (str serverhost "mutations/o4numbers/search") ono4resp)
     (http-get (str serverhost "villages") onres)))

 (defroute o4register-upd-path "/o4register/update/:id" [id]
-  (let [ono4resp (fn [json] ((set-key-value :o4mutations
-                                           (clj->js (cons {:id 0 :o4number "select"} (js->clj (getdata json)))))))]
+  (let [ono4resp (fn [json] (set-key-value :o4mutations
+                                          (clj->js (cons {:id 0 :o4number "select"} (js->clj (getdata json))))))]
     (http-get (str serverhost "mutations/o4numbers/search") ono4resp)
     (set-page! [o4register-update-template id
                 (first (filter (fn[obj]
@@ -2404,7 +2455,7 @@
      [:div.col-md-12
       [:div.form-group
        [:input {:type "button" :value "Add"
-                :class "btn btn-primary" :on-click o4register-add}]
+                :class "btn btn-primary" :on-click o4register-add}]
        ;; [:input {:id "getall" :type "button" :value "Refresh"
        ;;          :class "btn btn-primary" :on-click get-all-click}]
        ]
@@ -2418,8 +2469,8 @@
           [:th "Number and Date of Order"]
           [:th "Khasra Number"]
           [:th "Area"]
-          [:th "Revenue of Share of Plots Transfered"]
-          [:th "Name and Description of the Persons Removed"]
+          [:th "Revenue of Share of Plots Transfered"]
+          [:th "Name and Description of the Persons Removed"]
           [:th " "]
           [:th " "]
           ]]
@@ -2456,7 +2507,8 @@
   (do
     (swap! data-set assoc :subdivisionname nil)
     (swap! data-set assoc :mutationid nil)
-    (swap! data-set assoc :villagename "")))
+    (swap! data-set assoc :villagename "")
+    (swap! data-set assoc :o6number nil)))

 (defn on-o6-change [data-set]
   (let [selval (.-value (.getElementById js/document "O6-select"))
@@ -2505,10 +2557,10 @@
   [:div.container
    [:div.col-md-12
     [:div.box.box-info
-     [:div.box-header.with-border
+     [:div.box-header.with-border
       [:h2.box-title doc-name]]
      [:div.form-horizontal
-      [:div.box-body
+      [:div.box-body
        [o6-select data-set]
        [o6register-input-row :subdivisionname "Sub Division Name" "text" data-set focus]
        [o6register-input-row :year "Year" "date" data-set focus]
@@ -2532,7 +2584,7 @@

 (defn o6register-update-form-onclick [data-set focus]
   (if (= nil (o6register-form-validator @data-set))
-    (do (reset! data-set (assoc @data-set :villageid (int (.-value (.getElementById js/document "o6register-districts")))))
+    (do (reset! data-set (assoc @data-set :o6number (.-value (.getElementById js/document "O6-select"))))
         (let [onres (fn[data] (secretary/dispatch! "/o6register"))]
           (http-put (str serverhost "o6registers/" (:id @data-set)) onres (.serialize (Serializer.) (clj->js @data-set)))))
     (reset! focus "on")))
@@ -2568,10 +2620,10 @@
 (defn o6register-add-template []
   (let [add-data (r/atom {:isactive true})
         focus (r/atom nil)]
-    (fn [] [o6register-template
-          "o6register Add Form"
-            add-data focus
-             #(o6register-add-form-onclick add-data focus)])))
+    (fn [] [o6register-template
+           "o6register Add Form"
+           add-data focus
+           #(o6register-add-form-onclick add-data focus)])))

 (defn o6register-update-template [id dmt]
   (let [update-data (r/atom {:id (int id)
@@ -2613,8 +2665,8 @@
   (let [onres (fn[json](
                        (set-key-value :villages (getdata json))
                        (set-page! [o6register-add-template])))
-        ono6resp (fn [json] ((set-key-value :o6mutations
-                                           (clj->js (cons {:id 0 :o6number "select"} (js->clj (getdata json)))))))]
+        ono6resp (fn [json] (set-key-value :o6mutations
+                                          (clj->js (cons {:id 0 :o6number "select"} (js->clj (getdata json))))))]
     (http-get (str serverhost "mutations/o6numbers/search") ono6resp)
     (http-get (str serverhost "villages") onres)))

@@ -2624,8 +2676,8 @@
                        (set-page! [o6register-update-template id
                                    (first (filter (fn[obj]
                                                     (=(.-id obj) (.parseInt js/window id))) (get-value! :o6registers)))])))
-        ono6resp (fn [json] ((set-key-value :o6mutations
-                                           (clj->js (cons {:id 0 :o6number "select"} (js->clj (getdata json)))))))]
+        ono6resp (fn [json] (set-key-value :o6mutations
+                                          (clj->js (cons {:id 0 :o6number "select"} (js->clj (getdata json))))))]
     (http-get (str serverhost "mutations/o6numbers/search") ono6resp)
     (http-get (str serverhost "villages") onres)))

@@ -2641,7 +2693,7 @@
      [:div.col-md-12
       [:div.form-group
        [:input {:type "button" :value "Add"
-                :class "btn btn-primary" :on-click o6register-add}]
+                :class "btn btn-primary" :on-click o6register-add}]
        ;; [:input {:id "getall" :type "button" :value "Refresh"
        ;;          :class "btn btn-primary" :on-click get-all-click}]
        ]
@@ -2691,9 +2743,12 @@
                 (let [dt (getdata json)]
                   (set-key-value :mutations (.-data dt))
                   (set-key-value :total-pages (get-total-rec-no (.-pagesCount dt)))
-                  (set-key-value :page-location  [render-mutations (get-value! :mutations)])))]
-    (set-key-value :is-searched-results false)
-    (http-get (str serverhost "mutations?pageIndex="(dec (get-value! :current-page))"&pageSize=10") onres)))
+                  (set-key-value :page-location  [render-mutations (get-value! :mutations)])))
+        dist-res (fn[json] (set-key-value :districts (getdata json)))]
+    (do
+      (set-key-value :is-searched-results false)
+      (http-get (str serverhost "mutations?pageIndex="(dec (get-value! :current-page))"&pageSize=10") onres)
+      (http-get (str serverhost "districts") dist-res))))

 (defroute "*" []
   (js/alert "<h1>Not Found Page</h1>"))


make default target a bit harder for prod


Ensure braid.core.modules/init! (for clj) is only called once

Makes the test fixture work properly now

--- src/braid/core/modules.clj
+++ src/braid/core/modules.clj
@@ -28,6 +28,10 @@
   `(let [modules# (quote ~(doall (helpers/read-all-modules)))]
     (apply-extends (build-provides modules#) modules#)))

+(defonce inited? (atom false))
+
 (defn init!
   []
-  (load-modules!))
+  (when-not @inited?
+    (reset! inited? true)
+    (load-modules!)))


Reenable the fop event listener

Reenable the fop event listener

--- src/catalog/layout/fop.clj
+++ src/catalog/layout/fop.clj
@@ -836,12 +836,12 @@
             ;; get a user agent and add a listener to it that logs events
             user-agent (.newFOUserAgent factory)
             broadcaster (.getEventBroadcaster user-agent)
-            ;; _ (.addEventListener broadcaster
-            ;;                      (reify EventListener
-            ;;                        (processEvent [this event]
-            ;;                          (let [id (.getEventID event)]
-            ;;                            (when (not= id "org.apache.fop.render.RendererEventProducer.endPage")
-            ;;                              (println (EventFormatter/format event)))))))
+            _ (.addEventListener broadcaster
+                                 (reify EventListener
+                                   (processEvent [this event]
+                                     (let [id (.getEventID event)]
+                                       (when (not= id "org.apache.fop.render.RendererEventProducer.endPage")
+                                         (println (EventFormatter/format event)))))))
             ;; Construct fop with desired output format
             fop (.newFop factory MimeConstants/MIME_PDF user-agent out)
             ;; Setup JAXP using identity transformer


remove unused fn

remove unused fn

--- src/chat/client/store.cljs
+++ src/chat/client/store.cljs
@@ -58,13 +58,6 @@

 (defn add-users! [users]
   (transact! [:users] #(merge % (key-by-id users))))
-
-(defn get-user-emails []
-  (let [me (get-in @app-state [:session :user-id])]
-    (->> (get @app-state :users)
-         vals
-         (remove #(= me (% :id)))
-         (map :email))))

 (defn update-user-nick! [user-id nick]
   (transact! [:users user-id :nickname] (constantly nick)))


fix broken symbol

fix broken symbol

--- src/client/pages/play.cljs
+++ src/client/pages/play.cljs
@@ -8,6 +8,8 @@
     [client.dom :as dom]
     [client.socket :as socket]
     [client.util :as util]))
+
+(declare cleanup!)

 (def $ js/jQuery)

@@ -153,13 +155,11 @@
   (dom/set-page-body! (countdown-html))
   (socket/on "countdown" on-countdown))

-(declare cleanup)
-
 (defn on-game-over
   "Called when game over message received from server."
   [str-data]
   (js/console.log "game over")
-  (cleanup)
+  (cleanup!)
   (let [data (read-string str-data)]
     (dom/set-page-body! (gameover-html data))
     (.click ($ "#game-over-btn") #(aset js/location "hash" "#/lobby"))))


i -> gline to make the relationship to the generated line more clear

--- src/clj/cljs/sourcemap.clj
+++ src/clj/cljs/sourcemap.clj
@@ -46,7 +46,7 @@
   ([mappings source-map]
      (let [relseg-init [0 0 0 0 0]
            lines (seq (string/split mappings #";"))]
-       (loop [i 0 lines lines relseg relseg-init result {}]
+       (loop [gline 0 lines lines relseg relseg-init result {}]
          (if lines
            (let [line (first lines)
                  [result relseg]
@@ -56,9 +56,9 @@
                        (let [seg (first segs)
                              nrelseg (seg-combine (base64-vlq/decode seg) relseg)]
                          (recur (next segs) nrelseg
-                           (update-result result (seg->map nrelseg source-map) i)))
+                           (update-result result (seg->map nrelseg source-map) gline)))
                        [result relseg])))]
-             (recur (inc i) (next lines) (assoc relseg 0 0) result))
+             (recur (inc gline) (next lines) (assoc relseg 0 0) result))
            result)))))

 (defn encode [xs]


only add from nodes that do not yet have a community assigned

--- src/clj/owl/modularity.clj
+++ src/clj/owl/modularity.clj
@@ -31,6 +31,7 @@
 (defn prepare-network
   [network]
   (let [total (network/total-connections network)
+        pared (into {} (remove #(zero? (+ (-> % last :in count) (-> % last :out count))) network))
         commune (reduce
                  (fn [network id]
                    (-> network
@@ -38,11 +39,11 @@
                        (assoc-in [id :total-weights]
                                  (+ (sum-weights (get-in network [id :in]))
                                     (sum-weights (get-in network [id :out]))))))
-                 network (keys network))]
+                 pared (keys pared))]
     {:network commune
      :total total
      :ratio (/ 1.0 total)
-     :communities (into {} (map (fn [id] [id (set [id])]) (keys network)))
+     :communities (into {} (map (fn [id] [id (set [id])]) (keys commune)))
      :impact (network/map-vals node-impact commune)}))

 (defn weights-within
@@ -135,41 +136,44 @@
 (defn community-for
   [{:keys [network communities] :as graph} id]
   (let [node (get network id)
+        current-id (:community node)
         connections (shuffle (node-connections node))]
-    (if-let [connection
-             (first
-              (drop-while
-               (fn [connection]
-                 (let [community-id (get-in network [connection :community])
-                       community (get communities community-id)
-                       modularity (modularity-difference graph id community)]
-                   (< modularity 0)))
-               connections))]
-      (get-in network [connection :community]))))
-
-(defn remove-from-community
-  [communities id current]
-  (dissoc communities current))
+    (if (= 1 (count (get communities current-id)))
+      (if-let [connection
+               (first
+                (drop-while
+                 (fn [connection]
+                   (let [community-id (get-in network [connection :community])]
+                     (if (not= community-id current-id)
+                       (let [community (get communities community-id)
+                             modularity (modularity-difference graph id community)]
+                         (< modularity 0)))))
+                 connections))]
+        (get-in network [connection :community])))))

 (defn join-community
   [graph id community]
-  (p :join-community
-     (let [current-id (get-in graph [:network id :community])
-           current-community (get-in graph [:communities current-id])]
-       (if (not= current-id community)
-         (-> graph
-             (assoc-in [:network id :community] community)
-             (update-in [:communities] #(remove-from-community % id current-id))
-             (update-in [:communities community] #(set/union % current-community)))
-         graph))))
+  (let [current-id (get-in graph [:network id :community])
+        current-community (get-in graph [:communities current-id])
+        new-community (get-in graph [:communities community])]
+    ;; (println id ":" current-id "-->" community)
+    ;; (println current-community "-->" new-community)
+    (if (= current-id community)
+      graph
+      (-> (reduce
+           (fn [graph current]
+             (assoc-in graph [:network current :community] community))
+           graph current-community)
+          (update-in [:communities] #(dissoc % current-id))
+          (update-in [:communities community] #(set/union % current-community))))))

-(defn merge-communities
-  [graph]
-  (reduce
-   (fn [graph id]
-     (let [community (find-community graph id)]
-       (join-community graph id community)))
-   graph (-> graph :network keys)))
+;; (defn merge-communities
+;;   [graph]
+;;   (reduce
+;;    (fn [graph id]
+;;      (let [community (find-community graph id)]
+;;        (join-community graph id community)))
+;;    graph (-> graph :network keys)))

 (defn merge-communities
   [graph]


Remove debug

Remove debug

--- src/clj/salava/user/db.clj
+++ src/clj/salava/user/db.clj
@@ -255,5 +255,4 @@
       (delete-user! {:id user-id} {:connection tr-cn}))
     {:status "success"}
     (catch Object _
-      (println _)
-      {:status "error"})))
+      {:status "error"})))


implied difference

implied difference

--- src/cljc/commos/delta.cljc
+++ src/cljc/commos/delta.cljc
@@ -150,6 +150,30 @@
        (map (partial prepend-ks* ks))
        pack))

+(defn diagnostic-implied-difference
+  "Returns the implied difference of delta as diagnostic deltas so
+  that no replacements or dissociations are asserted."
+  [val delta]
+  (let [[op ks v :as dd] (diagnostic-delta delta)
+        cur-v (get-in val ks)]
+    (case op
+      :is
+      (->> (diagnostic-difference cur-v (first v))
+           (map (partial prepend-ks* ks)))
+      :ex
+      (if (map? cur-v)
+        (->> (diagnostic-difference cur-v
+                                    (apply dissoc cur-v v))
+             (map (partial prepend-ks* ks)))
+        [dd])
+      [dd])))
+
+;; Don't see use for this...
+;; (defn implied-difference
+;;   [val delta]
+;;   (->> (diagnostic-implied-difference val delta)
+;;        (map summable-delta)))
+
 ;; Adding deltas
 (declare add*)


Add :buildable-at parameter for all units MobileFlak (currently unimplemented) can be built at a base or an airfield, so I'm using a set for each unit's :buildable-at.

--- src/cljs/zetawar/data.cljs
+++ src/cljs/zetawar/data.cljs
@@ -154,6 +154,7 @@
                 :capturing-armor 4
                 :repair 1
                 :state-map :move-attack
+                :buildable-at #{:base}
                 :image "tilesets/elite-command/units/infantry-COLOR.png"
                 :terrain-effects
                 {:plains    {:movement-cost 3 :armor-bonus  0 :attack-bonus  0}
@@ -183,6 +184,7 @@
                  :capturing-armor 6
                  :repair 1
                  :state-map :move-attack
+                 :buildable-at #{:base}
                  :image "tilesets/elite-command/units/grenadier-COLOR.png"
                  :terrain-effects
                  {:plains    {:movement-cost 4 :armor-bonus  0 :attack-bonus  0}
@@ -212,6 +214,7 @@
               :capturing-armor 4
               :repair 1
               :state-map :move-attack
+              :buildable-at #{:base}
               :image "tilesets/elite-command/units/mortar-COLOR.png"
               :terrain-effects
               {:plains    {:movement-cost 4 :armor-bonus  0 :attack-bonus  0}
@@ -239,6 +242,7 @@
               :capturing-armor 7
               :repair 1
               :state-map :move-attack
+              :buildable-at #{:base}
               :image "tilesets/elite-command/units/ranger-COLOR.png"
               :terrain-effects
               {:plains        {:movement-cost 3 :armor-bonus  0 :attack-bonus  0}
@@ -269,6 +273,7 @@
              :capturing-armor 4
              :repair 1
              :state-map :move-attack
+             :buildable-at #{:base}
              :image "tilesets/elite-command/units/medic-COLOR.png"
              :terrain-effects
              {:plains    {:movement-cost 3 :armor-bonus  0 :attack-bonus  0}
@@ -298,6 +303,7 @@
                :capturing-armor 4
                :repair 1
                :state-map :move-attack
+               :buildable-at #{:base}
                :image "tilesets/elite-command/units/engineer-COLOR.png"
                :terrain-effects
                {:plains        {:movement-cost 3 :armor-bonus  0 :attack-bonus  0}
@@ -328,6 +334,7 @@
               :armor 8
               :repair 1
               :state-map :free-attack-twice
+              :buildable-at #{:base}
               :image "tilesets/elite-command/units/humvee-COLOR.png"
               :terrain-effects
               {:plains  {:movement-cost 3  :armor-bonus  0 :attack-bonus  0}
@@ -355,6 +362,7 @@
             :armor 12
             :repair 1
             :state-map :move-attack
+            :buildable-at #{:base}
             :image "tilesets/elite-command/units/tank-COLOR.png"
             :terrain-effects
             {:plains  {:movement-cost 3 :armor-bonus  0 :attack-bonus 0}
@@ -383,6 +391,7 @@
                :armor 8
                :repair 1
                :state-map :free-attack-twice
+               :buildable-at #{:seaport}
                :image "tilesets/elite-command/units/frigate-COLOR.png"
                :terrain-effects
                {:sea           {:movement-cost 1 :armor-bonus 0 :attack-bonus 0}
@@ -405,6 +414,7 @@
                  :armor 12
                  :repair 1
                  :state-map :free-attack-twice
+                 :buildable-at #{:seaport}
                  :image "tilesets/elite-command/units/destroyer-COLOR.png"
                  :terrain-effects
                  {:sea     {:movement-cost 1 :armor-bonus 0 :attack-bonus 0}
@@ -425,6 +435,7 @@
                :armor 15
                :repair 1
                :state-map :move-attack
+               :buildable-at #{:seaport}
                :image "tilesets/elite-command/units/cruiser-COLOR.png"
                :terrain-effects
                {:sea     {:movement-cost 1 :armor-bonus 0 :attack-bonus 0}


Improve concurrency in module management

--- src/containium/modules.clj
+++ src/containium/modules.clj
@@ -176,9 +176,9 @@

 (defn- activate
   [{:keys [agents] :as manager} name descriptor]
-  (let [promise (promise)]
-    (if-let [agent (get @agents name)]
-      (locking agent
+  (if-let [agent (get @agents name)]
+    (locking agent
+      (let [promise (promise)]
         (case (:state @agent)
           :undeployed (do (send-off agent assoc :state :deploying)
                           (send-off agent do-deploy manager descriptor)
@@ -199,15 +199,20 @@
                           (send-off agent do-deploy manager descriptor)
                           (send-off agent update-state manager :deployed :undeployed)
                           (send-off agent report-state manager promise)))
-          :undeploying (invalid-state @agent promise "currently undeploying")))
-      (let [agent (agent (Module. name :undeployed descriptor nil nil nil)
-                         :error-handler agent-error-handler)]
-        (send-off agent assoc :state :deploying)
-        (swap! agents #(assoc % name agent))
-        (send-off agent do-deploy manager descriptor)
-        (send-off agent update-state manager :deployed :undeployed)
-        (send-off agent report-state manager promise)))
-    promise))
+          :undeploying (invalid-state @agent promise "currently undeploying"))
+        promise))
+    (locking agents
+      (if-not (get @agents name)
+        (let [agent (agent (Module. name :undeployed descriptor nil nil nil)
+                           :error-handler agent-error-handler)
+              promise (promise)]
+          (swap! agents #(assoc % name agent))
+          (send-off agent assoc :state :deploying)
+          (send-off agent do-deploy manager descriptor)
+          (send-off agent update-state manager :deployed :undeployed)
+          (send-off agent report-state manager promise)
+          promise)
+        (activate manager name descriptor)))))

 (defn- deactivate


validate type-specific res props explictly

--- src/crucible/resources.clj
+++ src/crucible/resources.clj
@@ -37,18 +37,17 @@
                                  (assoc m k v)
                                  m))

+(def invalid? (complement s/valid?))
+
 (defn resource-factory [type props-spec]
   (if-not (s/valid? ::type type)
     (throw (ex-info "Invalid resource name" (s/explain-data ::type type)))
     (fn [& [props policies]]
-      (if-not (and (s/valid? props-spec props)
-                   (s/valid? ::policies policies))
-        (throw (ex-info "Invalid resource properties" (s/explain-data ::type type)))
-        (-> {::type type
-             ::properties props}
-            (assoc-when ((complement nil?) policies) ::policies policies))))))
-
-
-
-
-
+      (cond
+        (invalid? props-spec props) (throw (ex-info "Invalid resource properties"
+                                                    (s/explain-data ::t)))
+        (invalid? ::policies policies) (throw (ex-info "Invalid resource policies"
+                                                       (s/explain-data ::t)))
+        :else (-> {::type type
+                   ::properties props}
+                  (assoc-when ((complement nil?) policies) ::policies policies))))))


Separate flare report by a newline for clojure.test

--- src/flare/clojure_test.clj
+++ src/flare/clojure_test.clj
@@ -5,7 +5,7 @@

 (defn report
   [diff]
-  (println (clojure.string/join "\n" (report/report diff))))
+  (println "\n" (clojure.string/join "\n" (report/report diff))))

 (defn diff
   [args opts]


Edit form click handler.

Edit form click handler.

--- src/lab_notebook/core.cljs
+++ src/lab_notebook/core.cljs
@@ -32,7 +32,15 @@
                             :placeholder "Time"})
             (dom/textarea #js {:className "form-control":placeholder "Notes"
                                :rows "5"})
-            (dom/button #js {:className "btn btn-primary"}
+            (dom/button #js {:className "btn btn-primary"
+                             :onClick (fn [e]
+                                        (.preventDefault e)
+                                        (om/transact! cursor :entries
+                                          (fn [entries]
+                                            ((fnil conj []) entries
+                                             {:summary "summary"
+                                              :date-time "date-time"
+                                              :notes "notes"}))))}
               "Save")))))))

 (defn app-container [cursor component]


Sort environment metadata

Sort environment metadata

--- src/lister/persistence.clj
+++ src/lister/persistence.clj
@@ -135,7 +135,7 @@
   [environment-name]
   (when-let [environment (far/get-item (create-creds) environments-table {:name environment-name})]
     (if-let [metadata (cheshire/parse-string (:metadata environment) true)]
-      (assoc environment :metadata metadata)
+      (assoc environment :metadata (into (sorted-map) metadata))
       environment)))

 (defn delete-environment


verify that eval in a specific ns works

verify that eval in a specific ns works

--- src/main/cljs/cljs/js.cljs
+++ src/main/cljs/cljs/js.cljs
@@ -779,12 +779,12 @@

   (cljs/analyze st "(+ 1 1)" nil
     {:passes [ana/infer-type elide-env]
-     :eval cljs/js-eval}
+     :eval node-eval}
     (fn [{:keys [value]}]
       (println value)))

   (cljs/eval st '(defn foo [a b] (+ a b))
-    {:eval cljs/js-eval}
+    {:eval node-eval}
     (fn [res]
       (println res)))

@@ -797,27 +797,35 @@
     "(defn foo [a b] (+ a b))
      (defn bar [c d] (+ c d))"
     nil
-    {:eval cljs/js-eval}
+    {:eval node-eval}
     (fn [res]
       (println res)))

   (cljs/eval-str st "1"
     nil
-    {:eval cljs/js-eval
+    {:eval node-eval
      :context :expr}
     (fn [res]
       (println res)))

   (cljs/eval-str st "(def x 1)"
     nil
-    {:eval cljs/js-eval
+    {:eval node-eval
      :context :expr
      :def-emits-var true}
     (fn [res]
       (println res)))

   (cljs/eval st '(ns foo.bar)
-    {:eval cljs/js-eval}
+    {:eval node-eval}
+    (fn [res]
+      (println res)))
+
+  (cljs/eval st '(def x 1)
+    {:eval node-eval
+     :context :expr
+     :def-emits-var true
+     :ns 'foo.bar}
     (fn [res]
       (println res)))


add tests for nil and str

add tests for nil and str

--- test/metabox/core_test.clj
+++ test/metabox/core_test.clj
@@ -4,17 +4,26 @@
             [metabox.core :refer (box val)]))

 (deftest metabox-test
+  (testing "(box)"
+    (let [mb (box)]
+      (is (= nil (.val mb)))
+      (is (= nil (val mb)))
+      (is (= nil (.meta mb)))
+      (is (= nil (meta mb)))
+      (is (= {:band false} (meta (with-meta mb {:band false}))))))
   (testing "(box 20)"
     (let [mb (box 20)]
       (is (= 20 (.val mb)))
       (is (= 20 (val mb)))
       (is (= nil (.meta mb)))
       (is (= nil (meta mb)))
-      (is (= {:band false} (meta (with-meta mb {:band false}))))))
+      (is (= {:band false} (meta (with-meta mb {:band false}))))
+      (is (= "20" (str mb)))))
   (testing "(box 20 {:band false})"
     (let [mb (box 20 {:band false})]
       (is (= 20 (.val mb)))
       (is (= 20 (val mb)))
       (is (= {:band false} (.meta mb)))
       (is (= {:band false} (meta mb)))
-      (is (= {} (meta (with-meta mb {})))))))
+      (is (= {} (meta (with-meta mb {}))))
+      (is (= "20" (str mb))))))


Add dataset support, much better flow of all check actions

--- src/aerobio/validate/all.clj
+++ src/aerobio/validate/all.clj
@@ -16,7 +16,9 @@
              set-exp-sheet-data validate-msg make-validator]]
     [sampsheet :refer [validate-sample-sheet]]
     [expsheet :refer [validate-exp-sample-sheet]]
-    [compsheet :refer [validate-comparison-sheet]]]
+    [compsheet :refer [validate-comparison-sheet]]
+    [datasets :refer [validate-expexists
+                      validate-phase-0 validate-phase-1 validate-phase-2]]]

    [aerobio.htseq.common :as ac]))

@@ -68,29 +70,43 @@

+(defn norm-action [action]
+  (if (not (string? action))
+    action
+    (if-let [x (re-find #"phase-[0-9]" action)]
+      x
+      action)))
+
 (defn validate-exp [EID action]
-  (set-exp-sheet-data EID)
-  (let [vse (validate-sheets-exist EID)]
+  (let [action (norm-action action)
+        vse (validate-expexists EID)
+        vse (if (empty? vse) (validate-sheets-exist EID) vse)]
     (with-out-str
       (if (not (empty? vse))
         (print vse)
-        (print (cljstr/join
-                "\n\n"
-                (case action
-                  "phase-0"
-                  (filter #(not (empty? %))
-                          [(validate-sample-sheet EID)
-                           (validate-exp-sample-sheet EID)])
-                  "phase-1"
-                  (filter #(not (empty? %))
-                          [(validate-sample-sheet EID)
-                           (validate-exp-sample-sheet EID)
-                           #_(validate-data-sets-phase-1 EID)])
-                  ("all" "phase-2" "compare" "xcompare")
-                  (filter #(not (empty? %))
-                          [(validate-sample-sheet EID)
-                           (validate-exp-sample-sheet EID)
-                           (validate-comparison-sheet EID)]) )))))))
+        (do
+          (set-exp-sheet-data EID)
+          (print (cljstr/join
+                  "\n\n"
+                  (case action
+                    "phase-0"
+                    (filter #(not (empty? %))
+                            [(validate-phase-0 EID)
+                             (validate-sample-sheet EID)
+                             (validate-exp-sample-sheet EID)])
+                    "phase-1"
+                    (filter #(not (empty? %))
+                            [(validate-sample-sheet EID)
+                             (validate-exp-sample-sheet EID)
+                             (validate-phase-1 EID)])
+                    ("all" "phase-2"
+                     :compare "compare"
+                     :xcompare "xcompare")
+                    (filter #(not (empty? %))
+                            [(validate-sample-sheet EID)
+                             (validate-exp-sample-sheet EID)
+                             (validate-comparison-sheet EID)
+                             #_(validate-phase-2 EID)]) ))))))))

 (comment


Removes About from navbar.

Removes About from navbar.

--- src/cadence/views/common.clj
+++ src/cadence/views/common.clj
@@ -72,7 +72,6 @@
            (html
              [:li [:a {:href "/user/training"} "Training"]]
              [:li [:a {:href "/user/auth"} "Auth"]]))
-         [:li [:a {:href "/about"} "About"]]
          [:li [:a {:href "/docs/index.html"} "Documentation"]]
          [:li [:a {:href "https://github.com/RyanMcG/Cadence"} "Source"]]
          [:li.dropdown


pre merge.

pre merge.

--- src/clj/minijava/compile.clj
+++ src/clj/minijava/compile.clj
@@ -41,7 +41,10 @@
   (let [treemap   (apply-tree (parse program))
         canonmap  (map-method canon treemap)
         blocksmap (map-method basic-blocks canonmap)
-				tracemap (map-method trace canonmap)
-        munchmap  (map-method (fn [blocks] (map select blocks))
-                              blocksmap)]
-    munchmap))
+				tracemap (map-method #(trace % []) blocksmap)
+     ;;   munchmap  (map-method (fn [blocks] (map select blocks))
+    ;;                          tracemap)
+			]
+    tracemap))
+
+


Make Functions Private

Make Functions Private

--- src/cljs/lens/workbooks.cljs
+++ src/cljs/lens/workbooks.cljs
@@ -62,10 +62,10 @@
                              :auth true
                              :loaded-topic key}))

-(defn on-signed-in [owner]
+(defn- on-signed-in [owner]
   (load-workbooks! owner :private-workbooks))

-(defn on-sign-out [wbs]
+(defn- on-sign-out [wbs]
   (om/transact! wbs #(dissoc % :private-workbooks)))

 (defcomponent workbooks [wbs owner]


ideas

ideas

--- src/cljs/triboard/ai/ai.cljs
+++ src/cljs/triboard/ai/ai.cljs
@@ -54,9 +54,13 @@

 ;; TODO - How to add the custom scoring? How to keep the game? (use keys)
 ;; TODO - Use mapmin from http://worrydream.com/refs/Hughes-WhyFunctionalProgrammingMatters.pdf
+;; TODO - Sort by scores as well
 (defn leaf-score
   [ai game]
   (:scores (game/current-turn game)))
+
+#_(defn map-min
+  [scoring])

 (defn tree-score
   [ai game depth]


Handle chaincodeDeploymentSpec arg

Handle chaincodeDeploymentSpec arg

--- src/clojure_fabric/proto.clj
+++ src/clojure_fabric/proto.clj
@@ -76,9 +76,9 @@
     ;; Iterable - repeated
     ;; map has putAll* method
     (-> (Chaincode$ChaincodeInput/newBuilder)
-        (.addAllArgs (mapv #(if (utils/bytes? %)
-                              (ByteString/copyFrom #^bytes %)
-                              (ByteString/copyFromUtf8 (str %)))
+        (.addAllArgs (mapv #(cond (utils/bytes? %) (ByteString/copyFrom #^bytes %)
+                                  (instance? ChaincodeDeploymentSpec %) (.toByteString ^Chaincode$ChaincodeDeploymentSpec (clj->proto %))
+                                  :else (ByteString/copyFromUtf8 (str %)))
                            args))
         (.putAllDecorations decorations)
         (.build))))


snapshot

snapshot

--- build.boot
+++ build.boot
@@ -1,5 +1,5 @@
 (def project 'cljs-exe)
-(def version "0.1.0")
+(def version "0.1.0-SNAPSHOT")

 (set-env! :resource-paths #{"resources" "src"}
           ;; uncomment this if you write tests for your template:


Set v0.2.0 as new functions / API change

--- build.boot
+++ build.boot
@@ -1,6 +1,6 @@
 (set-env!
   :project 'irresponsible/unscrew
-  :version "0.1.2"
+  :version "0.2.0"
   :resource-paths #{"src" "resources"}
   :source-paths #{"src"}
   :description "A toolkit for processing jar files"