[#1950] Refine logs

[#1950] Refine logs

--- backend/src/akvo/lumen/component/flow.clj
+++ backend/src/akvo/lumen/component/flow.clj
@@ -34,10 +34,11 @@
      (str (:url flow-api) "/check_permissions")
      {:as :json
       :headers (api-headers token)
+      :throw-entire-message? true
+      :unexceptional-status #(<= 200 % 299)
       :form-params body
       :content-type :json})
-    (catch Exception e (log/error e :fail :body body :headers (api-headers token) :error-message (.getMessage e)))))
-
+    (catch Exception e (log/error :fail :body body :response (ex-data e)))))

 (defmethod ig/init-key ::api  [_ {:keys [url] :as opts}]
   opts)


Redo multiple AJAX pattern

Redo multiple AJAX pattern

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/tab.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/tab.cljs
@@ -178,55 +178,43 @@

 (react/defc Summary
-  {:get-initial-state
-   (fn []
-     {:viewing-attributes? false
-      :load-counter 0})
-   :render
+  {:render
    (fn [{:keys [refs state props this]}]
-     (cond
-       (and (:server-response @state) (:submission-response @state))
-       (let [{:keys [workspace workspace-error]} (:server-response @state)
-             {:keys [submissions submissions-error]} (:submission-response @state)]
-         (cond workspace-error (style/create-server-error-message workspace-error)
-               submissions-error (style/create-server-error-message submissions-error)
-               :else
-               (let [owner? (= "OWNER" (workspace "accessLevel"))
-                     writer? (or (= "WRITER" (workspace "accessLevel")) owner?)]
-                 [:div {:style {:margin "45px 25px" :display "flex"}}
-                  (render-overlays state props)
-                  (render-sidebar state props refs this workspace owner? writer?)
-                  (render-main state refs workspace owner? submissions)])))
-       :else [:div {:style {:textAlign "center" :padding "1em"}}
-              [comps/Spinner {:text "Loading workspace..."}]]))
+     (let [server-response (:server-response @state)
+           {:keys [workspace submissions server-error]} server-response]
+       (cond
+         server-error (style/create-server-error-message server-error)
+         (some nil? [workspace submissions]) [:div {:style {:textAlign "center" :padding "1em"}}
+                                              [comps/Spinner {:text "Loading workspace..."}]]
+         :else
+         (let [owner? (= "OWNER" (workspace "accessLevel"))
+               writer? (or owner? (= "WRITER" (workspace "accessLevel")))]
+           [:div {:style {:margin "45px 25px" :display "flex"}}
+            (render-overlays state props)
+            (render-sidebar state props refs this workspace owner? writer?)
+            (render-main state refs workspace owner? submissions)]))))
    :load-workspace
    (fn [{:keys [props state]}]
-     (when (zero? (:load-counter @state))
-       (swap! state assoc :load-counter 2)
-       (endpoints/call-ajax-orch
-         {:endpoint (endpoints/get-workspace (:workspace-id props))
-          :on-done (fn [{:keys [success? get-parsed-response status-text]}]
-                     (swap! state assoc :server-response
-                       (if success?
-                         {:workspace (get-parsed-response)}
-                         {:workspace-error status-text}))
-                     (if success?
-                       (let [response (:server-response @state)
-                             attributes (get-in response
-                                          [:workspace "workspace" "attributes" ])
-                             attrs-list (mapv (fn [[k v]] [k v])
-                                          (dissoc attributes "description"))]
-                         (swap! state assoc :attrs-list attrs-list))
-                       (swap! state dissoc :attrs-list))
-                     (swap! state update-in [:load-counter] dec))})
-       (endpoints/call-ajax-orch
-         {:endpoint (endpoints/list-submissions (:workspace-id props))
-          :on-done (fn [{:keys [success? status-text get-parsed-response]}]
-                     (swap! state assoc :submission-response
-                       (if success?
-                         {:submissions (get-parsed-response)}
-                         {:submissions-error status-text})
-                       (swap! state update-in [:load-counter] dec)))})))
+     (endpoints/call-ajax-orch
+       {:endpoint (endpoints/get-workspace (:workspace-id props))
+        :on-done (fn [{:keys [success? get-parsed-response status-text]}]
+                   (if success?
+                     (let [workspace (get-parsed-response)
+                           attributes (get-in workspace ["workspace" "attributes"])]
+                       (swap! state update-in [:server-response]
+                         assoc :workspace workspace)
+                       (swap! state assoc :attrs-list (mapv (fn [[k v]] [k v])
+                                                        (dissoc attributes "description"))))
+                     (swap! state update-in [:server-response]
+                       assoc :server-error status-text)))})
+     (endpoints/call-ajax-orch
+       {:endpoint (endpoints/list-submissions (:workspace-id props))
+        :on-done (fn [{:keys [success? status-text get-parsed-response]}]
+                   (if success?
+                     (swap! state update-in [:server-response]
+                       assoc :submissions (get-parsed-response))
+                     (swap! state update-in [:server-response]
+                       assoc :server-error status-text)))}))
    :lock-or-unlock
    (fn [{:keys [props state]} locked-now?]
      (swap! state assoc :locking? locked-now?)


use apply distinct  and emtpy? instead of counts comparison

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/tab.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/tab.cljs
@@ -141,7 +141,7 @@
                                                          (react/call :load-workspace this))
                                                        (when-not (empty? up-mapv)
                                                          (update-orch-fn  up-mapv))))}))
