CMR-6755 Updates url validation tests for upgraded validator library.

--- umm-spec-lib/test/cmr/umm_spec/test/validation/related_url.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/validation/related_url.clj
@@ -21,7 +21,7 @@
                                      :Description "Description"
                                      :Type "GET DATA"
                                      :Subtype "Earthdata Search"}
-                                    {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=\t&accession=FNG-GCEM-0401"
+                                    {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=%09&accession=FNG-GCEM-0401"
                                      :URLContentType "PublicationURL"
                                      :Description "Description"
                                      :Type "VIEW RELATED INFORMATION"
@@ -103,7 +103,7 @@
                                         :URLContentType "DataCenterURL"
                                         :Description "Description"
                                         :Type "HOME PAGE"}
-                                       {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=\t&accession=FNG-GCEM-0401"
+                                       {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=%09&accession=FNG-GCEM-0401"
                                         :URLContentType "DataCenterURL"
                                         :Description "Description"
                                         :Type "HOME PAGE"}]}}]})))
@@ -155,7 +155,7 @@
                                           :URLContentType "DataContactURL"
                                           :Description "Description"
                                           :Type "HOME PAGE"}
-                                         {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=\t&accession=FNG-GCEM-0401"
+                                         {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=%09&accession=FNG-GCEM-0401"
                                           :URLContentType "DataContactURL"
                                           :Description "Description"
                                           :Type "HOME PAGE"}]}}]}]})))
@@ -207,7 +207,7 @@
                                           :URLContentType "DataContactURL"
                                           :Description "Description"
                                           :Type "HOME PAGE"}
-                                         {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=\t&accession=FNG-GCEM-0401"
+                                         {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=%09&accession=FNG-GCEM-0401"
                                           :URLContentType "DataContactURL"
                                           :Description "Description"
                                           :Type "HOME PAGE"}]}}]}]})))
@@ -261,7 +261,7 @@
                                         :URLContentType "DataContactURL"
                                         :Description "Description"
                                         :Type "HOME PAGE"}
-                                       {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=\t&accession=FNG-GCEM-0401"
+                                       {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=%09&accession=FNG-GCEM-0401"
                                         :URLContentType "DataContactURL"
                                         :Description "Description"
                                         :Type "HOME PAGE"}]}}]})))
@@ -315,7 +315,7 @@
                                         :URLContentType "DataContactURL"
                                         :Description "Description"
                                         :Type "HOME PAGE"}
-                                       {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=\t&accession=FNG-GCEM-0401"
+                                       {:URL "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=%09&accession=FNG-GCEM-0401"
                                         :URLContentType "DataContactURL"
                                         :Description "Description"
                                         :Type "HOME PAGE"}]}}]})))
@@ -379,7 +379,7 @@
      (coll/map->UMM-C
                      {:CollectionCitations
                       [{:OnlineResource {:Linkage "http://fresc.usgs.gov/products/dataset/moorhen_telemetry.zip"}}
-                       {:OnlineResource {:Linkage "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=\t&accession=FNG-GCEM-0401"}}]})))
+                       {:OnlineResource {:Linkage "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=%09&accession=FNG-GCEM-0401"}}]})))
   (testing "Multiple invalid related urls"
     (h/assert-warnings-multiple-invalid
      (coll/map->UMM-C
@@ -397,7 +397,7 @@
      (coll/map->UMM-C
                      {:PublicationReferences
                       [{:OnlineResource {:Linkage "http://fresc.usgs.gov/products/dataset/moorhen_telemetry.zip"}}
-                       {:OnlineResource {:Linkage "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=\t&accession=FNG-GCEM-0401"}}]})))
+                       {:OnlineResource {:Linkage "http://gce-lter.marsci.uga.edu/lter/asp/db/send_eml.asp?detail=full&missing=NaN&delimiter=%09&accession=FNG-GCEM-0401"}}]})))
   (testing "Multiple invalid related urls"
     (h/assert-warnings-multiple-invalid
      (coll/map->UMM-C


End effects when we get an aftertouch of 0.

This can help avoid stuck keys on the Push, although it is still
somewhat susceptible when pressing lots of pads at once.

--- src/afterglow/controllers/ableton_push.clj
+++ src/afterglow/controllers/ableton_push.clj
@@ -1382,11 +1382,16 @@
                                        (show/end-effect! (:key cue) :when-id id)))
                                    :done)
                                  (handle-aftertouch [this controller message]
-                                   (doseq [v (:variables cue)]
-                                     (when (:velocity v)
-                                       (cues/set-cue-variable! cue v
-                                                               (controllers/value-for-velocity v (:velocity message))
-                                                               :controller controller :when-id id))))))))))))
+                                   (if (zero? (:velocity message))
+                                     (do (when holding
+                                           (with-show (:show controller)
+                                             (show/end-effect! (:key cue) :when-id id)))
+                                         :done)
+                                     (doseq [v (:variables cue)]
+                                       (when (:velocity v)
+                                         (cues/set-cue-variable! cue v
+                                                                 (controllers/value-for-velocity v (:velocity message))
+                                                                 :controller controller :when-id id)))))))))))))

 (defn- control-for-top-encoder-note
   "Return the control number on which rotation of the encoder whose


Join linez

Join linez

--- src-cljs/frontend/components/account.cljs
+++ src-cljs/frontend/components/account.cljs
@@ -350,8 +350,7 @@
     [:div.row
      [:div.col-md-6
       (for [project projects]
-        (om/build project/email-pref {:project project :user user}))]
-     ]]])
+        (om/build project/email-pref {:project project :user user}))]]]])

 (defn notifications [app owner]
   (reify


remove unused copy refinements

remove unused copy refinements

--- src-cljs/frontend/components/landing.cljs
+++ src-cljs/frontend/components/landing.cljs
@@ -262,16 +262,8 @@
              [:span "Make your ideas accessible anywhere, using any device."]]
             [:p.feature-copy
              [:span.content-copy
-              ; "With Precursor all of your ideas are easily accessible right from the browser, whether you're on your desktop, tablet, or phone."
-
-              ; "All of your best ideas are easily accessible right in your browser.
-              ; No downloads or installations necessary, just pull out your tablet or phone and you're good to go."
-
               "Quickly find sketches on any tablet or phone and be ready when inspiration hits you.
-              Don't bother wasting time with a big app download—just pull up your favorite browser."
-              ; No downloads or installations necessary, just pull out your tablet or phone and you're good to go."
-
-              ]]]
+              Don't bother wasting time with a big app download—just pull up your favorite browser."]]]
            [:div.feature-media artwork-mobile]]
           [:div.feature-divider]
           [:div.feature.content
@@ -281,16 +273,8 @@
              [:span "Make prototypes interactive & refine your user experience."]]
             [:p.feature-copy
              [:span.content-copy
-              ; "Make working demos in just minutes using our simple target linking."
-              ; "Make working demos in just minutes using our simple target linking system. Save time by pinpointing areas of improvement before you go into development."
-              ; "Make working demos in just minutes using simple links.
-              ; Save time by pinpointing areas that need improvement before you go into development."
-
               "Easily link your wireframes together in minutes to create working demos of your idea.
-              You'll save time by pinpointing areas for improvement before you go into development."
-
-
-              ]]
+              You'll save time by pinpointing areas for improvement before you go into development."]]
             [:a.feature-link {:href "/blog/interactive-layers" :role "button" :title "Read the tutorial."}
              [:span.content-copy
               "Read the tutorial."]]]
@@ -303,12 +287,8 @@
              [:span "Make team collaboration more productive & engaging."]]
             [:p.feature-copy
              [:span.content-copy
-              ; "Our new team features are optimized for efficient collaboration.
-              ; You'll have all of your team's best ideas store in one secure place."
-              ; "Our team features are optimized to make collaborating in real-time easier and more efficient.
               "Our team features are optimized to make collaborating in real-time effortless.
-              Communicate and create new ideas with your teammates in one secure place."
-              ]]
+              Communicate and create new ideas with your teammates in one secure place."]]
             [:a.feature-link {:role "button" :title "Request free trial."}
              [:span.content-copy
               "Request free trial."]]]


team-start moved to team

team-start moved to team

