Removed extra check in apply tests to eliminate compiler warnings. Refs #11

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -2927,36 +2927,36 @@
         single-arity-variadic-fixedargs (fn [x y & more] [more y x])
         single-arity-variadic-nofixedargs (fn [& more] more)
         multiple-arity-variadic (fn ([x] x) ([x y] [y x]) ([x y & more] [more y x]))]
-    (assert (= [3 2 1] (single-arity-non-variadic 1 2 3) (apply single-arity-non-variadic [1 2 3])))
-    (assert (= [3 2 1] (single-arity-non-variadic 1 2 3) (apply single-arity-non-variadic 1 [2 3])))
-    (assert (= [3 2 1] (single-arity-non-variadic 1 2 3) (apply single-arity-non-variadic 1 2 [3])))
-    (assert (= 42 (multiple-arity-non-variadic 42) (apply multiple-arity-non-variadic [42])))
-    (assert (= [2 1] (multiple-arity-non-variadic 1 2) (apply multiple-arity-non-variadic [1 2])))
-    (assert (= [2 1] (multiple-arity-non-variadic 1 2) (apply multiple-arity-non-variadic 1 [2])))
-    (assert (= [3 2 1] (multiple-arity-non-variadic 1 2 3) (apply multiple-arity-non-variadic [1 2 3])))
-    (assert (= [3 2 1] (multiple-arity-non-variadic 1 2 3) (apply multiple-arity-non-variadic 1 [2 3])))
-    (assert (= [3 2 1] (multiple-arity-non-variadic 1 2 3) (apply multiple-arity-non-variadic 1 2 [3])))
-    (assert (= [[3 4 5] 2 1] (single-arity-variadic-fixedargs 1 2 3 4 5) (apply single-arity-variadic-fixedargs [1 2 3 4 5])))
-    (assert (= [[3 4 5] 2 1] (single-arity-variadic-fixedargs 1 2 3 4 5) (apply single-arity-variadic-fixedargs 1 [2 3 4 5])))
-    (assert (= [[3 4 5] 2 1] (single-arity-variadic-fixedargs 1 2 3 4 5) (apply single-arity-variadic-fixedargs 1 2 [3 4 5])))
-    (assert (= [[3 4 5] 2 1] (single-arity-variadic-fixedargs 1 2 3 4 5) (apply single-arity-variadic-fixedargs 1 2 3 [4 5])))
-    (assert (= [[3 4 5] 2 1] (single-arity-variadic-fixedargs 1 2 3 4 5) (apply single-arity-variadic-fixedargs 1 2 3 4 [5])))
+    (assert (= [3 2 1] (apply single-arity-non-variadic [1 2 3])))
+    (assert (= [3 2 1] (apply single-arity-non-variadic 1 [2 3])))
+    (assert (= [3 2 1] (apply single-arity-non-variadic 1 2 [3])))
+    (assert (= 42 (apply multiple-arity-non-variadic [42])))
+    (assert (= [2 1] (apply multiple-arity-non-variadic [1 2])))
+    (assert (= [2 1] (apply multiple-arity-non-variadic 1 [2])))
+    (assert (= [3 2 1] (apply multiple-arity-non-variadic [1 2 3])))
+    (assert (= [3 2 1] (apply multiple-arity-non-variadic 1 [2 3])))
+    (assert (= [3 2 1] (apply multiple-arity-non-variadic 1 2 [3])))
+    (assert (= [[3 4 5] 2 1] (apply single-arity-variadic-fixedargs [1 2 3 4 5])))
+    (assert (= [[3 4 5] 2 1] (apply single-arity-variadic-fixedargs 1 [2 3 4 5])))
+    (assert (= [[3 4 5] 2 1] (apply single-arity-variadic-fixedargs 1 2 [3 4 5])))
+    (assert (= [[3 4 5] 2 1] (apply single-arity-variadic-fixedargs 1 2 3 [4 5])))
+    (assert (= [[3 4 5] 2 1] (apply single-arity-variadic-fixedargs 1 2 3 4 [5])))
     (assert (= [3 4 5] (take 3 (first (apply single-arity-variadic-fixedargs (iterate inc 1))))))
     (assert (= [2 1] (rest (apply single-arity-variadic-fixedargs (iterate inc 1)))))
-    (assert (= [1 2 3 4 5] (single-arity-variadic-nofixedargs 1 2 3 4 5) (apply single-arity-variadic-nofixedargs [1 2 3 4 5])))
-    (assert (= [1 2 3 4 5] (single-arity-variadic-nofixedargs 1 2 3 4 5) (apply single-arity-variadic-nofixedargs 1 [2 3 4 5])))
-    (assert (= [1 2 3 4 5] (single-arity-variadic-nofixedargs 1 2 3 4 5) (apply single-arity-variadic-nofixedargs 1 2 [3 4 5])))
-    (assert (= [1 2 3 4 5] (single-arity-variadic-nofixedargs 1 2 3 4 5) (apply single-arity-variadic-nofixedargs 1 2 3 [4 5])))
-    (assert (= [1 2 3 4 5] (single-arity-variadic-nofixedargs 1 2 3 4 5) (apply single-arity-variadic-nofixedargs 1 2 3 4 [5])))
+    (assert (= [1 2 3 4 5] (apply single-arity-variadic-nofixedargs [1 2 3 4 5])))
+    (assert (= [1 2 3 4 5] (apply single-arity-variadic-nofixedargs 1 [2 3 4 5])))
+    (assert (= [1 2 3 4 5] (apply single-arity-variadic-nofixedargs 1 2 [3 4 5])))
+    (assert (= [1 2 3 4 5] (apply single-arity-variadic-nofixedargs 1 2 3 [4 5])))
+    (assert (= [1 2 3 4 5] (apply single-arity-variadic-nofixedargs 1 2 3 4 [5])))
     (assert (= [1 2 3 4 5] (take 5 (apply single-arity-variadic-nofixedargs (iterate inc 1)))))
-    (assert (= 42 (multiple-arity-variadic 42) (apply multiple-arity-variadic [42])))
-    (assert (= [2 1] (multiple-arity-variadic 1 2) (apply multiple-arity-variadic [1 2])))
-    (assert (= [2 1] (multiple-arity-variadic 1 2) (apply multiple-arity-variadic 1 [2])))
-    (assert (= [[3 4 5] 2 1] (multiple-arity-variadic 1 2 3 4 5) (apply multiple-arity-variadic [1 2 3 4 5])))
-    (assert (= [[3 4 5] 2 1] (multiple-arity-variadic 1 2 3 4 5) (apply multiple-arity-variadic 1 [2 3 4 5])))
-    (assert (= [[3 4 5] 2 1] (multiple-arity-variadic 1 2 3 4 5) (apply multiple-arity-variadic 1 2 [3 4 5])))
-    (assert (= [[3 4 5] 2 1] (multiple-arity-variadic 1 2 3 4 5) (apply multiple-arity-variadic 1 2 3 [4 5])))
-    (assert (= [[3 4 5] 2 1] (multiple-arity-variadic 1 2 3 4 5) (apply multiple-arity-variadic 1 2 3 4 [5])))
+    (assert (= 42 (apply multiple-arity-variadic [42])))
+    (assert (= [2 1] (apply multiple-arity-variadic [1 2])))
+    (assert (= [2 1] (apply multiple-arity-variadic 1 [2])))
+    (assert (= [[3 4 5] 2 1] (apply multiple-arity-variadic [1 2 3 4 5])))
+    (assert (= [[3 4 5] 2 1] (apply multiple-arity-variadic 1 [2 3 4 5])))
+    (assert (= [[3 4 5] 2 1] (apply multiple-arity-variadic 1 2 [3 4 5])))
+    (assert (= [[3 4 5] 2 1] (apply multiple-arity-variadic 1 2 3 [4 5])))
+    (assert (= [[3 4 5] 2 1] (apply multiple-arity-variadic 1 2 3 4 [5])))
     (assert (= [3 4 5] (take 3 (first (apply multiple-arity-variadic (iterate inc 1))))))
     (assert (= [2 1] (rest (apply multiple-arity-variadic (iterate inc 1))))))
   (let [a (atom 0)]


select-keys did not preserve metadata

select-keys did not preserve metadata

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -7087,7 +7087,7 @@
              (assoc ret key entry)
              ret)
            (next keys)))
-        ret)))
+        (with-meta ret (meta map)))))

 ;;; PersistentHashSet


reagent not needed

reagent not needed

--- src/cljs/ufo/views.cljs
+++ src/cljs/ufo/views.cljs
@@ -1,6 +1,5 @@
 (ns ufo.views
-  (:require [re-frame.core :as re-frame]
-            [reagent.core :as reagent]))
+  (:require [re-frame.core :as re-frame]))

 (enable-console-print!)


bug #5243 - using correct error code for image picker compononent

Signed-off-by: Goran Jovic <fc686822162e6f379ea05b6f92d78d206147085c@gmail.com>

--- components/src/status_im/ui/components/react.cljs
+++ components/src/status_im/ui/components/react.cljs
@@ -136,7 +136,7 @@
 (def image-picker-class js-dependencies/image-crop-picker)

 (defn show-access-error [o]
-  (when (= "ERROR_PICKER_UNAUTHORIZED_KEY" (object/get o "code")) ; Do not show error when user cancel selection
+  (when (= "E_PERMISSION_MISSING" (object/get o "code"))
     (utils/show-popup (i18n/label :t/error)
                       (i18n/label :t/photos-access-error))))


Allow the WebServer component to be restarted

Dissoc-ing one of the defined fields of a record returns a regular
Clojure map instead of a record instance. Due to this the WebServer
cannot be started again once it is stopped. Setting the field to nil
preserves the type.

--- src/edge/web_server.clj
+++ src/edge/web_server.clj
@@ -98,7 +98,7 @@
   (stop [component]
     (when-let [close (get-in component [:listener :close])]
       (close))
-    (dissoc component :listener)))
+    (assoc component :listener nil)))

 (defn new-web-server []
   (using


Releasing fix

Releasing fix

--- modules/bidi/project.clj
+++ modules/bidi/project.clj
@@ -1,6 +1,6 @@
 ;; Copyright © 2014 JUXT LTD.

-(defproject juxt.modular/bidi "0.7.3"
+(defproject juxt.modular/bidi "0.7.4"
   :description "A modular extension that provides support for bidi routing"
   :url "https://github.com/juxt/modular/tree/master/modules/bidi"
   :license {:name "The MIT License"


Updated to latest version of bidi

Updated to latest version of bidi

--- modules/bidi/project.clj
+++ modules/bidi/project.clj
@@ -6,7 +6,7 @@
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
   :dependencies [[com.stuartsierra/component "0.2.1"]
-                 [bidi "1.10.3"]
+                 [bidi "1.11.0"]
                  [juxt.modular/ring "0.5.1"]
                  [prismatic/schema "0.2.1"]
                  [prismatic/plumbing "0.2.2"]]


Fix indentation in latest_games.clj

Fix indentation in latest_games.clj

--- src/nhl_score_api/fetchers/mlbam/latest_games.clj
+++ src/nhl_score_api/fetchers/mlbam/latest_games.clj
@@ -16,7 +16,7 @@
 (defn- get-started-games [games]
   (filter #(or (= "Final" (get-game-state %))
                (= "Live" (get-game-state %)))
-               games))
+          games))

 (defn- get-date-and-started-games [date-and-games]
   {:date (get-date (:date date-and-games))


toggle button to read 'stop' on shift key press

--- src/metronome/core.cljs
+++ src/metronome/core.cljs
@@ -9,7 +9,8 @@
     (enable-console-print!)))

 (defonce app-state (atom {:bpm {}
-                          :meter {:count 0}}))
+                          :meter {:count 0}
+                          :should-stop false}))

 (defn clock [bpm owner]
   (letfn [(start-interval [millis]
@@ -79,7 +80,7 @@

 (defn millis [] (.now js/performance))

-(defn click [_ owner]
+(defn click [app owner]
   (reify
     om/IInitState
     (init-state [_] {:previous-click nil})
@@ -91,7 +92,7 @@
                                                 (om/set-state! owner :previous-click m)
                                                 (when-not (nil? previous-click)
                                                   (put! click-channel (- m previous-click)))))}
-                              "tap tempo"))))
+                              (if (:should-stop app) "stop" "tap tempo")))))

 (defn dots [meter owner]
   (reify
@@ -108,6 +109,17 @@
                  (dot 3)
                  (dot 0))))))

