CMR-7197: Most tests are working now, need to confirm if the failing tests need their expected results changed

--- system-int-test/test/cmr/system_int_test/ingest/subscription_ingest_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/subscription_ingest_test.clj
@@ -21,9 +21,7 @@
    [cmr.transmit.access-control :as access-control]
    [cmr.transmit.config :as transmit-config]
    [cmr.transmit.metadata-db :as mdb2]
-   [cmr.mock-echo.data.urs-db :as urs-db]))
-
-(urs-db/create-users system/context '(user1 user2 user3 user4 admin-user post-user put-user sub-user))
+   [cmr.mock-echo.client.mock-urs-client :as mock-urs]))

 (use-fixtures :each
   (join-fixtures
@@ -38,6 +36,20 @@
                                                       [:read]
                                                       [:read :update])]))

+
+
+(defn create-users-fixture [fn]
+  (mock-urs/create-users (system/context) [{:username "user1" :password "user1pass"}
+                                           {:username "user2" :password "user2pass"}
+                                           {:username "user3" :password "user3pass"}
+                                           {:username "user4" :password "user4pass"}
+                                           {:username "admin-user" :password "admin-userpass"}
+                                           {:username "post-user" :password "post-userpass"}
+                                           {:username "put-user" :password "put-userpass"}
+                                           {:username "sub-user" :password "sub-userpass"}
+                                           {:username "someSubId" :password "someSubIdpass"}])
+  (fn))
+
 (defn- process-subscriptions
   "Sets up process-subscriptions arguments. Calls process-subscriptions, returns granule concept-ids."
   []
@@ -45,6 +57,9 @@
                            (remove :deleted)
                            (map #(select-keys % [:concept-id :extra-fields :metadata])))]
     (#'jobsub/process-subscriptions (system/context) subscriptions)))
+
+
+(use-fixtures :once create-users-fixture)

 (deftest subscription-ingest-no-subscriber-id-test
@@ -81,6 +96,7 @@
                 {:ShortName "coll1"
                  :EntryTitle "entry-title1"})
                {:token "mock-echo-system-token"})]
+    (mock-urs/create-users (system/context) [{:username "someSubId" :password "Password"}])
     (testing "ingest on PROV3, guest is not granted ingest permission for SUBSCRIPTION_MANAGEMENT ACL"
       (let [concept (subscription-util/make-subscription-concept {:provider-id "PROV3"
                                                                   :CollectionConceptId (:concept-id coll1)})
@@ -91,7 +107,7 @@
       (let [concept (subscription-util/make-subscription-concept {:provider-id "PROV3"
                                                                   :CollectionConceptId (:concept-id coll1)})
             user1-token (echo-util/login (system/context) "user1")
-            response (ingest/ingest-concept concept {:token user1-token})]
+            response (ingest/ingest-concept concept {:token user1-token :user-id "user1"})]
         (is (= 201 (:status response)))))))

 (deftest subscription-delete-on-prov3-test
@@ -101,6 +117,7 @@
                 {:ShortName "coll1"
                  :EntryTitle "entry-title1"})
                {:token "mock-echo-system-token"})]
+    (mock-urs/create-users (system/context) [{:username "someSubId" :password "Password"}])
     (testing "delete on PROV3, guest is not granted update permission for SUBSCRIPTION_MANAGEMENT ACL"
       (let [concept (subscription-util/make-subscription-concept {:provider-id "PROV3"
                                                                   :CollectionConceptId (:concept-id coll1)})
@@ -123,6 +140,7 @@
                 {:ShortName "coll1"
                  :EntryTitle "entry-title1"})
                {:token "mock-echo-system-token"})]
+    (mock-urs/create-users (system/context) "someSubId")
     (testing "ingest of a new subscription concept"
       (let [concept (subscription-util/make-subscription-concept
                      {:CollectionConceptId (:concept-id coll1)})
@@ -146,6 +164,7 @@
                 {:ShortName "coll1"
                  :EntryTitle "entry-title1"})
                {:token "mock-echo-system-token"})]
+    (mock-urs/create-users (system/context) [{:username "someSubId" :password "Password"}])
     (testing "json response"
       (let [response (ingest/ingest-concept
                       (subscription-util/make-subscription-concept
@@ -171,6 +190,7 @@
                (dissoc (ingest/parse-ingest-body :xml response) :body)))))))

 (deftest subscription-ingest-with-bad-query-error-test
+  (mock-urs/create-users (system/context) [{:username "someSubId" :password "Password"}])
   (testing "ingest of a new subscription concept"
     (let [coll1 (data-core/ingest-umm-spec-collection
                   "PROV1"
@@ -192,6 +212,7 @@

 ;; Verify that the accept header works with returned errors
 (deftest subscription-ingest-with-errors-accept-header-test
+  (mock-urs/create-users (system/context) [{:username "" :password "Password"}])
   (testing "json response"
     (let [concept-no-metadata (assoc (subscription-util/make-subscription-concept)
                                      :metadata "")
@@ -219,6 +240,11 @@
                 {:ShortName "coll1"
                  :EntryTitle "entry-title1"})
                {:token "mock-echo-system-token"})]
+    (mock-urs/create-users (system/context) [{:username "user1" :password "Pass1"}
+                                             {:username "user2" :password "Pass2"}
+                                             {:username "user3" :password "Pass3"}
+                                             {:username "user4" :password "Pass4"}
+                                             {:username "someSubId" :password "somePass"}])
     (testing "ingest of new concept"
       (are3 [ingest-headers expected-user-id]
         (let [concept (subscription-util/make-subscription-concept {:CollectionConceptId (:concept-id coll1)})
@@ -277,6 +303,7 @@
                   :CollectionConceptId (:concept-id coll1)
                   :native-id "Atlantic-1"}
         concept (subscription-util/make-subscription-concept metadata)]
+    (mock-urs/create-users (system/context) [{:username "someSubId" :password "Pass"}])
     (testing "ingest of a new subscription concept with concept-id present"
       (let [{:keys [concept-id revision-id]} (ingest/ingest-concept concept)]
         (is (mdb/concept-exists-in-mdb? concept-id revision-id))
@@ -313,6 +340,7 @@
                     :CollectionConceptId (:concept-id coll1)
                     :native-id "Atlantic-1"}
           concept (subscription-util/make-subscription-concept metadata)]
+      (mock-urs/create-users (system/context) [{:username "someSubId" :password "Password"}])
       (subscription-util/ingest-subscription concept)
       (testing "send an update event to an new subscription"
         (let [resp (subscription-util/update-subscription-notification supplied-concept-id)]
@@ -323,6 +351,8 @@
           (is (= 404 (:status resp))))))))

 (deftest subscription-ingest-schema-validation-test
+  (mock-urs/create-users (system/context) [{:username "" :password "Password"}])
+  (mock-urs/create-users (system/context) [{:username "someSubId" :password "Password"}])
   (testing "ingest of subscription concept JSON schema validation missing field"
     (let [concept (subscription-util/make-subscription-concept {:SubscriberId ""})
           {:keys [status errors]} (ingest/ingest-concept concept)]
@@ -355,6 +385,7 @@
                    :Query "platform=NOAA-9"
                    :native-id "other"})
         _ (ingest/ingest-concept concept)]
+    (mock-urs/create-users (system/context) [{:username "someSubId" :password "Password"}])
     (testing "update concept with a different concept-id is invalid"
       (let [{:keys [status errors]} (ingest/ingest-concept
                                      (assoc concept :Query "platform=NOAA-10" :concept-id "SUB1111-PROV1"))]
@@ -374,6 +405,7 @@
                [status errors]))))))

 (deftest delete-subscription-ingest-test
+  (mock-urs/create-users (system/context) [{:username "someSubId" :password "Password"}])
   (testing "delete a subscription"
     (let [coll1 (data-core/ingest-umm-spec-collection
                  "PROV1"
@@ -546,6 +578,7 @@

 ;; case 5 test account 2 which does NOT match metadata user and account has prems ; this should be MMT's use case
 (deftest roll-your-own-subscription-and-have-acls-tests-with-acls
+  (mock-urs/create-users (system/context) [{:username "user1" :password "Password"}])
   (testing "Use an account which does not match matches the metadata and DOES have an ACL"
     (let [user2-token (echo-util/login (system/context) "user2")
           supplied-concept-id "SUB1000-PROV1"
@@ -832,7 +865,7 @@
               "PROV1"
               (data-umm-c/collection)
               {:token "mock-echo-system-token"})]
-
+    (mock-urs/create-users (system/context) [{:username "post-user" :password "Password"}])
     (testing "without native-id returns an error"
       (let [concept (dissoc (subscription-util/make-subscription-concept
                              {:SubscriberId "post-user"
@@ -852,8 +885,8 @@
                              :Name "a different subscription with native-id"
                              :CollectionConceptId (:concept-id coll)})
                            :native-id "another-native-id")
-            {:keys [native-id concept-id status]} (ingest/ingest-concept concept {:token token
-                                                                                :method :put})]
+            {:keys [native-id concept-id status errors]} (ingest/ingest-concept concept {:token token
+                                                                                :method :put})]
         (is (= 201 status))
         (is (not (nil? concept-id)))
         (is (= "another-native-id" native-id))
@@ -940,4 +973,4 @@
             user1-token (echo-util/login (system/context) "user1")
             response (ingest/ingest-concept concept {:token user1-token})]
         (is (= 401 (:status response)))
-        (is (= "The user-id [invalid-user] does not exist." (first (:errors response))))))))+        (is (= "The user-id must correspond to a valid EDL account." (first (:errors response))))))))


remove extra parameter

remove extra parameter

--- test/babel/test/parse.cljc
+++ test/babel/test/parse.cljc
@@ -48,10 +48,10 @@
   (is (= 2 (count (string/split "je suis" tokenizer)))))

 (deftest toks-test1
-  (is (= 2 (count (toks "je suis" lexicon lookup)))))
+  (is (= 2 (count (toks "je suis" lookup)))))

 (deftest toks-test2
-  (is (= 2 (count (nth (toks "je suis" lexicon lookup) 0)))))
+  (is (= 2 (count (nth (toks "je suis" lookup) 0)))))

 (deftest toks-test3
-  (is (= 2 (count (nth (toks "je suis" lexicon lookup) 1)))))
+  (is (= 2 (count (nth (toks "je suis" lookup) 1)))))


Set the default print function for tests in V8.

--- test/cljs/test_runner.cljs
+++ test/cljs/test_runner.cljs
@@ -2,6 +2,8 @@
   (:require [cljs.core-test :as core-test]
             [cljs.reader-test :as reader-test]
             [clojure.string-test :as string-test]))
+
+(set! *print-fn* js/print)

 (core-test/test-stuff)
 (reader-test/test-reader)


use io/delete-file instead of .delete

use io/delete-file instead of .delete

