partial rewrite deep-trace2

partial rewrite deep-trace2

--- src/com/billpiel/sayid/deep_trace2.clj
+++ src/com/billpiel/sayid/deep_trace2.clj
@@ -218,7 +218,7 @@
      :xpanded-parent (:xp sub-src-map)
      :xpanded-frm (:x sub-src-map)}))

-(defn get-temp-root-parent
+(defn get-temp-root-tree
   []
   (-> trace/*trace-log-parent*
       (select-keys [:depth :path])
@@ -229,58 +229,62 @@
 (declare produce-recent-parent-tree-atom!)

 (defn get-recent-tree-at-inner-path
-  [path recent-trees]
+  [path recent-trees & {:keys [skip-closed-check]}]
   (let [entry (@recent-trees path)]
-    (if (not (some->> entry
-                      deref
-                      keys
-                      (some #{:return :throw})))
+    (if (or skip-closed-check
+            (not (some->> entry
+                          deref
+                          keys
+                          (some #{:return :throw}))))
       entry
       nil)))

-(defn assoc-to-recent-trees!
-  [tree-atom parent-tree-atom recent-trees]
+(defn update-tree!
+  [tree recent-trees]
+  #spy/d @recent-trees
+  (reset! #spy/d (-> tree
+                     :inner-path
+                     (@recent-trees))
+          tree))
+
+(defn conj-to-parent!
+  [tree-atom parent-atom]
+  (swap! (:children @parent-atom)
+         conj
+         tree-atom))
+
+(defn push-to-recent-trees!
+  [tree-atom recent-trees]
   (swap! recent-trees
          assoc
          (:inner-path @tree-atom)
          tree-atom)
-  (when parent-tree-atom
-    (println "vvvvv")
-    #spy/d tree-atom
-    #spy/d parent-tree-atom
-    (println "^^^^^")
-    (clojure.stacktrace/print-stack-trace (Exception. "assoc-to-recent-trees!"))
-    (swap! (-> @parent-tree-atom
-               :inner-path
-               (@recent-trees)
-               deref
-               :children)
-           conj
-           tree-atom)))
+  #spy/d @recent-trees)

 (defn mk-recent-tree-at-inner-path
   [inner-path recent-trees]
   (if (nil? inner-path)
-    (let [new-parent (get-temp-root-parent)]
-      (assoc-to-recent-trees! new-parent
-                              nil
+    (let [new-tree (get-temp-root-tree)]
+      (push-to-recent-trees!  new-tree
                               recent-trees)
-      new-parent)
-    (let [new-grandparent (produce-recent-parent-tree-atom! inner-path
-                                                            recent-trees)
-          new-parent (-> (trace/mk-tree :parent new-grandparent)
-                         (assoc :inner-path inner-path
-                                :parent-path (:path new-grandparent))
-                         atom)]
-      (assoc-to-recent-trees! new-parent
-                              new-grandparent
-                              recent-trees)
-      new-parent)))
+      new-tree)
+    (let [parent (produce-recent-parent-tree-atom! inner-path
+                                                   recent-trees)
+          new-tree (-> (trace/mk-tree :parent @parent)
+                       (assoc :inner-path inner-path
+                              :parent-path (:path @parent))
+                       atom)]
+      (push-to-recent-trees! new-tree
+                             recent-trees)
+      (conj-to-parent! new-tree
+                       parent)
+      new-tree)))

 (defn produce-recent-tree-atom!
-  [inner-path recent-trees]
+  [inner-path recent-trees & {:keys [skip-closed-check]}]
   (if-let [tree-atom (get-recent-tree-at-inner-path inner-path
-                                                    recent-trees)]
+                                                         recent-trees
+                                                         :skip-closed-check skip-closed-check)]
     tree-atom
     (mk-recent-tree-at-inner-path inner-path
                                   recent-trees)))
@@ -299,14 +303,14 @@
 (defn tr-fn
   [inner-path [recent-trees src-map] template f]
   (fn [& args]
-    (let [parent (produce-recent-parent-tree-atom! inner-path
-                                                   recent-trees)
-          this (-> (trace/mk-tree :parent @parent)
-                   (merge template)
+    (let [this (-> @(produce-recent-tree-atom! #spy/d inner-path
+                                               recent-trees)
+                   (merge #spy/d template)
                    (assoc :args (vec args)
                           :arg-map (delay (zipmap (:arg-forms template)
                                                   args))
                           :started-at (trace/now)))
+          _ (update-tree! this recent-trees)
           [value throw] (binding [trace/*trace-log-parent* this]
                           (try
                             [(apply f args) nil]
@@ -317,43 +321,51 @@
                        :return value
                        :throw throw ;;TODO not right
                        :ended-at (trace/now))]
-      (assoc-to-recent-trees! #spy/d (atom this')
-                              parent
-                              recent-trees)
+      (update-tree! this'
+                    recent-trees)
       value)))

 (defn tr-macro
   [path [recent-trees] template mcro v]
   (def rt' @recent-trees)

-  (let [tree-atom (produce-recent-tree-atom! path
-                                             recent-trees)]
-
-    (swap! (@recent-trees path)
-           assoc
-           :return v
-           :inner-tags [:macro mcro])
-
-
+  (let [tree @(produce-recent-tree-atom! path
+                                         recent-trees
+                                         :skip-closed-check true)]
+    (-> tree
+        (assoc :return v
+               :inner-tags [:macro mcro])
+        (merge template)
+        (update-tree! recent-trees))
     v))

 (defn tr-if-ret
+  [path [recent-trees] template v]
+  (-> path
+      (produce-recent-tree-atom! recent-trees)
+      deref
+      (merge template)
+      (assoc :return v
+             :inner-tags [:if])
+      (update-tree! recent-trees))
+  v)
+
+(defn tr-if-test
   [path [recent-trees] v]
-  (swap! (produce-recent-tree-atom! path
-                                    recent-trees)
-         assoc
-         :return v
-         :inner-tags [:if])
+  (-> path
+      (produce-recent-parent-tree-atom! recent-trees)
+      deref
+      (assoc :args [v])
+      (update-tree! recent-trees))
   v)

-(defn tr-if-clause
-  [path [log] test v]
-  (swap! log conj [path v :if test])
-  (let [test-path (-> path
-                      drop-last
-                      vec
-                      (conj 1))]
-    (swap! log conj [test-path test :if]))
+(defn tr-if-branch
+  [path [recent-trees] test v]
+  (-> path
+      (produce-recent-parent-tree-atom! recent-trees)
+      deref
+      (assoc-in [:args 1] v)
+      (update-tree! recent-trees))
   v)

 (declare xpand-form)
@@ -389,26 +401,23 @@

 (defn xpand-if-form
   [[_ test then else] path template]
-  (list `tr-if-ret
-        path
-        '$$
-        `'~template
-        (concat ['if test
-                 (list `tr-if-clause
-                       (conj path 2)
-                       '$$
-                       `'~template
-                       true
-                       then)]
-                (if-not (nil? else)
-                  [(list `tr-if-clause
-                         (conj path 3)
-                         '$$
-                         `'~template
-                         false
-                         else)]
-                  []))))
-
+  (let [template' (assoc template
+                         :test-form `'~test)]
+    `(tr-if-ret ~path
+                ~'$$
+                '~template'
+                (if (tr-if-test ~(conj path 1)
+                                ~'$$
+                                ~test)
+                  (tr-if-branch ~(conj path 2)
+                                ~'$$
+                                true
+                                ~then)
+                  ~(when-not (nil? else)
+                     `(tr-if-branch ~(conj path 3)
+                                ~'$$
+                                false
+                                ~else))))))

 (defn xpand-fn
   [head form src-map fn-meta path parent-path]
@@ -487,11 +496,20 @@

    (-/p (xpand form1 {:name "name1" :ns "ns1"} ))

+   (-/p (eval (xpand form1 {:name "name1" :ns "ns1"} )))
+
    (def form2 '(str (inc 1) 3))

    (-/p (xpand form2 {:name "name1" :ns "ns1"} ))

-   (-/p (eval (xpand form1 {:name "name1" :ns "ns1"} )))
+   (-/p (eval (xpand form2 {:name "name1" :ns "ns1"} )))
+
+   (def form3 '(if 1 2 3))
+
+   (-/p (xpand form3 {:name "name1" :ns "ns1"} ))
+
+   (-/p (eval (xpand form3 {:name "name1" :ns "ns1"} )))
+

    (comment))

@@ -572,7 +590,7 @@

 (defn record-trace-tree
   [[log src-map]]
-  (-/p (@log nil))
+  #spy/d (@log nil)
   (def log' @log)
 #_  (loop [[head & body] log
          tree-map {}


Moves the character sheet above the minion list

--- src/hphelper/live/view.clj
+++ src/hphelper/live/view.clj
@@ -93,13 +93,13 @@
                (map (fn [n] [:div n])
                     (:news g))
                ]
-              [:hr] ;; Minions
-              (map print-service-group (:serviceGroups (lapi/get-minions guid uuid)))
               [:hr] ;; Player Sheet
               (if u
                 [:div (cprint/html-print-sheet u)]
                 nil
                 )
+              [:hr] ;; Minions
+              (map print-service-group (:serviceGroups (lapi/get-minions guid uuid)))
               ]
              ]
             )


tidy up guard against infinite loop

tidy up guard against infinite loop

--- src/paredit_cm/core.cljs
+++ src/paredit_cm/core.cljs
@@ -306,6 +306,8 @@
        (token-end cm)
        (index cm)))

+(defn guard [] (println "past"))
+
 (defn skip-trampoline-helper
   "returns the cursor that satsifies skipping predicate 'sp' or nil if eof
   reached. does this by making sp something we can trampoline. sp takes these
@@ -325,7 +327,7 @@
         (let [next-cur (token-end cm cur 1)]
           (fn [] ;; for trampoline
             (skip-trampoline-helper cm next-cur sp result (dec n))))))
-    (println "infinite loop")))
+    (guard)))

 (defn skip-trampoline-helper-left
   "like skip-trampoline-helper but in the opposite direction."
@@ -345,7 +347,7 @@
                          (cursor cm (- i (- ch start))))]
           (fn [] ;; for trampoline
             (skip-trampoline-helper-left cm next-cur sp result (dec n))))))
-    (println "infinite loop")))
+    (guard)))

 (defn skip
   "returns the cursor that satisfies sp or nil if either eof reached
@@ -1366,7 +1368,7 @@
 (defn idx-of-next [cm i chars member max]
   (let [{:keys [right-char]} (get-info cm (cursor cm i))]
     (cond
-      (= i max), (println "infinite loop")
+      (= i max), (guard)
       (= member (contains? chars right-char)), i
       :default, (fn [] (idx-of-next cm (inc i) chars member max)))))

@@ -1420,7 +1422,7 @@
   (let [m (dec n), j (inc i), cur (cursor cm i), right-cur (cursor cm j)]
     (cond
       (neg? n)
-      (println "infinite loop")
+      (guard)

       (eof? cm right-cur)
       :do-nothing
@@ -1504,7 +1506,7 @@
   (let [h (dec i), m (dec n), cur (cursor cm i)]
     (cond
       (neg? n)
-      (println "infinite loop")
+      (guard)

       (bof? cm cur)
       :do-nothing
@@ -1555,7 +1557,7 @@
   (let [j (inc i), m (dec n), cur (cursor cm i), right-cur (cursor cm j)]
     (cond
       (neg? n)
-      (println "infinite loop")
+      (guard)

       (nil? right-cur)
       :do-nothing
@@ -1602,7 +1604,7 @@
   (let [h (dec i), m (dec n), cur (cursor cm i)]
     (cond
       (neg? n)
-      (println "infinite loop")
+      (guard)

       (nil? cur)
       :do-nothing
@@ -1846,9 +1848,9 @@
   [cm cur n]
   (let [{:keys [left-cur i start ch bof]} (get-info cm cur)]
     (cond
-      (<= n 0), (do (println "infinite loop") nil)
+      (<= n 0), (guard)
       (closing-delim? cm cur), left-cur
-      bof, nil;
+      bof, nil
       (zero? ch), (fn [] (bkwd-down cm (cursor cm (dec i)) (dec n)))
       :default, (fn [] (bkwd-down cm (cursor cm (- i (- ch start))) (dec n))))))


punting of p112

punting of p112

--- src/rwn4clojure/core.clj
+++ src/rwn4clojure/core.clj
@@ -1494,6 +1494,44 @@
                  (iterate pron)
                  rest))]
     (is (all? (p110 f)))))
+
+;; Create a function which takes an integer and a nested collection
+;; of integers as arguments. Analyze the elements of the input collection
+;; and return a sequence which maintains the nested structure, and
+;; which includes all elements starting from the head whose sum is
+;; less than or equal to the input integer.
+#_(defn p112 [__]
+  [(=  (__ 10 [1 2 [3 [4 5] 6] 7])
+       '(1 2 (3 (4))))
+   (=  (__ 30 [1 2 [3 [4 [5 [6 [7 8]] 9]] 10] 11])
+       '(1 2 (3 (4 (5 (6 (7)))))))
+   (=  (__ 9 (range))
+       '(0 1 2 3))
+   (=  (__ 1 [[[[[1]]]]])
+       '(((((1))))))
+   (=  (__ 0 [1 2 [3 [4 5] 6] 7])
+       '())
+   (=  (__ 0 [0 0 [0 [0]]])
+       '(0 0 (0 (0))))
+   (=  (__ 1 [-10 [1 [2 3 [4 5 [6 7 [8]]]]]])
+       '(-10 (1 (2 3 (4)))))])
+#_(deftest t112
+  (let [clone* (fn clone*
+                 ([node] (clone* node 0))
+                 ([node sum]
+                  (if-not (sequential? node)
+                    (let [v (if (map? node) (:node node) node)]
+                      (prn [:v v, :sum sum, :node node])
+                      {:node v, :sum (+' sum v)})
+                    (if-not (seq node)
+                      ()
+                      (map (fn [n] (clone* n sum)) node)))))
+        f (fn [m tree]
+            (loop [n m, acc ()]
+              (if (neg? n)
+                acc
+                )))]
+    (is (all? (p112 f)))))

 ;; take-while is great for filtering sequences, but it limited: you
 ;; can only examine a single item of the sequence at a time. What if


Pushing storage

Pushing storage

--- src/posthere/storage.clj
+++ src/posthere/storage.clj
@@ -51,6 +51,8 @@
   [url-uuid request]
   (def clean_request (dissoc request :async-channel))

+  (println clean_request)
+
   (let [url-key (url-key-for url-uuid)
         request-uuid (uuid) ;; new UUID for this request
         request-entry (request-entry-for request-uuid)


Stuff working and pulling genres locked

Stuff working and pulling genres locked

--- src/sciencefair/core.clj
+++ src/sciencefair/core.clj
@@ -29,7 +29,7 @@
              doall))
 (defn pull-down-tracks-genres [genres pagesize offset]
   (print "__" pagesize offset "___\n")
-  (pmapcat #(tracks settings {"genres" %, "order" "created_at", "limit" pagesize, "offset" offset "created_at[to]" "2015-01-19 09:40:00"}) genres))
+  (pmapcat #(tracks settings {"genres" %, "order" "created_at", "limit" pagesize, "offset" offset "created_at[to]" "2014-05-01 09:40:00"}) genres))

 (defn useful-format-tracks [tracks kees]
   (map #(assoc (select-keys % kees) :comments (get-comments (% :id))) tracks))
@@ -48,6 +48,6 @@
 (defn -main
   [& args]
   (let [howmany 800 pagesize 10 start 0]
-    (harvestTracks howmany pagesize start '("Electronic" "House" )  [:id :genre :bpm :description :user_id :download_count ] ))
+    (harvestTracks howmany pagesize start '("Hiphop" "hiphop" "jazz" "Electronic" "dubstep" "country" "rock" "rockandroll" "blues" "theblues")  [:id :genre :bpm :description :user_id :download_count ] ))
 )


gzip later

gzip later

--- src/seathree/handler.clj
+++ src/seathree/handler.clj
@@ -50,11 +50,11 @@
     (success (:body request))
     (fail)))

+; TODO wrap-gzip
 (def app
   (-> handler
       (wrap-json-response)
-      (wrap-json-body handler {:keywords? true})
-      (wrap-gzip)))
+      (wrap-json-body handler {:keywords? true})))

 (defn -main
   "Serve app. Poll Twitter."


fix tests due to data change

fix tests due to data change

--- test/wb_es/core_test.clj
+++ test/wb_es/core_test.clj
@@ -308,7 +308,8 @@
           (index-datomic-entity (d/entity db [:gene/id "WBGene00015146"]))
           (let [hit (has-hit (search "C. elegans" {:size 100}) "WBGene00015146")
                 ortholog-hit (has-hit (search "C. elegans" {:size 100}) "PRJNA248911_FL82_04596")]
-            (is (> (:_score hit) (:_score ortholog-hit)))))))))
+            (is (or (not ortholog-hit)
+                    (> (:_score hit) (:_score ortholog-hit))))))))))

 (deftest go-term-type-test
   (testing "go-term with creatine biosynthetic process as example"


Added a new behavior-group function that added another level of hierarchy.

--- src/smooth_spec/core.clj
+++ src/smooth_spec/core.clj
@@ -25,11 +25,16 @@
    but must occur inside a test function (deftest)."
   [string & body]
   `(~'testing ~string
-            (~'do-report {:type :begin-behavior :string ~string})
-            ~@body
-            (~'do-report {:type :end-behavior :string ~string})
-            )
+     (~'do-report {:type :begin-behavior :string ~string})
+     ~@body
+     (~'do-report {:type :end-behavior :string ~string})
+     )
   )
+
+(defmacro behavior-group
+  "An alias for the bahavior function."
+  [string & body]
+  `(behavior ~string ~@body))

 (defmacro with-timeline
   "Adds the infrastructure required for doing timeline testing"
@@ -69,5 +74,5 @@
     `(do
        ~@asserts
        )
-       )
+    )
   )


Added Component wrapper

Added Component wrapper

--- src/smooth_spec/core.clj
+++ src/smooth_spec/core.clj
@@ -31,8 +31,9 @@
      )
   )

-(defmacro behavior-group
-  "An alias for the bahavior function."
+(defmacro component
+  "A wrapper for behaviors.
+  Specifications have named Components, and Components have Behaviors."
   [string & body]
   `(behavior ~string ~@body))


remove gross, horrible extra spaces

remove gross, horrible extra spaces

--- src/subrosa/commands.clj
+++ src/subrosa/commands.clj
@@ -85,7 +85,7 @@
          (maybe-update-authentication! channel))
         (throw+ {:type :client-error
                  :code 461
-                 :msg  "USER :Not enough parameters"})))
+                 :msg "USER :Not enough parameters"})))
     (throw+ {:type :client-error
              :code 462
              :msg ":Unauthorized command (already registered)"})))
@@ -104,7 +104,7 @@
       (throw+ {:type :client-error
                :code 461
                :disconnect true
-               :msg  "PASS :Not enough parameters"}))
+               :msg "PASS :Not enough parameters"}))
     (throw+ {:type :client-error
              :code 462
              :disconnect true
@@ -390,7 +390,7 @@
                                                  (interpose " " on-nicks)))))
     (throw+ {:type :client-error
              :code 461
-             :msg  "ISON :Not enough parameters"})))
+             :msg "ISON :Not enough parameters"})))

 (defcommand invite [channel args]
   (let [sender-nick (nick-for-channel channel)
@@ -426,7 +426,7 @@
                  :msg (format "%s :No such nick/channel" target-nick)}))
       (throw+ {:type :client-error
                :code 461
-               :msg  "INVITE :Not enough parameters"}))))
+               :msg "INVITE :Not enough parameters"}))))

 (defcommand kick [channel args]
   (let [[rooms nicks comment] (.split args " " 3)]
@@ -473,10 +473,10 @@

          :else (throw+ {:type :client-error
                         :code 461
-                        :msg  "KICK :Not enough parameters"})))
+                        :msg "KICK :Not enough parameters"})))
       (throw+ {:type :client-error
                :code 461
-               :msg  "KICK :Not enough parameters"}))))
+               :msg "KICK :Not enough parameters"}))))

 (defcommand mode [channel args]
   (let [[room-name modes params] (.split args " ")


Add `redis-call` fn for raw Redis requests (suggestion by 'ToBeReplaced')

--- src/taoensso/carmine.clj
+++ src/taoensso/carmine.clj
@@ -124,6 +124,20 @@
 (commands/defcommands) ; This kicks ass - big thanks to Andreas Bielk!

 ;;;; Helper commands
+
+(defn redis-call
+  "Sends low-level requests to Redis. Useful for DSLs, certain kinds of command
+  composition, and for executing commands that haven't yet been added to the
+  official `commands.json` spec.
+
+  (redis-call [:set \"foo\" \"bar\"] [:get \"foo\"])"
+  [& requests]
+  (doseq [[cmd & args] requests]
+    (let [cmd-parts (-> cmd name str/upper-case (str/split #"-"))]
+      (apply protocol/send-request! (into (vec cmd-parts) args)))))
+
+(comment (wcar {} (redis-call [:set "foo" "bar"] [:get "foo"]
+                              [:config-get "*max-*-entries*"])))

 (def hash-script
   (memoize


Housekeeping

Housekeeping

--- src/taoensso/carmine.clj
+++ src/taoensso/carmine.clj
@@ -13,7 +13,7 @@
 ;;;; Connections

 (defn make-conn-pool
-  "For option documentation see http://commons.apache.org/pool/apidocs/org/apache/commons/pool/impl/GenericKeyedObjectPool.html"
+  "For option documentation see http://goo.gl/EiTbn"
   [& options]
   (let [;; Defaults adapted from Jedis
         default {:test-while-idle?              true


Write more tests for react-keys; split into smaller tests

--- src/devcards/discuss/devcards/lib.cljs
+++ src/devcards/discuss/devcards/lib.cljs
@@ -5,7 +5,7 @@

 (def test-state (atom {:val {:discussion {:add_premise_text "There are many parks in neighbouring towns holds, because...", :bubbles [{:votecounts 29, :votecounts_message "29 more participants with this opinion.", :data_argument_uid "None", :omit_url false, :data_is_supportive "True", :is_status false, :id "1464001655.6145825", :data_statement_uid "51", :is_user true, :is_info false, :data_type "statement", :url "http://localhost:4284/discuss/town-has-to-cut-spending", :is_system false, :message "There are many parks in neighbouring towns."} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url true, :data_is_supportive "None", :is_status true, :id "now", :data_statement_uid "None", :is_user false, :is_info false, :data_type "None", :url "None", :is_system false, :message "Now"} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url true, :data_is_supportive "None", :is_status false, :id "1464001655.6119502", :data_statement_uid "None", :is_user false, :is_info false, :data_type "None", :url "None", :is_system true, :message "What is your most important reason why  there are many parks in neighbouring towns holds?
Because..."} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url false, :data_is_supportive "None", :is_status false, :id "end", :data_statement_uid "None", :is_user false, :is_info true, :data_type "None", :url "None", :is_system false, :message "You are the first one, who said that There are many parks in neighbouring towns.
Please enter your reason for your statement."}], :mode "justify", :is_supportive true, :save_statement_url "ajax_set_new_start_statement", :search {:issue "1", :distance_name "Levensthein", :values [{:distance "00038", :url "api/town-has-to-cut-spending/justify/53/t", :statement_uid 53, :index 0, :text "Parks are very important for our climate."} {:distance "00040", :url "api/town-has-to-cut-spending/justify/51/t", :statement_uid 51, :index 1, :text "There are many parks in neighbouring towns."} {:distance "00067", :url "api/town-has-to-cut-spending/justify/44/t", :statement_uid 44, :index 2, :text "Spending of the city for these festivals are higher than the earnings."} {:distance "00081", :url "api/town-has-to-cut-spending/justify/54/t", :statement_uid 54, :index 3, :text "Our swimming pools are very old and it would take a major investment to repair them."}]}}, :issues {:date "3 hours ago", :slug "town-has-to-cut-spending", :uid 1, :all [{:uid "1", :url "", :arg_count 18, :title "Town has to cut spending ", :date "3 hours ago", :slug "town-has-to-cut-spending", :enabled "disabled", :info "Our town needs to cut spending. Please discuss ideas how this should be done."} {:uid "2", :url "api/cat-or-dog", :arg_count 30, :title "Cat or Dog", :date "3 hours ago", :slug "cat-or-dog", :enabled "enabled", :info "Your familiy argues about whether to buy a cat or dog as pet. Now your opinion matters!"} {:uid "3", :url "api/elektroautos", :arg_count 9, :title "Elektroautos", :date "3 hours ago", :slug "elektroautos", :enabled "enabled", :info "Elektroautos - Die Autos der Zukunft? Bitte diskutieren Sie dazu."} {:uid "4", :url "api/unterstuumltzung-der-sekretariate", :arg_count 0, :title "Unterstützung der Sekretariate", :date "3 hours ago", :slug "unterstuumltzung-der-sekretariate", :enabled "enabled", :info "Unsere Sekretariate in der Informatik sind arbeitsmäßig stark überlastet. Bitte diskutieren Sie Ma&szlignahmen zur Unterstützung der Sekretariate."}], :title "Town has to cut spending ", :info "Our town needs to cut spending. Please discuss ideas how this should be done.", :intro "Current discussion is about", :tooltip "The discussion was started 3 hours ago and already has 18 argument.", :arg_count 18}, :items [{:url "add", :already_used_text "", :id "item_start_premise", :already_used false, :premises [{:id 0, :title "None of the above! Let me state my own reason!"}], :attitude "justify"}], :layout {:loading? false, :add? false, :add-type :add-justify-premise, :template :discussion, :add-text "Let me enter my reason!", :title "discuss", :error-msg nil, :reference "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt", :intro "The current discussion is about:", :error? false}, :debug {:last-api "api/get/statements/1/3/are", :response {:issues {:date "3 hours ago", :slug "town-has-to-cut-spending", :uid 1, :all [{:uid "1", :url "", :arg_count 18, :title "Town has to cut spending ", :date "3 hours ago", :slug "town-has-to-cut-spending", :enabled "disabled", :info "Our town needs to cut spending. Please discuss ideas how this should be done."} {:uid "2", :url "api/cat-or-dog", :arg_count 30, :title "Cat or Dog", :date "3 hours ago", :slug "cat-or-dog", :enabled "enabled", :info "Your familiy argues about whether to buy a cat or dog as pet. Now your opinion matters!"} {:uid "3", :url "api/elektroautos", :arg_count 9, :title "Elektroautos", :date "3 hours ago", :slug "elektroautos", :enabled "enabled", :info "Elektroautos - Die Autos der Zukunft? Bitte diskutieren Sie dazu."} {:uid "4", :url "api/unterstuumltzung-der-sekretariate", :arg_count 0, :title "Unterstützung der Sekretariate", :date "3 hours ago", :slug "unterstuumltzung-der-sekretariate", :enabled "enabled", :info "Unsere Sekretariate in der Informatik sind arbeitsmäßig stark überlastet. Bitte diskutieren Sie Ma&szlignahmen zur Unterstützung der Sekretariate."}], :title "Town has to cut spending ", :info "Our town needs to cut spending. Please discuss ideas how this should be done.", :intro "Current discussion is about", :tooltip "The discussion was started 3 hours ago and already has 18 argument.", :arg_count 18}, :items [{:url "add", :already_used_text "", :id "item_start_premise", :already_used false, :premises [{:id 0, :title "None of the above! Let me state my own reason!"}], :attitude "justify"}], :extras {:is_reportable false, :lang_is_de false, :link_en_class "active", :lang_is_en true, :nickname "Christian", :is_user_neutral false, :close_premise_container false, :is_user_female false, :logged_in true, :users_avatar "https://secure.gravatar.com/avatar/5fb6235d584543384ee61ac6814195bb?s=80&d=wavatar", :link_de_class "", :users_name "Christian", :show_bar_icon false, :is_user_male true, :restart_url "api/town-has-to-cut-spending", :add_premise_container_style "", :add_statement_container_style "display: none", :is_editable false, :show_display_style false}, :discussion {:add_premise_text "There are many parks in neighbouring towns holds, because...", :bubbles [{:votecounts 29, :votecounts_message "29 more participants with this opinion.", :data_argument_uid "None", :omit_url false, :data_is_supportive "True", :is_status false, :id "1464001655.6145825", :data_statement_uid "51", :is_user true, :is_info false, :data_type "statement", :url "http://localhost:4284/discuss/town-has-to-cut-spending", :is_system false, :message "There are many parks in neighbouring towns."} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url true, :data_is_supportive "None", :is_status true, :id "now", :data_statement_uid "None", :is_user false, :is_info false, :data_type "None", :url "None", :is_system false, :message "Now"} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url true, :data_is_supportive "None", :is_status false, :id "1464001655.6119502", :data_statement_uid "None", :is_user false, :is_info false, :data_type "None", :url "None", :is_system true, :message "What is your most important reason why  there are many parks in neighbouring towns holds?
Because..."} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url false, :data_is_supportive "None", :is_status false, :id "end", :data_statement_uid "None", :is_user false, :is_info true, :data_type "None", :url "None", :is_system false, :message "You are the first one, who said that There are many parks in neighbouring towns.
Please enter your reason for your statement."}], :mode "justify", :is_supportive true, :save_statement_url "ajax_set_new_start_statement"}}}, :user {:nickname "Christian", :token "Christian-f96bad3afea854b9e2781a235f39d90ce32ed80e80732cf08defa279b202cbb0f3a811bc4d8150b2ad1463c21f45a36f1f5a444c52f19c09359e3bc8f9cc9dd5", :logged-in? true, :mouse-x 445, :mouse-y 783}, :clipboard {:selections nil, :current nil}, :sidebar {:show? true}}}))

-(deftest lib-test
+(deftest conversions
          (testing "Convert strings to integer."
            (is (= 4
                   (lib/str->int "4")))
@@ -18,13 +18,17 @@
            (let [json "{\"distance_name\": \"Levensthein\", \"values\": {\"00020_020\": \"Foobaraaaaaaaaaaaaaa.\", \"00033_013\": \"This is the only park in our city.\"}}"]
              (is (= {:distance_name "Levensthein", :values {:00020_020 "Foobaraaaaaaaaaaaaaa.", :00033_013 "This is the only park in our city."}} (lib/json->clj json)))))

+         test-state)
+
+(deftest issue-handling
          (testing "Get issue for uid."
            (is (= "Elektroautos"
                   (:title (lib/get-issue 3))))
            (is (= "3"
                   (:uid (lib/get-issue "Elektroautos"))))
-           (is (nil? (lib/get-issue "This should not be an issue in our app-state"))))
+           (is (nil? (lib/get-issue "This should not be an issue in our app-state")))))

+(deftest reference-handling
          (testing "Get reference by id."
            (let [refs [{:url "api/town-has-to-cut-spending/justify/70/t", :uid 1, :text "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt"} {:url "api/elektroautos/justify/72/t", :uid 3, :text "Es sei "ein gutes Gefühl", sagt Vater Richard Dolphin\n"} {:url "api/town-has-to-cut-spending/justify/73/t", :uid 4, :text "meisten Nachbarkommunen"} {:url "api/town-has-to-cut-spending/justify/74/t", :uid 5, :text "deutschen Kommunen"} {:url "api/town-has-to-cut-spending/justify/75/t", :uid 6, :text "Es sei "ein gutes Gefühl", sagt Vater Richard Dolphin "} {:url "api/town-has-to-cut-spending/justify/76/t", :uid 7, :text "Tatsächlich ist Düsseldorf ein außergewöhnlicher Fall unter den deutschen Kommunen . Knapp 300 Millionen Euro plant die Stadt in diesem Jahr für Kinderfeste, Jugendbücher und Betreuungseinrichtungen ein, selten hat sie so viel für Familien ausgegeben. Vor ein paar Monaten wurden gar die Kindergartengebühren für Drei- bis Sechsjährige abgeschafft. Sparen muss Düsseldorf nicht, der Haushalt für das Jahr 2010 ist ausgeglichen, ein Kunststück, das der Stadt bereits zum elften Mal in Folge gelingt. Ja, mehr noch: Seit 2007 ist die Stadt schuldenfrei, inzwischen hat sie sich sogar ein ansehnliches Polster angespart.\n\nEinige Städte haben im vergangenen Aufschwung immerhin jedes Jahr mehr Geld eingenommen als ausgegeben. Doch die meisten Nachbarkommunen  von Düsseldorf stehen kurz vor dem Zusammenbruch, wie sich auch aus einer gerade erschienenen Studie der Bertelsmann-Stiftung ersehen lässt. "Die Schere zwischen armen und reichen Kommunen geht weiter auseinander", schreiben die Autoren. Es stelle sich die Frage, wie den rund 60 besonders armen Städten in Nordrhein-Westfalen der Haushaltsausgleich gelingen solle, wenn "sie nicht einmal während einer beispiellosen Wachstumsphase" der vergangenen Jahre dazu in der Lage waren. Die Hälfte der Städte im Bundesland hat"}]]
              (is (= {:url "api/town-has-to-cut-spending/justify/70/t", :uid 1, :text "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt"}
@@ -32,9 +36,11 @@
              (is (= {:url "api/town-has-to-cut-spending/justify/70/t", :uid 1, :text "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt"}
                     (lib/get-reference "1" refs)))
              (is (nil? (lib/get-reference "foo" refs)))
-             (is (nil? (lib/get-reference -1 refs)))))
+             (is (nil? (lib/get-reference -1 refs))))))

+(deftest react-key
          (testing "Generate unique react-key"
            (is (not= (lib/get-unique-key) (lib/get-unique-key))))

-         test-state)+         (testing "Add :react-key to given dictionary with a unique key."
+           (is (not (nil? (:react-key (lib/merge-react-key {:foo "bar"})))))))


Clean up after dirty merge

Clean up after dirty merge

--- src/word_keeper/core.clj
+++ src/word_keeper/core.clj
@@ -7,12 +7,9 @@
             [word-keeper.backend  :refer :all]
             [word-keeper.frontend :refer :all]))

-<<<<<<< HEAD
 (def consumer-key "5KvZggyamEy8yHD0oACgAkLxH")
 (def consumer-secret "3DeEHXQ6LVh7LxSdApivzAOiwBAcGdvRorheKzheCchbPPQF6h")

-=======
->>>>>>> FETCH_HEAD
 (defroutes routes
   (GET "/" [] action-index)
   (files "/public/")


added ability to specify :libs, :externs and :foreign-libs in the config.clj

--- src/lib/clj/one/config.clj
+++ src/lib/clj/one/config.clj
@@ -5,7 +5,10 @@
   "Given a configuration map, return output directory options."
   [config]
   {:output-to (str (:js config) "/" (:dev-js-file-name config))
-   :output-dir (str (:js config) "/out")})
+   :output-dir (str (:js config) "/out")
+   :libs (:libs config)
+   :externs (:externs config)
+   :foreign-libs (:foreign-libs config)})

 (defn production-js
   "Given a configuration map, return the path to the production


fixed function declarations preventing compilation

--- src/main/clojure/naojure/motion_calc.clj
+++ src/main/clojure/naojure/motion_calc.clj
@@ -271,7 +271,7 @@
 (defn legs-right-stiff  [& ignored]
   {:stiffness {"RLeg" 1.0}})

-(defn legs-stiff
+(defn legs-stiff [& ignored]
   (combine-stiffness-fns legs-left-stiff legs-right-stiff))

 (defn legs-left-relax  [& ignored]
@@ -280,7 +280,7 @@
 (defn legs-right-relax  [& ignored]
   {:stiffness {"RLeg" 0.0}})

-(defn legs-relax
+(defn legs-relax [& ignored]
   (combine-stiffness-fns legs-left-stiff legs-right-stiff))

 ;; knees


remove old util functions from generic sql

--- src/metabase/driver/generic_sql/util.clj
+++ src/metabase/driver/generic_sql/util.clj
@@ -84,44 +84,3 @@
    :post [(map? %)]}
   (korma-entity (or (sel :one Table :id table-id)
                     (throw (Exception. (format "Table with ID %d doesn't exist!" table-id))))))
-
-(defn castify-field
-  "Wrap Field in a SQL `CAST` statement if needed (i.e., it's a `:DateTimeField`).
-
-    (castify :name :TextField nil)     -> :name
-    (castify :date :DateTimeField nil) -> (raw \"CAST(\"date\" AS DATE)
-    (castify :timestamp :IntegerField :timestamp_seconds) -> (raw \"CAST(TO_TIMESTAMP(\"timestamp\") AS DATE))"
-  [field-name base-type special-type]
-  {:pre [(string? field-name)
-         (keyword? base-type)]}
-  (cond
-    (contains? #{:DateField :DateTimeField} base-type) `(korma/raw ~(format "CAST(\"%s\" AS DATE)" field-name))
-    (= special-type :timestamp_seconds)                `(korma/raw ~((:cast-timestamp-seconds-field-to-date-fn qp/*driver*) field-name))
-    (= special-type :timestamp_milliseconds)           `(korma/raw ~((:cast-timestamp-milliseconds-field-to-date-fn qp/*driver*) field-name))
-    :else                                              (keyword field-name)))
-
-(defn field-name+base-type->castified-key
-  "Like `castify-field`, but returns a keyword that should match the one returned in results."
-  [field-name field-base-type special-type]
-  {:pre [(string? field-name)
-         (keyword? field-base-type)]
-   :post [(keyword? %)]}
-  (keyword
-   (cond
-     (contains? #{:DateField :DateTimeField} field-base-type) (format "CAST(%s AS DATE)" field-name)
-     :else                                                    field-name)))
-
-(defn field-id->kw
-  "Given a metabase `Field` ID, return a keyword for use in the Korma form (or a casted raw string for date fields)."
-  [field-id]
-  {:pre [(integer? field-id)]}
-  (if-let [{field-name :name, field-type :base_type, special-type :special_type} (sel :one [Field :name :base_type :special_type] :id field-id)]
-    (castify-field field-name field-type special-type)
-    (throw (Exception. (format "Field with ID %d doesn't exist!" field-id)))))
-
-(def date-field-id?
-  "Does FIELD-ID correspond to a field that is a Date?"
-  (memoize        ; memoize since the base_type of a Field isn't going to change
-   (fn [field-id]
-     (contains? #{:DateField :DateTimeField}
-                (sel :one :field [Field :base_type] :id field-id)))))


#5 change metadata map structure

#5 change metadata map structure

--- src/kalar_plugins/templates/hiccup.clj
+++ src/kalar_plugins/templates/hiccup.clj
@@ -42,15 +42,15 @@
         output   (new StringWriter)
         metadata (md/md-to-html input output :parse-meta? true :heading-anchors true)
         html     (.toString output)]
-    {:header metadata :body html}))
+    (merge metadata {:body html})))

-(defn load-md-abst [^String md]
+(defn load-md-excerpt [^String md]
   (let [compiled (load-markdown md)
-        top  (-> (ehtml/select (ehtml/html-resource (StringReader. (:body compiled))) [:p]) first ehtml/text)]
-    {:header (:header compiled) :abstract top}))
+        excerpt  (-> (ehtml/select (ehtml/html-resource (StringReader. (:body compiled))) [:p]) first ehtml/text)]
+    (dissoc (merge compiled {:excerpt excerpt}) :body)))

-
+; id -> num
 (defmacro def-templates [url-pattern dir body]
   `(def hiccup#
      (reify HiccupPlugin
@@ -75,15 +75,14 @@
                rest-absts# (rest index-abst-map#)]
            (let [~'page_
                  (merge
-                   {:posts (map #(load-md-abst (.getAbsolutePath %)) (val first-abst#))}
+                   {:posts (map #(load-md-excerpt (.getAbsolutePath %)) (val first-abst#))}
                    {:index (key first-abst#)})
                  output# (io/file (kfile/find-dest) ~head-url)]
-             (println ~'page_)
              (kfile/touch output#)
              (spit output# ~body))
            (dorun
              (for [posts-per-page# rest-absts#]
-               (let [~'page_ (merge {:posts (map #(load-md-abst (.getAbsolutePath %)) (val posts-per-page#))}
+               (let [~'page_ (merge {:posts (map #(load-md-excerpt (.getAbsolutePath %)) (val posts-per-page#))}
                                  {:index (key first-abst#)})
                      output# (io/file (kfile/find-dest)
                                       (string/replace ~tail-url-ptn #":id" (str (key posts-per-page#))))]
@@ -100,10 +99,7 @@
            (dorun
              (for [md# mds#]
                (let [compiled# (load-markdown (.getAbsolutePath  md#))
-                     metadata# (:header compiled#)
-                     body# (:body compiled#)
-                     output# (io/file (kfile/find-dest) (-> metadata# :url first))
-                     ~'mp metadata#]
+                     output# (io/file (kfile/find-dest) (-> compiled# :url first))
+                     ~'page_ compiled#]
                  (kfile/touch output#)
-                 (spit output# ~body)
-                 ))))))))
+                 (spit output# ~body)))))))))


CLJS-1301: local :foreign-libs are not picked up the first time browser REPL is started

The 2-arity version of cljs.closure/build simply adopts cljs.env/*compiler* if
there is a root binding. The browser REPL was invoking this arity of build to
generate the REPL iframe JS and thus clobbering it.

Create a fresh ambient compiler environment instead in
cljs.repl.browser/compile-client-js and invoke the 3-arity version of
cljs.closure/build

--- src/main/clojure/cljs/repl/browser.clj
+++ src/main/clojure/cljs/repl/browser.clj
@@ -485,17 +485,21 @@
 ;; BrowserEnv

 (defn compile-client-js [opts]
-  (cljsc/build
-    '[(ns clojure.browser.repl.client
-        (:require [goog.events :as event]
-                  [clojure.browser.repl :as repl]))
-      (defn start [url]
-        (event/listen js/window
-          "load"
-          (fn []
-            (repl/start-evaluator url))))]
-    {:optimizations (:optimizations opts)
-     :output-dir (:working-dir opts)}))
+  (let [copts {:optimizations (:optimizations opts)
+               :output-dir (:working-dir opts)}]
+    ;; we're inside the REPL process where cljs.env/*compiler* is already
+    ;; established, need to construct a new one to avoid mutating the one
+    ;; the REPL uses
+    (cljsc/build
+      '[(ns clojure.browser.repl.client
+          (:require [goog.events :as event]
+                    [clojure.browser.repl :as repl]))
+        (defn start [url]
+          (event/listen js/window
+            "load"
+            (fn []
+              (repl/start-evaluator url))))]
+      copts (env/default-compiler-env copts))))

 (defn create-client-js-file [opts file-path]
   (let [file (io/file file-path)]


Teach scopes to only work with internal server.

--- src/overtone/viz/scope.clj
+++ src/overtone/viz/scope.clj
@@ -30,6 +30,17 @@
 (on-deps :studio-setup-completed ::create-scope-group #(dosync
                                                         (ref-set scope-group* (group :tail ROOT-GROUP))
                                                         (satisfy-deps :scope-group-created)))
+
+
+(defn- ensure-internal-server!
+  "Throws an exception if the server isn't internal - scope relies on fast
+  access to shared buffers with the server which is currently only available
+  with the internal server. Also ensures server is connected."
+  []
+  (when (disconnected?)
+    (throw (Exception. "Cannot use scopes until a server has been booted or connected")))
+  (when (external-server?)
+    (throw (Exception. (str "Sorry, it's  only possible to use scopes with an internal server. Your server info is as follows: " (server-info))))))

 (defn- update-scope-data
   "Updates the scope by reading the current status of the buffer and repainting.
@@ -80,7 +91,7 @@
         (.scale 1 (* -1 y-zoom))
         (.drawPolyline ^ints x-array ^ints y-a width)))))

-(defn scope-panel [id width height]
+(defn- scope-panel [id width height]
   (let [panel (proxy [JPanel] [true]
                 (paint [g] (paint-scope g id)))
         _ (.setPreferredSize panel (Dimension. width height))]
@@ -106,6 +117,7 @@
   "Schedule the scope to be updated every (/ 1000 FPS) ms (unless the scopes are
   already running in which case it does nothing."
   []
+  (ensure-internal-server!)
   (dosync
    (when-not @scopes-running?*
      (at-at/every (/ 1000 FPS) update-scopes scope-pool)
@@ -130,7 +142,9 @@
   (doall (map reset-data-arrays (vals @scopes*))))

 (defn scopes-stop
-  []
+  "Stop all scopes from running."
+  []
+  (ensure-internal-server!)
   (at-at/stop-and-reset-pool! scope-pool)
   (empty-scope-data)
   (dosync (ref-set scopes-running?* false)))
@@ -161,7 +175,9 @@
   [s]
   (log/info (str "Closing scope: \n" s))
   (let [{:keys [id bus-synth buf]} s]
-    (when bus-synth (kill bus-synth))
+    (when (and bus-synth
+               (connected?))
+      (kill bus-synth))
     (dosync (alter scopes* dissoc id))))

 (defn- mk-scope
@@ -235,6 +251,7 @@
       :or {bus 0
            buf -1
            keep-on-top false}}]
+     (ensure-internal-server!)
      (let [buf (if (buffer? buf) (:id buf) buf)
            kind (if (= -1 buf) :bus :buf)
            num  (if (= -1 buf) bus buf)
@@ -245,11 +262,13 @@
 (defn pscope
   "Creates a 'perminent' scope, i.e. one where the window is always kept on top of other OS windows. See scope."
   ([& args]
+     (ensure-internal-server!)
      (apply scope (concat args [:keep-on-top true]))))

 (defn- reset-scopes
   "Restart scopes if they have already been running"
   []
+  (ensure-internal-server!)
   (dosync
    (ref-set scopes*
             (reduce (fn [new-scopes [k v]]
@@ -262,8 +281,13 @@
    (scopes-start)))

-(on-deps #{:synthdefs-loaded :scope-group-created} ::reset-scopes reset-scopes)
-(on-sync-event :shutdown scopes-stop  ::stop-scopes)
+(on-deps #{:synthdefs-loaded :scope-group-created} ::reset-scopes #(when (internal-server?)
+                                                                     (reset-scopes)))
+(on-sync-event :shutdown #(when (internal-server?)
+                            (scopes-stop)
+                            (dorun
+                             (map (fn [s] scope-close s) @scopes*)))
+               ::stop-scopes)

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Testing


thru rm_cfg_dictionaries_enterprise

thru rm_cfg_dictionaries_enterprise

--- src/pg_demo/table_defs.clj
+++ src/pg_demo/table_defs.clj
@@ -2275,6 +2275,302 @@
               PRIMARY KEY (ENTERPRISE_ID,CASE_ID,SEQ_NUM,DLP_REVISION_NUMBER)
           ); " }

+    { "rm_case_rev_master"
+          "CREATE TABLE rm_case_rev_master (
+              ENTERPRISE_ID numeric NOT NULL,
+              CASE_ID numeric NOT NULL,
+              DLP_REVISION_NUMBER numeric NOT NULL,
+              CASE_LOCKED numeric,
+              DATA_CLEANUP numeric,
+              CASE_REVISION_DATE timestamp,
+              DATE_LOCKED timestamp,
+              SITE_ID numeric,
+              STATE_ID numeric,
+              COUNTRY_ID numeric,
+              EFFECTIVE_RECEIPT_DATE timestamp,
+              EFFECTIVE_RECEIPT_DATE_J timestamp,
+              EFFECTIVE_SAFETY_DATE timestamp,
+              EFFECTIVE_TIME_STAMP timestamp,
+              DCM_XREF_NUM numeric,
+              REVISION_DELETE_FLAG numeric,
+              PRIMARY KEY (ENTERPRISE_ID,CASE_ID,DLP_REVISION_NUMBER)
+          ); " }
+
+    { "rm_case_routing"
+          "CREATE TABLE rm_case_routing (
+              ENTERPRISE_ID numeric NOT NULL,
+              CASE_ID numeric NOT NULL,
+              SEQ_NUM numeric NOT NULL,
+              ROUTE_DATE timestamp,
+              USER_ID numeric,
+              SORT_ID numeric,
+              COMMENT_TXT varchar(1000),
+              TO_STATE_ID numeric,
+              FR_STATE_ID numeric,
+              WORKFLOW_SEQ_NUM numeric,
+              DELETED timestamp,
+              JUSTIFICATION_ID numeric,
+              FOLLOWUP_NUM numeric,
+              COMMENT_TXT_J varchar(1000),
+              DLP_REVISION_NUMBER numeric NOT NULL,
+              S_FOLLOWUP_NUM numeric,
+              REPORT_SCHEDULING numeric,
+              CASE_STATUS numeric,
+              LAST_UPDATE_TIME timestamp,
+              REVISION_DELETE_FLAG numeric,
+              DELETED_FLAG numeric(1) NOT NULL,
+              EFFECTIVE_START_DATE timestamp NOT NULL,
+              EFFECTIVE_END_DATE timestamp NOT NULL,
+              PRIMARY KEY (ENTERPRISE_ID,CASE_ID,SEQ_NUM,DLP_REVISION_NUMBER)
+          ); " }
+
+    { "rm_case_study"
+          "CREATE TABLE rm_case_study (
+              ENTERPRISE_ID numeric NOT NULL,
+              CASE_ID numeric NOT NULL,
+              STUDY_KEY numeric,
+              STUDY_NUM varchar(35),
+              STUDY_TYPE numeric,
+              CENTER_ID numeric,
+              CENTER_NAME varchar(40),
+              PROTOCOL_ID numeric,
+              PROTOCOL_NUM varchar(40),
+              OTHER_ID varchar(20),
+              CODE_BROKEN numeric,
+              BROKEN_BY numeric,
+              BROKEN_DATE timestamp,
+              REASON varchar(100),
+              WEEK varchar(5),
+              VISIT varchar(5),
+              DELETED timestamp,
+              PRODUCT_COUNT numeric(2),
+              CLASSIFICATION_ID numeric,
+              BLIND_NAME varchar(70),
+              STUDY_DESC text,
+              STUDY_DESC_J text,
+              BLIND_NAME_J varchar(70),
+              CENTER_NAME_J varchar(40),
+              CLIN_COMPOUND_NUM_J varchar(70),
+              PROTOCOL_NUM_J varchar(40),
+              STUDY_NUM_J varchar(35),
+              DEV_PHASE_ID numeric,
+              DLP_REVISION_NUMBER numeric NOT NULL,
+              REVISION_DELETE_FLAG numeric,
+              DELETED_FLAG numeric(1) NOT NULL,
+              EFFECTIVE_START_DATE timestamp NOT NULL,
+              EFFECTIVE_END_DATE timestamp NOT NULL,
+              COHORT_ID numeric,
+              PRIMARY KEY (ENTERPRISE_ID,CASE_ID,DLP_REVISION_NUMBER)
+          ); " }
+
+    { "rm_case_user_defined"
+          "CREATE TABLE rm_case_user_defined (
+              ENTERPRISE_ID numeric NOT NULL,
+              TABLE_ID numeric NOT NULL,
+              CASE_ID numeric NOT NULL,
+              UD_SEQ_NUM numeric NOT NULL,
+              UD_NUMBER_1 numeric,
+              UD_NUMBER_2 numeric,
+              UD_NUMBER_3 numeric,
+              UD_NUMBER_4 numeric,
+              UD_NUMBER_5 numeric,
+              UD_NUMBER_6 numeric,
+              UD_NUMBER_7 numeric,
+              UD_NUMBER_8 numeric,
+              UD_NUMBER_9 numeric,
+              UD_NUMBER_10 numeric,
+              UD_NUMBER_11 numeric,
+              UD_NUMBER_12 numeric,
+              UD_DATE_1 timestamp,
+              UD_DATE_2 timestamp,
+              UD_DATE_3 timestamp,
+              UD_DATE_4 timestamp,
+              UD_DATE_5 timestamp,
+              UD_DATE_6 timestamp,
+              UD_DATE_7 timestamp,
+              UD_DATE_8 timestamp,
+              UD_DATE_9 timestamp,
+              UD_DATE_10 timestamp,
+              UD_DATE_11 timestamp,
+              UD_DATE_12 timestamp,
+              UD_TEXT_1 varchar(100),
+              UD_TEXT_2 varchar(100),
+              UD_TEXT_3 varchar(100),
+              UD_TEXT_4 varchar(100),
+              UD_TEXT_5 varchar(100),
+              UD_TEXT_6 varchar(100),
+              UD_TEXT_7 varchar(100),
+              UD_TEXT_8 varchar(100),
+              UD_TEXT_9 varchar(100),
+              UD_TEXT_10 varchar(100),
+              UD_TEXT_11 varchar(100),
+              UD_TEXT_12 varchar(100),
+              UD_TEXT_1_J varchar(100),
+              UD_TEXT_2_J varchar(100),
+              UD_TEXT_3_J varchar(100),
+              UD_TEXT_4_J varchar(100),
+              UD_TEXT_5_J varchar(100),
+              UD_TEXT_6_J varchar(100),
+              UD_TEXT_7_J varchar(100),
+              UD_TEXT_8_J varchar(100),
+              UD_TEXT_9_J varchar(100),
+              UD_TEXT_10_J varchar(100),
+              UD_TEXT_11_J varchar(100),
+              UD_TEXT_12_J varchar(100),
+              DELETED timestamp,
+              DLP_REVISION_NUMBER numeric NOT NULL,
+              EFFECTIVE_START_DATE timestamp NOT NULL,
+              EFFECTIVE_END_DATE timestamp NOT NULL,
+              DELETED_FLAG numeric(1) NOT NULL,
+              REVISION_DELETE_FLAG numeric,
+              PRIMARY KEY (ENTERPRISE_ID,TABLE_ID,CASE_ID,UD_SEQ_NUM,DLP_REVISION_NUMBER)
+          ); " }
+
+    { "rm_case_vacc_hist"
+          "CREATE TABLE rm_case_vacc_hist (
+              ENTERPRISE_ID numeric NOT NULL,
+              CASE_ID numeric NOT NULL,
+              SEQ_NUM numeric NOT NULL,
+              LOG_NO numeric NOT NULL,
+              LOCATION_ID numeric,
+              ADMIN_ROUTE_ID numeric,
+              VACC_DATE timestamp,
+              VACC_DATE_RES numeric,
+              VACCINE varchar(40),
+              DOSE_NO numeric,
+              DOSE numeric(22,7),
+              DOSE_UNIT_ID numeric,
+              LOT_NO varchar(20),
+              MANUFACTURER_ID numeric,
+              SORT_ID numeric,
+              PARENT_SEQ_NUM numeric,
+              VACC_DATE_PARTIAL varchar(20),
+              DELETED timestamp,
+              DLP_REVISION_NUMBER numeric NOT NULL,
+              REVISION_DELETE_FLAG numeric,
+              DELETED_FLAG numeric(1) NOT NULL,
+              EFFECTIVE_START_DATE timestamp NOT NULL,
+              EFFECTIVE_END_DATE timestamp NOT NULL,
+              VAERS_BLOCK_14 numeric,
+              PRIMARY KEY (ENTERPRISE_ID,CASE_ID,SEQ_NUM,LOG_NO,DLP_REVISION_NUMBER)
+          ); " }
+
+    { "rm_case_vacc_prior_ae"
+          "CREATE TABLE rm_case_vacc_prior_ae (
+              ENTERPRISE_ID numeric NOT NULL,
+              CASE_ID numeric NOT NULL,
+              SEQ_NUM numeric NOT NULL,
+              PATIENT numeric,
+              VACCINE varchar(40),
+              DOSE_NO numeric,
+              AGE numeric(22,7),
+              AGE_UNIT_ID numeric,
+              ADVERSE_EVENT varchar(50),
+              SORT_ID numeric,
+              ADVERSE_EVENT_J varchar(50),
+              VACCINE_J varchar(40),
+              DELETED timestamp,
+              DLP_REVISION_NUMBER numeric NOT NULL,
+              REVISION_DELETE_FLAG numeric,
+              DELETED_FLAG numeric(1) NOT NULL,
+              EFFECTIVE_START_DATE timestamp NOT NULL,
+              EFFECTIVE_END_DATE timestamp NOT NULL,
+              PRIMARY KEY (ENTERPRISE_ID,CASE_ID,SEQ_NUM,DLP_REVISION_NUMBER)
+          ); " }
+
+    { "rm_case_vacc_vaers"
+          "CREATE TABLE rm_case_vacc_vaers (
+              ENTERPRISE_ID numeric NOT NULL,
+              CASE_ID numeric NOT NULL,
+              VACC_AT_ID numeric,
+              VACC_STATE varchar(10),
+              VACC_COUNTY varchar(20),
+              PURCHASE_ID numeric,
+              VACC_ER_VISIT numeric,
+              ADMIN_BY varchar(40),
+              PHYSICIAN varchar(40),
+              FACILITY varchar(40),
+              ADDRESS varchar(120),
+              CITY varchar(30),
+              STATE varchar(10),
+              POSTAL_CODE varchar(10),
+              PHONE varchar(20),
+              RELATION_TO_PATIENT numeric,
+              REPORTED_PREVIOUSLY numeric,
+              ILLNESS varchar(50),
+              VAERS_NUMBER varchar(20),
+              PROLONGED_HOSP numeric(1),
+              ADDRESS_J varchar(120),
+              ADMIN_BY_J varchar(40),
+              CITY_J varchar(30),
+              FACILITY_J varchar(40),
+              ILLNESS_J varchar(50),
+              PHYSICIAN_J varchar(40),
+              STATE_J varchar(10),
+              VACC_COUNTY_J varchar(20),
+              VACC_STATE_J varchar(10),
+              DELETED timestamp,
+              DLP_REVISION_NUMBER numeric NOT NULL,
+              REVISION_DELETE_FLAG numeric,
+              DELETED_FLAG numeric(1) NOT NULL,
+              EFFECTIVE_START_DATE timestamp NOT NULL,
+              EFFECTIVE_END_DATE timestamp NOT NULL,
+              PRIMARY KEY (ENTERPRISE_ID,CASE_ID,DLP_REVISION_NUMBER)
+          ); " }
+
+    { "rm_cfg_auth_countries"
+          "CREATE TABLE rm_cfg_auth_countries (
+              ENTERPRISE_ID numeric NOT NULL,
+              GROUP_ID numeric NOT NULL,
+              COUNTRY_ID numeric NOT NULL,
+              TYPE numeric NOT NULL,
+              SEQ_NUM numeric NOT NULL,
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,GROUP_ID,COUNTRY_ID,TYPE,SEQ_NUM)
+          ); " }
+
+    { "rm_cfg_auth_products"
+          "CREATE TABLE rm_cfg_auth_products (
+              ENTERPRISE_ID numeric NOT NULL,
+              GROUP_ID numeric NOT NULL,
+              PRODUCT_ID numeric NOT NULL,
+              TYPE numeric NOT NULL,
+              SEQ_NUM numeric NOT NULL,
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,GROUP_ID,PRODUCT_ID,TYPE,SEQ_NUM)
+          ); " }
+
+    { "rm_cfg_auth_sites"
+          "CREATE TABLE rm_cfg_auth_sites (
+              ENTERPRISE_ID numeric NOT NULL,
+              GROUP_ID numeric NOT NULL,
+              SITE_ID numeric NOT NULL,
+              TYPE numeric NOT NULL,
+              SEQ_NUM numeric NOT NULL,
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,GROUP_ID,SITE_ID,TYPE,SEQ_NUM)
+          ); " }
+
+    { "rm_cfg_auth_studies"
+          "CREATE TABLE rm_cfg_auth_studies (
+              ENTERPRISE_ID numeric NOT NULL,
+              GROUP_ID numeric NOT NULL,
+              STUDY_KEY numeric NOT NULL,
+              TYPE numeric NOT NULL,
+              SEQ_NUM numeric NOT NULL,
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,GROUP_ID,STUDY_KEY,TYPE,SEQ_NUM)
+          ); " }
+
+    { "rm_cfg_dictionaries_enterprise"
+          "CREATE TABLE rm_cfg_dictionaries_enterprise (
+              ENTERPRISE_ID numeric NOT NULL,
+              GLOBAL_DICT_ID numeric NOT NULL,
+              DICT_ID numeric NOT NULL,
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,GLOBAL_DICT_ID,DICT_ID)
+          ); " }
+
   ] ))

 (def dummy


time schedule ui wip

time schedule ui wip

--- src/tango/cljs/main.cljs
+++ src/tango/cljs/main.cljs
@@ -35,7 +35,7 @@
 ;;   (atom {:competitions []}))

 (defonce app-state
-  (atom {:selected-page :import
+  (atom {:selected-page :events ;:classes

          ;; :competition
          ;; {:competition/date #inst "2014-11-22T00:00:00.000-00:00",
@@ -92,6 +92,17 @@
             :event/class-number 1
             :event/number 1
             :event/time "10:00"
+            :event/comment "A comment"
+            :event/adjudicator-panel 4
+            :event/heats 2
+            :event/round :normal-x
+            :event/status 1
+            :event/start-order 0}
+
+          {:event/position 2
+            :event/class-number 0
+            :event/number 1
+            :event/time "10:05"
             :event/comment "A comment"
             :event/adjudicator-panel 4
             :event/heats 2
@@ -203,7 +214,9 @@
     (log (str "Dispatch of " id " with data " data))
     (match [id data]
            [:file/import [file]]
-           (inc 1))))
+           (inc 1)
+           [:select-page [new-page]]
+           (swap! app-state merge {:selected-page new-page}))))

 (defn on-export-click [e competition]
   (log "Export clicked")
@@ -213,10 +226,6 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; UI utils
-
-(defn make-dance-type-presentation [dances]
-  ;; Dances are presented as a list of the first letters of each dance
-  (clojure.string/join (map #(first (:dance/name %)) dances)))

 (defn- to-number [s]
   {:pre [(string? s)]}
@@ -230,6 +239,20 @@
 (defn number-string? [s]
   (if s
     (re-seq #"\d+" s)))
+
+(defn make-dance-type-presentation [dances]
+  ;; Dances are presented as a list of the first letters of each dance
+  (clojure.string/join (map #(first (:dance/name %)) dances)))
+
+(defn make-event-time-presentation [time status]
+  (str time
+       (when (= status 1)
+         "*")))
+
+(defn make-event-round-presentation [event-round]
+  (condp = event-round
+    :unknown-round-value "Okänd Runda"
+    :normal-x "Normal"))

 (defn make-round-presentation [round-status round-count]
   (str
@@ -249,43 +272,45 @@
 ;; Components

 (defn dp-classes-component []
-  [:table.table
-   [:thead
-    [:tr
-     [:th {:with "20"} "#"]
-     [:th {:with "200"} "Dansdisciplin"]
-     [:th {:with "20"} "Panel"]
-     [:th {:with "20"} "Typ"]
-     [:th {:with "20"} "Startande"]
-     [:th {:with "20"} "Status"]]]
-   [:tbody
-    (for [class (sort-by :class/position (:competition/classes (:competition @app-state)))]
-      ^{:key class}
-      [:tr
-       [:td (inc (:class/position class))]
-       [:td (:class/name class)]
-       [:td (:class/adjudicator-panel class)]
-       [:td (make-dance-type-presentation (:class/dances class))]
-
-       [:td
-        (let [results (:result/results (last (:class/results class)))
-              started (count (:class/competitors class))
-              recalled-count
-              (if (empty? results)
-                started
-                (reduce
-                 (fn [x y]
-                   (if (contains?
-                        #{:r :x}
-                        (:competitor/recalled y))
-                     (inc x)
-                     x))
-                 0
-                 results))]
-          (str recalled-count "/" started))]
-
-       [:td (make-round-presentation (:result/round (last (:class/results class)))
-                                     (count (:class/results class)))]])]])
+  [:div
+   [:h3 "Klasser"]
+   [:table.table
+    [:thead
+     [:tr
+      [:th {:with "20"} "#"]
+      [:th {:with "200"} "Dansdisciplin"]
+      [:th {:with "20"} "Panel"]
+      [:th {:with "20"} "Typ"]
+      [:th {:with "20"} "Startande"]
+      [:th {:with "20"} "Status"]]]
+    [:tbody
+     (for [class (sort-by :class/position (:competition/classes (:competition @app-state)))]
+       ^{:key class}
+       [:tr
+        [:td (inc (:class/position class))]
+        [:td (:class/name class)]
+        [:td (:class/adjudicator-panel class)]
+        [:td (make-dance-type-presentation (:class/dances class))]
+
+        [:td
+         (let [results (:result/results (last (:class/results class)))
+               started (count (:class/competitors class))
+               recalled-count
+               (if (empty? results)
+                 started
+                 (reduce
+                  (fn [x y]
+                    (if (contains?
+                         #{:r :x}
+                         (:competitor/recalled y))
+                      (inc x)
+                      x))
+                  0
+                  results))]
+           (str recalled-count "/" started))]
+
+        [:td (make-round-presentation (:result/round (last (:class/results class)))
+                                      (count (:class/results class)))]])]]])

 ;; TODO - make the on-click event run thoughe dispatch
 (defn import-component []
@@ -294,14 +319,65 @@
    [:input.btn.btn-primary.btn-lg {:type "file" :value "Import file"
                                    :onChange #(on-click-import-file %)}]])

+(defn navigation-component []
+  [:div
+   [:input.btn.btn-default {:type "button" :value "Classes"
+                            :on-click #(dispatch [:select-page :classes])}]
+   [:input.btn.btn-default {:type "button" :value "Time Schedule"
+                            :on-click #(dispatch [:select-page :events])}]])
+
+(defn events-component []
+  [:div
+   [:h3 "Time Schedule"]
+   [:table.table
+    [:thead
+     [:tr
+      [:th {:with "20"} "Time"]
+      [:th {:with "20"} "#"]
+      [:th {:with "200"} "Dansdisciplin"]
+      [:th {:with "20"} "Startande"]
+      [:th {:with "20"} "Rond"]
+      [:th {:with "20"} "Heats"]
+      [:th {:with "20"} "Recall"]
+      [:th {:with "20"} "Panel"]
+      [:th {:with "20"} "Type"]]]
+    [:tbody
+     (doall
+      (for [event (sort-by :event/position (:competition/events (:competition @app-state)))]
+        ^{:key event}
+        [:tr
+         [:td (make-event-time-presentation (:event/time event) (:event/status event))]
+         [:td (:event/position event)]
+         ;; use comment if class number is zero
+         [:td
+          (let [t (into [] (:competition/classes (:competition @app-state)))]
+            (if (= (:event/class-number event) 0)
+              (:event/comment event)
+              (:class/name
+               (first (filter #(= (:class/position %) (:event/class-number event)) t)))
+              ;(log (:class/name (first t)))
+              ))]
+
+         ;[:td (:competition/classes @app-state)]
+
+         [:td "-"]
+         [:td (make-event-round-presentation (:event/round event))]
+         [:td (:event/heats event)]
+         [:td "-"]
+         [:td (:event/adjudicator-panel event)]
+         [:td "-"]
+         ]))]]])
+
+; :selected-page :import
 (defn menu-component []
-;  [:div]
-  ;; (fn []
-  ;;   (if (= (:selected-page @app-state) :import)))
-  [:div
-   [import-component]
-   [:h3 "Klasser"]
-   [dp-classes-component]])
+ ;[:div]
+  (fn []
+    [:div
+     [import-component]
+     [navigation-component]
+     (condp = (:selected-page @app-state)
+       :classes [dp-classes-component]
+       :events [events-component])]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Application


Use courtesy form of german language

Use courtesy form of german language

--- src/discuss/translations.cljs
+++ src/discuss/translations.cljs
@@ -24,25 +24,25 @@
                      :start-discussion "Starte die Diskussion"
                      :that             "dass"}
         :clipboard  {:heading "Clipboard"
-                     :instruction "Wähle eine Referenz aus dieser Liste aus, um beim Erzeugen eines neuen Arguments diese Referenz mit dem neuen Argument zu verknüpfen."}
-        :create/argument {:header "Erzeuge ein Argument zu einer Textstelle"
+                     :instruction "Wählen Sie eine Referenz aus dieser Liste aus, um beim Erzeugen eines neuen Arguments diese Referenz mit dem neuen Argument zu verknüpfen."}
+        :create/argument {:header "Erzeugen Sie ein Argument zu einer Textstelle"
                           :short "Neues Argument zur Referenz erstellen"
-                          :lead "Du kannst hier Position zu einer Textstelle beziehen."
-                          :logged-in "Fülle dazu die folgenden Felder aus!"
-                          :not-logged-in "Aber vorher musst du dich einlogggen."}
+                          :lead "Sie können hier Position zu einer Textstelle beziehen."
+                          :logged-in "Füllen Sie dazu die folgenden Felder aus."
+                          :not-logged-in "Aber vorher müssen Sie sich einlogggen."}
         :discussion {:add-position "Nichts von all dem. Ich habe eine andere Idee"
                      :add-position-heading "Ich denke, dass"
                      :add-position-placeholder "wir dieses oder jenes machen sollten"
                      :add-reason-placeholder "aus diesen und jenen Gründen"
-                     :bubble/congrats "Du hast das Ende der Diskussion erreicht. Suche dir einen anderen Einstiegspunkt in dem Artikel, um weiter zu diskutieren."
+                     :bubble/congrats "Sie haben das Ende der Diskussion erreicht. Suchen Sie sich einen anderen Einstiegspunkt in dem Artikel, um weiter zu diskutieren."
                      :current      "Aktuelle Diskussion"
-                     :reference/missing "Du musst dich auf eine Textstelle beziehen"
+                     :reference/missing "Sie müssen sich auf eine Textstelle beziehen"
                      :restart      "Neustarten"
                      :submit       "Abschicken"}
         :eden       {:overview "Meine Argumente"
-                     :overview/lead "Finde hier deine Argumente, welche du in verschiedenen Diskussionen eingeführt hast und springe direkt in die Diskussionen hinein."
+                     :overview/lead "Finden Sie hier Ihre Argumente, welche Sie in verschiedenen Diskussionen eingeführt haben und springen Sie direkt in die Diskussionen hinein."
                      :arguments/construct "Neues Argument erstellen"
-                     :arguments/not-found "Es konnten noch keine Argumente von dir gefunden werden. Ein guter Zeitpunkt eine Diskussion zu wählen und mit anderen Benutzern zu diskutieren!"
+                     :arguments/not-found "Es konnten noch keine Argumente von Ihnen gefunden werden. Ein guter Zeitpunkt eine Diskussion zu wählen und mit anderen Benutzern zu diskutieren!"
                      :arguments/show "Meine Argumente anzeigen"}
         :errors     {:login "Login fehlgeschlagen. Vermutlich sind die Zugangsdaten nicht korrekt."}
         :find       {:statement "Finde Aussage in Diskussion"
@@ -50,7 +50,7 @@
         :login      {:nickname "Benutzername"
                      :password "Passwort"
                      :hhu-ldap "Wir benutzen das Personenverzeichnug der Heinrich-Heine-Universität Düsseldorf. Alle Daten und Informationen werden natürlich SSL-verschlüsselt gesendet und nach Erhalt unter keinen Umständen an Dritte weitergegeben."
-                     :item "Klicke hier, damit du dich einloggen und eine neue Aussage hinzufügen kannst"}
+                     :item "Hier klicken, damit Sie sich einloggen und eine neue Aussage hinzufügen können"}
         :nav        {:home "Start"
                      :find "Suchen"
                      :eden "Meine Argumente"}
@@ -64,16 +64,16 @@
                      :save "Speichere"}
         :references {:jump "Springe in die Diskussion"
                      :usages/view-heading "Interaktionen mit dem Artikel"
-                     :usages/lead "Beziehe dich hier auf die ausgewählte Referenz oder schau dir an, wo diese Referenz bereits in der Diskussion verwendet wurde."
+                     :usages/lead "Beziehen Sie sich hier auf die ausgewählte Referenz oder schauen Sie sich an, wo diese Referenz bereits in der Diskussion verwendet wurde."
                      :usages/not-found-lead "Argument konnte nicht gefunden werden"
                      :usages/not-found-body "Vielleicht wurden die mit dieser Referenz verknüpften Argumente entfernt"
                      :usages/list "Hier ist eine Liste der bisherigen Verwendungen dieser Textstelle in anderen Argumenten"
                      :where-used "Wo wird diese Referenz verwendet?"
                      :find-statement "Finde Aussage in der Diskussion"
-                     :clipboard  "Ziehe diese Referenzen in das Textfeld beim Erzeugen eines neuen Arguments, um die Referenz zu nutzen."
+                     :clipboard  "Ziehen Sie diese Referenzen in das Textfeld beim Erzeugen eines neuen Arguments hinein, um die Referenz zu nutzen."
                      :ask-to-add "Möchten Sie Ihre Aussage durch eine Referenz von dieser Seite stützen? Dann markieren Sie einfach einen Teil des Textes mit der Maus."
-                     :has-to-add "Um dich auf eine Stelle im Artikel zu beziehen, musst du ihn mit der Maus markieren. Dann erscheint der Text in diesem Textfeld."
-                     :disabled/tooltip "Du kannst dieses Feld nicht direkt modifizieren. Bitte markiere die gewünschte Stelle direkt auf der Webseite. Dieses Feld füllt sich dann automatisch."}
+                     :has-to-add "Um sich auf eine Stelle im Artikel zu beziehen, müssen Sie die Stelle mit der Maus markieren. Dann erscheint der Text in diesem Textfeld."
+                     :disabled/tooltip "Dieses Feld kann nicht direkt modifiziert werden. Bitte markieren Sie die gewünschte Stelle direkt auf der Webseite. Dieses Feld füllt sich dann automatisch."}
         :search      {:reuse "Statement auswählen"
                       :origin "Herkunft"
                       :author "Autor"}


improved data formatting (suppressed unnecessary komma)

--- src/distillery/view/cloud.clj
+++ src/distillery/view/cloud.clj
@@ -1,4 +1,5 @@
 (ns distillery.view.cloud
+  (:require [clojure.string :as string])
   (:require [distillery.config :as cfg])
   (:require [distillery.view.html :refer :all]))

@@ -27,7 +28,7 @@
             (sort-by :v1)
             (map (fn
                    [{:keys [id rect]}]
-                   (str "{id:'" id "',r:{x:"(.x rect)",y:"(.y rect)",w:"(.width rect)",h:"(.height rect)"}},")))
-            (apply str))
+                   (str "{id:'" id "',r:{x:"(.x rect)",y:"(.y rect)",w:"(.width rect)",h:"(.height rect)"}}")))
+            (string/join ","))
        "]"))


Fix compile error

Fix compile error

--- src/yetibot/core/webapp/route_loader.clj
+++ src/yetibot/core/webapp/route_loader.clj
@@ -6,6 +6,6 @@
 (def plugin-route-namespaces
   [#"^.*plugins\.routes.*"])

-(defn load-plugin-routesx []
+(defn load-plugin-routes []
   (map #(ns-resolve % 'routes)
        (loader/find-and-load-namespaces plugin-route-namespaces)))


add :infl2lex index to italian grammar

add :infl2lex index to italian grammar

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -788,14 +788,13 @@

      ;; indices from paths to subsets of the lexicon
-     :aux2lex
-     (map-subset-by-path lexicon-for-generation [:synsem :aux])
-
-     :pred2lex ;; map:<pred => subset of lexicon with that pred>
-     (map-subset-by-path lexicon-for-generation [:synsem :sem :pred])
+     :aux2lex (map-subset-by-path lexicon-for-generation [:synsem :aux])
+
+     :infl2lex (map-subset-by-path lexicon [:synsem :infl])
+
+     :pred2lex (map-subset-by-path lexicon-for-generation [:synsem :sem :pred])

-     :cat2lex ;; map:<cat => subset of lexicon with that cat>
-     (map-subset-by-path lexicon-for-generation [:synsem :cat])
+     :cat2lex (map-subset-by-path lexicon-for-generation [:synsem :cat])

      }))


CMR-354: Added test for browsable parameter.

--- test/cmr/system_int_test/search/granule_sorting_search_test.clj
+++ test/cmr/system_int_test/search/granule_sorting_search_test.clj
@@ -281,4 +281,6 @@
                                                           :sort-key sort-key}))

          "browse_only" [g2 g1]
-         "-browse_only" [g1 g2])))
+         "-browse_only" [g1 g2]
+         "browsable" [g2 g1]
+         "-browsable" [g1 g2])))


STORM-1664: Remove unnecessary or

STORM-1664: Remove unnecessary or

--- storm-core/src/clj/org/apache/storm/testing4j.clj
+++ storm-core/src/clj/org/apache/storm/testing4j.clj
@@ -80,7 +80,7 @@
   `(let [supervisors# (or (.getSupervisors ~mkClusterParam) 2)
          ports-per-supervisor# (or (.getPortsPerSupervisor ~mkClusterParam) 3)
          daemon-conf# (or (.getDaemonConf ~mkClusterParam) {})
-         nimbus-daemon# (or (.isNimbusDaemon ~mkClusterParam) false)]
+         nimbus-daemon# (.isNimbusDaemon ~mkClusterParam)]
      (~cluster-type [cluster# :supervisors supervisors#
                      :ports-per-supervisor ports-per-supervisor#
                      :daemon-conf daemon-conf#


whitespace

whitespace

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -942,7 +942,6 @@
                         :subcat {:1 {:infl :future
                                      :sem {:tense :future}
                                      :subcat '()}}}})
-
       "dormire"
       {:synsem {:cat :verb
                 :essere false


added uscire

added uscire

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -1983,6 +1983,15 @@
    "usare"  {:synsem {:cat :verb
                       :sem {:pred :usare}}}

+   "uscire" (let [common {:synsem {:cat :verb}
+                                   :essere true
+                                   :sem {:subj {:animate true}}
+                          :italiano {:italiano "uscire"
+                                     :present {:boot-stem1 "esc"
+                                               :boot-stem2 "usc"}}}]
+             [(merge common {:synsem {:sem {:pred :go-out}}})
+              (merge common {:synsem {:sem {:pred :exit}}})])
+
    "vedere"
    {:synsem {:cat :verb
              :sem {:pred :see}}
@@ -2047,16 +2056,15 @@

    "vivere"
    [{:synsem {:cat :verb
-              :sem {:pred :live}
-              :essere true}
-     :italiano {:passato "vissuto"
-                :future-stem "vivr"}}
-
+             :sem {:pred :live}}
+    :italiano {:passato "vissuto"
+               :future-stem "vivr"
+               :essere true}}
     {:synsem {:cat :verb
-              :sem {:pred :live}
-              :essere true}
-     :italiano {:passato "vissuto"
-                :future-stem "vivr"}}]
+             :sem {:pred :live}}
+    :italiano {:passato "vissuto"
+               :future-stem "vivr"
+               :essere false}}]

    "voi"
    [{:synsem {:cat cat-of-pronoun


Add nan? and finite? predicates to math ns.

--- src/uxbox/util/math.cljs
+++ src/uxbox/util/math.cljs
@@ -8,6 +8,14 @@
 (ns uxbox.util.math
   "A collection of math utils."
   (:require [goog.math :as math]))
+
+(defn ^boolean nan?
+  [v]
+  (js/isNaN v))
+
+(defn ^boolean finite?
+  [v]
+  (js/isFinite v))

 (defn abs
   [^number v]


Use worker channel to ack message

Use worker channel to ack message

--- src/lcmap/aardvark/worker.clj
+++ src/lcmap/aardvark/worker.clj
@@ -19,13 +19,16 @@

 ;; RabbitMQ message handlers

+(declare worker-channel)
+
 (defn handle-delivery
   [ch metadata payload]
   (let [source (event/decode-message metadata payload)]
     (log/debugf "deliver: %s" metadata)
     (log/debugf "content: %s" source)
     (tile/process source)
-    (lb/ack ch (metadata :delivery-tag))))
+    (log/debugf "ack message")
+    (lb/ack worker-channel (metadata :delivery-tag))))

 (defn handle-consume
   [consumer-tag]


align some things

align some things

--- src/leiningen/new/tenzing.clj
+++ src/leiningen/new/tenzing.clj
@@ -106,30 +106,30 @@
 (defn index-html-head-tags [opts]
   (letfn [(style-tag [href] (str "<link href=\"" href "\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\">"))]
     (cond-> []
-            (garden? opts)
-            (conj (style-tag "css/garden.css"))
-            (sass? opts)
-            (conj (style-tag "css/sass.css")))))
+            (garden? opts) (conj (style-tag "css/garden.css"))
+            (sass? opts)   (conj (style-tag "css/sass.css")))))

 (defn index-html-script-tags [opts]
   (letfn [(script-tag [src] (str "<script type=\"text/javascript\" src=\"" src "\"></script>"))]
     (cond-> []
-            false ;(or (om? opts) (reagent? opts))
-            (conj (script-tag "js/preamble.js"))
-            :finally
-            (conj (script-tag "js/app.js")))))
+            ; (or (om? opts) (reagent? opts))
+            ; the preamble can also be handled by boot-cljs'
+            ; unified-mode which will load any .inc.js files
+            ; in the shim it generates
+            false    (conj (script-tag "js/preamble.js"))
+            :finally (conj (script-tag "js/app.js")))))

 (defn template-data [name opts]
-  {:name name
-   :sanitized (name-to-path name)
-   :source-paths (source-paths opts)
-   :deps (dep-list 18 (dependencies opts))
-   :requires (indent 1 (build-requires opts))
-   :build-steps (indent 8 (build-steps name opts))
-   :production-task-opts (indent 22 (production-task-opts opts))
-   :development-task-opts (indent 22 (development-task-opts opts))
+  {:name                   name
+   :sanitized              (name-to-path name)
+   :source-paths           (source-paths opts)
+   :deps                   (dep-list 18 (dependencies opts))
+   :requires               (indent 1 (build-requires opts))
+   :build-steps            (indent 8 (build-steps name opts))
+   :production-task-opts   (indent 22 (production-task-opts opts))
+   :development-task-opts  (indent 22 (development-task-opts opts))
    :index-html-script-tags (indent 4 (index-html-script-tags opts))
-   :index-html-head-tags (indent 4 (index-html-head-tags opts))})
+   :index-html-head-tags   (indent 4 (index-html-head-tags opts))})

 (defn warn-on-exclusive-opts!
   "Some options can't be used together w/o added complexity."


Load layouts in markdown parsing spec.

Load layouts in markdown parsing spec.

Otherwise it cannot run on its own. Refactor a bit too (DRY it up).

--- spec/incise/parsers/impl/markdown_spec.clj
+++ spec/incise/parsers/impl/markdown_spec.clj
@@ -9,25 +9,20 @@
             [me.raynes.cegdown :as md])
   (:import [java.io File]))

-(defn parse-markdown []
-  (let [markdown-file (file (resource "spec/markdown-options.md"))
-        parse (comp slurp first force (html-parser markdown-to-html))]
-    (parse markdown-file)))
-
 (describe "parsing markdown"
+  (before (load-parsers-and-layouts))
+  (with markdown-file (file (resource "spec/markdown-options.md")))
+  (around-with-custom-config :in-dir "resources/spec"
+                             :out-dir "/tmp/")
+  (with parse (comp slurp first force (html-parser markdown-to-html)))
+  (with result (@parse @markdown-file))
   (context "parsing with default options"
-    (around-with-custom-config :in-dir "resources/spec"
-                               :out-dir "/tmp/")
-    (with result (parse-markdown))
     (it "parses a markdown file into html"
         (should-contain #"<html>" @result))
     (it "parses without hardwraps"
         (should-contain "First line Second line" @result)))
   (context "parsing with custom options"
-    (around-with-custom-config :in-dir "resources/spec"
-                               :out-dir "/tmp/"
-                               :parsers {:markdown {:extensions [:hardwraps]}})
-    (with result (parse-markdown))
+    (around-with-custom-config :parsers {:markdown {:extensions [:hardwraps]}})
     (it "parses with hardwraps"
       (should-contain "First line<br/>Second line" @result))))


once more

once more

--- src-cljs/offcourse/core.cljs
+++ src-cljs/offcourse/core.cljs
@@ -11,6 +11,7 @@
             [offcourse.history.service :as history]))

 (defn init! []
+  (println "initialized")
   (let [actions-appstate   (chan)
         actions-log        (chan)
         actions-out        (chan)


sort of working but not really

sort of working but not really

--- src/bracketolojy/tournament.clj
+++ src/bracketolojy/tournament.clj
@@ -2,11 +2,13 @@
   (:require [clojure.math.combinatorics :as combo]
             [bracketolojy.log5 :as log5]
             [bracketolojy.team-data :as data]
-            [clojure.walk :as walk]))
+            [clojure.walk :as walk]
+            [clojure.zip :as zip]))

-(defrecord Team [name seed pe weight avg-pts])
+(defrecord Team [name seed pe weight avg-pts future-pts])

 (defn- log2 [x]
+  "The log base 2 of x, rounded to the nearest integer."
   (Math/round
     (/ (Math/log x)
        (Math/log 2))))
@@ -33,15 +35,15 @@
                                           0))))))

 (defmulti compute-matchup
-          "Compute a matchup.  The first argument is an associative structure that gives the points per a correct pick
-          for each round.  The second argument is an associative structure that gives the points per an upset pick for each
-          round.  The third and final argument is the matchup data to perform the computation on."
-          (fn [_ _ field]
-            (cond
-              (and (coll? field) (= (count field) 2) (record? (first field)) (record? (last field)))
-              :leaf
-              (and (coll? field) (= (count field) 2) (coll? (first field)) (coll? (last field)))
-              :branch)))
+  "Compute a matchup.  The first argument is an associative structure that gives the points per a correct pick
+  for each round.  The second argument is an associative structure that gives the points per an upset pick for each
+  round.  The third and final argument is the matchup data to perform the computation on."
+  (fn [_ _ field]
+    (cond
+      (and (coll? field) (= (count field) 2) (record? (first field)) (record? (last field)))
+      :leaf
+      (and (coll? field) (= (count field) 2) (coll? (first field)) (coll? (last field)))
+      :branch)))
 (defmethod compute-matchup :default [_ _ matchup]
   matchup)
 (defmethod compute-matchup :branch [pick-scoring upset-scoring [[upper-field] [lower-field] :as fields]]
@@ -62,56 +64,128 @@
       vals                                                  ;get the aggregation
       (#(vector % fields)))))                               ;preserve the tree
 (defmethod compute-matchup :leaf [pick-scoring upset-scoring [a b]]
-  (compute-matchup pick-scoring upset-scoring [[[a]] [[b]]]))
+  (compute-matchup pick-scoring upset-scoring [[(list a)] [(list b)]]))

-(defn to-tournament-teams [teams]
+(defn teams->tournament-teams [teams]
   "Transform a list of teams into a map of team name->team data."
   (->> teams
     (remove (comp nil? :seed))
-    (map #(vector (:name %) (assoc (map->Team %) :weight 1 :avg-pts 0)))
+    (map #(vector (:name %) (assoc (map->Team %) :weight 1 :avg-pts 0 :future-pts 0)))
     (into {})))

-(defn to-tournament-bracket [bracket teams]
+(defn ->tournament-bracket [bracket teams]
   "Transforms a bracket of team names and a map of team data into a bracket with team data."
   (walk/postwalk-replace
     teams
     bracket))

-(defn compute-tournament [pick-scoring upset-scoring tournament-bracket]
+(defn tournament-probabilities [pick-scoring upset-scoring tournament-bracket]
+  "Computes the probability of the various outcomes of a tournament.  Calculates the first round, then
+  uses the results from that to calculate the second round, ad infinitum until all rounds are calculated."
   (walk/postwalk
     (partial compute-matchup pick-scoring upset-scoring)
     tournament-bracket))

+(defn update-future-pts [[field children] parent-team-map]
+  "Update the future-pts of each team in the field using parent-team-map.  The future-pts for each team in the
+  field is the team's average points plus the future-pts of the team in the parent-team-map."
+  (vector
+    (map
+      #(update-in % [:future-pts] +
+        (get-in parent-team-map [(:name %) :future-pts] 0)
+        (:avg-pts %))
+      field)
+    children))
+
+(defn- compute-future-pts-helper [loc parent-team-map]
+  (if (zip/end? loc)
+    loc
+    (let [updated-loc (zip/edit loc update-future-pts parent-team-map)]
+      (recur
+        (zip/next updated-loc)
+        (->>                                                ;create next parent map
+          (zip/node updated-loc)
+          first
+          (map #((juxt :name identity) %))
+          (into {}))))))
+
+(defn compute-future-pts [tp]
+  (->
+    (zip/zipper
+      (fn [[_ cn]]
+        (vector? cn))
+      (fn [[_ cn]]
+        cn)
+      (fn [node cn]
+        (assoc node 1 cn))
+      tp)
+    (compute-future-pts-helper nil)
+    zip/root))
+
+;(def bracket
+;  [[[["Florida"
+;      "Albany"]
+;
+;     ["Colorado"
+;      "Pittsburgh"]]
+;
+;    [["VCU"
+;      "Stephen F. Austin"]
+;
+;     ["UCLA"
+;      "Tulsa"]]]
+;
+;   [[["Ohio St."
+;      "Dayton"]
+;
+;     ["Syracuse"
+;      "Western Michigan"]]
+;
+;    [["New Mexico"
+;      "Stanford"]
+;
+;     ["Kansas"
+;      "Eastern Kentucky"]]]])
+
+;(def bracket
+;  [[["Florida"
+;     "Albany"]
+;
+;    ["Colorado"
+;     "Pittsburgh"]]
+;
+;   [["VCU"
+;     "Stephen F. Austin"]
+;
+;    ["UCLA"
+;     "Tulsa"]]]
+;  )
+;
 (def bracket
-  [[[["Florida"
-      "Albany"]
+  [["VCU"
+    "Stephen F. Austin"]

-     ["Colorado"
-      "Pittsburgh"]]
+   ["UCLA"
+    "Tulsa"]]
+  )

-    [["VCU"
-      "Stephen F. Austin"]

-     ["UCLA"
-      "Tulsa"]]]
-
-   [[["Ohio St."
-      "Dayton"]
-
-     ["Syracuse"
-      "Western Michigan"]]
-
-    [["New Mexico"
-      "Stanford"]
-
-     ["Kansas"
-      "Eastern Kentucky"]]]])
+;(println
+;  (tournament-probabilities
+;    [0 1 2 4 8 12 16]
+;    [0 1 2 3 4 5 6]
+;    (tournament-bracket
+;      bracket
+;      (to-tournament-teams (data/get-kenpom-teams-bundled)))))

 (println
-  (compute-tournament
-    [0 1 2 4 8 12 16]
-    [0 1 2 3 4 5 6]
-    (to-tournament-bracket
-      bracket
-      (to-tournament-teams (data/get-kenpom-teams-bundled)))))
+  (->>
+    (tournament-probabilities
+      [0 1 2 4 8 12 16]
+      [0 1 2 3 4 5 6]
+      (->tournament-bracket
+        bracket
+        (teams->tournament-teams (data/get-kenpom-teams-bundled))))
+    compute-future-pts
+   ))


Use generated color for link background in messages

--- src/braid/ui/views/message.cljs
+++ src/braid/ui/views/message.cljs
@@ -2,7 +2,7 @@
   (:require [reagent.core :as r]
             [clojure.string :as string]
             [chat.client.store :as store]
-            [chat.client.views.helpers :refer [id->color]]
+            [chat.client.views.helpers :refer [id->color ->color]]
             [chat.client.reagent-adapter :refer [subscribe]]
             [braid.ui.views.embed :refer [embed-view]]
             [braid.ui.views.pills :refer [tag-pill-view user-pill-view]]
@@ -11,11 +11,16 @@
             [chat.client.views.helpers :as helpers]
             [chat.client.routes :as routes]))

+(defn url->parts [url]
+  (let [[domain path] (rest (re-find #"http(?:s)?://([^/]+)(.*)" url))]
+    {:domain domain
+     :path path}))
+
 (defn abridged-url
   "Given a full url, returns 'domain.com/*.png' where"
   [url]
   (let [char-limit 30
-        [domain path] (rest (re-find #"http(?:s)?://([^/]+)(.*)" url))]
+        {:keys [domain path]} (url->parts url)]
     (let [url-and-path (str domain path)]
       (if (> char-limit (count url-and-path))
         url-and-path
@@ -24,12 +29,16 @@
               abridged-path (apply str (take-last path-char-limit path))]
           (str domain gap abridged-path))))))

+(defn url->domain [url]
+  ((url->parts url) :domain))
+
 (def replacements
   {:urls
    {:pattern helpers/url-re
     :replace (fn [match]
                [:a.external {:href match
                              :title match
+                             :style {:background-color (->color (url->domain match))}
                              :target "_blank"
                              ; rel to address vuln caused by target=_blank
                              ; https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/


remove server autostart

remove server autostart

--- src/clj/cljs_morphic/server.clj
+++ src/clj/cljs_morphic/server.clj
@@ -1,4 +1,5 @@
-(ns cljs-workspace.server
+(ns cljs-morphic.server
  (:require [rksm.cloxp-com.server :as server]))

-(server/start-server! :port 8084)+(defn start-server []
+	(server/start-server! :port 8084))


saving.

saving.

--- src/clj/forma/trends/filter.clj
+++ src/clj/forma/trends/filter.clj
@@ -236,9 +236,9 @@
         last (peek base-vec)]
     (for [x (range start-index (inc end-index))]
       (let [prefix (subvec base-vec 0 (min x size))]
-        (if (> x size)
-          (concat prefix (repeat (- x size) last))
-          prefix)))))
+        (vec (if (> x size)
+               (concat prefix (repeat (- x size) last))
+               prefix))))))

 (defn make-clean
   "Wrapper for `make-reliable`, `deseasonalize` and any future data cleaning


prevent Dinosaurus from adding MU when hosted icebreaker is trashed

--- src/clj/game/cards-hardware.clj
+++ src/clj/game/cards-hardware.clj
@@ -162,22 +162,29 @@
    "Dinosaurus"
    {:abilities [{:label "Install a non-AI icebreaker on Dinosaurus"
                  :req (req (empty? (:hosted card))) :cost [:click 1]
-                 :prompt "Choose a non-AI icebreaker to install on Dinosaurus from your grip"
+                 :prompt "Choose a non-AI icebreaker in your Grip to install on Dinosaurus"
                  :choices {:req #(and (has? % :subtype "Icebreaker")
                                       (not (has? % :subtype "AI"))
                                       (= (:zone %) [:hand]))}
                  :effect (effect (gain :memory (:memoryunits target))
                                  (runner-install target {:host-card card})
+                                 (update! (assoc (get-card state card) :dino-breaker (:cid target)))
                                  (update-breaker-strength target))}
                 {:label "Host an installed non-AI icebreaker on Dinosaurus"
                  :req (req (empty? (:hosted card)))
-                 :prompt "Choose a program to host on Dinosaurus"
+                 :prompt "Choose an installed non-AI icebreaker to host on Dinosaurus"
                  :choices {:req #(and (has? % :subtype "Icebreaker")
                                       (not (has? % :subtype "AI"))
                                       (:installed %))}
-                 :msg (msg "host " (:title target)) :effect (effect (host card target))}]
+                 :msg (msg "host " (:title target))
+                 :effect (effect (host card target)
+                                 (update! (assoc (get-card state card) :dino-breaker (:cid target)))
+                                 (gain :memory (:memoryunits target)))}]
     :events {:pre-breaker-strength {:req (req (= (:cid target) (:cid (first (:hosted card)))))
-                                    :effect (effect (breaker-strength-bonus 2))}}}
+                                    :effect (effect (breaker-strength-bonus 2))}
+             :card-moved {:req (req (= (:cid target) (:dino-breaker (get-card state card))))
+                          :effect (effect (update! (dissoc card :dino-breaker))
+                                          (lose :memory (:memoryunits target)))}}}

    "Doppelgänger"
    {:effect (effect (gain :memory 1)) :leave-play (effect (lose :memory 1))


fix Bookmark duplicating hosted cards when trashing to add them all to Grip

fix for #945

--- src/clj/game/cards-hardware.clj
+++ src/clj/game/cards-hardware.clj
@@ -43,7 +43,7 @@
                       :effect (effect (rez :corp target))}}}

    "Bookmark"
-   {:abilities [{:label "Host 3 cards from your Grip facedown"
+   {:abilities [{:label "Host up to 3 cards from your Grip facedown"
                  :cost [:click 1] :msg "host up to 3 cards from their Grip facedown"
                  :choices {:max 3 :req #(and (:side % "Runner") (= (:zone %) [:hand]))}
                  :effect (req (doseq [c targets]
@@ -54,7 +54,8 @@
                 {:label "[Trash]: Add all hosted cards to Grip" :msg "add all hosted cards to their Grip"
                  :effect (req (doseq [c (:hosted card)]
                                 (move state side c :hand))
-                              (trash state side card {:cause :ability-cost}))}]}
+                              (update! state side (dissoc card :hosted))
+                              (trash state side (get-card state card) {:cause :ability-cost}))}]}

    "Box-E"
    {:effect (effect (gain :memory 2 :max-hand-size 2))


routes

routes

--- src/clj/salava/badge/routes.clj
+++ src/clj/salava/badge/routes.clj
@@ -145,13 +145,13 @@
                    :current-user current-user
                    (ok (str (b/toggle-show-recipient-name! ctx badgeid show_recipient_name (:id current-user)))))

-             (POST "/toggle_evidence/:badgeid" []
+             (POST "/toggle_evidences_all/:badgeid" []
                    :path-params [badgeid :- Long]
                    :body-params [show_evidence :- (s/enum false true)]
-                   :summary "Set evidence visibility"
-                   :auth-rules access/authenticated
-                   :current-user current-user
-                   (ok (str (b/toggle-show-evidence! ctx badgeid show_evidence (:id current-user)))))
+                   :summary "disable or enable all badge evidences"
+                   :auth-rules access/authenticated
+                   :current-user current-user
+                   (ok (str (b/toggle-show-all-evidences! ctx badgeid show_evidence (:id current-user)))))

              (POST "/congratulate/:badgeid" []
                    :return {:status (s/enum "success" "error") :message (s/maybe s/Str)}
@@ -238,13 +238,12 @@
                    :return {:status (s/enum "success" "error")}
                    :path-params [badgeid :- Long]
                    :body-params [visibility :- (s/enum "private" "public" "internal")
-                                 evidence-url :- (s/maybe s/Str)
                                  rating :- (s/maybe (s/enum 5 10 15 20 25 30 35 40 45 50))
                                  tags :- (s/maybe [s/Str])]
                    :summary "Save badge settings"
                    :auth-rules access/authenticated
                    :current-user current-user
-                   (ok (b/save-badge-settings! ctx badgeid (:id current-user) visibility evidence-url rating tags)))
+                   (ok (b/save-badge-settings! ctx badgeid (:id current-user) visibility rating tags)))

              (POST "/save_raiting/:badgeid" []
                    :return {:status (s/enum "success" "error")}
@@ -273,16 +272,12 @@
              (POST "/evidence/:user-badge-id" []
                    :return {:status (s/enum "success" "error")}
                    :path-params [user-badge-id :- Long]
-                   :body-params [id :- (s/maybe s/Int)
-                                 name :- (s/maybe s/Str)
-                                 narrative :- (s/maybe s/Str)
-                                 url :- s/Str
-                                 resource_id :- (s/maybe s/Int)
-                                 resource_type :- (s/maybe s/Str)]
+                   :body-params [evidence :- schemas/Evidence]
                    :summary "Save badge evidence"
                    :auth-rules access/authenticated
                    :current-user current-user
-                   (ok (b/save-badge-evidence ctx (:id current-user) user-badge-id id name narrative url resource_id resource_type)))
+                   (prn evidence)
+                   (ok (b/save-badge-evidence ctx (:id current-user) user-badge-id evidence)))

              (DELETE "/evidence/:evidenceid" [user_badge_id resource_type resource_id]
                      :return {:status (s/enum "success" "error")}
@@ -291,4 +286,13 @@
                      :auth-rules access/authenticated
                      :current-user current-user
                      (ok (b/delete-evidence! ctx evidenceid user_badge_id (:id current-user) resource_id resource_type))
-                     ))))
+                     )
+             (POST "/toggle_evidence/:evidenceid" []
+                   ;:return {} ;{:status (s/enum "success" "error")}
+                   :path-params [evidenceid :- Long]
+                   :body-params [show_evidence :- (s/enum false true)
+                                 user_badge_id :- s/Int]
+                   :summary "Set evidence visibility"
+                   :auth-rules access/authenticated
+                   :current-user current-user
+                   (ok (str (b/toggle-show-evidence! ctx user_badge_id evidenceid show_evidence (:id current-user))))))))


re-order things on the role page

re-order things on the role page

--- src/cljs/avalon/pages/play.cljs
+++ src/cljs/avalon/pages/play.cljs
@@ -69,14 +69,13 @@
        [row
         [col
          [description (:role info)]]]
+      [row
+       [col
+         [backstory (:role info)]]]
        [row
         [col
          [:div {:style {:padding-bottom "20px"}}
           [view-list info]]]]
-       [row
-        [col
-          [:h5 "Your backstory:"]
-          [backstory (:role info)]]]
       [row
        [col
         [goodbad (:player-count info)]]]


Stub out components for showing the comic lists

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -47,13 +47,23 @@
       (when-let [site-list @site-list]
         [:ul (map manga-site site-list)]))))

+(defn comic-btn [comic]
+  ^{:key (:name comic)}
+  [:li (:name comic)])
+
+(defn comic-list []
+  (let [comics-list (rf/subscribe [:comic-list])]
+    (fn []
+      (when-let [comic-list @comic-list]
+        [:ul (map comic-btn comic-list)]))))
+
 (defn comic-reader []
   (let [page (rf/subscribe [:page])]
     (fn []
       [:div
        (case @page
          :sites [site-list]
-         :comics "Display the comics available."
+         :comics [comic-list]
          :read "Display the comic itself!"
          nil ""
          [four-oh-four])])))