+(defn keylistener [app owner]
+  (reify
+    om/IDidMount
+    (did-mount [_]
+      (let [f (fn [e] (when (= "Shift" (.-key e)) (om/update! app :should-stop (= "keydown" (.-type e)))))]
+        (.addEventListener js/document "keydown" f)
+        (.addEventListener js/document "keyup" f)))
+
+    om/IRender
+    (render [_] (dom/div nil))))
+
 (om/root
  (fn [app owner]
    (reify
@@ -121,8 +133,9 @@
                (dom/h1 nil "metronome")
                (om/build clock (:bpm app) {:init-state {:sound-channel sound-channel :click-channel click-channel}})
                (om/build sound (:meter app) {:init-state {:sound-channel sound-channel}})
-               (om/build click nil {:init-state {:click-channel click-channel}})
-               (om/build dots (:meter app)))
+               (om/build click app {:init-state {:click-channel click-channel}})
+               (om/build dots (:meter app))
+               (om/build keylistener app))
       )))
  app-state
  {:target (. js/document (getElementById "app"))})


Shows queries in admin view

Shows queries in admin view

Shows queries in admin view

--- src/webapp/framework/client/components/admin.cljs
+++ src/webapp/framework/client/components/admin.cljs
@@ -6,6 +6,7 @@
 	(:use
 		[webapp.framework.client.system-globals  :only  [
 																										 data-views-v2
+																										 data-queries-v2
 																										 ]])
    )

@@ -154,8 +155,11 @@
 (c/defn-ui-component     admin-view-list-views   [data-sources]

   (c/div nil
+				 (c/h2 nil "Views")
 		 (c/map-many
-		  #(c/div nil  (pr-str (get  % :fields) (get  % :db-table) (get  % :where) (get  % :params) ))
+		  #(c/div
+				{:onClick (fn[x] (js/alert (pr-str (get  @data-views-v2 %))))}
+		      (pr-str (get  % :fields) (get  % :db-table) (get  % :where) (get  % :params) ))
 		     ;(c/read-ui data-sources [:values])
 		     ;["s" "dd"]
 			(keys @data-views-v2)
@@ -164,7 +168,19 @@

-
+(c/defn-ui-component     admin-view-list-queries   [data-sources]
+
+												 (c/div nil
+																(c/h2 nil "Queries")
+																(c/map-many
+																	#(c/div
+																		{:onClick (fn[x] (js/alert (pr-str (get  @data-queries-v2 %))))}
+																		(pr-str %   ))
+																	;(c/read-ui data-sources [:values])
+																	;["s" "dd"]
+																	(keys @data-queries-v2)
+																	)
+																))

@@ -189,6 +205,14 @@
 												(c/write-ui  app [:system :ui :tab-detail :value] {})
 									 )
 						 } "views"))
+
+			(c/inline "50px" (c/div {:style {:fontSize "12px"}
+															 :onClick #(do
+																					(c/write-ui  app [:system :ui :tab :value] "data queries")
+																					(c/write-ui  app [:system :ui :tab-detail :value] {})
+																					)
+															 } "queries"))
+
 		  )

@@ -201,6 +225,9 @@
 		  (= (c/read-ui  app [:system :ui :tab :value]) "data views")
 		  (c/component  admin-view-list-views  app  [:system :ui :data-sources])

+
+			(= (c/read-ui  app [:system :ui :tab :value]) "data queries")
+			(c/component  admin-view-list-queries  app  [:system :ui :data-sources])
 		  )
 		 ))


Fix counter-related tests

Fix counter-related tests

--- test/clojure/clojurewerkz/cassaforte/cql_test.clj
+++ test/clojure/clojurewerkz/cassaforte/cql_test.clj
@@ -65,7 +65,6 @@
                [=  :created_at (uuids/start-of (cc/to-long (date-time 2014 11 13 12)))]]]
       (testing "Bulk update"
         (truncate s t)
-        (println (perform-count s t))
         (is (= 0 (perform-count s t)))
         (doseq [i  (range 1 15)]
           (let [dt (date-time 2014 11 i 12)
@@ -118,20 +117,52 @@
               (using {:ttl (int 2)})))
     (is (= 3 (perform-count s :users)))
     (Thread/sleep 2100)
-    (is (= 0 (perform-count s :users)))))
-
-
-;; (deftest test-counter
-;;   (update s :user_counters {:user_count (increment-by 5)} (where {:name "user1"}))
-;;   (is (= 5 (:user_count (first (select s :user_counters)))))
-;;   (update s :user_counters {:user_count (decrement-by 5)} (where {:name "user1"}))
-;;   (is (= 0 (:user_count (first (select s :user_counters)))))
-;;   (update s :user_counters {:user_count [+ 500]} (where {:name "user1"}))
-;;   (is (= 500 (:user_count (first (select s :user_counters)))))
-;;   (update s :user_counters {:user_count [+ 5000000]} (where {:name "user1"}))
-;;   (is (= 5000500 (:user_count (first (select s :user_counters)))))
-;;   (update s :user_counters {:user_count [+ 50000000000000]} (where {:name "user1"}))
-;;   (is (= 50000005000500 (:user_count (first (select s :user_counters))))))
+    (is (= 0 (perform-count s :users))))
+
+
+  (deftest test-counter
+    (testing "Increment by"
+        (update s :user_counters
+                {:user_count (new-query-api/increment-by 5)}
+                (where {:name "user1"}))
+
+      (is (= 5 (-> (select s :user_counters)
+                   first
+                   :user_count))))
+
+    (testing "Decrement by"
+      (update s :user_counters
+              {:user_count (new-query-api/decrement-by 5)}
+              (where {:name "user1"}))
+
+      (is (= 0 (-> (select s :user_counters)
+                   first
+                   :user_count))))
+
+    (testing "Increment with explicit params"
+      (update s :user_counters
+              {:user_count (new-query-api/increment-by 500)}
+              (where {:name "user1"}))
+      (is (= 500 (-> (select s :user_counters)
+                     first
+                     :user_count))))
+
+    (testing "Decrement with explicit params"
+      (update s :user_counters
+              {:user_count (new-query-api/increment-by 5000000)}
+              (where {:name "user1"}))
+      (is (= 5000500 (-> (select s :user_counters)
+                         first
+                         :user_count))))
+
+    (testing "Increment with a large number"
+      (update s :user_counters
+              {:user_count (new-query-api/increment-by 50000000000000)}
+              (where {:name "user1"}))
+      (is (= 50000005000500 (-> s
+                                (select :user_counters)
+                                first
+                                :user_count))))))

 ;; (deftest test-counter-2
 ;;   (dotimes [i 100]


RS & AB | #0 | ENABLE_HTTPS_ONLY take 2

RS & AB | #0 | ENABLE_HTTPS_ONLY take 2

--- src/objective8/core.clj
+++ src/objective8/core.clj
@@ -104,7 +104,7 @@
       (wrap-frame-options :sameorigin)

       (#(if (config/get-var "ENABLE_HTTPS_ONLY")
-          (-> % wrap-ssl-redirect wrap-hsts)
+          (-> % wrap-ssl-redirect)
           %))))

 (defonce server (atom nil))


whitespace

whitespace

--- src/ontrail/summary.clj
+++ src/ontrail/summary.clj
@@ -75,7 +75,6 @@
         year-month-cond {:creationDate {:$gte first-day :$lte last-day}}]
     (assoc (get-overall-summary-cond user year-month-cond) :year year :month month)))

-
 (defn get-overall-summary [user]
   (.trace logger (str "Getting overall summary: " user))
   (get-overall-summary-cond user {}))


Update content.cljs

Update content.cljs

Christina (after a tasty lunch)
SECTION "understanding the predicted range"
1. updated and simplified description for Answer 1. No longer need "unforseen factors" glossary so tried to remove.
2. simplified long answer and tried to add glossary for unforeseen factors...
3. Have completely changed this around, since i don't think it was answering the question. Have added in 3 links to other FAQs. I've removed the picture since i don't think it helps.
4. Have tried to simplify this a lot and i removed the figures since i don't they work. Ive removed unforeseen factors glossary as it's not used. Have added something about move from 14 to 13 hospitals and corrected to 13 in the text.
5. have changed the title to below (since this is accurate). and tightened up... And removed the picture. IF qudos come up with something good for short animation, then we can maybe use that... I removed the glossary since the term isn't used but added in glossary for survival rate. I've also reordered bits.
6. minor tweaks

Limitations:
have removed glossary for risk adjustment

My family or child section:
1. have simplified a bit and added 2 links and changed 1.
2. No changes (!)
3. Have added some intro text and added more info to the charity titles (too much for a link do you think?) and have also reordered to be an alphabetical list.

ABOUT US

Have updated a bit... Once this version is published I'll send to others for their comments... see if you're happy with what I've said about you! have added a contact email at the bottom. Do you think I need to say more?!

How we developed this site: have written a whole bunch. see what you think...