--- test/duratom/core_test.clj
+++ test/duratom/core_test.clj
@@ -285,12 +285,12 @@

 (defn- sqlite-backed-tests*
   [async?]
-  (let [subname "sqlite-test.sqlite"
-        _ (when (.exists (io/file subname))
-            (io/delete-file subname)) ;; proper cleanup before testing
+  (let [filename "sqlite-test.sqlite"
+        _ (when (.exists (io/file filename))
+            (io/delete-file filename)) ;; proper cleanup before testing
         db-spec {:classname   "org.sqlite.JDBC"
                  :subprotocol "sqlite"
-                 :subname     subname
+                 :subname     "sqlite-test.sqlite"
                  :user        "dimitris"
                  :password    "secret"}
         table-name "atom_state"
@@ -338,7 +338,7 @@
                #(some? (ut/get-sql-value db-spec table-name 0 ut/read-edn-string))
                async?))
     ;; manually delete sqlite file to clean up
-    (.delete (io/file subname))))
+    (io/delete-file filename)))

 (deftest sqlite-backed-tests
   (println "SQLite-backed atom/agent with async commit...")


Fix modal not getting dismissed on rebuild

--- src-cljs/frontend/components/pages/build.cljs
+++ src-cljs/frontend/components/pages/build.cljs
@@ -81,9 +81,9 @@

     om/IWillReceiveProps
     (will-receive-props [_ data]
-      (let [build (get-in data state/build-path)]
-        (when (no-test-intervention/show-setup-docs-modal? build)
-          (om/set-state! owner :show-setup-docs-modal? true))))
+      (let [build (get-in data state/build-path)
+            show-setup-docs-modal? (no-test-intervention/show-setup-docs-modal? build)]
+        (om/set-state! owner :show-setup-docs-modal? show-setup-docs-modal?)))

     om/IRenderState
     (render-state [_ {:keys [show-jira-modal? show-setup-docs-modal?]}]


added some tests

added some tests

--- test/k_means/core_test.clj
+++ test/k_means/core_test.clj
@@ -1,3 +1,11 @@
 (ns k-means.core-test
   (:require [clojure.test :refer :all]
             [k-means.core :refer :all]))
+
+(deftest mean-test
+  (testing "means"
+    (is (= 2.5 (mean [1 2 3 4])))))
+
+(deftest distance-test
+  (testing "distance"
+    (is (= 5.0 (distance [2 -1] [-2 2])))))


Show correct error message when signing typed data

Prior to this commit `sign-message-completed` effect would always use
the `wrong-password` label for error handling. We now ensure that `wrong-password`
is only used in case the error in question has a code `5`, which is
associated to unmatching passwords.

In any other case we'll use the `message` attached to the `error`.

Fixes #8275

Signed-off-by: Andrey Shovkoplyas <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/signing/core.cljs
+++ src/status_im/signing/core.cljs
@@ -301,7 +301,9 @@
   (let [{:keys [result error]} (types/json->clj result)
         on-result (get-in db [:signing/tx :on-result])]
     (if error
-      {:db (update db :signing/sign assoc :error (i18n/label :t/wrong-password) :in-progress? false)}
+      {:db (update db :signing/sign assoc
+                   :error (if (= 5 (:code error)) (i18n/label :t/wrong-password) (:message error))
+                   :in-progress? false)}
       (fx/merge cofx
                 {:db (dissoc db :signing/tx :signing/in-progress? :signing/sign)}
                 (check-queue)


Move JS test to actual JS execution.

Move JS test to actual JS execution.

--- test/soy_clj/core_test.clj
+++ test/soy_clj/core_test.clj
@@ -4,21 +4,24 @@
             [clojure.string :as string]
             [clojure.test :refer :all]
             [soy-clj.core :refer :all :as soy-clj])
-  (:import [com.google.template.soy SoyFileSet SoyFileSet$Builder]
-           [com.google.template.soy.data SanitizedContent]
-           [com.google.template.soy.jssrc.restricted JsExpr]))
+  (:import (javax.script ScriptEngine ScriptEngineManager)
+           (com.google.template.soy SoyFileSet SoyFileSet$Builder)
+           (com.google.template.soy.data SanitizedContent
+                                         SanitizedContent$ConstantContent)
+           (com.google.template.soy.jssrc.restricted JsExpr)))

 (deftest ordain-as-safe-test
   (let [jsexpr (JsExpr. "'<foo>'" Integer/MAX_VALUE)]
     (testing "marks html js expressions safe"
       (is (= "soydata.VERY_UNSAFE.ordainSanitizedHtml('<foo>')"
-             (.getText (ordain-as-safe jsexpr :html))))))
+             (.getText ^JsExpr (ordain-as-safe jsexpr :html))))))

   (testing "marks html safe"
     (is (instance? SanitizedContent (ordain-as-safe "" :html))))

   (testing "renders safe html properly"
-    (is (= "" (.getContent (ordain-as-safe "" :html))))))
+    (is (= "" (.getContent ^SanitizedContent$ConstantContent
+                                  (ordain-as-safe "" :html))))))

 (deftest content-type-test
   (testing "The content types of various kinds"
@@ -41,8 +44,12 @@
                  (compile-to-js "bad.soy"))))
   (testing "Compiling templates to Javascript"
     (set-cache (cache/lu-cache-factory {}))
-    (is (= (slurp "test/example.js")
-           (compile-to-js "example.soy")))
+    (let [js (.. (ScriptEngineManager.)
+                 (getEngineByName "nashorn"))]
+      (.eval js ^String (slurp "resources/META-INF/resources/webjars/soy-clj/2016-01-12/soyutils.js"))
+      (.eval js ^String (compile-to-js "example.soy"))
+      (is (= "Hello world!"
+             (.eval js "examples.simple.helloWorld().content"))))
     (is (cache/has? @@#'soy-clj/cache [:js ["example.soy"]]))))

 (deftest parse-test


matcher-combinators: Add `WIP-embeds-test`

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
@@ -156,6 +156,10 @@
               1234)) ; TODO: I guess we need this in contexts where `even?` would not be treated as a pred -- but what are those contexts?
   )

+(deftest WIP-embeds-test ; TODO
+  (is (match? (m/embeds [1 3 5])
+              [1 2 3 4 5])))
+
 ;;;; ___________________________________________________________________________
 ;;;; ---- Exceptions ----


GNFID

GNFID

--- src/clj_simple_chart/ncs/discovery/resource_class_diagram.clj
+++ src/clj_simple_chart/ncs/discovery/resource_class_diagram.clj
@@ -31,15 +31,18 @@
 (def colors {:not-evaluated      hydro-blue
              :likely             brown
              :clarification      orange
-             :pdo-approved       red ;"#fd8d3c"
+             :pdo-approved       red;ø"#A700A7"
              :remaining-reserves "#109618"                  ; hard green
-             :producing-produced light-green
+             :producing-produced "#64c466"
              :shut-down-produced gray})

-
-
-
-
+(def text {:not-evaluated "Ikkje evaluert"
+           :likely "Utvinning sannsynlig"
+           :clarification "Under avklaring"
+           :pdo-approved "PUD*-godkjent"
+           :remaining-reserves "Gjenverande reservar"
+           :producing-produced "Produksjon frå felt i produksjon"
+           :shut-down-produced "Produksjon frå nedstengde felt"})

 (def marg 10)
 (def two-marg (* 2 marg))
@@ -76,11 +79,11 @@

 (def header (opentype/stack
               {:width available-width}
-              [{:text "Funn, felt og produksjon av olje på norsk sokkel" :font "Roboto Bold" :font-size 30}]))
+              [{:text "Gjenverande ressursar og historisk produksjon" :font "Roboto Bold" :font-size 30}]))

 (def footer (opentype/stack
               {:width available-width}
-              [{:margin-top 8 :text "Kjelde: Oljedirektoratet" :font "Roboto Regular" :font-size 14}
+              [{:margin-top 8 :text "Kjelde: Oljedirektoratet. *Plan for Utvikling og Drift." :font "Roboto Regular" :font-size 14}
                {:text "Diagram © Refsdal.Ivar@gmail.com" :font "Roboto Regular" :font-size 14 :valign :bottom :align :right}]))

@@ -101,6 +104,18 @@
     [:g {:transform (translate (:margin-left c) (+ (:height (meta header)) (:margin-top c)))}
      (axis/render-axis (:x c))
      (axis/render-axis (:y c))
+     [:g {:transform (translate 10 15)}
+      (opentype/stack {:widht available-width
+                       :fill "whitesmoke"
+                       :fill-opacity 0.7
+                       :margin 5}
+                      (vec (flatten [{:text "Ressurstype" :font "Roboto Bold" :font-size 14}
+                                     (map (fn [col]
+                                            {:text (get text col)
+                                             :font "Roboto Regular"
+                                             :font-size 14
+                                             :rect {:fill (get colors col)}})
+                                          (reverse number-columns))])))]
      (bars c {:p :year :h :value :fill colors} data)]
     [:g {:transform (translate-y (+ (:height (meta header)) available-height))} footer]]])


Enable parallel builds for figwheel (thanks to cljs 1.7.228).

--- scripts/figwheel.clj
+++ scripts/figwheel.clj
@@ -14,6 +14,7 @@
      :source-paths ["frontend"]
      :compiler {:main 'uxbox.core
                 :asset-path "js"
+                :parallel-build true
                 :optimizations :none
                 :pretty-print true
                 :language-in  :ecmascript5


Fix wrong array copy parameters on string typespec write implementation.

--- src/bytebuf/spec.clj
+++ src/bytebuf/spec.clj
@@ -164,18 +164,20 @@

      IReadableSpec
      (read [_ buff pos]
-       (let [data (buffer/read-bytes buff pos size)]
-         [(String. data "UTF-8") size]))
+       (let [data (buffer/read-bytes buff pos size)
+             data (String. data "UTF-8")]
+         [size data]))

      IWritableSpec
      (write [_ buff pos value]
        (let [input (.getBytes value "UTF-8")
              length (count input)
              tmpbuf (byte-array size)]
-         (System/arraycopy input 0 tmpbuf 0 size)
+         (if (< length size)
+           (System/arraycopy input 0 tmpbuf 0 length)
+           (System/arraycopy input 0 tmpbuf 0 size))
          (when (< length size)
            (Arrays/fill tmpbuf length size (byte 0)))
-
          (buffer/write-bytes buff pos size tmpbuf)
          size))


Fix autowire to be non-destructive

Fix autowire to be non-destructive

--- src/modular/core.clj
+++ src/modular/core.clj
@@ -48,11 +48,11 @@
    {} m))

 (defn autowire-dependencies-satisfying
-  "Return a system definition, adding dependencies between the given
+  "Return a dependency map, adding dependencies between the given
   key (of the dependant) and any components in the given system map that
   satisfy the given protocol."
   [dependency-map system-map dependant-key proto]
-  (normalize-dependency-map {dependant-key (vec (keep (fn [[k v]] (when (satisfies? proto v) k)) (seq system-map)))}))
+  (merge-with merge dependency-map (normalize-dependency-map {dependant-key (vec (keep (fn [[k v]] (when (satisfies? proto v) k)) (seq system-map)))})))

 (defn interpose-component
   "Splice in a component between a dependant component and its


add prepare

add prepare

--- src/neuseg/train.clj
+++ src/neuseg/train.clj
@@ -42,4 +42,6 @@
         (.write wrtr (str (count text) " 32 2\n"))
         (.write wrtr (gen-cases text))))))

+(defn prepare []
+  (gen-train "data/corpus/corpus" "data/trains/train"))


rename json return parameter from login

rename json return parameter from login

--- src/ontrail/core.clj
+++ src/ontrail/core.clj
@@ -29,7 +29,7 @@
   (GET "/summary/:user" [user] (json-response (get-overall-summary user)))
   (POST "/login" [username password]
     (if (authenticate username password)
-      (json-response {"token" (auth-token (get-user username)) "user" username} 200)
+      (json-response {"token" (auth-token (get-user username)) "username" username} 200)
       (json-response {"error" "Authentication failed"} 401)))
   (GET "/secret" {params :params cookies :cookies} (is-authenticated? params cookies (json-response {"secret" "ken sent me"})))


edit back button id fix

edit back button id fix

