redesign of stack info form

redesign of stack info form

--- src/cljs/swarmpit/component/stack/info.cljs
+++ src/cljs/swarmpit/component/stack/info.cljs
@@ -247,7 +247,7 @@
       {:className "Swarmpit-table-card-content"
        :key       "fccc"}
       (rum/with-key
-        (list/responsive
+        (list/list
           configs/render-metadata
           (sort-by :configName configs)
           configs/onclick-handler) "fcccrl"))))
@@ -264,7 +264,7 @@
       {:className "Swarmpit-table-card-content"
        :key       "fsecc"}
       (rum/with-key
-        (list/responsive
+        (list/list
           secrets/render-metadata
           (sort-by :secretName secrets)
           secrets/onclick-handler) "fseccrl"))))
@@ -297,43 +297,80 @@
           (comp/grid
             {:item true
              :key  "sgg"
-             :xs   12}
-            (rum/with-key
-              (form-general stack-name stackfile services) "sggfg"))
+             :xs   12
+             :md   4}
+            (comp/grid
+              {:container true
+               :spacing   40}
+              (comp/grid
+                {:item true
+                 :key  "ssgg"
+                 :xs   12}
+                (rum/with-key
+                  (form-general stack-name stackfile services) "sggfg"))
+              (comp/grid
+                {:item true
+                 :key  "sseg"
+                 :xs   12}
+                (rum/with-key
+                  (form-secrets stack-name secrets) "ssegfs"))
+              (comp/grid
+                {:item true
+                 :key  "scg"
+                 :xs   12}
+                (rum/with-key
+                  (form-configs stack-name configs) "scgfc"))))
           (comp/grid
             {:item true
              :key  "ssg"
-             :xs   12}
-            (rum/with-key
-              (form-services stack-name services) "ssgfs"))
-          (when (not-empty networks)
+             :xs   12
+             :md   8}
             (comp/grid
-              {:item true
-               :key  "sng"
-               :xs   12}
-              (rum/with-key
-                (form-networks stack-name networks) "sngfn")))
-          (when (not-empty secrets)
-            (comp/grid
-              {:item true
-               :key  "sseg"
-               :xs   12}
-              (rum/with-key
-                (form-secrets stack-name secrets) "ssegfs")))
-          (when (not-empty configs)
-            (comp/grid
-              {:item true
-               :key  "scg"
-               :xs   12}
-              (rum/with-key
-                (form-configs stack-name configs) "scgfc")))
-          (when (not-empty volumes)
-            (comp/grid
-              {:item true
-               :key  "svg"
-               :xs   12}
-              (rum/with-key
-                (form-volumes stack-name volumes) "svgfv"))))]])))
+              {:container true
+               :spacing   40}
+              (comp/grid
+                {:item true
+                 :key  "ssg"
+                 :xs   12}
+                (rum/with-key
+                  (form-services stack-name services) "ssgfs"))
+              (comp/grid
+                {:item true
+                 :key  "sng"
+                 :xs   12}
+                (rum/with-key
+                  (form-networks stack-name networks) "sngfn"))))
+
+          ;(when (not-empty networks)
+          ;  (comp/grid
+          ;    {:item true
+          ;     :key  "sng"
+          ;     :xs   12}
+          ;    (rum/with-key
+          ;      (form-networks stack-name networks) "sngfn")))
+          ;(when (not-empty secrets)
+          ;  (comp/grid
+          ;    {:item true
+          ;     :key  "sseg"
+          ;     :xs   12}
+          ;    (rum/with-key
+          ;      (form-secrets stack-name secrets) "ssegfs")))
+          ;(when (not-empty configs)
+          ;  (comp/grid
+          ;    {:item true
+          ;     :key  "scg"
+          ;     :xs   12}
+          ;    (rum/with-key
+          ;      (form-configs stack-name configs) "scgfc")))
+          ;(when (not-empty volumes)
+          ;  (comp/grid
+          ;    {:item true
+          ;     :key  "svg"
+          ;     :xs   12}
+          ;    (rum/with-key
+          ;      (form-volumes stack-name volumes) "svgfv")))
+
+          )]])))

 (rum/defc form < rum/reactive
                  mixin-init-form


(PDB-1268) Add validation for benchmark parameters

This adds validation that nummsgs or runinterval is used, and adds numhosts to
the list or required parameters.

--- src/puppetlabs/puppetdb/cli/benchmark.clj
+++ src/puppetlabs/puppetdb/cli/benchmark.clj
@@ -303,7 +303,7 @@
    ["-N" "--nummsgs NUMMSGS" "Number of commands and/or reports to send for each host"]])

 (def required-cli-options
-  [:config])
+  [:config :numhosts])

 (defn activate-logging!
   [options]
@@ -321,6 +321,11 @@
     (do
       (log/error
         "Error: -N/--nummsgs runs immediately and is not compatable with -i/--runinterval")
+      (action-on-error-fn))
+
+    (not-any? #{:nummsgs :runinterval} (keys options))
+    (do
+      (log/error "Error: Either -N/--nummsgs or -i/--runinterval is required.")
       (action-on-error-fn))

     (and (contains? options :archive)


Add compatibility with nREPL 0.4

Add compatibility with nREPL 0.4

Support with tools.nrepl is kept for now with the assumption
that tools.nrepl namespaces would be loaded automatically by
`lein repl` or `boot repl`.

--- src/com/billpiel/sayid/nrepl_middleware.clj
+++ src/com/billpiel/sayid/nrepl_middleware.clj
@@ -1,8 +1,5 @@
 (ns com.billpiel.sayid.nrepl-middleware
   (:require [clojure.stacktrace :as st]
-            [clojure.tools.nrepl.middleware :refer [set-descriptor!]]
-            [clojure.tools.nrepl.misc :refer [response-for]]
-            [clojure.tools.nrepl.transport :as t]
             [com.billpiel.sayid.core :as sd]
             [com.billpiel.sayid.query2 :as q]
             [com.billpiel.sayid.string-output2 :as so]
@@ -15,6 +12,18 @@
             [com.billpiel.sayid.util.find-ns :as find-ns]
             [tamarin.core :as tam]))

+;; Compatibility with the legacy tools.nrepl and the new nREPL 0.4.x.
+;; The assumption is that if someone is using old lein repl or boot repl
+;; they'll end up using the tools.nrepl, otherwise the modern one.
+(if (find-ns 'clojure.tools.nrepl)
+  (require
+   '[clojure.tools.nrepl.middleware :refer [set-descriptor!]]
+   '[clojure.tools.nrepl.misc :refer [response-for]]
+   '[clojure.tools.nrepl.transport :as t])
+  (require
+   '[nrepl.middleware :refer [set-descriptor!]]
+   '[nrepl.misc :refer [response-for]]
+   '[nrepl.transport :as t]))

 (def views (atom {}))
 (def selected-view (atom nil))
@@ -381,7 +390,7 @@
   [n [first-list & rest-lists]]
   (let [cfl (count first-list)]
     (cond (nil? first-list) nil
-
+
           (or (= n cfl)
               (and (-> first-list reverse rest first (= '&))
                    (>= n (dec cfl))))


Typos on go blocks and removes unused function from tests.

--- test/loudmoauth/core_test.clj
+++ test/loudmoauth/core_test.clj
@@ -78,12 +78,6 @@
   (drain! code-chan)
   (drain! interaction-chan))

-(defn put-values-on-channels
-  []
-  "Put a value on each channel."
-     (a/>!! code-chan (:code final-state-map))
-     )
-
 (defn reset
   "Reset the state of our app."
   [f]
@@ -114,7 +108,7 @@
 (deftest test-fetch-code
   (testing "Test issuing http get for auth-code from oauth provider."
    (reset-channels)
-   (a/go (a/>!! code-chan (:code final-state-map)))
+   (a/go (a/>! code-chan (:code final-state-map)))
    (with-redefs [clj-http.client/get (constantly (:token-response final-state-map))]
       (is (= final-state-map (fetch-code final-state-map))))))

@@ -122,7 +116,7 @@
   (testing "Pull response from http-requests for authorization and deliver to browser.
            In the first test we have something on the channel, in the second one the channel is empty."
     (reset-channels)
-    (a/go (a/>!! interaction-chan (:token-response final-state-map)))
+    (a/go (a/>! interaction-chan (:token-response final-state-map)))
     (Thread/sleep 1000)
     (is (= (:token-response final-state-map) (user-interaction {:status 200})))
     (is (= "No user interaction nescessary." (user-interaction {:status 200})))))
@@ -192,7 +186,7 @@
   (deftest test-request-access-to-data
     (testing "Build auth url and fetch code."
     (reset-channels)
-    (a/go (a/>!! code-chan (:code final-state-map)))
+    (a/go (a/>! code-chan (:code final-state-map)))
         (with-redefs [clj-http.client/get (constantly (:token-response final-state-map))]
        (is (= final-state-map) (update-in  (request-access-to-data (dissoc final-state-map :code)) [:token-response :request-time] (fn [x] 0))))))

@@ -200,7 +194,7 @@
   (testing "Test init function setting parameters and retrieving code and tokens."
     (reset! app-state middle-state-map)
     (reset-channels)
-    (a/go (a/>!! code-chan (:code final-state-map)))
+    (a/go (a/>! code-chan (:code final-state-map)))
     (with-redefs [clj-http.client/get (constantly (:token-response final-state-map)) clj-http.client/post  (constantly (:token-response final-state-map))]
       (is (= final-state-map (update-in (init) [:token-response :request-time] (fn [x] 0)))))))


Removed indexes that are duplicated by table constraints

--- src/com/puppetlabs/puppetdb/scf/migrate.clj
+++ src/com/puppetlabs/puppetdb/scf/migrate.clj
@@ -406,6 +406,13 @@
           ON reports.certname = latest.certname
           AND reports.end_time = latest.max_end_time"))

+(defn drop-duplicate-indexes
+  "Remove indexes that are duplicated by primary keys or other
+  constraints"
+  []
+  (sql/do-commands "DROP INDEX idx_catalogs_hash")
+  (sql/do-commands "DROP INDEX idx_certname_catalogs_certname"))
+
 ;; The available migrations, as a map from migration version to migration function.
 (def migrations
   {1 initialize-store
@@ -421,7 +428,8 @@
    11 increase-puppet-version-field-length
    12 burgundy-schema-changes
    13 add-latest-reports-table
-   14 add-parameter-cache})
+   14 add-parameter-cache
+   15 drop-duplicate-indexes})

 (def desired-schema-version (apply max (keys migrations)))


with no sleep now

with no sleep now

--- test/tabby/local_net_test.clj
+++ test/tabby/local_net_test.clj
@@ -45,13 +45,14 @@
     (if v @v v)))

 (defn wait-for-a-leader [c]
-  (loop [times 0]
-    (cond
-      (find-leader c) true
-      (> times 1000) false
-      :else (do
-              (Thread/sleep 10)
-              (recur (inc times))))))
+  (let [t0 (System/currentTimeMillis)]
+    (loop []
+      (cond
+        (find-leader c) true
+        (> (- (System/currentTimeMillis) t0) 30000) false
+        :else (do
+                (Thread/yield)
+                (recur))))))

 (deftest simple-test
   (testing "start elects a leader"


Use requires as backup when resetting provides

--- src/com/wsscode/pathom/connect/planner.cljc
+++ src/com/wsscode/pathom/connect/planner.cljc
@@ -111,11 +111,13 @@
   "Reset the node provides to the original resolver value. This is used when merging
   nodes with and, the accumulated provides goes into the new and node while the nodes
   have their provides reset."
-  [node {:com.wsscode.pathom.connect/keys [index-resolvers]}]
+  [node env]
   (cond-> node
     (pc-sym node)
     (assoc ::provides
-      (pci/resolver-provides (get index-resolvers (node-source-sym node))))))
+      (or
+        (resolver-provides (assoc env ::source-sym (node-source-sym node)))
+        (::requires node)))))

 (defn find-dynamic-node-to-merge
   "Given some branch node, tries to find a node with a dynamic resolver that's the
@@ -132,7 +134,7 @@

 (defn simplify-branch
   "If you pass a branch node with a single branch item, it removes the branch node
-  from the graph and puts that single item on its place.t"
+  from the graph and puts that single item on its place."
   [{::keys [root] :as out}
    {::keys [branch-type]}]
   (let [items (get-in out [::nodes root branch-type])]


Log diff of pod specs for K8s MODIFIED messages (#606)

--- waiter/src/waiter/scheduler/kubernetes.clj
+++ waiter/src/waiter/scheduler/kubernetes.clj
@@ -17,6 +17,7 @@
   (:require [cheshire.core :as cheshire]
             [clj-http.client :as clj-http]
             [clj-time.core :as t]
+            [clojure.data :as data]
             [clojure.data.zip.xml :as zx]
             [clojure.java.io :as io]
             [clojure.string :as string]
@@ -891,8 +892,8 @@
                     (let [now (t/now)
                           pod-id (k8s-object->id pod)
                           service-id (k8s-object->service-id pod)
-                          version (k8s-object->resource-version pod)]
-                      (scheduler/log "pod state update:" update-type version pod)
+                          version (k8s-object->resource-version pod)
+                          old-state @watch-state]
                       (when (not= "ERROR" update-type)
                         (swap! watch-state
                                #(as-> % state
@@ -901,7 +902,10 @@
                                     "MODIFIED" (assoc-in state [:service-id->pod-id->pod service-id pod-id] pod)
                                     "DELETED" (utils/dissoc-in state [:service-id->pod-id->pod service-id pod-id]))
                                   (assoc-in state [:pods-metadata :timestamp :watch] now)
-                                  (assoc-in state [:pods-metadata :version :watch] version))))))}
+                                  (assoc-in state [:pods-metadata :version :watch] version)))
+                        (let [old-pod (get-in old-state [:service-id->pod-id->pod service-id pod-id])
+                              [pod-fields pod-fields'] (data/diff old-pod pod)]
+                          (scheduler/log "pod state update:" update-type version pod-fields "->" pod-fields')))))}
       (merge options))))

 (defn global-rs-state-query


formatting and action message

formatting and action message

--- src/ontrail/websocket.clj
+++ src/ontrail/websocket.clj
@@ -55,7 +55,10 @@

 (defn server-message [type user value]
   (condp = type
-    :comment-ex {:user user :action (str "kommentoi käyttäjän " (:user value) " harjoitusta") :message (:title value) :link (ex-link value)}
+    :comment-ex {:user user
+                 :action (str "kommentoi käyttäjän " (:user value) " harjoitusta")
+                 :message (:title value)
+                 :link (ex-link value)}
     :create-ex {:user user
                 :action "kirjasi harjoituksen"
                 :message (:title value)


Support :angle, :origin-x, and :origin-y in actor and shape entities

--- src/play_clj/entities.clj
+++ src/play_clj/entities.clj
@@ -18,8 +18,8 @@
   (draw-entity! [this screen batch]))

 (defrecord TextureEntity [object] Entity
-  (draw-entity! [{:keys [^TextureRegion object x y width height scale-x scale-y
-                         angle origin-x origin-y]}
+  (draw-entity! [{:keys [^TextureRegion object x y width height
+                         scale-x scale-y angle origin-x origin-y]}
                  _
                  batch]
     (let [x (float (or x 0))
@@ -54,14 +54,23 @@
       (.draw object ^SpriteBatch batch delta-time))))

 (defrecord ActorEntity [object] Entity
-  (draw-entity! [{:keys [^Actor object] :as entity} _ batch]
-    (doseq [[k v] entity]
-      (case k
-        :x (.setX object v)
-        :y (.setY object v)
-        :width (.setWidth object v)
-        :height (.setHeight object v)
-        nil))
+  (draw-entity! [{:keys [^Actor object x y width height
+                         scale-x scale-y angle origin-x origin-y]} _ batch]
+    (some->> x (.setX object))
+    (some->> y (.setY object))
+    (some->> width (.setWidth object))
+    (some->> height (.setHeight object))
+    (when (or scale-x scale-y angle)
+      (let [scale-x (float (or scale-x 1))
+            scale-y (float (or scale-y 1))
+            origin-x (float (or origin-x (/ (.getWidth object) 2)))
+            origin-y (float (or origin-y (/ (.getHeight object) 2)))
+            angle (float (or angle 0))]
+        (.setScaleX object scale-x)
+        (.setScaleY object scale-y)
+        (.setOriginX object origin-x)
+        (.setOriginY object origin-y)
+        (.setRotation object angle)))
     (.draw object ^SpriteBatch batch 1)))

 (defrecord ModelEntity [object] Entity
@@ -76,20 +85,30 @@
     (.render renderer object attributes)))

 (defrecord ShapeEntity [object] Entity
-  (draw-entity! [{:keys [^ShapeRenderer object type draw! x y z]}
+  (draw-entity! [{:keys [^ShapeRenderer object type draw! x y width height
+                         angle origin-x origin-y]}
                  {:keys [^Camera camera]}
                  batch]
-    (let [^Matrix4 m (.getTransformMatrix object)
-          x (float (or x 0))
-          y (float (or y 0))
-          z (float (or z 0))]
-      (.setTranslation m x y z)
-      (.setTransformMatrix object m))
+    (when (or x y)
+      (let [^Matrix4 m (.getTransformMatrix object)
+            x (float (or x 0))
+            y (float (or y 0))]
+        (.setTranslation m x y 0)
+        (.setTransformMatrix object m)))
     (when batch
       (.end ^SpriteBatch batch))
     (when camera
       (.setProjectionMatrix object (. camera combined)))
     (.begin object type)
+    (when angle
+      (let [x (float (or x 0))
+            y (float (or y 0))
+            origin-x (float (or origin-x (/ (or width 0) 2)))
+            origin-y (float (or origin-y (/ (or height 0) 2)))
+            angle (float (or angle 0))]
+        (.identity object)
+        (.translate object (+ x origin-x) (+ y origin-y) 0)
+        (.rotate object 0 0 1 angle)))
     (draw!)
     (.end object)
     (when batch


fix: remove double batch size + update query fix

--- src/main/clojure/pdok/featured/extracts.clj
+++ src/main/clojure/pdok/featured/extracts.clj
@@ -87,11 +87,9 @@

 (defn- jdbc-udpate-marked-for-deletion [db table versions]
   (when (seq versions)
-    (let [versions (set (map #(str "'" % "'") versions))
-          versions (clojure.string/join ", " versions)
-          query (str "UPDATE " extract-schema "." table " SET marked_for_deletion = true WHERE version IN ( " versions " )")]
-      (try (j/with-db-connection [c db]
-             (j/execute! c [query]))
+    (let [query (str "UPDATE " extract-schema "." table
+                     " SET marked_for_deletion = true WHERE version = ?")]
+      (try (j/execute! db (cons query (map vector versions)) :multi? true :transaction? false)
            (catch java.sql.SQLException e (j/print-sql-exception-chain e))))))

 (defn- update-extract-marked-for-deletion [db dataset feature-type extract-type versions]
@@ -135,7 +133,7 @@
 (defn fill-extract [dataset collection extract-type]
   (let [batch-size 10000
         rc (timeline/changed-features (config/timeline) dataset collection)
-        parts (a/pipe rc (a/chan batch-size (partition-all batch-size)))]
+        parts (a/pipe rc (a/chan 1 (partition-all batch-size)))]
     (loop [records (a/<!! parts)]
       (when records
         (*process-delete-extract* dataset collection extract-type


Add core documentation

Add core documentation

--- src/simple_check/core.clj
+++ src/simple_check/core.clj
@@ -31,6 +31,13 @@
   {:result true :num-tests num-trials :seed seed})

 (defn quick-check
+  "Tests `property` `num-tests` times.
+
+  Examples:
+
+    (def p (for-all [a gen/pos-int] (> (* a a) a)))
+    (quick-check 100 p)
+  "
   [num-tests property & {:keys [seed max-size] :or {max-size 200}}]
   (let [[created-seed rng] (make-rng seed)
         size-seq (gen/make-size-range-seq max-size)]


Force and fix git fetch

Force and fix git fetch


Remove :else from if expression in namespace function.


new: select[nil], select[UUID]

new: select[nil], select[UUID]


[STORM-239] Allow supervisor to operate in paths with spaces in them

Works around a bug in path-escaping for Resources, described here:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4466485

--- storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@ -15,6 +15,7 @@
 ;; limitations under the License.
 (ns backtype.storm.daemon.supervisor
   (:import [backtype.storm.scheduler ISupervisor])
+  (:import [java.net URI])
   (:use [backtype.storm bootstrap])
   (:use [backtype.storm.daemon common])
   (:require [backtype.storm.daemon [worker :as worker]])
@@ -522,17 +523,19 @@
       (FileUtils/copyDirectory (File. master-code-dir) (File. stormroot))
       (let [classloader (.getContextClassLoader (Thread/currentThread))
             resources-jar (resources-jar)
-            url (.getResource classloader RESOURCES-SUBDIR)
+            ;; Work-around for JDK-4466485
+            uri (if-let [url (.getResource classloader RESOURCES-SUBDIR)]
+                  (URI. (str url)))
             target-dir (str stormroot file-path-separator RESOURCES-SUBDIR)]
             (cond
               resources-jar
               (do
                 (log-message "Extracting resources from jar at " resources-jar " to " target-dir)
                 (extract-dir-from-jar resources-jar RESOURCES-SUBDIR stormroot))
-              url
+              uri
               (do
-                (log-message "Copying resources at " (str url) " to " target-dir)
-                (FileUtils/copyDirectory (File. (.getFile url)) (File. target-dir))
+                (log-message "Copying resources at " (.getPath uri) " to " target-dir)
+                (FileUtils/copyDirectory (File. (.getPath uri)) (File. target-dir))
                 ))
             )))


Yo dawg.

Yo dawg.

--- test/kolmogorov_music/test/kolmogorov.clj
+++ test/kolmogorov_music/test/kolmogorov.clj
@@ -57,7 +57,11 @@
   [expr]
   (enterprise* expr *ns*))

+(defn yo-dawg []
+  (enterprise enterprise))
+
 (fact "The enterprise makes everything more complicated."
   (enterprise inc) => (repeat 0 nil)
   (enterprise baz) => (repeat 7 nil)
-  (enterprise enterprise) => (repeat 26 nil))
+  (enterprise enterprise) => (repeat 26 nil)
+  (kolmogorov/complexity yo-dawg) => #(< % (kolmogorov/complexity (yo-dawg))))


CMR-1061: Added a test case in system-int-test.

--- system-int-test/test/cmr/system_int_test/search/granule_timeline_test.clj
+++ system-int-test/test/cmr/system_int_test/search/granule_timeline_test.clj
@@ -60,9 +60,9 @@
         gran14 (make-gran coll2 14 "1995-08-03T08:30:45Z" "1995-08-03T17:20:00Z")
         gran15 (make-gran coll2 15 "1995-08-04T08:30:45Z" "1995-08-04T17:20:00Z")
         gran16 (make-gran coll2 16 "1995-08-05T08:30:45Z" "1995-08-05T17:20:00Z")
-
-        all-grans [gran1 gran2 gran3 gran4 gran5 gran6 gran7 gran8 gran9 gran10 gran11 gran12 gran13
-                   gran14 gran15 gran16]
+        ;; granule with start-date that is represented as Integer in elasticsearch result (CMR-1061)
+        gran17 (make-gran coll2 17 "1970-01-01T00:00:45Z" "1995-01-05T17:20:00Z")
+
         all-colls [coll1 coll2]
         coll-ids (map :concept-id all-colls)]
     (index/refresh-elastic-index)
@@ -105,7 +105,7 @@
               :results [{:concept-id (:concept-id coll1)
                          :intervals [["2000-01-01T00:00:00.000Z" "2001-05-01T00:00:00.000Z" 8]]}
                         {:concept-id (:concept-id coll2)
-                         :intervals [["1995-01-01T00:00:00.000Z" "1996-01-01T00:00:00.000Z" 5]]}]}
+                         :intervals [["1994-01-01T00:00:00.000Z" "1996-01-01T00:00:00.000Z" 6]]}]}
              (search/get-granule-timeline {:start-date "1994-01-01T00:00:00Z"
                                            :end-date "2001-05-01T00:00:00Z"
                                            :interval :year}))))


Changed import of clojure.contrib.seq in exploration

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

--- src/conexp/contrib/dl/languages/EL_gfp_exploration.clj
+++ src/conexp/contrib/dl/languages/EL_gfp_exploration.clj
@@ -16,8 +16,7 @@
 	conexp.contrib.dl.languages.EL-gfp
 	conexp.contrib.dl.languages.EL-gfp-rewriting
 	conexp.contrib.dl.util.concept-sets)
-  (:use clojure.contrib.pprint
-	clojure.contrib.seq))
+  (:use [clojure.contrib.seq :only (seq-on)]))

 (update-ns-meta! conexp.contrib.dl.languages.EL-gfp-exploration
   :doc "Implements exploration for description logics EL and EL-gfp.")
@@ -58,29 +57,29 @@
      (explore-model initial-model (concept-names (model-language initial-model))))
   ([initial-model initial-ordering]
      (with-memoized-fns [EL-expression->rooted-description-graph,
-			 interpret,
-			 model-closure,
-			 subsumed-by?,
+                         interpret,
+                         model-closure,
+                         subsumed-by?,
                          model->tbox]
        (let [language (model-language initial-model)]

-	 (when (and (not= (set initial-ordering) (concept-names language))
-		    (not= (count initial-ordering) (count (concept-names language))))
-	   (illegal-argument "Given initial-ordering for explore-model must consist "
-			     "of all concept names of the language of the given model."))
+         (when (and (not= (set initial-ordering) (concept-names language))
+                    (not= (count initial-ordering) (count (concept-names language))))
+           (illegal-argument "Given initial-ordering for explore-model must consist "
+                             "of all concept names of the language of the given model."))

-	 (loop [k     0,
-		M_k   (make-concept-set (map #(dl-expression language %) initial-ordering)),
-		K     (induced-context (seq-on M_k) initial-model),
-		Pi_k  [],
-		P_k   #{},
-		model initial-model,
-		implications #{},
-		background-knowledge #{}]
+         (loop [k     0,
+                M_k   (make-concept-set (map #(dl-expression language %) initial-ordering)),
+                K     (induced-context (seq-on M_k) initial-model),
+                Pi_k  [],
+                P_k   #{},
+                model initial-model,
+                implications #{},
+                background-knowledge #{}]

-	   (if (nil? P_k)
-	     ;; then return set of implications
-	     (let [implicational-knowledge (union implications background-knowledge)]
+           (if (nil? P_k)
+             ;; then return set of implications
+             (let [implicational-knowledge (union implications background-knowledge)]
                (doall                   ;ensure that this sequence is evaluated with our bindings in effect
                 (for [P Pi_k
                       :let [all-P    (make-dl-expression language (cons 'and P)),
@@ -91,17 +90,17 @@
                       :when (not (empty? (arguments (subsumer susu))))]
                   susu)))

-	     ;; else search for next implication
-	     (let [all-P_k    (make-dl-expression language (cons 'and P_k)),
-		   next-model (loop [model model]
-				(let [susu (abbreviate-subsumption
+             ;; else search for next implication
+             (let [all-P_k    (make-dl-expression language (cons 'and P_k)),
+                   next-model (loop [model model]
+                                (let [susu (abbreviate-subsumption
                                             (make-subsumption all-P_k
                                                               (model-closure model all-P_k))
                                             (union implications background-knowledge))]
-				  (if (or (obviously-true? susu)
-					  (not (expert-refuses? susu)))
-				    model
-				    (recur (extend-model-by-contradiction model susu))))),
+                                  (if (or (obviously-true? susu)
+                                          (not (expert-refuses? susu)))
+                                    model
+                                    (recur (extend-model-by-contradiction model susu))))),
 		   next-M_k   (apply add-concepts! M_k (for [r (role-names language)]
                                                          (dl-expression language
                                                                         (exists r (model-closure next-model all-P_k))))),


Bug fix for close-round

Bug fix for close-round

--- src/wombats/daos/game.clj
+++ src/wombats/daos/game.clj
@@ -210,10 +210,11 @@

 (defn- close-round
   [conn]
-  (fn [{:keys [:game/frame :game/status]}]
+  (fn [{:keys [:game/id :game/frame :game/status]}]

     (let [frame-trx (-> frame (update :frame/arena nippy/freeze))
-          game-trx {:game/status status}]
+          game-trx {:game/id id
+                    :game/status status}]

       (d/transact-async conn [frame-trx game-trx]))))


fix typo

fix typo

--- test/babel/test/en.cljc
+++ test/babel/test/en.cljc
@@ -194,7 +194,7 @@
                                   (fo foo)))))))))

-(def her-name-is-luisa
+(deftest her-name-is-luisa
   (is (= "her name is Luisa"
          (fo (generate {:synsem {:cat :verb :sem {:pred :be-called
                                                   :subj {:pred :lei}


Changed server addresses

Changed server addresses

--- src-cljs/client/websocket_handler.cljs
+++ src-cljs/client/websocket_handler.cljs
@@ -8,8 +8,7 @@

 ;; Address to host
 (def servers-addresses ["ws://localhost:5000"
-                        "ws://books-server.herokuapp.com"
-                        "ws://tree-mind-tone.herokuapp.com"])
+                        "ws://bs1.dikoto.com"])

 (defn get-connection-supply-channels
   "Returns a vector of tuples, one for every


Clean up: defasync code

Clean up: defasync code

--- src/me/shenfeng/http/server.clj
+++ src/me/shenfeng/http/server.clj
@@ -28,15 +28,15 @@
       :body (let [data# (atom {})
                   ~callback-name
                   (fn [response#]
-                    (reset! data# (assoc @data# :response response#))
-                    (when-let [listener# ^Runnable (:listener @data#)]
-                      (.run listener#)))]
+                    (swap! data# assoc :response response#)
+                    (when-let [listener# (:listener @data#)]
+                      (.run ^Runnable listener#)))]
               (do ~@body)
               (reify IListenableFuture
                 (addListener [this# listener#]
-                  (if-let [d# (:response @data#)]
+                  (if (:response @data#)
                     (.run ^Runnable listener#)
-                    (reset! data# (assoc @data# :listener listener#))))
+                    (swap! data# assoc :listener listener#)))
                 (get [this#] (:response @data#))))}))

 ;;;; WebSockets


Doc for repl specials

Doc for repl specials

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -48,8 +48,21 @@
 (defn ns-form? [form]
   (and (seq? form) (= 'ns (first form))))

+(def repl-specials '#{in-ns doc})
+
 (defn repl-special? [form]
-  (and (seq? form) ('#{in-ns doc} (first form))))
+  (and (seq? form) (repl-specials (first form))))
+
+(def repl-special-doc-map
+  '{in-ns {:arglists ([name])
+           :doc "Sets *cljs-ns* to the namespace named by the symbol, creating it if needed."}
+    doc {:arglists ([name])
+         :doc "Prints documentation for a var or special form given its name"}})
+
+(defn- repl-special-doc [name-symbol]
+  (assoc (repl-special-doc-map name-symbol)
+    :name name-symbol
+    :repl-special-function true))

 (defn ^:export read-eval-print [line]
   (binding [ana/*cljs-ns* @current-ns
@@ -65,12 +78,14 @@
             (if (repl-special? form)
               (case (first form)
                 in-ns (reset! current-ns (second (second form)))
-                doc (let [var-ast (ana/analyze env `(var ~(second form)))
-                          var-js (with-out-str
-                                   (ensure
-                                     (c/emit var-ast)))
-                          var-ret (js/eval var-js)]
-                      (repl/print-doc (meta var-ret))))
+                doc (if (repl-specials (second form))
+                      (repl/print-doc (repl-special-doc (second form)))
+                      (let [var-ast (ana/analyze env `(var ~(second form)))
+                           var-js (with-out-str
+                                    (ensure
+                                      (c/emit var-ast)))
+                           var-ret (js/eval var-js)]
+                       (repl/print-doc (meta var-ret)))))
               (let [_ (when DEBUG (prn "form:" form))
                     ast (ana/analyze env form)
                     _ (when DEBUG (prn "ast:" ast))


Fix resolution of integer cue variables.


Fix test data

Fix test data

--- test/icecap/test_data.clj
+++ test/icecap/test_data.clj
@@ -6,10 +6,14 @@
    :name name})

 (def simple-http-step
-  {:type :http :url "http://example.test"})
+  {:type :http
+   :method :GET
+   :url "http://example.test"})

 (def simple-https-step
-  {:type :http :url "https://example.test"})
+  {:type :http
+   :method :GET
+   :url "https://example.test"})

 (def simple-ftp-step
   {:type :ftp


Removing dummy collection id which causes errors.

--- test/cmr/system_int_test/search/granule_search_test.clj
+++ test/cmr/system_int_test/search/granule_search_test.clj
@@ -351,8 +351,7 @@
         gran2-cid (get-in gran2 [:concept-id])
         gran3-cid (get-in gran3 [:concept-id])
         gran4-cid (get-in gran4 [:concept-id])
-        gran5-cid (get-in gran5 [:concept-id])
-        dummy-cid "D1000000004-PROV2"]
+        gran5-cid (get-in gran5 [:concept-id])]
     (index/refresh-elastic-index)
     (testing "echo granule id search"
       (are [items cid options]
@@ -363,7 +362,6 @@

            [gran1] gran1-cid {}
            [gran5] gran5-cid {}
-           [] dummy-cid {}
            ;; Multiple values
            [gran1 gran2 gran3 gran4 gran5] [gran1-cid gran2-cid gran3-cid gran4-cid gran5-cid] {}
            [gran1 gran5] [gran1-cid gran5-cid] {:and false}
@@ -377,7 +375,6 @@

            [gran1] gran1-cid {}
            [gran5] gran5-cid {}
-           [] dummy-cid {}
            ;; Multiple values
            [gran1 gran2 gran3 gran4 gran5] [gran1-cid gran2-cid gran3-cid gran4-cid gran5-cid] {}
            [] (s/lower-case gran1-cid) {:ignore-case false}))
@@ -425,7 +422,6 @@
              (d/refs-match? items (search/find-refs :granule params)))
            [gran1] gran1-cid {}
            [gran5] gran5-cid {}
-           [] dummy-cid {}
            ;; Multiple values
            [gran1 gran2 gran3 gran4 gran5] [gran1-cid gran2-cid gran3-cid gran4-cid gran5-cid] {}
            [] [gran1-cid gran5-cid] {:and true}))


oops, "cake new" task got lost

oops, "cake new" task got lost

--- src/cake.clj
+++ src/cake.clj
@@ -190,7 +190,8 @@
       (cake.project/init (.getPath (File. global-project "tasks.clj")))))
   (when-not *project* (require '[cake.tasks help new]))
   (when (= "global" (:artifact-id *project*))
-    (undeftask clean compile test autotest jar uberjar war uberwar install release))
+    (undeftask clean compile test autotest jar uberjar war uberwar install release)
+    (require '[cake.tasks new]))
   (server/redirect-to-log ".cake/cake.log")
   (server/create port process-command :reload reload-files)
   nil)


Fix ns.

Fix ns.

--- src/onyx/metrics/throughput.clj
+++ src/onyx/metrics/throughput.clj
@@ -1,5 +1,6 @@
 (ns onyx.metrics.throughput
-  (:require [rotating-seq.core :as rsc]))
+  (:require [rotating-seq.core :as rsc]
+            [taoensso.timbre :refer [fatal]]))

 (defn pre [event lifecycle]
   (let [retention (:onyx.metrics.throughput/retention-ms lifecycle)
@@ -35,7 +36,6 @@

  {:lifecycle/task :all
   :lifecycle/pre :onyx.metrics.timbre/pre
-  :lifecycle/pre :onyx.metrics.timbre/post
-  :lifecycle/post-batch :onyx.metrics.timbre/post-batch
+  :lifecycle/post :onyx.metrics.timbre/post
   :onyx.metrics.throughput/interval-ms 5000
   :lifecycle/doc "Prints task metrics to Timbre every 5000 ms"}]


Lock at slot for status message

Lock at slot for status message

--- exercise3/src/de/haw/vs/station.clj
+++ exercise3/src/de/haw/vs/station.clj
@@ -20,10 +20,10 @@
        (first)
        (swap! state-atom assoc :slot)))

-(defn status [slot-atom]
-  (if (nil? @slot-atom)
+(defn status [state-atom]
+  (if (nil? (:slot @state-atom))
     (stat/status-detail :station :error "No slot assigned")
-    (stat/status-detail :station :ok @slot-atom)))
+    (stat/status-detail :station :ok @state-atom)))

 (defn send-message [state-atom config-params connector]
   ;TODO


Satisfy Eastwood

Satisfy Eastwood

--- src/refactor_nrepl/ns/slam/hound/search.clj
+++ src/refactor_nrepl/ns/slam/hound/search.clj
@@ -42,7 +42,7 @@
       (.. f getParentFile (list jar-filter))
       [f])))

-(def resource-separator
+(def ^String resource-separator
   "Please do not use File/separator see e.g. https://git.io/Jzig3"
   "/")


bug #5265 - transaction history populated only with own transactions

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

--- src/status_im/ui/screens/wallet/events.cljs
+++ src/status_im/ui/screens/wallet/events.cljs
@@ -73,7 +73,7 @@
  (fn [{:keys [web3 chain account-id token-addresses success-event error-event]}]
    (transactions/get-transactions chain
                                   account-id
-                                  #(re-frame/dispatch [success-event %])
+                                  #(re-frame/dispatch [success-event % account-id])
                                   #(re-frame/dispatch [error-event %]))
    (doseq [direction [:inbound :outbound]]
      (erc20/get-token-transactions web3
@@ -81,7 +81,7 @@
                                    token-addresses
                                    direction
                                    account-id
-                                   #(re-frame/dispatch [success-event %])))))
+                                   #(re-frame/dispatch [success-event % account-id])))))

 ;; TODO(oskarth): At some point we want to get list of relevant assets to get prices for
 (reg-fx
@@ -167,12 +167,22 @@
         (both-transfer? tx1 tx2)   (update-confirmations tx1 tx2)
         :else tx2))

+(defn own-transaction? [address [_ {:keys [type to from]}]]
+  (let [normalized (ethereum/normalized-address address)]
+    (or (and (= :inbound type) (= normalized (ethereum/normalized-address to)))
+        (and (= :outbound type) (= normalized (ethereum/normalized-address from)))
+        (and (= :failed type) (= normalized (ethereum/normalized-address from))))))
+
 (handlers/register-handler-db
  :update-transactions-success
- (fn [db [_ transactions]]
-   (-> db
-       (update-in [:wallet :transactions] #(merge-with dedupe-transactions % transactions))
-       (assoc-in [:wallet :transactions-loading?] false))))
+ (fn [db [_ transactions address]]
+   ;; NOTE(goranjovic): we want to only show transactions that belong to the current account
+   ;; this filter is to prevent any late transaction updates initated from another account on the same
+   ;; device from being applied in the current account.
+   (let [own-transactions (into {} (filter #(own-transaction? address %) transactions))]
+     (-> db
+         (update-in [:wallet :transactions] #(merge-with dedupe-transactions % own-transactions))
+         (assoc-in [:wallet :transactions-loading?] false)))))

 (handlers/register-handler-db
  :update-transactions-fail


Proof-of-concept permutation generation via the tree-seq function.


lose println

lose println


fixed domain

fixed domain

--- main/src/dda/pallet/dda_managed_ide/domain.clj
+++ main/src/dda/pallet/dda_managed_ide/domain.clj
@@ -99,8 +99,7 @@
                    (when (contains? domain-config :lein-auth)
                      {:lein-auth lein-auth}))}
         (= dev-platform :clojure-nightlight)
-        {:os-user-name user-name
-         :clojure (merge
+        {:clojure (merge
                     {:os-user-name user-name
                      :settings #{:install-nightlight}}
                     (when (contains? domain-config :lein-auth)


reuse param-value helper for query on home page

--- src/semtag_web/client/main.cljs
+++ src/semtag_web/client/main.cljs
@@ -155,8 +155,7 @@
         create-url (partial add-url $add-text $add-button)
         search-and-update-page (partial mls-search ($ :#search_box) $text-field)
         search-and-update-page-and-url (partial search-and-update-page
-                                                #(.pushState window.history "" "" (path-to "/?query=" %)))
-        query-param (re-find #"[\?&]?query=([^&]+)" (.-search window.location))]
+                                                #(.pushState window.history "" "" (path-to "/?query=" %)))]

     (bind $button "click" search-and-update-page-and-url)
     (bind $add-button "click" create-url)
@@ -167,7 +166,7 @@
       #(jq/after $text-field (view/generate-datalist %))
       :alert-fn console-error)

-    (when-let [query (when (seq query-param) (second query-param))]
+    (when-let [query (util/param-value "query")]
       (jq/val $text-field query)
       (search-and-update-page))))


Use SSL for the SoundCloud API

Use SSL for the SoundCloud API

--- src/sinusoides/views/think.cljs
+++ src/sinusoides/views/think.cljs
@@ -47,7 +47,7 @@

      api-get
      (fn [& command]
-       (http/jsonp (add-client-id (str "http://api.soundcloud.com"
+       (http/jsonp (add-client-id (str "https://api.soundcloud.com"
                                        (apply str command)
                                        ".json"))))


Dont forget schema

Dont forget schema

--- src/aurora/language/representation.cljs
+++ src/aurora/language/representation.cljs
@@ -50,14 +50,15 @@
   (let [now (:now kn)
         next (transient (:now kn))
         asserted (:asserted kn)
-        retracted (:retracted kn)]
+        retracted (:retracted kn)
+        name->schema (:name->schema kn)]
     (doseq [fact asserted]
       (when (or (contains? now fact) (not (contains? retracted fact)))
         (conj!! next fact)))
     (doseq [fact retracted]
       (when (or (not (contains? now fact)) (not (contains? asserted fact)))
         (disj!! next fact)))
-    (->Knowledge #{} #{} #{} (persistent! next))))
+    (->Knowledge #{} #{} #{} (persistent! next) name->schema)))

 (comment
   (-> (->Knowledge #{} #{} #{} #{:a})


fixup gae adapter

fixup gae adapter

--- src/clj/migae/datastore/adapter/gae.clj
+++ src/clj/migae/datastore/adapter/gae.clj
@@ -32,12 +32,12 @@
             ShortBlob
             Text
             Transaction]
-           [migae.datastore PersistentEntityMap]
+           ;; [migae.datastore PersistentEntityMap] ;; PersistentEntityMapSeq]
            )
   (:require [clojure.tools.logging :as log :only [debug info]]
             [clojure.tools.reader.edn :as edn]
-            [migae.datastore.keys :as k]
-            [migae.datastore :refer [->PersistentEntityMap]]
+            [migae.datastore :as ds]
+            ;; [migae.datastore :refer [->PersistentEntityMap ->PersistentEntityMapSeq]]
             ;; [migae.datastore.types.entity-map :refer [->PersistentEntityMap]]
             ;; [migae.datastore.types.entity-map-seq]
             ;; [migae.datastore.api :as ds]
@@ -48,7 +48,7 @@

 (clojure.core/println "loading migae.datastore.adapter.gae")

-(def ds  ;; store-map
+(def datastore  ;; store-map
   (let [dsm (DatastoreServiceFactory/getDatastoreService)
 ;;        psm (ds/->PersistentStoreMap dsm nil nil)
         ]
@@ -75,7 +75,7 @@
         fq (doseq [pred filter]
              (log/trace "\tpred: " pred)
              (.setFilter q pred))
-        pq (.prepare ds q)
+        pq (.prepare datastore q)
         iterator (.asIterator pq)
         seq (iterator-seq iterator)
         pemseq (migae.datastore.PersistentEntityMapSeq. seq)]
@@ -88,13 +88,13 @@
   ([keychain]
    (log/trace "get-ds " keychain)
    (cond
-     (k/proper-keychain? keychain)
+     (ds/proper-keychain? keychain)
      (do
        (log/trace "proper keychain: " keychain)
        (let [r (get-proper-emap keychain)]
          r))

-     (k/improper-keychain? keychain)
+     (ds/improper-keychain? keychain)
      (do
        (log/trace "improper-keychain: " keychain)
        (let [r (get-kinded-emap keychain)]
@@ -111,13 +111,13 @@
   (log/trace "get-ds " keychain pattern)
    (cond
      (= :prefix keychain)
-     (if (k/proper-keychain? pattern)
+     (if (ds/proper-keychain? pattern)
        (get-prefix-matches pattern))

      ;; (empty? keychain)
      ;; (pull-all)

-     (k/improper-keychain? keychain)
+     (ds/improper-keychain? keychain)
      (do
        (log/trace "improper-keychain with pattern" )
        (if (empty? pattern)
@@ -132,7 +132,7 @@
              (log/trace "inequality filter not yet implemented")))
            ))

-     (k/proper-keychain? keychain)
+     (ds/proper-keychain? keychain)
      (if (empty? pattern)
        (do (log/trace "proper keychain with empty pattern")
            (get-proper-emap keychain))
@@ -145,10 +145,10 @@
   [keychain & data]
   ;; precon: keychain has already been validated
   (log/trace "get-proper-emap" keychain)
-  (let [k (k/entity-key keychain)
-        e (.get ds k)]
+  (let [k (ds/vector->Key keychain)
+        e (.get datastore k)]
     (log/trace "e: " e (type e))
-    (->PersistentEntityMap e nil)))
+    (ds/->PersistentEntityMap e nil)))

 (defn get-kinded-emap
   [keychain & data]
@@ -158,10 +158,10 @@
   (if (> (count keychain) 1)
     (do
       (log/trace "kinded descendant query")
-      (let [ancestor-key (k/entity-key (vec (butlast keychain)))
+      (let [ancestor-key (ds/vector->Key (vec (butlast keychain)))
             kind (name (last keychain))
             q (Query. kind ancestor-key)
-            prepared-query (.prepare ds q)
+            prepared-query (.prepare datastore q)
             iterator (.asIterator prepared-query)
             seq (iterator-seq iterator)
             res (migae.datastore.PersistentEntityMapSeq. seq)]
@@ -173,7 +173,7 @@
       (let [kind (name (last keychain))
             q (Query. kind)
             ;; log (log/trace "query: " q)
-            pq (.prepare ds q) ;; FIXME
+            pq (.prepare datastore q) ;; FIXME
             ;; log (log/trace "p query: " pq)
             ;; log (log/trace "p query count: " (.countEntities pq (FetchOptions$Builder/withDefaults)))
             iterator (.asIterator pq)
@@ -189,7 +189,7 @@
   []
   ;; (log/trace "pull-all")
   (let [q  (Query.)
-        prepared-query (.prepare ds q) ;; FIXME
+        prepared-query (.prepare datastore q) ;; FIXME
         iterator (.asIterator prepared-query)
         ;; res (migae.datastore.PersistentEntityMapSeq. (iterator-seq iterator))
         seq (iterator-seq iterator)
@@ -202,7 +202,7 @@
 (defn fetch
   [^Key k]
   ;; FIXME: validate k
-  (.get ds k))
+  (.get datastore k))

 (defn- make-embedded-entity
   [m]
@@ -320,13 +320,13 @@
              (Entity. kind)
              (do #_(log/trace "parent-keychain" parent-keychain)
                  #_(log/trace "parent-key" (entity-key parent-keychain))
-                 (Entity. kind  (k/entity-key parent-keychain))
+                 (Entity. kind  (ds/vector->Key parent-keychain))
                  ))]
      (when (not (empty? em))
        (doseq [[k v] (seq em)]
          (.setProperty e (subs (str k) 1) (get-val-ds v))))
-     (.put ds e)
-     (->PersistentEntityMap e nil)))
+     (.put datastore e)
+     (ds/->PersistentEntityMap e nil)))
      ;; e))
   ([keyvec & data]
   ;; precon: improper keychain is validated
@@ -339,16 +339,16 @@
             (Entity. kind)
             (do #_(log/trace "parent-keychain" parent-keychain)
                 #_(log/trace "parent-key" (entity-key parent-keychain))
-                (Entity. kind  (k/entity-key parent-keychain))
+                (Entity. kind  (ds/vector->Key parent-keychain))
                 ))]
     (when (not (empty? em))
       (doseq [[k v] (seq em)]
         (.setProperty e (subs (str k) 1) (get-val-ds v))))
-    (.put ds e)
+    (.put datastore e)
     ;; (PersistentEntityMap. e nil))))
     e)))
     ;; (let [pem (PersistentEntityMap. e nil)
-    ;;       ds (into store-map pem)]
+    ;;       datastore (into store-map pem)]
     ;;   pem)))

 (defn put-proper-emap
@@ -358,10 +358,10 @@
   ;; (log/trace "keychain" keyvec)
   ;; (log/trace "propmap" propmap)
   ;; (log/trace "force" force)
-  (let [k (k/entity-key keyvec)
+  (let [k (ds/vector->Key keyvec)
         e (if (not force)
             (do (log/trace "not force: " k)
-                (let [ent (try (.get ds k)
+                (let [ent (try (.get datastore k)
                                (catch EntityNotFoundException ex ex))]
                   (log/trace "ent: " (instance? EntityNotFoundException ent))
                   ;; (if (= (type ent) Entity) ;; found
@@ -378,20 +378,20 @@
       (doseq [[k v] propmap]
         (.setProperty e (subs (str k) 1) (get-val-ds v))))
     ;; (let [pem (PersistentEntityMap. e nil)
-    ;;       ds ds]
-    ;;   ;; (log/trace "ctor-push.put-proper-emap ds: " ds (type ds))
+    ;;       datastore ds]
+    ;;   ;; (log/trace "ctor-push.put-proper-emap ds: " datastore (type ds))
     ;;   (into store-map pem)
     ;;   pem)))
-    (.put ds e)
-    (->PersistentEntityMap e nil)))
+    (.put datastore e)
+    (ds/->PersistentEntityMap e nil)))

 (defn get-prefix-matches
   [keychain]
   ;; precon: keychain has already been validated
   (log/trace "get-prefix-matches" keychain)
-  (let [prefix (apply k/entity-key keychain)
+  (let [prefix (apply ds/vector->Key keychain)
         q (.setAncestor (Query.) prefix)
-        prepared-query (.prepare ds q)
+        prepared-query (.prepare datastore q)
         iterator (.asIterator prepared-query (FetchOptions$Builder/withDefaults))
         seq  (iterator-seq iterator)
         res (migae.datastore.PersistentEntityMapSeq. seq)]
@@ -409,18 +409,18 @@
 ;;          (let [k (:migae/keychain (meta arg))]
 ;;            ;; (log/trace "edn key: " k " improper?" (improper-keychain? k))
 ;;            (cond
-;;              (k/improper-keychain? k)
+;;              (ds/improper-keychain? k)
 ;;              (put-kinded-emap k arg)
-;;              (k/proper-keychain? k)
+;;              (ds/proper-keychain? k)
 ;;              (put-proper-emap :keyvec k :propmap arg :force true)
 ;;              :else (throw (IllegalArgumentException. (str "INVALID KEYCHAIN!: " k)))))
 ;;          )
-;;        (k/keychain? arg)
+;;        (ds/keychain? arg)
 ;;        (do
 ;;          (cond
-;;            (k/improper-keychain? arg)
+;;            (ds/improper-keychain? arg)
 ;;            (put-kinded-emap arg {})
-;;            (k/proper-keychain? arg)
+;;            (ds/proper-keychain? arg)
 ;;            (put-proper-emap :keyvec arg :propmap {} :force true)
 ;;            :else (throw (IllegalArgumentException. (str "Invalid keychain" arg)))))
 ;;        :else (throw (IllegalArgumentException.)))))
@@ -431,9 +431,9 @@
 ;;     ;; (if (empty? keychain)
 ;;     ;;   (throw (IllegalArgumentException. "keychain vector must not be empty"))
 ;;     (cond
-;;       (k/improper-keychain? keychain)
+;;       (ds/improper-keychain? keychain)
 ;;       (put-kinded-emap keychain em)
-;;       (k/proper-keychain? keychain)
+;;       (ds/proper-keychain? keychain)
 ;;       (put-proper-emap :keyvec keychain :propmap em)
 ;;       :else
 ;;       (throw (IllegalArgumentException. (str "Invalid keychain : " keychain))))))
@@ -448,16 +448,16 @@
 ;;     (cond
 ;;       (= mode :force)
 ;;       (cond
-;;         (k/improper-keychain? keychain)
+;;         (ds/improper-keychain? keychain)
 ;;         (put-kinded-emap keychain em)
-;;         (k/proper-keychain? keychain)
+;;         (ds/proper-keychain? keychain)
 ;;         (put-proper-emap :keyvec keychain :propmap em :force true)
 ;;         :else
 ;;         (throw (IllegalArgumentException. (str "Invalid keychain" keychain))))
 ;;       (= mode :multi)
 ;;       (do
 ;;         ;; (log/trace "entity-map! :multi processing...")
-;;         (if (k/improper-keychain? keychain)
+;;         (if (ds/improper-keychain? keychain)
 ;;           (if (vector? em)
 ;;             (do
 ;;               (for [emap em]
@@ -480,7 +480,7 @@
             val (get-val-ds v)]
         ;; (log/trace "emap-new setting prop: " k prop v val)
         (.setProperty e prop val)))
-    (.put ds e)
+    (.put datastore e)
     ;; (PersistentEntityMap. e nil)))
     e))

@@ -517,21 +517,21 @@
 ;;               ;; (log/trace "setting val" val (type val))
 ;;               ;; (flush)
 ;;               (.setProperty e prop val)))))
-;;       (.put ds e)
+;;       (.put datastore e)
 ;;       ;; (log/trace "saved entity " e)
 ;;       (PersistentEntityMap. e nil))))

 ;; (defn- emap-update-empty
 ;;   [keychain]
 ;;   (let [k (apply entity-key keychain)
-;;         e (try (.get ds k)
+;;         e (try (.get datastore k)
 ;;                (catch EntityNotFoundException e nil)
 ;;                (catch DatastoreFailureException e (throw e))
 ;;                (catch java.lang.IllegalArgumentException e (throw e)))]
 ;;     (if (ds/entity-map? e)
 ;;           (PersistentEntityMap. e nil)
 ;;           (let [e (Entity. k)]
-;;             (.put ds e)
+;;             (.put datastore e)
 ;;             (PersistentEntityMap. e nil)))))

 ;; TODO: support embedded maps, e.g. (ds/emap!! [:Foo/bar] {:a 1, :b {:c 3, :d 4}})
@@ -543,9 +543,9 @@
     ;; (log/trace "emap-update-map key: " k)
     (let [e (if (keyword? k)
               (let [e (Entity. (subs (str k) 1))] ;; key of form :Foo, i.e. a Kind specifier
-                (.put ds e)
+                (.put datastore e)
                 e)
-              (try (.get ds k)
+              (try (.get datastore k)
                    (catch EntityNotFoundException e nil)
                    (catch DatastoreFailureException e (throw e))
                    (catch java.lang.IllegalArgumentException e (throw e))))]
@@ -565,14 +565,14 @@
 ;;           em (PersistentEntityMap. e nil)]
 ;;       (try
 ;;         (f em)
-;;         (.put ds e)
+;;         (.put datastore e)
 ;;         (.commit txn)
 ;;         (finally
 ;;           (if (.isActive txn)
 ;;             (.rollback txn))))
 ;;       em)
 ;;     (let [k (apply entity-key keychain)
-;;           e (try (.get ds k)
+;;           e (try (.get datastore k)
 ;;                  (catch EntityNotFoundException e
 ;;                    ;;(log/trace (.getMessage e))
 ;;                    e)
@@ -596,7 +596,7 @@
 ;;               em (PersistentEntityMap. e nil)]
 ;;           (try
 ;;             (f em)
-;;             (.put ds e)
+;;             (.put datastore e)
 ;;             (.commit txn)
 ;;             (finally
 ;;               (if (.isActive txn)


added more subreddits to listing

added more subreddits to listing

--- src/cljs/redditv/components/header.cljs
+++ src/cljs/redditv/components/header.cljs
@@ -10,16 +10,31 @@
    "youtubehaiku"
    "documentaries"
    "deepintoyoutube"
+   "cringe"
    "commercialcuts"
-   "cringe"
+   "listentothis"
+   "music"
+   "indie"
+
+   "360video"
+   "accidentalcomedy"
    "artisanvideos"
+   "contagiouslaughter"
+   "edm"
+   "electronicmusic"
+   "gaming"
+   "idiotsfightingthings"
    "lectures"
-   "360video"
+   "metal"
+   "movies"
+   "outrun"
+   "philosophy"
+   "publicfreakout"
+   "sports"
+   "television"
    "trailers"
-   "contagiouslaughter"
-   "accidentalcomedy"
-   "publicfreakout"
-   "idiotsfightingthings"
+   "trap"
+   "wtf"
    ])

 (defn search-subreddit [app-state subreddit]


fix naming

fix naming

--- src/clojure/zensols/nlparse/feature.clj
+++ src/clojure/zensols/nlparse/feature.clj
@@ -374,7 +374,7 @@
    [(keyword (format "lrs-length-%d" unique-idx)) 'numeric]])

 (defn lrs-feature-metas
-  "See [[lsr-features]]."
+  "See [[lrs-features]]."
   [count]
   (concat [[:lrs-len 'numeric]
            [:lrs-unique-chars 'numeric]]
@@ -382,7 +382,7 @@
                (map lrs-unique-feature-metas)
                (apply concat))))

-(defn lsr-features
+(defn lrs-features
   "Return the following features:

   * **:lrs-len** longest repeating string length
@@ -430,13 +430,16 @@
                           :length (count rs)
                           :occurs (StringUtils/countConsecutiveOccurs rs text)
                           :unique (count (StringUtils/uniqueChars rs))}))
+                  (#(if (empty? %)
+                      [{:str "" :length -1 :occurs -1 :unique -1}]
+                      %))
                   (sort (fn [a b]
                           (compare (:occurs b) (:occurs a)))))
         lrs-features (->> reps
                           (sort (fn [a b]
                                   (compare (:length b) (:length a))))
                           (take 1)
-                          (map (fn [{:keys [str length occurs unique]}]
+                          (map (fn [{:keys [length unique]}]
                                  {:lrs-len length
                                   :lrs-unique-chars unique}))
                           first)
@@ -453,8 +456,6 @@
                         [(or occurs -1) (or length -1)])))
          (apply merge lrs-features))))

-;(clojure.pprint/pprint (lsr-features "abcabc aabb aaaaaa abcabcabcabc abcdefgabcdefgabcdefg" 7))
-
 ;; chararcter distribution
 (defn char-dist-feature-metas
   "See [[char-dist-features]]."
@@ -470,7 +471,3 @@
    {:char-dist-unique (count char-dist)
     :char-dist-variance (->> char-dist stat/variance)
     :char-dist-mean (->> char-dist stat/mean double)}))
-
-;(char-dist-features "abcabc aabb aaaaaa abcabcabcabc abcdefgabcdefgabcdefg")
-
-


Config module should be used in core

Config module should be used in core

--- src/cloverage_jenkins_reporter/core.clj
+++ src/cloverage_jenkins_reporter/core.clj
@@ -1,7 +1,11 @@
 (ns cloverage-jenkins-reporter.core
-  (:gen-class))
+    (:gen-class))
+
+(require '[cloverage-jenkins-reporter.config :as config])

 (defn -main
-  "I don't do a whole lot ... yet."
-  [& args]
-  (println "Hello, World!"))
+    "I don't do a whole lot ... yet."
+    [& args]
+    (config/load-configuration "config.cfg")
+    (println "Hello, World!"))
+


Fixed parsing of test results

Fixed parsing of test results

--- src/lt/plugins/cljrefactor/testing.cljs
+++ src/lt/plugins/cljrefactor/testing.cljs
@@ -34,11 +34,12 @@
     (notifos/set-msg! (str "Test summary: " summary))))

 (defn show-successes [ed results]
-  (doseq [ks (filter (fn [[k v]]
-                       (every? #(= (:type %) "pass") v))
-                     results)]
-    (let [line (find-line-containing ed (name (first ks)))]
-      (object/raise ed :editor.result "✓" {:line line}))))
+  (when (seq results)
+    (doseq [ks (filter (fn [[k v]]
+                         (every? #(= (:type %) "pass") v))
+                       results)]
+      (let [line (find-line-containing ed (name (first ks)))]
+        (object/raise ed :editor.result "✓" {:line line})))))

 (defn show-errors [ed results]
   (doseq [r (apply concat (vals results))]
@@ -48,21 +49,13 @@
                     {:line (dec (:line r))}))))

-(defn extract-result-group [res k]
-  (->> res :results first :result (filter k)))
-
-(defn extract-result-group-single [res k]
-  (-> (extract-result-group res k) first k))
-

 (behavior ::test-res
           :triggers #{:editor.eval.clj.result.refactor.test}
           :reaction (fn [ed res]
                       (let [[ok? ret] (mw/extract-result res
                                                          :singles
-                                                         [:summary]
-                                                         :multiples
-                                                         [:results])]
+                                                         [:summary :results])]
                         (if-not ok?
                           (object/raise ed
                                         :editor.exception


use catch morphological exceptions

use catch morphological exceptions

--- src/babel/forest.clj
+++ src/babel/forest.clj
@@ -190,7 +190,11 @@
               ;; else, no complements could be added to this bolt.
               (do
                 (log/warn (str " add-complement took " run-time " msec, but found no lexical complements for "
-                               (morph from-bolt) "(rule: " (:rule from-bolt) ")"
+                               (try
+                                 (morph from-bolt)
+                                 (catch Exception e
+                                   "(exception caught)"))
+                               "(rule: " (:rule from-bolt) ")"
                                "; head rule:" (:rule (get-in from-bolt [:head]))
                                ". Complements tried were: " (morph complement-candidate-lexemes)))


Fix typo in scheduler creation function

Fix typo in scheduler creation function

Also rearranged for esthetic reasons :-).

--- src/beicon/core.cljc
+++ src/beicon/core.cljc
@@ -1169,12 +1169,12 @@
 #?(:cljs
    (defn scheduler
      "Get the scheduler instance by type.
-     The posible types are: `:asap`, `:queue`, `:async`."
+     The posible types are: `:asap`, `:async`, `:queue`."
      [type]
      (case type
-       :trampoline (.-queue Scheduler)
        :asap (.-asap Scheduler)
-       :async (.-async Scheduler)))
+       :async (.-async Scheduler)
+       :queue (.-queue Scheduler)))
    :clj
    (defn scheduler
      "Get the scheduler instance by type. The possible


Convert key explicitly

Convert key explicitly

--- test/caesium/crypto/secretbox_benchmark.clj
+++ test/caesium/crypto/secretbox_benchmark.clj
@@ -10,7 +10,7 @@
 ;; secretbox to-buf! macros vs fn vs no casts with indirect byte bufs

 (deftest ^:benchmark to-buf!-benchmarks
-  (let [key (randombytes s/keybytes)
+  (let [key (bc/->direct-byte-buf (randombytes s/keybytes))
         sizes (map (partial bit-shift-left 1) [6 8 10 12 20 24])]
     (println "secretbox to-buf! macros vs fn vs no casts with direct bufs")
     (println "these bufs already exist, so there is no allocation")


put back in the ids that i took out bc it broke things

--- src/client/menu.cljs
+++ src/client/menu.cljs
@@ -13,8 +13,8 @@
   [:div#inner-container
     [:div.logo-31d54]
     [:div.menu-cd25d
-      [:button.green-btn-f67eb "SOLO"]
-      [:button.blue-btn-41e23 "BATTLE"]]])
+      [:button#solo-btn.green-btn-f67eb "SOLO"]
+      [:button#battle-btn.blue-btn-41e23 "BATTLE"]]])

 ;;------------------------------------------------------------
 ;; Page initialization.


interpret volume for kb,mb,gb,tb

interpret volume for kb,mb,gb,tb

--- src/clj/neb/core.clj
+++ src/clj/neb/core.clj
@@ -23,6 +23,16 @@
   (dispose-trunks)
   (leave-cluster))

+(defn interpret-volume [str-volume]
+  (let [str-volume (clojure.string/lower-case (str str-volume))
+        num-part (re-find #"\d+" str-volume)
+        unit-part (first (re-find #"[a-zA-Z]+" str-volume))
+        multiply (Math/pow
+                   1024
+                   (case unit-part
+                     \k 1 \m 2 \g 3 \t 4 0))]
+    (long (* (read-string num-part) multiply))))
+
 (defn start-server [config]
   (let [{:keys [server-name port zk meta]} config]
     (join-cluster
@@ -37,6 +47,8 @@
                                       cluster-configs))
               {:keys [trunks-size]} cluster-configs
               {:keys [memory-size data-path]} config
+              ;trunks-size (interpret-volume trunks-size)
+              ;memory-size (interpret-volume memory-size)
               schemas (or (try (:data (ds/get-configure :schemas)) (catch Exception _))
                           (let [s (load-schemas-file (str data-path "/schemas"))]
                             (ds/set-configure :schemas s) s))


Rewrite set-options!

Rewrite set-options!

--- src/control/core.clj
+++ src/control/core.clj
@@ -89,12 +89,8 @@
         (set-options! :ssh-options \"-o ConnectTimeout=3000\")

   "
-  ([key value]
-     (swap! *global-options* assoc key value))
-  ([key value & kvs]
-     (set-options! key value)
-     (if kvs
-       (recur (first kvs) (second kvs) (next kvs)))))
+  [key value & kvs]
+  (swap! *global-options* #(apply assoc (list* % key value kvs))))

 (defn clear-options!
   "Clear global options"
@@ -268,7 +264,7 @@
   defcluster [name & args]
   (let [name (keyword name)]
     `(let [m# (apply hash-map ~(cons 'list (unquote-cluster args)))]
-     (swap! clusters assoc ~name (assoc m# :name ~name)))))
+       (swap! clusters assoc ~name (assoc m# :name ~name)))))

 (defmacro ^:private when-exit
   ([test error]


Use DOS line endings for the plain text output destination.

--- src/marcgrep/destinations/plaintext.clj
+++ src/marcgrep/destinations/plaintext.clj
@@ -23,8 +23,8 @@
                   (.write out " ")
                   (.write out (.getData sf)))))
           (.write out (.getData ^ControlField f)))
-        (.write out "\n"))))
-  (.write out "\n"))
+        (.write out "\r\n"))))
+  (.write out "\r\n"))

 (deftype PlaintextDestination [^BufferedWriter writer included-fields]


CIRCLE-3207 Piggie back org add container link displayed twice (#1730)

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -1552,7 +1552,7 @@

                   [:div
                    [:h1 (displayed-linux-plan-info current-linux-cost containers in-student-trial?)]
-                   (when (= current-linux-cost 0)
+                   (when (and (= current-linux-cost 0) (not piggiebacked?))
                      [:div
                       [:p (gstring/format "%s. %s." (displayed-linux-paid-info paid-linux-containers) (displayed-linux-free-info in-student-trial?))]
                       [:p


result :html now should return a function + improve docs

--- src/chat/client/views/new_message.cljs
+++ src/chat/client/views/new_message.cljs
@@ -20,8 +20,16 @@
 ;       thread-id - id of the thread
 ;    output:
 ;       if a trigger pattern was matched, an array of maps, each containing:
-;         :html - html to be displayed for the result
+;         :html - fn that returns html to be displayed for the result
+;             inputs:
+;                 none
+;             output:
+;                 html (as returned by (dom/*) functions)
 ;         :action - fn to be triggered when result picked
+;             inputs:
+;                 thread-id
+;             output:
+;                 none expected
 ;         (this array may be empty)
 ;       otherwise nil

@@ -45,13 +53,14 @@
                         (dispatch! :tag-thread {:thread-id thread-id
                                                 :id (tag :id)}))
                       :html
-                      (dom/div #js {:className "tag-match"}
-                        (dom/div #js {:className "color-block"
-                                      :style #js {:backgroundColor (helpers/tag->color tag)}})
-                        (dom/div #js {:className "tag-name"}
-                          (tag :name))
-                        (dom/div #js {:className "group-name"}
-                          (:name (store/id->group (tag :group-id)))))}))))))])
+                      (fn []
+                        (dom/div #js {:className "tag-match"}
+                          (dom/div #js {:className "color-block"
+                                        :style #js {:backgroundColor (helpers/tag->color tag)}})
+                          (dom/div #js {:className "tag-name"}
+                            (tag :name))
+                          (dom/div #js {:className "group-name"}
+                            (:name (store/id->group (tag :group-id))))))}))))))])

 ; TODO: autocomplete mentions
@@ -140,7 +149,7 @@
                                       :onClick (fn []
                                                  ((result :action) (config :thread-id))
                                                  (close-autocomplete!))}
-                          (result :html)))
+                          ((result :html))))
                       results))
                   (dom/div #js {:className "result"}
                     "No Results")))))))))


can use ESC to force-close autocomplete + move post-close message transform into engine

--- src/chat/client/views/new_message.cljs
+++ src/chat/client/views/new_message.cljs
@@ -52,6 +52,9 @@
                       (fn [thread-id]
                         (dispatch! :tag-thread {:thread-id thread-id
                                                 :id (tag :id)}))
+                      :message-transform
+                      (fn [text]
+                        (string/replace text #"( *#\S*)" ""))
                       :html
                       (fn []
                         (dom/div #js {:className "tag-match"}
@@ -69,12 +72,11 @@
     om/IInitState
     (init-state [_]
       {:text ""
+       :force-close? false
        :highlighted-result-index -1})
     om/IRenderState
-    (render-state [_ {:keys [text highlighted-result-index] :as state}]
-      (let [clear-tags! (fn []
-                          (om/set-state! owner :text (string/replace text #"( *#\S*)" "")))
-            constrain (fn [x a z]
+    (render-state [_ {:keys [text force-close? highlighted-result-index] :as state}]
+      (let [constrain (fn [x a z]
                         (cond
                           (> x z) z
                           (< x a) a
@@ -96,14 +98,22 @@
               (om/set-state! owner :text ""))
             close-autocomplete!
             (fn []
-              (clear-tags!)
               (highlight-clear!))
-            autocomplete-open? (not (nil? results))]
+            choose-result!
+            (fn [result]
+              ((result :action) (config :thread-id))
+              (om/set-state! owner :text ((result :message-transform) text))
+              (close-autocomplete!))
+            autocomplete-open? (and (not force-close?) (not (nil? results)))]
           (dom/div #js {:className "message new"}
             (dom/textarea #js {:placeholder (config :placeholder)
                                :value (state :text)
                                :onChange (fn [e]
-                                           (om/set-state! owner :text (.. e -target -value)))
+                                           (om/update-state! owner
+                                                             (fn [s]
+                                                               (assoc s
+                                                                 :text (.. e -target -value)
+                                                                 :force-close? false))))
                                :onKeyDown
                                (fn [e]
                                  (condp = e.keyCode
@@ -114,8 +124,7 @@
                                      (do
                                        (.preventDefault e)
                                        (when-let [result (nth results highlighted-result-index nil)]
-                                         ((result :action) (config :thread-id))
-                                         (close-autocomplete!)))
+                                         (choose-result! result)))
                                      ; ENTER otherwise -> send message
                                      (not e.shiftKey)
                                      (do
@@ -124,7 +133,9 @@
                                                                 :content text})
                                        (clear-text!)))

-                                   KeyCodes.ESC (close-autocomplete!)
+                                   KeyCodes.ESC (do
+                                                  (om/set-state! owner :force-close? true)
+                                                  (close-autocomplete!))

                                    KeyCodes.UP (when autocomplete-open?
                                                  (.preventDefault e)
@@ -147,8 +158,7 @@
                                                       (when (= i highlighted-result-index) "highlight"))
                                       :style #js {:cursor "pointer"}
                                       :onClick (fn []
-                                                 ((result :action) (config :thread-id))
-                                                 (close-autocomplete!))}
+                                                 (choose-result! result))}
                           ((result :html))))
                       results))
                   (dom/div #js {:className "result"}


Cleanup

Cleanup

--- src/cljs/hacker_agent/hacker-base.cljs
+++ src/cljs/hacker_agent/hacker-base.cljs
@@ -90,7 +90,6 @@
   (fn [id]
     (let [child-path (conj path id)]
       (when-not (get-in @data child-path)
-        (.log js/console (str "Binding " id))
         (bind! data child-path
                (id->fbref id)
                story-binder)))))


Gallery module, new translation string builder

--- src/cljs/salava/gallery/ui/routes.cljs
+++ src/cljs/salava/gallery/ui/routes.cljs
@@ -14,9 +14,9 @@
                ["/getbadge" (placeholder [:p "Apply for a badge"])]]})

 (defn ^:export navi [context]
-  {"/gallery"          {:weight 40 :title (t :gallery/Gallery)          :breadcrumb (str (t :gallery/Gallery) " / " (t :gallery/Sharedbadges))}
-   "/gallery/badges"   {:weight 41 :title (t :gallery/Sharedbadges)     :breadcrumb (str (t :gallery/Gallery) " / " (t :gallery/Sharedbadges))}
-   "/gallery/pages"    {:weight 42 :title (t :gallery/Sharedpages)      :breadcrumb (str (t :gallery/Gallery) " / " (t :gallery/Sharedpages))}
-   "/gallery/profiles" {:weight 43 :title (t :gallery/Sharedprofiles)   :breadcrumb (str (t :gallery/Gallery) " / " (t :gallery/Sharedprofiles))}
-   "/gallery/getbadge" {:weight 44 :title (t :gallery/Applybadge)       :breadcrumb (str (t :gallery/Gallery) " / " (t :gallery/Applybadge))}})
+  {"/gallery"          {:weight 40 :title (t :gallery/Gallery)          :breadcrumb (t :gallery/Gallery " / " :gallery/Sharedbadges)}
+   "/gallery/badges"   {:weight 41 :title (t :gallery/Sharedbadges)     :breadcrumb (t :gallery/Gallery " / " :gallery/Sharedbadges)}
+   "/gallery/pages"    {:weight 42 :title (t :gallery/Sharedpages)      :breadcrumb (t :gallery/Gallery " / " :gallery/Sharedpages)}
+   "/gallery/profiles" {:weight 43 :title (t :gallery/Sharedprofiles)   :breadcrumb (t :gallery/Gallery " / " :gallery/Sharedprofiles)}
+   "/gallery/getbadge" {:weight 44 :title (t :gallery/Applybadge)       :breadcrumb (t :gallery/Gallery " / " :gallery/Applybadge)}})


Add a repl-caught hook for use in Leiningen.

--- src/cljx/active/clojure/condition.cljx
+++ src/cljx/active/clojure/condition.cljx
@@ -17,7 +17,8 @@
   active.clojure.condition
   (:refer-clojure :exclude (assert))
   #+clj (:require [clojure.core :as core] ; get assert back
-                  [clojure.stacktrace :as stack])
+                  [clojure.stacktrace :as stack]
+                  [clojure.main :as main])
   #+cljs (:require-macros [active.clojure.condition
                            :refer (define-condition-type assert condition raise guard)]
                           [cljs.core :as core])
@@ -374,7 +375,7 @@

         more-stuff (delete-first
                     (fn [comp] ; make sure interesting subtypes still get printed
-                      (contains? covered-condition-types
+                      (contains? (covered-condition-types)
                                  (:type comp)))
                     ;; we don't expect interesting subtypes here
                     (delete-first
@@ -449,3 +450,11 @@
         (print spaces)
         (pr irritant))
       (print "\n"))))
+
+#+clj
+(defn repl-caught
+  [& [e]]
+  (let [e (or e *e)]
+    (if (condition? e)
+      (print-condition e *err*)
+      (main/repl-caught e))))


(TK-405) Log warning if restart-file specified on CLI and in TK config

This commit adds a log warning message in the event that the
restart-file setting is specified both via TK configuration and via the
command-line, indicating the value from the command-line which will be
the one actually used.

--- src/puppetlabs/trapperkeeper/config.clj
+++ src/puppetlabs/trapperkeeper/config.clj
@@ -62,7 +62,14 @@
 (defn override-restart-file-from-cli-data
   [config-data cli-data]
   (if-let [cli-restart-file (:restart-file cli-data)]
-    (assoc-in config-data [:global :restart-file] cli-restart-file)
+    (do
+      (if (get-in config-data [:global :restart-file])
+        (log/warnf
+         (str
+          "restart-file setting specified both on command-line and "
+          "in config file, using command-line value: '%s'")
+         cli-restart-file))
+      (assoc-in config-data [:global :restart-file] cli-restart-file))
     config-data))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


more logging for staging debugging

more logging for staging debugging

--- src/vip/data_processor/validation/zip.clj
+++ src/vip/data_processor/validation/zip.clj
@@ -31,7 +31,8 @@
         size (get-uncompressed-size zip-file)
         tmp-dir (Files/createTempDirectory "vip-extracted-feed"
                                            (into-array FileAttribute []))]
-    (log/info "zipfile size: " size)
+    (log/info "zipfile size: " size " type? " (type size))
+    (log/info "max-zipfile-size: " max-zipfile-size " type? " (type max-zipfile-size))
     (if (> size max-zipfile-size)
       (-> (too-big-msg size max-zipfile-size)
           (ex-info {:msg (too-big-msg size max-zipfile-size)


Get autoreloading working.

Get autoreloading working.

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

--- plugins/DeviceAdapterHelper/src/DeviceAdapterHelper/core.clj
+++ plugins/DeviceAdapterHelper/src/DeviceAdapterHelper/core.clj
@@ -1,5 +1,8 @@
 (ns org.micromanager.reloader
-  (:use [org.micromanager.mm :only (load-mm mmc core get-system-config)]))
+  (:use [clojure.java.io :only (file copy)]
+        [clojure.data :only (diff)]
+        [org.micromanager.mm :only (load-mm mmc core)]
+        [clojure.pprint :only (pprint)]))

 (load-mm (org.micromanager.MMStudioMainFrame/getInstance))
@@ -19,24 +22,25 @@
   (filter #(core isPropertyPreInit dev %)
           (seq (core getDevicePropertyNames dev))))

-(defn property-state-triple
-  "Returns the [dev, prop, value] for a device
-   and a property name."
-  [[dev property-name]]
-  [dev property-name (core getProperty dev property-name)])
+(defn pre-init-property-settings
+  "Returns a vector of [prop value] pre-init property settings
+   for a given device."
+  [dev]
+  (vec (doall (for [prop (pre-init-property-names dev)]
+                [prop (core getProperty prop)]))))

-(defn apply-property-state-triple
-  "Sets the state of property 'dev-prop' to value"
-  [[dev prop value]]
-  (when-not (core isPropertyReadOnly dev prop)
-    (core setProperty dev prop value)))
+(defn apply-property-settings
+  "Sets the state of properties 'dev-prop' to value"
+  [dev settings]
+  (doseq [[prop value] settings]
+    (when-not (core isPropertyReadOnly dev prop)
+      (core setProperty dev prop value))))

-(defn device-instance-triple
-  "Returns [module, name, label] for a device with dev-label"
+(defn device-library-location
+  "Returns [module name] for a device with dev-label"
   [dev-label]
   [(core getDeviceLibrary dev-label)
-   (core getDeviceName dev-label)
-                dev-label])
+   (core getDeviceName dev-label)])

 (defn state-device-labels
   "If dev is a state device, returns its assigned labels in
@@ -44,62 +48,125 @@
   [dev]
   (when (= mmcorej.DeviceType/StateDevice
            (core getDeviceType dev))
-    (vec (seq (core getStateLabels dev)))))
-
-(defn state-device-labels-map
-  "Maps each device to its labels (nil if not a state device)"
-  [devs]
-  (zipmap devs (map state-device-labels devs)))
+    (vec (doall (seq (core getStateLabels dev))))))

 (defn apply-state-device-labels
-  "Takes a map of devices to state labels and applies these
-   labels to the appropriate state device."
-  [dev-state-map]
-  (doseq [[dev labels] dev-state-map]
-    (dotimes [i (count labels)]
-      (core defineStateLabel dev i (get labels i)))))
+  "Takes list of state labels for a state device
+   and applies these labels."
+  [dev labels]
+  ;(println dev labels)
+  (dotimes [i (count labels)]
+      (core defineStateLabel dev i (get labels i))))

-(defn reload-module [module]
-  (let [devs (get (devices-in-each-module) module)
-        dev-triples (map device-instance-triple devs)
-        pre-init-vals (zipmap devs (map pre-init-property-names devs))
-        state-dev-labels (state-device-labels-map devs)]
-    (clojure.pprint/pprint [devs dev-triples pre-init-vals state-dev-labels])
+(defn read-device-startup-settings
+  [dev]
+  {:library-location (device-library-location dev)
+   :pre-init-settings (pre-init-property-settings dev)
+   :state-labels (state-device-labels dev)})
+
+(defn startup-device
+  "Startup a device given a device startup settings map."
+  [dev {:keys [library-location
+               pre-init-settings
+               state-labels]
+        :as settings}]
+  (let [[module name] library-location]
+    (core loadDevice dev module name))
+  (apply-property-settings dev pre-init-settings)
+  (core initializeDevice dev)
+  (apply-state-device-labels dev state-labels))
+
+(defn reload-device
+  "Reload a single given device."
+  [dev]
+  (let [startup-settings (read-device-startup-settings dev)]
+    (core unloadDevice dev)
+    (startup-device dev startup-settings)))
+
+(defn reload-module-fn
+  "Unload all devices in a module. Run housekeeping function.
+   Then load and restart again with the original settings."
+  [module housekeeping-fn]
+  (let [devs (doall (get (devices-in-each-module) module))
+        dev-settings-map (zipmap devs
+                                 (doall (map read-device-startup-settings devs)))]
     (core unloadLibrary module)
-    (doseq [[module name dev] dev-triples]
-      (core loadDevice dev module name))
+    (housekeeping-fn)
     (doseq [dev devs]
-       (core initializeDevice dev))))
-
+      (startup-device dev (dev-settings-map dev)))))

-(comment pasted for inspiration
-(defn reload-device
-  "Unload a device, and reload it, preserving its property settings."
-  [dev]
-  (when (. gui getAutoreloadOption)
-    (log "Attempting to reload " dev "...")
-    (let [props (filter #(= (first %) dev)
-                        (get-system-config-cached))
-          prop-map (into {} (map #(-> % next vec) props))
-          library (core getDeviceLibrary dev)
-          name-in-library (core getDeviceName dev)
-          state-device (eval 'mmcorej.DeviceType/StateDevice) ; load at runtime
-          state-labels (when (= state-device (core getDeviceType dev))
-                         (vec (core getStateLabels dev)))]
-      (core unloadDevice dev)
-      (core loadDevice dev library name-in-library)
-      (doseq [[prop val] (pre-init-property-names dev)]
-          (core setProperty dev prop val))
-      (core initializeDevice dev)
-      (when state-labels
-        (dotimes [i (count state-labels)]
-          (core defineStateLabel dev i (get state-labels i)))))
-    (log "...reloading of " dev " has apparently succeeded.")))
-   )
+(defmacro reload-module
+  [module & housekeeping]
+  `(reload-module-fn ~module (fn [] ~@housekeeping)))
+
+(defn file-dates [path]
+  (let [files (.listFiles (file path))]
+    (zipmap files (map #(.lastModified %) files))))
+
+(defn changed-file [path old-dates]
+  (diff old-dates (file-dates path)))
+
+(defn follow-dir-dates
+  "Polls a directory and keeps an up-to-date
+   map of files to dates in date-atom. Returns a
+   stop-following function."
+  [date-atom path]
+  (reset! date-atom (file-dates path))
+  (let [keep-following (atom true)]
+    (future
+      (while @keep-following
+        (Thread/sleep 300)
+        (reset! date-atom (file-dates path))))
+    #(reset! keep-following false)))
+
+(defn watch-dates
+  [date-atom handle-new-files-fn]
+  (add-watch date-atom "file-date"
+             (fn [_ _ old-val new-val]
+               (when-let [new-files (keys (second (diff old-val new-val)))]
+                 (println new-files)
+                 (handle-new-files-fn new-files)))))
+
+(defn module-for-dll [dll]
+  (-> dll
+      file .getName (.split "\\.")
+      first (.replace "mmgr_dal_" "")))
+
+(defn reload-updated-module [new-dll-version]
+  (let [dll (file new-dll-version)
+        module (module-for-dll dll)
+        loaded-modules (keys (devices-in-each-module))]
+    (when (some #{module} loaded-modules)
+      (println "Reloading" module "module...")
+      (reload-module module
+        (copy dll
+              (file "." (.getName dll))))
+      (println "...done!"))))
+
+(defn reload-updated-modules [new-dll-versions]
+  (doseq [dll new-dll-versions]
+    (reload-updated-module dll)))
+
+(defn reload-modules-on-device-adapter-change [dll-dir-path]
+  (let [date-atom (atom nil)
+        stop-fn (follow-dir-dates date-atom dll-dir-path)]
+    (watch-dates date-atom reload-updated-modules)
+    stop-fn))
+

 ;; testing

 (defonce test-lib (first (keys (devices-in-each-module))))

 (defn test-unload []
-  (core unloadLibrary test-lib))+  (core unloadLibrary test-lib))
+
+(def test-directory "E:\\projects\\micromanager\\bin_x64")
+
+(def test-file (file test-directory "mmgr_dal_DemoCamera.dll"))
+
+(def ^{:dynamic true} stop (fn []))
+
+(defn run-test []
+  (stop)
+  (def stop (reload-modules-on-device-adapter-change test-directory)))


Unused dep

Unused dep

--- src/doctopus/web.clj
+++ src/doctopus/web.clj
@@ -1,7 +1,6 @@
 (ns doctopus.web
   (:require [bidi.ring :as bidi]
             [clojure.java.io :as io]
-            [clojure.string :as str]
             [doctopus.configuration :refer [server-config]]
             [org.httpkit.server :as server]
             [ring.middleware.defaults :refer [wrap-defaults site-defaults]]


make 'move-to-path-or-value' start at map/vector node.

Previously, it started at the first element.

--- src/leiningen/ancient/artifact/zip.clj
+++ src/leiningen/ancient/artifact/zip.clj
@@ -27,24 +27,32 @@

 ;; ## Upgrade

+(defn- move-to-index
+  [zloc p]
+  (nth
+    (->> (iterate z/right zloc)
+         (remove #(= (z/tag %) :uneval)))
+    p))
+
+(defn- move-to-value
+  [zloc p]
+  (when-let [floc (z/find-value zloc p)]
+    (when-let [floc (z/right floc)]
+      floc)))
+
 (defn- move-to-value-or-index
-  "Move within a zipper. A keyword prompts descend into
-   a map, a number moves to the given position."
+  "Move within a zipper. A keyword prompts descend into a map, a number moves
+   to the given position. `zloc` has to point to either a seq or a vector"
   [zloc p]
-  (cond (not zloc) nil
-        (integer? p) (nth
-                       (->> (iterate z/right zloc)
-                            (remove #(= (z/tag %) :uneval)))
-                       p)
-        (keyword? p) (when-let [floc (z/find-value zloc p)]
-                       (when-let [floc (z/right floc)]
-                         (z/down floc)))
-        :else nil))
+  (when-let [zloc' (some-> zloc z/down)]
+    (if (integer? p)
+      (move-to-index zloc' p)
+      (move-to-value zloc' p))))

 (defn- move-path
   "Move within a zipper to the node at the given path."
   [loc path]
-  (reduce move-to-value-or-index loc path))
+  (reduce move-to-value-or-index (z/up loc) path))

 (defn upgrade-path
   "Upgrade the version vector at the given position."


api info instead of trace logging

api info instead of trace logging

--- src/main/clojure/pdok/featured/api.clj
+++ src/main/clojure/pdok/featured/api.clj
@@ -43,7 +43,7 @@
   (http/post uri {:body (json/generate-string run-stats) :headers {"Content-Type" "application/json"}}))

 (defn- process* [stats callback-chan request]
-  (log/trace "Processsing: " request)
+  (log/info "Processsing: " request)
   (swap! stats assoc-in [:processing] request)
   (let [persistence (config/persistence)
         projectors (config/projectors persistence)


New tests: test-log-existence, test-encode-spaces-existence, test-read-list-of-all-jobs-existence, and test-read-job-results-existence

--- test/clj_jenkins_api/jenkins_api_test.clj
+++ test/clj_jenkins_api/jenkins_api_test.clj
@@ -7,7 +7,7 @@
 ;  http://www.eclipse.org/legal/epl-v10.html
 ;
 ;  Contributors:
-;      Pavel Tisnovsky
+;      Pavel Tisnovsky
 ;

 (ns clj-jenkins-api.jenkins-api-test
@@ -22,6 +22,24 @@
     "Test if given function-name is bound to the real function."
     [function-name]
     (clojure.test/function? function-name))
+
+
+
+;
+; Test for function existence
+;
+
+(deftest test-log-existence
+    "Check that the clj-jenkins-api.jenkins-api/log definition exists."
+    (testing "if the clj-jenkins-api.jenkins-api/log definition exists."
+        (is (callable? 'clj-jenkins-api.jenkins-api/log))))
+
+
+
+(deftest test-encode-spaces-existence
+    "Check that the clj-jenkins-api.jenkins-api/encode-spaces definition exists."
+    (testing "if the clj-jenkins-api.jenkins-api/encode-spaces definition exists."
+        (is (callable? 'clj-jenkins-api.jenkins-api/encode-spaces))))

@@ -48,6 +66,29 @@
     "Check that the clj-jenkins-api.jenkins-api/update-jenkins-url definition exists."
     (testing "if the clj-jenkins-api.jenkins-api/update-jenkins-url definition exists."
         (is (callable? 'clj-jenkins-api.jenkins-api/update-jenkins-url))))
+
+
+
+(deftest test-read-list-of-all-jobs-existence
+    "Check that the clj-jenkins-api.jenkins-api/read-list-of-all-jobs definition exists."
+    (testing "if the clj-jenkins-api.jenkins-api/read-list-of-all-jobs definition exists."
+        (is (callable? 'clj-jenkins-api.jenkins-api/read-list-of-all-jobs))))
+
+
+
+(deftest test-read-job-results-existence
+    "Check that the clj-jenkins-api.jenkins-api/read-job-results definition exists."
+    (testing "if the clj-jenkins-api.jenkins-api/read-job-results definition exists."
+        (is (callable? 'clj-jenkins-api.jenkins-api/read-job-results))))
+
+
+
+(deftest test-read-file-from-artifact-existence
+    "Check that the clj-jenkins-api.jenkins-api/read-file-from-artifact definition exists."
+    (testing "if the clj-jenkins-api.jenkins-api/read-file-from-artifact definition exists."
+        (is (callable? 'clj-jenkins-api.jenkins-api/read-file-from-artifact))))
+
+

 ;
 ; Function behaviours


use are instead of many is's

use are instead of many is's

--- test/infinitelives/utils/events_test.cljs
+++ test/infinitelives/utils/events_test.cljs
@@ -1,17 +1,18 @@
 (ns infinitelives.utils.events-test
-  (:require [cljs.test :refer-macros [deftest is]]
+  (:require [cljs.test :refer-macros [deftest is are]]
             [infinitelives.utils.events :as events]))

 (deftest ascii
-  (is (= 10 (events/ascii "\n")))
-  (is (= 13 (events/ascii "\r")))
-  (is (= 32 (events/ascii " ")))
-  (is (= 48 (events/ascii "0")))
-  (is (= 57 (events/ascii "9")))
-  (is (= 65 (events/ascii "A")))
-  (is (= 90 (events/ascii "Z")))
-  (is (= 97 (events/ascii "a")))
-  (is (= 122 (events/ascii "z"))))
+  (are [x y] (= x y)
+       10 (events/ascii "\n")
+       13 (events/ascii "\r")
+       32 (events/ascii " ")
+       48 (events/ascii "0")
+       57 (events/ascii "9")
+       65 (events/ascii "A")
+       90 (events/ascii "Z")
+       97 (events/ascii "a")
+       122 (events/ascii "z")))

 ;; just test the keys are there. we assume the codes are correct.
 (deftest key-codes


(maint) Pursue serialization failure in two places

Before pg 9.4, the serialization message was in the first exception.
Now it's in a second chained exception.  We'd adjusted the tests to look
for the newer location.  Instead, look for both.

--- test/puppetlabs/puppetdb/command_test.clj
+++ test/puppetlabs/puppetdb/command_test.clj
@@ -958,6 +958,18 @@
       first
       second))

+(defn pg-serialization-failure-ex? [ex]
+  ;; Before pg 9.4, the message was in the first exception.  Now it's
+  ;; in a second chained exception.  Look for both.
+  (letfn [(failure? [candidate]
+            (when candidate
+              (when-let [m (.getMessage candidate)]
+                (re-matches
+                 #"(?sm).*ERROR: could not serialize access due to concurrent update.*"
+                 m))))]
+    (or (failure? (.getNextException ex))
+        (failure? ex))))
+
 (deftest concurrent-fact-updates
   (testing "Should allow only one replace facts update for a given cert at a time"
     (with-message-handler {:keys [handle-message dlo delay-pool q command-chan]}
@@ -1015,14 +1027,8 @@

             (let [failed-cmdref (take-with-timeout!! command-chan default-timeout-ms)]
               (is (= 1 (count (:attempts failed-cmdref))))
-              (is (re-matches
-                   #"(?sm).*ERROR: could not serialize access due to concurrent update.*"
-                   (-> failed-cmdref
-                       :attempts
-                       first
-                       :exception
-                       .getNextException
-                       .getMessage))))
+              (is (-> failed-cmdref :attempts first :exception
+                      pg-serialization-failure-ex?)))

             (is (true? @first-message?))
             (is (true? @second-message?))))))))
@@ -1234,14 +1240,8 @@

             (let [failed-cmdref (take-with-timeout!! command-chan default-timeout-ms)]
               (is (= 1 (count (:attempts failed-cmdref))))
-              (is (re-matches
-                   #"(?sm).*ERROR: could not serialize access due to concurrent update.*"
-                   (-> failed-cmdref
-                       :attempts
-                       first
-                       :exception
-                       .getNextException
-                       .getMessage))))
+              (is (-> failed-cmdref :attempts first :exception
+                      pg-serialization-failure-ex?)))

             (is (true? @first-message?))
             (is (true? @second-message?))))))))
@@ -1298,14 +1298,8 @@
             (is (empty? (fs/list-dir (:path dlo))))
             (let [failed-cmdref (take-with-timeout!! command-chan default-timeout-ms)]
               (is (= 1 (count (:attempts failed-cmdref))))
-              (is (re-matches
-                   #"(?sm).*ERROR: could not serialize access due to concurrent update.*"
-                   (-> failed-cmdref
-                       :attempts
-                       first
-                       :exception
-                       .getNextException
-                       .getMessage))))
+              (is (-> failed-cmdref :attempts first :exception
+                      pg-serialization-failure-ex?)))

             (is (true? @first-message?))
             (is (true? @second-message?))))))))


cleanup

cleanup

--- src/jsx_fun/core.clj
+++ src/jsx_fun/core.clj
@@ -17,7 +17,6 @@
       (case v
         :es5 (.setLanguageIn compiler-options
                CompilerOptions$LanguageMode/ECMASCRIPT5))))
-
   compiler-options)

 (defn jsx-engine []
@@ -70,34 +69,6 @@
       (slurp (io/file "resources/ScrollResponder.js"))))

   (transform-commonjs
-    "ScrollResponder.out.js"
+    "ScrollResponder.js"
     (transform-jsx (slurp (io/file "resources/ScrollResponder.js"))))
-
-  ;; NOTE: wasted some time processing the wrong thing!
-  ;; need to process the JSX compiled thing
-
-  ;; getting warmer!
-
-  (let [js      [(SourceFile/fromCode
-                   "ScrollResponder.out.js"
-                   (slurp (io/file "resources/ScrollResponder.out.js")))]
-        options (set-options
-                  {:lang-in :es5 :type :commonjs}
-                  (CompilerOptions.))
-        comp    (doto (cl/make-closure-compiler)
-                  (.init '() js options))
-        ;module  (JSModule. "[singleton]")
-        ;input   (do
-        ;          (doseq [x js]
-        ;             (.add module x))
-        ;          (first (.getInputs module)))
-        root (.parse comp
-               (first js))]
-    (.process
-      (ProcessCommonJSModules. comp
-        (ES6ModuleLoader. comp "./")
-        false)
-      nil root)
-    (.toSource comp root))
-
-)+  )


adding utility for prompting for passwords :key:

--- src/matross/core.clj
+++ src/matross/core.clj
@@ -13,6 +13,13 @@
 (def cli-opts
   [["-h" "--help"]])

+(defn get-sensitive-user-input [prompt]
+  (let [console (. System console)
+        padded-prompt (str prompt " ")]
+    (if console
+      (-> console (.readPassword padded-prompt nil) String/valueOf)
+      (throw (Exception. "Could not find system console.")))))
+
 (defn -main [& args]
   (let [opts (parse-opts args cli-opts)
         {:keys [connections]} (model/prepare config)]


Remove unused helpers

Remove unused helpers

--- src/mavlink/core.clj
+++ src/mavlink/core.clj
@@ -719,29 +719,6 @@
          (recur (inc idx)
                 messages))))))

-(defn get-ref
-  "Return the Ref for a message. If the message-key is a keyword it is looked
-   up from the messages-by-keyword. Otherwise it is assumed to be a number and
-   is used to find the ref in the messages-by-id."
-  [{:keys [messages-by-keyword messages-by-id] :as mavlink} message-key]
-  {:pre [messages-by-keyword
-         messages-by-id
-         ]}
-  (if (keyword? message-key)
-    (:last-value (message-key messages-by-keyword))
-    (:last-value (get messages-by-id message-key))))
-
-(defn get-last-message
-  "Return the last value map of the message received.
-   message-key should be a keyword or the id value of a message."
-  [{:keys [messages-by-keyword messages-by-id] :as mavlink} message-key]
-  {:pre [messages-by-keyword
-         messages-by-id
-         ]}
-  (if (keyword? message-key)
-    @(:last-value (message-key messages-by-keyword))
-    @(:last-value (get messages-by-id message-key))))
-
 (defn get-description
   "Return the description, only useful if descriptions were saved.
    Otherwise nil is returned."


removed hardcoded port

removed hardcoded port

--- src/moomoo/core.cljs
+++ src/moomoo/core.cljs
@@ -2,6 +2,8 @@
   (:require [cljs.nodejs :as nodejs]))

 (nodejs/enable-util-print!)
+
+(def port 3001)

 (def http (nodejs/require "http"))
 (def socketio (nodejs/require "socket.io"))
@@ -18,6 +20,6 @@
   (let [app (.createServer http)
         io (.listen socketio app)]
     (.on io "connection" connection)
-    (.listen app 3001)))
+    (.listen app port)))

 (set! *main-cli-fn* -main)


build,sys: bootstrap boot/myocamlbuild.boot

git-svn-id: e7e61699ce1738538ffebb75374fbea0924bc775@9103 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02


internal server error is 500

internal server error is 500

--- src/ontrail/core.clj
+++ src/ontrail/core.clj
@@ -30,7 +30,7 @@
      (catch Exception exception#
        (.error logger (str exception#))
        (stacktrace/print-stack-trace exception# 100)
-       {:status 400
+       {:status 500
         :headers {"Content-Type" "application/tex"}
         :body (str exception#)})))

@@ -42,7 +42,7 @@
      (catch Exception exception#
        (.error logger (str exception#))
        (stacktrace/print-stack-trace exception# 100)
-       {:status 400
+       {:status 500
         :headers {"Content-Type" "application/tex"}
         :body (str exception#)})))