change ts-chart to state in single atom

change ts-chart to state in single atom

--- Clojure-Websockets/MainApp/src/cljs/birdwatch/charts/ts_chart.cljs
+++ Clojure-Websockets/MainApp/src/cljs/birdwatch/charts/ts_chart.cljs
@@ -10,26 +10,26 @@
 (defn bar
   "Renders a vertical bar. Enables showing a label when the mouse is
    positioned above the bar."
-  [x y h w idx label]
+  [x y h w idx app]
   [:rect {:x x :y (- y h) :fill "steelblue" :width w :height h
-          :on-mouse-enter #(reset! label {:idx idx})
-          :on-mouse-leave #(reset! label {})}])
+          :on-mouse-enter #(swap! app {:idx idx})
+          :on-mouse-leave #(swap! app assoc :label {})}])

 (defn barchart
   "Renders a bar chart, making use of the bar function above. Returns
    entire SVG element."
-  [indexed mx cnt w label]
+  [indexed mx cnt w app]
   (let [gap (/ (/ ts-w 20) cnt)]
     [:svg {:width ts-w :height ts-h}
      [:g
       (for [[idx [k v]] indexed]
-        ^{:key k} [bar (* idx w) ts-h (* (/ v mx) ts-h) (- w gap) idx label])]]))
+        ^{:key k} [bar (* idx w) ts-h (* (/ v mx) ts-h) (- w gap) idx app])]]))

 (defn labels
   "Renders a label for a bar chart. Makes use of Rickshaws CSS."
   [bars mx cnt w label]
-  (when-not (empty? @label)
-    (let [idx (:idx @label)
+  (when-not (empty? label)
+    (let [idx (:idx label)
           [k v] (get (vec bars) idx)
           top (- ts-h (* (/ v mx) ts-h))
           lr (if (< (/ idx cnt) 0.6) "left" "right")]
@@ -42,21 +42,20 @@
   "Renders time series chart consisting of SVG for the bars and a label.
    Appearance is similar to the Rickshaw timeseries chart, which this
    component replaced, except for the CSS."
-  [bars-atom label]
-  (let [bars @bars-atom
+  [app]
+  (let [bars (:bars @app)
         indexed (vec (map-indexed vector bars))
         mx (apply max (map (fn [[_ v]] v) bars))
         cnt (count bars)
         w (/ ts-w cnt)]
     [:div.rickshaw_graph
-     [barchart indexed mx cnt w label]
-     [labels bars mx cnt w label]]))
+     [barchart indexed mx cnt w app]
+     [labels bars mx cnt w (:label @app)]]))

 (defn init-component
   "Initializes timeseries chart component. Takes put-fn as the function that can be called when some message
    needs to be sent back to the switchboard. Returns a function that handles incoming messages."
   [_]
-  (let [bars (atom [])
-        label (atom {})]
-    (r/render-component [ts-chart bars label] ts-elem)
-    (fn [[_ state]] (reset! bars (ts/ts-data state)))))
+  (let [app (atom {:bars [] :label {}})]
+    (r/render-component [ts-chart app] ts-elem)
+    (fn [[_ state]] (swap! app assoc :bars (ts/ts-data state)))))


clean up

clean up

--- src/otto/html.clj
+++ src/otto/html.clj
@@ -2,6 +2,15 @@
   (:require [hiccup.core    :as core    :refer [h]]
             [hiccup.element :as element :refer [link-to]]
             [hiccup.page    :as page    :refer [html5 include-css include-js]]))
+
+(defn- navbar-filters
+  [items]
+  [:form#filters.navbar-form {:role "filter"}
+   (map (fn [[k v]]
+          [:div.checkbox
+           [:label.checkbox-inline.navbar-link
+            [:input {:checked true :type "checkbox" :value k}]
+            (format " %s" v)]]) items)])

 (defn- navigation
   [organizations organization]
@@ -16,19 +25,7 @@
                                          {:class "active"})
                                     (link-to (format "/%s" n) n)]))
                               organizations)]
