Also takes an ##INT-?## token that returns the number within 10% with no decimals

--- src/hphelper/shared/sql.clj
+++ src/hphelper/shared/sql.clj
@@ -138,9 +138,9 @@
                )))

 (defn- fuzzify-number
-  "Takes a number as a string, fuzzifies it by 10%, returns it with two decimal places.
+  "Takes a number as a string, fuzzifies it by 10%, returns it with the specified decimal places.
   Returns '0' if it's not an integer"
-  ([^String token]
+  ([^String token decimals]
    (log/trace "fuzzify-number:" token)
    (if-let [n (parse-int token)]
      ;; Creates a number between 0.9 and 1.1, multiplies it by the number in the token
@@ -149,7 +149,7 @@
          (/ 100)
          (+ 1)
          (* n)
-         ((partial format "%.2f"))
+         ((partial format (str "%." decimals "f")))
          str
          )
      "0"
@@ -170,7 +170,14 @@
       "LOC" (get-or-create-name (partial get-random-resource "LOC") token)
       "RES" (get-or-create-name (partial get-random-resource "RES") token)
       "SUB" (get-or-create-name create-random-sub token)
-      "NUM" (get-or-create-name (partial fuzzify-number (second (clojure.string/split token #"-"))) token)
+      "NUM" (get-or-create-name (partial fuzzify-number
+                                         (second (clojure.string/split token #"-"))
+                                         2)
+                                token)
+      "INT" (get-or-create-name (partial fuzzify-number
+                                         (second (clojure.string/split token #"-"))
+                                         0)
+                                token)
       (do
         (log/error "Incorrect token form:" token)
         token)


Cover edge cases with tests

Cover edge cases with tests

--- test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
+++ test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
@@ -143,11 +143,25 @@
                           (fcall "intToBlob"
                                  (cname "b")))))

+  (is (renders-to "SELECT unixTimestampOf(created_at) FROM events LIMIT 5;"
+                  (select :events
+                          (unix-timestamp-of :created_at)
+                          (limit 5))))
+
+  (is (renders-to "INSERT INTO events(created_at,message) VALUES (now(),'Message 1');"
+                  (insert :events
+                          {:created_at (now)
+                           :message    "Message 1"})))

   (is (renders-to "SELECT * FROM foo WHERE k>42 LIMIT 42;";
                   (select :foo
                           (where [[:> :k 42]])
                           (limit 42))))
+
+  (is (renders-to "SELECT * FROM events WHERE message IN ('Message 7','Message 8','Message 9','Message 10') AND created_at>=minTimeuuid(1001);"
+                  (select :events
+                    (where [[:in :message ["Message 7" "Message 8" "Message 9" "Message 10"]]
+                            [>= :created_at (min-timeuuid 1001)]]))))

   (is (renders-to "SELECT * FROM foo WHERE token(k)>token(42);"
                   (select :foo


Rename s to url

Rename s to url

--- src/hatti/views/photos.cljs
+++ src/hatti/views/photos.cljs
@@ -33,11 +33,11 @@
 (defn- make-url
   "If not a fully qualified URL, remove the API namespace prefix from a URI
    string and convert to a fully qualified URL."
-  [s]
+  [url]
   (js/encodeURIComponent
-   (if (= (subs s 0 4) "http")
-     s
-     (remote/make-url (replace s #"/api/v1" "")))))
+   (if (= (subs url 0 4) "http")
+     url
+     (remote/make-url (replace url #"/api/v1" "")))))

 (defn- build-caption
   [item]


Add scoring

Add scoring

--- src/hydrofoil/evolution.clj
+++ src/hydrofoil/evolution.clj
@@ -1,5 +1,7 @@
 (ns hydrofoil.evolution
-  (:require [hydrofoil.utils :refer :all]))
+  (:require [hydrofoil.utils :refer :all]
+            [hydrofoil.Model.Thin_Aerofoil_Theory :as TAT]
+            [hydrofoil.Model.Lifting_Line_Theory :as LLT]))

 (defn upper-bound-check
@@ -26,7 +28,7 @@
   (let [exploration-factor 30 ;;; Doesn't do anything yet. hopefully will change m, p, and t, exp-factors.
         ;;; how far you can go from the parent value
         m-exp-factor 10
-        p-exp-factor 1
+        p-exp-factor 10
         t-exp-factor 10
         ;;; the numerical values of the upper limits
         m-upper-bound (upper-bound-check (+ m-exp-factor (parent :max-camber)) 9.5)
@@ -52,7 +54,46 @@
                  (rand-double (p-min t-value) 9)
                  t-value)))

+;;; ------------ SCORING --------------
+(defn thin-aerofoil-scoring
+  "Most rudimentary scoring, uses thin aerofoil theory, and just returns lift"
+  [individual run-constants scoring-arg]
+  (let    [individual-performance (TAT/thin-aerofoil-theory individual run-constants)
+           score (:Lift individual-performance)]
+    (conj individual-performance
+          {:score score})))
+
+(defn lift-priority-scoring
+  "Using LLT: Inputs will include a minimum lift, foils not achieving this lift will recieve a score of 0.
+  If a foil, reaches the lift threashold, the score will be 1,000,000 - drag. Individuals will want a HIGH score. "
+  [individual run-constants min-lift]
+  (let [individual-performance (LLT/Lifting-Line-Theory individual run-constants)]
+    (if (> (:Lift individual-performance) min-lift)
+            (conj individual-performance {:score (- 1000000 (:Drag individual-performance))})
+            (conj individual-performance {:score 0})
+      )))
+
+(defn drag-priority-scoring
+  "Using LLT: Inputs will include a maximum drag, foils not achieving this maximum drag will recieve a score of 0.
+  If a foil, reaches the lift threashold, the score will be simply its lift. Individuals will want a HIGH score."
+  [individual run-constants max-drag]
+  (let [individual-performance (LLT/Lifting-Line-Theory individual run-constants)]
+    (if (< (:Drag individual-performance) max-drag)
+            (conj individual-performance {:score (:Lift individual-performance)})
+            (conj individual-performance {:score 0}))))
+
+(defn linear-combination-scoring
+  "Using LLT: No extra input, lift and drag will be weighted with constants, and summed."
+  [individual run-constants]
+  (let [lift-weight 0.5
+        drag-weight 3
+        individual-performance (LLT/Lifting-Line-Theory individual run-constants)]
+    (conj individual-performance {:score (+ (* lift-weight (:Lift individual-performance))
+                                            (* drag-weight (:Drag individual-performance)))})))

+
+
+


toString title when comparing to root-title.

This way title can be nil or some other value which can be coerced to a string.

--- src/incise/parsers/html.clj
+++ src/incise/parsers/html.clj
@@ -28,7 +28,7 @@

 (def ^:private root-title "index")
 (def ^:private root-path "index.html")
-(defn- root-title? [title] (= root-title (s/lower-case title)))
+(defn- root-title? [title] (-> title str s/lower-case (= root-title)))

 (defn- meta-and-content->Parse
   "Combine the given meta data and content into a Parse."


Change go-try macro to return nil when exception is thrown (and sent to the channel)

--- src/io/aviso/rook/utils.clj
+++ src/io/aviso/rook/utils.clj
@@ -36,7 +36,8 @@
        (try
          ~@body
          (catch Throwable t#
-           (>! ch# t#)
-           ;; Re-throw the exception; that's the only way to get out of the go block
-           ;; without returning a value.
-           (throw t#))))))+           ;; The exception is routed to the exception channel.
+           ;; The go block returns nil (that's problematic according to the
+           ;; docs), but re-throwing the exeption results in an ugly
+           ;; exception trace on the console.
+           (>! ch# t#))))))


Log writing the file with html parser.

Log writing the file with html parser.

--- src/incise/parsers/html.clj
+++ src/incise/parsers/html.clj
@@ -2,6 +2,7 @@
   (:require (incise.parsers [helpers :as help]
                             [core :refer [map->Parse]])
             [incise.layouts.core :refer [Parse->string]]
+            [taoensso.timbre :refer [info]]
             [clojure.edn :as edn]
             [clojure.string :as s]
             [clojure.java.io :refer [reader]])
@@ -23,6 +24,7 @@
     (-> file-path
         (.getParentFile)
         (.mkdirs))
+    (info "Writing" (.getPath file-path))
     (spit file-path (Parse->string parse-data))))

 (defn html-parser


Add Google tags.

Add Google tags.

--- src/klangmeister/views.cljs
+++ src/klangmeister/views.cljs
@@ -57,12 +57,24 @@
                  [:button {:on-click #(handle! (action/->Play))} "Play"]
                  [:button {:on-click #(handle! (action/->Stop))} "Stop"])
         error (:error state)]
-    [:div
-     [:div {:class "graph"} [graph handle! state-atom]]
-     [:div {:class "controls"} button]
-     [:div {:class (if error "error" "")} [editor handle! state]]
-     [:a {:href "https://github.com/ctford/klangmeister"}
-      [:img {:style {:position "absolute" :top 0 :right 0 :border 0}
-             :src "https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67"
-             :alt "Fork me on GitHub"
-             :data-canonical-src "https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"}]]]))
+    [:body
+     [:div {:dangerouslySetInnerHTML
+            {:__html
+             "
+
+
+             "}}]
+     [:div
+      [:div {:class "graph"} [graph handle! state-atom]]
+      [:div {:class "controls"} button]
+      [:div {:class (if error "error" "")} [editor handle! state]]
+      [:a {:href "https://github.com/ctford/klangmeister"}
+       [:img {:style {:position "absolute" :top 0 :right 0 :border 0}
+              :src "https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67"
+              :alt "Fork me on GitHub"
+              :data-canonical-src "https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"}]]]]))


disable the key-pins-header until we decide how we want users to input it because it's causing an issue trying to use a db connection before the db is initialized.

--- src/metabase/middleware.clj
+++ src/metabase/middleware.clj
@@ -172,13 +172,14 @@
 (defn- api-security-headers [] ; don't need to include all the nonsense we include with index.html
   (merge (cache-prevention-headers)
          strict-transport-security-header
-         (public-key-pins-header)))
+         ;(public-key-pins-header)
+         ))

 (defn- index-page-security-headers []
   (merge (cache-prevention-headers)
          strict-transport-security-header
          content-security-policy-header
-         (public-key-pins-header)
+         ;(public-key-pins-header)
          {"X-Frame-Options"                   "DENY"          ; Tell browsers not to render our site as an iframe (prevent clickjacking)
           "X-XSS-Protection"                  "1; mode=block" ; Tell browser to block suspected XSS attacks
           "X-Permitted-Cross-Domain-Policies" "none"          ; Prevent Flash / PDF files from including content from site.


updating id to snake case over kebab

updating id to snake case over kebab

--- src-cljs/frontend/models/build.cljs
+++ src-cljs/frontend/models/build.cljs
@@ -198,7 +198,7 @@
 (defn current-user-ssh?
   "Whether the given user has SSH access to the build"
   [build user]
-  (let [cmp (fn [m] (select-keys m [:type :external-id]))
+  (let [cmp (fn [m] (select-keys m [:type :external_id]))
         identities (->> user
                         :identities
                         vals


Remove now unused with-destructured-query macro

--- src/main/workflo/macros/util/macro.clj
+++ src/main/workflo/macros/util/macro.clj
@@ -22,12 +22,3 @@
    will return `UserComponent`."
   [name]
   (symbol (str (record-symbol name) 'Component)))
-
-(defmacro with-destructured-query
-  "Takes a parsed query, query results and arbitrary code. Wraps
-   the code in let form that destructures the query results according
-   to the query."
-  [query result & body]
-  (let [keys (map-destructuring-keys query)]
-    `(let [{:keys [~@keys]} ~result]
-       ~@body)))


fix get

fix get

--- elephantdb-server/src/clj/elephantdb/keyval/core.clj
+++ elephantdb-server/src/clj/elephantdb/keyval/core.clj
@@ -178,7 +178,8 @@
       (let [get-fn (kv-get-fn this domain-name database)
             ret (byte-array (.remaining key))]
         (.get key ret)
-        (clojure.core/get (multi-get get-fn database domain-name [ret]) key)))
+        (prn "get: " (multi-get get-fn database domain-name [ret]))
+        (first (vals (multi-get get-fn database domain-name [ret])))))

     (getDomainStatus [_ domain-name]
       "Returns the thrift status of the supplied domain-name."


Improve performance and many of unexpected conflicts on page save.

--- frontend/src/uxbox/main/data/pages.cljs
+++ frontend/src/uxbox/main/data/pages.cljs
@@ -176,10 +176,10 @@
 (deftype PagePersisted [data]
   ptk/UpdateEvent
   (update [_ state]
-    ;; TODO: update only the version instead of complete unpacking
-    ;; this will improve the application responsiveness when multiple
-    ;; updates are performed
-    (assoc-page state data)))
+    (let [{:keys [id version]} data]
+      (-> state
+          (assoc-in [:pages id :version] version)
+          (assoc-packed-page data)))))

 (defn- page-persisted?
   [event]


Use window->screen

Use window->screen

--- dungeon-crawler/desktop/src-common/dungeon_crawler/utils.clj
+++ dungeon-crawler/desktop/src-common/dungeon_crawler/utils.clj
@@ -158,12 +158,11 @@
        (near-entity? e e2 attack-distance)))

 (defn get-entity-at-cursor
-  [screen entities screen-x screen-y]
-  (let [v (vector-3 screen-x screen-y 0)
-        _ (orthographic! screen :unproject v)]
+  [screen entities window-x window-y]
+  (let [cursor-pos (window->screen screen window-x window-y)]
     (some (fn [{:keys [x y width height npc? health] :as entity}]
             (-> (rectangle x y width height)
-                (rectangle! :contains (. v x) (. v y))
+                (rectangle! :contains (:x cursor-pos) (:y cursor-pos))
                 (and npc? (> health 0))
                 (when entity)))
           entities)))


Update hello world version.

Update hello world version.

--- examples/hello-world/project.clj
+++ examples/hello-world/project.clj
@@ -1,6 +1,6 @@
-(defproject hello-world "0.30.0"
+(defproject hello-world "0.31.0"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.10.1"]
-                 [uncomplicate/neanderthal "0.30.0"]]
+                 [uncomplicate/neanderthal "0.31.0"]]
   :jvm-opts ^:replace [#_"--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"])


Add helper function for normalize db returing record attributes.


reduce the number of card initially displayed in the card browser

--- src/cljs/netrunner/cardbrowser.cljs
+++ src/cljs/netrunner/cardbrowser.cljs
@@ -136,7 +136,7 @@
                             (filter-cards (:faction-filter state) :faction)
                             (filter-cards (:type-filter state) :type)
                             (match (.toLowerCase (:search-query state)))
-                            (take (* (:page state) 55))
+                            (take (* (:page state) 41))
                             (sort-by (sort-field (:sort-field state))))
                        {:key :code})]]))))


Add PAD Factory and Product Recall to alliance influence in deckbuilder.

--- src/cljs/netrunner/deckbuilder.cljs
+++ src/cljs/netrunner/deckbuilder.cljs
@@ -173,7 +173,7 @@
         ;; checks card ID against list of currently known alliance cards
         has-alliance-subtype? (fn [card]
                                 (case (:code (:card card))
-                                  (list "10013" "10018" "10019" "10067" "10068" "10071" "10072" "10076" "10109")
+                                  (list "10013" "10018" "10019" "10029" "10038" "10067" "10068" "10071" "10072" "10076" "10109")
                                   true
                                   false))
         ;; alliance helper, subtracts influence of free ally cards from given influence map


refactoring

refactoring

--- src/cljs/salava/badge/ui/modal.cljs
+++ src/cljs/salava/badge/ui/modal.cljs
@@ -210,12 +210,10 @@
     ))

 (defn modal-navi [state]
-  (let [expired? (bh/badge-expired? (:expires_on @state))
-        revoked (pos? (:revoked @state))
+  (let [invalid? (or (bh/badge-expired? (:expires_on @state)) (pos? (:revoked @state)))
         selected-language (cursor state [:content-language])
         data (content-setter @selected-language (:content @state))
-        disabled (or revoked expired?)
-        disable-link (if disabled "btn disabled")]
+        disable-link (if invalid? "btn disabled")]
     [:div.col-md-9.badge-modal-navi
      [:ul {:class "nav nav-tabs wrap-grid"}
       [:li.nav-item{:class  (if (or (nil? (:tab-no @state))(= 1 (:tab-no @state))) "active")}


Fixup

Fixup

--- src/clojure/buddy/core/mac/hmac.clj
+++ src/clojure/buddy/core/mac/hmac.clj
@@ -113,20 +113,6 @@
   (verify-hmac [^java.net.URI input ^bytes signature ^String key ^Keyword alg]
     (verify-hmac-for-stream (io/input-stream input) signature key alg)))

-(defn- make-salted-hmac
-  "Generic function that implement salted variant
-of keyed-hash message authentication code (hmac).
-This is a low level function and always return bytes."
-  [input key salt ^Keyword alg]
-  (let [key (concat-byte-arrays (->byte-array key)
-                                (->byte-array salt))]
-    (make-hmac input (hash/sha512 key) alg)))
-
-(defn- verify-salted-hmac
-  [input ^bytes signature key salt ^Keyword alg]
-  (let [key (concat-byte-arrays (->byte-array key)
-                                (->byte-array salt))]
-    (verify-hmac input signature (hash/sha512 key) alg)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; High level interface


Fix missing arg

Fix missing arg

--- src/clojure_fabric/crypto_suite.clj
+++ src/clojure_fabric/crypto_suite.clj
@@ -305,7 +305,7 @@
         (bool): verification successful or not"
   [pub-key signature ^bytes digest {:keys [algorithm curve type security-provider] :as opts}]
   (let [^PublicKey pub-key (cond (utils/bytes? pub-key) (import-key pub-key opts)
-                                 (string? pub-key) (import-key (cert-string->bytes pub-key))
+                                 (string? pub-key) (import-key (cert-string->bytes pub-key) opts)
                                  :else pub-key)
         signer (Signature/getInstance (name algorithm))]
     (.initVerify signer pub-key)


Add check for empty blocks in store!.

Add check for empty blocks in store!.

--- src/blocks/core.clj
+++ src/blocks/core.clj
@@ -259,11 +259,11 @@
   ([store source]
    (store! store source default-algorithm))
   ([store source algorithm]
-   (store/-put!
-     store
-     (if (instance? File source)
-       (from-file source algorithm)
-       (read! source algorithm)))))
+   (let [block (if (instance? File source)
+                 (from-file source algorithm)
+                 (read! source algorithm))]
+     (when (pos? (:size block))
+       (store/-put! store block)))))

 (defn delete!


Finish doc

Finish doc

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -165,7 +165,8 @@
      (throw (ex-info "Default resolver-dispatch is not supported on CLJS, please implement ::p.connect/resolver-dispatch in your parser environment." {}))))

 (defn resolver-dispatch
-  "Helper method that extract resolver symbol from env. It's recommended to use as a dispatch method for "
+  "Helper method that extract resolver symbol from env. It's recommended to use as a dispatch method for creating
+  multi-methods for resolver dispatch."
   [env input]
   (get-in env [::resolver-data ::sym]))


Add blank view-dispatcher

Add blank view-dispatcher

--- src/devcards/discuss/molecules.cljs
+++ src/devcards/discuss/molecules.cljs
@@ -22,11 +22,14 @@
   views/DiscussionElements
   parser/reconciler)

+(defcard-om-next view-dispatcher
+  views/ViewDispatcher
+  parser/reconciler)
+
 (defcard-om-next view-dispatcher-default
   views/ViewDispatcher
   (om/reconciler {:state (merge {:layout/view :default}
-                                (select-keys @(om/app-state parser/reconciler)
-                                             [:discussion/bubbles :discussion/items]))
+                                @(om/app-state parser/reconciler))
                   :parser (om/parser {:read parser/read})}))

 (defcard-om-next view-dispatcher-login
@@ -39,10 +42,6 @@
   (om/reconciler {:state {:layout/view :options}
                   :parser (om/parser {:read parser/read})}))

-(defcard-om-next main-content-view
-  views/MainContentView
-  parser/reconciler)
-
 (defcard-om-next main-view
   views/MainView
   parser/reconciler)


More readable comment.

More readable comment.

--- src/cbfg/fence.cljs
+++ src/cbfg/fence.cljs
@@ -15,21 +15,22 @@
 ;;   r0 r1 r2 r3 r4
 ;;         F
 ;;   -----------------------------------------------
-;;   ^                    (++inflight == 1)
-;;      ^                 (++inflight == 2)
-;;      p1                (send)
-;;         ^              (++inflight == 3 (2 unfenced + 1 fenced), and...)
-;;         ||             (pause input processing)
-;;      p1                (send)
-;;      d1                (send, --inflight == 2)
-;;         p2             (send)
-;;         d2-hold        (hold d2 result, --inflight == 1)
-;;   p0                   (send)
-;;   d0                   (send, --inflight == 0, so...)
-;;         d2-send        (now can send d2 and move onwards to r3, so...)
-;;         >>             (unpause input processing)
-;;            ^           (++inflight == 1)
-;;               ^        (++inflight == 2)
+;;                        ; inflight == 0
+;;   ^                    ; ++inflight == 1
+;;      ^                 ; ++inflight == 2
+;;      p1                ; send p1 result
+;;         ^              ; ++inflight == 3, and...
+;;         ||             ; pause input processing
+;;      p1                ; send p1 result
+;;      d1                ; send d1, --inflight == 2
+;;         p2             ; send p2 result
+;;         d2-hold        ; hold d2 result, --inflight == 1
+;;   p0                   ; send p0 result
+;;   d0                   ; send d0, --inflight == 0, so...
+;;         d2-send        ; can now send the held d2, and...
+;;         >>             ; unpause input processing
+;;            ^           ; ++inflight == 1
+;;               ^        ; ++inflight == 2

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


Extracting and printing args for improving the help works.

--- src/cli4clj/cli.clj
+++ src/cli4clj/cli.clj
@@ -108,11 +108,14 @@
       (doseq [c command-names]
         (when (map? (cmds c))
           (print (name c))
-          (if (not (nil? (c cmd-aliases)))
-            (println "" (vec (map #(symbol (name %)) (c cmd-aliases))))
-            (println ""))
+          (when-let [al (c cmd-aliases)]
+            (print "" (vec (map #(symbol (name %)) al))))
+          (println "")
           (when-let [si (get-in cmds [c :short-info])]
-            (println (str "\t" si)))
+            (print (str "\t" si)))
+          (when-let [args (get-in cmds [c :fn-args])]
+            (print "\t" "Arguments:" args))
+          (println "")
           (when-let [li (get-in cmds [c :long-info])]
             (println (str "\t" li)))
           (print cmd-entry-delimiter))))))
@@ -185,7 +188,7 @@
   ([]
     (start-cli {}))
   ([user-options]
-    (let [options-with-args-info user-options]
+    (let [options-with-args-info (add-args-info user-options)]
      `(let [options# (get-cli-opts ~options-with-args-info)]
         (repl
           :eval ((options# :eval-factory) (options# :cmds) (options# :allow-eval) (options# :print-err))


Remove style helper. If you want to generate CSS within JVM Clojure, look at https://github.com/paraseba/cssgen.

--- src/clj/c2/core.clj
+++ src/clj/c2/core.clj
@@ -2,19 +2,8 @@
   (:use [clojure.string :only [join]]))

 (defn unify
+  "Map `data` to hiccup vectors via provided `mapping` function."
   ([data mapping]
      (map mapping data))
   ([container data mapping]
       (into container (unify data mapping))))
-
-
-(defn style
-  "Convert map to CSS string. Optional :numeric-suffix added to numbers (defaults to 'px')."
-  [m & {:keys [numeric-suffix]
-        :or {numeric-suffix "px"}}]
-  (join (for [[k v] m]
-          (str (name k) ":"
-               (if (number? v)
-                 (str v numeric-suffix)
-                 v)
-               ";"))))


updated bangs for weather

updated bangs for weather

--- src/xebang/models/bangs.clj
+++ src/xebang/models/bangs.clj
@@ -4,29 +4,33 @@
   {'!bible      "http://www.bible.com/search/bible?q={{{s}}}"
    '!kidsinmind "http://www.kids-in-mind.com/cgi-bin/search/search.pl?q={{{s}}}"
    '!movies     "http://www.google.com/movies?hl=en&near={{{s}}}"
-   '!weather    "http://weatherspark.com/#!dashboard;q={{{s}}}"
-   '!w          "http://weatherspark.com/#!dashboard;q={{{s}}}"
+   '!weather    "http://www.wunderground.com/cgi-bin/findweather/hdfForecast?query={{{s}}}"
+   '!w          "http://www.wunderground.com/cgi-bin/findweather/hdfForecast?query={{{s}}}"
    '!syn        "http://thesaurus.com/browse/{{{s}}}"
    '!def        "http://dictionary.com/browse/{{{s}}}"
    '!values     "http://0to255.com/{{{s}}}"
    '!devdocs    "http://devdocs.io/#q={{{s}}}"
    '!js         "http://devdocs.io/#q=js {{{s}}}"
    '!css        "http://devdocs.io/#q=css {{{s}}}"
-   '!html       "http://devdocs.io/#q=html {{{s}}}"
+   '!html       "http://devdocs.io/#q=html {{{s}}}"
    '!http       "http://devdocs.io/#q=http {{{s}}}"
    '!jquery     "http://devdocs.io/#q=jquery {{{s}}}"
-   '!underscore "http://devdocs.io/#q=underscore {{{s}}}"
+   '!underscore "http://devdocs.io/#q=underscore {{{s}}}"
+   '!backbone   "http://devdocs.io/#q=backbone {{{s}}}"
    '!markdown   "http://daringfireball.net/projects/markdown/syntax#{{{s}}}"
-   '!namecheap  "http://www.namecheap.com/domains/domain-name-search/results.aspx?domain={{{s}}}&tlds=&searchall=&type=single&"})
+   '!namecheap  "http://www.namecheap.com/domains/domain-name-search/results.aspx?domain={{{s}}}&tlds=&searchall=&type=single&"
+   '!email      "mailto:{{{s}}}"
+   '!downloads  "chrome://downloads/"
+   '!history    "chrome://settings/"})

 (def mock-config
   {:default-search-pattern "http://duckduckgo.com/?q={{{s}}}"
    :bangs [{:bang "!bible"      :name "Bible"        :url-pattern "http://www.bible.com/search?q={{{s}}}"}
-				   {:bang "!kidsinmind" :name "Kids in Mind" :url-pattern "http://www.kids-in-mind.com/cgi-bin/search/search.pl?q={{{s}}}"}
-				   {:bang "!weather"    :name "WeatherSpark" :url-pattern "http://weatherspark.com/#!dashboard;q={{{s}}}"}
-				   {:bang "!devdocs"    :name "DevDocs.io"   :url-pattern "http://devdocs.io/#q={{{s}}}"}
-				   {:bang "!js"         :name "JavaScript"   :url-pattern "http://devdocs.io/#q=js {{{s}}}"}
-				   {:bang "!css"        :name "CSS"          :url-pattern "http://devdocs.io/#q=css {{{s}}}"}
-				   {:bang "!html"       :name "HTML"         :url-pattern "http://devdocs.io/#q=html {{{s}}}"}
-				   {:bang "!namecheap"  :name "Domain Search"
-				    :url-pattern "http://www.namecheap.com/domains/domain-name-search/results.aspx?domain={{{s}}}&tlds=&searchall=&type=single&"}]})
+                   {:bang "!kidsinmind" :name "Kids in Mind" :url-pattern "http://www.kids-in-mind.com/cgi-bin/search/search.pl?q={{{s}}}"}
+                   {:bang "!weather"    :name "WeatherSpark" :url-pattern "http://weatherspark.com/#!dashboard;q={{{s}}}"}
+                   {:bang "!devdocs"    :name "DevDocs.io"   :url-pattern "http://devdocs.io/#q={{{s}}}"}
+                   {:bang "!js"         :name "JavaScript"   :url-pattern "http://devdocs.io/#q=js {{{s}}}"}
+                   {:bang "!css"        :name "CSS"          :url-pattern "http://devdocs.io/#q=css {{{s}}}"}
+                   {:bang "!html"       :name "HTML"         :url-pattern "http://devdocs.io/#q=html {{{s}}}"}
+                   {:bang "!namecheap"  :name "Domain Search"
+                    :url-pattern "http://www.namecheap.com/domains/domain-name-search/results.aspx?domain={{{s}}}&tlds=&searchall=&type=single&"}]})


Inline a couple of fns.

Inline a couple of fns.

--- src/kolmogorov_music/kolmogorov.clj
+++ src/kolmogorov_music/kolmogorov.clj
@@ -68,14 +68,10 @@
   [string]
   (->> string (map int) (reduce + 0)))

-(defn select [applies? xs]
-  (->> xs (drop-while (complement applies?)) first))
+(defn enterprise
+  "Calculate the shortest string that is more complicated than itself."
+  []
+  (->> (lexicon)
+       (drop-while (fn [s] (< (complexity s) (-> 'enterprise repl/source-fn extension))))
+       first))

-(defn more-complex-than? [limit]
-  (fn [value] (< limit (complexity value))))
-
-(defn enterprise []
-  (select
-    (more-complex-than? (-> 'enterprise repl/source-fn extension))
-    (lexicon)))
-


Gather trailing parentheses

Gather trailing parentheses

https://github.com/bbatsov/clojure-style-guide#gather-trailing-parens

--- test/cats/builtin_spec.cljc
+++ test/cats/builtin_spec.cljc
@@ -141,5 +141,4 @@
             result (m/foldr (partial foldr-fn state) '() (map identity [1 2 3 4]))]
         (t/is (= @state 0))
         (t/is (= 2 (first result)))
-        (t/is (= @state 1))))
-))
+        (t/is (= @state 1))))))


clarify usage in testst

clarify usage in testst

--- test/cheshire/test/core.clj
+++ test/cheshire/test/core.clj
@@ -182,4 +182,4 @@
   (is (= (str "{\n  \"foo\" : 1,\n  \"bar\" : {\n    "
               "\"quux\" : [ 1, 2, 3 ],\n    \"baz\" : 2\n  }\n}")
          (json/encode {:foo 1 :bar {:baz 2 :quux [1 2 3]}}
-                      :pretty :yesplease))))
+                      :pretty true))))


Replace js/setIntervar to js/setTimeout.

--- test/cljs/quil/snippet.cljs
+++ test/cljs/quil/snippet.cljs
@@ -7,7 +7,6 @@

 (def test-data (atom (list)))

-(def test-interval (atom nil))
 (def test-indx (atom 0))

 (def failed (atom 0))
@@ -35,12 +34,9 @@
                    (str "Total tested: " @total ";   Accepted: " (- @total @failed) ";   Failed: " @failed))
   (reset! test-indx 0)
   (reset! failed 0)
-  (reset! total 0)
-
-  (reset! test-interval (js/clearInterval @test-interval)))
+  (reset! total 0))

 (defn run-single-test []
-  (js/clearInterval @test-interval)
   (if (< @test-indx (count @test-data))
     (let [sketch (nth @test-data @test-indx)]
       (log-sketch-test sketch)
@@ -56,9 +52,9 @@

         (finally
          (swap! test-indx inc)
-         (reset! test-interval (js/setInterval run-single-test 1000)))))
+         (js/setTimeout run-single-test 1000))))

-    (reset! test-interval (js/setInterval end-of-tests 500))))
+    (js/setTimeout end-of-tests 500)))

 (defn ^:export run-tests []
@@ -66,4 +62,4 @@

   (dommy/set-text! (sel1 :#results) "Test started")
   (reset! test-indx 0)
-  (reset! test-interval (js/setInterval run-single-test 100)))
+  (js/setTimeout run-single-test 100))


Test with better print fun

Test with better print fun

--- test/cljs_workers/test.cljs
+++ test/cljs_workers/test.cljs
@@ -4,11 +4,12 @@

 (defn app
   []
-  (let [worker-pool (main/create-pool 2 "js/worker/worker.js")]
-    (main/do-with-pool! worker-pool {:handler :mirror, :arguments {:a "Hallo" :b "Welt" :c 10}} #(.debug js/console %))
-    (main/do-with-pool! worker-pool {:handler :mirror, :arguments {:a "Hallo" :b "Welt" :c 10 :d (js/ArrayBuffer. 10) :transfer [:d]} :transfer [:d]} #(.debug js/console %))
-    (main/do-with-pool! worker-pool {:handler :mirror, :arguments {:a "Hallo" :b "Welt" :c 10 :d (js/ArrayBuffer. 10) :transfer [:d]} :transfer [:c]} #(.debug js/console %))
-    (main/do-with-pool! worker-pool {:handler :mirror, :arguments {:a "Hallo" :b "Welt" :c 10 :d (js/ArrayBuffer. 10) :transfer [:c]} :transfer [:d]} #(.debug js/console %))))
+  (let [worker-pool (main/create-pool 2 "js/worker/worker.js")
+        print-result #(.debug js/console (str (:state %)) %)]
+    (main/do-with-pool! worker-pool {:handler :mirror, :arguments {:a "Hallo" :b "Welt" :c 10}} print-result)
+    (main/do-with-pool! worker-pool {:handler :mirror, :arguments {:a "Hallo" :b "Welt" :c 10 :d (js/ArrayBuffer. 10) :transfer [:d]} :transfer [:d]} print-result)
+    (main/do-with-pool! worker-pool {:handler :mirror, :arguments {:a "Hallo" :b "Welt" :c 10 :d (js/ArrayBuffer. 10) :transfer [:d]} :transfer [:c]} print-result)
+    (main/do-with-pool! worker-pool {:handler :mirror, :arguments {:a "Hallo" :b "Welt" :c 10 :d (js/ArrayBuffer. 10) :transfer [:c]} :transfer [:d]} print-result)))

 (defn worker
   []


Journal browser

Journal browser

--- src/yada/resources/journal_browser.clj
+++ src/yada/resources/journal_browser.clj
@@ -7,29 +7,40 @@
    [yada.charset :as charset]
    [yada.journal :as journal]
    [yada.methods :refer [Get]]
+   [yada.media-type :refer [media-type]]
    [yada.protocols :as p]
    [yada.yada :as yada]))
+
+(def access-control
+  {:allow-origin "*"
+   :expose-headers ["Server" "Date" "Content-Length" "Access-Control-Allow-Origin"]})

 (defn index [idx]
   (yada/resource
    (fn [ctx]
-     (html
-      [:body
-       [:h1 "Error index"]
-       [:ul
-        (for [[k v] idx]
-          [:li [:a {:href (journal/path-for :entry :id k)} k]]
-          )]
-       ]))
+     (case (-> ctx :response :representation :media-type media-type)
+       "text/html"
+       (html
+        [:body
+         [:h1 "Error index"]
+         [:ul
+          (for [[k v] idx]
+            [:li [:a {:href (journal/path-for :entry :id k)} k]]
+            )]
+         ])
+       "application/edn"
+       (into {} (for [[k v] idx]
+                  [k (:chain (get idx k))]
+                  ))))
    {:allowed-methods #{:get}
-    :media-type "text/html"
+    :access-control access-control
+    :media-type #{"text/html" "application/edn" "application/edn;pretty=true"}
     :charset charset/platform-charsets}))

 (defn entry [e]
   (yada/resource e {:media-type "text/html"
-                    :charset charset/platform-charsets}))
-
-
+                    :charset charset/platform-charsets
+                    :access-control access-control}))

 ;; TODO: Improve rendering


use source-map-timestamp

use source-map-timestamp

--- cljs/project.clj
+++ cljs/project.clj
@@ -62,7 +62,8 @@
                     :compiler-stats        true
                     :cache-analysis        true
                     :figwheel              true
-                    :source-map            true}}
+                    :source-map            true
+                    :source-map-timestamp  true}}
     :main
     {:source-paths ["checkouts/cljs-devtools/src"
                     "checkouts/re-frame/src"
@@ -81,7 +82,8 @@
                     :compiler-stats        true
                     :cache-analysis        true
                     :figwheel              true
-                    :source-map            true}}
+                    :source-map            true
+                    :source-map-timestamp  true}}
     :worker
     {:source-paths ["checkouts/re-frame/src"
                     "checkouts/rewrite-cljs/src"
@@ -101,4 +103,5 @@
                     :compiler-stats        true
                     :cache-analysis        true
                     :figwheel              true
-                    :source-map            true}}}})
+                    :source-map            true
+                    :source-map-timestamp  true}}}})


No need to pass anything to the SESMonitor component.

--- src/oc/email/components.clj
+++ src/oc/email/components.clj
@@ -6,7 +6,7 @@
             [oc.lib.sqs :as sqs]
             [oc.email.async.ses-monitor :as ses-monitor]))

-(defrecord SESMonitorConsumer [ses-monitor-consumer-fn]
+(defrecord SESMonitorConsumer []
   component/Lifecycle

   (start [component]
@@ -32,7 +32,7 @@
            (sqs/sqs-listener sqs-creds sqs-queue sqs-msg-handler)
            [:sentry-capturer])
      :ses-monitor (component/using
-                   (map->SESMonitorConsumer {:ses-monitor-consumer-fn ses-monitor-sqs-msg-handler})
+                   (->SESMonitorConsumer)
                    [:sentry-capturer])
      :ses-monitor-sqs (component/using
                        (sqs/sqs-listener sqs-creds ses-monitor-sqs-queue ses-monitor-sqs-msg-handler)


Fixed lint error.

Fixed lint error.

--- src/dragon/blog.clj
+++ src/dragon/blog.clj
@@ -114,7 +114,7 @@

 (defn data-minus-body
   [data]
-  (log/trace "Dumping body from: " (into [] data))
+  (log/trace "Dumping body from: " (vec data))
   (cond
     (map? data) (assoc data :body "...")
     (coll? data) (map #(assoc % :body "...") data)))


CMR-2240: Removing down migration.

CMR-2240: Removing down migration.

--- metadata-db-app/src/migrations/026_fix_entry_ids.clj
+++ metadata-db-app/src/migrations/026_fix_entry_ids.clj
@@ -24,7 +24,4 @@
   "Migrates the database down from version 26."
   []
   (println "migrations.026-fix-entry-ids down...")
-  (doseq [t (h/get-collection-tablenames)]
-    (h/sql (format "alter table %s modify (VERSION_ID null)" t))
-    (h/sql (format "update %s set entry_id = short_name where version_id = 'Not provided'" t))
-    (h/sql (format "update %s set entry_id = short_name || '_' || version_id where version_id != 'Not provided'" t))))
+  (throw (Exception. "This migration does not support 'down'")))


docstring formatting for keypin.core namespace

--- src/keypin/core.clj
+++ src/keypin/core.clj
@@ -106,7 +106,7 @@
 (defn realize-config
   "Realize config by applying variable substitution, if any.

-  ## Options
+  ### Options

   | Kwarg          | Type   | Description                 | Default                 |
   |----------------|--------|-----------------------------|-------------------------|
@@ -124,7 +124,7 @@
 (defn read-config
   "Read config file(s) returning a `java.util.Map` instance.

-  ## Options
+  ### Options

   | Kwarg           | Type     | Description                                  | Default                         |
   |-----------------|----------|----------------------------------------------|---------------------------------|
@@ -156,7 +156,7 @@
 (defn write-config
   "Write config to a specified file.

-  ## Options
+  ### Options

   | Kwarg           | Type     | Description                               | Default                         |
   |-----------------|----------|-------------------------------------------|---------------------------------|
@@ -189,7 +189,7 @@
   |`:envvar` |Environment variable that can override the config value and system property (before parsing) |
   |`:source` |Source or container (of reference type, e.g. atom/agent/promise etc.) of key/value pairs     |

-  ## Lookup function
+  ### Lookup function

   ```
   (fn [store key validator description value-parser default-value? default-value not-found-handler])->value
@@ -239,7 +239,7 @@

   See [[make-key]] for options. First argument to `defkey` can optionally be a base option-map for all argument vectors.

-  ## Examples
+  ### Examples

   ```
   (defkey
@@ -303,7 +303,7 @@
   "Like `let`, except in which the left hand side is a destructuring map, right hand side is the argument to key finder.
   Beside symbols, the destructuring map optionally supports `:defs` (symbols bound to key finders) and `:as` keys.

-  ## Example
+  ### Example

   ```
   (letval [{:defs [foo bar] ; foo, bar are key finders


try parallel compute graph compiler

try parallel compute graph compiler

--- src/polismath/math/conversation.clj
+++ src/polismath/math/conversation.clj
@@ -676,7 +676,8 @@

 (def eager-profiled-compiler
-  (comp graph/eager-compile (partial graph/profiled :profile-data)))
+  ;(comp graph/eager-compile (partial graph/profiled :profile-data))
+  (comp graph/par-compile (partial graph/profiled :profile-data)))

 (def small-conv-update (eager-profiled-compiler small-conv-update-graph))
 (def large-conv-update (eager-profiled-compiler large-conv-update-graph))


Convert some mis-uses of (if*) forms to (when*)

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

--- src/obcc/dar/ls.clj
+++ src/obcc/dar/ls.clj
@@ -27,8 +27,8 @@
 (defn verify-compatibility [header] (let [compat (select-keys header [:magic :version])] (= compat CompatVersion)))

 (defn read-header [is]
-  (if-let [header (read-protobuf Header is)]
-    (if (verify-compatibility header)
+  (when-let [header (read-protobuf Header is)]
+    (when (verify-compatibility header)
       header)))

 (defn ls [file]


Add scroll-pane

Add scroll-pane

--- src/play_clj/ui.clj
+++ src/play_clj/ui.clj
@@ -5,8 +5,9 @@
            [com.badlogic.gdx.graphics.g2d BitmapFont TextureRegion]
            [com.badlogic.gdx.scenes.scene2d Actor Stage]
            [com.badlogic.gdx.scenes.scene2d.ui ButtonGroup CheckBox Dialog
-            HorizontalGroup Image ImageButton ImageTextButton Label SelectBox
-            Skin Slider Table TextButton TextField VerticalGroup WidgetGroup]
+            HorizontalGroup Image ImageButton ImageTextButton Label ScrollPane
+            SelectBox Skin Slider Table TextButton TextField VerticalGroup
+            WidgetGroup]
            [com.badlogic.gdx.scenes.scene2d.utils ActorGestureListener Align
             ChangeListener ClickListener DragListener FocusListener
             NinePatchDrawable SpriteDrawable TextureRegionDrawable
@@ -223,6 +224,20 @@
   [entity k & options]
   `(u/call! ^Label (:object ~entity) ~k ~@options))

+(defn scroll-pane*
+  [child arg]
+  (u/create-entity (ScrollPane. (:object child) arg)))
+
+(defmacro scroll-pane
+  [child arg & options]
+  `(let [entity# (scroll-pane* ~child ~arg)]
+     (u/calls! ^ScrollPane (:object entity#) ~@options)
+     entity#))
+
+(defmacro scroll-pane!
+  [entity k & options]
+  `(u/call! ^ScrollPane (:object ~entity) ~k ~@options))
+
 (defn select-box*
   [items arg]
   (u/create-entity (SelectBox. (into-array items) arg)))


Add GA

Add GA

--- src/poehub/core.clj
+++ src/poehub/core.clj
@@ -66,7 +66,15 @@
     [:script {:src "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"
               :integrity "sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ=="
               :crossorigin="anonymous"} ""]
-    [:script {:src (link/file-path request "/js/poehub.js")} ""]]))
+    [:script {:src (link/file-path request "/js/poehub.js")} ""]
+    [:script "
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-70467764-1', 'auto');
+  ga('send', 'pageview');"]]))

 (defn index [ctx]
   (layout-page


fix network switching in dev mode

fix network switching in dev mode

--- src/status_im/network/ui/views.cljs
+++ src/status_im/network/ui/views.cljs
@@ -9,7 +9,8 @@
             [status-im.ui.components.toolbar.view :as toolbar]
             [status-im.ui.components.toolbar.actions :as toolbar.actions]
             [status-im.ui.components.styles :as components.styles]
-            [status-im.network.ui.styles :as styles]))
+            [status-im.network.ui.styles :as styles]
+            status-im.network.events))

 (defn- network-icon [connected? size]
   [react/view (styles/network-icon connected? size)


New test: send-error-response

New test: send-error-response

--- test/emender_jenkins/rest_api_test.clj
+++ test/emender_jenkins/rest_api_test.clj
@@ -60,6 +60,12 @@
         (is (callable? 'emender-jenkins.rest-api/send-response))))

+(deftest test-send-error-response-existence
+    "Check that the emender-jenkins.rest-api/send-error-response definition exists."
+    (testing "if the emender-jenkins.rest-api/send-error-response definition exists."
+        (is (callable? 'emender-jenkins.rest-api/send-error-response))))
+
+
 (deftest test-send-plain-response-existence
     "Check that the emender-jenkins.rest-api/send-plain-response definition exists."
     (testing "if the emender-jenkins.rest-api/send-plain-response definition exists."


fix error count

fix error count

--- src/rester/core.clj
+++ src/rester/core.clj
@@ -378,7 +378,7 @@
           tests-file (first args)
           results (-> tests-file (tests-from (opts "sheet")) (exec-tests opts) summarise-results)]
       ((juxt #(junit-report opts tests-file %) print-test-results) results)
-      (System/exit (- (results :total 0) (results :success 0))))
+      (System/exit (+ (get results :error 0) (get results :failure 0))))
     (finally
       (shutdown-agents))))


minor fixes

minor fixes

--- src/rester/core.clj
+++ src/rester/core.clj
@@ -32,7 +32,7 @@
     (str/replace s placeholder-pattern
                  #(str (or (opts (second %)) (log/error "missing argument:" (second %)) "")))))

-(defn- json->clj [json-str]
+(defn json->clj [json-str]
   (if-not (str/blank? json-str)
     (binding [factory/*json-factory* (factory/make-json-factory
                                       {:allow-unquoted-field-names true})]
@@ -74,27 +74,29 @@
     (log/debug "diff..." a b " is " ldiff)
     ldiff))

-(defn coerce-response [{:keys [body headers] :as resp}]
-  (assoc resp :body (condp re-find (or (:Content-Type headers) "")
-                      #"json" (json->clj body)
-                      #"xml" (try (parse-str body)
-                                  (catch Exception e (log/error e "failed parsing xml:" body) body))
-                      body)))
+(defn coerce-payload [payload content-type]
+  (try (condp re-find content-type
+         #"xml" (parse-str payload)
+         (json->clj payload))
+       (catch Exception e
+         (log/error e "failed coercing payload") payload)))

 (defn mk-request [{:keys[test url verb headers params payload] :as  req}]
   (log/info "executing" test ": " verb " " url)
-  (try
-    (-> (client/request {:url url
-                         :method (keyword (str/lower-case verb))
-                         ;; :content-type :json
-                         :headers headers
-                         :query-params params
-                         :body (if (string? payload) payload
-                                   (and (seq payload) (json/generate-string payload)))
-                         :insecure? true})
-        coerce-response)
-    (catch ExceptionInfo e
-      (.getData e))))
+  (let [start (System/nanoTime)]
+    (-> (try
+         (client/request {:url url
+                          :method (keyword (str/lower-case verb))
+                          ;; :content-type :json
+                          :headers headers
+                          :query-params params
+                          :body (if (string? payload) payload
+                                    (and (seq payload) (json/generate-string payload)))
+                          :insecure? true})
+         (catch ExceptionInfo e
+           (.getData e)))
+        (assoc :elapsed (/ (- (System/nanoTime) start) 1000))
+       (#(update % :body coerce-payload (get-in % [:headers "Content-Type"]))))))

 (defn extract-data [{:keys [status body headers] :as resp} extractions]
   (into {} (for [[name path] extractions]
@@ -146,11 +148,7 @@
     (let [options (into #{} (for [opt (str/split options #"\s*,\s*")] (keyword (str/lower-case opt))))
           exp-headers (str->map exp-headers #":")
           exp-body (if-not (str/blank? exp-body)
-                     (try (condp re-find (or (get exp-headers "Content-Type") "")
-                            #"xml" (parse-str exp-body)
-                            (json->clj exp-body))
-                          (catch Exception e
-                            (log/error e "failed parsing exp-body") exp-body)))]
+                     (coerce-payload exp-body (or (get exp-headers "Content-Type") "")))]
       (-> test (update :url replace-opts opts)
           (update :headers str->map #":" opts false)
           (update :params str->map #"\s*=\s*" opts true)


Unused code

Unused code

--- src/robb1e/core.clj
+++ src/robb1e/core.clj
@@ -1,6 +1 @@
 (ns robb1e.core)
-
-(defn foo
-  "I don't do a whole lot."
-  [x]
-  (println x "Hello, World!"))


white space cleanup

white space cleanup

--- src/selmer/tags.clj
+++ src/selmer/tags.clj
@@ -130,7 +130,7 @@
       (render-if-any false (rest params) if-tags else-tags render)
       (= ["not" "any"] (take 2 params))
       (render-if-any true (drop 2 params) if-tags else-tags render)
-
+
       (< (count params) 3)
       (if-default-handler params if-tags else-tags render)
       :else


minor

minor

--- src/sensor/core.clj
+++ src/sensor/core.clj
@@ -63,14 +63,18 @@
   (loop [count 1]
     (Thread/sleep 1000)
     (flush)
-    (if false;(or (= count 5) (= count 15))
+    (if (= (mod 10 count) 0)
       (do
-        (println "sending command")
-        (doseq [c (map int "105;0;2;0;1;\n")]
-          (serial/write-int port c))
+        (println "sending command on")
+        ;(doseq [c (map int "105;0;2;0;1;\n")]
+        ;  (serial/write-int port c))
         ))
-    (if (= count 10)
-      (println @in-string))
+    (if (= (mod 10 (+ 5 count)) 0)
+      (do
+        (println "sending command off")
+        ;(doseq [c (map int "105;0;2;0;1;\n")]
+        ;  (serial/write-int port c))
+        ))
     (recur (inc count))

     )


updated refer to allow limbs to be references without being qualified by namespace

--- src/test/clojure/naojure/sample.clj
+++ src/test/clojure/naojure/sample.clj
@@ -1,8 +1,10 @@
 (ns naojure.sample
   (:require [naojure.core :as nao :refer []]))

-(require '[naojure.core :as nao]
-         '[clojure.core.async :as async :refer [<! >! timeout chan alt! go]]
+(require '[naojure.core :as nao
+           :refer [head arms elbows wrists hands legs knees feet]]
+         '[clojure.core.async :as async
+           :refer [<! >! timeout chan alt! go]]
          '[clojure.pprint :refer [pprint]])

 ;; examples of how we'd like to control NAO with clojure


Decrease peer count for multi-peer-mem

Decrease peer count for multi-peer-mem

--- test/onyx/peer/multi_peer_mem_test.clj
+++ test/onyx/peer/multi_peer_mem_test.clj
@@ -80,7 +80,7 @@

 (>!! in-chan :done)

-(def v-peers (onyx.api/start-peers 8 peer-group))
+(def v-peers (onyx.api/start-peers 4 peer-group))

 (onyx.api/submit-job
  peer-config


CW | 29 | add journey test for registration during auth flow

--- test/stonecutter_journey_test/test.clj
+++ test/stonecutter_journey_test/test.clj
@@ -49,6 +49,7 @@
 (def stonecutter-register-confirm-password-input ".func--confirm-password__input")
 (def stonecutter-register-create-profile-button ".func--create-profile__button")
 (def stonecutter-profile-created-page-body ".func--profile-created-page")
+(def stonecutter-profile-created-next-link ".func--profile-created-next__button")
 (def stonecutter-authorise-page-body ".func--authorise-page")
 (def stonecutter-authorise-failure-body ".func--authorise-failure-page")
 (def stonecutter-authorise-cancel-link ".func--authorise-cancel__link")
@@ -184,5 +185,35 @@
           (screenshot "stonecutter_profile-deleted")
           (wd/current-url) => (contains "stonecutter.herokuapp.com/profile-deleted"))

+    (fact "can continue to authorise app even when registering a new account"
+          (wd/to "https://stonecutter-client.herokuapp.com")
+          (wait-for-selector client-home-page-body)
+          (wd/click "button")
+          (wait-for-selector stonecutter-sign-in-page-body)
+          (wd/click stonecutter-sign-in-page-register-link)
+          (wait-for-selector stonecutter-register-page-body)
+
+          ;; Enter user details to register
+          (wd/input-text stonecutter-register-email-input "stonecutter-journey-test@tw.com")
+          (wd/input-text stonecutter-register-password-input "password")
+          (wd/input-text stonecutter-register-confirm-password-input "password")
+          (wd/click stonecutter-register-create-profile-button)
+
+          ;; View profile created page
+          (wait-for-selector stonecutter-profile-created-page-body)
+          (screenshot "stonecutter_profile_created_page_from_auth")
+
+          (wd/click stonecutter-profile-created-next-link)
+          (wait-for-selector stonecutter-authorise-page-body)
+
+          (screenshot "stonecutter_authorisation_form_after_registration")
+          (wd/current-url) => (contains "stonecutter.herokuapp.com/authorisation")
+
+          ;; Cleaning up
+          (go-to-delete-account)
+          (wd/current-url) => (contains "stonecutter.herokuapp.com/delete-account")
+          (confirm-delete-account)
+          (wd/current-url) => (contains "stonecutter.herokuapp.com/profile-deleted"))
+
     (catch Exception e
       (screenshot "ERROR"))))


Tundra unit tests: use wcar* macro

Tundra unit tests: use wcar* macro

--- test/taoensso/carmine/tests/tundra.clj
+++ test/taoensso/carmine/tests/tundra.clj
@@ -44,44 +44,44 @@

 (let [tstore (tundra/tundra-store dstore)]
   (expect (and (:access-key creds) (:secret-key creds)))
-  (expect Exception (wcar {} (tundra/dirty     tstore (tkey "invalid"))))
-  (expect nil       (wcar {} (tundra/ensure-ks tstore (tkey "invalid"))))
-  (expect Exception (wcar {} (car/sadd @#'tundra/k-evictable (tkey "invalid-evictable"))
-                             (tundra/ensure-ks tstore (tkey "invalid-evictable")))))
+  (expect Exception (wcar* (tundra/dirty     tstore (tkey "invalid"))))
+  (expect nil       (wcar* (tundra/ensure-ks tstore (tkey "invalid"))))
+  (expect Exception (wcar* (car/sadd @#'tundra/k-evictable (tkey "invalid-evictable"))
+                           (tundra/ensure-ks tstore (tkey "invalid-evictable")))))

 (expect [[:clj-val] [:clj-val] [:clj-val-new]]
   (let [tstore  (tundra/tundra-store dstore {:qname qname})
         tworker (tundra/worker tstore {} {:eoq-backoff-ms 100 :throttle-ms 100})]
-    (wcar {} (car/mset (tkey 0) [:clj-val]
-                       (tkey 1) [:clj-val]
-                       (tkey 2) [:clj-val])) ; Reset vals
+    (wcar* (car/mset (tkey 0) [:clj-val]
+                     (tkey 1) [:clj-val]
+                     (tkey 2) [:clj-val])) ; Reset vals

     ;; Invalid keys don't prevent valid keys from being processed
-    (wcar {} (try (tundra/dirty tstore (tkey "invalid") (tkey "invalid-evictable")
-                                       (tkey 0) (tkey 1) (tkey 2))
+    (wcar* (try (tundra/dirty tstore (tkey "invalid") (tkey "invalid-evictable")
+                                     (tkey 0) (tkey 1) (tkey 2))
                   (catch Exception _ nil)))

     (Thread/sleep 8000) ; Wait for replication
     (mq/stop tworker)
-    (wcar {} (car/del (tkey 0))
-             (car/set (tkey 2) [:clj-val-new])
-             (car/with-replies)) ; Make some local modifications
+    (wcar* (car/del (tkey 0))
+           (car/set (tkey 2) [:clj-val-new])
+           (car/with-replies)) ; Make some local modifications

-    ;; Invalid keys throw w/o preventing valid keys from being processed
-    (wcar {} (try (tundra/ensure-ks tstore (tkey "invalid") (tkey "invalid-evictable")
-                                           (tkey 0) (tkey 1) (tkey 2))
-                  (catch Exception _ nil)))
-    (wcar {} (car/mget (tkey 0) (tkey 1) (tkey 2)))))
+    ;; Invalid keys don't prevent valid keys from being processed
+    (wcar* (try (tundra/ensure-ks tstore (tkey "invalid") (tkey "invalid-evictable")
+                                         (tkey 0) (tkey 1) (tkey 2))
+                (catch Exception _ nil)))
+    (wcar* (car/mget (tkey 0) (tkey 1) (tkey 2)))))

 (expect [-1 -1 -1] ; nil eviction timeout (default) is respected!
   (let [tstore  (tundra/tundra-store dstore {:qname qname})
         tworker (tundra/worker tstore {} {:eoq-backoff-ms 100 :throttle-ms 100})]
-    (wcar {} (car/mset (tkey 0) "0" (tkey 1) "1" (tkey 2) "1") ; Clears timeouts
-             (tundra/dirty tstore (tkey 0) (tkey 1) (tkey 2))
-             (Thread/sleep 8000) ; Wait for replication
-             (mq/stop tworker)
-             (tundra/ensure-ks tstore (tkey 0) (tkey 1) (tkey 2)))
-    (wcar {} (mapv #(car/ttl (tkey %)) [0 1 2]))))
+    (wcar* (car/mset (tkey 0) "0" (tkey 1) "1" (tkey 2) "1") ; Clears timeouts
+           (tundra/dirty tstore (tkey 0) (tkey 1) (tkey 2))
+           (Thread/sleep 8000) ; Wait for replication
+           (mq/stop tworker)
+           (tundra/ensure-ks tstore (tkey 0) (tkey 1) (tkey 2)))
+    (wcar* (mapv #(car/ttl (tkey %)) [0 1 2]))))

 (expect ; nnil eviction timeout is applied & extended correctly
  (fn [[t0 t1 t2]]
@@ -93,17 +93,17 @@
                                             :qname qname})
        tworker (tundra/worker tstore {} {:eoq-backoff-ms 100 :throttle-ms 100
                                          :auto-start? false})]
-   (wcar {} (car/set (tkey 0) "0") ; Clears timeout
-            (tundra/dirty tstore (tkey 0)))
+   (wcar* (car/set (tkey 0) "0") ; Clears timeout
+          (tundra/dirty tstore (tkey 0)))

-   (wcar {} (car/ttl (tkey 0))
-            (mq/start tworker)
-            (Thread/sleep 3000) ; Wait for replication
-            (mq/stop tworker)
-            (car/ttl (tkey 0))
-            (Thread/sleep 1000)
-            (tundra/ensure-ks tstore (tkey 0))
-            (car/ttl (tkey 0)))))
+   (wcar* (car/ttl (tkey 0))
+          (mq/start tworker)
+          (Thread/sleep 3000) ; Wait for replication
+          (mq/stop tworker)
+          (car/ttl (tkey 0))
+          (Thread/sleep 1000)
+          (tundra/ensure-ks tstore (tkey 0))
+          (car/ttl (tkey 0)))))

 (comment (clean-up!)
          (mq/queue-status {} qname))


make view [de]registration properly atomic - a couple of small code tidy ups

--- dada-core/src/main/clojure/org/dada/core/SimpleModelView.clj
+++ dada-core/src/main/clojure/org/dada/core/SimpleModelView.clj
@@ -3,20 +3,13 @@
    [clojure.contrib logging]
    [org.dada.core counted-set]
    )
-  ;; (:require
-  ;;  [org.dada.core BaseModelView]
-  ;;  )
   (:import
    [java.util Collection]
    [org.dada.core Data Metadata RemoteModel Update View]
    )
   (:gen-class
-   ;;:extends org.dada.core.BaseModelView
    :implements [org.dada.core.ModelView java.io.Serializable]
-   :constructors {[String org.dada.core.Metadata]
-		  ;;[String org.dada.core.Metadata]
-		  []
-		  }
+   :constructors {[String org.dada.core.Metadata] []}
    :methods [[writeReplace [] Object]]
    :init init
    :state state
@@ -28,7 +21,6 @@
 (defn -init [#^String name #^Metadata metadata]

   [ ;; super ctor args
-   ;;[name metadata]
    []
    ;; instance state
    (let [key-getter (.getPrimaryGetter metadata)
@@ -145,29 +137,24 @@
     (extant key)))

 (defn #^Data -registerView [#^org.dada.core.SimpleModelView this #^View view]
-  (let [[_ mutable] (.state this)
-	[extant extinct] @mutable]
+  (let [[_ mutable] (.state this)]
     ;; N.B. does not check to see if View is already Registered
     (debug ["REGISTER VIEW   ->" view (@mutable 2)])
-    (swap! mutable (fn [state view] (assoc state 2 (counted-set-inc (state 2) view))) view)
-    (debug ["REGISTER VIEW   <-" (@mutable 2)])
-    (Data. (vals extant) (vals extinct))
-    )
-  )
+    (let [[extant extinct views] (swap! mutable (fn [state view] (assoc state 2 (counted-set-inc (state 2) view))) view)]
+      (debug ["REGISTER VIEW   <-" views])
+      (Data. (vals extant) (vals extinct)))))

 (defn #^Data -deregisterView [#^org.dada.core.SimpleModelView this #^View view]
-  (let [[_ mutable] (.state this)
-	[extant extinct] @mutable]
+  (let [[_ mutable] (.state this)]
     (debug ["DEREGISTER VIEW ->" view (@mutable 2)])
-    (swap! mutable (fn [state view] (assoc state 2 (counted-set-dec (state 2) view))) view)
-    (debug ["DEREGISTER VIEW <-" (@mutable 2)])
-    (Data. (vals extant) (vals extinct))
-    ))
+    (let [[extant extinct views] (swap! mutable (fn [state view] (assoc state 2 (counted-set-dec (state 2) view))) view)]
+      (debug ["DEREGISTER VIEW <-" views])
+      (Data. (vals extant) (vals extinct)))))

 (defn -notifyUpdate [#^org.dada.core.SimpleModelView this insertions alterations deletions]
   (let [[_ mutable] (.state this)
 	[_ _ views] @mutable]
-    (trace ["NOTIFY ->" @mutable])
+    (trace ["NOTIFY ->" views])
     (if (and (empty? insertions) (empty? alterations) (empty? deletions))
       (warn "empty event raised" (.getStackTrace (Exception.)))
       (dorun (map (fn [#^View view]	;dirty - side-effects
@@ -185,7 +172,6 @@

 (defn -update [#^org.dada.core.SimpleModelView this & inputs]
   (let [[[_ _ update-fn] mutable] (.state this)
-	[_ _ views] @mutable
 	[#^Collection i #^Collection a #^Collection d] (update-fn inputs)]
     (if (not (and (empty? i) (empty? a) (empty? d)))
       (-notifyUpdate this i a d))


(maint) Rename req to resp in tests

(maint) Rename req to resp in tests

Throughout the service tests, `req` was being used as a parameter name to
refer to the response from an http request. This commit renames that
everywhere to the more accurate `resp`.

--- test/puppetlabs/trapperkeeper/services/status/status_service_test.clj
+++ test/puppetlabs/trapperkeeper/services/status/status_service_test.clj
@@ -48,9 +48,9 @@
     [foo-service
      bar-service]
     (testing "returns latest status for all services"
-      (let [req (http-client/get "http://localhost:8180/status/v1/services")
-            body (json/parse-string (slurp (:body req)))]
-        (is (= 200 (:status req)))
+      (let [resp (http-client/get "http://localhost:8180/status/v1/services")
+            body (json/parse-string (slurp (:body resp)))]
+        (is (= 200 (:status resp)))
         (is (= {"bar" {"service-version" "0.1.0"
                        "service-status-version" 1
                        "status" "bar status 1 :info"}
@@ -59,9 +59,9 @@
                        "status" "foo status 2 :info"}}
                body))))
     (testing "uses status level from query param"
-      (let [req (http-client/get "http://localhost:8180/status/v1/services?level=debug")
-            body (json/parse-string (slurp (:body req)))]
-        (is (= 200 (:status req)))
+      (let [resp (http-client/get "http://localhost:8180/status/v1/services?level=debug")
+            body (json/parse-string (slurp (:body resp)))]
+        (is (= 200 (:status resp)))
         (is (= {"bar" {"service-version" "0.1.0"
                        "service-status-version" 1
                        "status" "bar status 1 :debug"}
@@ -75,33 +75,33 @@
     app
     [foo-service]
     (testing "returns service information for service that has registered a callback"
-      (let [req (http-client/get "http://localhost:8180/status/v1/services/foo")]
-        (is (= 200 (:status req)))
+      (let [resp (http-client/get "http://localhost:8180/status/v1/services/foo")]
+        (is (= 200 (:status resp)))
         (is (= {"service-version" "1.1.0"
                 "service-status-version" 2
                 "status" "foo status 2 :info"
                 "service-name" "foo"}
-               (json/parse-string (slurp (:body req)))))))
+               (json/parse-string (slurp (:body resp)))))))
     (testing "uses status level query param"
-      (let [req (http-client/get "http://localhost:8180/status/v1/services/foo?level=critical")]
-        (is (= 200 (:status req)))
+      (let [resp (http-client/get "http://localhost:8180/status/v1/services/foo?level=critical")]
+        (is (= 200 (:status resp)))
         (is (= {"service-version" "1.1.0"
                 "service-status-version" 2
                 "status" "foo status 2 :critical"
                 "service-name" "foo"}
-               (json/parse-string (slurp (:body req)))))))
+               (json/parse-string (slurp (:body resp)))))))
     (testing "returns a 404 for service not registered with the status service"
-      (let [req (http-client/get "http://localhost:8180/status/v1/services/notfound")]
-        (is (= 404 (:status req)))
+      (let [resp (http-client/get "http://localhost:8180/status/v1/services/notfound")]
+        (is (= 404 (:status resp)))
         (is (= {"error" {"type" "service-not-found"
                          "message" "No status information found for service notfound"}}
-               (json/parse-string (slurp (:body req)))))))))
+               (json/parse-string (slurp (:body resp)))))))))

 (deftest error-handling-test
   (with-status-service app []
     (testing "returns a 400 when an invalid level is queried for"
-      (let [req (http-client/get "http://localhost:8180/status/v1/services?level=bar")]
-        (is (= 400 (:status req)))
+      (let [resp (http-client/get "http://localhost:8180/status/v1/services?level=bar")]
+        (is (= 400 (:status resp)))
         (is (= {"error" {"type" "request-data-invalid"
                          "message" "Invalid level: :bar"}}
-               (json/parse-string (slurp (:body req)))))))))
+               (json/parse-string (slurp (:body resp)))))))))


Removed unused import

Removed unused import

--- kuona-core/test/kuona_core/git_test.clj
+++ kuona-core/test/kuona_core/git_test.clj
@@ -1,8 +1,7 @@
 (ns kuona-core.git-test
   (:require [midje.sweet :refer :all]
             [kuona-core.util :refer :all]
-            [kuona-core.git :as git])
-  (:import (java.net MalformedURLException URL)))
+            [kuona-core.git :as git]))

 (facts "about commit history"
        (let [test-repo-path (clojure.string/join "/" [(canonical-path "..") "test" "test-repo"])]


Introduced bug for phaser damage when fixing lint issues.

--- src/startrek/enterprise.clj
+++ src/startrek/enterprise.clj
@@ -131,7 +131,7 @@

     (when-not (neg? (get-in @game-state [:enterprise :shields]))
       (when (neg? (get-in @game-state [:enterprise :damage :computer_display]))
-        (swap! power update * (r/gen-double)))
+        (swap! power #(* % (r/gen-double))))

       (swap! game-state assoc-in [:current-klingons]
              (->> (get-in @game-state [:current-klingons])
@@ -264,6 +264,6 @@
   (u/message "DEVICE        STATE OF REPAIR")

   (doseq [damage (->> (get-in @game-state [:enterprise :damage])
-       (sort)
-       (map #(format "%-15s %-2d" ((first %) damage-station-map) (int (second %))))
-       )] (u/message damage)))
+                      (sort)
+                      (map #(format "%-15s %-2d" ((first %) damage-station-map) (int (second %)))))]
+    (u/message damage)))


handlers

handlers

--- src/swanson/routes/home.clj
+++ src/swanson/routes/home.clj
@@ -3,12 +3,13 @@
             [liberator.core :refer [defresource resource request-method-in]]
             [swanson.views.layout :as layout]))

-(defn home []
-  (layout/common [:h1 "Hello World!"]))
+(defresource home
+  :service-available? false
+  :handle-service-not-available "service is currently unavailable..."
+  :method-allowed? (request-method-in :get)
+  :handle-ok "Hello world!"
+  :etag "fixed-etag"
+  :available-media-types ["text-plain"])

 (defroutes home-routes
-  (ANY "/" request
-       (resource
-         :handle-ok "Hello world!"
-         :etag "fixed-etag"
-         :available-media-types ["text-plain"])))
+  (ANY "/" request home))


[#3036] WIP Use joined view of all data-groups for merge source table

Co-authored-by: Juan A. Ruz <fd32a78311daf157576625b0c2bbe145183ae007@gmail.com>

--- backend/src/akvo/lumen/lib/transformation/merge_datasets.clj
+++ backend/src/akvo/lumen/lib/transformation/merge_datasets.clj
@@ -2,6 +2,7 @@
   (:require [akvo.lumen.util :as util]
             [akvo.lumen.lib.env :as env]
             [akvo.lumen.lib.transformation.engine :as engine]
+            [akvo.lumen.lib.aggregation.commons :as aggregation.commons]
             [akvo.lumen.db.dataset :as db.dataset]
             [akvo.lumen.db.transformation :as db.transformation]
             [akvo.lumen.db.transformation.engine :as db.tx.engine]
@@ -118,13 +119,12 @@
                     [(str target-merge-column "= ?") merge-value]))))

 (defn get-source-dataset-2 [conn source]
-  (let [mergeColumn (get source "mergeColumn")
-        dataset-id (get source "datasetId")
-        dataset-version-id (:id (db.dataset-version/latest-dataset-version-2-by-dataset-id conn {:dataset-id dataset-id}))]
-    (if-let [data-group (db.data-group/get-data-group-by-column-name conn {:dataset-version-id dataset-version-id
-                                                                           :column-name mergeColumn})]
-      data-group
-      (throw (ex-info (format "Dataset %s does not exist" dataset-id)
+  (let [dataset-id (get source "datasetId")]
+    (if-let [data (aggregation.commons/table-name-and-columns-from-data-grops conn dataset-id)]
+      data
+      nil
+      ;; TODO: implemenmt exception when migrated fully to data-groups
+      #_(throw (ex-info (format "Dataset %s does not exist" dataset-id)
                       {:source source})))))

 (defn get-source-dataset [conn source]


CMR-4558 PR comment

CMR-4558 PR comment

--- common-app-lib/src/cmr/common_app/services/search/params.clj
+++ common-app-lib/src/cmr/common_app/services/search/params.clj
@@ -173,7 +173,7 @@
   [context concept-type params]
   (let [options (u/map-keys->kebab-case (get params :options {}))
         params (dissoc params :options)]
-    (when (not (empty? params))
+    (when (seq params)
       (map (fn [[param value]]
              (parameter->condition context concept-type param value options))
            params))))


added the plain text benchmark

added the plain text benchmark

--- luminus/hello/src/hello/routes/home.clj
+++ luminus/hello/src/hello/routes/home.clj
@@ -6,6 +6,10 @@

 (defroutes home-routes
   (GET "/" [] "Hello, World!")
+  (GET "/plaintext" []
+       {:status 200
+        :headers {"Content-Type" "text/plain; charset=utf-8"}
+        :body "Hello, World!"})
   (GET "/json" [] (response/json {:message "Hello, World!"}))
   (GET "/db/:queries" [queries] (response/json (run-queries (get-query-count queries))))
   (GET "/dbraw/:queries" [queries] (response/json (run-queries-raw (get-query-count queries))))


use update-in instead of assoc assoc.

use update-in instead of assoc assoc.

--- support/build-support/src/main/clojure/fnbox/build/tools.clj
+++ support/build-support/src/main/clojure/fnbox/build/tools.clj
@@ -98,7 +98,7 @@

 (defn set-welcome-root [xml]
   (if-let [loc (zfx/xml1-> (zip/xml-zip xml) zf/descendants :virtual-server [#(not= (zfx/attr % :enable-welcome-root) "false")])]
-    (recur (zip/root (zip/edit loc #(assoc % :attrs (assoc (:attrs %) :enable-welcome-root "false")))))
+    (recur (zip/root (zip/edit loc #(update-in % [:attrs :enable-welcome-root] (constantly "false")))))
     xml))

 (defn add-system-properties-tag [xml]


reduce the generation sizes so that the tests can actually finish

--- test/aurora/btree_test.cljs
+++ test/aurora/btree_test.cljs
@@ -30,27 +30,27 @@
   aurora.btree/anti-symmetric-prop)

 (defspec total-prop-test
-  1000
+  100
   aurora.btree/total-prop)

 (defspec building-assoc-test
-  500
+  100
   (aurora.btree/building-prop aurora.btree/gen-assoc))

 (defspec building-action-test
-  500
+  100
   (aurora.btree/building-prop aurora.btree/gen-action))

 (defspec lookup-action-test
-  500
+  100
   (aurora.btree/lookup-prop aurora.btree/gen-action))

 (defspec iterator-prop-test
-  500
+  100
   aurora.btree/iterator-prop)

 (defspec intersection-prop-test
-  500
+  50
   aurora.btree/intersection-prop)

 (comment


Deleted placeholder for stupid idea.

Deleted placeholder for stupid idea.

--- test/behaviors/t_setup_teardown.clj
+++ test/behaviors/t_setup_teardown.clj
@@ -80,10 +80,6 @@
      (+ (f x) 2) => 4)
    (fact (only-passes? 1) => truthy)))

-(future-fact "users can make functions that return before/after/around descriptions"
-  (against-background (x-is-available-with-value-1))
-  x => 1)
-
 					; ========


try to fix unit tests

try to fix unit tests

--- test/cljs/triboard/test_runner.cljs
+++ test/cljs/triboard/test_runner.cljs
@@ -1,6 +1,9 @@
 (ns ^:figwheel-always triboard.test-runner
   (:require
-    [cljs.test :refer-macros [run-all-tests]]
+    [cljs.test]
     ))

-(run-all-tests #"triboard.*test")
+;;(cljs.test/run-all-tests #"triboard.*test")
+
+(cljs.test/run-tests
+  'triboard.core-test)


fixed typo

fixed typo

--- test/foreclojure/test/solutions.clj
+++ test/foreclojure/test/solutions.clj
@@ -16,10 +16,16 @@
       (get-solution :private uid pid) => code
       (provided
         (fetch-one :solutions :where {:user uid :problem pid}) => {:code code}))
-    (fact "about get-solution: hide solutions"
+    (fact "about get-solution: hide solutions = true"
       (get-solution :public uid pid) => falsey
       (provided
+        (fetch-one :solutions :where {:user uid :problem pid}) => {:code code}
         (fetch-one :users :where {:_id uid} :only [:hide-solutions]) => {:hide-solutions true}))
+    (fact "about get-solution: hide solutions = true"
+      (get-solution :public uid pid) => code
+      (provided
+        (fetch-one :solutions :where {:user uid :problem pid}) => {:code code}
+        (fetch-one :users :where {:_id uid} :only [:hide-solutions]) => {:hide-solutions false}))
     (fact "about get-solution: scored early"
       (get-solution uid pid) => (err-msg "solution.scored-early" pid)
       (provided


Property test initial coordination barrier send

--- test/onyx/generative/peer_model.clj
+++ test/onyx/generative/peer_model.clj
@@ -13,6 +13,7 @@
             [onyx.log.commands.common :as common]
             [onyx.mocked.failure-detector]
             [onyx.mocked.log]
+            [onyx.peer.coordinator]
             [onyx.log.replica]
             [onyx.extensions :as extensions]
             [onyx.system :as system]
@@ -366,9 +367,15 @@
                                                         (m/poll-recover messenger))
                   onyx.peer.coordinator/next-replica (fn [coordinator replica]
                                                        (if (:started? coordinator)
-                                                         (do (println "Next" (:messenger coordinator))
-                                                             (println "Last was" (:coordinator-thread coordinator))
-                                                             coordinator)
+                                                         (let [state (:coordinator-thread coordinator)]
+                                                           (assoc coordinator
+                                                                  :coordinator-thread (assoc state :prev-replica replica)
+                                                                  :messenger (onyx.peer.coordinator/emit-reallocation-barrier
+                                                                              (:messenger coordinator)
+                                                                              (:replica state)
+                                                                              replica
+                                                                              (:job-id state)
+                                                                              (:peer-id state))))
                                                          coordinator))
                   onyx.messaging.atom-messenger/atom-peer-group shared-peer-group
                   ;; Make start and stop threadless / linearizable


Fix fn grouping test.

Fix fn grouping test.

--- test/onyx/peer/fn_grouping_test.clj
+++ test/onyx/peer/fn_grouping_test.clj
@@ -1,8 +1,8 @@
 (ns onyx.peer.fn-grouping-test
-  (:require [onyx.peer.task-lifecycle-extensions :as l-ext]
-            [taoensso.timbre :refer [info]]
+  (:require [clojure.core.async :refer [chan >!! <!! close! sliding-buffer]]
             [midje.sweet :refer :all]
-            [onyx.queue.hornetq-utils :as hq-util]
+            [onyx.peer.task-lifecycle-extensions :as l-ext]
+            [onyx.plugin.core-async :refer [take-segments!]]
             [onyx.api]))

 (def id (java.util.UUID/randomUUID))
@@ -20,15 +20,15 @@

 (def output (atom []))

-(def hq-config {"host" (:host (:non-clustered (:hornetq config)))
-                "port" (:port (:non-clustered (:hornetq config)))})
+(def in-chan (chan 1000000))

-(def in-queue (str (java.util.UUID/randomUUID)))
+(def out-chan (chan (sliding-buffer 1000000)))

-(def out-queue (str (java.util.UUID/randomUUID)))
+(defmethod l-ext/inject-lifecycle-resources :in
+  [_ _] {:core.async/chan in-chan})

-(hq-util/create-queue! hq-config in-queue)
-(hq-util/create-queue! hq-config out-queue)
+(defmethod l-ext/inject-lifecycle-resources :out
+  [_ _] {:core.async/chan out-chan})

 (defmethod l-ext/inject-lifecycle-resources
   :onyx.peer.fn-grouping-test/sum-balance
@@ -50,33 +50,33 @@
 (defn group-by-name [{:keys [name]}]
   name)

-(def workflow {:in {:sum-balance :out}})
+(def workflow
+  [[:in :sum-balance]
+   [:sum-balance :out]])

 (def catalog
   [{:onyx/name :in
-    :onyx/ident :hornetq/read-segments
+    :onyx/ident :core.async/read-from-chan
     :onyx/type :input
-    :onyx/medium :hornetq
-    :hornetq/queue-name in-queue
-    :hornetq/host (:host (:non-clustered (:hornetq config)))
-    :hornetq/port (:port (:non-clustered (:hornetq config)))
-    :onyx/batch-size 1000}
+    :onyx/medium :core.async
+    :onyx/batch-size 40
+    :onyx/max-peers 1
+    :onyx/doc "Reads segments from a core.async channel"}

    {:onyx/name :sum-balance
     :onyx/ident :onyx.peer.fn-grouping-test/sum-balance
     :onyx/fn :onyx.peer.fn-grouping-test/sum-balance
     :onyx/type :function
     :onyx/group-by-fn :onyx.peer.fn-grouping-test/group-by-name
-    :onyx/batch-size 1000}
+    :onyx/batch-size 40}

    {:onyx/name :out
-    :onyx/ident :hornetq/write-segments
+    :onyx/ident :core.async/write-to-chan
     :onyx/type :output
-    :onyx/medium :hornetq
-    :hornetq/queue-name out-queue
-    :hornetq/host (:host (:non-clustered (:hornetq config)))
-    :hornetq/port (:port (:non-clustered (:hornetq config)))
-    :onyx/batch-size 1000}])
+    :onyx/medium :core.async
+    :onyx/batch-size 40
+    :onyx/max-peers 1
+    :onyx/doc "Writes segments to a core.async channel"}])

 (def size 3000)

@@ -128,20 +128,20 @@
    (map (fn [_] {:name "Eusebia" :amount 10}) (range size))
    (map (fn [_] {:name "Fletcher" :amount 10}) (range size))))

-(hq-util/write-and-cap! hq-config in-queue data 100)
+(doseq [x data]
+  (>!! in-chan x))

-(def v-peers (onyx.api/start-peers! 6 peer-config))
+(>!! in-chan :done)
+(close! in-chan)

-(onyx.api/submit-job peer-config
-                     {:catalog catalog :workflow workflow
-                      :task-scheduler :onyx.task-scheduler/round-robin})
+(def v-peers (onyx.api/start-peers 3 peer-config))

-(def results (hq-util/consume-queue! hq-config out-queue 1))
+(onyx.api/submit-job
+ peer-config
+ {:catalog catalog :workflow workflow
+  :task-scheduler :onyx.task-scheduler/round-robin})

-(doseq [v-peer v-peers]
-  (onyx.api/shutdown-peer v-peer))
-
-(onyx.api/shutdown-env env)
+(def results (take-segments! out-chan))

 (def out-val @output)

@@ -153,3 +153,8 @@

 (fact results => [:done])

+(doseq [v-peer v-peers]
+  (onyx.api/shutdown-peer v-peer))
+
+(onyx.api/shutdown-env env)
+


rename

rename

--- pigpen-cascading/src/test/clojure/pigpen/cascading_test.clj
+++ pigpen-cascading/src/test/clojure/pigpen/cascading_test.clj
@@ -4,7 +4,7 @@
            (org.apache.hadoop.conf Configuration))
   (:use clojure.test pigpen.cascading)
   (:require [pigpen.extensions.test :refer [test-diff pigsym-zero pigsym-inc]]
-            [pigpen.cascading.core :as pig]))
+            [pigpen.cascading.core :as pigpen]))

 (def input1 "/tmp/input1")
 (def input2 "/tmp/input2")
@@ -27,10 +27,10 @@
          (letfn
              [(func [data]
                     (->> data
-                         (pig/map (fn [[a b c]]
+                         (pigpen/map (fn [[a b c]]
                                     {:sum  (+ (Integer/valueOf a) (Integer/valueOf b))
                                      :name c}))
-                         (pig/filter (fn [{:keys [sum]}]
+                         (pigpen/filter (fn [{:keys [sum]}]
                                        (< sum 5)))))
               (query [input-file output-file]
                      (->>
@@ -46,7 +46,7 @@
   (write-input input2 [{:c 1 :d "foo"} {:c 2 :d "bar"} {:c 2 :d "baz"}])
   (let [left (load-clj input1)
         right (load-clj input2)
-        command (pig/cogroup [(left :on :a)
+        command (pigpen/cogroup [(left :on :a)
                               (right :on :c)]
                              (fn [k l r] [k (map :b l) (map :d r)]))
         command (store-clj output command)]


less logging still

less logging still

--- test/metabase/test/data.clj
+++ test/metabase/test/data.clj
@@ -119,8 +119,6 @@
                      (when special-type
                        (log/info (format "SET SPECIAL TYPE %s.%s -> %s" table-name field-name special-type))
                        (upd Field (:id @field) :special_type (name special-type)))))))
-
-             (log/info (color/blue "Finished."))
              db))))))

 (defn remove-database!


Use shell scheduler as the default

Use shell scheduler as the default

--- resources/leiningen/new/mesos_framework/dev/user.clj
+++ resources/leiningen/new/mesos_framework/dev/user.clj
@@ -54,7 +54,7 @@
   [& [task-type]]
   (when-let [task-fn (if (or (keyword? task-type) (nil? task-type))
                        (condp = task-type
-                         nil sched/jar-task-info
+                         nil sched/shell-task-info
                          :jar sched/jar-task-info
                          :shell sched/shell-task-info
                          :docker  sched/docker-task-info)


CMR-6161 removed unused namespaces

CMR-6161 removed unused namespaces

--- search-app/src/cmr/search/services/autocomplete_service.clj
+++ search-app/src/cmr/search/services/autocomplete_service.clj
@@ -1,9 +1,6 @@
 (ns cmr.search.services.autocomplete-service
   "Service for autocomplete functionality"
   (:require
-    [clojure.string :as str]
-    [cheshire.core :as json]
-    [cmr.common-app.services.search.params :as common-params]
     [cmr.common-app.services.search.query-execution :as qe]
     [cmr.common-app.services.search.query-model :as qm]
     [cmr.common-app.services.search.group-query-conditions :as gc]))


Support task options without short name (fixes #130)

--- boot/core/src/boot/cli.clj
+++ boot/core/src/boot/cli.clj
@@ -93,13 +93,14 @@
   ([short long type doc]
      (argspec->cli-argspec short long nil type doc))
   ([short long optarg type doc]
-     [:id           (keyword long)
-      :short-opt    (str "-" short)
-      :long-opt     (str "--" long)
-      :required     (when optarg (str optarg))
-      :desc         (format-doc optarg type doc)
-      :parse-fn     `(#'parse-fn ~(when optarg (list 'quote optarg)))
-      :assoc-fn     `(#'assoc-fn ~(when optarg (list 'quote optarg)) '~type)]))
+   ((fnil into [])
+    (when short [:short-opt (str "-" short)])
+    [:id           (keyword long)
+     :long-opt     (str "--" long)
+     :required     (when optarg (str optarg))
+     :desc         (format-doc optarg type doc)
+     :parse-fn     `(#'parse-fn ~(when optarg (list 'quote optarg)))
+     :assoc-fn     `(#'assoc-fn ~(when optarg (list 'quote optarg)) '~type)])))

 (defn- argspec->assert
   ([short long type doc]
@@ -187,73 +188,3 @@
          fmtdoc# (comp string/trim (#'indent 2))
          meta#   (update-in (meta ~sym) [:doc] fmtdoc#)]
      (doto var# (alter-meta! (fnil merge {}) meta#))))
-
-(comment
-
-  (defclifn d
-    "Docstring here."
-    [S no-source              bool        "Exclude source files from jar."
-     v verbose                int         "The verbosity level."
-     p project      SYM       sym         "The project id (eg. foo/bar)."
-     b bind         ADDR      str         "The address server will listen on."
-     n init-ns      SYM       sym         "The initial REPL namespace."
-     d description  DESC      str         "The project description."
-     D dependencies ID:VER    [[sym str]] "The dependencies vector."
-     l license      KEY=VAL   {kw str}    "The license map."
-     m middleware   SYM       [sym]       "The vector of REPL middleware."
-     M manifest     KEY=VAL   {str str}   "The jar manifest."
-     s scopes       SCOPE     #{str}      "The set of excluded scopes."
-     t thing        CODE      code        "Some computings."]
-
-    [*opts* *args*])
-
-  (d "-vvD" "foo/bar:0.1.0" "-p" "hello/world" "-l" "name=foop" "-l" "url=http://me.com" "-t" "(inc 41)" "zxcv" "qwer")
-  [{:thing 42,
-    :license {:url "http://me.com", :name "foop"},
-    :project hello/world,
-    :dependencies [[foo/bar "0.1.0"]],
-    :verbose 2}
-   ["zxcv" "qwer"]]
-
-  (doc d)
-  ; -------------------------
-  ; boot.cli-util/d
-  ; ([& {:keys [help no-source verbose project bind init-ns description dependencies license middleware manifest scopes thing], :as *opts*}])
-  ;   Docstring here.
-  ;
-  ;   Keyword Args:
-  ;     :help          bool         Print this help info.
-  ;     :no-source     bool         Exclude source files from jar.
-  ;     :verbose       int          The verbosity level.
-  ;     :project       sym          The project id (eg. foo/bar).
-  ;     :bind          str          The address server will listen on.
-  ;     :init-ns       sym          The initial REPL namespace.
-  ;     :description   str          The project description.
-  ;     :dependencies  [[sym str]]  The dependencies vector.
-  ;     :license       {kw str}     The license map.
-  ;     :middleware    [sym]        The vector of REPL middleware.
-  ;     :manifest      {str str}    The jar manifest.
-  ;     :scopes        #{str}       The set of excluded scopes.
-  ;     :thing         code         Some computings.
-  nil
-
-  (d "-h")
-  ; Docstring here.
-  ;
-  ; Options:
-  ;   -h, --help                 Print this help info.
-  ;   -S, --no-source            Exclude source files from jar.
-  ;   -v, --verbose              Increase the verbosity level.
-  ;   -p, --project SYM          Set the project id (eg. foo/bar) to SYM.
-  ;   -b, --bind ADDR            Set the address server will listen on to ADDR.
-  ;   -n, --init-ns SYM          Set the initial REPL namespace to SYM.
-  ;   -d, --description DESC     Set the project description to DESC.
-  ;   -D, --dependencies ID:VER  Conj [ID VER] onto the dependencies vector.
-  ;   -l, --license KEY=VAL      Conj [KEY VAL] onto the license map.
-  ;   -m, --middleware SYM       Conj SYM onto the vector of REPL middleware.
-  ;   -M, --manifest KEY=VAL     Conj [KEY VAL] onto the jar manifest.
-  ;   -s, --scopes SCOPE         Conj SCOPE onto the set of excluded scopes.
-  ;   -t, --thing CODE           Set some computings to CODE.
-  nil
-
-    )


test/riemann/xymon_test.clj: event->enable test suite

--- test/riemann/xymon_test.clj
+++ test/riemann/xymon_test.clj
@@ -30,6 +30,20 @@
     (doseq [[event line] pairs]
       (is (= line (event->status event))))))

+(deftest ^:xymon-enable event->enable-test
+  (let [pairs [[{}
+                "enable .*"]
+               [{:host "foo"}
+                "enable foo.*"]
+               [{:host "foo" :service "bar"}
+                "enable foo.bar"]
+               [{:host "foo.example.com" :service "bar"}
+                "enable foo,example,com.bar"]
+               [{:host "foo" :service "b  a.r"}
+                "enable foo.b__a_r"]]]
+    (doseq [[event line] pairs]
+      (is (= line (event->enable event))))))
+
 (deftest ^:xymon ^:integration xymon-test
          (let [k (xymon nil)]
            (k {:host "riemann.local"


Fix stream tests to work with wonko-client 0.1.4

- Since execution in wonko-client is async, we can not rely on the
  messages to be sent serially anymore. This test attested on the first
  of the events received, which is necessarily the first event sent to
  kafka, but not necessarily the first event sent to wonko-client.

--- test/wonko/streams_test.clj
+++ test/wonko/streams_test.clj
@@ -11,7 +11,7 @@

 (deftest test-streams
   (testing "producing, consuming and exporting streams works"
-    (let [service-name "wonko-test-streams-service"
+    (let [service-name (str (gensym "wonko-test-streams-service"))
           {:keys [events-topic alerts-topic]} (tu/create-topics)
           consumed-events (atom [])
           thread-pool (consume/start {events-topic 1 alerts-topic 1}
@@ -24,13 +24,16 @@
       (client/stream :feed-length {:status :success} 20)
       (tu/wait-for #(= 3 (count @consumed-events)) :interval 1 :timeout 3)

-      (is (= (dissoc (first @consumed-events) :metadata)
-             {:service "wonko-test-streams-service"
-              :metric-name "feed-length"
-              :metric-type "stream"
-              :metric-value 0
-              :properties {:status "success"}
-              :options nil}))
+      (is (= 3 (count @consumed-events)))
+
+      (let [first-metric (first (filter #(= 0 (:metric-value %)) @consumed-events))]
+        (is (= (dissoc first-metric :metadata)
+               {:service service-name
+                :metric-name "feed-length"
+                :metric-type "stream"
+                :metric-value 0
+                :properties {:status "success"}
+                :options nil})))

       (let [histogram (get-in @prometheus/created-metrics
                               [service-name :stream "feed-length" "histogram"])


Let exceptions bubble out of codox

Let exceptions bubble out of codox

--- clojuresque-base-runtime/src/main/resources/clojuresque/codox/reader.clj
+++ clojuresque-base-runtime/src/main/resources/clojuresque/codox/reader.clj
@@ -33,16 +33,13 @@

 (defn- read-ns [namespace]
   (when namespace
-    (try
-      (require namespace)
-      (-> (find-ns namespace)
-          (meta)
-          (assoc :name namespace)
-          (assoc :publics (read-publics namespace))
-          (update-in [:doc] correct-indent)
-          (list))
-      (catch Exception e
-        (println "Could not generate documentation for" namespace)))))
+    (require namespace)
+    (-> (find-ns namespace)
+      (meta)
+      (assoc :name namespace)
+      (assoc :publics (read-publics namespace))
+      (update-in [:doc] correct-indent)
+      (list))))

 (defn read-namespaces
   "Read namespaces from a source directory (defaults to \"src\"), and


minor linting

minor linting

--- test/freecoin/fxc_test.clj
+++ test/freecoin/fxc_test.clj
@@ -40,8 +40,8 @@

   ;; manual creation of an nxt address to intercept it in clear
   (def fake {:ah (:integer (rand/create (:length param/encryption)))
-             :al (:integer (rand/create (:length param/encryption)))
-             })
+             :al (:integer (rand/create (:length param/encryption)))})
+
   (def nxtpass (fxc/render-slice param/encryption "STUB" (:ah fake) (:al fake) 0))

   (def secret (fxc/create-secret param/encryption "STUB" (:ah fake) (:al fake)))
@@ -49,20 +49,18 @@

   (pp/pprint nxtpass)
   (pp/pprint secret)
-
+
   (fact "cookie is first slice" (first (:slices secret)) => (:cookie secret))

   (fact "reversable extraction / hash / conversion for AH"
     (fxc/extract-ahal param/encryption (:cookie secret) "ah")
     =>
-    (fxc/extract-int param/encryption (first (:slices secret)) "ah")
-    )
+    (fxc/extract-int param/encryption (first (:slices secret)) "ah"))

   (fact "reversable extraction / hash / conversion for AL"
     (fxc/extract-ahal param/encryption (:cookie secret) "al")
     =>
-    (fxc/extract-int param/encryption (first (:slices secret)) "al")
-    )
+    (fxc/extract-int param/encryption (first (:slices secret)) "al"))

   (fact "unlocking secret"
     (let [quorum (fxc/extract-quorum param/encryption secret (:cookie secret))
@@ -73,8 +71,4 @@
       (fxc/render-slice param/encryption "STUB" ah al 0) => nxtpass
       (util/log! 'ACK 'unlocking-secret-test
                  ["Quorum size: " (count (get-in quorum [:ah :shares]))
-                  "expected: " (get-in quorum [:ah :header :quorum])]
-                 )
-      )
-    )
-  )
+                  "expected: " (get-in quorum [:ah :header :quorum])]))))


Fix failing integration tests.

Fix failing integration tests.

--- test/lein_xjc/t_plugin.clj
+++ test/lein_xjc/t_plugin.clj
@@ -1,7 +1,6 @@
 (ns lein-xjc.t-plugin
   (:require [cljito.core :refer :all]
             [lein-xjc.plugin :as plugin]
-            [lein-xjc.internal.target-dir :as td]
             [lein-xjc.internal.xjc :as xjc]
             [midje.sweet :refer :all])
   (:import [com.sun.tools.xjc Driver]))


remove duplicate test

remove duplicate test

--- test/merlion/core_test.clj
+++ test/merlion/core_test.clj
@@ -136,19 +136,6 @@
           (etcd-rm (str "service/" domain-name "/aaa"))
           (is (= (slurp "test/fixtures/excerpt.txt") @f)))))))

-#_
-(deftest no-backend
-  (testing "fetches hang when no backends"
-    (let [be-process (socat "test/fixtures/excerpt.txt")]
-      (with-running-server [prefix port]
-        (Thread/sleep 500)
-        (let [before (java.util.Date.)
-              s (doto (java.net.Socket.)
-                  (.connect (java.net.InetSocketAddress. "127.0.0.1" port) 1000)
-                  (.setSoTimeout 1000))]
-          (is (thrown? java.net.SocketTimeoutException
-                       (slurp (io/reader (.getInputStream s))))))))))
-
 (deftest no-backend
   (testing "fetches hang when no backends"
     (let [be-process (socat "test/fixtures/excerpt.txt")]


filename fix

filename fix

--- src/plugins/Scripts/Funimage/Experimental/star_detector.clj
+++ src/plugins/Scripts/Funimage/Experimental/star_detector.clj
@@ -321,4 +321,5 @@
   (let [imp-cc (ij1/autocontrast (ij1seg/color-code-rois imp rois (partial measure-fn imp)))]
     (ij.IJ/run imp-cc "Fire" "")
     (ij1/save-imp-as-tiff (ij1/show-imp (ij1/set-title imp-cc (name measure-name)))
-                          (str (.substring img-filename 0 (- (.length img-filename) 4)) "_" (name measure-name) ".tif"))))
+                          (let [img-filename (.fileName (.getFileInfo imp))]
+                            (str (.substring img-filename 0 (- (.length img-filename) 4)) "_" (name measure-name) ".tif")))))


Add tests for index creation

Add tests for index creation

--- test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
+++ test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
@@ -512,7 +512,19 @@
   (is (= "DROP TABLE foo"
          (drop-table :foo)))

-  (is (= "DROP TABLE IF EXISTS foo"
-         (drop-table :foo
-                     (if-exists))))
+  (is (= "
+  CREATE INDEX foo ON bar(baz)"
+         (normalize-string
+          (create-index "foo"
+                        (on-table "bar")
+                        (and-column "baz")))))
+
+  (is (= "
+  CREATE INDEX foo ON bar(KEYS(baz))"
+         (normalize-string
+          (create-index "foo"
+                        (on-table "bar")
+                        (and-keys-of-column "baz")))))
+
+
   )


fixed existing-install

fixed existing-install

--- integration/src/dda/pallet/dda_user_crate/app/instantiate_existing.clj
+++ integration/src/dda/pallet/dda_user_crate/app/instantiate_existing.clj
@@ -20,7 +20,7 @@
     [dda.pallet.dda-user-crate.app :as app]))

 (defn install
-  [count & options]
+  [& options]
   (let [{:keys [domain targets summarize-session]
          :or {domain "integration/resources/user.edn"
               targets "integration/resources/existing-targets.edn"


(SERVER-2763) Use `uri:classloader` to avoid globbing issue

The upgrade to Rubygems 3 broken some of JRuby's globbing code. They
fixed the issue around `uri:classloader`, but not issues with the
`classpath` protocol, which we were using to load our Ruby code inside
puppetserver. However, it appears we can switch to using
`uri:classloader` instead, so this PR changes our loadpath addition to
use that protocol. This means that globbing against our loadpath (e.g.
when installing gem documentation) now works.

--- src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
+++ src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
@@ -30,9 +30,9 @@
   directory is placed into the root of the jar structure which is on the
   classpath.

-  See also:  http://jruby.org/apidocs/org/jruby/runtime/load/LoadService.html"
-
-  "classpath:/puppetserver-lib")
+  See also:  https://www.javadoc.io/doc/org.jruby/jruby-core/latest/org/jruby/runtime/load/LoadService.html"
+
+  "uri:classloader:/puppetserver-lib")

 (def default-http-connect-timeout
   "The default number of milliseconds that the client will wait for a connection


removal of owner

removal of owner

--- src/cljs/org/broadinstitute/firecloud_ui/endpoints.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/endpoints.cljs
@@ -266,8 +266,7 @@
         :namespace (rand-nth ["Broad" "nci" "public" "ISB"])
         :snapshotId (rand-nth (range 100))
         :synopsis (str (rand-nth ["variant caller synopsis", "gene analyzer synopsis", "mutect synopsis"]) " " (inc i))
-        :createDate (str "20" (inc i) "-06-10T16:54:26Z")
-        :owner (rand-nth ["thibault@broadinstitute.org" "esalinas@broadinstitute.org"])})
+        :createDate (str "20" (inc i) "-06-10T16:54:26Z")})
      (range (rand-int 50)))})

 (defn copy-method-config-to-workspace [workspace-id]


Changing order of conditions on hunch it gives better performance. It is logically equivalent.

--- src/cmr/search/data/complex_to_simple_converters/spatial.clj
+++ src/cmr/search/data/complex_to_simple_converters/spatial.clj
@@ -37,9 +37,9 @@
             d (range-cond :east -180 east)
             e (range-cond :east east 180)
             f (range-cond :west west 180)
-            am-conds (gc/and-conds [(gc/or-conds [c f])
-                                    (gc/or-conds [d e])
-                                    (bool-cond :crosses-antimeridian true)])
+            am-conds (gc/and-conds [(bool-cond :crosses-antimeridian true)
+                                    (gc/or-conds [c f])
+                                    (gc/or-conds [d e])])
             lon-cond (gc/or-conds [(range-cond :west -180 east)
                                    (range-cond :east west 180)
                                    am-conds])]