--- src-cljs/frontend/components/overlay.cljs
+++ src-cljs/frontend/components/overlay.cljs
@@ -714,7 +714,7 @@
    :connection-info {:title "Connection Info"
                      :component connection/connection-info}
    :roster {:title "Team"
-            :component team-start}
+            :component team/team-start}
    :team-settings {:title "Team Permissions"
                    :component team/team-settings}
    :team-doc-viewer {:title "Team Documents"


Add language backgrounds to testimonials.

--- src-cljs/frontend/components/stories.cljs
+++ src-cljs/frontend/components/stories.cljs
@@ -94,6 +94,7 @@
          [:p "Shopify needed the ability to easily configure, customize, and debug build their machines."]]]]]

      [:div.outer-section.outer-section-condensed
+      common/language-background
       [:section.container
        [:div.row
         [:div.col-xs-6.col-xs-offset-3
@@ -117,6 +118,7 @@
        [:p "Today, 1 year after initially switching to CircleCI, Shopify has scaled their engineering team to 130 team members who on average merge 300 pull requests and deploy 100 times per week. Thanks to CircleCI, they've managed to maintain their agile and efficient development process, with new projects being added effortlessly and everyone working off of a master branch (rather than having to maintain production and development branches). Their test suite runs faster than it ever did with their previous solution, and now that developers don't have to run tests on their local machine they can work on other projects while CircleCI runs their tests in the background. Shopify also uses CircleCI along with Capistrano to continuously deploy their application for anything from a small bug fix, to a package upgrade, to a new feature."]]]

      [:div.outer-section.outer-section-condensed
+      common/language-background
       [:section.container
        [:div.row
         [:div.col-xs-6.col-xs-offset-3
@@ -150,6 +152,7 @@
        [:p "Wit.ai's platform is built with services written in Clojure, including user-facing web apps and service endpoints, as well as a Riak-backed Datomic database. As Wti.ai was scaling their platform, they ran in to a few different issues. First, different services were built, tested, and deployed in different ways. The development team was moving fast and wanted to deploy multiple times per day, but were slowed down by this operational complexity. Second, it was difficult to ensure that their production environment was always consistent with their development and test environments. Making sure that the proper binary artifacts, server OS, and configuration files were in place required additional tooling which further added to their issues around complexity."]]]

      [:div.outer-section.outer-section-condensed
+      common/language-background
       [:section.container
        [:div.row
         [:div.col-xs-6.col-xs-offset-3


slugify programmes

slugify programmes

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -150,11 +150,15 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; programmes
-(defn programmes-table [programmes owner]
-  (reify
-    om/IRender
-    (render [_]
-      (let [table-id   "programme-table"
+(defn slugify-programme [programme]
+  (assoc programme :slug (:name programme)))
+
+(defn programmes-table [data owner]
+  (reify
+    om/IRender
+    (render [_]
+      (let [programmes (-> data :programmes)
+            table-id   "programme-table"
             history    (om/get-shared owner :history)]
         (html
          [:table {:className "table table-hover"}
@@ -177,7 +181,6 @@
     (did-update [_ prev-props prev-state]
       (let [{:keys [programmes active-components]} data
             programme-id (:programmes active-components)]
-
         (when-not programme-id
           (om/update! programmes :selected nil))

@@ -185,7 +188,7 @@
           (GET (str "/4/programmes/")
                {:handler  (fn [x]
                             (println "Fetching programmes.")
-                            (om/update! programmes :data x)
+                            (om/update! programmes :data (mapv slugify-programme x))
                             (om/update! programmes :selected nil))
                 ;; TODO: Add Error Handler
                 :headers {"Accept" "application/edn"}


advance pending games with either game id strings or keywords

--- src-cljc/tourney_nerd/advance_event.cljc
+++ src-cljc/tourney_nerd/advance_event.cljc
@@ -151,20 +151,24 @@

         pending-teamA (:pending-teamA pending-game)
         teamA-target-game-id (:game-id pending-teamA)
-        teamA-target-game (get-in event [:games teamA-target-game-id])
+        teamA-target-game (when teamA-target-game-id
+                            (or (get-in event [:games (keyword teamA-target-game-id)])
+                                (get-in event [:games (name teamA-target-game-id)])))
+
         teamA-target-game-finished? (games/game-finished? teamA-target-game)
         teamA-target-game-winner (results/winner teamA-target-game)
         teamA-target-game-loser (results/loser teamA-target-game)

         pending-teamB (:pending-teamB pending-game)
         teamB-target-game-id (:game-id pending-teamB)
-        teamB-target-game (get-in event [:games teamB-target-game-id])
+        teamB-target-game (when teamB-target-game-id
+                            (or (get-in event [:games (keyword teamB-target-game-id)])
+                                (get-in event [:games (name teamB-target-game-id)])))
         teamB-target-game-finished? (games/game-finished? teamB-target-game)
         teamB-target-game-winner (results/winner teamB-target-game)
         teamB-target-game-loser (results/loser teamB-target-game)

         new-event (atom event)]
-
     (when (and (= (:type pending-teamA) "PENDING_GAME_RESULT")
                teamA-target-game-finished?)
       (swap! new-event assoc-in [:games pending-game-id :teamA-id]


Fix signup link on 404 page

Fix signup link on 404 page

We missed an `open-ext` when we added this link, so clicking the link
resulted in attempting to find the signup page in the "inner" app and
that just didn't work at all.

--- src-cljs/frontend/components/errors.cljs
+++ src-cljs/frontend/components/errors.cljs
@@ -7,6 +7,7 @@
             [frontend.state :as state]
             [frontend.utils :as utils :include-macros true]
             [frontend.utils.github :as gh-utils :refer [auth-url]]
+            [frontend.utils.html :refer [open-ext]]
             [om.core :as om :include-macros true])
   (:require-macros [frontend.utils :refer [html]]))

@@ -91,7 +92,7 @@
                (if (not logged-in?)
                  (if (config/enterprise?)
                    [:span " or " logging-in]
-                   [:span ", " logging-in ", or " [:a {:href "/signup"} "signing up"]])
+                   [:span ", " logging-in ", or " [:a (open-ext {:href "/signup"}) "signing up"]])
                  [:span " or checking out our " [:a {:href "http://blog.circleci.com/"} "blog"]]))]
             :else "Something completely unexpected happened")]]]))))


Fix indentation

Fix indentation

--- src-cljs/frontend/components/header.cljs
+++ src-cljs/frontend/components/header.cljs
@@ -391,22 +391,22 @@
                     (not dismissed-banner-one)) (om/build top-banner/banner
                                                           {:banner-type "warning"
                                                            :content [:div
-                                                                        [:span.banner-alert-icon
-                                                                         [:img {:src (common/icon-path "Info-Info")}]]
-                                                                        [:b "  New: "] "You can now get web notifications when your build is done! "
-                                                                        [:a
-                                                                         {:href "#"
-                                                                          :on-click #(n/request-permission
-                                                                                (fn [response]
-                                                                                (raise! owner [:dismiss-web-notif-banner {:banner-number "one"
-                                                                                :response response}])
-                                                                                (when (= response "granted") (raise! owner [:set-web-notifications {:enabled? true
-                                                                                :response response}]))))}
-                                                                         "Click here to activate web notifications."]]
+                                                                     [:span.banner-alert-icon
+                                                                      [:img {:src (common/icon-path "Info-Info")}]]
+                                                                     [:b "  New: "] "You can now get web notifications when your build is done! "
+                                                                     [:a
+                                                                      {:href "#"
+                                                                       :on-click #(n/request-permission
+                                                                                (fn [response]
+                                                                                (raise! owner [:dismiss-web-notif-banner {:banner-number "one"
+                                                                                :response response}])
+                                                                                (when (= response "granted") (raise! owner [:set-web-notifications {:enabled? true
+                                                                                :response response}]))))}
+                                                                      "Click here to activate web notifications."]]
                                                            :impression-event-type  :web-notification-banner-impression
                                                            :dismiss-fn #(do
                                                                           (raise! owner [:dismiss-web-notif-banner {:banner-number "one"
-                                                                                :response "default"}])
+                                                                                :response "default"}])
                                                                           (raise! owner [:dismiss-web-notif-banner {:banner-number "two"}]))})
                (and dismissed-banner-one
                     (not dismissed-banner-two)) (om/build top-banner/banner


no need to notify you about your own updates

--- src-cljs/frontend/components/issues.cljs
+++ src-cljs/frontend/components/issues.cljs
@@ -401,7 +401,8 @@
                      :render-time (datetime/server-date)})
     om/IDidMount
     (did-mount [_]
-      (let [issue-db (om/get-shared owner :issue-db)]
+      (let [issue-db (om/get-shared owner :issue-db)
+            cust-email (:cust/email (om/get-shared owner :cust))]
         (let [issue-ids (set (map :e (d/datoms @issue-db :aevt :issue/title)))]
           (om/set-state! owner :all-issue-ids issue-ids)
           (om/set-state! owner :rendered-issue-ids issue-ids))
@@ -411,9 +412,19 @@
          (om/get-state owner :listener-key)
          (fn [tx-report]
            (let [issue-ids (set (map :e (d/datoms @issue-db :aevt :issue/title)))]
-             (when (empty? (om/get-state owner :rendered-issue-ids))
-               (om/set-state! owner :rendered-issue-ids issue-ids))
-             (om/set-state! owner :all-issue-ids issue-ids))))))
+             (if (empty? (om/get-state owner :rendered-issue-ids))
+               (om/update-state! owner #(assoc % :rendered-issue-ids issue-ids :all-issue-ids issue-ids))
+               (when cust-email
+                 (om/update-state!
+                  owner #(-> %
+                           (assoc :all-issue-ids issue-ids)
+                           (update-in [:rendered-issue-ids]
+                                      (fn [r]
+                                        (set/union r
+                                                   (set (filter
+                                                         (fn [i] (= cust-email
+                                                                    (:issue/author (d/entity (:db-after tx-report) i))))
+                                                         (set/difference issue-ids r)))))))))))))))
     om/IWillUnmount
     (will-unmount [_]
       (fdb/remove-attribute-listener (om/get-shared owner :issue-db)


+TODO

+TODO

--- src/babel/francais/morphology/verbs.cljc
+++ src/babel/francais/morphology/verbs.cljc
@@ -966,6 +966,7 @@
     true
     reflexive-infinitive))

+;; TODO: pull out stuff that can be made declarative into a data structure inside a (def ..)
 (defn imperfect [word]
   (let [infinitive (reflexive-to-infinitive (get-in word [:français]))
         ar-type (try (re-find #"ar$" infinitive)


Fix state return value

Fix state return value

--- src/braid/client/state/handler/impl.cljs
+++ src/braid/client/state/handler/impl.cljs
@@ -215,17 +215,17 @@
   (helpers/set-search-query state query))

 (defmethod handler :search-history [state [_ [query group-id]]]
-  (when query
-    (do (dispatch! :set-page-error false)
-        (sync/chsk-send!
+  (if query
+    (do (sync/chsk-send!
           [:braid.server/search [query group-id]]
           15000
           (fn [reply]
             (dispatch! :set-page-loading false)
             (if (:thread-ids reply)
               (dispatch! :set-search-results [query reply])
-              (dispatch! :set-page-error true))))))
-  state)
+              (dispatch! :set-page-error true))))
+        (helpers/set-page-error state false))
+    state))

 (defmethod handler :add-threads [state [_ threads]]
   (helpers/add-threads state threads))


Adjust for removal of git_update_interval

--- src/cider_ci/repository/repositories.clj
+++ src/cider_ci/repository/repositories.clj
@@ -48,28 +48,11 @@

 ;### Submit actions through agent #############################################
-(defn- git-update-is-due? [repository git-repository]
-  (when-let [interval-value (:git_update_interval repository)]
-    (if-let [git-updated-at (:git_updated_at @(:agent git-repository))]
-      (time/after? (time/now) (time/plus git-updated-at (time/seconds interval-value)))
-      true)))
-
 (defn- git-fetch-is-due? [repository git-repository]
   (when-let [interval-value (:git_fetch_and_update_interval repository)]
     (if-let [git-fetched-at (:git_fetched_at @(:agent git-repository))]
       (time/after? (time/now) (time/plus git-fetched-at (time/seconds interval-value)))
       true)))
-
-(defn- submit-git-update [repository git-repository]
-  (logging/debug submit-git-update [repository git-repository])
-  (send-off (:agent git-repository)
-            (fn [state repository git-repository]
-              ; possibly skip overflow of the queue
-              (if (git-update-is-due? repository git-repository)
-                (do (fetch-and-update/git-update repository)
-                    (conj state {:git_updated_at (time/now)}))
-                state))
-            repository git-repository))

 (defn- git-fetch-and-update-fn [state repository]
   (catcher/wrap-with-suppress-and-log-warn
@@ -108,8 +91,7 @@
       ;(logging/debug "check for git-fetch-is-due?" {:repository repository :repository-processor repository-processor})
       (if (git-fetch-is-due? repository repository-processor)
         (submit-git-fetch-and-update repository repository-processor)
-        (when (git-update-is-due? repository repository-processor)
-          (submit-git-update repository repository-processor))))))
+        ))))

 (daemon/define "update-repositories"


Use contrasting cue text color on initial render.


Make all data variables private

Make all data variables private

--- src/clj/comic_reader/sites/manga_fox.clj
+++ src/clj/comic_reader/sites/manga_fox.clj
@@ -5,50 +5,69 @@
             [comic-reader.util :refer [safe-read-string]]
             [clojure.string :as s]))