--- src/prais2/content.cljs
+++ src/prais2/content.cljs
@@ -248,27 +248,28 @@

 (def unassoc-charity-list
   [
-   [:a {:href "www.chfed.org.uk"} "Children’s heart federation"]
-   [:a {:href "www.tinytickers.org"} "TINY TICKERS"]
-   [:a {:href "www.dhg.org.uk"} "DOWNS HEART GROUP"]
-   [:a {:href "www.patchesheartgroup.org"} "PATCHES HEART GROUP"]
-   [:a {:href "www.lagans.org.uk"} "LAGAN’S FOUNDATION"]
-   [:a {:href "www.lhm.org.uk"} "LITTLE HEARTS MATTER"]
-   [:a {:href "www.thesf.org.uk"} "SOMERVILLE FOUNDATION"]
-   [:a {:href "www.bhf.org.uk"} "BRITISH HEART FOUNDATION"]
-   [:a {:href "www.maxappeal.org.uk"} "MAX APPEAL"]
-   [:a {:href "www.heartline.org.uk"} "HEARTLINE FAMILIES"]
-   [:a {:href "www.younghearts.org.uk"} "YOUNG HEARTS"]
-   [:a {:href "www.heartrhythmcharity.org.uk"} "ARRHYTHMIA ALLIANCE"]
-   [:a {:href "www.c-r-y.org.uk"} "CRY – Cardiac Risk in the Young"]
-   [:a {:href "www.arc-uk.org"} "ARC – Antenatal Results and Choices"]
-   [:a {:href "www.benwilliamstrust.org.uk"} "BEN WILLIAMS TRUST"]
-   [:a {:href "www.cardiomyopathy.org"} "CARDIOMYOPATHY UK"]
-   [:a {:href "www.heartchild.info"} "CHILDREN’S HEART ASSOCIATION"]
-   [:a {:href "www.chd-uk.co.uk"} "CHD-UK Congenital Heart Defects UK"]
-   [:a {:href "www.amelia-matters.org.uk"} "AMELIA MATTERS"]
-   [:a {:href "www.cafamily.org.uk"} "CONTACT A FAMILY"]
-   [:a {:href "www.22crew.org"} "THE22CREW"]
+   [:a {:href "www.amelia-matters.org.uk"} "Amelia Matters: supporting children born with congenital heart disease."]
+   [:a {:href "www.arc-uk.org"} "Antenatal Results and Choices (ARC): helping parents and healthcare professionals through antenatal screening and its consequences"]
+   [:a {:href "www.heartrhythmcharity.org.uk"} "Arrhythmia Alliance: improving the diagnosis, treatment and quality of life for all those affected by arrhythmias."]
+   [:a {:href "www.benwilliamstrust.org.uk"} "Ben Williams Trust: supports children with abnormal heart rhythms (arrhythmias) and their families "]
+   [:a {:href "www.bhf.org.uk"} "British Heart Foundation: working to fight against cardiovascular disease."]
+   [:a {:href "www.c-r-y.org.uk"} "Cardiac Risk in the Young (CRY): preventing young sudden cardiac deaths through awareness, screening and research, and supporting affected families."]
+   [:a {:href "www.cardiomyopathy.org"} "Cardiomyopathy UK: providing support to patients and families and promoting research for the disease cardiomyopathy"]
+   [:a {:href "www.heartchild.info"} "Children’s Heart Association: supporting families of children with a heart condition."]
+   [:a {:href "www.chfed.org.uk"} "Children’s Heart Federation: the main umbrella body for British congenital heart disease charities and voluntary organisations."]
+   [:a {:href "www.chd-uk.co.uk"} "Congenital Heart Defects UK: educating and raising awareness of congenital heart defects and supporting patients and families."]
+   [:a {:href "www.cafamily.org.uk"} "Contact a family: a national charity for families with disabled children, providing information, advice and support."]
+   [:a {:href "www.dhg.org.uk"} "Down’s Heart Group: a charity offering support and information relating to heart conditions associated with Down's Syndrome."]
+   [:a {:href "www.heartline.org.uk"} "Heartline: supports children with heart disorders and their families, whatever the condition wherever it is treated"]
+    [:a {:href "www.lagans.org.uk"} "Lagan’s Foundation: offers home respite and support services for young children with heart defects or feeding issues."]
+   [:a {:href "www.lhm.org.uk"} "Little Hearts Matter: offers support and information, and raises awareness of those affected when a child has only half a heart."]
+    [:a {:href "www.maxappeal.org.uk"} "Max Appeal: Supports families affected by DiGeorge syndrome, VCFS and 22q11.2 deletion."]
+    [:a {:href "www.younghearts.org.uk"} "Oxford Young Hearts:  support children with heart conditions and their families in the counties served by the Oxford University Hospitals NHS Trust. "]
+   [:a {:href "www.patchesheartgroup.org"} "Patches Heart Group: a support group for children with congenital heart defects / aquired heart conditions and their families in the community."]
+    [:a {:href "www.youngheart.info"} "The Scottish Association for Children with Heart Disorders (SACHD): supports children and young adults with congenital heart disorders, and the families in Scotland."]
+   [:a {:href "www.thesf.org.uk"} "Somerville Foundation: supports young people and adults born with a heart condition."]
+    [:a {:href "www.22crew.org"} "The 22 Crew:  A charity providing resources for patients with 22q deletion and their families."]
+   [:a {:href "www.tinytickers.org"} "Tiny tickers: improving the detection, care and treatment of babies with serious heart conditions"]
    ])

 (rum/defc render-charity-list []
@@ -357,7 +358,7 @@
                                                     {:style {:width        "100px"
                                                              :margin-right "20px"}
                                                      :src   "assets/nicor.png"}]]
-                                               "Until 2013, the national audit body " [:a {:href "http://www.ucl.ac.uk/nicor/patients"} "NICOR"] " only published survival rates for certain types of procedure because there was no clear way to put overall survival rates for each hospital into context (see " [:a {:href "?#/intro"} "What, Why and How?"] "). But " [:a {:href "https://www.ucl.ac.uk/operational-research/AnalysisTools/PRAiS"} "researchers"] " have now made this possible by creating a statistical formula. Using this formula, NICOR has published overall survival rates along with the predicted range and extended predicted range for survival over the previous 3 years for each hospital since 2013 (see " [:a {:href "?#/intro"} "What, Why and How?"] ").  The predicted range is the range in which we expect to see each hospital’s survival rate the majority of the time (19 times out of 20 for the dark blue bar, 998 times out of 1000 for the light blue bar). "
+                                               "Until 2013, the national audit body " [:a {:href "http://www.ucl.ac.uk/nicor/patients"} "NICOR"] " only published survival rates for certain types of procedure (MIKE LINK EXTERNAL - SEE WORD DOC) because there was no clear way to put overall survival rates for each hospital into context (see " [:a {:href "?#/intro"} "What, Why and How?"] "). But " [:a {:href "https://www.ucl.ac.uk/operational-research/AnalysisTools/PRAiS"} "researchers"] " have now made this possible by creating a statistical formula. Using this formula, NICOR has published overall survival rates along with the predicted range and extended predicted range for survival over the previous 3 years for each hospital since 2013 (see " [:a {:href "?#/intro"} "What, Why and How?"] ").  The predicted range is the range in which we expect to see each hospital’s survival rate the majority of the time (19 times out of 20 for the dark blue bar, 998 times out of 1000 for the light blue bar). "

                                                ]
                                               [:p "The predicted range is calculated using the " [:strong "same"] " statistical formula for all hospitals and this prediction is " [:strong "not"] " influenced by what the survival rate at a hospital actually was."]
