Changed servlet to be inline, so routes argument is not strictly evaluated

--- src/compojure/http/servlet.clj
+++ src/compojure/http/servlet.clj
@@ -103,16 +103,18 @@

 ;; Functions that combine request and response handling

-(defn- http-handler
+(defn request-handler
   "Handle incoming HTTP requests from a servlet."
   [[servlet request response] routes]
   (do (.setCharacterEncoding response "UTF-8")
       (update-response response
         (routes (create-request request)))))

-(defn servlet
-  "Create a servlet from a sequence of routes."
+(definline servlet
+  "Create a servlet from a sequence of routes. Automatically updates if
+  the routes binding is redefined."
   [routes]
-  (proxy [HttpServlet] []
-    (service [request response]
-       (http-handler [this request response] routes))))
+  `(proxy [HttpServlet] []
+     (~'service [request# response#]
+       (request-handler [~'this request# response#]
+         ~routes))))


Couple of docstrings has been added to defcomponent and deftransform macroes

--- core/src/cljc/hellhound/component.cljc
+++ core/src/cljc/hellhound/component.cljc
@@ -100,15 +100,26 @@

 (defmacro defcomponent
+  "Creates a component with the given `component-name` and use the
+  given `body` as the main function of the component.
+
+  The defined component will use `hellhound.components.defaults/start-fn` and
+  `hellhound.components.defaults/stop-fn` as the `start-fn` and `stop-fn`
+  which basically do nothing (`start-fn` attaches the context to the component)."
   [component-name & body]
-  `(def ~component-name
-     {:hellhound.component/name       (keyword (str *ns*) ~(str component-name))
-      :hellhound.component/start-fn   hellhound.component/default-start-fn
-      :hellhound.component/stop-fn    hellhound.component/default-stop-fn
+  `(def ~component-name))
+p     {:hellhound.component/name       (keyword (str *ns*) ~(str component-name))}
+      :hellhound.component/start-fn   hellhound.components.default/start-fn
+      :hellhound.component/stop-fn    hellhound.components.default/stop-fn
       :hellhound.component/depends-on []
-      :hellhound.component/fn         ~(list* `fn body)}))
+      :hellhound.component/fn         ~(list* `fn body)
+

 (defmacro deftransform
+  "Creates a [transform] component with the given `component-name` and uses
+  the given `body` to create a function to be used in the main function of
+  the component which gets two arguments, the component itself and a value
+  fetched from the input stream."
   [component-name & body]
   `(def ~component-name
      {:hellhound.component/name       (keyword (str *ns*) ~(str component-name))


Update project.clj

Update project.clj

Update preview gem commit reference
- MMT-1908: Update preview gem to handle metadata which has datacenters with no short name.

--- collection-renderer-lib/project.clj
+++ collection-renderer-lib/project.clj
@@ -14,7 +14,7 @@
    the hardcoded commit id during dev integration with cmr_metadata_preview project.
    The hardcoded commit id should be updated when MMT releases a new version of the gem."
   (or (System/getenv "CMR_METADATA_PREVIEW_COMMIT")
-      "d81ad5ef55c"))
+      "03072e2c727"))

 (def gem-install-path
   "The directory within this library where Ruby gems are installed."


CMR-5885: update collection-renderer-lib

--- collection-renderer-lib/project.clj
+++ collection-renderer-lib/project.clj
@@ -14,7 +14,7 @@
    the hardcoded commit id during dev integration with cmr_metadata_preview project.
    The hardcoded commit id should be updated when MMT releases a new version of the gem."
   (or (System/getenv "CMR_METADATA_PREVIEW_COMMIT")
-      "5eaeaafefa8"))
+      "6d22973623f"))

 (def gem-install-path
   "The directory within this library where Ruby gems are installed."


further updates to copy for build notification

--- src-cljs/frontend/controllers/api.cljs
+++ src-cljs/frontend/controllers/api.cljs
@@ -829,10 +829,10 @@

 (defmethod api-event [:retry-build :success]
   [target message status {:keys [resp context]} state]
-  (let [{:keys [reponame ref-name]} context]
+  (let [{:keys [reponame]} context]
     (state/add-flash-notification
      state
-     (gstring/format "Rebuilding %s %s..." reponame ref-name))))
+     (gstring/format "Rebuilding %s..." reponame))))

 (defmethod post-api-event! [:retry-build :success]
   [target message status {:keys [resp context] :as args} previous-state current-state comms]


Fix testing against newer versions of MySQL :wrench:

--- test/metabase/test/data/mysql.clj
+++ test/metabase/test/data/mysql.clj
@@ -30,13 +30,18 @@
          (when (= context :db)
            {:db database-name})))