-(def ^:const comic->url-format "%s%s/")
+(def ^:private
+ comic->url-format "%s%s/")

-(def ^:private comic-list-selector
+(def ^:private
+ comic-list-selector
   [:div.manga_list :ul :li :a])

-(def ^:const chapter-number-match-pattern #"/c0*(\d+)/")
+(def ^:private
+ chapter-number-match-pattern #"/c0*(\d+)/")

-(def ^:private chapter-list-selector
+(def ^:private
+ chapter-list-selector
   [:div#chapters :ul.chlist :li :div #{:h3 :h4} :a])

-(def ^:const page-normalize-pattern #"^\d+$")
+(def ^:private
+ page-normalize-pattern #"^\d+$")

-(def ^:const page-normalize-format "%s/%s.html")
+(def ^:private
+ page-normalize-format "%s/%s.html")

-(def ^:const chapter-number-pattern #"/\d+\.html")
+(def ^:private
+ chapter-number-pattern #"/\d+\.html")

-(def ^:private page-list-selector
+(def ^:private
+ page-list-selector
   [:div#top_center_bar :form#top_bar :select.m :option])

-(def ^:private image-selector
+(def ^:private
+ image-selector
   [:div#viewer :img#image])

-(def ^:private root-url "http://mangafox.me")
+(def ^:private
+ root-url "http://mangafox.me")

-(def ^:const link-url-normalize identity)
+(def ^:private
+ link-url-normalize identity)

-(def ^:const link-name-normalize first)
+(def ^:private
+ link-name-normalize first)

-(def ^:const manga-pattern-match-portion "(.*?)/")
+(def ^:private
+ manga-pattern-match-portion "(.*?)/")

-(def ^:const manga-list-format "%s/manga/")
+(def ^:private
+ manga-list-format "%s/manga/")

-(def ^:const manga-url-format "%s/manga/")
+(def ^:private
+ manga-url-format "%s/manga/")

-(def ^:private manga-url
+(def ^:private
+ manga-url
   (format manga-url-format root-url))

-(def ^:private manga-list-url
+(def ^:private
+ manga-list-url
   (format manga-list-format root-url))

-(def ^:private manga-pattern
+(def ^:private
+ manga-pattern
   (re-pattern (str manga-url manga-pattern-match-portion)))

-(def ^:private link->map
+(def ^:private
+ link->map
   (util/gen-link->map link-name-normalize
                       link-url-normalize))


Fix comic filtering code to use new namespaced keys

--- src/cljs/comic_reader/ui/comic_list.cljs
+++ src/cljs/comic_reader/ui/comic_list.cljs
@@ -94,16 +94,16 @@
       {:on-click #(set-prefix "" :clear true)}
       "clear filters"]]))

-(defn- re-string [letter]
-  (if (= letter "#")
-    "^[^a-z]"
-    (str "^" letter)))
+(defn- re-string [s]
+  (if (= s "#")
+    "[^a-z]"
+    (str "" s)))

 (defn prefix-filter-comics [prefix comics]
   (if-not (str/blank? prefix)
     (let [filter-re (re-pattern (str "(?i)^"
                                      (re-string prefix)))]
-      (filter (fn [{:keys [name]}]
+      (filter (fn [{name :comic/name}]
                 (re-find filter-re name))
               comics))
     comics))


Add states debugging tool

Add states debugging tool

--- src/cljs/dato/debug/components/core.cljs
+++ src/cljs/dato/debug/components/core.cljs
@@ -4,6 +4,7 @@
             [cljsjs.codemirror.mode.clojure :as cm-clj]
             [cljs.pprint :as pp]
             [cljs.reader :as reader]
+            [clojure.string :as string]
             [dato.lib.core :as dato]
             [dato.debug.components.keyboard-listener :as keyboard]
             [om-bootstrap.panel :as bs-p]
@@ -72,9 +73,10 @@
   (reify
     om/IWillMount
     (will-mount [_]
-      (om/set-state! owner [:tool] :query)
+      (om/set-state! owner [:current-save-slot] 0)
+      (om/set-state! owner [:tool] :states)
       (om/set-state! owner [:current-query] "default")
-      (om/set-state! owner [:open?] true)
+      (om/set-state! owner [:open?] false)
       (om/set-state! owner [:query] (or (:expressions opts) [])))
     om/IDidUpdate
     (did-update [_ _ prev]
@@ -94,56 +96,113 @@
                                                                        (js/console.log "--------------------")))}}))))
     om/IRender
     (render [_]
-      (let [log                (:log data)
-            log-count          (count log)
-            dato               (om/get-shared owner [:dato])
-            db                 (dato/db dato)
-            app-root           (om/value (om/get-shared owner [:app-root]))
-            selected-state-idx (max 0 (min (or (om/get-state owner [:states :selected]) 0) log-count))
-            selected-state     (when (pos? log-count)
-                                 (nth log selected-state-idx))
-            set-app-state!     (fn [idx]
-                                 (when-let [state (and (pos? log-count)
-                                                       (get-in log [idx :tx :db-after]))]
-                                   (let [new-db (om/value state)
-                                         conn   (dato/conn dato)]
-                                     (js/console.log "new-db: " new-db)
-                                     (js/console.log "conn: " conn)
-                                     (js/console.log "\t=>" [(type new-db)
-                                                             (pr-str (type new-db))
-                                                             (satisfies? datascript.core/ISearch new-db)
-                                                             (satisfies? datascript.core/IIndexAccess new-db)
-                                                             (satisfies? datascript.core/IDB new-db)])
-                                     (reset! conn new-db)
-                                     (om/refresh! app-root)
-                                     (js/console.log "app-root: " app-root)
-                                     ;; (js/console.log "Atom? " conn)
-                                     ;; (js/console.log "new-db DB? " (datascript.core/db? new-db))
-                                     ;; (js/console.log "DB? " (datascript.core/db? @conn))
-                                     ;; (js/console.log "post-reset: " conn)
-                                     )))
-            play-all-states!   (fn play-all-states!
-                                 ([]
-                                  (play-all-states! 0))
-                                 ([idx]
-                                  (cond
-                                    (> idx (dec log-count))          nil
-                                    (get-in log [idx :tx :db-after]) (do
-                                                                       (set-app-state! idx)
-                                                                       (js/setTimeout #(play-all-states! (inc idx)) 1))
-                                    :else                            (js/setTimeout #(play-all-states! (inc idx)) 1))))]
+      (let [log                 (:log data)
+            log-count           (count log)
+            dato                (om/get-shared owner [:dato])
+            db                  (dato/db dato)
+            app-root            (om/value (om/get-shared owner [:app-root]))
+            selected-state-idx  (max 0 (min (or (om/get-state owner [:states :selected]) 0) log-count))
+            selected-state      (when (pos? log-count)
+                                  (nth log selected-state-idx))
+            set-app-state!      (fn [idx]
+                                  (when-let [state (and (pos? log-count)
+                                                        (get-in log [idx :tx :db-after]))]
+                                    (let [new-db (om/value state)
+                                          conn   (dato/conn dato)]
+                                      (reset! conn new-db)
+                                      (om/refresh! app-root))))
+            save-state!         (fn [_ slot-idx]
+                                  (let [local-storage-name (str "dato_save_state_" slot-idx)
+                                        existing-db-str    (js/localStorage.getItem local-storage-name)
+                                        existing-db        (when existing-db-str
+                                                             (reader/read-string existing-db-str))
+                                        title              (or (:title existing-db)
+                                                               (js/prompt "Title for this save state" (str "State " slot-idx)))
+                                        title              (if (string/blank? title)
+                                                             (str "State " slot-idx)
+                                                             title)]
+                                    (js/localStorage.setItem local-storage-name (pr-str {:title title
+                                                                                :db    (dato/db dato)}))))
+            restore-state! (fn [new-db]
+                             (let [conn (dato/conn dato)]
+                               (reset! conn new-db)
+                               (om/refresh! app-root)))
+            restore-save-state! (fn [_ slot-idx]
+                                  (let [local-storage-name (str "dato_save_state_" slot-idx)
+                                        existing-db-str    (js/localStorage.getItem local-storage-name)
+                                        existing-db        (when existing-db-str
+                                                             (reader/read-string existing-db-str))]
+                                    (when existing-db
+                                      (let [new-db (:db existing-db)
+                                            conn   (dato/conn dato)]
+                                        (reset! conn new-db)
+                                        (om/refresh! app-root)))))
+            play-all-states!    (fn play-all-states!
+                                  ([]
+                                   (play-all-states! 0))
+                                  ([idx]
+                                   (cond
+                                     (> idx (dec log-count))          nil
+                                     (get-in log [idx :tx :db-after]) (do
+                                                                        (set-app-state! idx)
+                                                                        (js/setTimeout #(play-all-states! (inc idx)) 1))
+                                     :else                            (js/setTimeout #(play-all-states! (inc idx)) 1))))]
         (dom/div
          {:style {:display (when-not (om/get-state owner [:open?]) "none")}}
-         (om/build keyboard/keyboard-handler {} {:opts {:keymap (atom {["ctrl+slash"] #(om/update-state! owner [:open?] not)})}})
+         (om/build keyboard/keyboard-handler {} {:opts {:keymap (atom {["ctrl+slash"] #(om/update-state! owner [:open?] not)
+                                                                       ["ctrl+s"]     #(save-state! owner (om/get-state owner [:current-save-slot]))
+                                                                       ["ctrl+r"]     #(restore-save-state! owner (om/get-state owner [:current-save-slot]))
+                                                                       ["ctrl+0"]     #(do
+                                                                                (restore-save-state! owner 0)
+                                                                                (om/set-state! owner [:current-save-slot] 0))
+                                                                       ["ctrl+1"]     #(do
+                                                                                (restore-save-state! owner 1)
+                                                                                (om/set-state! owner [:current-save-slot] 1))
+                                                                       ["ctrl+2"]     #(do
+                                                                                (restore-save-state! owner 2)
+                                                                                (om/set-state! owner [:current-save-slot] 2))
+                                                                       ["ctrl+3"]     #(do
+                                                                                (restore-save-state! owner 3)
+                                                                                (om/set-state! owner [:current-save-slot] 3))
+                                                                       ["ctrl+4"]     #(do
+                                                                                (restore-save-state! owner 4)
+                                                                                (om/set-state! owner [:current-save-slot] 4))
+                                                                       ["ctrl+5"]     #(do
+                                                                                (restore-save-state! owner 5)
+                                                                                (om/set-state! owner [:current-save-slot] 5))
+                                                                       ["ctrl+6"]     #(do
+                                                                                (restore-save-state! owner 6)
+                                                                                (om/set-state! owner [:current-save-slot] 6))
+                                                                       ["ctrl+7"]     #(do
+                                                                                (restore-save-state! owner 7)
+                                                                                (om/set-state! owner [:current-save-slot] 7))
+                                                                       ["ctrl+8"]     #(do
+                                                                                (restore-save-state! owner 8)
+                                                                                (om/set-state! owner [:current-save-slot] 8))
+                                                                       ["ctrl+9"]     #(do
+                                                                                (restore-save-state! owner 9)
+                                                                                (om/set-state! owner [:current-save-slot] 9))})}})
          (dom/div
           {:className     "debugger"
            :on-mouse-move #(.stopPropagation %)}
           (bs-p/panel
-           {:header (dom/div (dom/button {:on-click #(om/set-state! owner [:tool] :debugger)} "Debugger")
-                             (dom/button {:on-click #(om/set-state! owner [:tool] :editor)} "Editor")
+           {:header (dom/div "["
+                             (dom/button {:on-click #(om/set-state! owner [:tool] :timeline)} "Timeline")
+                             ;;(dom/button {:on-click #(om/set-state! owner [:tool] :editor)} "Editor")
+                             "] | ["
+                             (dom/button {:on-click #(om/set-state! owner [:tool] :states)} "States")
+                             "] | ["
                              (dom/button {:on-click #(om/set-state! owner [:tool] :query)} "Expression Watch")
-                             " - Dato Debugger " (dom/small "(" log-count " states)"))}
+                             "] - Dato Debugger " (dom/small "(" log-count " states)"))}
            (case (om/get-state owner [:tool])
+             :states   (dom/div
+                        (dom/h3 "Click a title to restore a state")
+                        (dom/ul
+                         (for [slot-idx (range 0 10)]
+                           (let [local-storage-name (str "dato_save_state_" slot-idx)
+                                 existing-db        (when-let [db-str (js/localStorage.getItem local-storage-name)]
+                                                      (reader/read-string db-str))]
+                             (dom/li {:style {:cursor "pointer"}} (:title existing-db "No state saved"))))))
              :query    (dom/div
                         (g/grid
                          {}
@@ -202,7 +261,7 @@
                                    :property "stylesheet"
                                    :href     "/css/vendor/codemirror/codemirror.css"})
                         (dom/div {:className "editor"}))
-             :debugger (dom/div
+             :timeline (dom/div
                         (dom/h3 (pr-str (get-in log [selected-state-idx :tx/intent])))
                         (dom/div
                          (dom/input {:type      "range"


Correct handling of `reduced` in tuple source reduction.

--- src/clojure/parkour/mapreduce/source.clj
+++ src/clojure/parkour/mapreduce/source.clj
@@ -62,9 +62,13 @@
      (source-reduce next-keyval keyval source f init))
   ([nextf dataf source f init]
      (loop [source source, state init]
-       (if-let [source (nextf source)]
-         (recur source (f state (dataf source)))
-         state))))
+       (let [source (nextf source)]
+         (if-not source
+           state
+           (let [state (f state (dataf source))]
+             (if (reduced? state)
+               @state
+               (recur source state))))))))

 (defn source-seq
   "A seq for `source`, in terms of the `TupleSource` protocol.  When provided,


added response-time-ms to logging middleware output

--- src/clojure/picard/middleware/logging.clj
+++ src/clojure/picard/middleware/logging.clj
@@ -24,7 +24,9 @@
          (fn [evt val]
            (when (= :request evt)
              (let [hdrs (first val)]
-               (swap! state #(merge hdrs %))))
+               (swap! state #(-> hdrs
+                                 (merge %)
+                                 (assoc :request-start-time (System/currentTimeMillis))))))
            (next-up evt val))

          :downstream
@@ -49,8 +51,22 @@
                (fn [info]
                  (assoc info
                    :response-body-size
-                   (+ (info :response-body-size) chunk-size))))))
+                   (+ (info :response-body-size) chunk-size)))))
+
+            (= :done evt)
+            (swap!
+             state
+             (fn [info]
+               (assoc info
+                 :response-time-ms
+                 (- (System/currentTimeMillis) )))))
+
            (next-dn evt val))

          :finalize
-         (fn [_] (.info logger @state))))))
+         (fn [_]
+           (let [current-state @state
+                 current-time (System/currentTimeMillis)
+                 response-time-ms (- current-time (:request-start-time current-state))]
+             (.info logger (assoc current-state :response-time-ms response-time-ms))))
+         ))))


more TODO

more TODO

--- src/com/billpiel/sayid/string_output.clj
+++ src/com/billpiel/sayid/string_output.clj
@@ -5,7 +5,7 @@
             clojure.string))

 (def ^:dynamic *sayid-print-length* 15)
-(def ^:dynamic *max-chars* 5000)
+(def ^:dynamic *max-chars* 10000)
 (def ^:dynamic *max-arg-lines* 15)
 (def ^:dynamic *truncate-lines-count* nil)
 (def ^:dynamic *selector* {:args true


some new examples

some new examples

--- one/src/one/a.clj
+++ one/src/one/a.clj
@@ -81,6 +81,37 @@
   (faktorial 2) => (* 2 (faktorial 1)) => (* 2 1)
   (faktorial 1) => 1)

+;; sum, product, take, drop, fibo
+
+(defn sum
+  [xs]
+  (if (empty? xs)
+    0
+    (+ (first xs) (sum (rest xs)))))
+
+(defn sum'
+  [[x & xs]]
+  (if x (+ x (sum' xs)) 0))
+
+
+(defn drop'
+  [n xs]
+  (cond
+    (zero? n) xs
+    (empty? xs) '()
+    :else (drop' (- n 1) (rest xs))))
+
+;; product, take, fibo
+;; map, reduce, filter, keep,
+;; zipmap, merge, assoc, dissoc, dll
+
+(comment
+  (drop 3 [1 2 3 4 5 6 7])
+  (drop 2 [2 3 4 5 6 7])
+  (drop 1 [3 4 5 6 7])
+  (drop 0 [3 4 5 6 7]) => xs)
+
+;; destructuring


Formatting

Formatting

--- src/braid/chat/client/remote_handlers.cljs
+++ src/braid/chat/client/remote_handlers.cljs
@@ -38,7 +38,7 @@
      :braid.client/left-group
      (fn [_ [group-id group-name]]
        (dispatch [:leave-group! {:group-id group-id
-                                :group-name group-name}]))
+                                 :group-name group-name}]))

      :braid.client/user-connected
      (fn [_ [group-id user-id]]


Remove stopwords from documents.

Remove stopwords from documents.

--- project/analyze-data/src/analyze_data/tf_idf/core.clj
+++ project/analyze-data/src/analyze_data/tf_idf/core.clj
@@ -4,13 +4,13 @@
             [analyze-data.tf-idf.inverse-document-frequency
              :refer [inverse-document-frequency]]
             [analyze-data.tf-idf.words
-             :refer [n-grams to-words]]))
+             :refer [n-grams remove-stopwords to-words]]))

 (defn to-terms
   "Given a string representing a document, return a sequence of words,
   bigrams, and trigrams found in the document."
   [document]
-  (let [words (to-words document)]
+  (let [words (remove-stopwords (to-words document))]
     (concat words (n-grams 2 words) (n-grams 3 words))))

 (defn- tf-idf-document


[#1098] make sure that email addresses are saved as lowercase only

--- Dashboard/app/cljs/src/org/akvo/flow/dashboard/users/store.cljs
+++ Dashboard/app/cljs/src/org/akvo/flow/dashboard/users/store.cljs
@@ -14,6 +14,7 @@

 (ns org.akvo.flow.dashboard.users.store
   (:require  [clojure.set :as set]
+             [clojure.string :as s]
              [org.akvo.flow.dashboard.app-state :refer (app-state)]
              [org.akvo.flow.dashboard.dispatcher :as dispatcher]
              [org.akvo.flow.dashboard.ajax-helpers :as ajax]
@@ -63,7 +64,7 @@
  (assert new-user)
  (POST "/rest/users"
        (merge ajax/default-ajax-config
-              {:params {"user" new-user}
+              {:params {"user" (update-in new-user ["emailAddress"] s/lower-case)}
                :handler (fn [response]
                           (let [user (get response "user")
                                 user-id (get user "keyId")]


Fixed cell update function.

Fixed cell update function.

--- src/utf8ify/web/core.cljs
+++ src/utf8ify/web/core.cljs
@@ -25,19 +25,20 @@
   (put! ch [msg-name {:x (.-pageX xy-obj) :y (.-pageY xy-obj)}]))

 (om/root grid app-state
-              {:target (. js/document (getElementById "app")) })
+         {:target (. js/document (getElementById "app")) })
+
+(defn- String->Number [s]
+  (js/parseFloat s))
+
+(defn activate-cell [id data]
+  (assoc data
+         :cells (->> (:cells data)
+                     (map (fn [cell] (assoc cell :on (or (:on cell) (= (:id cell) id))))))))

 (go
   (loop [[msg-name {x :x y :y}] (<! app/draw-events)]
     (let [cell (.elementFromPoint js/document x y)
           data-id (.-id (.-dataset cell))]
-      (activate-cell data-id))
+      (swap! app-state #(activate-cell (String->Number data-id) %)))
     (recur (<! app/draw-events))))

-(defn activate-cell [id]
-  (.log js/console (str "Cell: " id))
-  (swap! app-state (fn [data]
-         (let [cells (:cells data)
-               updated-cells (map (fn [cell]
-                                    (assoc cell {:on (or (:on cell) (= (:id cell) id))})) cells)]
-           (assoc data {:cells updated-cells})))))


Revert "Expose container status."

Revert "Expose container status."

This is already exposed via immutant.util/in-container.

This reverts commit 214c71ccec746f72badda0267292a5d97ee6c74d.

--- wildfly/src/immutant/wildfly.clj
+++ wildfly/src/immutant/wildfly.clj
@@ -18,15 +18,9 @@
             [immutant.wildfly.repl  :as repl]
             [wunderboss.util        :as wu]
             [clojure.java.io        :as io])
-  (:import java.net.URL
-           org.projectodd.wunderboss.WunderBoss))
+  (:import java.net.URL))

 (def module-class-loader-class (memoize #(u/try-import 'org.jboss.modules.ModuleClassLoader)))
-
-(defn in-container?
-  "Returns true if the application is currently running inside WildFly."
-  []
-  (boolean (get (WunderBoss/options) "wildfly-service")))

 (defn- get-resource-loaders
   [cl]


Several changes to incorporate re-com and dmm

--- dmmproj/project.clj
+++ dmmproj/project.clj
@@ -1,15 +1,18 @@
 (defproject dmmproj "0.1.0-SNAPSHOT"
-  :description "CLJS DMM with Quil..."
-  :url "http://example.com/FIXME"
+  :description "Exploring various reagent,re-com, etc"
+  :url "https://github.com/jsa-aerial/cljs-adventures/tree/master/projone"
   :license {:name "The MIT License (MIT)"
             :url "http://opensource.org/licenses/MIT"}

-  :dependencies [[org.clojure/clojure "1.9.0-alpha16"]
-                 [org.clojure/clojurescript "1.9.521"
+  :dependencies [[org.clojure/clojure "1.8.0"]
+                 [org.clojure/clojurescript "1.9.542"
                   :exclusions [org.apache.ant/ant]]
                  [org.clojure/core.async "0.3.442"]
+
                  [quil "2.6.0"]
-                 [re-com "2.0.0"]
+
+                 [cljs-ajax "0.6.0"]
+                 [re-com "2.1.0"]
                  [reagent "0.6.1"]
                  [cljsbuild "1.1.5"]]

@@ -22,7 +25,7 @@

   :figwheel
   {:css-dirs ["resources/public/stylesheets"]
-   :server-port 3450}
+   :server-port 3451}

   ;; All lein-cljsbuild-specific configuration is under the :cljsbuild
   ;; key.
@@ -62,6 +65,7 @@
       ;; New extern inference for :advanced opt.
       ;; writes externs file (see below) inferred_externs.js
       ;; Also need (set! *warn-on-infer* true) turns on inference warnings
+      ;; And see https://github.com/dcodeIO/node.js-closure-compiler-externs
       ;;:infer-externs true

       ;; Otherwise or additionally:


Fixed transitions patter and lint errors.

--- src/hxgm30/language/syntagmata/corpus.clj
+++ src/hxgm30/language/syntagmata/corpus.clj
@@ -66,23 +66,27 @@

 (defn re-not-alpha
   [language]
-  (str "[^" (apply str (load-alphabet language)) "]"))
+  (str "[^" (string/join (load-alphabet language)) "]"))

 (defn re-alpha
   [language]
-  (str "[" (apply str (load-alphabet language)) "]"))
+  (str "[" (string/join (load-alphabet language)) "]"))

 (defn re-vowel
   [language]
-  (str "[" (apply str (load-vowels language)) "]"))
+  (str "[" (string/join (load-vowels language)) "]"))

 (defn re-consonant
   [language]
-  (str "[" (apply str (load-consonants language)) "]"))
+  (str "[" (string/join (load-consonants language)) "]"))

-(defn re-sound-transition
+(defn re-sound-transitions
   [language]
-  (str (re-consonant language) "?" (re-vowel language) "+"))
+  (format "(%s+)|(%s+%s+)|(%s+)"
+          (re-vowel language)
+          (re-consonant language)
+          (re-vowel language)
+          (re-consonant language)))

 (defn clean-word
   [language word]


Fixed typo 'Accepets' -> 'Accepts'

Fixed typo 'Accepets' -> 'Accepts'

--- src/leiningen/new/mr_clojure/web_unit.clj
+++ src/leiningen/new/mr_clojure/web_unit.clj
@@ -11,7 +11,7 @@

 (defn request
   "Creates a compojure request map and applies it to our routes.
-   Accepets method, resource and optionally an extended map"
+   Accepts method, resource and optionally an extended map"
   [method resource & [{:keys [params body content-type headers]
                        :or {params {}
                             headers {}}}]]


Reformat day8.re-frame-10x.common-styles ns

--- src/day8/re_frame_10x/common_styles.cljs
+++ src/day8/re_frame_10x/common_styles.cljs
@@ -218,10 +218,10 @@

    ;; input-text - set to 26px high
    [:.rc-input-text
-    [:input {:height "25px"
-             :border-radius "2px"
+    [:input {:height           "25px"
+             :border-radius    "2px"
              :background-color "white"
-             :border (str "1px solid " white-background-border-color)}]]
+             :border           (str "1px solid " white-background-border-color)}]]

    ;; input-time - set to 26px high
    [:.rc-input-time {:height "26px"}]
@@ -269,5 +269,5 @@
    [:.btn-default.active {:color default-text-color}]
    [:.open
     [:>
-     [:.dropdown-toggle.btn-default {:color default-text-color}]]]
-   ])
+     [:.dropdown-toggle.btn-default {:color default-text-color}]]]])
+


Revert "reader: read and read-string are read-eval safe, added unsafe-read and unsafe-read-string"

This reverts commit 2899201a9f4e6bcda1dd5beca6606206cde3ec75.

--- src/main/clojure/clojure/tools/reader.clj
+++ src/main/clojure/clojure/tools/reader.clj
@@ -680,14 +680,10 @@
               (throw (IllegalStateException. "Arg literal must be %, %& or %integer"))
               (register-arg n))))))))

-(def ^:private ^:dynamic *unsafe-read* false)
-
 (defn read-eval
   [rdr _]
   (when-not *read-eval*
     (reader-error rdr "#= not allowed when *read-eval* is false"))
-  (when-not *unsafe-read*
-    (reader-error rdr "#= only allowed when using the unsafe- variants of read and read-string"))
   (let [o (read rdr true nil true)]
     (if (symbol? o)
       (RT/classForName (str ^Symbol o))
@@ -973,8 +969,7 @@

 (defn read
   "Reads the first object from an IPushbackReader or a java.io.PushbackReader.
-Returns the object read. If EOF, throws if eof-error? is true. Otherwise returns sentinel.
-Safe, #= is not allowed"
+Returns the object read. If EOF, throws if eof-error? is true. Otherwise returns sentinel."
   ([] (read *in*))
   ([reader] (read reader true nil))
   ([reader eof-error? sentinel] (read reader eof-error? sentinel false))
@@ -1004,8 +999,7 @@
                            e)))))))

 (defn read-string
-  "Reads one object from the string s.
-Safe, #= is not allowed"
+  "Reads one object from the string s"
   [s]
   (read (string-push-back-reader s) true nil false))

@@ -1020,20 +1014,3 @@
          (if (newline? c)
            (str s)
            (recur (read-char rdr) (.append s c)))))))
-
-(defn unsafe-read
-  "Reads the first object from an IPushbackReader or a java.io.PushbackReader.
-Returns the object read. If EOF, throws if eof-error? is true. Otherwise returns sentinel.
-Unsafe, #= is allowed if *read-eval* is bound to true"
-  ([]  (unsafe-read *in*))
-  ([reader] (unsafe-read reader true nil))
-  ([reader eof-error? sentinel] (unsafe-read reader eof-error? sentinel false))
-  ([^clojure.tools.reader.IPushbackReader reader eof-error? sentinel recursive?]
-     (binding [*unsafe-read* true]
-       (read reader eof-error? sentinel recursive?))))
-
-(defn unsafe-read-string
-  "Reads one object from the string s.
-Unsafe, #= is allowed if *read-eval* is bound to true"
-  [s]
-  (unsafe-read (string-push-back-reader s) true nil false))


more tidying

more tidying

--- src/main/clojure/org/dada/demo/whales.clj
+++ src/main/clojure/org/dada/demo/whales.clj
@@ -147,11 +147,11 @@

 (def #^Class Whale (apply make-class "org.dada.demo.whales.Whale" Object attributes))
 (def #^Metadata whale-metadata (metadata Whale md-attributes))
-(def #^Model whales (model "Whales" :id :version whale-metadata))
+(def #^Model whales-model (model "Whales" :id :version whale-metadata))

 (def num-whales 100000)

-(insert *metamodel* whales)
+(insert *metamodel* whales-model)

 ;;----------------------------------------

@@ -319,8 +319,9 @@
   ((second (monad)) (fn [model key])))

 ;;--------------------------------------------------------------------------------
-
-(def my-whales (mlift whales :id 0))	;TODO - col should be optional
+;; some actual queries...
+
+(def whales (mlift whales-model :id 0))	;TODO - col should be optional

 (def #^NavigableSet years
      (TreeSet.
@@ -336,15 +337,12 @@
        (Date. 8 0 1)
        (Date. 9 0 1))))

-;;--------------------------------------------------------------------------------
-
-
-
-(execute (msum (mgroup my-whales [[:type]] mcount) :count))
-(execute (mcount my-whales))
-
-(execute (mgroup my-whales [[:type]
-			    [:time (fn [time] (list (or (.lower years time) time)))]]
+
+(execute (msum (mgroup whales [[:type]] mcount) :count))
+(execute (mcount whales))
+
+(execute (mgroup whales [[:type]
+			 [:time (fn [time] (list (or (.lower years time) time)))]]
 		 mcount))

 ;;----------------------------------------
@@ -356,14 +354,14 @@
 ;; create some whales...
 (time
  (doall
-  (let [batcher (Batcher. 999 1000 (list whales))
+  (let [batcher (Batcher. 999 1000 (list whales-model))
 	#^Creator creator (.getCreator whale-metadata)
 	max-length-x-100 (* max-length 100)
 	max-weight-x-100 (* max-weight 100)]
     (pmap
      (fn [id]
 	 (insert
-	  whales ;; batcher
+	  whales-model ;; batcher
 	  (.create
 	   creator
 	   (into-array


pivot going well - metadata in place

pivot going well - metadata in place

--- src/main/clojure/org/dada/demo/whales.clj
+++ src/main/clojure/org/dada/demo/whales.clj
@@ -287,10 +287,36 @@

 (defn union [[#^Model src-metamodel #^Metadata src-metadata #^Collection extra-keys] & [#^String prefix]]
-  (let [tgt-model (model (str (or prefix (name (gensym "HERE"))) ".union()") nil src-metadata)
+  (let [tgt-model (model (str (or prefix (name (gensym "UNION"))) ".union()") nil src-metadata)
 	tgt-metamodel (meta-view ".union()" src-metamodel (fn [tgt-metamodel src-model & extra-values] (connect src-model tgt-model)))]
     (insert *metamodel* tgt-model)
     (insert tgt-metamodel [tgt-model])
+    [tgt-metamodel src-metadata extra-keys]))
+
+;; pivot-key - e.g. :time
+;; pivot-values - e.g. years
+;; value-key - e.g. :count(*) - needed to find type of new columns
+(defn pivot [[#^Model src-metamodel #^Metadata src-metadata #^Collection extra-keys] pivot-key pivot-values value-key]
+  (let [pivot-name (str ".pivot(" value-key "/" pivot-key")")
+	value-type (.getAttributeType src-metadata value-key)
+	pivot-metadata (class-metadata
+			(name (gensym "org.dada.core.Pivot"))
+			Object
+			extra-keys
+			(concat
+			 (map #(.getAttribute src-metadata %) extra-keys)
+			 (map #(vector % value-type true) pivot-values)))
+	tgt-metamodel (meta-view
+		       pivot-key
+		       src-metamodel
+		       (fn [tgt-metamodel src-model & extra-values]
+			   ;; we'll neesd to build the metadata here
+			   (let [tgt-model (model (str (name (gensym "PIVOT")) pivot-name) nil pivot-metadata)]
+			     (println "PIVOT"  extra-keys pivot-key pivot-values value-key extra-values)
+			     (insert *metamodel* tgt-model)
+			     (insert tgt-metamodel [tgt-model])
+			     ;;(connect src-model tgt-model)
+			     )))]
     [tgt-metamodel src-metadata extra-keys]))

 ;;--------------------------------------------------------------------------------
@@ -317,13 +343,17 @@
       all-whales
       :type
       nil
-      #(union
-	(ccount
-	 (split
-	  %
-	  :time
-	  (fn [time] (list (or (.lower years time) time)))
-	  )))
+      #(pivot
+	(union
+	 (ccount
+	  (split
+	   %
+	   :time
+	   (fn [time] (list (or (.lower years time) time)))
+	   )))
+	:time
+	years
+	(keyword (count-value-key nil)))
       ))

 ;;(def counted-whales-by-type (ccount whales-by-type))
@@ -336,7 +366,7 @@

 ;; create some whales...

-(def num-whales 1000000)
+(def num-whales 1000)

 (time
  (doall


fix mk-fixed-spout

fix mk-fixed-spout

--- src/clj/marceline/storm/testing/trident_wordcount.clj
+++ src/clj/marceline/storm/testing/trident_wordcount.clj
@@ -12,15 +12,13 @@

 (defn mk-fixed-spout [max-batch-size]
   (FixedBatchSpout.
-   (Fields. "sentence")
+   (t/fields "sentence")
    max-batch-size
-;   (ArrayList. (into [] (doall (map t/values '("the cow jumped over the moon"
-;                                               "the man went to the store and bought some candy"
-;                                               "four score and seven years ago"
-;                                               "how many can you eat"
-;                                               "to be or not to be the person")))))
-   (Values. "the cow jumped over the moon")
-   ))
+   (into-array (map t/values '("the cow jumped over the moon"
+                               "the man went to the store and bought some candy"
+                               "four score and seven years ago"
+                               "how many can you eat"
+                               "to be or not to be the person")))))

 (t/defcombineraggregator
   count-words


Make it possible to use complex types

Make it possible to use complex types

--- src/clojure/clojurewerkz/cassaforte/new_query_api.clj
+++ src/clojure/clojurewerkz/cassaforte/new_query_api.clj
@@ -464,6 +464,13 @@
 ;;     (.addPartitionKey "bsd" (:int primitive-types))
 ;;     (.addClusteringColumn "a" (:int primitive-types)))

+(defn- make-column-type
+  [column-name column-defs]
+  (let [column-type (get column-defs column-name)]
+    (if (keyword? column-type)
+      (get primitive-types column-type)
+      column-type)))
+
 (let [order
       {:column-definitions 1}
       renderers
@@ -473,17 +480,18 @@

                                (reduce
                                 (fn [builder [column-name column-type]]
-                                  (.addColumn builder (name column-name)
-                                              (get primitive-types column-type)))
+                                  (.addColumn builder
+                                              (name column-name)
+                                              (make-column-type column-name column-defs)))
                                 query-builder
                                 (apply dissoc column-defs (conj (flatten (get column-defs :primary-key))
                                                                 :primary-key)))

                                (reduce
                                 (fn [builder column-name]
-                                  (.addPartitionKey builder (name column-name)
-                                                    (get primitive-types
-                                                         (get column-defs column-name))))
+                                  (.addPartitionKey builder
+                                                    (name column-name)
+                                                    (make-column-type column-name column-defs)))
                                 query-builder
                                 (if (sequential? primary-key)
                                   primary-key
@@ -493,8 +501,7 @@
                                 (fn [builder column-name]
                                   (.addClusteringColumn builder
                                                         (name column-name)
-                                                        (get primitive-types
-                                                             (get column-defs column-name))))
+                                                        (make-column-type column-name column-defs)))
                                 query-builder
                                 clustering-keys)))}]
   (defn create-table


Fix hiding of hover-card description in collapsed messages

--- src/braid/core/client/ui/styles/message.cljs
+++ src/braid/core/client/ui/styles/message.cljs
@@ -19,7 +19,9 @@

    [:&.collapse
     {:margin-top (m/- pad)}
-    [:.avatar :.info
+
+    [:>.avatar
+     :>.info
      {:display "none"}]]

    [:&.unseen


added loading info while fetching logs on init

--- src/cljs/swarmpit/component/service/log.cljs
+++ src/cljs/swarmpit/component/service/log.cljs
@@ -106,8 +106,9 @@
           :onCheck (fn [_ v]
                      (state/update-value [:autoscroll] v cursor))})]]
      [:div.log#service-log
-      (if (and (empty? filtered-items) initialized)
-        [:span "There are no logs available for the service."]
-        (map
-          (fn [item]
-            (line item timestamp)) filtered-items))]]))
+      (cond
+        (and (empty? filtered-items) initialized) [:span "There are no logs available for the service."]
+        (not initialized) [:span "Loading..."]
+        :else (map
+                (fn [item]
+                  (line item timestamp)) filtered-items))]]))


Renamed elasticsearch namespace to connect.

--- src/cmr/search/data/elastic_search_index.clj
+++ src/cmr/search/data/elastic_search_index.clj
@@ -7,7 +7,7 @@
             [cmr.common.log :refer (debug info warn error)]
             [cmr.common.lifecycle :as lifecycle]
             [cmr.common.cache :as cache]
-            [cmr.elastic-utils.elasticsearch :as es]
+            [cmr.elastic-utils.connect :as es]
             [cmr.transmit.index-set :as index-set]
             [cmr.search.models.results :as results]
             [cmr.search.data.query-to-elastic :as q2e]


form for submitting a rating | sg | #5

form for submitting a rating | sg | #5

--- src/cljs/conference_rating/conference.cljs
+++ src/cljs/conference_rating/conference.cljs
@@ -45,8 +45,16 @@
      [:p (str (:rating-stars conference-ratings-entry) " out of 5 stars")]
      [:p (:rating-comment conference-ratings-entry)]]]])

-(defn display-conference-ratings [conference-ratings]
+(defn display-ratings [conference-ratings]
   [:div (map display-rating conference-ratings)])
+
+(defn display-add-rating []
+  [:form
+   [:div {:class "form-group"}
+    [:input {:type "text" :placeholder "author" :class "form-control"}]]
+   [:div {:class "form-group"}
+    [:textarea {:placeholder "comment" :class "form-control" :rows "5"}]]
+   [:button {:type "submit" :class "btn btn-primary"} "add rating"]])

 (defn display-conference [conference]
   (let [conference-ratings @ratings]
@@ -54,7 +62,8 @@
    [:div {:class "jumbotron"}
     [:h1(:conference-name conference)]
     [:p (:conference-description conference)]]
-   [:div (display-conference-ratings conference-ratings)]]))
+   [:div (display-add-rating)]
+   [:div (display-ratings conference-ratings)]]))

 (defn conference-page []
   (let [conference @displayed-conference]


clean input

clean input

--- src/cljs/material/component/composite.cljs
+++ src/cljs/material/component/composite.cljs
@@ -21,8 +21,7 @@
 (defn autocomplete-input [props]
   (let [{:keys [inputRef] :as p} (keywordize-keys (js->clj props))]
     (html
-      [:div (merge {:ref                   inputRef
-                    :backspaceRemovesValue true}
+      [:div (merge {:ref inputRef}
                    (dissoc p :inputRef))])))

 (defn autocomplete-no-options-mssg [props]


KTO-235: Poistettu deprekoitu include_type_name

--- clj-elasticsearch/src/clj_elasticsearch/elastic_connect.clj
+++ clj-elasticsearch/src/clj_elasticsearch/elastic_connect.clj
@@ -30,7 +30,7 @@
   ([index settings mappings]
    (let [json (cond-> {:settings settings}
                       (seq (keys mappings)) (merge {:mappings mappings}))]
-     (elastic-put (elastic-url index) json {:include_type_name false})))
+     (elastic-put (elastic-url index) json)))
   ([index settings]
    (create-index index settings nil)))


Update links to new repo name

Update links to new repo name

GitHub was redirecting appropriately, but it was bothering me.

--- cljs-cheatsheet/cljs_cheatsheet/html.cljs
+++ cljs-cheatsheet/cljs_cheatsheet/html.cljs
@@ -1058,8 +1058,8 @@
 (def clojure-cheatsheet-href "http://clojure.org/cheatsheet")
 (def clojure-tooltip-cheatsheet-href "http://jafingerhut.github.io/cheatsheet/clojuredocs/cheatsheet-tiptip-cdocs-summary.html")
 (def clojurescript-github-href "https://github.com/clojure/clojurescript")
-(def cljsinfo-github-href "https://github.com/oakmac/cljs.info/")
-(def cljsinfo-license-href "https://github.com/oakmac/cljs.info/blob/master/LICENSE.md")
+(def cljsinfo-github-href "https://github.com/cljsinfo/cljs.info/")
+(def cljsinfo-license-href "https://github.com/cljsinfo/cljs.info/blob/master/LICENSE.md")

 ;; include this? "Please copy, improve, and share this work."
 (hiccups/defhtml footer []
@@ -1074,7 +1074,7 @@
         [:a.ftr-link-e980e {:href clojurescript-github-href} "ClojureScript source"]]
       [:div.links-446e0
         [:label.quiet-5d4e8 "source: "]
-        [:a.ftr-link-e980e {:href cljsinfo-github-href} "github.com/oakmac/cljs.info"]]
+        [:a.ftr-link-e980e {:href cljsinfo-github-href} "github.com/cljsinfo/cljs.info"]]
       [:div.links-446e0
         [:label.quiet-5d4e8 "license: "]
         [:a.ftr-link-e980e {:href cljsinfo-license-href} "MIT"]]]])


Switch default queue setup.

Switch default queue setup.

--- src/dsbdp/local_data_processing_pipeline.clj
+++ src/dsbdp/local_data_processing_pipeline.clj
@@ -32,12 +32,12 @@
 ;                  "ArrayBlockingQueue_put-counted-yield"))]
 ;                  "ArrayBlockingQueue_add-counted-yield"))]
 ;                  "ArrayBlockingQueue_add-counted-yield_remove-yield"))]
