Add filter-type to queries

Add filter-type to queries

--- src/day8/re_frame/trace.cljs
+++ src/day8/re_frame/trace.cljs
@@ -116,7 +116,7 @@
   (monkey-patch-reagent)
   )

-(defn search-input [{:keys [title on-save on-stop]}]
+(defn search-input [{:keys [title on-save on-change on-stop]}]
   (let [val  (r/atom title)
         save #(let [v (-> @val str str/trim)]
                 (when (pos? (count v))
@@ -126,7 +126,8 @@
                :value       @val
                :style       {:margin 7}
                :auto-focus  true
-               :on-change   #(reset! val (-> % .-target .-value))
+               :on-change   #(do (reset! val (-> % .-target .-value))
+                                 (on-change %))
                :on-key-down #(case (.-which %)
                                13 (do
                                     (save)
@@ -135,9 +136,10 @@

 (defn render-traces []
   (let [filter-input     (r/atom "")
-        filter-items     (r/atom []) ;; [{:id (random-uuid) :query "showing" :filter-type "contains"} {:id (random-uuid) :query "Reagent" :filter-type "contains"}
+        filter-items     (r/atom [])
         slower-than-ms   (r/atom "")
-        slower-than-bold (r/atom "")]
+        slower-than-bold (r/atom "")
+        filter-type      (r/atom "contains")]
     (fn []
       (let [slower-than-ms-int   (js/parseInt @slower-than-ms)
             slower-than-bold-int (js/parseInt @slower-than-bold)
@@ -150,31 +152,36 @@
             filter-msg           (if (and (str/blank? @filter-input) (str/blank? @slower-than-ms))
                                    (str "Filter " (count @traces) " events: ")
                                    (str "Filtering " (count showing-traces) " of " (count @traces) " events:"))
-            padding              {:padding "0px 5px 0px 5px"}]
+            padding              {:padding "0px 5px 0px 5px"}
+            save-query           (fn [_]
+                                   (swap! filter-items conj {:id (random-uuid)
+                                                             :query (str/lower-case @filter-input)
+                                                             :filter-type @filter-type}))]
         [:div
          {:style {:padding "10px"}}
          [:h1 "TRACES"]
          [:span filter-msg [:button {:on-click #(do (trace/reset-tracing!) (reset! traces []))} " Clear traces"]] [:br]
-         [:span "Filter events " [search-input {:value @filter-input
-                                                :on-save (fn [query]
-                                                           (do
-                                                             (reset! filter-input "")
-                                                             (swap! filter-items conj {:id (random-uuid)
-                                                                                :query (str/lower-case query)
-                                                                                :filter-type "contains"})))}]
-          [:button "+"]
+         [:span "Filter events "
+          [:select {:value @filter-type :on-change (fn [e]
+                                                       (reset! filter-type (.. e -target -value))
+                                                       (println (.. e -target -value)))}
+           [:option "contains"]
+           [:option "slower than"]]
+          [search-input {:on-save save-query
+                         :on-change #(reset! filter-input (.. % -target -value))}]
+          [:button {:on-click save-query} "+"]
           ;; [:button {:style {:background "#aae0ec"
           ;;                   :padding 7
           ;;                   :margin 5}}
           ;;  "-"]]
-          [:br]]
-         [:div.filter-items
-          (for [item @filter-items]
-            ^{:key (:id item)}
-            [:span [:div.filter-item {:style {:paddingLeft 90}} (:query item)
-                    [:button {:on-click (fn [event] (swap! filter-items #(remove (comp (partial = (:query item)) :query) %)))}
-                     "-"]]])]
-
+          [:br]
+          [:div.filter-items
+           (map (fn [item]
+                    ^{:key (:id item)}
+                    [:span [:div.filter-item {:style {:paddingLeft 90}} (:filter-type item) " " (:query item)
+                            [:button {:on-click (fn [event] (swap! filter-items #(remove (comp (partial = (:query item)) :query) %)))}
+                             "-"]]])
+                @filter-items)]]
          [:table
           {:cell-spacing "0" :width "100%"}
           [:thead>tr


refactoring interpreter_core

refactoring interpreter_core

--- src/push/interpreter/interpreter_core.clj
+++ src/push/interpreter/interpreter_core.clj
@@ -19,7 +19,9 @@

 (defn make-interpreter
   "creates a new Interpreter record
-  With no arguments, it has an empty :program, the :stacks include core types and are empty, no :instructions are registered, and the counter is 0.
+  With no arguments, it has an empty :program, the :stacks include
+  core types and are empty, no :instructions are registered, and the
+  counter is 0.

   Any of these can be specified by key."
   [& {:keys [program stacks instructions counter]
@@ -27,18 +29,36 @@
            stacks core-stacks
            instructions {}
            counter 0}}]
-  (->Interpreter program (merge core-stacks stacks) instructions counter))
+  (->Interpreter program (merge core-stacks stacks)
+                   instructions counter))

+
+(defn- throw-redefined-instruction-error
+  [token]
+  (throw (Exception. (str
+                        "Push Instruction Redefined:'"
+                        token
+                        "'"))))
+
+
+(defn- add-instruction
+  [interpreter instruction]
+  (assoc-in
+    interpreter
+    [:instructions (:token instruction)]
+    instruction))

 (defn register-instruction
-  "Takes an Interpreter and an Instruction, and attempts to add the Instruction to the :instructions map of the Interpreter, keyed by its :token."
+  "Takes an Interpreter and an Instruction, and attempts to add the
+  Instruction to the :instructions map of the Interpreter, keyed by
+  its :token."
   [interpreter instruction]
   (let [token (:token instruction)
         registry (:instructions interpreter)]
     (if (contains? registry token)
-      (throw (Exception. (str "Push Instruction Redefined:'" token "'")))
-      (assoc-in interpreter [:instructions (:token instruction)] instruction))))
+      (throw-redefined-instruction-error token))
+      (add-instruction interpreter instruction)))

 (defn contains-at-least?
@@ -170,4 +190,5 @@
             (increment-counter)
             (set-stack :exec new-exec)
             (handle-item next-item)))
-      interpreter)))+      interpreter)))
+


Display better suggestions for next problem to tackle, as mdeboard proposed.

--- src/foreclojure/problems.clj
+++ src/foreclojure/problems.clj
@@ -31,17 +31,37 @@
              :where criteria
              :sort {:_id 1}))))

-(defn next-unsolved-problem [solved-problems]
-  (when-let [unsolved (->> (get-problem-list)
-                           (remove (comp (set solved-problems) :_id))
-                           (seq))]
-    (apply min-key :_id unsolved)))
+(defn next-unsolved-problem [solved-problems just-solved-id]
+  (when-let [unsolved (seq
+                       (from-mongo
+                        (fetch :problems
+                               :only [:_id :title]
+                               :where {:_id {:$nin solved-problems}}
+                               :sort {:_id 1})))]
+    (let [[skipped not-yet-tried] (split-with #(< (:_id %) just-solved-id)
+                                              unsolved)]
+      (filter identity [(rand-nth (or (seq skipped)
+                                      [nil])) ; rand-nth barfs on empty seq
+                        (first not-yet-tried)]))))
+
+(letfn [(problem-link [{id :_id title :title}]
+          (str "" title ""))]
+  (defmulti suggest-problems count)
+
+  (defmethod suggest-problems 0 [_]
+    "You've solved them all! Come back later for more!")
+
+  (defmethod suggest-problems 1 [[problem]]
+    (str "Now try " (problem-link problem) "!"))
+
+  (defmethod suggest-problems 2 [[skipped not-tried]]
+    (str "Now move on to " (problem-link not-tried)
+         ", or go back and try " (problem-link skipped) " again!")))

 (defn next-problem-link [completed-problem-id]
   (when-let [{:keys [solved]} (get-user (session/session-get :user))]
-    (if-let [{:keys [_id title]} (next-unsolved-problem solved)]
-      (str "Now try " title "!")
-      "You've solved them all! Come back later for more!")))
+    (suggest-problems
+     (next-unsolved-problem solved completed-problem-id))))

 (defn get-recent-problems [n]
   (map get-problem (map :_id (take-last n (get-problem-list)))))


Figure out the correct db schema to to on the server

When the server gets a data request from the client it needs to figure
out which database schema to use. It can figure this out from the
client's session ID, the appshare_web_sessions table, and the
appshare_application_schemas table

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -1549,7 +1549,7 @@
   ))

-;zzz
+
 ; ----------------------------------------------------------------
 ; Whenever a record changes an entry is added to the real time log
 ; which is processed here. It first finds which queries it
@@ -1680,8 +1680,19 @@

 (defn get-schema-name-for-session-id [data-session-id]
-  "public")
-
+  (let [
+         app-schema-id     (:appshare_application_schema_id (sql-1 "select   appshare_application_schema_id   from   public.appshare_web_sessions    where   session_id = ?" [data-session-id]))
+
+         schema-name       (cond
+                             app-schema-id
+                             (:database_schema_name (sql-1 "select   database_schema_name   from   public.appshare_application_schemas  where  id = ?"  [app-schema-id]))
+
+                             :else
+                             "public")
+
+         schema-name2      (if (= (count schema-name) 0) "public" schema-name)
+         ]
+    schema-name2))