@@ -379,125 +380,110 @@

                    {:section "Understanding the predicted range"
                     :faqs    [{:title        "Why is a different survival range predicted for each hospital?"
-                               :short-answer "The predicted range depends on how complex were the medical problems of the children who had operations. Each hospital treats different children and so each hospital will have a different predicted range."
-                               :glossary     [:unforeseen-factors :survival-rate]
+                               :short-answer "The predicted range depends on the complexity of the medical problems of the children who had operations. Each hospital treats different children and so each hospital will have a different predicted range."
+                               :glossary     [:survival-rate]
                                :body         [:div
                                               [:p "Heart disease in children covers a wide range of disorders, from relatively minor to more serious conditions. This affects a child's chances of survival, as do other factors such as age, weight and other health problems."]

-                                              [:p "Some hospitals specialise in certain conditions that are particularly complicated, meaning they tend to operate on children with a lower chance of survival. It would therefore be unfair to expect all hospitals to have the same survival rates and it is not valid to simply compare hospitals' survival rates. Each hospital will also treat different children from year to year, so we expect any hospital’s survival rate to vary from year to year."]
-
-                                              [:p "The predicted range (dark blue bar) is where we expect the hospital’s survival rate to be 19 times out of 20."]
-
-                                              [:p "It is based on a formula that uses recorded information about each operation a hospital performed over a 3 year period. Since each hospital operated on different patients, the predicted ranges for each hospital will be different. This is why it is not valid to compare raw survival rates to each other. It is " [:i "only valid"] " to compare a hospital’s survival rate to its own predicted range. "]
+                                              [:p "Some hospitals take on more cases that are particularly complicated, meaning they tend to operate on children with a lower chance of survival. Each hospital will also treat different children from year to year, so we expect any hospital’s survival rate to vary from year to year. It would therefore be unfair to expect all hospitals to have the same survival rates and it is not valid to simply compare hospitals' survival rates. It is " [:i "only valid"] " to compare a hospital’s survival rate to its own predicted range."]
+
+

                                               (comment "*** POSSIBLE IMAGES ***** - a snapshot from animation from factors going into the formula/machine and coming out with a predicted range? ")
                                               ]
                                }

                               {:title        "Why does the width of the predicted range differ between hospitals?"
+                               :glossary     [:unforeseen-factors :survival-rate]
                                :short-answer "If a hospital does fewer operations, unforeseen factors have a bigger influence on its overall survival rate. This is why the predicted range is wider for hospitals that do fewer operations."
+
+                               :body         [:div
+                                              [:p "The predicted range for each hospital shows the range where we expect to see the observed survival rate if the hospital is performing as predicted by the formula, regardless of how many operations it did or what children it treated. When a hospital does fewer operations, unforeseen factors have a bigger influence on the overall outcome, and so it has a wider predicted range than a hospital that does many operations."]]
+
+                               }
+
+                              {:title        "When looking at just one hospital, what does it mean if its survival is outside its predicted range?"
+                               :short-answer "There are four possible reasons for being outside the predicted range: inaccurate data, a formula that for some reason doesn’t work well for that hospital, just by chance (1 time in 20), or the chances of survival at that hospital are different to what is predicted. "
                                :glossary     [:survival-rate]
                                :body         [:div
-                                              [:p "The predicted range (dark blue bar) for each hospital shows the range where we expect to see the observed survival rate 19 times out of 20 if the hospital is performing as predicted by the formula regardless of how many operations it did or what children it treated. When a hospital does fewer operations, unforeseen factors have a bigger influence on the overall outcome, and so it has a wider predicted range than a hospital that does many operations. "]]
-
-                               }
-
-                              {:title        "When looking at just one hospital, what does it mean if its survival is outside its predicted range?"
-                               :short-answer "There are four possible reasons for being outside the predicted range: inaccurate data, a risk model that for some reason doesn’t work well for that hospital, just by chance (1 time in 20), or the chances of survival at that hospital are different to what is predicted. "
+
+                                              [:p "Possible reasons for a hospital’s survival rate being outside its predicted range of survival:"]
+
+                                              [:h4 "1. Inaccurate data"]
+                                              [:p "Each hospital and the Office of National Statistics supply data on each child to the national audit body. Although the data submitted is of very high quality (MIKE LINK TO FAQ on DATA QUAL), there will always be some inaccuracies is such large datasets. If a hospital submits data where some of the data is very wrong (for instance wrong weights are recorded) or missing, then this will result in a wrong predicted range."]
+
+
+
+                                              [:h4 "2. The formula doesn’t work well for that hospital"]
+                                              [:p "The statistical formula is applied to all operations at that hospital to calculate its overall predicted range of survival. Although the formula as is as good as we can currently get it, it is not perfect (MIKE LINK TO FAQ on FORM QUAL (1st one)). There will always be unique features about a child that affect their chance of survival that are not captured by national data collection and so cannot be part of a formula (e.g. the size of a hole in the heart). We will never be able to capture the whole medical picture of a child in a single formula! That means that the predicted range is the best possible guess for what the predicted range should be. If a hospital happens to have operated on a lot of children with unique features that affect their chances of survival but are not captured by the formula, the predicted range might be unfairly high for that hospital."]
+
+
+                                              [:h4 "3. Chance"]
+                                              [:p "If the hospital’s data contains no errors and there’s no reason to think that the formula shouldn’t apply well to that hospital, then in 19 times out of 20, we’d expect to see a hospital’s overall survival range within the predicted range. The means that the hospital’s survival rate could be outside its predicted range just by chance (1 time in 20)."]
+
+                                              [:h4 "4. The chances of survival at that hospital are different to what are predicted by the formula."]
+                                              [:p "The chances of survival for children at the hospital could genuinely be much higher or lower than what is predicted, which would make it more likely that the hospital’s survival rate would lie outside its predicted range. The national audit process is intended to check that no hospital in the UK and Ireland has chances of survival much lower than predicted. See “What happens if a hospital’s survival is below its predicted range” to find out what happens in such situations. (MIKE LINK TO FAQ what happens if outside range) "]
+
+
+
+
+
+                                              ]
+
+                               }
+
+                              {:title        "When looking at ALL hospitals simultaneously, what does it mean if any of the hospitals have a survival rate outside their predicted range?"
+                               :short-answer "When looking at all 13 hospitals at once, we expect at least one hospital’s survival rate to be outside its predicted range about half the time."
                                :glossary     [:survival-rate]
                                :body         [:div
-                                              [:p "This is a difficult question and so the answer is a bit long!"]
-
-                                              [:p "There are three steps that lead to a hospital being outside its prediction range:"]
-
-                                              [:h4 "Step 1"]
-                                              [:p "Each hospital and the Office of National Statistics supply data on each child to NICOR"]
-
-                                              [:p [:i "Although the data submitted is usually of very high quality, there will always be some mistakes in large and complex datasets. If a hospital submits data where some of the data is very wrong (for instance wrong weights are recorded) or missing, then this will result in a wrong predicted range. "]]
-
-                                              [:h4 "Step 2"]
-                                              [:p "The statistical formula is then applied to all operations at that hospital to calculate its overall predicted range."]
-
-                                              [:p [:i "Although the statistical formula as is as good as we can currently get it, it is not perfect. There will always be unique features about a child that affect its chance of survival that are not captured by routine data collection and so cannot be part of a formula formula (e.g. the size of a hole in the heart). We will never be able to capture the whole medical picture of a child in a single formula! So, the predicted range is the best possible guess for what the predicted range should be and could be wrong."]]
-
-                                              [:h4 "Step 3"]
-                                              [:p "“What actually happened” for each child is then used to calculate the survival rate for that hospital and compared to the predicted range."]
-
-                                              [:p "If the hospital’s data contains no errors and there’s no reason to think that the formula shouldn’t apply well to that hospital, then , we consider there is some or strong evidence that the chances of survival at that hospital are not as predicted, if the survival rate is outside the predicted range"]
-
-                                              [:p "The strength of the evidence depends on where the survival rate is compared to the extended range. If it is outside the central predicted range (dark blue bar) but inside the extended range (light blue bar) (expected 998 out of a 1000 times) then this is considered moderate evidence. If the survival rate is outside the extended range (only expected to happen 2 times out of a 1000), then this is considered strong evidence. "]
-
-                                              [:.col-sm-8 [:img.thumbnail {:style {:width "100%"}
-                                                                           :src   "assets/bars.png"}]]
-
-                                              ]
-
-                               }
-
-                              {:title        "When looking at ALL hospitals simultaneously , what does it mean if any of the hospitals have an survival rate outside their predicted range?"
-                               :short-answer "When looking at all 14 hospitals at once, we expect at least one hospital’s survival rate to be outside its predicted range about 8 times in 20. "
-                               :glossary     [:unforeseen-factors :survival-rate]
-                               :body         [:div
-
-                                              [:p "If we were looking at only one hospital, we’d expect its survival rate to fall outside its predicted range rarely, only 1 time in 20 if chances of survival at the hospitals match the formula."]
-
-
-                                              [:.col-sm-8 [:img.thumbnail {:style {:width "100%"}
-                                                                           :src   "assets/rare.png"}]]
-
-                                              [:p "BUT, if we are looking at all 14 hospitals at once, we’d actually expect that at least one hospital will fall outside its range just by chance about 8 times in 20! This is similar to the situation where you hear a friend won a good prize in a raffle. This may be surprising, but it becomes a lot less surprising when you hear they bought 100 tickets. Just as this gave them more chances of winning, the more hospitals we look at, the more likely it becomes that at least one will fall outside its range, even if survival at all the hospitals matches the formula."]
-
-                                              [:p "8 times in 20 means that it is not that rare that " [:strong "any"] " one of these hospitals will have an survival rate that falls outside their predicted range. "]
-                                              [:.col-sm-8 [:img.thumbnail {:style {:width "100%"}
-                                                                           :src   "assets/not-rare.png"}]]
-
-                                              [:p "So, on average, we’d anticipate that about half (8/20) of NICOR’s annual reports to have at least one centre outside its range, either above or below, by chance alone."]
-
-                                              [:p "Considering now the " [:i "extended predicted range"] " (light blue bar). If we look at all 14 hospitals at once, we’d only expect one of them to be outside their extended range very rarely, less than 1 time in 20 (actually about 1 time in 30). This is why a hospital’s survival rate being outside the extended predicted range is considered strong evidence that the chances of a patient surviving at that hospital are different to what is expected."]
-
-                                              [:.col-sm-8 [:img.thumbnail {:style {:width "100%"}
-                                                                           :src   "assets/not-rare.png"}]]
-
+
+                                              [:p "If we were looking at only one hospital, we’d expect its survival rate to fall outside its predicted range rarely if chances of survival at the hospitals match the formula: just 1 time in 20. BUT, if we are looking at all 14 hospitals at once, we’d actually expect that at least one hospital will fall outside its range just by chance about 8 times in 20!"]
+
+
+
+
+                                              [:p "This is similar to the situation where you hear a friend won a good prize in a raffle. This may be surprising, but it becomes a lot less surprising when you hear they bought 100 tickets. Just as this gave them more chances of winning, the more hospitals we look at, the more likely it becomes that at least one will fall outside its range, even if survival at all the hospitals matches the formula."]
+
+                                              [:p "So, on average, we’d anticipate about half of NICOR’s annual reports to have at least one hospital outside its range, either above or below, by chance alone."]
+
+                                              [:p "Considering now the " [:i "extended predicted range"] ", if we look at all 13 hospitals at once, we’d only expect " [:i "any"] " one of them to be outside their extended range very rarely, just 1 time in 40. This is why a hospital’s survival rate being outside the extended predicted range is considered strong evidence that the chances of a patient surviving at that hospital are different to what is expected."]
+
+                                              [:p "NOTE: As of 2016, Royal Victoria Hospital in Belfast no longer operates on children with congenital heart disease, so there are now 13 hospitals in the UK and Ireland that perform these operations."]
+
                                               ]}

-                              {:title        "What happens if a hospital’s survival is outside its predicted range?"
-                               :short-answer "The national audit body works with the hospital to check the quality of the data. If this is fine, the hospital and the audit body explore the processes of care at that hospital. If these bring to light any concerns, the NHS and the hospital work together to improve care, which might include temporarily suspending heart surgery at that centre. "
-                               :glossary     [:unforeseen-factors]
-                               :body         [:div
-                                              [:p "For these cases, the NHS and the national audit body, NICOR, want to understand if there is a reason why a hospital is outside of its range. "]
-
-                                              [:p "Because NICOR always looks at all 14 hospitals at once, it is not that rare for any single hospital to be outside its main predicted range but it is rare for any hospital to be outside its extended range (see also: " [:a {:href "#/faq/1/3"} "looking at ALL hospitals"] ")"]
-
-                                              [:p "If a hospital’s survival rate is " [:strong "below"] " its predicted range (either the main or extended), everyone wants to be sure that there is not a potential problem in the pathway of care. It is important to either rule this out or start to improve care if the national audit body decides that this is the reason."]
-
-                                              [:p "If a hospital actual survival rate is below the predicted range, the "
+                              {:title        "What actually happens if a hospital’s survival rate is below its predicted range?"
+                               :short-answer "The national audit body works with the hospital to check the quality of the data. If this is fine, the hospital and the relevant national health service explore the processes of care at that hospital. If these bring to light any concerns, the health service and the hospital work together to improve care, which might include temporarily suspending heart surgery at that centre. "
+                               :glossary     [:survival-rate]
+                               :body         [:div
+                                              [:p " If a hospital’s survival rate is below its predicted range (either the main or extended), everyone wants to be sure that there is not a potential problem in the pathway of care. It is important to either rule this out or start to improve care if it’s decided that this is the reason."]
+
+                                              [:p "If a hospital's survival rate is below the predicted range, the "
                                                [:a {:href "https://www.ucl.ac.uk/nicor/audits/congenital/governance"} "National Congenital Heart Disease Audit Steering Committee "]
-                                               " is notified. The Committee in turn notifies the Medical Director and the lead doctor for congenital heart disease at that hospital and a detailed examination of the hospital’s results takes place. There are established and " [:a {:href "https://www.gov.uk/government/publications/detection-and-management-of-outliers-guidance-prepared-by-national-clinical-audit-advisory-group"} "published procedures"] " involving the Royal College of Surgeons and/or the Care Quality Commission which can be put into action if the detailed assessment raises concerns about care."]
-
-                                              [:p "There are two main steps (see also: " [:a {:href "#faq/1/2"} "looking at just one hospital"] ")"]
+                                               " is notified. The Committee in turn notifies the relevant national health service’s Medical Director and the lead doctor for congenital heart disease at that hospital and a detailed examination of the hospital’s results takes place. There are established and published procedures which can be put into action if the detailed assessment raises concerns about care. In England, for instance, this would involve the Royal College of Surgeons and/or the Care Quality Commission."]
+
+                                              [:p "There are two main steps: ]

                                               [:h4 "Step 1"]
                                               [:p "The hospital is asked to recheck the data it submitted for any errors."]

                                               [:h4 "Step 2"]
-                                              [:p "If the hospital’s survival rate is still below its predicted range but within the extended predicted range (i.e. in the light blue area) with the corrected data, then an internal hospital review is conducted to understand whether there is cause for concern. "]
-                                              [:p "If the hospital’s survival rate is below the extended predicted range (outside the light blue area) with the corrected data, then an external review of the hospital’s processes and results would be instigated."]
+                                              [:p "With the corrected data:"]
+                                              [:p "If the hospital’s survival rate is still below its predicted range but within the extended predicted range (i.e. in the light blue area), then an internal hospital review is conducted to understand whether there is cause for concern. "]
+                                              [:p "If the hospital’s survival rate is below the extended predicted range (to the left of the light blue bar), then an external review of the hospital’s processes and results would be instigated."]
+
+
                                               [:p "In all such cases, the reviews (whether internal or external) would be published online by NICOR at the same time as the Annual Report."]

-                                              [:p "In all such cases, the reviews (whether internal or external) would be published online by NICOR at the same time as the Annual Report."]
-
-                                              [:.col-sm-8 [:img.thumbnail {:style {:width "100%"}
-                                                                           :src   "assets/outside-range.png"}]]
-
-                                              [:p "If a hospital’s survival rate is above its predicted range, we want to see if there is anything we can learn about best practice form that hospital so that it can be shared with other hospitals. However, no formal reviews are instigated in cases where survival is higher than the predicted range."]
+                                              [:p "NOTE: Because the national audit body always reports on all 13 hospitals at once, it is not that rare for any single hospital to be outside its predicted range but it is rare for any hospital to be outside its extended range (see also: " [:a {:href "#/faq/1/3"} "looking at ALL hospitals"] ")"]

                                               ]}

-                              {:title        "Where did the formula used by National Audit to calculate the predicted range come from?"
+                              {:title        "Where did the formula used to calculate the predicted range come from?"
                                :short-answer "The statistical formula comes from a method called “Partial Risk Adjustment in Surgery” or PRAiS for short, developed by researchers at Great Ormond Street Hospital and University College London. "
                                :glossary     []
                                :body         [:div
-                                              [:p "The National Audit body uses a formula developed by researchers at Great Ormond Street Hospital and University College London called PRAiS (Partial Risk Adjustment in Surgery. See also the " [:a {:href "?#/intro"} "What, why, how?"] " section). The underlying methodology of this method is published in the " [:a {:href "https://www.ucl.ac.uk/operational-research/AnalysisTools/PRAiS"} "academic literature"] " if you are interested in learning more details."]
+                                              [:p "The national audit body uses a formula developed by researchers at Great Ormond Street Hospital and University College London called PRAiS (Partial Risk Adjustment in Surgery - see also the " [:a {:href "?#/intro"} "What, why, how?"] " section). The underlying methodology of this method is published in the " [:a {:href "https://www.ucl.ac.uk/operational-research/AnalysisTools/PRAiS"} "academic literature"] " if you are interested in learning more details."]

                                               (comment "*** picture of formula churning away at PRAIS risk factors?***")

@@ -509,7 +495,7 @@

                               {:title        "Are there any limitations to using a formula?"
                                :short-answer "Yes – a child’s chances of survival can never be completely captured in a single formula. "
-                               :glossary     [:risk-adjustment]
+                               :glossary     []
                                :body         [:div
                                               [:p "Yes there are. While taking into account the complexity of each child’s medical problems in a formula allows for fairer assessment of a hospital’s survival rate, it still cannot make it completely fair. There will always be information about important factors that affect a child’s chances of survival that are not routinely collected for national bodies and so cannot be captured by a formula that was developed using national data. "]
                                               [:p "Any statistical formula has to be developed on existing data and so the data will be typically at least a year out of date. So risk adjustment cannot adjust or account for future changes to the way data is collected (for instance more complete data) or new methods of surgical or medical management. Often, these statistical formulas are updated every few years with more up to date (in 2016, we updated PRAiS for the third time). "]]}
@@ -548,7 +534,7 @@
                                :body         [:div
                                               [:p "Two very common measures used for looking at a hospital’s outcomes are “survival at discharge from hospital” and “30 day survival” after an operation. Survival at discharge is often used in other contexts as it’s the easiest to obtain – it is included within standard hospital records. However, survival to discharge does depend on the discharge procedures at that hospital. For instance, some hospitals will transfer very sick patients to other, more specialised hospitals, meaning that more patients will be alive at discharge from that hospital than the specialised hospital. Some hospitals might have close links with local palliative care services and so might discharge patients to these services if further treatment is considered unavailing. Again, such hospitals with have more patients alive at discharge compared to a hospital that look after the sickest patients until they die. "]
                                               [:p "Therefore, if it is available, “30 day survival” after surgery is considered a more objective and preferable statistic than “survival to hospital discharge”, since it does not depend on the hospital’s discharge procedures."]
-                                              [:p "While longer term survival is extremely important (see [link to longer term survival FAQ]), 30-day survival post surgery was initially chosen as it is more straightforward to link this outcome to a child’s surgery and post-operative care than a longer range survival  period which might, for instance, incorporate further treatment at different hospitals. The other important aspect of monitoring 30-day survival, particularly within hospitals, is that any worrying outcomes can be investigated very quickly since the survival outcomes are available (locally) within 30 days of a child’s operation."]]}
+                                              [:p "While longer term survival is extremely important (see (MIKE LINK to longer term survival FAQ)), 30-day survival post surgery was initially chosen as it is more straightforward to link this outcome to a child’s surgery and post-operative care than a longer range survival  period which might, for instance, incorporate further treatment at different hospitals. The other important aspect of monitoring 30-day survival, particularly within hospitals, is that any worrying outcomes can be investigated very quickly since the survival outcomes are available (locally) within 30 days of a child’s operation."]]}
                               ]
                     }

@@ -557,12 +543,12 @@
                                :short-answer "This website cannot tell you which hospital to go to. Please discuss this with your child’s clinical team or access the support offered by specialist charities such as the Children’s Heart Federation. "
                                :glossary     []
                                :body         [:div
-                                              [:p "You can use the national audit data to see how the different hospitals are doing compared to what is predicted from the statistical model for a particular time period. You can also use the " [:a {:href "https://nicor4.nicor.org.uk/CHD/an_paeds.nsf/vwContent/home"} "national audit website"] " to explore how many operations of each type a hospital does and survival outcomes for each of these. However, this cannot, in itself, tell you which hospital you should go to and does not provide proof that one hospital is “better” than any other. The safety or otherwise of a hospital " [:strong "cannot"] " be determined from survival data alone."]
-
-                                              [:p "When considering which hospital, there are many factors to take into account, including how well the clinical team know your child and his or her medical history, any particular medical issues that your child has (for instance, some hospitals specialise in treating children with a particular problem) and how far the hospital is from your home."]
-
-                                              [:p "You should discuss your child’s care with their specialist cardiologist to determine what the best treatment option is for your child."]
-                                              [:p "You can also access the support available from national charities such as the " [:a {:href "http://www.chfed.org.uk/documents/2012/11/second-opinion-factsheet.pdf"} "Children’s Heart Federation"] " or " [:a {:href "http://www.lhm.org.uk/"} "Little Hearts Matter"] " or local charities for your specialist children’s hospital (hospital map tab for individual hospital charities). These guides on " [:a {:href "http://www.chfed.org.uk/documents/2015/02/talking-to-doctors-pdf-factsheet.pdf"} "speaking to your child’s surgeon"] " or " [:a {:href "http://www.chfed.org.uk/documents/2012/11/second-opinion-factsheet.pdf"} "seeking a second opinion"] ", written by the Children’s Heart Federation, might also be helpful."]
+                                              [:p "You can use the national audit data to see how the different hospitals are doing compared to their predicted range calculated for the last 3 years (MIKE LINK TO EXPLORE THE DATA). You can also use the (MIKE LINK change - see word doc) " [:a {:href "https://nicor4.nicor.org.uk/CHD/an_paeds.nsf/vwContent/home"} "national audit website"] " to explore how many operations of each type a hospital does and survival outcomes for each of these. However, this cannot, in itself, tell you which hospital you should go to and does not provide proof that one hospital is “better” than any other. The safety or otherwise of a hospital " [:strong "cannot"] " be determined from survival data alone."]
+
+                                              [:p "When considering which hospital, there are many factors to take into account, including how well the clinical team know your child and his or her medical history, any particular medical issues that your child has (for instance, some hospitals specialise in treating children  with particularly complex medical problems) and how far the hospital is from your home."]
+
+                                              [:p "You should discuss your child’s care with their specialist cardiologist to determine the best treatment option for your child."]
+                                              [:p "You can also access the support available from national charities such as the " [:a {:href "http://www.chfed.org.uk/documents/2012/11/second-opinion-factsheet.pdf"} "Children’s Heart Federation"] " or " [:a {:href "http://www.lhm.org.uk/"} "Little Hearts Matter"] " or local charities for your specialist children’s hospital (MIKE LINK TO CHARITY FAQ). These guides on " [:a {:href "http://www.chfed.org.uk/documents/2015/02/talking-to-doctors-pdf-factsheet.pdf"} "speaking to your child’s surgeon"] " or " [:a {:href "http://www.chfed.org.uk/documents/2012/11/second-opinion-factsheet.pdf"} "seeking a second opinion"] ", written by the Children’s Heart Federation, might also be helpful."]
                                               ]
                                }

@@ -573,16 +559,19 @@
                                               [:p "No, the published data cannot tell you about the risk for your child specifically – this will depend on other factors that are not necessarily captured in the national data. Your child’s specialist cardiologist and/or cardiac surgeon will be able to discuss this with you. These guides on " [:a {:href "http://www.chfed.org.uk/documents/2015/02/talking-to-doctors-pdf-factsheet.pdf"} "speaking to your child’s surgeon"] " or " [:a {:href "http://www.chfed.org.uk/documents/2012/11/second-opinion-factsheet.pdf"} "seeking a second opinion"] ", written by the Children’s Heart Federation, might also be helpful."]
                                               ]}