-                  "OneToOneConcurrentArrayQueue3_add-counted-yield_remove-yield"))]
+;                  "OneToOneConcurrentArrayQueue3_add-counted-yield_remove-yield"))]
 ;                  "ArrayBlockingQueue_offer"))]
 ;                  "ArrayBlockingQueue_offer-counted-yield"))]
 ;                  "LinkedTransferQueue_transfer"))]
 ;                  "LinkedTransferQueue_transfer-counted-yield"))]
-;                  "LinkedTransferQueue_tryTransfer-counted-1ms"))]
+                  "LinkedTransferQueue_tryTransfer-counted-1ms"))]
     (println "Using queue-setup:" setup)
     setup))


A bit of shader improvements

A bit of shader improvements

--- renderer/src/renderer/engine/shaders.cljs
+++ renderer/src/renderer/engine/shaders.cljs
@@ -11,8 +11,12 @@
 (declare frag-shader-picker)

 (defn create-shader [gl]
+  ;; make sure that needed extensions are addeded
   (let [vs (shaders/create-shader gl shader/vertex-shader vertex-shader)
-        fs (shaders/create-shader gl shader/fragment-shader frag-shader)]
+        fs (shaders/create-shader gl shader/fragment-shader
+                                  (if (.getExtension gl "EXT_frag_depth")
+                                    (str "#define have_frag_depth\n\n" frag-shader)
+                                    frag-shader))]
     (shaders/create-program gl vs fs)))

