Get version string automatically

Get version string automatically

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

--- src/conexp/base.clj
+++ src/conexp/base.clj
@@ -71,8 +71,14 @@

 ;;; Version

+;; https://stackoverflow.com/questions/11235445/embed-version-string-from-leiningen-project-in-application
 (def- internal-version-string
-  "1.1.5-SNAPSHOT")
+  (or (System/getProperty "conexp-clj.version")
+      (-> (doto (java.util.Properties.)
+            (.load (-> "META-INF/maven/conexp-clj/conexp-clj/pom.properties"
+                       (io/resource)
+                       (io/reader))))
+          (.get "version"))))

 (def- conexp-version-map
   (let [[_ major minor patch qualifier] (re-find #"(\d+)\.(\d+)\.(\d+)(?:-(.+))?"


Fixed pattern for finding current version

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

--- src/conexp/main.clj
+++ src/conexp/main.clj
@@ -41,7 +41,7 @@
   the conexp-clj jar file. Returns \"source\" if there is none in the
   classpath."
   []
-  (if-let [[_ date time] (re-find #"conexp-clj-.*-(\d+)\.(\d+)\.jar"
+  (if-let [[_ date time] (re-find #"conexp-clj-.*?-(\d+)\.(\d+)\.jar"
                                   (System/getProperty "java.class.path"))]
     (str date "." time)
     "source"))


Improve format of received data.

Improve format of received data.

--- test/kixi/hecuba/http_test.clj
+++ test/kixi/hecuba/http_test.clj
@@ -118,29 +118,29 @@

 (defn- get-programme []
   (log/info "\nProgramme data:\n")
-  (let [output (json/read-str (:body (client/get (apply str "http://127.0.0.1:8010/4" @programme-loc) {:accept :json :content-type :json :basic-auth ["support@mastodonc.com" "password"]})))
-        prog-name (get-in output ["name"])]
+  (let [output (json/read-json (:body (client/get (apply str "http://127.0.0.1:8010/4" @programme-loc) {:accept :json :content-type :json :basic-auth ["support@mastodonc.com" "password"]})))
+        prog-name (:name output)]
     (reset! getter-map (assoc-in @getter-map [:programme-name] prog-name))
      (log/info output)))

 (defn- get-project []
   (log/info "\nProject data:\n")
-  (let [output (json/read-str (:body (client/get (apply str "http://127.0.0.1:8010/4" @programme-loc @project-loc) {:accept :json :content-type :json :basic-auth ["support@mastodonc.com" "password"]})))
-        proj-name (get-in output ["name"])]
+  (let [output (json/read-json (:body (client/get (apply str "http://127.0.0.1:8010/4" @programme-loc @project-loc) {:accept :json :content-type :json :basic-auth ["support@mastodonc.com" "password"]})))
+        proj-name (:name output)]
     (reset! getter-map (assoc-in @getter-map [:project-name] proj-name))
      (log/info output)))

 (defn- get-entity []
   (log/info "\nEntity data:\n")
-  (let [output (json/read-str (:body (client/get (apply str "http://127.0.0.1:8010/4" @entity-loc) {:accept :json :content-type :json :basic-auth ["support@mastodonc.com" "password"]})))
-        prop-code (get-in output ["property_code"])]
+  (let [output (json/read-json (:body (client/get (apply str "http://127.0.0.1:8010/4" @entity-loc) {:accept :json :content-type :json :basic-auth ["support@mastodonc.com" "password"]})))
+        prop-code (:property_code output)]
     (reset! getter-map (assoc-in @getter-map [:entity-property-code] prop-code))
      (log/info output)))

 (defn- get-device []
   (log/info "\nDevice data:\n")
-  (let [output (json/read-str (:body (client/get (apply str "http://127.0.0.1:8010/4" @device-loc) {:accept :json :content-type :json :basic-auth ["support@mastodonc.com" "password"]})))
-        device-desc (get-in output ["description"])]
+  (let [output (json/read-json (:body (client/get (apply str "http://127.0.0.1:8010/4" @device-loc) {:accept :json :content-type :json :basic-auth ["support@mastodonc.com" "password"]})))
+        device-desc (:description output)]
      (reset! getter-map (assoc-in @getter-map [:device-description] device-desc))
     (log/info output)))


Added new tests into rest_api_test

Added new tests into rest_api_test

--- test/emender_jenkins/rest_api_test.clj
+++ test/emender_jenkins/rest_api_test.clj
@@ -108,6 +108,12 @@
         (is (callable? 'emender-jenkins.rest-api/create-error-response))))

+(deftest test-create-bad-request-response-existence
+    "Check that the emender-jenkins.rest-api/create-bad-request-response definition exists."
+    (testing "if the emender-jenkins.rest-api/create-bad-request-response definition exists."
+        (is (callable? 'emender-jenkins.rest-api/create-bad-request-response))))
+
+
 (deftest test-job-does-not-exist-response-existence
     "Check that the emender-jenkins.rest-api/job-does-not-exist-response definition exists."
     (testing "if the emender-jenkins.rest-api/job-does-not-exist-response definition exists."
@@ -120,6 +126,36 @@
         (is (callable? 'emender-jenkins.rest-api/job-already-exist-response))))

+(deftest test-send-job-does-not-exist-response-existence
+    "Check that the emender-jenkins.rest-api/send-job-does-not-exist-response definition exists."
+    (testing "if the emender-jenkins.rest-api/send-job-does-not-exist-response definition exists."
+        (is (callable? 'emender-jenkins.rest-api/send-job-does-not-exist-response))))
+
+
+(deftest test-send-job-not-specified-response-existence
+    "Check that the emender-jenkins.rest-api/send-job-not-specified-response definition exists."
+    (testing "if the emender-jenkins.rest-api/send-job-not-specified-response definition exists."
+        (is (callable? 'emender-jenkins.rest-api/send-job-not-specified-response))))
+
+
+(deftest test-send-job-invalid-metadata-response-existence
+    "Check that the emender-jenkins.rest-api/send-job-invalid-metadata-response definition exists."
+    (testing "if the emender-jenkins.rest-api/send-job-invalid-metadata-response definition exists."
+        (is (callable? 'emender-jenkins.rest-api/send-job-invalid-metadata-response))))
+
+
+(deftest test-reload-tests-metadata-existence
+    "Check that the emender-jenkins.rest-api/reload-tests-metadata definition exists."
+    (testing "if the emender-jenkins.rest-api/reload-tests-metadata definition exists."
+        (is (callable? 'emender-jenkins.rest-api/reload-tests-metadata))))
+
+
+(deftest test-perform-job-command-existence
+    "Check that the emender-jenkins.rest-api/perform-job-command definition exists."
+    (testing "if the emender-jenkins.rest-api/perform-job-command definition exists."
+        (is (callable? 'emender-jenkins.rest-api/perform-job-command))))
+
+
 (deftest test-start-job-existence
     "Check that the emender-jenkins.rest-api/start-job definition exists."
     (testing "if the emender-jenkins.rest-api/start-job definition exists."
@@ -144,6 +180,18 @@
         (is (callable? 'emender-jenkins.rest-api/delete-job))))

+(deftest test-job-invalid-input-existence
+    "Check that the emender-jenkins.rest-api/job-invalid-input definition exists."
+    (testing "if the emender-jenkins.rest-api/job-invalid-input definition exists."
+        (is (callable? 'emender-jenkins.rest-api/job-invalid-input))))
+
+
+(deftest test-job-metadata-ok?-existence
+    "Check that the emender-jenkins.rest-api/job-metadata-ok? definition exists."
+    (testing "if the emender-jenkins.rest-api/job-metadata-ok? definition exists."
+        (is (callable? 'emender-jenkins.rest-api/job-metadata-ok?))))
+
+
 (deftest test-create-job-existence
     "Check that the emender-jenkins.rest-api/create-job definition exists."
     (testing "if the emender-jenkins.rest-api/create-job definition exists."


Test "seqs are expanded".

Test "seqs are expanded".

--- test/sablono/compiler_test.clj
+++ test/sablono/compiler_test.clj
@@ -98,9 +98,14 @@
        (js/React.DOM.p nil)
        (js/React.DOM.br nil))))
   (testing "seqs are expanded"
-    ;; (is (= (html [:div (list "foo" "bar")]) "
foobar
"))
-    ;; (is (= (html (list [:p "a"] [:p "b"])) "
a

b
"))
-    )
+    (are-html-expanded
+     '[:div (list "foo" "bar")]
+     '(let* [attrs (list "foo" "bar")]
+            (if (clojure.core/map? attrs)
+              (js/React.DOM.div (sablono.interpreter/attributes (sablono.util/merge-with-class {} attrs)) nil)
+              (js/React.DOM.div nil (sablono.interpreter/interpret attrs))))
+     '(list [:p "a"] [:p "b"])
+     '(sablono.interpreter/interpret (list [:p "a"] [:p "b"]))))
   (testing "vecs don't expand - error if vec doesn't have tag name"
     (is (thrown? Exception (html (vector [:p "a"] [:p "b"])))))
   (testing "tags can contain tags"


Cleanup

Cleanup

--- src/deltalog/mr.clj
+++ src/deltalog/mr.clj
@@ -29,19 +29,17 @@
 (defn -main []
   (let [json-paths ["id" "timestamp" "is-delete" "data"]

-        splitter (make-splitter json-paths)
-        splitter-pipe (Each. "json_split" splitter)
-        filter-pipe (Each. splitter-pipe
-                           (make-fields ["timestamp"])
-                           (ExpressionFilter. "timestamp >= 1393542318" Long/TYPE))
-        group-pipe (GroupBy. filter-pipe
-                             (make-fields ["id"])
-                             (make-fields ["timestamp"]))
-        max-pipe (Every. group-pipe Fields/ALL (Last.) Fields/RESULTS)
+        splitter-pipe (Each. "json_split" (make-splitter json-paths))
+        tail-pipe (-> splitter-pipe
+                      (Each. (make-fields ["timestamp"])
+                             (ExpressionFilter. "timestamp >= 1393542318" Long/TYPE))
+                      (GroupBy. (make-fields ["id"])
+                                (make-fields ["timestamp"]))
+                      (Every. Fields/ALL (Last.) Fields/RESULTS))

         flow-def (-> (FlowDef/flowDef)
                      (.addSource splitter-pipe in-tap)
-                     (.addTailSink max-pipe out-tap))]
+                     (.addTailSink tail-pipe out-tap))]

     (-> (HadoopFlowConnector.)
         (.connect flow-def)


Fixed bug in character count util func.

Fixed bug in character count util func.

--- src/dragon/util.clj
+++ src/dragon/util.clj
@@ -106,7 +106,7 @@
 (defn count-chars
   [str]
   (log/trace "Counting chars ...")
-  (count (re-seq #".*" str)))
+  (count (re-seq #"." str)))

 (defn count-words
   [str]


Documentation updates.

Documentation updates.

--- src/grafter/rdf.clj
+++ src/grafter/rdf.clj
@@ -118,7 +118,11 @@
   (reduce conj triple-template
           (mapcat vector hash-map)))

-(defn get-column-by-number* [ds row index]
+(defn ^:no-doc get-column-by-number*
+  "This function is intended for use by the graph-fn macro only, and
+  should not be considered part of this namespaces public interface.
+  It is only public because it is used by a macro."
+  [ds row index]
   (let [col-name (grafter.tabular/resolve-column-id ds index ::not-found)]
     (if-not (= col-name ::not-found)
       (get row col-name ::not-found))))


Drop out flow conditions until they can run on CI box.

--- test/onyx/flow_conditions/flow_conditions_gen_test.clj
+++ test/onyx/flow_conditions/flow_conditions_gen_test.clj
@@ -89,7 +89,7 @@
     (is (thrown? clojure.lang.ExceptionInfo
                  (r/route-data nil nil wrapped-e nil [:a :b])))))

-(deftest conj-downstream-tasks-together
+#_(deftest conj-downstream-tasks-together
   (checking
    "It joins the :flow/to tasks together and limits selection"
    (times 15)
@@ -107,7 +107,7 @@
      (is (= (into #{} target-tasks) (into #{} (:flow results))))
      (is (nil? (:action results))))))

-(deftest no-false-predicate-picks
+#_(deftest no-false-predicate-picks
   (checking
    "It doesn't pick any downstream tasks with false predicates"
    (times 15)
@@ -128,7 +128,7 @@
      (is (= (into #{} (mapcat :flow/to true-fcs)) (into #{} (:flow results))))
      (is (nil? (:action results))))))

-(deftest short-circuit
+#_(deftest short-circuit
   (checking
    "It stops searching when it finds a short circuit true pred"
    (times 15)
@@ -162,7 +162,7 @@
      (is (= (into #{} (:flow/to (first true-1))) (into #{} (:flow results))))
      (is (nil? (:action results))))))

-(deftest retry-action
+#_(deftest retry-action
   (checking
    "Using a retry action with a true predicate flows to nil"
    (times 15)
@@ -207,7 +207,7 @@
      (is (not (seq (:flow results))))
      (is (= :retry (:action results))))))

-(deftest key-exclusion
+#_(deftest key-exclusion
   (checking
    "Matched predicates excluded keys are conj'ed together"
    (times 15)
@@ -229,7 +229,7 @@
      (is (into #{} excluded-keys) (:exclusions results))
      (is (nil? (:action results))))))

-(deftest matching-all
+#_(deftest matching-all
   (checking
    "A :flow/to of :all that passes its predicate matches everything"
    (times 15)
@@ -261,7 +261,7 @@
      (is (= (into #{} downstream) (into #{} (:flow/to results))))
      (is (nil? (:action results))))))

-(deftest matching-none
+#_(deftest matching-none
   (checking
    "A :flow/to of :none that passes its pred matches nothing"
    (times 15)
@@ -293,7 +293,7 @@
      (is (not (seq (:flow/to results))))
      (is (nil? (:action results))))))

-(deftest post-transformation
+#_(deftest post-transformation
   (checking
    "A :flow/post-transform is returned for exception predicates that define it"
    (times 15)
@@ -325,7 +325,7 @@
      (is (= xform (:post-transformation results)))
      (is (nil? (:action results))))))

-(deftest post-transformation-no-invocation
+#_(deftest post-transformation-no-invocation
   (checking
    "Post-transformations are not invoked when they are not matched"
    (times 15)
@@ -344,7 +344,7 @@
          routes (r/route-data event nil message fcs downstream)]
      (is (= message (r/flow-conditions-transform message routes fcs event))))))

-(deftest post-transformation-invocation
+#_(deftest post-transformation-invocation
   (checking
    "Post-transformations are invoked when they are matched"
    (times 15)
@@ -364,7 +364,7 @@
          transformed (reduce dissoc post-transformed-segment (:exclusions routes))]
      (is (= transformed (r/flow-conditions-transform message routes fcs event))))))

-(deftest post-transformation-exclusions
+#_(deftest post-transformation-exclusions
   (checking
    "Key exclusions are applied during post transformation"
    (times 15)


added tests

added tests


(SERVER-882) Move decoding and canonicalizing into utility function

This commit moves some repeated code into a utility function.

--- src/clj/puppetlabs/services/master/master_core.clj
+++ src/clj/puppetlabs/services/master/master_core.clj
@@ -310,11 +310,16 @@
    jruby-request/wrap-with-error-handling
    ring/wrap-params))

+(schema/defn ^:always-validate decode-and-canonicalize-path :- (schema/maybe schema/Str)
+  "Takes a URI path and returns a decoded and canonicalized version."
+  [path :- schema/Str]
+  (-> path URIUtil/decodePath URIUtil/canonicalPath))
+
 (schema/defn ^:always-validate valid-static-file-path?
   "Helper function to decide if a static_file_content path is valid.
   The access here is designed to mimic Puppet's file_content endpoint."
   [path :- schema/Str]
-  (when-let [canonicalized-path (-> path URIUtil/decodePath URIUtil/canonicalPath)]
+  (when-let [canonicalized-path (decode-and-canonicalize-path path)]
      ;; Here, keywords represent a single element in the path. Anything between two '/' counts.
      ;; The second vector takes anything else that might be on the end of the path.
      ;; Below, this corresponds to 'modules/*/files/**' in a filesystem glob.
@@ -340,7 +345,8 @@
          "the files directory of a module.")}
         :else
         {:status 200
-         :body (get-code-content environment code-id (-> file-path URIUtil/decodePath URIUtil/canonicalPath))}))))
+         :body (get-code-content environment code-id
+                                 (decode-and-canonicalize-path file-path))}))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Routing


Doubled max points

Doubled max points

--- src/clojush/problems/integer_regression/change.clj
+++ src/clojush/problems/integer_regression/change.clj
@@ -76,7 +76,7 @@
 (def argmap
   {:error-function (change-error-function 150)
    :atom-generators change-atom-generators
-   :max-points 1000
+   :max-points 2000
    :max-genome-size-in-initial-program 500
    :evalpush-limit 800
    :population-size 2000


Tweak pattern-sequence to work with token stream and return remaining tokens.  Makes code more flexible for upcoming changes.

--- src/isla/parser.clj
+++ src/isla/parser.clj
@@ -29,15 +29,17 @@
     {:expr nil :left-tokens tokens})) ;; no expr match - return

 (defn -assignment [tokens]
-  (let [nodes (pattern-sequence tokens [-assignee -is -value -nl] [])]
-    (if (= (count nodes) 4)
-      {:expr (nnode :assignment (take 3 nodes)) :left-tokens (nthrest tokens 4)}
+  (let [{nodes :nodes left-tokens :left-tokens}
+        (pattern-sequence tokens [-assignee -is -value -nl] [])]
+    (if (not= nodes nil)
+      {:expr (nnode :assignment (take 3 nodes)) :left-tokens left-tokens}
       nil)))

 (defn -invocation [tokens]
-  (let [nodes (pattern-sequence tokens [-identifier -value -nl] [])]
-    (if (= (count nodes) 3)
-      {:expr (nnode :invocation (take 2 nodes)) :left-tokens (nthrest tokens 3)}
+  (let [{nodes :nodes left-tokens :left-tokens}
+        (pattern-sequence tokens [-identifier -value -nl] [])]
+    (if (not= nodes nil)
+      {:expr (nnode :invocation (take 2 nodes)) :left-tokens left-tokens}
       nil)))

 ;; atoms
@@ -85,12 +87,17 @@
                     types))))

 (defn pattern-sequence [tokens patterns collected]
-  (if (and (> (count patterns) 0) ;; still patterns to test
-           (>= (count tokens) (count patterns))) ;; enough tokens to satisfy pattern
-    (if-let [node ((first patterns) (first tokens))] ;; pattern matches token
-      (pattern-sequence (rest tokens) (rest patterns) (conj collected node))
-      collected)
-    collected))
+  ;; (if (and (> (count patterns) 0) ;; still patterns to test
+  ;; (>= (count tokens) (count patterns))) ;; enough tokens to satisfy pattern
+  (let [pattern (first patterns)
+        token (first tokens)]
+    (if (nil? pattern)
+      {:nodes collected :left-tokens tokens} ;; pattern matched - return
+      (if (nil? token) ;; pattern match failure - not enough tokens
+        {:nodes nil :left-tokens nil}
+        (if-let [node (pattern token)] ;; matched token
+          (pattern-sequence (rest tokens) (rest patterns) (conj collected node)) ;; round again
+          {:nodes nil :left-tokens nil}))))) ;; pattern match failure - return

 ;; only one token, for now
 (defn pattern [input matcher tag & args]


CMR-1867 Removes unnecessary test.

CMR-1867 Removes unnecessary test.

--- umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
@@ -55,10 +55,6 @@
   [record format]
   (core/parse-metadata :collection format (core/generate-metadata :collection format record)))

-(deftest dif9-round-trip
-  (is (= (expected-conversion/convert example-record :dif)
-         (xml-round-trip example-record :dif))))
-
 (deftest roundtrip-gen-parse
   (are2 [metadata-format]
     (= (expected-conversion/convert example-record metadata-format)


CMR-1863 Removes comment.

CMR-1863 Removes comment.

--- umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj
@@ -17,9 +17,7 @@
                    :LongName "Example Platform Long Name 1"
                    ;; TODO This is a valid DIF 10 type; replace it with something that can't be
                    ;; round-tripped and handle that in expected-conversion.
-                   :Type "Aircraft"
-                   ;; :Instruments [(umm-cmn/map->InstrumentType {:ShortName "Instrument"})]
-                   })]
+                   :Type "Aircraft"})]
      :ProcessingLevel (umm-c/map->ProcessingLevelType {})
      :RelatedUrls [(umm-cmn/map->RelatedUrlType {:URLs ["http://google.com"]})]
      :ResponsibleOrganizations [(umm-cmn/map->ResponsibilityType {:Role "RESOURCEPROVIDER"


Implemented completed specializations view

--- src/kmg/client.cljs
+++ src/kmg/client.cljs
@@ -32,20 +32,32 @@
   ".recommendation-completed-title" (ef/content (:media/title media)))

 (em/defsnippet specialization-available tmpl ".specialization-available" [specialization]
-  ".specialization-available-title" (ef/content (:specialization/title specialization)))
+  ".specialization-available-title"
+  (ef/content (:specialization/title specialization)))
+
+(em/defsnippet specialization-comleted tmpl ".specialization-completed" [specialization]
+  ".specialization-completed-title"
+  (ef/content (:specialization/title specialization)))

 (defn error-handler [{:keys [status status-text]}]
   (js/alert (str "somthing bad happened: " status " " status-text))
   #_(.log js/console (str "somthing bad happened: " status " " status-text)))

 (defn recommendation-list [data]
-  (ef/at "#inner-content" (ef/content (map recommendation data))))
+  (ef/at "#inner-content"
+         (ef/content (map recommendation data))))

 (defn recommendation-completed-list [data]
-  (ef/at "#recommenations-completed" (ef/content (map recommendation-completed data))))
+  (ef/at "#recommenations-completed"
+         (ef/content (map recommendation-completed data))))

 (defn specialization-available-list [data]
-  (ef/at "#specializations-available" (ef/content (map specialization-available data))))
+  (ef/at "#specializations-available"
+         (ef/content (map specialization-available data))))
+
+(defn specialization-comleted-list [data]
+  (ef/at "#specializations-completed"
+         (ef/content (map specialization-comleted data))))

 (defn try-load-recommendations []
   (GET (str "/recommendation/list/" (:username @user))
@@ -62,10 +74,16 @@
        {:handler specialization-available-list
         :error-hadler error-handler}))

+(defn try-load-specializations-completed []
+  (GET (str "/specialization/completed/" (:username @user))
+       {:handler specialization-comleted-list
+        :error-handler error-handler}))
+
 (defn refresh []
   (try-load-recommendations)
   (try-load-recommendations-completed)
-  (try-load-specializations-available))
+  (try-load-specializations-available)
+  (try-load-specializations-completed))

 (defn try-mark-as-completed [recommendation]
   (POST (str "/recommendation/mark-as-completed/" (:username @user) "/" (:recommendation/id recommendation))


Don't need to qualify that var.

Don't need to qualify that var.

--- src/lancet/core.clj
+++ src/lancet/core.clj
@@ -25,7 +25,7 @@
   (contains? #{"on" "yes" "true"} (.toLowerCase str)))
 (defmethod coerce :default [dest-cls obj] (cast dest-cls obj))
 (defmethod coerce [Path String] [_ str]
-  (Path. lancet/ant-project str))
+  (Path. ant-project str))

 (defn env [val]
   (System/getenv (name val)))


Use (reduce into) instead of (apply concat) for non-lazy generation of all-terms.

--- project/analyze-data/src/analyze_data/tf_idf/core.clj
+++ project/analyze-data/src/analyze_data/tf_idf/core.clj
@@ -42,9 +42,8 @@
   corpus. The rest are sequences of tf-idf values of those terms, for each
   document in term-corpus."
   [term-corpus]
-  (let [all-terms (sort (distinct (apply concat term-corpus)))
+  (let [all-terms (sort (distinct (reduce into term-corpus)))
         tf-corpus (map double-normalized-term-frequency term-corpus)
         idf (inverse-document-frequency tf-corpus)
         tf-idf-values (map (partial tf-idf-document idf all-terms) tf-corpus)]
     (cons all-terms tf-idf-values)))
-


Menu headers shouldn't contain links

Menu headers shouldn't contain links

--- modules/menu/src/modular/menu.clj
+++ modules/menu/src/modular/menu.clj
@@ -43,7 +43,7 @@
                    (if parent
                      (list
                       [:li.dropdown
-                       [:a.dropdown-toggle {:href "#" :data-toggle "dropdown"} parent [:b.caret]]
+                       [:a.dropdown-toggle {:data-toggle "dropdown"} parent [:b.caret]]
                        [:ul.dropdown-menu listitems]])
                      listitems)))))})))


Remove unused function from luhn exercise

--- exercises/luhn/src/example.clj
+++ exercises/luhn/src/example.clj
@@ -32,10 +32,3 @@
   (if (or (re-find #"[^0-9\s]+" n) (>= 1 (count (string/trim n))))
     false
     (zero? (-> n string->long checksum))))
-
-(defn add-check-digit
-  "given a number, adds a luhn check digit at the end"
-  [n]
-  (let [n-shifted (* 10 n)
-        check-digit (- 10 (checksum n-shifted))]
-    (+ n-shifted check-digit)))


Moved top physics sensor 'up' and out of the way

--- desktop/src-common/ds3/main_screen.clj
+++ desktop/src-common/ds3/main_screen.clj
@@ -44,7 +44,7 @@
                           :can-attack? false
                           :debug-renderer (Box2DDebugRenderer.))
           top-oob (doto (create-oob-entity! screen (c/screen-to-world c/game-width) (c/screen-to-world 20))
-                    (body-position! 0 (c/screen-to-world c/game-height) 0))
+                    (body-position! 0 (c/screen-to-world (+ 20 c/game-height)) 0))
           bottom-oob (doto (create-oob-entity! screen (c/screen-to-world (+ c/game-width 20)) (c/screen-to-world 20))
                        (body-position! (c/screen-to-world (- 10)) (c/screen-to-world (- 20)) 0))
           space (space/create-space)]


[#12936] Add accessibility-id to message timestamp

--- src/status_im/ui/screens/chat/message/message.cljs
+++ src/status_im/ui/screens/chat/message/message.cljs
@@ -80,7 +80,9 @@
     (let [anim-opacity (animation/create-value 0)]
       [react/animated-view {:style (style/message-timestamp-wrapper message) :opacity anim-opacity}
        (when @show-timestamp? (message-timestamp-anim anim-opacity show-timestamp?))
-       [react/text {:style (style/message-timestamp-text)}
+       [react/text
+        {:style               (style/message-timestamp-text)
+         :accessibility-label :message-timestamp}
         timestamp-str]])))

 (defview quoted-message


Not really necessary, since recovery was always the default [IMMUTANT-356]

--- modules/cache/src/main/clojure/immutant/cache/config.clj
+++ modules/cache/src/main/clojure/immutant/cache/config.clj
@@ -57,7 +57,8 @@
         transaction
         (transactionManagerLookup (GenericTransactionManagerLookup.))
         (transactionMode TransactionMode/TRANSACTIONAL)
-        (useSynchronization (not (not use-synchronization))))
+        (useSynchronization (boolean use-synchronization))
+        recovery)
     (.. builder
         transaction
         (transactionMode TransactionMode/NON_TRANSACTIONAL))))


Update external_config.clj

Update external_config.clj


documentation changes

documentation changes

--- libs/rabbit-microservices/test/rabbit_microservices/core_test.clj
+++ libs/rabbit-microservices/test/rabbit_microservices/core_test.clj
@@ -38,8 +38,9 @@
    (di/startup $)
    (di/do-with! $ [serve]
      (serve my-service {:partial :event}) => nil
-     (persistent! calls) => [[:declare-service "rabbit-microservices.core-test/my-service" {:partial :event}]
-                             [:assign-service "rabbit-microservices.core-test/my-service" my-service]])))
+     (persistent! calls)
+     => [[:declare-service "rabbit-microservices.core-test/my-service" {:partial :event}]
+         [:assign-service "rabbit-microservices.core-test/my-service" my-service]])))

 [[:chapter {:title "declare-service: Declare an AMQP Queue" :tag "declare-service"}]]
@@ -82,6 +83,9 @@
  (assign-service "foobar" my-other-service) => nil
  (provided
   (lc/subscribe :some-chan "foobar" irrelevant {:auto-ack false}) => irrelevant))
+
+"The `lc/subscribe` function is given a closure returned by [handle-event](#handle-event).
+Please refer to it for more information."

 [[:chapter {:title "publish: Publish an Event from the Outside" :tag "publish"}]]
 "`publish` is a service that allows its users to publish events from outside the context of a service.
@@ -263,10 +267,7 @@
 (fact
  (def alive (atom true))
  (def received (atom '()))
- (defn my-func
-   {:reg {:kind :fact
-          :name "foo/bar"}}
-   [ev]
+ (defn my-func [ev]
    (swap! received #(conj % ev)))
  (def my-event {:kind :fact
                 :name "foo/bar"
@@ -289,10 +290,7 @@
  (def event2 {:name "foo/baz"
               :key 5555
               :data [1 2 3 4]})
- (defn my-func
-   {:reg {:kind :fact
-          :name "foo/bar"}}
-   [ev publish]
+ (defn my-func [ev publish]
    (publish event2))
  (def event-that-was-sent
    (merge my-event event2))
@@ -309,10 +307,7 @@
  )
 "If the wrapped function accepts three parameters, the third parameter is taken to be an `ack` function, that explicitly acknowledges the received event."
 (fact
- (defn my-func
-   {:reg {:kind :fact
-          :name "foo/bar"}}
-   [ev publish ack]
+ (defn my-func [ev publish ack]
    (ack))
  (handle-event my-func alive :the-channel {:delivery-tag "foo"} my-event-bin) => nil
  (provided


Rearrange defs

Rearrange defs

--- test/om_tools/dom_test.cljs
+++ test/om_tools/dom_test.cljs
@@ -6,16 +6,16 @@
    [om.dom :as om-dom :include-macros true]
    [om-tools.dom :as dom :include-macros true]))

+(def +react-dom-prototype+ (.-prototype (js/React.DOM.span nil)))
+
+(defn react-dom? [x]
+  (and x (= (.-prototype x) +react-dom-prototype+)))
+
 (defn props [el]
   (js->clj (.-props el) :keywordize-keys true))

 (defn children [el]
   (:children (props el)))
-
-(def +react-dom-prototype+ (.-prototype (js/React.DOM.span nil)))
-
-(defn react-dom? [x]
-  (and x (= (.-prototype x) +react-dom-prototype+)))

 (defn is=el [el1 el2]
   (is (= (.-tagName el1) (.-tagName el2)))


Add test for metadata printing.

Add test for metadata printing.

--- test/puget/printer_test.clj
+++ test/puget/printer_test.clj
@@ -84,6 +84,13 @@
              "#<java.util.Currency USD>\n")))))

+(deftest metadata-printing
+  (let [value ^:foo [:bar]]
+    (binding [*print-meta* true]
+      (is (= "^{:foo true}\n[:bar]" (pprint-str value)))
+      (is (= "[:bar]" (pprint-str value {:print-meta false}))))))
+
+
 (deftest colored-printing
   (let [value [nil 1.0 true "foo" :bar]
         bw-str (with-out-str (pprint value))


hot words done!

hot words done!

--- src/Miscellaneous/hotword.clj
+++ src/Miscellaneous/hotword.clj
@@ -1,5 +1,5 @@
 (ns Miscellaneous.hotword
-  (:refer-clojure :exclude [sort find])
+  (:refer-clojure :exclude [find])
   (:require [clojure.string :as string]
             [incanter.core :as incanter]
             [data-mall.connectDB3 :as db]
@@ -7,7 +7,7 @@
             [monger.core :as mg];the following 4 is for mongo use
             [monger.collection :as mc]
             [monger.operators :refer :all]
-            [monger.query :refer :all]
+            ;[monger.query :refer :all]
             [monger.joda-time :as mjt]
             [monger.multi.collection :as mmc]
             [data-mall.ansj-seg :as seg]
@@ -24,7 +24,7 @@
            org.bson.types.ObjectId)
   (:use clj-excel.core))

-(mg/connect! {:host "192.168.1.184" :port 7017})
+(mg/connect!)

 (mg/set-db! (mg/get-db "xuetest"))

@@ -39,15 +39,116 @@
   (let [day (t/from-time-zone (apply t/date-time day) (t/time-zone-for-offset +8))
         next-day (t/plus (t/from-time-zone day (t/time-zone-for-offset +8)) (t/days 1))
         results (mc/aggregate collection [{$match {:date {$gte day
-                                           $lt next-day}
+                                                          $lt next-day}
                                                    :nature nature}}
                                           {$group {:_id {:word "$word"}
                                                    :counts {$sum 1}}}
-                                          {$sort {:counts -1}}])
-        func #()]
-))
+                                          {$sort {:counts -1}}
+                                          {$limit amounts}])
+        pairs (map #(vector ((comp :word :_id) %) (:counts %)) results)]
+    (reduce #(apply (partial assoc %1) %2) {} pairs)))
+
+(defn previous-average
+  [collection word nature day]
+  (let [previous-day (t/plus (t/from-time-zone day (t/time-zone-for-offset +8)) (t/days -7))
+        previous-sum (->> (mc/aggregate collection [{$match {:word word
+                                                            :date {$gte previous-day
+                                                                   $lt day}
+                                                            :nature nature}}
+                                                   {$group {:_id {:word "$word"}
+                                                            :counts {$sum 1}}}
+                                                   {$project {:_id 0
+                                                              :counts 1}}])
+                          first
+                          :counts)]
+    (if (nil? previous-sum)
+      0.1
+      (double (/ previous-sum 7)))))

-(heavy-words "mahang_segs" "形容词" [2014 4 5] 500)
+(heavy-words "mahang_segs" "名词" [2014 3 15] 500)
+;(previous-average "mahang_segs" "酒店" "名词" (t/from-time-zone (apply t/date-time [2014 3 19]) (t/time-zone-for-offset +8)))
+
+(defn hot-words
+  [collection nature day amounts]
+  (let [heavy (heavy-words collection nature day amounts)
+        day (t/from-time-zone (apply t/date-time day) (t/time-zone-for-offset +8))
+        func #(previous-average collection % nature day)]
+    (->> (reduce #(assoc %1 (key %2) (/ (val %2) (func (key %2)))) {} heavy)
+         (sort #(> (val %1) (val %2))))))
+
+;(hot-words "mahang_segs" "动词" [2014 3 11] 100)
+;(sort #(> (val %1) (val %2)) {:b 1 :c 3 :a  2})

+(defn print-hot-word
+  [collection day-range amounts]
+  (let [f #(->> (hot-words collection %1 %2 amounts)
+                (take 50)
+                (map first))
+        n #(f "名词" %)
+        a #(f "形容词" %)
+        v #(f "动词" %)
+        s #(string/join %1 %2)]
+    (reduce #(conj %1 (vector (s "-" %2)
+                              (s " " (n %2))
+                              (s " " (a %2))
+                              (s " " (v %2))))
+            [["日期" "名词热词" "形容词热词" "动词热词"]]
+         day-range)))
+
+(def day-range
+  [
+[2014 	3 	1]
+[2014 	3 	2]
+[2014 	3 	3]
+[2014 	3 	4]
+[2014 	3 	5]
+[2014 	3 	6]
+[2014 	3 	7]
+[2014 	3 	8]
+[2014 	3 	9]
+[2014 	3 	10]
+[2014 	3 	11]
+[2014 	3 	12]
+[2014 	3 	13]
+[2014 	3 	14]
+[2014 	3 	15]
+[2014 	3 	16]
+[2014 	3 	17]
+[2014 	3 	18]
+[2014 	3 	19]
+[2014 	3 	20]
+[2014 	3 	21]
+[2014 	3 	22]
+[2014 	3 	23]
+[2014 	3 	24]
+[2014 	3 	25]
+[2014 	3 	26]
+[2014 	3 	27]
+[2014 	3 	28]
+[2014 	3 	29]
+[2014 	3 	30]
+[2014 	3 	31]
+[2014 	4 	1]
+[2014 	4 	2]
+[2014 	4 	3]
+[2014 	4 	4]
+[2014 	4 	5]
+[2014 	4 	6]
+[2014 	4 	7]
+[2014 	4 	8]
+[2014 	4 	9]
+[2014 	4 	10]])
+
+day-range
+
+(->> {"热词" (print-hot-word "mahang_segs" day-range 100)}
+     (build-workbook (workbook-xssf))
+     (#(save % "D:/data/.xlsx")))
+
+;;;;;;;;;;;;;;;;;;tips;;;;;;;;;;;;;;;;;;;;
+
+
+(string/join "-" [2012 2 3])
+


fix some of these tests

fix some of these tests

--- test/tabby/cluster_test.clj
+++ test/tabby/cluster_test.clj
@@ -12,10 +12,10 @@

 (defn test-cluster [n]
   (let [c (create 8090 n)]
-    (update-in c [:servers "0.localnet:0" :election-timeout] (constantly 0))))
+    (assoc-in c [:servers "0.localnet:0" :election-timeout] 0)))

 (defn create-and-elect []
-  (until-empty (test-cluster 3)))
+  (until-empty (step 50 (until-empty (test-cluster 3)))))

 (deftest simple-things
   (testing "everyone's type"
@@ -30,9 +30,10 @@

   (testing "1 - 2 vote"
     (let [s (create-and-elect)]
+      (println s)
       (is (= '(:leader :follower :follower) (fields-by-id s :type)))

-      (is (= '(0 0 0) (fields-by-id s :commit-index))))))
+      (is (= '(2 2 2) (fields-by-id s :commit-index))))))

 (defn sort-queue [q]
   (sort-by :dst q))
@@ -49,10 +50,10 @@
       (is (= '(:candidate :follower :follower) (fields-by-id s1 :type)))
       (is (= '(1 0 0) (fields-by-id s1 :current-term)))
       (is (= '({:dst "1.localnet:1" :src "0.localnet:0" :type :request-vote
-                :body {:term 1 :candidate-id "0.localnet:0", :prev-log-index 0
+                :body {:term 1 :candidate-id "0.localnet:0", :prev-log-index 1
                        :prev-log-term 0}}
                {:dst "2.localnet:2" :src "0.localnet:0" :type :request-vote
-                :body {:term 1 :candidate-id "0.localnet:0", :prev-log-index 0
+                :body {:term 1 :candidate-id "0.localnet:0", :prev-log-index 1
                        :prev-log-term 0}}) (sort-queue (:tx-queue (get (:servers s1) (s-at 0))))))))
   (testing "step 2 - peers respond to request vote"
     (let [s2 (->> (test-cluster 3)
@@ -74,27 +75,27 @@
       (is (= '(:leader :follower :follower) (fields-by-id s :type)))
       (is (= (list {:dst (s-at 1) :type :append-entries :src (s-at 0)
                     :body {:term 1 :leader-id (s-at 0)
-                           :prev-log-index 0 :prev-log-term 0
-                           :entries [] :leader-commit 0}}
+                           :prev-log-index 1 :prev-log-term 0
+                           :entries [{:term 1, :cmd {:op :noop}}] :leader-commit 0}}
                    {:dst (s-at 2) :type :append-entries :src (s-at 0)
                     :body {:term 1 :leader-id (s-at 0)
-                           :prev-log-index 0 :prev-log-term 0
-                           :entries [] :leader-commit 0}})
+                           :prev-log-index 1 :prev-log-term 0
+                           :entries [{:term 1, :cmd {:op :noop}}] :leader-commit 0}})
              (sort-by :dst (:tx-queue (srv s (s-at 0))))))
       (is (= {(s-at 2) 0 (s-at 1) 0} (:match-index (srv s (s-at 0)))))
-      (is (= {(s-at 2) 1 (s-at 1) 1} (:next-index (srv s (s-at 0)))))))
+      (is (= {(s-at 2) 2 (s-at 1) 2} (:next-index (srv s (s-at 0)))))))

   (testing "step 4 - process heart beat responses"
     (let [s (->> (test-cluster 3)
                  (step-times 0 4))]
       (is (= (list {:dst (s-at 0) :src (s-at 1) :type :append-entries-response
-                :body {:term 1 :success true :count 0}}) (:tx-queue (srv s (s-at 1)))))
+                :body {:term 1 :success true :count 1}}) (:tx-queue (srv s (s-at 1)))))
       (is (= (list {:dst (s-at 0) :src (s-at 2) :type :append-entries-response
-                :body {:term 1 :success true :count 0}}) (:tx-queue (srv s (s-at 2)))))))
+                :body {:term 1 :success true :count 1}}) (:tx-queue (srv s (s-at 2)))))))
   (testing "step 5 - heart beat response"
     (let [s (->> (test-cluster 3)
                  (step-times 0 5))]
-      (is (= {(s-at 2) 0 (s-at 1) 0} (:match-index (srv s (s-at 0)))))))
+      (is (= {(s-at 2) 2 (s-at 1) 2} (:match-index (srv s (s-at 0)))))))

   (testing "step 7 wait for commit index"
@@ -104,7 +105,7 @@
                  (until-empty)
                  (step 150)
                  (until-empty))]
-      (is (= '(1 1 1) (fields-by-id s :commit-index))))))
+      (is (= '(3 3 3) (fields-by-id s :commit-index))))))

 (deftest test-election-responses
   (testing "election with one server not responding"


monitor-circular-buffer

monitor-circular-buffer

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@10771 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- acqEngine/src/org/micromanager/test/saving.clj
+++ acqEngine/src/org/micromanager/test/saving.clj
@@ -108,3 +108,10 @@
           (.put storage-queue buffer)))
     storage-queue))

+(defn monitor-circular-buffer []
+  (while (not (core isSequenceRunning))
+    (Thread/sleep 100))
+  (while (core isSequenceRunning)
+    (println (core getRemainingImageCount))
+    (Thread/sleep 250)))
+


More on atoms.

More on atoms.

--- test/com/nomistech/clojure_the_language/intro_to_state.clj
+++ test/com/nomistech/clojure_the_language/intro_to_state.clj
@@ -2,10 +2,7 @@
   (:require [midje.sweet :refer :all]))

 ;;;; ___________________________________________________________________________
-
-;;;; Concurrency and state management without locks.
-;;;; Focus on sane management of state.
-;;;; Sane concurrency follows.
+;;;; State management and concurrency and without locks.

 ;;;; References
 ;;;; - There are a fair few types of reference.
@@ -34,14 +31,14 @@

 ;;;; Supplying args to the swap function:

-(swap! my-number-atom + 1) ; (+ 2 1)
-(fact @my-number-atom => 3)
+(swap! my-number-atom + 10) ; (+ 2 10)
+(fact @my-number-atom => 12)

-(swap! my-number-atom + 1) ; (+ 3 1)
-(fact @my-number-atom => 4)
+(swap! my-number-atom + 10) ; (+ 12 10)
+(fact @my-number-atom => 22)

-(swap! my-number-atom + 10 20 30) ; (+ 4 10 20 30)
-(fact @my-number-atom => 64)
+(swap! my-number-atom + 10 20 30) ; (+ 22 10 20 30)
+(fact @my-number-atom => 82)

 ;;;; Maps in atoms
@@ -68,11 +65,11 @@
 ;;;; ___________________________________________________________________________
 ;;;; Atoms: `compare-and-set!`

-(fact @my-number-atom => 64)
+(fact @my-number-atom => 82)
 (fact (compare-and-set! my-number-atom 99 42) => false)
-(fact @my-number-atom => 64)
+(fact @my-number-atom => 82)

-(fact (compare-and-set! my-number-atom 64 42) => true)
+(fact (compare-and-set! my-number-atom 82 42) => true)
 (fact @my-number-atom => 42)

 ;;;; ___________________________________________________________________________


Fix replayability of crash test

Fix replayability of crash test

--- test/onyx/windowing/basic_windowing_crash_test.clj
+++ test/onyx/windowing/basic_windowing_crash_test.clj
@@ -63,32 +63,8 @@
     [1442115900000 1442116199999 {37 1}]
     [1442115000000 1442115299999 {60 1}]})

-(def test-state (atom []))
-
-(defn update-atom! [event window-id lower-bound upper-bound state]
-  (swap! test-state conj [lower-bound upper-bound state]))
-
 (defn restartable? [e]
   true)
-
-(def batch-num (atom 0))
-
-(def identity-crash
-  {:lifecycle/before-batch
-   (fn [event lifecycle]
-     (case (swap! batch-num inc)
-       2
-       (do (state-extensions/compact-log (:onyx.core/state-log event) event @(:onyx.core/window-state event))
-           (Thread/sleep 7000))
-       ;; compactions happen at a check in between log entries writing, so we need to wait for two cycles
-       ;; before crashing
-       4
-       (do
-         ; give the peer a bit of time to write the chunks out and ack the batches,
-         ; since we want to ensure that the batches aren't re-read on restart
-         (Thread/sleep 7000)
-         (throw (ex-info "Restartable" {:restartable? true})))
-       {}))})

 (defrecord MonitoringStats
   [zookeeper-write-log-entry
@@ -128,10 +104,34 @@
    peer-notify-join
    peer-accept-join])

-(def compaction-finished? (atom false))
-(def playback-occurred? (atom false))
-
 (deftest fault-tolerance-fixed-windows-segment-trigger
+
+  (def test-state (atom []))
+
+  (defn update-atom! [event window-id lower-bound upper-bound state]
+    (swap! test-state conj [lower-bound upper-bound state]))
+
+  (def batch-num (atom 0))
+
+  (def identity-crash
+    {:lifecycle/before-batch
+     (fn [event lifecycle]
+       (case (swap! batch-num inc)
+         2
+         (do (state-extensions/compact-log (:onyx.core/state-log event) event @(:onyx.core/window-state event))
+             (Thread/sleep 7000))
+         ;; compactions happen at a check in between log entries writing, so we need to wait for two cycles
+         ;; before crashing
+         4
+         (do
+           ; give the peer a bit of time to write the chunks out and ack the batches,
+           ; since we want to ensure that the batches aren't re-read on restart
+           (Thread/sleep 7000)
+           (throw (ex-info "Restartable" {:restartable? true})))
+         {}))})
+
+  (def compaction-finished? (atom false))
+  (def playback-occurred? (atom false))

   (def in-chan (chan (inc (count input))))


[:rule] is now structure-shared with [:espanol :rule]

--- src/babel/espanol/grammar.clj
+++ src/babel/espanol/grammar.clj
@@ -10,33 +10,31 @@
    [clojure.tools.logging :as log]
    [dag-unify.core :refer (get-in merge unifyc)]))

-(def hc-agreement
-  (let [agr (ref :top)]
-    {:synsem {:agr agr}
-     :head {:synsem {:agr agr}}
-     :comp {:espanol {:agr agr}
-            :synsem {:agr agr}}}))
-
 (def head-first
   (let [head-espanol (ref :top)
-        comp-espanol (ref :top)]
+        comp-espanol (ref :top)
+        rule (ref :top)]
     (unifyc
      {:comp {:espanol {:initial false}}
       :head {:espanol {:initial true}}}
      {:head {:espanol head-espanol}
       :comp {:espanol comp-espanol}
+      :rule rule
       :espanol {:a head-espanol
+                :rule1 rule
                 :b comp-espanol}})))
-
 (def head-last
   (let [head-espanol (ref :top)
-        comp-espanol (ref :top)]
+        comp-espanol (ref :top)
+        rule (ref :top)]
     (unifyc
      {:comp {:espanol {:initial true}}
       :head {:espanol {:initial false}}}
      {:head {:espanol head-espanol}
+      :rule rule
       :comp {:espanol comp-espanol}
       :espanol {:a comp-espanol
+                :rule rule
                 :b head-espanol}})))

 ;; -- BEGIN SCHEMA DEFINITIONS
@@ -71,6 +69,12 @@
     :first :comp
     :comment "c21"}))

+(def hc-agreement
+  (let [agr (ref :top)]
+    {:synsem {:agr agr}
+     :head {:synsem {:agr agr}}
+     :comp {:espanol {:agr agr}
+            :synsem {:agr agr}}}))
 (def h11
   (unifyc
    subcat-1-1-principle


added defend

added defend

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -145,6 +145,10 @@

    "deber" {:synsem {:cat :verb
                      :sem {:pred :have-to}}}
+
+   "defender" {:espanol {:boot-stem "defiend"}
+                :synsem {:cat :verb
+                         :sem {:pred :defend}}}

    "decidir" {:synsem {:cat :verb
                        :sem {:pred :decide}}}
@@ -463,23 +467,7 @@
       (merge shared-part-of-poder
              {:synsem {:pred :be-able-to}})])

-   "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}})])
+

    "quedarse" (let [subject-semantics (ref {:animate true})
                     subject-agr (ref :top)]


improve logging

improve logging

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -168,8 +168,6 @@
   "Return every possible bolt for the given model and spec. Start at the given depth and
    keep generating until the given max-depth is reached."
   [model spec depth max-depth & [use-candidate-parents]]
-  (log/debug (str "lightning-bolts: depth="
-                  depth "; spec=" (dag_unify.core/strip-refs spec)))
   (if (and (< depth max-depth)
            (not (= false (get-in spec [:phrasal] true))))
     (let [candidate-parents
@@ -189,8 +187,7 @@
         (let [candidate-parent (first candidate-parents)]
           (log/debug (str "creating bolts with: "
                           (:rule candidate-parent)
-                          " and spec: " (dag_unify.core/strip-refs
-                                         (get-in candidate-parent [:head]))))
+                          " and cat: " (get-in candidate-parent [:head :synsem :cat])))
           (lazy-cat
            (->> (lightning-bolts model
                                  (get-in candidate-parent [:head])
@@ -266,7 +263,9 @@
      (comp-paths (- depth 1)))))

 (defn get-lexemes [model spec]
-  "Get lexemes matching the spec. Use a model's index if available, where the index is a function that we call with _spec_ to get a set of indices. otherwise use the model's entire lexeme."
+  "Get lexemes matching the spec. Use a model's index if available, where the index
+   is a function that we call with _spec_ to get a set of indices.
+   Otherwise use the model's entire lexeme."
   (->>
    (if (= false (get-in spec [:phrasal] false))
      (if-let [index-fn (:index-fn model)]


+(def ^:const truncate true)

+(def ^:const truncate true)

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -2,7 +2,7 @@
   (:refer-clojure :exclude [assoc-in get-in deref resolve find parents])
   (:require
    [babel.index :refer [intersection-with-identity]]
-   [babel.over :as over :refer [show-bolt spec-info truncate truncate-expressions]]
+   [babel.over :as over :refer [show-bolt spec-info]]
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
    [clojure.math.combinatorics :as combo]
@@ -27,7 +27,7 @@
 (def ^:const randomize-lexemes-before-phrases
   true)

-(def ^:const error-if-no-complements false)
+(def ^:const truncate true)

 (declare bolts-with-comps)
 (declare candidate-parents)
@@ -43,7 +43,7 @@

 (defn generate-all [spec model & [depth max-depth]]
   (let [depth (or depth 0)
-        truncate false
+        truncate truncate
         max-depth (or max-depth max-total-depth)]
     (log/debug (str "generate-all:" depth "/" max-depth ":         " (strip-refs spec)))
     (->>


replace (not (fail? x)) with new, less expensive (not-fail x)

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -32,6 +32,7 @@
 (declare lexemes-before-phrases)
 (declare lightning-bolts)
 (declare generate-all)
+(declare not-fail?)
 (declare spec-info)

 ;; FIXME: truncate-children=false (the non-default option) is not propagated through all calls,
@@ -193,11 +194,11 @@
         bolt-child-synsem (strip-refs (get-in bolt (concat path [:synsem]) :top))

         lexical-complements (lazy-shuffle
-                                      (filter (fn [lexeme]
-                                                (and (not (fail? (unify (strip-refs (get-in lexeme [:synsem] :top))
-                                                                        bolt-child-synsem)))))
-                                              complement-candidate-lexemes))]
-    (filter #(not (fail? %))
+                             (filter (fn [lexeme]
+                                       (and (not-fail? (unify (strip-refs (get-in lexeme [:synsem] :top))
+                                                              bolt-child-synsem))))
+                                     complement-candidate-lexemes))]
+    (filter #(not-fail? %)
             (mapfn (fn [complement]
                      (let [unified
                            (unify (copy bolt)
@@ -277,14 +278,14 @@
   (filter #(not (= :fail %))
           (pmap (fn [rule]
                   (log/trace (str "candidate-parents: rule: " (:rule rule)))
-                  (if (and (not (fail? (unifyc (get-in rule [:synsem :cat] :top)
-                                               (get-in spec [:synsem :cat] :top))))
-                           (not (fail? (unifyc (get-in rule [:synsem :infl] :top)
-                                               (get-in spec [:synsem :infl] :top))))
-                           (not (fail? (unifyc (get-in rule [:synsem :sem :tense] :top)
-                                               (get-in spec [:synsem :sem :tense] :top))))
-                           (not (fail? (unifyc (get-in rule [:synsem :modified] :top)
-                                               (get-in spec [:synsem :modified] :top)))))
+                  (if (and (not-fail? (unifyc (get-in rule [:synsem :cat] :top)
+                                              (get-in spec [:synsem :cat] :top)))
+                           (not-fail? (unifyc (get-in rule [:synsem :infl] :top)
+                                              (get-in spec [:synsem :infl] :top)))
+                           (not-fail? (unifyc (get-in rule [:synsem :sem :tense] :top)
+                                               (get-in spec [:synsem :sem :tense] :top)))
+                           (not-fail? (unifyc (get-in rule [:synsem :modified] :top)
+                                              (get-in spec [:synsem :modified] :top))))
                     (let [result
                            (unifyc spec rule)]
                       (if (fail? result)
@@ -361,3 +362,6 @@
                       (identical? member1 member2))
                     set2))
             set1)))
+
+(defn not-fail? [arg]
+  (not (= :fail arg)))


Delete unused arity variant

Delete unused arity variant

--- src/beehive/service.clj
+++ src/beehive/service.clj
@@ -34,7 +34,7 @@
 (set! *warn-on-reflection* true)

 (defprotocol CLJService
-  (submit-action [this action-fn timeout-millis] [this action-fn callback timeout-millis])
+  (submit-action [this action-fn timeout-millis])
   (run-action [this action-fn])
   (metrics [this] [this time time-unit])
   (latency [this])


Add basic concept page handler

Add basic concept page handler

--- src/clj/clojuredocs/pages.clj
+++ src/clj/clojuredocs/pages.clj
@@ -6,6 +6,7 @@
             [clojuredocs.util :as util]
             [clojuredocs.config :as config]
             [clojuredocs.search :as search]
+            [clojuredocs.search.static :as search.static]
             [clojuredocs.pages.common :as common]
             [clojuredocs.pages.search-feedback :as search-feedback]
             [clojuredocs.pages.intro :as intro]
@@ -106,11 +107,31 @@
   (or (lookup-var ns name)
       (lookup-var (expand-ns ns) name)))

+(defn concept-page-handler [concept]
+  (fn [r]
+    (common/$main
+      {:content
+       [:div.row
+        [:div.col-sm-2
+         [:div.sidenav
+          {:data-sticky-offset "30"}
+          [:h5 "Concepts"]
+          [:ul
+           (for [{:keys [name href]} search.static/concept-pages]
+             [:li [:a {:href href} name]])]]]
+        [:div.col-sm-10
+         [:div.markdown
+          (-> (str "src/md/concepts/" concept ".md")
+              common/memo-markdown-file
+              common/prep-for-syntaxhighligher)]]]})))
+
 (defroutes routes
   (GET "/robots.txt" [] robots-resp)
   (GET "/logout" [] logout-resp)
   (GET "/examples-styleguide" [] examples-styleguide-handler)
   (GET "/core-library" [] core-library-handler)
+
+  (GET "/concepts/:concept" [concept] (concept-page-handler concept))

   ;; Search Feedback
   (GET "/search-feedback" [] search-feedback/page-handler)
@@ -127,6 +148,7 @@
   (GET "/dev/styleguide/examples" [] dev/examples-styleguide-handler)
   (GET "/dev/search-perf" [] dev/perf-handler)
   (GET "/dev/canary" [] dev/canary-tests-handler)
+  (GET "/dev/api" [] dev/api-docs-handler)

   (GET "/gh-callback*" {{path :*} :route-params} (gh-auth/callback-handler path))
   (GET "/quickref" [] quickref/page-handler)


Prevent overflows when calculating free space on large filesystems.

The FileStore methods .getTotalSpace and .getUsableSpace return signed longs.
Large filesystems, such as AWS's EFS, can have a number of bytes that exceed
Long.MAX_VALUE, which will cause these methods to overflow and return a negative
number. In order to prevent this, we now check for a negative result and, if we
find one, return Long.MAX_VALUE.

See https://bugs.openjdk.java.net/browse/JDK-8162520.

--- src/clj/runbld/fs/factory.clj
+++ src/clj/runbld/fs/factory.clj
@@ -6,6 +6,14 @@
             [runbld.fs :refer [FileSystem] :as fs]
             [runbld.util.data :as data])
   (:import (java.nio.file Files)))
+
+;; We need to guard against overflows on filesystems (particularly
+;; AWS EFS) that are larger than Long/MAX_VALUE. See
+;; https://bugs.openjdk.java.net/browse/JDK-8162520
+(defn prevent-overflow [n]
+  (if (neg? n)
+    Long/MAX_VALUE
+    n))

 (defrecord JavaFileSystem [jfs]
   FileSystem
@@ -16,10 +24,10 @@
     (-> x .jfs .type))

   (fs-bytes-total [x]
-    (-> x .jfs .getTotalSpace))
+    (-> x .jfs .getTotalSpace prevent-overflow))

   (fs-bytes-free [x]
-    (-> x .jfs .getUsableSpace))
+    (-> x .jfs .getUsableSpace prevent-overflow))

   (fs-bytes-used [x]
     (let [tot (fs/fs-bytes-total x)


Eliz Mills, Eliza's Toybox, Encryption Protocol, Mark Yale, Reversed Accounts, Ronin, Turtlebacks

--- src/clj/test/cards-assets.clj
+++ src/clj/test/cards-assets.clj
@@ -76,6 +76,66 @@
       (is (= 1 (count (get-in @state [:runner :scored]))) "Chairman Hiro added to Runner score area")
       (is (= 2 (:agenda-point (get-runner))) "Runner gained 2 agenda points"))))

+(deftest elizabeth-mills
+  "Elizabeth Mills - Remove 1 bad publicity when rezzed; click-trash to trash a location"
+  (do-game
+    (new-game (default-corp [(qty "Elizabeth Mills" 1)])
+              (default-runner [(qty "Earthrise Hotel" 1)]))
+    (core/gain state :corp :bad-publicity 1)
+    (play-from-hand state :corp "Elizabeth Mills" "New remote")
+    (take-credits state :corp)
+    (play-from-hand state :runner "Earthrise Hotel")
+    (take-credits state :runner)
+    (let [liz (get-in @state [:corp :servers :remote1 :content 0])
+          hotel (get-in @state [:runner :rig :resource 0])]
+      (core/rez state :corp liz)
+      (is (= 0 (:bad-publicity (get-corp))) "1 bad publicity removed")
+      (card-ability state :corp liz 0)
+      (prompt-select :corp hotel)
+      (is (= 1 (count (:discard (get-runner)))) "Earthrise trashed")
+      (is (= 1 (count (:discard (get-corp)))) "Elizabeth Mills trashed")
+      (is (= 1 (:bad-publicity (get-corp))) "1 bad publicity taken from trashing a location"))))
+
+(deftest elizas-toybox
+  "Eliza's Toybox - Rez a card ignoring all costs"
+  (do-game
+    (new-game (default-corp [(qty "Eliza's Toybox" 1) (qty "Wotan" 1)])
+              (default-runner))
+    (core/gain state :corp :click 2)
+    (play-from-hand state :corp "Wotan" "R&D")
+    (play-from-hand state :corp "Eliza's Toybox" "New remote")
+    (let [wotan (get-in @state [:corp :servers :rd :ices 0])
+          eliza (get-in @state [:corp :servers :remote1 :content 0])]
+      (core/rez state :corp eliza)
+      (is (= 1 (:credit (get-corp))))
+      (card-ability state :corp eliza 0)
+      (prompt-select :corp wotan)
+      (is (get-in (refresh wotan) [:rezzed]))
+      (is (= 0 (:click (get-corp))) "3 clicks spent")
+      (is (= 1 (:credit (get-corp))) "No credits spent"))))
+
+(deftest encryption-protocol
+  "Encryption Protocol - Trash cost of installed cards increased by 1"
+  (do-game
+    (new-game (default-corp [(qty "Encryption Protocol" 2)])
+              (default-runner))
+    (play-from-hand state :corp "Encryption Protocol" "New remote")
+    (play-from-hand state :corp "Encryption Protocol" "New remote")
+    (let [ep1 (get-in @state [:corp :servers :remote1 :content 0])
+          ep2 (get-in @state [:corp :servers :remote2 :content 0])]
+      (core/rez state :corp ep1)
+      (core/rez state :corp ep2)
+      (take-credits state :corp)
+      (core/click-run state :runner {:server "Server 1"})
+      (core/no-action state :corp nil)
+      (core/successful-run state :runner nil)
+      (is (= 4 (core/trash-cost state :runner (refresh ep1))) "Trash cost increased to 4 by two active Encryption Protocols")
+      (prompt-choice :runner "Yes") ; trash first EP
+      (core/click-run state :runner {:server "Server 2"})
+      (core/no-action state :corp nil)
+      (core/successful-run state :runner nil)
+      (is (= 3 (core/trash-cost state :runner (refresh ep2))) "Trash cost increased to 3 by one active Encryption Protocol"))))
+
 (deftest eve-campaign
   (do-game
     (new-game (default-corp [(qty "Eve Campaign" 1)]) (default-runner))
@@ -135,6 +195,25 @@
       (is (= 8 (get-in @state [:corp :credit])))
       (is (= 4 (get-in (refresh launch) [:counter]))))))

+(deftest mark-yale
+  "Mark Yale - Spend agenda counters or trash himself to gain credits"
+  (do-game
+    (new-game (default-corp [(qty "Firmware Updates" 1) (qty "Mark Yale" 1)]) (default-runner))
+    (play-from-hand state :corp "Firmware Updates" "New remote")
+    (play-from-hand state :corp "Mark Yale" "New remote")
+    (let [firm (get-in @state [:corp :servers :remote1 :content 0])
+          yale (get-in @state [:corp :servers :remote2 :content 0])]
+      (score-agenda state :corp firm)
+      (core/rez state :corp yale)
+      (let [firmscored (get-in @state [:corp :scored 0])]
+        (is (= 3 (get-in firmscored [:counter])))
+        (card-ability state :corp yale 1)
+        (prompt-select :corp firmscored)
+        (is (= 7 (:credit (get-corp))) "Gained 3 credits")
+        (card-ability state :corp yale 0)
+        (is (= 9 (:credit (get-corp))) "Gained 2 credits")
+        (is (= 1 (count (:discard (get-corp)))) "Mark Yale trashed")))))
+
 (deftest public-support
   "Public support scoring and trashing"
   ;TODO could also test for NOT triggering "when scored" events
@@ -176,6 +255,49 @@
       (is (= (:zone (refresh publics2) :discard)))
       (is (= "Public Support" (:title (first (get-in @state [:corp :scored])))))
       (is (= 1 (:agendapoints (first (get-in @state [:corp :scored]))))))))
+
+(deftest reversed-accounts
+  "Reversed Accounts - Trash to make Runner lose 4 credits per advancement"
+  (do-game
+    (new-game (default-corp [(qty "Reversed Accounts" 1)])
+              (default-runner))
+    (play-from-hand state :corp "Reversed Accounts" "New remote")
+    (let [rev (get-in @state [:corp :servers :remote1 :content 0])]
+      (core/advance state :corp {:card (refresh rev)})
+      (core/advance state :corp {:card (refresh rev)})
+      (take-credits state :corp)
+      (play-from-hand state :runner "Sure Gamble")
+      (play-from-hand state :runner "Sure Gamble")
+      (play-from-hand state :runner "Sure Gamble")
+      (take-credits state :runner)
+      (is (= 18 (:credit (get-runner))))
+      (core/advance state :corp {:card (refresh rev)})
+      (core/advance state :corp {:card (refresh rev)})
+      (is (= 4 (:advance-counter (refresh rev))))
+      (core/rez state :corp (refresh rev))
+      (card-ability state :corp rev 0)
+      (is (= 1 (count (:discard (get-corp)))) "Reversed Accounts trashed")
+      (is (= 2 (:credit (get-runner))) "Runner lost 16 credits"))))
+
+(deftest ronin
+  "Ronin - Click-trash to do 3 net damage when it has 4 or more advancements"
+  (do-game
+    (new-game (default-corp [(qty "Ronin" 1) (qty "Mushin No Shin" 1)])
+              (default-runner))
+    (play-from-hand state :corp "Mushin No Shin")
+    (prompt-select :corp (find-card "Ronin" (:hand (get-corp))))
+    (let [ron (get-in @state [:corp :servers :remote1 :content 0])]
+      (is (= 3 (:advance-counter (refresh ron))))
+      (core/rez state :corp (refresh ron))
+      (card-ability state :corp ron 0)
+      (is (= 3 (count (:hand (get-runner)))) "Ronin ability didn't fire with only 3 advancements")
+      (take-credits state :corp)
+      (take-credits state :runner)
+      (core/advance state :corp {:card (refresh ron)})
+      (is (= 4 (:advance-counter (refresh ron))))
+      (card-ability state :corp ron 0)
+      (is (= 3 (count (:discard (get-runner)))) "Ronin did 3 net damage")
+      (is (= 2 (count (:discard (get-corp)))) "Ronin trashed"))))

 (deftest sundew
   "Sundew"
@@ -284,3 +406,19 @@
       (is (= "Adonis Campaign" (get-in @state [:corp :servers :remote5 :content 0 :title])) "Adonis installed by Team Sponsorship")
       (is (nil? (:ts-active (refresh tsp1))) "Team Sponsorship 1 ability disabled")
       (is (nil? (:ts-active (refresh tsp2))) "Team Sponsorship 2 ability disabled"))))
+
+(deftest turtlebacks
+  "Turtlebacks - Gain 1 credit for every new server created"
+  (do-game
+    (new-game (default-corp [(qty "Turtlebacks" 1) (qty "PAD Campaign" 2) (qty "Wraparound" 1)])
+              (default-runner))
+    (core/gain state :corp :click 1)
+    (play-from-hand state :corp "Turtlebacks" "New remote")
+    (let [tb (get-in @state [:corp :servers :remote1 :content 0])]
+      (core/rez state :corp tb)
+      (play-from-hand state :corp "PAD Campaign" "New remote")
+      (is (= 4 (:credit (get-corp))) "Gained 1 credit for new server created")
+      (play-from-hand state :corp "Wraparound" "Server 1")
+      (is (= 4 (:credit (get-corp))) "No credit gained for install into existing server")
+      (play-from-hand state :corp "PAD Campaign" "New remote")
+      (is (= 5 (:credit (get-corp))) "Gained 1 credit for new server created"))))


todo:

todo:

--- src/clj_css_analyzer/core.clj
+++ src/clj_css_analyzer/core.clj
@@ -69,5 +69,9 @@
 ;; todo

 ; diff
-;  + unify resulting hash-map keys' to a set, not vector — diff/intersect/...
-;
+;  + unify resulting hash-map keys' to a set, not vector for diff/intersect/etc.
+;  - multiple css & html files
+;  - ui
+;    ? web
+;    ? local files
+;    ? curl


Fix weapon combat damage calculation

Fix weapon combat damage calculation

--- src/cljc/robinson/combat.cljc
+++ src/cljc/robinson/combat.cljc
@@ -141,7 +141,7 @@
      (log/debug "attack message" msg)
      msg))

-(defn attack-toughness
+(defn attack->toughness
   [attack]
   (case attack
   :bite        5
@@ -183,7 +183,7 @@
           defender-speed     (dcp/get-speed defender state)
           attacker-size      (dcp/get-size attacker state)
           defender-size      (dcp/get-size defender state)
-          attack-toughness   (dcp/get-toughness attacker state)
+          attack-toughness   (attack->toughness attack)
           defender-toughness (dcp/get-toughness defender state)]
       (log/info "attacker-strength" attacker-strength)
       (log/info "attacker-dexterity" attacker-dexterity)
@@ -192,6 +192,12 @@
       (log/info "defender-size" defender-size)
       (log/info "attack-toughness" attack-toughness)
       (log/info "defender-toughnes" defender-toughness)
+      (assert attacker-strength)
+      (assert attacker-dexterity)
+      (assert defender-speed)
+      (assert defender-size)
+      (assert attack-toughness  (str "attack" attack))
+      (assert defender-toughness)
       (* attacker-strength
          (/ (+ 5 (rr/uniform-double (* 10 attacker-dexterity))) (+ 15 defender-speed))
          (/ (+ 125 attacker-size) (+ 125 defender-size))
@@ -398,6 +404,8 @@
                :world         {:npcs [defender]
                                :player attacker
                                :time 0}}
+        knife  (assoc (ig/gen-item :knife) :wielded true)
+        #_#_state         (rp/add-to-inventory state [knife])
         attacker-path [:world :player]
         defender-path [:world :npcs 0]
         pass-through  (fn [m & _] m)]


Rename :bind-to option to :def and safe handle nil if no options provided to defactivity

--- src/clojure/neko/activity.clj
+++ src/clojure/neko/activity.clj
@@ -111,22 +111,23 @@

   :extends, :prefix - same as for `gen-class`.

-  :bind-to - symbol to bind the Activity object to in the onCreate
+  :def - symbol to bind the Activity object to in the onCreate
   method. Relevant only if :create is used.

   :create - takes a two-argument function. Generates a handler for
   activity's `onCreate` event which automatically calls the
   superOnCreate method and creates a var with the name denoted by
-  `:bind-to` (or activity's lower-cased name by default) to store the
+  `:def` (or activity's lower-cased name by default) to store the
   activity object. Then calls the provided function onto the
   Application object.

   :start, :restart, :resume, :pause, :stop, :destroy - same as :create
   but require a one-argument function."
-  [name & {:keys [extends prefix create bind-to] :as options}]
-  (let [sname (simple-name name)
+  [name & {:keys [extends prefix create def] :as options}]
+  (let [options (or options {}) ;; Handle no-options case
+        sname (simple-name name)
         prefix (or prefix (str sname "-"))
-        bind-to (or bind-to (symbol (unicaseize sname)))]
+        def (or def (symbol (unicaseize sname)))]
     `(do
        (gen-class
         :name ~name
@@ -145,7 +146,7 @@
              [~(vary-meta 'this assoc :tag name),
               ^android.os.Bundle ~'savedInstanceState]
              (.superOnCreate ~'this ~'savedInstanceState)
-             (def ~(vary-meta bind-to assoc :tag name) ~'this)
+             (def ~(vary-meta def assoc :tag name) ~'this)
              (~create ~'this ~'savedInstanceState)))
        ~@(map #(let [func (options %)
                      event-name (capitalize (.getName ^clojure.lang.Keyword %))]


CMR-5201: Add a maybe-deref utility function.

--- src/cmr/http/kit/response.clj
+++ src/cmr/http/kit/response.clj
@@ -23,6 +23,13 @@
     body
     (slurp body)))

+(defn maybe-deref
+  [maybe-ref]
+  (try
+    @maybe-ref
+    (catch Exception _
+      maybe-ref)))
+
 (defn soft-reference->json!
   "Given a soft reference object and a Cheshire JSON generator, write the
   data stored in the soft reference to the generator as a JSON string.
@@ -31,9 +38,10 @@
   a raw value from the response. In that case, we need to skip the object
   conversion, and just do the realization."
   [obj json-generator]
-  (let [data @(if (isa? obj SoftReference)
-                (.get obj)
-                obj)
+  (let [data (maybe-deref
+               (if (isa? obj SoftReference)
+                 (.get obj)
+                 obj))
         data-str (json/generate-string data)]
     (log/trace "Encoder got data: " data)
     (.writeString json-generator data-str)))


extract lib/*.jar like lein's native-deps plugin does

--- src/cake/tasks/deps.clj
+++ src/cake/tasks/deps.clj
@@ -64,8 +64,10 @@

 (defn extract-native [jars dest]
   (doseq [jar jars]
+    (ant Copy {:todir (str dest "/native") :flatten true}
+         (add-zipfileset {:src jar :includes (format "native/%s/%s/*" (os-name) (os-arch))}))
     (ant Copy {:todir dest :flatten true}
-         (add-zipfileset {:src jar :includes (format "native/%s/%s/*" (os-name) (os-arch))}))))
+         (add-zipfileset {:src jar :includes "lib/*.jar" }))))

 (defn fetch [deps dest]
   (when (seq deps)
@@ -77,7 +79,7 @@
            (.addFileset (get-reference ref-id)))))
   (extract-native
    (fileset-seq {:dir dest :includes "*.jar"})
-   (str dest "/native")))
+   dest))

 (defn make-pom []
   (let [refid "cake.pom"


Attempt a unit test for my hello endpoint

--- test/takehome/unit/web.clj
+++ test/takehome/unit/web.clj
@@ -38,4 +38,9 @@
  (fact "Healthcheck returns OK"
        (let [resp (request :get "/healthcheck")]
          (:status resp) => 200
-         (get-in resp [:body :name]) => "takehome")))
+         (get-in resp [:body :name]) => "takehome"))
+
+ (fact "Hello returns OK"
+       (let [resp (request :get "/hello" {:nickname "world"})]
+         (:status resp) => 200
+         (get-in resp [:body]) => "Hello world!\n")))


Add a keyword for raw js

Add a keyword for raw js

--- src/aurora/compiler/jsth.cljs
+++ src/aurora/compiler/jsth.cljs
@@ -91,6 +91,8 @@
                             "})"))
    (= "new" (head x)) (do (check (= (count x) 2))
                         (str "new " (expression->string (nth x 1))))
+   (= "js*" (head x)) (do (check (= (count x) 2))
+                        (nth x 1))
    (seq? x) (do (check (>= (count x) 1))
               (let [f (expression->string (nth x 0))
                     args (map expression->string (rest x))]


fix 'Luisa and I' (genders were backwards)

--- src/babel/english/lexicon.clj
+++ src/babel/english/lexicon.clj
@@ -918,7 +918,7 @@
      :synsem {:cat :noun
              :pronoun true
              :case :nom
-             :agr {:gender :fem
+             :agr {:gender :masc
                    :person :1st
                    :number :plur}
              :sem {:human true
@@ -928,7 +928,7 @@
      :synsem {:cat :noun
               :pronoun true
               :case :nom
-             :agr {:gender :masc
+             :agr {:gender :fem
                    :person :1st
                    :number :plur}
               :sem {:human true


fix button select

fix button select

--- src/cljs/re_form/inputs/button_select_input_impl.cljs
+++ src/cljs/re_form/inputs/button_select_input_impl.cljs
@@ -25,12 +25,13 @@
                 :color "white"}]]])

 (defn button-select-input [_]
-  (fn [{:keys [value on-change label-fn items]}]
-    [:div.re-radio-buttons
-     (doall
-      (for [i items]
-        [:div.option
-         {:key (pr-str i)
-          :class (when (= i value) "active")
-          :on-click (partial on-change i)}
-         [:span.value (label-fn i)]]))]))
+  (fn [{:keys [value on-change label-fn value-fn items]}]
+    (let [value-fn (or value-fn identity)]
+      [:div.re-radio-buttons
+       (doall
+        (for [i items]
+          [:div.option
+           {:key (pr-str i)
+            :class (when (= (value-fn i) value) "active")
+            :on-click (partial on-change i)}
+           [:span.value (label-fn i)]]))])))


made best-alternate-phrase public

made best-alternate-phrase public

--- src/distillery/processing.clj
+++ src/distillery/processing.clj
@@ -47,7 +47,7 @@
       :confidence
       (>= cfg/good-confidence)))

-(defn- best-alternate-phrase
+(defn best-alternate-phrase
   "Returns the best alternate phrase of a recgnition result."
   [result]
   (apply max-key :confidence (:alternates result)))


Only show signatures if there are any

Only show signatures if there are any

--- src/catalog/layout/dtbook.clj
+++ src/catalog/layout/dtbook.clj
@@ -19,8 +19,10 @@
    (if rucksackbuch?
      [:p (wrap producer-brief "" ", " false) (wrap rucksackbuch-number "Rucksackbuch Nr. ")]
      [:p (wrap producer-brief)])
-   [:p "Ausleihe: " (layout/braille-signatures library-signature)]
-   [:p "Verkauf: " (wrap price "" ". " false) (layout/braille-signatures product-number)]])
+   (when library-signature
+     [:p {:class "aus"} "Ausleihe: " (layout/braille-signatures library-signature)])
+   (when product-number
+     [:p {:class "ver"} "Verkauf: " (wrap price "" ". " false) (layout/braille-signatures product-number)])])

 (defn catalog-entries [items]
   [:div {:class "catalog-list"}


change Space Camp advancement to :placed true

--- src/clj/game/cards-assets.clj
+++ src/clj/game/cards-assets.clj
@@ -508,7 +508,7 @@
    "Space Camp"
    {:access {:msg (msg "place 1 advancement token on " (if (:rezzed target) (:title target) "a card"))
              :choices {:req #(or (= (:type %) "Agenda") (:advanceable %))}
-             :effect (effect (add-prop target :advance-counter 1))}}
+             :effect (effect (add-prop target :advance-counter 1 {:placed true}))}}

    "Sundew"
    {:events {:runner-spent-click {:req (req (not (= (:server run) (:zone card)))) :once :per-turn


api change

api change

--- src/clj/shadow/cljs/build.clj
+++ src/clj/shadow/cljs/build.clj
@@ -1131,7 +1131,7 @@
                                 [source-path name]))
                          (into #{}))]
     (->> reloadable-paths
-         (mapcat find-fs-resources)
+         (mapcat #(find-fs-resources % state))
          (remove (fn [{:keys [source-path name]}]
                    (contains? known-files [source-path name])))
          (map #(assoc % :scan :new))


remove debug output

remove debug output

--- src/clj_money/web/budgets.clj
+++ src/clj_money/web/budgets.clj
@@ -503,9 +503,6 @@
                                :account-id
                                :periods]))
         updated (budgets/update-item (env :db) item)]
-
-    (pprint {:updated updated})
-
     (if (empty? (validation/error-messages updated))
       (redirect (format "/budgets/%s" (:budget-id updated)))
       (edit-item {:item updated}))))


parse integers in budget item params

parse integers in budget item params

--- src/clj_money/web/budgets.clj
+++ src/clj_money/web/budgets.clj
@@ -219,7 +219,10 @@
 (defn create-item
   "Creates an budget item"
   [params]
-  (let [item (select-keys params [:budget-id :account-id :average])
+  (let [item (-> params
+                 (select-keys [:budget-id :account-id :average])
+                 (update-in [:budget-id] #(Integer. %))
+                 (update-in [:account-id] #(Integer. %)))
         adjusted (-> item
                      (assoc :periods (extract-periods-from-average item))
                      (dissoc :average))


Use repo consistently and close when done

--- src/clojure/nightcode/git.clj
+++ src/clojure/nightcode/git.clj
@@ -233,9 +233,8 @@
             forms]]))

 (defn create-html
-  [^Git git ^RevCommit commit]
+  [^FileRepository repo ^RevCommit commit]
   (let [out (ByteArrayOutputStream.)
-        repo (.getRepository git)
         df (doto (DiffFormatter. out)
              (.setRepository repo))
         [old-tree new-tree] (diff-trees repo commit)
@@ -322,10 +321,10 @@
         (.setSelectionMode TreeSelectionModel/SINGLE_TREE_SELECTION))))

 (defn update-content!
-  [^JTree sidebar content ^Git git ^RevCommit commit]
+  [^JTree sidebar content ^FileRepository repo ^RevCommit commit]
   (.setText content (clj->html (utils/get-string :loading)))
   (future
-    (let [s (create-html git commit)]
+    (let [s (create-html repo commit)]
       (s/invoke-later
         (when (= commit (selected-commit sidebar))
           (doto content
@@ -335,21 +334,19 @@
 (defn update-sidebar!
   ([]
     (let [{:keys [sidebar
+                  repo
                   content
-                  offset]} (get @editors/editors @ui/tree-selection)
-          path (ui/get-project-root-path)]
-      (when (and sidebar content offset path)
-        (update-sidebar! sidebar content offset (git-file path)))))
-  ([^JTree sidebar content offset f]
+                  offset]} (get @editors/editors @ui/tree-selection)]
+      (when (and sidebar repo content offset)
+        (update-sidebar! sidebar repo content offset))))
+  ([^JTree sidebar ^FileRepository repo content offset]
     ; remove existing listener
     (doseq [l (.getTreeSelectionListeners sidebar)]
       (.removeTreeSelectionListener sidebar l))
     ; add model and listener, then re-select the row
-    (let [repo (FileRepository. f)
-          git (Git. repo)
-          commits (cons nil ; represents uncommitted changes
+    (let [commits (cons nil ; represents uncommitted changes
                         (try
-                          (-> git .log (.setMaxCount max-commits)
+                          (-> repo Git. .log (.setMaxCount max-commits)
                               (.setSkip @offset) .call .iterator iterator-seq)
                           (catch Exception _ [])))
           selected-row (selected-row sidebar commits)]
@@ -359,7 +356,7 @@
           (reify TreeSelectionListener
             (valueChanged [this e]
               (->> (some-> e .getPath .getLastPathComponent .getUserObject)
-                   (update-content! sidebar content git)))))
+                   (update-content! sidebar content repo)))))
         (.setSelectionRow (or selected-row 0))))))

 (def ^:dynamic *widgets* [:pull :push :close])
@@ -417,7 +414,7 @@
           offset-atom (atom 0)
           content (create-content repo)
           sidebar (doto (create-sidebar)
-                    (update-sidebar! content offset-atom f))
+                    (update-sidebar! repo content offset-atom))
           paging-panel (doto (s/horizontal-panel
                                :items (create-paging-buttons offset-atom))
                          (update-paging-buttons! offset-atom))
@@ -441,9 +438,11 @@
       ; return a map describing the view
       {:view git-pane
        :sidebar sidebar
+       :repo repo
        :content content
        :offset offset-atom
-       :close-fn! (fn [])
+       :close-fn! (fn []
+                    (.close repo))
        :should-remove-fn #(not (.exists f))
        :italicize-fn (fn [] false)})))


Changed homology sampling to divide by longer program's size

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -45,12 +45,17 @@
             (count @population-behaviors))))

 (defn sample-population-edit-distance
+  "Returns a sample of Levenshtein distances between programs in the population,
+   where each is divided by the length of the longer program."
   [pop samples]
   (let [instr-programs (map #(map :instruction %)
                             (map :genome pop))]
     (repeatedly samples
-                #(levenshtein-distance (random/lrand-nth instr-programs)
-                                       (random/lrand-nth instr-programs)))))
+                #(let [prog1 (random/lrand-nth instr-programs)
+                       prog2 (random/lrand-nth instr-programs)
+                       longer-length (max (count prog1) (count prog2))]
+                   (float (/ (levenshtein-distance prog1 prog2)
+                             longer-length))))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; log printing (csv and json)


Modifying indicies now updates :updated

Modifying indicies now updates :updated

--- src/hphelper/live/control.clj
+++ src/hphelper/live/control.clj
@@ -117,7 +117,12 @@
                     indicies/normalise-all-indicies
                     )]
     (log/trace "modify-index-inner. newInds:" newInds)
-    (update-in scenMap [:indicies] (partial cons newInds))))
+    (-> scenMap
+        (update-in [:indicies] (partial cons newInds))
+        (assoc-in [:updated :indicies] (current-time))
+        )
+    )
+  )

 (defn modify-index
   "Modifys an index by a certain amount, returns the map, or nil if the game doesn't exist"


CMR-615: Removed debug output.

CMR-615: Removed debug output.

--- src/cmr/search/api/routes.clj
+++ src/cmr/search/api/routes.clj
@@ -148,7 +148,6 @@
 (defn- find-concepts
   "Invokes query service to find results and returns the response"
   [context path-w-extension params headers query-string]
-  (println headers)
   (if (= "application/x-www-form-urlencoded" (get headers (str/lower-case CONTENT_TYPE_HEADER)))
     (let [concept-type (concept-type-path-w-extension->concept-type path-w-extension)
           context (-> context


Updated to use new method of extracting trace context information from the request.

--- src/cmr/search/api/routes.clj
+++ src/cmr/search/api/routes.clj
@@ -8,7 +8,7 @@
             [cmr.common.log :refer (debug info warn error)]
             [cmr.common.api.errors :as errors]
             [cmr.search.services.query-service :as query-svc]
-            [cmr.system-trace.context :as context]
+            [cmr.system-trace.http :as http-trace]
             [cmr.search.api.search-results :as sr]))

 (defn get-search-results-format
@@ -28,13 +28,13 @@
 (defn- build-routes [system]
   (routes
     (context "/collections" []
-      (GET "/" {params :params headers :headers}
-        (find-collection-references
-          (context/build-request-context system) params headers)))
+      (GET "/" {params :params headers :headers context :request-context}
+        (find-collection-references context params headers)))
     (route/not-found "Not Found")))

 (defn make-api [system]
   (-> (build-routes system)
+      (http-trace/build-request-context-handler system)
       errors/exception-handler
       handler/site
       ring-json/wrap-json-body


Fix generating a card ID for a new card if there are no cards yet

--- src/kanban/parsing/cards.cljs
+++ src/kanban/parsing/cards.cljs
@@ -16,7 +16,7 @@
        (into [])))

 (defn create-card [st]
-  (let [id   (->> (get-cards st :cards) (map :id) (reduce max) inc)
+  (let [id   (->> (get-cards st :cards) (map :id) (cons 0) (reduce max) inc)
         card {:id id :text "" :assignees []}
         ref  [:card/by-id id]]
     {:card ref


Make sure the first file we get in build-tools/ is a directory (fix #80)

--- src/leiningen/droid/utils.clj
+++ src/leiningen/droid/utils.clj
@@ -40,7 +40,13 @@
   [sdk-path]
   (ensure-paths sdk-path)
   ;; for now just try to infer whether we're having build-tools 17
-  (let [bt-dir (first (.list (file sdk-path "build-tools")))]
+  (let [bt-root-dir (file sdk-path "build-tools")
+        ;; build-tools directory contains a subdir which name we don't
+        ;; know that has all the tools. Let's grab the first directory
+        ;; inside build-tools/ and hope it is the one we need.
+        bt-dir (->> (.list bt-root-dir)
+                    (filter #(.isDirectory (file bt-root-dir %)))
+                    first)]
     ;; if bt-dir exists (i.e. non-nil) then, probably, it is not empty
     ;; and therefore we can assume that we're running build-tools 17+ revision
     (if bt-dir


use shorter resource function

use shorter resource function

--- src/leiningen/new/cryogen.clj
+++ src/leiningen/new/cryogen.clj
@@ -2,18 +2,12 @@
   (:require [leiningen.new.templates :refer [renderer sanitize year ->files]]
             [leinjacker.utils :refer [lein-generation]]
             [leiningen.core.main :as main]
-            [clojure.string :as string]
-            [clojure.java.io :refer [file] :as io]))
+            [clojure.java.io :refer [file]]))

-(defn binary-renderer
-  "Create a binary renderer function that looks for binary files in the
-  right place given the name of your file."
-  [name]
-  (fn [file]
-    (let [path (string/join "/" ["leiningen" "new" (sanitize name) file])]
-      (if-let [resource (io/resource path)]
-        (io/input-stream resource)
-        (main/abort (format "Template resource '%s' not found." path))))))
+(defn resource [resource]
+  (-> (Thread/currentThread)
+      (.getContextClassLoader)
+      (.getResource (str "leiningen/new/cryogen/" resource))))

 (defn check-lein-version []
   (if (< (lein-generation) 2)
@@ -26,15 +20,14 @@
   (let [options {:name name
                  :sanitized (sanitize name)
                  :year (year)}
-        render (renderer "cryogen")
-        binary (binary-renderer "cryogen")]
+        render (renderer "cryogen")]
     (main/info "Generating fresh 'lein new' Cryogen project.")
     (with-redefs [leiningen.new.templates/render-text (fn [text _] text)]
       (->files options
                [".gitignore"  (render "gitignore")]
                ["project.clj" (render "project.clj")]
                ;;static resources
-               ["resources/templates/img/cryogen.png" (binary "img/cryogen.png")]
+               ["resources/templates/img/cryogen.png" (file (resource "img/cryogen.png"))]
                ;;themes
                ["resources/templates/themes/blue/html/archives.html" (render "themes/blue/html/archives.html")]
                ["resources/templates/themes/blue/html/base.html" (render "themes/blue/html/base.html")]


Shorten function name

Shorten function name

--- dungeon-crawler/desktop/src-common/dungeon_crawler/core.clj
+++ dungeon-crawler/desktop/src-common/dungeon_crawler/core.clj
@@ -6,7 +6,8 @@
             [dungeon-crawler.utils :as u]
             [play-clj.core :refer :all]
             [play-clj.g2d :refer :all]
-            [play-clj.ui :refer :all]))
+            [play-clj.ui :refer :all]
+            [play-clj.utils :as utils]))

 (defn update-screen!
   [screen entities]
@@ -46,7 +47,7 @@
                      (e/move screen entities)
                      (e/animate screen)
                      (e/prevent-move screen entities))))
-         (render-sorted-map! screen ["walls"])
+         (render-sorted! screen ["walls"])
          (update-screen! screen)))
   :on-resize
   (fn [screen entities]


Fix gclosure compiler warning on print. Refs #57

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -2425,11 +2425,12 @@
   [& objs]
   (pr-with-opts objs (pr-opts)))

-(defn print
+(def ^{:doc
   "Prints the object(s) using string-print.
-  print and println produce output for human consumption."
-  [& objs]
-  (pr-with-opts objs (assoc (pr-opts) :readably false)))
+  print and println produce output for human consumption."}
+  print
+  (fn cljs-core-print [& objs]
+    (pr-with-opts objs (assoc (pr-opts) :readably false))))

 (defn println
   "Same as print followed by (newline)"


Remove outdated note in docstring for create-graphics

http://processing.org/discourse/beta/num_1271238026.html

--- src/cljx/quil/core.cljx
+++ src/cljx/quil/core.cljx
@@ -1189,9 +1189,7 @@
   created with create-graphics can have transparency. This makes it
   possible to draw into a graphics and maintain the alpha channel. By
   using save to write a PNG or TGA file, the transparency of the
-  graphics object will be honored. Note that transparency levels are
-  binary: pixels are either complete opaque or transparent. This means
-  that text characters will be opaque blocks."
+  graphics object will be honored."
   #+clj
   ([w h]
      (.createGraphics (current-applet) (int w) (int h)))


Changed cond to case'

Changed cond to case'

--- src/clojurebot/core.clj
+++ src/clojurebot/core.clj
@@ -65,10 +65,10 @@

 (reg-command
   "work"
-  #(cond %
+  #(case %
       "init" "Bleep bloop, initializing work..."
       "end"  "Bleep bloop, work terminated"
-      :else  "Get back to work!"))
+      "Get back to work!"))

 (reg-command
  "coin"


Whitespace.

Whitespace.

--- src/clojurecraft/in.clj
+++ src/clojurecraft/in.clj
@@ -443,7 +443,6 @@
                      :types (replace-array-index (:types @chunk) i type)
                      :metadata (replace-array-index (:metadata @chunk) i meta))))))

-
 (defn- read-packet-blockchange [bot conn]
   (let [data (assoc {}
                     :x (-read-int conn)
@@ -455,7 +454,6 @@
                           (:x data) (:y data) (:z data)
                           (:blocktype data) (:blockmetadata data))
     data))
-

 (defn- read-packet-multiblockchange [bot conn]
   (let [prearrays (assoc {}


simplify config

simplify config

--- resources/leiningen/new/closp/clj/components/config.clj
+++ resources/leiningen/new/closp/clj/components/config.clj
@@ -11,22 +11,7 @@
 (defrecord Config [config]
   component/Lifecycle
   (start [component]
-    (assoc component :config {:hostname (:hostname config)
-                              :mail-from (:mail-from config)
-                              :mail-type (:mail-type config)
-                              :activation-mail-subject (:activation-mail-subject config)
-                              :activation-mail-body (:activation-mail-body config)
-                              :activation-placeholder (:activation-placeholder config)
-                              :smtp-data (:smtp-data config) ; passed directly to postmap like {:host "postfix"}
-                              :jdbc-url (:jdbc-url config)
-                              :env (:env config)
-                              :registration-allowed? (:registration-allowed? config)
-                              :captcha-enabled? (:captcha-enabled? config)
-                              :private-recaptcha-key (:private-recaptcha-key config)
-                              :recaptcha-domain (:recaptcha-domain config)
-                              :captcha-public-key (:captcha-public-key config)
-                              :port (:port config)
-                              :closp-definitions (:closp-definitions config)}))
+    (assoc component :config config))
   (stop [component]
     (assoc component :config nil)))


Use synonyms function instead of inline synonyms.

--- src/haystack/create_index.clj
+++ src/haystack/create_index.clj
@@ -36,25 +36,19 @@
   []
   (let [groups (map #(string/split % #" ") synonym-list)
         syns (map (fn [[main & others]] (map #(string/join #"," [main %]) others)) groups)]
-    (flatten syns)))
+    (vec (flatten syns))))

 ;; (synonyms)

 (def ecommerce-mapping-types
   (let [;; analyzers
-        ;; snowball {:type "string" :analyzer "snowball" :store true}
-        ;; snowball {:type "string" :analyzer "snowball" :index_options "offsets" :store true}
-        ;; snowball {:type "string" :analyzer "snowball"}
         snowball {:type "string" :analyzer "synonym-snowball"}
         part-num {:type "string" :analyzer "part-num-analyzer"}
-        ;; part-num {:type "string"}
         string {:type "string"}
         integer {:type "integer"}
         long {:type "long"}
         ignore-int {:type "integer" :include_in_all false}
         path {:type "string" :analyzer "path-analyzer"}
-        ;; path {:type "string" :index "not_analyzed"}
-        ;; path {:type "string"}
         date {:type "date", :format "strict_date_optional_time||epoch_millis"}
         upc {:type "string" :analyzer "upc-analyzer"}

@@ -86,11 +80,7 @@
         :snowball-filter {:type "snowball"
                           :language "English"}
         :synonym-filter {:type "synonym"
-                         :synonyms
-                         ;; ["romex,nm"]
-                         ["romex,nm" "so,seoow" "so,seow" "so,soow" "so,sow" "pipe,conduit" "gfi,gfci" "bx,mc"]
-                         ;;(synonyms)
-                         }
+                         :synonyms (synonyms)}
         }

        :tokenizer
@@ -132,9 +122,6 @@
                :manufacturer-name snowball
                :product-class snowball
                :matnr {:type "string"}
-               ;; :matnr {:type "string" :tokenizer "keyword"}
-               ;; :matnr long
-               ;; :matnr {:type "string" :analyzer "not_analyzed" :search_analyzer "not_analyzed"}

                :manufacturer-part-number part-num
                :summit-part-number part-num
@@ -152,14 +139,6 @@
                :manufacturer-id ignore-int
                })}}
        }))
-
-;; (do
-;;   (esi/delete haystack.repo/repo "testing")
-;;   (esi/create haystack.repo/repo "testing" ecommerce-mapping-types)
-;;   ;; curl '192.168.0.220:9201/testing/_analyze?pretty=1&analyzer=part-num-analyzer' -d 'FC;(!- %^/&>a@<,:#''}{`_~][+|="$\?,c]'})
-;;   ;;   => should return only one ngram
-;;   )
-

 (defn bulk-create-all
   "adds all docs in one shot"


Fix Typo

Fix Typo

--- src/lens/schema.clj
+++ src/lens/schema.clj
@@ -71,7 +71,7 @@
     {:db/ident :form/studies
      :db/valueType :db.type/ref
      :db/cardinality :db.cardinality/many
-     :db/doc "A reference to all the studies of a form."}
+     :db/doc "A reference to all studies of a form."}

     ;; Item-Group


Add robots.txt

Add robots.txt

--- mtg-pairings-server/src/clj/mtg_pairings_server/handler.clj
+++ mtg-pairings-server/src/clj/mtg_pairings_server/handler.clj
@@ -49,6 +49,11 @@
       :headers {"Content-Type"  "text/html"
                 "Cache-Control" "no-cache"}})))

+(def robots-txt
+  {:status  200
+   :body    "User-agent: *\nDisallow: /\n"
+   :headers {"Content-Type" "text/plain"}})
+
 (defroutes site-routes
   (GET "/" [] (loading-page))
   (GET "/tournaments" []
@@ -88,6 +93,7 @@
   (GET "/tournaments/:id/organizer" [] (loading-page))
   (GET "/tournaments/:id/organizer/menu" [] (loading-page))
   (GET "/tournaments/:id/organizer/deck-construction" [] (loading-page))
+  (GET "/robots.txt" [] robots-txt)
   ws/routes)

 (defroutes app-routes


Make not ready on eval

Make not ready on eval

--- src-frontend/cljs/cljs_webrepl/core.cljs
+++ src-frontend/cljs/cljs_webrepl/core.cljs
@@ -181,8 +181,6 @@
   (let [expression (str/trim (:input @state))]
     (when-not (str/blank? expression)
       (eval-str! expression)
-      (swap! state assoc :input "" :cursor 0))))
-
       (swap! state assoc :ready? false :input "" :cursor 0))))


Docstring tweak.

Docstring tweak.

--- clojure/src/advent2017/day9.clj
+++ clojure/src/advent2017/day9.clj
@@ -1,7 +1,7 @@
 (ns advent2017.day9
   "Write an instaparse grammar to parse the input into groups of garbage,
-  ignoring the discard garbage. Part 1 is the sum of the bread-first depths of
-  the groups. Part 2 is the sum of the number of non-discard garbage."
+  ignoring the discard garbage. Part 1 is the sum of the depths of the groups.
+  Part 2 is the sum of the number of non-discard garbage."
   (:require [instaparse.core :as insta]
             [advent2017.core :refer [read-puzzle ->lines]]))