-     [:form#filters.navbar-form {:role "form"}
-      [:div.checkbox
-       [:label.checkbox-inline.navbar-link
-        [:input {:checked true :type "checkbox" :value "fork"}]
-        " Forks"]]
-      [:div.checkbox
-       [:label.checkbox-inline.navbar-link
-        [:input {:checked true :type "checkbox" :value "private"}]
-        " Private"]]
-      [:div.checkbox
-       [:label.checkbox-inline.navbar-link
-        [:input {:checked true :type "checkbox" :value "public"}]
-        " Public"]]]]]])
+     (navbar-filters {:fork "Forks" :private "Private" :public "Public"})]]])

 (defn- format-string
   [string]


fix argument order

fix argument order

--- src/pc/assets.clj
+++ src/pc/assets.clj
@@ -137,7 +137,7 @@
     (http/post "https://api.rollbar.com/api/1/sourcemap"
                {:multipart (concat [{:name "access_token" :content (rollbar/token)}
                                     {:name "version" :content sha1}
-                                    {:name "minified_url" :content (manifest-asset-path "/cljs/production/frontend.js" manifest)}
+                                    {:name "minified_url" :content (manifest-asset-path manifest "/cljs/production/frontend.js")}
                                     {:name "source_map" :content (clojure.java.io/file source-map)}]
                                    (for [source sources]
                                      (do (println source)


CRM-183: Changed to compute values before calling update-cache

--- src/cmr/search/services/query_execution/has_granules_results_feature.clj
+++ src/cmr/search/services/query_execution/has_granules_results_feature.clj
@@ -19,10 +19,6 @@
   []
   (cache/create-cache))

-(defn context->has-granules-map-cache
-  [context]
-  (get-in context [:system :caches :has-granules-map]))
-
 (defn- collection-granule-counts->has-granules-map
   "Converts a map of collection ids to granule counts to a map of collection ids to true or false
   of whether the collection has any granules"
@@ -33,18 +29,21 @@
 (defn refresh-has-granules-map
   "Gets the latest provider holdings and updates the has-granules-map stored in the cache."
   [context]
-  (cache/update-cache (context->has-granules-map-cache context)
-                      #(assoc % :has-granules (collection-granule-counts->has-granules-map
-                                                (idx/get-collection-granule-counts context nil)))))
+  (let [has-granules-map (collection-granule-counts->has-granules-map
+                                                (idx/get-collection-granule-counts context nil))]
+  (cache/update-cache (cache/context->cache context has-granule-cache-key)
+                      #(assoc % :has-granules has-granules-map))))
 (defn get-has-granules-map
   "Gets the cached has granules map from the context which contains collection ids to true or false
   of whether the collections have granules or not. If the has-granules-map has not yet been cached
   it will retrieve it and cache it."
   [context]
-  (let [has-granules-map-cache (context->has-granules-map-cache context)]
-    (when (empty? (deref (:atom has-granules-map-cache)))
-      (refresh-has-granules-map context))
-    (:has-granules (deref (:atom has-granules-map-cache)))))
+  (let [has-granules-map-cache (cache/context->cache context has-granule-cache-key)]
+    (cache/cache-lookup has-granules-map-cache
+                        :has-granules
+                        (fn []
+                          (collection-granule-counts->has-granules-map
+                                                (idx/get-collection-granule-counts context nil))))))

 ;; This returns a boolean flag with collection results if a collection has any granules in provider holdings
 (defmethod query-execution/post-process-query-result-feature :has-granules


Separate lines for all

Separate lines for all

--- txf/pva-trans.clj
+++ txf/pva-trans.clj
@@ -1,216 +1,403 @@
 select
-    a.case_id,
-    a.listedness,
-    a.outcome,
-    a.seriousness,
-    a.agent_suspect,
-    a.company_diagnosis,
-    b.version_num,
-    b.effective_start_date,
-    b.effective_end_date,
-    a.enterprise_id
-from
-    argusmart.rm_case_assess as a,
-    argusmart.case_version_table as b
-where
-    (a.case_id = b.case_id) and
-    (a.enterprise_id = b.enterprise_id) and
-    (a.deleted_flag = convert(0,bigdecimal)) and
-    (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
-    (convert(a.effective_end_date,timestamp) > b.effective_start_date)
-
---------------------
-
-select
-    a.enterprise_id, a.case_id, a.seq_num, a.classification_id, a.deleted,
-    b.version_num, b.effective_start_date, b.effective_end_date
-from
-    argusmart.rm_case_classifications as a,
-    argusmart.case_version_table as b
-where
-    (a.case_id = b.case_id) and
-    (a.effective_start_date <= b.effective_start_date) and
-    (a.effective_end_date > b.effective_start_date)
-
---------------------
-
-select
-    a.enterprise_id, a.case_id, a.seq_num, a.desc_reptd, a.desc_coded, a.diagnosis,
-    a.onset, a.onset_res, a.onset_delay, a.stop_date, a.stop_date_res, a.duration,
-    a.onset_latency, a.evt_intensity_id, a.evt_freq_id, a.treated, a.study_related,
-    a.rechall_related, a.prod_seq_num, a.evt_outcome_id, a.receipt_date,
-    a.rpt_serious, a.sc_death, a.sc_hosp, a.sc_cong_anom, a.sc_threat, a.sc_disable,
-    a.sc_int_req, a.sc_other, a.sc_other_text, a.art_code, a.pref_term, a.inc_term,
-    a.body_sys, a.med_serious, a.past_hist, a.dict_id, a.dict_key, a.code_status,
-    a.seriousness, a.sort_id, a.onset_date_partial, a.stop_date_partial, a.efficacy,
-    a.disease, a.withdrawal, a.hlgt, a.hlt, a.hlt_code, a.hlgt_code, a.soc_code,
-    a.study_dropped, a.inc_code, a.onset_minutes, a.delay_minutes, b.version_num,
-    b.effective_start_date, b.effective_end_date
-from
-    argusmart.rm_case_event as a,
-    argusmart.case_version_table as b
-where
-    (a.case_id = b.case_id) and
-    (a.enterprise_id = b.enterprise_id) and
-    (a.deleted_flag = convert(0,bigdecimal)) and
-    (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
-    (convert(a.effective_end_date,timestamp) > b.effective_start_date)
-
---------------------
-
-select
-    a.case_id, a.prod_seq_num, a.event_seq_num, a.license_id, a.datasheet_id,
-    a.source_id, a.det_causality_id, a.seq_num, a.causality_score, a.cause_justify,
-    a.listed_justify, a.causality_assessment, a.det_listedness_id, a.rpt_causality_id,
-    a.prt_causality_id, b.version_num, b.effective_start_date, b.effective_end_date,
-    a.enterprise_id
-from
-    argusmart.rm_case_event_assess as a,
-    argusmart.case_version_table as b
-where
-    (a.case_id = b.case_id) and
-    (a.enterprise_id = b.enterprise_id) and
-    (a.deleted_flag = convert(0,bigdecimal)) and
-    (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
-    (convert(a.effective_end_date,timestamp) > b.effective_start_date)
-
---------------------
-
-select
-    cf.case_id, cf.seq_num, cf.auditlog_type, cf.time_stamp, cf.receipt_date,
-    cf.safety_date, cf.significant, cvt.version_num, cvt.effective_start_date,
-    cvt.effective_end_date, cf.enterprise_id
-from
-    argusmart.rm_case_followup as cf,
-    argusmart.case_version_table as cvt
-where
-    (cf.case_id = cvt.case_id) and
-    (cf.enterprise_id = cvt.enterprise_id) and
-    (convert(cf.effective_start_date,timestamp) <= cvt.effective_start_date) and
-    (convert(cf.effective_end_date,timestamp) > cvt.effective_start_date) and
-    (cf.deleted_flag = convert(0,bigdecimal))
-
---------------------
-
-select
-    cm.case_id, cm.global_num, cm.initial_justification, cm.workflow_seq_num,
-    cm.owner_id, cm.site_id, cm.susar, cm.close_user_id, cm.close_date,
-    cm.date_locked, cm.close_notes, cm.state_id, cm.last_state_id,
-    cm.requires_followup, cm.due_soon, cm.create_time, cm.followup_date,
-    cm.init_rept_date, cm.last_update_time, cm.safety_date, cm.worklist_owner_id,
-    cm.case_num, cm.e2b_ww_number, cm.country_id, cm.rpt_type_id, cm.user_id,
-    cm.last_update_user_id, cm.seriousness, cvt.version_num, cvt.effective_start_date,
-    cvt.effective_end_date, cm.enterprise_id
-from
-    argusmart.rm_case_master as cm,
-    argusmart.case_version_table as cvt
-where
-    (cvt.case_id = cm.case_id) and
-    (cvt.effective_start_date >= convert(cm.effective_start_date,timestamp)) and
-    (cvt.effective_start_date < convert(cm.effective_end_date,timestamp)) and
-    (cm.deleted_flag = convert(0,bigdecimal)) and
-    (cm.enterprise_id = cvt.enterprise_id)
-
---------------------
-
-select
-    a.enterprise_id, a.case_id, a.abbrev_narrative, a.abbrev_narrative_j, a.narrative,
-    a.narrative_j, b.version_num, b.effective_start_date, b.effective_end_date
-from
-    argusmart.rm_case_narrative as a,
-    argusmart.case_version_table as b
-where
-    (a.case_id = b.case_id) and
-    (a.effective_start_date <= b.effective_start_date) and
-    (a.effective_end_date > b.effective_start_date)
-
---------------------
-
-select
-    a.case_id, a.age_group_id, a.ethnicity_id, a.gender_id, a.pat_age, a.pat_subj_num,
-    a.pat_stat_preg, a.age_unit_id, b.version_num, b.effective_start_date,
-    b.effective_end_date, a.enterprise_id
-from
-    argusmart.rm_case_pat_info as a,
-    argusmart.case_version_table as b
-where
-    (a.case_id = b.case_id) and
-    (a.enterprise_id = b.enterprise_id) and
-    (a.deleted_flag = convert(0,bigdecimal)) and
-    (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
-    (convert(a.effective_end_date,timestamp) > b.effective_start_date)
-
---------------------
-
-select
-    a.case_id, a.seq_num, a.latency_seconds, a.rechall_stop, a.rechall_start,
-    a.total_dose, a.tampering, a.overdose, a.protocol, a.rechall_outcome,
-    a.rechallenge, a.n_siblings, a.cumulative_dose_unit_id, a.obtain_drug_country_id,
-    a.drug_auth_country_id, a.cumulative_dose, a.abuse, a.contraind, a.dechallenge,
-    a.act_taken_id, a.conc_units_id, a.formulation_id, a.concentration, a.severity_id,
-    a.interaction, a.prev_use, a.dechall_date, a.first_dose, a.last_dose,
-    a.duration_seconds, b.version_num, b.effective_start_date, b.effective_end_date,
-    a.enterprise_id, a.first_dose_partial, a.last_dose_partial
-from
-    argusmart.rm_case_prod_drugs as a,
-    argusmart.case_version_table as b
-where
-    (a.case_id = b.case_id) and
-    (a.enterprise_id = b.enterprise_id) and
-    (a.deleted_flag = 0) and
-    (a.effective_start_date <= b.effective_start_date) and
-    (a.effective_end_date > b.effective_start_date)
-
---------------------
-
-select
-    cp.sdrug_not_admin, cp.prod_reptd, cp.prod_coded, cp.case_id, cp.family_id,
-    cp.seq_num, cp.product_id, cp.drug_type, cp.pat_exposure, cp.manufacturer_id,
-    cp.first_sus_prod, cp.country_id, cp.who_drug_code, cp.co_drug_code,
-    cp.product_name, cp.generic_name, cvt.version_num, cvt.effective_start_date,
-    cvt.effective_end_date, cp.enterprise_id, cp.sort_id
-from
-    argusmart.rm_case_product as cp,
-    argusmart.case_version_table as cvt
-where
-    (cp.case_id = cvt.case_id) and
-    (cp.enterprise_id = cvt.enterprise_id) and
-    (convert(cp.effective_start_date,timestamp) <= cvt.effective_start_date) and
-    (convert(cp.effective_end_date,timestamp) > cvt.effective_start_date) and
-    (cp.deleted_flag = convert(0,bigdecimal))
-
---------------------
-
-select
-    a.enterprise_id, a.case_id, a.seq_num, a.media_id, a.occupation_id, a.hcp_flag,
-    a.primary_contact, a.corr_contact, a.reporter_type, a.intermediary_id, a.rpt_sent,
-    a.sort_id, a.confidential, a.country_id, a.reporter_id, a.institution,
-    a.institution_id, b.version_num, b.effective_start_date, b.effective_end_date
-from
-    argusmart.rm_case_reporters as a,
-    argusmart.case_version_table as b
-where
-    (a.case_id = b.case_id) and
-    (a.enterprise_id = b.enterprise_id) and
-    (a.deleted_flag = convert(0,bigdecimal)) and
-    (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
-    (convert(a.effective_end_date,timestamp) > b.effective_start_date)
-
---------------------
-
-select
-    a.case_id, a.blind_name, a.center_id, a.classification_id, a.code_broken,
-    a.dev_phase_id, a.other_id, a.study_desc, a.study_key, a.study_num, b.version_num,
-    b.effective_start_date, b.effective_end_date, a.enterprise_id
-from
-    argusmart.rm_case_study as a,
-    argusmart.case_version_table as b
-where
-    (a.case_id = b.case_id) and
-    (a.enterprise_id = b.enterprise_id) and
-    (a.deleted_flag = convert(0,bigdecimal)) and
-    (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
-    (convert(a.effective_end_date,timestamp) > b.effective_start_date)
+  a.case_id,
+  a.listedness,
+  a.outcome,
+  a.seriousness,
+  a.agent_suspect,
+  a.company_diagnosis,
+  b.version_num,
+  b.effective_start_date,
+  b.effective_end_date,
+  a.enterprise_id
+from
+  argusmart.rm_case_assess as a,
+  argusmart.case_version_table as b
+where
+  (a.case_id = b.case_id) and
+  (a.enterprise_id = b.enterprise_id) and
+  (a.deleted_flag = convert(0,bigdecimal)) and
+  (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
+  (convert(a.effective_end_date,timestamp) > b.effective_start_date)
+
+--------------------
+
+select
+  a.enterprise_id,
+  a.enterprise_id,
+  a.case_id,
+  a.seq_num,
+  a.classification_id,
+  a.deleted,
+  b.version_num,
+  b.effective_start_date,
+  b.effective_end_date
+from
+  argusmart.rm_case_classifications as a,
+  argusmart.case_version_table as b
+where
+  (a.case_id = b.case_id) and
+  (a.effective_start_date <= b.effective_start_date) and
+  (a.effective_end_date > b.effective_start_date)
+
+--------------------
+
+select
+  a.enterprise_id,
+  a.case_id,
+  a.seq_num,
+  a.desc_reptd,
+  a.desc_coded,
+  a.diagnosis,
+  a.onset,
+  a.onset_res,
+  a.onset_delay,
+  a.stop_date,
+  a.stop_date_res,
+  a.duration,
+  a.onset_latency,
+  a.evt_intensity_id,
+  a.evt_freq_id,
+  a.treated,
+  a.study_related,
+  a.rechall_related,
+  a.prod_seq_num,
+  a.evt_outcome_id,
+  a.receipt_date,
+  a.rpt_serious,
+  a.sc_death,
+  a.sc_hosp,
+  a.sc_cong_anom,
+  a.sc_threat,
+  a.sc_disable,
+  a.sc_int_req,
+  a.sc_other,
+  a.sc_other_text,
+  a.art_code,
+  a.pref_term,
+  a.inc_term,
+  a.body_sys,
+  a.med_serious,
+  a.past_hist,
+  a.dict_id,
+  a.dict_key,
+  a.code_status,
+  a.seriousness,
+  a.sort_id,
+  a.onset_date_partial,
+  a.stop_date_partial,
+  a.efficacy,
+  a.disease,
+  a.withdrawal,
+  a.hlgt,
+  a.hlt,
+  a.hlt_code,
+  a.hlgt_code,
+  a.soc_code,
+  a.study_dropped,
+  a.inc_code,
+  a.onset_minutes,
+  a.delay_minutes,
+  b.version_num,
+  b.effective_start_date,
+  b.effective_end_date
+from
+  argusmart.rm_case_event as a,
+  argusmart.case_version_table as b
+where
+  (a.case_id = b.case_id) and
+  (a.enterprise_id = b.enterprise_id) and
+  (a.deleted_flag = convert(0,bigdecimal)) and
+  (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
+  (convert(a.effective_end_date,timestamp) > b.effective_start_date)
+
+--------------------
+
+select
+  a.case_id,
+  a.prod_seq_num,
+  a.event_seq_num,
+  a.license_id,
+  a.datasheet_id,
+  a.source_id,
+  a.det_causality_id,
+  a.seq_num,
+  a.causality_score,
+  a.cause_justify,
+  a.listed_justify,
+  a.causality_assessment,
+  a.det_listedness_id,
+  a.rpt_causality_id,
+  a.prt_causality_id,
+  b.version_num,
+  b.effective_start_date,
+  b.effective_end_date,
+  a.enterprise_id
+from
+  argusmart.rm_case_event_assess as a,
+  argusmart.case_version_table as b
+where
+  (a.case_id = b.case_id) and
+  (a.enterprise_id = b.enterprise_id) and
+  (a.deleted_flag = convert(0,bigdecimal)) and
+  (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
+  (convert(a.effective_end_date,timestamp) > b.effective_start_date)
+
+--------------------
+
+select
+  cf.case_id
+  cf.seq_num
+  cf.auditlog_type
+  cf.time_stamp
+  cf.receipt_date,
+  cf.safety_date
+  cf.significant
+  cvt.version_num
+  cvt.effective_start_date,
+  cvt.effective_end_date
+  cf.enterprise_id
+from
+  argusmart.rm_case_followup as cf,
+  argusmart.case_version_table as cvt
+where
+  (cf.case_id = cvt.case_id) and
+  (cf.enterprise_id = cvt.enterprise_id) and
+  (convert(cf.effective_start_date,timestamp) <= cvt.effective_start_date) and
+  (convert(cf.effective_end_date,timestamp) > cvt.effective_start_date) and
+  (cf.deleted_flag = convert(0,bigdecimal))
+
+--------------------
+
+select
+  cm.case_id
+  cm.global_num
+  cm.initial_justification
+  cm.workflow_seq_num,
+  cm.owner_id
+  cm.site_id
+  cm.susar
+  cm.close_user_id
+  cm.close_date,
+  cm.date_locked
+  cm.close_notes
+  cm.state_id
+  cm.last_state_id,
+  cm.requires_followup
+  cm.due_soon
+  cm.create_time
+  cm.followup_date,
+  cm.init_rept_date
+  cm.last_update_time
+  cm.safety_date
+  cm.worklist_owner_id,
+  cm.case_num
+  cm.e2b_ww_number
+  cm.country_id
+  cm.rpt_type_id
+  cm.user_id,
+  cm.last_update_user_id
+  cm.seriousness
+  cvt.version_num
+  cvt.effective_start_date,
+  cvt.effective_end_date
+  cm.enterprise_id
+from
+  argusmart.rm_case_master as cm,
+  argusmart.case_version_table as cvt
+where
+  (cvt.case_id = cm.case_id) and
+  (cvt.effective_start_date >= convert(cm.effective_start_date,timestamp)) and
+  (cvt.effective_start_date < convert(cm.effective_end_date,timestamp)) and
+  (cm.deleted_flag = convert(0,bigdecimal)) and
+  (cm.enterprise_id = cvt.enterprise_id)
+
+--------------------
+
+select
+  a.enterprise_id
+  a.case_id
+  a.abbrev_narrative
+  a.abbrev_narrative_j
+  a.narrative,
+  a.narrative_j
+  b.version_num
+  b.effective_start_date
+  b.effective_end_date
+from
+  argusmart.rm_case_narrative as a,
+  argusmart.case_version_table as b
+where
+  (a.case_id = b.case_id) and
+  (a.effective_start_date <= b.effective_start_date) and
+  (a.effective_end_date > b.effective_start_date)
+
+--------------------
+
+select
+  a.case_id
+  a.age_group_id
+  a.ethnicity_id
+  a.gender_id
+  a.pat_age
+  a.pat_subj_num,
+  a.pat_stat_preg
+  a.age_unit_id
+  b.version_num
+  b.effective_start_date,
+  b.effective_end_date
+  a.enterprise_id
+from
+  argusmart.rm_case_pat_info as a,
+  argusmart.case_version_table as b
+where
+  (a.case_id = b.case_id) and
+  (a.enterprise_id = b.enterprise_id) and
+  (a.deleted_flag = convert(0,bigdecimal)) and
+  (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
+  (convert(a.effective_end_date,timestamp) > b.effective_start_date)
+
+--------------------
+
+select
+  a.case_id
+  a.seq_num
+  a.latency_seconds
+  a.rechall_stop
+  a.rechall_start,
+  a.total_dose
+  a.tampering
+  a.overdose
+  a.protocol
+  a.rechall_outcome,
+  a.rechallenge
+  a.n_siblings
+  a.cumulative_dose_unit_id
+  a.obtain_drug_country_id,
+  a.drug_auth_country_id
+  a.cumulative_dose
+  a.abuse
+  a.contraind
+  a.dechallenge,
+  a.act_taken_id
+  a.conc_units_id
+  a.formulation_id
+  a.concentration
+  a.severity_id,
+  a.interaction
+  a.prev_use
+  a.dechall_date
+  a.first_dose
+  a.last_dose,
+  a.duration_seconds
+  b.version_num
+  b.effective_start_date
+  b.effective_end_date,
+  a.enterprise_id
+  a.first_dose_partial
+  a.last_dose_partial
+from
+  argusmart.rm_case_prod_drugs as a,
+  argusmart.case_version_table as b
+where
+  (a.case_id = b.case_id) and
+  (a.enterprise_id = b.enterprise_id) and
+  (a.deleted_flag = 0) and
+  (a.effective_start_date <= b.effective_start_date) and
+  (a.effective_end_date > b.effective_start_date)
+
+--------------------
+
+select
+  cp.sdrug_not_admin
+  cp.prod_reptd
+  cp.prod_coded
+  cp.case_id
+  cp.family_id,
+  cp.seq_num
+  cp.product_id
+  cp.drug_type
+  cp.pat_exposure
+  cp.manufacturer_id,
+  cp.first_sus_prod
+  cp.country_id
+  cp.who_drug_code
+  cp.co_drug_code,
+  cp.product_name
+  cp.generic_name
+  cvt.version_num
+  cvt.effective_start_date,
+  cvt.effective_end_date
+  cp.enterprise_id
+  cp.sort_id
+from
+  argusmart.rm_case_product as cp,
+  argusmart.case_version_table as cvt
+where
+  (cp.case_id = cvt.case_id) and
+  (cp.enterprise_id = cvt.enterprise_id) and
+  (convert(cp.effective_start_date,timestamp) <= cvt.effective_start_date) and
+  (convert(cp.effective_end_date,timestamp) > cvt.effective_start_date) and
+  (cp.deleted_flag = convert(0,bigdecimal))
+
+--------------------
+
+select
+  a.enterprise_id
+  a.case_id
+  a.seq_num
+  a.media_id
+  a.occupation_id
+  a.hcp_flag,
+  a.primary_contact
+  a.corr_contact
+  a.reporter_type
+  a.intermediary_id
+  a.rpt_sent,
+  a.sort_id
+  a.confidential
+  a.country_id
+  a.reporter_id
+  a.institution,
+  a.institution_id
+  b.version_num
+  b.effective_start_date
+  b.effective_end_date
+from
+  argusmart.rm_case_reporters as a,
+  argusmart.case_version_table as b
+where
+  (a.case_id = b.case_id) and
+  (a.enterprise_id = b.enterprise_id) and
+  (a.deleted_flag = convert(0,bigdecimal)) and
+  (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
+  (convert(a.effective_end_date,timestamp) > b.effective_start_date)
+
+--------------------
+
+select
+  a.case_id
+  a.blind_name
+  a.center_id
+  a.classification_id
+  a.code_broken,
+  a.dev_phase_id
+  a.other_id
+  a.study_desc
+  a.study_key
+  a.study_num
+  b.version_num,
+  b.effective_start_date
+  b.effective_end_date
+  a.enterprise_id
+from
+  argusmart.rm_case_study as a,
+  argusmart.case_version_table as b
+where
+  (a.case_id = b.case_id) and
+  (a.enterprise_id = b.enterprise_id) and
+  (a.deleted_flag = convert(0,bigdecimal)) and
+  (convert(a.effective_start_date,timestamp) <= b.effective_start_date) and
+  (convert(a.effective_end_date,timestamp) > b.effective_start_date)

 --------------------

@@ -227,35 +414,51 @@
 --------------------

 select
-    argusmart.rm_lm_product.enterprise_id, argusmart.rm_lm_product.product_id,
-    argusmart.rm_lm_product.prod_name, argusmart.rm_lm_product.family_id,
-    argusmart.rm_lm_product.formulation_id, argusmart.rm_lm_product.manufacturer_id,
-    argusmart.rm_lm_product.concentration, argusmart.rm_lm_product.conc_unit_id,
-    argusmart.rm_lm_product.indication_id, argusmart.rm_lm_product.code_dict,
-    argusmart.rm_lm_product.indication_text, argusmart.rm_lm_product.intl_birth_date,
-    argusmart.rm_lm_product.model_no, argusmart.rm_lm_product.drug_code,
-    argusmart.rm_lm_product.prod_generic_name, argusmart.rm_lm_product.ind_llt_code,
-    argusmart.rm_lm_product.ind_llt, argusmart.rm_lm_product.ind_hlt_code,
-    argusmart.rm_lm_product.ind_hlt, argusmart.rm_lm_product.ind_hlgt_code,
-    argusmart.rm_lm_product.ind_hlgt, argusmart.rm_lm_product.ind_soc_code,
-    argusmart.rm_lm_product.ind_soc, argusmart.rm_lm_product.ind_syn_code,
-    argusmart.rm_lm_product.ind_code_status, argusmart.rm_lm_product.prod_name_abbrv,
-    argusmart.rm_lm_product.ind_coded, argusmart.rm_lm_product.ind_reptd
-from
-    argusmart.rm_lm_product
-where
-    argusmart.rm_lm_product.deleted is null
-
---------------------
-
-select
-    argusmart.rm_lm_product_family.enterprise_id,
-    argusmart.rm_lm_product_family.family_id, argusmart.rm_lm_product_family.name,
-    argusmart.rm_lm_product_family.primary_view,
-    argusmart.rm_lm_product_family.product_group_id,
-    argusmart.rm_lm_product_family.deleted, argusmart.rm_lm_product_family.name_j
-from
-    argusmart.rm_lm_product_family
+  argusmart.rm_lm_product.enterprise_id
+  argusmart.rm_lm_product.product_id,
+  argusmart.rm_lm_product.prod_name
+  argusmart.rm_lm_product.family_id,
+  argusmart.rm_lm_product.formulation_id
+  argusmart.rm_lm_product.manufacturer_id,
+  argusmart.rm_lm_product.concentration
+  argusmart.rm_lm_product.conc_unit_id,
+  argusmart.rm_lm_product.indication_id
+  argusmart.rm_lm_product.code_dict,
+  argusmart.rm_lm_product.indication_text
+  argusmart.rm_lm_product.intl_birth_date,
+  argusmart.rm_lm_product.model_no
+  argusmart.rm_lm_product.drug_code,
+  argusmart.rm_lm_product.prod_generic_name
+  argusmart.rm_lm_product.ind_llt_code,
+  argusmart.rm_lm_product.ind_llt
+  argusmart.rm_lm_product.ind_hlt_code,
+  argusmart.rm_lm_product.ind_hlt
+  argusmart.rm_lm_product.ind_hlgt_code,
+  argusmart.rm_lm_product.ind_hlgt
+  argusmart.rm_lm_product.ind_soc_code,
+  argusmart.rm_lm_product.ind_soc
+  argusmart.rm_lm_product.ind_syn_code,
+  argusmart.rm_lm_product.ind_code_status
+  argusmart.rm_lm_product.prod_name_abbrv,
+  argusmart.rm_lm_product.ind_coded
+  argusmart.rm_lm_product.ind_reptd
+from
+  argusmart.rm_lm_product
+where
+  argusmart.rm_lm_product.deleted is null
+
+--------------------
+
+select
+  argusmart.rm_lm_product_family.enterprise_id,
+  argusmart.rm_lm_product_family.family_id
+  argusmart.rm_lm_product_family.name,
+  argusmart.rm_lm_product_family.primary_view,
+  argusmart.rm_lm_product_family.product_group_id,
+  argusmart.rm_lm_product_family.deleted
+  argusmart.rm_lm_product_family.name_j
+from
+  argusmart.rm_lm_product_family

 --------------------


add a numeric index for year

add a numeric index for year

(no way to query it yet thobut)

--- src/sledge/db.clj
+++ src/sledge/db.clj
@@ -47,6 +47,11 @@
            :tokenize-query lower-words}
    :title {:tokenize-tags (comp #'lower-words :title)
            :tokenize-query lower-words}
+   :year {:empty-map (sorted-map)
+          :tokenize-tags #(if-let [y (:year %)]
+                            (vector (Integer/parseInt y))
+                            [])
+          :tokenize-query #(vector (Integer/parseInt %))}
    })

 ;; for each entry [k v] in adjuncts, create map entry
@@ -57,7 +62,8 @@
 (defn adjunctivize [name-map]
   (reduce
    (fn [m [attr tok]]
-     (assoc m attr (make-adjunct-index name-map (:tokenize-tags tok))))
+     (let [empty (get tok :empty-map {})]
+       (assoc m attr (assoc-adjunct-index empty name-map (:tokenize-tags tok)))))
    {}
    adjuncts))

@@ -112,7 +118,7 @@
          paths)))

 ;; haven't considered numeric fields yet.  need to build some
-;; sorted-maps or similar
+;; sorted-maps and then use subseq to get the data out

 ;; the main index maps from pathname to hash of tags


Add Project Token API Path Util

Add Project Token API Path Util

--- src-cljs/frontend/api/path.cljs
+++ src-cljs/frontend/api/path.cljs
@@ -37,6 +37,24 @@
                "/api/v1/project/%s/%s/plan"
                org repo)))

+(defn project-tokens  [vcs-type project-name]
+  (case vcs-type
+    "bitbucket" (gstring/format
+                  "/api/dangerzone/project/%s/%s/token"
+                  vcs-type project-name)
+    "github" (gstring/format
+               "/api/v1/project/%s/token"
+               project-name)))
+
+(defn project-token [vcs-type project-name token]
+  (case vcs-type
+    "bitbucket" (gstring/format
+                  "/api/dangerzone/project/%s/%s/token/%s"
+                  vcs-type project-name token)
+    "github" (gstring/format
+               "/api/v1/project/%s/token/%s"
+               project-name token)))
+
 (defn build-retry [vcs-type org-name repo-name build-num]
   (case vcs-type
     "bitbucket" (gstring/format


Pass React elements, not Sablono vectors

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -1769,9 +1769,10 @@

         (when show-modal?
           (modal/modal-dialog {:title "Upload a New Apple Code Signing Key"
-                               :body [:div
-                                      (om/build common/flashes error-message)
-                                      upload-form]
+                               :body (html
+                                      [:div
+                                       (om/build common/flashes error-message)
+                                       upload-form])
                                :actions [upload-button]
                                :close-fn close-fn}))))))


(SERVER-797) Change test-503-app-shut-down to stop app even on error

Previously, if the `test-503-when-app-shuts-down` test encounters an
error after an app has been started but before it is shut down, the
Jetty webserver that the test spawned would keep on running -
potentially causing many tests downstream to fail as well.  This commit
adds some cleanup logic which attempts to stop the all services
(including the Jetty webserver) in the event that an unexpected error
causes the test to fail before all assertions are made.

--- test/integration/puppetlabs/services/jruby/jruby_puppet_pool_int_test.clj
+++ test/integration/puppetlabs/services/jruby/jruby_puppet_pool_int_test.clj
@@ -221,7 +221,8 @@
                        (jruby-testutils/jruby-puppet-config {:max-active-instances 2
                                                              :borrow-timeout
                                                              default-borrow-timeout}))
-                      (assoc-in [:webserver :port] 8081))
+                      (assoc :webserver {:port 8081
+                                         :shutdown-timeout-seconds 1}))
            mock-jruby-puppet-fn (partial jruby-testutils/create-mock-jruby-puppet
                                          (fn [_]
                                            (JRubyPuppetResponse.
@@ -240,32 +241,55 @@
                      (jruby-testutils/mock-jruby-pool-manager-service
                       config
                       mock-jruby-puppet-fn)]
+           jruby-instance (atom nil)
            app (tk/boot-services-with-config services config)
-           cert (ssl-utils/pem->cert
-                 (str test-resources-dir "/localhost-cert.pem"))
-           jruby-service (tk-app/get-service app :JRubyPuppetService)
-           jruby-instance (jruby-testutils/borrow-instance jruby-service :i-want-this-instance)
-           handler-service (tk-app/get-service app :RequestHandlerService)
-           request {:uri "/puppet/v3/environments", :params {}, :headers {},
-                    :request-method :GET, :body "", :ssl-client-cert cert, :content-type ""}
-           ping-environment #(->> request (handler-core/wrap-params-for-jruby) (handler/handle-request handler-service))
-           ping-before-stop (ping-environment)
-           stop-complete? (future (tk-app/stop app))]
-       (is (= 200 (:status ping-before-stop))
-           "environment request before stop failed")
-       (let [start (System/currentTimeMillis)]
-         (logging/with-test-logging
-          (while (and
-                  (< (- (System/currentTimeMillis) start) 10000)
-                  (not= 503 (:status (ping-environment))))
-            (Thread/yield))
-          (is (= 503 (:status (ping-environment)))))
-         (jruby-testutils/return-instance jruby-service jruby-instance :i-want-this-instance)
-         (is (not= :timed-out (timed-deref stop-complete?))
-             (str "timed out waiting for the stop to complete, stack:\n"
-                  (get-all-stack-traces-as-str)))
-         (logging/with-test-logging
-          (is (= 503 (:status (ping-environment))))))))))
+           jruby-service (tk-app/get-service app :JRubyPuppetService)]
+       (try
+         (let [cert (ssl-utils/pem->cert
+                     (str test-resources-dir "/localhost-cert.pem"))
+               _ (reset! jruby-instance (jruby-testutils/borrow-instance
+                                         jruby-service
+                                         :i-want-this-instance))
+               handler-service (tk-app/get-service app :RequestHandlerService)
+               request {:uri "/puppet/v3/environments", :params {}, :headers {},
+                        :request-method :GET, :body "", :ssl-client-cert cert, :content-type ""}
+               ping-environment #(->> request (handler-core/wrap-params-for-jruby) (handler/handle-request handler-service))
+               ping-before-stop (ping-environment)
+               stop-complete? (future (tk-app/stop app))]
+           (is (= 200 (:status ping-before-stop))
+               "environment request before stop failed")
+           (let [start (System/currentTimeMillis)]
+             (logging/with-test-logging
+              (while (and
+                      (< (- (System/currentTimeMillis) start) 10000)
+                      (not= 503 (:status (ping-environment))))
+                (Thread/yield))
+              (is (= 503 (:status (ping-environment)))))
+             (jruby-testutils/return-instance jruby-service
+                                              @jruby-instance
+                                              :i-want-this-instance)
+             (reset! jruby-instance nil)
+             (is (not= :timed-out (timed-deref stop-complete?))
+                 (str "timed out waiting for the stop to complete, stack:\n"
+                      (get-all-stack-traces-as-str)))
+             (logging/with-test-logging
+              (is (= 503 (:status (ping-environment)))))))
+         (finally
+           ;; Return the borrowed instance to the pool in case it hadn't
+           ;; been returned previously.  This is done before stop is called
+           ;; so that the jruby-puppet-pooled-service will hopefully be able
+           ;; to be stopped (with all instances back in the pool).
+           (if-let [instance @jruby-instance]
+             (jruby-testutils/return-instance jruby-service
+                                              instance
+                                              :i-want-this-instance))
+           ;; Stop the tk app.  In success cases, this will end up being done
+           ;; twice - which is benign.  This is done in the finally block so
+           ;; that it is done even if the test errors out prematurely.  Not
+           ;; doing so could leave a Jetty webserver running indefinitely -
+           ;; causing many tests downstream from this one that try to create
+           ;; new Jetty servers to fail.
+           (tk-app/stop app)))))))

 (deftest ^:integration test-503-when-jruby-is-first-to-shutdown
   (testing "During a shutdown requests result in 503 http responses"


Switch to om/RenderState instead of om/Render for the Heroku API token form, use an :input{:type submit} instead of an :a element for the form, rework the submit logic.

--- frontend/components/account.cljs
+++ frontend/components/account.cljs
@@ -61,18 +61,25 @@
              user-and-orgs)]]])))))

 ;; XXX 1. How can we re-enable the form after it's been processed?