-                         uniq-keys? (== (count curr-keys) (count (distinct curr-keys)))]
+                         uniq-keys? (or (empty? curr-keys) (apply distinct? curr-keys))]
                         (cond
                           (not valid-keys?) (js/alert "Empty attribute keys are not allowed!")
                           (not valid-vals?) (js/alert "Empty attribute values are not allowed!")


fix kibit complaints

fix kibit complaints

--- utils/src/com/sixsq/slipstream/util/response.clj
+++ utils/src/com/sixsq/slipstream/util/response.clj
@@ -11,11 +11,11 @@
    identifier and provides the Set-Cookie header with the given cookie, if
    the cookie value is not nil."
   [id & [[cookie-name cookie]]]
-  (cond-> {:status 201
+  (cond-> {:status  201
            :headers {"Location" id}
-           :body {:status 201
-                  :message (str id " created")
-                  :resource-id id}}
+           :body    {:status      201
+                     :message     (str id " created")
+                     :resource-id id}}
           cookie (assoc :cookies {cookie-name cookie})))

@@ -75,8 +75,7 @@

 (defn response-not-found
   [id]
-  (-> (str id " not found")
-      (map-response 404 id)))
+  (map-response (str id " not found") 404 id))

 (defn response-error
@@ -93,24 +92,21 @@
   "Provides an ExceptionInfo exception when the input is not valid. This is a
    400 status response. If the message is not provided, a generic one is used."
   [& [msg]]
-  (-> (or msg "invalid request")
-      (ex-response 400)))
+  (ex-response (or msg "invalid request") 400))

 (defn ex-not-found
   "Provides an ExceptionInfo exception when a resource is not found. This is a
    404 status response and the provided id should be the resource identifier."
   [id]
-  (-> (str id " not found")
-      (ex-response 404 id)))
+  (ex-response (str id " not found") 404 id))

 (defn ex-conflict
   "Provides an ExceptionInfo exception when there is a conflict. This is a 409
    status response and the provided id should be the resource identifier."
   [id]
-  (-> (str "conflict with " id)
-      (ex-response 409 id)))
+  (ex-response (str "conflict with " id) 409 id))

 (defn ex-unauthorized
@@ -129,8 +125,10 @@
    resource. This is a 405 status code. Information from the request is used to
    provide a reasonable message."
   [{:keys [uri request-method] :as request}]
-  (-> (str "invalid method (" (name (or request-method "UNKNOWN")) ") for " (or uri "UNKNOWN"))
-      (ex-response 405 uri)))
+  (let [msg (format "invalid method (%s) for %s"
+                    (name (or request-method "UNKNOWN"))
+                    (or uri "UNKNOWN"))]
+    (ex-response msg 405 uri)))

 (defn ex-bad-action
@@ -138,8 +136,11 @@
    used. This is a 404 status code. Information from the request and the action
    are used to provide a reasonable message."
   [{:keys [uri request-method] :as request} action]
-  (-> (str "undefined action (" (name (or request-method "UNKNOWN")) ", " action ") for " (or uri "UNKNOWN"))
-      (ex-response 404 uri)))
+  (let [msg (format "undefined action (%s, %s) for %s"
+                    (name (or request-method "UNKNOWN"))
+                    action
+                    (or uri "UNKNOWN"))]
+    (ex-response msg 404 uri)))

 (defn ex-bad-CIMI-filter


cljs.js wip

cljs.js wip

--- src/main/cljs/cljs/js.cljs
+++ src/main/cljs/cljs/js.cljs
@@ -52,7 +52,10 @@
   (let [rdr  (rt/string-push-back-reader source)
         eof  (js-obj)
         aenv (ana/empty-env)]
-    (env/with-compiler-env env
+    (binding [ana/*cljs-ns*    (:*cljs-ns* bound-vars)
+              *ns*             (:*ns* bound-vars)
+              r/*data-readers* (:*data-readers* bound-vars)
+              env/*compiler*   env]
       (loop []
         (let [form (r/read {:eof eof} rdr)]
           (if-not (identical? eof form)
@@ -76,7 +79,7 @@
        (if (seq deps)
          (let [dep (first deps)]
            (when-not (or (not-empty (get-in compiler [::namespaces dep :defs]))
-                       (contains? (:js-dependency-index compiler) (name dep)))
+                         (contains? (:js-dependency-index compiler) (name dep)))
              (*load-fn* name
                (fn [source]
                  (if-not (nil? source)


cljs.js wip

cljs.js wip

--- src/main/cljs/cljs/js.cljs
+++ src/main/cljs/cljs/js.cljs
@@ -13,7 +13,8 @@
             [cljs.compiler :as comp]
             [cljs.tools.reader :as r]
             [cljs.tools.reader.reader-types :as rt]
-            [cljs.tagged-literals :as tags]))
+            [cljs.tagged-literals :as tags])
+  (:import [goog.string StringBuffer]))

 (js/goog.require "cljs.core$macros")

@@ -42,7 +43,7 @@
 ;; -----------------------------------------------------------------------------
 ;; Analyze

-(declare compile*)
+(declare eval-str*)

 (def *loaded* (atom #{}))

@@ -51,7 +52,8 @@
    (when-not (contains? @*loaded* name)
      (*load-fn* name
        (fn [source]
-         (compile* bound-vars source opts (fn [ret] (cb true)))))))
+         (eval-str* bound-vars source opts
+           (fn [ret] (cb true)))))))
   ([bound-vars name reload opts cb]
    (when (= :reload reload)
      (swap! *loaded* disj name))
@@ -60,7 +62,8 @@
    (when-not (contains? @*loaded* name)
      (*load-fn* name
        (fn [source]
-         (compile* bound-vars source opts (fn [ret] (cb true))))))))
+         (eval-str* bound-vars source opts
+           (fn [ret] (cb true))))))))

 (declare ns-side-effects)

@@ -72,15 +75,16 @@
               ana/*cljs-ns*    (:*cljs-ns* bound-vars)
               *ns*             (:*ns* bound-vars)
               r/*data-readers* (:*data-readers* bound-vars)]
-      (loop []
-        (let [form (r/read {:eof eof} rdr)]
-          (if-not (identical? eof form)
-            (let [aenv (assoc aenv :ns (ana/get-namespace ana/*cljs-ns*))
-                  ast  (ana/analyze aenv form)]
-              (if (= (:op ast) :ns)
-                (ns-side-effects bound-vars aenv ast opts (fn [_] (cb)))
-                (recur)))
-            (cb)))))))
+      ((fn analyze-loop []
+         (let [form (r/read {:eof eof} rdr)]
+           (if-not (identical? eof form)
+             (let [aenv (assoc aenv :ns (ana/get-namespace ana/*cljs-ns*))
+                   ast  (ana/analyze aenv form)]
+               (if (= :ns (:op ast))
+                 (ns-side-effects bound-vars aenv ast opts
+                   (fn [_] (analyze-loop)))
+                 (recur)))
+             (cb))))))))

 (defn analyze-deps
   "Given a lib, a namespace, deps, its dependencies, env, an analysis environment
@@ -200,12 +204,25 @@
 ;; Compile

 (defn compile* [bound-vars source opts cb]
-  (binding [env/*compiler    (:*compiler* bound-vars)
-            *eval-fn*        (:*eval-fn* bound-vars)
-            ana/*cljs-ns*    (:*cljs-ns* bound-vars)
-            *ns*             (:*ns* bound-vars)
-            r/*data-readers* (:*data-readers* bound-vars)]
-    ))
+  (let [rdr  (rt/string-push-back-reader source)
+        eof  (js-obj)
+        aenv (ana/empty-env)
+        sb   (StringBuffer.)]
+    ((fn compile-loop []
+       (binding [env/*compiler*   (:*compiler* bound-vars)
+                 *eval-fn*        (:*eval-fn* bound-vars)
+                 ana/*cljs-ns*    (:*cljs-ns* bound-vars)
+                 *ns*             (:*ns* bound-vars)
+                 r/*data-readers* (:*data-readers* bound-vars)]
+         (let [form (r/read {:eof eof} rdr)]
+           (if-not (identical? eof form)
+             (let [aenv (assoc aenv :ns (ana/get-namespace ana/*cljs-ns*))
+                   ast  (.append sb (comp/emit (ana/analyze aenv form)))]
+               (if (= :ns (:op ast))
+                 (ns-side-effects bound-vars aenv ast opts
+                   (fn [_] (compile-loop)))
+                 (recur)))
+             (cb (.toString cb)))))))))

 (defn compile
   ([env source cb] (compile env source cb))
@@ -216,4 +233,39 @@
        :*ns*           (create-ns 'cljs.user)
        :*data-readers* tags/*cljs-data-readers*
        :*eval-fn*      (or (:js-eval opts) js/eval)}`
-      source opts cb)))+      source opts cb)))
+
+;; -----------------------------------------------------------------------------
+;; Evaluate String
+
+(defn eval-str* [bound-vars source opts cb]
+  (let [rdr  (rt/string-push-back-reader source)
+        eof  (js-obj)
+        aenv (ana/empty-env)
+        sb   (StringBuffer.)]
+    ((fn compile-loop []
+       (binding [env/*compiler*   (:*compiler* bound-vars)
+                 *eval-fn*        (:*eval-fn* bound-vars)
+                 ana/*cljs-ns*    (:*cljs-ns* bound-vars)
+                 *ns*             (:*ns* bound-vars)
+                 r/*data-readers* (:*data-readers* bound-vars)]
+         (let [form (r/read {:eof eof} rdr)]
+           (if-not (identical? eof form)
+             (let [aenv (assoc aenv :ns (ana/get-namespace ana/*cljs-ns*))
+                   ast  (.append sb (comp/emit (ana/analyze aenv form)))]
+               (if (= :ns (:op ast))
+                 (ns-side-effects bound-vars aenv ast opts
+                   (fn [_] (compile-loop)))
+                 (recur)))
+             (cb (.toString cb)))))))))
+
+(defn eval-str
+  ([env source cb] (eval-str env source cb))
+  ([env source opts cb]
+   (eval-str*
+     {:*compiler*     env
+      :*cljs-ns*      'cljs.user
+      :*ns*           (create-ns 'cljs.user)
+      :*data-readers* tags/*cljs-data-readers*
+      :*eval-fn*      (or (:js-eval opts) js/eval)}`
+       source opts cb)))


fixes the failing tests after sandbox refactoring (#1366)

--- scheduler/test/cook/test/rest/api.clj
+++ scheduler/test/cook/test/rest/api.clj
@@ -97,9 +97,8 @@
                                      :task-constraints {:cpus cpus :memory-gb memory-gb :retry-limit retry-limit}}
                                     (Object.)
                                     (atom true))]
-      (with-redefs [api/retrieve-url-path
-                    (fn [hostname task-id _]
-                      (str "http://" hostname "/" task-id))
+      (with-redefs [api/retrieve-sandbox-url-path (fn [{:keys [instance/hostname instance/task-id]}]
+                                                    (str "http://" hostname "/" task-id))
                     rate-limit/job-submission-rate-limiter rate-limit/AllowAllRateLimiter]
         (handler request)))))

@@ -1490,19 +1489,30 @@
                       "reasons" [{"reason" "The job is now under investigation. Check back in a minute for more details!"
                                   "data" {}}]}]))))

-(deftest test-retrieve-url-path
+(deftest test-retrieve-sandbox-url-path
   (let [agent-hostname "www.mesos-agent-com"]
-    (testing "retrieve-url-path"
-      (is (nil? (api/retrieve-url-path agent-hostname "task-100" nil)))
-      (is (= (str "http://" agent-hostname ":5051/files/read.json?path=%2Fsandbox%2Flocation")
-             (api/retrieve-url-path agent-hostname "task-100" "/sandbox/location")))
-      (is (= (str "http://" agent-hostname ":5051/files/read.json?path=%2Fsandbox%2Flocation")
-             (api/retrieve-url-path agent-hostname "task-101" "/sandbox/location")))
-      (is (nil? (api/retrieve-url-path agent-hostname "task-103" nil))))))
+    (with-redefs [cc/retrieve-sandbox-url-path (fn [_ {:keys [instance/hostname instance/sandbox-directory instance/task-id]}]
+                                                 (when (and hostname sandbox-directory)
+                                                   (str "http://" hostname ":5051" "/" task-id "/files/read.json?path=" sandbox-directory)))]
+      (testing "retrieve-sandbox-url-path"
+        (is (nil? (api/retrieve-sandbox-url-path {:instance/hostname agent-hostname
+                                                  :instance/sandbox-directory nil
+                                                  :instance/task-id "task-100"})))
+        (is (= (str "http://" agent-hostname ":5051/task-101/files/read.json?path=/sandbox/location")
+               (api/retrieve-sandbox-url-path {:instance/hostname agent-hostname
+                                               :instance/sandbox-directory "/sandbox/location"
+                                               :instance/task-id "task-101"})))
+        (is (= (str "http://" agent-hostname ":5051/task-102/files/read.json?path=/sandbox/location")
+               (api/retrieve-sandbox-url-path {:instance/hostname agent-hostname
+                                               :instance/sandbox-directory "/sandbox/location"
+                                               :instance/task-id "task-102"})))
+        (is (nil? (api/retrieve-sandbox-url-path {:instance/hostname agent-hostname
+                                                  :instance/sandbox-directory nil
+                                                  :instance/task-id "task-103"})))))))

 (deftest test-instance-progress
-  (with-redefs [api/retrieve-url-path
-                (fn retrieve-url-path [hostname task-id _]
+  (with-redefs [api/retrieve-sandbox-url-path
+                (fn retrieve-sandbox-url-path [{:keys [instance/hostname instance/task-id]}]
                   (str "http://" hostname "/" task-id))]
     (let [uri "datomic:mem://test-instance-progress"
           conn (restore-fresh-database! uri)


add test for dependency vectors with ':exclusions' key.

--- test/leiningen/ancient/artifact/files_test.clj
+++ test/leiningen/ancient/artifact/files_test.clj
@@ -69,7 +69,23 @@
                 (spit (str contents "\n\n;; EOF"))
                 (.setLastModified (+ (System/currentTimeMillis) 5000)))
               (write-string! upgraded) =not=> empty?
-              (write-out! upgraded) => #(instance? Throwable %)))))
+             (write-out! upgraded) => #(instance? Throwable %)))))
+
+(fact "about project file upgrading with :exclusions."
+      (let [opts (const-opts "0.1.1")
+            mk #(format
+                  (str "(defproject project-x \"0.1.1-SNAPSHOT\"\n"
+                       "  :dependencies [[artifact %s :exclusions [other]]])")
+                  (pr-str %))]
+        (with-temp-file [tmp (mk "0.1.0")]
+          (let [f (read! (project-file tmp))
+                outdated (check! f opts)
+                artifacts (map (juxt (comp :symbol :artifact) :path) outdated)
+                upgraded (upgrade! f outdated)
+                expected (mk "0.1.1")]
+            (count outdated) => 1
+            artifacts => (contains #{'[artifact  [:dependencies 0]]})
+            (write-string! upgraded) => expected))))

 (fact "about project file upgrading with multiple identical artifacts."
       (let [opts (const-opts "0.1.1")


added *server-instance* and (stop) and (restart) to repl's convenience fns

--- src/app/clj/one/sample/repl.clj
+++ src/app/clj/one/sample/repl.clj
@@ -7,17 +7,24 @@
             [one.sample.dev-server :as dev]
             [clojure.java.browse :as browse]))

+(def *server-instance* (atom nil))
+
+(defn- run-server []
+  (if (nil? @*server-instance*)
+    (reset! *server-instance* (dev/run-server))
+    (println "Server is already instantiated. Try (restart)")))
+
 (defn go
   "Start a browser-connected REPL and launch a browser to talk to it."
   []
-  (dev/run-server)
+  (run-server)
   (tools/cljs-repl))

 (defn dev-server
   "Start the development server and open the host application in the
   default browser."
   []
-  (dev/run-server))
+  (run-server))

 ;; This is a convenience function so that people can start a CLJS REPL
 ;; without having to type in (tools/cljs-repl)
@@ -26,7 +33,19 @@
   []
   (tools/cljs-repl))

+;; These are convenience functions for stopping and restarting
+(defn stop []
+  (if (not (nil? @*server-instance*))
+    (.stop @*server-instance*)))
+
+(defn restart []
+  (if (not (nil? @*server-instance*))
+    (do
+      (stop)
+      (.start @*server-instance*))))
+
 (println)
 (println "Type (go) to launch the development server and setup a browser-connected REPL.")
 (println "Type (dev-server) to launch only the development server.")
 (println)
+(println "Type (stop) or (restart) to stop or restart the server.")


Made the servlet implementation more robust.

--- src/appengine_magic/servlet.clj
+++ src/appengine_magic/servlet.clj
@@ -78,7 +78,7 @@
    ;; just a string
    (string? body)
    (with-open [writer (.getWriter response)]
-     (.println writer body))
+     (.print writer body))
    ;; any Clojure seq
    (seq? body)
    (with-open [writer (.getWriter response)]
@@ -87,11 +87,10 @@
        (.flush writer)))
    ;; a Java InputStream
    (instance? InputStream body)
-   (let [^InputStream b body]
-     (with-open [out (.getOutputStream response)]
-       (copy-stream b out)
-       (.close b)
-       (.flush out)))
+   (with-open [out (.getOutputStream response)
+               ^InputStream b body]
+     (copy-stream b out)
+     (.flush out))
    ;; serve up a File
    (instance? File body)
    (let [^File f body]


Removed TODOs.

Removed TODOs.

--- umm-spec-lib/src/cmr/umm_spec/umm_to_xml_mappings/iso19115_2.clj
+++ umm-spec-lib/src/cmr/umm_spec/umm_to_xml_mappings/iso19115_2.clj
@@ -117,7 +117,7 @@
   [instruments]
   (for [instrument instruments]
     [:gmi:instrument
-     [:eos:EOS_Instrument ;; TODO {:id unique-id}
+     [:eos:EOS_Instrument
       [:gmi:citation
        [:gmd:CI_Citation
         [:gmd:title


whitespace

whitespace

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -781,5 +781,3 @@
        :rule-map (zipmap rules grammar)})))

 (log/info "Italiano grammars defined (small, medium).")
-
-


disable "a" [:cat :prep]

disable "a" [:cat :prep]

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -46,16 +46,17 @@
                            :sem {:city true}}}}}

     ;; e.g. "a ridere": tu hai fatto bene a ridere (you did well to laugh)"
-    (let [complement-semantics (atom {:pred :a
-                                      :mod {:pred :a}})]
-      {:synsem {:cat :prep
-                :sem complement-semantics
-                :subcat {:1 {:cat :verb
-                             :sem complement-semantics
-                                :subcat {:1 :top
-                                         :2 '()}}
-                         :2 '()}}})]
-
+;    (let [complement-semantics (atom {:pred :a
+;                                      :mod {:pred :a}})]
+;      {:synsem {:cat :prep
+;                :sem complement-semantics
+;                :subcat {:1 {:cat :verb
+;                             :sem complement-semantics
+;                                :subcat {:1 :top
+;                                         :2 '()}}
+;                         :2 '()}}})
+    ]
+
    "abbandonare" {:synsem {:cat :verb
                            :sem {:pred :abandon}}}


Function to read all groups for given chatpter ID

--- src/hurvinek/server.clj
+++ src/hurvinek/server.clj
@@ -290,6 +290,15 @@
           product-id   (get params "product-id")
           chapters     (db-interface/read-chapters product-id)
           json-output  (data->json chapters)]
+        (-> (http-response/response json-output)
+            (http-response/content-type "application/json"))))
+
+(defn process-list-of-groups
+    [request]
+    (let [params       (:params request)
+          chapter-id   (get params "chapter-id")
+          groups       (db-interface/read-groups chapter-id)
+          json-output  (data->json groups)]
         (-> (http-response/response json-output)
             (http-response/content-type "application/json"))))

@@ -343,6 +352,7 @@
             "/rename-component"           (process-rename-component     request title)
             "/api/products"               (process-list-of-products     request)
             "/api/chapters"               (process-list-of-chapters     request)
+            "/api/groups"                 (process-list-of-groups       request)
             "/api/components"             (process-list-of-components   request)
             )))


rename `radians-to-degrees` to `radians->degrees` to be more idiomatic.

--- src/metabase/api/tiles.clj
+++ src/metabase/api/tiles.clj
@@ -12,7 +12,7 @@
 (def pixel-per-lon-degree (float (/ tile-size 360.0)))
 (def pixel-per-lon-radian (float (/ tile-size (* 2 (java.lang.Math/PI)))))

-(defn- radians-to-degrees [rad]
+(defn- radians->degrees [rad]
   (float (/ rad (float (/ (java.lang.Math/PI) 180)))))

 (defn- tile-lat-lon
@@ -23,7 +23,7 @@
         corner-y (float (/ (* y tile-size) num-tiles))
         lon (float (/ (- corner-x pixel-origin) pixel-per-lon-degree))
         lat-radians (/ (- corner-y pixel-origin) (* pixel-per-lon-radian -1))
-        lat (radians-to-degrees (- (* 2 (java.lang.Math/atan (java.lang.Math/exp lat-radians)))
+        lat (radians->degrees (- (* 2 (java.lang.Math/atan (java.lang.Math/exp lat-radians)))
                                    (/ (java.lang.Math/PI) 2)))]
     {:lat lat
      :lon lon}))


chore(cmdline): improved error handling

chore(cmdline): improved error handling

--- src/main/clojure/pdok/featured/core.clj
+++ src/main/clojure/pdok/featured/core.clj
@@ -32,13 +32,20 @@
   (log/info "done")
   )

+(defn exit [status msg]
+  (println msg)
+  (System/exit status))
+
 (defn -main [& args]
 ;  (println "ENV-test" (config/env :pdok-test))
-  (let [parameters (parse-opts args cli-options)]
-    (execute (:options parameters))))
+  (let [{:keys [options arguments summary options]} (parse-opts args cli-options)]
+    (cond
+      (:help options) (exit 0 summary)
+      (not (:json-file options)) (exit 0 "json-file required")
+      :else (execute options))))

 (def cli-options
-  [["-f" "--json-file FILE" "JSON-file with features"]
+  [["-f" "--json-file FILE" "required JSON-file with features"]
    ["-d" "--dataset-name DATASET" "dataset"]
    [nil "--no-projectors"]
    [nil "--no-timeline"]


Make some helper functions for scraping

Make some helper functions for scraping

--- src/clj/comic_reader/server.clj
+++ src/clj/comic_reader/server.clj
@@ -29,15 +29,31 @@
     (edn-response comic-list)
     (edn-response (gen-error-data request) 404)))

+(defn get-comic-chapter [site comic chapter]
+  (first
+   (drop (dec chapter)
+         (sort-by :url
+                  (scrape/fetch-list
+                   (sites/chapter-list-data site
+                                            comic))))))
+
+(defn get-following-pages [site comic chapter-map page]
+  (drop (dec page)
+        (scrape/fetch-list
+         (sites/page-list-data site
+                               (:url chapter-map)))))
+
 (defn get-comic-imgs [{{:keys [site comic chapter page]} :params
                        :as request}]
   (println (:uri request))
-  (let [chapter-list (sort-by :url
-                      (scrape/fetch-list
-                       (sites/chapter-list-data site comic)))]
-   (if-let [comic-urls nil]
-     (edn-response)
-     (edn-response (gen-error-data request) 404))))
+  (let [chapter-map (get-comic-chapter site comic
+                                       (int chapter))
+        page-list (get-following-pages site comic
+                                       chapter-map
+                                       (int page))]
+    (if-let [comic-urls nil]
+      (edn-response)
+      (edn-response (gen-error-data request) 404))))

 (c/defroutes routes
   (c/GET "/" [] (hp/html5


more Surat City Grid fixes

more Surat City Grid fixes

fix #1445: don't allow targeting an agenda; don't fire SCG at all when only facedown agendas remain

--- src/clj/game/cards-upgrades.clj
+++ src/clj/game/cards-upgrades.clj
@@ -354,12 +354,14 @@
    {:events
     {:rez {:req (req (and (= (card->server state target) (card->server state card))
                           (not= (:cid target) (:cid card))
-                          (seq (filter #(not (rezzed? %)) (all-installed state :corp)))))
+                          (seq (filter #(and (not (rezzed? %))
+                                             (not (is-type? % "Agenda"))) (all-installed state :corp)))))
            :effect (effect (resolve-ability
                              {:optional
                               {:prompt (msg "Rez another card with Surat City Grid?")
                                :yes-ability {:prompt "Choose a card to rez"
-                                             :choices {:req #(not (rezzed? %))}
+                                             :choices {:req #(and (not (rezzed? %))
+                                                                  (not (is-type? % "Agenda")))}
                                              :msg (msg "rez " (:title target) ", lowering the rez cost by 2 [Credits]")
                                              :effect (effect (rez-cost-bonus -2)
                                                              (rez target))}}}


add case 404

add case 404

--- src/clj/salava/badge/verify.clj
+++ src/clj/salava/badge/verify.clj
@@ -68,8 +68,11 @@
     (if (url? asr)
       (let [asr-response (assertion asr)]
         (case (:status asr-response)
+          404 (assoc result :assertion-status 404
+                            :asr asr)
           410 (do
                 (update-revoked! {:revoked 1 :id (:id badge)} (get-db ctx))
+                (update-visibility! {:visibility "private" :id (:id badge)} (get-db ctx))
                 (assoc result :assertion-status 410
                               :asr asr
                               :revoked? true))


Remove more cruft

Remove more cruft

--- src/cljs/cljs_webrepl/core.cljs
+++ src/cljs/cljs_webrepl/core.cljs
@@ -119,16 +119,6 @@
    {:display-name        "scroll-on-update"
     :component-did-mount scroll
     :reagent-render      (fn [child] child)}))
-
-;; (defn highlight [node]
-;;   (let [node (r/dom-node node)]
-;;     (highlight/highlightBlock node)))
-
-;; (defn highlight-clojure [value]
-;;   (r/create-class
-;;    :display-name "highlight"
-;;    :component-did-mount highlight
-;;    :reagent-render (fn [value] [:code.clojure value])))

 (defn pprint-output
   [value]
@@ -173,11 +163,9 @@
         [:code [:pre output]]]
        [:hr.border]])
     [:div.card-data.result
-     (cond
-       (some? exception)
-       [:code exception]
-
-       :else
+     (if (some? exception)
+       [:code
+        [:pre exception]]
        [:code
         [:pre
          (syntaxify (with-out-str (pprint result)))]])]]])
@@ -246,9 +234,6 @@
       [history props]
       [input props]]]))

-;; -------------------------
-;; Initialize app
-
 (defn mount-root []
   (r/render [home-page] (.getElementById js/document "app")))


Remove logging

Remove logging

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -60,12 +60,10 @@
 (defn img-component [site
                      {:keys [comic]}
                      {:keys [chapter page tag]}]
-  (.log js/console "Make an img-component.")
   (let [waypoint (clojure.core/atom nil)]
     (reagent/create-class
      {:component-did-mount
       (fn [this]
-        (.log js/console "Did mount.")
         (let [wp (js/Waypoint.
                   #js {:element (reagent/dom-node this)
                        :offset "bottom-in-view"
@@ -78,7 +76,6 @@
           (reset! waypoint wp)))
       :reagent-render
       (fn [site location {:keys [tag]}]
-        (.log js/console "Render.")
         tag)})))

 (defn reader []


A little cleanup and fix problem with deleting columns

--- src/cljs/retroboard/client.cljs
+++ src/cljs/retroboard/client.cljs
@@ -304,13 +304,13 @@
     (if (not= (:column-id drag-data) drop-data)
       (a/move-note connection (:note drag-data) (:column-id drag-data) drop-data))))

-(defn draggable [{:keys [connection comp-fn state drag-data droppable-nodes] :as data} owner opts]
+(defn draggable [{:keys [drop-fn comp-fn state drag-data droppable-nodes] :as data} owner opts]
   (reify
     om/IInitState
     (init-state [_]
       {:hor-value 0
        :ver-value 0
-       :dragger (free-drag owner (partial perform-drop connection drag-data) droppable-nodes)})
+       :dragger (free-drag owner (partial drop-fn drag-data) droppable-nodes)})
     om/IWillMount
     (will-mount [_])
     om/IDidMount
@@ -334,7 +334,7 @@
                                  {}))}
                  (om/build comp-fn state {:opts opts}))))))

-(defn droppable [{:keys [droppable-nodes comp-fn state]} owner {:keys [drop-data] :as opts}]
+(defn droppable [{:keys [droppable-nodes comp-fn state drop-data]} owner {:keys [] :as opts}]
   (reify
     om/IDidMount
     (did-mount [_]
@@ -430,14 +430,14 @@
                  (om/build create-note-button {:connection connection
                                                :column-id id})
                  (apply dom/div #js {:className "notes"}
-                        (map (fn [note] (om/build draggable {:connection connection
-                                                            :comp-fn note-view
-                                                            :droppable-nodes (:droppable-nodes app)
+                        (map (fn [note] (om/build draggable {:comp-fn note-view
                                                             :state {:connection connection
                                                                     :column-id id
                                                                     :note note}
+                                                            :drop-fn (partial perform-drop connection)
+                                                            :droppable-nodes (:droppable-nodes app)
                                                             :drag-data [:note {:column-id id :note (first note)}]}
-                                                 {:key :drag-data}))
+                                                 {:react-key (first note)}))
                              (sort-by first (:notes column))))
                  (om/build delete-column-button {:connection connection
                                                  :column-id id}))))))
@@ -490,8 +490,9 @@
                                                        :droppable-nodes (:droppable-nodes app)
                                                        :state {:connection connection
                                                                :column col
-                                                               :droppable-nodes (:droppable-nodes app)}}
-                                                      {:opts {:drop-data [:column (first col)]}}))
+                                                               :droppable-nodes (:droppable-nodes app)}
+                                                       :drop-data [:column (first col)]}
+                                                      {:react-key (first col)}))
                                           (sort-by first columns)))))
                    (dom/div nil
                             (create-board-button "Empty Board")


Calculate the number of seconds between a given date and midnight

--- src/karmanaut/utils.clj
+++ src/karmanaut/utils.clj
@@ -29,6 +29,17 @@
       (.set Calendar/MILLISECOND 0))
     (.getTime c)))

+(defn seconds-since-epoch [dt]
+  "Number of seconds elapsed since the Unix epoch"
+  (quot (.getTime dt) 1000))
+
+(defn seconds-since-midnight [dt]
+  "Number of seconds elapsed since midnight"
+  (let [mn (midnight dt)
+        mnsec (seconds-since-epoch mn)
+        dtsec (seconds-since-epoch dt)]
+    (- dtsec mnsec)))
+
 (defn long-to-date
   "Reddit timestamps are the number of seconds since the
   Unix epoch, in UTC."


There's not currently any HTML to generate.

--- src/cmr/opendap/site/static.clj
+++ src/cmr/opendap/site/static.clj
@@ -50,8 +50,7 @@
   in this namespace. This is the function that should be called in the parent
   static generator namespace."
   [docs-source docs-dir base-url]
-  (log/debug "Generating static site files ...")
-  (generate-rest-api-docs docs-source docs-dir base-url))
+  (log/debug "Generating static site files ..."))

 (defn -main
   [& args]


adding conditional flags to zlib for linux / os x builds

--- config/software/zlib.clj
+++ config/software/zlib.clj
@@ -27,19 +27,19 @@
            {
             "LDFLAGS" "-Wl,-rpath /opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"
             "CFLAGS" "-I/opt/opscode/embedded/include -L/opt/opscode/embedded/lib"
-            }
-(software "zlib"
-          :source "zlib-1.2.5"
-          :steps [
-                  {
-                   :command "./configure"
-                   :env
-                   :args ["--prefix=/opt/opscode/embedded"]
-                   }
-                  { :command "make" }
-                  { :command "make" :args ["install"]}
-                  ])
+            })]
+  (software "zlib"
+            :source "zlib-1.2.5"
+            :steps [
+                    {
+                     :command "./configure"
+                     :env env
+                     :args ["--prefix=/opt/opscode/embedded"]
+                     }
+                    { :command "make" }
+                    { :command "make" :args ["install"]}
+                    ]))

-
+


add TODO about english imperfect

add TODO about english imperfect

--- src/babel/english/morphology.cljc
+++ src/babel/english/morphology.cljc
@@ -223,6 +223,10 @@
          stem (replace infinitive #"^to " "")]
      (str "will " stem))

+   ;; irregular imperfect
+   ;; TODO
+
+   ;; regular imperfect
    (and (= (get-in word '(:infl)) :imperfect)
         (get-in word '(:english)))
    (let [infinitive (get-in word '(:english))


Change expected directory naming convention for morningstar csv files

--- src/boefie_invest/morningstar.clj
+++ src/boefie_invest/morningstar.clj
@@ -127,7 +127,7 @@
                  parts (clojure.string/split filename #" ")
                  isin (first parts)
                  date-added (try
-                              (parse (formatter "yyyy_MM_dd") dirname)
+                              (parse (formatter "yyyy-MM-dd") dirname)
                               (catch Exception e))]
            :when (and (.endsWith filename ".csv")
                       (= 3 (count parts))


Fixed function definitions in buffered commands

--- src/multi_repl/core.clj
+++ src/multi_repl/core.clj
@@ -79,7 +79,7 @@
   (.flush (:out console))
   (some-> (:reader console)
           .readLine
-          clojure.string/trim))
+          clojure.string/trim-newline))

 (defn println-console [console & args]
   (binding [*out* (:out console)]


Converting timeout to 60 seconds

Converting timeout to 60 seconds

--- zambuko-back/src/zambuko_back/routes/queue.clj
+++ zambuko-back/src/zambuko_back/routes/queue.clj
@@ -6,7 +6,7 @@
   (:import [org.hornetq.api.core Message]))

 (defn handle-response [consumer]
-  (when-let [message (hq/receive-message consumer 5000)]
+  (when-let [message (hq/receive-message consumer 60000)]
     (if (.getBooleanProperty message "served")
       (let [response (edn/read-string (.getStringProperty message "edn-message"))
             body (java.io.ByteArrayInputStream. (.getBytesProperty message "body"))]


(TK-5) Update parse-config-data docstring

Update the docstring on parse-config-data. It now lists all the
proper file extensions that TK accepts for configuration data,
and explains what happens when no configuration data is specified.

--- src/puppetlabs/trapperkeeper/config.clj
+++ src/puppetlabs/trapperkeeper/config.clj
@@ -87,7 +87,8 @@
            (get-in-config [this ks default] (get-in config ks default))))

 (defn parse-config-data
-  "Parses the .ini configuration file(s) and returns a map of configuration data."
+  "Parses the .ini, .edn, .conf, .json, or .properties configuration file(s) and returns a map of configuration data.
+   If no configuration file is explicitly specified, will act as if it was given an empty configuration file."
   [cli-data]
   {:post [(map? %)]}
   (let [debug? (or (:debug cli-data) false)]


Removed obsolete code

Removed obsolete code

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/gui/base.clj
+++ src/conexp/contrib/gui/base.clj
@@ -7,10 +7,7 @@
 ;; You must not remove this notice, or any other, from this software.

 (ns conexp.contrib.gui.base
-  (:import [javax.swing JFrame JMenuBar JMenu JMenuItem JToolBar JPanel
-                        JButton JSeparator JTabbedPane JSplitPane
-                        JLabel JTextArea JScrollPane]
-           [java.awt GridLayout BorderLayout Dimension event.WindowEvent])
+  (:import [java.awt.event WindowEvent])
   (:use [conexp.base :only (defvar-, defvar, defnk, illegal-state, ns-doc)]
         conexp.contrib.gui.util
         conexp.contrib.gui.repl
@@ -21,17 +18,7 @@
         [conexp.contrib.gui.editors.code :only (code-editor)])
   (:use seesaw.core))

-
 (ns-doc "Provides basic definitions for the standard conexp-clj GUI.")
-
-;;; Menus
-
-(defvar- help-menu {:name "Help",
-                      :content [{:name "License"}
-                                ---
-                                {:name "About"}]}
-  "Help menu for conexp-clj standard GUI.")
-

 ;;; Conexp Main Frame

@@ -76,7 +63,6 @@

     main-frame))

-
 ;;;

 nil


Fixed bug when pasting to a permutated view such that the table has to be extended, the second++ rows now fill in correctly, too.

--- src/conexp/gui/editors/util.clj
+++ src/conexp/gui/editors/util.clj
@@ -200,6 +200,11 @@
    with the widget as first parameter and the given additional parameters"
   [map key & parameters]
   `(((~map :handler) ~key) ~map ~@parameters))
+
+(defmacro map!
+  "Just like map, but not lazy."
+  [f & colls]
+   `(seq (map ~f ~@colls)))

 ;;;
@@ -485,10 +490,12 @@
   Parameters:
     obj     _a table widget" [obj]
   (let [control (get-control obj)
-         sel-columns ((*comp (rho .getSelectedColumns) extract-array)
+         sel-columns ((*comp (rho .getSelectedColumns)  extract-array)
                        control)
          sel-rows ((*comp (rho .getSelectedRows) extract-array)
-                    control)]
+                    control)
+         col-index (!! obj :get-column-index-permutator)
+         row-index (!! obj :get-row-index-permutator)]
     (if (or (empty? sel-columns) (empty? sel-rows)) nil
       (let [data (str (get-clipboard-contents))
              startx (first sel-columns)
@@ -499,9 +506,9 @@
         (one-by-one lns (fn [r]
                           (one-by-one (range (count (cells r)))
                             (fn [c]
-                              (!! obj :set-value-at
-                                (+ starty r)
-                                (+ startx c)
+                              (!! obj :set-index-at
+                                (row-index (+ starty r))
+                                (col-index (+ startx c))
                                 ((cells r) c))))))))))

 (defn-swing-threads* table-to-clipboard!
@@ -654,6 +661,24 @@
   Returns the model row-index"
            [row] row)

+         :get-row-index-permutator
+         (fn-doc "Returns a function that will map the current view rows to
+   the according index values."
+           [] identity)
+
+         :get-column-index-permutator
+         (fn-swing-doc "Returns a function that will map the current view
+   columns to the according index values."
+           []
+           (let [ col-count (.getColumnCount table)
+                  col-range (range col-count)
+                  col-model (.getColumnModel table)
+                  col-map  (zipmap col-range (map (*comp
+                                                    (rho .getColumn col-model)
+                                                    (rho .getModelIndex))
+                                               col-range)) ]
+             (fn [i] (if (>= i col-count) i (col-map i)))))
+
          :get-column-index
          (fn-swing-doc "Returns the tables model index of the specified
    column in the view.
@@ -662,9 +687,11 @@
     column    _viewport column
   Returns the model index"
            [column]
-           (let [ col-model (.getColumnModel table)
-                  table-col (.getColumn col-model column)]
-             (.getModelIndex table-col)))
+           (let [ col-count (.getColumnCount table) ]
+             (if (>= column col-count) column
+               (let [ col-model (.getColumnModel table)
+                      table-col (.getColumn col-model column)]
+                 (.getModelIndex table-col)))))

          :get-index-column
          (fn-swing-doc "Returns the column in the view that corresponds
@@ -677,8 +704,9 @@
                   cols (range (.getColumnCount col-model))
                   matching (filter
                              (fn [x] (= index (.getModelIndex (.getColumn col-model x))))
-                             cols)]
-             (first matching)))
+                             cols)
+                  found  (first matching)]
+             (if found found index)))

          :get-index-row
          (fn-doc "Returns the row in the view that corresponds


Altered the new Table example slightly

Altered the new Table example slightly

--- devcards_src/bootstrap_cljs_devcards.cljs
+++ devcards_src/bootstrap_cljs_devcards.cljs
@@ -399,11 +399,12 @@
   (react-card
     (mkdn
       "## Tables"
-      "###  Set the `striped`, `bordered`, `condensed` or `hover` properties to true to"
-      "control the behavior of the table")
+      (str "###  Set the `striped`, `bordered`, `condensed` or `hover`"
+           " properties to true to control the behavior of the table"))
     (dom/br "")
     (bs/table {:bordered true
-               :striped true}
+               :striped true
+               :hover true}
               (dom/thead
                 (dom/tr
                   (dom/td "Header 1")


nesting values

nesting values

--- src/picsou/time/api.clj
+++ src/picsou/time/api.clj
@@ -47,7 +47,7 @@

       :quantity (select-keys token [:value :unit :product])

-	    value))) ; keep value as is for other dims
+	    {:value value}))) ; nest value for other dims

 (defn date->str
   "Coerce date to string for API output"


Add collapse parameter to allow for optional collapsing of load balanced systems.

--- src/greenyet/view/patchwork.clj
+++ src/greenyet/view/patchwork.clj
@@ -5,19 +5,23 @@
             [hiccup.core :refer [h html]]))

 (defn- collapse-all-green-hosts [hosts]
-  (let [sorted-hosts (sort-by (fn [[{index :index} _]] index) hosts)]
-    (if (every? (fn [[_ {color :color}]] (= :green color)) sorted-hosts)
-      (take 1 sorted-hosts)
-      sorted-hosts)))
+    (if (every? (fn [[_ {color :color}]] (= :green color)) hosts)
+      (take 1 hosts)
+      hosts))

-(defn- hosts-for-environment [host-list environment]
+(defn- hosts-for-environment [host-list environment collapse]
+  (let [collapse (if (= collapse true)
+                  (fn [[_ hosts]]
+                    (collapse-all-green-hosts hosts))
+                  (fn [[_ hosts]] hosts))
+        sort-hosts (fn [hosts] (sort-by (fn [[{index :index} _]] index) hosts))]
   (->> host-list
        (filter (fn [[{host-environment :environment} _]]
                  (= environment host-environment)))
        (group-by (fn [[{system :system} _]] system))
-       (mapcat (fn [[_ hosts]]
-                 (collapse-all-green-hosts hosts)))
-       (sort-by (fn [[{system :system} _]] system))))
+       sort-hosts
+       (mapcat collapse)
+       (sort-by (fn [[{system :system} _]] system)))))

 (defn- environments [host-status-pairs]
   (->> host-status-pairs
@@ -25,12 +29,12 @@
        (map :environment)
        distinct))

-(defn systems-by-environment [environment-names host-status-pairs]
+(defn systems-by-environment [environment-names host-status-pairs dont-collapse]
   (let [the-environments (utils/prefer-order-of environment-names
                                                 (environments host-status-pairs)
                                                 str/lower-case)]
     (zipmap the-environments
-            (map #(hosts-for-environment host-status-pairs %) the-environments))))
+            (map #(hosts-for-environment host-status-pairs % dont-collapse) the-environments))))

 (defn- patchwork-as-html [patchwork params]
@@ -59,6 +63,7 @@
                html))

 (defn render [host-status-pairs page-template environment-names params]
-  (let [patchwork (systems-by-environment environment-names host-status-pairs)]
+  (let [collapse  (= (get params "collapse") "true")
+        patchwork (systems-by-environment environment-names host-status-pairs collapse)]
     (in-template (patchwork-as-html patchwork params)
                  page-template)))


Add content-type handling to the middleware stack.

--- metlog-vault/src-server/metlog_vault/core.clj
+++ metlog-vault/src-server/metlog_vault/core.clj
@@ -1,11 +1,12 @@
 (ns metlog-vault.core
   (:gen-class :main true)
   (:use metlog-common.core
-        compojure.core)
+        compojure.core
+        [ring.middleware resource
+                         not-modified
+                         content-type])
   (:require [clojure.tools.logging :as log]
             [ring.adapter.jetty :as jetty]
-            [ring.middleware.resource :as ring-resource]
-            [ring.middleware.not-modified :as not-modified]
             [ring.util.response :as ring]
             [compojure.route :as route]
             [compojure.handler :as handler]
@@ -56,22 +57,22 @@
   (GET "/dashboard" [] (render-dashboard))
   (route/not-found "Resource Not Found"))

-                                        ; https://github.com/slester/browser-caching
-
 (defn wrap-request-logging [ app ]
   (fn [req]
     (log/trace 'REQ (:request-method req) (:uri req) (:params req))
     (let [begin-t (. System (nanoTime))
           resp (app req)]
-      (log/info 'RESP (:status resp) (:uri req) "-" (/ (- (. System (nanoTime)) begin-t) 1000000.0))
+      (log/info 'RESP (:status resp) (:uri req)
+                "-" (/ (- (. System (nanoTime)) begin-t) 1000000.0))
       resp)))

 (def handler (-> all-routes
                  (data/wrap-db-connection)
-                 (ring-resource/wrap-resource "public")
-                 (not-modified/wrap-not-modified)
-                 (wrap-request-logging)
-                 (handler/site)))
+                 (wrap-resource "public")
+                 (wrap-content-type)
+                 (wrap-not-modified)
+                 (handler/site)
+                 (wrap-request-logging)))

 (defn start-webserver [ http-port ]
   (log/info "Starting Vault Webserver on port" http-port)


all tests passing

all tests passing

--- src/clj/com/rpl/specter/impl.cljx
+++ src/clj/com/rpl/specter/impl.cljx
@@ -344,7 +344,6 @@
                 (exec-transform* curr structure
                   (fn [structure-next]
                     (exec-transform* next structure-next next-fn)))))))]
-
     (reduce combiner all)))

 (defn coerce-rich-navigator [nav]
@@ -1033,7 +1032,7 @@
         m (-> protpath-prot :sigs keys first)
         expected-params (num-needed-params protpath)]
     (doseq [[atype apath] extensions]
-      (let [p (comp-paths* apath)
+      (let [p (comp-paths-internalized apath)
             needed-params (num-needed-params p)
             rich-nav (extract-rich-nav p)
             ]


updated docs for common data model namespace

--- src/clj/forma/hadoop/jobs/cdm.clj
+++ src/clj/forma/hadoop/jobs/cdm.clj
@@ -1,7 +1,8 @@
 (ns forma.hadoop.jobs.cdm
-  "Functions and Cascalog queries for converting data into map tile coordinates."
+  "Functions and Cascalog queries for converting data into map tile
+coordinates."
   (:use [cascalog.api]
-        [cartodb.playground :only (insert-rows delete-all)]
+        [cartodb.playground :only (insert-rows delete-all big-insert)]
         [forma.source.gadmiso :only (gadm->iso)]
         [forma.gfw.cdm :only (latlon->tile, read-latlon, latlon-valid?)]
         [forma.utils :only (positions)])
@@ -16,12 +17,9 @@
   [(reduce min (map first tuples))])

 (defn first-hit
-  "Returns the index of the first value in a vector of numbers that is greater
-  than or equal to a threshold.
-
-  Arguments:
-    thresh - The threshold value.
-    series - A vector of numbers.
+  "Returns the index of the first value in a vector of numbers that is
+  greater than or equal to a threshold. `thresh` - The threshold
+  value.  `series` - A vector of numbers.

   Example usage:
     (first-hit 5 [1 2 3 4 5 6 7 8 9 10]) => 4"
@@ -29,12 +27,9 @@
   (first (positions (partial <= thresh) series)))

 (defn hansen->cdm
-  "Returns a Cascalog query that transforms Hansen data into map tile coordinates.
-
-  Arguments:
-    src - The source tap.
-    zoom - The map zoom level.
-    tres - The temporal resolution."
+  "Returns a Cascalog query that transforms Hansen data into map tile
+  coordinates. `src` - The source tap.  `zoom` - The map zoom level.
+  `tres` - The temporal resolution."
   [src zoom tres]
   (let [epoch (date/datetime->period tres "2000-01-01")
         hansen (date/datetime->period tres "2010-12-31")
@@ -47,16 +42,23 @@
         (latlon->tile ?lat ?lon zoom :> ?x ?y ?z))))

 (defn forma->cdm
-  "Returns a Cascalog query that transforms FORMA data into map tile coordinates.
+  "Returns a Cascalog generator that transforms FORMA data into map
+    tile coordinates.  `start` - Estimation start period date string.
+    `src` - The source tap for FORMA data.  `gadm-src` - a sequence
+    file source with mod-h, mod-v, sample, line, and gadm. `thresh` -
+    The threshold number for valid detections (0-100, integer).
+    `tres` - The input temporal resolution (string).  `tres-out` - The
+    output temporal resolution (string).  `zoom` - The map zoom
+    level (integer).

-  Arguments:
-    start - Start period date string.
-    src - The source tap for FORMA data.
-    gadm-src - a sequence file source with mod-h, mod-v, sample, line, and gadm
-    thresh - The threshold number for valid detections.
-    tres - The temporal resolution as a string.
-    tres-out - The output temporal resolution as a string.
-    zoom - The map zoom level."
+  Example usage:
+    (forma->cdm (hfs-seqfile \"/home/dan/Dropbox/local/output\")
+                (hfs-seqfile \"/tmp/forma/data/gadm-path\")
+                17
+                \"16\"
+                \"32\"
+                \"2005-12-31\"
+                50)"
   [src gadm-src zoom tres tres-out start thresh]
   (let [epoch (date/datetime->period tres-out "2000-01-01")
         start-period (date/datetime->period tres start)]


removed #_ for precondition on whizbang-general.

--- src/clj/forma/trends/analysis.clj
+++ src/clj/forma/trends/analysis.clj
@@ -98,7 +98,7 @@
   element is that associated with the time-trend. The try statement is
   meant to check whether the cofactor matrix is singular."
   [attributes t-series & cofactors]
-  #_{:pre [(not (empty? cofactors))]}
+  {:pre [(not (empty? cofactors))]}
   (let [y (deseasonalize (vec t-series))
         X (if (empty? cofactors)
             (i/matrix (t-range y))


Fixed players name in chat

Fixed players name in chat

--- src/clj/funstructor/processes.clj
+++ src/clj/funstructor/processes.clj
@@ -173,7 +173,7 @@
             (recur new-game-map (a/timeout turn-time-delay))))))))

-(defn game-chat-process [game-id p1-id p1-ch p2-id p2-ch]
+(defn game-chat-process [game-id p1-id p1-ch p1-name p2-id p2-ch p2-name]
   (u/log "Starting game chat process")
   (a/go-loop []
     (let [[value ch] (c/read-cmd-from-chs [p1-ch p2-ch]
@@ -186,7 +186,7 @@
           (do (c/write-cmd-to-chs
                [p1-ch p2-ch]
                {:type :chat-message-response
-                :data {:player-id p1-id
+                :data {:player-id p1-name
                        :message (get-in value [:data :message])
                        }}
                true)
@@ -196,7 +196,7 @@
           (do (c/write-cmd-to-chs
                [p1-ch p2-ch]
                {:type :chat-message-response
-                :data {:player-id p2-id
+                :data {:player-id p2-name
                        :message (get-in value [:data :message])}}
                true)
               (recur)))))))
@@ -256,5 +256,7 @@
       (game-chat-process game-uuid
                          player1-id
                          player1-chan
+                         player1-name
                          player2-id
-                         player2-chan))))
+                         player2-chan
+                         player2-name))))


implement Product Recall

implement Product Recall

--- src/clj/game/cards-operations.clj
+++ src/clj/game/cards-operations.clj
@@ -416,6 +416,14 @@
    "Predictive Algorithm"
    {:events {:pre-steal-cost {:effect (effect (steal-cost-bonus [:credit 2]))}}}

+   "Product Recall"
+   {:prompt "Choose a rezzed asset or upgrade to trash"
+    :choices {:req #(and (rezzed? %)
+                         (or (is-type? % "Asset") (is-type? % "Upgrade")))}
+    :msg (msg "trash " (card-str state target) " and gain " (:trash target) " [Credits]")
+    :effect (effect (trash target)
+                    (gain :credit (:trash target)))}
+
    "Psychographics"
    {:req (req tagged) :choices :credit :prompt "How many credits?"
     :effect (req (let [c (min target (:tag runner))]


Card back in opponent's hand

Card back in opponent's hand

--- src/cljs/netrunner/gameboard.cljs
+++ src/cljs/netrunner/gameboard.cljs
@@ -97,14 +97,17 @@
                                  :on-mouse-leave #(put! zoom-channel false)}
      [:img.card.bg {:src (image-url cursor) :onError #(-> % .-target js/$ .hide)}]])))

-(defn hand-view [{:keys [identity hand max-hand-size] :as cursor}]
-  (om/component
-   (sab/html
-    [:div.panel.blue-shade.hand {}
-     [:div.header
-      (str (if (= (:side identity) "Corp") "HQ" "Grip") " (" (count hand) ")")
-      [:span.float-right (str "Max hand size: " max-hand-size)]]
-     (om/build-all card-view hand)])))
+(defn hand-view [{:keys [identity hand max-hand-size user] :as cursor}]
+  (om/component
+   (sab/html
+    (let [side (:side identity)]
+      [:div.panel.blue-shade.hand
+       [:div.header
+        (str (if (= side "Corp") "HQ" "Grip") " (" (count hand) ")")
+        [:span.float-right (str "Max hand size: " max-hand-size)]]
+       (if (= user (:user @app-state))
+         (om/build-all card-view hand)
+         (repeat (count hand) [:img.card {:src (str "/img/" (.toLowerCase side) ".png")}]))]))))

 (defn handle-deck-click [side]
   (when (= side (:side @game-state))


Generalized phase-shift code and reduced code redundancy.

--- src/cmr/opendap/ous/util/geog.clj
+++ src/cmr/opendap/ous/util/geog.clj
@@ -22,7 +22,8 @@
   resolution is stored at indices from 0 to 359 and similar latitudinal data is
   stored at indices from 0 to 179. The max values for lat and lon are stored in
   the UMM-Var records as part of the dimensions. Sometimes those values are
-  pre-decremented for use in OPeNDAP, sometimes not. This function attempts to
+  pre-decremented for use in OPeNDAP, sometimes not (e.g., sometimes max
+  longitude is given as 359, sometimes as 360). This function attempts to
   ensure a consistent use of decremented max values for indices."
   ([max default-max]
    (offset-index max default-max const/default-lat-lon-resolution))
@@ -31,53 +32,65 @@
      max
      (dec max))))

+(defn phase-shift
+  "Longitude goes from -180 to 180 and latitude from -90 to 90. However, when
+  referencing data in OPeNDAP arrays, 0-based indices are needed. Thus in order
+  to get indices that match up with degrees, our longitude needs to be
+  phase-shifted by 180 degrees, latitude by 90 degrees."
+  [degrees-max default-abs-degrees-max default-degrees-max degrees adjust-fn round-fn]
+  (let [res (Math/ceil (/ degrees-max default-abs-degrees-max))]
+    (log/trace "Got degrees-max:" degrees-max)
+    (log/trace "Got degrees:" degrees)
+    (log/trace "Got resolution:" res)
+    (-> (/ (* (offset-index degrees-max default-abs-degrees-max res)
+              (adjust-fn degrees res))
+           (adjust-fn default-degrees-max res))
+        round-fn
+        int)))
+
 (defn lon-lo-phase-shift
   [lon-max lon-lo]
-  (let [res (Math/ceil (/ lon-max const/default-lon-abs-hi))]
-    (log/debug "Got lon-max:" lon-max)
-    (log/debug "Got resolution:" res)
-    (-> (/ (* (offset-index lon-max const/default-lon-abs-hi res)
-              (adjusted-lon lon-lo res))
-           (adjusted-lon const/default-lon-hi res))
-        Math/floor
-        int)))
+  (phase-shift
+   lon-max
+   const/default-lon-abs-hi
+   const/default-lon-hi
+   lon-lo
+   adjusted-lon
+   #(Math/floor %)))

 (defn lon-hi-phase-shift
   [lon-max lon-hi]
-  (let [res (Math/ceil (/ lon-max const/default-lon-abs-hi))]
-    (log/debug "Got lon-max:" lon-max)
-    (log/debug "Got resolution:" res)
-    (-> (/ (* (offset-index lon-max const/default-lon-abs-hi res)
-              (adjusted-lon lon-hi res))
-           (adjusted-lon const/default-lon-hi res))
-        Math/ceil
-        int)))
+  (phase-shift
+   lon-max
+   const/default-lon-abs-hi
+   const/default-lon-hi
+   lon-hi
+   adjusted-lon
+   #(Math/ceil %)))

 (defn lat-lo-phase-shift
   "This is used for reading values from OPeNDAP where -90N is stored at the
   zero (first) index in the array."
   [lat-max lat-lo]
-  (let [res (Math/ceil (/ lat-max const/default-lat-abs-hi))]
-    (log/debug "Got lat-max:" lat-max)
-    (log/debug "Got resolution:" res)
-    (-> (/ (* (offset-index lat-max const/default-lat-abs-hi res)
-              (adjusted-lat lat-lo res))
-           (adjusted-lat const/default-lat-hi res))
-        Math/floor
-        int)))
+  (phase-shift
+   lat-max
+   const/default-lat-abs-hi
+   const/default-lat-hi
+   lat-lo
+   adjusted-lat
+   #(Math/floor %)))

 (defn lat-hi-phase-shift
   "This is used for reading values from OPeNDAP where -90N is stored at the
   zero (first) index in the array."
   [lat-max lat-hi]
-  (let [res (Math/ceil (/ lat-max const/default-lat-abs-hi))]
-    (log/debug "Got lat-max:" lat-max)
-    (log/debug "Got resolution:" res)
-    (-> (/ (* (offset-index lat-max const/default-lat-abs-hi res)
-              (adjusted-lat lat-hi res))
-           (adjusted-lat const/default-lat-hi res))
-        Math/ceil
-        int)))
+  (phase-shift
+   lat-max
+   const/default-lat-abs-hi
+   const/default-lat-hi
+   lat-hi
+   adjusted-lat
+   #(Math/ceil %)))

 (defn lat-lo-phase-shift-reversed
   "This is used for reading values from OPeNDAP where 90N is stored at the


adding edn responses

adding edn responses

--- src/com/narkisr/celestial/api.clj
+++ src/com/narkisr/celestial/api.clj
@@ -5,21 +5,25 @@
   (:require [compojure.handler :as handler]
             [compojure.route :as route]))

+(defn generate-response [data & [status]]
+  {:status (or status 200)
+   :headers {"Content-Type" "application/edn"}
+   :body (pr-str data)})
+
 (defroutes app-routes
   (context "/provision" []
-           (defroutes provision-routes
-             (POST "/" [provision]
-                   (debug "provisioning" provision)
-                   (puppetize provision)
-                   "Provision done"
-                   )))
+    (defroutes provision-routes
+       (POST "/" [provision]
+         (debug "provisioning" provision)
+         (puppetize provision)
+         (generate-response {:status "pupptization done"}))))
   (context "/system" []
-           (defroutes system-routes
-             (POST "/:hypervisor" [hypervisor system]
-                  (debug "setting up system" system "on" hypervisor)
-                  (reload system hypervisor)
-                   "System reloaded"
-                   )))
+     (defroutes system-routes
+       (POST "/:hypervisor" [hypervisor system]
+         (debug "setting up system" system "on" hypervisor)
+         (reload system hypervisor)
+         (generate-response {:status "system is up"}))))
+
   (route/not-found "Not Found"))

 (def app


User variables for all colors

User variables for all colors

--- src/braid/client/register/styles.cljs
+++ src/braid/client/register/styles.cljs
@@ -1,24 +1,34 @@
 (ns braid.client.register.styles)
-
-(def braid-color "#2bb8ba")

 (def small-spacing "0.5rem")
 (def border-radius "3px")

-(def invalid-color "#fd4734")
-(def valid-color "#2bb8ba")
+(def accent-color          "#2bb8ba")
+(def page-background-color "#f3f3f3")
+(def form-background-color "#ffffff")
+(def primary-text-color    "#222222")
+(def secondary-text-color  "#999999")
+(def field-border-color    "#e0e0e0")
+(def invalid-color         "#fd4734")
+(def valid-color           "#2bb8ba")
+(def disabled-input-color  "#f6f6f6")
+(def placeholder-color     "#eeeeee")
+(def disabled-button-color "#cccccc")

 (defn input-field-mixin []
   {:font-size "1.25rem"
    :font-family "Open Sans"
    :padding "0.4em"
-   :border "1px solid #ddd"
+   :border [["1px" "solid" field-border-color]]
    :line-height 1.5
    :border-radius border-radius})

 (defn app-styles []
   [:html
-   {:background "#f3f3f3"}
+   {:background page-background-color
+    :border [["1px" "solid" field-border-color]]
+    :border-bottom "none"
+    :border-top "none"}

    [:body
     {:min-height "100vh"
@@ -33,14 +43,15 @@
   [:form.register
    {:display "flex"
     :flex-direction "column"
-    :min-height "100vh"
+    :height "100vh"
+    :max-height "60em"
     :padding [["1.5rem" 0]]
     :box-sizing "border-box"
     :justify-content "space-around"}

    [:h1
     {:margin 0
-     :color braid-color
+     :color accent-color
      :font-weight "normal"
      :font-size "1.75em"
      :margin-bottom "0.75rem"}
@@ -62,10 +73,11 @@

     [:h2
      {:font-size "1em"
+      :color primary-text-color
       :margin [[0 0 small-spacing 0]]}]

     [:.explanation
-     {:color "#999"
+     {:color secondary-text-color
       :font-size "0.75em"
       :margin [[small-spacing 0 0 0]]}

@@ -88,11 +100,14 @@
       (input-field-mixin)

       [:&:focus
-       {:border-color braid-color
+       {:border-color accent-color
         :outline "none"}]]

      ["::-webkit-input-placeholder"
-      {:color "#eee"}]]
+      {:color placeholder-color}]
+
+     ["&&::-moz-placeholder"
+      {:color placeholder-color}]]

     [:&.invalid
      ["input[type=text]"
@@ -117,7 +132,7 @@
      [:.field::after
       (input-field-mixin)
       {:content "\"\u2026\""
-       :color "#CCC"
+       :color secondary-text-color
        :border "none"
        :display "inline-block"}]]

@@ -137,8 +152,8 @@
        {:border-left "none"
         :display "inline-block"
         :vertical-align "top"
-        :background "#f6f6f6"
-        :color "#999"
+        :background disabled-input-color
+        :color secondary-text-color
         :border-radius [[0 border-radius border-radius 0]]}

        [:&::after
@@ -150,7 +165,7 @@

      [:label
       {:margin [[small-spacing 0]]
-       :border "1px solid #eee"
+       :border [["1px" "solid" field-border-color]]
        :padding [["0.75rem" "1rem" "1.0rem"]]
        :border-radius border-radius
        :position "relative"
@@ -200,7 +215,7 @@
    [:button
     {:font-size "1.25em"
      :padding "1rem"
-     :background braid-color
+     :background accent-color
      :border "none"
      :color "white"
      :border-radius border-radius
@@ -212,7 +227,7 @@
      :cursor "pointer"}

     [:&.disabled
-     {:background "#ccc"
+     {:background disabled-button-color
       :cursor "not-allowed"}]

     [:&::after


Improve button styling

Improve button styling

--- src/braid/client/register/styles.cljs
+++ src/braid/client/register/styles.cljs
@@ -224,14 +224,15 @@
      :letter-spacing "0.05em"
      :display "inline-block"
      :transition "background 0.25s ease-in-out"
-     :cursor "pointer"}
+     :cursor "pointer"
+     :-webkit-font-smoothing "antialiased"}

     [:&.disabled
      {:background disabled-button-color
       :cursor "not-allowed"}]

     [:&::after
-     {:content "\" ▶\""}]
+     {:content "\" ≫\""}]

     [:&:focus
      {:outline "none"}]]])


fix ws url

fix ws url

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -123,7 +123,14 @@
         issue-db (db/make-initial-db initial-issue-entities)
         ab-choices (ab/setup! state/ab-tests)
         use-talaria? (:use-talaria? utils/initial-query-map)
-        tal (when use-talaria? (tal/init (str "ws://localhost:8080/talaria?tab-id=" tab-id)))]
+        tal (when use-talaria? (tal/init (str (if (= "https" (.getScheme utils/parsed-uri))
+                                                "wss"
+                                                "ws")
+                                              "://"
+                                              (.getDomain utils/parsed-uri)
+                                              ":"
+                                              (.getPort utils/parsed-uri)
+                                              "/talaria?tab-id=" tab-id)))]
     (atom (-> (assoc initial-state
                      ;; id for the browser, used to filter transactions
                      :admin? admin?


adds link to article moderation table for admins

--- src-cljs/rmfu_ui/admin.cljs
+++ src-cljs/rmfu_ui/admin.cljs
@@ -5,7 +5,7 @@
             [ajax.core :refer [PUT GET DELETE]]
             [cljsjs.jquery]
             [cljsjs.fixed-data-table]
-            [rmfu-ui.utils :refer [index-of get-identity-token]]))
+            [rmfu-ui.utils :as utils]))

 (declare cell-and-checkbox)

@@ -27,14 +27,14 @@
   (PUT "/api/block-user"
        {:params        {:email email :blocked? state}
         :format        :json
-        :headers       {:identity (get-identity-token)}
+        :headers       {:identity (utils/get-identity-token)}
         :handler       (fn [res]
                          (alert-update-display-fn (str "User with email: " email " successfully " res)))
         :error-handler #(js/alert %)}))

 (defn fetch-all-users []
   (GET "/api/users"
-       {:headers         {:identity (get-identity-token)}
+       {:headers         {:identity (utils/get-identity-token)}
         :error-handler   #(secretary/dispatch! "/")
         :response-format :json
         :keywords?       true
@@ -42,7 +42,7 @@

 (defn fetch-all-articles []
   (GET "/api/articles"
-       {:headers         {:identity (get-identity-token)}
+       {:headers         {:identity (utils/get-identity-token)}
         :error-handler   #(secretary/dispatch! "/")
         :response-format :json
         :keywords?       true
@@ -50,7 +50,7 @@

 (defn delete-article [id]
   (DELETE (str "/api/articles/" id)
-          {:headers       {:identity (get-identity-token)}
+          {:headers       {:identity (utils/get-identity-token)}
            :error-handler #(alert-update-display-fn %)
            :handler       #(alert-update-display-fn %)}))

@@ -62,7 +62,7 @@
 (defn cell-and-checkbox [row]
   (let [users (sort-by first (:users @app-state))
         users-table (mapv #(into [] (vals %)) users)
-        index (index-of users-table row)
+        index (utils/index-of users-table row)
         user (get (:users @app-state) index)]
     [:div.checkbox
      [:label
@@ -108,7 +108,7 @@
      (for [article (:articles @app-state)
            :let [id (:_id article)]]
        ^{:key id} [:tr
-                   [:td id]
+                   [:td [:a {:href (str "/#/articles/#!" id)} id]]
                    [:td.text-overflow (:title article)]
                    [:td (:author article)]
                    [:td


Bump version again

Bump version again

--- src/circle/backend/project/circle.clj
+++ src/circle/backend/project/circle.clj
@@ -27,7 +27,7 @@
          :type :deploy
          :vcs-type :git
          :vcs-url "git@github.com:arohner/CircleCI.git"
-         :vcs-revision "8035034c10f3c6d5f98aa6a1c8cd233b58698a26"
+         :vcs-revision "0542337e29f07835b01c81fb3a69301205fb4411"
          :aws-credentials circle.aws-credentials/AWS-access-credentials
          :r53-zone-id "ZBVDNEPFXWZR2"
          :num-nodes 1


Pulled country-seq up and out.

Pulled country-seq up and out.

--- src/clj/forma/hadoop/jobs/scatter.clj
+++ src/clj/forma/hadoop/jobs/scatter.clj
@@ -125,7 +125,8 @@
 (defn bucket-forma
   "TODO: Get these country numbers turned into codes!"
   [unbucketed-path bucketed-path]
-  (let [template-fields ["?s-res" "?country" "?datestring"]
+  (let [keep-countries [[103] [158]]
+        template-fields ["?s-res" "?country" "?datestring"]
         data-fields     ["?mod-h" "?mod-v" "?sample" "?line" "?text"]
         forma-fields    (concat template-fields data-fields)
         src (hfs-seqfile unbucketed-path)]
@@ -136,7 +137,7 @@
                        :sinkparts 3)
          forma-fields
          (src :>> forma-fields)
-         ([[103] [158]] ?country :> true))))
+         (keep-countries ?country :> true))))

 (defmain RunForma
   [pail-path ts-pail-path results-path run-key & countries]


Change to private

Change to private

--- src/clj_chrome_devtools/cljs/test.clj
+++ src/clj_chrome_devtools/cljs/test.clj
@@ -44,7 +44,7 @@
    " (run-tests " (str/join "\n"
                             (map #(str "'" %) namespaces)) "))"))

-(defn with-test-runner-source [namespaces source-path fun]
+(defn- with-test-runner-source [namespaces source-path fun]
   ;; Create a test runner source file in the given source path
   ;; We have to put this in an existing source path as
   ;; we can't add a new source path dynamically (files therein


fixed bug in mi rule

fixed bug in mi rule

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/bio_to_ice/ontology_ice_gen_rules.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/bio_to_ice/ontology_ice_gen_rules.clj
@@ -75,7 +75,7 @@
   :head ((?/ice obo/IAO_0000219 ?/cls)) ; denotes
   :body ((?/cls oboInOwl:hasOBONamespace ["PSI-MI"])
          (?/cls rdf/type owl/Class))
-  :reify ([?/ice {:ln (:localname ?/subclass)
+  :reify ([?/ice {:ln (:localname ?/cls)
                   :ns "iaomi" :prefix "" :suffix "_ICE"}])}

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


removed old commented-out rule

removed old commented-out rule

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/id_typing/irefweb_id_typing_rules.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/id_typing/irefweb_id_typing_rules.clj
@@ -12,20 +12,3 @@

   :options {:magic-prefixes [["franzOption_clauseReorderer" "franz:identity"]]}
 }
-
-;;TODO replicate the above and create denotesSubClassOf for Complexes
-
-
-
-;; IREFWEB ids are of type kiao/ProteinIdentifier
-;; `{:name "irefweb-A-id-type-assertion"
-;;  :head ((?/ice kiao/denotesSubClassOf obo/CHEBI_36080)) ;protein
-;;  :body ((_/f kiao/hasTemplate iaoirefweb/irefwebirefwebInteractorID_ADataField1)
-;;         (_/f obo/IAO_0000219 ?/ice))}
-
-;; `{:name "irefweb-B-id-type-assertion"
-;;  :head ((?/ice kiao/denotesSubClassOf obo/CHEBI_36080)) ;protein
-;;  :body ((_/f kiao/hasTemplate iaoirefweb/irefwebirefwebInteractorID_BDataField1)
-;;         (_/f obo/IAO_0000219 ?/ice))}
-
-


Implement feature for going to edit mode directly when the user starts typing

--- src/reabledit/util.cljs
+++ src/reabledit/util.cljs
@@ -27,10 +27,14 @@
     (str (/ 100 cols) "%")))

 (defn enable-edit!
-  [column row-data state]
-  (if-not (:disable-edit column)
-    (swap! state assoc :edit {:initial row-data
-                              :updated row-data})))
+  ([column row-data state]
+   (enable-edit! column row-data state nil))
+  ([column row-data state input]
+   (when-not (:disable-edit column)
+     (swap! state assoc :edit {:initial row-data
+                               :updated (if input
+                                          (assoc row-data (:key column) input)
+                                          row-data)}))))

 ;; This function serves multiple purposes:
 ;; 1) Move selection to certain cell
@@ -114,29 +118,32 @@

       ;; Arrow keys in navigation mode change the selected cell
       ;; Enter and F2 in navigation mode enable editing mode
+      ;; Most keycodes take user to edit mode
       (nil? (:edit @state))
-      (do
+      (let [input (-> e .-nativeEvent .-key)]
         (.preventDefault e)
-        (case keycode
-          37 (move-to-cell! row-change-fn
-                            current-row
-                            (max 0 (dec current-col))
-                            state)
-          38 (move-to-cell! row-change-fn
-                            (max 0 (dec current-row))
-                            current-col
-                            state)
-          39 (move-to-cell! row-change-fn
-                            current-row
-                            (min max-col (inc current-col))
-                            state)
-          40 (move-to-cell! row-change-fn
-                            (min max-row (inc current-row))
-                            current-col
-                            state)
-          13 (enable-edit! column row-data state)
-          113 (enable-edit! column row-data state)
-          nil)))))
+        (if (and (= (count input) 1))
+          (enable-edit! column row-data state input)
+          (case keycode
+            37 (move-to-cell! row-change-fn
+                              current-row
+                              (max 0 (dec current-col))
+                              state)
+            38 (move-to-cell! row-change-fn
+                              (max 0 (dec current-row))
+                              current-col
+                              state)
+            39 (move-to-cell! row-change-fn
+                              current-row
+                              (min max-col (inc current-col))
+                              state)
+            40 (move-to-cell! row-change-fn
+                              (min max-row (inc current-row))
+                              current-col
+                              state)
+            13 (enable-edit! column row-data state)
+            113 (enable-edit! column row-data state)
+            nil))))))

 (defn move-cursor-to-end!
   [e]


Modification at all Grids

Modification at all Grids

--- src_cljs/rrm/corecljs.cljs
+++ src_cljs/rrm/corecljs.cljs
@@ -1696,6 +1696,8 @@
        [:table {:class "table table-bordered table-striped dataTable"}
         [:thead
          [:tr
+          (when (is-admin-or-super-admin)[:th " "])
+          (when (is-admin-or-super-admin)[:th " "])
           [:th "S.No"]
           [:th "Name of the Village"]
           [:th "Sub Division Name"]
@@ -1703,12 +1705,14 @@
           [:th "Year"]
           [:th "Rack Number"]
           [:th "Description"]
-          (when (is-admin-or-super-admin)[:th " "])
-          (when (is-admin-or-super-admin)[:th " "])
-          ]]
+         ]]
         [:tbody
          (doall (for [mt masavis]
                   ^{:key (.-id mt)} [:tr
+                                     (when (is-admin-or-super-admin)[:td [button {:bs-style "success"
+                                                                                :on-click  #(masavi-update(.-id mt))} "Update"]])
+                                     (when (is-admin-or-super-admin)[:td  [button {:bs-style "danger"
+                                                                                :on-click #(masavi-delete(.-id mt))} "Delete"]])
                                      [:td (.-serialnumber mt)]
                                      [:td (.-villagename mt)]
                                      [:td (.-subdivisionname mt)]
@@ -1716,11 +1720,7 @@
                                      [:td (.-year mt)]
                                      [:td (.-racknumber mt)]
                                      [:td (.-description mt)]
-                                     (when (is-admin-or-super-admin)[:td [:a {:href "javascript:;"
-                                                                              :on-click  #(masavi-update(.-id mt))
-                                                                              :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]])
-                                     (when (is-admin-or-super-admin)[:td  [:a {:href "javascript:;" :on-click #(masavi-delete(.-id mt))
-                                                                               :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}]])]))]]
+                                     ]))]]
        [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]]]])

@@ -1912,6 +1912,8 @@
        [:table {:class "table table-bordered table-striped dataTable"}
         [:thead
          [:tr
+          (when (is-admin-or-super-admin)[:th " "])
+          (when (is-admin-or-super-admin)[:th " "])
           [:th "S.No"]
           [:th "Name of the Village"]
           [:th "Sub Division Name"]
@@ -1919,12 +1921,15 @@
           [:th "Year"]
           [:th "Rack Number"]
           [:th "Description"]
-          (when (is-admin-or-super-admin)[:th " "])
-          (when (is-admin-or-super-admin)[:th " "])
+
           ]]
         [:tbody
          (doall (for [mt consolidations]
                   ^{:key (.-id mt)} [:tr
+                                     (when (is-admin-or-super-admin)[:td [button {:bs-style "success"
+                                                                                :on-click  #(consolidation-update(.-id mt))} "Update"]])
+                                     (when (is-admin-or-super-admin)[:td  [button {:bs-style "danger"
+                                                                                :on-click #(consolidation-delete(.-id mt))} "Delete"]])
                                      [:td (.-serialnumber mt)]
                                      [:td (.-villagename mt)]
                                      [:td (.-subdivisionname mt)]
@@ -1932,11 +1937,7 @@
                                      [:td (.-year mt)]
                                      [:td (.-racknumber mt)]
                                      [:td (.-description mt)]
-                                     (when (is-admin-or-super-admin)[:td [:a {:href "javascript:;"
-                                                                              :on-click  #(consolidation-update(.-id mt))
-                                                                              :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]])
-                                     (when (is-admin-or-super-admin)[:td  [:a {:href "javascript:;" :on-click #(consolidation-delete(.-id mt))
-                                                                               :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}]])]))]]
+                                  ]))]]
        [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]]]])

 (defroute consolidation-list "/consolidation" []
@@ -2108,7 +2109,6 @@

 (defn fieldbook-add [event]
   (secretary/dispatch! "/fieldbook/add"))
-
 (defn render-fieldbook [fieldbooks]
   [:div
    [:div {:class "box"}
@@ -2127,6 +2127,8 @@
        [:table {:class "table table-bordered table-striped dataTable"}
         [:thead
          [:tr
+          (when (is-admin-or-super-admin) [:th " "])
+          (when (is-admin-or-super-admin) [:th " "])
           [:th "S.No"]
           [:th "Name of the Village"]
           [:th "Sub Division Name"]
@@ -2134,12 +2136,14 @@
           [:th "Year"]
           [:th "Rack Number"]
           [:th "Description"]
-          (when (is-admin-or-super-admin) [:th " "])
-          (when (is-admin-or-super-admin) [:th " "])
           ]]
         [:tbody
          (doall(for [mt fieldbooks]
                  ^{:key (.-id mt)} [:tr
+                                    (when (is-admin-or-super-admin)[:td [button {:bs-style "success"
+                                                                             :on-click  #(fieldbook-update(.-id mt))} "Update"]])
+                                    (when (is-admin-or-super-admin)[:td  [button {:bs-style "danger"
+                                                                                :on-click #(fieldbook-delete(.-id mt))} "Delete"]])
                                     [:td (.-serialnumber mt)]
                                     [:td (.-villagename mt)]
                                     [:td (.-subdivisionname mt)]
@@ -2147,12 +2151,9 @@
                                     [:td (.-year mt)]
                                     [:td (.-racknumber mt)]
                                     [:td (.-description mt)]
-                                    (when (is-admin-or-super-admin)[:td [:a {:href "javascript:;"
-                                                                             :on-click  #(fieldbook-update(.-id mt))
-                                                                             :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]])
-                                    (when (is-admin-or-super-admin)[:td  [:a {:href "javascript:;" :on-click #(fieldbook-delete(.-id mt))
-                                                                              :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}]])]))]]
+                                   ]))]]
        [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]]]])
+

 (defroute fieldbook-list "/fieldbook" []
@@ -2320,31 +2321,29 @@
        [:table {:class "table table-bordered table-striped dataTable"}
         [:thead
          [:tr
+          [:th ""]
+          (when (is-admin-or-super-admin) [:th " "])
           [:th "Fille Number"]
           [:th "Subject"]
           [:th "Title"]
           [:th "Remarks"]
           [:th "Dispatched Date"]
           [:th "Received Date"]
-          [:th ""]
-          (when (is-admin-or-super-admin) [:th " "])
-          ]]
+           ]]
         [:tbody
          (doall (for [mt miscs]
                   ^{:key (.-id mt)} [:tr
+                                     [:td [button {:bs-style "success"
+                                               :on-click  #(misc-update(.-id mt))} "Update"]]
+                                     (when (is-admin-or-super-admin)[:td  [button {:bs-style "danger"
+                                                                                :on-click #(misc-delete(.-id mt))} "Delete"]])
                                      [:td (.-filenumber mt)]
                                      [:td (.-subject mt)]
                                      [:td (.-title mt)]
                                      [:td (.-remarks mt)]
                                      [:td (.-dispatcheddate mt)]
-                                     [:td (.-receiveddate mt)]
-                                     [:td [:a {:href "javascript:;"
-                                               :on-click  #(misc-update(.-id mt))
-                                               :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]]
-                                     (when (is-admin-or-super-admin)[:td  [:a {:href "javascript:;" :on-click #(misc-delete(.-id mt))
-                                                                               :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}]])]))]]
+                                     [:td (.-receiveddate mt)]]))]]
        [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]]]])
-

 (defroute misc-list "/misc" []
   (if (nil? (get-value! :user)) (set-page! [login])
@@ -2592,6 +2591,8 @@
        [:table {:class "table table-bordered table-striped dataTable"}
         [:thead
          [:tr
+          (when (is-admin-or-super-admin) [:th " "])
+          (when (is-admin-or-super-admin) [:th " "])
           [:th "S.No"]
           [:th "Sub Division Name"]
           [:th "Date of Institution"]
@@ -2603,12 +2604,14 @@
           [:th "Rack NUmber"]
           [:th "Starting Year"]
           [:th "Ending Year"]
-          (when (is-admin-or-super-admin) [:th " "])
-          (when (is-admin-or-super-admin) [:th " "])
-          ]]
+         ]]
         [:tbody
          (doall (for [mt o2registers]
                   ^{:key (.-id mt)} [:tr
+                                     (when (is-admin-or-super-admin)[:td [button {:bs-style "success"
+                                                                                :on-click  #(o2register-update(.-id mt))} "Update"]])
+                                     (when (is-admin-or-super-admin)[:td  [button {:bs-style "danger"
+                                                                                :on-click #(o2register-delete(.-id mt))} "Delete"]])
                                      [:td (.-serialnumber mt)]
                                      [:td (.-subdivisionname mt)]
                                      [:td (.-dateofinstitution mt)]
@@ -2620,11 +2623,7 @@
                                      [:td (.-racknumber mt)]
                                      [:td (.-startingyear mt)]
                                      [:td (.-endingyear mt)]
-                                     (when (is-admin-or-super-admin)[:td [:a {:href "javascript:;"
-                                                                              :on-click  #(o2register-update(.-id mt))
-                                                                              :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]])
-                                     (when (is-admin-or-super-admin)[:td  [:a {:href "javascript:;" :on-click #(o2register-delete(.-id mt))
-                                                                               :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}]])]))]]
+                ]))]]
        [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]]]])

 (defroute o2register-list "/o2register" []
@@ -2822,6 +2821,8 @@
        [:table {:class "table table-bordered table-striped dataTable"}
         [:thead
          [:tr
+          (when (is-admin-or-super-admin) [:th " "])
+          (when (is-admin-or-super-admin) [:th " "])
           [:th "Sub Division Name"]
           [:th "Khata Khatuni Number"]
           [:th "Number and Date of Order"]
@@ -2829,12 +2830,15 @@
           [:th "Area"]
           [:th "Revenue of Share of Plots Transfered"]
           [:th "Name and Description of the Persons Removed"]
-          (when (is-admin-or-super-admin) [:th " "])
-          (when (is-admin-or-super-admin) [:th " "])
+
           ]]
         [:tbody
          (doall (for [mt o4registers]
                   ^{:key (.-id mt)} [:tr
+                                     (when (is-admin-or-super-admin)[:td [button {:bs-style "success"
+                                                                                :on-click  #(o4register-update(.-id mt))} "Update"]])
+                                     (when (is-admin-or-super-admin)[:td  [button {:bs-style "danger"
+                                                                                :on-click #(o4register-delete(.-id mt))} "Delete"]])
                                      [:td (.-subdivisionname mt)]
                                      [:td (.-khatakhatuninumber mt)]
                                      [:td (.-numberanddateoforder mt)]
@@ -2842,12 +2846,10 @@
                                      [:td (.-area mt)]
                                      [:td (.-revenuerentofshareofplotstransferred mt)]
                                      [:td (.-nameanddescriptionofthepersonsremoved mt)]
-                                     (when (is-admin-or-super-admin)[:td [:a {:href "javascript:;"
-                                                                              :on-click  #(o4register-update(.-id mt))
-                                                                              :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]])
-                                     (when (is-admin-or-super-admin)[:td  [:a {:href "javascript:;" :on-click #(o4register-delete(.-id mt))
-                                                                               :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}]])]))]]
+                                      ]))]]
        [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]]]])
+
+

 (defroute o4register-list "/o4register" []
@@ -3060,30 +3062,32 @@
        [:table {:class "table table-bordered table-striped dataTable"}
         [:thead
          [:tr
+          (when (is-admin-or-super-admin) [:th " "])
+          (when (is-admin-or-super-admin) [:th " "])
           [:th "Sub Divison Name"]
           [:th "Year"]
           [:th  "Mehsil Number"]
           [:th "Date of Orederlevy"]
           [:th "Village Name"]
           [:th "name of Person Whom Recovery is Made"]
-          (when (is-admin-or-super-admin) [:th " "])
-          (when (is-admin-or-super-admin) [:th " "])
+
           ]]
         [:tbody
          (doall (for [mt o6registers]
                   ^{:key (.-id mt)} [:tr
+                                     (when (is-admin-or-super-admin)[:td [button {:bs-style "success"
+                                                                                :on-click  #(o6register-update(.-id mt))} "Update"]])
+                                     (when (is-admin-or-super-admin)[:td  [button {:bs-style "danger"
+                                                                                :on-click #(o6register-delete(.-id mt))}"Delete"]])
                                      [:td (.-subdivisionname mt)]
                                      [:td (.-year mt)]
                                      [:td (.-mehsilnumber mt)]
                                      [:td (.-dateoforderlevy mt)]
                                      [:td (.-villagename mt)]
                                      [:td (.-nameofpersonwhomrecoveryismade mt)]
-                                     (when (is-admin-or-super-admin)[:td [:a {:href "javascript:;"
-                                                                              :on-click  #(o6register-update(.-id mt))
-                                                                              :class "btn btn-success btn-sm glyphicon glyphicon-edit"}]])
-                                     (when (is-admin-or-super-admin)[:td  [:a {:href "javascript:;" :on-click #(o6register-delete(.-id mt))
-                                                                               :class "btn btn-danger btn-sm glyphicon glyphicon-remove"}]])]))]]
+                                      ]))]]
        [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]]]])
+


Fix docstring consistency issue

Fix docstring consistency issue

--- src/riemann/streams.clj
+++ src/riemann/streams.clj
@@ -1469,7 +1469,7 @@
 (defn runs
   "Usable to perform flap detection, runs examines a moving-event-window of
   n events and determines if :field is the same across all them. If it is,
-  runs passes on the *first* event of the window. In practice, this can be
+  runs passes on the last (newest) event of the window. In practice, this can be
   used nested within a (changed-state ...) to reduce 'flappiness' for
   state changes.


Correct stringifying error in message

Correct stringifying error in message

--- src/maestro/messages/alarms.clj
+++ src/maestro/messages/alarms.clj
@@ -1,5 +1,6 @@
 (ns maestro.messages.alarms
   (:require [amazonica.aws.cloudwatch :as cw]
+            [clojure.string :as str]
             [maestro
              [alarms :as alarms]
              [aws :as aws]
@@ -40,7 +41,7 @@
                                                              :alarm-name-prefix (str old-auto-scaling-group-name "-")))
               old-alarm-names (map :alarm-name old-alarms)]
           (when-not (zero? (count old-alarm-names))
-            (log/write (format "Deleting existing CloudWatch alarms %s" old-alarm-names))
+            (log/write (format "Deleting existing CloudWatch alarms [%s]" (str/join ", " old-alarm-names)))
             (cw/delete-alarms (aws/config environment region)
                               :alarm-names (vec old-alarm-names))))
         (success parameters)