remove hard-coded URL

remove hard-coded URL

--- src/cljs/searchbot/parsets.cljs
+++ src/cljs/searchbot/parsets.cljs
@@ -28,7 +28,7 @@
 (defn- new-svg [graph-id w h]
   (-> js/d3 (.select graph-id) (.append "svg") (.attr "width" w) (.attr "height" h)))

-(defcomponent parsets [cursor owner {:keys [agg width height] :or {width 1000 height 600} :as opts}]
+(defcomponent parsets [cursor owner {:keys [agg url width height] :or {width 1000 height 600} :as opts}]
   (init-state [_]
               {:continue? true
                :comm (chan)
@@ -43,7 +43,7 @@
                 (.log js/console "# parsets agg query:" (pr-str agg-query))
                 (go (while (:continue? (om/get-state owner))
                       (.log js/console "# running parsets aggregation")
-                      (let [{agg-result :aggregations} (<! (es-agg "/es/stats_avc_1d/avc/_search" agg-query))]
+                      (let [{agg-result :aggregations} (<! (es-agg (or url (:url-agg (es-settings))) agg-query))]
                         (>! comm (agg->parsets agg-result parsets-agg)))
                       (<! (timeout 30000))))
                 ))


reset conn is better to preserve listeners from empty conn.

--- src/datascript/js.cljs
+++ src/datascript/js.cljs
@@ -94,9 +94,8 @@
 (defn ^:export create_conn [& [schema]]
   (d/create-conn (schema->clj schema)))

-(defn ^:export conn_from [db]
-  (atom db
-        :meta { :listeners  (atom {}) }))
+(defn ^:export reset_conn [conn db]
+  (reset! conn db))

 (defn ^:export db [conn]
   @conn)
@@ -116,6 +115,9 @@
 (defn ^:export resolve_tempid [tempids tempid]
   (aget tempids (str tempid)))

+(defn ^:export js_to_datom [d]
+  (js->Datom d))
+
 (defn ^:export datoms [db index & components]
   (->> (apply d/datoms db (keywordize index) components)
        into-array))


~(defn vocab-entry-to-lexeme) preserve :vocab-cat in generated lexical entry for debugging

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -482,12 +482,10 @@
   (let [ends-with (str (nth surface (- (count surface) 1)))]
     (cond

-      ;; if:
       (= vocab-cat "noun1")
-
-      ;;then:
-      {surface
-       [{:synsem {:sem {:pred (keyword pred)}
+      {surface
+       [{:vocab-cat vocab-cat
+         :synsem {:sem {:pred (keyword pred)}
                   :cat :noun
                   :agr {:gender (cond (= "o" ends-with)
                                       :masc
@@ -497,55 +495,64 @@
                                       :top)}}}]}
       (= vocab-cat "noun2m")
       {surface
-       [{:synsem {:sem {:pred (keyword pred)}
+       [{:vocab-cat vocab-cat
+         :synsem {:sem {:pred (keyword pred)}
                   :cat :noun
                   :agr {:gender :masc}}}]}

       (= vocab-cat "noun2f")
       {surface
-       [{:synsem {:sem {:pred (keyword pred)}
+       [{:vocab-cat vocab-cat
+         :synsem {:sem {:pred (keyword pred)}
                   :cat :noun
                   :agr {:gender :fem}}}]}

       (= vocab-cat "noun3")
       {surface
-       [{:synsem {:sem {:pred (keyword pred)}
+       [{:vocab-cat vocab-cat
+         :synsem {:sem {:pred (keyword pred)}
                   :cat :noun
                   :agr {:gender :masc}}
          :italiano {:plur (clojure.string/replace surface #"a$" "i")}}]}

       (= vocab-cat "nounneutr")
       {surface
-       [{:synsem {:sem {:pred (keyword pred)}
+       [{:vocab-cat vocab-cat
+         :synsem {:sem {:pred (keyword pred)}
                   :agr {:gender :masc
                         :number :sing}}}
-        {:synsem {:sem {:pred (keyword pred)}
+        {:vocab-cat vocab-cat
+         :synsem {:sem {:pred (keyword pred)}
                   :agr {:gender :fem
                         :number :plur}}
          :italian {:plur (clojure.string/replace surface #"o$" "a")}}]}

       (= vocab-cat "nounsingm")
       {surface
-       [{:synsem {:sem {:pred (keyword pred)}
+       [{:vocab-cat vocab-cat
+         :synsem {:sem {:pred (keyword pred)}
                   :agr {:gender :masc
                         :number :sing}}}]}

       (= vocab-cat "nounsingf")
       {surface
-       [{:synsem {:sem {:pred (keyword pred)}
+       [{:vocab-cat vocab-cat
+         :synsem {:sem {:pred (keyword pred)}
                   :agr {:gender :fem
                         :number :sing}}}]}

       (= vocab-cat "nounplurm")
       {surface
-       [{:synsem {:sem {:pred (keyword pred)}
+       [{:vocab-cat vocab-cat
+         :synsem {:sem {:pred (keyword pred)}
                   :agr {:gender :masc
                         :number :plur}}}]}

       (= vocab-cat "nounplurf")
       {surface
-       [{:synsem {:sem {:pred (keyword pred)}
+       [{:vocab-cat vocab-cat
+         :synsem {:sem {:pred (keyword pred)}
                   :agr {:gender :fem
                         :number :plur}}}]}


Rename function

Rename function

--- src/discuss/debug.cljs
+++ src/discuss/debug.cljs
@@ -68,7 +68,7 @@

                         " "
                         (dom/button #js {:className "btn btn-default"
-                                         :onClick   #(discuss.communication/post-origin-get-references)}
+                                         :onClick   #(discuss.communication/request-references)}
                                     "Get references")

                         (dom/h6 nil "Token")


Use `case` instead of `condp =` (idiomatic Clojure) :unamused:

--- src/metabase/query_processor/parameters.clj
+++ src/metabase/query_processor/parameters.clj
@@ -21,7 +21,7 @@
     "lastyear"})

 (defn- start-of-quarter [quarter year]
-  (condp = quarter
+  (case quarter
     "Q1" (t/first-day-of-the-month (.withMonthOfYear (t/date-time year) DateTimeConstants/JANUARY))
     "Q2" (t/first-day-of-the-month (.withMonthOfYear (t/date-time year) DateTimeConstants/APRIL))
     "Q3" (t/first-day-of-the-month (.withMonthOfYear (t/date-time year) DateTimeConstants/JULY))
@@ -79,7 +79,7 @@
 ;  (let [tz        (t/time-zone-for-id report-timezone)
 ;        formatter (tf/formatter "yyyy-MM-dd" tz)
 ;        today     (.withTimeAtStartOfDay (t/to-time-zone (t/now) tz))]
-;    (->> (condp = value
+;    (->> (case value
 ;           "past7days"  {:end   (t/minus today (t/days 1))
 ;                         :start (t/minus today (t/days 7))}
 ;           "past30days" {:end   (t/minus today (t/days 1))
@@ -113,7 +113,7 @@
       (let [{:keys [start end]} (absolute-date->range param-value)]
         ["BETWEEN" field start end])
       ;; relative date range
-      (condp = param-value
+      (case param-value
         "past7days"  ["TIME_INTERVAL" field -7 "day"]
         "past30days" ["TIME_INTERVAL" field -30 "day"]
         "thisweek"   ["TIME_INTERVAL" field "current" "week"]


remove prints

remove prints

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/aurora/dumbjoin.cljs
+++ src/aurora/dumbjoin.cljs
@@ -8,7 +8,6 @@
         itrs (next itrs)]
     (.reset itr)
     (while (not (.-end? itr))
-      (println itr map)
       (let [filled (aclone cur-search)
             cur-key (.key itr)
             valid? (loop [ix 0]
@@ -21,7 +20,6 @@
                          (when (or (= :u cur-search-val)
                                    (== cur-search-val cur-val))
                            (recur (inc ix))))))]
-        (println cur-search cur-key valid? filled)
         (if valid?
           (if itrs
             (check-next itrs filled results)


Bugfix: need to check whether remember/forget actually changed anything in the index

--- src/aurora/language.cljs
+++ src/aurora/language.cljs
@@ -86,9 +86,9 @@
                                 (let [remember (.seek-gte remember-iter key)]
                                   (when (or (nil? remember) (btree/key-not= key remember))
                                     (.push forgets key)))))
-                    (.add-facts this "know" name fields remembers)
-                    (.del-facts this "know" name fields forgets)
-                    (or (> (alength remembers) 0) (> (alength forgets) 0)))))
+                    (or
+                     (.add-facts this "know" name fields remembers)
+                     (.del-facts this "know" name fields forgets)))))
   (tick [this name->transient?]
         (let [names (js/Object.keys name->transient?)
               changed? false]


RS | #64 | Link project-status view to correct html file

--- src/objective8/templates/project_status.clj
+++ src/objective8/templates/project_status.clj
@@ -2,7 +2,7 @@
   (:require [net.cgrand.enlive-html :as html]
             [objective8.templates.page-furniture :as f]))

-(def project-status-template (html/html-resource "templates/jade/learn-more.html"))
+(def project-status-template (html/html-resource "templates/jade/project-status.html"))

 (defn project-status-page [{:keys [translations doc] :as context}]
   (apply str


Spec defcontroller, to try and help avoid errors.

--- src/draconic/fx/ml.clj
+++ src/draconic/fx/ml.clj
@@ -3,7 +3,8 @@
             [clojure.string :as str]
             [draconic.fx.assignment :as fxa]
             [com.rpl.specter :as sp :refer :all]
-            [draconic.macros :as dramac])
+            [draconic.macros :as dramac]
+            [clojure.spec :as s])
   (:import (javafx.scene Scene)
            (javafx.stage Stage)
            (java.io ByteArrayInputStream)
@@ -83,12 +84,13 @@
   (let [destructargs (into [] (rest args))
         maparg (first args)
         body-with-do (conj body 'do)]
-    (println "some args " destructargs)
-    (println "map arg" maparg)
-    (println body-with-do)
     `(defn ~varname ~docstring [{:strs ~destructargs :as ~maparg}]
        ~body-with-do
        ~maparg)))
+
+(s/fdef defcontroller
+        :args (s/and (s/cat :varname symbol? :docstring string? :args vector? :body (s/* any?)))
+  )

 (defn launch-fxml-window
   "Launches a window. First argument is a vector passed to make-composite-nodes. Second is a controller fn


types prelude 1

types prelude 1

--- src/latte_compiler/static_analysis.clj
+++ src/latte_compiler/static_analysis.clj
@@ -82,8 +82,6 @@
                [false _] (makeclassdefmap glob-state (hash-map) (second clssexpr) (nth clssexpr 2))
                )
   )
-
-

 (defn class-dep
   [clsdef]
@@ -214,34 +212,42 @@

 (defn check-type
   [glob-state funexpr]
-  (match/match funexpr [_ [type] [_ name] args block]
-               (let
-                 [vars (add-args (vars-map) args)]
-                 )
-               )
-  (util/succ glob-state)
+  ;(match/match funexpr [_ [type] [_ name] args block]
+  ;             (m/domonad util/phase-m
+  ;               [vars (m-result (add-args (vars-map) args))]
+  ;               )
+  ;             )
+  (util/succ funexpr)
   )

 (defn analyze-fun
   [glob-state funexpr]
   (match/match funexpr [_ [type] [_ name] args block]
                (if (not (or (= type :void) (terminated block)))
-                 (util/err (str "return not found in function " name "\n" (util/ip-meta funexpr)))
-                 (check-type glob-state funexpr)
+                 (do (println "err") (util/err (str "return not found in function " name "\n" (util/ip-meta funexpr))))
+                 (do (println funexpr) (check-type glob-state funexpr))
                  )
                )
   )

 (defn check
-  [glob-state expr]
-  (println expr)
+  [glob-state]
+  (println glob-state)
+  (fn [expr]
+    (m/domonad util/phase-m
+               [state glob-state
+                res (match/match (first expr)
+                                 ;:clssdef (analyze-class state (second expr))
+                                 :fndef (analyze-fun state expr))]
+               (do (println "ser") (println res) res))))
+
+(defn merge-checks
+  [acc cur]
   (m/domonad util/phase-m
-             [state glob-state
-              res (match/match (first expr)
-                               ;:clssdef (analyze-class state (second expr))
-                               :fndef (analyze-fun state expr))]
-             (do (println res) res))
-  )
+             [acc acc
+              curr cur]
+              (conj acc curr)
+             ))

 (defn analize
   [tree]
@@ -253,18 +259,15 @@
     (m/domonad util/phase-m
                [funs (funsred split-funs (.-funs glob-state))
                 new-glob-state (m-result (update glob-state :funs (fn [_] funs)))
-                n-glob-state (do (println new-glob-state) (main-check new-glob-state))
-                result (do (println n-glob-state) (reduce check (m-result n-glob-state) (vec tree)))
+                n-glob-state (do (println "A") (main-check new-glob-state))
+                result (do (println "B") (reduce merge-checks (m-result []) (map (check (m-result n-glob-state)) tree)))
                 ]
-               (do
-                 result)
-               )
-
-    ))
-
-;(analize (vec [
-;               [:fndef [:int] [:ident "main"] [:args] [:block [:sexp [:expr [:eapp [:ident "printInt"] [:expr [:elitint 1]]]]] [:sexp [:expr [:evar [:ident "return"]]]]]]
-;               [:fndef [:int] [:ident "g"] [:args [:arg [:tident [:ident "string"]] [:ident "a"]]] [:block [:ret [:expr [:eadd [:elitint 4] [:plus] [:elitint 2]]]]]]
-;               [:fndef [:int] [:ident "h"] [:args [:arg [:tident [:ident "string"]] [:ident "a"]]] [:block [:ret [:expr [:eadd [:elitint 4] [:plus] [:elitint 2]]]]]]
-;               [:fndef [:int] [:ident "f"] [:args [:arg [:int] [:ident "a"]] [:arg [:int] [:ident "b"]]] [:block [:ret [:expr [:eapp [:ident "g"] [:expr [:estring "132"]]]]]]]
-;               ]))
+               result
+               )))
+
+(analize (vec [
+               [:fndef [:int] [:ident "main"] [:args] [:block [:sexp [:expr [:eapp [:ident "printInt"] [:expr [:elitint 1]]]]] [:vret]]]
+               [:fndef [:int] [:ident "g"] [:args [:arg [:tident [:ident "string"]] [:ident "a"]]] [:block [:ret [:expr [:eadd [:elitint 4] [:plus] [:elitint 2]]]]]]
+               [:fndef [:int] [:ident "h"] [:args [:arg [:tident [:ident "string"]] [:ident "a"]]] [:block [:ret [:expr [:eadd [:elitint 4] [:plus] [:elitint 2]]]]]]
+               [:fndef [:int] [:ident "f"] [:args [:arg [:int] [:ident "a"]] [:arg [:int] [:ident "b"]]] [:block [:ret [:expr [:eapp [:ident "g"] [:expr [:estring "132"]]]]]]]
+               ]))


Rerelease aleph

Rerelease aleph

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

-(defproject juxt.modular/aleph "0.0.1"
+(defproject juxt.modular/aleph "0.0.2"
   :description "A modular extension that provides support for aleph"
   :url "https://github.com/juxt/modular/tree/master/modules/aleph"
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
-  :dependencies [[aleph "0.4.0-SNAPSHOT" :exclusions [org.clojure/clojure]]
+  :dependencies [[aleph "0.4.0-alpha9" :exclusions [org.clojure/clojure]]
                  [prismatic/schema "0.2.1"]
                  [juxt.modular/ring "0.5.2"]
                  ]


Improve formatting

Improve formatting

--- src/refactor_nrepl/find/symbols_in_file.clj
+++ src/refactor_nrepl/find/symbols_in_file.clj
@@ -52,10 +52,13 @@
                               (when (symbol? form)
                                 (swap! syms conj (normalize-ctor-call form)))
                               ;; Classes used in typehints
-                              (when-let [t (:tag (meta form))] (swap! syms conj t))
+                              (when-let [t (:tag (meta form))]
+                                (swap! syms conj t))
                               form)]
          (loop [form (reader/read rdr-opts rdr)]
            (when (not= form :eof)
              (walk/prewalk collect-symbol form)
              (recur (reader/read rdr-opts rdr))))
-         (set (map (partial fix-ns-of-backquoted-symbols (dialect parsed-ns)) @syms)))))))
+         (->> @syms
+              (map (partial fix-ns-of-backquoted-symbols (dialect parsed-ns)))
+              set))))))


refine transaction test for multiple items same account

--- test/clj_money/models/transactions_test.clj
+++ test/clj_money/models/transactions_test.clj
@@ -305,11 +305,16 @@
         [checking-items
          salary-items
          groceries-items] (map #(transactions/items-by-account storage-spec (:id %))
-                               (:accounts context))]
-    (is (= [{:index 0 :amount 1000 :balance 1000}
-            {:index 1 :amount  100 :balance 1100}
-            {:index 2 :amount  100 :balance 1000}]
-           checking-items)
+                               (:accounts context))
+        expected-checking-items (->> [{:index 2 :amount  100 :balance 1000}
+                                      {:index 1 :amount  100 :balance 1100}
+                                      {:index 0 :amount 1000 :balance 1000}]
+                                     (map #(update-in % [:amount] bigdec))
+                                     (map #(update-in % [:balance] bigdec)))
+        actual-checking-items (map #(select-keys % [:index :amount :balance])
+                                   checking-items)]
+    (is (= expected-checking-items
+           actual-checking-items)
         "The checking account items are correct")))

 ; update a transaction


Reorganized vect-math tests.

Reorganized vect-math tests.

--- test/uncomplicate/neanderthal/math_test.clj
+++ test/uncomplicate/neanderthal/math_test.clj
@@ -17,7 +17,7 @@
   (:import clojure.lang.ExceptionInfo))

 (defmacro ^:private zero []
-  `(roughly 0 0.000001))
+  `(roughly 0 0.00001))

 (defn diff-vctr-1
   ([factory scalarf vectorf start end by]
@@ -73,134 +73,83 @@

 ;; =========================================================================

-(defn test-vctr [factory]
-  (facts "vctr-sqr" (diff-vctr-1 factory m/sqr vm/sqr) => (zero))
-  (facts "vctr-mul" (diff-vctr-2 factory (double-fn *) vm/mul) => (zero))
-  (facts "vctr-div" (diff-vctr-2 factory (double-fn /) vm/div) => (zero))
-  (facts "vctr-inv" (diff-vctr-1 factory (double-fn /) vm/inv) => (zero))
-  (facts "vctr-abs" (diff-vctr-1 factory m/abs vm/abs) => (zero))
+(defn test-math [factory diff-1 diff-2]
+  (facts "sqr" (diff-1 factory m/sqr vm/sqr) => (zero))
+  (facts "mul" (diff-2 factory (double-fn *) vm/mul) => (zero))
+  (facts "div" (diff-2 factory (double-fn /) vm/div) => (zero))
+  (facts "inv" (diff-1 factory (double-fn /) vm/inv) => (zero))
+  (facts "abs" (diff-1 factory m/abs vm/abs) => (zero))
+  (facts "fmod" (diff-2 factory (double-fn mod) vm/fmod) => (zero))
+  (facts "frem" (diff-2 factory (double-fn #(rem (double %1) (double %2))) vm/frem) => (zero))
+  (facts "sqrt" (diff-1 factory m/sqrt vm/sqrt 1 9 0.22) => (zero))
+  (facts "inv-sqrt"
+         (diff-1 factory (double-fn (comp m/sqrt /)) vm/inv-sqrt 1 7 0.23) => (zero))
+  (facts "cbrt" (diff-1 factory m/cbrt vm/cbrt) => (zero))
+  (facts "inv-cbrt" (diff-1 factory (double-fn (comp m/cbrt /)) vm/inv-cbrt 1 9 0.32) => (zero))
+  (facts "pow23" (diff-1 factory (m/pow 2/3) vm/pow23 1 3 0.11) => (zero))
+  (facts "pow32" (diff-1 factory (m/pow 3/2) vm/pow32 1 5 0.13) => (zero))
+  (facts "pow" (diff-2 factory m/pow vm/pow 1 3 0.17) => (zero))
+  (facts "powx" (diff-1 factory (m/pow 2) #(vm/pow % 2)) => (zero))
+  (facts "hypot" (diff-2 factory m/hypot vm/hypot) => (zero))
+  (facts "exp" (diff-1 factory m/exp vm/exp) => (zero))
+  (facts "expm1" (diff-1 factory m/expm1 vm/expm1) => (zero))
+  (facts "log" (diff-1 factory m/log vm/log 0.1 7 0.33) => (zero))
+  (facts "log10" (diff-1 factory m/log10 vm/log10 0.1 3 0.07) => (zero))
+  (facts "sin" (diff-1 factory m/sin vm/sin) => (zero))
+  (facts "cos" (diff-1 factory m/cos vm/cos) => (zero))
+  (facts "tan" (diff-1 factory m/tan vm/tan 1 9 0.77) => (zero))
+  (facts "sincos" (diff-2 factory m/sin m/cos vm/sincos 1 3 0.17) => (just [(zero) (zero)]))
+  (facts "asin" (diff-1 factory m/asin vm/asin) => (zero))
+  (facts "acos" (diff-1 factory m/acos vm/acos) => (zero))
+  (facts "atan" (diff-1 factory m/atan vm/atan 1 9 0.66) => (zero))
+  (facts "atan2" (diff-2 factory m/atan2 vm/atan2 1 9 0.66) => (zero))
+  (facts "sinh" (diff-1 factory m/sinh vm/sinh) => (zero))
+  (facts "cosh" (diff-1 factory m/cosh vm/cosh) => (zero))
+  (facts "tanh" (diff-1 factory m/tanh vm/tanh 1 9 0.77) => (zero))
+  (facts "asinh" (diff-1 factory m/asinh vm/asinh) => (zero))
+  (facts "acosh"
+         (diff-1 factory (double-fn (comp m/acosh m/cosh)) (comp vm/acosh vm/cosh)) => (zero))
+  (facts "atanh" (diff-1 factory m/atanh vm/atanh 0 1 0.06) => (zero))
+  (facts "erf" (diff-1 factory m/erf vm/erf) => (zero))
+  (facts "erfc" (diff-1 factory m/erfc vm/erfc) => (zero))
+  (facts "erf-inv"
+         (diff-1 factory (double-fn (comp m/erf-inv m/erf)) (comp vm/erf-inv vm/erf)) => (zero))
+  (facts "erfc-inv"
+         (diff-1 factory (double-fn (comp m/erfc-inv m/erfc)) (comp vm/erfc-inv vm/erfc)) => (zero))
+  (facts "cdf-norm" (diff-1 factory m/cdf-norm vm/cdf-norm) => (zero))
+  (facts "cdf-norm-inv"
+         (diff-1 factory (double-fn (comp m/cdf-norm-inv m/cdf-norm)) (comp vm/cdf-norm-inv vm/cdf-norm))
+         => (zero))
+  (facts "gamma" (diff-1 factory m/gamma vm/gamma 0.1 7 0.22) => (zero))
+  (facts "lgamma" (diff-1 factory m/lgamma vm/lgamma 0.1 7 0.22) => (zero))
+  (facts "floor" (diff-1 factory m/floor vm/floor -5 7 0.22) => (zero))
+  (facts "ceil" (diff-1 factory m/ceil vm/ceil -5 7 0.342) => (zero))
+  (facts "trunc" (diff-1 factory m/trunc vm/trunc -5 7 0.342) => (zero))
+  (facts "round" (diff-1 factory m/round vm/round -5 7 0.342) => (zero))
+  (facts "modf" (diff-2 factory m/trunc m/frac vm/modf -5 6 0.77) => (just [(zero) (zero)]))
+  (facts "frac" (diff-1 factory m/frac vm/frac -5 9 0.87) => (zero))
+  (facts "max" (diff-2 factory (double-fn max) vm/fmax) => (zero))
+  (facts "min" (diff-2 factory (double-fn min) vm/fmin) => (zero)))
+
+(defn test-vctr-linear-frac [factory]
   (facts "vctr-linear-frac"
          (with-release [a (vctr factory 1 2 3)
                         b (vctr factory 2 3 4)
                         expected (vctr factory 5/13 7/17 9/21)
                         result (vm/linear-frac 2 a 3 4 b 5)]
-           (nrm2 (axpy! -1 result expected)) => (zero)))
-  (facts "vctr-fmod" (diff-vctr-2 factory (double-fn mod) vm/fmod) => (zero))
-  (facts "vctr-frem" (diff-vctr-2 factory (double-fn #(rem (double %1) (double %2))) vm/frem) => (zero))
-  (facts "vctr-sqrt" (diff-vctr-1 factory m/sqrt vm/sqrt 1 9 0.22) => (zero))
-  (facts "vctr-inv-sqrt"
-         (diff-vctr-1 factory (double-fn (comp m/sqrt /)) vm/inv-sqrt 1 7 0.23) => (zero))
-  (facts "vctr-cbrt" (diff-vctr-1 factory m/cbrt vm/cbrt) => (zero))
-  (facts "vctr-inv-cbrt" (diff-vctr-1 factory (double-fn (comp m/cbrt /)) vm/inv-cbrt 1 9 0.32) => (zero))
-  (facts "vctr-pow23" (diff-vctr-1 factory (m/pow 2/3) vm/pow23 1 3 0.11) => (zero))
-  (facts "vctr-pow32" (diff-vctr-1 factory (m/pow 3/2) vm/pow32 1 5 0.13) => (zero))
-  (facts "vctr-pow" (diff-vctr-2 factory m/pow vm/pow 1 3 0.17) => (zero))
-  (facts "vctr-powx" (diff-vctr-1 factory (m/pow 2) #(vm/pow % 2)) => (zero))
-  (facts "vctr-hypot" (diff-vctr-2 factory m/hypot vm/hypot) => (zero))
-  (facts "vctr-exp" (diff-vctr-1 factory m/exp vm/exp) => (zero))
-  (facts "vctr-expm1" (diff-vctr-1 factory m/expm1 vm/expm1) => (zero))
-  (facts "vctr-log" (diff-vctr-1 factory m/log vm/log 0.1 7 0.33) => (zero))
-  (facts "vctr-log10" (diff-vctr-1 factory m/log10 vm/log10 0.1 3 0.07) => (zero))
-  (facts "vctr-sin" (diff-vctr-1 factory m/sin vm/sin) => (zero))
-  (facts "vctr-cos" (diff-vctr-1 factory m/cos vm/cos) => (zero))
-  (facts "vctr-tan" (diff-vctr-1 factory m/tan vm/tan 1 9 0.77) => (zero))
-  (facts "vctr-sincos" (diff-vctr-2 factory m/sin m/cos vm/sincos 1 3 0.17) => (just [(zero) (zero)]))
-  (facts "vctr-asin" (diff-vctr-1 factory m/asin vm/asin) => (zero))
-  (facts "vctr-acos" (diff-vctr-1 factory m/acos vm/acos) => (zero))
-  (facts "vctr-atan" (diff-vctr-1 factory m/atan vm/atan 1 9 0.66) => (zero))
-  (facts "vctr-atan2" (diff-vctr-2 factory m/atan2 vm/atan2 1 9 0.66) => (zero))
-  (facts "vctr-sinh" (diff-vctr-1 factory m/sinh vm/sinh) => (zero))
-  (facts "vctr-cosh" (diff-vctr-1 factory m/cosh vm/cosh) => (zero))
-  (facts "vctr-tanh" (diff-vctr-1 factory m/tanh vm/tanh 1 9 0.77) => (zero))
-  (facts "vctr-asinh" (diff-vctr-1 factory m/asinh vm/asinh) => (zero))
-  (facts "vctr-acosh"
-         (diff-vctr-1 factory (double-fn (comp m/acosh m/cosh)) (comp vm/acosh vm/cosh)) => (zero))
-  (facts "vctr-atanh" (diff-vctr-1 factory m/atanh vm/atanh 0 1 0.06) => (zero))
-  (facts "vctr-erf" (diff-vctr-1 factory m/erf vm/erf) => (zero))
-  (facts "vctr-erfc" (diff-vctr-1 factory m/erfc vm/erfc) => (zero))
-  (facts "vctr-erf-inv"
-         (diff-vctr-1 factory (double-fn (comp m/erf-inv m/erf)) (comp vm/erf-inv vm/erf)) => (zero))
-  (facts "vctr-erfc-inv"
-         (diff-vctr-1 factory (double-fn (comp m/erfc-inv m/erfc)) (comp vm/erfc-inv vm/erfc)) => (zero))
-  (facts "vctr-cdf-norm" (diff-vctr-1 factory m/cdf-norm vm/cdf-norm) => (zero))
-  (facts "vctr-cdf-norm-inv"
-         (diff-vctr-1 factory (double-fn (comp m/cdf-norm-inv m/cdf-norm)) (comp vm/cdf-norm-inv vm/cdf-norm))
-         => (zero))
-  (facts "vctr-gamma" (diff-vctr-1 factory m/gamma vm/gamma 0.1 7 0.22) => (zero))
-  (facts "vctr-lgamma" (diff-vctr-1 factory m/lgamma vm/lgamma 0.1 7 0.22) => (zero))
-  (facts "vctr-floor" (diff-vctr-1 factory m/floor vm/floor -5 7 0.22) => (zero))
-  (facts "vctr-ceil" (diff-vctr-1 factory m/ceil vm/ceil -5 7 0.342) => (zero))
-  (facts "vctr-trunc" (diff-vctr-1 factory m/trunc vm/trunc -5 7 0.342) => (zero))
-  (facts "vctr-round" (diff-vctr-1 factory m/round vm/round -5 7 0.342) => (zero))
-  (facts "vctr-modf" (diff-vctr-2 factory m/trunc m/frac vm/modf -5 6 0.77) => (just [(zero) (zero)]))
-  (facts "vctr-frac" (diff-vctr-1 factory m/frac vm/frac -5 9 0.87) => (zero))
-  (facts "vctr-max" (diff-vctr-2 factory (double-fn max) vm/fmax) => (zero))
-  (facts "vctr-min" (diff-vctr-2 factory (double-fn min) vm/fmin) => (zero)))
+           (nrm2 (axpy! -1 result expected)) => (zero))))

-(defn test-ge [factory]
-  (facts "ge-sqr" (diff-ge-1 factory m/sqr vm/sqr) => (zero))
-  (facts "ge-mul" (diff-ge-2 factory (double-fn *) vm/mul) => (zero))
-  (facts "ge-div" (diff-ge-2 factory (double-fn /) vm/div) => (zero))
-  (facts "ge-inv" (diff-ge-1 factory (double-fn /) vm/inv) => (zero))
-  (facts "ge-abs" (diff-ge-1 factory m/abs vm/abs) => (zero))
+(defn test-ge-linear-frac [factory]
   (facts "ge-linear-frac"
-         (with-release [a (vctr factory 1 2 3)
-                        b (vctr factory 2 3 4)
-                        expected (vctr factory 5/13 7/17 9/21)
+         (with-release [a (ge factory 3 2 [1 2 3 1 2 3])
+                        b (ge factory 3 2 [2 3 4 2 3 4])
+                        expected (ge factory 3 2 [5/13 7/17 9/21
+                                                  5/13 7/17 9/21])
                         result (vm/linear-frac 2 a 3 4 b 5)]
-           (nrm2 (axpy! -1 result expected)) => (zero)))
-  (facts "ge-fmod" (diff-ge-2 factory (double-fn mod) vm/fmod) => (zero))
-  (facts "ge-frem" (diff-ge-2 factory (double-fn #(rem (double %1) (double %2))) vm/frem) => (zero))
-  (facts "ge-sqrt" (diff-ge-1 factory m/sqrt vm/sqrt 1 9 0.22) => (zero))
-  (facts "ge-inv-sqrt"
-         (diff-ge-1 factory (double-fn (comp m/sqrt /)) vm/inv-sqrt 1 7 0.23) => (zero))
-  (facts "ge-cbrt" (diff-ge-1 factory m/cbrt vm/cbrt) => (zero))
-  (facts "ge-inv-cbrt" (diff-ge-1 factory (double-fn (comp m/cbrt /)) vm/inv-cbrt 1 9 0.32) => (zero))
-  (facts "ge-pow23" (diff-ge-1 factory (m/pow 2/3) vm/pow23 1 3 0.11) => (zero))
-  (facts "ge-pow32" (diff-ge-1 factory (m/pow 3/2) vm/pow32 1 5 0.13) => (zero))
-  (facts "ge-pow" (diff-ge-2 factory m/pow vm/pow 1 3 0.17) => (zero))
-  (facts "ge-powx" (diff-ge-1 factory (m/pow 2) #(vm/pow % 2)) => (zero))
-  (facts "ge-hypot" (diff-ge-2 factory m/hypot vm/hypot) => (zero))
-  (facts "ge-exp" (diff-ge-1 factory m/exp vm/exp) => (zero))
-  (facts "ge-expm1" (diff-ge-1 factory m/expm1 vm/expm1) => (zero))
-  (facts "ge-log" (diff-ge-1 factory m/log vm/log 0.1 7 0.33) => (zero))
-  (facts "ge-log10" (diff-ge-1 factory m/log10 vm/log10 0.1 3 0.07) => (zero))
-  (facts "ge-sin" (diff-ge-1 factory m/sin vm/sin) => (zero))
-  (facts "ge-cos" (diff-ge-1 factory m/cos vm/cos) => (zero))
-  (facts "ge-tan" (diff-ge-1 factory m/tan vm/tan 1 9 0.77) => (zero))
-  (facts "ge-sincos" (diff-ge-2 factory m/sin m/cos vm/sincos 1 3 0.17) => (just [(zero) (zero)]))
-  (facts "ge-asin" (diff-ge-1 factory m/asin vm/asin) => (zero))
-  (facts "ge-acos" (diff-ge-1 factory m/acos vm/acos) => (zero))
-  (facts "ge-atan" (diff-ge-1 factory m/atan vm/atan 1 9 0.66) => (zero))
-  (facts "ge-atan2" (diff-ge-2 factory m/atan2 vm/atan2 1 9 0.66) => (zero))
-  (facts "ge-sinh" (diff-ge-1 factory m/sinh vm/sinh) => (zero))
-  (facts "ge-cosh" (diff-ge-1 factory m/cosh vm/cosh) => (zero))
-  (facts "ge-tanh" (diff-ge-1 factory m/tanh vm/tanh 1 9 0.77) => (zero))
-  (facts "ge-asinh" (diff-ge-1 factory m/asinh vm/asinh) => (zero))
-  (facts "ge-acosh"
-         (diff-ge-1 factory (double-fn (comp m/acosh m/cosh)) (comp vm/acosh vm/cosh)) => (zero))
-  (facts "ge-atanh" (diff-ge-1 factory m/atanh vm/atanh 0 1 0.06) => (zero))
-  (facts "ge-erf" (diff-ge-1 factory m/erf vm/erf) => (zero))
-  (facts "ge-erfc" (diff-ge-1 factory m/erfc vm/erfc) => (zero))
-  (facts "ge-erf-inv"
-         (diff-ge-1 factory (double-fn (comp m/erf-inv m/erf)) (comp vm/erf-inv vm/erf)) => (zero))
-  (facts "ge-erfc-inv"
-         (diff-ge-1 factory (double-fn (comp m/erfc-inv m/erfc)) (comp vm/erfc-inv vm/erfc)) => (zero))
-  (facts "ge-cdf-norm" (diff-ge-1 factory m/cdf-norm vm/cdf-norm) => (zero))
-  (facts "ge-cdf-norm-inv"
-         (diff-ge-1 factory (double-fn (comp m/cdf-norm-inv m/cdf-norm)) (comp vm/cdf-norm-inv vm/cdf-norm))
-         => (zero))
-  (facts "ge-gamma" (diff-ge-1 factory m/gamma vm/gamma 0.1 7 0.22) => (zero))
-  (facts "ge-lgamma" (diff-ge-1 factory m/lgamma vm/lgamma 0.1 7 0.22) => (zero))
-  (facts "ge-floor" (diff-ge-1 factory m/floor vm/floor -5 7 0.22) => (zero))
-  (facts "ge-ceil" (diff-ge-1 factory m/ceil vm/ceil -5 7 0.342) => (zero))
-  (facts "ge-trunc" (diff-ge-1 factory m/trunc vm/trunc -5 7 0.342) => (zero))
-  (facts "ge-round" (diff-ge-1 factory m/round vm/round -5 7 0.342) => (zero))
-  (facts "ge-modf" (diff-ge-2 factory m/trunc m/frac vm/modf -5 6 0.77) => (just [(zero) (zero)]))
-  (facts "ge-frac" (diff-ge-1 factory m/frac vm/frac -5 9 0.87) => (zero))
-  (facts "ge-max" (diff-ge-2 factory (double-fn max) vm/fmax) => (zero))
-  (facts "ge-min" (diff-ge-2 factory (double-fn min) vm/fmin) => (zero)))
+           (nrm2 (axpy! -1 result expected)) => (zero))))

 (defn test-all [factory]
-  (test-vctr factory)
-  (test-ge factory))
+  (test-math factory diff-vctr-1 diff-vctr-2)
+  (test-math factory diff-ge-1 diff-ge-2)
+  (test-vctr-linear-frac factory)
+  (test-ge-linear-frac factory))


fix build task

fix build task

* call build-sift task instead of calling builtin/sift directly
* add final call to builtin/target

Signed-off-by: Gregg Reynolds <d0f77bc71a9867acdcb4f62f012b858edad79160@norc.org>

--- src/migae/boot_gae.clj
+++ src/migae/boot_gae.clj
@@ -564,6 +564,11 @@
             target-handler (target-middleware next-handler)]
         (target-handler fileset)))))

+(boot/deftask keep-config
+  "Retain master config file"
+  []
+  (builtin/sift :to-resource #{(re-pattern (str ".*" boot-config-edn))}))
+
 (boot/deftask build
   "Configure and build servlet or service app"
   [k keep bool "keep intermediate .clj and .edn files"
@@ -583,8 +588,11 @@
           (logging :verbose verbose)
           (webxml :verbose verbose)
           (appengine :verbose verbose)
-          (builtin/sift :move {#"(.*clj$)" (str classes-dir "/$1")})
-          (builtin/sift :move {#"(.*\.class$)" (str classes-dir "/$1")})
+          (build-sift)
+          (if keep identity (keep-config))
+          (builtin/target)
+          ;; (builtin/sift :move {#"(.*clj$)" (str classes-dir "/$1")})
+          ;; (builtin/sift :move {#"(.*\.class$)" (str classes-dir "/$1")})
           ;; (if servlet
           ;;   identity
           ;;   (comp
@@ -965,11 +973,6 @@
             (println "Installing unpacked SDK to: " (.getPath sdk-dir)))
           (pod/unpack-jar jar-path (.getParent sdk-dir))))
       fileset)))
-
-(boot/deftask keep-config
-  "Retain master config file"
-  []
-  (builtin/sift :to-resource #{(re-pattern (str ".*" boot-config-edn))}))

 ;; FIXME:  for dev phase, we want to include deps in test scope
 (boot/deftask libs


Add endpoints tests "api/shares" and "/share"

--- backend/test/akvo/lumen/endpoints_test.clj
+++ backend/test/akvo/lumen/endpoints_test.clj
@@ -117,10 +117,10 @@
                             :sort nil}])

 ;; Todo: generate it with current vis + aggregation specs!!
-(defn visualisation-bar-payload [dataset-id name*]
+(defn visualisation-payload [dataset-id vis-type name*]
   {:type "visualisation",
    :name name*,
-   :visualisationType "bar",
+   :visualisationType vis-type
    :datasetId dataset-id
    :spec {:metricColumnX nil,
           :horizontal false,
@@ -234,12 +234,30 @@
           (let [bar-vis-name "hello-bar-vis!"]
             (is (= [bar-vis-name dataset-id]
                    (-> (h (post*  (api-url "/visualisations")
-                                  (visualisation-bar-payload dataset-id bar-vis-name)))
+                                  (visualisation-payload dataset-id "bar" bar-vis-name)))
                        :body
                        (json/parse-string keyword)
                        ((juxt :name :datasetId)))))
-            (is (= bar-vis-name (-> (h (get* (api-url "/library")))
-                                    :body (json/parse-string keyword) :visualisations first :name))))
+            (let [[name* id*] (-> (h (get* (api-url "/library")))
+                                  :body (json/parse-string keyword) :visualisations first                        ((juxt :name :id)))]
+              (is (= bar-vis-name name*))
+              (testing "/shares"
+                (let [share-id (-> (h (post*  (api-url "/shares") {:visualisationId id*}))
+                                   :body (json/parse-string keyword)
+                                   :id)]
+                  (is (some? share-id))
+                  (let [{:keys [visualisations datasets visualisationId]} (-> (h (get* (str "/share/" share-id)))
+                                                                              :body (json/parse-string keyword))]
+                    (is (= visualisationId id*))
+                    (is (some? visualisations))
+                    (is (some? datasets))
+                    )
+                  )
+
+                )
+
+
+              ))

           )


Faster conjing.

Faster conjing.

--- src/clj/com/hypirion/subtex.clj
+++ src/clj/com/hypirion/subtex.clj
@@ -84,8 +84,15 @@
 (def remove-comments
   (remove #(identical? (:type %) :comment)))

+(defn rf-conj!
+  ([] (transient []))
+  ([res] (persistent! res))
+  ([res input] (conj! res input)))
+
 (defn read
   [data]
-  (transduce (comp minted/process match-braces group-calls group-env remove-comments)
-             conj []
+  (transduce (comp minted/process remove-comments match-braces group-calls
+                   group-env hiccup/item-to-li hiccup/itemize-to-ul
+                   hiccup/enumerate-to-ol hiccup/common-invokes)
+             rf-conj! (transient [:body])
              (iterator-seq (Tokenise. data))))


--- src/clj/forma/source/static.clj
+++ src/clj/forma/source/static.clj
@@ -3,9 +3,15 @@
         [forma.source.modis :only (wgs84-resolution)]
         [forma.static :only (static-datasets)]
         [forma.reproject :only (wgs84-indexer
+<<<<<<< HEAD
                                 modis-indexer)])
   (:require [cascalog.ops :as c]
             [forma.source.modis :as m]
+=======
+                                modis-indexer)]
+        [clojure.string :only (split)])
+  (:require [forma.source.modis :as m]
+>>>>>>> wgs84-indexer now accepts ascii-map in all cases.
             [forma.hadoop.predicate :as p]
             [clojure.contrib.duck-streams :as duck]))


fix :req in Medium and Nerve Agent that triggers log message

--- src/clj/game/cards-programs.clj
+++ src/clj/game/cards-programs.clj
@@ -296,8 +296,10 @@
    {:abilities [{:cost [:click 1] :effect (effect (gain :credit 2)) :msg "gain 2 [Credits]"}]}

    "Medium"
-   {:events {:no-action {:req (req (and run (= (:server run) [:rd]) (not current-ice))
-                                        (and (:counter card) (> (:counter card) 0)))
+   {:events {:no-action {:req (req (and run
+                                        (= (first (get-in @state [:run :server])) :rd)
+                                        (not current-ice)
+                                        (and (:counter card) (> (:counter card) 0))))
                          :effect (req (system-msg state :runner (str "may choose fewer than all additional R&D accesses"
                                                                      " by clicking on Medium"))
                                       (update! state side (assoc card :medium-active true)))}
@@ -319,8 +321,10 @@
    {:recurring 2}

    "Nerve Agent"
-   {:events {:no-action {:req (req (and run (= (:server run) [:hq]) (not current-ice))
-                                        (and (:counter card) (> (:counter card) 0)))
+   {:events {:no-action {:req (req (and run
+                                        (= (first (get-in @state [:run :server])) :hq)
+                                        (not current-ice)
+                                        (and (:counter card) (> (:counter card) 0))))
                          :effect (req (system-msg state :runner (str "may choose fewer than all additional HQ accesses"
                                                                      " by clicking on Nerve Agent"))
                                       (update! state side (assoc card :nerve-active true)))}


thread name

thread name

--- src/clj/neb/durability/core.clj
+++ src/clj/neb/durability/core.clj
@@ -20,7 +20,7 @@
   (try
     (let [dirty-segments (.getDirtySegments trunk)
           sync-pool (cp/threadpool (* 2 (count @server-sids)) :name "Backup-Remote-Sync")
-          seg-pool (cp/threadpool 2 "Backup-Segment")
+          seg-pool (cp/threadpool 2 :name "Backup-Segment")
           trunk-id (.getId trunk)]
       (cp/pdoseq
         seg-pool [^Segment seg dirty-segments]


resolve account parent-id values

resolve account parent-id values

--- src/clj_money/serialization.clj
+++ src/clj_money/serialization.clj
@@ -49,9 +49,22 @@
   [context model]
   (update-in model [:entity-id] #(:id (find-entity context %))))

+(defn- resolve-parent
+  [storage-spec account]
+  (if (:parent-id account)
+    (let [parent (accounts/find-by-name storage-spec (:entity-id account) (:parent-id account))]
+
+      (pprint {:resolve-parent account
+               :parent parent})
+
+      (assoc account :parent-id (:id parent)))
+    account))
+
 (defn- create-accounts
   [storage-spec context accounts]
-  (mapv #(accounts/create storage-spec (resolve-entity context %)) accounts))
+  (mapv #(accounts/create storage-spec (->> %
+                                            (resolve-entity context)
+                                            (resolve-parent storage-spec))) accounts))

 (defn- realize-accounts
   [storage-spec context]


cljs-nusmods.main - Add `LessonTime` info to Exhibit 3 items

This enables the filter by `Lecture Timings` and filter by `Tutorial
Timings` HierarchicalFacets on the Module Finder page.

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

--- src/cljs/cljs_nusmods/main.cljs
+++ src/cljs/cljs_nusmods/main.cljs
@@ -2,7 +2,8 @@
   cljs-nusmods.main
   (:use [jayq.core :only [$ one]])
   (:require [cljs-nusmods.module-array-repr     :as module-array-repr]
-            [cljs-nusmods.aux-module-array-repr :as aux-module-array-repr]))
+            [cljs-nusmods.aux-module-array-repr :as aux-module-array-repr]
+            [cljs-nusmods.time                  :as time-helper]))

 (defn ^{:doc "Wrapper for $.getScript"
         :private true}
@@ -117,12 +118,27 @@
                                   "subtopicOf" facultyString))))
     itemsArray))

+(defn- add-lesson-time-to-exhibit-items
+  "Adds `LessonTime` information to a JavaScript Array used as the `items`
+   value for an Exhibit 3 database, and returns the Array.
+   This enables the filter by `Lecture Timings` and filter by `Tutorial Timings`
+   HierarchicalFacets on the Module Finder page."
+  [itemsArray]
+  (let [timeOfDayVec ["Morning" "Afternoon" "Evening"]]
+    (doseq [day time-helper/DAY_INTEGER_TO_STRING]
+      (doseq [timeOfDay timeOfDayVec]
+        (.push itemsArray (js-obj "type"       "LessonTime"
+                                  "label"      (str day " " timeOfDay)
+                                  "subtopicOf" day))))
+    itemsArray))
+
 (defn- add-aux-info-to-exhibit-items
   "Add `ModuleType` and `ModuleDepartment` information to a JavaScript Array
    used as the `items` value for an Exhibit 3 database, and returns the Array."
   [AUXMODULES itemsArray]
   (add-module-types-to-exhibit-items itemsArray)
   (add-module-departments-to-exhibit-items AUXMODULES itemsArray)
+  (add-lesson-time-to-exhibit-items itemsArray)
   itemsArray)

 ; Main entry point of the program


Only check Exhibit3 initialization on `Module Finder` page

just a micro-optimization. It'll take time to tell whether this is buggy
on a production server.

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

--- src/cljs/cljs_nusmods/main.cljs
+++ src/cljs/cljs_nusmods/main.cljs
@@ -223,9 +223,19 @@
        :private true}
   MODULE-FINDER-SCRIPTS-DLED? false)

+(def ^{:doc     "Return value of js/setInterval on `check-initialize-exhibit3`"
+       :private true}
+  INITIALIZE-EXHIBIT3-INTERVAL-VAL nil)
+
 (defn- timetable-builder-tab-click-handler
   "Click event handler for the `Timetable Builder` tab"
   []
+  ; Clear the interval when user switches to `Timetable Builder` page
+  (if (and (not (aget js/window "Exhibit3_Initialized"))
+           (not (nil? INITIALIZE-EXHIBIT3-INTERVAL-VAL)))
+      (do
+        (js/clearInterval INITIALIZE-EXHIBIT3-INTERVAL-VAL)
+        (set! INITIALIZE-EXHIBIT3-INTERVAL-VAL nil)))
   (hide ($ :#module-finder))
   (.removeClass (parent ($ :#module-finder-tab-link)) "active")
   (.addClass (parent ($ :#timetable-builder-tab-link)) "active")
@@ -364,10 +374,6 @@
                             "examDateIdx" examDateIdx}]))
            modulesArray))))

-(def ^{:doc     "Return value of js/setInterval on `check-initialize-exhibit3`"
-       :private true}
-  INITIALIZE-EXHIBIT3-INTERVAL-VAL nil)
-
 (defn- check-and-initialize-exhibit3
   "Used by `js/setInterval` to repeatedly check for initialization of
    the module finder page"
@@ -425,9 +431,11 @@
                                   ($deferred (fn [deferred]
                                                ($ (resolve deferred nil)))))
                           (fn []
-                            (set! MODULE-FINDER-SCRIPTS-DLED? true)
-                            (set! INITIALIZE-EXHIBIT3-INTERVAL-VAL
-                                  (js/setInterval check-and-initialize-exhibit3 1000))))))
+                            (set! MODULE-FINDER-SCRIPTS-DLED? true)))))
+              (if (and (not (aget js/window "Exhibit3_Initialized"))
+                       (nil? INITIALIZE-EXHIBIT3-INTERVAL-VAL))
+                (set! INITIALIZE-EXHIBIT3-INTERVAL-VAL
+                      (js/setInterval check-and-initialize-exhibit3 1000)))
               (hide ($ :#timetable-builder))
               (show ($ :#module-finder))
               (.removeClass (parent ($ :#timetable-builder-tab-link)) "active")


Don't need replumb-init anymore

Don't need replumb-init anymore

--- src/cljs/cljs_webrepl/repl.cljs
+++ src/cljs/cljs_webrepl/repl.cljs
@@ -19,9 +19,6 @@
           :verbose            false}))

 (def current-ns replumb-repl/current-ns)
-
-(defn replumb-init [repl-opts]
-  (replumb/read-eval-call repl-opts identity "true"))

 (defn replumb-async [expression repl-opts out num]
   (let [print-fn  #(put! out [:print num %])


Add a manga-site component fn

Add a manga-site component fn

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -30,11 +30,21 @@
    "There's nothing to see here."
    [:a {:href "/#"}]])

+(defn manga-site [site]
+  ^{:key (:id site)}
+  [:li
+   [:input {:type "button"
+            :value (:name site)
+            :on-click #(.log js/console
+                             (str "You clicked the "
+                                  (:id site)
+                                  " button!"))}]])
+
 (defn site-list []
   (let [site-list (rf/subscribe [:site-list])]
     (fn []
       (when-let [site-list @site-list]
-        [:ul (vec (map #([:li %]) site-list))]))))
+        [:ul (map manga-site site-list)]))))

 (defn comic-reader []
   (let [page (rf/subscribe [:page])]


Fix go-loop infinite loop

Fix go-loop infinite loop

--- src/cljs/hacker_agent/core.cljs
+++ src/cljs/hacker_agent/core.cljs
@@ -44,13 +44,14 @@
 (defn- fb->atom [fbref]
   (let [c (fb->chan fbref)
         data (atom {})]
-    (go-loop [msg (<! c)]
-      (let [[event key val] msg]
-        (case event
-          :child_added (swap! data assoc key val)
-          :child_changed (swap! data assoc key val)
-          :child_removed (swap! data dissoc key)))
-      (recur (<! c)))
+    (go-loop []
+      (when-let [msg (<! c)]
+        (let [[event key val] msg]
+          (case event
+            :child_added (swap! data assoc key val)
+            :child_changed (swap! data assoc key val)
+            :child_removed (swap! data dissoc key)))
+        (recur)))
     data))

 (defn listen


Add missing method to clj-chess.core/piece-on.

--- src/clojure/clj_chess/core.cljc
+++ src/clojure/clj_chess/core.cljc
@@ -128,6 +128,10 @@
   (piece-to-keyword (b/piece-on board (square-from-string square))))

 (defmethod piece-on Long
+  [board square]
+  (piece-to-keyword (b/piece-on board square)))
+
+(defmethod piece-on Integer
   [board square]
   (piece-to-keyword (b/piece-on board square)))


More compact footer

More compact footer

--- src/clojure/staircase/views.clj
+++ src/clojure/staircase/views.clj
@@ -109,12 +109,13 @@
    [:div.panel.panel-info
     [:div.panel-heading "Cookies"]
     [:div.panel-body
+     [:button.btn.pull-right {:ng-click "showCookieMessage = false"} "Do not show again"]
      [:p
       "This site uses cookies to provide essential functionality, such as remembering your
       identity. You can find out details of what information we store here "
       (link-to "/cookies" "here")
       "."]
-     [:button.btn {:ng-click "showCookieMessage = false"} "Do not show again"]]]])
+     ]]])

 (defn common
   ([title body] (common title body []))


Rename path.

Rename path.

--- src/gorilla_repl/core.clj
+++ src/gorilla_repl/core.clj
@@ -91,7 +91,7 @@
            (GET "/config" [] (wrap-api-handler config))
            (GET "/repl" [] ws-relay/ring-handler)
            (route/resources "/")
-           (route/files "/project" [:root "."]))
+           (route/files "/project-files" [:root "."]))

 (defn run-gorilla-server


Force UTF-8 encoding on load.

Force UTF-8 encoding on load.

Hopefully will fix the problem with files not loading on Windows.

--- src/gorilla_repl/core.clj
+++ src/gorilla_repl/core.clj
@@ -48,7 +48,7 @@
   ;; TODO: S'pose some error handling here wouldn't be such a bad thing
   (when-let [ws-file (:worksheet-filename (:params req))]
     (let [_ (print (str "Loading: " ws-file " ... "))
-          ws-data (slurp (str ws-file))
+          ws-data (slurp (str ws-file) :encoding "UTF-8")
           _ (println "done.")]
       (res/response {:worksheet-data ws-data}))))


Faster stringification on response parsing.

--- src/carmine/protocol.clj
+++ src/carmine/protocol.clj
@@ -117,7 +117,7 @@
                      (let [data (byte-array data-length)]
                        (.read in data 0 data-length)
                        (.skip in 2) ; Final crlf
-                       (String. data charset))))
+                       (String. data 0 data-length charset))))
               \* (let [length (Integer/parseInt (.readLine in))]
                    (doall (repeatedly length get-reply!)))
               (throw (Exception. (str "Server returned unknown reply type: "


Compile cljs in memory.

Compile cljs in memory.

--- src/clj/quil_site/controllers/sketches.clj
+++ src/clj/quil_site/controllers/sketches.clj
@@ -5,7 +5,6 @@
             [ring.util.response :as resp]
             [cljs.closure :as cljs]
             [cljs.env :as cljs-env]
-            [me.raynes.fs :as fs]
             [quil-site.views.sketches :as views]
             [quil-site.examples :refer [get-example-source]]
             [clojure.tools.reader :as reader]
@@ -23,12 +22,12 @@
   {:color 0
    :angle 0})

-(defn update [state]
+(defn update-state [state]
   (let [{:keys [color angle]} state]
     {:color (mod (+ color 0.7) 255)
      :angle (mod (+ angle 0.1) q/TWO-PI)}))

-(defn draw [state]
+(defn draw-state [state]
   (q/background 240)
   (q/fill (:color state) 255 255)
   (let [angle (:angle state)
@@ -42,25 +41,30 @@
   :host \"my\"
   :size [500 500]
   :setup setup
-  :update update
-  :draw draw
+  :update update-state
+  :draw draw-state
   :middleware [m/fun-mode])")

-(defn extract-size [sketch-source]
-  (letfn [(read-all [text]
-            (try
-              (let [reader (string-push-back-reader text)
-                    endof (gensym)]
-                (binding [reader/*read-eval* false
-                          reader/*data-readers* tags/*cljs-data-readers*]
-                  (->> #(reader/read reader false endof)
-                       (repeatedly)
-                       (take-while #(not= % endof))
-                       (doall))))
-              (catch Exception e
-                (println e)
-                '())))
-          (defsketch? [form]
+(defn parse-cljs
+  "Parses cljs source code using clojure.tools.reader and return vector
+  of parsed expressions."
+  [cljs-source]
+  (try
+    (let [reader (string-push-back-reader cljs-source)
+          endof (gensym)]
+      (binding [reader/*read-eval* false
+                reader/*data-readers* tags/*cljs-data-readers*]
+        (->> #(reader/read reader false endof)
+             (repeatedly)
+             (take-while #(not= % endof))
+             (doall)
+             vec)))
+    (catch Exception e
+      (println e)
+      [])))
+
+(defn extract-size [sketch]
+  (letfn [(defsketch? [form]
             (and (list? form)
                  (symbol? (first form))
                  (= "defsketch" (name (first form)))))
@@ -73,37 +77,16 @@
                  (filter #(= :size (first %)))
                  (map second)
                  first))]
-    (let [size (-> sketch-source read-all find-defsketch get-size)]
+    (let [size (-> sketch find-defsketch get-size)]
       (if (and (or (list? size) (vector? size))
                (every? number? size))
         (vec (take 2 size))
         nil))))

-(def cljs-compilation-dir (fs/temp-dir "cljs-compilation"))
-
-(defn compile-cljs-2 [cljs-text]
-  (let [source (fs/temp-file "cljs-source" "cljs")]
-   (spit source cljs-text)
-   (let [compiled (cljs-env/with-compiler-env (cljs-env/default-compiler-env)
-                    (cljs/-compile source {}))]
-     (fs/delete source)
-     compiled)))
-
-(defn compile-cljs [cljs-text]
-  (let [source (fs/temp-file "cljs-source" "cljs")
-        compiled (fs/temp-file "cljs-compiled")]
-    (spit source cljs-text)
-    (cljs/build source
-                {:optimizations :simple
-                 :output-to (.getAbsolutePath compiled)
-                 :output-dir (.getAbsolutePath cljs-compilation-dir)
-                 :externs ["externs/processing.js"]
-                 :preamble ["processing.min.js"]
-                 :pretty-print true})
-    (let [compiled-text (slurp compiled)]
-      (fs/delete source)
-      (fs/delete compiled)
-      compiled-text)))
+(defn compile-cljs [cljs-forms]
+  (binding [cljs.analyzer/*cljs-file* "something.cljs"]
+    (cljs-env/with-compiler-env (cljs-env/default-compiler-env)
+      (cljs/-compile cljs-forms {}))))

 (def id (atom 0))
 (def sketches (atom (cache/lru-cache-factory {} :threshold 128)))
@@ -143,8 +126,9 @@
 (defn create-sketch [sketch]
   (try
     (let [source (:cljs sketch)
-          js (compile-cljs-2 source)
-          size (extract-size source)
+          parsed (parse-cljs source)
+          js (compile-cljs parsed)
+          size (extract-size parsed)
           id (str (swap! id inc))
           sketch (assoc sketch
                    :id id


position and visibility of text

position and visibility of text

--- src/cljs/infinitelives/pixi/pixelfont.cljs
+++ src/cljs/infinitelives/pixi/pixelfont.cljs
@@ -40,7 +40,8 @@
 (defn get-font [font-key]
   (font-key @pixel-fonts))

-(defn make-text [font-key text & {:keys [tint scale anchor rotation]}]
+(defn make-text [font-key text & {:keys [tint scale anchor rotation
+                                         x y visible]}]
   (let [font (get-font font-key)
         batch
         (if tint
@@ -72,9 +73,15 @@
     (when scale
       (s/set-scale! batch scale))
     (when rotation
-      (s/set-rotation! batch scale))
+      (s/set-rotation! batch rotation))
     (when anchor
       (s/set-anchor! batch (anchor 0) (anchor 1)))
+    (when x
+      (s/set-x! batch x))
+    (when y
+      (s/set-y! batch y))
+    (when-not (nil? visible)
+      (s/set-visible! batch visible))
     batch))

 (comment


visibile and invisible date tasks are set

--- src/clojure/com/example/gt/metime/main.clj
+++ src/clojure/com/example/gt/metime/main.clj
@@ -1,7 +1,7 @@
 (ns com.example.gt.metime.main
   (:require [neko.activity :refer [defactivity set-content-view!]]
             [neko.debug :refer [*a]]
-            [neko.ui :refer [config]]
+            [neko.ui :refer [config make-ui]]
             [neko.log :as log]
             [neko.ui.adapters :as adapters]
             [clojure.string :refer [join]]
@@ -11,6 +11,9 @@
            android.graphics.Color
            java.util.Calendar
            android.app.Activity
+           android.view.View
+           android.widget.LinearLayout
+
            [android.app DatePickerDialog DatePickerDialog$OnDateSetListener]
            [android.app TimePickerDialog TimePickerDialog$OnTimeSetListener]
            android.app.DialogFragment))
@@ -19,21 +22,41 @@
 (declare date-picker)
 (declare time-picker)

+(defrecord Task [date name duration date-index])
+
 (defn show-picker [activity picker picker-type]
   (. picker show (. activity getFragmentManager) picker-type))

 (def listing (atom (sorted-map)))

-(defn make-adapter []
+
+
+(defn sorted-map-array-to-array-task [lst]
+  (mapcat identity (map (fn [sorted-map-data]
+                          (into [] (map-indexed (fn [i ele]  (apply ->Task (concat [(first sorted-map-data)] ele [i]))) (second sorted-map-data)))
+                          ) lst)))
+
+
+(defn make-date-adapter [activity]
   (adapters/ref-adapter
     (fn [_]
-      [:linear-layout {:id-holder true}
-       [:text-view {:id         ::caption-tv}]])
-    (fn [_ view _ date-event]
-      (let [tv (find-view view ::caption-tv)]
-        (config tv :text (str (nth date-event 0) " " (nth date-event 1) "\n"))))
+      [:linear-layout {:id-holder true
+                       :orientation :vertical}
+       [:text-view {:id ::date-tv}]
+       [:text-view {:id ::event-tv}]
+       ])
+    (fn [_ view _ task]
+      (let [date-view (find-view view ::date-tv)
+            event-view (find-view view ::event-tv)]
+        ;symptom of mutability
+        (config date-view :visibility (if (= (:date-index task) 0) View/VISIBLE View/GONE))
+        (config date-view :text (str (:date task)))
+
+        (config event-view :text (str (:name task) " " (:duration task) " " (:date-index task) ))
+
+        ))
     listing
-    (fn [lst] (into [] (seq lst)))))
+    sorted-map-array-to-array-task))

 (defn main-layout [activity]
   [:linear-layout {:orientation :vertical}
@@ -60,14 +83,9 @@
       :text "+ Event",
       :on-click (fn [_] (add-event activity))}]
     [:list-view {
-      :id ::listings
+      :id ::days
       :draw-selector-on-top true
-      :adapter (make-adapter)
-      ;:on-item-click (fn [_] (show-picker activity
-      ;  (date-picker activity) "timerActivity"))
-
-                 }]
-   ])
+      :adapter (make-date-adapter activity)}]])

 (defn get-elmt [activity elmt]
   (str (.getText ^TextView (find-view activity elmt))))
@@ -76,8 +94,10 @@
   (on-ui (config (find-view activity elmt) :text s)))

 (defn update-ui [activity]
-  (set-elmt-text activity ::name "")
-  )
+  (set-elmt-text activity ::name ""))
+
+(defn add-to-listing [event-name date-key time-key]
+  (swap! listing update-in [date-key] (fnil conj []) [event-name time-key]))

 (defn add-event [activity]
   (let [
@@ -88,8 +108,7 @@
         (read-string (get-elmt activity ::time))
         (catch RuntimeException e "Time string is empty!"))]
     (when (number? date-key)
-      (swap! listing update-in [date-key] (fnil conj [])
-        [(get-elmt activity ::name) time-key])
+      (add-to-listing (get-elmt activity ::name) date-key time-key)
       (update-ui activity))))

 (defn date-picker [activity]


source hunter stuff

source hunter stuff

--- src/com/billpiel/mem_tracer/util/other.clj
+++ src/com/billpiel/mem_tracer/util/other.clj
@@ -137,16 +137,43 @@
                                                    %))))
        #'~alias))

-(defn hunt-down-source-str
+(defn source-fn-var
   [fn-var]
-  (let [{:keys [source file line]} (meta fn-var)]
+  (->> fn-var
+       meta ((juxt :ns
+                   (constantly "/")
+                   :name))
+       (apply str)
+       symbol
+       clojure.repl/source-fn))
+
+(defn hunt-down-source
+  [fn-sym]
+  (let [{:keys [source file line]} (-> fn-sym
+                                       resolve
+                                       meta)]
     (or source
-        (with-out-str (clojure.repl/source-fn fn-var))
-        (->> file
-             slurp
-             clojure.string/split-lines
-             (drop (- line 1))
-             clojure.string/join))))
+        (read-string (or
+                      (clojure.repl/source-fn fn-sym)
+                      (->> file
+                           slurp
+                           clojure.string/split-lines
+                           (drop (- line 1))
+                           clojure.string/join)
+                      "nil")))))
+
+(defmacro src-in-meta
+  [& body]
+  `(alter-meta! ~body assoc :source '~body))
+
+(src-in-meta
+ defn fff
+ [x] (-> x
+         inc
+         inc))
+
+(-> fff var meta :source clojure.walk/macroexpand-all)
+(eval '(do (declare x) (let [x 4] (eval '(inc x)))))

 #_ (do
      (defn ff [] 1)
@@ -156,4 +183,33 @@
                       (constantly "/")
                       :name))
           (apply str)
-          symbol))
+          symbol
+          clojure.repl/source-fn)
+
+     (defn f1
+       [a b c]
+       (inc (let [d 4
+                  e 5]
+              (-> a
+                  inc
+                  (+ d)))))
+
+     (f1 1 2 3)
+
+     (clojure.pprint/pprint (clojure.walk/macroexpand-all '(defn f1
+                                                             [a b c]
+                                                             (inc (let [d 4
+                                                                        e 5]
+                                                                    (-> a
+                                                                        inc
+                                                                        (+ d)))))))
+     (def f1
+       (fn* ([a b c]
+             (inc (let* [d 4
+                         e 5]
+                        (+
+                         (inc a)
+                         d))))))
+
+
+     (comment))


whitespace.

whitespace.

--- web/src/immutant/web/async.clj
+++ web/src/immutant/web/async.clj
@@ -232,16 +232,16 @@
   The callbacks common to both channel types are:

   * :on-open - `(fn [ch] ...)` - called when the channel is
-  available for sending. Will only be invoked once.
+    available for sending. Will only be invoked once.
   * :on-error - `(fn [ch throwable] ...)` - Called for any error
-  that occurs in relation to the channel. If the error
-  requires the channel to be closed, :on-close will also be invoked.
-  To handle [[send!]] errors separately, provide it a completion
-  callback.
+    that occurs in relation to the channel. If the error
+    requires the channel to be closed, :on-close will also be invoked.
+    To handle [[send!]] errors separately, provide it a completion
+    callback.
   * :on-close - `(fn [ch {:keys [code reason]}] ...)` -
-  called for *any* close, including a call to [[close]], but will
-  only be invoked once. `ch` will already be closed by the time
-  this is invoked.
+    called for *any* close, including a call to [[close]], but will
+    only be invoked once. `ch` will already be closed by the time
+    this is invoked.

   `code` and `reason` will be the numeric closure code and text reason,
   respectively, if the channel is a WebSocket
@@ -251,7 +251,7 @@
   If the channel is a Websocket, the following callback is also used:

   * :on-message - `(fn [ch message] ...)` - Called for each message
-  from the client. `message` will be a `String` or `byte[]`
+    from the client. `message` will be a `String` or `byte[]`

   When the ring handler is called during a WebSocket upgrade request,
   any headers returned in the response map are ignored, but any changes to


Oops... didn't know it's private.

Oops... didn't know it's private.

--- web/src/sound_effector/web.clj
+++ web/src/sound_effector/web.clj
@@ -43,7 +43,9 @@
         (response (json/write-str {:message "You don't have the permission."}))
         (status 403)
         (content-type "application/json"))
-      (friend/default-unauthorized-handler request))))
+      (->
+        (response "You don't have the permission.")
+        (status 403)))))

 (def application
   (-> site-routes


throw if :nodejs target combined with optimizations :whitespace

--- src/clj/cljs/closure.clj
+++ src/clj/cljs/closure.clj
@@ -1011,6 +1011,10 @@
   (assert (not (and output-wrapper (= :whitespace optimizations)))
           ":output-wrapper cannot be combined with :optimizations :whitespace"))

+(defn check-node-target [{:keys [target optimizations] :as opts}]
+  (assert (not (and (= target :nodejs) (= optimizations :whitespace)))
+    (format ":nodejs target not compatible with :whitespace optimizations")))
+
 (defn foreign-source? [js]
   (and (satisfies? deps/IJavaScript js)
        (deps/-foreign? js)))
@@ -1040,6 +1044,7 @@
          (check-source-map opts)
          (check-source-map-path opts)
          (check-output-wrapper opts)
+         (check-node-target opts)
          (swap! compiler-env
            #(-> %
              (assoc-in [:opts :emit-constants] emit-constants)


Added a few type hints to remove reflection warnings

--- src/main/clojure/clojure/data/xml.clj
+++ src/main/clojure/clojure/data/xml.clj
@@ -16,7 +16,7 @@
                              XMLStreamConstants)
            (java.nio.charset Charset)
            (java.io Reader)))
-
+(set! *warn-on-reflection* true)
 ; Represents a parse event.
 ; type is one of :start-element, :end-element, or :characters
 (defrecord Event [type name attrs str])
@@ -27,7 +27,7 @@
 (defprotocol Emit
   (emit-element [element writer]))

-(defn write-attributes [{:keys (attrs)} writer]
+(defn write-attributes [{:keys (attrs)} ^javax.xml.stream.XMLStreamWriter writer]
   (doseq [[k v] attrs]
     (.writeAttribute writer (str (namespace k)) (name k) (str v))))

@@ -36,7 +36,8 @@
   Emit
   (emit-element [e writer]
     (let [nspace (namespace (:tag e))
-          qname (name (:tag e))]
+          qname (name (:tag e))
+          ^javax.xml.stream.XMLStreamWriter writer writer]
       (.writeStartElement writer ""  qname (or nspace ""))
       (write-attributes e writer)
       (doseq [c (:content e)]
@@ -46,17 +47,17 @@
 (defrecord CData [content]
   Emit
   (emit-element [e writer]
-    (.writeCData writer (:content e))))
+    (.writeCData ^javax.xml.stream.XMLStreamWriter writer (:content e))))

 (defrecord Comment [content]
   Emit
   (emit-element [e writer]
-    (.writeComment writer (:content e))))
+    (.writeComment ^javax.xml.stream.XMLStreamWriter writer (:content e))))

 (extend-protocol Emit
   String
   (emit-element [e writer]
-    (.writeCharacters writer e)))
+    (.writeCharacters ^javax.xml.stream.XMLStreamWriter writer e)))

 (defn element [tag & [attrs & content]]
   (Element. tag (or attrs {}) content))
@@ -177,7 +178,7 @@
     root))

-(defn- attr-prefix [sreader index]
+(defn- attr-prefix [^XMLStreamReader sreader index]
   (let [p (.getAttributePrefix sreader index)]
     (when-not (str/blank? p)
       p)))
@@ -239,21 +240,23 @@
 ;;;; XML Emitting
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

+(defn check-stream-encoding [^java.io.OutputStreamWriter stream xml-encoding]
+  (when (not= (Charset/forName xml-encoding) (Charset/forName (.getEncoding stream)))
+    (throw (Exception. (str "Output encoding of stream (" xml-encoding
+                            ") doesn't match declaration ("
+                            (.getEncoding stream) ")")))))
+
 (defn emit-stream
   "Prints the given Element tree as XML text to *out*. See element-tree.
   Options:
     :indent <num>            Amount to increase indent depth each time
     :encoding <str>          Character encoding to use"
-  [e stream & {:as opts}]
-  (let [writer (-> (javax.xml.stream.XMLOutputFactory/newInstance)
-                 (.createXMLStreamWriter stream))
-        encoding (or (:encoding opts) "UTF-8")]
-
-    (when (and (instance? java.io.OutputStreamWriter stream)
-               (not= (Charset/forName encoding) (Charset/forName (.getEncoding stream))))
-      (throw (Exception. (str "Output encoding of stream (" encoding
-                              ") doesn't match declaration ("
-                              (.getEncoding stream) ")"))))
+  [e ^java.io.Writer stream & {:as opts}]
+  (let [^javax.xml.stream.XMLStreamWriter writer (-> (javax.xml.stream.XMLOutputFactory/newInstance)
+                                                     (.createXMLStreamWriter stream))]
+
+    (when (instance? java.io.OutputStreamWriter stream)
+      (check-stream-encoding stream (or (:encoding opts) "UTF-8")))

     (.writeStartDocument writer (or (:encoding opts) "UTF-8") "1.0")
     (emit-element e writer)


Fix scanner for cljs

Fix scanner for cljs

--- modules/reitit-core/src/reitit/segment.cljc
+++ modules/reitit-core/src/reitit/segment.cljc
@@ -61,7 +61,10 @@

 (defn scanner [compiled-tries]
   "Returns a new compiled trie that does linear scan on the given compiled tries on [[lookup]]."
-  #?(:cljs (fn [path] (some (fn [trie] (lookup trie path)) compiled-tries))
+  #?(:cljs (reify
+             Segment
+             (-lookup [_ ps params]
+               (some (fn [trie] (-lookup trie ps params)) compiled-tries)))
      :clj  (SegmentTrie/scanner compiled-tries)))

 (defn lookup [trie path]


Four tests added into test_text_renderer

--- test/clouseau/test_text_renderer.clj
+++ test/clouseau/test_text_renderer.clj
@@ -63,3 +63,36 @@
     (testing "if the clouseau.text-renderer/render-package-descriptions definition exists."
         (is (callable? 'clouseau.text-renderer/render-package-descriptions))))

+;
+; Tests for function behaviours
+;
+
+(deftest test-render-front-page-package-parameter
+    "Check the function clouseau.text-renderer/render-front-page"
+    (testing "the function clouseau.text-renderer/render-front-page"
+        (is (= (render-front-page nil nil nil nil nil nil nil nil) "[Package]\n\n\n[CCS Description]\n\n\n"))
+        (is (= (render-front-page nil "PACKAGE" nil nil nil nil nil nil) "[Package]\nPACKAGE\n\n[CCS Description]\n\n\n"))
+        (is (= (render-front-page nil "" nil nil nil nil nil nil) "[Package]\n\n\n[CCS Description]\n\n\n"))
+        (is (= (render-front-page nil "*" nil nil nil nil nil nil) "[Package]\n*\n\n[CCS Description]\n\n\n"))))
+
+(deftest test-render-front-page-ccs-description-parameter
+    "Check the function clouseau.text-renderer/render-front-page"
+    (testing "the function clouseau.text-renderer/render-front-page"
+        (is (= (render-front-page nil "PACKAGE" nil nil nil nil nil nil) "[Package]\nPACKAGE\n\n[CCS Description]\n\n\n"))
+        (is (= (render-front-page nil "PACKAGE" nil "" nil nil nil nil) "[Package]\nPACKAGE\n\n[CCS Description]\n\n\n"))
+        (is (= (render-front-page nil "PACKAGE" nil "***" nil nil nil nil) "[Package]\nPACKAGE\n\n[CCS Description]\n***\n\n"))))
+
+(deftest test-render-front-page-package-descriptions-parameter
+    "Check the function clouseau.text-renderer/render-front-page"
+    (testing "the function clouseau.text-renderer/render-front-page"
+        (is (= (render-front-page nil "PACKAGE" nil "***" nil nil nil nil) "[Package]\nPACKAGE\n\n[CCS Description]\n***\n\n"))
+        (is (= (render-front-page nil "PACKAGE" {"x" "y"} "***" nil nil nil nil) "[Package]\nPACKAGE\n\n[CCS Description]\n***\n\n[x]\ny\n\n"))
+        (is (= (render-front-page nil "PACKAGE" {"prod1" "text1" "prod2" "text2"} "***" nil nil nil nil) "[Package]\nPACKAGE\n\n[CCS Description]\n***\n\n[prod1]\ntext1\n\n[prod2]\ntext2\n\n"))))
+
+(deftest test-render-package-descriptions
+    "Check the function clouseau.text-renderer/render-package-descriptions"
+    (testing "the function clouseau.text-renderer/render-package-descriptions"
+        (is (= (render-package-descriptions {"x" "y"}) '("[x]\ny\n\n")))
+        (is (= (render-package-descriptions {"x" nil}) '("[x]\n\n\n")))
+        (is (= (render-package-descriptions {}) '()))
+        ))


Replace assert with explicit throws

Replace assert with explicit throws

--- src/main/cljc/mikron/buffer_macro.cljc
+++ src/main/cljc/mikron/buffer_macro.cljc
@@ -25,13 +25,15 @@
   (defn without-tag
     "Removes the `tag` metadata from `value`."
     [value]
-    (assert (util/can-have-meta? value))
+    (when-not (util/can-have-meta? value)
+      (throw (ex-info "Cannot apply metadata to value" {:value value})))
     (vary-meta value dissoc :tag))

   (defn without-primitive-tag
     "Removes the primitive `tag` metadata from `value`."
     [value]
-    (assert (util/can-have-meta? value))
+    (when-not (util/can-have-meta? value)
+      (throw (ex-info "Cannot apply metadata to value" {:value value})))
     (vary-meta value (fn [{:keys [tag] :as meta}]
                        (cond-> meta
                          (#{'long 'double} tag) (dissoc :tag)))))


Removed duplicate filtering due to overhead and there aren't many in the dataset

--- taxi-rides-clj/src/taxi_rides_clj/core.clj
+++ taxi-rides-clj/src/taxi_rides_clj/core.clj
@@ -261,24 +261,24 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defn extract-to-csv [file]
-  (with-open [in (-> file io/file clojure.java.io/input-stream java.util.zip.GZIPInputStream.)]
-    (with-open [out (-> file (string/replace #"/data/" "/data_out/") io/file clojure.java.io/output-stream java.util.zip.GZIPOutputStream. io/writer)]
-      (let [_            (my-println-f "started")
-            cols         (-> fields keys set (disj :pickup-pos :dropoff-pos) sort)
-            docs         (parse-trips file in)
-            dt-format   #(let [[y1 y2 m d h i s] (->> % (remove #{\T \Z}) (partition 2) (map (partial apply str)))] (str y1 y2 \- m \- d \space h \: i \: s))
-            get-cols    #(map (fn [col] (or (col %) "NULL")) cols)
-            n-docs       (atom 0)
-            _            (csv/write-csv out
-                           (concat
-                             [(for [col cols] (-> col str (subs 1)))]
-                             (for [doc docs]
-                               (do (swap! n-docs inc)
-                                   (-> doc
-                                       (update :pickup-dt  dt-format)
-                                       (update :dropoff-dt dt-format)
-                                       get-cols)))))]
-        (my-println-f (str "finished, " @n-docs " rows"))))))
+  (with-open [in  (-> file io/file clojure.java.io/input-stream java.util.zip.GZIPInputStream.)
+              out (-> file (string/replace #"/data/" "/data_out/") io/file clojure.java.io/output-stream java.util.zip.GZIPOutputStream. io/writer)]
+    (let [_            (my-println-f "started")
+          cols         (-> fields keys set (disj :pickup-pos :dropoff-pos) sort)
+          docs         (parse-trips file in)
+          dt-format   #(let [[y1 y2 m d h i s] (->> % (remove #{\T \Z}) (partition 2) (map (partial apply str)))] (str y1 y2 \- m \- d \space h \: i \: s))
+          get-cols    #(map (fn [col] (or (col %) "NULL")) cols)
+          n-docs       (atom 0)
+          _            (csv/write-csv out
+                         (concat
+                           [(for [col cols] (-> col str (subs 1)))]
+                           (for [doc docs]
+                             (do (swap! n-docs inc)
+                                 (-> doc
+                                     (update :pickup-dt  dt-format)
+                                     (update :dropoff-dt dt-format)
+                                     get-cols)))))]
+      (my-println-f (str "finished, " @n-docs " rows")))))

 ;(extract-to-csv (str data-folder "green_tripdata_2013-08.csv.gz"))
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -298,11 +298,11 @@
                      ;:_source {:enabled false}
                       :properties (->> (map vector (keys fields) (map es-types (vals fields)))
                                        (into {}))}}
-   :settings {"index.translog.flush_threshold_size" "1g"
+   :settings {"index.translog.flush_threshold_size" "20g"
               "index.store.throttle.max_bytes_per_sec" "1000mb"
-              :number_of_shards 1
+              :number_of_shards 10
               :number_of_replicas 0
-              :refresh_interval "10s"}})
+              :refresh_interval "30s"}})
 ;(pprint taxi-mapping)

 (def es-config
@@ -334,16 +334,13 @@
                                   (do
                                     (my-println-f "Exception " (.getMessage e) ", retrying after " retry-t  " ms...")
                                     (Thread/sleep retry-t))))))
-          process-chunk (fn [i chunk-in]
-                          (let [result (doall (for [sub-chunk (->> chunk-in (my-distinct get-doc-id) (partition-all 500))]
-                                                (let [chunk-body (->> chunk-in (map doc->bulk) flatten s/chunks->body)]
-                                                ; Call insert-chunk until it returns non-nil. I was going to recur
-                                                ; but it could not be done from "catch" position so this is what I came up with
-                                                  (->> #(insert-chunk chunk-body) repeatedly (filter some?) first))))
-                                _ (my-println-f "  finished chunk " i ", so far " @collision-counter " duplicates")]
-                            result))
+          process-chunk (fn [chunk-in]
+                          (let [chunk-body (->> chunk-in (map doc->bulk) flatten s/chunks->body)]
+                          ; Call insert-chunk until it returns non-nil. I was going to recur
+                          ; but it could not be done from "catch" position so this is what I came up with
+                            (->> #(insert-chunk chunk-body) repeatedly (filter some?) first)))
           _       (my-println-f "started")
-          freqs   (->> (parse-trips file in) (partition-all 10000) (map process-chunk (range)) flatten frequencies)
+          freqs   (->> (parse-trips file in) (partition-all 1000) (map process-chunk) flatten frequencies)
           _       (my-println-f "got " freqs)]
         freqs)))

@@ -351,13 +348,13 @@
   {"insert"  insert-file
    "extract" extract-to-csv})

-; time ls ../data/*.gz | grep -E '(yellow|green)' | shuf | xargs java -Xms16g -Xmx30g -jar target/taxi-rides-clj-0.0.1-SNAPSHOT-standalone.jar insert  6
+; time ls ../data/*.gz | grep -E '(yellow|green)' | shuf | xargs java -Xms16g -Xmx30g -jar target/taxi-rides-clj-0.0.1-SNAPSHOT-standalone.jar insert  4
 ; time ls ../data/*.gz | grep -E '(yellow|green)' | shuf | xargs java -Xms16g -Xmx30g -jar target/taxi-rides-clj-0.0.1-SNAPSHOT-standalone.jar extract 8
 (defn -main [f-name n-parallel & files]
   (do
     (my-println "Started!")
     (create-taxicab-template)
     (doall (cp/upfor (Integer. ^String n-parallel) [file files] (->> (string/replace file #".+/" "") (str data-folder) ((main-funs f-name)))))
-    (my-println "Done, filtered " @collision-counter " duplicate documents")
+  ; (my-println "Done, filtered " @collision-counter " duplicate documents")
     (shutdown-agents)
     (System/exit 0)))


model.connection: should not make new connection from map missing arrival place id

--- test/busa_server/model/connection_test.clj
+++ test/busa_server/model/connection_test.clj
@@ -13,3 +13,6 @@

 (fact "should not make new connection from map missing duration"
   (connection/new-connection (dissoc valid-connection-map :duration)) => (throws Exception))
+
+(fact "should not make new connection from map missing arrival place id"
+  (connection/new-connection (dissoc valid-connection-map :arrival-place-id)) => (throws Exception))


refactor(model.connection-test): rename couple of testes for clarity

--- test/busa_server/model/connection_test.clj
+++ test/busa_server/model/connection_test.clj
@@ -32,9 +32,9 @@
   (fact "should save new connection"
     (c/save [connection]) => (contains {:inserted 1}))

-  (fact "should not save invalid connection"
+  (fact "should not save invalid connection missing field"
     (c/save [invalid-connection]) => (throws Exception))

-  (fact "should throw exception when save to db fails"
+  (fact "should not save invalid connection with too long id"
     (c/save [connection-with-too-long-id]) => (throws Exception))
 )


Add default ptexts

Add default ptexts

--- test/caesium/magicnonce/secretbox_test.clj
+++ test/caesium/magicnonce/secretbox_test.clj
@@ -94,21 +94,22 @@
   This compares the XORd ciphertexts to the XORd plaintexts. This will
   only be the same when the keystream repeats, and should not happen
   in an NMR scheme, or in a randomized scheme."
-  [ptexts scheme]
-  (let [just-ctext (fn [^bytes ptext]
-                     (->> (scheme ptext)
-                          (drop s/noncebytes)
-                          (take (alength ptext))))
-        ctexts (map just-ctext ptexts)
-        shortest (apply min alength ptexts)
-        xord-ptexts (byte-array shortest)
-        xord-ctexts (byte-array shortest)]
-    (apply #'ms/xor! xord-ptexts ptexts)
-    (apply #'ms/xor! xord-ctexts ctexts)
-    (u/array-eq xord-ptexts xord-ctexts)))
-
-(def example-ptexts
-  [(.getBytes "four score and ") (.getBytes "seven years ago")])
+  ([scheme]
+   (let [ptexts [(.getBytes "four score and ")
+                 (.getBytes "seven years ago")]]
+     (repeated-keystream? ptexts schems)))
+  ([ptexts scheme]
+   (let [just-ctext (fn [^bytes ptext]
+                      (->> (scheme ptext)
+                           (drop s/noncebytes)
+                           (take (alength ptext))))
+         ctexts (map just-ctext ptexts)
+         shortest (apply min alength ptexts)
+         xord-ptexts (byte-array shortest)
+         xord-ctexts (byte-array shortest)]
+     (apply #'ms/xor! xord-ptexts ptexts)
+     (apply #'ms/xor! xord-ctexts ctexts)
+     (u/array-eq xord-ptexts xord-ctexts))))

 (deftest secretbox-nmr-with-implicit-rnd-nonce-test
   (let [ctext (ms/secretbox-nmr st/ptext st/secret-key)]
@@ -127,7 +128,7 @@
         (is (not= n3 n1))))

     (let [scheme (fn [ptext] (ms/secretbox-nmr ptext st/secret-key))]
-      (is (not (repeated-keystream? example-ptexts)))))
+      (is (not (repeated-keystream? scheme)))))

   (let [scheme (fn [ptext] (ms/secretbox-nmr ptext st/secret-key))]
     (is (not (repeated-keystream? example-ptexts)))))


Add tests for secretbox-det

Add tests for secretbox-det

--- test/caesium/magicnonce/secretbox_test.clj
+++ test/caesium/magicnonce/secretbox_test.clj
@@ -131,6 +131,17 @@
     (is (not (u/array-eq (sn m1 k1) (sn m2 k1))))
     (is (not (u/array-eq (sn m1 k1) (sn m1 k2))))))

+(deftest secretbox-det-test
+  (let [ctext (ms/secretbox-det st/ptext st/secret-key)]
+    (is-valid-magicnonce-ctext? ctext))
+
+  (let [scheme (fn [ptext] (ms/secretbox-det ptext st/secret-key))]
+    (is (not (repeated-keystream? scheme))))
+
+  (let [c1 (ms/secretbox-det st/ptext st/secret-key)
+        c2 (ms/secretbox-det st/ptext st/secret-key)]
+    (is (u/array-eq c1 c2))))
+
 (deftest secretbox-nmr-with-implicit-rnd-nonce-test
   (let [ctext (ms/secretbox-nmr st/ptext st/secret-key)]
     (is-valid-magicnonce-ctext? ctext))


feat(user plugins): if there is a file named "skip" don't load user plugin

--- ccw.core/src/clj/ccw/core/user_plugins.clj
+++ ccw.core/src/clj/ccw/core/user_plugins.clj
@@ -94,7 +94,9 @@

 (defn user-plugins [d]
   (if (and d (plugin-folder? d))
-    [d]
+    (if-not (f/exists? (io/file d "skip"))
+      [d]
+      [])
     (mapcat user-plugins
             (filter f/directory?
                     (.listFiles (io/file d))))))


Corrects issue #152 - Cannot delete characters/insert new lines....

--- src/paredit/parser.clj
+++ src/paredit/parser.clj
@@ -119,7 +119,7 @@
     (.charAt s index)))

 (defn eof [s eof?]
-  (and (= 0 (.length s)) eof? [0 eof]))
+  (when (and (= 0 (.length s)) eof?) [0 eof]))

 (defn bracket-end [s eof?]
   (lr+/match #{")" "]" "}" eof} s eof?))


use responds helper to consolidate some test code

--- test/block_chain/message_handlers_test.clj
+++ test/block_chain/message_handlers_test.clj
@@ -33,17 +33,16 @@

 (deftest test-getting-adding-and-removing-peers
   (with-redefs [db/peers (atom #{})]
-    (is (= #{} (:payload (handler {:message-type "get_peers"} {}))))
+    (responds #{} {:message-type "get_peers"})
     (handler {:message-type "add_peer"
               :payload {:port 8335}}
              sock-info)
-    (is (= #{{:host "127.0.0.1" :port 8335}}
-           (:payload (handler {:message-type "get_peers"} {}))))
+    (responds #{{:host "127.0.0.1" :port 8335}}
+              {:message-type "get_peers"})
     (handler {:message-type "remove_peer"
               :payload {:port 8335}}
              sock-info)
-    (is (= #{}
-           (:payload (handler {:message-type "get_peers"} {}))))))
+    (responds #{} {:message-type "get_peers"})))

 (deftest test-getting-balance-for-key
   (let [chain (atom [])
@@ -52,34 +51,18 @@
         block (blocks/generate-block
                [(miner/coinbase (:public-pem key-a))]
                {:target easy-diff})]
-    (miner/mine-and-commit chain
-                           block)
+    (miner/mine-and-commit chain block)
     (with-redefs [db/block-chain chain]
-      (-> {:message-type "get_balance" :payload (:public-pem key-a)}
-          (handler {})
-          :payload
-          :balance
-          (= 25)
-          is))))
+      (responds {:balance 25 :key (:public-pem key-a)} {:message-type "get_balance" :payload (:public-pem key-a)})
+      )))

 (deftest test-transaction-pool
   (with-redefs [db/transaction-pool (atom #{})]
-    (-> {:message-type "get_transaction_pool"}
-      (handler {})
-      :payload
-      (= [])
-      is)
     (let [key (wallet/generate-keypair 512)
-        cb (miner/coinbase (:public-pem key))]
-
-    (handler {:message-type "add_transaction" :payload cb} {})
-
-    (-> {:message-type "get_transaction_pool"}
-        (handler {})
-        :payload
-        (= [cb])
-        is))))
-
+          cb (miner/coinbase (:public-pem key))]
+      (responds [] {:message-type "get_transaction_pool"})
+      (handler {:message-type "add_transaction" :payload cb} {})
+      (responds [cb] {:message-type "get_transaction_pool" :payload cb}))))

 (deftest test-getting-block-height
   (with-redefs [db/block-chain (atom [])]


Move stops-panel to its own component

Move stops-panel to its own component

--- src/cljs/gtfve/components/side_panel.cljs
+++ src/cljs/gtfve/components/side_panel.cljs
@@ -22,6 +22,33 @@
          (when (= tab key)
            "active in")]))

+(defn stop-panel [panel owner]
+  (reify
+    om/IDisplayName (display-name [_] "Side Panel")
+    om/IRender
+    (render [_]
+      (let [tab (:tab panel)
+            query (:stops-query panel)]
+        (html
+         [:div {:className (tab-class tab :stops)}
+          [:form.form-horizontal
+           [:fieldset
+            [:div.form-group
+             [:label.col-sm-2.control-label {:for "inputSearch"} "Stop"]
+             [:div.col-sm-10
+              [:input.form-control#inputSearch
+               {:type "text"
+                :placeholder "Search"}]]]]]
+          [:table.table.table-striped.table-hover
+           [:thead
+            [:tr
+             [:th "#"]
+             [:th "Code"]
+             [:th "Name"]
+             [:th "Description"]
+             [:th "Lat/Lng"]]]
+           [:tbody]]])))))
+
 (defn side-panel [panel owner]
   (reify
     om/IDisplayName (display-name [_] "Side Panel")
@@ -42,23 +69,7 @@
                [:div.tab-content
                 ;; stops
                 [:div.tab-wrapper
-                 [:div {:className (tab-class tab :stops)}
-                  [:form.form-horizontal
-                   [:fieldset
-                    [:div.form-group
-                     [:label.col-sm-2.control-label {:for "inputSearch"} "Stop"]
-                     [:div.col-sm-10
-                      [:input.form-control#inputSearch {:type "text"
-                                                        :placeholder "Search"}]]]]]
-                  [:table.table.table-striped.table-hover
-                   [:thead
-                    [:tr
-                     [:th "#"]
-                     [:th "Code"]
-                     [:th "Name"]
-                     [:th "Description"]
-                     [:th "Lat/Lng"]]]
-                   [:tbody]]]
+                 (om/build stop-panel panel)
                  ;; routes
                  [:div {:className (tab-class tab :routes)}
                   [:p "Routes panel"]]


Add wrapping server :result 'error' responses.

--- src/cljs/hatnik/web/client/z_actions.cljs
+++ src/cljs/hatnik/web/client/z_actions.cljs
@@ -77,6 +77,12 @@

       (ajax "/api/actions/test" "POST" data (fn [e])))))

+(defn wrap-error-alert [callback]
+  (fn [reply]
+    (let [resp (js->clj reply)]
+      (when (= "error" (get resp "result")) (js/alert (get resp "message")))
+      (callback reply))))
+

 (defn common-update-callback [msg data reply]
   (let [resp (js->clj reply)]
@@ -103,14 +109,16 @@
         (.modal ($ :#iModal) "hide")
         (ajax
          (str "/api/actions/" action-id) "PUT"
-         data #(common-update-callback "Action don't updated!" data %))))))
+         data (wrap-error-alert
+               #(common-update-callback "Action don't updated!" data %)))))))

 (defn delete-action [action-id]
   (.modal ($ :#iModal) "hide")
   (ajax
    (str "/api/actions/" action-id) "DELETE"
-   {} #(common-update-callback "Action don't deleted!" {} %)))
+   {} (wrap-error-alert
+       #(common-update-callback "Action don't deleted!" {} %))))

@@ -119,7 +127,8 @@
     (.modal ($ :#iModalProjectMenu) "hide")
     (ajax
      (str "/api/projects/" project-id) "DELETE"
-     {} #(common-update-callback "Project don't deleted!" {} %))))
+     {} (wrap-error-alert
+         #(common-update-callback "Project don't deleted!" {} %)))))

 (defn update-project []
   (let [project-id (:current-project (deref state/app-state))
@@ -128,5 +137,5 @@
     (ajax
      (str "/api/projects/" project-id) "PUT"
      {:name new-name}
-     #(common-update-callback "Project don't renamed!" {} %))))
+     (wrap-error-alert #(common-update-callback "Project don't renamed!" {} %)))))


Add IAuthorization protocol implementation for signed token backend.

--- src/clojure/buddy/auth/backends/token.clj
+++ src/clojure/buddy/auth/backends/token.clj
@@ -38,7 +38,17 @@
     (parse [_ request]
       (parse-authorization-header request))
     (authenticate [_ request data]
-      (assoc request :identity (loads data privkey {:max-age max-age})))))
+      (assoc request :identity (loads data privkey {:max-age max-age})))
+
+    proto/IAuthorization
+    (handle-unauthorized [_ request metadata]
+      (if unauthorized-handler
+        (unauthorized-handler request metadata)
+        (if (authenticated? request)
+          (-> (response "Permission denied")
+              (status 403))
+          (-> (response "Unauthorized")
+              (status 401)))))))

 (defn token-backend
   [{:keys [authfn unauthorized-handler]}]


Revert "Merge branch 'master' of https://git.earthdata.nasa.gov/scm/cmr/cmr-indexer-app into CMR-183"

This reverts commit a682d39d9bc0505fa2ac093cfd826964a44dd176, reversing
changes made to bfa6d81f4f3514e313719aa3a7115c3740714545.


Remove unused variable

Remove unused variable

Signed-off-by: Deepak Giridharagopal <d11186354d1ef01ca06ae37d7e23e827da13e85f@puppetlabs.com>

--- src/com/puppetlabs/cmdb/cli/benchmark.clj
+++ src/com/puppetlabs/cmdb/cli/benchmark.clj
@@ -108,8 +108,7 @@
   The time resolution of this loop is 10ms."
   []
   (loop [last-time (System/currentTimeMillis)]
-    (let [curr-time (System/currentTimeMillis)
-          delta (- curr-time last-time)]
+    (let [curr-time (System/currentTimeMillis)]

       ;; Send out updated ticks to each agent
       (doseq [host *hosts*]


rename info message for redeploy / rollback

--- src/cljs/swarmpit/component/service/info.cljs
+++ src/cljs/swarmpit/component/service/info.cljs
@@ -78,7 +78,7 @@
     (routes/path-for-backend :service-redeploy {:id service-id})
     {:on-success (fn [_]
                    (message/info
-                     (str "Service " service-id " redeploy started.")))
+                     (str "Service " service-id " redeploy triggered.")))
      :on-error   (fn [response]
                    (message/error
                      (str "Service redeploy failed. Reason: " (:error response))))}))
@@ -89,7 +89,7 @@
     (routes/path-for-backend :service-rollback {:id service-id})
     {:on-success (fn [_]
                    (message/info
-                     (str "Service " service-id " rollback started.")))
+                     (str "Service " service-id " rollback triggered.")))
      :on-error   (fn [response]
                    (message/error
                      (str "Service rollback failed. Reason: " (:error response))))}))


Remove stray println.

Remove stray println.

--- test/onyx/windowing/window_session_test.clj
+++ test/onyx/windowing/window_session_test.clj
@@ -62,7 +62,6 @@
 (def test-state (atom []))

 (defn update-atom! [event window trigger {:keys [lower-bound upper-bound event-type] :as opts} extent-state]
-  (println "UPDATE" (:group-key opts) event-type upper-bound extent-state)
   (when (= :job-completed event-type)
     (swap! test-state conj [(java.util.Date. (long lower-bound))
                             (java.util.Date. (long upper-bound))


Improve doc in context.file

Improve doc in context.file

--- src/main/clojure/lazytest/context/file.clj
+++ src/main/clojure/lazytest/context/file.clj
@@ -4,6 +4,7 @@
 	[clojure.java.io :only (file)])
   (:import (java.io File)))

+;; You don't create instances of this; use the temp-file function.
 (deftype TempFileContext [name suffix dir ^{:tag File :unsynchronized-mutable true} f]
   Context
   (setup [this] (set! f (File/createTempFile name suffix dir)))
@@ -18,7 +19,7 @@
   If suffix is a file extension, it should include the leading period,
   e.g., \".txt\"

-  If dir is specified (string or File), the temporary file will be
+  If dir is specified (String or File), the temporary file will be
   created in that directory; otherwise it will be in the
   system-default temporary directory."
   ([]
@@ -33,6 +34,7 @@
      (let [dir (if (nil? dir) dir (file dir))]
        (stateful (TempFileContext. prefix suffix dir nil)))))

+;; You don't create instances of this; use the temp-dir function.
 (deftype TempDirContext [name dir ^{:tag File :unsynchronized-mutable true} f]
   Context
   (setup [this]
@@ -44,14 +46,14 @@
 	    (doseq [x (reverse (file-seq f))]
 	      (.delete x))))

-
 (defn temp-dir
   "Returns a stateful context that creates a temporary directory.
-  After setup, an empty directory named with the given prefix and will
-  exist.  The state of the context is the java.io.File.  The directory
-  and all its contents will be recursively deleted during teardown.
+  After setup, an empty directory named with the given
+  prefix (optional) will exist.  The state of the context is the
+  java.io.File.  The directory and all its contents will be
+  recursively deleted during teardown.

-  If dir is specified (string or File), the temporary directory will
+  If dir is specified (String or File), the temporary directory will
   be created in that directory; otherwise it will be in the
   system-default temporary directory."
   ([]


Remove drop-keys function.

Remove drop-keys function.

--- src/postal/message.clj
+++ src/postal/message.clj
@@ -139,10 +139,6 @@
     (doto jmsg (.setText body charset))
     (doto jmsg (add-multipart! body))))

-(defn drop-keys [m ks]
-  (select-keys m
-               (difference (set (keys m)) (set ks))))
-
 (defn make-auth [user pass]
   (proxy [javax.mail.Authenticator] []
     (getPasswordAuthentication [] (PasswordAuthentication. user pass))))


rearrange p tags to get examples to show up in site preview per #56

--- src/pronouns/pages.clj
+++ src/pronouns/pages.clj
@@ -69,38 +69,33 @@
                         sub-obj
                         " pronouns")]
     [:div {:class "section examples"}
-     [:p [:h2 header-str]]
-     (subject-example subject)
-     (object-example object)
-     (posessive-determiner-example subject possessive-determiner)
-     (possessive-pronoun-example possessive-pronoun)
-     (reflexive-example subject reflexive)]))
+     [:h2 header-str]
+     [:p (subject-example subject)
+         (object-example object)
+         (posessive-determiner-example subject possessive-determiner)
+         (possessive-pronoun-example possessive-pronoun)
+         (reflexive-example subject reflexive)]]))

 (defn about-block []
   [:div {:class "section about"}
    [:p "Full usage: "
-    [:tt "http://pronoun.is/subject-pronoun/object-pronoun/possessive-determiner/possessive-pronoun/reflexive"]
-    " displays examples of your pronouns."]
+       [:tt "http://pronoun.is/subject-pronoun/object-pronoun/possessive-determiner/possessive-pronoun/reflexive"]
+       " displays examples of your pronouns."]
    [:p "This is a bit unwieldy. If we have a good guess we'll let you use just the first one or two."]])

 (defn contact-block []
   (let [twitter-name (fn [handle] (href (str "https://www.twitter.com/" handle)
                                        (str "@" handle)))]
-  [:div {:class "section contact"}
-   [:p
-    "Written by "
-    (twitter-name "morganastra")
-    ", whose "
-    (href "http://pronoun.is/ze/zir?or=she" "pronoun.is/ze/zir?or=she")
-    [:br]
-    [:br]
-    "pronoun.is is free software under the "
-    (href "https://www.gnu.org/licenses/agpl.html" "AGPLv3")
-    "! visit the project on "
-    (href "https://github.com/witch-house/pronoun.is" "github")
-    [:br]
-    [:br]
-    "<3"]]))
+    [:footer {:class "section contact"}
+     [:p "Written by "
+         (twitter-name "morganastra")
+         ", whose "
+         (href "http://pronoun.is/ze/zir?or=she" "pronoun.is/ze/zir?or=she")]
+     [:p "pronoun.is is free software under the "
+         (href "https://www.gnu.org/licenses/agpl.html" "AGPLv3")
+         "! visit the project on "
+         (href "https://github.com/witch-house/pronoun.is" "github")]
+     [:p "<3"]]))

 (defn format-pronoun-examples


add a single comma.

add a single comma.

--- src/pronouns/pages.clj
+++ src/pronouns/pages.clj
@@ -60,7 +60,7 @@
     (twitter-name "morganastra")
     ", whose "
     [:a {:href "http://pronoun.is/ze/zir"} "pronoun.is/ze/zir"]
-    " and "
+    ", and "
     (twitter-name "thelseraphim")
     ", whose "
     [:a {:href "http://pronoun.is/she"} "pronoun.is/she"]