+;; 2. I don't want the submit event to fire unless there's actually
+;; input (or some other predicate is met), but the managed-button
+;; seems to wrap/override my on-click event
 (defn heroku-key [app owner]
   (reify
-    om/IRender
-    (render [_]
-      (let [controls-ch          (om/get-shared owner [:comms :controls])
-            heroku-api-key       (get-in app (conj state/user-path :heroku_api_key))
-            heroku-api-key-input (str (om/get-state owner :heroku-api-key-input))
-            processing-form?     (om/get-state owner :processing?)
-            form-processed?      false
-            submit-form!         #(when (seq heroku-api-key-input)
-                                    (om/set-state! owner :processing? true)
-                                    (put! controls-ch [:heroku-key-add-attempted {:heroku_api_key %}]))]
+    om/IInitState
+    (init-state [_]
+      {:processing? false})
+    om/IRenderState
+    (render-state [_ _]
+      (let [controls-ch               (om/get-shared owner [:comms :controls])
+            set-heroku-api-key-input! #(om/set-state! owner :heroku-api-key-input %)
+            heroku-api-key            (get-in app (conj state/user-path :heroku_api_key))
+            heroku-api-key-input      (str (om/get-state owner :heroku-api-key-input))
+            processing-form?          (om/get-state owner :processing?)
+            form-processed?           false
+            submit-form!              #(when (seq heroku-api-key-input)
+                                         (om/set-state! owner :processing? true)
+                                         (put! controls-ch [:heroku-key-add-attempted {:heroku_api_key %}]))]
         (html/html
          [:div#settings-heroku
           [:div.heroku-item
@@ -86,9 +93,6 @@
             [:br]
             "You'll also need to set yourself as the Heroku deploy user from your project's settings page."]
            [:form
-            {:on-submit (fn [event]
-                          (.preventDefault event)
-                          (submit-form! heroku-api-key-input))}
             (when heroku-api-key
               [:div
                [:input.disabled
@@ -102,15 +106,19 @@
               :value     heroku-api-key-input
               :class     (when processing-form?
                            "disabled")
-              :on-change  (fn [event]
-                            (om/set-state! owner :heroku-api-key-input (.. event -target -value)))}]
+              :on-change  #(set-heroku-api-key-input! (.. % -target -value))}]
             [:label {:placeholder "Add new key"}]
             (forms/managed-button
-             [:a {:data-loading-text "Saving...",
-                  :data-failed-text  "Failed to save Heroku key",
-                  :data-success-text "Saved",
-                  :on-click          #(submit-form! heroku-api-key-input)}
-              "Save Heroku key"])]]])))))
+             [:input
+              {:data-loading-text "Saving...",
+               :data-failed-text  "Failed to save Heroku key",
+               :data-success-text "Saved",
+               :type "submit"
+               :value "Save Heroku key"
+               :on-click          (fn [event]
+                                    (when (seq (.. event -target -value))
+                                      (submit-form! heroku-api-key-input))
+                                    false)}])]]])))))

 ;; XXX 1. Not finished - how to tie form-submit to managed-button?
 ;; 2. Disable form while creating


