Helper function for rounding to decimal places

--- src/cljs/db_quiz/model.cljs
+++ src/cljs/db_quiz/model.cljs
@@ -13,6 +13,17 @@

 ; ----- Private functions -----

+(defn- round
+  "Round a `number` to a given `precision` decimal places."
+  [precision number]
+  (let [rounding-factor (js/Math.pow 10 precision)]
+    (/ (js/Math.round (* number rounding-factor))
+       rounding-factor)))
+
+(def ^:private round-2
+  "Round to 2 decimal places"
+  (partial round 2))
+
 (def ^:private degrees->radians
   "Convert angle in degrees to radians"
   (partial * (/ js/Math.PI 180)))
@@ -34,10 +45,9 @@
   The result is rounded to 2 decimal places."
   (let [b-param (get-in config [:data :sparql :difficulty-distribution :params :b])]
     (fn [max-count angle]
-      (/ (js/Math.round (* (/ (js/Math.log (- (/ (* max-count b-param)
-                            (js/Math.tan (degrees->radians angle)))))
-                           b-param) 100))
-         100))))
+      (round-2 (/ (js/Math.log (- (/ (* max-count b-param)
+                                     (js/Math.tan (degrees->radians angle)))))
+                  b-param)))))

 ; ----- Public functions -----


removed unnecessary step

removed unnecessary step

--- src/cljs/markov/markov.cljs
+++ src/cljs/markov/markov.cljs
@@ -13,10 +13,8 @@

 (defn markov-data [line]
   (let [l (if (= \. (last line)) line (str line "."))
-        words (clojure.string/split l #"\s")
-        ks (concat ["*START*"] (butlast words))
-        pairs (partition 2 (interleave ks words))
-        maps (for [p pairs] {(first p) [(second p)]})]
+        words (cons "*START*" (clojure.string/split l #"\s"))
+        maps (for [p (partition 2 1 words)] {(first p) [(second p)]})]
     (apply merge-with concat maps)))

 (defn text-to-markov [text]


fix: do not update state if no state #207

--- src/cljs/swarmpit/ajax.cljs
+++ src/cljs/swarmpit/ajax.cljs
@@ -11,8 +11,10 @@
 (defn- command-state
   "Update given form state if form origin."
   [request form-id progress?]
-  (when (state/form-origin? form-id)
-    (state/update-value (:state request) progress? state/form-state-cursor)))
+  (let [state-cursor (:state request)]
+    (when (and (some? state-cursor)
+               (state/form-origin? form-id))
+      (state/update-value state-cursor progress? state/form-state-cursor))))

 (defn- command-error
   [{:keys [body headers]} status]


add ideas of todos to clean that up

add ideas of todos to clean that up

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -20,6 +20,7 @@
 ;; TODO - Rework the connection with AI: the AI should not be in the game (could be function)
 ;; TODO - Move the assembling of the display in view
 ;; TODO - Rework the queue system to have something simpler
+;; TODO - Extract the parts that are related to costmetic: Help

 ;; TODO - http://www.w3schools.com/howto/howto_js_sidenav.asp
 ;; TODO - http://www.w3schools.com/svg/svg_grad_radial.asp


fix the build

fix the build

--- src/clojento/magento/db.clj
+++ src/clojento/magento/db.clj
@@ -118,6 +118,7 @@
         product-id         (if is-variant (:product-id q-variants-info) query-id)
         entity-ids         (cons query-id (:variant-ids q-variants-info))
         q-product-entities (run-query db :product-entities [entity-ids] :debug debug)
+        q-product-websites (run-query db :product-websites [entity-ids] :debug debug)
         product-entities   (group-by :id q-product-entities) ; map (first) on values
         query-entity       (first (get product-entities query-id))
         variants           (dissoc product-entities query-id)
@@ -132,5 +133,5 @@
                             basic-result)
         result            with-variants]
     (if debug
-      (with-meta result (assoc (combine-queries-meta [q-variants-info q-product-entities]) :entity-ids entity-ids :total-time (/ (- (System/nanoTime) starttime) 1e6)) )
+      (with-meta result (assoc (combine-queries-meta [q-variants-info q-product-entities q-product-websites]) :entity-ids entity-ids :total-time (/ (- (System/nanoTime) starttime) 1e6)) )
       result)))


Using clojure.java.shell instead of clojure.contrib.shell-out

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

--- src/conexp/contrib/exec.clj
+++ src/conexp/contrib/exec.clj
@@ -9,7 +9,7 @@
 (ns conexp.contrib.exec
   (:use conexp.main
         [conexp.io.util :only (tmpfile with-out-writer)])
-  (:use clojure.contrib.shell-out))
+  (:use [clojure.java.shell :only (sh)]))

 (ns-doc "Executing external programs with a common interface.")

@@ -19,9 +19,7 @@
   "Runs given commandline in an external shell process. Returns the
   output on stdout as result."
   [& cmdln]
-  (let [result (apply sh
-                      :return-map true
-                      cmdln)]
+  (let [result (apply sh cmdln)]
     (when-not (zero? (:exit result))
       (illegal-state "External program " (first cmdln) " returned with non-zero status: " (:err result)))
     (:out result)))
@@ -67,6 +65,8 @@
                                        (dissoc (zipmap arguments arg-names) :context))
                                 cmdln)))))

+;;;
+
 (defmacro with-context-from-output
   "Runs body, expecting to get a string containing a formal
   context. Writes this string to a file and reads it in


Corrected formula for gravitative force

Corrected formula for gravitative force

is it correct now?

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

--- src/conexp/layout/force.clj
+++ src/conexp/layout/force.clj
@@ -199,7 +199,6 @@
 (defn- gravitative-force
   "Computes given part of gravitative force in layout on the
   inf-irreducible element n_i."
-  ;; unsure, paper gives contradicting formulas
   [layout n_i part information]
   (let [upper-neighbours (:upper-neighbours-of-inf-irrs information),
 	inf-irrs (:inf-irrs information),
@@ -212,7 +211,7 @@
      (* (nth (rotate-pi2 n_i) part)
         (/ (- (square (Math/sin phi_n_i))
 	      (square (Math/sin phi_0)))
-	   (square (Math/sin phi_n_i)))),
+	   (square (double (second n_i))))),

      (<= phi_0 phi_n_i (- Math/PI phi_0))
      0.0,
@@ -221,7 +220,7 @@
      (* (nth (rotate-pi2 n_i) part)
 	(/ (- (square (Math/sin phi_0))
 	      (square (Math/sin phi_n_i)))
-	   (square (Math/sin phi_n_i)))))))
+	   (square (double (second n_i))))))))

 ;; Overall Energy and Force


remove cassandra v2 support, add table-columns query

--- src/er_cassandra/schema.clj
+++ src/er_cassandra/schema.clj
@@ -7,19 +7,11 @@
   (:import
    [er_cassandra.session Session]))

-;; HACK ALERT
-(def cassandra-version (or (some-> (env :cassandra-version) Integer/parseInt)
-                           3))
-
 (defn ^:private table-metadata-query
   [keyspace table]
-  (if (< cassandra-version 3)
-    (h/select :system.schema_columnfamilies
-              (h/where {:keyspace_name keyspace
-                        :columnfamily_name table}))
-    (h/select :system_schema.tables
-              (h/where {:keyspace_name keyspace
-                        :table_name table}))))
+  (h/select :system_schema.tables
+            (h/where {:keyspace_name keyspace
+                      :table_name table})))

 (defn table-metadata
   "returns a Deferred with metadata for the requested table (or nil)"
@@ -33,15 +25,27 @@
                              {})
             first)))

+(defn ^:private table-columns-query
+  [keyspace table]
+  (h/select :system_schema.columns
+            (h/where {:keyspace_name keyspace
+                      :table_name table})))
+
+(defn table-columns
+  ([^Session session table]
+   (table-columns session (session/keyspace session) table))
+  ([^Session session keyspace table]
+   (session/execute session
+                    (table-columns-query
+                     (name keyspace)
+                     (name table))
+                    {})))
+
 (defn ^:private usertype-metadata-query
   [keyspace type]
-  (if (< cassandra-version 3)
-    (h/select :system.schema_usertypes
-              (h/where {:keyspace_name keyspace
-                        :type_name type}))
-    (h/select :system_schema.types
-              (h/where {:keyspace_name keyspace
-                        :type_name type}))))
+  (h/select :system_schema.types
+            (h/where {:keyspace_name keyspace
+                      :type_name type})))

 (defn usertype-metadata
   ([^Session session type]
@@ -56,13 +60,9 @@

 (defn ^:private column-metadata-query
   [keyspace table]
-  (if (< cassandra-version 3)
-    (h/select :system.schema_columns
-              (h/where {:keyspace_name keyspace
-                        :columnfamily_name table}))
-    (h/select :system_schema.columns
-              (h/where {:keyspace_name keyspace
-                        :table_name table}))))
+  (h/select :system_schema.columns
+            (h/where {:keyspace_name keyspace
+                      :table_name table})))

 (defn column-metadata
   "returns a Deferred with metadata for the requested table (or nil)"


Fix capitalization

Fix capitalization

--- src/play_clj/ui.clj
+++ src/play_clj/ui.clj
@@ -185,12 +185,12 @@
 (defmacro check-box!
   "Calls a single method on a `check-box`."
   [entity k & options]
-  `(u/call! ^Checkbox (u/get-obj ~entity :object) ~k ~@options))
+  `(u/call! ^CheckBox (u/get-obj ~entity :object) ~k ~@options))

 (defn check-box?
   "Returns true if `entity` is a `check-box`."
   [entity]
-  (isa? (type (u/get-obj entity :object)) Checkbox))
+  (isa? (type (u/get-obj entity :object)) CheckBox))

 ; container


Modify parse to only attempt parsing when a parser exists.

Also, log the file being parsed.

--- src/incise/parsers/core.clj
+++ src/incise/parsers/core.clj
@@ -3,8 +3,10 @@
             [incise.parsers.helpers :refer [extension]]
             [clj-time.core :as tm]
             [clojure.java.io :refer [file]]
+            [taoensso.timbre :refer [with-default-outs spy trace debug info warn error fatal]]
             [clojure.string :as s])
-  (:import [java.io File]))
+  (:import [java.io File])
+  (:refer-clojure :exclude [contains?]))

 (defrecord Parse [^String title
                   ^String extension
@@ -20,14 +22,21 @@
    parse function takes a java.io.File and returns a Parse."
   (atom {}))

+(defn contains? [& args]
+  (apply clojure.core/contains? @parsers args))
+
 (defn register
   "Register a parser for the given file extensions."
   [extensions parser]
   (swap! parsers
          merge (zipmap (map name extensions)
                        (repeat parser))))
+
 (defn parse
   "Do all the work, parse the file and output it to the proper location."
   [^File handle]
-  {:pre [(contains? @parsers (extension handle))]}
-  ((@parsers (extension handle)) handle))
+  {:pre [(instance? File handle)]}
+  (let [ext (extension handle)]
+    (when (contains? ext)
+      (info "Parsing" (.getPath handle))
+      ((@parsers ext) handle))))


The body returned by delete is empty

The body returned by delete is empty

so just return whether the status was successful