-                              {:title    "Further resources for families of children with heart problems"
+                              {:title    "Charities and support groups for families of children with heart problems"
                                ;                    :short-answer ""
                                :glossary []
                                :body     [:div
+                                          [:p "We have collated a list of charities and support groups for families of children with heart problems (all active as of 2016). Some of them specialise in certain heart conditions while others are only active in certain places."]
                                           (render-charity-list)
+
+                                          [:p "NOTE: As of 2016, Royal Victoria Hospital in Belfast no longer operates on children with congenital heart disease."]
                                           ]}
                               ]}

                    {:section "Who developed this site and how"
-                    :faqs    [{:title    "About us"
+                    :faqs    [{:title    "About us (MIKE LINK to all organisations: UCL CORU for UCL; DS stats lab (?), KCL Tim’s group; Sense about Science, CHF)…. "
                                :glossary []
                                :body     [:div
                                           [:.image-para [:p [:img.pull-left
@@ -590,12 +579,12 @@
                                                                       :margin-right "20px"}
                                                               :src   "assets/ucl-logo.png"}] [:strong "University College London: Dr Christina Pagel"] " is a Reader in Operational Research (a branch of applied mathematics) at University College London, applying maths to problems in the NHS. She works very closely with doctors and other clinical staff, mainly at Great Ormond Street Hospital, to help them use routinely collected data to improve NHS services. Her work currently focuses on two areas: 1) care for children requiring heart surgery and 2) how specialist intensive care is organised for children who need it (for whatever reason). "]

-                                           [:p "Christina helped developed a statistical method called PRAiS to let specialist hospitals and the national audit body easily monitor survival outcomes after heart surgery in children. The UK National Audit Body that monitors paediatric congenital outcomes now uses this method in publishing their outcomes. In this project, Christina worked with Sense about Science, the University of Cambridge and the Children’s Heart Federation to develop these online resources to help people interpret the audit body’s published results. "]]
+                                           [:p "Christina helped developed a statistical method called PRAiS to let hospitals and the national audit body easily monitor survival outcomes after heart surgery in children. In this project, Christina worked with Sense about Science, the University of Cambridge, King’s College London and the Children’s Heart Federation to develop these online resources to help people interpret the audit body’s published results. In particular, she wrote a lot of the content, helped enormously by feedback from the team and the user workshops. Thanks to " [:strong "Dr Andrew Wilshere"] " for designing our logo! "]]
                                           [:.image-para
                                            [:p [:img.pull-left
                                                 {:style {:width        "150px"
                                                          :margin-right "20px"}
-                                                 :src   "assets/camlogo.png"}] [:strong "University of Cambridge: Professor David Spiegelhalter"] " is a statistician from Cambridge University.   He has worked for many years with doctors from Great Ormond Street Hospital on monitoring outcomes following surgery for congenital heart disease, and led the statistical team at the Bristol Royal Infirmary Inquiry.  He is particularly interested in transparent communication, and was part of the team that drew up the new patient information leaflets for breast screening. " [:strong "Mike Pearson"] ", University of Cambridge , developed the data visualisations."]]
+                                                 :src   "assets/camlogo.png"}] [:strong "University of Cambridge: Professor David Spiegelhalter"] " is a statistician from Cambridge University.   He has worked for many years with doctors from Great Ormond Street Hospital on monitoring outcomes following surgery for congenital heart disease, and led the statistical team at the Bristol Royal Infirmary Inquiry.  He is particularly interested in transparent communication, and was part of the team that drew up the new national patient information leaflets for breast cancer screening. For this project, David helped write the content, especially the language around the statistical formula and predicted range.  " [:strong "Mike Pearson"] ", University of Cambridge ,  is the brains behind the website development, setting up the site, the data visuals and working closely with the animation team, Qudos. (MIKE LINK to Qudos)."]]

                                           [:.image-para
                                            [:p [:img.pull-left
@@ -609,19 +598,34 @@
                                             [:img.pull-left
                                              {:style {:width        "150px"
                                                       :margin-right "20px"}
-                                              :src   "assets/sas-logo.png"}] [:strong "Sense About Science"] ", a U.K.-based charity, works to put science and evidence in the hands of the public. They are a source of information, challenge misinformation, and champion sound science and evidence with the help of scientists, academics, and experts in various fields. They facilitated the workshops with parents, other interested users and members of the public who helped to co-develop the website. "]]
+                                              :src   "assets/sas-logo.png"}] [:strong "Sense About Science"] " is a UK-based charity that works to put science and evidence in the hands of the public. They are a source of information, challenge misinformation, and champion sound science and evidence with the help of scientists, academics, and experts in various fields. For this project, they facilitated the workshops with parents, other interested users and members of the public who helped to co-develop the website over four sets of two workshops and stopped the academics going into too much mathematical detail! "]]

                                           [:.image-para
                                            [:p [:img.pull-left
                                                 {:style {:width        "60px"
                                                          :margin-right "20px"}
-                                                 :src   "assets/chf-logo.png"}] [:strong "The Children’s Heart Federation"] " is the leading UK children’s heart charity and the main umbrella body for British CHD charities and voluntary organisations. They publicised this project among their members and coordinated the involvement of parents in our workshops. "]]
+                                                 :src   "assets/chf-logo.png"}] [:strong "The Children’s Heart Federation"] " is the main umbrella body for British CHD charities and voluntary organisations. They publicised this project among their members and coordinated the involvement of parents of children who had heart surgery in our workshops."]]
+                                          [:p "If you have any comments about the website please email: (MIKE: Generic email)"]
+
                                           ]}