@@ -1703,8 +1714,14 @@
                                      ]}]

   (let [
-         schema-name  (get-schema-name-for-session-id  data-session-id)
+         schema-name  "public" ;(get-schema-name-for-session-id  data-session-id)
          ]
+  (println "************************************************************************************")
+  (println (str "* SCHEMA: "  (get-schema-name-for-session-id  data-session-id)))
+  (println "************************************************************************************")
+  (println "")
+
+
   ;(println "************************************************************************************")
   ;(println "    **** " db-table " : "  fields)
   ;(println " ")
@@ -1992,7 +2009,6 @@

-;zzz
 ; ----------------------------------------------------------------
 ; Whenever a web client wants to know if the data it is showing
 ; needs to be updated it sends a request to this server side
@@ -2111,7 +2127,6 @@

-;zzz
 ;(defn !savecode [{:keys [id] } code]
 (defn !savecode [{:keys [id   code   app-session-id] }]
   (do


pos? in core.cljs with arithmetic is test

--- src/core.cljs
+++ src/core.cljs
@@ -114,6 +114,8 @@

 (defn dec [x] (- x 1))

+(defn pos? [x] (> x 0))
+
 (defmacro lazy-seq
     [& body]
     `(.create js/lazyseqs ((fn [] ~@body))))


Tests for unnest-series and unnest-all

Tests for unnest-series and unnest-all


Removes redundant test.

Removes redundant test.

--- test/onyx/coordinator/simulation_test.clj
+++ test/onyx/coordinator/simulation_test.clj
@@ -270,15 +270,6 @@
                                              #{:payload :ack :completion :status})
                      #{})))))

-        (let [db (d/db (:conn log))]
-          (testing "The peer is marked as :acking"
-            (is (= (count (d/q '[:find ?peer :where
-                                 [?peer :peer/status :acking]
-                                 [?peer :peer/task ?task]
-                                 [?task :task/name :in]]
-                               db))
-                   1))))
-
         (testing "Touching the ack node triggers the callback"
           (let [nodes (:nodes (extensions/read-place sync payload-node))]
             (extensions/touch-place sync (:ack nodes))


Ignore caught-up messages in test

Ignore caught-up messages in test

--- test/rill/event_store/atom_store_test.clj
+++ test/rill/event_store/atom_store_test.clj
@@ -73,7 +73,10 @@
             write-chunk-size 12
             num-messages 1000
             throughput-events (map gen-event (range num-messages))
-            recieve (event-channel store throughput-stream-id -1 10)]
+            recieve (async/filter< (fn [e]
+                                     (not= (message/type e)
+                                           :rill.event-channel/CaughtUp))
+                                   (event-channel store throughput-stream-id -1 10))]
         (println "Writing and recieving" num-messages "messages")
         (time
          (let [post (async/thread


correct PR for change of logging levels

correct PR for change of logging levels

--- jar-async/src/slipstream/async/launcher.clj
+++ jar-async/src/slipstream/async/launcher.clj
@@ -38,14 +38,15 @@
   [run user]
   (let [ch (chan)]
     (go
-      (let [[v c] (alts! [ch (timeout timeout-launch)])]
+      (let [[v c] (alts! [ch (timeout timeout-launch)])
+            run-uuid (.getUuid run)]
         (if (nil? v)
-          (let [msg (str "Timeout launching run " (.getUuid run))]
-            (log/log-error msg)
+          (do
+            (log/log-error "Timeout launching run" run-uuid)
             (swap! errors inc)
-            (Run/abort msg)
-          (let [msg (str "Launched run " (.getUuid run))]
-            (log/log-info msg)
+            (Run/abort "Timeout launching run" run-uuid))
+          (do
+            (log/log-info "Launched run" run-uuid)
             (swap! completed inc)))))
     (go (>! ch (Launcher/launch run user)))))


apply resizable css styles to inline div

--- src/datafrisk/core.cljs
+++ src/datafrisk/core.cljs
@@ -207,9 +207,9 @@
          (when visible?
            [:div {:style {:padding "10px"
                           ;; TODO Make the max height and width adjustable
-                          :max-height "400px"
-                          :max-width "800px"
-                          :height "100%"
+                          ;:max-height "400px"
+                          ;:max-width "800px"
+                          :resize "both"
                           :box-sizing "border-box"
                           :overflow-x "auto"
                           :overflow-y "auto"}}


don't broadcast to the peer that created the tx

--- src/dato/lib/server.clj
+++ src/dato/lib/server.clj
@@ -2,9 +2,11 @@
   (:require [clojure.core.async :as casync]
             [clojure.tools.logging :as log]
             [cognitect.transit :as transit]
+            [datascript.core]
             [dato.db.utils :as dsu]
             [dato.lib.datomic :as datod]
             [dato.lib.incoming :as incoming]
+            [dato.lib.outgoing :as outgoing]
             [dato.lib.incoming-tx :as incoming-tx]
             [datomic.api :as d]
             [immutant.codecs :as cdc]
@@ -99,10 +101,12 @@

 (defn broadcast-tx! [tal-state session-store tx-report]
   (def last-tx-report tx-report)
-  (let [data        (incoming/outgoing-tx-report tx-report)
-        _           (def last-tx-data data)
-        message     (ss-msg :server/database-transacted data)]
-    (doseq [ch-id (all-channel-ids session-store)]
+  (let [data          (incoming/outgoing-tx-report tx-report)
+        _             (def last-tx-data data)
+        message       (ss-msg :server/database-transacted data)
+        tx-session-id (:tx/session-id (outgoing/tx-ent tx-report))]
+    (doseq [ch-id (all-channel-ids session-store)
+            :when (not= ch-id tx-session-id)]
       (tal/queue-msg! tal-state ch-id message))))

 (defn start-tx-broadcast! [tal-state session-store tx-mult]
@@ -192,12 +196,11 @@
 (defmethod handle-websocket-msg :web-peer/transact
   [tal-state dato-config session-store msg]
   (let [reply (incoming-tx/handle-txes (get-dato-conn dato-config)
-                                       {}
+                                       {:tx/session-id (:tal/ch-id msg)}
                                        (-> msg :data :txes)
                                        (-> msg :data :guids)
                                        (get-dato-db dato-config)
                                        nil)]
-    (clojure.pprint/pprint reply)
     (tal/queue-reply! tal-state msg reply)))

@@ -320,8 +323,12 @@
   (let [dato-server (:server config)
         tal-state (tal/init :transit-reader-opts {:handlers {"r"                (transit/read-handler (fn [s] (URI. s)))
                                                              "datascript/Datom" (transit/read-handler datascript-datom->datom)}}
-                            :transit-writer-opts {:handlers {dato.lib.server.Datom (transit/write-handler (constantly "datascript/Datom")
-                                                                                transit-rep)}})
+                            :transit-writer-opts {:handlers {;; Do we still need this one?
+                                                             dato.lib.server.Datom (transit/write-handler (constantly "datascript/Datom")
+                                                                                transit-rep)
+                                                             datascript.core.Datom
+                                                             (transit/write-handler (constantly "datascript/Datom")
+                                                                                (fn [d] [(:e d) (:a d) (:v d) (:tx d) (:added d)]))}})
         session-store all-sessions]
     (set-dato-route-heirarchy! (get-routing-table config))
     (def -tal-state tal-state)


Set default language to german

Set default language to german

--- src/discuss/parser.cljs
+++ src/discuss/parser.cljs
@@ -14,7 +14,7 @@
                 :layout/title "discuss"
                 :layout/view :default
                 :layout/view-next nil
-                :layout/lang :en
+                :layout/lang :de
                 :issue/title "Town has to cut spending"
                 :issue/info "Our town needs to cut spending. Please discuss ideas how this should be done."
                 :issue/list [:list :of :issues]


CMR-493: Removed unneeded requires.

CMR-493: Removed unneeded requires.

--- src/cmr/search/data/complex_to_simple_converters/attribute.clj
+++ src/cmr/search/data/complex_to_simple_converters/attribute.clj
@@ -2,8 +2,6 @@
   "Defines functions that implement the reduce-query methods of the ComplexQueryToSimple
   protocol for product specific attribute search fields."
   (:require [clojure.string :as s]
-            [clj-time.core :as t]
-            [clj-time.format :as f]
             [cmr.search.data.complex-to-simple :as c2s]
             [cmr.search.models.query :as qm]
             [cmr.search.data.datetime-helper :as h]))


Fixed splitting strings.

Fixed splitting strings.

--- src/harnocode/core.cljs
+++ src/harnocode/core.cljs
@@ -106,18 +106,17 @@
   (let [invert-row (fn [row] (map #(if (= % 0) 1 0) row))]
    (map invert-row img)))

-;; TODO: break long string literals into several of form "abc" + "def"
+;; TODO: handle escaped symbols
 (defn split-string-literal [token l result]
- (let [[[quote & hrest :as h] t] (split-at l (:value token))]
-  (println h)
-  (if (empty? hrest)
-   (butlast result)
-   (recur
-    {:value (str quote (:value t)) :type "String"}
-    l
-    (conj result
-     {:value (str h quote) :type "String"}
-     {:value "+" :type "Punctuator"})))))
+ (let [[quote & value-rest] (:value token)
+       text   (string/join (butlast value-rest))
+       chunks (re-seq #"..?.?.?" text)
+       plus   {:value "+", :type "Punctuator"}
+       quoted-chunks (map #(str quote % quote) chunks)
+       quoted-tokens (map (fn [t] {:value t :type "String"}) quoted-chunks)
+       interleaved (butlast (interleave quoted-tokens (cycle [plus])))]
+    (println plus)
+    interleaved))

 (defn split-string-literals [tokens l]
   (let [split-token (fn [token]


Factored out partial compilation into separate method.

--- src/hiccup/compiler.clj
+++ src/hiccup/compiler.clj
@@ -101,7 +101,7 @@
   `(or ~@(for [[pattern body] (partition 2 clauses)]
            `(match-pattern ~target ~pattern ~body))))

-(defn literal?
+(defn- literal?
   "True if x is a literal value that can be rendered as-is."
   [x]
   (and (not (symbol? x))
@@ -112,6 +112,16 @@

 (declare compile-html)

+(defn- compile-partial-tag
+  "Compile an element when only the tag and attributes are literal."
+  [tag attrs content]
+  (let [[tag attrs _] (parse-element [tag attrs])]
+    (if (or content (container-tags tag))
+      `(str ~(str "<" tag (make-attrs attrs) ">")
+            ~@(compile-html content)
+            ~(str "</" tag ">"))
+       (str "<" tag (make-attrs attrs) " />"))))
+
 (defn compile-tag
   "Pre-compile a single tag vector where possible."
   [element]
@@ -119,12 +129,7 @@
     [& (every? literal? content)]
       (render-tag (eval element))
     [(literal? tag) (map? attrs) & content]
-      (let [[tag attrs _] (parse-element [tag attrs])]
-        (if (or content (container-tags tag))
-          `(str ~(str "<" tag (make-attrs attrs) ">")
-                ~@(compile-html content)
-                ~(str "</" tag ">"))
-           (str "<" tag (make-attrs attrs) " />")))
+      (compile-partial-tag tag attrs content)
     [& content]
       `(render-tag [~@(compile-html content)])))


Доработка предикатов выбора по тегам (отрицание)

--- src/ixinfestor/core.clj
+++ src/ixinfestor/core.clj
@@ -331,11 +331,14 @@
           set))))

 (defn com-defn-pred-rows-by-rel?
-  [field-id-1 field-id-2 rel-entity field-fk-id-1 field-fk-id-2]
+  [field-id-1 field-id-2 rel-entity field-fk-id-1 field-fk-id-2 & [not?]]
   (fn [select*-1 {entity-2-id field-id-2}]
-    (where select*-1 {field-id-1 [in (subselect rel-entity
-                                                (fields field-fk-id-1)
-                                                (where (= field-fk-id-2 entity-2-id)))]})))
+    (where select*-1
+           {field-id-1
+            (let [p [in (subselect rel-entity
+                                   (fields field-fk-id-1)
+                                   (where (= field-fk-id-2 entity-2-id)))]]
+              (if not? (not p) p))})))

 (defn com-defn-pred-rows-by-rel--nil-other?
   [field-id-1 field-id-2 rel-entity field-fk-id-1 field-fk-id-2]
@@ -358,22 +361,23 @@
        select*-1 row))))

 (defn com-defn-pred-rows-by-rels?
-  [field-id-1 field-id-2 rel-entity field-fk-id-1 field-fk-id-2]
+  [field-id-1 field-id-2 rel-entity field-fk-id-1 field-fk-id-2 & [not?]]
   (fn [select*-1 entity-2-rows]
     (reduce
      (fn [query entity-2-row]
        (where query
-              (exists
-               (subselect rel-entity
-                          (fields field-fk-id-1)
-                          (where (and
-                                  (= field-fk-id-2 (field-id-2 entity-2-row))
-                                  (= field-fk-id-1 (-> select*-1
-                                                       :ent
-                                                       :table
-                                                       (str "." (name field-id-1))
-                                                       keyword)))
-                                 )))))
+              (let [p (exists
+                       (subselect rel-entity
+                                  (fields field-fk-id-1)
+                                  (where (and
+                                          (= field-fk-id-2 (field-id-2 entity-2-row))
+                                          (= field-fk-id-1 (-> select*-1
+                                                               :ent
+                                                               :table
+                                                               (str "." (name field-id-1))
+                                                               keyword)))
+                                         )))]
+                (if not? (not p) p))))
      select*-1 entity-2-rows)))

 ;; END SQL TOOLS