--- src/mdr2/pipeline2/core.clj
+++ src/mdr2/pipeline2/core.clj
@@ -89,8 +89,7 @@
 (defn job-delete [id]
   (let [url (str ws-url "/jobs/" id)
         response (client/delete url (auth-query-params url))]
-    (when (client/success? response)
-      (-> response :body xml/parse-str))))
+    (client/success? response)))

 (defn scripts []
   (let [url (str ws-url "/scripts")


Getting there...

Getting there...

--- src/obb_rules/ai/alamo.cljc
+++ src/obb_rules/ai/alamo.cljc
@@ -12,7 +12,7 @@
             [obb-rules.result :as result]
             [obb-rules.board :as board]))

-(def element-depth 50)
+(def element-depth 10)

 (defmulti actions
   "Returns a list of actions to apply to the current game"
@@ -85,11 +85,8 @@
           counter-quantity (if counter-element (element/element-quantity counter-element) 0)
           percentage (/ counter-quantity original-quantity)]
       (-> option
-          (assoc :data {:percentage percentage
+          #_(assoc :data {:percentage percentage
                         :_counter-element? (boolean counter-element)
-                        :_counter-element counter-element
-                        :elems (keys (:elements (:board counter-option)))
-                        :elems-oriq (keys (:elements element-board))
                         :counter-actions (:actions counter-option)
                         :original-quantity original-quantity
                         :counter-quantity counter-quantity})
@@ -106,8 +103,9 @@
            (let [board (:board option)
                  player (game/state board)
                  counter-player (other-player board)
+                 moved-element (board/get-element board (or (:element-coord option) (element/element-coordinate element)))
                  board (-> (game/state board counter-player)
-                           (board/element-focus element)
+                           (board/element-focus moved-element)
                            (dissoc :removed-elements)
                            (dissoc :action-results))
                  counter-option (firingsquad/turn-option board counter-player)]


Upgrade to Clojure 1.8.0

Upgrade to Clojure 1.8.0

--- roles/system/files/.lein/profiles.clj
+++ roles/system/files/.lein/profiles.clj
@@ -1,5 +1,5 @@
 {:system
- {:dependencies [[org.clojure/clojure "1.7.0"]]}
+ {:dependencies [[org.clojure/clojure "1.8.0"]]}
  :user {:plugins [[lein-midje "3.1.3"]
                   [cider/cider-nrepl "0.10.0-SNAPSHOT"]
                   [lein-oneoff "0.3.1"]


add basic event monitoring (for device discovery)

--- src/overtone/libs/event.clj
+++ src/overtone/libs/event.clj
@@ -7,6 +7,8 @@

 (defonce ^:private handler-pool (handlers/mk-handler-pool "Overtone Event Handlers"))
 (defonce ^:private event-debug* (atom false))
+(defonce ^:private monitoring?* (atom false))
+(defonce ^:private monitor* (atom {}))

 (defn- log-event
   "Log event on separate thread to ensure logging doesn't interfere with
@@ -105,6 +107,8 @@
   (log-event "event: " event-type " " args)
   (when @event-debug*
     (println "event: " event-type " " args "\n"))
+  (when @monitoring?*
+    (swap! monitor* assoc event-type args))
   (binding [overtone.libs.handlers/*log-fn* log/error]
     (let [event-info (if (and (= 1 (count args))
                               (map? (first args)))
@@ -121,6 +125,8 @@
   (log-event "sync-event: " event-type " " args)
   (when @event-debug*
     (println "sync-event: " event-type " " args "\n"))
+  (when @monitoring?*
+    (swap! monitor* assoc event-type args))
   (binding [overtone.libs.handlers/*log-fn* log/error]
     (let [event-info (apply hash-map args)]
       (apply handlers/sync-event handler-pool event-type event-info))))
@@ -134,3 +140,45 @@
   "Stops debug info from being printed out."
   []
   (reset! event-debug* false))
+
+(defn event-monitor-on
+  "Start recording new incoming events into a map which can be examined
+  with #'event-monitor"
+  []
+  (reset! monitor* {})
+  (println "Event monitoring enabled")
+  (reset! monitoring?* true))
+
+(defn event-monitor-off
+  "Stop recording new incoming events"
+  []
+  (println "Event monitoring disabled")
+  (reset! monitoring?* false))
+
+(defn event-monitor-timer
+  "Record events for a specific period of time in seconds (defaults to
+  5)."
+  ([] (event-monitor-timer 5))
+  ([seconds]
+     (event-monitor-on)
+     (loop [i seconds]
+       (when (and @monitoring?* (pos? i))
+         (println (str "Event monitor activated for "
+                       (- seconds i)
+                       " more second"
+                       (when (> (- seconds i) 1)
+                         "s")))
+         (Thread/sleep 1000)
+         (recur (dec i))))
+     (event-monitor-off)))
+
+(defn event-monitor
+  "Return a map of the most recently seen events. This is reset every
+  time #'event-monitor-on is called."
+  ([] @monitor*)
+  ([event-key] (get @monitor* event-key)))
+
+(defn event-monitor-keys
+  "Return a seq of all the keys of most recently seen events."
+  []
+  (keys @monitor*))


143/144/145

--- stuf/src/sandbox/4clojure.clj
+++ stuf/src/sandbox/4clojure.clj
@@ -1247,10 +1247,18 @@
       (let [lead-winer (lead trick lead-suit)
             trump-winer (lead trick trump)]
         (if trump-winer trump-winer lead-winer)))))
-;; wow solution
-;;(fn [s]
-;;  (fn [c]
-;;    (->> c
-;;         (filter #(= (:suit %) (if s s (:suit (first c)))))
-;;         (sort-by :rank)
-;;         last)))
+
+;;143 dot product
+#(apply + (map * %1 %2))
+
+;;144 Oscilrate
+(defn f [param & funcs]
+  (let [osc (fn osc [param [fst & rst]]
+              (lazy-seq (concat [param] (osc (fst param) rst))))]
+    (osc param (cycle funcs))))
+
+;;wow solution
+;;(fn [v & f] (reductions #(%2 %) v (cycle f)))
+
+;;145 For the win
+[1 5 9 13 17 21 25 29 33 37]


Add autofilling input fields in edit action form.

--- src/cljs/hatnik/web/client/form_components.cljs
+++ src/cljs/hatnik/web/client/form_components.cljs
@@ -51,8 +51,12 @@
                                         :id "emain-body-input"}
                                    "Library release: {{LIBRARY}} {{VERSION}}")))))

-(defn email-edit-action [data]
-  (email-action-form-body data))
+(defn email-edit-action [data]
+  (let [artifact-input (.getElementById js/document "artifact-input")
+        email-body-input (.getElementById js/document "emain-body-input")]
+    (set! (.-value artifact-input) (get (:current-action data) "library"))
+    (set! (.-value email-body-input) (get (:current-action data) "template"))
+    (email-action-form-body data)))

 (def action-form-bodys
   {:email-action email-action-form-body


Resolve node URLs before saving to Redis.

--- src/shale/nodes.clj
+++ src/shale/nodes.clj
@@ -77,6 +77,8 @@
   (first (filter #(= (% :url) url) (view-models))))

 (s/defn modify-node :- NodeView
+  "Modify a node's url or tags in Redis. Any provided url that's host isn't an
+  IP address will be resolved before storing."
   [id {:keys [url tags]
        :or {:url nil
             :tags nil}}]
@@ -84,7 +86,10 @@
     (with-car*
       (let [node-key (node-key id)
             node-tags-key (node-tags-key id)]
-        (if url (car/hset node-key :url url))
+        (if url (->> url
+                     host-resolved-url
+                     str
+                     (car/hset node-key :url)))
         (if tags (sset-all node-tags-key tags))
         (car/return (view-model id))))))


200->201 for create

200->201 for create

--- src/shuppet/web.clj
+++ src/shuppet/web.clj
@@ -32,13 +32,15 @@
   (alter-var-root #'*version* (fn [_] version)))

 (defn- response
-  [body]
-  (merge
-   {:status 200
-    :headers {"Content-Type" "application/json"}}
-   (if (nil? body)
-     {}
-     {:body body})))
+  ([body status]
+      (merge
+       {:status status
+        :headers {"Content-Type" "application/json"}}
+       (if (nil? body)
+         {}
+         {:body body})))
+  ([body]
+     (response body 200)))

 (defn- list-envs
   []
@@ -89,7 +91,7 @@
 (defn- create-app-config
   [name local]
   (let [env (if local "local" "")]
-    (response (core/create-config env name))))
+    (response (core/create-config env name) 201)))

 (defn- send-error
   [code message]


Fix images storage initialization.

Fix images storage initialization.

--- src/uxbox/media.clj
+++ src/uxbox/media.clj
@@ -14,18 +14,21 @@
             [storages.misc :refer (hashed prefixed)]
             [uxbox.config :refer (config)]))

-(defn- resolve-basedir
-  [^String basedir]
-  (or (io/resource basedir)
-      basedir))
+(defn- initialize-images-storage
+  [{:keys [basedir baseuri] :as config} prefix]
+  (-> (filesystem {:basedir basedir
+                   :baseuri baseuri})
+      (prefixed prefix)
+      (hashed)))

-(defn- initialize-storage
-  [{:keys [basedir baseuri] :as config}]
-  (let [basedir (resolve-basedir basedir)]
-    (-> (filesystem {:basedir basedir
-                     :baseuri baseuri})
-        (prefixed "images")
-        (hashed))))
+(defn- initialize-thumbnails-storage
+  [{:keys [basedir baseuri] :as config} prefix]
+  (-> (filesystem {:basedir basedir
+                   :baseuri baseuri})
+      (prefixed prefix)))

-(defstate storage
-  :start (initialize-storage (:storage config)))
+(defstate images-storage
+  :start (initialize-images-storage (:storage config) "images"))
+
+(defstate thumbnails-storage
+  :start (initialize-thumbnails-storage (:storage config) "thumbnails"))


Replaced checkmarks with nation codes

Replaced checkmarks with nation codes

--- streamable_intl.clj
+++ streamable_intl.clj
@@ -77,7 +77,7 @@
                       (for [country countries]
                         (if
                           ((:streaming_options ep) country)
-                          "|✓"
+                          (str "|" country)
                           "|"))
                       "\n"))]
     (apply str
@@ -87,9 +87,7 @@
           ":---"
           (repeat (count countries) "|:---:")
           "\n"
-          (interpose
-            interstitial-row
-            (partition 20 body-rows)))))))
+          body-rows)))))

 (let [episode-data (kcore/select episodes
                      (kcore/where {:ignore 0}))]


Remove clojure/data.json from project.clj - one json library is enough

--- resources/leiningen/new/dropship/project.clj
+++ resources/leiningen/new/dropship/project.clj
@@ -9,8 +9,7 @@
                  [ring "1.3.2"]
                  [ring/ring-json "0.4.0"]
                  [scenic "0.2.5"]
-                 [cheshire "5.5.0"]
-                 [org.clojure/data.json "0.2.6"]]
+                 [cheshire "5.5.0"]]
   :target-path "target/%s"
   :profiles {:uberjar {:aot :all}
              :dev {:dependencies [[midje "1.6.3"]


check if incomplete

check if incomplete

--- src/sandbox/multithread.clj
+++ src/sandbox/multithread.clj
@@ -120,3 +120,21 @@
 ;;=> this functions just adds :count n to the map maintained in
 ;;"scheduled"

+(defn incomplete-instruction?
+  [instruction-w-count]
+  (let [instr-effort (insts-effort (instruction-w-count :inst-type))
+        instr-count (instruction-w-count :count)]
+    (< instr-count instr-effort)))
+
+(defn incomplete-process?
+  [process-w-counts]
+  (let [instrs-w-count (process-w-counts :instructions)]
+    (some true? (map incomplete-instruction?
+                     instrs-w-count))))
+
+(defn more-incomplete-processes?
+  [processes-w-count]
+  (some true? (map incomplete-process?
+                   processes-w-count)))
+;=> processes-w-count is just another name for the "scheduled"
+;; state map.


Fix tests from changed snapshot

Fix tests from changed snapshot

--- test/beehive/service_test.clj
+++ test/beehive/service_test.clj
@@ -17,7 +17,8 @@
             [beehive.core :as beehive]
             [beehive.service :as service])
   (:import (java.io IOException)
-           (java.util.concurrent CountDownLatch)))
+           (java.util.concurrent CountDownLatch)
+           (java.util Map)))

 (set! *warn-on-reflection* true)

@@ -91,6 +92,17 @@
       (is (= :rejected (:status f)))
       (.countDown latch))))

+(defn remove-latency [^Map snapshot]
+  (doto snapshot
+    (.remove "latency-max")
+    (.remove "latency-mean")
+    (.remove "latency-50")
+    (.remove "latency-90")
+    (.remove "latency-99")
+    (.remove "latency-99.9")
+    (.remove "latency-99.99")
+    (.remove "latency-99.999")))
+
 (deftest metrics-test
   (testing "Testing that metrics are updated with result of action"
     (let [metrics-service (beehive/service "test" 1 100)
@@ -125,8 +137,16 @@
               "queue-full" 0
               "successes" 1
               "timeouts" 1
-              "total" 3}
-             (-> metrics-service :metrics :snapshot)))))
+              "total" 3
+              "total-all-rejected" 0
+              "total-circuit-open" 0
+              "total-errors" 1
+              "total-max-concurrency" 0
+              "total-queue-full" 0
+              "total-successes" 1
+              "total-timeouts" 1
+              "total-total" 3}
+             (-> metrics-service :metrics :snapshot remove-latency)))))
   (testing "Testing that rejection reasons are updated"
     (let [metrics-service (beehive/service "test" 1 1)
           latch (CountDownLatch. 1)]


setup compojure-style request

setup compojure-style request

--- test/prometheus/core_test.clj
+++ test/prometheus/core_test.clj
@@ -7,16 +7,13 @@
     (io.prometheus.client CollectorRegistry)
     (io.prometheus.client.exporter.common TextFormat)))

-(defn test-handler [_]
-  (with-meta
-    {:status 200 :body "ok"}
-    {:path "`/test"}))
+(defn test-handler [request]
+  (prometheus/with-path request {:status 200 :body "ok"}))

 (deftest dump-metrics
   (let [registry (CollectorRegistry.)
-        request (ring/request :get "/test")
         handler (prometheus/instrument-handler test-handler "test" registry)
-        response (prometheus/with-path request (handler request))
+        response (handler (assoc (ring/request :get "/test") :compojure/route ["GET" "/test"]))
         metrics (prometheus/dump-metrics registry)]
     (testing "handler returns delegate's response"
       (is (= {:status 200 :body "ok"} response)))
@@ -24,4 +21,5 @@
       (is (= 200 (:status metrics)))
       (is (= TextFormat/CONTENT_TYPE_004 (get-in metrics [:headers "Content-Type"])))
       (is (.contains (:body metrics) "http_request_latency_seconds"))
-      (is (.contains (:body metrics) "http_requests_total")))))
+      (is (.contains (:body metrics) "http_requests_total"))
+      (is (.contains (:body metrics) "/test")))))


GR - disable functional tests for voting

Selenium can't seem to handle the page getting reloaded on vote

--- test/objective8/functional/functional_tests.clj
+++ test/objective8/functional/functional_tests.clj
@@ -152,11 +152,14 @@
                       (throw e)))
                => "Functional test answer")

-         (fact "Can up vote an answer"
+         (future-fact "Can up vote an answer"
                       (try (wd/to (:question-url @journey-state))
                            (wait-for-element "textarea.func--add-answer")
+                           (wd/text ".func--up-score") => "0"
                            (wd/click "button.func--up-vote")
-                           (wait-for #(= (wd/text ".func--up-score") "1"))
+                           (wd/to (:question-url @journey-state)) ;TODO - how to handle redirects
+                           (wd/text ".func--up-score") => "1"
+
                            (catch Exception e
                              (screenshot "Error-Can-vote-on-an-answer")
                              (throw e))))


Unmangle clj fn names

Unmangle clj fn names

--- src/tripod/interceptor.cljc
+++ src/tripod/interceptor.cljc
@@ -8,15 +8,17 @@

 (declare interceptor)

-(defn unmangle
-  "Given the name of a class that implements a Clojure function, returns the function's name in Clojure. Note: If the true Clojure function name
-  contains any underscores (a rare occurrence), the unmangled name will
-  contain hyphens at those locations instead."
-  [f]
-  (let [class-name #?(:clj (.getName (class f)) :cljs (.-name f))]
-    (-> class-name
-        (str/replace #"^(.+)\$([^@]+)(|@.+)$" "$1/$2")
-        (str/replace #"_" "-"))))
+
+#?(:clj
+   (defn unmangle
+     "Given the name of a class that implements a Clojure function, returns the function's name in Clojure. Note: If the true Clojure function name
+     contains any underscores (a rare occurrence), the unmangled name will
+     contain hyphens at those locations instead."
+     [f]
+     (let [class-name (.getName (class f))]
+       (-> class-name
+           (str/replace #"^(.+)\$([^@]+)(|@.+)$" "$1/$2")
+           (str/replace #"_" "-")))))

 #?(:clj
    (extend-protocol IntoInterceptor
@@ -25,7 +27,8 @@

      clojure.lang.Fn
      (-interceptor [t]
-       (interceptor {:enter (fn [context]
+       (interceptor {:name  (keyword (unmangle t))
+                     :enter (fn [context]
                               (assoc context :response (t (:request context))))}))

      clojure.lang.Var


Story ID: RPC-174 Merge branch 'feature/RPC-174' of gitlab.buehner-fry.com:navis/untangled into feature/RPC-174

--- src/untangled/test/dom.cljs
+++ src/untangled/test/dom.cljs
@@ -80,7 +80,7 @@
   [text-or-regex search-kind search-param dom]
   (if-let [ele (find-element search-kind search-param dom)]
     (if-not (node-contains-text? text-or-regex ele)
-      (t/do-report {:type :fail :actual (.-innerHTML ele) :expected text-or-regex})
+      (t/do-report {:type :fail :actual (gd/getTextContent ele) :expected text-or-regex})
       (t/do-report {:type :pass })
       )
     (t/do-report {:type     :error :message (str "Could not find element " search-kind search-param)


Add missing attributes when page is exported as svg.

--- src/uxbox/main/exports.cljs
+++ src/uxbox/main/exports.cljs
@@ -47,16 +47,18 @@
   (shape* (get-in @*state* [:shapes sid])))

 (mx/defc page-svg
-  [{:keys [width height] :as page}]
-  [:svg {:width width
-         :height height
-         :version "1.1"
-         :xmlnsXlink "http://www.w3.org/1999/xlink"
-         :xmlns "http://www.w3.org/2000/svg"}
-   (background)
-   (for [item (reverse (:shapes page))]
-     (-> (shape item)
-         (mx/with-key (str item))))])
+  [{:keys [metadata] :as page}]
+  (let [{:keys [width height]} metadata]
+    [:svg {:width width
+           :height height
+           :view-box (str "0 0 " width " " height)
+           :version "1.1"
+           :xmlnsXlink "http://www.w3.org/1999/xlink"
+           :xmlns "http://www.w3.org/2000/svg"}
+     #_(background)
+     (for [item (reverse (:shapes page))]
+       (-> (shape item)
+           (mx/with-key (str item))))]))

 (defn render-page
   [id]


Load namespaces synchronously

Load namespaces synchronously

--- src/yetibot/core/loader.clj
+++ src/yetibot/core/loader.clj
@@ -25,11 +25,11 @@

 (defn load-ns [arg]
   (info "Loading" arg)
-  (future (try (require arg :reload)
-               arg
-               (catch Exception e
-                 (warn "WARNING: problem requiring" arg "hook:" (.getMessage e))
-                 (st/print-stack-trace (st/root-cause e) 15)))))
+  (try (require arg :reload)
+       arg
+       (catch Exception e
+         (warn "WARNING: problem requiring" arg "hook:" (.getMessage e))
+         (st/print-stack-trace (st/root-cause e) 15))))

 (defn find-and-load-namespaces
   "Find namespaces matching ns-patterns: a seq of regex patterns. Load the matching


Use (game :point-x) instead of (:input-x screen)

--- resources/arcade/core.clj
+++ resources/arcade/core.clj
@@ -49,7 +49,7 @@
   (fn [screen entities]
     (for [e entities]
       (if (:player? e)
-        (assoc e :x (- (:input-x screen)
+        (assoc e :x (- (game :point-x)
                        (/ (texture! e :get-region-width) 2)))
         e)))


added configuration phase

added configuration phase

--- uberjar/src/dda/pallet/dda_managed_ide/main.clj
+++ uberjar/src/dda/pallet/dda_managed_ide/main.clj
@@ -38,6 +38,16 @@
   [domain-config targets]
   (let [{:keys [existing provisioning-user]} targets]
     (operation/do-apply-install
+     (existing/provider {:dda-managed-ide existing})
+     (app/existing-provisioning-spec
+       domain-config
+       provisioning-user)
+     :summarize-session true)))
+
+(defn execute-configure
+  [domain-config targets]
+  (let [{:keys [existing provisioning-user]} targets]
+    (operation/do-apply-configure
      (existing/provider {:dda-managed-ide existing})
      (app/existing-provisioning-spec
        domain-config
@@ -85,7 +95,7 @@
                                         (app/load-targets (:targets options)))
       (:configure options) (execute-configure
                              (app/load-domain (first arguments))
-                             (app/load-targets (:targets options))))
+                             (app/load-targets (:targets options)))
       :default (execute-install
                  (app/load-domain (first arguments))
-                 (app/load-targets (:targets options)))))
+                 (app/load-targets (:targets options))))))


Temporary files in multpart store deleted on exit

--- ring-core/src/ring/middleware/multipart_params/temp_file.clj
+++ ring-core/src/ring/middleware/multipart_params/temp_file.clj
@@ -5,7 +5,8 @@
 (defn temp-file-store
   "Stores multipart file parameters as a temporary file."
   [item]
-  (let [temp-file (File/createTempFile "ring-multipart-" "")]
+  (let [temp-file (File/createTempFile "ring-multipart-" nil)]
+    (.deleteOnExit temp-file)
     (with-open [out (io/output-stream temp-file)]
       (io/copy (:stream item) out))
     (-> (select-keys item [:filename :content-type])


CMR-3097: Removed unused require.

CMR-3097: Removed unused require.

--- umm-spec-lib/src/cmr/umm_spec/time.clj
+++ umm-spec-lib/src/cmr/umm_spec/time.clj
@@ -2,8 +2,7 @@
   "Functions for working with the variety of temporal extent
   structures in the UMM model."
   (:require
-    [clj-time.core :as t]
-    [cmr.umm-spec.date-util :as date-util]))
+    [clj-time.core :as t]))

 (defn temporal-all-dates
   "Returns the set of all dates contained in the given TemporalExtent record. :present is used to


Story ID: develop Summary: Fixed untangled-spec.core require in data-fetch-spec

--- spec/untangled/client/data_fetch_spec.cljs
+++ spec/untangled/client/data_fetch_spec.cljs
@@ -3,10 +3,10 @@
     [untangled.client.data-fetch :as df]
     [untangled.client.impl.data-fetch :as dfi]
     [untangled.client.impl.util :as util]
-    [om.next :as om :refer-macros [defui]])
-  (:require-macros
-    [cljs.test :refer [is are]]
-    [untangled-spec.core :refer [specification behavior assertions provided component when-mocking]]))
+    [om.next :as om :refer-macros [defui]]
+    [cljs.test :refer-macros [is are]]
+    [untangled-spec.core :refer-macros
+     [specification behavior assertions provided component when-mocking]]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; SETUP


insights: remove legend

insights: remove legend

--- src-cljs/frontend/components/insights.cljs
+++ src-cljs/frontend/components/insights.cljs
@@ -39,18 +39,6 @@
   {:width (- (:width svg-info) (:left svg-info) (:right svg-info))
    :height (- (:height svg-info) (:top svg-info) (:bottom svg-info))
    :max-bars 50
-   :left-legend-items [{:classname "success"
-                        :text "Passed"}
-                       {:classname "failed"
-                        :text "Failed"}
-                       {:classname "canceled"
-                        :text "Canceled"}]
-   :right-legend-items [{:classname "queue"
-                         :text "Queue time"}]
-   :legend-info {:square-size 10
-                 :item-width 80
-                 :item-height 14   ; assume font is 14px
-                 :spacing 4}
    :positive-y% 0.65})

 (defn add-queued-time [build]
@@ -59,66 +47,6 @@

 (defn build-graphable [{:keys [outcome]}]
   (#{"success" "failed" "canceled"} outcome))
-
-(defn add-legend [plot]
-  (let [{:keys [square-size item-width item-height spacing]} (:legend-info plot-info)
-        left-legend-enter (-> plot
-                             (.select ".legend-container")
-                             (.selectAll ".legend")
-                             (.data (clj->js (:left-legend-items plot-info)))
-                             (.enter)
-                             (.append "g")
-                             (.attr #js {"class" "legend left"
-                                         "transform"
-                                         (fn [item i]
-                                           (let [tr-x (* i item-width)
-                                                 tr-y (- (- item-height
-                                                            (/ (- item-height square-size)
-                                                               2)))]
-                                             (gstring/format "translate(%s,%s)" tr-x  tr-y)))}))
-        right-legend-enter (-> plot
-                              (.select ".legend-container")
-                              (.selectAll ".legend-right")
-                              (.data (clj->js (:right-legend-items plot-info)))
-                              (.enter)
-                              (.append "g")
-                              (.attr #js {"class" "legend right"
-                                          "transform"
-                                          (fn [item i]
-                                            (let [tr-x (- (:width plot-info) (* (inc i) item-width))
-                                                  tr-y (- (- item-height
-                                                             (/ (- item-height square-size)
-                                                                2)))]
-                                              (gstring/format "translate(%s,%s)" tr-x  tr-y)))}))]
-    ;; left legend
-    (-> left-legend-enter
-        (.append "rect")
-        (.attr #js {"width" square-size
-                    "height" square-size
-                    ;; `aget` must be used here instead of direct field access.  See note in preamble.
-                    "class" #(aget % "classname")
-                    "transform"
-                    (fn [item i]
-                      (gstring/format "translate(%s,%s)" 0  (- (+ square-size))))}))
-    (-> left-legend-enter
-        (.append "text")
-        (.attr #js {"x" (+ square-size spacing)})
-        (.text #(aget % "text")))
-
-    ;; right legend
-    (-> right-legend-enter
-        (.append "rect")
-        (.attr #js {"width" square-size
-                    "height" square-size
-                    "class" #(aget % "classname")
-                    "transform"
-                    (fn [item i]
-                      (gstring/format "translate(%s,%s)" 0  (- (+ square-size))))}))
-    (-> right-legend-enter
-        (.append "text")
-        (.attr #js {"x" (+ square-size
-                           spacing)})
-        (.text #(aget % "text")))))

 (defn visualize-insights-bar! [el builds owner]
   (let [[y-pos-max y-neg-max] (->> [:build_time_millis :queued_time_millis]
@@ -219,10 +147,6 @@
         (.exit)
         (.remove))

-
-    ;; legend
-    (add-legend plot)
-
     ;; y-axis
     (-> plot
         (.select ".axis-container g.y-axis.positive")
@@ -263,9 +187,6 @@
                                                          (:left svg-info)
                                                          (:top svg-info))))]

-    (-> plot-area
-        (.append "g")
-        (.attr "class" "legend-container"))
     (-> plot-area
         (.append "g")
         (.attr "class" "grid-lines"))


Automatically switch to multiline input if newline

--- src-frontend/cljs/cljs_webrepl/editor.cljs
+++ src-frontend/cljs/cljs_webrepl/editor.cljs
@@ -1,6 +1,7 @@
 (ns cljs-webrepl.editor
   (:require
    [reagent.core :as r :refer [atom]]
+   [clojure.string :as str]
    [cljsjs.codemirror]
    [cljsjs.codemirror.mode.clojure]
    [cljsjs.codemirror.keymap.emacs]
@@ -50,8 +51,10 @@
   (swap! state assoc :input (.getValue editor)))

 (defn editor-key-enter [{:keys [input submit] :as props} editor event]
-  (submit input)
-  (.preventDefault event))
+  (when (not (.-shiftKey event))
+    (when (or (.-ctrlKey event) (not (str/includes? @input "\n")))
+      (submit input)
+      (.preventDefault event))))

 (defn editor-key-up [{:keys [history-prev state] :as props} editor event]
   (history-prev)
@@ -75,8 +78,7 @@
 (defn editor-key [props editor event]
   (when-let [name (key-code->name (.-keyCode event))]
     (case name
-      :enter (when (or (.-ctrlKey event) (not (.-shiftKey event)))
-               (editor-key-enter props editor event))
+      :enter (editor-key-enter props editor event)
       :up    (editor-key-up props editor event)
       :down  (editor-key-down props editor event)
       nil)))


Remove ssh-ad v1

Remove ssh-ad v1

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -288,15 +288,6 @@
                  :on-click #(raise! owner [:ssh-build-clicked build-info])}
                 "Retry this build with SSH enabled"]))])))))

-(defn ssh-ad
-  "Note about why you might want to SSH into a build and buttons to do so"
-  [build owner]
-    [:div.ssh-ad
-     [:p "Often the best way to troubleshoot problems is to ssh into a running or finished build to look at log files, running processes, and so on."]
-     (om/build ssh-buttons build)
-     [:p "This will grant you ssh access to the build's containers, prevent the deploy step from starting, and keep the build up for 30 minutes after it finishes to give you time to investigate."]
-     [:p "More information " [:a {:href (routes/v1-doc-subpage {:subpage "ssh-build"})} "in our docs"] "."]])
-
 (defn ssh-ad-v2
   "Note about why you might want to SSH into a build and buttons to do so"
   [build owner]
@@ -367,12 +358,8 @@
            (if for-current-user?
              (cond
                (build-model/ssh-enabled-now? build) (ssh-instructions build owner)
-               (build-model/finished? build) (if (feature/enabled? :ui-v2)
-                                               (ssh-ad-v2 build owner)
-                                               (ssh-ad build owner)))
-             (if (feature/enabled? :ui-v2)
-               (ssh-ad-v2 build owner)
-               (ssh-ad build owner)))])))))
+               (build-model/finished? build) (ssh-ad-v2 build owner))
+             (ssh-ad-v2 build owner))])))))

 (defn cleanup-artifact-path [path]
   (-> path


lower-case both sides when determining method ownership (#1612)

--- src/cljs/main/broadfcui/page/method_repo/method/summary.cljs
+++ src/cljs/main/broadfcui/page/method_repo/method/summary.cljs
@@ -33,7 +33,7 @@
    (fn [{:keys [props state locals]}]
      (let [{:keys [selected-snapshot refresh-snapshot]} props
            {:keys [managers]} selected-snapshot
-           owner? (contains? (set (map string/lower-case managers)) (user/get-email))
+           owner? (contains? (set (map string/lower-case managers)) (string/lower-case (user/get-email)))
            {:keys [body-id]} @locals
            on-method-created (fn [_ method-id]
                                (nav/go-to-path :method-summary method-id)


Added max-error parameter to Replace Newline With Space problem

--- src/clojush/problems/software/replace_space_with_newline.clj
+++ src/clojush/problems/software/replace_space_with_newline.clj
@@ -179,5 +179,5 @@
    :print-homology-data true
    :report-simplifications 0
    :final-report-simplifications 5000
-   ;:max-error 1
+   :max-error 1000
    })


add limit to select-lot-transactions

add limit to select-lot-transactions

--- src/clj_money/models/storage/sql_storage.clj
+++ src/clj_money/models/storage/sql_storage.clj
@@ -433,8 +433,9 @@
               {:criteria criteria})))
     (query db-spec (-> (h/select :*)
                        (h/from :lot_transactions)
-                       (h/where (map->where criteria))
-                       (h/order-by :trade_date))))
+                       (h/where (map->where (dissoc criteria :limit)))
+                       (h/order-by :trade_date)
+                       (append-limit criteria))))

   ; Transactions
   (select-transactions-by-entity-id


Rename replumb integration namespace

Rename replumb integration namespace

--- src/cljs/cljs_repl_web/code_mirror/core.cljs
+++ src/cljs/cljs_repl_web/code_mirror/core.cljs
@@ -5,7 +5,7 @@
             [cljs-repl-web.code-mirror.subs :as subs]
             [cljs-repl-web.code-mirror.editor :as editor]
             [cljs-repl-web.code-mirror.common :as common]
-            [cljs-repl-web.code-mirror.replumb :as replumb]
+            [cljs-repl-web.code-mirror.replumb :as replumb-proxy]
             [cljs-repl-web.code-mirror.utils :as utils]))

 ;;; many parts are taken from jaredly's reepl
@@ -45,7 +45,7 @@
   (into [:div] (map display-repl-item items)))

 (defn console []
-  (let [execute #(replumb/run-repl %1 {} %2)
+  (let [execute #(replumb-proxy/run-repl %1 {} %2)
         {:keys [add-input
                 add-result
                 go-up
@@ -61,7 +61,7 @@
                  (let [text (.trim text)]
                    (when (< 0 (count text))
                      (set-text text)
-                     (add-input text (replumb/current-ns))
+                     (add-input text (replumb-proxy/current-ns))
                      (execute text #(add-result (not %1) %2))
                      ;; todo - rethink better?
                      (when-let [example @(subscribe [:get-next-example :cljs-console])]
@@ -82,9 +82,9 @@
             :on-down go-down
             :on-change set-text
             :on-eval submit
-            :get-prompt replumb/get-prompt
+            :get-prompt replumb-proxy/get-prompt
             :should-eval (fn [source _ _]
-                           (not (replumb/multiline? source)))})]])
+                           (not (replumb-proxy/multiline? source)))})]])
       :component-did-update
       (fn [this]
         (common/scroll-to-el-bottom! (.-parentElement (reagent/dom-node this))))})))


Fix indentation.

Fix indentation.

--- src/afterglow/controllers/ableton_push.clj
+++ src/afterglow/controllers/ableton_push.clj
@@ -958,7 +958,7 @@
       (doseq [x (range 0 8)]
         (let [lightness-index (if (> x 3) (- 7 x) x)
               lightness ([10 30 50 70] lightness-index)
-color (colors/create-color
+              color (colors/create-color
                      :h (+ 60 (* 40 (- @counter 18))) :s 100 :l lightness)]
           (set-pad-color controller x (- 25 @counter) color)))


Fix bug when project name wasn't updated.

--- src/cljs/hatnik/web/client/components.cljs
+++ src/cljs/hatnik/web/client/components.cljs
@@ -102,9 +102,7 @@
            (dom/button
             #js {:className "btn btn-default"
                  :type "button"
-                 :onClick #(pmenu/show {:project-id (:id project)
-                                        :name (:name project)
-                                        :type (:type project)})}
+                 :onClick #(pmenu/show @project)}
             (dom/span #js {:className "glyphicon glyphicon-pencil pull-right"}))))

 (defn project-view [prj owner]


reverse inserted edges in dim-draw before storing in C

--- src/main/clojure/conexp/layouts/dim_draw.clj
+++ src/main/clojure/conexp/layouts/dim_draw.clj
@@ -104,16 +104,11 @@
                                   (uber/pprint (transitive-edge-union P <= C))
                                   (println "I:")
                                   (uber/pprint I)
-                                  (println C (sat-reduction I))
-                                  (union C (sat-reduction I)))))
+                                  (println C " <-- C ; new -->" (sat-reduction I))
+                                  (union C (map reverse (sat-reduction I))))))
                  (let [C @CAtom
-                       C-bar-graph (transitive-closure (apply uber/digraph C))
-                       ;<=CNew (compute-conjugate-order P #(or (<= %1 %2) (lg/has-edge? C-bar-graph %2 %1)))] ;why \bar C? why not union?
-                       ;<=CNew (compute-conjugate-order (transitive-edge-union P <= #(lg/has-edge? C-bar-graph %1 %2)))]
-                       <=CNew (compute-conjugate-order (transitive-edge-union P <= #(lg/has-edge? C-bar-graph %2 %1)))]
+                       <=CNew (compute-conjugate-order (transitive-edge-union P <= C))]
                    (println "C: " C)
-                   (println "C-bar-graph:")
-                   (uber/pprint C-bar-graph)
                    (println "<=CNew: " <=CNew)
                    (reset! <=CAtom
                            <=CNew)))


oops, broke release

oops, broke release

--- src/main/shadow/cljs/devtools/compiler.clj
+++ src/main/shadow/cljs/devtools/compiler.clj
@@ -217,7 +217,7 @@
       (process-stage :compile-finish true)))

 (defn optimize
-  [{:keys [mode] :as state}]
+  [{::keys [mode] :as state}]
   {:pre [(cljs/compiler-state? state)]
    :post [(cljs/compiler-state? %)]}
   (-> state


Fence as many peers as possible when only some of them are going to shift to a new task.

--- src/onyx/scheduling/common_job_scheduler.clj
+++ src/onyx/scheduling/common_job_scheduler.clj
@@ -264,15 +264,15 @@
   [replica jobs task-seq peer->vm task->node planned-capacities]
   (reduce
    (fn [result [job-id task-id :as id]]
-     (if (>= (get-in planned-capacities [job-id task-id])
-             (count (get-in replica [:allocations job-id task-id])))
+     (let [expected-count (get-in planned-capacities [job-id task-id])
+           actual-count (count (get-in replica [:allocations job-id task-id]))
+           n-fenced (min expected-count actual-count)]
        (into result (map
                      (fn [p]
                        (let [ctasks (constrainted-tasks-for-peer replica jobs (get-in replica [:peer-tags p]))]
                          (Fence. (peer->vm p)
                                  (into #{} (map task->node (conj ctasks id))))))
-                     (get-in replica [:allocations job-id task-id])))
-       result))
+                     (take n-fenced (get-in replica [:allocations job-id task-id]))))))
    []
    task-seq))


Be more clear in comment in src/active/clojure/validation.cljc

Co-authored-by: kaaninho <f950d10c4916556a5d4bff6a6dc331bacbf26608@active-group.de>

--- src/active/clojure/validation.cljc
+++ src/active/clojure/validation.cljc
@@ -256,7 +256,7 @@
   of the value that could not be validated."
   [validators candidate & [label]]
   ;; Choice is interesting because we need to have exactly one
-  ;; validator validate the candidate.
+  ;; validator successfully validate the candidate.
   (let [validation-results   (mapv (fn [validate] (validate candidate label)) validators)
         groups               (group-by validation-success? validation-results)
         successes            (get groups true)


(RE-8861) Add managed dependencies to dependency map

Before this commit we were only listing the dependencies which were
listed in the dependencies field which may not include everything. This
commit adds the managed dependencies to the list of dependencies to
consider when building out the dependency map.

--- src/puppetlabs/ezbake/dependency_utils.clj
+++ src/puppetlabs/ezbake/dependency_utils.clj
@@ -253,7 +253,7 @@
 (defn generate-dependency-map
   [lein-project]
   (aether/dependency-hierarchy
-   (:dependencies lein-project)
+    (concat (:dependencies lein-project) (:managed-dependencies lein-project))
    (aether/resolve-dependencies
     :coordinates (:dependencies lein-project)
     :managed-coordinates (:managed-dependencies lein-project)


Minor: change stat description

Minor: change stat description


remove TODO

remove TODO

--- src-cljs/frontend/components/app.cljs
+++ src-cljs/frontend/components/app.cljs
@@ -154,7 +154,6 @@
                  ;;     expanding all datastructures.
                  (om/build inspector/inspector app))

-               ;; TODO: put behind banner feature flag
                (when (and (feature/enabled? :ui-v2-opt-in-banner) (not (feature/enabled-in-cookie? :ui-v2)))
                  (om/build opt-in/ui-v2-opt-in-banner app))


IndexedSeq

IndexedSeq

--- examples/lesson-carousel-starter-kit/src/carousel/core.cljs
+++ examples/lesson-carousel-starter-kit/src/carousel/core.cljs
@@ -20,15 +20,16 @@

 (defn decorate-dots [dots-node]
   (let [dot-nodes (.. dots-node getChildren)
-        resize (clj->js {:onSizeChange (fn [size]
-                                         (println "onSizeChange " size)
-                                         (let [dotWidth 10
+        resize (clj->js {:onSizeChange (fn [^Float32Array size]
+                                         (let [size (IndexedSeq. size 0)
+                                               dotWidth 10
                                                numPages 5
                                                spacing 5
                                                totalDotSize (+ (* numPages dotWidth)
                                                                (* spacing (dec numPages)))
                                                start-x (/ (- (nth size 0) totalDotSize)
                                                           2)]
+                                           (println size)
                                            (doseq [n (range (count dot-nodes))
                                                    :let [dot-node (nth dot-nodes n)]]
                                              (.. dot-node (setPosition (+ start-x


[#2127] Fix spec definition. Metadata is a vector not a map

--- backend/specs/akvo/lumen/specs/import/values.clj
+++ backend/specs/akvo/lumen/specs/import/values.clj
@@ -37,7 +37,7 @@
                      string?
                      #(s/gen #{"c1" "c2" "c3"})))

-(s/def ::metadata (s/nilable map?))
+(s/def ::metadata (s/nilable vector?))

 (s/def ::title (s/with-gen
                         string?


Make queuing work

Make queuing work

- Todo refactor to use records instead of the arcane map

--- server/src/clinicico/server/network/broker.clj
+++ server/src/clinicico/server/network/broker.clj
@@ -9,7 +9,7 @@

 (def ^:private worker-pool (ref {}))
 (def ^:private context (zmq/context 2))
-(def ^:private max-ttl 5000) ;; in millis
+(def ^:private max-ttl 3000) ;; in millis
 (def ^:private ttl-pool (at/mk-pool))

 (defn- check-workers
@@ -18,47 +18,65 @@
    (map
     (fn [[method workers]]
       (dosync
-       (let [curr (:ttl workers)
+       (let [curr (:expiry workers)
              expired (select-keys curr (for [[addr ttl] curr :when (> (- (now) ttl) max-ttl)] addr))
              expired? (fn [addr] (some #(= addr %) (keys expired)))
-             queue (get-in @pool [method :queue])]
-         (when (seq expired) (log/warn (count expired) "workers were expired:" (keys expired)))
-         (alter pool assoc-in [method :ttl] (apply (partial dissoc curr) (keys expired)))
-         (alter pool assoc-in [method :queue]
+             waiting (get-in @pool [method :waiting])]
+         (when (seq expired) (log/warn "workers were expired:" (keys expired)))
+         (alter pool assoc-in [method :expiry] (apply (partial dissoc curr) (keys expired)))
+         (alter pool assoc-in [method :waiting]
                 (into PersistentQueue/EMPTY
                       (select (comp not expired?)
-                              (set (take (count queue) queue))))))))
+                              (set (take (count waiting) waiting))))))))
     @pool)))

 ;; Periodically check the workers
 (at/every 1000 #(check-workers worker-pool) ttl-pool)

-(defn bind-socket
+(defn- bind-socket
   [context type address]
   (zmq/bind (zmq/socket context type) address))

-(defn put-worker [pool method address]
+(defn- put-worker
+  [pool method address]
   (dosync
-   (let [queue (get-in @pool [method :queue] PersistentQueue/EMPTY)]
-     (alter pool assoc-in [method :ttl address] (now))
-     (alter pool assoc-in [method :queue] (conj queue address)))))
+   (let [requests (get-in @pool [method :requests] PersistentQueue/EMPTY)
+         queue (get-in @pool [method :waiting] PersistentQueue/EMPTY)]
+     (alter pool assoc-in [method :requests] requests)
+     (alter pool assoc-in [method :expiry address] (now))
+     (alter pool assoc-in [method :waiting] (conj queue address)))))

-(defn pop-worker
-  [pool method]
-  (dosync
-   (let [queue (get-in @pool [method :queue])
-         worker (peek queue)]
-     (alter pool assoc-in [method :queue] (pop queue))
-     worker)))
+(defn- pop-atom
+  [key]
+  (fn [pool method]
+    (dosync
+     (let [queue (get-in @pool [method key])
+           worker (peek queue)]
+       (alter pool assoc-in [method key] (pop queue))
+       worker))))
+
+(def pop-worker (pop-atom :waiting))
+(def pop-request (pop-atom :requests))

 (defn service-available?
   [service]
-  (> (count (get-in @worker-pool [service :ttl])) 0))
+  (> (count (get-in @worker-pool [service :expiry])) 0))

 (defn- update-ttl
-  [pool method address ttl]
+  [pool method address expiry]
   (dosync
-   (alter pool assoc-in [method :ttl address] ttl)))
+   (alter pool assoc-in [method :expiry address] expiry)))
+
+(defn- dispatch
+  [socket [_ method request :as msg]]
+  (dosync
+   (when-not (nil? request) (alter worker-pool update-in [method :requests] #(conj % msg)))
+   (while (and (not (empty? (get-in @worker-pool [method :waiting])))
+               (not (empty? (get-in @worker-pool [method :requests]))))
+     (let [[client-addr method request] (pop-request worker-pool method)
+           worker-addr (pop-worker worker-pool method)]
+       (log/debug "[broker] dispatching!" client-addr "to" (format "%s:%s" method worker-addr))
+       (q/send-frame socket worker-addr q/MSG-REQ client-addr request)))))

 (defn router-fn
   [frontend-address backend-address]
@@ -70,22 +88,15 @@
       (while (not (.. Thread currentThread isInterrupted))
         (zmq/poll poller)
         (if (zmq/check-poller poller 0 :pollin)
-          (let [[client-addr method request] (q/receive frontend [String String zmq/bytes-type])
-                worker-addr (pop-worker worker-pool method)]
-            (if-not (nil? worker-addr)
-              (do
-                (log/debug "[router] dispatching" method "from" client-addr "to" worker-addr)
-                (q/send-frame backend worker-addr q/MSG-REQ client-addr request))
-              (do
-                (log/debug "[router] no workers for" method)
-                (q/send-frame frontend client-addr q/STATUS-ERROR "No workers available")))))
+          (dispatch backend (q/receive frontend [String String zmq/bytes-type])))
         (if (zmq/check-poller poller 1 :pollin)
           (let [[worker-addr msg-type method] (q/receive backend [String Byte String])]
             (condp = msg-type
               q/MSG-PING  (do (update-ttl worker-pool method worker-addr (now))
                               (q/send-frame backend worker-addr q/MSG-PONG))
               q/MSG-READY (do (log/debug "[router] READY from" worker-addr "for" method)
-                              (put-worker worker-pool method worker-addr))
+                              (put-worker worker-pool method worker-addr)
+                              (dispatch backend [worker-addr method]))
               q/MSG-REP   (let [[client-addr reply] (q/receive-more backend [String zmq/bytes-type])]
                             (q/send-frame frontend client-addr q/STATUS-OK reply)))))))))


Run prepared statement inserts with fewer documents

Prepared statements have a limit in Cassandra 2.0.x.

--- test/clojurewerkz/cassaforte/stress_test.clj
+++ test/clojurewerkz/cassaforte/stress_test.clj
@@ -16,6 +16,15 @@
       (truncate table)
       (println "Inserting " n " documents...")
       (time (insert-batch table docs))
+      (is (= n (perform-count table))))))
+
+(deftest insert-test
+  (doseq [n [10 1000 3000]]
+    (let [table  :users
+          docs   (map (fn [i]
+                        {:name (str "user_" i) :city (str "city_" i) :age (int i)})
+                      (take n (iterate inc 1)))]
+      (truncate table)
       (println "Inserting " n " documents with prepared statement...")
       (time (client/prepared (insert-batch table docs)))
       (is (= n (perform-count table))))))


Maybe pass arguments in the right order?

--- src/caesium/crypto/generichash.clj
+++ src/caesium/crypto/generichash.clj
@@ -12,3 +12,4 @@
                :or {salt sixteen-nuls
                     personal sixteen-nuls
                     key (byte-array 0)}}]
+     (.blake2 (new Hash) message key salt personal)))


only show subscribed channels under channels in sidebar

--- src/chat/client/views/sidebar.cljs
+++ src/chat/client/views/sidebar.cljs
@@ -80,6 +80,7 @@
           (apply dom/div nil
             (->> (@store/app-state :tags)
                  vals
+                 (filter (fn [t] (store/is-subscribed-to-tag? (t :id))))
                  (take 5)
                  (map (fn [tag]
                         (dom/div nil (om/build tag-view tag) (str "[" (rand-int 10) "]")))))))


Added shift logic fix.

Added shift logic fix.

--- src/cljc/lander/game_launcher.cljc
+++ src/cljc/lander/game_launcher.cljc
@@ -23,8 +23,8 @@
     (for [i (range d) j (range d) :when (= 1 (get-in shape [i j]))]
       (mapv + [i j] shape-pos))))

-(defn valid? [state]
-  (every? (fn [[x y]] (and (<= 0 x 9) (< y 22))) (shape-coords state)))
+(defn valid? [{:keys [board] :as state}]
+  (every? (fn [[x y :as c]] (and ((complement board) c) (<= 0 x 9) (< y 22))) (shape-coords state)))

 (defn x-shift [state f]
   (let [shifted (update-in state [:shape-pos 0] f)]


Correct simple sentiment analysis namespace.

--- src/cljs-nlp/sentiment/simple.cljs
+++ src/cljs-nlp/sentiment/simple.cljs
@@ -1,4 +1,4 @@
-(ns cljs-nlp.sentiment.core
+(ns cljs-nlp.sentiment.simple
   (:use [clojure.string :only [lower-case split]]
         [cljs.reader :only [read-string]]))


reformat

reformat

--- src/cljs/tictactoe/view/board.cljs
+++ src/cljs/tictactoe/view/board.cljs
@@ -24,5 +24,6 @@
   (into
     (utils/square-svg-panel board)
     (for [[cell-pos cell-owner] (board/get-cells board)]
-      [render-one-cell cell-owner cell-pos {:on-click #(on-move-event cell-pos)}]
+      [render-one-cell cell-owner cell-pos
+       {:on-click #(on-move-event cell-pos)}]
       )))


fix spec

fix spec

--- src/cljs/triboard/logic/board.cljs
+++ src/cljs/triboard/logic/board.cljs
@@ -38,18 +38,20 @@
 ;; Public Types
 ;; -----------------------------------------

-(s/def ::board (s/coll-of (s/coll-of cst/cell? :count 11) :count 16))
+(s/def ::board (s/every (s/every cst/cell? :count 11) :count 16))
 (s/def ::coord (s/tuple integer? integer?))

-(s/fdef new-board :ret ::board)
+(s/fdef new-board
+  ;; :args
+  :ret ::board)

 (s/fdef to-iterable
   :args (s/cat :board ::board)
-  :ret (s/coll-of (s/tuple ::coord cst/cell?)))
+  :ret (s/every (s/tuple ::coord cst/cell?))) ;; Success with (s/explain `to-iterable to-iterable)

 (s/fdef empty-cells
   :args (s/cat :board ::board)
-  :ret (s/coll-of ::coord)) ;; TODO - Fails with empty collection, also fails with a s/or!
+  :ret (partial every? #(s/valid? ::coord %))) ;; TODO - Fails with coll-of ::coord. WHY?

 (defn board?
   "A board is a vector of vector of cells"


Add more body parts to monsters

Add more body parts to monsters

--- src/dungeon_crusade/monstergen.clj
+++ src/dungeon_crusade/monstergen.clj
@@ -19,7 +19,7 @@
    9
    0
    1.1
-   #{:head :neck :body :leg :tail}
+   #{:face :head :neck :body :leg :tail}
    #{:bite :claw}
    :follow-player-in-range-or-random
    5
@@ -49,7 +49,7 @@
    3
    0
    1.1
-   #{:head :claw :abdomen :tail}
+   #{:head :claw :leg :abdomen :tail}
    #{:bite :claw :sting-venom}
    :follow-player-in-range-or-random
    4
@@ -109,7 +109,7 @@
    2
    0
    0.9
-   #{:head :body :tail :leg}
+   #{:head :face :body :tail :leg}
    #{:bite}
    :follow-player-in-range-or-random
    4
@@ -124,7 +124,7 @@
    13
    0
    1.2
-   #{:head :body :tail :leg :face :arm}
+   #{:head :neck :body :tail :leg :face :arm}
    #{:bite :punch}
    :follow-player-in-range-or-random
    10
@@ -169,7 +169,7 @@
    4
    0
    0.5
-   #{:head :body :leg :face :shell}
+   #{:head :neck :body :leg :face :shell}
    #{:bite}
    :follow-player-in-range-or-random
    5


Settling on an async agent impl using futures to deposit/withdraw

--- clojure/src/app/core.clj
+++ clojure/src/app/core.clj
@@ -2,25 +2,43 @@
   (:refer-clojure :exclude [map reduce into partition partition-by take merge])
   (:require [clojure.core.async :refer :all :as async]))

-; function to add some value 'c' to 'n'
-(defn increment [c n] (+ c n))
+;;; "deposits" money into a given bank account
+(defn deposit [c n]
+  (println (str "Depositing $" n " dollars"))
+  (+ c n))
+
+;;; "withdraws" money from a given bank account
+(defn withdraw [c n]
+  (println (str "Withdrawing $" n " dollars"))
+  (- c n))
+
+;;; Wrapper for Thread.sleep. Reads a bit better
+(defn sleep-for [n]
+  (Thread/sleep n))

 (defn example []
-  (let [
-         ; start with a bank account of balance zero
-         bank-account (agent 0)]

-    (send bank-account increment 5)
+  ;; start with a bank account of balance zero
+  (let [bank-account (agent 0)
+        nTransactions 5]

-    (Thread/sleep 1000)
+    (future
+      (dotimes [n nTransactions]
+        (sleep-for (rand 500))
+        (send bank-account deposit 5)))

-    ; print output
-    (println @bank-account)))
+    (future
+      (dotimes [n (- nTransactions 1)]
+        (sleep-for (rand 500))
+        (send bank-account withdraw 5)))

-; onward!
+    (sleep-for 5000)
+
+    ;; print output
+    (println (str "Remaining balance " @bank-account))))
+
+;; onward!
 (example)
-(example)
-(example)
-(example)
-(example)
-(example)
+
+;; required cleanup for threads in the background
+(shutdown-agents)


if-let style change.

if-let style change.

--- src/kixi/hecuba/api/properties.clj
+++ src/kixi/hecuba/api/properties.clj
@@ -29,8 +29,8 @@
   (db/with-session [session (:hecuba-session store)]
     (let [request (:request ctx)]
       (let [coll (->> (db/execute session
-                                  (if (project_id-from ctx)
-                                    (hayt/select :entities (hayt/where [[= :project_id (-> (:route-params request) :project_id)]]))
+                                  (if-let [project_id (project_id-from ctx)]
+                                    (hayt/select :entities (hayt/where [[= :project_id project_id]]))
                                     (hayt/select :entities)))
                       (map #(assoc %
                               :property_data (if-let [property_data (:property_data %)]


Update version of ClojureScript to 0.0-2173

--- src/leiningen/new/mies/project.clj
+++ src/leiningen/new/mies/project.clj
@@ -3,7 +3,7 @@
   :url "http://example.com/FIXME"

   :dependencies [[org.clojure/clojure "1.5.1"]
-                 [org.clojure/clojurescript "0.0-2138"]]
+                 [org.clojure/clojurescript "0.0-2173"]]

   :plugins [[lein-cljsbuild "1.0.2"]]


Add support for Ctrl-Enter keybinding.

Add support for Ctrl-Enter keybinding.

--- src/cljs/editor/quil_site/editor.cljs
+++ src/cljs/editor/quil_site/editor.cljs
@@ -42,11 +42,32 @@
   (.tab (j/$ "#source-tab") "show")
   (set-errors [error]))

-(defn compile []
-  (.clearGutter @editor "CodeMirror-lint-markers")
-  (let [code (.getValue @editor)]
-    (println "Compiling" code)
-    (c/run code)))
+(defn compile
+  ([] (compile (.getValue @editor)))
+  ([code]
+   (.clearGutter @editor "CodeMirror-lint-markers")
+   (c/run code)))
+
+(defn get-ns-part [code]
+  (loop [[fst & rst] (cstr/trim code)
+         accum ""
+         balance 0]
+    (if (or (and (zero? balance) (not (empty? accum)))
+            (nil? fst))
+      accum
+      (recur rst (str accum fst)
+             (+ balance
+                (condp contains? fst
+                  #{\[ \( \{} 1
+                  #{\] \) \}} -1
+                  0))))))
+
+(defn compile-selected []
+  (let [selection (.getSelection @editor)
+        code (.getValue @editor)]
+    (if (empty? selection)
+      (compile code)
+      (compile (str (get-ns-part code) \newline selection)))))

 (def popover-template
   "<div id=\"share-dialog\">
@@ -131,13 +152,14 @@
             :lint #js {:options #js {:cljsErrors #js []}}
             :viewportMargin js/Infinity
             :matchBrackets true
-            :autoCloseBrackets true}))
+            :autoCloseBrackets true
+            :extraKeys #js {"Ctrl-Enter" compile-selected}}))
   (j/ajax
    {:url (str "/sketches/info/" (j/data (j/$ "#source") "sketch-id"))
     :method "GET"
     :success #(.setValue @editor (.-cljs %))})

-  (j/on (j/$ "#send") "click" compile)
+  (j/on (j/$ "#send") "click" #(compile))
   (j/on (j/$ "#reset") "click" reset-iframe)
   (j/on (j/$ "#share") "click" share)
   (j/on (j/$ "body") "click" "#share-dialog input" #(this-as el (.select el)))


added documentation to timeout

added documentation to timeout

--- src/cljs/wilkerdev/util/reactive.cljs
+++ src/cljs/wilkerdev/util/reactive.cljs
@@ -374,7 +374,10 @@
             (recur (dec i))
             e))))))

-(defn timeout [c msec]
+(defn timeout
+  "Do an alt! between channel c and a timout with msec milli seconds.
+  In case the timeout is the taken, a timeout error will be returned."
+  [c msec]
   (go
     (alt!
       c ([x] x)


Remove transparency code and make editor appear fixed on the right

--- desktop/src/nightmod/core/desktop_launcher.clj
+++ desktop/src/nightmod/core/desktop_launcher.clj
@@ -3,11 +3,15 @@
             [nightmod.core :refer :all]
             [seesaw.core :as s])
   (:import [com.badlogic.gdx.backends.lwjgl LwjglApplication]
-           [java.awt BorderLayout Canvas Color Panel]
+           [java.awt BorderLayout Canvas Dimension]
            [org.fife.ui.rsyntaxtextarea FileLocation SyntaxConstants
             TextEditorPane Theme]
            [org.lwjgl.input Keyboard])
   (:gen-class))
+
+(def ^:const window-width 1200)
+(def ^:const window-height 768)
+(def ^:const editor-width (/ window-width 2))

 (defn set-theme!
   [text-area path]
@@ -15,10 +19,7 @@
       io/resource
       io/input-stream
       Theme/load
-      (.apply text-area))
-  (when-let [c (.getBackground text-area)]
-    (.setBackground text-area
-      (Color. (.getRed c) (.getGreen c) (.getBlue c) 128))))
+      (.apply text-area)))

 (defn create-text-area
   ([]
@@ -31,7 +32,7 @@
               (proxy-super processKeyBinding ks e condition pressed)))
       (.setAntiAliasingEnabled true)
       (set-theme! "dark.xml")
-      (.setOpaque false)))
+      (.setPreferredSize (Dimension. editor-width window-height))))
   ([path]
     (doto (create-text-area)
       (.load (FileLocation/create path) nil)
@@ -52,13 +53,13 @@
   []
   (s/invoke-later
     (doto (s/frame :title "Nightmod"
-                   :width 800
-                   :height 600
+                   :width window-width
+                   :height window-height
                    :on-close :exit)
       (-> .getContentPane (.add (create-canvas)))
       (-> .getGlassPane (doto
                           (.setLayout (BorderLayout.))
-                          (.add (create-text-area) BorderLayout/CENTER)
+                          (.add (create-text-area) BorderLayout/EAST)
                           (.setVisible true)))
       s/show!))
   (Keyboard/enableRepeatEvents true))


Remove the & from the matchers. It currently serves no purpose other than this detection. Will likely change.

--- src/midje/parsing/lexical_maps.clj
+++ src/midje/parsing/lexical_maps.clj
@@ -64,7 +64,7 @@

 (defn- arg-matchers [arg-matchers]
   (if (= (str (first arg-matchers)) "&")
-    `(from-fake-maps/mkfn:arity-arg-matchers ~(vec arg-matchers))
+    `(from-fake-maps/mkfn:arity-arg-matchers ~(rest (vec arg-matchers)))
     `(from-fake-maps/mkfn:arg-matchers ~(vec arg-matchers))))


Don't log mtrx9.controllers.matrices.update requests.

The rest of the implementation is lightweight; logging each request is
relatively quite expensive. Also, we probably don't really care what's
being sent, as it's being relayed to browsers directly, and there's no
storage.

--- src/mtrx9/controllers/matrices.clj
+++ src/mtrx9/controllers/matrices.clj
@@ -26,7 +26,6 @@
   (ring/redirect (str "/matrices/" (rand-matrix-id))))

 (defn update [id streams]
-  (println (str "[" (str (time/now)) "] " id  " <- " streams))
   (enqueue (named-channel id nil) (encode-json->string {:streams streams}))
   {:status 204})


matcher-combinators: Tweak comment

matcher-combinators: Tweak comment

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
@@ -13,7 +13,7 @@
 ;;;; Note that `m/mismatch` should generally be avoided.

 (deftest match-with-explicit-matchers-test
-  ;; TODO: When is this useful? /eg/ Just `(is (match? 37 (+ 29 8)))`
+  ;; TODO: When is this useful? Just /eg/ `(is (match? 37 (+ 29 8)))`
   ;;       works fine.
   (is (match? (m/equals 37)
               (+ 29 8)))


Removing alia protocol extension for batchstatment as unnessary

--- src/org/spootnik/cyanite/store.clj
+++ src/org/spootnik/cyanite/store.clj
@@ -127,12 +127,6 @@
                  (map (comp first val))
                  (sort-by :time)
                  (map :metric))))
-
-(comment "Extend/hack alia's query to statement protocol to pass through batches")
-(extend-protocol alia/PStatement
-  BatchStatement
-  (query->statement [q _]
-    q))

 (defn- batch
   "Creates a batch of prepared statements"


CMR-1265 Adds more publication reference fields to DIF test XML

--- umm-lib/test/cmr/umm/test/dif/collection.clj
+++ umm-lib/test/cmr/umm/test/dif/collection.clj
@@ -275,9 +275,18 @@
       <Author>author</Author>
       <Publication_Date>2015</Publication_Date>
       <Title>title</Title>
+      <Series>1</Series>
+      <Edition>2</Edition>
+      <Volume>3</Volume>
+      <Issue>4</Issue>
+      <Report_Number>5</Report_Number>
       <Publication_Place>Frederick, MD</Publication_Place>
       <Publisher>publisher</Publisher>
+      <Pages>678</Pages>
+      <ISBN>978-0-394-80001-1</ISBN>
+      <Online_Resource>http://example.com</Online_Resource>
       <DOI>http://dx.doi.org/12.3456/ABC012XYZ</DOI>
+      <Other_Reference_Details>blah</Other_Reference_Details>
     </Reference>
     <Related_URL>
       <URL_Content_Type>
@@ -413,9 +422,18 @@
                                                {:author "author"
                                                 :publication-date "2015"
                                                 :title "title"
+                                                :series "1"
+                                                :edition "2"
+                                                :volume "3"
+                                                :issue "4"
+                                                :report-number "5"
                                                 :publication-place "Frederick, MD"
                                                 :publisher "publisher"
-                                                :doi "http://dx.doi.org/12.3456/ABC012XYZ"})]
+                                                :pages "678"
+                                                :isbn "978-0-394-80001-1"
+                                                :related-url "http://example.com"
+                                                :doi "http://dx.doi.org/12.3456/ABC012XYZ"
+                                                :other-reference-details "blah"})]
                     ;:spatial-keywords ["Word-2" "Word-1" "Word-0"]
                     :platforms [(umm-c/map->Platform
                                   {:short-name "SPOT-1"


Updated dependencies

Updated dependencies

--- src/leiningen/new/cryogen/project.clj
+++ src/leiningen/new/cryogen/project.clj
@@ -5,7 +5,7 @@
                       :url "http://www.eclipse.org/legal/epl-v10.html"}
             :dependencies [[org.clojure/clojure "1.6.0"]
                            [ring/ring-devel "1.3.2"]
-                           [compojure "1.3.1"]
+                           [compojure "1.3.2"]
                            [ring-server "0.4.0"]
                            [cryogen-markdown "0.1.1"]
                            [cryogen-core "0.1.20"]]


changes

changes

--- src/main/clojure/czlab/basal/core.clj
+++ src/main/clojure/czlab/basal/core.clj
@@ -10,7 +10,7 @@

   "Useful additions to clojure core & string."

-  (:refer-clojure :exclude [send])
+  (:refer-clojure :exclude [send next])

   (:require [clojure.set :as ct]
             [clojure.string :as cs]
@@ -3111,6 +3111,11 @@
   (set-trigger [_ t] ""))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defprotocol Nextable
+  "Something that has a next."
+  (next [_] ""))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defprotocol Versioned
   "Something that has a version."
   (version [_] ""))


added type hints

added type hints

--- src/main/clojure/czlab/basal/util.clj
+++ src/main/clojure/czlab/basal/util.clj
@@ -631,7 +631,7 @@
         false
         (and (bytes? a)
              (bytes? b))
-        (== 0 (Arrays/compare a b))
+        (== 0 (Arrays/compare ^bytes a ^bytes b))
         :else
         (.equals ^Object a b)))


Added helper function to allow easy starting of a NGServer

This allows to fire up easily a nailgun server if the system is owned
by a different application. Use cases are external Repls, servers
(during development), etc.

Refers #23

--- src/main/clojure/vimclojure/nails.clj
+++ src/main/clojure/vimclojure/nails.clj
@@ -27,7 +27,18 @@
                  [backend :as backend]))
   (:import
      java.io.BufferedReader
-     com.martiansoftware.nailgun.NGContext))
+     com.martiansoftware.nailgun.NGContext
+     com.martiansoftware.nailgun.NGServer))
+
+(defn start-server-thread
+  "Start a nailgun server in a dedicated daemon thread. host defaults
+  to 127.0.0.1, port to 2113."
+  ([]     (start-server-thread "127.0.0.1" 2113))
+  ([host] (start-server-thread host 2113))
+  ([host port]
+   (doto (Thread. #(NGServer/main (into-array [(str host ":" port)])))
+     (.setDaemon true)
+     (.start))))

 (defmacro defnail
   "Define a new Nail of the given name. The arguments is a command line


fix typo

fix typo

--- src/metabase/task/execute_queries.clj
+++ src/metabase/task/execute_queries.clj
@@ -1,8 +1,8 @@
 (ns metabase.task.execute-queries
-  (require (metabase [db :refer :all]
-                     [driver :as driver]
-                     [task :refer :all])
-           [metabase.models.query :refer [Query]]))
+  (:require (metabase [db :refer :all]
+                      [driver :as driver]
+                      [task :refer :all])
+            [metabase.models.query :refer [Query]]))

 (defn execute-queries []
   "Execute all `Querys` in the database, one-at-a-time."


Add lein instant cheatsheet.

Add lein instant cheatsheet.


Don't follow symbolic links when deleting a working dir

--- src/cider_ci/ex/trials/working_dir_sweeper.clj
+++ src/cider_ci/ex/trials/working_dir_sweeper.clj
@@ -29,16 +29,21 @@
   (->> (clj-fs/list-dir (get-working-dir))
        (filter clj-fs/directory?)))

-(defn- delete [dir]
+(defn- delete-recursively [file-or-string]
   (catcher/wrap-with-suppress-and-log-warn
-    (clj-fs/delete-dir dir)))
+    (let [file (clojure.java.io/file file-or-string)]
+      (when (.exists file)
+        (when (and (.isDirectory file) (not (Files/isSymbolicLink (.toPath file))))
+          (doseq [file (.listFiles file)]
+            (delete-recursively file)))
+        (.delete file)))))

 (defn- delete-orphans []
   (doseq [working-dir (get-trial-dirs)]
     (when-let [base-name (clj-fs/base-name working-dir)]
       (when-not (cider-ci.ex.trials.state/get-trial base-name)
         (logging/info "deleting working-dir " working-dir)
-        (delete working-dir)))))
+        (delete-recursively working-dir)))))

 (defdaemon "trial-working-dir-sweeper"
   1 (delete-orphans))


Try to handle ACKs from parent (WIP)

Try to handle ACKs from parent (WIP)

Before, I was [unsuccessfully] setting the time-sent flag to 0, then
forgetting about them.

This version hasn't been tested, so I'm not sure it's an actual
improvement. But at least I'm doing *something* with them.

--- src/clojure/frereth_cp/message/from_parent.clj
+++ src/clojure/frereth_cp/message/from_parent.clj
@@ -110,13 +110,12 @@
                      :packet ::specs/packet)
         :ret ::start-stop-details)
 (defn calculate-start-stop-bytes
-  "calculate start/stop bytes (lines 562-574)"
+  "Extract start/stop ACK addresses (lines 562-574)"
   [{{:keys [::specs/receive-bytes
             ::specs/receive-written]
      :as incoming} ::specs/incoming
     :keys [::specs/message-loop-name]
     :as state}
-   ;; Q: Isn't this a byte array now?
    {^ByteBuf incoming-buf ::specs/buf
     D ::specs/size-and-flags
     start-byte ::specs/start-byte
@@ -326,7 +325,8 @@
           ;; The gap-buffer that we are *not* updating is about
           ;; arriving messages that might have been dropped/misordered
           ;; due to UDP issues.
-          (log/debug "Discarding a pure ACK")
+          (log/debug (str message-loop-name
+                          ": Pure ACK never updates gap-buffer"))
           state)))))

 (s/fdef flag-acked-others!
@@ -358,7 +358,7 @@
                    [::specs/ack-gap-4->5 ::specs/ack-length-5] ; 30-32
                    [::specs/ack-gap-5->6 ::specs/ack-length-6]])] ; 34-36
     (log/debug (str message-loop-name
-                    ": Gaps: " (into [] gaps)
+                    ": ACK'ing with Gaps: " (into [] gaps)
                     "\nState: " state))
     (->
      (reduce (fn [{:keys [::stop-byte]
@@ -505,19 +505,20 @@
             ;; so it shouldn't happen here.
             acked-blocks (filter #(= ack-id (::specs/message-id %))
                                  un-acked-blocks)
-            flagged (-> (reduce flow-control/update-statistics
-                                ;; Remove parent->buffer.
-                                ;; It's been parsed into packet
-                                (update state ::specs/incoming
-                                        dissoc
-                                       ::specs/parent->buffer)
-                                acked-blocks)
-                        ;; That takes us down to line 544
-                        ;; It seems more than a bit silly to calculate flag-acked-others!
-                        ;; if the incoming message is a pure ACK (i.e. message ID 0).
-                        ;; Leave it be for now, just to try to stay in sync with reference
-                        ;; implementation, but this smells.
-                        (flag-acked-others! packet))
+            ;; That takes us down to line 544
+            ;; It seems more than a bit silly to calculate flag-acked-others!
+            ;; if the incoming message is a pure ACK (i.e. message ID 0).
+            ;; That seeming silliness is completely correct: this
+            ;; is the entire point behind a pure ACK.
+            acked-gaps (flag-acked-others! packet)
+            flagged (reduce flow-control/update-statistics
+                            ;; Remove parent->buffer.
+                            ;; It's been parsed into packet
+                            (update acked-gaps
+                                    ::specs/incoming
+                                    dissoc
+                                    ::specs/parent->buffer)
+                            acked-blocks)
             extracted (extract-message! flagged packet)]
         (log/debug (str message-loop-name
                         ": handle-comprehensible message/extracted:\n"
@@ -592,10 +593,14 @@
             (>= receive-written receive-bytes))
       ;; 440: sets maxblocklen=1024
       ;; Q: Why was it ever 512?
-      ;; Guess: for initial Message part of Initiate packet
-      (let [state' (assoc-in state [::specs/outcoming ::specs/max-block-length] K/k-1)]
+      ;; Guess: for initial Message part of Initiate packet, although
+      ;; that limit's higher.
+      (let [state' (assoc-in state [::specs/outgoing ::specs/max-block-length] K/k-1)]
         (log/debug (str message-loop-name ": Handling incoming message, if it's comprehensible"))
         ;; Move on to line 444
+        ;; It seems as though this should forward the incoming message
+        ;; along to the child. But it's really just setting up the
+        ;; state to do that.
         (handle-comprehensible-message! state'))
       (do
         ;; Nothing to do.


remove download attribute on GCSFilePreviewLink to allow opening files in-browser

--- src/cljs/org/broadinstitute/firecloud_ui/common/dialog.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/dialog.cljs
@@ -123,7 +123,7 @@
                                   (common/format-filesize data-size)
                                   [:span {:style {:marginLeft "1em"}}
                                    [:a {:href (common/gcs-object->download-url (:bucket-name props) (:object props))
-                                    :target "_blank" :download (:object props)} "Download"]]
+                                    :target "_blank"} "Open"] [:span {:style {:fontStyle "italic" :color (:text-gray style/colors)}}" (right-click to download)"]]
                                   (when (> data-size 100000000)
                                     [:span {:style {:color (:exception-red style/colors) :marginLeft "2ex"}}
                                      (icons/font-icon {:style {:fontSize "100%" :verticalAlign "middle" :marginRight "1ex"}}


CMR-663: Refactored in response to pull request comments.

--- src/cmr/search/services/parameters/parameter_validation.clj
+++ src/cmr/search/services/parameters/parameter_validation.clj
@@ -159,79 +159,6 @@
    :provider string-param-options
    :attribute exclude-plus-or-option
    :temporal and-or-option})
-
-(def option->valid-parameters
-  "Map of options to parameters that allow them."
-  {:pattern #{:collection-concept-id
-              :archive-center
-              :dataset-id
-              :entry-title
-              :short-name
-              :entry-id
-              :version
-              :granule-ur
-              :producer-granule-id
-              :readable-granule-name
-              :project
-              :campaign
-              :platform
-              :sensor
-              :instrument
-              :collection-data-type
-              :day-night
-              :day-night-flag
-              :two-d-coordinate-system
-              :two-d-coordinate-system-name
-              :grid
-              :keyword
-              :processing-level
-              :processing-level-id
-              :science-keywords
-              :spatial-keyword
-              :dif-entry-id
-              :provider
-              :provider-id}
-   :ignore-case #{:short-name
-                  :dif-entry-id
-                  :readable-granule-name
-                  :version
-                  :processing-level
-                  :processing-level-id
-                  :collection-data-type
-                  :project
-                  :campaign
-                  :archive-center
-                  :spatial-keyword
-                  :science-keywords
-                  :long-name
-                  :entry-title
-                  :granule-ur
-                  :producer-granule-id
-                  :day-night
-                  :day-night-flag
-                  :platform
-                  :instrument
-                  :sensor
-                  :project-refs
-                  :two-d-coordinate-system
-                  :grid
-                  :entry-id
-                  :provider
-                  :provider-id}
-   :and #{:entry-id
-          :dif-entry-id
-          :entry-title
-          :readable-granule-name
-          :campaign
-          :spatial-keyword
-          :project
-          :platform
-          :instrument
-          :sensor
-          :short-name
-          :temporal}
-   :or #{:attribute :science-keywords :temporal}
-   :exclude-collection #{:attribute}})

 (defn parameter-options-validation
   [concept-type params]


Add longer name to table column for testing

--- example-src/devdemos/core.cljs
+++ example-src/devdemos/core.cljs
@@ -17,7 +17,7 @@
     :value "ID"
     :disable-edit true}
    {:key :name
-    :value "Name"}
+    :value "Name (not the secret identity)"}
    {:key :age
     :value "Age"
     :editor (components/int-editor)}


Adds intersect

Adds intersect

--- src/the_little_clojurian/chapter7.clj
+++ src/the_little_clojurian/chapter7.clj
@@ -75,3 +75,18 @@
   (is (= (intersect? '(1) '(1)) true))
   (is (= (intersect? '(1) '(2)) false))
   (is (= (intersect? '(stewed tomatoes and macaroni) '(macaroni and cheese)) true)))
+
+(with-test
+  (def intersect
+    (fn [set1 set2]
+      (cond (null? set1) '()
+            (member? (car set1) set2) (cons (car set1)
+                                            (intersect (cdr set1) set2))
+            :else (intersect (cdr set1) set2))))
+
+  (is (= (intersect '() '()) '()))
+  (is (= (intersect '(1) '(1)) '(1)))
+  (is (= (intersect '(1) '(2)) '()))
+  (is (= (intersect '(1 2) '(2 3)) '(2)))
+  (is (= (intersect '(1 2 3 4) '(4 3 2 1)) '(1 2 3 4)))
+  (is (= (intersect '(stewed tomatoes and macaroni) '(macaroni and cheese)) '(and macaroni))))


inc guitar section

inc guitar section

--- ohack/src/ohack/core.clj
+++ ohack/src/ohack/core.clj
@@ -116,3 +116,8 @@
 ;; ok, let's get back to more basics and build up to other exciting things.
 ;; first, let's add a few imports.

+;; playing with the guitar synth
+
+;; Mark found this guitar-pick function
+(guitar-pick (guitar) 0 0) ;; String 0 (Low E) Fret 0 (open)
+


make node-library exports map reloadable in dev

defining a getter property that accesses the real CLJS variable
to avoid "snapshotting" it once only.

fixes #589

--- src/main/shadow/build/targets/node_library.clj
+++ src/main/shadow/build/targets/node_library.clj
@@ -71,8 +71,15 @@
                 (map namespace)
                 (map symbol)
                 (into #{}))
-           `(cljs.core/js-obj ~@(->> exports (mapcat (fn [[k v]] [(-> k (name) (cljs-comp/munge)) v]))))
-           ])
+           (if (= :release (:shadow.build/mode state))
+             `(cljs.core/js-obj ~@(->> exports (mapcat (fn [[k v]] [(-> k (name) (cljs-comp/munge)) v]))))
+             `(doto (cljs.core/js-obj)
+                ~@(for [[k v] exports]
+                    `(js/Object.defineProperty ~(-> k (name) (cljs-comp/munge))
+                       (cljs.core/js-obj
+                         "enumerable" true
+                         "get" (fn [] ~v)) )))
+             )])

         requires
         (conj entries 'cljs.core)


Fix spelling

Fix spelling

--- planck-cljs/src/planck/io.cljs
+++ planck-cljs/src/planck/io.cljs
@@ -38,7 +38,7 @@
       (as-file (.getPath u))
       (throw (js/Error. (str "Not a file: " u))))))

-(defprotocol IClosaeable
+(defprotocol IClosable
   (-close [this]))

 (defprotocol IReader
@@ -48,7 +48,7 @@
   IReader
   (-read [_]
     (raw-read))
-  IClosaeable
+  IClosable
   (-close [_]
     (raw-close)))


check vertical treshold

check vertical treshold

--- src/mobile_patient/component/gesture_view.cljs
+++ src/mobile_patient/component/gesture_view.cljs
@@ -8,8 +8,15 @@
   (let [e1 (first (.. e -touchHistory -touchBank))
         dx (- (.-currentPageX e1) (.-startPageX e1))]
     (cond
-      (> dx 50) :right
-      (< dx -50) :left)))
+      (> dx 30) :right
+      (< dx -30) :left)))
+
+(defn vert-direction [e]
+  (let [e1 (first (.. e -touchHistory -touchBank))
+        dx (- (.-currentPageY e1) (.-startPageY e1))]
+    (cond
+      (> dx 5) :up
+      (< dx -5) :down)))

 (defn log [e]
   (print (first (.. e -touchHistory -touchBank))))
@@ -17,7 +24,7 @@
 (defn gesture-view [child]
   (let [state (r/atom 0)]
     (fn []
-     [ui/view {:onMoveShouldSetResponder (fn [e] (boolean (horiz-direction e)))
+     [ui/view {:onMoveShouldSetResponder (fn [e] (not (boolean (vert-direction e))))
                :onResponderRelease (fn [e] (case (horiz-direction e)
                                              :right (swap! state inc)
                                              :left (swap! state dec)))


Adjusted the door stop time

Adjusted the door stop time

--- src/chicken_coop/core.clj
+++ src/chicken_coop/core.clj
@@ -27,7 +27,7 @@
   (hb/forward! hb)
   (wait-till (closed? floor-btn)
     (log "Stopping door")
-    (Thread/sleep 100)
+    (Thread/sleep 500)
     (hb/stop! hb)))


re-organize game states and monitors

re-organize game states and monitors

--- src/client/game/core.cljs
+++ src/client/game/core.cljs
@@ -61,14 +61,38 @@
 ;; STATE OF THE GAME
 ;;------------------------------------------------------------

+(def state
+  "The state of the game."
+  (atom nil))
+
+(defn init-state!
+  "Set the initial state of the game."
+  []
+  (reset! state {:next-piece nil
+                 :piece nil
+                 :position nil
+                 :board empty-board
+
+                 :theme 0
+
+                 :score 0
+                 :level 0
+                 :level-lines 0
+                 :total-lines 0
+
+                 :soft-drop false
+
+                 :quit false
+                 :quit-chan (chan)}))
+
+; required for pausing/resuming the gravity routine
+(def pause-grav (chan))
+(def resume-grav (chan))
+
 (def battle
   "Boolean flag signaling whether we are in solo or battle mode."
   (atom false))

-(def state
-  "The state of the game."
-  (atom nil))
-
 (def paused?
   "Boolean flag signaling if game is paused or not"
   (atom false))
@@ -84,6 +108,10 @@
 (def music-playing?
   "Boolean flag signaling if the music is playing or not"
   (atom false))
+
+;;------------------------------------------------------------
+;; STATE MONITOR
+;;------------------------------------------------------------

 (defn- on-music-playing-change [_ _ _ new-state]
   (let [music-el (.getElementById js/document "music")]
@@ -92,6 +120,7 @@
       (.pause music-el))))

 (add-watch music-playing? :music on-music-playing-change)
+

 (defn- update-theme [_ _ old-state new-state]
   (if (not= (:theme old-state)
@@ -102,49 +131,6 @@
       (.html ($ "#theme-details") (:platform theme)))))

 (add-watch state :theme-change update-theme)
-
-(defn init-state!
-  "Set the initial state of the game."
-  []
-  (reset! state {:next-piece nil
-                 :piece nil
-                 :position nil
-                 :board empty-board
-
-                 :theme 0
-
-                 :score 0
-                 :level 0
-                 :level-lines 0
-                 :total-lines 0
-
-                 :soft-drop false
-
-                 :quit false
-                 :quit-chan (chan)}))
-
-; required for pausing/resuming the gravity routine
-(def pause-grav (chan))
-(def resume-grav (chan))
-
-(defn try-publish-score!
-  "Inform the server of our current state."
-  []
-  (if @battle
-    (socket/emit "update-player"
-      (select-keys @state [:total-lines :score]))))
-
-;;------------------------------------------------------------
-;; STATE MONITOR
-;;------------------------------------------------------------
-
-(defn drawable-board
-  "Draw the current state of the board."
-  []
-  (let [{piece :piece
-         [x y] :position
-         board :board} @state]
-    (create-drawable-board piece x y board)))

 (defn make-redraw-chan
   "Create a channel that receives a value everytime a redraw is requested."
@@ -157,6 +143,14 @@
                 (request-anim trigger-redraw)))]
       (request-anim trigger-redraw)
       redraw-chan)))
+
+(defn drawable-board
+  "Draw the current state of the board."
+  []
+  (let [{piece :piece
+         [x y] :position
+         board :board} @state]
+    (create-drawable-board piece x y board)))

 (defn go-go-draw!
   "Kicks off the drawing routine."
@@ -227,6 +221,13 @@
   (.html ($ "#score") (str "Score: " (util/format-number (:score @state))))
   (.html ($ "#level") (str "Level: " (:level @state)))
   (.html ($ "#lines") (str "Lines: " (:total-lines @state))))
+
+(defn try-publish-score!
+  "Inform the server of our current state."
+  []
+  (if @battle
+    (socket/emit "update-player"
+      (select-keys @state [:total-lines :score]))))

 (defn update-points!
   [rows-cleared]


CLJS-866: Faulty ns macro desugaring

CLJS-866: Faulty ns macro desugaring

Fixes:
* `:refer-macros` sugar producing an invalid expansion.
* `:include-macros` sugar behaving unpredictably.

--- src/clj/cljs/analyzer.clj
+++ src/clj/cljs/analyzer.clj
@@ -1140,18 +1140,20 @@
           (map (fn [[k & specs]] [k (into [] specs)]))
           (into {}))
         sugar-keys #{:include-macros :refer-macros}
+        remove-from-spec
+        (fn [pred spec]
+          (if-not (and (sequential? spec) (some pred spec))
+            spec
+            (let [[l r] (split-with (complement pred) spec)]
+              (recur pred (concat l (drop 2 r))))))
         to-macro-specs
         (fn [specs]
           (->> specs
             (filter #(and (sequential? %) (some sugar-keys %)))
-            (map #(->> % (remove #{:include-macros true})
+            (map #(->> % (remove-from-spec #{:include-macros})
+                         (remove-from-spec #{:refer})
                          (map (fn [x] (if (= x :refer-macros) :refer x)))))))
-        remove-sugar
-        (fn [spec]
-          (if (and (sequential? spec) (some sugar-keys spec))
-            (let [[l & r] (split-with #(not (contains? sugar-keys %)) spec)]
-              (concat l (drop 2 r)))
-            spec))]
+        remove-sugar (partial remove-from-spec sugar-keys)]
     (if-let [require-specs (seq (to-macro-specs require))]
       (map (fn [[k v]] (cons k (map remove-sugar v)))
         (update-in indexed [:require-macros] (fnil into []) require-specs))


comments

comments

--- src/clj/cljs/analyzer.clj
+++ src/clj/cljs/analyzer.clj
@@ -1224,14 +1224,22 @@
     {:import  import-map
      :require import-map}))

-(defn macro-autoload-ns? [form]
+(defn macro-autoload-ns?
+  "Given a spec form check whether the spec namespace requires a macro file
+   of the same name. If so return true."
+  [form]
   (let [ns (if (sequential? form) (first form) form)
         {:keys [use-macros require-macros]}
         (get-in @env/*compiler* [::namespaces ns])]
     (or (contains? use-macros ns)
         (contains? require-macros ns))))

-(defn desugar-ns-specs [args]
+(defn desugar-ns-specs
+  "Given an original set of ns specs desugar :include-macros and :refer-macros
+   usage into only primitive spec forms - :use, :require, :use-macros,
+   :require-macros. If a library includes a macro file of with the same name
+   as the namespace will also be desugared."
+  [args]
   (let [{:keys [require] :as indexed}
         (->> args
           (map (fn [[k & specs]] [k (into [] specs)]))


fix route

fix route

--- src/clj/haushalt/core.clj
+++ src/clj/haushalt/core.clj
@@ -13,7 +13,7 @@
   [:#view-container] (content (html [:h1 "Greetings"])))

 (defroutes handler
-  (GET "/*" [] (landing-page))
+  (GET "/*" [] (landing-page)
   (resources "/"))

 (defn start-server [port]