Fix client render bug

Fix client render bug

--- src/instantetymonline/client.cljs
+++ src/instantetymonline/client.cljs
@@ -1,21 +1,26 @@
 (ns ^:figwheel-always instantetymonline.client
-    (:require [reagent.core :as r :refer [atom]]
+    (:require [reagent.core :as r]
               [instantetymonline.dict :refer [dict]]))

 (enable-console-print!)

-(defonce word (atom ""))
-
-(defn text-input [label]
-  [:div
-   [:input {:type "text"
-            :value @word
-            :on-change (fn [e] (reset! word (-> e .-target .-value)))}]])
+(defn etym-lookup []
+  (let [local (r/atom {:word ""})]   ;; not included in render
+    (fn []                           ;; render from here
+      (let [word (get @local :word)]
+        [:div.center
+         [:form
+          [:input.h2 {:id "etym"
+                   :type "text"
+                   :value word
+                   :on-change (fn [e]
+                                (reset! local {:word (-> e .-target .-value)}))}]]
+         [:div [:p (get dict word)]]]))))

 (defn main-component []
-  [:body
-   [text-input "word"]
-   [:p (get dict @word)]])
+  [:div
+   [:h1.center "Etymologically delicious"]
+   [etym-lookup]])

 (r/render-component [main-component]
   (. js/document (getElementById "app")))


added optional - for url pattern in results

--- src/lcmap/clownfish/endpoints.clj
+++ src/lcmap/clownfish/endpoints.clj
@@ -95,7 +95,7 @@
          (alg/put-algorithm algorithm request)
          {:template html/default}))

-     (GET "/results/:algorithm{.+}/:x{[0-9]+}/:y{[0-9]+}" [algorithm x y]
+     (GET "/results/:algorithm{.+}/:x{[0-9-]+}/:y{[0-9-]+}" [algorithm x y]
        (with-meta
          (results/get-results algorithm x y request)
          {:template html/default})))


important to always commit to a fileset

important to always commit to a fileset