Manually convert to byte bufs

Manually convert to byte bufs

--- test/caesium/magicnonce/secretbox_test.clj
+++ test/caesium/magicnonce/secretbox_test.clj
@@ -32,8 +32,11 @@
     (is (= (+ s/noncebytes s/macbytes ptextlen)
            (bb/buflen ctext)))

-    (let [out (byte-array ptextlen)]
-      (ms/decrypt-to-buf! out st/secret-key ctext)
+    (let [out (bb/alloc ptextlen)]
+      (ms/decrypt-to-buf!
+       out
+       (bb/->indirect-byte-buf st/secret-key)
+       (bb/->indirect-byte-buf ctext))
       (is (u/array-eq st/ptext out)))

     (let [out (bb/alloc ptextlen)


correct prices permission test

correct prices permission test

--- test/clj_money/permissions/prices_test.clj
+++ test/clj_money/permissions/prices_test.clj
@@ -47,17 +47,21 @@
 (deftest price-list
   (let [context (serialization/realize storage-spec prices-context)
         [john jane] (find-users context "john@doe.com" "jane@doe.com")
-        commodity (find-commodity context "AAPL")]
+        commodity (find-commodity context "AAPL")
+        criteria {:commodity-id (:id commodity)
+                  :trade-date [:between
+                               (t/local-date 2017 1 1)
+                               (t/local-date 2017 12 31)]}]
     (testing "A user has permission to list prices for commodities in his entities"
       (with-authentication john
-        (is (not= 0 (->> (apply-scope {:commodity-id (:id commodity)} :price)
+        (is (not= 0 (->> (apply-scope criteria :price)
                          (prices/search storage-spec)
                          count))
             "The prices are returned")))
     (testing "A user does not have permission to list prices for commodities in someone else's entity"
       (with-authentication jane
         (is (thrown+? [:type :clj-money.authorization/unauthorized]
-                     (->> (apply-scope {:commodity-id (:id commodity)} :price)
+                     (->> (apply-scope criteria :price)
                           (prices/search storage-spec)
                           count)))))))


Function to add new word should word with blacklist and atomic typos as well

--- src/zg/server.clj
+++ src/zg/server.clj
@@ -133,13 +133,14 @@
 (defn process-add-word
     "Add word provided by user (together with its description) to the blacklist or into atomic typos."
     [request title emender-page mode]
-    (let [word        (read-string-parameter request "new-word")
-          description (read-string-parameter request "description")
-          proper-word (dictionary-interface/proper-word-for-blacklist? word)
-          user-name (get-user-name request)
-          message   (add-word-message word proper-word)]
+    (let [word         (read-string-parameter request "new-word")
+          description  (read-string-parameter request "description")
+          correct-form (read-string-parameter request "correct-word")
+          proper-word  (dictionary-interface/proper-word-for-blacklist? word)
+          user-name    (get-user-name request)
+          message      (add-word-message word proper-word)]
           (if (and proper-word (seq word))
-              (dictionary-interface/store-word word description user-name mode))
+              (dictionary-interface/store-word word correct-form description user-name mode))
         (finish-processing request nil message title emender-page mode)))

 (defn process-add-words


(SERVER-1743) Rework check-for-updates tests for timing issues

Previously, the check-for-updates tests could intermittently fail
because the check-for-updates call can happen later than when assertions
for the call are made.  In this commit, the tests have been reworked to
wait a longer period of time for the call to be made.  To minimize test
run time, the maximum wait time is much longer for the opt-in case vs.
the opt-out case.

--- test/integration/puppetlabs/services/analytics/analytics_service_test.clj
+++ test/integration/puppetlabs/services/analytics/analytics_service_test.clj
@@ -7,13 +7,14 @@

 (deftest ^:integration version-check-test
   (testing "master calls into the dujour version check library using the correct values"
-    ; This atom will store the parameters passed to the version-check-test-fn, which allows us to keep the
+    ; This promise will store the parameters passed to the version-check-test-fn, which allows us to keep the
     ; assertions about their values inside the version-check-test and will also ensure failures will appear if
     ; the master stops calling the check-for-updates! function
-    (let [version-check-params (atom {})
+    (let [version-check-params (promise)
           version-check-test-fn (fn [request-values update-server-url]
-                                  (swap! version-check-params #(assoc % :request-values request-values
-                                                                        :update-server-url update-server-url)))]
+                                  (deliver version-check-params
+                                           {:request-values request-values
+                                            :update-server-url update-server-url}))]
       (with-redefs
        [version-check/check-for-updates! version-check-test-fn]
         (logutils/with-test-logging
@@ -26,18 +27,26 @@
            :product {:update-server-url "http://notarealurl/"
                      :name {:group-id "puppets"
                             :artifact-id "yoda"}}}
-          (is (= {:group-id "puppets" :artifact-id "yoda"}
-                 (get-in @version-check-params [:request-values :product-name])))
-          (is (= "http://notarealurl/" (:update-server-url @version-check-params))))))))
+          (let [params-received (deref version-check-params 30000
+                                       {:request-values
+                                        {:product-name
+                                         :no-product-name-received-before-time-out-reached}
+                                        :update-server-url
+                                        :no-update-server-url-received-before-time-out-reached})]
+            (is (= {:group-id "puppets" :artifact-id "yoda"}
+                   (get-in params-received [:request-values :product-name])))
+            (is (= "http://notarealurl/"
+                   (:update-server-url params-received)))))))))

   (testing "master does not make an analytics call to dujour if opt-out exists"
-    ; This atom will store the parameters passed to the version-check-test-fn, which allows us to keep the
+    ; This promise will store the parameters passed to the version-check-test-fn, which allows us to keep the
     ; assertions about their values inside the version-check-test and will also ensure failures will appear if
     ; the master stops calling the check-for-updates! function
-    (let [version-check-params  (atom {})
+    (let [version-check-params  (promise)
           version-check-test-fn (fn [request-values update-server-url]
-                                  (swap! version-check-params #(assoc % :request-values request-values
-                                                                        :update-server-url update-server-url)))]
+                                  (deliver version-check-params
+                                           {:request-values request-values
+                                            :update-server-url update-server-url}))]
       (with-redefs
        [version-check/check-for-updates! version-check-test-fn]
         (logutils/with-test-logging
@@ -51,5 +60,8 @@
                      :name {:group-id "puppets"
                             :artifact-id "yoda"}
                      :check-for-updates false}}
-          (is (= nil (get-in @version-check-params [:request-values :product-name])))
-          (is (= nil (:update-server-url @version-check-params)))))))))
+          (is (logutils/logged?
+               #"Not checking for updates - opt-out setting exists" :info))
+          (let [params-received (deref version-check-params 100
+                                       :no-params-received-before-time-out-reached)]
+            (is (= :no-params-received-before-time-out-reached params-received)))))))))