@@ -966,13 +970,13 @@

 ;; TODO: написать тесты
 (defn webdoc-pred-by-tag?
-  [select*-1 tag-row]
-  ((com-defn-pred-rows-by-rel? :id :id webdoctag :webdoc_id :tag_id)
+  [select*-1 tag-row & [not?]]
+  ((com-defn-pred-rows-by-rel? :id :id webdoctag :webdoc_id :tag_id not?)
    select*-1  tag-row))

 (defn webdoc-pred-by-tags?
-  [select*-1 tags-rows]
-  ((com-defn-pred-rows-by-rels? :id :id webdoctag :webdoc_id :tag_id)
+  [select*-1 tags-rows & [not?]]
+  ((com-defn-pred-rows-by-rels? :id :id webdoctag :webdoc_id :tag_id not?)
    select*-1 tags-rows))

 (defn webdoc-pred-childs-tags-of-parent-tag? [query {id :id}]


Updated site routes to use templates.

Updated site routes to use templates.

--- search-app/src/cmr/search/site/routes.clj
+++ search-app/src/cmr/search/site/routes.clj
@@ -5,16 +5,47 @@
    ;; Third-party libs
    [compojure.core :refer :all]
    [ring.swagger.ui :as ring-swagger-ui]
+   [selmer.parser :as selmer]

    ;; CMR libs
    [cmr.collection-renderer.api.routes :as collection-renderer-routes]
    [cmr.common.api.context :as context]
-   [cmr.common-app.api-docs :as api-docs]))
+   [cmr.common-app.api-docs :as api-docs]
+   [cmr.search.site.data :as data]))
+
+(defn render-template-ok
+  ""
+  [template data]
+  {:status 200
+   :body (selmer/render-file template data)})
+
+(defn landing-links-page
+  ""
+  [request]
+  (render-template-ok
+    "templates/landing-links.html"
+    (data/get-landing-links request)))
+
+(defn eosdis-landing-links-page
+  ""
+  [request]
+  (render-template-ok
+    "templates/eosdis-landing-links.html"
+    (data/get-eosdis-landing-links request)))

 (defn build-routes [system]
   (let [relative-root-url (get-in system [:public-conf :relative-root-url])]
     (routes
       (context relative-root-url []
+        ;; Landing pages - Note that the landing pages must come before the
+        ;; api-docs, since api-docs/docs-routes also use a context of "site"
+        ;; but have the last entry as a 404 renderer, and as such, would
+        ;; prevent any pages in the "site" context from rendering after that
+        ;; point.
+        (GET "/site/collections/landing-pages" request
+          (landing-links-page request))
+        (GET "/site/collections/eosdis-landing-pages" request
+          (eosdis-landing-links-page request))
         ;; Add routes for API documentation
         (api-docs/docs-routes
           (get-in system [:public-conf :protocol])


holy quackamole I think it's working

holy quackamole I think it's working

--- server/src/gratefulplace/db/serialize.clj
+++ server/src/gratefulplace/db/serialize.clj
@@ -89,11 +89,9 @@
   [entity directives]
   (let [serialize-retrieved #(serialize
                               %
-                              (:serializer directives)
+                              (eval (:serializer directives))
                               (:options directives))
         retrieved ((:retriever directives) entity)]
-    (println "DIRECTIVES" directives)
-    (println "RETRIEVED" retrieved)
     (cond
      (= :one (:arity directives)) (serialize-retrieved retrieved)
      (= :many (:arity directives)) (map serialize-retrieved retrieved))))
@@ -118,10 +116,3 @@
      (merge
       (serialize-attributes entity (:attributes serializer) options)
       (serialize-relationships entity (:relationships serializer) options))))
-
-
-(serialize
- {:topic/title "test" :db/id 1 :topic/first-post {:db/id 1 :post/content "content"}}
- topic
- {:exclude [:id]
-  :include {:first-post {:include :topic}}})


fix padding for inner pages

fix padding for inner pages

--- frontend/components/aside.cljs
+++ frontend/components/aside.cljs
@@ -216,7 +216,7 @@
            [:i.fa.fa-comments]
            [:span "Live Support"]]