--- src/lwhorton/boot_stylus/core.clj
+++ src/lwhorton/boot_stylus/core.clj
@@ -77,11 +77,9 @@
                 (binding [u/*sh-dir* (.getPath tmp)]
                   (u/dosh "./node_modules/.bin/stylus" "-o" (.getPath out-file) (.getPath in-file)))))))

-        (if (seq styl-files)
-          (-> fileset
-              (c/add-resource tmp)
-              c/commit!)
-          fileset)))))
+        (-> fileset
+            (c/add-resource tmp)
+            c/commit!)))))

 (deftask compile-css-modules
   "Compile all .css files into css-modules with a json manifest.
@@ -143,14 +141,14 @@
                         (doto out-file io/make-parents (spit module)))
                       (u/fail "Something went wrong compiling: " in-path))))))))

-        (if (seq css)
-         (do
-           (u/info (str "Finished compiling stylus, elapsed time: " (- (System/currentTimeMillis) @starttime) "ms\n"))
-           (-> fileset
+        (when (seq css)
+          (u/info (str "Finished compiling stylus, elapsed time: " (- (System/currentTimeMillis) @starttime) "ms\n")))
+
+        (-> fileset
             (c/add-resource hash-cache)
             (c/add-resource tmp)
-            c/commit!))
-          fileset)))))
+            c/commit!)
+        ))))

 (deftask remove-leftovers
   "Remove all files generated in the stylus task because all we really care
@@ -176,5 +174,5 @@
   (comp
     (compile-stylus)
     (compile-css-modules)
-    (remove-leftovers)
+    ;(remove-leftovers)
     ))


fix js-template not generating proper code

--- src/main/shadow/cljs/modern.cljc
+++ src/main/shadow/cljs/modern.cljc
@@ -273,23 +273,24 @@
   `(defclass* ~@body))

 (defmethod comp/emit* ::js-template
-  [{:keys [tagged parts]}]
-  (when tagged
-    (comp/emit (first parts)))
-  (comp/emits "`")
-  (doseq [{:keys [op val] :as part} (if tagged (rest parts) parts)]
-    (if (and (= :const op) (string? val))
-      (let [quoted
-            (-> val
-                ;; FIXME: anything else that needs replacing?
-                ;; newlines and stuff are allowed
-                (str/replace #"`" (constantly "\\`"))
-                (str/replace #"\$\{" (constantly "\\${")))]
-        (comp/emits quoted))
-      (do (comp/emits "${")
-          (comp/emit part)
-          (comp/emits "}"))))
-  (comp/emits "`"))
+  [{:keys [env tagged parts]}]
+  (comp/emit-wrap env
+    (when tagged
+      (comp/emit (first parts)))
+    (comp/emits "`")
+    (doseq [{:keys [op val] :as part} (if tagged (rest parts) parts)]
+      (if (and (= :const op) (string? val))
+        (let [quoted
+              (-> val
+                  ;; FIXME: anything else that needs replacing?
+                  ;; newlines and stuff are allowed
+                  (str/replace #"`" (constantly "\\`"))
+                  (str/replace #"\$\{" (constantly "\\${")))]
+          (comp/emits quoted))
+        (do (comp/emits "${")
+            (comp/emit part)
+            (comp/emits "}"))))
+    (comp/emits "`")))

 (defmethod ana/parse `js-template*
   [op env form name opts]


Corrected typo in contexp.fca.contexts

Corrected typo in contexp.fca.contexts

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

--- conexp/fca/contexts.clj
+++ conexp/fca/contexts.clj
@@ -206,7 +206,7 @@

 (defn transitive-closure
   ([set-of-pairs]
-     (transitively-close-relation set-of-pairs set-of-pairs #{}))
+     (transitive-closure set-of-pairs set-of-pairs #{}))
   ([set-of-pairs new old]
      (if (= new old)
        new


fix :preloads injection in :node-test

fix :preloads injection in :node-test

--- src/main/shadow/build/targets/node_test.clj
+++ src/main/shadow/build/targets/node_test.clj
@@ -36,7 +36,9 @@

         entries
         (-> '[shadow.test.env] ;; must be included before any deftest because of the cljs.test mod
-            (into (:preloads config))
+            (cond->
+              (= :dev mode)
+              (into (get-in config [:devtools :preloads])))
             (into test-namespaces)
             (conj (or (when-let [main (:main config)]
                         (-> main namespace symbol))


Move before-task-start to before pipeline is built

this way before-task-start operations are available when pipeline is
built/started, which is the intention.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -593,16 +593,14 @@
                            :onyx.core/replica replica
                            :onyx.core/state state}

+            pipeline-data (merge pipeline-data ((:onyx.core/compiled-before-task-start-fn pipeline-data) pipeline-data))
             pipeline (build-pipeline catalog-entry pipeline-data)
-            _ (taoensso.timbre/info "Built " pipeline " for " (:name task))
-
+            pipeline-data (assoc pipeline-data :onyx.core/pipeline pipeline)
+
             ex-f (fn [e] (handle-exception e restart-ch outbox-ch job-id))
             _ (while (and (first (alts!! [kill-ch task-kill-ch] :default true))
                           (not (munge-start-lifecycle pipeline-data)))
-                (Thread/sleep (or (:onyx.peer/peer-not-ready-back-off opts) 2000)))
-            pipeline-data (assoc pipeline-data :onyx.core/pipeline pipeline)
-            pipeline-data (merge pipeline-data
-                                 ((:onyx.core/compiled-before-task-start-fn pipeline-data) pipeline-data))]
+                (Thread/sleep (or (:onyx.peer/peer-not-ready-back-off opts) 2000)))]

         (>!! outbox-ch (entry/create-log-entry :signal-ready {:id id}))


Retries need ids

Retries need ids

--- src/onyx/plugin/bench_plugin.clj
+++ src/onyx/plugin/bench_plugin.clj
@@ -27,9 +27,12 @@
            generator/pending-messages
            generator/retry] :as event}]
   (let [batch-size (:onyx/batch-size task-map)
-        segments (flush-swap! retry
-                              #(take batch-size %)
-                              #(subvec % (min batch-size (count %))))
+        segments (->> (flush-swap! retry
+                                   #(take batch-size %)
+                                   #(subvec % (min batch-size (count %))))
+                      (map (fn [m] {:id (java.util.UUID/randomUUID)
+                                    :input :generator
+                                    :message m})))
         batch (loop [n (count segments)
                      sgs segments]
                 (if (= n batch-size)


don't show os:none masters in builder fleet state

--- src-cljs/frontend/components/admin.cljs
+++ src-cljs/frontend/components/admin.cljs
@@ -131,7 +131,9 @@
   (reify
     om/IRender
     (render [_]
-      (let [fleet-state (sort-by :instance_id (get-in app state/fleet-state-path))
+      (let [fleet-state (->> (get-in app state/fleet-state-path)
+                             (remove #(-> % :builder_tags (= ["os:none"])))
+                             (sort-by :instance_id))
             summary-counts (get-in app state/build-system-summary-path)
             current-tab (or (get-in app [:navigation-data :tab]) :builders)]
         (html


bit of cleanup

bit of cleanup

--- src/cljs/defender_cljs/canvas/core.cljs
+++ src/cljs/defender_cljs/canvas/core.cljs
@@ -1,11 +1,9 @@
 (ns defender-cljs.canvas.core
   (:require [defender-cljs.canvas.camera :as cam]
             [defender-cljs.canvas.scene :as scene]
-            [defender-cljs.canvas.geometry :as geo]
             [defender-cljs.canvas.system :as system]
             [defender-cljs.overlay.core :as overlay]
             [defender-cljs.overlay.map :as map]
-            [defender-cljs.canvas.sprite :as sprite]
             [defender-cljs.constants :as c]
             [defender-cljs.physics :as physics]
             [defender-cljs.actor :as a]


Reduce some log message levels

Reduce some log message levels

And add some comments re: others that seem dubious.

--- src/com/frereth/common/curve/server.clj
+++ src/com/frereth/common/curve/server.clj
@@ -564,13 +564,13 @@
                         K/hello-crypto-box-length
                         initial-cookie
                         K/server-nonce-suffix-length)
-        (log/info "Trying to extract cookie based on current minute-key")
+        (log/debug "Trying to extract cookie based on current minute-key")
         (when-let [success
                    (try
                      (crypto/secret-unbox result result box-size nonce (::minute-key cookie-cutter))
                      (catch ExceptionInfo _
                        ;; Try again with the previous minute-key
-                       (log/info "That failed. Try again with the previous minute-key")
+                       (log/debug "That failed. Try again with the previous minute-key")
                        (b-t/byte-copy! result 0 K/box-zero-bytes shared/zero-bytes)
                        (b-t/byte-copy! result
                                        K/box-zero-bytes
@@ -585,7 +585,10 @@
                                               nonce
                                               (::last-minute-key cookie-cutter))
                          (catch ExceptionInfo _
-                           ;; For now, just silently discard this failure
+                           ;; Reference implementation just silently discards the
+                           ;; failure.
+                           ;; That's more efficient at this level, but seems to
+                           ;; discard the possibilities of attack mitigation.
                            (log/warn "Extracting the original crypto-box failed")))))]
           (let [extracted (byte-array (subvec (vec result)
                                               K/decrypt-box-zero-bytes
@@ -593,7 +596,7 @@
                 expected-buffer (::K/clnt-short-pk initiate)
                 expected (byte-array K/key-length)]
             (.getBytes expected-buffer 0 expected)
-            (log/info "Cookie extraction succeeded. Q: Do the contents match?"
+            (log/debug "Cookie extraction succeeded. Q: Do the contents match?"
                       "\nExpected:\n"
                       (with-out-str (b-s/print-bytes expected))
                       "\nActual:\n"


Don't use threading macro excessively

Don't use threading macro excessively

Use a direct function call here to improve readibilty.

--- src/com/puppetlabs/puppetdb/command.clj
+++ src/com/puppetlabs/puppetdb/command.clj
@@ -266,8 +266,7 @@
           (number? version)]
    :post [(string? %)]}
   (with-open [conn (mq/connect! mq-spec)]
-    (let [command-map (-> (assemble-command command version payload)
-                          (annotate-command))]
+    (let [command-map (annotate-command (assemble-command command version payload))]
       (mq/publish-json! conn mq-endpoint command-map)
       (get-in command-map [:annotations :id]))))


Revert spec gen

Revert spec gen

--- src/com/wsscode/pathom/connect/gen.cljc
+++ src/com/wsscode/pathom/connect/gen.cljc
@@ -87,7 +87,7 @@
    ::attrs
    (fn attrs [{::p/keys  [path]
                ::pc/keys [indexes]}]
-     (-> (pc/discover-attrs indexes (rseq path)) keys seq))
+     (-> (pc/discover-attrs indexes path) keys seq))

    ::idents
    (fn idents [{::pc/keys [indexes]}]
@@ -96,7 +96,7 @@
    ::nestable-keys
    (fn nestable-keys [{::pc/keys [indexes]
                        ::p/keys  [path]}]
-     (->> (pc/discover-attrs indexes (rseq path))
+     (->> (pc/discover-attrs indexes path)
           (keep (fn [[k v]] (if (seq v) k)))
           seq))


biordinal-scale now takes <= and >= as optional arguments

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

--- src/conexp/fca/many_valued_contexts.clj
+++ src/conexp/fca/many_valued_contexts.clj
@@ -144,24 +144,26 @@

 (defn biordinal-scale
   "base must be ordered (e.g. vector or list). Otherwise the result will be arbitrary."
-  [base n]
-  (let [first-objs (take n base)
-	rest-objs (drop n base)
+  ([base n]
+     (biordinal-scale base n <= >=))
+  ([base n <= >=]
+     (let [first-objs (take n base)
+	   rest-objs (drop n base)

-	first-atts (map #(str "<= " %) first-objs)
-	rest-atts (map #(str ">= " %) rest-objs)
+	   first-atts (map #(str "<= " %) first-objs)
+	   rest-atts (map #(str ">= " %) rest-objs)

-	first-inz (set-of [g (str "<= " m)]
-			  [g first-objs
-			   m first-objs
-			   :when (<= g m)])
-	rest-inz (set-of [g (str ">= " m)]
-			 [g rest-objs
-			  m rest-objs
-			  :when (>= g m)])]
-    (make-context base
-		  (union first-atts rest-atts)
-		  (union first-inz rest-inz))))
+	   first-inz (set-of [g (str "<= " m)]
+			     [g first-objs
+			      m first-objs
+			      :when (<= g m)])
+	   rest-inz (set-of [g (str ">= " m)]
+			    [g rest-objs
+			     m rest-objs
+			     :when (>= g m)])]
+       (make-context base
+		     (union first-atts rest-atts)
+		     (union first-inz rest-inz)))))

 (defn dichotomic-scale [base]
   (diag-context base))


Plug another file descriptor leak

Plug another file descriptor leak

--- src/refactor_nrepl/ns/helpers.clj
+++ src/refactor_nrepl/ns/helpers.clj
@@ -69,10 +69,10 @@

 (defn read-ns-form
   [path]
-  (if-let [ns-form
-           (read-ns-decl (PushbackReader. (FileReader. path)))]
-    ns-form
-    (throw (IllegalArgumentException. "Malformed ns form!"))))
+  (with-open [file-reader (FileReader. path)]
+    (if-let [ns-form (read-ns-decl (PushbackReader. file-reader))]
+      ns-form
+      (throw (IllegalArgumentException. "Malformed ns form!")))))

 (defn file-content-sans-ns [file-content]
   ;; NOTE: It's tempting to trim this result but


Extract empty string as a no-bucket constant

--- src/silly_image_store/handler.clj
+++ src/silly_image_store/handler.clj
@@ -7,8 +7,8 @@
             [compojure.handler :as handler]
             [compojure.route :as route]))

-(def images-dir
-  (env :base-store-dir))
+(def images-dir (env :base-store-dir))
+(def no-bucket "")

 ; Request/Response utils
@@ -47,9 +47,9 @@

 (defroutes app-routes
-  (GET "/images" request (list-images-route request ""))
-  (GET "/images/:image" [image] (serve-image-route "" image))
-  (GET "/random" [] (serve-random-image-route ""))
+  (GET "/images" request (list-images-route request no-bucket))
+  (GET "/images/:image" [image] (serve-image-route no-bucket image))
+  (GET "/random" [] (serve-random-image-route no-bucket))
   (GET "/buckets" request list-buckets-route)
   (GET "/buckets/:bucket/images" [bucket :as request] (list-images-route request bucket))
   (GET "/buckets/:bucket/images/:image" [bucket image] (serve-image-route bucket image))


Remove remaining deprecated Push 1 code.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -362,15 +362,6 @@
   [controller x color]
   (set-button-color controller (get control-buttons (keyword (str "encoder-pad-" x))) color))

-(defn ^:deprecated set-display-line
-  "Sets a line of the text display."
-  [controller line bytes]
-  {:pre [(<= 0 line 3)]}
-  (let [message (concat [240 71 127 21 (+ line 24) 0 69 0]
-                        (take 68 (concat (map int bytes) (repeat 32)))
-                        [247])]
-    #_(midi/midi-sysex (:port-out controller) message)))
-
 (def touch-strip-mode-flags
   "The values which are combined to set the touch strip into
   particular modes."
@@ -551,34 +542,6 @@
   ;; And record the new state for next time
   (reset! (:last-text-buttons controller) @(:next-text-buttons controller)))

-(defn- ^:deprecated get-safe-text-byte
-  "Converts a character to be displayed to a byte, but if it is
-  outside the range that can be displayed by the Push, like Unicode,
-  then change it to a byte representing an ellipsis."
-  [c]
-  (let [i (int c)]
-    (if (> i 127)
-      0
-      i)))
-
-(defn ^:deprecated write-display-text
-  "Update a batch of characters within the display to be rendered on
-  the next update."
-  [controller row start text]
-  {:pre [(<= 0 row 3) (<= 0 start 67)]}
-  #_(let [bytes (map get-safe-text-byte text)]
-    (doseq [[i val] (map-indexed vector bytes)]
-      (aset (get (:next-display controller) row) (+ start i) (util/ubyte val)))))
-
-(defn- ^:deprecated write-display-cell
-  "Update a single text cell (of which there are four per row) in the
-  display to be rendered on the next update."
-  [controller row cell text]
-  {:pre [(<= 0 row 3) (<= 0 cell 3)]}
-  #_(let [bytes (take 17 (concat (map get-safe-text-byte text) (repeat 32)))]
-    (doseq [[i val] (map-indexed vector bytes)]
-      (aset (get (:next-display controller) row) (+ (* cell 17) i) (util/ubyte val)))))
-
 (def button-cell-width
   "The number of pixels allocated to each button above or below the
   graphical display."
@@ -705,17 +668,6 @@
     (set-graphics-color graphics color)
     (.drawString graphics iterator
                  (int (math/round (- (* (+ index (/ encoder-count 2)) button-cell-width) (/ width 2)))) 40)))
-
-(defn ^:deprecated make-gauge
-  "Create a graphical gauge with an indicator that fills a line.
-  The default range is from zero to a hundred, and the default size is
-  17 characters, or a full display cell."
-  [value & {:keys [lowest highest width] :or {lowest 0 highest 100 width 17}}]
-  (let [range (- highest lowest)
-        scaled (int (* 2 width (/ (- value lowest) range)))
-        marker 0
-        leader (take (int (/ scaled 2)) (repeat 0))]
-    (take width (concat leader [marker] (repeat 0)))))

 (defn draw-null-gauge
  "Draw a mostly meaningless gauge simply to indicate that the encoder
@@ -851,31 +803,13 @@
       (.setAngleStart arc (- 240.0 (* i 3)))
       (.draw graphics arc))))

-(defn ^:deprecated make-pan-gauge
-  "Create a graphical gauge with an indicator that moves along a line.
-  The default range is from zero to a hundred, and the default size is
-  17 characters, or a full display cell."
-  [value & {:keys [lowest highest width] :or {lowest 0 highest 100 width 17}}]
-  (let [range (* 1.01 (- highest lowest))
-        midpoint (/ (- highest lowest) 2)
-        scaled (int (* 2 width (/ (- value lowest) range)))
-        filler (repeat 0)
-        centered (< (math/abs (- (- value lowest) midpoint)) (/ range 256))
-        marker 0
-        leader (if (and centered (even? width) (even? scaled))
-                 (concat (take (dec (int (/ scaled 2))) filler) [0])
-                 (take (int (/ scaled 2)) filler))]
-    (take width (concat leader [marker]
-                        (when (and centered (even? width) (odd? scaled)) [0])
-                        filler))))
-
 (defn- metronome-sync-label
   "Determine the sync type label to display under the BPM section."
   [controller]
   (with-show (:show controller)
     (case (:type (show/sync-status))
-      :manual " Manual"
-      :midi "  MIDI"
+      :manual "Manual"
+      :midi "MIDI"
       :dj-link "DJ Link"
       :traktor-beat-phase "Traktor"
       "Unknown")))
@@ -2180,17 +2114,6 @@
   [note]
   (+ note 71))

-(defn- ^:deprecated draw-variable-gauge
-  "Display the value of a variable being adjusted in the effect list."
-  [controller cell width offset cue v effect-id]
-  (let [value (or (cues/get-cue-variable cue v :show (:show controller) :when-id effect-id) 0)
-        low (min value (:min v))  ; In case user set "out of bounds".
-        high (max value (:max v))
-        gauge (if (:centered v)
-                (make-pan-gauge value :lowest low :highest high :width width)
-                (make-gauge value :lowest low :highest high :width width))]
-    (write-display-text controller 0 (+ offset (* cell 17)) gauge)))
-
 (defn- adjust-variable-value
   "Handle a control change from turning an encoder associated with a
   variable being adjusted in the effect list."


Coils: Can turn off debug mode bug fixed

--- src/webapp/framework/client/coreclient.cljs
+++ src/webapp/framework/client/coreclient.cljs
@@ -369,7 +369,8 @@
     [
      react-fn-name    (get-fn-name (str str-nm ))
      ]
-    (dom/div #js {
+    (dom/div (if js/debug_live
+               #js {
                   :onMouseEnter #(om/set-state! owner :debug-highlight true)
                   :onMouseLeave #(om/set-state! owner :debug-highlight false)
                   :style #js {:backgroundColor
@@ -381,7 +382,7 @@
                                 (do
                                   (unset-debug-component  react-fn-name)
                                   "")                                )}
-                  }
+                  } )

              (react-fn data)
              "")))


Fix typo

Fix typo

--- src/clj/collect_earth_online/db/projects.clj
+++ src/clj/collect_earth_online/db/projects.clj
@@ -12,10 +12,8 @@
             [collect-earth-online.logging    :refer [log]]
             [collect-earth-online.views      :refer [data-response]]
             [collect-earth-online.utils.geom :refer [make-geo-json-polygon]]
-            [collect-earth-online.generators.clj-point-generator
-             :refer [generate-point-plots generate-point-samples]]
-            [collect-earth-online.generators.external-file-generators
-             :refer [generate-file-plots generate-file-samples]]))
+            [collect-earth-online.generators.clj-point     :refer [generate-point-plots generate-point-samples]]
+            [collect-earth-online.generators.external-file :refer [generate-file-plots generate-file-samples]]))

 ;;;
 ;;; Auth functions


Formatting

Formatting

--- src/cljs/onyx_dashboard/components/jobs.cljs
+++ src/cljs/onyx_dashboard/components/jobs.cljs
@@ -19,12 +19,10 @@
                               (let [job-id (:id job)
                                     selected? (= job-id selected-job)]
                                 (dom/tr {:class (str "job-entry")}
-                                        (dom/td
-                                          (dom/i {:class (if selected? "fa fa-dot-circle-o" "fa fa-circle-o")}))
+                                        (dom/td (dom/i {:class (if selected? "fa fa-dot-circle-o" "fa fa-circle-o")}))
                                         (dom/td {:on-click (fn [_]
                                                              (put! (om/get-shared owner :api-ch)
                                                                    [:select-job job-id]))}
-
                                                 (str job-id))
                                         (dom/td {}
                                                 (.fromNow (js/moment (str (js/Date. (:created-at job))))))))))))))


Added a function to retrieve the indexed collection permitted group ids.

--- src/cmr/search/data/elastic_search_index.clj
+++ src/cmr/search/data/elastic_search_index.clj
@@ -134,6 +134,19 @@
                 :from from
                 :fields fields)))

+(defn get-collection-permitted-groups
+  "Useful for debugging only. Gets collections along with their currently permitted groups"
+  [context]
+  (let [index-info (concept-type->index-info context :collection nil)
+        results (esd/search (context->conn context)
+                (:index-name index-info)
+                [(:type-name index-info)]
+                :query (q/match-all)
+                :size 10000
+                :fields ["permitted-group-ids"])]
+    (into {} (for [hit (get-in results [:hits :hits])]
+               [(:_id hit) (get-in hit [:fields :permitted-group-ids])]))))
+
 (defn execute-query
   "Executes a query to find concepts. Returns concept id, native id, and revision id."
   [context query]


Finish up unit tests for item listing.

Finish up unit tests for item listing.

--- test/fcms/unit/resources/item/item_list.clj
+++ test/fcms/unit/resources/item/item_list.clj
@@ -1,6 +1,7 @@
 (ns fcms.unit.resources.item.item-list
   (:require [midje.sweet :refer :all]
             [fcms.lib.resources :refer :all]
+            [fcms.lib.checks :refer (about-now?)]
             [fcms.resources.collection :as collection]
             [fcms.resources.item :refer :all]))

@@ -28,18 +29,30 @@
 			(fact "returns two items when there are two item in the collection"
 				(count (all-items e)) => 2)

-      (future-fact "the item ids are strings")
+      (fact "the item ids are strings"
+        (doseq [item (all-items e)]
+          (instance? String (:id item)) => true))
+
+      (fact "the containing collection's slug is included in the items"
+        (set (map :collection (all-items e))) => #{e})

-      (future-fact "the containing collection's slug is included in the items")
+      (fact "the items' slugs are included"
+        (set (map :slug (all-items e))) => #{i slug})

-      (future-fact "the items' slugs are included")
+      (fact "the items' names are included"
+        (set (map :name (all-items e))) => #{unicode-name slug})

-      (future-fact "the items' names are included")
+      (fact "the items' descriptions are included"
+        (set (map :description (all-items e))) => #{unicode-description nil})

-      (future-fact "the items' descriptions are included")
+      (fact "the items' versions are 1"
+        (set (map :version (all-items e))) => #{1})

-      (future-fact "the items' versions are 1")
+      (fact "the custom property of an item in the list is included"
+        (set (map :custom (all-items e))) => #{foo nil})

-      (future-fact "the custom property of an item in the list is included")
-
-      (future-fact "the item's timestamps are included"))))+      (fact "the item's timestamps are included"
+        (doseq [item (all-items e)]
+          (instance? timestamp (:created-at item)) => true
+          (about-now? (:created-at item)) => true
+          (:created-at item) => (:updated-at item))))))


Add update collection link.

Add update collection link.

--- src/oc/storage/representations/org.clj
+++ src/oc/storage/representations/org.clj
@@ -37,6 +37,8 @@
         full-links (if (= access-level :author)
                       (concat links [(partial-update-link org)
                                      (add-author-link org)
+                                     (hateoas/collection-link (str (url org) "/updates")
+                                        {:accept mt/update-collection-media-type})
                                      (hateoas/create-link (str (url org) "/updates/")
                                         {:content-type mt/share-request-media-type
                                          :accept mt/update-media-type})])


add test pattern: misaki.compiler.markdown.code

--- test/misaki/compiler/markdown/code_test.clj
+++ test/misaki/compiler/markdown/code_test.clj
@@ -2,11 +2,9 @@
   (:require
     [misaki.compiler.markdown [code :refer :all]]
     [misaki [config :refer [*config*]]
-            [tester :refer :all]
-            ]
-    [clojure.test :refer :all]
-    [clojure.string :as str]))
-
+            [tester :refer :all]]
+    [clojure [test   :refer :all]
+             [string :as str]]))

 ;; gen-uniq-str
 (deftest gen-uniq-str-test
@@ -17,32 +15,41 @@
 (defcompilertest convert-without-codes-test
   (let [f #(str/replace % #"a" "A")]

-    (are [x y] (= x (convert-without-codes f y))
-      "AAA" "aaa"
-      "AAA\nbbb" "aaa\nbbb"
-      "AA```\naaa\n```"  "aa```\naaa\n```"
-      "AA```\naaa\nbbb\n```"  "aa```\naaa\nbbb\n```"
-      "AA```\naaa\nbbb\n\n```"  "aa```\naaa\nbbb\n\n```")
+    (testing "code block without language"
+      (are [x y] (= x (convert-without-codes f y))
+        "AAA"                   ,  "aaa"
+        "AAA\nbbb"              ,  "aaa\nbbb"
+        "AA```\naaa\n```"       ,  "aa```\naaa\n```"
+        "AA```\naaa\nbbb\n```"  ,  "aa```\naaa\nbbb\n```"
+        "AA```\naaa\nbbb\n\n```",  "aa```\naaa\nbbb\n\n```"))

-    (are [x y] (= x (convert-without-codes f y))
-      "AA```lang\naaa\n```" "aa```lang\naaa\n```")
+    (testing "code block with language"
+      (are [x y] (= x (convert-without-codes f y))
+        "AA```lang\naaa\n```"       ,  "aa```lang\naaa\n```"
+        "AA```lang\naaa\nbbb\n```"  ,  "aa```lang\naaa\nbbb\n```"
+        "AA```lang\naaa\nbbb\n\n```",  "aa```lang\naaa\nbbb\n\n```"))

-    (are [x y] (= x (convert-without-codes f y))
-      "```\na\n``` A ```\na\n```" "```\na\n``` a ```\na\n```")
-    ))
+    (testing "multiple code blocks"
+      (are [x y] (= x (convert-without-codes f y))
+        "```\na\n``` A ```\na\n```"    , "```\na\n``` a ```\na\n```"
+        "```\na\n``` A ```lang\na\n```", "```\na\n``` a ```lang\na\n```"))))

 ;; transform-codes
 (defcompilertest transform-codes-test
-  (are [x y] (= x (transform-codes y))
-    "
a
" "```\na\n```"
-    "
a
" "```\n\n\na\n\n\n```"
-    "
a\nb
" "```\na\nb\n```"
-    )
+  (testing "transform code without language"
+    (are [x y] (= x (transform-codes y))
+      "
a
"   , "```\na\n```"
+      "
a
"   , "```\n\n\na\n\n\n```"
+      "
a\nb
", "```\na\nb\n```"))

-  (are [x y] (= x (transform-codes y))
-    "
a
" "```clj\na\n```"
-    "
a\nb
" "```clj\na\nb\n```"
-    )
-  )
+  (testing "transform code with language"
+    (are [x y] (= x (transform-codes y))
+      "
a
"   , "```clj\na\n```"
+      "
a\nb
", "```clj\na\nb\n```"))
+
+  (testing "transform multiple codes"
+    (are [x y] (= x (transform-codes y))
+      "
a
 b
c
", "```\na\n``` b ```\nc\n```"
+      "
a
 b
c
", "```\na\n``` b ```lang\nc\n```")))


Remove debugging println.

Remove debugging println.

--- test/onyx/peer/lifecycle_exception_test.clj
+++ test/onyx/peer/lifecycle_exception_test.clj
@@ -52,10 +52,6 @@
   {})

 (defn handle-exception [event lifecycle phase e]
-  (println "PHASE IS" phase
-           (if (not= phase :lifecycle/after-batch)
-             :restart
-             :kill))
   (if (not= phase :lifecycle/after-batch)
     :restart
     :kill))


minor change to work with the latest dashboard version

--- src/clj/deliverit_dashboard/pusher.clj
+++ src/clj/deliverit_dashboard/pusher.clj
@@ -1,6 +1,6 @@
 (ns deliverit-dashboard.pusher
   (:require [clojure.core.async :as async]
-            [dashboard-clj.data-source :refer [data->event]]))
+            [dashboard-clj.utils :refer [data->event]]))

 (defn init
   [datasource]


Forgot to url-encode the state on the return call to Bond

--- src/cljs/main/broadfcui/endpoints.cljs
+++ src/cljs/main/broadfcui/endpoints.cljs
@@ -380,7 +380,7 @@

 (defn profile-link-fence-account [provider oauth-code oauth-state redirect-uri on-done ]
   (ajax/call-bond
-   (str "/link/v1/" provider "/oauthcode?oauthcode=" oauth-code "&redirect_uri=" redirect-uri "&state=" oauth-state)
+   (str "/link/v1/" provider "/oauthcode?oauthcode=" oauth-code "&redirect_uri=" redirect-uri "&state=" (js/encodeURIComponent oauth-state))
    {:method :post
     :on-done on-done}))


small-fix

small-fix

--- src/cljs/salava/badge/ui/evidence.cljs
+++ src/cljs/salava/badge/ui/evidence.cljs
@@ -23,20 +23,18 @@
            :show-form false
            :evidence nil)))

-(defn show-settings-dialog [badge-id state init-data ]
+(defn init-settings [badge-id state init-data ]
   (ajax/GET
     (path-for (str "/obpv1/badge/settings/" badge-id) true)
     {:handler (fn [data]
-                (swap! state assoc :badge-settings data (assoc data :new-tag ""))
-                (swap! state assoc :tab [se/settings-tab-content data state init-data]
-                       :tab-no 2
+                (swap! state assoc :badge-settings data (assoc data :new-tag "")
                        :evidences (:evidences data)))}))

 (defn delete-evidence! [id data state init-data]
-    (ajax/DELETE
-      (path-for (str "/obpv1/badge/evidence/" id))
-      { :params {:user_badge_id (:id data)}
-        :handler #(show-settings-dialog (:id @state) state init-data)}))
+  (ajax/DELETE
+    (path-for (str "/obpv1/badge/evidence/" id))
+    { :params {:user_badge_id (:id data)}
+      :handler #(init-settings (:id @state) state init-data)}))

 (defn init-resources [key resource-atom]
@@ -60,14 +58,12 @@
 (defn toggle-show-evidence! [id data state init-data]
   (let [visibility-atom (cursor state [:evidence :properties :hidden])
         new-value (not @visibility-atom)
-        badgeid (:id @state)
-        ;init-settings (first (plugin-fun (session/get :plugins) "modal" "show_settings_dialog"))
-        ]
+        badgeid (:id @state)]
     (ajax/POST
       (path-for (str "/obpv1/badge/toggle_evidence/" id))
       {:params {:show_evidence new-value
                 :user_badge_id (int badgeid)}
-       :handler #(show-settings-dialog badgeid state init-data)})))
+       :handler #(init-settings badgeid state init-data)})))

 (defn set-page-visibility-to-private [page-id]
   (ajax/POST
@@ -78,9 +74,7 @@
 (defn save-badge-evidence [data state init-data]
   (let [{:keys [id name narrative url resource_visibility properties]} (:evidence @state)
         {:keys [resource_type mime_type resource_id]} properties
-        badge-id (:id data)
-        ;init-settings (first (plugin-fun (session/get :plugins) "modal" "show_settings_dialog"))
-        ]
+        badge-id (:id data)]
     (swap! state assoc :evidence {:message nil})
     (if (and (not (blank? narrative)) (blank? name))
       (swap! state assoc :evidence {:message [:div.alert.alert-warning [:p (t :badge/Emptynamefield)]]
@@ -98,7 +92,7 @@
                                :resource_id resource_id
                                :resource_type resource_type
                                :mime_type mime_type}}
-           :handler #(show-settings-dialog (:id @state) state init-data)})))))
+           :handler #(init-settings (:id @state) state init-data)})))))

 ;;;;

@@ -239,12 +233,12 @@

 (defn evidence-form [data state init-data]
   (let [;settings-tab (first (plugin-fun (session/get :plugins) "settings" "settings_tab_content"))
-        evidence-name-atom (cursor state [:evidence :name])
-        evidence-narrative-atom (cursor state [:evidence :narrative])
-        evidence-url-atom (cursor state [:evidence :url])
-        message (cursor state [:evidence :message])
-        input-mode (cursor state [:input_mode])
-        {:keys [image_file name]} data]
+         evidence-name-atom (cursor state [:evidence :name])
+         evidence-narrative-atom (cursor state [:evidence :narrative])
+         evidence-url-atom (cursor state [:evidence :url])
+         message (cursor state [:evidence :message])
+         input-mode (cursor state [:input_mode])
+         {:keys [image_file name]} data]

     [:div {:id "badge-settings" :class "row flip"}
      [:div {:class "col-md-3 badge-image modal-left"}
@@ -325,7 +319,9 @@
                                 (reset! input-mode nil)
                                 (reset! (cursor state [:show-form]) nil)
                                 (reset! (cursor state [:show-preview]) nil)
-                                (save-badge-evidence data state init-data)
+                                (save-badge-evidence @(cursor state [:badge-settings]) state init-data)
+                                (swap! state assoc :tab [se/settings-tab-content data state init-data]
+                                       :tab-no 2)

                                 )}
           (t :core/Add)]
@@ -338,7 +334,7 @@
 (defn evidence-list [data state init-data]
   (let [evidence-name-atom (cursor state [:evidence :name])
         evidence-narrative-atom (cursor state [:evidence :narrative])
-        ]
+        visibility-atom (cursor state [:evidence :properties :hidden])]
     (reduce (fn [r evidence]
               (let [{:keys [narrative description name id url mtime ctime properties]} evidence
                     {:keys [resource_id resource_type mime_type hidden]} properties
@@ -418,7 +414,7 @@
                                       :data-target (str "#collapse" id)}
                              (t :badge/Save)]]
                            ]]])))
-              )[:div {:id "accordion" :class "panel-group evidence-list" :role "tablist" :aria-multiselectable "true"}] (:evidences data))))
+              )[:div {:id "accordion" :class "panel-group evidence-list" :role "tablist" :aria-multiselectable "true"}] @(cursor state [:badge-settings :evidences]))))

 (defn evidenceblock [data state init-data]
   [:div#badge-settings


fix init badges

fix init badges

--- src/cljs/salava/gallery/ui/badges.cljs
+++ src/cljs/salava/gallery/ui/badges.cljs
@@ -304,10 +304,13 @@
      :handler (fn [data]
                 (let [{:keys [badges badge_count]} data]
                   ;(value-helper state tags)
-                  (reset! (cursor state [:params :page_count]) 1)
-                  (swap! state assoc
-                         :badges badges
-                         :badge_count badge_count)))
+                  (if (empty? badges)
+                    (init-data (assoc params :country "all") state) ;;Recall init data with "all" countries if initial query returned empty coll
+                    (do
+                     (reset! (cursor state [:params :page_count]) 1)
+                     (swap! state assoc
+                           :badges badges
+                           :badge_count badge_count)))))
      :finally (fn []
                 (ajax-stop (cursor state [:ajax-message])))}))


Make the ratpack promise type play on the futura IPromise protocol.

--- src/clojure/catacumba/impl/helpers.clj
+++ src/clojure/catacumba/impl/helpers.clj
@@ -1,6 +1,9 @@
 (ns catacumba.impl.helpers
+  (:refer-clojure :exclusions [promise])
+  (:require [futura.promise :as p])
   (:import ratpack.func.Action
            ratpack.func.Function
+           ratpack.exec.Promise
            ratpack.handling.Context
            io.netty.buffer.Unpooled))

@@ -33,3 +36,10 @@
   String
   (bytebuffer [s]
     (Unpooled/wrappedBuffer (.getBytes s "UTF-8"))))
+
+(extend-protocol p/IPromise
+  ratpack.exec.Promise
+  (then* [this callback]
+    (.onYield ^Promise this ^Runnable callback))
+  (error* [this callback]
+    (.onError ^Promise this (action callback))))


Fixed concept-id look-up for cached collection.

--- src/cmr/opendap/components/concept.clj
+++ src/cmr/opendap/components/concept.clj
@@ -27,16 +27,18 @@
 (defn- -get-cached
   "This does the actual work for the cache lookup and fallback function call."
   [system concept-id lookup-fn lookup-args]
-  (log/trace "lookup-fn:" lookup-fn)
-  (log/trace "lookup-args:" lookup-args)
-  (try
-    (caching/lookup
-     system
-     (concept-key concept-id)
-     #(apply lookup-fn lookup-args))
-    (catch Exception e
-      (log/error e)
-      {:errors (errors/exception-data e)})))
+  (let [cache-key (concept-key concept-id)]
+    (log/trace "lookup-fn:" lookup-fn)
+    (log/trace "lookup-args:" lookup-args)
+    (log/trace "Cache key:" cache-key)
+    (try
+      (caching/lookup
+       system
+       cache-key
+       #(apply lookup-fn lookup-args))
+      (catch Exception e
+        (log/error e)
+        {:errors (errors/exception-data e)}))))

 (defn get-cached
   "Look up the concept for a concept-id in the cache; if there is a miss,
@@ -67,7 +69,7 @@
 (defmethod get :collection
   [_type system search-endpoint user-token params]
   (get-cached system
-              (:concept params)
+              (:collection-id params)
               collection/async-get-metadata
               [search-endpoint user-token params]))


Adding cap population depending on Biome

--- src/amindblowingworld/civs.clj
+++ src/amindblowingworld/civs.clj
@@ -62,6 +62,24 @@
 (defn update-tribe [tribe]
   (let [id (.id tribe)]
     (swap! game assoc-in [:tribes id] tribe)))
+
+(defn population-supported [pos]
+  (let [x (:x pos)
+        y (:y pos)
+        b (-> (get-world) .getBiome)
+        biome (.get b x y)]
+    (case (.name biome)
+      "OCEAN"        0
+      "ICELAND"      100
+      "TUNDRA"       200
+      "ALPINE"       200
+      "GLACIER"      0
+      "GRASSLAND"    5000
+      "ROCK_DESERT"  500
+      "SAND_DESERT"  300
+      "FOREST"       3000
+      "SAVANNA"      1500
+      "JUNGLE"       2500)))

 (defn calc-biome-map [world]
   (let [ w (-> world .getDimension .getWidth)
@@ -215,10 +233,19 @@
       (run-randomly (update-settlement-fun id-new-settlement) (* fastness 3) (* fastness 10)))
     (catch AssertionError e (println "assertion failed: " (.getMessage e)))))

+(defn events-for [id-settlement]
+  (let [s (get-settlement id-settlement)
+        events [:growing :shrinking :stable]
+        pop (.pop s)
+        too-much-pop (> pop (population-supported (.pos s)))]
+    (if too-much-pop [:shrinking :stable :shrinking :stable :growing]
+      [:growing :shrinking :stable])))
+
 (defn update-settlement-fun [id-settlement]
   (fn []
-    (let [s     (get-settlement id-settlement)
-          event (rand-nth [:growing :shrinking :stable])]
+    (let [s (get-settlement id-settlement)
+          events (events-for id-settlement)
+          event (rand-nth events)]
       (when (and s (not (ghost-town? s)))
         (when (= event :growing)
           (let [perc (+ 1.0 (/ (rand) 5.0))


remove redundant "they (♂)" and "they (♀)"

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2000,7 +2000,8 @@
     ]

    "they"
-   [{:english {:note "♂"}
+   [;; human
+    {:english {:note "♂"}
      :synsem {:cat :noun
               :pronoun true
               :case :nom
@@ -2011,6 +2012,7 @@
                     :human true
                     :pred :loro}
               :subcat '()}}
+    ;; non-human
     {:english {:note "♂"}
      :synsem {:cat :noun
               :pronoun true
@@ -2022,6 +2024,7 @@
                     :human false
                     :pred :loro}
               :subcat '()}}
+    ;; human
     {:english {:note "♀"}
      :synsem {:cat :noun
               :pronoun true
@@ -2033,52 +2036,9 @@
                     :human true
                    :pred :loro}
               :subcat '()}}
+    ;; non-human
     {:english {:note "♀"}
      :synsem {:cat :noun
-              :pronoun true
-              :case :nom
-              :agr {:person :3rd
-                    :gender :fem
-                    :number :plur}
-              :sem {:gender :fem
-                    :human false
-                    :pred :loro}
-              :subcat '()}}]
-
-   "they (♂)"
-   [{:synsem {:cat :noun
-              :pronoun true
-              :case :nom
-              :agr {:person :3rd
-                    :gender :masc
-                    :number :plur}
-              :sem {:gender :masc
-                    :human true
-                    :pred :loro}
-              :subcat '()}}
-    {:synsem {:cat :noun
-              :pronoun true
-              :case :nom
-              :agr {:person :3rd
-                    :gender :masc
-                    :number :plur}
-              :sem {:gender :masc
-                    :human false
-                    :pred :loro}
-              :subcat '()}}]
-
-   "they (♀)"
-   [{:synsem {:cat :noun
-              :pronoun true
-              :case :nom
-              :agr {:person :3rd
-                    :gender :fem
-                    :number :plur}
-              :sem {:gender :fem
-                    :human true
-                    :pred :loro}
-              :subcat '()}}
-    {:synsem {:cat :noun
               :pronoun true
               :case :nom
               :agr {:person :3rd


trying to use :share-sem with "chat"

trying to use :share-sem with "chat"

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -451,13 +451,18 @@
                         :english {:participle "chatting"
                                   :past "chatted"}}]
             [(unify common ;; intransitive
-                    {:synsem {:subcat {:2 '()}}})
-             (unify common ;; transitive "chatted with <human>"
-                    {:synsem {:subcat {:2 {:cat :prep
-                                           :sem {:obj {:human true}
-                                                 :pred :with}
-                                           :subcat '()}}}})])
+                    {:synsem {:subcat {:2 '()}
+                              :sem {:obj :unspec}}})
+            (unify common
+                   {:synsem {:subcat {:2 {:cat :prep}}
+                             :sem {:got-here :yes}}})

+   ;          (unify common ;; transitive "chatted with <human>"
+;                    {:share-sem :obj
+;                     :synsem {:subcat {:2 {:cat :prep
+;                                           :sem {:pred :with}}}}})
+             ])
+
    "charge" {:synsem {:cat :verb
                       :sem {:pred :caricare}}}

@@ -2233,6 +2238,7 @@
                   {:synsem {:cat :verb
                             :subcat {:2 {:cat :top}}}})

+                 ;; prevent :modal-with :infinitive matching unless it's already set
                  (default
                   {:modal-with false
                    :synsem {:cat :verb}})


add default rule concerning pronouns and reflexivity

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2217,7 +2217,10 @@
                  (default
                   {:synsem {:cat :verb
                             :subcat {:2 {:subcat '()}}}})
-
-                 ))))
-
-
+
+                 ;; A pronoun is either reflexive or not reflexive, but
+                 ;; a non-pronoun is never reflexive.
+                 (default
+                  {:synsem {:cat :noun
+                            :pronoun false
+                            :reflexive false}})))))


+her (accusative pronoun)

+her (accusative pronoun)

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -743,15 +743,21 @@
              :sem {:pred :aiutare
                    :activity true
                    :obj {:human true}}}}
-    "her"
-    (map #(unify %
-                 {:synsem {:cat :det
-                           :agr {:gender :fem}
-                           :sem {:pred :lei}
-                           :def :possessive}})
-         [{:synsem {:agr {:number :sing}}}
-          {:synsem {:agr {:number :plur}}}])
-
+   "her"
+   [{:synsem {:cat :det
+              :sem {:pred :lei}
+              :def :possessive}}
+
+    {:synsem {:cat :noun
+              :pronoun true
+              :case :acc
+              :reflexive false
+              :agr {:person :3rd
+                    :gender :fem
+                    :number :sing}
+              :sem {:human true}
+              :subcat '()}}]
+
    "herself"
    {:synsem {:cat :noun
              :pronoun true


+(default rule for :unspec)

+(default rule for :unspec)

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2297,6 +2297,13 @@
                                     :subcat {:2 {:cat :noun}}}}
                           {:synsem {:sem {:obj {:pred :top}}}})

+
+                 (default ;; intransitive verbs' :obj is :unspec.
+                  {:synsem {:cat :verb
+                            :subcat {:1 {:top :top}
+                                     :2 '()}
+                            :sem {:obj :unspec}}})
+
                  ;; make an intransitive version of every verb which has an
                  ;; [:sem :obj] path.
                  intransitivize


corrected present endings of 2nd conjugation

--- src/babel/latin/morphology.clj
+++ src/babel/latin/morphology.clj
@@ -9,31 +9,31 @@
                 :subcat {:1 {:agr {:number :sing
                                    :person :1st}}}}}}
   {:p [#"^(.)as$" "$1ēre"]
-   :g [#"^(.)eo$" "$1as"]
+   :g [#"^(.)eo$" "$1es"]
    :u {:synsem {:infl :present
                 :sem {:tense :present}
                 :subcat {:1 {:agr {:number :sing
                                    :person :2nd}}}}}}
   {:p [#"^(.)at$" "$1ēre"]
-   :g [#"^(.)eo$" "$1at"]
+   :g [#"^(.)eo$" "$1et"]
    :u {:synsem {:infl :present
                 :sem {:tense :present}
                 :subcat {:1 {:agr {:number :sing
                                    :person :3rd}}}}}}
   {:p [#"^(.)amus$" "$1ēre"]
-   :g [#"^(.)eo$" "$1amus"]
+   :g [#"^(.)eo$" "$1emus"]
    :u {:synsem {:infl :present
                 :sem {:tense :present}
                 :subcat {:1 {:agr {:number :plur
                                    :person :1st}}}}}}
   {:p [#"^(.)atis$" "$1ēre"]
-   :g [#"^(.)eo$" "$1atis"]
+   :g [#"^(.)eo$" "$1etis"]
    :u {:synsem {:infl :present
                 :sem {:tense :present}
                 :subcat {:1 {:agr {:number :plur
                                    :person :2nd}}}}}}
   {:p [#"^(.)ant$" "$1ēre"]
-   :g [#"^(.)eo$" "$1ant"]
+   :g [#"^(.)eo$" "$1ent"]
    :u {:synsem {:infl :present
                 :sem {:tense :present}
                 :subcat {:1 {:agr {:number :plur


incorporated Franco's imperfect and future additions

--- src/babel/latin/morphology.clj
+++ src/babel/latin/morphology.clj
@@ -2,11 +2,12 @@

 ;; Present indicative
 ;; https://en.wikipedia.org/wiki/Latin_conjugation#Present_indicative
+(def present {:synsem {:sem {:tense :present}}})
+
 (def are-present-indicative
   (conjugation
    {:infinitive "āre"
-    :common {:synsem {:infl :present
-                      :sem {:tense :present}}}
+    :common present
     :forms
     [["o"
       {:synsem {:sem {:subj {:pred :I}}}}]
@@ -29,8 +30,7 @@
 (def ere-bar-present-indicative
   (conjugation
    {:infinitive "ēre"
-    :common {:synsem {:infl :present
-                      :sem {:tense :present}}}
+    :common present
     :forms
     [["eo"
       {:synsem {:sem {:subj {:pred :I}}}}]
@@ -53,8 +53,7 @@
 (def ere-present-indicative
   (conjugation
    {:infinitive "ere"
-    :common {:synsem {:infl :present
-                      :sem {:tense :present}}}
+    :common present
     :forms
     [["o"
       {:synsem {:sem {:subj {:pred :I}}}}]
@@ -74,13 +73,10 @@
      ["unt"
       {:synsem {:sem {:subj {:pred :loro}}}}]]}))

-
-
-(def ere-present-indicative
-  (conjugation
-   {:infinitive "ere-i"
-    :common {:synsem {:infl :present
-                      :sem {:tense :present}}}
+(def ere-i-present-indicative
+  (conjugation
+   {:infinitive "ere-i" ;; FIXME: use {:conjugation :3i}
+    :common present
     :forms
     [["io"
       {:synsem {:sem {:subj {:pred :I}}}}]
@@ -100,15 +96,10 @@
      ["iunt"
       {:synsem {:sem {:subj {:pred :loro}}}}]]}))

-
-
-
-
 (def ire-present-indicative
   (conjugation
    {:infinitive "īre"
-    :common {:synsem {:infl :present
-                      :sem {:tense :present}}}
+    :common present
     :forms
     [["o"
       {:synsem {:sem {:subj {:pred :I}}}}]
@@ -126,20 +117,260 @@
       {:synsem {:sem {:subj {:pred :voi}}}}]

      ["unt"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+;;IMPERFECT BEGINS HERE
+(def imperfect {:synsem {:sem {:tense :past
+                               :aspect :progressive}}})
+
+(def are-imperfect-indicative
+  (conjugation
+   {:infinitive "āre"
+    :common imperfect
+    :forms
+    [["abam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["abas"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["abat"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["abamus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["abatis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["abant"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def ere-bar-imperfect-indicative
+  (conjugation
+   {:infinitive "ēre"
+    :common imperfect
+    :forms
+    [["ebam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["ebas"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["ebat"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["ebamus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["ebatis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["ebant"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def ere-imperfect-indicative
+  (conjugation
+   {:infinitive "ere"
+    :common imperfect
+    :forms
+    [["ebam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["ebas"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["ebat"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["ebamus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["ebatis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["ebant"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def ere-i-imperfect-indicative
+  (conjugation
+   {:infinitive "ere-i" ;; FIXME: use {:conjugation :3i}
+    :common imperfect
+    :forms
+    [["iebam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["iebas"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["iebat"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["iebamus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["iebatis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["iebant"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def ire-imperfect-indicative
+  (conjugation
+   {:infinitive "īre"
+    :common imperfect
+    :forms
+    [["iebam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["iebas"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["iebat"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["iebamus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["iebatis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["iebant"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+;;FUTURE BEGINS HERE
+
+(def future {:synsem {:sem {:tense :future}}})
+
+(def are-future-indicative
+  (conjugation
+   {:infinitive "āre"
+    :common future
+    :forms
+    [["abo"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["abis"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["abit"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["abimus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["abitis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["abunt"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def ere-bar-future-indicative
+  (conjugation
+   {:infinitive "ēre"
+    :common future
+    :forms
+    [["ebo"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["ebis"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["ebit"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["ebimus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["ebitis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["ebunt"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def ere-future-indicative
+  (conjugation
+   {:infinitive "ere"
+    :common future
+    :forms
+    [["am"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["es"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["et"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["emus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["etis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["ent"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def ere-i-future-indicative
+  (conjugation
+   {:infinitive "ere-i" ;; FIXME: use {:conjugation :3i}
+    :common future
+    :forms
+    [["iam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["ies"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["iet"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["iemus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["ietis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["ient"
+      {:synsem {:sem {:subj {:pred :loro}}}}]]}))
+
+(def ire-future-indicative
+  (conjugation
+   {:infinitive "īre"
+    :common future
+    :forms
+    [["iam"
+      {:synsem {:sem {:subj {:pred :I}}}}]
+
+     ["ies"
+      {:synsem {:sem {:subj {:pred :tu}}}}]
+
+     ["iet"
+      {:synsem {:sem {:subj {:pred :lui}}}}]
+
+     ["iemus"
+      {:synsem {:sem {:subj {:pred :noi}}}}]
+
+     ["ietis"
+      {:synsem {:sem {:subj {:pred :voi}}}}]
+
+     ["ient"
       {:synsem {:sem {:subj {:pred :loro}}}}]]}))

 (def replace-patterns (concat are-present-indicative
                               ere-bar-present-indicative
                               ere-present-indicative
-                              ire-present-indicative))
-
-
-
-
-
-
-
-
+                              ire-present-indicative
+
+                              are-imperfect-indicative
+                              ere-bar-imperfect-indicative
+                              ere-imperfect-indicative
+                              ire-imperfect-indicative
+
+                              are-future-indicative
+                              ere-bar-future-indicative
+                              ere-future-indicative
+                              ire-future-indicative))

 (defn analyze [surface-form lexicon]
   (morph/analyze surface-form lexicon replace-patterns))


Add function wpml/table-style

Add function wpml/table-style

--- src/bakyeono/litedocx/wpml.clj
+++ src/bakyeono/litedocx/wpml.clj
@@ -393,6 +393,113 @@
              (ppr options))
            (when (or font font-size font-color bold? italic? underline?)
              (rpr options)))
+     (when font
+       ;; Font Style Definition for above Paragraph Style
+       (node :w:style {:w:type "character" ; Style Type
+                       :w:styleId font-style-name ; Style ID
+                       :w:customStyle "true"} ; User-Defined Style
+             (node :w:name {:w:val font-style-name}) ; Primary Style Name
+             (node :w:basedOn {:w:val "a0"}) ; Parent Style ID
+             (rpr options)))]))
+
+(defn table-style
+  "Returns w:style tag for table style with w:style tag for the font,
+  as a vector containing both of them.
+
+  Parameters:
+  - name: <string> Used as index. Must be unique.
+  - & options: option, value, ...
+
+  Examples:
+  - (table-style \"table1\")
+  - (table-style \"table2\" :font \"Arial\" :font-color \"0000AA\" :align \"both\")
+
+  See More: "
+  [name
+   & {:as options
+      :keys [font font-size font-color
+             bold? italics? underline? strike?
+             word-wrap?
+             align
+             space-before space-after space-line
+             indent-left indent-right indent-first-line mirror-indents?
+             cell-margin-top cell-margin-bottom cell-margin-left cell-margin-right
+             cell-h-align cell-v-align]}]
+  (let [font-style-name (str "character-style-of-" name)]
+    [;; Table Style Definition
+     (node :w:style {:w:type "table" ; Style Type
+                     :w:styleId name ; Style ID
+                     :w:customStyle "true"} ; User-Defined Style
+           (node :w:name {:w:val name}) ; Primary Style Name
+           (node :w:basedOn {:w:val "a"}) ; Parent Style ID
+           (when font
+             (node :w:link {:w:val font-style-name})) ; Linked Style Reference
+           (node :w:qFormat) ; Primary Style
+           (when (or word-wrap? align
+                     space-before space-after space-line
+                     indent-left indent-right indent-first-line mirror-indents?)
+             (ppr options))
+           (when (or font font-size font-color bold? italic? underline?)
+             (rpr options))
+           ;; Style Table Properties
+           (node :w:tblPr {}
+                 ;; Number of Rows in Row Band
+                 (node :w:tblStyleRowBandSize {:w:val 1})
+                 ;; Table Alignment
+                 (node :w:jc {:w:val "both"})
+                 ;; Table Indent from Leading Margin
+                 (node :w:tblInd {:w:val 0
+                                  :w:type "dxa"})
+                 ;; Table Borders
+                 (node :w:tblBorders {}
+                       (node :w:top {:w:val "single" ; Border Style
+                                     :w:color "auto" ; Border Color
+                                     :w:sz "4" ; Border Width
+                                     :w:space "0"}) ; Border Spacing Measurement
+                       (node :w:left {:w:val "single" ; Border Style
+                                      :w:color "auto" ; Border Color
+                                      :w:sz "4" ; Border Width
+                                      :w:space "0"}) ; Border Spacing Measurement
+                       (node :w:bottom {:w:val "single" ; Border Style
+                                        :w:color "auto" ; Border Color
+                                        :w:sz "4" ; Border Width
+                                        :w:space "0"}) ; Border Spacing Measurement
+                       (node :w:right {:w:val "single" ; Border Style
+                                       :w:color "auto" ; Border Color
+                                       :w:sz "4" ; Border Width
+                                       :w:space "0"}) ; Border Spacing Measurement
+                       (node :w:insideH {:w:val "single" ; Border Style
+                                         :w:color "auto" ; Border Color
+                                         :w:sz "4" ; Border Width
+                                         :w:space "0"}) ; Border Spacing Measurement
+                       (node :w:insideV {:w:val "single" ; Border Style
+                                         :w:color "auto" ; Border Color
+                                         :w:sz "4" ; Border Width
+                                         :w:space "0"})) ; Border Spacing Measurement
+                 ;; Table Cell Margin
+                 (node :w:tblCellMar {}
+                       (node :w:top {:w:w cell-margin-top
+                                     :w:type "dxa"})
+                       (node :w:left {:w:w cell-margin-left
+                                      :w:type "dxa"})
+                       (node :w:bottom {:w:w cell-margin-bottom
+                                        :w:type "dxa"})
+                       (node :w:right {:w:w cell-margin-right
+                                       :w:type "dxa"})))
+           ;; Table Row Properties
+           (node :w:trPr {}
+                 ;; Table Row Alignment
+                 (node :w:jc {:w:val cell-h-align}))
+           ;; Table Cell Properties
+           (node :w:tcPr {}
+                 ;; Table Cell Vertical Alignment
+                 (node :w:vAlign {:w:val cell-v-align}))
+           ;; First Row Formatting Properties
+           (node :w:tblStylePr {:w:type "firstRow"})
+           ;; Band 1 Horizontal Formatting Properties
+           (node :w:tblStylePr {:w:type "band1Horz"})
+           ;; Band 2 Horizontal Formatting Properties
+           (node :w:tblStylePr {:w:type "band2Horz"}))
      (when font
        ;; Font Style Definition for above Paragraph Style
        (node :w:style {:w:type "character" ; Style Type


Correct comic->url-format description

Correct comic->url-format description

--- src/clj/comic_reader/sites.clj
+++ src/clj/comic_reader/sites.clj
@@ -55,7 +55,7 @@
   (:manga-url-suffix-pattern options))

 (defn comic->url-format
-  "A format string that when used to format the root URL and a comic
+  "A format string that when used to format the manga URL and a comic
   id will produce the URL of a comics chapter page."
   []
   (:comic->url-format options))


Abstracted out two big functions, finally.

--- src/clj/elephantdb/service.clj
+++ src/clj/elephantdb/service.clj
@@ -77,69 +77,62 @@
     (when-let [e @error]
       (throw e))))

+(defn try-thrift
+  [domains-info local-dir initial-status func]
+  (with-ret (p-dofor [[domain info] domains-info]
+                     (try (domain/set-domain-status! info initial-status)
+                          (func domain info)
+                          (domain/set-domain-status! info (thrift/ready-status))
+                          (catch Throwable t
+                            (log-error t "Error when loading domain " domain)
+                            (domain/set-domain-status! info (thrift/failed-status t)))))
+    (try (log-message "Removing all old versions of updated domains!")
+         (cleanup-domains! (keys domains-info) local-dir)
+         (catch Throwable t
+           (log-error t "Error when cleaning old versions.")))))
+
 (defn load-and-sync-status!
-  "TODO: Only note success for non-failed domains. check thrift status."
   [edb-config rw-lock domains-info loader-state]
   (let [{:keys [hdfs-conf local-dir local-db-conf]} edb-config
-        remote-fs (filesystem hdfs-conf)
         remote-path-map (:domains edb-config)
-        status (thrift/ready-status :loading? true)
-        domain-names (keys domains-info)
-        loaders (p-dofor [[domain info] domains-info]
-                         (try (domain/set-domain-status! info status)
-                              (let [remote-path (get remote-path-map domain)
-                                    remote-vs (DomainStore. remote-fs remote-path)
-                                    local-domain-root (str (path local-dir domain))
-                                    local-vs (mk-local-vs remote-vs local-domain-root)]
-                                (if (domain-needs-update? local-vs remote-vs)
-                                  (->> (load-domain domain
-                                                    remote-fs
-                                                    local-db-conf
-                                                    local-domain-root
-                                                    remote-path
-                                                    loader-state)
-                                       (domain/set-domain-data! rw-lock domain info))
-                                  (let [{:keys [finished-loaders shard-states]} loader-state]
-                                    (swap! finished-loaders + (count (shard-states domain))))))
-                              (domain/set-domain-status! info (thrift/ready-status))
-                              (catch Throwable t
-                                (log-error t "Error when loading domain " domain)
-                                (domain/set-domain-status! info (thrift/failed-status t)))))]
-    (with-ret loaders
-      (try (log-message "Removing all old versions of updated domains!")
-           (cleanup-domains! domain-names local-dir)
-           (catch Throwable t
-             (log-error t "Error when cleaning old versions.")))
-      (log-message "Successfully loaded domains: " (s/join ", " domain-names)))))
+        remote-fs (filesystem hdfs-conf)]
+    (try-thrift domains-info
+                local-dir
+                (thrift/ready-status :loading? true)
+                (fn [domain info]
+                  (let [remote-path (get remote-path-map domain)
+                        remote-vs (DomainStore. remote-fs remote-path)
+                        local-domain-root (str (path local-dir domain))
+                        local-vs (mk-local-vs remote-vs local-domain-root)]
+                    (if (domain-needs-update? local-vs remote-vs)
+                      (->> (load-domain domain
+                                        remote-fs
+                                        local-db-conf
+                                        local-domain-root
+                                        remote-path
+                                        loader-state)
+                           (domain/set-domain-data! rw-lock domain info))
+                      (let [{:keys [finished-loaders shard-states]} loader-state]
+                        (swap! finished-loaders + (count (shard-states domain))))))))))

 (defn load-cached-domains!
   [edb-config rw-lock domains-info]
   (let [{:keys [hdfs-conf local-dir local-db-conf]} edb-config
         remote-path-map (:domains edb-config)
-        remote-fs (filesystem hdfs-conf)
-        status (thrift/loading-status)
-        domain-names (keys domains-info)
-        loaders (p-dofor [[domain info] domains-info]
-                         (try (domain/set-domain-status! info status)
-                              (let [remote-path  (get remote-path-map domain)
-                                    remote-vs (DomainStore. remote-fs remote-path)
-                                    local-domain-root (str (path local-dir domain))
-                                    local-vs (mk-local-vs remote-vs local-domain-root)]
-                                (when-let [new-data (and (domain-has-data? local-vs)
-                                                         (open-domain local-db-conf
-                                                                      local-domain-root
-                                                                      (domain/host-shards info)))]
-                                  (domain/set-domain-data! rw-lock domain info new-data)))
-                              (domain/set-domain-status! info (thrift/ready-status))
-                              (catch Throwable t
-                                (log-error t "Error when loading domain " domain)
-                                (domain/set-domain-status! info (thrift/failed-status t)))))]
-    (with-ret loaders
-      (try (log-message "Removing all old versions of updated domains!")
-           (cleanup-domains! domain-names local-dir)
-           (catch Throwable t
-             (log-error t "Error when cleaning old versions.")))
-      (log-message "Successfully loaded cached domains: " (s/join ", " domain-names)))))
+        remote-fs (filesystem hdfs-conf)]
+    (try-thrift domains-info
+                local-dir
+                (thrift/loading-status)
+                (fn [domain info]
+                  (let [remote-path  (get remote-path-map domain)
+                        remote-vs (DomainStore. remote-fs remote-path)
+                        local-path (str (path local-dir domain))
+                        local-vs (mk-local-vs remote-vs local-path)]
+                    (when-let [new-data (and (domain-has-data? local-vs)
+                                             (open-domain local-db-conf
+                                                          local-path
+                                                          (domain/host-shards info)))]
+                      (domain/set-domain-data! rw-lock domain info new-data)))))))

 (defn purge-unused-domains!
   "Walks through the supplied local directory, recursively deleting
@@ -163,8 +156,9 @@
       (future
         (try (purge-unused-domains! domain-seq local-dir)
              (load-cached-domains! edb-config rw-lock domains-info)
-             (load-and-sync-status! edb-config rw-lock domains-info (map-mapvals domains-info
-                                                                                domain/host-shards))
+             (load-and-sync-status! edb-config rw-lock domains-info (->> domain/host-shards
+                                                                         (map-mapvals domains-info)
+                                                                         (mk-loader-state)))
              (log-message "Finished loading all updated domains from remote.")
              (catch Throwable t
                (log-error t "Error when syncing data.")
@@ -212,7 +206,7 @@
       (try (load-and-sync-status! edb-config
                                   rw-lock
                                   domains-info
-                                  :state download-state)
+                                  download-state)
            (log-message "Finished updating all domains from remote.")
            (catch Throwable t
              (log-error t "Error when syncing data"))))))


implement Improved Tracers

implement Improved Tracers

--- src/clj/game/cards-agendas.clj
+++ src/clj/game/cards-agendas.clj
@@ -188,6 +188,10 @@
     :abilities [{:counter-cost 1 :msg "do 1 net damage" :req (req (:run @state)) :once :per-run
                  :effect (effect (damage :net 1 {:card card}))}]}

+   "Improved Tracers"
+   {:events {:pre-ice-strength {:req (req (has? target :subtype "Tracer"))
+                                :effect (effect (ice-strength-bonus 1))}}}
+
    "Labyrinthine Servers"
    {:data {:counter 2}
     :abilities [{:counter-cost 1 :effect (effect (prevent-jack-out))


Working add-user endpoint

Working add-user endpoint

--- src/clj/traveler/api/users.clj
+++ src/clj/traveler/api/users.clj
@@ -1,6 +1,8 @@
 (ns traveler.api.users
   (:require [traveler.api.api :refer [gen-response]]
+            [traveler.datomic.utils :refer [user->db]]
             [traveler.utils :refer [get-param]]
+            [clojure.walk :refer [keywordize-keys]]
             [valip.core :refer [validate]]
             [valip.predicates :refer [digits? email-address? present?]]))

@@ -29,26 +31,14 @@
     [:lastname present? "must be present"]
     [:firstname present? "must be present"]
     [:email present? "must be present"]
-    [:email email-address? "must be a valid email address"]
     [:policies-assent-date present? "must be present"]))
-
-;;testing
-
-#_
-(def user {:id-sk "00392"
-           :username "mgeorge"
-           :password "kaj309jdfna0sd9flk4nas2"
-           :privilege "ADMIN"
-           :lastname "George"
-           :firstname "Michael"
-           :email "mgeorge@vlacs.org"
-           :policies-assent-date "2001-03-02"
-           })
-
-
-;;end testing

 (defn add-user
   "Public facing add-user endpoint"
   [ctx]
-  (gen-response "This endpoint is not implemented yet!"))
+  (let [user (keywordize-keys (get-in ctx [:request :params]))]
+    (if (nil? (validate-add-user user))
+      (do
+        (user->db user)
+        (gen-response))
+      (gen-response (validate-add-user user)))))


Finish fixing issue #47.  Use updated browse-url implementation in bdoc* by wrapping it in with-redefs

--- src/clj_ns_browser/browser.clj
+++ src/clj_ns_browser/browser.clj
@@ -1008,7 +1008,8 @@
                 (when-let [url (clojuredocs-url fqn)]
                   (clj-ns-browser.web/browse-url url))

-                (bdoc* fqn))))))))
+                (with-redefs [clojure.java.browse/browse-url clj-ns-browser.web/browse-url]
+                  (bdoc* fqn)))))))))
     ;;
     ;; edit-btn pressed =>
     ;; if we find a local file (not inside jar), then send to $EDITOR.


Refine draft of the economic model.

Refine draft of the economic model.

--- src/cljs/beatha/automaton.cljs
+++ src/cljs/beatha/automaton.cljs
@@ -1,6 +1,7 @@
 (ns beatha.automaton
   (:require-macros [cljs.core.async.macros :refer [go]])
-  (:require [cljs.core.async :refer [put! <!]]))
+  (:require [cljs.core.async :refer [put! <!]]
+            [clojure.set :as set]))

 (defprotocol AutomatonSpecification
   "Describes basic interactions with particular set of cellular automata
@@ -188,48 +189,59 @@
                       (merge {:s 0 :f 0})))))))

 (def labour-market-model
-  (reify
-    AutomatonSpecification
-    (default-cell [_] {:state :worker})
-    (next-initial-state [_ state]
-      (or ({:worker :corp-1 :corp-1 :corp-2 :corp-2 :corp-3
-            :corp-3 :corp-4 :corp-4 :worker} state) :worker))
-    (next-grid [this grid]
-      (transition
-       this grid
-       (fn [this width height cells x y]
-         (let [get-cell (partial get-cell this cells)
-               n-states (ordered-neighbour-states get-cell width height x y)
-               {:keys [top-left top top-right left right
-                       bottom-left bottom bottom-right]} n-states
-               counted-neigh-states
-                 (into {:worker 0 :corp-1 0 :corp-2 0 :corp-3 0 :corp-4 0}
-                       (map (fn [[k v]] [k (count v)])
-                            (group-by identity (vals n-states))))
-
-               {:keys [worker corp-1 corp-2 corp-3 corp-4]}
-               counted-neigh-states
-
-               cell (get-cell [x y])
-               s (:state cell)]
-           {[x y]
-            {:state
-             (cond
-              (= 0 corp-1 corp-2 corp-3 corp-4)                      s
-              (and (= :worker s) (every? true? [(> corp-1 corp-2)
-                                                (> corp-1 corp-3)
-                                                (> corp-1 corp-4)])) :worker-1
-              (and (= :worker s) (every? true? [(> corp-2 corp-1)
-                                                (> corp-2 corp-3)
-                                                (> corp-2 corp-4)])) :worker-2
-              (and (= :worker s) (every? true? [(> corp-3 corp-2)
-                                                (> corp-3 corp-1)
-                                                (> corp-3 corp-4)])) :worker-3
-              (and (= :worker s) (every? true? [(> corp-4 corp-2)
-                                                (> corp-4 corp-3)
-                                                (> corp-4 corp-1)])) :worker-4
-              :else                                                  s)}}))))
-
-    InformationChannelsSpecification
-    (process-info-channel [this ic])
-    (fill-output-info-channel [this grid oc])))
+  (let [state (atom {:government {:help 10}
+                     :job-offer-chance 0.2
+                     :productivity {:corp-1 (+ 15 (rand 10))
+                                    :corp-2 (+ 15 (rand 10))
+                                    :corp-3 (+ 15 (rand 10))
+                                    :corp-4 (+ 15 (rand 10))}})
+
+        wage (fn [state c] (if (contains? (:productivity state) c)
+                            (/ ((:productivity state) c) 1.5)
+                            (get-in state [:government :help])))
+        company-worker {:corp-1 :worker-1 :corp-2 :worker-2
+                        :corp-3 :worker-3 :corp-4 :worker-4}
+        worker? #((into #{:worker} (vals company-worker)) %)
+        company-of-worker (fn [s] (or ((set/map-invert company-worker) s) s))
+        worker-of-company (fn [s] (or (company-worker s) s))]
+    (reify
+      AutomatonSpecification
+      (default-cell [_] {:state :worker})
+      (next-initial-state [_ state]
+        (or ({:worker :corp-1 :corp-1 :corp-2 :corp-2 :corp-3
+              :corp-3 :corp-4 :corp-4 :worker} state) :worker))
+      (next-grid [this grid]
+        (transition
+         this grid
+         (fn [this width height cells x y]
+           (let [state @state
+                 get-cell (partial get-cell this cells)
+                 n-states
+                 (ordered-neighbour-states get-cell width height x y)
+
+                 {:keys [top-left top top-right left right
+                         bottom-left bottom bottom-right]}
+                 n-states
+
+                 cell (get-cell [x y])
+                 s (:state cell)
+                 current-wage (wage state (company-of-worker s))]
+             {[x y]
+              {:state (if-not (worker? s)
+                        s
+                        (->> (vals n-states)
+                             (map company-of-worker)
+                             (filter #(not (#{(company-of-worker s)} %)))
+                             (into #{})
+                             (filter #(<= (rand) (:job-offer-chance state)))
+                             (map (fn [o] [o (wage state o)]))
+                             (reduce (fn [[b-s b-w] [c-s c-w]]
+                                       (if (>= c-w b-w)
+                                         [(worker-of-company c-s) c-w]
+                                         [b-s b-w]))
+                                     [s current-wage])
+                             first))}}))))
+
+      InformationChannelsSpecification
+      (process-info-channel [this ic])
+      (fill-output-info-channel [this grid oc]))))


Fix so that click channel is properly initialized in board, rather than a new one being created on every render. Means you can now click on the same square more than once and it doesn't just get lost in the ether

--- src/cljs/chess/components.cljs
+++ src/cljs/chess/components.cljs
@@ -1,5 +1,5 @@
 (ns chess.components
-  (:require-macros [cljs.core.async.macros :refer [go]])
+  (:require-macros [cljs.core.async.macros :refer [go-loop]])
   (:require [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
             [chess.board :as b]
@@ -22,38 +22,41 @@
     (render [_]
       (dom/div
        #js {:className (str "square" (if selected " selected"))
-            :id id
-            :onClick #(put! click-chan id)}
+            :id        id
+            :onClick   #(put! click-chan id)}
        (if p
          (om/build piece p))))))

 (defn board [{:keys [board] :as app-state} owner]
-  (let [click-chan (chan)]
-    (reify
-      om/IRenderState
-      (render-state [this state]
-        (let [selected (state :selected)]
-          (apply dom/div #js {:className "board"}
-                 (map
-                  (fn
-                    [r]
-                    (apply dom/div #js {:className "row"}
-                           (om/build-all square r {:opts {:click-chan click-chan}})))
-                  (->> board
-                       b/squares-and-pieces
-                       (map (fn [[s p]] [s p (= s selected)]))
-                       b/as-rows)))))
-      om/IDidMount
-      (did-mount [_]
-        (go (while true
-              (let [new-selection (<! click-chan)
-                    old-selection (om/get-state owner :selected)]
-                (if old-selection
-                  (do
-                    (om/transact! app-state :board (fn [b]
-                                                     (b/move b
-                                                                 old-selection
-                                                                 new-selection)))
-                    (om/set-state! owner :selected nil))
-                  (if (b/in (deref board) new-selection)
-                    (om/set-state! owner :selected new-selection))))))))))
+  (reify
+    om/IInitState
+    (init-state [_]
+      {:click-chan (chan)})
+    om/IRenderState
+    (render-state [this {click-chan :click-chan selected :selected}]
+      (apply dom/div #js {:className "board"}
+             (map
+               (fn
+                 [r]
+                 (apply dom/div #js {:className "row"}
+                        (om/build-all square r {:opts {:click-chan click-chan}})))
+               (->> board
+                    b/squares-and-pieces
+                    (map (fn [[s p]] [s p (= s selected)]))
+                    b/as-rows))))
+    om/IDidMount
+    (did-mount [_]
+      (let [click-chan (om/get-state owner :click-chan)]
+        (go-loop []
+          (let [new-selection (<! click-chan)
+                old-selection (om/get-state owner :selected)]
+            (if old-selection
+              (do
+                (om/transact! app-state :board (fn [b]
+                                                 (b/move b
+                                                         old-selection
+                                                         new-selection)))
+                (om/set-state! owner :selected nil))
+              (if (b/in (deref board) new-selection)
+                (om/set-state! owner :selected new-selection))))
+          (recur))))))


#5 navbar

#5 navbar

--- src/kalar_plugins/templates/hiccup.clj
+++ src/kalar_plugins/templates/hiccup.clj
@@ -69,27 +69,36 @@
   `(def hiccup#
      (reify HiccupPlugin
        (hiccup-compile [this]
-         (let [parts# (partition-all ~num-perpage (.listFiles (io/file ~dir)))
+         (let [
+               splited-url-ptn# (string/split ~tail-url-ptn  #":num")
+               get-url# (fn [num#] (if (= num# 1) ~head-url
+                                                  (str (first splited-url-ptn#) num# (nth splited-url-ptn# 1))))
+               create-neighbor-page-url# (fn [num# total#]
+                                          (cond
+                                            (= num# 1) {:previous-page nil :next-page (if (> total# 1) (get-url# 2))}
+                                            true {:previous-page (if (= num# 1) ~head-url (get-url# (- num# 1)))
+                                                  :next-page (if (= total# num#) nil (get-url# (+ num# 1)))}))
+               parts# (partition-all ~num-perpage (.listFiles (io/file ~dir)))
                index-abst-map# (zipmap (range 1 (+ 1 (count parts#))) parts#)
                first-abst# (first index-abst-map#)
-               rest-absts# (rest index-abst-map#)]
+               rest-absts# (rest index-abst-map#)
+               total# (count index-abst-map#)]
            (let [~'page_
-                 (merge
-                   {:posts (map #(load-md-excerpt (.getAbsolutePath %)) (val first-abst#))}
-                   {:index (key first-abst#)})
+                 (merge {:posts (map #(load-md-excerpt (.getAbsolutePath %)) (val first-abst#))}
+                        (create-neighbor-page-url# 1 total#))
                  output# (io/file (kfile/find-dest) ~head-url)]
              (kfile/touch output#)
              (spit output# ~body))
            (dorun
              (for [posts-per-page# rest-absts#]
                (let [~'page_ (merge {:posts (map #(load-md-excerpt (.getAbsolutePath %)) (val posts-per-page#))}
-                                 {:index (key first-abst#)})
+                                    (create-neighbor-page-url# (key posts-per-page#) total#))
                      output# (io/file (kfile/find-dest)
-                                      (string/replace ~tail-url-ptn #":id" (str (key posts-per-page#))))]
+                                      (string/replace ~tail-url-ptn #":num" (str (key posts-per-page#))))]
+                 (println ~'page_)
                  (kfile/touch output#)
                  (spit output# ~body))
-               ))
-           )))))
+               )))))))

 (defmacro def-page [dir body]
   `(def hiccup#


Make test and clean consistent with the other commands

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -173,6 +173,14 @@
     (leiningen.droid/droid project-map "release")
     (leiningen.uberjar/uberjar project-map)))

+(defn test-project-task
+  [path project-map]
+  (leiningen.test/test project-map))
+
+(defn clean-project-task
+  [path project-map]
+  (leiningen.clean/clean project-map))
+
 ; high-level commands

 (defn run-project
@@ -207,22 +215,20 @@
   [process thread in out path]
   (stop-process process)
   (stop-thread thread)
-  (->> (let [project-map (read-project-clj path)]
-         (println (utils/get-string :testing))
-         (leiningen.test/test project-map)
-         (when (:cljsbuild project-map)
-           (leiningen.cljsbuild/cljsbuild project-map "test")))
+  (->> (do (println (utils/get-string :testing))
+         (if (is-clojurescript-project? path)
+           (start-slow-process process path "test")
+           (start-fast-process process path test-project-task)))
        (start-thread thread in out)))

 (defn clean-project
   [process thread in out path]
   (stop-process process)
   (stop-thread thread)
-  (->> (let [project-map (read-project-clj path)]
-         (println (utils/get-string :cleaning))
-         (leiningen.clean/clean project-map)
-         (when (:cljsbuild project-map)
-           (leiningen.cljsbuild/cljsbuild project-map "clean")))
+  (->> (do (println (utils/get-string :cleaning))
+         (if (is-clojurescript-project? path)
+           (start-slow-process process path "clean")
+           (start-fast-process process path clean-project-task)))
        (start-thread thread in out)))

 (defn new-project
@@ -265,8 +271,10 @@
         project-map (leiningen.core.project/init-project
                       (read-project-clj path))]
     (case cmd
+      "build" (build-project-task path project-map)
+      "clean" (clean-project-task path project-map)
+      "repl" (run-repl-project-task path project-map)
       "run" (run-project-task path project-map)
-      "repl" (run-repl-project-task path project-map)
-      "build" (build-project-task path project-map)
+      "test" (test-project-task path project-map)
       nil))
   (System/exit 0))


Add bangs to start-thread

Add bangs to start-thread

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -154,7 +154,7 @@
             leiningen.core.main/*exit-process?* false]
     (func)))

-(defn start-thread*
+(defn start-thread!*
   [in out func]
   (->> (fn []
          (try (func)
@@ -166,9 +166,9 @@
        Thread.
        .start))

-(defmacro start-thread
+(defmacro start-thread!
   [in out & body]
-  `(start-thread* ~in ~out (fn [] ~@body)))
+  `(start-thread!* ~in ~out (fn [] ~@body)))

 (defn start-process!
   [process path & args]
@@ -316,7 +316,7 @@
          (if (should-run-directly? path)
            (start-process-directly! process path run-project-task)
            (start-process-indirectly! process path class-name "run")))
-       (start-thread in out)))
+       (start-thread! in out)))

 (defn run-repl-project!
   [process in out path]
@@ -325,7 +325,7 @@
          (if (should-run-directly? path)
            (start-process-directly! process path run-repl-project-task)
            (start-process-indirectly! process path class-name "repl")))
-       (start-thread in out)))
+       (start-thread! in out)))

 (defn build-project!
   [process in out path]
@@ -334,7 +334,7 @@
          (if (should-run-directly? path)
            (start-process-directly! process path build-project-task)
            (start-process-indirectly! process path class-name "build")))
-       (start-thread in out)))
+       (start-thread! in out)))

 (defn test-project!
   [process in out path]
@@ -343,7 +343,7 @@
          (if (should-run-directly? path)
            (start-process-directly! process path test-project-task)
            (start-process-indirectly! process path class-name "test")))
-       (start-thread in out)))
+       (start-thread! in out)))

 (defn clean-project!
   [process in out path]
@@ -352,21 +352,21 @@
          (if (should-run-directly? path)
            (start-process-directly! process path clean-project-task)
            (start-process-indirectly! process path class-name "clean")))
-       (start-thread in out)))
+       (start-thread! in out)))

 (defn cljsbuild-project!
   [process in out path]
   (->> (if (should-run-directly? path)
          (start-process-directly! process path cljsbuild-project-task)
          (start-process-indirectly! process path class-name "cljsbuild"))
-       (start-thread in out)))
+       (start-thread! in out)))

 (defn check-versions-in-project!
   [process in out path]
   (stop-process! process)
   (->> (do (println (utils/get-string :checking_versions))
          (start-process-directly! process path check-versions-in-project-task))
-       (start-thread in out)))
+       (start-thread! in out)))

 (defn new-project!
   [in out parent-path project-type project-name package-name]
@@ -387,7 +387,7 @@
   [process in out]
   (stop-process! process)
   (->> (start-process-indirectly! process nil "clojure.main")
-       (start-thread in out)))
+       (start-thread! in out)))

 (defn run-logcat!
   [process in out path]
@@ -401,12 +401,12 @@
                        "logcat"
                        "*:I")
        (binding [leiningen.core.main/*exit-process?* false])
-       (start-thread in out)))
+       (start-thread! in out)))

 (defn run-hot-swap!
   [in out path]
   (->> (hot-swap-project-task path (read-project-clj path))
-       (start-thread in out)))
+       (start-thread! in out)))

 ; main function for "indirect" processes


Use an argument -- rest arsg too confusing

--- src/layzee/adapters/twitter/search.clj
+++ src/layzee/adapters/twitter/search.clj
@@ -26,8 +26,11 @@
         (filter tweet-filter (:statuses (json/read-str (:body reply) :key-fn keyword)))))))

 (defn by-keyword[bearer-token keyword & opts]
+  (logging/log opts)
   (search bearer-token keyword logging/log (if (nil? opts) {} (first opts))))

-(defn lazy-web [bearer-token & opts]
-  (by-keyword bearer-token "#lazyweb" opts))
+(defn lazy-web
+  ([bearer-token] (lazy-web bearer-token {}))
+  ([bearer-token opts]
+     (by-keyword bearer-token "#lazyweb" opts)))


Update figwheel to 0.2.6 and cljsbuild 1.0.5

--- src/leiningen/new/figwheel/project.clj
+++ src/leiningen/new/figwheel/project.clj
@@ -6,14 +6,14 @@

   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/clojurescript "0.0-2850"]
-                 [figwheel "0.2.5-SNAPSHOT"]
+                 [figwheel "0.2.6"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]{{#om?}}
                  [sablono "0.3.4"]
                  [org.omcljs/om "0.8.8"]{{/om?}}{{#reagent?}}
                  [reagent "0.5.0-alpha3"]{{/reagent?}}]

-  :plugins [[lein-cljsbuild "1.0.4"]
-            [lein-figwheel "0.2.5-SNAPSHOT"]]
+  :plugins [[lein-cljsbuild "1.0.5"]
+            [lein-figwheel "0.2.6"]]

   :source-paths ["src"]


Remove extraneous whitespace in docstring

--- src/main/clojure/clojure/data/json.clj
+++ src/main/clojure/clojure/data/json.clj
@@ -434,9 +434,7 @@
         the return value is a map, it will be processed recursively,
         calling value-fn again on its key-value pairs. If value-fn
         returns itself, the key-value pair will be omitted from the
-        output. This option does not apply to non-map collections.
-
-"
+        output. This option does not apply to non-map collections."
   [x ^Writer writer & options]
   (let [{:keys [escape-unicode escape-separators escape-slash key-fn value-fn]
          :or {escape-unicode true


cleaned out some leftover debug chaff

cleaned out some leftover debug chaff

--- src/push/types/standard/vectorized.clj
+++ src/push/types/standard/vectorized.clj
@@ -326,8 +326,6 @@
       `(push.instructions.dsl/consume-top-of :integer :as :which)
       `(push.instructions.dsl/calculate
         [:arg :which] #(fix/safe-mod %2 (count %1)) :as :idx)
-      `(push.instructions.dsl/calculate
-        [:arg :idx :subst] #(println (str %1 " , " %2 " , " %3)) :as :DISCARD)
       `(push.instructions.dsl/calculate
         [:arg :idx :subst] #(if (empty? %1) %1 (into [] (assoc %1 %2 %3))) :as :result)
       `(push.instructions.dsl/push-onto ~typename :result)))))


Some lines of code are refactored.

Some lines of code are refactored.

--- src/polyomino_enclosure/core.clj
+++ src/polyomino_enclosure/core.clj
@@ -1,7 +1,6 @@
 (ns polyomino-enclosure.core
   (:use     (polyomino-enclosure engine))
-  (:require (clojure             [string :as string]
-                                 [pprint :as pprint])
+  (:require (clojure             [string :as string])
             (clojure.java        [shell  :as shell]))
   (:gen-class))

@@ -11,10 +10,10 @@
     (apply println more)))

 (defn -main
-  [question-file-name solution-program-name]
-  (let [question        (slurp question-file-name)
+  [question-file solution-program]
+  (let [question        (slurp question-file)
         start-nano-time (System/nanoTime)
-        answer          (:out (shell/sh solution-program-name :in question))
+        answer          (:out (shell/sh solution-program :in question))
         end-nano-time   (System/nanoTime)
         polyominos      (create-polyominos (string/split-lines question))
         programs        (create-programs   (string/split-lines answer))]


Version 0.2.2

Version 0.2.2

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject xsc/asset-builder "0.2.2-SNAPSHOT"
+(defproject xsc/asset-builder "0.2.2"
   :description "Utility for CLJS + Asset Building"
   :url "https://github.com/xsc/asset-builder"
   :license {:name "MIT License"


Bump Eastwood

Bump Eastwood

--- project.clj
+++ project.clj
@@ -69,7 +69,7 @@
                                           with-debug-bindings [[:inner 0]]
                                           merge-meta [[:inner 0]]
                                           try-if-let [[:block 1]]}}}]
-             :eastwood {:plugins         [[jonase/eastwood "1.1.1"]]
+             :eastwood {:plugins         [[jonase/eastwood "1.2.2"]]
                         :eastwood {;; :implicit-dependencies would fail spuriously when the CI matrix runs for Clojure < 1.10,
                                    ;; because :implicit-dependencies can only work for a certain corner case starting from 1.10.
                                    :exclude-linters [:implicit-dependencies]


revert react-bootstrap version

revert react-bootstrap version

--- project.clj
+++ project.clj
@@ -35,7 +35,7 @@
                  [org.jasypt/jasypt "1.9.2"]
                  ;; [com.oracle/ojdbc16 "11.2.0.3"]
                  [ojdbc/ojdbc "14"]
-                 [cljsjs/react-bootstrap "0.30.7-0" :exclusions [org.webjars.bower/jquery]]
+                 [cljsjs/react-bootstrap "0.27.3-0" :exclusions [org.webjars.bower/jquery]]
                  [cljsjs/mousetrap "1.5.3-0"]
                  [cljsjs/codemirror "5.7.0-1"]
                  [com.zaxxer/HikariCP "2.5.1"]


org.clojure/clojure 1.7.0-alpha6 released

--- project.clj
+++ project.clj
@@ -3,7 +3,7 @@
   :url "https://github.com/lvh/icecap"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
-  :dependencies [[org.clojure/clojure "1.7.0-alpha5"]
+  :dependencies [[org.clojure/clojure "1.7.0-alpha6"]

                  ;; Stores
                  [com.novemberain/welle "3.0.0"]


lein-release plugin: preparing 0.64 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject tyrant "0.64-SNAPSHOT"
+(defproject tyrant "0.64"
   :description "Tyrant service"
   :license  "https://github.com/mixradio/mr-tyrant/blob/master/LICENSE"


Use the actual correct link to lgpl 2.1

Use the actual correct link to lgpl 2.1

--- project.clj
+++ project.clj
@@ -1,7 +1,7 @@
 (defproject tokyocabinet "1.24.4"
   :url "https://github.com/flatland/tokyocabinet"
   :license {:name "GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1"
-            :url "http://www.gnu.org/licenses/lgpl.html"}
+            :url "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html"}
   :min-lein-version "2.0.0"
   :description "native tokyo cabinet libraries"
   :dependencies [[fs "1.1.2"]