CMR-3200: Fixing failing test.

CMR-3200: Fixing failing test.

--- system-int-test/test/cmr/system_int_test/ingest/collection_validation_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/collection_validation_test.clj
@@ -339,7 +339,7 @@
                                                       (dc/psa {:name "bool2" :data-type :boolean :value true})]})
                              {:allow-failure? true})]
       (is (= {:status 422
-              :errors ["object has missing required properties ([\"Platforms\",\"ProcessingLevel\",\"RelatedUrls\",\"ScienceKeywords\",\"SpatialExtent\"])"]}
+              :errors ["object has missing required properties ([\"ProcessingLevel\",\"RelatedUrls\",\"ScienceKeywords\",\"SpatialExtent\"])"]}
              (select-keys response [:status :errors]))))
     ;; disable return of schema validation errors from API
     (side/eval-form `(icfg/set-return-umm-json-validation-errors! false))


return url in map

return url in map

--- src/ads_txt_crawler/crawl.clj
+++ src/ads_txt_crawler/crawl.clj
@@ -62,8 +62,8 @@
     ;; - ignore commented lines
     ;; - parse lines into map of values
     ;; - ignore
-    (let [rtn {:domain domain}
-          {:keys [status headers body error] :as resp} (h/fixup-stream (h/get-url url))]
+    (let [rtn {:domain domain :url url}
+          {:keys [status headers body error] :as resp} (h/fixup-stream (h/get-url url))]   ;; TODO Consider returning the body to save elsewhere
       (if error
         (assoc rtn :error true :message (format "Error: %s for %s" (.toString error) url))
         (if status


Yes, we can use maps too!

Yes, we can use maps too!

--- src/adventofcode1/clpfd10.clj
+++ src/adventofcode1/clpfd10.clj
@@ -191,19 +191,19 @@
   (fresh [x y wolf goat cabbage]
     (conde
      [(== s1 [x x goat cabbage])
-      (== c [x :wolf y])
+      (== c {:from x :who :wolf :to y})
       (== s2 [y y goat cabbage])
       (change x y)]
      [(== s1 [x wolf x cabbage])
-      (== c [x :goat y])
+      (== c {:from x :who :goat :to y})
       (== s2 [y wolf y cabbage])
       (change x y)]
      [(== s1 [x wolf goat x])
-      (== c [x :cabbage y])
+      (== c {:from x :who :cabbage :to y})
       (== s2 [y wolf goat y])
       (change x y)]
      [(== s1 [x wolf goat cabbage])
-      (== c [x :nothing y])
+      (== c {:from x :who :nothing :to y})
       (== s2 [y wolf goat cabbage])
       (change x y)])))


Only run auto-bind thread when user wants it.

--- src/afterglow/controllers.clj
+++ src/afterglow/controllers.clj
@@ -34,11 +34,26 @@

 (declare bind-to-show)

+(defonce ^:private ^{:doc "The thread used to run [[bind-bottleneck]]
+  and serialize the auto-binding of potential controllers that have
+  been found."}
+  auto-bind-thread
+  (atom nil))
+
 (defn- bind-bottleneck
   "Takes potential auto-bind devices from the incoming queue one by
   one and tries binding to them. This is used to make sure that we are
   only trying one device at a time, taking as long as it needs,
-  without backing up the main MIDI event handler thread."
+  without backing up the main MIDI event handler thread.
+
+  Entries on the cue are a tuple containing the device which has been
+  identified as a potential new controller port, the show to which it
+  should be bound if it turns out to be suitable, and any optional
+  arguments which should be passed along to [[bind-to-show]].
+
+  If the special flag value `:done` is passed as the third element in
+  the tuple, it signals the loop to end, because auto-binding has been
+  canceled."
   []
   (loop [[device show args] (.take bind-queue)]
     (when device
@@ -51,12 +66,10 @@
         (catch Exception e
           (timbre/error e "Problem binding to controller"))))

-    ;; Wait for the next candidate device
-    (recur (.take bind-queue))))
-
-(defonce ^:private ^{:doc "The thread used to run [[bind-bottleneck]]."}
-  auto-bind-thread
-  (atom nil))
+    ;; Wait for the next candidate device, unless we have been told to end
+    (when-not (= args :done)
+      (recur (.take bind-queue))))
+  (swap! auto-bind-thread (constantly nil)))

 (defn- start-auto-bind-thread
   "Creates the thread used to serialize auto-bind attempts."
@@ -89,11 +102,8 @@
   which rely on controller implementations need to call this function
   to ensure loading has occurred. After the first call, the list of
   namespaces will be replaced by `nil`, so it will no longer do
-  anything.
-
-  Also ensures the auto-bind thread has been started."
+  anything."
   []
-  (swap! auto-bind-thread start-auto-bind-thread)
   (swap! built-in-controllers
          (fn [namespaces]
            (doseq [n namespaces]
@@ -870,6 +880,7 @@
   [show & {:keys [device-filter] :as args}]
   {:pre [(have? some? show)]}
   (load-built-in-controllers)  ; Make sure controller implementations are registered
+  (swap! auto-bind-thread start-auto-bind-thread)  ; Make sure the auto-bind thread is running
   (letfn [(connection-handler
             ([device]
              (connection-handler device true))
@@ -882,7 +893,7 @@
                                                     {:auto-binding   true
                                                      :new-connection new-connection})]))))]

-    ;; See if our controller seems to already be connected, and if so, try bind to it right away.
+    ;; See if any eligible controller seems to already be connected, and if so, try bind to it right away.
     (doseq [found (amidi/filter-devices device-filter (amidi/open-inputs-if-needed!))]
       (when-not (already-bound? found) (connection-handler found false)))

@@ -897,7 +908,8 @@
 (defn cancel-auto-bind
   "Stop any [[auto-bind]] which may be in effect."
   []
-  (swap! auto-bind-handler (fn [former-handler]
+  (swap! auto-bind-handler (fn [former-handler]  ; Stop noticing new device connections
                              (when former-handler
                                (amidi/remove-new-device-handler! former-handler))
-                             nil)))
+                             nil))
+  (.add bind-queue [nil nil :done]))  ; Tell the auto-bind thread to shut down


move :propernoun from [:synsem :sem] to [:sem] (as with espanol)

--- src/babel/english/lexicon.clj
+++ src/babel/english/lexicon.clj
@@ -11,19 +11,18 @@
   {
    "Antonia"
    {:synsem {:sem {:pred :antonia
-                   :propernoun true
                    :human true}
+             :propernoun true
              :agr {:number :sing
                    :person :3rd
                    :gender :fem}}}
-
    "Antonio"
-   {:synsem {:agr {:number :sing
+   {:synsem {:propernoun true
+             :agr {:number :sing
                    :person :3rd
                    :gender :masc}
-             :sem {:pred :antonio
-                   :propernoun true
-                   :human true}}}
+             :sem {:pred :antonio}
+                   :human true}}
    "a"
    {:synsem {:cat :det
              :def :indef
@@ -97,7 +96,7 @@
                   {:synsem {:sem {:pred :be}}})
            (let [subject-semantics (ref {:spec {:def :possessive}
                                          :pred :name})
-                 object-semantics (ref {:propernoun true})]
+                 object-semantics (ref :top)]
              (merge common
                     {:intransitivize false
                      :synsem {:sem {:pred :be-called
@@ -703,8 +702,8 @@
                     {:synsem {:sem {:pred :hurt
                                     :obj {:animate true}}}})])
    "Juan" {:synsem {:sem {:pred :Juan
-                          :propernoun true
                           :human true}
+                    :propernoun true
                     :agr {:number :sing
                           :person :3rd
                           :gender :masc}}}


add imperfect for ‘be missing’

add imperfect for ‘be missing’

--- src/babel/english/lexicon.clj
+++ src/babel/english/lexicon.clj
@@ -105,7 +105,14 @@
                                     :2plur "are missed"
                                     :3plur "are missed"}}}

-   "be missing" {:english {:present {:1sing "am missing"
+   ;; TODO: for imperfect, generates things like 'he was be missinging'.
+   "be missing" {:english {:imperfect {:1sing "was missing"
+                                       :2sing "were missing"
+                                       :3sing "was missing"
+                                       :1plur "were missing"
+                                       :2plur "were missing"
+                                       :3plur "were missing"}
+                           :present {:1sing "am missing"
                                      :2sing "are missing"
                                      :3sing "is missing"
                                      :1plur "are missing"
@@ -117,8 +124,6 @@
                                   :1plur "were missing"
                                   :2plur "were missing"
                                   :3plur "were missing"}}
-                 :disable :fail ;; morphology not working for this verb:
-                 ;; generates things like 'he was be missinging'.
                  :synsem {:cat :verb
                           :sem {:pred :to-be-missing}}}


(SERVER-615) Check for excep. error msg in validate-settings! test

--- test/unit/puppetlabs/puppetserver/certificate_authority_test.clj
+++ test/unit/puppetlabs/puppetserver/certificate_authority_test.clj
@@ -111,7 +111,8 @@
                      (testutils/ca-settings cadir)
                      :ca-ttl
                      (+ max-ca-ttl 1))]
-      (is (thrown? IllegalStateException (validate-settings! settings)))))
+      (is (thrown-with-msg? IllegalStateException #"ca_ttl must have a value below"
+                            (validate-settings! settings)))))

   (testing "warns if :client-whitelist is set in c-a.c-s section"
     (let [settings (assoc-in


pascal-triangle-value test case

pascal-triangle-value test case

--- test/hackerrank/fp/pascal_triangle_test.clj
+++ test/hackerrank/fp/pascal_triangle_test.clj
@@ -10,6 +10,7 @@
 (defn is-equal [a b]
   (is (= a b)))

+
 (deftest pascal-triangle-test

   (testing "parseInt"
@@ -21,6 +22,9 @@
     (is-equal (factorial 3) 6)
     (is-equal (factorial 4) 24))

+  (testing "pascal-triangle-value"
+    (is-equal (pascal-triangle-value 0 0)))
+
   (testing "pascal-triangle"
     (is-equal (pascal-triangle test-string-input) 4))


moved global connector parameters to connector namespace.

--- openstack/config/src/com/sixsq/slipstream/connector/openstack_template.clj
+++ openstack/config/src/com/sixsq/slipstream/connector/openstack_template.clj
@@ -10,33 +10,18 @@

 (def ^:const cloud-service-type "openstack")

-(def ref-attrs-kw->name
-  {:orchestratorImageid "orchestrator.imageid"
-   :quotaVm             "quota.vm"
-   :maxIaasWorkers      "max.iaas.workers"})
+(def connector-kw->pname
+  {:orchestratorInstanceType "orchestrator.instance.type"
+   :identityVersion          "identity.version"
+   :serviceRegion            "service.region"
+   :serviceType              "service.type"
+   :serviceName              "service.name"
+   :floatingIPs              "floating.ips"
+   :networkPrivate           "network.private"
+   :networkPublic            "network.public"
+   })

-(def mandatory-atrrs-kw->name
-  {:endpoint                "endpoint"
-   :nativeContextualization "native-contextualization"
-   :orchestratorSSHUsername "orchestrator.ssh.username"
-   :orchestratorSSHPassword "orchestrator.ssh.password"
-   :securityGroups          "security.groups"
-   :updateClientURL         "update.clienturl"})
-
-(def kw->name
-  (merge ref-attrs-kw->name
-         mandatory-atrrs-kw->name
-         {:orchestratorInstanceType "orchestrator.instance.type"
-          :identityVersion          "identity.version"
-          :serviceRegion            "service.region"
-          :serviceType              "service.type"
-          :serviceName              "service.name"
-          :floatingIPs              "floating.ips"
-          :networkPrivate           "network.private"
-          :networkPublic            "network.public"
-          }))
-
-(def name->kw (set/map-invert kw->name))
+(def connector-pname->kw (set/map-invert connector-kw->pname))

 ;;
 ;; schemas


CMR-2889 Fixes failing acl provider search test

--- access-control-app/int_test/cmr/access_control/int_test/acl_search_test.clj
+++ access-control-app/int_test/cmr/access_control/int_test/acl_search_test.clj
@@ -8,7 +8,8 @@
            [cmr.access-control.data.access-control-index :as access-control-index]))

 (use-fixtures :each
-  (fixtures/reset-fixture {"prov1guid" "PROV1", "prov2guid" "PROV2"}
+  (fixtures/reset-fixture {"prov1guid" "PROV1", "prov2guid" "PROV2", "prov3guid" "PROV3",
+                           "prov4guid" "PROV4"}
                           ["user1" "user2" "user3" "user4" "user5"])
   (fixtures/grant-all-group-fixture ["prov1guid" "prov2guid"]))
 (use-fixtures :once (fixtures/int-test-fixtures))
@@ -336,21 +337,24 @@
 (deftest acl-search-provider-test
   (let [token (e/login (u/conn-context) "user1")
         acl1 (ingest-acl token (provider-acl "INGEST_MANAGEMENT_ACL"))
-        acl2 (ingest-acl token (catalog-item-acl "Catalog_Item1_PROV1"))
-        acl3 (ingest-acl token (catalog-item-acl "Catalog_Item2_PROV1"))
-        acl4 (ingest-acl token (assoc-in (catalog-item-acl "Catalog_Item3_PROV2")
+        acl2 (ingest-acl token (assoc-in (provider-acl "INGEST_MANAGEMENT_ACL")
+                                         [:provider_identity :provider_id] "PROV2"))
+        acl3 (ingest-acl token (assoc-in (provider-acl "INGEST_MANAGEMENT_ACL")
+                                         [:provider_identity :provider_id] "PROV3"))
+        acl4 (ingest-acl token (assoc-in (provider-acl "INGEST_MANAGEMENT_ACL")
+                                         [:provider_identity :provider_id] "PROV4"))
+        acl5 (ingest-acl token (catalog-item-acl "Catalog_Item1_PROV1"))
+        acl6 (ingest-acl token (catalog-item-acl "Catalog_Item2_PROV1"))
+        acl7 (ingest-acl token (assoc-in (catalog-item-acl "Catalog_Item3_PROV2")
                                          [:catalog_item_identity :provider_id] "PROV2"))
-        acl5 (ingest-acl token (assoc-in (catalog-item-acl "Catalog_Item4_PROV3")
-                                         [:catalog_item_identity :provider_id] "PROV3"))
-        acl6 (ingest-acl token (assoc-in (catalog-item-acl "Catalog_Item5_PROV2")
+        acl8 (ingest-acl token (assoc-in (catalog-item-acl "Catalog_Item5_PROV2")
                                          [:catalog_item_identity :provider_id] "PROV2"))
-        acl7 (ingest-acl token (assoc-in (provider-acl "INGEST_MANAGEMENT_ACL")
-                                         [:provider_identity :provider_id] "PROV2"))
-        acl8 (ingest-acl token (assoc-in (catalog-item-acl "Catalog_Item6_PROV4")
+
+        acl9 (ingest-acl token (assoc-in (catalog-item-acl "Catalog_Item6_PROV4")
                                          [:catalog_item_identity :provider_id] "PROV4"))
-        prov1-acls [acl1 acl2 acl3]
-        prov1-and-2-acls [acl1 acl2 acl3 acl4 acl6 acl7]
-        prov3-acls [acl5]]
+        prov1-acls [acl1 acl5 acl6]
+        prov1-and-2-acls [acl1 acl2 acl5 acl6 acl7 acl8]
+        prov3-acls [acl3]]
     (u/wait-until-indexed)
     (testing "Search ACLs that grant permissions to objects owned by a single provider
               or by any provider where multiple are specified"


Made some changes

Made some changes

--- src/clojush/problems/software/double_letters_c.clj
+++ src/clojush/problems/software/double_letters_c.clj
@@ -25,6 +25,7 @@
             ;;; end ERCs
             (tag-instruction-erc [:exec :integer :boolean :string :char] 1000)
             (tagged-instruction-erc 1000)
+            (registered-for-type "return_")
             ;;; end tag ERCs
             'in1
             ;;; end input instructions
@@ -178,6 +179,7 @@
    :report-simplifications 0
    :final-report-simplifications 5000
    :max-error 5000
-   :meta-error-categories [:max-stacks-depth]
-   :sort-meta-errors-for-lexicase :last
+   :use-single-thread true
+   ;:meta-error-categories [:max-stacks-depth]
+   ;:sort-meta-errors-for-lexicase :last
    })


Fix a faulty require

Fix a faulty require

--- src/catalog/layout/common.clj
+++ src/catalog/layout/common.clj
@@ -1,6 +1,5 @@
 (ns catalog.layout.common
-  (:require [catalog.layout.common :as layout :refer [wrap]]
-            [clj-time
+  (:require [clj-time
              [core :as time.core]
              [format :as time.format]]
             [clojure.string :as string])


Handle all types of items in Braille output

Move from a single function to create a entry sexp to a multifn
dispatching on format of the entry.

Fixes #5

--- src/catalog/layout/dtbook.clj
+++ src/catalog/layout/dtbook.clj
@@ -52,35 +52,148 @@
    endophile/to-clj
    (walk/postwalk #(visitor %))))

-(defn catalog-entry [{:keys [creator record-id title subtitles name-of-part source-publisher
-                             source-date genre genre-text description producer-brief
-                             rucksackbuch? rucksackbuch-number
-                             library-signature product-number price]}]
-  [:div {:brl:class "ps"}
-   [:p {:brl:class "tit"} (wrap creator "" ": " false)
-    (->> [(wrap title) (for [s subtitles] (wrap s)) (wrap name-of-part)]
-         flatten
-         (remove empty-or-blank?)
-         (string/join " "))
-    " - "
-    (wrap source-publisher "" ", " false) (wrap (layout/year source-date))]
-   (when ((set layout/genres) genre)
-     ;; don't show the genre for :musiknoten and :taktilesbuch
-     [:p {:brl:class "gen"} (wrap genre-text "Genre: ")])
-   [:p {:brl:class "ann"} (wrap description)]
+(defn- entry-heading-sexp
+  [{:keys [creator title subtitles name-of-part source-publisher source-date]}]
+  [:p {:brl:class "tit"} (wrap creator "" ": " false)
+   (->> [(wrap title) (for [s subtitles] (wrap s)) (wrap name-of-part)]
+        flatten
+        (remove empty-or-blank?)
+        (string/join " "))
+   (when (or source-publisher source-date) " - ")
+   (wrap source-publisher "" (if source-date ", " "") false) (wrap (layout/year source-date))])
+
+(defmulti entry-sexp (fn [{fmt :format}] fmt))
+
+(defn- ausleihe
+  [library-signature]
+  (when library-signature
+    [:p {:brl:class "aus"} "Ausleihe: "
+     (binding [layout/translations translations] (layout/braille-signatures library-signature))]))
+
+(defn- ausleihe-simple
+  [library-signature]
+  (when library-signature
+    [:p {:brl:class "aus"} (wrap library-signature "Ausleihe: ")]))
+
+(defn- verkauf
+  [product-number price]
+  (when product-number
+    [:p {:brl:class "ver"} "Verkauf: " (wrap price "" ". " false)
+     (binding [layout/translations translations] (layout/braille-signatures product-number))]))
+
+(defn- description-sexp
+  [description]
+  [:p {:brl:class "ann"} (wrap description)])
+
+(defn- producer-sexp
+  ([producer-brief]
+   [:p {:brl:class "pro"} (wrap producer-brief)])
+  ([producer-brief rucksackbuch-number]
+   [:p {:brl:class "pro"} (wrap producer-brief "" ", " false) (wrap rucksackbuch-number "Rucksackbuch Nr. ")]))
+
+(defn- genre-sexp
+  [genre-text]
+  [:p {:brl:class "gen"} (wrap genre-text "Genre: ")])
+
+(defmethod entry-sexp :braille
+  [{:keys [creator title subtitles name-of-part source-publisher
+           source-date genre-text description producer-brief
+           rucksackbuch? rucksackbuch-number
+           library-signature product-number price] :as item}]
+  [:div {:brl:class "ps"}
+   (entry-heading-sexp item)
+   (genre-sexp genre-text)
+   (description-sexp description)
    (if rucksackbuch?
-     [:p {:brl:class "pro"} (wrap producer-brief "" ", " false) (wrap rucksackbuch-number "Rucksackbuch Nr. ")]
-     [:p {:brl:class "pro"} (wrap producer-brief)])
+     (producer-sexp producer-brief rucksackbuch-number)
+     (producer-sexp producer-brief))
+   (ausleihe library-signature)
+   (verkauf product-number price)])
+
+(defmethod entry-sexp :musiknoten
+  [{:keys [creator title subtitles name-of-part source-publisher
+           source-date genre-text description producer-brief
+           library-signature product-number price] :as item}]
+  [:div {:brl:class "ps"}
+   (entry-heading-sexp item)
+   (description-sexp description)
+   (producer-sexp producer-brief)
+   (ausleihe library-signature)
+   (verkauf product-number price)])
+
+(defmethod entry-sexp :taktilesbuch
+  [{:keys [creator title subtitles name-of-part source-publisher
+           source-date genre-text description producer-brief
+           library-signature product-number price] :as item}]
+  [:div {:brl:class "ps"}
+   (entry-heading-sexp item)
+   (description-sexp description)
+   (producer-sexp producer-brief)
+   (ausleihe library-signature)
+   (verkauf product-number price)])
+
+(defmethod entry-sexp :hörbuch
+  [{:keys [genre-text description duration narrators producer-brief
+           produced-commercially? library-signature product-number price] :as item}]
+  [:div {:brl:class "ps"}
+   (entry-heading-sexp item)
+   (genre-sexp genre-text)
+   (description-sexp description)
+   [:p {:brl:class "duration"} (wrap duration "" " Min., " false) (layout/render-narrators narrators)]
+   (if produced-commercially?
+     [:p {:brl:class "pro"} (wrap producer-brief "" ", Hörbuch aus dem Handel")]
+     (producer-sexp producer-brief))
+   (ausleihe-simple library-signature)
+   (when product-number
+     [:p {:brl:class "ver"} "Verkauf: " product-number ", " price])])
+
+(defmethod entry-sexp :grossdruck
+  [{:keys [genre-text description library-signature volumes product-number price] :as item}]
+  [:div {:brl:class "ps"}
+   (entry-heading-sexp item)
+   (genre-sexp genre-text)
+   (description-sexp description)
    (when library-signature
-     [:p {:brl:class "aus"} "Ausleihe: "
-      (binding [layout/translations translations] (layout/braille-signatures library-signature))])
+     [:p {:brl:class "aus"} "Ausleihe: " library-signature (wrap volumes ", " " Bd. " false)])
    (when product-number
-     [:p {:brl:class "ver"} "Verkauf: " (wrap price "" ". " false)
-      (binding [layout/translations translations] (layout/braille-signatures product-number))])])
+     [:p {:brl:class "ver"} "Verkauf: " price])])
+
+(defmethod entry-sexp :e-book
+  [{:keys [genre-text description library-signature] :as item}]
+  [:div {:brl:class "ps"}
+   (entry-heading-sexp item)
+   (genre-sexp genre-text)
+   (description-sexp description)
+   (ausleihe-simple library-signature)])
+
+(defmethod entry-sexp :hörfilm
+  [{:keys [personel-text movie_country genre-text
+           description producer library-signature] :as item}]
+  [:div {:brl:class "ps"}
+   (entry-heading-sexp item)
+   [:p {:brl:class "personel"} (wrap personel-text)]
+   [:p {:brl:class "country"} (wrap movie_country)]
+   (genre-sexp genre-text)
+   (description-sexp description)
+   (producer-sexp producer)
+   (ausleihe-simple library-signature)])
+
+(defmethod entry-sexp :ludo
+  [{:keys [source-publisher genre-text description
+           game-description accompanying-material library-signature
+           product-number price] :as item}]
+  [:div {:brl:class "ps"}
+   (entry-heading-sexp item)
+   [:p {:brl:class "publisher"} (wrap source-publisher)]
+   (genre-sexp genre-text)
+   (description-sexp description)
+   [:p {:brl:class "game-desc"} (wrap game-description)]
+   (ausleihe library-signature)
+   (verkauf product-number price)])

 (defn catalog-entries [items]
   [:div {:brl:class "list"}
-   (map catalog-entry items)])
+   (map entry-sexp items)])

 (defn subgenre-entry [[subgenre items]]
   [:level3


Re-add main func for prod invocation

Re-add main func for prod invocation

--- src/clj/coffee_table/core.clj
+++ src/clj/coffee_table/core.clj
@@ -1,7 +1,7 @@
 (ns coffee-table.core
   "Entrypoint for production Uberjars"
   (:gen-class)
-  (:require
+  (:require [integrant.core :as ig]
             [coffee-table.system :refer [new-system]]
             [taoensso.timbre :as timbre]))

@@ -10,18 +10,18 @@
 (defn add-shutdown-hook! [^Runnable f]
   (.addShutdownHook (Runtime/getRuntime) (Thread. f)))

-#_ (defn logged-shutdown [system]
+(defn logged-shutdown [system]
   (info ::shutting-down-app)
-  (component/stop system)
+  (ig/halt system)
   (info ::shut-down-app))

-#_ (defn -main
+(defn -main
   [& args]
   (let [system (new-system :prod)]
     ;; Shut down system if we terminate
     (add-shutdown-hook! (partial logged-shutdown system))
     (info ::starting-app)
-    (component/start system)
+    (ig/init system)
     (info ::started-app))
   ;; All threads are daemon, so block forever:
   @(promise))


fixed type -> Ressource -> Resource

fixed type -> Ressource -> Resource

--- src/clj/game/cards-assets.clj
+++ src/clj/game/cards-assets.clj
@@ -375,7 +375,7 @@
                          :once :per-turn
                          :req (req (seq (:hand runner)))
                          :prompt "Choose a card type"
-                         :choices ["Event" "Hardware" "Program" "Ressource"]
+                         :choices ["Event" "Hardware" "Program" "Resource"]
                          :msg (msg "reveal " (join ", " (map :title (:hand runner))) " and trash a " target)
                          :effect (effect (resolve-ability (trash-ability target) card nil))}]
      {:additional-cost [:forfeit]


check that agenda is able to be scored

check that agenda is able to be scored

--- src/clj/game/core-actions.clj
+++ src/clj/game/core-actions.clj
@@ -5,7 +5,7 @@
 (declare card-str can-rez? corp-install enforce-msg gain-agenda-point get-remote-names
          jack-out move name-zone play-instant purge resolve-select run has-subtype?
          runner-install trash update-breaker-strength update-ice-in-server update-run-ice win
-         can-run-server?)
+         can-run-server? can-score?)

 ;;; Neutral actions
 (defn play
@@ -233,20 +233,21 @@
   "Score an agenda."
   [state side args]
   (let [card (or (:card args) args)]
-    (when (and (empty? (filter #(= (:cid card) (:cid %)) (get-in @state [:corp :register :cannot-score])))
-               (>= (:advance-counter card) (or (:current-cost card) (:advancementcost card))))
-      (let [moved-card (move state :corp card :scored)
-            c (card-init state :corp moved-card)
-            points (get-agenda-points state :corp c)]
-        (system-msg state :corp (str "scores " (:title c) " and gains " points
-                                     " agenda point" (when (> points 1) "s")))
-        (swap! state update-in [:corp :register :scored-agenda] #(+ (or % 0) points))
-        (gain-agenda-point state :corp points)
-        (set-prop state :corp c :advance-counter 0)
-        (trigger-event state :corp :agenda-scored (assoc c :advance-counter 0))
-        (when-let [current (first (get-in @state [:runner :current]))]
-          (say state side {:user "__system__" :text (str (:title current) " is trashed.")})
-          (trash state side current))))))
+    (when (can-score? state side card)
+      (when (and (empty? (filter #(= (:cid card) (:cid %)) (get-in @state [:corp :register :cannot-score])))
+                 (>= (:advance-counter card) (or (:current-cost card) (:advancementcost card))))
+        (let [moved-card (move state :corp card :scored)
+              c (card-init state :corp moved-card)
+              points (get-agenda-points state :corp c)]
+          (system-msg state :corp (str "scores " (:title c) " and gains " points
+                                       " agenda point" (when (> points 1) "s")))
+          (swap! state update-in [:corp :register :scored-agenda] #(+ (or % 0) points))
+          (gain-agenda-point state :corp points)
+          (set-prop state :corp c :advance-counter 0)
+          (trigger-event state :corp :agenda-scored (assoc c :advance-counter 0))
+          (when-let [current (first (get-in @state [:runner :current]))]
+            (say state side {:user "__system__" :text (str (:title current) " is trashed.")})
+            (trash state side current)))))))

 (defn no-action
   "The corp indicates they have no more actions for the encounter."


Parallel delete

Parallel delete

--- src/clj_applenewsapi/core.clj
+++ src/clj_applenewsapi/core.clj
@@ -35,12 +35,21 @@
      (client/get url (authorize default-opts concatenated ts channel-name)))))

 (defn delete-article
+  "The id here is the id the publisher service associated to the article
+  when it was created."
   ([id] (delete-article id :sandbox))
   ([id channel-name]
    (let [url (str (cfg/host) "/articles/" id)
          ts (now)
          concatenated (canonical "DELETE" url ts)]
      (client/delete url (authorize default-opts concatenated ts channel-name)))))
+
+(defn delete-articles
+  "The id here is the id the publisher service associated to the article
+  when it was created. cfg/parallel is the chunk size (that will spawn n threads)"
+  ([ids] (delete-articles ids :sandbox))
+  ([ids channel-name]
+   (doall (parallel/ppmap #(delete-article % channel-name) ids (cfg/parallel)))))

 (defn get-channel
   ([] (get-channel :sandbox))


Add some doc strings & minor style tweaks

--- src/clj_http_hystrix/core.clj
+++ src/clj_http_hystrix/core.clj
@@ -23,7 +23,7 @@
     resp
     {:status 503}))

-(defn handle-exception
+(defn ^:private handle-exception
   [f req]
   (let [raw-response (try (f) (catch Exception e e))
         resp (if (instance? HystrixBadRequestException raw-response)
@@ -65,11 +65,15 @@
       (warn message))))

 (defn status-codes
+  "Create a predicate that returns true whenever one of the given
+  status codes is present"
   [& status]
   (fn [req resp]
     (reduce #(or %1 (= %2 (:status resp))) false status)))

 (defn client-error?
+  "Returns true when the response has one of the 4xx family of status
+  codes"
   [req resp]
   (http/client-error? resp))


Fix getting recurring events after uploading csv file

--- src/cljs/my_money/events.cljs
+++ src/cljs/my_money/events.cljs
@@ -19,15 +19,15 @@
 (defn recurring-expenses-handler [response]
   (reset! recurring-expenses response))

-(defn get-recurring-expenses []
+(defn get-recurring-expenses [username]
  (GET "/events/recurring/expenses" {:handler recurring-expenses-handler
-                                    :params {:user (:username @form-data)}}))
+                                    :params {:user username}}))

 (defn get-events
   ([]
    (get-events (:username @form-data)))
   ([username]
-   (get-recurring-expenses)
+   (get-recurring-expenses username)
    (GET "/events" {:handler handle-response
                    :params {:user username}})))


Fixed printing of empty programs.

Fixed printing of empty programs.

--- src/clojush/pushgp/report.clj
+++ src/clojush/pushgp/report.clj
@@ -82,7 +82,7 @@
     (with-open [csv-file (io/writer csv-log-filename :append true)]
       (csv/write-csv csv-file
                      (map-indexed (fn [location individual]
-                                    (concat (map (assoc (clojure.set/rename-keys individual {:program :push-program})
+                                    (concat (map (assoc (into {} individual)
                                                         :generation generation
                                                         :location location
                                                         :parent-uuids (let [parent-uuids (not-lazy (map str (:parent-uuids individual)))]
@@ -91,8 +91,14 @@
                                                                           parent-uuids))
                                                         :genetic-operators (if (nil? (:genetic-operators individual)) [] (:genetic-operators individual))
                                                         :push-program-size (count-points (:program individual))
+                                                        :push-program (if (and (seq? (:program individual))
+                                                                               (empty? (:program individual)))
+                                                                        "()"
+                                                                        (:program individual))
                                                         :plush-genome-size (count (:genome individual))
-                                                        :plush-genome (not-lazy (:genome individual))
+                                                        :plush-genome (if (empty? (:genome individual))
+                                                                        "()"
+                                                                        (not-lazy (:genome individual)))
                                                         ) ; This is a map of an individual
                                                  columns)
                                             (when (some #{:test-case-errors} csv-columns)


Fixed typo.

Fixed typo.

--- src/cmr/common/mime_types.clj
+++ src/cmr/common/mime_types.clj
@@ -22,7 +22,7 @@
    :iso-smap "application/iso:smap+xml"
    :iso19115 "application/iso19115+xml"
    :dif "application/dif+xml"
-   :csv "text/cvs"})
+   :csv "text/csv"})

 (defn mime-type->format
   "Converts a mime-type into the format requested."


arity-1 function in streaming-buffer transducer (so that it would work on finite collections as well)

--- Clojure-Websockets/src/clj/birdwatch/twitterclient/processing.clj
+++ Clojure-Websockets/src/clj/birdwatch/twitterclient/processing.clj
@@ -23,11 +23,13 @@
 (defn- streaming-buffer []
   (fn [step]
     (let [buff (atom "")]
-      (fn [r x]
+      (fn
+        ([r] (step r))
+        ([r x]
         (let [json-lines (-> (str @buff x) (insert-newline) (str/split-lines))
               to-process (butlast json-lines)]
           (reset! buff (last json-lines))
-          (if to-process (reduce step r to-process) r))))))
+          (if to-process (reduce step r to-process) r)))))))

 (defn- tweet? [data]
   "Checks if data is a tweet. If so, pass on, otherwise log error."
@@ -50,3 +52,7 @@

 (defn ex-handler [ex]
   (log/error "Exception while processing chunk" ex))
+
+
+
+


add timeout on pinging peer

add timeout on pinging peer

--- src/block_chain/peer_client.clj
+++ src/block_chain/peer_client.clj
@@ -51,6 +51,7 @@
   (log/info "Pinging peer" peer time)
   (-> (http/post (url peer "ping")
                  {:form-params {:ping time}
+                  :socket-timeout 2000
                   :content-type :json})
       :body
       read-json))


Fix some styling of rss feed settings

Fix some styling of rss feed settings

--- src/braid/rss/client/views.cljs
+++ src/braid/rss/client/views.cljs
@@ -28,7 +28,6 @@
        [:div.warning "New posts will be posted as coming from you"]
        (when @error [:div.error @error])
        [:label [:span "Feed URL"]
-        [:br]
         [:input {:type "url"
                  :placeholder "https://foo.bar/rss.xml"
                  :value (:feed-url @new-feed)
@@ -45,6 +44,7 @@
                                   (reset! error "Couldn't fetch feed from URL")))]))}]
         (when @checked-feed?
           [:span {:style {:color "green"}} "Feed looks good"])]
+       [:br]
        [:label [:span "Tags to apply to posts"]
         [:br]
         ;; Annoying React thing: multiple select doesn't seem to be
@@ -73,6 +73,7 @@
            " private feed-reader, or you want to manually vet items before tagging them."]
           [:p "Otherwise, you can select one or more of the above tags"
            " to allow others to automatically see them."]])
+       [:br]
        [:input {:type "submit" :value "Add"
                 :disabled (or (string/blank? (:feed-url @new-feed))
                               (not @checked-feed?))}]])))
@@ -87,10 +88,10 @@
                ^{:key (feed :id)}
                [:tr
                 [:td (feed :feed-url)]
-                [:td [pills/user-pill-view (feed :user-id)]]
+                [:td [:span.user [pills/user-pill-view (feed :user-id)]]]
                 [:td (doall (for [tag-id (feed :tag-ids)]
                               ^{:key tag-id}
-                              [pills/tag-pill-view tag-id]))]
+                              [:span.tag [pills/tag-pill-view tag-id]]))]
                 [:td [:button
                       {:on-click (fn [_] (dispatch [:rss/force-feed-run (feed :id)]))}
                       "Check Now"]]


Write a function to process the site data

--- src/clj/comic_reader/scrape.clj
+++ src/clj/comic_reader/scrape.clj
@@ -1,6 +1,7 @@
 (ns comic-reader.scrape
   (:require [clojure.string :refer [trim]]
-            [net.cgrand.enlive-html :as html]))
+            [net.cgrand.enlive-html :as html])
+  (:import java.net.URL))

 (def sites
   {"Manga Fox" {:url "http://mangafox.me/manga/"
@@ -19,4 +20,5 @@
 (defn fetch-url [url]
   (html/html-resource (java.net.URL. url)))

-(defn fetch-site-list [{:keys [url selector normalize]}])
+(defn fetch-site-list [{:keys [url selector normalize]}]
+  (map normalize (html/select (fetch-url url) selector)))


Use small columns for correct inheritance

--- src/clj/comic_reader/server.clj
+++ src/clj/comic_reader/server.clj
@@ -73,7 +73,7 @@
                   (hp/include-js "js/vendor/modernizr.js")]
                  [:body
                   [:div.row
-                   [:div#app.large-12.columns]]
+                   [:div#app.small-12.columns]]
                   [:input#history_state {:type "hidden"}]
                   (hp/include-js "js/vendor/jquery.js"
                                  "js/vendor/fastclick.js"


Correct system reset fn

Correct system reset fn

--- src/clj/comic_reader/system.clj
+++ src/clj/comic_reader/system.clj
@@ -32,7 +32,7 @@

 (defn reset []
   (stop)
-  (refresh :after 'comic-reader.system/go))
+  (refresh :after 'comic-reader.system/-main))

 (defn -main [& [port]]
   (let [port (Integer. (or port (env :port) 10555))]


Fix: remove-temporary-directory

Fix: remove-temporary-directory

--- src/clj_fileutils/fileutils.clj
+++ src/clj_fileutils/fileutils.clj
@@ -7,7 +7,7 @@
 ;  http://www.eclipse.org/legal/epl-v10.html
 ;
 ;  Contributors:
-;      Pavel Tisnovsky
+;      Pavel Tisnovsky
 ;

 (ns clj-fileutils.fileutils)
@@ -50,7 +50,7 @@
           abs-path (.getAbsolutePath file)]
         ; make sure we are not going to remove wrong directory!
         (if (.startsWith abs-path "/tmp")
-            (rm-rf/rm-r abs-path))))
+            (rm-rf/rm-r file))))

 (defn remove-directory
     [directory]


Return the proper word class and source

Return the proper word class and source

--- src/clj_mrazik/db_interface.clj
+++ src/clj_mrazik/db_interface.clj
@@ -50,7 +50,10 @@
 (defn select-words
     [word]
     (jdbc/query db-spec/mrazik-db
-        ["select * from dictionary where term=?" word]))
+        ["select term, description,
+                 (select class from classes where classes.id=dictionary.class) as class,
+                 use, incorrect_forms, correct_forms, see_also, internal, verified, copyrighted,
+                 (select source from sources where sources.id=dictionary.source) as source from dictionary where term=?" word]))

 (defn select-word-count
     [word]


Try to find start position from inside out rather than outside in so that the player doesn't end up on an island unconntected to the mainland

--- src/cljc/robinson/worldgen.cljc
+++ src/cljc/robinson/worldgen.cljc
@@ -135,22 +135,19 @@
             radius (min max-x max-y)
             [x y]   [(* radius (Math/cos angle))
                      (* radius (Math/sin angle))]
-            points  (rlos/line-segment [x y] [0 0])
-            samples (take-nth 2 points)
+            points  (rlos/line-segment [0 0] [x y])
+            samples points #_(take-nth 2 points)
             n       (rn/create-noise (rr/create-random seed))
-            #_#__ (log/info "find-starting-pos samples" (vec samples))]
-        (if (= :ocean (apply sample-island n (first samples)))
-          (let [non-water-samples (filter
-                                    (fn [[x y]]
+            _ (log/info "find-starting-pos samples" (vec samples))]
+        (if (= :ocean (apply sample-island n (last samples)))
+          (let [spans (partition-by (fn [[x y]]
                                       (let [s (sample-island n x y)
                                             adj-types (map (fn [[x y]] (sample-island n x y))
                                                            (rw/adjacent-xys x y))]
                                         (log/info "sample" x y s (vec adj-types))
-                                        (or
-                                          (contains? #{:sand :dirt} s)
-                                          (every? (partial contains? #{:sand :dirt :surf}) adj-types))))
+                                        (every? (partial contains? #{:surf}) adj-types)))
                                     samples)
-                [sx sy] (first non-water-samples)]
+                [sx sy] (-> spans first last)]
             (if (and sx sy)
               (recur (rc/xy->pos sx sy))
               (recur nil)))


1. use parset widget id; 2. only render dimensions div when necessary

--- src/cljs/searchbot/parsets.cljs
+++ src/cljs/searchbot/parsets.cljs
@@ -119,7 +119,7 @@
                                        (-> js/d3 (.select the-bar) (.classed "highlight" (not was-highlighted?)))
                                        (select! owner (if was-highlighted? disj conj) selected)))}})))

-(defcomponent parsets [cursor owner {:keys [agg value-path url height] :or {height 600 value-path ["doc_count"]} :as opts}]
+(defcomponent parsets [cursor owner {:keys [id agg value-path url height] :or {height 600 value-path ["doc_count"]} :as opts}]
   (init-state [_]
               (let [{:keys [es-settings ref-state]} (om/get-shared owner)]
                 {:continue? true
@@ -165,10 +165,10 @@
                      [:label {:for "toggle-show-dimensions"} "Show Dimensional Charts"]]
                     ]
                    [:.row
-                    [:.col {:class (if show-dimensions "s9" "s12") :id "parsets" :ref "parsets-div"}]
-                    [:.col {:class (if show-dimensions "s3" "hide") :ref "parsets-dims"}
-                     (when-not (empty? parsets-data) (map #(build-bar owner (name %)) (get-agg-terms)))
-                     ]
+                    [:.col {:class (if show-dimensions "s9" "s12") :id id :ref "parsets-div"}]
+                    (if show-dimensions
+                      [:.col {:class "s3" :ref "parsets-dims"}
+                       (when-not (empty? parsets-data) (map #(build-bar owner (name %)) (get-agg-terms)))])
                     ]]]
                  ))
   (did-update [_ _ _]
@@ -184,14 +184,14 @@
              (let [{:keys [comm parsets-agg]} (om/get-state owner)
                    parsets-div (om/get-node owner "parsets-div")
                    card-width #(* 0.95 (.-offsetWidth parsets-div))
-                   get-svg #(new-svg {:id "#parsets" :height height :width (card-width) :width-fn card-width})
+                   get-svg #(new-svg {:id (str "#" id) :height height :width (card-width) :width-fn card-width})
                    chart #(make-parsets-chart
                            {:height height :width (card-width) :width-fn card-width
                             :get-parsets-agg (fn [_] (:parsets-agg (om/get-state owner)))})]
                (.attach js/Waves (om/get-node owner "parsets-div") "waves-yellow")
                (go (while (:continue? (om/get-state owner))
                      (let [parsets-data (<! comm)
-                           _ (-> js/d3 (.select "#parsets > svg") .remove)
+                           _ (-> js/d3 (.select (str "#" id " > svg")) .remove)
                            svg (get-svg)]
                        (when (< 0 (count parsets-data))
                          (.log js/console "# parsets aggregation:" (count parsets-data))


Work on worldgen

Work on worldgen

--- src/cljx/robinson/worldgen.cljx
+++ src/cljx/robinson/worldgen.cljx
@@ -221,11 +221,11 @@
   (offset [-0.5 -0.5] (v+ [-0.5 -0.5 -0.5] (scale 0.01 noise))))

 (defn sample-island
-  [noise]
+  [noise x y]
   (cliskf/vectorize
-    (cliskf/vlet [c  (center (invert (offset (scale 0.43 (v* [0.5 0.5 0.5] (vsnoise noise) (distance))))))
-                  c1 (offset [0.5 0.5] (v+ [-0.5 -0.5 -0.5] (scale 0.06 noise)))
-                  c2 (offset [-0.5 -0.5] (v+ [-0.5 -0.5 -0.5] (scale 0.08 noise)))]
+    (cliskf/vlet [c  ((center (invert (offset (scale 0.43 (v* [0.5 0.5 0.5] (vsnoise noise) (distance)))))) x y)
+                  c1 ((offset [0.5 0.5] (v+ [-0.5 -0.5 -0.5] (scale 0.06 noise))) x y)
+                  c2 ((offset [-0.5 -0.5] (v+ [-0.5 -0.5 -0.5] (scale 0.08 noise))) x y)]
       (cond
         ;; interior biomes
         (> -0.55  c)
@@ -239,7 +239,7 @@
             light-forest
             (and (pos? c1) (neg? c2))
             bamboo-grove
-            (and (neg? c1) (pos? c2) (v> c1 c2))
+            (and (neg? c1) (pos? c2) (> c1 c2))
             meadow
             (and (neg? c1) (pos? c2))
             rocky


Rename SecretKey protocol to ISecretKey

Rename SecretKey protocol to ISecretKey

--- src/clojure/buddy/core/keys.clj
+++ src/clojure/buddy/core/keys.clj
@@ -15,11 +15,11 @@
 (ns buddy.core.keys
   (:require [buddy.core.codecs :refer [str->bytes bytes->hex]]))

-(defprotocol SecretKey
+(defprotocol ISecretKey
   (key->bytes [key] "Normalize key to byte array")
   (key->str [key] "Normalize key String"))

-(extend-protocol SecretKey
+(extend-protocol ISecretKey
   (Class/forName "[B")
   (key->bytes [it] it)
   (key->str [it] (bytes->hex it))


hot reload edn

hot reload edn

--- src/clojure_playground/core.clj
+++ src/clojure_playground/core.clj
@@ -27,7 +27,7 @@

 (def recipes-filename "data/recipes.edn")
-(defonce recipes (atom (slurp-edn recipes-filename {})))
+(def recipes (atom (slurp-edn recipes-filename {})))
 (add-watch recipes :recipes-file-store
            (fn [_ _ _ new-value]
              (log/info "writing new recipe to" recipes-filename)


Expose datomish.schema/validate-schema so that schema management can use it.

--- src/common/datomish/schema.cljc
+++ src/common/datomish/schema.cljc
@@ -178,7 +178,7 @@
       (raise "Unknown attribute " attr ", expected one of " (sorted-set (keys schema))
              {:error :schema/valueType, :attribute attr}))))

-(defn- validate-schema [schema]
+(defn validate-schema [schema]
   (doseq [[a kv] schema]
     (when-not (:db/valueType kv)
       (throw (ex-info (str "Bad attribute specification for " a ": should have {:db/valueType ...}")


Include attack moves to the table

Include attack moves to the table

--- frontend/src/cruncher/views.cljs
+++ frontend/src/cruncher/views.cljs
@@ -79,7 +79,7 @@
       (dom/tr #js {:id        (str "poketable-row-details-" (:id pokemon))
                    :className "collapse"}
               (dom/td #js {:className "well"})
-              (dom/td #js {:className "well" :colSpan 12}
+              (dom/td #js {:className "well" :colSpan 13}
                       (dom/div #js {:className "row"}
                                (dom/div #js {:className "col-md-6"}
                                         (dom/div #js {:className "row"}
@@ -128,6 +128,8 @@
               (dom/td nil (dom/img #js {:src (str "img/pokemon/models/" (:pokemon_id pokemon) ".png") :className "pokemon-image-thumb"}))
               (dom/td nil (:name pokemon))
               (dom/td nil (:nickname pokemon))
+              (dom/td nil (moves/get-name (:move_1 pokemon)))
+              (dom/td nil (moves/get-name (:move_2 pokemon)))
               (dom/td nil (:cp pokemon))
               (dom/td nil (:individual_percentage pokemon))
               (dom/td nil (:individual_attack pokemon))
@@ -157,11 +159,13 @@
                                            (dom/th nil "")
                                            (vlib/sortable-table-header :name "Name")
                                            (vlib/sortable-table-header :nickname "Nickname")
+                                           (vlib/sortable-table-header :move_1 "Fast")
+                                           (vlib/sortable-table-header :move_2 "Special")
                                            (vlib/sortable-table-header :cp "CP")
                                            (vlib/sortable-table-header :individual_percentage "IV % Perfect")
-                                           (vlib/sortable-table-header :individual_attack "IV Attack")
-                                           (vlib/sortable-table-header :individual_defense "IV Defense")
-                                           (vlib/sortable-table-header :individual_stamina "IV Stamina")
+                                           (vlib/sortable-table-header :individual_attack "Attack")
+                                           (vlib/sortable-table-header :individual_defense "Defense")
+                                           (vlib/sortable-table-header :individual_stamina "Stamina")
                                            (dom/th nil "")))
                         (dom/tbody nil
                                    (interleave