+
+

                               {:title    "How we developed this site"
                                :glossary []
                                :body     [:div
-                                          [:p "Yet to be written"]]}
+                                          [:p "We developed this site in just over a year from April 2015 to launch in May 2016. "]
+
+                                          [:p "The academic mathematicians and statisticians wrote first drafts of the content in May 2015, with feedback from communication experts at Sense about Science and the academic psychologists at King’s College London. Over the next 10 months, Sense about Science held four sets of two workshops each to test the web content: each time one workshop was with interested potential users (e.g. press officers; health journalists; policy people) and the other workshop was with parents of children who had heart surgery. At each stage, we asked new people to come to the workshop so we could get fresh impressions. "]
+
+                                          [:p "As the website took shape in the autumn of 2015, the academic psychologists at King’s College London did formal tests of specific sentences and concepts discussed in the website to see if one way of explaining the concepts worked better than the other and to pinpoint where there was possibility for confusions. We also shared the evolving website with the clinical community including surgeons, intensive care doctors, data experts and cardiologists, to incorporate their feedback too. "]
+
+                                          [:p "Over time, the website took shape, changing massively over the year in response to the workshops, the psychology experiments and other feedback. We asked about everything from layout to colours to language to page navigation and very little remains from the original draft content! "]
+
+                                          [:p "Looking back, we cannot thank all those who gave feedback enough – this website is immeasurably better with their input than it would otherwise have been. Any niggles that remain are our responsibility alone.  "]
+
+                                          [:p "We would also like to thank our funder, the UK National Institute of Health Research, for encouraging us to think ambitiously about how to develop this site and gave us the time and money to do it! "]
+                                          ]}
                               ]}

                    {:section "Further resources about understanding clinical data"


Correct switch to compare instead of number assumptions.

--- src/riemann/streams.clj
+++ src/riemann/streams.clj
@@ -902,7 +902,7 @@
         scan (fn scan [top]
                (if (empty? top)
                  nil
-                 (first (sort-by second top))))
+                 (first (first (sort-by second top)))))
         trim (fn trim [top smallest]
                (if (< k (count top))
                  (dissoc top smallest)
@@ -922,8 +922,8 @@

       ; Falls outside the top set.
       (and (not (top ekey))
-           (pos? (compare (top smallest) value))
-           (>= (count top) k))
+           ((complement pos?) (compare value (top smallest)))
+           (<= k (count top)))
       [smallest top]

       ; In the top set


sorted services in compose file

sorted services in compose file

--- src/clj/swarmpit/docker/engine/mapper/compose.clj
+++ src/clj/swarmpit/docker/engine/mapper/compose.clj
@@ -25,7 +25,8 @@
   [stack-name fn coll]
   (->> coll
        (map #(fn stack-name %))
-       (into {})))
+       (into (sorted-map))
+       (ordered-map)))

 (defn add-swarmpit-labels
   [service map]
@@ -126,7 +127,7 @@
   [stack]
   (let [name (:stackName stack)]
     (-> {:version  compose-version
-         :services (group name service (:services stack))
+         :services (group name service (->> stack :services (sort-by :serviceName) (vec)))
          :networks (group name network (:networks stack))
          :volumes  (group name volume (:volumes stack))
          :configs  (group name config (:configs stack))


Update quil

Update quil

--- resources/leiningen/new/graphics/project.clj
+++ resources/leiningen/new/graphics/project.clj
@@ -2,5 +2,5 @@
   :description "FIXME: write description"
   :url "http://example.com/FIXME"
   :dependencies [[org.clojure/clojure "1.9.0"]
-                 [quil "2.6.0" :exclusions [org.clojure/clojure]]]
+                 [quil "2.7.1" :exclusions [org.clojure/clojure]]]
   :main {{namespace}})


CMR-6474 Adds GET DATA : OPENDAP DATA mapping to echo10 granules

--- umm-lib/src/cmr/umm/echo10/related_url.clj
+++ umm-lib/src/cmr/umm/echo10/related_url.clj
@@ -50,6 +50,7 @@
    "DATA ACCESS" ["GET DATA"]
    "ALGORITHM INFO" ["VIEW RELATED INFORMATION"]
    "GET DATA : OPENDAP DATA (DODS)" ["OPENDAP DATA ACCESS"]
+   "GET DATA : OPENDAP DATA" ["GET DATA" "OPENDAP DATA"]
    "VIEW PROJECT HOME PAGE" ["VIEW PROJECT HOME PAGE"]})

 (def related-url-types->resource-types


better done callculation and when all subtodos are done, todo is done

--- src/todos/todo_item.clj
+++ src/todos/todo_item.clj
@@ -8,18 +8,23 @@
         sub-todos (atom [])
         status-done (fn [] (if (= 0 (count @sub-todos))
                               (if @done 1 0)
-                              (/ (apply (partial +
-                                                 (/ (count (filter #((% :done?)) @sub-todos))
-                                                    (count @sub-todos))
-                                                 (if @done 1 0))
-                                        (for [i @sub-todos] ((i :status-done)) ))
-                                 (+ (count  @sub-todos) 2)
-                                 )))
+                              (/ (count
+                                   (filter
+                                     #((% :done?))
+                                     @sub-todos))
+                                 (-> @sub-todos
+                                     count
+                                     ))))
+        is-done (fn [] (if
+                           (= 0 (count @sub-todos))
+                           @done
+                           (>= (status-done) 1)
+                           ))
         ]
     {:name        (fn [] @todo-name)           ; fn Get name
      :rename      (partial reset! todo-name)   ; fn Rename     [string]

-     :done?       (fn [] @done)                ; fn is done?
+     :done?       is-done                      ; fn is done?
      :set-done    (partial reset! done)        ; fn set done   [true/false]

      :notes       (fn [] @notes)               ; fn Get notes
@@ -45,7 +50,7 @@
      :idstatus    (fn [i]
                     (println (format "%s : [%s] %s"
                                      (str i)
-                                     (if @done "X" " ")
+                                     (if (is-done) "X" " ")
                                      @todo-name)))
      :status      (fn []
                     (let [data-dones (count (filter #((% :done?)) @sub-todos))
@@ -54,10 +59,10 @@
                           percent-dones (format "%.1f" (* 100 (float (status-done))))
                           status-str (format "notes: %3s todos: %3s/%-3s %5s%%" count-notes data-dones data-todos-all percent-dones)]
                       (do
-                        (println (format "%s   [%s] %s" status-str (if @done "X" " ") @todo-name))
+                        (println (format "%s   [%s] %s" status-str (if (is-done) "X" " ") @todo-name))
                         )))
      :print       (fn [pre-string]
-                      (println (format "%s[ %s ] %s" pre-string (if @done "X" " ") @todo-name))
+                      (println (format "%s[ %s ] %s" pre-string (if (is-done) "X" " ") @todo-name))
                       (doseq [note @notes] (println (format "%s    | - %s" pre-string note)))
                       (doseq [item @sub-todos] ((item :print) (str pre-string "    | ")))
                       nil


force normal map printing in lein repls

force normal map printing in lein repls

--- files/lein/profiles.clj
+++ files/lein/profiles.clj
@@ -3,4 +3,8 @@
  :user {:dependencies [[hashp "0.1.1"]
                        [criterium "0.4.6"]]
         :injections [(require 'hashp.core)
-                     (require '[criterium.core :as cr])]}}
+                     (require '[criterium.core :as cr])
+                     (defmethod print-method clojure.lang.IPersistentMap [m, ^java.io.Writer w]
+                       (#'clojure.core/print-meta m w)
+                       (#'clojure.core/print-map m #'clojure.core/pr-on w))]}}
+


Adjust orientation movement

Adjust orientation movement

--- src/try_lwjgl/logic.clj
+++ src/try_lwjgl/logic.clj
@@ -21,9 +21,9 @@
      ;; (0, 0, 0) is origin, upright, facing -z
      (let [[angle-x angle-y angle-z] direction
            [px py pz] position
-           dx (* -1.0 distance (Math/sin angle-y))
-           dy 0.0
-           dz (* -1.0 distance (Math/cos angle-y))
+           dx (* -1.0 distance (Math/cos angle-x) (Math/sin angle-y))
+           dy (* -1.0 distance (Math/sin angle-x))
+           dz (* -1.0 distance (Math/cos angle-y) (Math/cos angle-x))
            new-x (+ px dx)
            new-y (+ py dy)
            new-z (+ pz dz)]
@@ -81,9 +81,12 @@
 (def mouse-sensitivity 0.002)

 (defn handle-mouse []
-  (let [dx (input/mouse-dx)]
+  (let [dx (input/mouse-dx)
+        dy (input/mouse-dy)]
     (when (not (= dx 0))
-      (swap! player-direction #(rotate-direction % 1 (* -1.0 dx mouse-sensitivity))))))
+      (swap! player-direction #(rotate-direction % 1 (* -1.0 dx mouse-sensitivity))))
+    (when (not (= dy 0))
+      (swap! player-direction #(rotate-direction % 0 (* -1.0 dy mouse-sensitivity))))))

 (defn handle-movement-key-up [key event key-down-at]
   (if (and event (not (event :down?)))


Bugfix: If we have problems processing something, don't kill th… (#1276)

--- scheduler/src/cook/kubernetes/controller.clj
+++ scheduler/src/cook/kubernetes/controller.clj
@@ -187,7 +187,7 @@
 (defn pod-update
   "Update the existing state for a pod. Include some business logic to e.g., not change a state to the same value more than once.
   Invoked by callbacks from kubernetes."
-  [{:keys [existing-state-map] :as kcc} ^V1Pod new-pod]
+  [{:keys [existing-state-map name] :as kcc} ^V1Pod new-pod]
   (let [pod-name (api/V1Pod->name new-pod)]
     (locking (calculate-lock pod-name)
       (let [new-state {:pod new-pod :synthesized-state (api/pod->synthesized-pod-state new-pod)}
@@ -195,7 +195,10 @@
         ; We always store the updated state, but only reprocess it if it is genuinely different.
         (swap! existing-state-map assoc pod-name new-state)
         (when-not (existing-state-equivalent? old-state new-state)
-          (process kcc pod-name))))))
+          (try
+            (process kcc pod-name)
+            (catch Exception e
+              (log/error e (str "In compute-cluster " name ", error while processing pod-update for " pod-name)))))))))

 (defn pod-deleted
   "Indicate that kubernetes does not have the pod. Invoked by callbacks from kubernetes."
@@ -204,7 +207,11 @@
     (log/info "In compute cluster" name ", detected pod" pod-name "deleted")
     (locking (calculate-lock pod-name)
       (swap! existing-state-map dissoc pod-name)
-      (process kcc pod-name))))
+      (try
+        (process kcc pod-name)
+        (catch Exception e
+          (log/error e (str "In compute-cluster " name ", error while processing pod-delete for " pod-name)))))))
+

 (defn update-expected-state
   "Update the expected state. Include some business logic to e.g., not change a state to the same value more than once. Marks any state changes Also has a lattice of state. Called externally and from state machine."


allow clicking on external urls for thing page

--- pedestal-app/app/src/semtag_web/rendering.cljs
+++ pedestal-app/app/src/semtag_web/rendering.cljs
@@ -180,7 +180,7 @@
                         :caption (if (re-find #"\d+$" thing-id) "" (p/link-tagged thing-id))
                         :row-partial p/thing-row
                         :fields [:attribute :value])))
-  (enable-clickable-links-on "#thing_show_table" input-queue))
+  (enable-clickable-links-on "#thing_show_table td:not([data-field=url])" input-queue))

 (defn render-alert-error [_ [_ _ _ msg] _]
   (render-alert msg :error))


STORM-496. task.clj missing debug for logging spout and bolt emit values.

--- storm-core/src/clj/backtype/storm/daemon/task.clj
+++ storm-core/src/clj/backtype/storm/daemon/task.clj
@@ -132,9 +132,12 @@
         emit-sampler (mk-stats-sampler storm-conf)
         stream->component->grouper (:stream->component->grouper executor-data)
         user-context (:user-context task-data)
-        executor-stats (:stats executor-data)]
+        executor-stats (:stats executor-data)
+        debug? (= true (storm-conf TOPOLOGY-DEBUG))]

     (fn ([^Integer out-task-id ^String stream ^List values]
+          (when debug?
+            (log-message "Emitting direct: " out-task-id "; " component-id " " stream " " values))
           (let [target-component (.getComponentId worker-context out-task-id)
                 component->grouping (get stream->component->grouper stream)
                 grouping (get component->grouping target-component)
@@ -151,6 +154,8 @@
             (if out-task-id [out-task-id])
             ))
         ([^String stream ^List values]
+           (when debug?
+             (log-message "Emitting: " component-id " " stream " " values))
            (let [out-tasks (ArrayList.)]
              (fast-map-iter [[out-component grouper] (get stream->component->grouper stream)]
                (when (= :direct grouper)


converted bunch of facts to use `causes-validation-error` macro

--- test/midje/error_handling/t_background_errors.clj
+++ test/midje/error_handling/t_background_errors.clj
@@ -88,48 +88,33 @@
 ;; ~~ Vectory

 ;; invalid wrapping targets
-(after-silently
+(causes-validation-error
   (against-background [(before :invalid-wrapping-target (do "something"))]
-    "body")
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
+    "body"))

 ;; check for vectors w/ no state-descriptions or background fakes
-(after-silently
+(causes-validation-error
   (against-background [:not-a-state-description-or-fake]
-    (fact nil => nil))
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
+    (fact nil => nil)))

 (defn f [] )

 ;; check for vectors w/ one thing that isn't a state-description or background fake
-(after-silently
+(causes-validation-error
   (against-background [(before :contents (do "something")) (f) => 5 :other-odd-stuff]
-    (fact nil => nil))
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
+    (fact nil => nil)))

 ;; invalid if missing background fakes or state descriptions
-(after-silently
+(causes-validation-error
   (against-background []
-    (fact nil => nil))
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
+    (fact nil => nil)))

 ;; ~~Sequency

 ;; invalid wrapping targets
-(after-silently
+(causes-validation-error
   (against-background (before :invalid-wrapping-target (do "something"))
-    "body")
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
+    "body"))

 ;; invalid when list w/ no state-descriptions or background fakes
 (after-silently
@@ -140,50 +125,31 @@
     @reported =future=> (one-of (contains {:type :user-error}))))

 ; check for one thing that isn't a state-description or background fake
-(after-silently
+(causes-validation-error
   (against-background :invalid-stuff-here
-    (fact nil => nil))
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
+    (fact nil => nil)))

 ;; invalid if missing background fakes or state descriptions
-(after-silently
+(causes-validation-error
   (against-background
-    (fact nil => nil))
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
+    (fact nil => nil)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ** `background` end-to-end ** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 ;; invalid wrapping targets
-(after-silently
-  (background (before :invalid-wrapping-target (do "something")))
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
+(causes-validation-error
+  (background (before :invalid-wrapping-target (do "something"))))

 ;; invalid when anything doesn't look like a state-description or background fake
-(after-silently
+(causes-validation-error
   (background (before :contents (do "something"))
-              (:not-a-state-description-or-fake))
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
+              (:not-a-state-description-or-fake)))

 ; invalid when one thing isn't a state-description or background fake
-(after-silently
-  (background :invalid-stuff-here)
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
+(causes-validation-error
+  (background :invalid-stuff-here))

 ;; invalid if missing background fakes or state descriptions
-(after-silently
-  (background)
-
-  (fact
-    @reported => (one-of (contains {:type :user-error}))))
-
+(causes-validation-error
+  (background))


(PDB-3302) Fix gem version sorting in integration test fixtures

--- test/puppetlabs/puppetdb/integration/fixtures.clj
+++ test/puppetlabs/puppetdb/integration/fixtures.clj
@@ -183,9 +183,15 @@

 (defn jruby-agent-dir []
   (->> (fs/list-dir "vendor/puppetserver-gems/gems/")
-       sort
-       (filter #(re-matches #"puppet-\d+\.\d+\.\d+" (fs/base-name %)))
-       (map fs/absolute)
+       (map (fn [f] (let [[_ package version-str] (re-matches #"^(.*)-([\d\.]+)" (fs/base-name f))]
+                      {:file f
+                       :package-name package
+                       :version (->> (string/split version-str #"\.")
+                                     (map #(Integer/parseInt %))
+                                     (into []))})))
+       (filter #(= (:package-name %) "puppet"))
+       (sort-by :version) ;; newest comes last
+       (map :file)
        last))

 (defn install-terminus-into [puppet-dir]


removing bad comments from mrege

removing bad comments from mrege

--- test/restaurant_inspections_api/services_test.clj
+++ test/restaurant_inspections_api/services_test.clj
@@ -37,7 +37,6 @@
                 {:id 53, :count 1}
                 {:id 54, :count 1}]})

-;; Test general helper functions
 (deftest format-data-test
   ;; TODO: test given full results, gets fully correctly formatted object
   ;; TODO: given empty, returns full object with nulls
@@ -52,5 +51,4 @@
         (is (= (:location_city json) "COOPER CITY"))
         (is (= (count (:violations json)) 8))
         (is (= (first (:violations json)) {:id 3, :count 1}))
-;; TODO: test given full results, gets fully correctly formatted object
         (is (= (:total_violations json) 11))))))


Fixes tag links in embedded entries, when using a prefixed URL.

For example: `http://example.com/blog` and `tags/{{id}}.tag` would
result in invalid link to `http://example.com/blog/../tags/foobar.html`.

--- lambda-blog/src/lambda_blog/templates/entries.clj
+++ lambda-blog/src/lambda_blog/templates/entries.clj
@@ -5,7 +5,7 @@
             [lambda-blog.utils :refer [format-time pathcat separate-with]]
             [s-html.tags.html :refer [a article div footer h1 header hr i li nav p span time ul]]))

-(defn- entry-tags [{:keys [path-to-root tags]}]
+(defn- entry-tags [path-to-root {:keys [tags]}]
   (nav (separate-with " "
                       (map #(a {:class :tag
                                 :href (pathcat path-to-root (:path %))}
@@ -43,7 +43,7 @@
       (h1 title)
       (p "Posted on " (time (format-time "YYYY-MM-dd HH:mm" timestamp))
          " by " author)
-      (entry-tags ent))))
+      (entry-tags path-to-root ent))))
    contents
    (footer
     (pager ent))))
@@ -65,7 +65,7 @@
               title))
        (p "Posted on " (time (format-time "YYYY-MM-dd HH:mm" timestamp))
           " by " (or author (:author ent))) ;; KLUDGE :(
-       (entry-tags entry)))))
+       (entry-tags path-to-root entry)))))
    (if preview
      [preview
       ;; NOTE #preview-more should be added by the parser.


add more docs

add more docs

--- test/babel/test/en.cljc
+++ test/babel/test/en.cljc
@@ -624,6 +624,7 @@
   (benchmark spec2 5))

 ;; (repeatedly #(println (fo (first (nugents (medium) spec1)))))
+;; (repeatedly #(time (println (fo (first (nugents (medium) spec1))))))
 ;; (repeatedly #(println (fo-ps (first (nugents (medium) spec1)))))
 ;; (repeatedly #(println (fo (first (nugents (medium) {:synsem {:cat :noun}})))))


added tests

added tests

--- test/blog/core_test.clj
+++ test/blog/core_test.clj
@@ -2,6 +2,42 @@
   (:require [clojure.test :refer :all]
             [blog.core :refer :all]))

-(deftest a-test
-  (testing "FIXME, I fail."
-    (is (= 0 1))))
+(def test-articles
+  [{:name "2014-04-02-first-post.md",
+    :path "articles/2014-04-02-first-post.md"}
+   {:name "2014-05-01-next-post.md",
+    :path "articles/2014-05-01-next-post.md"}])
+
+(deftest data
+  (testing "group-by-month"
+    (is (= (group-by-month test-articles)
+           {"2014-05" [{:name "2014-05-01-next-post.md",
+                        :path "articles/2014-05-01-next-post.md"}],
+            "2014-04" [{:name "2014-04-02-first-post.md",
+                        :path "articles/2014-04-02-first-post.md"}]}))))
+
+(deftest helpers
+  (testing "local-redirect"
+    (is (= (local-redirect {:server-name "localhost"
+                            :server-port "8080"}
+                           "/next")
+           {:status 302,
+            :headers {"Location" "http://localhost:8080/next"},
+            :body ""}))
+    (is (= (local-redirect {:server-name "localhost"
+                            :server-port ""}
+                           "/next")
+           {:status 302,
+            :headers {"Location" "http://localhost/next"},
+            :body ""}))
+    (is (= (local-redirect {:server-name "localhost"}
+                           "/next")
+           {:status 302,
+            :headers {"Location" "http://localhost/next"},
+            :body ""})))
+  (testing "date-code->text"
+    (is (= (date-code->text "2014-02")
+           "February 2014")))
+  (testing "article-code->title"
+    (is (= (article-code->title "2014-04-02-first-post.md")
+           "First Post"))))


Close #75: add unix epoch => local date time unit test

--- test/java_time_test.clj
+++ test/java_time_test.clj
@@ -1085,3 +1085,12 @@
     (is (= (slurp "src/java_time.cljc")
            (with-out-str ((resolve 'java-time.dev.gen/print-java-time-ns))))
         "java-time main namespace is out of date -- call (java-time.dev.gen/spit-java-time-ns)")))
+
+;; https://github.com/dm3/clojure.java-time/issues/75
+;; Q: Can we add a new function, or at least an example for converting a Unix timestamp (epoch seconds) to a LocalDateTime object?
+(deftest unix-epoch-example-test
+  (is (= (j/local-date-time #inst "1970-01-01T00:00:00.100" "UTC")
+         (-> ;; A: First you must get an Instant as Unix epoch doesn't have timezone information. java-time/instant constructor accepts a number of milliseconds:
+             (j/instant 100)
+             ;; Then you'll get a LocalDateTime by providing the instant and the time zone to the local-date-time constructor:
+             (j/local-date-time "UTC")))))


Formatting

Formatting

--- test/tick/core_test.clj
+++ test/tick/core_test.clj
@@ -22,7 +22,6 @@
     ;; Duration -> Duration -> Long
     (= 63 (t// (t/duration 21 :days) (t/duration 8 :hours)))))

-
 (deftest construction-test
   (is (= (t/date "2018-01-11")
          (t/date (t/instant 1515691416624)))))


Nix unnecessary test notes

Nix unnecessary test notes

--- test/uruk/core_test.clj
+++ test/uruk/core_test.clj
@@ -593,8 +593,6 @@
           (is (false? (execute-xquery session "boolean-node{false()}"
                                       {:shape :single!})))))

-      ;; TODO produce and test JsonItem
-
       (testing "......null-node type"
         (with-open [session (create-session db)]
           (is (= "null-node()"
@@ -913,19 +911,6 @@
                                              {:types :raw}))))
         (is (= "74657374"
                (execute-xquery session "xs:hexBinary(\"74657374\")" {:shape :single!})))
-
-        ;; TODO
-        ;; (is (= "xs:hexBinary"
-        ;;        (result->type (execute-xquery session "xdmp:integer-to-hex(string-to-codepoints(
-        ;;                                                     \"Testing binary Constructor\"))"
-        ;;                                      {:types :raw}))))
-        ;; TODO
-        ;; (is (= '("54" "65" "73" "74" "69" "6e" "67" "20" "62" "69" "6e" "61" "72"
-        ;;          "79" "20" "43" "6f" "6e" "73" "74" "72" "75" "63" "74" "6f" "72")
-        ;;        (execute-xquery session "xdmp:integer-to-hex(string-to-codepoints(
-        ;;                                                     \"Testing binary Constructor\"))")))
-        ;; TODO
-
         (is (= "xs:hexBinary"
                (result->type (execute-xquery session "data(xdmp:subbinary(binary { xs:hexBinary(\"DEADBEEF\") }, 3, 2))"
                                              {:types :raw}))))


Adding un-styled ssh node list for v2.

Adding un-styled ssh node list for v2.

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -294,7 +294,10 @@
        More information " [:a {:href (routes/v1-doc-subpage {:subpage "ssh-build"})} "in our docs"] "."
      (om/build ssh-buttons build)]])

-(defrender ssh-build-list [nodes owner]
+(defn ssh-command [node]
+  (gstring/format "ssh -p %s %s@%s " (:port node) (:username node) (:public_ip_addr node)))
+
+(defrender ssh-node-list [nodes owner]
   (html
     [:div.build-ssh-list
      [:dl.dl-horizontal
@@ -302,10 +305,20 @@
              (list
                [:dt (when (< 1 (count nodes)) [:span (str "container " i " ")])]
                [:dd {:class (when (:ssh_enabled node) "connected")}
-                [:span (gstring/format "ssh -p %s %s@%s " (:port node) (:username node) (:public_ip_addr node))]
+                [:span (ssh-command node)]
                 (when-not (:ssh_enabled node)
                   [:span.loading-spinner common/spinner])]))
            nodes (range))]]))
+
+(defrender ssh-node-list-v2 [nodes owner]
+  (html
+    [:ul.ssh-node-list
+     (map-indexed (fn [i node] [:li
+                                [:span.container (str "Container " i)]
+                                [:span.command (ssh-command node)]
+                                (when (:ssh_enabled node)
+                                  [:img.running-icon {:src (common/icon-path "Status-Running")}])])
+                  nodes)]))

 (defn ssh-instructions
   "Instructions for SSHing into a build that you can SSH into"
@@ -316,7 +329,9 @@
        [:div.build-ssh-title
         [:p "You can SSH into this build. Use the same SSH public key that you use for GitHub. SSH boxes will stay up for 30 minutes."]
         [:p "This build takes up one of your concurrent builds, so cancel it when you are done."]]
-       (om/build ssh-build-list nodes)
+       (if  (feature/enabled? :ui-v2)
+         (om/build ssh-node-list-v2 nodes)
+         (om/build ssh-node-list nodes))
        [:div.build-ssh-doc
         "Debugging Selenium browser tests? "
         [:a {:href "/docs/browser-debugging#interact-with-the-browser-over-vnc"}


Pulling out actual project state from app state.

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -1429,8 +1429,8 @@
             build-id (build-model/id build)
             build-num (:build_num build)
             vcs-url (:vcs_url build)
-            project (get-in data state/project-data-path)
-            plan (:plan project)
+            project (get-in data state/project-path)
+            plan (get-in data state/project-plan-path)
             user (get-in data state/user-path)
             logged-in? (not (empty? user))
             has-write-settings? (:write-settings