+(defn- add-connection-params [spec]
+  ;; allow inserting dates where value is '0000-00-00' -- this is disallowed by default on newer versions of MySQL, but we still want to test that we can handle it correctly for older ones
+  (update spec :subname (u/rpartial str "&sessionVariables=sql_mode='ALLOW_INVALID_DATES'")))
+
 (defn- quote-name [nm]
   (str \` nm \`))

 (u/strict-extend MySQLDriver
   generic/IGenericSQLDatasetLoader
   (merge generic/DefaultsMixin
-         {:execute-sql!              generic/sequentially-execute-sql!              ; TODO - we might be able to do SQL all at once by setting `allowMultiQueries=true` on the connection string
+         {:database->spec            (comp add-connection-params (:database->spec generic/DefaultsMixin))
+          :execute-sql!              generic/sequentially-execute-sql! ; TODO - we might be able to do SQL all at once by setting `allowMultiQueries=true` on the connection string
           :field-base-type->sql-type (u/drop-first-arg field-base-type->sql-type)
           :load-data!                generic/load-data-all-at-once!
           :pk-sql-type               (constantly "INTEGER NOT NULL AUTO_INCREMENT")


Added test assertions for other rules in step_b_ontology_to_ice/step_a

--- test/rules_tests/post_identifier_merge/step_b_ontology_to_ice/step_a/test_rule_copy_list_nodes_to_bio.clj
+++ test/rules_tests/post_identifier_merge/step_b_ontology_to_ice/step_a/test_rule_copy_list_nodes_to_bio.clj
@@ -50,11 +50,17 @@

 (deftest test-rule
-  (let [rule (first (filter #(= (:name %) "copy-list-nodes-to-bio")
+  (let [rule1 (first (filter #(= (:name %) "copy-list-nodes-to-bio")
                               (kabob-load-rules-from-classpath "rules/post_identifier_merge/step_b_ontology_to_ice/step_a")))
+        rule2 (first (filter #(= (:name %) "copy-owl-restriction-to-bio")
+                             (kabob-load-rules-from-classpath "rules/post_identifier_merge/step_b_ontology_to_ice/step_a")))
+        rule3 (first (filter #(= (:name %) "copy-owl-alldisjointclasses-to-bio")
+                             (kabob-load-rules-from-classpath "rules/post_identifier_merge/step_b_ontology_to_ice/step_a")))
         source-kb (test-kb sample-kb-triples)] ;; source kb contains sample triples

-    (run-forward-rule-sparql-string source-kb source-kb rule)
+    (run-forward-rule-sparql-string source-kb source-kb rule1)
+    (run-forward-rule-sparql-string source-kb source-kb rule2)
+    (run-forward-rule-sparql-string source-kb source-kb rule3)

     ;; there should be 3 list_recored instances
     (is (= 3 (count (query source-kb '((?/list_record rdf/type ccp/IAO_EXT_0000317)))))) ;; ccp:RDF list record
@@ -70,12 +76,20 @@
                                         (ccp/ID_aPvFdJzcE7zuZolQo-0bfXOLsnA obo/IAO_0000219 ccp/L_aPvFdJzcE7zuZolQo-0bfXOLsnA) ;; obo:denotes
                                         (ccp/L_aPvFdJzcE7zuZolQo-0bfXOLsnA rdf/type rdf/List))))))

+
+    (is (= 1 (count (query source-kb '((?/list_record rdf/type ccp/IAO_EXT_0000347)))))) ;; ccp:AllDisjointClasses record
+    (is (= 3 (count (query source-kb '((?/list_record rdf/type ccp/IAO_EXT_0000305)))))) ;; ccp:OWL restriction record
+
+
+
     ;;; The code fragment below is useful for debugging as it writes
     ;;; triples to a local file.
     (let [log-kb (output-kb "/tmp/triples.nt")]
       ;; add sample triples to the log kb
       ;;(dorun (map (partial add! log-kb) sample-kb-triples))

-      (run-forward-rule-sparql-string source-kb log-kb rule)
+      (run-forward-rule-sparql-string source-kb log-kb rule1)
+      (run-forward-rule-sparql-string source-kb log-kb rule2)
+      (run-forward-rule-sparql-string source-kb log-kb rule3)
       (close log-kb))
     ))


Metrics component idempotent

Metrics component idempotent

--- src/kixi/datastore/metrics.clj
+++ src/kixi/datastore/metrics.clj
@@ -107,37 +107,41 @@
     [influx-reporter registry]
     component/Lifecycle
     (start [component]
-      (let [with-reg (update component :registry #(or %
-                                                      (let [reg (new-registry)]
-                                                        (jvm/instrument-jvm reg)
-                                                        reg)))
-            reg (:registry with-reg)]
-        (-> with-reg
-            (update :reporter #(or %
-                                   (let [reporter (influxdb/reporter reg
-                                                                     influx-reporter)]
-                                     (log/info "Starting InfluxDb Metrics Reporter")
-                                     (influxdb/start reporter (:seconds influx-reporter))
-                                     reporter)))
-            (update :meter-mark #(or %
-                                     (meter-mark! reg)))
-            (update :insert-time-in-ctx #(or %
-                                             (insert-time :resource)))
-            (update :expose-metrics-resource #(or %
-                                                  (expose-metrics-resource reg)))
-            (update :record-ctx-metrics #(or %
-                                             (record-metrics reg :resource))))))
+      (if-not registry
+        (let [with-reg (update component :registry #(or %
+                                                        (let [reg (new-registry)]
+                                                          (jvm/instrument-jvm reg)
+                                                          reg)))
+              reg (:registry with-reg)]
+          (-> with-reg
+              (update :reporter #(or %
+                                     (let [reporter (influxdb/reporter reg
+                                                                       influx-reporter)]
+                                       (log/info "Starting InfluxDb Metrics Reporter")
+                                       (influxdb/start reporter (:seconds influx-reporter))
+                                       reporter)))
+              (update :meter-mark #(or %
+                                       (meter-mark! reg)))
+              (update :insert-time-in-ctx #(or %
+                                               (insert-time :resource)))
+              (update :expose-metrics-resource #(or %
+                                                    (expose-metrics-resource reg)))
+              (update :record-ctx-metrics #(or %
+                                               (record-metrics reg :resource)))))
+        component))
     (stop [component]
-      (-> component
-          (update :reporter #(when %
-                               (log/info "Stopping InfluxDb Reporting")
-                               (influxdb/stop %)
-                               nil))
-          (dissoc :meter-mark)
-          (dissoc :insert-time-in-ctx)
-          (dissoc :record-ctx-metrics)
-          (update :registry #(when %
-                               (log/info "Destorying metrics registry")
-                               (.removeMatching % (com.codahale.metrics.MetricFilter/ALL))
-                               nil)))))
+      (if registry
+        (-> component
+            (update :reporter #(when %
+                                 (log/info "Stopping InfluxDb Reporting")
+                                 (influxdb/stop %)
+                                 nil))
+            (dissoc :meter-mark)
+            (dissoc :insert-time-in-ctx)
+            (dissoc :record-ctx-metrics)
+            (update :registry #(when %
+                                 (log/info "Destorying metrics registry")
+                                 (.removeMatching % (com.codahale.metrics.MetricFilter/ALL))
+                                 nil)))
+        component)))


first draft for testing diff changes (untested)

--- test/parinfer/formatter_test.cljc
+++ test/parinfer/formatter_test.cljc
@@ -59,19 +59,88 @@
         (-> state
             (assoc :block-key block-key)
             (assoc-in [:test-case block-key] {:file-line-no file-line-no
-                                              :lines []}))))))
+                                              :lines []
+                                              :cursor nil
+                                              :diff nil}))))))
+
+(defn index-of
+  [string ch]
+  (let [i (.indexOf string)]
+    (when-not (= -1 i) i)))

 (defmethod parse-test-line :inside-block
-  [{:keys [block-key test-case test-cases] :as state} [file-line-no line]]
-  (let [cursor-x (.indexOf line "|")
-        cursor-line (when (and (= :in block-key)
-                               (not= -1 cursor-x))
-                      (dec (- file-line-no (:file-line-no (:in test-case)))))
-        line (string/replace line "|" "")]
-    (-> state
-        (update-in [:test-case block-key :lines] conj line)
-        (update-in [:test-case block-key :cursor-x] #(or % cursor-x))
-        (update-in [:test-case block-key :cursor-line] #(or % cursor-line)))))
+  [{:keys [block-key] :as state} [file-line-no line]]
+  (let [block (get-in state [:test-case block-key])
+        diff (:diff block)
+
+        ;; process and remove cursor char
+        cursor-x (index-of line "|")
+        line-without-cursor (string/replace line "|" "")
+        multiple-cursors? (< (count line-without-cursor) (dec (count line)))
+        line (if multiple-cursors?
+               (throw (error-msg file-line-no "only one cursor allowed on a line"))
+               line-without-cursor)
+
+        ;; process and remove diff char
+        diff-ch (#{"-" "+"} (str (first line)))
+        line (if diff-ch
+               (if (:closed? diff)
+                 (throw (error-msg file-line-no "diff lines must be contiguous"))
+                 (str " " (subs line 1)))
+               line)
+
+        ;; prevent special chars in 'out' block
+        _ (when (= :out block-key)
+            (when cursor-x (throw (error-msg file-line-no "no cursor allowed in 'out' block yet")))
+            (when diff-ch (throw (error-msg file-line-no "no diff chars allowed in 'out' block"))))
+
+        ;; prevent multiple cursors
+        _ (when cursor-x
+            (if (= diff-ch "+")
+              (when (:cursor diff) (throw (error-msg file-line-no "only one cursor allowed in all '+' diff lines")))
+              (when (:cursor block) (throw (error-msg file-line-no "only one cursor allowed in all normal and '-' diff lines")))))
+
+        ;; initialize or close diff
+        diff (if-not diff
+
+               ;; initialize diff
+               (when diff-ch
+                 (let [line-no (count (:lines block))]
+                   {:start-line-no line-no
+                    :end-line-no line-no
+                    :lines []}))
+
+               ;; close diff
+               (cond-> diff
+                 (not diff-ch) (assoc :closed? true)))
+
+        ;; update diff end line
+        diff (cond-> diff
+               (= diff-ch "-") (update :end-line-no inc))
+
+        ;; finish determining cursor
+        cursor (when cursor-x
+                 {:cursor-x cursor-x
+                  :cursor-line (if (= diff-ch "+")
+                                 (+ (:start-line-no diff) (count (:lines diff)))
+                                 (count (:lines block)))})
+
+        ;; set appropriate cursor
+        block (if cursor
+                (if (= diff-ch "+")
+                  (assoc-in block [:diff :cursor] cursor)
+                  (assoc block :cursor cursor))
+                block)
+
+        ;; conj line to appropriate vector
+        block (if (= diff-ch "+")
+                (update-in block [:diff :lines] conj line)
+                (update block :lines conj line))
+
+        ;; update state
+        state (assoc-in state [:test-case block-key] block)]
+
+    state))

 (defmethod parse-test-line :default
   [state [line-no line]]
@@ -94,35 +163,65 @@
     (:test-cases state)))

 (defn idempotent-check
-  [type- message result overrides format-text]
-  (let [post-result (format-text overrides result)
+  [type- message result overrides process-text]
+  (let [post-result (process-text overrides result)
         message (str type- " idempotence over " message)]
     (is (= result post-result) message)))

 (defn run-test-cases
-  ([type- format-text] (run-test-cases type- format-text nil))
-  ([type- format-text post-test]
-   (let [filename (str "doc/" type- "-tests.md")
-         text #?(:clj (slurp filename)
-                 :cljs (.readFileSync fs filename))
-         test-cases (parse-test-cases text)]
-     (doseq [{:keys [in out]} test-cases]
-       (let [cursor-line (:cursor-line in)
-             cursor-x (:cursor-x in)
-             cursor? (and cursor-line cursor-x)
-             overrides (select-keys in [:cursor-line :cursor-x])
-             message (cond-> (str type- " test case @ line #" (:file-line-no in))
-                       cursor? (str " with cursor at line=" cursor-line " x=" cursor-x))
-             text-in (join "\n" (:lines in))
-             text-out (join "\n" (:lines out))
-             result (format-text overrides text-in)]
-         (is (= text-out result))
-         (idempotent-check "infer" message result overrides infer/format-text)
-         (when-not cursor?
-           (idempotent-check "prep" message result overrides prep/format-text)))))))
+  [type- process-text process-change]
+  (let [filename (str "doc/" type- "-tests.md")
+        text #?(:clj (slurp filename)
+                     :cljs (.readFileSync fs filename))
+        test-cases (parse-test-cases text)]
+    (doseq [{:keys [in out]} test-cases]
+      (let [
+            ;; cursor states
+            cursor (:cursor in)
+            diff-cursor (:cursor (:diff in))
+            final-cursor (if change diff-cursor cursor)
+
+            ;; overrides allow the initial state to be overwritten by something
+            ;; (we only use it for the cursor right now)
+            overrides (merge cursor)
+            diff-overrides (merge diff-cursor)
+            final-overrides (merge final-cursor)
+
+            ;; message needed for tracking errors
+            message (cond-> (str type- " test case @ line #" (:file-line-no in))
+                      cursor      (str "\n   with cursor at line=" (:cursor-line cursor) " x=" (:cursor-x cursor))
+                      diff-cursor (str "\n   with diff-cursor at line=" (:cursor-line diff-cursor) " x=" (:cursor-x diff-cursor)))
+
+            ;; input and expected output
+            text-in (join "\n" (:lines in))
+            text-expected (join "\n" (:lines out))
+
+            ;; calculate input change if needed
+            change (when-let [diff (:diff in)]
+                     (is (not (nil? process-text-change)) message)
+                     {:line-no [(:start-line-no diff) (:end-line-no diff)]
+                      :new-line (:lines diff)})
+
+            ;; calculate result (with change if needed)
+            result (cond-> (process-text overrides text-in)
+                     change (process-text-change change diff-overrides))
+            text-actual (join "\n" (:lines result))]
+
+        (is (= text-expected text-actual) message)
+
+        (idempotent-check "infer" message text-actual final-overrides infer/format-text)
+        (when-not final-cursor
+          (idempotent-check "prep" message text-actual final-overrides prep/format-text))))))

 (deftest run-infer-cases
-  (run-test-cases "infer" infer/format-text))
+  (run-test-cases
+    "infer"
+    infer/process-text
+    infer/process-text-change))

 (deftest run-prep-cases
-  (run-test-cases "prep" prep/format-text))
+  (run-test-cases
+    "prep"
+    prep/process-text
+    nil ;; no process-text-change for prep yet
+    ))


fix typo in comment

fix typo in comment

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -189,7 +189,7 @@
                       :subcat {:2 {:cat :noun}}
                       :sem {:obj {:pred :top}}}})

-   ;; inttransitivize:  remove the second argument and semantic object to make verbs intransitive.
+   ;; intransitivize:  remove the second argument and semantic object to make verbs intransitive.
    (new-entries
     {:intransitivize false
      :phrasal-verb false


s/:cenare/:have-dinner/

s/:cenare/:have-dinner/

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -519,7 +519,7 @@
                    :sem {:pred :mangiare}}}

    "eat dinner" {:synsem {:cat :verb
-                          :sem {:pred :cenare}}
+                          :sem {:pred :have-dinner}}
                  :transitivize false
                  :english {:present {:3sing "eats dinner"}
                            :participle "eating dinner"
@@ -776,7 +776,7 @@
                      :past "had"}}

    "have dinner" {:synsem {:cat :verb
-                           :sem {:pred :cenare}}
+                           :sem {:pred :have-dinner}}
                   :english {:present {:3sing "has dinner"}
                             :past "had dinner"
                             :participle "having dinner"}}


for auxiliary 'avere', select reflexive=false

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -309,6 +309,9 @@
           :synsem {:infl :present
                    :subcat {:1 {:agr agr-of-subj-of-main-verb}
                             :2 {:essere false
+                                :reflexive false ;; in Italian, reflexive verbs are always essere=false.
+                                ;; this additional qualification here (:reflexive false) is not necessary
+                                ;; but is expected to reduce fails during generation.
                                 :agr agr-of-subj-of-main-verb
                                 :subcat {:1 {:agr agr-of-subj-of-main-verb}
                                          :2 '()}}}}}))])


added potere

added potere

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -1507,7 +1507,25 @@
                          :sem {:pred :carry}}}
                {:synsem {:cat :verb
                          :sem {:pred :wear}}}]
-
+   "potere"
+   (let [shared-part-of-potere
+   {:synsem {:cat :verb}
+    :italiano {:future-stem "potr"
+    :drop-e true
+   :present {:1sing "posso"
+             :2sing "puoi"
+             :3sing "può"
+             :1plur "possiamo"
+             :2plur "potete"
+             :3plur "possono"}}}
+   [(merge shared-part-of-potere
+             {:synsem {:pred :can}})
+      (merge shared-part-of-potere
+             {:synsem {:pred :may}})
+           (merge shared-part-of-potere
+             {:synsem {:pred :be-able-to}})])
+
+
    "prendere" {:synsem {:cat :verb :sem {:pred :take}}
                :italiano {:passato "preso"}}


Add fn to describe player.

Add fn to describe player.

--- src/isla/talk.clj
+++ src/isla/talk.clj
@@ -32,6 +32,16 @@
     (str "Try saying 'pick up " (:name (first items-in-room)) "'.")
     (str "There is nothing to pick up here.")))

+;; player description
+
+(defn player-description [player]
+  (str (:summary player) " "
+       (list-things (:items player)
+                    "You are not carrying anything."
+                    "You are carrying"
+                    "You are carrying"
+                    "a")))
+
 ;; room description

 (defn room-intro [room connected-rooms]


Add does not contain spec namespaces to core_spec.

--- spec/incise/core_spec.clj
+++ spec/incise/core_spec.clj
@@ -23,7 +23,11 @@
   (it "does not contain core namespaces"
     (doseq [core-sym core-namespace-symbols]
       (should-not-contain core-sym @layout-and-parser-syms)))
-  (it "should contain default layouts and parsers"
+  (it "does not contain spec namespaces"
+    (doseq [spec-sym ['incise.parsers.core-spec
+                      'incise.parsers.markdown-spec]]
+      (should-not-contain spec-sym @layout-and-parser-syms)))
+  (it "contains default layouts and parsers"
     (doseq [default-sym ['incise.parsers.markdown
                          'incise.layouts.page]]
       (should-contain default-sym @layout-and-parser-syms))))


don't show thread close on new thread box

--- src/braid/ui/views/thread.cljs
+++ src/braid/ui/views/thread.cljs
@@ -177,7 +177,7 @@

          [:div.card
           [:div.head
-           (when open?
+           (when (and (not new?) open?)
              [:div.close
               {:on-click (fn [_]
                            (dispatch! :hide-thread {:thread-id (thread :id)}))} "×"])


Cleanup the test name

Cleanup the test name

--- spec/rook/server_spec.clj
+++ spec/rook/server_spec.clj
@@ -35,8 +35,10 @@
                               :message "Processing of request GET /foo/bar timed out after 10 ms."}}
                    response)))

-    (it "responds with a timeout immediately if the control channel is closed."
-        (let [handler (-> #(-> % :timeout-control-ch close!)
+    (it "responds with a timeout immediately if the control channel is closed"
+        (let [handler (-> (fn [request]
+                            (thread
+                              (-> request :timeout-control-ch close!)))
                           (server/wrap-with-timeout 1000))
               start-time (System/currentTimeMillis)
               response (-> (mock/request :get "/fast/timeout")


:bug: Fix routing unresponsivenes in some conditions.

--- frontend/src/uxbox/util/router.cljs
+++ frontend/src/uxbox/util/router.cljs
@@ -126,7 +126,8 @@
             history (:history state)
             router  (:router state)]
         (rx/merge
-         (rx/of (on-change router (.getToken history)))
+         (->> (rx/of (on-change router (.getToken history)))
+              (rx/observe-on :asap))
          (->> (rx/create (fn [sink]
                            (let [key (e/listen history "navigate" #(sink (.-token %)))]
                              (fn []


Removed old sync-data-scratch and sync-global functions as they're not used anymore.

--- src/clj/elephantdb/service.clj
+++ src/clj/elephantdb/service.clj
@@ -39,19 +39,6 @@
                             ))))]
     (with-ret (future-values loaders)
       (log-message "Successfully loaded all domains"))
-    ))
-
-(defn sync-data-scratch [domains-info global-config local-config]
-  (let [fs (filesystem (:hdfs-conf local-config))
-        local-dir (:local-dir local-config)]
-    (load-and-sync-status domains-info
-                          (fn [domain]
-                            (load-domain
-                             fs
-                             local-config
-                             (str (path local-dir domain))
-                             (-> global-config (:domains) (get domain))
-                             (domain/host-shards (domains-info domain)))))
     ))

 (defn domain-needs-update? [local-vs remote-vs]
@@ -100,25 +87,6 @@
                             (use-cache-or-update domain domains-info global-config local-config)))))

-(defn- sync-global [global-config local-config token]
-  (log-message "Loading remote data")
-  (let [fs (filesystem (:hdfs-conf local-config))
-        domains-info (init-domain-info-map fs global-config)
-        local-dir (:local-dir local-config)
-        lfs (doto (local-filesystem) (clear-dir local-dir))
-        cache-config (assoc global-config :token token)]
-    (log-message "Domains info:" domains-info)
-    (future
-     (try
-       (sync-data-scratch domains-info global-config local-config)
-       (log-message "Caching global config " cache-config)
-       (cache-global-config! local-config cache-config)
-       (log-message "Cached config " (read-cached-global-config local-config))
-       (log-message "Finished loading all domains from remote")
-       (catch Throwable t (log-error t "Error when syncing data") (throw t))
-     ))
-    domains-info ))
-
 (defn sync-updated [global-config local-config token]
   "Only fetch domains from remote if a newer version is available.
 Keep the cached versions of any domains that haven't been updated"


Fix copy paste error in alert event handler

--- src/clj/zetawar/events/ui.cljs
+++ src/clj/zetawar/events/ui.cljs
@@ -13,8 +13,8 @@
    [cljs.core.async.macros :refer [go go-loop]]))

 (defmethod router/handle-event ::alert
-  [{:as handler-ctx :keys [ev-chan conn db]} [_ message]]
-  (js/alert "Enabling AI on all factions is not yet supported."))
+  [{:as handler-ctx :keys [ev-chan conn db]} [_ text]]
+  (js/alert text))

 ;; New click logic:
 ;; - no selection?


remove debug statements

remove debug statements

--- src/cljs/gointermod/views.cljs
+++ src/cljs/gointermod/views.cljs
@@ -34,6 +34,6 @@
             [enrichment/enrichment]
         )]
     )]
-       (when config/debug?
-         [:div.db  (edn->hiccup (dissoc @(re-frame/subscribe [:db]) :multi-mine-results :heatmap))])
+      ;  (when config/debug?
+      ;    [:div.db  (edn->hiccup (dissoc @(re-frame/subscribe [:db]) :multi-mine-results :heatmap))])
     ]))


smaller textareas

smaller textareas

--- src/cljs/greffe/doc_comps.cljs
+++ src/cljs/greffe/doc_comps.cljs
@@ -93,7 +93,7 @@
                   "Editer"))))
            (when (:editText state)
              (dom/textarea #js {:value (:editContent state)
-                                :cols "50" :rows "10"
+                                :cols "50" :rows "3"
                              :onChange
                                 (fn [ev]
                                   (let [new-val (-> ev .-target .-value)]


core: got rid off offset, wasn't using it

--- src/cljs/scroll_demo/core.cljs
+++ src/cljs/scroll_demo/core.cljs
@@ -19,7 +19,7 @@
                (reset! cur-scroll-y (max 0 new-y)))
                (recur))))

-(defn- block [pv cv & {:keys [x y w h offset direction]}]
+(defn- block [pv cv & {:keys [x y w h direction]}]
   (let [payload [:div {:style {:display :inline-block
                                :box-sizing :border-box
                                :width "100%"
@@ -36,7 +36,7 @@
               :left x
               :width w
               :height h}
-      :animations {[offset (+ offset 4000)] {:left left-animation
+      :animations {[0 4000] {:left left-animation
                                              :width [w 0]
                                              :opacity [1 0]
                                              :height [h 0]}}}]))
@@ -76,12 +76,11 @@
          (let [h 200
                w 200
                y (* i h)
-               x 300
-               offset (* i 0)]
+               x 300]
            ^{:key i}
            [:div
-            [block pv cv :x x :y y :w w :h h :offset offset :direction :left]
-            [block pv cv :x (+ 200 x) :y y :w w :h h :offset offset :direction :right]]))
+            [block pv cv :x x :y y :w w :h h :direction :left]
+            [block pv cv :x (+ 200 x) :y y :w w :h h :direction :right]]))
        [:div {:style {:text-align :center
                       :position :fixed
                       :top 500


Minor PGN parsing tweaks.

Minor PGN parsing tweaks.

--- src/clojure/clj_chess/pgn.cljc
+++ src/clojure/clj_chess/pgn.cljc
@@ -10,7 +10,7 @@
   (ip/parser
     "
     (* A PGN game consists of PGN headers followed by the move text. *)
-    game = headers <whitespace> movetext
+    game = headers <whitespace> moves
     headers = {header [<whitespace>]}

     (* Each header consists of a header name and a corresponding value, *)
@@ -21,7 +21,7 @@

     (* Movetext consists of moves (symbols), numbers, periods, comments,    *)
     (* variations, numeric annotation glyphs, and game termination markers. *)
-    movetext = {(termination-marker / <number> / <'.'> / symbol / comment / variation / nag / semicolon-comment / percent-comment / <whitespace>)}
+    moves = {(termination-marker / <number> / <'.'> / symbol / comment / variation / nag / semicolon-comment / percent-comment / <whitespace>)}

     (* Comments are arbitrary strings surrounded by curly braces. *)
     comment = <'{'> comment-content <'}'>
@@ -35,17 +35,13 @@
     <percent-comment> = <'%'> <{!'\n' #'[\\S\\s]'}> <'\n'>

     (* Variations are contained in parens, and can be nested recursively. *)
-    <variation> = <'('> movetext <')'>
+    <variation> = <'('> moves <')'>

     nag = ('$' #'[0-9]+') | '!' | '?' | '!!' | '??' | '!?' | '?!'

     (* Game termination markers, '1-0', '0-1', '1/2-1/2' or '*', where *)
     (* the asterisk indicates an incomplete game or an unknown result. *)
-    termination-marker = white-wins | black-wins | draw | unknown-result
-    white-wins = <'1-0'>
-    black-wins = <'0-1'>
-    draw = <'1/2-1/2'>
-    unknown-result = <'*'>
+    termination-marker = '1-0' | '0-1' | '1/2-1/2' | '*'

     (* Strings are a little messy, since they are surrounded by double *)
     (* quotes, but we also allows a double quote within the string if *)
@@ -58,9 +54,7 @@
     (* immediately followed by a sequence of zero or more symbol continuation *)
     (* characters. These continuation characters are letters, digits, *)
     (* and the special character '_', '+', '-', '#', ':' and '='. *)
-    symbol = symbol-start symbol-continuation
-    <symbol-start> = #'[A-Za-z0-9]'
-    <symbol-continuation> = #'[A-Za-z0-9_+\\-:=#]*'
+    <symbol> = #'[A-Za-z0-9][A-Za-z0-9_+\\-:=#]*'

     number = #'[0-9]+'
     whitespace = #'\\s+'
@@ -104,9 +98,3 @@
                   #?(:clj parsed-pgn
                      :cljs (vectorize-parsed-pgn parsed-pgn)))))

-
-
-
-
-
-


Fixing indexer routes.

Fixing indexer routes.

--- src/cmr/indexer/api/routes.clj
+++ src/cmr/indexer/api/routes.clj
@@ -37,8 +37,8 @@

     ;; reset operation available just for development purposes
     ;; delete configured elastic indexes and create them back
-    (POST "/reset" {:keys [context]}
-      (index-svc/reset-indexes context)
+    (POST "/reset" {:keys [request-context]}
+      (index-svc/reset-indexes request-context)
       {:status 200})

     (context "/reindex-provider-collections/:provider-id" [provider-id]


add ! to activate/deactivate to reflect state change and stub out render :workspace

--- src/app/cljs/one/sample/view.cljs
+++ src/app/cljs/one/sample/view.cljs
@@ -25,16 +25,21 @@
 (defmethod render :init [_]
   (load-templates))

-(defn- deactivate [id-or-node-or-nodes]
+(defn- deactivate! [id-or-node-or-nodes]
   (remove-class! (if (string? id-or-node-or-nodes)
                    ($ id-or-node-or-nodes)
                    (nodes id-or-node-or-nodes))
                  "active"))

-(defn- activate [id-or-node-or-nodes]
+(defn- activate! [id-or-node-or-nodes]
   (add-class! (if (string? id-or-node-or-nodes)
                 ($ id-or-node-or-nodes)
                 (nodes id-or-node-or-nodes))
               "active"))

+(defmethod render :workspace [m]
+  (do
+    (deactivate! ($ "#content > div"))
+    (activate! ($ "#workspace"))))
+
 (dispatch/react-to #{:state-change} (fn [_ m] (render m)))


Matching exercise description. (#427)

Matching exercise description. (#427)

--- exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj
+++ exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj
@@ -16,7 +16,7 @@
   )

 (defn remove-language
-  "Removes the the last language added to the list."
+  "Removes the the first language added to the list."
   [lang-list]
   )


ast->tree

ast->tree

--- src/atom_finder/util/cdt_util.clj
+++ src/atom_finder/util/cdt_util.clj
@@ -343,4 +343,4 @@
 (s/defn pmap-dir-nodes
   "Apply a function to the every node of every c file in a directory"
   [f :- (s/=> s/Any [IASTTranslationUnit]) dirname :- s/Str]
-  (flatten (pmap-dir-asts #(->> % flatten-tree (map f)) dirname)))
+  (flatten (pmap-dir-trees #(->> % flatten-tree (map f)) dirname)))


use new +(defn present-participle-of)

use new +(defn present-participle-of)

--- src/babel/english/morphology.cljc
+++ src/babel/english/morphology.cljc
@@ -300,19 +300,10 @@
            ;; unless overridden by :participle or :participle-suffix below,
            ;; ing-form or used-to-form (chosen randomly) will be used.
            ing-form
-           (cond
-
-            (re-find #"ie$" stem)
-            (str (replace stem #"..$" "y") "ing")
-
-            true
-            (str stem "ing"))
+           (present-participle-of stem)

            used-to-form
-           (str "used to " root)
-
-           ]
-
+           (str "used to " root)]
        (cond (= 0 (rand-int 2))
              used-to-form


add make-id function, group-by type

add make-id function, group-by type

--- src/brainbot/nozzle/esconnect.clj
+++ src/brainbot/nozzle/esconnect.clj
@@ -59,6 +59,7 @@
               ["dir" "doc"]
               :size 1000000
               :query {:match_all {}}
+              :fields ["parent" "lastmodified"]
               :filter {:term {:parent parent}}))

@@ -72,18 +73,25 @@

+(defn make-id
+  [& args]
+  (string/replace (string/join "/" args) #"/+" "/"))
+

 (defn simple-update_directory
   [fs es-index {:keys [directory entries] :as body} {publish :publish}]
-  (println "update-directory" body)
+  (let [parent-id (make-id "" directory)
+        entries-by-type (group-by #(get-in % [:stat :type]) entries)]

-  (doseq [e (filter #(= (get-in % [:stat :type]) "directory") entries)]
-    (let [id (string/join "/" [directory (:relpath e)])]
-      (println "put" e)
-      (esd/put es-index "dir"
-               id
-               {:mtime (get-in e [:stat :mtime])
-                :parent directory}))))
+    (println "update-directory" fs parent-id entries-by-type)
+
+    (doseq [e (entries-by-type "directory")]
+      (let [id (make-id "" directory (:relpath e))]
+        (println "put" id e)
+        (esd/put es-index "dir"
+                 id
+                 {:lastmodified (get-in e [:stat :mtime])
+                  :parent parent-id})))))


change Blue Sun message to read correctly

fixes #1094

--- src/clj/game/cards-identities.clj
+++ src/clj/game/cards-identities.clj
@@ -43,7 +43,7 @@
                               (let [cost (rez-cost state side target)]
                                 (gain state side :credit cost)
                                 (move state side target :hand)
-                                (system-msg state side (str "add " (:title target) " to HQ and gain " cost " [Credits]"))
+                                (system-msg state side (str "adds " (:title target) " to HQ and gains " cost " [Credits]"))
                                 (swap! state update-in [:bonus] dissoc :cost)))}]}

    "Cerebral Imaging: Infinite Frontiers"


Fix the call to add-card-to-list! when quantity is present

--- src/cljs/decktouch/card-data.cljs
+++ src/cljs/decktouch/card-data.cljs
@@ -56,7 +56,7 @@
   [card-name & quantity]
   (do
     (if quantity
-      (swap! card-list add-card-quantity card-name quantity)
+      (swap! card-list add-card-quantity card-name (first quantity))
       (swap! card-list add-card-quantity card-name 1))
     (go
       (let [response (js->clj (.parse js/JSON (<! (<lookup-card-data card-name))))]


Fix typo.

Fix typo.

--- src/clojars/tools/upload_repo.clj
+++ src/clojars/tools/upload_repo.clj
@@ -1,6 +1,6 @@
 (ns clojars.tools.upload-repo
   (:require [clojure.java.io :as io]
-            [clojars.cloud-files :as cf])
+            [clojars.cloudfiles :as cf])
   (:gen-class))

 (defn upload-file [conn path file]


Change template order

Change template order

--- src/clojure/nightcode/dialogs.clj
+++ src/clojure/nightcode/dialogs.clj
@@ -106,11 +106,11 @@
                [:game [:clojure :java]]
                [:android [:clojure :java]]
                [:ios [:clojure :java] :osx-required]
+               [:dotnet [:clojure] :windows-required]
                [:desktop [:clojure]]
                [:web [:clojure]]
                [:graphics [:clojure]]
                [:sounds [:clojure]]
-               [:dotnet [:clojure] :windows-required]
                [:database [:clojure]]]
         types (if (sandbox/get-dir)
                 (remove #(contains? #{:ios :android} (first %)) types)


Checking more arguments within incomplete exploration

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

--- src/conexp/fca/exploration.clj
+++ src/conexp/fca/exploration.clj
@@ -210,7 +210,11 @@
         background-knowledge       (or background-knowledge #{}),
         handler                    (or handler default-handler-for-incomplete-counterexamples)]
     ;; check arguments
-    (assert (set? background-knowledge))
+    (assert (and (context? possible-ctx)
+                 (context? certain-ctx))
+            "Arguments to :context or :possible-context/:certain-context must be contexts")
+    (assert (set? background-knowledge)
+            "Background knowledge must be given as set")
     (assert (= (attributes certain-ctx)
                (attributes possible-ctx))
             "Given contexts must coincide on the set of attributes")


added state for "page"

added state for "page"

--- src/ui/state.cljs
+++ src/ui/state.cljs
@@ -19,4 +19,35 @@
                            (sort (into [] (take 100 (repeatedly rand-word))))
                            (range)))
          :menu [{:name "Typeahead" :path "/typeahead"}
-                {:name "Dimple" :path "/graph"}]}))
+                {:name "Dimple" :path "/graph"}
+                {:name "Mesh" :path "/mesh"}]
+         :content {:title "Thinking Clojurescript"
+                   :issue "Issue #1"
+                   :publisher "The Facjure Review"
+                   :logo "http://placekitten.com/404/404"
+                   :editorial "Object Oriented programming as a paradigm has many real
+                   benefits but one of the worst plagues it has inflicted on
+                   programming culture is obscuring data. Functional programming
+                   is not a silver bullet but its emphasis on unadorned data is
+                   a guiding light. No models."
+                   :interviews ["Bruce Hauman, " "David Nolen, " "Joel Holdbrooks"]
+                   :developer-pic "http://placekitten.com/404/404"
+                   :essays ["“A meditation in Edn” by Priyatam Mudivarti"]
+                   :quotes {:nolen-tweet "“We create things with our tools, and
+                    our tools have consequences”"
+                            :dev-quote "The Functional final frontier: Clojurescript"}}}))
+
+(def history
+  (atom [@app-state]))
+
+(add-watch
+ app-state :history
+ (fn [_ _ old new]
+   #_(println old new history)
+   (when-not (= (last @history) new)
+     (swap! history conj new))))
+
+(defn undo! []
+  (when (> (count @history) 1)
+    (swap! history pop)
+    (reset! app-state (last @history))))


Fix CommCareEngine import

Fix CommCareEngine import

--- util/clojure-cli/src/commcare_cli/app_host.clj
+++ util/clojure-cli/src/commcare_cli/app_host.clj
@@ -8,7 +8,7 @@
            [org.commcare.core.parse CommCareTransactionParserFactory ParseUtils]
            [org.commcare.data.xml DataModelPullParser]
            [org.commcare.session SessionFrame]
-           [org.commcare.util CommCareConfigEngine]
+           [org.commcare.util.engine CommCareConfigEngine]
            [org.commcare.util.cli ApplicationHost]
            [org.commcare.util.screen MenuScreen EntityScreen]
            [org.commcare.util.mocks CLISessionWrapper MockUserDataSandbox]


Add support for "-v" option to get version

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- src/obcc/core.clj
+++ src/obcc/core.clj
@@ -14,6 +14,7 @@
 (def cli-options
   ;; An option with a required argument
   [["-p" "--path PATH" "path to chaincode project" :default "./"]
+   ["-v" "--version"]
    ["-h" "--help"]])

 (defn exit [status msg & rest]
@@ -27,8 +28,10 @@
    "clean",   ["Clean the chaincode project",          cleancmd/run]
    "package", ["Package the chaincode for deployment", packagecmd/run]})

+(defn version [] (str "obcc version: v" util/app-version))
+
 (defn usage [options-summary]
-  (->> (flatten [(str "obcc version: v" util/app-version)
+  (->> (flatten [(version)
                  ""
                  "Usage: obcc [options] action"
                  ""
@@ -43,25 +46,33 @@

 (defn -main [& args]
   (let [ {:keys [options arguments errors summary]} (parse-opts args cli-options) ]
-    (cond (or (:help options) (= (count arguments) 0))
-          (exit 0 (usage summary))
+    (cond

-          (not= errors nil)
-          (exit -1 "Error: " (string/join errors))
+      (:help options)
+      (exit 0 (usage summary))

-          (not= (count arguments) 1)
-          (exit -1 "Error: bad argument count")
+      (:version options)
+      (exit 0 (version))

-          :else
-          (let [path (:path options)
-                file (io/file path util/configname)]
-            (do
-              (cond (not (.isFile file))
-                    (exit -1 "Configuration not found at " path)
-                    :else
-                    (let [config (config/parser file)]
-                      (if-let [[_ func] (subcommands (first arguments))]
-                        (do
-                          (func path config)
-                          (System/exit 0))
-                        (exit 1 (usage summary))))))))))
+      (= (count arguments) 0)
+      (exit 0 (usage summary))
+
+      (not= errors nil)
+      (exit -1 "Error: " (string/join errors))
+
+      (not= (count arguments) 1)
+      (exit -1 "Error: bad argument count")
+
+      :else
+      (let [path (:path options)
+            file (io/file path util/configname)]
+        (do
+          (cond (not (.isFile file))
+                (exit -1 "Configuration not found at " path)
+                :else
+                (let [config (config/parser file)]
+                  (if-let [[_ func] (subcommands (first arguments))]
+                    (do
+                      (func path config)
+                      (System/exit 0))
+                    (exit 1 (usage summary))))))))))


migration

migration

--- src/ophion/db.clj
+++ src/ophion/db.clj
@@ -27,7 +27,7 @@

 (defn property-index-name
   [index]
-  (string/join "-" (concat (map name (keys index)) ["index"])))
+  (string/join "-" (concat (map name (map first index)) ["index"])))

 (defn edge-index-name
   [edge-label index]
@@ -35,7 +35,7 @@
    "-"
    (concat
     [(name edge-label)]
-    (sort (map name (keys index)))
+    (sort (map name (map first index)))
     ["vertex-centric-index"])))

 (defn janus-get-property-key
@@ -180,8 +180,8 @@
     {:end String}
     {:genotype String}
     {:phenotype String}
-    [:chromosome String :start String :end String]
-    [:referenceName String :start String :end String]]
+    [[:chromosome String] [:start String] [:end String]]
+    [[:referenceName String] [:start String] [:end String]]]
    :edges
    [{:variantIn {:featureId String}}
     {:expressionLevel {:level Double}}


upgrade codox to work with lein 2.9.0 (#14133)

--- contrib/clojure-package/project.clj
+++ contrib/clojure-package/project.clj
@@ -36,7 +36,7 @@
                  [org.apache.logging.log4j/log4j-api "2.8.1"]
                  [org.slf4j/slf4j-log4j12 "1.7.25" :exclusions [org.slf4j/slf4j-api]]]
   :pedantic? :skip
-  :plugins [[lein-codox "0.10.3" :exclusions [org.clojure/clojure]]
+  :plugins [[lein-codox "0.10.6" :exclusions [org.clojure/clojure]]
             [lein-cloverage "1.0.10" :exclusions [org.clojure/clojure]]
             [lein-cljfmt "0.5.7"]]
   :codox {:namespaces [#"^org\.apache\.clojure-mxnet\.(?!gen).*"]}


not return internal fields in introspection query

--- src/graphql_clj/introspection.clj
+++ src/graphql_clj/introspection.clj
@@ -1,5 +1,6 @@
 (ns graphql-clj.introspection
   (:require [graphql-clj.parser :as parser]
+            [clojure.string :as string]
             [clojure.java.io :as io]))

 (def introspection-schema-str (slurp (io/resource "introspection.schema")))
@@ -112,7 +113,10 @@

        ;; OBJECT and INTERFACE only
        :fields (when (contains? #{:OBJECT :INTERFACE} kind)
-                 (filter #(not (= '__typename (:name %))) (:fields type))) ; defer resolving of fields
+                 (filter (fn [field]
+                           (and (not (= '__typename (:name field)))
+                                (not (string/starts-with? (:name field) "__"))))
+                         (:fields type))) ; defer resolving of fields
        ;; OBJECT only
        :interfaces [] ; TODO

@@ -137,6 +141,8 @@
 (defn schema-types [schema]
   (assert (map? (:type-map schema)) (format "schema has no :type-map: %s" schema))
   (let [types (->> (vals (:type-map schema))
+                   (filter (fn [type]
+                             (not (string/starts-with? (:name type) "__"))))
                    (map (fn [t]
                           (assert (:name t) (format "type doesn't have a name: %s" t))
                           (assoc t :type-name (:name t))))


Use the clojars version of boot-junit

Use the clojars version of boot-junit

--- build.boot
+++ build.boot
@@ -1,6 +1,6 @@
 (set-env!
  :source-paths #{"src/main/java" "src/test/java"}
- :dependencies '[[radicalzephyr/boot-junit "0.1.0" :scope "test"]])
+ :dependencies '[[radicalzephyr/boot-junit "0.1.0-SNAPSHOT" :scope "test"]])

 (def +version+ "0.1.0")


Revert to standard dependency management with boot

--- build.boot
+++ build.boot
@@ -1,14 +1,36 @@
 (merge-env!
-  :init-ns      'user
-  :dependencies '[[seancorfield/boot-tools-deps "0.1.4"]]
-  :repositories [["clojars" {:url      "https://clojars.org/repo"
-                             :username (System/getenv "CLOJARS_USER")
-                             :password (System/getenv "CLOJARS_PASS")}]])
-
-(require '[boot-tools-deps.core :as boot-tools-deps])
-
-(boot-tools-deps/load-deps {:resolve-aliases   [:build]
-                            :classpath-aliases [:build]})
+  :resource-paths #{"src/main/cljc"
+                    "src/spec/cljc"
+                    "src/main/js"}
+  :dependencies   '[;; Clojure and ClojureScript
+                    [org.clojure/clojure         "1.9.0"]
+                    [org.clojure/clojurescript   "1.9.946"]
+
+                    ;; utility
+                    [moxaj/macrowbar             "0.1.2"]
+
+                    ;; testing
+                    [org.clojure/test.check      "0.10.0-alpha1" :scope "test"]
+
+                    ;; dev
+                    [nodisassemble               "0.1.3" :scope "test"]
+
+                    ;; documentation
+                    [boot-codox                  "0.10.3" :scope "test"]
+
+                    ;; build script
+                    [adzerk/boot-test            "1.2.0" :scope "test"]
+                    [adzerk/boot-reload          "0.5.1" :scope "test"]
+                    [adzerk/boot-cljs            "2.0.0" :scope "test"]
+                    [adzerk/boot-cljs-repl       "0.3.3" :scope "test"]
+                    [pandeiro/boot-http          "0.8.3" :scope "test"]
+                    [crisptrutski/boot-cljs-test "0.3.0" :scope "test"]
+                    [com.cemerick/piggieback     "0.2.1" :scope "test"]
+                    [weasel                      "0.7.0" :scope "test"]
+                    [org.clojure/tools.nrepl     "0.2.13" :scope "test"]]
+  :repositories   [["clojars" {:url      "https://clojars.org/repo"
+                               :username (System/getenv "CLOJARS_USER")
+                               :password (System/getenv "CLOJARS_PASS")}]])

 (require '[boot.util :as boot-util]
          '[adzerk.boot-test :as boot-test]
@@ -77,21 +99,48 @@

 ;; Tasks

+(deftask testing
+  "Adds the test files to the fileset."
+  []
+  (merge-env! :resource-paths #{"src/test/cljc"
+                                "src/test/cljs"
+                                "src/test/resources"})
+  identity)
+
+(deftask benchmarking
+  "Adds the benchmark files to the fileset."
+  []
+  (merge-env! :resource-paths #{"src/benchmark/cljc"
+                                "src/benchmark/java"
+                                "src/benchmark/resources"}
+              :dependencies   '[[com.cognitect/transit-clj         "0.8.300"]
+                                [com.cognitect/transit-cljs        "0.8.239"]
+                                [com.damballa/abracad              "0.4.14-alpha2"]
+                                [gloss                             "0.2.6"]
+                                [cheshire                          "5.7.1"]
+                                [funcool/octet                     "1.0.1"]
+                                [com.google.protobuf/protobuf-java "3.3.1"]
+                                [com.taoensso/nippy                "2.14.0-alpha1"]
+                                [criterium                         "0.4.4"]])
+  identity)
+
 (deftask dev
   "Dev task for proto-repl."
   []
-  (boot-tools-deps/load-deps {:resolve-aliases   [:dev]
-                              :classpath-aliases [:dev]})
+  (merge-env! :init-ns        'user
+              :resource-paths #{"src/dev/clj"}
+              :dependencies   '[[org.clojure/tools.namespace "0.2.11"]
+                                [proto-repl                  "0.3.1" :exclusions [org.clojure/core.async]]])
   (require 'clojure.tools.namespace.repl)
-  (apply (resolve 'clojure.tools.namespace.repl/set-refresh-dirs)
-         (get-env :directories))
-  (comp (boot-tools-deps/deps :aliases [:test :benchmark :dev])
+  (apply (resolve 'clojure.tools.namespace.repl/set-refresh-dirs) (get-env :directories))
+  (comp (testing)
+        (benchmarking)
         (javac)))

 (deftask test-clj
   "Runs the tests on JVM."
   []
-  (comp (boot-tools-deps/deps :aliases [:test])
+  (comp (testing)
         (boot-test/test :namespaces clj-test-namespaces)))

 (deftask test-node
@@ -99,7 +148,7 @@
   [o opt          VAL kw   "The optimization level for the cljs compiler."
    s self-hosted?     bool "True if self-hosted."]
   (let [opt (or opt :none)]
-    (comp (boot-tools-deps/deps :aliases [:test])
+    (comp (testing)
           (if self-hosted?
             (with-pass-thru fileset
               (proc "lumo"
@@ -122,7 +171,7 @@
    e js-env VAL kw "The js environment."]
   (let [opt    (or opt :none)
         js-env (or js-env :slimer)]
-    (comp (boot-tools-deps/deps :aliases [:test])
+    (comp (testing)
           (boot-cljs-test/test-cljs :js-env        js-env
                                     :namespaces    cljs-test-namespaces
                                     :optimizations opt
@@ -188,7 +237,8 @@
      - (boot-cljs-repl/start-repl)
    localhost:3000"
   [o opt VAL kw  "The compiler optimization level."]
-  (comp (boot-tools-deps/deps :aliases [:test :benchmark])
+  (comp (benchmarking)
+        (testing)
         (javac)
         (boot-http/serve :dir "target/browser")
         (watch)
@@ -201,7 +251,8 @@
 (deftask run-node-repl
   "Runs a node repl."
   []
-  (comp (boot-tools-deps/deps :aliases [:test :benchmark])
+  (comp (testing)
+        (benchmarking)
         (proc "lumo"
               "-c" (str "\"" (System/getProperty "fake.class.path") "\"")
               "-k" "lumo_cache"


Use the latest real Om release for now

Use the latest real Om release for now

--- build.boot
+++ build.boot
@@ -39,7 +39,7 @@
                  ;; Web app
                  [com.cognitect/transit-cljs "0.8.232"]
                  [org.clojure/core.async "0.2.374"]
-                 [org.omcljs/om "1.0.0-alpha26-SNAPSHOT"]
+                 [org.omcljs/om "1.0.0-alpha25"]
                  [cljsjs/showdown "0.4.0-1"]])

 (task-options!
@@ -77,7 +77,6 @@
         (cljs :optimizations :simple)
         (aot :namespace '#{server.core})))

-
 (deftask run-production
   [p path PATH str "Path to a CUSTARD Git repository"]
   (comp (environ :env {:custard-path path})


Update to latest Aleph/Manifold

Update to latest Aleph/Manifold

--- build.boot
+++ build.boot
@@ -61,8 +61,8 @@
    [selmer "1.10.6"]
    [yada "1.2.1" :exclusions [aleph manifold ring-swagger prismatic/schema]]

-   [aleph "0.4.2-alpha8"]
-   [manifold "0.1.6-alpha1"]
+   [aleph "0.4.3"]
+   [manifold "0.1.6"]
    [metosin/ring-swagger "0.22.10"]

    ;; App deps


license format fixed in build script

license format fixed in build script

--- build.boot
+++ build.boot
@@ -42,8 +42,8 @@
  pom {:project     'codamic/hellhound
       :version     VERSION
       :description DESCRIPTION
-      :license     {:name "GPLv3"
-                    :url  "https://www.gnu.org/licenses/gpl.html"}
+      :license     {"GPLv3"
+                    "https://www.gnu.org/licenses/gpl.html"}
       :url         "http://github.com/Codamic/hellhound"
       :scm         {:url "https://github.com/Codamic/hellhound"}}


Implemented Offline Repl via Nailgun

Implemented Offline Repl via Nailgun

--- src/de/kotka/gorilla/nails.clj
+++ src/de/kotka/gorilla/nails.clj
@@ -24,11 +24,14 @@
   (:use
      (de.kotka.gorilla [util :only (with-command-line
                                      clj->vim
-                                     resolve-and-load-namespace)]
-                       backend))
+                                     resolve-and-load-namespace
+                                     make-reader)]
+                       backend)
+     [clojure.contrib.def :only (defvar)])
   (:import
      com.martiansoftware.nailgun.NGContext
      clojure.lang.LineNumberingPushbackReader
+     (clojure.lang Var Compiler)
      (java.io InputStreamReader OutputStreamWriter PrintWriter)))

 (defmacro defnail
@@ -126,3 +129,138 @@
       (prn (if first
              (macroexpand-1 expression)
              (macroexpand   expression))))))
+
+; The Repl
+(defvar *repls*
+  (ref {})
+  "A map holding the references to all running repls indexed by their repl id.")
+
+(let [id (ref 0)]
+  (defn repl-id
+    "Get a new Repl id."
+    []
+    (dosync (alter id inc))))
+
+(defstruct
+  #^{:doc
+  "The structure for the Repl interface. Holds the state of a Repl between
+  invokations. The members correspond to the Vars as bound be with-binding."}
+  repl
+  :id :ns :warn-on-reflection :print-meta :print-length :print-level
+  :compile-path :command-line-args :expr1 :expr2 :expr3 :exception)
+
+(defn make-repl
+  [id args]
+  ; Make sure user namespace exists.
+  (binding [*ns* *ns*]
+    (in-ns 'user))
+  (struct-map repl
+              :id                 id
+              :ns                 (the-ns 'user)
+              :warn-on-reflection *warn-on-reflection*
+              :print-meta         *print-meta*
+              :print-length       *print-length*
+              :print-level        *print-level*
+              :compile-path       (System/getProperty
+                                    "clojure.compile.path"
+                                    "classes")
+              :command-line-args  args
+              :expr1              nil
+              :expr2              nil
+              :expr3              nil
+              :exception          nil
+              :line               0))
+
+(defn root-cause
+  [cause]
+  (if-let [cause (.getCause cause)]
+    (recur cause)
+    cause))
+
+(defnail ReplStart
+  "Usage: ng de.kotka.gorilla.nails.ReplStart"
+  []
+  (let [id       (repl-id)
+        the-repl (make-repl id (.getArgs nailContext))]
+    (dosync (commute *repls* assoc id the-repl))
+    (println id)))
+
+(defnail ReplSend
+  "Usage: ng de.kotka.gorilla.nails.ReplSend [options]"
+  [[id   i "The id of the Repl to which the expression is sent.
+                    -1 for one-shot." "-1"]
+   [file f "Set the source name to the given file." "REPL"]
+   [line l "Set the initial line number." "0"]]
+  (let [id       (Integer/parseInt id)
+        the-repl (if (= id -1)
+                   (make-repl nil (.getArgs nailContext))
+                   (*repls* id))]
+    (if the-repl
+      (try
+        (Var/pushThreadBindings
+          {Compiler/SOURCE file
+           Compiler/LINE   (var-get Compiler/LINE)})
+        (binding [*in*                 (-> nailContext
+                                         .in
+                                         InputStreamReader.
+                                         (make-reader (if (= line "0")
+                                                        (the-repl :line)
+                                                        (Integer/parseInt 0))))
+                  *ns*                 (the-repl :ns)
+                  *warn-on-reflection* (the-repl :warn-on-reflection)
+                  *print-meta*         (the-repl :print-meta)
+                  *print-length*       (the-repl :print-length)
+                  *print-level*        (the-repl :print-level)
+                  *compile-path*       (the-repl :compile-path)
+                  *command-line-args*  (the-repl :command-line-args)
+                  *1                   (the-repl :expr1)
+                  *2                   (the-repl :expr2)
+                  *3                   (the-repl :expr3)
+                  *e                   (the-repl :exception)]
+          (try
+            (let [eof   (Object.)
+                  exprs (take-while #(not= % eof)
+                                    (repeatedly #(read *in* false eof)))]
+              (dorun exprs)
+              (doseq [expr exprs]
+                (let [value (eval expr)]
+                  (prn value)
+                  (when-not (= *1 value)
+                    (set! *3 *2)
+                    (set! *2 *1)
+                    (set! *1 value)))))
+            (catch Throwable e
+              (-> (if (instance? clojure.lang.Compiler$CompilerException e)
+                    e
+                    (root-cause e))
+                .toString
+                println)
+              (set! *e e)))
+          (when-not (= id -1)
+            (let [new-repl
+                  (struct-map repl
+                              :id                 id
+                              :ns                 *ns*
+                              :warn-on-reflection *warn-on-reflection*
+                              :print-meta         *print-meta*
+                              :print-length       *print-length*
+                              :print-level        *print-level*
+                              :compile-path       *compile-path*
+                              :command-line-args  *command-line-args*
+                              :expr1              *1
+                              :expr2              *2
+                              :expr3              *3
+                              :exception          *e
+                              :line               (dec (.getLineNumber *in*)))]
+              (dosync (commute *repls* assoc id new-repl)))))
+        (finally
+          (Var/popThreadBindings)))
+    (println "ERROR: no repl of that id"))))
+
+(defnail ReplStop
+  "Usage: ng de.kotka.gorilla.nails.ReplStop [options]"
+  [[id   i "The id of the Repl to stop." ""]
+   [all?   "Stop all Repls."]]
+  (if all
+    (dosync (ref-set *repls* {}))
+    (dosync (alter *repls* dissoc (Integer/parseInt id)))))


Update docs.

Update docs.

--- src/quil/core.clj
+++ src/quil/core.clj
@@ -4326,8 +4326,8 @@
   sketch
   "Create and start a new visualisation applet.

-   :size           - a vector of width and height for the sketch or :fullscreen.
-                     Defaults to [500 300].
+   :size           - a vector of width and height for the sketch or
+                     :fullscreen. Defaults to [500 300].

    :renderer       - Specify the renderer type. One of :p2d, :p3d,
                      :java2d, :opengl, :pdf). Defaults to :java2d.
@@ -4349,20 +4349,22 @@
    :features       - A vector of keywords customizing sketch behaviour.
                      Supported features:

-                     :keep-on-top - Sketch window will always be above other windows.
-                                    Note: some platforms might not support
-                                    always-on-top windows.
+                     :keep-on-top - Sketch window will always be above other
+                                    windows. Note: some platforms might not
+                                    support always-on-top windows.

                      :exit-on-close - Shutdown JVM  when sketch is closed.

                      :resizable - Makes sketch resizable.

-                     :no-safe-draw - Do not catche and print exception in the draw fn.
-                                     By default all exceptions thrown inside draw function are
-                                     catched so sketch doesn't break if something goes wrong.
-
-                     :present - Switch to present mode (fullscreen without borders, OS panels). You may
-                                want to use this feature together with :size :fullscreen.
+                     :no-safe-draw - Do not catch and print exception in the
+                                     draw fn. By default all exceptions thrown
+                                     inside draw function are catched so sketch
+                                     doesn't break if something goes wrong.
+
+                     :present - Switch to present mode (fullscreen without
+                                borders, OS panels). You may want to use this
+                                feature together with :size :fullscreen.

                      Usage example: :features [:keep-on-top :present]

@@ -4391,7 +4393,7 @@
                      Takes 1 argument - wheel rotation, an int.
                      Negative values if the mouse wheel was rotated
                      up/away from the user, and positive values
-                     if the mouse wheel was rotated down/ towards the user
+                     if the mouse wheel was rotated down/towards the user

    :key-pressed    - Called every time any key is pressed.


max-message-size calculated number 16MB

max-message-size calculated number 16MB

--- src/kixi/eventlog/application.clj
+++ src/kixi/eventlog/application.clj
@@ -42,7 +42,7 @@
   ([{:keys [profile authentication topics]}]
    (let [config            (config profile)
          zookeeper-connect (:zookeeper config)
-         max-message-size  (or (System/getenv "TOPIC_MAX_MESSAGE_SIZE") "1048576")
+         max-message-size  (or (System/getenv "TOPIC_MAX_MESSAGE_SIZE") (str (* 16 1024 1024)))
          producer          (new-producer :max-message-size max-message-size)
          topic-names       (or (System/getenv "TOPICS") topics)
          topics            (new-topics


import StringWriter

import StringWriter

--- src/learnclojure/chapt2/core3.clj
+++ src/learnclojure/chapt2/core3.clj
@@ -1,5 +1,6 @@
 (ns learnclojure.chapt2.core3
-  (:import (java.util Date)))
+  (:import (java.util Date)
+           (java.io StringWriter)))
 ;;高阶函数
 ;;一个返回摸个给定数字与它的参数的和的函数
 (defn adder
@@ -25,7 +26,7 @@
 (def *out*-logger (print-logger *out*))
 (*out*-logger "hello")
 ;;把消息打印到一个内存buffer,使用java.io.StringWriter
-(def writer (java.io.StringWriter.))
+(def writer (StringWriter.))
 (def retained-logger (print-logger writer))
 (retained-logger "hehe")
 (str writer)
@@ -76,12 +77,12 @@
                (filter #(zero? (rem n %)))
                empty?)))
 ;;数字大的时候函数运行时间比较长
-(time  (prime? 1125899906842679))
+(time (prime? 1125899906842679))
 ;;用memoize缓存prime？，函数调用一次后再以相同的参数调用会马上返回结果
 ;;所以下面的第二次调用(m-prime? 1125899906842679)比第一次快的多
 (let [m-prime? (memoize prime?)]
-(time (m-prime? 1125899906842679))
-(time (m-prime? 1125899906842679)))
+  (time (m-prime? 1125899906842679))
+  (time (m-prime? 1125899906842679)))
 ;;有副作用的函数就不是引用透明的，所以不能内存化
 ;;如果内存化rand-int，会如何？
 (repeatedly 10 (partial rand-int 10))


schema: more comments

schema: more comments

--- examples/_common/middleware/schema.cljs
+++ examples/_common/middleware/schema.cljs
@@ -3,8 +3,10 @@
   (:require-macros [reagent.ratom :refer [run!]]))

 (defn add
-  "Middleware will validate the model returned from reconcile function.
-  Throws an exception if validation fails effectively prohibiting model change to unallowed state.
+  "Middleware will validate the model returned from reconcile function using Plumatic Schema library.
+  Strives to provide a better logging than s/defn.
+  Logs problems and throws an exception if validation fails effectively prohibiting model change to unallowed state.
+
   Add it as close to spec as possible in order to not propagate the invalid model to other middlewares."
   [spec schema]
   (update spec :reconcile
@@ -12,7 +14,7 @@
             (fn validated-reconcile [model action]
               (let [new-model (reconcile model action)]
                 (when-let [problems (s/check schema new-model)]
-                  ; using console log for better printing in Chrome console
+                  ; using console log for better printing in Chrome console (in particular with binaryage/cljs-devtools)
                   (.log js/console "VALIDATION PROBLEMS:" problems)
                   (throw (ex-info "Model validation failed. See more info above." {})))


Add a page to display the range method.

Add a page to display the range method.

--- src/my_noir_lab/views/welcome.clj
+++ src/my_noir_lab/views/welcome.clj
@@ -11,4 +11,9 @@
 (defpage "/my-page" []
   (common/site-layout
    [:h1 "Welcome to my site!"]
-   [:p#wrapper "Hope you like it!"]))+   [:p#wrapper "Hope you like it!"]))
+
+(defpage "/range" []
+  (common/site-layout
+   [:h1 "range 1 100"]
+   [:p#wrapper (map #(str "<i>" % "</i> ") (range 1 100))]))


Don't let the indexing thread OOM when decoding giant MIME parts

--- src/net/dishevelled/mailindex.clj
+++ src/net/dishevelled/mailindex.clj
@@ -27,6 +27,8 @@
   (:gen-class))

+(def MAX_PART_BYTES (* 20 1024 1024))
+
 (def date-output-format
      (doto (SimpleDateFormat. "EEE, dd MMM yyyy HH:mm:ss Z")
        (.setTimeZone (SimpleTimeZone. 0 "UTF"))))
@@ -182,15 +184,18 @@
   "Recursively parses a MIME part converting it into a sequence of strings."
   [^Part part]
   (try
-    (let [content (.getContent part)]
-      (condp re-find (.toLowerCase (.getContentType part))
-        #"^text/(plain|calendar)" [(if (string? content)
-                                     content
-                                     (slurp content))]
-        #"^text/(html|xml)" [(strip-html content)]
-        #"^message/rfc822" (parse-mime-part content)
-        #"^multipart/" (parse-mime-multipart (.getContent part))
-        []))
+    (if (> (.getSize part) MAX_PART_BYTES)
+      (do (println "Skipping giant part: " (.getSize part))
+          [])
+      (let [content (.getContent part)]
+        (condp re-find (.toLowerCase (.getContentType part))
+          #"^text/(plain|calendar)" [(if (string? content)
+                                       content
+                                       (slurp content))]
+          #"^text/(html|xml)" [(strip-html content)]
+          #"^message/rfc822" (parse-mime-part content)
+          #"^multipart/" (parse-mime-multipart (.getContent part))
+          [])))
     (catch java.io.UnsupportedEncodingException e
       [])))


reduce verbosity of NO-ARG-DOC-FOUND and also specify appropriate default bufnum docstring

--- src/overtone/sc/ugen/defaults.clj
+++ src/overtone/sc/ugen/defaults.clj
@@ -21,10 +21,10 @@
 (def UGEN-RATE-SORT-FN
   (zipmap UGEN-RATE-PRECEDENCE (range (count UGEN-RATE-PRECEDENCE))))

-(def NO-ARG-DOC-FOUND "Sorry, missing docstring")
+(def NO-ARG-DOC-FOUND "-")

 (def DEFAULT-ARG-DOCS
-  {"bufnum" "buf bum"})
+  {"bufnum" "The index of the buffer to use."})

 (def DOC-WIDTH 60)


:globe_with_meridians: Snap to Grid French

Signed-off-by: mathieu.brunot <cbb78c9d6ecc8139b4697c3352cc1f1edbdf61d7@monogramm.io>

--- frontend/src/uxbox/main/locales/fr.cljs
+++ frontend/src/uxbox/main/locales/fr.cljs
@@ -123,7 +123,7 @@
    "header.image" "Image (Ctrl + I)"
    "header.rules" "Règles"
    "header.grid" "Grille (Ctrl + G)"
-   "header.grid-snap" "Snap to grid"
+   "header.grid-snap" "Coller à la grille"
    "header.align" "Aligner (Ctrl + A)"
    "header.view-mode" "Mode visualisation (Ctrl + P)"


Show all keys on flows in the debugger

Show all keys on flows in the debugger

--- src/aurora/editor/ui.cljs
+++ src/aurora/editor/ui.cljs
@@ -304,55 +304,15 @@
       )]]
   )

-(defmulti node->ui type)
-
-(defmethod node->ui js/aurora.language.Union [f i]
-  (list [:p "U" i]
-        [:table
-         [:tr
-          [:td "nodes"]
-          [:td (pr-str (:nodes f))]]]))
-
-(defmethod node->ui js/aurora.language.Index [f i]
-  (list [:p "I" i]
-        [:table
-         [:tr
-          [:td "nodes"]
-          [:td (pr-str (:nodes f))]]
-         [:tr
-          [:td "key-ixes"]
-          [:td (pr-str (:key-ixes f))]]]))
-
-(defmethod node->ui js/aurora.language.Lookup [f i]
-  (list [:p "L" i]
-        [:table
-         [:tr
-          [:td "nodes"]
-          [:td (pr-str (:nodes f))]]
-         [:tr
-          [:td "index-node"]
-          [:td (pr-str (:index-node f))]]]
-        [:table
-         [:tr
-          [:td "key-ixes"]
-          [:td (pr-str (:key-ixes f))]]
-         [:tr
-          [:td "val-ixes"]
-          [:td (pr-str (:val-ixes f))]]]))
-
-
-(defmethod node->ui js/aurora.language.FilterMap [f i]
-  (list [:p "F" i]
-        [:table
-         [:tr
-          [:td "nodes"]
-          [:td (pr-str (:nodes f))]]
-         [:tr
-          [:td "fn"]
-          [:td (pr-str (:fun&args f))]]]))
-
-(defmethod node->ui :default [n]
-  (pr-str n))
+(defn node->ui [flow node]
+  (list [:p (condp = (type flow)
+              language/Union "U"
+              language/Index "I"
+              language/Lookup "L"
+              language/FilterMap "F") node]
+        (apply vector :table
+               (for [[k v] flow]
+                 [:tr [:td (str k)] [:td (pr-str v)]]))))

 (defcomponent debugger-item [flow i active? current?]
   [:li [:div


Modify source path in dev config after having introduced boot

--- env/dev/cljs/cljs_repl_web/config.cljs
+++ env/dev/cljs/cljs_repl_web/config.cljs
@@ -6,5 +6,5 @@
      :production? false
      :base-path base-path
      :core-cache-url (str base-path "/js-cache/core.cljs.cache.aot.json")
-     :src-paths [(str base-path "/js/compiled/out")]
+     :src-paths [(str base-path "/main.out")]
      :verbose-repl? true}))


Fix wrong implementation of hmac-sha256.

--- src/buddy/crypto/core.clj
+++ src/buddy/crypto/core.clj
@@ -53,14 +53,15 @@

 (defn hmac-sha256
   "Returns a salted hmac-sha256."
-  [value secret & {:keys [salt] :or {salt ""}}]
-  (let [md  (-> (MessageDigest/getInstance "SHA-256")
-                (.update (str->bytes secret))
-                (.update (str->bytes salt)))
-        mac (-> (Mac/getInstance "HmacSHA256")
-                (.init (SecretKeySpec. (.digest md) "HmacSHA256"))
-                (.doFinal (str->bytes value)))]
-    (bytes->hex mac)))
+  [value secret & [{:keys [salt] :or {salt ""}}]]
+  (let [md  (doto (MessageDigest/getInstance "SHA-256")
+              (.update (str->bytes secret))
+              (.update (str->bytes salt)))
+        mac (doto (Mac/getInstance "HmacSHA256")
+              (.init (SecretKeySpec. (.digest md) "HmacSHA256")))]
+    (->
+      (.doFinal mac (str->bytes value))
+      (bytes->hex))))

 (defn timestamp
   "Get current timestamp."


Show username instead of email.

Show username instead of email.

--- src/clj/hatnik/web/server/renderer.clj
+++ src/clj/hatnik/web/server/renderer.clj
@@ -41,14 +41,14 @@

    [:div#navbarCollapse.collapse.navbar-collapse
     (if user
-                                        ; User log in
+      ; User logged in
       [:ul.nav.navbar-nav.navbar-right
        [:li
-        [:a {:href "#"} (:email user)]]
+        [:a (:github-login user)]]
        [:li
         [:a.btn {:href "/api/logout"} "Logout"]]]

-                                        ; User don't log in
+      ; User is not logged in
       [:ul.nav.navbar-nav.navbar-right
        [:li
         [:a.btn


last review of plots.clj

last review of plots.clj

--- src/clj/org/openforis/ceo/db/plots.clj
+++ src/clj/org/openforis/ceo/db/plots.clj
@@ -21,7 +21,7 @@
                             :analyses assigned})
                          (call-sql "select_limited_project_plots" project-id max-plots)))))

-(defn- prepare-sample-object [plot-id project-id]
+(defn- prepare-samples-object [plot-id project-id]
   (mapv (fn [{:keys [sample_id point sampleId geom value]}]
           {:id       sample_id
            :point    point
@@ -36,7 +36,7 @@
   (or (dissoc (tc/jsonb->clj extra-plot-info) :gid :lat :lon :plotid)
       {}))

-(defn- build-plot-object [plot-info project-id]
+(defn- prepare-plot-object [plot-info project-id]
   (let [{:keys [plot_id center flagged plotId geom extra_plot_info]} plot-info]
     {:id            plot_id
      :projectId     project-id ;TODO why do we need to return a value that is already known
@@ -45,15 +45,15 @@
      :plotId        plotId
      :geom          (tc/jsonb->clj geom)
      :extraPlotInfo (clean-extra-plot-info extra_plot_info)
-     :samples       (prepare-sample-object plot_id project-id)}))
+     :samples       (prepare-samples-object plot_id project-id)}))

 (defn get-project-plot [{:keys [params]}]
   (let [project-id (tc/str->int (:projectId params))
         plot-id    (tc/str->int (:plotId params))]
-    (data-response (build-plot-object (first (call-sql "select_plot_by_id"
-                                                       project-id
-                                                       plot-id))
-                                      project-id))))
+    (data-response (prepare-plot-object (first (call-sql "select_plot_by_id"
+                                                         project-id
+                                                         plot-id))
+                                        project-id))))

 (defn- unlock_plots [user-id]
   (call-sql-opts "unlock_plots" {:log? false} user-id))
@@ -93,7 +93,7 @@
                                  (:plot_id plot-info)
                                  user-id
                                  (time-plus-five-min))
-                       (build-plot-object plot-info project-id))
+                       (prepare-plot-object plot-info project-id))
                      "done"))))

 (defn get-plot-by-id [{:keys [params]}]


clear colspan warning

clear colspan warning

--- src/cljs/clj_money/views/accounts.cljs
+++ src/cljs/clj_money/views/accounts.cljs
@@ -229,7 +229,7 @@
      [:th.col-sm-2.text-right "Balance"]]
     (if @items
       (map item-row @items)
-      [:tr [:td {:colspan 4} [:span.inline-status "Loading..."]]])]])
+      [:tr [:td {:colSpan 4} [:span.inline-status "Loading..."]]])]])

 (defn- show-account [id]
   (let [account (r/atom {})


Trello board view and front end for posting cards

--- src/cljs/new_website/static_views.cljs
+++ src/cljs/new_website/static_views.cljs
@@ -426,9 +426,57 @@
   (render [_]
     (dom/iframe {:src "https://trello.com/b/N9PkMev2.html"
                  :frameBorder 0
-                 :width 800 :height 400})))
-
-(defcomponent todo-view [_ _]
+                 :id "trello-iframe"
+                 :width 800 :height 350})))
+
+(defcomponent todo-view [app owner]
   (render [_]
     (dom/section
-      (->trello-board-view {}))))
+      (dom/p
+        {:style {:margin-bottom "12px" :margin-left "8px"}}
+        (str "As an experiment, my personal Trello board is "
+             "available below. You can post a card to it if you "
+             "would like to find a time to meet. You can also send me "
+             "an email if you want, but this is a much lower noise channel."))
+      (->trello-board-view {})
+      (dom/div
+        {:id "post-trello-card-form"}
+        (dom/div
+          {:class "main-form"}
+          (dom/div
+            {:class "input-group"}
+            (dom/input
+              {:ref "name-input" :id "name"
+               :placeholder "Your name"
+               :value (:name (:trello-card app))
+               :on-change (fn [_]
+                            (let [this (om/get-node owner "name-input")]
+                              (om/update! app [:trello-card :name] (.-value this))))}))
+          (dom/div
+            {:class "input-group"}
+            (dom/textarea
+              {:ref "description-input" :id "description"
+               :placeholder "Notes + email + times that work for you"
+               :value (:description (:trello-card app))
+               :on-change (fn [_]
+                            (let [this (om/get-node owner "description-input")]
+                              (om/update! app [:trello-card :description] (.-value this))))})))
+        (dom/button
+          {:type "button" :class "create-card"
+           :disabled (not-every? (fn [x] (not (empty? x))) (vals (:trello-card app)))
+           :on-click (fn [_]
+                       (println (:trello-card app))
+                       (POST "/create-card"
+                            {:params {:name (:name (:trello-card app))
+                                      :description (:description (:trello-card app))}
+                             :headers {:x-csrf-token js/csrf}
+                             :error-handler (fn [resp] (println "Error"))
+                             :handler
+                             (fn [_]
+                               (.reload (.. js/window -location)))})
+                       (om/update! app [:trello-card] {:name "" :description ""}))}
+          "Add")
+        (dom/p
+          {:style {:margin-top "24px"}}
+          (str "The page will reload if you add a card, but it might "
+               "not show due to caching on Trello's part."))))))


add logdriver to global state #99

add logdriver to global state
#99

--- src/cljs/swarmpit/component/state.cljs
+++ src/cljs/swarmpit/component/state.cljs
@@ -22,6 +22,7 @@
                                                             :private {}
                                                             :other   {}}
                                                :settings   {}
+                                               :logdriver  {}
                                                :ports      []
                                                :networks   []
                                                :secrets    []


Solve 2nd ahlf by trying all posible inputs

--- src/adventofcode1/twentyone.clj
+++ src/adventofcode1/twentyone.clj
@@ -198,13 +198,13 @@

 (defn call-cmd
   [cmd text]
-  (let [ret (or (mycall (parse-rotate-left cmd text))
-                (mycall (parse-rotate-right cmd text))
-                (mycall (parse-move-position cmd text))
-                (mycall (parse-reverse-positions cmd text))
-                (mycall (parse-rotate-based-on cmd text))
-                (mycall (parse-swap-letter cmd text))
-                (mycall (parse-swap-position cmd text)))]
+  (let [ret (or (parse-rotate-left cmd text)
+                (parse-rotate-right cmd text)
+                (parse-move-position cmd text)
+                (parse-reverse-positions cmd text)
+                (parse-rotate-based-on cmd text)
+                (parse-swap-letter cmd text)
+                (parse-swap-position cmd text))]
     (if (nil? ret){:error :not-a-command :data cmd}
         ret)))

@@ -217,7 +217,7 @@
   (if (seq l)
     (do
       (assert (first l))
-      (let [res (call-cmd (first l) text)]
+      (let [res (mycall (call-cmd (first l) text))]
         (println (str (first l) " => " res))
         (recur res (rest l))))
     text))
@@ -246,6 +246,45 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;

+;; (call-cmd-backwards "abc" (list rotate-right "foo" 1) "cab") ==> true
+;; overkill except for non-reversible operations
+;; * move-position
+;; * rotate-based-on
+(defn call-cmd-backwards
+  "Return non-nil if text is the correct answer."
+  [text cmd text-after]
+  (= text-after
+     (mycall (cons (first cmd) (cons text (rest (rest cmd)))))))
+
+(defn try-call-cmd-backwards
+  ([cmd text-after](try-call-cmd-backwards (combo/permutations (seq text-after)) cmd text-after))
+  ([perm cmd text-after]
+   (if-not (seq? perm) nil
+           (let [text (str/join (first perm))
+                 found (call-cmd-backwards text (call-cmd cmd "dummy") text-after)]
+             (if found text
+                 (recur (rest perm) cmd text-after))))))
+
+(defn process-b-2
+  [text-after l]
+  (if (seq l)
+    (do
+      (assert (first l))
+      (let [res (try-call-cmd-backwards (first l) text-after)]
+        (println (str (first l) " => " res))
+        (recur res (rest l))))
+    text-after))
+
+(defn process-b
+  ([text-after](process-b text-after (reverse (str/split-lines mydata))))
+  ([text-after l](process-b-2 text-after l)))
+
+
+(defn sample-b
+  []
+  (assert
+   (= "abcde"
+      (process-b "decab" (reverse (str/split-lines testdata))))))


We still use the dashboard page for webdriver tests

--- src-cljs/frontend/routes.cljs
+++ src-cljs/frontend/routes.cljs
@@ -292,7 +292,8 @@

   (defroute v1-root "/" {:as params}
     (cond
-      (not (config/enterprise?))
+      (and (not (config/enterprise?))
+           (not (= (config/env) "test")))
       (set! js/window.location "https://circleci.com/")

       authenticated?


fix compiler warning on symbol declare

fix compiler warning on symbol declare

--- src/client/dashboard.cljs
+++ src/client/dashboard.cljs
@@ -7,6 +7,8 @@
 ;; TODO:
 ;; - hide empty boards that are not in the leaderboard 10
 ;; - more efficient board updating code?
+
+(declare board)

 (def $ js/jQuery)


Ignore case in confirm-ns, where the namespace is the same as the current ns. These cases will be checked by confirm-var-exists.

--- src/clj/cljs/analyzer.clj
+++ src/clj/cljs/analyzer.clj
@@ -169,17 +169,20 @@
     (get (:requires (:ns env)) sym sym)))

 (defn confirm-ns [env ns-sym]
-  (condp get ns-sym
-    '#{cljs.core goog Math} :>> identity
-    (-> env :ns :requires) :>> identity
-    ;; our internal conventions around data structures
-    ;; should not be allowed elsewhere
-    (if-not (== (.indexOf (str ns-sym) "cljs.core") -1)
-      ns-sym
-      (do (when (:undeclared *cljs-warnings*)
-            (warning env
-              (str "WARNING: No such namespace: " ns-sym)))
-        ns-sym))))
+  ;; ignore if ns-nsym is same as env ns
+  (if (= (-> env :ns :name) ns-sym)
+    ns-sym
+    (condp get ns-sym
+      '#{cljs.core goog Math} :>> identity
+      (-> env :ns :requires) :>> identity
+      ;; our internal conventions around data structures
+      ;; should not be allowed elsewhere
+      (if-not (== (.indexOf (str ns-sym) "cljs.core") -1)
+        ns-sym
+        (do (when (:undeclared *cljs-warnings*)
+              (warning env
+                (str "WARNING: No such namespace: " ns-sym)))
+          ns-sym)))))

 (defn core-name?
   "Is sym visible from core in the current compilation namespace?"


* src/clj/cljs/compiler.clj: remove old assert

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -712,7 +712,6 @@
         methods (map #(analyze-fn-method menv locals %) meths)
         max-fixed-arity (apply max (map :max-fixed-arity methods))
         variadic (boolean (some :variadic methods))]
-    ;;(assert (= 1 (count methods)) "Arity overloading not yet supported")
     ;;todo - validate unique arities, at most one variadic, variadic takes max required args
     {:env env :op :fn :name mname :methods methods :variadic variadic :recur-frames *recur-frames*
      :jsdoc [(when variadic "@param {...*} var_args")]


reserved words should be a supeset of reserved and future-reserved from ECMA 3 and 5

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -16,10 +16,19 @@
 (declare resolve-var)
 (require 'cljs.core)

-(def js-reserved #{"new" "debugger" "enum" "default" "private" "finally" "in" "import" "package" "with" "throw"
-                   "continue" "var" "for" "public" "do" "delete" "instanceof" "yield" "static" "protected" "return"
-                   "case" "implements" "typeof" "while" "void" "switch" "export" "class" "function" "extends" "else"
-                   "interface" "try" "let" "catch" "super" "if" "this" "break" "boolean"})
+(def js-reserved
+  #{"abstract" "boolean" "break" "byte" "case"
+    "catch" "char" "class" "const" "continue"
+    "debugger" "default" "delete" "do" "double"
+    "else" "enum" "export" "extends" "final"
+    "finally" "float" "for" "function" "goto" "if"
+    "implements" "import" "in" "instanceof" "int"
+    "interface" "let" "long" "native" "new"
+    "package" "private" "protected" "public"
+    "return" "short" "static" "super" "switch"
+    "synchronized" "this" "throw" "throws"
+    "transient" "try" "typeof" "var" "void"
+    "volatile" "while" "with" "yield"})

 (defonce namespaces (atom '{cljs.core {:name cljs.core}
                             cljs.user {:name cljs.user}}))


* src/clj/cljs/compiler.clj: propagate :protocol-inline info

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -964,6 +964,7 @@
                      {:protocol-symbol protocol-symbol})
                    (when fn-var?
                      {:fn-var true
+                      :protocol-inline (:protocol-inline init-expr)
                       :variadic (:variadic init-expr)
                       :max-fixed-arity (:max-fixed-arity init-expr)
                       :method-params (map (fn [m]
@@ -1007,6 +1008,7 @@
         locals (:locals env)
         locals (if name (assoc locals name {:name name}) locals)
         fields (-> form meta ::fields)
+        protocol-inline (-> form meta :protocol-inline)
         gthis (and fields (gensym "this__"))
         locals (reduce (fn [m fld]
                          (assoc m fld
@@ -1034,6 +1036,7 @@
      :recur-frames *recur-frames* :loop-lets *loop-lets*
      :jsdoc [(when variadic "@param {...*} var_args")]
      :max-fixed-arity max-fixed-arity
+     :protocol-inline protocol-inline
      :children (vec (mapcat block-children
                             methods))}))


fix formatting

fix formatting

--- src/clj/lambdacd/core.clj
+++ src/clj/lambdacd/core.clj
@@ -13,7 +13,7 @@
   ([pipeline-def config]
    (assemble-pipeline pipeline-def config (default-pipeline-state/new-default-pipeline-state config)))
   ([pipeline-def config pipeline-state-component]
-   (let [context                (-> {:config        (merge default-config config)}
+   (let [context                (-> {:config (merge default-config config)}
                                     (event-bus/initialize-event-bus)
                                     (running-builds-tracking/initialize-running-builds-tracking)
                                     (assoc :pipeline-state-component pipeline-state-component))


Fix schema error

Fix schema error

--- src/clj/stripe/charge.clj
+++ src/clj/stripe/charge.clj
@@ -109,15 +109,13 @@
 (s/defschema ApplicationFeeRefundID
   (s/named s/Str "Application fee refund identifier."))

-(declare ApplicationFee)
-
 (s/defschema ApplicationFeeRefund
   (-> {:id ApplicationFeeRefundID
        :amount ss/Currency
        :balance_transaction (s/either b/BalanceTxID b/BalanceTx)
        :created ss/UnixTimestamp
        :currency ss/CurrencyID
-       :fee (s/either ApplicationFeeID ApplicationFee)
+       :fee (s/either ApplicationFeeID (s/named s/Any "ApplicationFee"))
        :metadata ss/Metadata}
       (ss/stripe-object "fee_refund")))

@@ -178,6 +176,8 @@
 ;; ## ApplicationFee API Requests

 (s/defn refund-app-fee :- (ss/Async ApplicationFeeRefund)
+  "Returns a channel containing the ApplicationFeeRefund, or an
+  error."
   ([req :- ApplicationFeeRefundReq]
    (refund-app-fee req {}))
   ([req :- ApplicationFeeRefundReq


clojure wrapper update

clojure wrapper update

--- src/clojure/yaw/world.clj
+++ src/clojure/yaw/world.clj
@@ -114,12 +114,13 @@
 (defn create-item!
   "Create an item in the `world` with the
   specified id, position, mesh"
-  [world & {:keys [id position scale mesh]
-            :or   {id       "can't read the doc..."
-                   position [0 0 -2]
+  [world id & {:keys [x y z scale mesh]
+            :or   {x 0
+                   y 0
+                   z 2
                    scale    1
                    mesh     (create-mesh! world)}}]         ;;error here
-  (.createItem world id (float-array position) scale mesh))
+  (.createItemObject world id x y z scale mesh))

 (defn remove-item!
   "Remove the specified `item` from the `world`"
@@ -139,7 +140,7 @@
                    color    [0 0 1]
                    scale    1
                    position [0 0 -2]
-                   id       ""}}]
+                   id (str (gensym "block-"))}}]
   (create-item! world :id id
                 :position position
                 :scale scale


add factory fns for [Read|Write]HandlerMap

--- src/cognitect/transit.clj
+++ src/cognitect/transit.clj
@@ -317,6 +317,14 @@
           {}
           types))

+(defn read-handler-map
+  [custom-handlers]
+  (TransitFactory/readHandlerMap custom-handlers))
+
+(defn write-handler-map
+  [custom-handlers]
+  (TransitFactory/writeHandlerMap custom-handlers))
+
 (comment

   (require 'cognitect.transit)
@@ -328,7 +336,6 @@

   (def w (writer out :json))
   (def w (writer out :json-verbose))
-
   (def w (writer out :msgpack))

   (write w "foo")
@@ -387,4 +394,18 @@
   (def in (ByteArrayInputStream. (.toByteArray out)))
   (def r (reader in :json {:handlers ext-read-handlers}))
   (read r)
+
+  ;; write and read handler maps
+
+  (def custom-write-handler-map (write-handler-map ext-write-handlers))
+  (def custom-read-handler-map (read-handler-map ext-read-handlers))
+
+  (def out (ByteArrayOutputStream. 2000))
+  (def w (writer out :json {:handlers custom-write-handler-map}))
+
+  (write w (Point. 10 20))
+
+  (def in (ByteArrayInputStream. (.toByteArray out)))
+  (def r (reader in :json {:handlers custom-read-handler-map}))
+  (read r)
   )


Added docstring to compojure.handler namespace

--- src/compojure/handler.clj
+++ src/compojure/handler.clj
@@ -1,4 +1,5 @@
 (ns compojure.handler
+  "Functions to create Ring handlers from routes."
   (:use [ring.middleware params
                          keyword-params
                          nested-params


filter out exceptional lexemes

filter out exceptional lexemes

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -730,21 +730,30 @@
   (let [lexicon @lexicon
         parse-lexicon
         (into {}
-              (for [[k v] lexicon]
-                (let [filtered-v
+              (for [[k vals] lexicon]
+                (let [filtered-vals
                       (filter (fn [x] true)
-                              v)]
-                  (if (not (empty? filtered-v))
-                    [k filtered-v]))))
+                              vals)]
+                  (if (not (empty? filtered-vals))
+                    [k filtered-vals]))))
         lexicon
         (into {}
-              (for [[k v] lexicon]
-                (let [filtered-v
+              (for [[k vals] lexicon]
+                (let [filtered-vals
                       (filter #(not (= true (get-in % [:top])))
-                              v)]
-                  (if (not (empty? filtered-v))
-                    [k filtered-v]))))
-        lexicon-for-generation (lexicon-for-generation lexicon)
+                              vals)]
+                  (if (not (empty? filtered-vals))
+                    [k filtered-vals]))))
+
+        lexicon-for-generation (into {}
+                                     (for [[k vals] lexicon]
+                                       (let [filtered-vals
+                                             (filter #(and (= false (get-in % [:italiano :exception] false))
+                                                           (= true (get-in % [:generate-with] true)))
+                                                     vals)]
+                                         (if (not (empty? filtered-vals))
+                                           [k filtered-vals]))))
+
         rules (map #(keyword (get-in % [:rule])) grammar)

         ;; indices from paths to subsets of the lexicon


whitespace

whitespace

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -900,9 +900,9 @@
               :italiano {:cat :adjective
                          :fem {:sing "difficile"}}})

-      "dipingere" {:synsem {:cat :verb
-                            :sem {:pred :paint}}
-                   :italiano {:passato "dipinto"}}
+   "dipingere" {:synsem {:cat :verb
+                         :sem {:pred :paint}}
+                :italiano {:passato "dipinto"}}

    "dire" (let [shared-part-of-dire
                 {:synsem {:cat :verb}


Add the fnx clj files to watch for reloading the server automagically.