@@ -113,8 +117,8 @@
                   height_color * height_f +
                   inv_height_color * iheight_f;

-      // blend and return
-      gl_PointSize = pointSize;
+      gl_PointSize = (1.0 / tan(1.308/2.0)) * pointSize / (-mvPosition.z);
+      gl_PointSize = gl_PointSize * 1000.0 / 2.0;
   }")

@@ -148,6 +152,10 @@

 (def frag-shader
   "
+#if defined have_frag_depth
+#extension GL_EXT_frag_depth : enable
+#endif
+
   precision mediump float;

   uniform vec4 planes[6];
@@ -168,6 +176,17 @@
           }
       }

+
+      float a = pow(2.0*(gl_PointCoord.x - 0.5), 2.0);
+  	  float b = pow(2.0*(gl_PointCoord.y - 0.5), 2.0);
+      float c = 1.0 - (a + b);
+
+   	  if(c < 0.0){
+   	      discard;
+   	  }
+#if defined have_frag_depth
+      gl_FragDepthEXT = gl_FragCoord.z + 0.002*(1.0-pow(c, 1.0)) * gl_FragCoord.w;
+#endif
       gl_FragColor = vec4(mix(out_color, out_intensity, intensityBlend), 1.0);
   }")


refac: more volatile consistency