--- src/cljs/swarmpit/component/service/edit.cljs
+++ src/cljs/swarmpit/component/service/edit.cljs
@@ -8,30 +8,29 @@
 (enable-console-print!)

 (rum/defc form < rum/static [item]
-  (let [id (get item "ID")]
-    [:div
-     [:div.form-panel
-      [:div.form-panel-right
-       (material/theme
-         (material/raised-button
-           #js {:href    "/#/services/create"
-                :label   "Save"
-                :primary true
-                :style   #js {:marginRight "12px"}}))
-       (material/theme
-         (material/raised-button
-           #js {:href  (str "/#/services/" id)
-                :label "Back"}))]]
-     [:div.form-view
-      [:div.form-view-group
-       (material/form-view-section "General settings")
-       (settings/form true)]
-      [:div.form-view-group
-       (material/form-view-section "Ports")
-       (ports/form)]
-      [:div.form-view-group
-       (material/form-view-section "Environment variables")
-       (variables/form)]]]))
+  [:div
+   [:div.form-panel
+    [:div.form-panel-right
+     (material/theme
+       (material/raised-button
+         #js {:href    "/#/services/create"
+              :label   "Save"
+              :primary true
+              :style   #js {:marginRight "12px"}}))
+     (material/theme
+       (material/raised-button
+         #js {:href  (str "/#/services/" (:id item))
+              :label "Back"}))]]
+   [:div.form-view
+    [:div.form-view-group
+     (material/form-view-section "General settings")
+     (settings/form true)]
+    [:div.form-view-group
+     (material/form-view-section "Ports")
+     (ports/form)]
+    [:div.form-view-group
+     (material/form-view-section "Environment variables")
+     (variables/form)]]])

 (defn- init-state
   [item]
@@ -42,4 +41,4 @@
 (defn mount!
   [item]
   (init-state item)
-  (rum/mount (form item) (.getElementById js/document "content")))
+  (rum/mount (form item) (.getElementById js/document "content")))


propagate stack data on update to be

propagate stack data on update to be

--- src/cljs/swarmpit/component/service/edit.cljs
+++ src/cljs/swarmpit/component/service/edit.cljs
@@ -63,7 +63,7 @@

 (defn- init-state
   [service networks]
-  (state/set-value (select-keys service [:distribution :repository :version :serviceName :mode :replicas]) settings/cursor)
+  (state/set-value (select-keys service [:distribution :repository :version :serviceName :mode :replicas :stack]) settings/cursor)
   (state/set-value (:ports service) ports/cursor)
   (state/set-value (->> networks
                         (map #(select-keys % [:networkName]))


Ditto

Ditto

--- src/clojure/clojurewerkz/cassaforte/uuids.clj
+++ src/clojure/clojurewerkz/cassaforte/uuids.clj
@@ -1,6 +1,6 @@
 (ns clojurewerkz.cassaforte.uuids
   "Provides utility functions for UUID generation."
-  (:import [com.datastax.driver.core.utils UUIDs]
+  (:import com.datastax.driver.core.utils.UUIDs
            java.util.UUID))

 (defn random


Ensure that exporting animation doesn't break if canvas size changes over time

--- src/cljs/goya/components/mainmenu.cljs
+++ src/cljs/goya/components/mainmenu.cljs
@@ -30,19 +30,21 @@

 (defn export-history-animation [owner]
   (let [render-canvas (. js/document (createElement "canvas"))
-        width (get-in @app/app-state [:main-app :canvas-width])
-        height (get-in @app/app-state [:main-app :canvas-height])
-        zoom-factor (get-in @app/app-state [:zoom-factor])
+        max-width 64
+        max-height 64
+        zoom-factor 2
         app-history @timemachine/app-history
         gif (js/GIF. #js {:workers 2
                           :quality 10
-                          :width (* width zoom-factor)
-                          :height (* height zoom-factor)
+                          :width (* max-width zoom-factor)
+                          :height (* max-height zoom-factor)
                           :workerScript "./gifjs/dist/gif.worker.js"})]
     (om/set-state! owner :is-processing true)
     (om/set-state! owner :progress 0)
     (dotimes [x (count app-history)]
       (let [history-snapshot (nth app-history x)
+            width (get-in history-snapshot [:canvas-width])
+            height (get-in history-snapshot [:canvas-height])
             image-data (get-in history-snapshot [:image-data])
             context (.getContext render-canvas "2d")]
         (canvasdrawing/draw-image-to-canvas image-data render-canvas width height zoom-factor)


export to pdf

export to pdf

--- src/cljs/salava/badge/ui/settings.cljs
+++ src/cljs/salava/badge/ui/settings.cljs
@@ -17,6 +17,14 @@
     {:handler  (fn []
                  (my/init-data state)
                  (navigate-to "/badge"))}))
+
+(defn export-to-pdf [state]
+  (let [lang-option "all"
+        badge-url (str "/obpv1/badge/export-to-pdf?badges[0]=" (:id @state) "&lang-option="lang-option)]
+    (ajax/GET
+      (path-for (str "/obpv1/badge/export-to-pdf"))
+      {:params {:badges (list (:id @state)) :lang-option lang-option }
+       :handler (js-navigate-to badge-url)})))

 (defn save-settings [state init-data]
   (let [{:keys [id visibility tags rating evidence_url]} (:badge-settings @state)]


scroll to top on init

scroll to top on init

--- src/cljs/swarmpit/component/mixin.cljs
+++ src/cljs/swarmpit/component/mixin.cljs
@@ -18,16 +18,13 @@

 (defn init-form
   [handler]
-  {:init (fn [state _]
-           (state/reset-form)
-           (handler (first (:rum/args state)))
-           state)})
-
-(defn init-tab
-  [handler]
-  {:init (fn [state _]
-           (handler (first (:rum/args state)))
-           state)})
+  {:init      (fn [state _]
+                (state/reset-form)
+                (handler (first (:rum/args state)))
+                state)
+   :did-mount (fn [state]
+                (.scrollTo js/window 0 0)
+                state)})

 (def subscribe-form
   {:did-mount    (fn [state]
@@ -47,8 +44,7 @@
            (when (and el section)
              (do
                (.scrollIntoView el true)
-               (.scrollBy js/window 0 -74)
-               (state/update-value [:scrolled] true state/form-state-cursor))))))
+               (.scrollBy js/window 0 -74))))))
      state)})

 (def focus-filter


bug fix

bug fix

the protein was being directly connected via rdfs:subClassOf to the
appropriate GeneOrGeneProductOrVariant class instead of
GeneOrGeneProduct

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/temp/abstraction/abstraction_extending_rules.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/temp/abstraction/abstraction_extending_rules.clj
@@ -7,12 +7,12 @@

 `{:name "connect-GP-to-GorGP-abstraction"
   ;; this need to be hashed and have proper classes
-  :head ((?/geneProduct rdfs/subClassOf ?/gorgporv))
+  :head ((?/geneProduct rdfs/subClassOf ?/gorgp))

   :body
   ((?/gene rdf/type kbio/GeneSpecificGClass)
-   (?/gene [rdfs/subClassOf clojure.core/*] ?/gorgporv)
-   (?/gorgporv rdf/type kbio/GeneSpecificGorGPorVClass)
+   (?/gene [rdfs/subClassOf clojure.core/*] ?/gorgp)
+   (?/gorgp rdf/type kbio/GeneSpecificGorGPClass)

    (?/r1 owl/someValuesFrom ?/gene)
    (?/r1 owl/onProperty kso/has_indirect_template)


Added some t-norms

Added some t-norms

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

--- src/conexp/contrib/factor_analysis.clj
+++ src/conexp/contrib/factor_analysis.clj
@@ -107,7 +107,35 @@
                  (conj F [C D])))
         (clear-factors F)))))

-;;; Many Valued (with t-norms, TODO)
+;;; Many Valued (with t-norms)
+
+(defmulti t-norm
+  "Returns the t-norm and it's residuum corresponding to the name given."
+  {:arglists '[(t-norm-name)]}
+  identity)
+
+(defmethod t-norm :łukasiewicz
+  [_]
+  [(fn [x y] (max 0 (+ x y -1))),
+   (fn [x y] (min 1 (+ 1 (- x) y)))])
+
+(defmethod t-norm :lukasiewicz
+  [_]
+  (t-norm :łukasiewicz))
+
+(defmethod t-norm :gödel
+  [_]
+  [(fn [x y] (min x y)),
+   (fn [x y] y)])
+
+(defmethod t-norm :goedel
+  [_]
+  (t-norm :gödel))
+
+(defmethod t-norm :product
+  [_]
+  [(fn [x y] (* x y)),
+   (fn [x y] (/ y x))])

 ;;;


Clean jsonml rendering code

Clean jsonml rendering code

--- src/day8/re_frame/trace/app_state.cljs
+++ src/day8/re_frame/trace/app_state.cljs
@@ -4,31 +4,6 @@
             [devtools.formatters.core :as cljs-devtools]

             [cljs.pprint :refer [pprint]]))
-
-(defn css-munge
-  [string]
-  (str/replace string #"\.|/" "-"))
-
-(defn namespace-css
-  [classname]
-  (str "re-frame-trace--" classname))
-
-(defn type-string
-  [obj]
-  (cond
-    (number? obj)    "number"
-    (boolean? obj)   "boolean"
-    (string? obj)    "string"
-    (nil? obj)       "nil"
-    (keyword? obj)   "keyword"
-    (symbol? obj)    "symbol"
-    :else (pr-str (type obj))))
-
-(defn view
-  [data]
-  (if (coll? data)
-    [:div  {:class (str (namespace-css "collection") " " (namespace-css (css-munge (type-string data))))}]
-    [:span {:class (str (namespace-css "primative") " " (namespace-css (css-munge (type-string data))))} (str data)]))

 (defn string->css [css-string]
   (->> (map #(str/split % #":") (str/split (get css-string "style") #";"))
@@ -41,12 +16,6 @@
         (= string "style")  :style
         (= string ", ")     " "
         :else               string))
-
-(defn crawl
-  [data]
-  (if (coll? data)
-    (into (view data) (mapv crawl data))
-    (view data)))

 (declare jsonml->hiccup)

@@ -68,10 +37,11 @@
   [jsonml]
   (cond
     (and (array? jsonml)
-         (= "object" (get jsonml 0))) [data-structure jsonml]
+         (= "object" (first jsonml))) [data-structure jsonml]
     (array? jsonml)                   (mapv jsonml->hiccup jsonml)
     (object? jsonml)                  {:style (string->css (js->clj jsonml))}
-    :else                             (str->hiccup jsonml)))
+    (or (string? jsonml)
+        (integer? jsonml))            (str->hiccup jsonml)))

 (defn tab [data]
   [:div {:style {:flex "1 0 auto" :width "100%" :height "100%" :display "flex" :flex-direction "column"}}


provide stub new-records to force all key removals

identification of stale keys has been changed to ignore
keys which don't have all components present in the new
record, to permit partial upserts

this broke deletion which used nil new-records, so now
it uses new-records with all keys but nil values

--- src/er_cassandra/model/alia/delete.clj
+++ src/er_cassandra/model/alia/delete.clj
@@ -12,38 +12,43 @@
    [er_cassandra.model.types Model]
    [er_cassandra.session Session]))

+(defn nil-values
+  "return a record with the same keys as m but nil values... used to
+   force all secondary/lookup keys to be considered for stale deletion"
+  [m]
+  (->> m
+       keys
+       (map (fn [k] [k nil]))
+       (into {})))
+
 (defn ^:private delete-with-primary
   [^Session session ^Model model key record opts]
   (with-context deferred-context
-    (mlet [primary-response (m/when record
-                               (alia-upsert/delete-record
-                                session
-                                model
-                                (:primary-table model)
-                                (t/extract-uber-key-value
-                                 model
-                                 record)))
+    (mlet [primary-response (alia-upsert/delete-record
+                             session
+                             model
+                             (:primary-table model)
+                             (t/extract-uber-key-value
+                              model
+                              record))

-            unique-responses (m/when record
-                               (alia-unique-key/release-stale-unique-keys
+           unique-responses (alia-unique-key/release-stale-unique-keys
+                             session
+                             model
+                             record
+                             (nil-values record))
+
+           secondary-responses (alia-upsert/delete-stale-secondaries
                                 session
                                 model
                                 record
-                                nil))
+                                (nil-values record))

-            secondary-responses (m/when record
-                                  (alia-upsert/delete-stale-secondaries
-                                   session
-                                   model
-                                   record
-                                   nil))
-
-            lookup-responses (m/when record
-                               (alia-upsert/delete-stale-lookups
-                                session
-                                model
-                                record
-                                nil))]
+           lookup-responses (alia-upsert/delete-stale-lookups
+                             session
+                             model
+                             record
+                             (nil-values record))]
       (return
        [:ok record :deleted]))))


improve render performance

improve render performance

--- clojure/src/dnd/showScreen.cljs
+++ clojure/src/dnd/showScreen.cljs
@@ -80,14 +80,10 @@
         has-inhabitant (boolean (seq inhabitants))
         fgcolor (or (:color (first inhabitants)) [0 0 0])
         bgcolor (.rgb COLOR color)
-        ;night true
-        ;bgcolor (if night (.darken bgcolor .9) bgcolor)
         bgcolor (color-to-vec bgcolor)
-        char    (if-not visible
-                  " "
-                  (if has-inhabitant
-                   (:char (first inhabitants))
-                   (if solid "▒" " ")))]
+        char    (if has-inhabitant
+                  (:char (first inhabitants))
+                  (if solid "▒" " "))]
     (apply (.-colorRgb term) fgcolor)
     (apply (.-bgColorRgb term) bgcolor)
     (.moveTo        term x y char)))
@@ -109,35 +105,23 @@
         viewable-coords (map (partial shorten-line level) fov-blocks)]
     (apply concat viewable-coords)))

-(defn dimmed-blocks [level coords]
-  (let [flattened-level (flatten level)
-        block-not-in-coords (fn [block]
-                              (let [{x :x y :y} block]
-                                (not-any? #(= [x y] %) coords)
-                                ))
-        dim-block #(assoc % :visible false :color #js [0 0 0])
-        lit-block #(assoc % :visible true)
-        ]
-    (map #(if (block-not-in-coords %) (dim-block %) (lit-block %)) flattened-level)
-    ))
+(defn show-screen [term level character]
+  (let [buffer ((.. terminal -ScreenBufferHD -create)
+                #js {
+                     :dst term
+                     :x 0
+                     :y 0
+                     :width width
+                     :height height
+                     })
+        get-in-level (partial get-in level)]

+    (->> level
+         (viewable-coords character)
+         (map get-in-level)
+         (run! #(put-block buffer %)))

-(defn show-screen [term level character]
-  (defonce buffer ((.. terminal -ScreenBufferHD -create)
-                   #js {
-                        :dst term
-                        :x 0
-                        :y 0
-                        :width width
-                        :height height
-                        }))
-
-  (->> level
-       (viewable-coords character)
-       (dimmed-blocks level)
-       (run! #(put-block buffer %)))
-
-  (.draw buffer #js {:delta true})
+    (.draw buffer #js {:delta true}))

   (.color256    term 7)
   (.bgColor256  term 0)


Карта яндекса - цирк шапито

Карта яндекса - цирк шапито

--- src-cljs/ixinfestor/omut_ymap.cljs
+++ src-cljs/ixinfestor/omut_ymap.cljs
@@ -37,27 +37,25 @@

-
 (defn geo-object [{:keys [type coordinates preset
                           balloon-content-header
-                          balloon-content-body]
+                          balloon-content-body
+                          icon-content hint-content
+                          preset]
                    :or {type "Point"}}]
   (new js/ymaps.GeoObject
        ;;feature
-       (clj->js { "geometry" (clj->js {"coordinates" coordinates
-                                       "type" type
-                                       "preset" "islands#redIcon"
-                                       })
-                  "properties" (clj->js {"balloonContentHeader" balloon-content-header
-                                         "balloonContentBody" balloon-content-body
-
+       (clj->js { "geometry" (clj->js {:coordinates coordinates
+                                       :type type})
+                  "properties" (clj->js {:balloonContentHeader balloon-content-header
+                                         :balloonContentBody balloon-content-body
+                                         :iconContent icon-content
+                                         :hintContent hint-content
                                          })
                   })

        ;; options
-       (clj->js {"preset" "islands#redIcon"
-
-                 })))
+       (clj->js {:preset (or preset  "islands#redStretchyIcon")})))

 (defonce ids (atom 0))
 (defn get-id [] (str "ymap-" (swap! ids inc)))


MOAR PERFORMANCE!!! :rocket:

MOAR PERFORMANCE!!! :rocket:

--- src-cljs/kmc_booking/components.cljs
+++ src-cljs/kmc_booking/components.cljs
@@ -27,7 +27,6 @@
 			[:pre (pr-str booked)]
 		[:hr]
 		[:button
-
 			{:onClick (fn[e]
 				(swap! app-state assoc-in [:seats (.prompt js/window "use row-seat format like '1-39'" "1-39") :status]
 					"pending")
@@ -41,26 +40,13 @@
 ;;;

+(rum/defc seat < rum/cursored  [y x current] ;; < rum/cursored-watch
+	(when (= "pending" (get @current :status))
+			(swap! renders inc))

-(rum/defc seat < rum/cursored rum/cursored-watch [y x ref] ;; < rum/cursored-watch
-	(let [current ref]
-		[:div {:x x :y y
-				:onClick (fn[e]
-							(let [el (.-target e)
-								  id (seat-id (attr el "y") (attr el "x"))]
-
-										(swap! current assoc :status
-											(if (= "free" (@current :status)) "pending" "free"))))
-			 	:class (do
-
-			 				(when (= "pending" (get @current :status))
-								(swap! renders inc)
-								;(.warn js/console (.now js/Date))
-			 					)
-			 				(if-not @current "seat" ["seat" (get @current :status)])
-
-			 				)
-				} ""]))
+	[:div {:x x :y y
+		 	:class (str "seat " (get @current :status))
+			} ""])

 (rum/defc seat-col < rum/static [col]
@@ -123,7 +109,18 @@
 (rum/defc seat-plan < rum/cursored rum/cursored-watch [app-state]
 	(let [seats (rum/cursor app-state [:seats])]

-		[:div.seat-plan {:key "root"}
+		[:div.seat-plan {:key "root"
+						 :onClick (fn[e]
+						 	(let [el (.-target e)
+								  id (seat-id (attr el "y") (attr el "x"))]
+						 		(when-not (= "-" id)
+									(let [status (get-in @seats [id :status])]
+										(swap! seats assoc-in [id :status]
+											(condp = status
+												"free" "pending"
+												"pending" "free"))))))
+							}
+
 			[:div#parter {:key "parter"}
 				(rum/with-props seat-rows parter-rows "left" :rum/key (str "left_" (range-key parter-rows)))
 				(rum/with-props seat-rows parter-rows "right" :rum/key (str "right_" (range-key parter-rows)))


fix namespaces in hdf5

fix namespaces in hdf5

--- examples/src/helpers/hdf5.clj
+++ examples/src/helpers/hdf5.clj
@@ -1,6 +1,6 @@
 (ns helpers.hdf5
   (:require [clojure.core.matrix :as m]
-            [clj-hdf5.core :refer :all]
+            [clj-hdf5.core :as hdf5]
             [clojure.string :as str]))

 (defn- array-to-mat-vec [array]
@@ -15,9 +15,9 @@

   Returns hashmap of the same structure as the group structure with
   hashmap keys being group names."
-  (let [h5root (open (clojure.java.io/file filename))
-        datasets-and-paths (remove nil? (doall (walk h5root #(if (dataset? %)
-                                                               {:dataset (read %) :path (:path %)}
+  (let [h5root (hdf5/open (clojure.java.io/file filename))
+        datasets-and-paths (remove nil? (doall (hdf5/walk h5root #(if (hdf5/dataset? %)
+                                                               {:dataset (hdf5/read %) :path (:path %)}
                                                                nil))))
         result (reduce (fn [nn-params dataset-and-path]
                          (let [dataset (array-to-mat-vec (:dataset dataset-and-path))
@@ -26,7 +26,7 @@
                            (assoc-in nn-params path dataset)))
                        {}
                        datasets-and-paths)]
-    (close h5root)
+    (hdf5/close h5root)
     result))

 ;; Code for pre-generating random projection matrices


Fixup system bump

Fixup system bump

System should be bumped, not Component.

component system bump to 0.3.2

--- src/leiningen/new/chestnut/project.clj
+++ src/leiningen/new/chestnut/project.clj
@@ -13,8 +13,8 @@
                  [ring.middleware.logger "0.5.0"]
                  [compojure "1.5.1"]
                  [environ "1.1.0"]
-                 [com.stuartsierra/component "0.4.0"]
-                 [org.danielsz/system "0.3.1"]
+                 [com.stuartsierra/component "0.3.2"]
+                 [org.danielsz/system "0.4.0"]
                  [org.clojure/tools.namespace "0.2.11"]{{{project-clj-deps}}}]

   :plugins [[lein-cljsbuild "1.1.5"]


Fix figwheel :port -> :server-port

Fix figwheel :port -> :server-port

--- src/leiningen/new/chestnut/project.clj
+++ src/leiningen/new/chestnut/project.clj
@@ -44,7 +44,7 @@
                    :plugins [[lein-figwheel "0.1.4-SNAPSHOT"]{{{project-dev-plugins}}}]

                    :figwheel {:http-server-root "public"
-                              :port 3449
+                              :server-port 3449
                               :css-dirs ["resources/public/css"]}

                    :env {:is-dev true}


more cleanup of apparently unused code

more cleanup of apparently unused code

--- src/babel/index.cljc
+++ src/babel/index.cljc
@@ -25,21 +25,6 @@
 (def head-index {})
 (def comp-index {})
 (declare show-spec)
-
-(defn specs-to-subsets [lexicon-of-heads lexicon]
-  (if (not (empty? lexicon-of-heads))
-    (let [lexeme (first lexicon-of-heads)]
-      (if (keyword? (show-spec (get-in lexeme '(:synsem :subcat :1 :cat))))
-        (conj {(show-spec (get-in lexeme '(:synsem :subcat :1 :cat)))
-               (filter (fn [each-lex]
-                         (not (fail? (unifyc (get-in each-lex '(:synsem :cat))
-                                             (get-in lexeme '(:synsem :subcat :1 :cat))))))
-                       lexicon)}
-              (specs-to-subsets (rest lexicon-of-heads)
-                                lexicon))
-        (specs-to-subsets (rest lexicon-of-heads)
-                          lexicon)))
-    {}))

 (declare spec-to-phrases)

@@ -85,8 +70,7 @@
                  (not (fail? (unifyc (first phrases)
                                      {:head lex}))))
                lexicon)}}
-     (build-lex-sch-index (rest phrases) lexicon all-phrases))
-    {:lexical-subsets (specs-to-subsets lexicon lexicon)}))
+     (build-lex-sch-index (rest phrases) lexicon all-phrases))))

 (defn spec-to-phrases [specs all-phrases]
   (if (not (empty? specs))


s||log/info||log/debug||

s||log/info||log/debug||

--- src/babel/parse.cljc
+++ src/babel/parse.cljc
@@ -151,15 +151,15 @@
                                                                 model)))
                                                   parents))]
                                        (if (not (empty? parents))
-                                         (log/info (str "parse/parses: parents: "
-                                                        (string/join ","
-                                                                     (map #(morph-ps %) parents)))))
-                                       (log/info (str " left: "
-                                                      (string/join ","
-                                                                   (map #(morph-ps %) left-signs))))
-                                       (log/info (str " right: "
-                                                      (string/join ","
-                                                                   (map #(morph-ps %) right-signs))))
+                                         (log/debug (str "parse/parses: parents: "
+                                                         (string/join ","
+                                                                      (map #(morph-ps %) parents)))))
+                                       (log/debug (str " left: "
+                                                       (string/join ","
+                                                                    (map #(morph-ps %) left-signs))))
+                                       (log/debug (str " right: "
+                                                       (string/join ","
+                                                                    (map #(morph-ps %) right-signs))))
                                        (if parse-with-truncate truncated-parents parents)))

                                  ;; TODO: explain why we can use (first) here for the left- and right-strings.


+(expression-single)

+(expression-single)

--- src/babel/writer.clj
+++ src/babel/writer.clj
@@ -28,6 +28,36 @@
 ;;    (exec-raw ["TRUNCATE ?" [table]])))
    (exec-raw [(str "TRUNCATE " table)])))
 ;; catch exceptions when trying to populate
+
+(defn expression-single [model spec]
+  (let [no-language (if (nil? model)
+                             (throw (Exception. "No target language model was supplied.")))
+
+        ;; 1. generate sentence in target language.
+        ;; resolve future
+        model (if (future? model)
+                @model
+                model)
+
+        sentence (engine/generate spec model :enrich true)
+
+        sentence (if (:morph-walk-tree model)
+                   (merge ((:morph-walk-tree model) sentence)
+                          sentence)
+                   (do (log/warn (str "there is no morph-walk-tree function for the model:"
+                                      (:name model) " of language: "
+                                      (:language model)))
+                       sentence))
+        sentence (let [subj (get-in sentence
+                                    [:synsem :sem :subj] :notfound)]
+                   (cond (not (= :notfound subj))
+                         (do
+                           (log/debug (str "subject constraints: " subj))
+                           (unify sentence
+                                  {:synsem {:sem {:subj subj}}}))
+                         true
+                         sentence))]
+    {:target sentence}))

 (defn expression-pair [source-language-model target-language-model spec]
   "Generate a pair: {:source <source_expression :target <target_expression>}.
@@ -101,9 +131,7 @@
                       ;; need to try parsing same spec, but without the
                       ;;  {:synsem {:subcat '()}} that makes us try to generate
                       ;; an entire sentence.
-
                       (throw (Exception. message))))))
-
         ;; TODO: add warning if semantics of target-expression is merely :top - it's
         ;; probably not what the caller expected. Rather it should be something more
         ;; specific, like {:pred :eat :subj {:pred :antonio}} ..etc.
@@ -133,8 +161,7 @@
                                    ;; need to try parsing same spec, but without the
                                    ;;  {:synsem {:subcat '()}} that makes us try to generate
                                    ;; an entire sentence.
-                                   )
-                      ]
+                                   )]
                   (if (= true mask-populate-errors)
                     (log/warn message)
                     ;; else


Restore vcs_url to build

Restore vcs_url to build

--- src/circle/backend/build/config.clj
+++ src/circle/backend/build/config.clj
@@ -178,7 +178,8 @@
         actions (load-actions job)]
     (assert job-name)
     (build/build (merge
-                  {:notify_emails notify
+                  {:vcs_url (-> project :vcs_url)
+                   :notify_emails notify
                    :build_num build_num
                    :vcs_revision vcs_revision
                    :job-name job-name


Extract method

Extract method

--- src/clj_gatling/simulation_util.clj
+++ src/clj_gatling/simulation_util.clj
@@ -30,6 +30,8 @@
             (first (filter (fn [^List xs]
                              (.contains xs nil)) vector-of-vectors))))

+(defn- generate-empty-buckets [bucket-sizes]
+  (mapv #(repeat % nil) bucket-sizes))
 (defn split-to-number-of-buckets [xs bucket-count]
   (reduce (fn [m v]
             (update m (idx-of-smallest-vector m) conj v))
@@ -39,7 +41,7 @@
 (defn split-to-buckets-with-sizes [xs bucket-sizes]
   (reduce (fn [m v]
             (update m (idx-of-first-vector-with-nil m) #(conj (butlast %) v)))
-          (mapv #(repeat % nil) bucket-sizes)
+          (generate-empty-buckets bucket-sizes)
           xs))

 (defn- weighted [weights value]


Increase load-at distance

Increase load-at distance

--- src/cljs/comic_reader/handlers.cljs
+++ src/cljs/comic_reader/handlers.cljs
@@ -85,7 +85,7 @@
                                  .-body
                                  .-clientHeight)]
          (if (> screen-bottom
-                (- document-height 100))
+                (- document-height 200))
            (get-next-image db)
            db))
        db)))


Moderately clean up waypoints code

Moderately clean up waypoints code

--- src/cljs/comic_reader/ui/image.cljs
+++ src/cljs/comic_reader/ui/image.cljs
@@ -36,30 +36,37 @@
   (let [rect (.getBoundingClientRect node)]
     (+ (.-top rect) (.-pageYOffset js/window))))

+(defn- make-reset-trigger-point [id]
+  (fn [this]
+    (swap! waypoints assoc-in
+           [id :trigger-point]
+           (get-element-top (reagent/dom-node this)))))
+
 (defn waypoint [child-el options]
   (let [id (gensym "waypoint-id")
-        reset-trigger-point! (fn [n]
-                               (swap! waypoints assoc-in [id :trigger-point] n))]
+        reset-trigger-point! (make-reset-trigger-point id)]
     (reagent/create-class
      {:display-name "waypoint"
+
       :component-will-mount
       (fn []
         (swap! waypoints assoc id {:callback (:callback options)}))
-      :component-did-mount
-      (fn [this]
-        (reset-trigger-point! (get-element-top (reagent/dom-node this))))
       :component-will-unmount
       (fn []
         (swap! waypoints dissoc id))
-      :component-did-update
-      (fn [this]
-        (reset-trigger-point! (get-element-top (reagent/dom-node this))))
+
+      :component-did-mount reset-trigger-point!
+      :component-did-update reset-trigger-point!
+
       :reagent-render
       (fn [child-el]
         child-el)})))

+(defn- page-offset []
+  (.-pageYOffset js/window))
+
 (defn check-waypoints [last-scroll-y]
-  (let [new-scroll-y (.-pageYOffset js/window)]
+  (let [new-scroll-y (page-offset)]
     (doseq [[id {:keys [callback trigger-point]}] @waypoints]
       (when trigger-point
         (let [was-before-trigger (< last-scroll-y trigger-point)
@@ -69,8 +76,8 @@
                                     (not now-after-trigger))]
           (when (or crossed-forward crossed-backward)
             (let [direction (if crossed-forward :forward :backward)]
-              (when callback (callback direction))
-              (.log js/console "Passed" id "going" direction))))))))
+              (.log js/console "Passed" id "going" direction)
+              (when callback (callback direction)))))))))

 (defn waypoint-context [child-el]
   (let [state (atom {})
@@ -83,18 +90,16 @@
                       (when (not (:ticking @state))
                         (swap! state assoc
                                :ticking true
-                               :last-scroll-y (.-pageYOffset js/window)))
+                               :last-scroll-y (page-offset)))
                       (.fire throttler))]
     (reagent/create-class
      {:display-name "waypoint-context"
       :component-did-mount
       (fn []
-        (.addEventListener js/window "scroll" listener-fn)
-        (.log js/console "waypoint-context did-mount"))
+        (.addEventListener js/window "scroll" listener-fn))
       :component-will-unmount
       (fn []
-        (.removeEventListener js/window "scroll" listener-fn)
-        (.log js/console "waypoint-context did-unmount"))
+        (.removeEventListener js/window "scroll" listener-fn))
       :reagent-render
       (fn [child-el]
         child-el)})))


Update src/active/clojure/validation.cljc

Co-authored-by: kaaninho <f950d10c4916556a5d4bff6a6dc331bacbf26608@active-group.de>

--- src/active/clojure/validation.cljc
+++ src/active/clojure/validation.cljc
@@ -133,7 +133,7 @@

 (defn seq-validation
   "Apply two validations sequentially, from left to right.  Analogous
-  to `Either` where `ValidationFailure` ts `Left` and
+  to `Either` where `ValidationFailure` is `Left` and
   `ValidationSuccess` is `Right`."
   [v-1 v-2]
   (cond


Issue 1341: fix large quantities of influence dots overflowing the display area.

--- src/cljs/netrunner/deckbuilder.cljs
+++ src/cljs/netrunner/deckbuilder.cljs
@@ -363,12 +363,18 @@
 (defn influence-dots
   "Returns a string with UTF-8 full circles representing influence."
   [num]
-  (join (conj (repeat num "●") ""))) ;  is a zero-width space to allow wrapping
+  (let [dot "●"] ;  is a zero-width space to allow wrapping
+    (if (<= 20 num)
+      (str num dot)
+      (join (conj (repeat num dot) "")))))

 (defn restricted-dots
   "Returns a string with UTF-8 empty circles representing MWL restricted cards."
   [num]
-  (join (conj (repeat num "○") "")))
+  (let [dot "○"]
+    (if (<= 20 num)
+      (str num dot)
+      (join (conj (repeat num dot) "")))))

 (defn influence-html
   "Returns hiccup-ready vector with dots colored appropriately to deck's influence."


Add Scorpion Storm FX RGB.

Add Scorpion Storm FX RGB.

--- src/afterglow/fixtures/chauvet.clj
+++ src/afterglow/fixtures/chauvet.clj
@@ -214,6 +214,104 @@
               (chan/dimmer 6)]
    :name "LED Techno Strobe RGB"})

+(defn scorpion-storm-fx-rgb
+  "[Scorpion Storm FX RGB](http://www.chauvetlighting.com/scorpion-storm-fx-rgb.html)
+   grid effect laser.
+
+  This fixture can be patched to use either 7 or 2 DMX channels. If
+  you do not specify a mode when patching it, `:7-channel` is assumed;
+  you can pass a value of `:2-channel` for `mode` if you are using it
+  that way. Although there are two different modes in which you can
+  patch it, its behavior is controlled by the value you send in
+  channel 1: If that value is between `0` and `50`, the laser responds
+  to all 7 channels as described by `:7-channel` mode; if channel 1 is
+  set to `51` or higher, it looks only at the first two channels, as
+  described by `:2-channel` mode.
+
+  This was created by Afterglow from the QLC+ Fixture Definintion
+  (.qxf) file, and revised by James Elliott.
+
+  The original fixture defintition was created by Frédéric Combe
+  using Q Light Controller Plus version 5.0.0 GIT.
+
+  QLC+ Fixture Type: Laser."
+  ([]
+   (scorpion-storm-fx-rgb :7-channel))
+  ([mode]
+   (merge {:name "Scorpion Storm FX RGB"
+           :mode mode}
+          (case mode
+                :7-channel
+                {:channels [(chan/functions :control 1
+                                            0 "DMX Mode"
+                                            51 nil)
+                            (chan/functions :control 2
+                                            0 "Blackout"
+                                            5 "Beam Red"
+                                            16 "Beam Green"
+                                            26 "Beam Blue"
+                                            36 "Beam Red Green"
+                                            46 "Beam Blue Green"
+                                            56 "Beam Red Blue"
+                                            66 "Beam Red Green Blue"
+                                            76 "Beam Red, Strobe Green"
+                                            86 "Beam Green, Strobe Blue"
+                                            96 "Beam Blue, Strobe Red"
+                                            106 "Alternate Red/Green"
+                                            116 "Alternate Green/Blue"
+                                            126 "Alternate Red/Blue"
+                                            136 "Beam Red Green, Strobe Blue"
+                                            146 "Beam Green Blue, Strobe Red"
+                                            156 "Beam Red Blue, Strobe Green"
+                                            166 "Beam Blue, Strobe Red Green"
+                                            176 "Beam Red, Strobe Green Blue"
+                                            186 "Beam Green, Strobe Red Blue"
+                                            196 "Beam Blue, Alternate Red/Green"
+                                            206 "Beam Red, Alternate Green/Blue"
+                                            216 "Beam Green, Alternate Red/Blue"
+                                            226 "Alternate Red/Green/Blue")
+                            (chan/functions :strobe 3
+                                            0 nil
+                                            5 :strobe
+                                            255 "Sound Active strobe")
+                            (chan/functions :control 4
+                                            0 "Motor 1 Stop"
+                                            5 :motor-1-clockwise
+                                            128 "Motor 1 Stop 2"
+                                            134 :motor-1-counterclockwise)
+                            (chan/functions :control 5
+                                            0 nil
+                                            5 :stutter-motor-1-mode-1
+                                            57 :stutter-motor-1-mode-2
+                                            113 :stutter-motor-1-mode-3
+                                            169 :stutter-motor-1-mode-4)
+                            (chan/functions :control 6
+                                            0 "Motor 2 Stop"
+                                            5 :motor-2-clockwise
+                                            128 "Motor 2 Stop 2"
+                                            134 :motor-2-counterclockwise)
+                            (chan/functions :control 7
+                                            0 nil
+                                            5 :stutter-motor-2-mode-1
+                                            57 :stutter-motor-2-mode-2
+                                            113 :stutter-motor-2-mode-3
+                                            169 :stutter-motor-2-mode-4)]}
+                :2-channel
+                {:channels [(chan/functions :control 1
+                                            0 nil
+                                            51 "Auto fast"
+                                            101 "Auto slow"
+                                            151 :sound-active
+                                            201 "Random program")
+                            (chan/functions :control 2
+                                            0 "Beam Red"
+                                            37 "Beam Green"
+                                            73 "Beam Blue"
+                                            109 "Beam Red Green"
+                                            145 "Beam Green Blue"
+                                            181 "Beam Red Blue"
+                                            217 "Beam Red Green Blue")]}))))
+
 (defn slimpar-hex3-irc
   "[SlimPAR HEX 3 IRC](http://www.chauvetlighting.com/slimpar-hex3irc.html)
   six-color low-profile LED PAR.


Fix critical bug in deduplication.

Fix critical bug in deduplication.

--- src/algebolic/algorithms/spea2.clj
+++ src/algebolic/algorithms/spea2.clj
@@ -156,7 +156,7 @@
 (defn make-new-archive
   "Implements the core step of the SPEA2 algorithm which is constructing a new archive of elite
   individuals from the old archive and a population of new individuals."
-  [goals comparison-depth deduplicate archive-size population old-archive]
+  [goals deduplicate comparison-depth archive-size population old-archive]
   (let [pool (into population old-archive)
         scored-pool (calculate-fitnesses goals pool)
         ;; individuals that are non-dominated will have a fitness less than 1. Duplicates are removed if the


show the document model clearly when initialized

--- src/app/cljs/one/sample/model.cljs
+++ src/app/cljs/one/sample/model.cljs
@@ -29,19 +29,25 @@

 (defn now [] (.getTime (js/Date.)))

-(defn document-session [& {:keys [who id content title]}]
+(defn document-session [& {:keys [who id content title mode cursor born]}]
   (let [state   (atom {})
         watch   (add-watch state :document-state-key
                            (fn [k r o n]
                              (swap! state assoc :ts (now))
                              (swap! docs assoc (:id n) n)))
-        init    (swap! state assoc :who who :id (or id (uuid))
-                       :content (or content "") :ts (now)
-                       :title (or title nil))]
+        init    (swap! state assoc
+                       :who who
+                       :id (or id (uuid))
+                       :content (or content "")
+                       :born (or born (now))
+                       :ts (now)
+                       :title title
+                       :mode (or mode "html")
+                       :cursor (or cursor 0))]
     (fn document [command & args]
       (condp = command
         :set! (let [[k v] args]
-                (swap! state assoc k v :ts (now)))
+                (swap! state assoc k v))
         :get  (let [[key] args]
                 (@state key))))))


fix aggregation unit test (#1163)

fix aggregation unit test (#1163)

--- ssclj/jar/test/com/sixsq/slipstream/ssclj/middleware/cimi_params/impl_test.clj
+++ ssclj/jar/test/com/sixsq/slipstream/ssclj/middleware/cimi_params/impl_test.clj
@@ -83,4 +83,4 @@
   (is (= {:sum ["attr0" "attr1" "attr4"]
           :min ["attr2/child"]
           :max ["attr3"]}
-         (t/cimi-aggregation {"$aggregation" ["attr0:sum,attr1:sum" "invalid" "attr2/child:min" "attr3:max" "attr4:sum"]}))))
+         (t/cimi-aggregation {"$aggregation" ["sum:attr0,sum:attr1" "invalid" "min:attr2/child" "max:attr3" "sum:attr4"]}))))


fixing problem with non-standard whitespace

--- Clojure-Websockets/src/cljs/birdwatch/util.cljs
+++ Clojure-Websockets/src/cljs/birdwatch/util.cljs
@@ -56,8 +56,8 @@
         count (sym ((keyword rt-id) (:retweets @state/app)))]
     (if (not (nil? count)) (str (number-format count) s) "")))

-(defn rt-count [tweet] (entity-count tweet :retweet_count " RT | "))
-(defn fav-count [tweet] (entity-count tweet :favorite_count " fav"))
+(defn rt-count [tweet] (entity-count tweet :retweet_count " RT | "))
+(defn fav-count [tweet] (entity-count tweet :favorite_count " fav"))

 (defn rt-count-since-startup [tweet]
   "gets RT count since startup for tweet, if exists returns formatted string"


blnd: correctly return error for wrong number literals

--- src/blind/reader.clj
+++ src/blind/reader.clj
@@ -279,16 +279,18 @@
     (Double/parseDouble s)))

 (defn match-number [^String s]
-  (cond
-    (.contains s "/") (match-ratio s (doto (.matcher ratio-pattern s) .matches))
-
-    (or (.contains s ".")
-        (.contains s "M")
-        (.contains s "E")
-        (.contains s "e"))
-    (match-float s (doto (.matcher float-pattern s) .matches))
-
-    :else (match-int s (doto (.matcher int-pattern s) .matches))))
+  (try
+    (cond
+      (.contains s "/") (match-ratio s (doto (.matcher ratio-pattern s) .matches))
+
+      (or (.contains s ".")
+          (.contains s "M")
+          (.contains s "E")
+          (.contains s "e"))
+      (match-float s (doto (.matcher float-pattern s) .matches))
+
+      :else (match-int s (doto (.matcher int-pattern s) .matches)))
+    (catch IllegalStateException e)))

 (defn- parse-symbol [^String token]
   (when-not (= "" token)


Run 1k tests not 100

Run 1k tests not 100

--- test/simple_check/core_test.clj
+++ test/simple_check/core_test.clj
@@ -16,7 +16,7 @@
   (testing "+ and 0 form a monoid"
            (is (let [a gen/int]
                  (:result
-                   (sc/quick-check 100 passes-monoid-properties [a a a]))))))
+                   (sc/quick-check 1000 passes-monoid-properties [a a a]))))))

 ;; reverse
 ;; ---------------------------------------------------------------------------
@@ -30,7 +30,7 @@
 (deftest reverse-equal?
   (testing "For all lists L, reverse(reverse(L)) == L"
            (is (let [v (gen/vector gen/int)]
-                 (:result (sc/quick-check 100 reverse-equal?-helper [v]))))))
+                 (:result (sc/quick-check 1000 reverse-equal?-helper [v]))))))

 ;; failing reverse
 ;; ---------------------------------------------------------------------------
@@ -39,7 +39,7 @@
   (testing "For all lists L, L == reverse(L). Not true"
            (is (false?
                  (let [v (gen/vector gen/int)]
-                   (:result (sc/quick-check 100 #(= (reverse %) %) [v])))))))
+                   (:result (sc/quick-check 1000 #(= (reverse %) %) [v])))))))

 ;; failing element remove
 ;; ---------------------------------------------------------------------------
@@ -53,7 +53,7 @@
            longer be in the list. (This is a false assumption)"
            (is (false?
                  (let [v (gen/vector gen/int)]
-                   (:result (sc/quick-check 100 first-is-gone [v])))))))
+                   (:result (sc/quick-check 1000 first-is-gone [v])))))))

 ;; exceptions shrink and return as result
 ;; ---------------------------------------------------------------------------
@@ -68,7 +68,7 @@
   (testing "Exceptions during testing are caught. They're also shrunk as long
            as they continue to throw."
            (is (= [exception [0]]
-                  (let [result (sc/quick-check 100 exception-thrower [gen/int])]
+                  (let [result (sc/quick-check 1000 exception-thrower [gen/int])]
                     [(:result result) (get-in result [:shrunk :smallest])])))))

 ;; Count and concat work as expected
@@ -128,7 +128,7 @@

 (defn unique-test
   [seed]
-  (sc/quick-check 100 vector-elements-are-unique
+  (sc/quick-check 1000 vector-elements-are-unique
                   [(gen/vector gen/int)] :seed seed))

 (defn equiv-runs
@@ -139,4 +139,4 @@
   (testing "If two runs are started with the same seed, they should
            return the same results."
            (is (:result
-                 (sc/quick-check 100 equiv-runs [gen/int])))))
+                 (sc/quick-check 1000 equiv-runs [gen/int])))))


Fix authors check.

Fix authors check.

--- src/oc/storage/representations/org.clj
+++ src/oc/storage/representations/org.clj
@@ -78,7 +78,7 @@
     org))

 (defn- viewer-is-private-board-author? [org user]
-  (some #((:authors %) (-> user :user-id)) (:boards org)))
+  (some #((set (:authors %)) (:user-id user)) (:boards org)))

 (defn- reminders-link [org access-level user]
   (if (and (not (:id-token user))


make fm example a synth so an out-bus may be specified

--- src/overtone/examples/synthesis/fm.clj
+++ src/overtone/examples/synthesis/fm.clj
@@ -1,13 +1,14 @@
 (ns overtone.examples.synthesis.fm
-  (:use overtone.live))
+  (:use overtone.live
+        [meta-ex.mixer]))

-(definst fm [carrier 440 divisor 2.0 depth 1.0]
+(defsynth fm [carrier 440 divisor 2.0 depth 1.0 out-bus 0]
   (let [modulator (/ carrier divisor)
-        mod-env   (env-gen (lin-env 1 0 1))
-        amp-env   (env-gen (lin-env 0 1 1) :action FREE)]
-    (* 0.5 amp-env
-       (sin-osc (+ carrier
-                   (* mod-env  (* carrier depth) (sin-osc modulator)))))))
+        mod-env   (env-gen (lin-env 1 0 6))
+        amp-env   (env-gen (lin-env 1 1 5) :action FREE)]
+    (out out-bus (pan2 (* 0.5 amp-env
+                          (sin-osc (+ carrier
+                                      (* mod-env  (* carrier depth) (sin-osc modulator)))))))))

 ; Some of these are more or less interesting
 (fm)


use lightweight doseq & hoist default batched updates handler

--- src/citrus/core.cljs
+++ src/citrus/core.cljs
@@ -1,6 +1,11 @@
 (ns citrus.core
+  (:require-macros [citrus.macros :as m])
   (:require [citrus.reconciler :as r]
             [citrus.cursor :as c]))
+
+(def ^:private -default-batched-updates
+  {:schedule-fn js/requestAnimationFrame
+   :release-fn  js/cancelAnimationFrame})

 (defn reconciler
   "Creates an instance of Reconciler
@@ -23,25 +28,28 @@

   Returned value supports deref, watches and metadata.
   The only supported option is `:meta`"
-  [{:keys [state controllers effect-handlers co-effects batched-updates chunked-updates]} & {:as options}]
-  (let [watch-fns (volatile! {})
-        rec       (r/->Reconciler
-                    controllers
-                    effect-handlers
-                    co-effects
-                    state
-                    (volatile! [])
-                    (volatile! nil)
-                    (or batched-updates {:schedule-fn js/requestAnimationFrame :release-fn js/cancelAnimationFrame})
-                    chunked-updates
-                    (:meta options)
-                    watch-fns)]
-    (add-watch state (list rec :watch-fns)
-               (fn [_ _ oldv newv]
-                 (when (not= oldv newv)
-                   (doseq [[k watch-fn] @watch-fns]
-                     (watch-fn k rec oldv newv)))))
-    rec))
+  [{:keys [state controllers effect-handlers co-effects batched-updates chunked-updates]
+    :or   {batched-updates -default-batched-updates}}
+   & {:as options}]
+  (binding []
+    (let [watch-fns (volatile! {})
+          rec (r/->Reconciler
+                controllers
+                effect-handlers
+                co-effects
+                state
+                (volatile! [])
+                (volatile! nil)
+                batched-updates
+                chunked-updates
+                (:meta options)
+                watch-fns)]
+      (add-watch state (list rec :watch-fns)
+                 (fn [_ _ oldv newv]
+                   (when (not= oldv newv)
+                     (m/doseq [[k watch-fn] @watch-fns]
+                       (watch-fn k rec oldv newv)))))
+      rec)))

 (defn dispatch!
   "Invoke an event on particular controller asynchronously


move (def replace-patterns) to top

move (def replace-patterns) to top

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -22,6 +22,14 @@
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
    [dag_unify.core :refer (copy dissoc-paths fail? get-in merge ref? unifyc)]))
+
+;; replace-patterns are declarative data that determine how analysis (and soon conjugation) are performed.
+(def replace-patterns
+  (concat
+   adjectives/replace-patterns
+   determiners/replace-patterns
+   nouns/replace-patterns
+   verbs/replace-patterns))

 (defn phrase-is-finished? [phrase]
   (cond
@@ -1374,13 +1382,6 @@
                           :agr {:number :sing}}}}
    :determiners
    {:unify-with {:synsem {:cat :det}}}})
-
-(def replace-patterns
-  (concat
-   adjectives/replace-patterns
-   determiners/replace-patterns
-   nouns/replace-patterns
-   verbs/replace-patterns))

 (defn analyze-regular [surface-form lexicon]
   "do regular (i.e. non-exceptional) morphological analysis to determine lexical information for a conjugated surface-form"


Register with live.

Register with live.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -106,7 +106,7 @@
                    (let [rets
                          (try
                            (let [live (component/start v-peer)]
-                             (register-peer coord (:node (:peer (:peer v-peer))))
+                             (register-peer coord (:node (:peer (:peer live))))

                              (let [restart-ch (:dead-restart-tail-ch (:peer live))
                                    [v ch] (alts!! [stop-ch restart-ch] :priority true)]


[Add] _print-exp-data for test

[Add] _print-exp-data for test

--- src/clj_elm/core.clj
+++ src/clj_elm/core.clj
@@ -181,20 +181,27 @@
          (#(pmap (fn [feature] (predict % feature)) (:features test)))
          (#(evaluation (:classes test) % exp))))))

+(defn _print-exp-data [exp]
+  {:pre [(map? exp)]
+   :post [(string? %)]}
+  (str "L:" (:L exp) "\n"
+       " length(train_negative): " (:length-train-negative exp) "\n"
+       " length(test_negative): " (:length-test-negative exp) "\n"
+       " length(train_positive): " (:length-train-positive exp) "\n"
+       " length(test_positive): " (:length-test-positive exp) "\n"
+       " TP: " (:TP exp) ", FP: " (:FP exp) ", TN: " (:TN exp) ", FN: " (:FN exp) "\n"
+       " Accuracy: " (:Accuracy exp)
+       ",Recall: " (:Recall exp)
+       ",Precision: " (:Precision exp) "\n\n"))
+
 (defn print-exp-data [exp]
-  {:pre [(map? exp)]}
-  (print "L: " (:L exp) "\n"
-         "length(train_negative):" (:length-train-negative exp) "\n"
-         "length(test_negative):" (:length-test-negative exp) "\n"
-         "length(train_positive):" (:length-train-positive exp) "\n"
-         "length(test_positive):" (:length-test-positive exp) "\n"
-         "TP:" (:TP exp) ", FP:" (:FP exp) ", TN: " (:TN exp) ", FN:" (:FN exp) "\n"
-         "Accuracy:" (:Accuracy exp "\n")
-         "Recall:" (:Recall exp "\n")
-         "Precision:" (:Precision exp) "\n\n"))
+  {:pre [(map? exp)]
+   :post [(nil? %)]}
+  (print (_print-exp-data exp)))

 (defn +-exp [exp1 exp2]
-  {:pre [(map? exp1) (map? exp2)]}
+  {:pre [(map? exp1) (map? exp2)]
+   :post [(map? %)]}
   {:L (:L exp1)
    :length-train-negative (+ (:length-train-negative exp1) (:length-train-negative exp2))
    :length-test-negative (+ (:length-test-negative exp1) (:length-test-negative exp2))


Add file icon

Add file icon

--- src/airhead_frontend/components.cljs
+++ src/airhead_frontend/components.cljs
@@ -119,7 +119,7 @@
           [:i.fa.fa-upload]]]

         [:div
-         ;[:i.fa.fa-file-audio-o]
+         [:i.fa.fa-file-o]
          [:span (when @file-input-ref
                  (let [path (.-value @file-input-ref)]
                    (if-not (blank? path)


Redirect to user edition after user created from external system

--- auth/src/com/sixsq/slipstream/auth/external.clj
+++ auth/src/com/sixsq/slipstream/auth/external.clj
@@ -24,20 +24,21 @@
 (defn match-external-user!
   [authn-method external-login external-email]
   (if-let [user-name-mapped (db/find-username-by-authn authn-method external-login)]
-    (mapped-user authn-method user-name-mapped)
+    [(mapped-user authn-method user-name-mapped) "/dashboard"]
     (let [user-names-same-email (db/find-usernames-by-email external-email)]
       (if (empty? user-names-same-email)
-        (create-slipstream-user! authn-method external-login external-email)
-        (map-slipstream-user! authn-method (first user-names-same-email) external-login)))))
+        (let [name-new-user (create-slipstream-user! authn-method external-login external-email)]
+          [name-new-user (format "/user/%s?edit=true" name-new-user)])
+        [(map-slipstream-user! authn-method (first user-names-same-email) external-login) "/dashboard"]))))

 (defn redirect-with-matched-user
   [authn-method external-login external-email redirect-server]
   (if (and (not-empty external-login) (not-empty external-email))
-    (let [matched-user (match-external-user! authn-method external-login external-email)
-          token (sg/sign-claims {:com.sixsq.identifier matched-user
-                                 :exp                  (sg/expiry-timestamp)})]
+    (let [[matched-user redirect-url] (match-external-user! authn-method external-login external-email)
+          token                       (sg/sign-claims {:com.sixsq.identifier matched-user
+                                                       :exp                  (sg/expiry-timestamp)})]

-      (-> (uh/response-redirect (str redirect-server "/dashboard"))
+      (-> (uh/response-redirect (str redirect-server redirect-url))
           (assoc :cookies {"com.sixsq.slipstream.cookie" {:value {:token token}
                                                           :path  "/"}})))
     (uh/response-redirect (str redirect-server "/login?flash-now-warning=auth-failed"))))


CMR-964: Added more nil params.

CMR-964: Added more nil params.

--- system-int-test/test/cmr/system_int_test/search/granule_orbit_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/granule_orbit_search_test.clj
@@ -49,12 +49,12 @@
              :inclination-angle 94
              :number-of-orbits 0.25
              :start-circular-latitude -50}
-        ;; orbit parameters with missing start-circular latititude to test guards that prevent
+        ;; orbit parameters with missing values to test guards that prevent
         ;; previous null pointer exception caused by this
         op3-bad {:swath-width 1450
-                 :period 98.88
-                 :inclination-angle 98.15
-                 :number-of-orbits 0.5
+                 :period nil
+                 :inclination-angle nil
+                 :number-of-orbits nil
                  :start-circular-latitude nil}
         coll1 (d/ingest "PROV1"
                         (dc/collection


Include HamamatsuMac in list of non-window-device-adapters

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

--- buildscripts/buildcheck/src/buildcheck/core.clj
+++ buildscripts/buildcheck/src/buildcheck/core.clj
@@ -99,7 +99,7 @@
            (let [txt (slurp blacklist)]
              (map #(first (.split % ":")) (.split txt "\n")))))))

-(def non-windows-device-adapters #{"dc1394" "SimpleCam" "Video4Linux" "Spot"})
+(def non-windows-device-adapters #{"dc1394" "HamamatsuMac" "SimpleCam" "Video4Linux" "Spot"})

 (defn device-adapter-dirs []
   (filter #(and (.isDirectory %)


remove 'non functional' notice

remove 'non functional' notice

--- src/chat/client/views/sidebar.cljs
+++ src/chat/client/views/sidebar.cljs
@@ -68,7 +68,6 @@
       (dom/div #js {:className "sidebar"}
         (om/build search-box-view (data :page))

-        (dom/div nil "note: below sections are currently non-functional")
         (dom/h2 #js {:className "inbox"
                      :onClick (fn []
                                 (store/set-page! {:type :inbox}))}


Stop aleph properly

Stop aleph properly

--- src/cider_ci/utils/http_server.clj
+++ src/cider_ci/utils/http_server.clj
@@ -18,7 +18,7 @@
 (defn stop []
   (when-let [server @_server]
     (logging/info stop)
-    (.stop server)
+    (.close server)
     (reset! _server nil)))

 (defn start [conf main-handler ]


better print-tree

better print-tree

--- src/atom_finder/util/writer-util.clj
+++ src/atom_finder/util/writer-util.clj
@@ -6,25 +6,6 @@
         '(org.eclipse.cdt.core.dom.ast IASTPreprocessorStatement IASTPreprocessorMacroExpansion IASTPreprocessorMacroDefinition))

 (import '(atom_finder SanitaryASTWriterVisitor))
-
-(defn print-tree [node]
-  (pre-tree
-   (fn [node index tree-path]
-     (let [offset (format " (offset: %s, %s)"
-                          (some-> node .getFileLocation .getNodeOffset)
-                          (some-> node .getFileLocation .getNodeLength))]
-
-       (printf "%s -%s %s %s -> %s\n"
-               (apply str (repeat index "  "))
-               (-> node .getClass .getSimpleName)
-               (str tree-path)
-               offset
-               (-> node .getRawSignature
-                   (str "           ")
-                   (.subSequence 0 10)
-                   (.replaceAll "\n" " \\ ")))))
-   node 1 []))
-

 (defn print-node-context
   "Print the line that contains the node and the lines around it"
@@ -120,3 +101,14 @@
     write-node-type
     write-node)
    node))
+
+(defn print-tree [node]
+  (pre-tree
+   (fn [node index tree-path]
+       (printf "%-45s %s\n"
+               (str tree-path "            " (write-node node))
+               (->> (select-keys (loc node) [:line :offset :length])
+                    (map-keys (fn [k] (if (-> k name count (> 4)) (keyword (subs (name k) 0 3)) k))))
+               ))
+   node 1 []))
+


Don't add remote signal handler

Don't add remote signal handler

Looks like something else has changed since
4497310af7586f68bf0b8a011045ccf92f47cc13 to make this unnecessary. Yay!

refs #127, 133

--- src/clj/reply/eval_modes/nrepl.clj
+++ src/clj/reply/eval_modes/nrepl.clj
@@ -245,9 +245,6 @@
                (binding [*print-length* nil
                          *print-level* nil]
                  (pr-str (list 'do
-                           (reply.initialization/export-definition
-                             'reply.signals/set-signal-handler!)
-                           '(set-signal-handler! "INT" (fn [s]))
                            (reply.initialization/construct-init-code
                              options)))))
       (handle-client-interruption! client)


bugfix: lost focus related

bugfix: lost focus related

--- src/cljs/om_next_leaflet/core.cljs
+++ src/cljs/om_next_leaflet/core.cljs
@@ -93,7 +93,10 @@
       :app/kilotei])
   Object
   (componentWillMount [this]
-    (.log js/console "will-mount"))
+    (.log js/console "will-mount")
+    (om/transact! this `[(app/update-kilotei {:id -1
+                                              :line-id -1
+                                              :kilotei ""})]))
   (componentDidMount [this]
     (.log js/console "did-mount")
     (let [{:keys [app/lines app/stations]} (om/props this)]
@@ -112,19 +115,19 @@
        [:div
         [:div {:id "custom-control"
                :class "leaflet-control-layers leaflet-control-layers-expanded leaflet-control"}
-         [:input {:ref "title"
+         #_[:input {:ref "title"
                   :value title
                   :on-change (fn [e] (let [v (-> e .-target .-value)]
                                        (om/transact! this `[(app/update-title {:new-title ~v})])))}]
-         [:button {:on-click (fn [e] (let [new-title (.-value (dom/node this "title"))]
+         #_[:button {:on-click (fn [e] (let [new-title (.-value (dom/node this "title"))]
                                        (om/transact! this `[(app/update-title {:new-title ~new-title})
                                                             :app/title])))
-                   } "update"]
+                     } "update"]
+         (into [] (concat [:select {:value 24}] (mapv (fn [[id line-name]] [:option {:value id} line-name]) lines)))
          (let [{:keys [id station-name line-id line-name]} station-info]
            [:div
             [:p (str "zoom: " (:zoom mapstate init-zoom))]
-            [:p (str "[" id "] " station-name)]
-            [:p (str "[" line-id "] " line-name)]
+            [:p (str "[" line-id "] " line-name "/ [" id "] " station-name)]
             [:input {:value kilotei
                      :on-change (fn [e] (let [new-kilotei (-> e .-target .-value)]
                                           (om/transact! this `[(app/update-kilotei {:id ~id


minor board update

minor board update

--- src/cljs/triboard/logic/board.cljs
+++ src/cljs/triboard/logic/board.cljs
@@ -15,7 +15,7 @@
 (def height 11)

 (def coordinates
-  (for [x (range width) y (range height)] [x y]))
+  (vec (for [x (range width) y (range height)] [x y])))

 (def empty-board
   (let [empty-column (vec (repeat height :none))]


Remove button toggling

Remove button toggling

--- src/clojure/nightcode/builders.clj
+++ src/clojure/nightcode/builders.clj
@@ -31,13 +31,6 @@
     (.enterLine console (str "(do " code ")")))
   (s/request-focus! (.getView (.getViewport console))))

-(defn toggle-buttons
-  [target is-running?]
-  (-> (s/select target [:#run-repl-button])
-      (s/config! :enabled? (not is-running?)))
-  (-> (s/select target [:#reload-button])
-      (s/config! :enabled? is-running?)))
-
 (defn create-builder
   [path]
   (let [console (ui/create-console)
@@ -47,11 +40,8 @@
         build-group (s/border-panel
                       :center (s/config! console :id :build-console))
         run-action (fn [e]
-                     (toggle-buttons build-group (lein/is-java-project? path))
                      (lein/run-project process in out path))
         run-repl-action (fn [e]
-                          (toggle-buttons build-group
-                                          (not (lein/is-java-project? path)))
                           (lein/run-repl-project process in out path)
                           (s/request-focus! (.getView (.getViewport console))))
         reload-action (fn [e]
@@ -59,16 +49,12 @@
                           (lein/run-hot-swap in out path)
                           (eval-in-repl console)))
         build-action (fn [e]
-                       (toggle-buttons build-group false)
                        (lein/build-project process in out path))
         test-action (fn [e]
-                      (toggle-buttons build-group false)
                       (lein/test-project process in out path))
         clean-action (fn [e]
-                       (toggle-buttons build-group false)
                        (lein/clean-project process in out path))
         stop-action (fn [e]
-                      (toggle-buttons build-group false)
                       (lein/stop-process process))
         btn-group (ui/wrap-panel
                     :items [(s/button :id :run-button
@@ -104,7 +90,6 @@
                                       :listen [:action set-android-sdk]
                                       :focusable? false)])]
     (s/config! build-group :north btn-group)
-    (toggle-buttons build-group false)
     (shortcuts/create-mappings build-group
                                {:run-button run-action
                                 :run-repl-button run-repl-action


Revert broken optimization

Revert broken optimization

--- src/com/wsscode/pathom/parser.cljc
+++ src/com/wsscode/pathom/parser.cljc
@@ -218,14 +218,13 @@
 (defn parser [{:keys [read mutate]}]
   (fn self [env tx]
     (tracing env {::pt/event ::parse-loop}
-      (let [{:keys [children] :as tx-ast} (or (::ast (meta tx)) (query->ast tx))
+      (let [{:keys [children] :as tx-ast} (query->ast tx)
             tx  (vary-meta tx assoc ::ast tx-ast)
             env (assoc env :parser self)]
         (loop [res {}
                [{:keys [query key type params] :as ast} & tail] children]
           (if ast
             (let [_     (trace env {::pt/event ::process-key :key key})
-                  query (cond-> query (vector? query) (vary-meta assoc ::ast ast))
                   env   (cond-> (merge env {:ast ast :query query})
                           (nil? query) (dissoc :query)
                           (= '... query) (assoc :query tx))
@@ -250,14 +249,13 @@
   (fn self [env tx]
     (go-catch
       (tracing env {::pt/event ::parse-loop}
-        (let [{:keys [children] :as tx-ast} (or (::ast (meta tx)) (query->ast tx))
+        (let [{:keys [children] :as tx-ast} (query->ast tx)
               tx  (vary-meta tx assoc ::ast tx-ast)
               env (assoc env :parser self)]
           (loop [res {}
                  [{:keys [query key type params] :as ast} & tail] children]
             (if ast
               (let [_     (trace env {::pt/event ::process-key :key key})
-                    query (cond-> query (vector? query) (vary-meta assoc ::ast ast))
                     env   (cond-> (merge env {:ast ast :query query})
                             (nil? query) (dissoc :query)
                             (= '... query) (assoc :query tx))


fix style to only push down last aside item in nav

--- frontend/components/aside.cljs
+++ frontend/components/aside.cljs
@@ -138,7 +138,7 @@
            [:header
             [:h5 "Project Settings"]
             [:a.close-menu
-             {:on-click #(put! controls-ch [:user-options-toggled])}
+             {:href "/"}
              (common/ico :fail-light)]]
            [:div.aside-user-options
             ; [:li "Project Settings"]
@@ -161,8 +161,7 @@
             [:a.aside-item {:href "#aws"} "AWS keys"]
             ; [:li "Continuous Deployment"]
             [:a.aside-item {:href "#heroku"} "Heroku"]
-            [:a.aside-item {:href "#deployment"} "Other Deployments"]
-            [:a.aside-item {:href "/"} "Back to Project"]]])))))
+            [:a.aside-item {:href "#deployment"} "Other Deployments"]]])))))

 (defn activity [app owner opts]
   (reify
@@ -176,8 +175,8 @@
             controls-ch (om/get-shared owner [:comms :controls])]
         (html
          [:nav.aside-left-menu
+          (om/build project-settings-menu app)
           (om/build context-menu app)
-          (om/build project-settings-menu app)
           [:div.aside-activity.open
            [:div.wrapper
             [:header
@@ -265,10 +264,10 @@
            [:i.fa.fa-bell]
            [:span "Changelog"]]

-          [:a.aside-item {:data-placement "right"
-                          :data-trigger "hover"
-                          :title "Expand"
-                          :on-click #(put! controls-ch [:slim-aside-toggled])}
+          [:a.aside-item.push-to-bottom {:data-placement "right"
+                                         :data-trigger "hover"
+                                         :title "Expand"
+                                         :on-click #(put! controls-ch [:slim-aside-toggled])}
            (if slim-aside?
              [:i.fa.fa-long-arrow-right]
              (list


fix link spacing

fix link spacing

--- frontend/components/build.cljs
+++ frontend/components/build.cljs
@@ -30,8 +30,8 @@
           "or "
           [:a {:title "Report an error in how Circle ran this build"
                :on-click #(put! controls-ch [:report-build-clicked {:build-url build-url}])}
-           "report this issue "]
-          "and we'll investigate."]
+           "report this issue"]
+          " and we'll investigate."]

          [:div
           "Looks like we had a bug in our infrastructure, or that of our providers (generally "


Refactor backend bis

Refactor backend bis

--- backend/src/akvo/lumen/transformation/split_column.clj
+++ backend/src/akvo/lumen/transformation/split_column.clj
@@ -42,7 +42,8 @@
   [op-spec]
   (let [{:keys [onError op args] :as op-spec} (keywordize-keys op-spec)]
     (and (engine/valid-column-name? (col-name args))
-         (pattern* args))))
+         (pattern* args)
+         (new-column-name args))))

 (defn- add-name-to-new-columns
   [columns new-columns]
@@ -70,11 +71,11 @@
           column-name               (col-name args)
           pattern                   (pattern* args)
           re-pattern*               (re-pattern (Pattern/quote pattern))]
-      (if-let [pattern-analysis (get-in
+      (if-let [pattern-analysis (get
                                  (->> (select-column-data tenant-conn {:table-name table-name :column-name column-name})
                                       (map (comp str (keyword column-name)))
                                       (pattern-analysis re-pattern*)
-                                      :analysys)
+                                      :analysis)
                                  pattern)]
         (let [new-rows-count    (inc (:max-coincidences-in-one-row pattern-analysis))
               new-columns       (columns-to-extract (new-column-name args) new-rows-count (selected-column args) columns)


remove println

remove println

--- src/clj/elephantdb/cascalog/core.clj
+++ src/clj/elephantdb/cascalog/core.clj
@@ -73,8 +73,6 @@
   (let [fs (Utils/getFS source-dir (Configuration.))
         spec (c/read-domain-spec fs source-dir)
         new-spec (assoc spec :num-shards numshards)]
-    (println spec)
-    (println new-spec)
     (write-to-elephant!
      (elephant-tap target-dir new-spec {})
      (elephant-tap source-dir))


[REFACTOR] Use destructuring to remove `let`

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -654,18 +654,17 @@
    If such a `TimetableLessonInfo` object does not exist, returns nil."
   [day rowNum timeIdx]
   (let [ttRow (timetable-get-day-row day rowNum)]
-    (reduce (fn [selectedTTLessonInfo [ttLessonInfo _]]
-              (let [endTime   (:endTime ttLessonInfo)]
-                (cond (and (nil? selectedTTLessonInfo)
-                           (<= endTime timeIdx))
-                      ttLessonInfo
-
-                      (and (not (nil? selectedTTLessonInfo))
-                           (<= endTime timeIdx)
-                           (> endTime (:endTime selectedTTLessonInfo)))
-                      ttLessonInfo
-
-                      :else selectedTTLessonInfo)))
+    (reduce (fn [selectedTTLessonInfo [{:keys [endTime] :as ttLessonInfo} _]]
+              (cond (and (nil? selectedTTLessonInfo)
+                         (<= endTime timeIdx))
+                    ttLessonInfo
+
+                    (and (not (nil? selectedTTLessonInfo))
+                         (<= endTime timeIdx)
+                         (> endTime (:endTime selectedTTLessonInfo)))
+                    ttLessonInfo
+
+                    :else selectedTTLessonInfo))
             nil
             ttRow)))