-          [:a#add-projects.aside-item {:href "/add-projects",
+          [:a.aside-item {:href "/add-projects",
                                        :data-placement "right"
                                        :data-trigger "hover"
                                        :title "Add Projects"}


fail fast

fail fast

--- frontend/components/forms.cljs
+++ frontend/components/forms.cljs
@@ -24,7 +24,7 @@
                (cond
                 (and (= uuid message-uuid)
                      (#{:success :failed} status))
-                (if (< (inc api-calls) api-count)
+                (if (and (= status :success) (< (inc api-calls) api-count))
                   (do (utils/mlog "completed" (inc api-calls) "of" api-count "api calls")
                       (recur (inc api-calls) (conj results status)))
                   (do (if (= #{:success} (conj results status))


Fix the typo in the test

Fix the typo in the test

--- test/clj/kixi/hecuba/data/measurements/calculations_test.clj
+++ test/clj/kixi/hecuba/data/measurements/calculations_test.clj
@@ -136,7 +136,7 @@
 (deftest apply-tariff-test
   (testing "Testing calculation of standard tariff."
     (is (= 0.08
-           (calculate/round (apply-tariff {:cost_per_kwh 0.13 :type :electricity :daily_standing_charge 0.2192
+           (calculate/round (apply-tariff {:cost_per_kWh 0.13 :type :electricity :daily_standing_charge 0.2192
                                            :annual-lump-sum-discount 5.0}
                                           [{:device_id "aa8392871e0f0a5dc23fb1f89f58b765d85674aa",
                                             :sensor_id "Electricity consumption_differenceSeries",


use walk-root to scope get-in retrieval

use walk-root to scope get-in retrieval

--- src/pani/cljs/core.cljs
+++ src/pani/cljs/core.cljs
@@ -82,8 +82,7 @@
 (defn get-in
   "get-in style single shot get function, returns a channel which delivers the value"
   [root ks]
-  (let [loc (clojure.string/join "/" (map name- ks))
-        ref (.child root loc)
+  (let [ref (walk-root root ks)
         ch  (async/chan)]
     (.once ref "value"
            #(if-let [v (.val %)]


Command prompt.

Command prompt.

--- src/mash_commander/core.cljs
+++ src/mash_commander/core.cljs
@@ -264,6 +264,8 @@
       (let [words (str/split (str/join (reverse (:letters cursor))) " ")
             spacing (contains? #{:typing-space :mashing-space} (first (:state cursor)))
             commanding (contains? valid-commands (first words))
+            command-prompt (dom/span #js {:style #js {:color "#33f"
+                                                      :fontWeight "bold"}} "$ ")
             cursor-char (dom/span #js {:style #js {:color "#900"}} "\u2588")
             rendered-words (interpose
                             (dom/span nil " ")
@@ -279,7 +281,9 @@
                  (if (and (:focus state) spacing) (concat r [(dom/span nil " ") cursor-char]) r)
                  (if (and (:focus state) (not spacing)) (concat r [cursor-char]) r)
                  (if commanding (cons (dom/span #js {:style #js {:color "#33f"}} (first words))
-                                      (rest r)) r)))))))
+                                      (rest r)) r)
+                 (if (:focus state) (cons command-prompt r) r)))))))
+

 (defn app-view [cursor owner]
   (reify


Refactor detail view

Refactor detail view

--- src/hackernews/shared/components/story_row.cljs
+++ src/hackernews/shared/components/story_row.cljs
@@ -6,13 +6,11 @@

 (defn- points-view
   [points]
-  [rn/view {:style {:flex 1
-                    :padding 5
-                    :align-items "center"
+  [rn/view {:style {:align-items "center"
+                    :flex 1
+                    :padding 10
                     :justify-content "center"}}
    [rn/text {:number-of-lines 1
-             :adjust-font-size-to-fit true
-             :minimum-font-scale .2
              :style {:font-size 20
                      :font-weight "bold"
                      :color "#f26522"}}
@@ -24,28 +22,25 @@

 (defn- detail-view
   [{:keys [user time_ago comments_count]}]
-  [rn/view {:style {:flex-direction "row"
-                    :padding-top 2
-                    :flex 1}}
+  [rn/view {:style {:flex-direction "row"}}
    [subtitle-view (str "by " user)]
    [subtitle-view time_ago]
    [subtitle-view "|"]
    [subtitle-view (str comments_count " comments")]])

 (s/fdef story-row
-        :args (s/cat :story ::db/story))
+        :args (s/cat :story ::db/story ))

 (defn story-row
   [{:keys [id points title read?] :as story}]
-  [rn/view {:style {:flex-direction "row"
-                    :margin 10}}
-   [points-view points]
-   [rn/view {:style {:flex 7
-                     :flex-direction "column"
-                     :justify-content "center"
-                     :align-items "flex-start"}}
-    [rn/text {:key title
-              :style {:font-size 20
-                      :color (if read? "grey" "black")}}
-     title]
-    [detail-view story]]])
+   [rn/view {:style {:flex-direction "row"
+                     :padding 10}}
+    [points-view points]
+    [rn/view {:style {:flex 7
+                      :flex-direction "column"
+                      :align-items "flex-start"}}
+     [rn/text {:key title
+               :style {:font-size 20
+                       :color (if read? "grey" "black")}}
+      title]
+     [detail-view story]]])


Add [CCI] output during cci compilation

Add [CCI] output during cci compilation

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- src/obcc/build/interface.clj
+++ src/obcc/build/interface.clj
@@ -119,8 +119,9 @@
 ;; it to an AST.
 ;;-----------------------------------------------------------------
 (defn compileintf [path intf]
-  (let [ipath (str path "/src/interfaces")]
-    (->> (open ipath intf) slurp parse)))
+  (let [file (open (io/file path "src/interfaces") intf)]
+    (println (str "[CCI] parse " (.getName file)))
+    (->> file slurp parse)))

 ;;-----------------------------------------------------------------
 ;; returns true if the interface contains a message named "Init"


Only retry if publication is in backpressure mode, not disconnected

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -360,6 +360,8 @@
   (doseq [segment batch]
     (>!! ch segment)))

+(def ^:const publication-backpressured? (long -2))
+
 (defmethod extensions/send-messages AeronConnection
   [messenger event {:keys [id channel] :as conn-info} batch]
   (if ((:short-circuitable? messenger) channel)
@@ -369,8 +371,8 @@
           offer-f (fn [] (.offer pub unsafe-buffer 0 len))
           idle-strategy (:send-idle-strategy messenger)]
       ;;; TODO: offer will return a particular code when the publisher is down
-      ;;; we should probably re-restablish the publication in this case
-      (while (neg? ^long (offer-f))
+      ;;; we should probably re-establish the publication in this case
+      (while (= ^long (offer-f) publication-backpressured?)
         (.idle ^IdleStrategy idle-strategy 0)))))

 (defn ack-messages-short-circuit [ch acks]
@@ -386,8 +388,8 @@
       (doseq [ack acks]
         (let [unsafe-buffer (protocol/build-acker-message id (:id ack) (:completion-id ack) (:ack-val ack))
               offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/ack-msg-length))]
-          (while (neg? ^long (offer-f))
-            (.idle ^IdleStrategy idle-strategy 0)))))))
+      (while (= ^long (offer-f) publication-backpressured?)
+        (.idle ^IdleStrategy idle-strategy 0)))))))

 (defn complete-message-short-circuit [ch completion-id]
   (>!! ch completion-id))
@@ -400,7 +402,7 @@
           pub ^Publication (get-publication messenger conn-info)
           unsafe-buffer (protocol/build-completion-msg-buf id completion-id)
           offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/completion-msg-length))]
-      (while (neg? ^long (offer-f))
+      (while (= ^long (offer-f) publication-backpressured?)
         (.idle ^IdleStrategy idle-strategy 0)))))

 (defn retry-message-short-circuit [ch retry-id]
@@ -414,7 +416,7 @@
           pub ^Publication (get-publication messenger conn-info)
           unsafe-buffer (protocol/build-retry-msg-buf id retry-id)
           offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/retry-msg-length))]
-      (while (neg? ^long (offer-f))
+      (while (= ^long (offer-f) publication-backpressured?)
         (.idle ^IdleStrategy idle-strategy 0)))))

 (defmethod extensions/close-peer-connection AeronConnection


removed incremental namespace; should never have been pushed

--- src/clj/forma/hadoop/jobs/incremental.clj
+++ src/clj/forma/hadoop/jobs/incremental.clj
@@ -1,159 +0,0 @@
-(ns forma.hadoop.jobs.incremental
-  (:use cascalog.api)
-  (:require [forma.date-time :as date]
-            [forma.ops.classify :as classify]
-            [forma.trends.analysis :as analyze]
-            [forma.hadoop.jobs.scatter :as scatter]
-            [forma.hadoop.jobs.forma :as forma]
-            [cascalog.ops :as c]))
-
-;; (defmain increment-prob
-;;   [tmp-root pail-path ts-pail-path fire-pail-path out-path run-key]
-;;   (let [{:keys [s-res t-res est-end] :as est-map} (scatter/forma-run-parameters run-key)
-;;         betas (classify/beta-dict beta-src)]))
-
-    ;; (date/datetime->period t-res end-period)
-
-(defmain formarunner
-  [tmp-root pail-path ts-pail-path fire-pail-path out-path run-key]
-  (let [{:keys [s-res t-res est-end] :as est-map} (forma-run-parameters run-key)
-        mk-filter (fn [vcf-path ts-src] (forma/filter-query (hfs-seqfile vcf-path)
-                                                           (:vcf-limit est-map)
-                                                           ts-src))]
-    (assert est-map (str run-key " is not a valid run key!"))
-
-    (workflow [tmp-root]
-
-              ndvi-pail-seq-step
-              ([:tmp-dirs ndvi-seq-path]
-                 "Filters out NDVI with VCF < 25"
-                 (?- (hfs-seqfile ndvi-seq-path)
-                     (<- [?pail-path ?data-chunk]
-                         ((constrained-tap ts-pail-path
-                                           "ndvi"
-                                           s-res
-                                           t-res) ?pail-path ?data-chunk))))
-
-              reli-pail-seq-step
-              ([:tmp-dirs reli-seq-path]
-                 "Filters out reliability with VCF < 25"
-                 (?- (hfs-seqfile reli-seq-path)
-                     (<- [?pail-path ?data-chunk]
-                         ((constrained-tap ts-pail-path
-                                           "reli"
-                                           s-res
-                                           t-res) ?pail-path ?data-chunk))))
-
-              rain-pail-seq-step
-              ([:tmp-dirs rain-seq-path]
-                 "Filter out rain with VCF < 25"
-                 (?- (hfs-seqfile rain-seq-path)
-                     (<- [?pail-path ?data-chunk]
-                         ((constrained-tap ts-pail-path
-                                           "precl"
-                                           s-res
-                                           "32") ?pail-path ?data-chunk))))
-
-              ndvi-filter
-              ([:tmp-dirs ndvi-path]
-                 "Filters out NDVI with VCF < 25"
-                 (?- (hfs-seqfile ndvi-path)
-                     (mk-filter vcf-path (hfs-seqfile ndvi-seq-path))))
-
-              reli-filter
-              ([:tmp-dirs reli-path]
-                 "Filters out reliability with VCF < 25"
-                 (?- (hfs-seqfile reli-path)
-                     (mk-filter vcf-path (hfs-seqfile reli-seq-path))))
-
-              screen-rain
-              ([:tmp-dirs rain-screened-path]
-                 "Only keeps rain for a specific country"
-                 (?- (hfs-seqfile rain-screened-path)
-                     (forma/screen-by-tileset (hfs-seqfile rain-seq-path)
-                                              (tile-set :IDN :BRA))))
-
-              rain-filter
-              ([:tmp-dirs rain-path]
-                 "Filter out rain with VCF < 25"
-                 (?- (hfs-seqfile rain-path)
-                     (mk-filter vcf-path
-                                (adjusted-precl-tap ts-pail-path
-                                                    s-res
-                                                    "32"
-                                                    t-res
-                                                    (hfs-seqfile rain-screened-path)))))
-              trends
-              ([:tmp-dirs trends-path]
-                 "Runs the trends processing."
-                 (?- (hfs-seqfile trends-path)
-                     (forma/analyze-trends
-                      est-map
-                      (hfs-seqfile clean-series))))
-
-              trends-cleanup
-              ([:tmp-dirs cleanup-path]
-                 "Clean up data after trends to improve join performance. Joins
-                  kill us with lots of observations"
-                 (?- (hfs-seqfile cleanup-path)
-                     (forma/trends-cleanup (hfs-seqfile trends-path))))
-
-              fire-step
-              ([:tmp-dirs fire-path]
-                 "Create fire series"
-                 (?- (hfs-seqfile fire-path)
-                     (tseries/fire-query fire-pail-path
-                                         s-res
-                                         t-res
-                                         "2000-11-01"
-                                         est-end)))
-
-              adjustfires
-              ([:tmp-dirs adjusted-fire-path]
-                 "Make sure fires data lines up temporally with our other
-                  timeseries."
-                 (?- (hfs-seqfile adjusted-fire-path)
-                     (forma/fire-tap est-map (hfs-seqfile fire-path))))
-
-              mid-forma
-              ([:tmp-dirs forma-mid-path]
-                 "Final step to collect all data for the feature vector -
-                 trends + fires data"
-                 (?- (hfs-seqfile forma-mid-path)
-                     (forma/forma-tap t-res
-                                      est-map
-                                      (hfs-seqfile cleanup-path)
-                                      (hfs-seqfile adjusted-fire-path))))
-
-              final-forma
-              ([:tmp-dirs final-path]
-                 "Process neighbors"
-                 (let [names ["?s-res" "?period" "?mod-h" "?mod-v"
-                              "?sample" "?line" "?forma-val"]
-                       mid-src (-> (hfs-seqfile forma-mid-path)
-                                   (name-vars names))]
-                   (?- (hfs-seqfile final-path)
-                       (forma/forma-query est-map mid-src))))
-
-              beta-data-prep
-              ([:tmp-dirs beta-data-path]
-                 "Pre-generate data needed for beta generation. Saves a bit of
-                  time if you have to run the next step multiple times."
-                 (?- (hfs-seqfile beta-data-path)
-                     (forma/beta-data-prep est-map
-                                           (hfs-seqfile final-path)
-                                           (hfs-seqfile static-path))))
-
-              forma-estimate
-              ([]
-                 "Apply beta vector"
-                 (?- (hfs-seqfile out-path :sinkmode :replace)
-                     (forma/forma-estimate (hfs-seqfile beta-path)
-                                           (hfs-seqfile final-path)
-                                           (hfs-seqfile static-path))))
-
-              stop-process
-              ([]
-                 "stop everything before deleting the temp directory"
-                 (?- (hfs-seqfile "/mnt/hgfs/Dropbox/yikes")
-                     (hfs-seqfile "/mnt/hgfs/Dropbox/yikestimes"))))))


Remove trailing comment in projects.clj.

--- src/clj/org/openforis/ceo/db/projects.clj
+++ src/clj/org/openforis/ceo/db/projects.clj
@@ -935,7 +935,7 @@
 (defn dump-project-aggregate-data [{:keys [params]}]
   (let [project-id (tc/val->int (:projectId params))]
     (if-let [project-info (first (call-sql "select_project_by_id" project-id))]
-      (let [survey-questions (tc/jsonb->clj (:survey_questions project-info)) ; TODO rename var
+      (let [survey-questions (tc/jsonb->clj (:survey_questions project-info))
             text-headers     (concat plot-base-headers
                                      (get-ext-plot-headers project-id))
             number-headers   (get-value-distribution-headers survey-questions)


Improve messaging: don't hide dialog if action is failed and don't show 'Success' message when action is failed.

--- src/cljs/hatnik/web/client/z_actions.cljs
+++ src/cljs/hatnik/web/client/z_actions.cljs
@@ -12,10 +12,10 @@
   (.-value (.getElementById js/document id)))

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

 (defn ajax [url type data callback]
   (jq/ajax url
@@ -26,7 +26,7 @@
             :dataType "json"
             :async true
             :error #(msg/danger "Invalid request. Please, check out request data.")
-            :success callback}))
+            :success #(callback (js->clj %))}))

 (defn get-github-repos [github-name callback error-handler]
   (jq/ajax (str "https://api.github.com/users/" github-name "/repos")
@@ -34,16 +34,14 @@
             :success callback
             :error error-handler}))

-(defn common-update-callback [msg data reply]
-  (let [resp (js->clj reply)]
-    (when (= "ok" (get resp "result"))
-      (state/update-all-view))))
+(defn common-update-callback [msg data response]
+  (when (= "ok" (get response "result"))
+    (.modal ($ :#iModalAddAction) "hide")
+    (state/update-all-view)))

-(defn create-new-project-callback [name reply]
-  (let [resp (js->clj reply)]
-    (when (= "ok" (get resp "result"))
-      (state/update-all-view))))
-
+(defn create-new-project-callback [name response]
+  (when (= "ok" (get response "result"))
+    (state/update-all-view)))

 (defn ^:export send-new-project-request []
   (let [name (.-value (.getElementById js/document "project-name-input"))]
@@ -53,10 +51,10 @@
         (.modal ($ :#iModalProject) "hide")
         (ajax  "/api/projects" "POST" {:name name} #(create-new-project-callback name %))))))

-(defn create-new-action-callback [data reply]
-  (let [resp (js->clj reply)]
-    (when (= "ok" (get resp "result"))
-      (state/update-all-view))))
+(defn create-new-action-callback [data response]
+  (when (= "ok" (get response "result"))
+    (.modal ($ :#iModalAddAction) "hide")
+    (state/update-all-view)))

 (defn build-email-action [data-pack]
   {:project-id (:project-id data-pack)
@@ -101,7 +99,7 @@
                   :text-done "The issue is created. Check out the repository."}
    :github-pull-request {:build build-gh-pull-request
                          :schema schm/GithubPullRequestAction
-                         :text-progress "Creating pull request on Github..."
+                         :text-progress "Creating test pull request on GitHub..."
                          :text-done "The pull request is created. Check out the repository."}})

 (defn send-new-action [data-pack]
@@ -109,10 +107,8 @@
         data (build data-pack)]
     (if (s/check schema data)
       (msg/danger default-error-message)
-      (do
-        (.modal ($ :#iModalAddAction) "hide")
-        (ajax "/api/actions" "POST" data
-              (wrap-error-alert #(create-new-action-callback data %)))))))
+      (ajax "/api/actions" "POST" data
+            (wrap-error-alert #(create-new-action-callback data %))))))

 (defn test-action [data-pack done-callback]
   (let [config (actions-config (:type data-pack))
@@ -123,10 +119,11 @@
       (do
         (msg/info (:text-progress config))
        (ajax "/api/actions/test" "POST" data
-            (wrap-error-alert
-             (fn [e]
-               (done-callback)
-               (msg/success (:text-done config)))))))))
+            (fn [response]
+              (done-callback)
+              (case (get response "result")
+                "ok" (msg/success (:text-done config))
+                "error" (msg/danger (get response "message")))))))))

 (def action-update-error-message "Couldn't update the action. Please file a bug if the issue persists.")

@@ -135,12 +132,10 @@
         data (build data-pack)]
     (if (s/check schema data)
       (msg/danger default-error-message)
-      (do
-        (.modal ($ :#iModalAddAction) "hide")
-        (ajax
-         (str "/api/actions/" (:action-id data-pack)) "PUT"
-         data (wrap-error-alert
-               #(common-update-callback action-update-error-message data %)))))))
+      (ajax
+       (str "/api/actions/" (:action-id data-pack)) "PUT"
+       data (wrap-error-alert
+             #(common-update-callback action-update-error-message data %))))))

 (defn delete-action [action-id]
   (.modal ($ :#iModalAddAction) "hide")


Minor renames on internal api of postal impl.

--- src/clojure/catacumba/handlers/postal.clj
+++ src/clojure/catacumba/handlers/postal.clj
@@ -39,19 +39,19 @@
 ;; Data encoding/decoding
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defmulti decode
+(defmulti ^:no-doc -decode
   (fn [data content-type]
     content-type))

-(defmulti encode
+(defmulti ^:no-doc -encode
   (fn [data content-type]
     content-type))

-(defmethod decode :application/transit+json
+(defmethod -decode :application/transit+json
   [data _]
   (sz/decode ^bytes data :transit+json))

-(defmethod encode :application/transit+json
+(defmethod -encode :application/transit+json
   [data _]
   (sz/encode data :transit+json))

@@ -133,11 +133,11 @@
   (-handle-response-message [data content-type]
     (try
       (-> (normalize-frame data)
-          (encode content-type)
+          (-encode content-type)
           (frame->http content-type))
       (catch Throwable error
         (-> (-adapt-exception error)
-            (encode content-type)
+            (-encode content-type)
             (frame->http content-type)))))

   CompletableFuture
@@ -167,7 +167,7 @@
         (-handle-response-message response content-type)))
     (catch Throwable error
       (-> (-adapt-exception error)
-          (encode content-type)
+          (-encode content-type)
           (frame->http content-type)))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -213,7 +213,7 @@
              data (get-incoming-data context)
              frame (if (empty? data)
                      {}
-                     (decode data content-type))]
+                     (-decode data content-type))]
          (dispatch handler context content-type frame))
        (catch Exception e
          (http/unsupported-mediatype (str e)))))))
@@ -230,12 +230,12 @@
   (let [content-type (::content-type context)]
     (letfn [(encode-message [msg]
               (-> (normalize-frame msg)
-                  (encode content-type)
+                  (-encode content-type)
                   (codecs/bytes->str)))

             (decode-message [msg]
               (-> (codecs/str->bytes msg)
-                  (decode content-type)))
+                  (-decode content-type)))

             (inner-handler [{:keys [in out ctrl] :as context}]
               (let [out-xf (map encode-message)


update pool key select

update pool key select

--- src/clojure/tcp_driver/routing/policy.clj
+++ src/clojure/tcp_driver/routing/policy.clj
@@ -42,20 +42,20 @@

            (-add-host! [_ host]
                        (ensure-host-address-schema! host)
-                       (swap! hosts-at conj host))
+                       (swap! hosts-at conj (select-keys host [:host :port])))

            (-remove-host! [_ host]
                           (ensure-host-address-schema! host)
-                          (swap! hosts-at disj host))
+                          (swap! hosts-at disj (select-keys host [:host :port])))

            (-blacklisted? [_ host]
                           (ensure-host-address-schema! host)
-                          (get black-listed-hosts-cache host))
+                          (get black-listed-hosts-cache (select-keys host [:host :port])))

            (-blacklist! [_ host]
                         (ensure-host-address-schema! host)
                         (prn "DefaultRountingPolicy:-blacklist " host " in " black-listed-hosts-cache)
-                        (assoc black-listed-hosts-cache host true))
+                        (assoc black-listed-hosts-cache (select-keys host [:host :port]) true))

            (-select-host [_]
                          (let [available-hosts (into [] (clj-set/difference @hosts-at (set (keys black-listed-hosts-cache))))]


repl fix

repl fix

--- src/clojure/zensols/cisql/interactive.clj
+++ src/clojure/zensols/cisql/interactive.clj
@@ -34,6 +34,7 @@
   {:description "Start an interactive session"
    :options
    [(spec/name-option true)
+    (lu/log-level-set-option)
     ["-u" "--user <string>" "login name"]
     ["-p" "--password <string>" "login password"]
     ["-h" "--host <string>" "database host name"
@@ -45,7 +46,7 @@
     ["-c" "--config <k1=v1>[,k2=v2] ..." "set session configuration"
      :parse-fn (fn [op]
                  (map #(s/split % #"=") (s/split op #"\s*,\s*")))]
-    (repl/repl-port-set-option nil "--repl")]
+    (repl/repl-port-set-option nil "--repl" nil)]
    :app (fn [{:keys [repl config] :as opts} & args]
           (with-exception
             (let [dbspec (create-db-spec opts)]


fix type in image caption

fix type in image caption

--- src/pc/views/blog/product_hunt_wake_up_call.clj
+++ src/pc/views/blog/product_hunt_wake_up_call.clj
@@ -100,7 +100,7 @@
       [:img {:src "/blog/product-hunt-wake-up-call/traffic-spike.png"}]]
      [:a {:data-caption-white "Here's an hourly overview of the same data.
                               We think the server crashed under the load but we're not sure since we were asleep.
-                              We've upgraded our hardware after that."}
+                              We've upgraded our hardware since then."}
       [:img {:src "/blog/product-hunt-wake-up-call/server-crash.png"}]]
      (common/tweet "benarent" "534592531917312000")
      (common/tweet "fotosdelviaje" "534070940120780801")


Update surface to use seesaw.mouse funcs

--- src/overtone/gui/surface.clj
+++ src/overtone/gui/surface.clj
@@ -2,27 +2,8 @@
   (:use [seesaw.core]
         [seesaw.graphics :only [draw circle style string-shape]]
         [seesaw.color :only [color]]
-        [overtone.sc.node :only [ctl]]))
-
-; TODO move to Seesaw.
-(def ^ {:private true} input-modifier-table
-  {:left java.awt.event.InputEvent/BUTTON1_DOWN_MASK
-    :center java.awt.event.InputEvent/BUTTON2_DOWN_MASK
-   :right java.awt.event.InputEvent/BUTTON3_DOWN_MASK})
-
-(def ^ {:private true} mouse-button-table
-  {java.awt.event.MouseEvent/BUTTON1 :left
-   java.awt.event.MouseEvent/BUTTON2 :center
-   java.awt.event.MouseEvent/BUTTON3 :right
-   java.awt.event.MouseEvent/NOBUTTON :none })
-
-(defn- mouse-button-down?
-  [^java.awt.event.InputEvent e btn]
-  (let [mask (input-modifier-table btn 0)]
-    (not= 0 (bit-and mask (.getModifiersEx e)))))
-
-(defn- mouse-button [^java.awt.event.MouseEvent e]
-  (mouse-button-table (.getButton e)))
+        [overtone.sc.node :only [ctl]])
+  (:require [seesaw.mouse :as mouse]))

 ;;;

@@ -69,8 +50,8 @@
     (style :foreground :darkgrey)))

 (defn- handle-move-event [state e]
-  (if (or (mouse-button-down? e :left)
-          (mouse-button-down? e :right))
+  (if (or (mouse/button-down? e :left)
+          (mouse/button-down? e :right))
     (let [x (min (max (.getX e) 0) (width e))
           y (min (max (.getY e) 0) (height e))]
       ((get-in state [:x :set-value]) (to-model (:x state) (width e) x))
@@ -79,12 +60,12 @@

 (defn- handle-press-event [state timer e]
   (handle-move-event state e)
-  (if (= :right (mouse-button e))
+  (if (= :right (mouse/button e))
     (reset! (:dir state) +)
     (repaint! e)))

 (defn- handle-release-event [state timer e]
-  (if (= :right (mouse-button e))
+  (if (= :right (mouse/button e))
     (reset! (:dir state) -)
     (repaint! e)))


modify unzip "security" method to check for subdirectory relationship of the canonical paths rather than searching for the presence of parent dir shortcuts: ..

--- src/overtone/helpers/zip.clj
+++ src/overtone/helpers/zip.clj
@@ -60,7 +60,8 @@
   compressed subdirectories, these will be created too."
   [zip-path dest-path]
   (let [zip-path  (resolve-tilde-path zip-path)
-        dest-path (resolve-tilde-path dest-path)]
+        dest-path (resolve-tilde-path dest-path)
+        dest-path (canonical-path dest-path)]
     (when-not (dir-exists? dest-path)
       (throw (Exception. (str "Destination directory does not exist: " dest-path))))
     (when-not (file-exists? zip-path)
@@ -73,9 +74,10 @@
        (map
         (fn [entry]
           (let [name           (.getName entry)
-                full-dest-path (mk-path dest-path name)]
-            (when (contains-parent-shortcut? full-dest-path)
-              (throw (Exception. "Security warning - attempted to specify a path which contains the .. previous dir shortcut. Aborting operation.")))
+                full-dest-path (mk-path dest-path name)
+                full-dest-path (canonical-path full-dest-path)]
+            (when-not (subdir? full-dest-path dest-path)
+              (throw (Exception. "Security warning - unzip was requested to create a path which is not within original dest-path. Aborting operation.")))
             (if (.isDirectory entry)
               (mkdir-p! full-dest-path)
               (let [is (.getInputStream zip entry)


log instead of printing error

log instead of printing error

--- src/shale/resources.clj
+++ src/shale/resources.clj
@@ -57,7 +57,7 @@
           [false {key data}])
         {:message "Empty body."})
       (catch Exception e
-        (.printStackTrace e)
+        (error e)
         {:message (format "Malformed JSON.")}))))

 (defn build-session-url [request id]


minor bug

minor bug

--- src/stash_bot/core.cljs
+++ src/stash_bot/core.cljs
@@ -133,7 +133,7 @@
       (fn []
         (set! led (js/five.Led. "GPIO16"))
         (set! servo
-          (js/five.Servo (js->clj {:pin "GPIO18"
+          (js/five.Servo (clj->js {:pin "GPIO18"
                                    :type "continuous"
                                    :deadband [90,92]})))
         (next-fn)))))


Simplify protocol function names.

Simplify protocol function names.

--- src/suricatta/proto.clj
+++ src/suricatta/proto.clj
@@ -25,8 +25,8 @@
 (ns suricatta.proto)

 (defprotocol IContextHolder
-  (-get-context [_] "Get jooq context with attached configuration")
-  (-get-config [_] "Get attached configuration."))
+  (-context [_] "Get jooq context with attached configuration")
+  (-config [_] "Get attached configuration."))

 (defprotocol IConnectionFactory
   (-connection [_] "Create a jdbc connection."))
@@ -41,8 +41,8 @@
   (-fetch-lazy [q ctx opts] "Fetch lazy results executing query."))

 (defprotocol IRenderer
-  (-get-sql [_ type dialect] "Render a query sql into a string.")
-  (-get-bind-values [_] "Get query bind values."))
+  (-sql [_ type dialect] "Render a query sql into a string.")
+  (-bind-values [_] "Get query bind values."))

 (defprotocol IQuery
   (-query [_ ctx] "Build a query."))
@@ -53,9 +53,9 @@
   "A lightweight abstraction for access
   to the basic properties on the render/bind
   context instances."
-  (-get-statement [_] "Get the prepared statement if it is awailable.")
-  (-get-next-bindindex [_] "Get the next bind index (WARN: side effectful)")
-  (-render-inline? [_] "Return true in case the context is setup for inline."))
+  (-statement [_] "Get the prepared statement if it is awailable.")
+  (-next-bind-index [_] "Get the next bind index (WARN: side effectful)")
+  (-inline? [_] "Return true in case the context is setup for inline."))

 (defprotocol IParamType
   "A basic abstraction for adapt user defined


major refactoring more progreess - editing needs work

--- cljs/matrix/src/tiltontec/tag/html.cljs
+++ cljs/matrix/src/tiltontec/tag/html.cljs
@@ -24,7 +24,7 @@
       [me type]
       (assert me)
       (fasc (fn [visited]
-                (println :mxa-find-type type (ia-type visited))
+                ;;(println :mxa-find-type type (ia-type visited))
                 (= type (ia-type visited))) me))

 (defn dom-has-class [dom class]


Added spinme example

Added spinme example

--- clojure/sodium/src/sodium/s_widgets.clj
+++ clojure/sodium/src/sodium/s_widgets.clj
@@ -1,9 +1,9 @@
 (ns sodium.s-widgets
   (:require [sodium.core :refer :all])
   (:require [clojure.string :as s])
-  (:import [nz.sodium Cell  CellLoop Listener Stream StreamSink Operational Transaction Unit])
-  (:import [javax.swing JButton JFrame JLabel JTextField SwingUtilities])
-  (:import [java.awt FlowLayout])
+  (:import [nz.sodium Cell  CellLoop Listener Stream StreamLoop StreamSink Operational Transaction Unit])
+  (:import [javax.swing JButton JFrame JLabel JPanel JTextField SwingUtilities])
+  (:import [java.awt FlowLayout GridBagLayout GridBagConstraints])
   (:import [java.awt.event ActionListener])
   (:import [javax.swing.event DocumentEvent DocumentListener]))

@@ -53,7 +53,7 @@
         label (proxy [JLabel] [""]
                 (removeNotify []
                   (.unlisten @l)
-                  (proxy-super removeNofify)))]
+                  (proxy-super removeNotify)))]
     (reset! l (.listen (Operational/updates c-text)
                        (handler [t] (if (SwingUtilities/isEventDispatchThread)
                                       (.setText label t)
@@ -112,7 +112,7 @@
        label (s-label (:cell msg))]
    (doto frame
      (.setLayout (FlowLayout.))
-                                        ;(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
+     (.setDefaultCloseOperation JFrame/DISPOSE_ON_CLOSE)
      (.add (:jtext msg))
      (.add label)
      (.setSize 400 160)
@@ -127,7 +127,7 @@
        label (s-label reversed)]
    (doto frame
      (.setLayout (FlowLayout.))
-                                        ;(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
+     (.setDefaultCloseOperation JFrame/DISPOSE_ON_CLOSE)
      (.add (:jtext msg))
      (.add label)
      (.setSize 400 160)
@@ -144,7 +144,7 @@
         text (s-text-field s-canned "")]
     (doto frame
       (.setLayout (FlowLayout.))
-                                        ;(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
+      (.setDefaultCloseOperation JFrame/DISPOSE_ON_CLOSE)
       (.add (:jtext text))
       (.add (:jbutton onegai))
       (.add (:jbutton thanks))
@@ -163,8 +163,7 @@
         lbl (s-label color)]
     (doto frame
       (.setLayout (FlowLayout.))
-                                        ;(.setDefaultCloseOperation
-                   ;JFrame/EXIT_ON_CLOSE)
+      (.setDefaultCloseOperation JFrame/DISPOSE_ON_CLOSE)
       (.add (:jbutton red))
       (.add (:jbutton green))
       (.add lbl)
@@ -183,8 +182,7 @@
         lbl-latin (s-label latin)]
     (doto frame
       (.setLayout (FlowLayout.))
-                                        ;(.setDefaultCloseOperation
-                                        ;JFrame/EXIT_ON_CLOSE)
+      (.setDefaultCloseOperation JFrame/DISPOSE_ON_CLOSE)
       (.add (:jtext english))
       (.add (:jbutton translate))
       (.add lbl-latin)
@@ -207,8 +205,7 @@
                              (.loop value (.hold s-update 0))
                              (doto view
                                (.setLayout (FlowLayout.))
-                                        ;(.setDefaultCloseOperation
-                                        ;JFrame/EXIT_ON_CLOSE)
+                               (.setDefaultCloseOperation JFrame/DISPOSE_ON_CLOSE)
                                (.add lbl-value)
                                (.add (:jbutton plus))
                                (.add (:jbutton minus))))))
@@ -232,16 +229,86 @@
         lbl-sum (s-label (.map sum (apply1 [i] (str i))))]
     (doto frame
       (.setLayout (FlowLayout.))
-     ;(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
+      (.setDefaultCloseOperation JFrame/DISPOSE_ON_CLOSE)
       (.add (:jtext txt-a))
       (.add (:jtext txt-b))
       (.add lbl-sum)
       (.setSize 400 160)
       (.setVisible true))))
-
+
+(defmacro set-grid! [constraints field value]
+  `(set! (. ~constraints ~(symbol (name field)))
+         ~(if (keyword? value)
+            `(. java.awt.GridBagConstraints
+                ~(symbol (name value)))
+            value)))
+
+(defmacro grid-bag-layout [container & body]
+  (let [c (gensym "c")
+        cntr (gensym "cntr")]
+    `(let [~c (new java.awt.GridBagConstraints)
+           ~cntr ~container]
+       ~@(loop [result '() body body]
+           (if (empty? body)
+             (reverse result)
+             (let [expr (first body)]
+               (if (keyword? expr)
+                 (recur (cons `(set-grid! ~c ~expr
+                                          ~(second body))
+                              result)
+                        (next (next body)))
+                 (recur (cons `(.add ~cntr ~expr ~c)
+                              result)
+                        (next body)))))))))
+
+(defn s-spinner
+  [initial-value]
+  (let [s-set-value (StreamLoop.)
+        text-field (s-text-field (.map s-set-value (apply1 [v] (str v))) (str initial-value) 5)
+        parse-int (fn [t] (try
+                           (Integer/parseInt t)
+                           (catch NumberFormatException e
+                             0)))
+        value (.map (:cell text-field) (apply1 [txt] (parse-int txt)))
+        plus (s-button "+")
+        minus (s-button "-")
+        spinner (JPanel. (GridBagLayout.))
+        s-plus-delta (.map (:s-clicked plus) (apply1 [u] 1))
+        s-minus-delta (.map (:s-clicked minus) (apply1 [u] -1))
+        s-delta (.orElse s-plus-delta s-minus-delta )]
+    (doto spinner
+      (grid-bag-layout
+       :gridx 0 :gridy 0
+       :gridwidth 1 :gridheight 2
+       :fill :BOTH
+       :weightx 1.0
+       (:jtext text-field)
+       :gridx 1 :gridy 0
+       :gridwidth 1 :gridheight 1
+       (:jbutton plus)
+       :gridx 1 :gridy 1
+       (:jbutton minus)))
+    (.loop s-set-value (.snapshot s-delta value (apply2 [delta value]
+                                                        (println (str delta ":" value))
+                                                        (+ delta value))))
+    {:jpanel spinner :cell value}))
+
+(defn spinme
+  []
+  (let [view (JFrame.)]
+    (Transaction/runVoid (fn []
+                           (let [spnr (s-spinner 0)]
+                             (.add view (:jpanel spnr)))))
+    (doto view
+      (.setLayout (FlowLayout.))
+      (.setDefaultCloseOperation JFrame/DISPOSE_ON_CLOSE)
+      (.setSize 400 160)
+      (.setVisible true))))
+

 (defn -main
   [& args]
+  (spinme)
   (add)
   (spinner)
   (translate)


CMR-8096: Fixed repl startup issue.

CMR-8096: Fixed repl startup issue.

--- cmr-exchange/service-bridge/project.clj
+++ cmr-exchange/service-bridge/project.clj
@@ -88,6 +88,7 @@
              :dev {:dependencies [[debugger "0.2.1"]]
                    :repl-options {:init-ns cmr.opendap.dev
                                   :prompt ~get-prompt
+                                  :timeout 120000
                                   :init ~(println (get-banner))}}
              :lint {:source-paths ^:replace ["src"]
                     :test-paths ^:replace []


I like this prefix better here

I like this prefix better here

--- integration-tests/apps/pedestal/hello/src/immutant/init.clj
+++ integration-tests/apps/pedestal/hello/src/immutant/init.clj
@@ -1,6 +1,6 @@
 (ns immutant.init
   (:require [immutant.web             :as web]
-            [io.pedestal.service.http :as bootstrap]
+            [io.pedestal.service.http :as http]
             [hello.service            :as service]))

-(web/start-servlet "/" (::bootstrap/servlet (bootstrap/create-servlet service/service)))+(web/start-servlet "/" (::http/servlet (http/create-servlet service/service)))


0.9.0-wip2

--- storm-kafka/project.clj
+++ storm-kafka/project.clj
@@ -1,4 +1,4 @@
-(defproject storm/storm-kafka "0.9.0-wip1"
+(defproject storm/storm-kafka "0.9.0-wip2"
   :source-path "src/clj"
   :java-source-path "src/jvm"
   :javac-options {:debug "true" :fork "true"}


on unsupported images, show default broken image

--- src/vignette/http/routes.clj
+++ src/vignette/http/routes.clj
@@ -92,7 +92,7 @@
              {route-params :route-params}
              (let [image-params (alr/route->thumb-map route-params)]
                (if (:unsupported image-params)
-                 (status (response "unsupported thumbnail request") 302)
+                 (error-response 302) ; purposely not passing image-params, since there is probably a redirect in varnish
                  (if-let [thumb (u/get-or-generate-thumbnail system image-params)]
                    (create-image-response thumb)
                    (error-response 404 image-params)))))


measure mouse position from the center of the view

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

--- plugins/SlideExplorer2/src/slide_explorer/user_controls.clj
+++ plugins/SlideExplorer2/src/slide_explorer/user_controls.clj
@@ -264,9 +264,16 @@
     (doseq [component (window-descendants window)]
       (.addKeyListener component key-adapter))))

+(defn apply-centered-mouse-position [screen-state screen-x screen-y]
+  (let [{:keys [width height]} screen-state]
+    (update-in screen-state [:mouse] assoc
+               :x (- screen-x (/ width 2))
+               :y (- screen-y (/ height 2)))))
+
 (defn update-mouse-position [e screen-state-atom]
-  (swap! screen-state-atom update-in [:mouse]
-         merge {:x (.getX e) :y (.getY e)}))
+  (swap! screen-state-atom
+         apply-centered-mouse-position
+         (.getX e) (.getY e)))

 (defn handle-click [panel event-predicate response-fn]
   (.addMouseListener panel
@@ -297,18 +304,15 @@
 (defn absolute-mouse-position [screen-state]
   (let [{:keys [x y z mouse zoom scale width height tile-dimensions]} screen-state]
     (when mouse
-      (let [mouse-x-centered (- (mouse :x) (/ width 2))
-            mouse-y-centered (- (mouse :y) (/ height 2))
-            [w h] tile-dimensions]
-        {:x (long (+ x (/ mouse-x-centered zoom scale) (/ w -2)))
-         :y (long (+ y (/ mouse-y-centered zoom scale) (/ h -2)))
+      (let [[w h] tile-dimensions]
+        {:x (long (+ x (/ (mouse :x) zoom scale) (/ w -2)))
+         :y (long (+ y (/ (mouse :y) zoom scale) (/ h -2)))
          :z z}))))

 (defn handle-reset [window screen-state-atom]
   (bind-window-keys window ["shift R"]
                #(swap! screen-state-atom
                        assoc :x 0 :y 0 :z 0 :zoom 1)))
-

 ;(defn handle-open [window]
 ;  (bind-window-keys window ["S"] create-dir-dialog))


add missing space in error message

add missing space in error message

--- src/main/clojure/clojure/tools/reader.clj
+++ src/main/clojure/clojure/tools/reader.clj
@@ -152,7 +152,7 @@
               (recur (if-not (identical? o rdr) (conj! a o) a)))))
         (reader-error rdr "EOF while reading"
                       (when first-line
-                        (str ", starting at line" first-line)))))))
+                        (str ", starting at line " first-line)))))))

 (defn- read-list
   [rdr _]


misc edits

misc edits

--- src/main/clojure/mikera/spectral/core.clj
+++ src/main/clojure/mikera/spectral/core.clj
@@ -53,8 +53,15 @@
               (mag (aget tarr (* j 2)) (aget tarr (inc (* j 2)))))))
     (Matrix/wrap half-length ts result-array)))

-(defn colour ^long [^double v]
-  (let [v (* (+ 1.0 (Math/log v)) 0.25)] (col/rgb v 0.0 v)))
+(defn colour ^long [^double val]
+  (let [lval (* (inc (Math/log val)) 0.9)]
+    (cond
+    (<= lval 0.0) 0xFF000000
+    (<= lval 1.0) (let [v (- lval 0.0)] (col/rgb 0.0 0.0 v))
+    (<= lval 2.0) (let [v (- lval 1.0)] (col/rgb v 0.0 (- 1.0 v)))
+    (<= lval 3.0) (let [v (- lval 2.0)] (col/rgb 1.0 v 0.0))
+    (<= lval 4.0) (let [v (- lval 3.0)] (col/rgb 1.0 1.0 v))
+    :else 0xFFFFFFFFF)))

 (defn render
   "Renders a spectrogram matrix into a bufferedimage"


Update to released lein-immutant.

Update to released lein-immutant.

--- integration-tests/project.clj
+++ integration-tests/project.clj
@@ -19,7 +19,7 @@
                  [org.immutant/wildfly _]]
   :aliases {"all" ^:replace ["do" "clean," "test"]}
   :modules {:parent nil}
-  :profiles {:integ-base {:plugins [[lein-immutant "2.1.0-SNAPSHOT"]]
+  :profiles {:integ-base {:plugins [[lein-immutant "2.1.0"]]
                           :aliases {"test" ^:displace ["immutant" "test"]}
                           :modules {:parent ".."}}
              :integ-messaging {:test-paths ["../messaging/test"]}


dind fixture destroy

dind fixture destroy

--- test/clj/swarmpit/test.clj
+++ test/clj/swarmpit/test.clj
@@ -8,7 +8,8 @@
 (defn dind-socket-fixture
   [test]
   (config/update! {:docker-sock "http://localhost:12375"})
-  (test))
+  (test)
+  (config/update! {}))

 (defn running-service-fixture
   [test]


Add tests with a single track, definition, and data line

--- test/cljam/io/wig_test.clj
+++ test/cljam/io/wig_test.clj
@@ -119,6 +119,22 @@
              :chr "chr1" :start 1 :end 1 :value 1}
             {:track {:line nil :format :fixed-step :chr "chr1" :step 1 :span 1}
              :chr "chr1" :start 2 :end 2 :value 2}])))
+
+  (testing "read a single track with a single variableStep"
+    (is (= (str->wig (cstr/join \newline ["track type=wiggle_0"
+                                          "variableStep chrom=chr1 span=10"
+                                          "1 1"]))
+           [{:track {:line "track type=wiggle_0" :format :variable-step
+                     :chr "chr1" :step nil :span 10}
+             :chr "chr1" :start 1 :end 10 :value 1}])))
+
+  (testing "read a single track with a single fixedStep"
+    (is (= (str->wig (cstr/join \newline ["track type=wiggle_0"
+                                          "fixedStep chrom=chr1 start=1 span=10"
+                                          "1"]))
+           [{:track {:line "track type=wiggle_0" :format :fixed-step
+                     :chr "chr1" :step 1 :span 10}
+             :chr "chr1" :start 1 :end 10 :value 1}])))

   (testing "read wig with continuous same formats"
     (let [s (cstr/join \newline ["variableStep chrom=chr19 span=5"


Adding a little more description, and a link back to pauldoo.com.

--- ClojureScript/hello.cljs
+++ ClojureScript/hello.cljs
@@ -374,6 +374,15 @@
                 (dom/createDom "div" {}
                     (dom/createTextNode "My code lives here: ")
                     (dom/createDom "a" (.strobj {"href" my-code-url}) my-code-url))
-                button
-                canvas)))))
-
+                (dom/createDom "div" {}
+                    (dom/createTextNode "This was my entry for the ")
+                    (dom/createDom "a" (.strobj {"href" "http://groups.google.com/group/techmeetup/browse_thread/thread/e9462c7a7815aee"}) "2011 christmas competition")
+                    (dom/createTextNode " at ")
+                    (dom/createDom "a" (.strobj {"href" "http://techmeetup.co.uk"}) "TechMeetup")
+                    (dom/createTextNode ".")
+                )
+                canvas
+                (dom/createDom "div" {}
+                    (dom/createDom "a" (.strobj {"href" "http://pauldoo.com/"}) "http://pauldoo.com/"))
+                )))))
+


(SERVER-1743) Change log message from Analytics to Update Service

This commit changes the message that the analytics service logs on
completing start from "Analytics" to "Update Service".  This change
reflects that the service is only currently handling a check for
available updates.

--- src/clj/puppetlabs/services/analytics/analytics_service.clj
+++ src/clj/puppetlabs/services/analytics/analytics_service.clj
@@ -26,5 +26,5 @@
                     (fn [] (version-check/check-for-updates!
                             {:product-name product-name} update-server-url)))
        (log/info (i18n/trs "Not checking for updates - opt-out setting exists"))))
-   (log/info (i18n/trs "Puppet Server Analytics has successfully started and will run in the background"))
+   (log/info (i18n/trs "Puppet Server Update Service has successfully started and will run in the background"))
    context))


Enable pretty REPL exceptions

Enable pretty REPL exceptions

--- test/user.clj
+++ test/user.clj
@@ -1,8 +1,12 @@
 (ns user
-  (:use io.aviso.tracker
-        [io.aviso.twixt :only [get-asset-uris default-options]]
-        io.aviso.twixt.startup
-        ring.adapter.jetty))
+  (:use
+    io.aviso.tracker
+    io.aviso.repl
+    [io.aviso.twixt :only [get-asset-uris default-options]]
+    io.aviso.twixt.startup
+    ring.adapter.jetty))
+
+(install-pretty-exceptions)

 (defn handler
   [request]


Resolved merge conflicts.

Resolved merge conflicts.

--- test/cmr_system_int_test/collection_search_test.clj
+++ test/cmr_system_int_test/collection_search_test.clj
@@ -62,21 +62,24 @@
       (is (= 3 (count references)))
       (some #{"MinimalCollectionV1" "OneCollectionV1" "AnotherCollectionV1"}
             (map #(:dataset-id %) references))))
-  (testing "search by provider id using wildcard *."
-    (let [references (search/find-collection-refs {:provider "CMR_PRO*", "options[provider][pattern]" "true"})]
+  (t/testing "search by provider id using wildcard *." [context]
+    (let [references (search/find-collection-refs context {:provider "CMR_PRO*", "options[provider][pattern]" "true"})]
       (is (= 5 (count references)))
       (some #{"MinimalCollectionV1" "OneCollectionV1" "AnotherCollectionV1" "OtherCollectionV1"}
             (map #(:dataset-id %) references))))
-  (testing "search by provider id using wildcard ?."
-    (let [references (search/find-collection-refs {:provider "CMR_PROV?", "options[provider][pattern]" "true"})]
+  (t/testing "search by provider id using wildcard ?." [context]
+    (let [references (search/find-collection-refs context {:provider "CMR_PROV?", "options[provider][pattern]" "true"})]
       (is (= 5 (count references)))
       (some #{"MinimalCollectionV1" "OneCollectionV1" "AnotherCollectionV1" "OtherCollectionV1"}
             (map #(:dataset-id %) references))))
-  (testing "search by provider id case not match."
-    (let [references (search/find-collection-refs {:provider "CMR_prov1"})]
-      (is (= 0 (count references)))))
-  (testing "search by provider id ignore case."
-    (let [references (search/find-collection-refs {:provider "CMR_prov1", "options[provider][ignore_case]" "true"})]
+  (t/testing "search by provider id case not match." [context]
+    (let [references (search/find-collection-refs context {:provider "CMR_prov1"})]
+      (is (= 0 (count references)))))
+  (t/testing "search by provider id ignore case false" [context]
+    (let [references (search/find-collection-refs context {:provider "CMR_prov1", "options[provider][ignore_case]" "false"})]
+      (is (= 0 (count references)))))
+  (t/testing "search by provider id ignore case true." [context]
+    (let [references (search/find-collection-refs context {:provider "CMR_prov1", "options[provider][ignore_case]" "true"})]
       (is (= 3 (count references)))
       (some #{"MinimalCollectionV1" "OneCollectionV1" "AnotherCollectionV1" "OtherCollectionV1"}
             (map #(:dataset-id %) references)))))
@@ -102,16 +105,19 @@
           dataset-ids (map #(:dataset-id %) references)]
       (is (= 2 (count references)))
       (is (= #{"OneCollectionV1"} (into #{} dataset-ids)))))
-  (testing "search by dataset id using wildcard *."
-    (let [references (search/find-collection-refs {:dataset_id "O*", "options[dataset_id][pattern]" "true"})
+  (t/testing "search by dataset id using wildcard *." [context]
+    (let [references (search/find-collection-refs context {:dataset_id "O*", "options[dataset_id][pattern]" "true"})
           dataset-ids (map #(:dataset-id %) references)]
       (is (= 3 (count references)))
       (is (= #{"OneCollectionV1" "OtherCollectionV1"} (into #{} dataset-ids)))))
-  (testing "search by dataset id case not match."
-    (let [references (search/find-collection-refs {:dataset_id "minimalCollectionV1"})]
-      (is (= 0 (count references)))))
-  (testing "search by dataset id ignore case."
-    (let [references (search/find-collection-refs {:dataset_id "minimalCollectionV1", "options[dataset_id][ignore_case]" "true"})]
+  (t/testing "search by dataset id case not match." [context]
+    (let [references (search/find-collection-refs context {:dataset_id "minimalCollectionV1"})]
+      (is (= 0 (count references)))))
+  (t/testing "search by dataset id ignore case false." [context]
+    (let [references (search/find-collection-refs context {:dataset_id "minimalCollectionV1", "options[dataset_id][ignore_case]" "false"})]
+      (is (= 0 (count references)))))
+  (t/testing "search by dataset id ignore case true." [context]
+    (let [references (search/find-collection-refs context {:dataset_id "minimalCollectionV1", "options[dataset_id][ignore_case]" "true"})]
       (is (= 1 (count references)))
       (let [{dataset-id :dataset-id} (first references)]
         (is (= "MinimalCollectionV1" dataset-id))))))
@@ -137,16 +143,19 @@
           dataset-ids (map #(:dataset-id %) references)]
       (is (= 2 (count references)))
       (is (= #{"OneCollectionV1"} (into #{} dataset-ids)))))
-  (testing "search by short name using wildcard *."
-    (let [references (search/find-collection-refs {:short_name "O*", "options[short_name][pattern]" "true"})
+  (t/testing "search by short name using wildcard *." [context]
+    (let [references (search/find-collection-refs context{:short_name "O*", "options[short_name][pattern]" "true"})
           dataset-ids (map #(:dataset-id %) references)]
       (is (= 3 (count references)))
       (is (= #{"OneCollectionV1" "OtherCollectionV1"} (into #{} dataset-ids)))))
-  (testing "search by short name case not match."
-    (let [references (search/find-collection-refs {:short_name "minimal"})]
-      (is (= 0 (count references)))))
-  (testing "search by short name ignore case."
-    (let [references (search/find-collection-refs {:short_name "minimal", "options[short_name][ignore_case]" "true"})]
+  (t/testing "search by short name case not match." [context]
+    (let [references (search/find-collection-refs context {:short_name "minimal"})]
+      (is (= 0 (count references)))))
+  (t/testing "search by short name ignore case false." [context]
+    (let [references (search/find-collection-refs context {:short_name "minimal", "options[short_name][ignore_case]" "false"})]
+      (is (= 0 (count references)))))
+  (t/testing "search by short name ignore case true." [context]
+    (let [references (search/find-collection-refs context {:short_name "minimal", "options[short_name][ignore_case]" "true"})]
       (is (= 1 (count references)))
       (let [{dataset-id :dataset-id} (first references)]
         (is (= "MinimalCollectionV1" dataset-id))))))
@@ -165,7 +174,7 @@
         ;; TODO We should return a URL in the references once the retrieval feature is implemented.
         #_(is (re-matches #"http.*/catalog-rest/echo_catalog/datasets/C[0-9]+-CMR_PROV1$" location)))))
   (t/testing "search by multiple versions." [context]
-    (let [references (search/find-collection-refs context {"version[]" ["1", "3"]})
+    (let [references (search/find-collection-refs context {"version[]" ["1", "r1"]})
           dataset-ids (map #(:dataset-id %) references)]
       (is (= 2 (count references)))
       (is (= #{"MinimalCollectionV1" "AnotherCollectionV1"} (into #{} dataset-ids)))))
@@ -174,21 +183,24 @@
           dataset-ids (map #(:dataset-id %) references)]
       (is (= 2 (count references)))
       (is (= #{"OneCollectionV1"} (into #{} dataset-ids)))))
-  (testing "search by version using wildcard *."
-    (let [references (search/find-collection-refs {:version "r*", "options[version][pattern]" "true"})
+  (t/testing "search by version using wildcard *." [context]
+    (let [references (search/find-collection-refs context {:version "r*", "options[version][pattern]" "true"})
           dataset-ids (map #(:dataset-id %) references)]
       (is (= 2 (count references)))
       (is (= #{"OtherCollectionV1" "AnotherCollectionV1"} (into #{} dataset-ids)))))
-  (testing "search by version using wildcard ?."
-    (let [references (search/find-collection-refs {:version "r?", "options[version][pattern]" "true"})
+  (t/testing "search by version using wildcard ?." [context]
+    (let [references (search/find-collection-refs context {:version "r?", "options[version][pattern]" "true"})
           dataset-ids (map #(:dataset-id %) references)]
       (is (= 2 (count references)))
       (is (= #{"OtherCollectionV1" "AnotherCollectionV1"} (into #{} dataset-ids)))))
-  (testing "search by version case not match."
-    (let [references (search/find-collection-refs {:version "R1"})]
-      (is (= 0 (count references)))))
-  (testing "search by version ignore case."
-    (let [references (search/find-collection-refs {:version "R1", "options[version][ignore_case]" "true"})]
+  (t/testing "search by version case not match." [context]
+    (let [references (search/find-collection-refs context {:version "R1"})]
+      (is (= 0 (count references)))))
+  (t/testing "search by version ignore case false." [context]
+    (let [references (search/find-collection-refs context {:version "R1", "options[version][ignore_case]" "false"})]
+      (is (= 0 (count references)))))
+  (t/testing "search by version ignore case true." [context]
+    (let [references (search/find-collection-refs context {:version "R1", "options[version][ignore_case]" "true"})]
       (is (= 1 (count references)))
       (let [{dataset-id :dataset-id} (first references)]
         (is (= "AnotherCollectionV1" dataset-id))))))
@@ -204,7 +216,7 @@
           (is (re-matches #".*Parameter \[unsupported\] was not recognized.*" body))))))
   (t/testing "search by un-supported options." [context]
     (try
-      (search/find-collection-refs context {:dataset_id "abcd", "options[dataset_id][unsupported]" "true"})
+      (search/find-collection-refs context {:dataset_id "MinimalCollectionV1", "options[dataset_id][unsupported]" "true"})
       (catch clojure.lang.ExceptionInfo e
         (let [status (get-in (ex-data e) [:object :status])
               body (get-in (ex-data e) [:object :body])]


Missing test check.

Missing test check.

--- test/fcms/integration/rest_api/item/item_create.clj
+++ test/fcms/integration/rest_api/item/item_create.clj
@@ -167,6 +167,7 @@
       (item/get-item e i) => (contains {
         :collection e
         :name unicode-name
+        :description unicode-description
         :slug i
         :version 1})
       (collection/item-count e) => 1)


Test belongs elsewhere

Test belongs elsewhere

--- test/structural_typing/guts/mechanics/f_compiling_types.clj
+++ test/structural_typing/guts/mechanics/f_compiling_types.clj
@@ -208,17 +208,6 @@
       (oopsie/explanations (checker {:a 1}))
       => (just ":a should be `even?`; it is `1`"
                "Value should be `evencount`; it is `{:a 1}`"))
-
-    (fact "intended to be typically used with `implies`"
-      (let [checker (->checker {:a even?}
-                               (preds/implies :a :b))]
-        (checker {}) => empty?
-        (checker {:a 2 :b 1}) => empty?
-        (oopsie/explanations (checker {:a 1 :b 1})) => (just ":a should be `even?`; it is `1`")
-        (oopsie/explanations (checker {:a 2})) =future=> (just "some message")))
-
-
-    (future-fact "implies like (preds/implies :a (about :b required-key)")
 ))


CMR-5064: Resolved merge conflict.

CMR-5064: Resolved merge conflict.

--- umm-spec-lib/test/cmr/umm_spec/test/umm_g/expected_util.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/umm_g/expected_util.clj
@@ -65,6 +65,12 @@
                {:range-date-time (umm-c/map->RangeDateTime
                                   {:beginning-date-time (dtp/parse-datetime "2018-07-17T00:00:00.000Z")
                                    :ending-date-time (dtp/parse-datetime "2018-07-17T23:59:59.999Z")})})
+    :orbit-calculated-spatial-domains [(umm-lib-g/map->OrbitCalculatedSpatialDomain
+                                        {:orbital-model-name "OrbitalModelName"
+                                         :start-orbit-number 99263
+                                         :stop-orbit-number 99263
+                                         :equator-crossing-longitude 88.92
+                                         :equator-crossing-date-time (dtp/parse-datetime "2018-08-16T16:22:21.000Z")})]
     :platform-refs [(umm-lib-g/map->PlatformRef
                      {:short-name "Aqua"
                       :instrument-refs
@@ -165,6 +171,5 @@
   excluded list below."
   [gran]
   (-> gran
-      (dissoc :orbit-calculated-spatial-domains)
       (util/update-in-each [:measured-parameters] expected-measured-parameter)
       umm-lib-g/map->UmmGranule))


Story ID: RPC-236 Summary: <factory-fn> -> ui-factory-fn

--- src/untangled_spec/reporters/browser.cljs
+++ src/untangled_spec/reporters/browser.cljs
@@ -27,25 +27,25 @@
                                              (dom/div #js {:className (if folded? "hidden" "stack-trace")}
                                                       stack))))))))

-(def <result-line> (om/factory ResultLine))
+(def ui-result-line (om/factory ResultLine))

 (defui TestResult
        Object
        (render [this]
                (let [{:keys [message actual expected stack]} (om/props this)]
                  (->> (dom/tbody nil
-                                 (<result-line> {:title "Actual"
+                                 (ui-result-line {:title "Actual"
                                                  :value actual
                                                  :stack stack})
-                                 (<result-line> {:title "Expected"
+                                 (ui-result-line {:title "Expected"
                                                  :value (or expected "")}))
                       (dom/table nil)
                       (dom/div nil (when message (dom/h3 nil message)))
                       (dom/li nil)))))

-(def <test-result> (om/factory TestResult {:keyfn :id}))
+(def ui-test-result (om/factory TestResult {:keyfn :id}))

-(declare <test-item>)
+(declare ui-test-item)

 (defui TestItem
        Object
@@ -57,13 +57,13 @@
                                   (dom/span #js {:className (impl/itemclass (:status test-item-data))}
                                             (:name test-item-data))
                                   (dom/ul #js {:className "test-list"}
-                                          (mapv <test-result>
+                                          (mapv ui-test-result
                                                 (:test-results test-item-data)))
                                   (dom/ul #js {:className "test-list"}
-                                          (mapv (comp <test-item> #(assoc % :report/filter filter))
+                                          (mapv (comp ui-test-item #(assoc % :report/filter filter))
                                                 (:test-items test-item-data))))))))

-(def <test-item> (om/factory TestItem {:keyfn :id}))
+(def ui-test-item (om/factory TestItem {:keyfn :id}))

 (defui TestNamespace
        Object
@@ -82,10 +82,10 @@
                                            (if folded? \u25BA \u25BC)
                                            " Testing " (:name tests-by-namespace)))
                             (dom/ul #js {:className (if folded? "hidden" "test-list")}
-                                    (mapv (comp <test-item> #(assoc % :report/filter filter))
+                                    (mapv (comp ui-test-item #(assoc % :report/filter filter))
                                           (:test-items tests-by-namespace))))))))

-(def <test-namespace> (om/factory TestNamespace {:keyfn :name}))
+(def ui-test-namespace (om/factory TestNamespace {:keyfn :name}))

 (defui Filters
        Object
@@ -104,7 +104,7 @@
                                       :onClick   (set-filter! :failed)}
                                  "Failed")))))

-(def <filters> (om/factory Filters))
+(def ui-filters (om/factory Filters))

 (defn debounce [f interval]
   (let [timeout (atom nil)]
@@ -155,7 +155,7 @@
                                        failed " failed "
                                        error  " errors"))))))

-(def <test-count> (om/factory TestCount))
+(def ui-test-count (om/factory TestCount))

 (defui TestReport
        static om/IQuery
@@ -168,10 +168,10 @@
                      set-filter! (fn [new-filter]
                                    #(om/transact! this `[(~'set-filter {:new-filter ~new-filter})]))]
                  (dom/section #js {:className "test-report"}
-                              (<filters> {:report/filter current-filter
+                              (ui-filters {:report/filter current-filter
                                           :set-filter! set-filter!})
                               (dom/ul #js {:className "test-list"}
-                                      (mapv (comp <test-namespace>
+                                      (mapv (comp ui-test-namespace
                                                   #(assoc % :report/filter current-filter))
                                             (:namespaces test-report-data)))
-                              (<test-count> test-report-data)))))
+                              (ui-test-count test-report-data)))))


Allow non-map results in xargs (#79)

Allow non-map results in xargs (#79)

--- src/yetibot/core/commands/collections.clj
+++ src/yetibot/core/commands/collections.clj
@@ -142,7 +142,7 @@
         ((resolve cmd-runner)
          (fn [item]
            (try
-             (let [{:result/keys [value error] :as cmd-result}
+             (let [cmd-result
                    (apply handle-cmd
                           ;; item could be a collection, such as when xargs is
                           ;; used on nested collections, e.g.:
@@ -151,6 +151,11 @@
                             [args (merge cmd-params {:raw item :opts item})]
                             [(psuedo-format args item)
                              (merge cmd-params {:raw item :opts nil})]))
+
+                   [value error] (if (map? cmd-result)
+                                   ((juxt :result/value :result/error)
+                                    cmd-result)
+                                   [cmd-result nil])
                    _ (info "xargs cmd-result" (pr-str cmd-result))]
                (or error value cmd-result))
              (catch Exception ex


basic searching works

basic searching works

--- test/celestial/integration/es/systems.clj
+++ test/celestial/integration/es/systems.clj
@@ -2,10 +2,20 @@
   "Testing system searching"
   (:require
     [es.node :as es]
-    [es.systems :as esys])
+    [es.systems :as sys]
+    [clojurewerkz.elastisch.query :as q]
+    [celestial.fixtures.data :refer (redis-prox-spec redis-ec2-spec)]
+    )
   (:use midje.sweet))

-(with-state-changes [(before :facts (do (es/start-n-connect) (esys/initialize)))
+(with-state-changes [(before :facts (do (es/start-n-connect) (sys/initialize)))
                      (after :facts (es/stop))]
-
-  )
+
+  (fact "basic system put and get" :integration :elasticsearch
+    (sys/put "1" redis-prox-spec)
+    (sys/put "2" redis-ec2-spec)
+    (sys/put "3" redis-prox-spec)
+    (get-in (sys/get "1") [:source :env]) => ":dev"
+    (get-in (sys/query {:bool {:must {:term {"machine.cpus" "4" }}}}) [:hits :total]) => 2
+
+    ))


With this setup tests in figwheel are not possible (repl-test requires doo.runner)

--- test/cljs/launcher/test.cljs
+++ test/cljs/launcher/test.cljs
@@ -1,14 +0,0 @@
-(ns ^:figwheel-always launcher.test
-  (:require [cljs.test :refer [successful?] :refer-macros [run-tests run-all-tests]]
-            [replumb.repl-test]
-            [replumb.core-test]
-            [replumb.common-test]))
-
-(enable-console-print!)
-
-(defmethod cljs.test/report [:cljs.test/default :end-run-tests] [m]
-  (successful? m))
-
-(defn ^:export run
-  []
-  (run-all-tests #"^replumb.*-test"))


Test-replaceAll1/2

--- test/hurvinek/utils_test.clj
+++ test/hurvinek/utils_test.clj
@@ -235,3 +235,21 @@
         (is (thrown? NullPointerException (endsWith "text" nil)))
         (is (thrown? NullPointerException (endsWith nil "text")))))

+(deftest test-replaceAll-1
+    "Check the function hurvinek.utils/replaceAll."
+    (testing "the function hurvinek.utils/replaceAll."
+        (are [x y] (= x y)
+            ""    (replaceAll "" "" "")
+            "b"   (replaceAll "a" "a" "b")
+            "bb"  (replaceAll "aa" "a" "b")
+            "bcb" (replaceAll "aca" "a" "b"))))
+
+(deftest test-replaceAll-2
+    "Check the function hurvinek.utils/replaceAll."
+    (testing "the function hurvinek.utils/replaceAll."
+        (are [x y] (= x y)
+            "b"     (replaceAll "aa" "aa" "b")
+            "bb"    (replaceAll "aaaa" "aa" "b")
+            "xbbx"  (replaceAll "xaaaax" "aa" "b")
+            "xbxbx" (replaceAll "xaaxaax" "aa" "b"))))
+


Add tests of pattern/binding->symbol

Add tests of pattern/binding->symbol

--- test/oxcart/pattern_test.clj
+++ test/oxcart/pattern_test.clj
@@ -117,6 +117,15 @@
       (is (p/binding? {:op op})))))

+(deftest binding->symbol-tests
+  ;; FIXME:
+  ;;   This test depends on internals of t.a.jvm's renaming and
+  ;;   _technically_ is implementation defined but it's probably safe
+  ;;   for now.
+  (let [b (first (:bindings addition))]
+    (is (= 'x__#0 (p/binding->symbol b)))))
+
+
 (def private-defn
   (ast
    (defn ^:private baz [x]