refac: more volatile consistency

--- src/main/clojure/pdok/featured/geoserver.clj
+++ src/main/clojure/pdok/featured/geoserver.clj
@@ -200,7 +200,7 @@
     (flush-batch update-batch (partial gs-update-feature db proj-fn))
     (flush-batch delete-batch (partial gs-delete-feature db))

-    (dosync (ref-set no-insert #{}))
+    (dosync (vreset! no-insert #{}))
     ))

 (defn- versions-in-batch [{:keys [dataset collection id]} batch]
@@ -260,7 +260,7 @@
       (let [versions-in-insert (versions-in-batch feature @insert-batch)
             batched-delete-feature (batched delete-batch delete-batch-size flush-fn)]
         (dosync
-          (alter no-insert #(clojure.set/union % (into #{} versions-in-insert))))
+          (vswap! no-insert #(clojure.set/union % (into #{} versions-in-insert))))
         (batched-delete-feature feature))))
   (proj/accept? [_ feature]
          (not (some #{(:collection feature)} no-visualization)))
@@ -278,7 +278,7 @@
         update-batch (volatile! (clojure.lang.PersistentQueue/EMPTY))
         delete-batch-size (or (:delete-batch-size config) (:batch-size config) 10000)
         delete-batch (volatile! (clojure.lang.PersistentQueue/EMPTY))
-        no-insert (ref #{})
+        no-insert (volatile! #{})
         ndims (or (:ndims config) 2)
         srid (or (:srid config) 28992)
         proj-fn (or (:proj-fn config) identity)


close-all -> close-childs

close-all -> close-childs

--- src/main/clojure/pdok/featured/processor.clj
+++ src/main/clojure/pdok/featured/processor.clj
@@ -172,11 +172,11 @@
    :parent-collection collection
    :parent-id id})

-(defn- meta-close-all-features [features]
-  "{:action :close-all :dataset _ :collection _ :parent-collection _ :parent-id _ :end-time _"
+(defn- meta-close-childs [features]
+  "{:action :close-childs :dataset _ :collection _ :parent-collection _ :parent-id _ :end-time _"
   (let [grouped (group-by #(select-keys % [:dataset :collection :parent-collection :parent-id :validity]) features)]
     (letfn [(meta [dataset collection parent-collection parent-id validity]
-              {:action :close-all
+              {:action :close-childs
                :dataset dataset
                :collection collection
                :parent-collection parent-collection
@@ -194,10 +194,10 @@
           without-nested (apply dissoc attributes (map #(first %) nested))
           flat (assoc feature :attributes without-nested)
           linked-nested (map #(link-parent % feature) nested)
-          close-all (meta-close-all-features linked-nested)]
+          meta-close-childs (meta-close-childs linked-nested)]
       (if (empty? linked-nested)
         (list flat)
-        (cons flat (concat close-all (mapcat pre-process linked-nested))))
+        (cons flat (concat meta-close-childs (mapcat pre-process linked-nested))))
       ))
   )

@@ -212,7 +212,7 @@
         collected (assoc no-attributes :attributes collected)]
     collected))

-(defn- close-all* [processor dataset collection id end-time]
+(defn- close-childs* [processor dataset collection id end-time]
   (let [persistence (:persistence processor)
         validity (pers/current-validity persistence dataset collection id)
         state (pers/last-action persistence dataset collection id)]
@@ -224,7 +224,7 @@
                               :current-validity validity
                               :validity end-time}))))

-(defn- close-nested-meta [persistence dataset parent-collection parent-id end-time]
+(defn- close-nested-childs-meta [persistence dataset parent-collection parent-id end-time]
   (let [nested (pers/childs persistence dataset parent-collection parent-id)
         metas (map (fn [[col id]] {:dataset dataset
                                   :collection col
@@ -233,13 +233,13 @@
                                   :end-time end-time}) nested)]
     metas))

-(defn- close-all [processor meta-record]
+(defn- close-childs [processor meta-record]
   (let [{:keys [dataset collection parent-collection parent-id end-time]} meta-record
         persistence (:persistence processor)
         ids (pers/childs persistence dataset parent-collection parent-id collection)
-        nested-metas (mapcat #(close-nested-meta persistence dataset collection % end-time) ids)
-        closed-nesteds (doall (mapcat #(close-all processor %) nested-metas))
-        closed (doall (mapcat #(close-all* processor dataset collection % end-time) ids))]
+        nested-metas (mapcat #(close-nested-childs-meta persistence dataset collection % end-time) ids)
+        closed-nesteds (doall (mapcat #(close-childs processor %) nested-metas))
+        closed (doall (mapcat #(close-childs* processor dataset collection % end-time) ids))]
     (concat closed-nesteds closed)))

 (defn- delete-child* [processor dataset collection id]
@@ -277,7 +277,7 @@
           :nested-new (process-nested-new-feature processor vf)
           :nested-change (process-nested-new-feature processor vf)
           :nested-close  (process-nested-close-feature processor vf)
-          :close-all (close-all processor vf);; should save this too... So we can backtrack actions. Right?
+          :close-childs (close-childs processor vf);; should save this too... So we can backtrack actions. Right?
           :delete-childs (delete-childs processor vf)
           (make-invalid vf (str "Unknown action:" (:action vf))))]
     processed))


cleanup

cleanup

Former-commit-id: 923b2af64859a25d279877c672f3bc99d694710c

--- src/status_im/commands/handlers/jail.cljs
+++ src/status_im/commands/handlers/jail.cljs
@@ -48,7 +48,6 @@

 (defn command-preview
   [db [chat-id {:keys [result]}]]
-  (println :wuuut)
   (if result
     (let [path         [:chats chat-id :staged-commands]
           commands-cnt (count (get-in db path))]


Turned change-texture into a function

Turned change-texture into a function

It now returns a new entity merged with the old one minus the texture,
and including the new filename.

--- desktop/src-common/escape_game/gamedata.clj
+++ desktop/src-common/escape_game/gamedata.clj
@@ -35,10 +35,8 @@
        ~'ent)))

-;; small macro to make code more terse
-;; may want to update the :image entry in the map, too?
-(defmacro change-texture [who filename]
-  `(texture! ~who :set-texture (texture! (texture ~filename) :get-texture)))
+(defn change-texture [who filename]
+  (-> who (dissoc :object) (assoc :image filename) (map->entity)))

 ;; the game data
@@ -48,14 +46,14 @@
                :action (pickup-action-fn))
              (defentity "door" "images/door2.png" 250 81 128 256
                :action (when-selected "key"
-                                      (change-texture ent "images/door2open.png")
-                                      (assoc ent :action (fn [ent screen entities]
-                                                           (switch-to-room (:current-room screen) :room05 screen)))))
+                                      (assoc (change-texture ent "images/door2open.png")
+                                             :action (fn [ent screen entities]
+                                                       (switch-to-room (:current-room screen) :room05 screen)))))
              (defentity "door" "images/door3.png" 12 16 35 256
                :action (when-selected "key"
-                                      (change-texture ent "images/door3open.png")
-                                      (assoc ent :action (fn [ent screen entities]
-                                                           (switch-to-room (:current-room screen) :room05 screen))))) ;; TODO: switch to stairs
+                                      (assoc (change-texture ent "images/door3open.png")
+                                             :action (fn [ent screen entities]
+                                                       (switch-to-room (:current-room screen) :room05 screen))))) ;; TODO: switch to stairs
              (arrow :right :room02)]

             :room02


refactor

refactor

--- examples/lesson-carousel-starter-kit/src/carousel/core.cljs
+++ examples/lesson-carousel-starter-kit/src/carousel/core.cljs
@@ -128,9 +128,9 @@

     pages))

-(defn Carousel [selector data]
+(defn Carousel []
   (let [simulation (PhysicsEngine.)
-        context (.. FamousEngine (createScene selector))
+        context (.. FamousEngine (createScene "body"))
         root-node (.. context addChild)

         back-node (.. root-node addChild)
@@ -198,5 +198,5 @@

   )

-(Carousel "body" {})
+(Carousel)
 (.. FamousEngine init)


Story ID: develop Summary: Fixed bug where if diff is nil or empty it wouldn't fallback to showing expected and actual

--- src/untangled_spec/reporters/terminal.clj
+++ src/untangled_spec/reporters/terminal.clj
@@ -1,14 +1,11 @@
 (ns untangled-spec.reporters.terminal
-  ( :require [clojure.test :as t]
+  (:require [clojure.test :as t]
             [clojure.stacktrace :as stack]
             [untangled-spec.reporters.impl.terminal :as impl]
             [colorize.core :as c]
             [clojure.string :as s]
             [io.aviso.exception :refer [format-exception *traditional*]]
-            clojure.java.shell
-            [clojure.pprint :refer [pprint]] )
-  (:import clojure.lang.ExceptionInfo
-           apple.applescript.AppleScriptEngineFactory))
+            [clojure.pprint :refer [pprint]]))

 (def env (let [COLOR     (System/getenv "US_DIFF_HL")
                DIFF-MODE (System/getenv "US_DIFF_MODE")
@@ -124,7 +121,7 @@
     (print-throwable actual))
   (some-> throwable print-throwable)
   (some-> message (print-message print-fn))
-  (when (or (not (env :diff?))
+  (when (or (not diff) (not (env :diff?))
             (and (not (env :diff-hl?)) (not (env :diff-list?))))
     (print-fn "   Actual:" (pretty-str actual (+ 5 print-level)))
     (print-fn " Expected:" (pretty-str expected (+ 5 print-level))))


dorun is more appropriate than doall

dorun is more appropriate than doall

--- src/vip/data_processor/validation/xml.clj
+++ src/vip/data_processor/validation/xml.clj
@@ -238,13 +238,14 @@
   (let [xml-file (first (:input ctx))
         import-id (:import-id ctx)]
     (with-open [reader (util/bom-safe-reader xml-file)]
-      (doall (pmap insert
-                   (->> reader
-                        xml/parse
-                        path-and-values
-                        (partition 5000 5000 '())
-                        (map (fn [chunk]
-                               (map (partial paths->ltree import-id) chunk)))))))
+      (dorun
+       (pmap insert
+             (->> reader
+                  xml/parse
+                  path-and-values
+                  (partition 5000 5000 '())
+                  (map (fn [chunk]
+                         (map (partial paths->ltree import-id) chunk)))))))
     ctx))

 (defn determine-spec-version [ctx]


typical-slurry-rate uses slurry-rate-as

typical-slurry-rate uses slurry-rate-as

--- src/test_utils/fracture_diagnostics.cljc
+++ src/test_utils/fracture_diagnostics.cljc
@@ -56,8 +56,6 @@
                    [:m :ft]                   #(* % (factors [:m :ft]))
                    [:kg :lb]                  #(* % (factors [:kg :lb]))
                    [:lb :kg]                  #(/ % (factors [:kg :lb]))
-                   [:m3-per-min :bpm]         #(* % (factors [:m3 :bbl]))
-                   [:bpm :m3-per-min]         #(/ % (factors [:bbl :m3]))
                    [:F :C]                    #(/ (- % 32) 1.8)
                    [:C :F]                    #(+ (* % 1.8) 32)
                    [:bbl :m3]                 #(/ % (factors [:m3 :bbl]))
@@ -423,15 +421,12 @@

 (defn typical-slurry-rate
   ([]
-   (let [unit (rand-slurry-rate-unit)]
-     (typical-slurry-rate unit)))
-  ([unit]
-   (let [typical-value (cond (= unit :bpm)
-                             (value-from-typical-range 75 100)
-                             (or (= unit :m3-per-min)
-                                 (= unit :m3/min))
-                             (value-from-typical-range 11.92 15.9))]
-     [typical-value unit])))
+   (let [slurry-rate-unit (rand-slurry-rate-unit)]
+     (typical-slurry-rate slurry-rate-unit)))
+  ([slurry-rate-unit]
+   (condp = slurry-rate-unit
+     :bpm (make-measurement (value-from-typical-range 75 100) :bpm)
+     :m3-per-min (slurry-rate-as (typical-slurry-rate :bpm) :m3-per-min))))

 (defn slurry-rate-seq [arg]
   (cond (int? arg)


Add defassert, defcontext, deftest, defsuite

--- lazytest.clj
+++ lazytest.clj
@@ -64,6 +64,20 @@
 (defmacro assertion [locals & body]
   (format-assertion (Assertion locals `(do ~@body))))

+(defmacro defassert
+  "Defines an Assertion.
+  decl => docstring? [locals*] body*"
+  [name & decl]
+  (let [m {:name name}
+        m (if (string? (first decl)) (assoc m :doc (first decl)) m)
+        decl (if (string? (first decl)) (next decl) decl)
+        argv (first decl)
+        m (assoc m :locals argv)
+        body (next decl)]
+    (assert (vector? argv))
+    `(def ~name (with-meta (assertion ~argv ~@body)
+                  '~m))))
+

 ;;; CONTEXT HANDLING

@@ -84,6 +98,21 @@
       (apply f (active c) states))
     (let [active (reduce close-context active (:parents c))]
       (dissoc active c))))
+
+(defmacro defcontext
+  "Defines a context.
+  decl => docstring? [parents*] before-fn after-fn?"
+  [name & decl]
+  (let [m {:name name}
+        m (if (string? (first decl)) (assoc m :doc (first decl)) m)
+        decl (if (string? (first decl)) (next decl) decl)
+        parents (first decl)
+        m (assoc m :locals parents)
+        before (next decl)
+        after (next decl)]
+    (assert (vector? parents))
+    `(def ~name (with-meta (Context ~parents ~before ~after)
+                  '~m))))

 ;;; TEST CASE HANDLING
@@ -125,7 +154,48 @@
                                  (reverse (:contexts t))))))
         (TestResult t results))
       (catch Throwable e (TestThrown t e)))))
-
+
+(defmacro deftest
+  "Defines a test case containing assertions that share the same contexts.
+  decl => docstring? [binding*] assertion*
+  binding => symbol context
+  assertion => docstring? expression"
+  [name & decl]
+  (let [m {:name name}
+        m (if (string? (first decl)) (assoc m :doc (first decl)) m)
+        decl (if (string? (first decl)) (next decl) decl)
+        bindings (first decl)
+        assertions (next decl)]
+    (assert (vector? bindings))
+    (assert (even? (count bindings)))
+    (let [locals (vec (map first (partition 2 bindings)))
+          contexts (vec (map second (partition 2 bindings)))]
+      (assert (every? symbol locals))
+      `(def ~name
+            (with-meta (TestCase ~contexts
+                                 ~(loop [r [], as assertions]
+                                    (if (seq as)
+                                      (if (string? (first as))
+                                        (recur (conj r `(with-meta (assertion ~locals ~(next as))
+                                                          {:doc ~(first as)}))
+                                               (nnext as))
+                                        (recur (conj r `(assertion ~locals ~(first as))) (next as)))
+                                      r)))
+              '~m)))))
+
+(defmacro defsuite
+  "Defines a test suite containing other test cases or suites.
+  decl => docstring? [context*] children*"
+  [name & decl]
+  (let [m {:name name}
+        m (if (string? (first decl)) (assoc m :doc (first decl)) m)
+        decl (if (string? (first decl)) (next decl) decl)
+        contexts (first decl)
+        children (next decl)]
+    (assert (vector? contexts))
+    `(def ~name (with-meta (TestCase ~contexts ~(vec children))
+                  '~m))))
+

 ;;; TEST RESULT HANDLING

@@ -281,3 +351,46 @@
     (assert (= @*log* [:c6-open]))
     (dorun (result-seq results))
     (assert (= @*log* [:c6-open :a3 :a4 :a3 :a4]))))
+
+;; defassert form
+(defassert a5 "Assertion a5" [a b]
+  (comment "stuff")
+  (< a b))
+
+(assert (fn? a5))
+(assert (= 'a5 (:name (meta a5))))
+(assert (= "Assertion a5" (:doc (meta a5))))
+(assert (= ::AssertionPassed (type (a5 1 2))))
+(assert (= ::AssertionFailed (type (a5 2 1))))
+(assert (= ::AssertionThrown (type (a5 "a" "b"))))
+
+;; defcontext form
+(defcontext c7 "Context c7" [c5] (fn [s5] 7) (fn [s7 s5] nil))
+(assert (= ::Context (type c7)))
+(assert (= 'c7 (:name (meta c7))))
+(assert (= "Context c7" (:doc (meta c7))))
+(assert (= [c5] (:parents c7)))
+
+;; deftest form
+(deftest t10 "Test t10"
+  [a c4, b c5]
+  (= a b)
+  "a is less than b"
+  (< a b))
+
+(assert (= 't10 (:name (meta t10))))
+(assert (= "Test t10" (:doc (meta t10))))
+(assert (= ::TestCase (type t10)))
+(assert (= [c4 c5] (:contexts t10)))
+(assert (every? fn? (:children t10)))
+(assert (= "a is less than b"
+           (:doc (meta (second (:children t10))))))
+
+;; defsuite form
+(defsuite t11 "Suite t11" [c4 c5] t9 t10)
+
+(assert (= 't11 (:name (meta t11))))
+(assert (= "Suite t11" (:doc (meta t11))))
+(assert (= ::TestCase (type t11)))
+(assert (= [c4 c5] (:contexts t11)))
+(assert (= [t9 t10] (:children t11)))


fix AOT warning

fix AOT warning

--- example/project.clj
+++ example/project.clj
@@ -8,4 +8,5 @@
                  [clj-pid "0.1.1"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]]

-  :main ^:skip-aot example.core)
+  :main example.core
+  :aot [example.core])


double-valued constant generators

double-valued constant generators

--- src/main/clojure/zana/stats/statistics.clj
+++ src/main/clojure/zana/stats/statistics.clj
@@ -1,7 +1,7 @@
 (set! *warn-on-reflection* true)
 (set! *unchecked-math* :warn-on-boxed)
 (ns ^{:author "wahpenayo at gmail dot com"
-      :date "2018-01-29"
+      :date "2018-02-08"
       :doc "Stats that don't have an obvious home." }

     zana.stats.statistics
@@ -66,14 +66,18 @@
             t))))))
 ;;----------------------------------------------------------------
 ;; TODO: move to function namespace
+
 (defn constantly-0d
   "An instance of clojure.lang.IFn$OD that returns a primitve
   double 0.0, regardless of input."
-  ^double [arg] 0.0)
+  (^double [] 0.0)
+  (^double [arg] 0.0))
+
 (defn constantly-1d
   "An instance of clojure.lang.IFn$OD that returns a primitve
   double 1.0, regardless of input."
-  ^double [arg] 1.0)
+  (^double [] 1.0)
+  (^double [arg] 1.0))
 ;;----------------------------------------------------------------
 (defn- singular-longs? [^clojure.lang.IFn$OL z ^Iterable data]
   (let [it (g/iterator data)]