test case for ns clinvar-submitter.ld

test case for ns clinvar-submitter.ld

--- test/clinvar_submitter/ld_test.clj
+++ test/clinvar_submitter/ld_test.clj
@@ -2,16 +2,16 @@
   (:require [clojure.test :refer :all]
             [clinvar-submitter.ld :refer :all]))

-(deftest read-ld-test
+(deftest resolve-id-test
   (testing "Test if an identifier is in symbol table"
            (let [t (read-ld "data/test_interp_1.dmwg.json" "data/context-new.jsonld")]
-           (is (= "http://reg.genome.network/allele/CA229854"
-           (resolve-id t "http://reg.genome.network/allele/CA229854")
-                   (println " Identifier is in symbol table"))))))
+           (is (= {"id" "https://www.ncbi.nlm.nih.gov/pubmed/12501224", "type" "InformationSource"}
+                  (resolve-id t "https://www.ncbi.nlm.nih.gov/pubmed/12501224"))
+                  (println " Identifier is in symbol table")))))

 (deftest ld-get-test
   (testing "Test if an map key value is in symbol table"
   (let [t (read-ld "data/test_interp_1.dmwg.json" "data/context-new.jsonld")]
-  (is (= t
-         (ld-get t "cg:A156" "cg:A158")
-         (println " Map is in symbol table"))))))+  (is (= nil
+         (ld-get t "id" "https://www.ncbi.nlm.nih.gov/pubmed/12501224"))
+         (println " Map is in symbol table")))))


Reformatted config.clj by zprint

Reformatted config.clj by zprint

--- src/zg/config.clj
+++ src/zg/config.clj
@@ -11,35 +11,35 @@
 ;

 (ns zg.config
-    "Module that contains all functions required to to load configuration from the INI file.")
+  "Module that contains all functions required to to load configuration from the INI file.")

 (require '[clojure.pprint         :as pprint])
 (require '[clojure.tools.logging  :as log])
 (require '[clojure-ini.core       :as clojure-ini])

 (defn parse-int
-    "Parse the given string as an integer number."
-    [^String string]
-    (java.lang.Integer/parseInt string))
+  "Parse the given string as an integer number."
+  [^String string]
+  (java.lang.Integer/parseInt string))

 (defn parse-float
-    "Parse the given string as a float number."
-    [^String string]
-    (java.lang.Float/parseFloat string))
+  "Parse the given string as a float number."
+  [^String string]
+  (java.lang.Float/parseFloat string))

 (defn parse-boolean
-    "Parse the given string as a boolean value."
-    [^String string]
-    (or (= string "true")
-        (= string "True")))
+  "Parse the given string as a boolean value."
+  [^String string]
+  (or (= string "true")
+      (= string "True")))

 (defn load-configuration
-    "Load configuration from the provided INI file."
-    [^String ini-file-name]
-    (clojure-ini/read-ini ini-file-name :keywordize? true))
+  "Load configuration from the provided INI file."
+  [^String ini-file-name]
+  (clojure-ini/read-ini ini-file-name :keywordize? true))

 (defn print-configuration
-    "Print actual configuration to the output."
-    [configuration]
-    (pprint/pprint configuration))
+  "Print actual configuration to the output."
+  [configuration]
+  (pprint/pprint configuration))


fix parentheses

fix parentheses

--- ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/es/es_filter.clj
+++ ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/es/es_filter.clj
@@ -66,28 +66,23 @@
   [:Value (Date. s)])

 (defmethod convert :Comp [v]
-  (println "converting v=" v)
-  ;; TODO : work around
-  (if (= 2 (count v))
-    (first (rest v))
-    (let [args (rest v)
-          args (if (= 1 (count args))
-                 (apply concat args)
-                 args)
-          {:keys [Attribute Op Value] :as m} (into {} args)
-          order (ffirst args)]
-      (case [Op order]
-        ["=" :Attribute] (term-query Attribute Value)
-        [">=" :Attribute] (range-ge-query Attribute Value)
-        [">" :Attribute] (range-gt-query Attribute Value)
-        ["<=" :Attribute] (range-le-query Attribute Value)
-        ["<" :Attribute] (range-lt-query Attribute Value)
-        ["=" :Value] (term-query Attribute Value)
-        [">=" :Value] (range-le-query Attribute Value)
-        [">" :Value] (range-lt-query Attribute Value)
-        ["<=" :Value] (range-ge-query Attribute Value)
-        ["<" :Value] (range-gt-query Attribute Value)
-        m))))
+           (let [args (rest v)]
+             (if (= 1 (count args))
+               (first args)                                          ;; (a=1 and b=2) case
+               (let [{:keys [Attribute Op Value] :as m} (into {} args)
+                     order (ffirst args)]
+                 (case [Op order]
+                       ["=" :Attribute] (term-query Attribute Value)
+                       [">=" :Attribute] (range-ge-query Attribute Value)
+                       [">" :Attribute] (range-gt-query Attribute Value)
+                       ["<=" :Attribute] (range-le-query Attribute Value)
+                       ["<" :Attribute] (range-lt-query Attribute Value)
+                       ["=" :Value] (term-query Attribute Value)
+                       [">=" :Value] (range-le-query Attribute Value)
+                       [">" :Value] (range-lt-query Attribute Value)
+                       ["<=" :Value] (range-ge-query Attribute Value)
+                       ["<" :Value] (range-gt-query Attribute Value)
+                       m)))))

 (defmethod convert :PropExpr [[_ Prop Op Value]]
   (let [result [[:Attribute (str "property." (second Prop))] Op Value]]
@@ -105,7 +100,10 @@
     (or-query args)))

 (defmethod convert :Filter [v]
-  (QueryBuilders/constantScoreQuery (second v)))
+           (let [arg (second v)]
+             (if (instance? ConstantScoreQueryBuilder arg)
+               arg                                                   ;; don't nest unnecessarily
+               (QueryBuilders/constantScoreQuery arg))))

 (defmethod convert :Attribute [v]
   [:Attribute (-> v second (s/replace "/" "."))])


Add automatic encoding for byte arrays in Cassandra statement values

--- systems/cassandra-node/src/containium/systems/cassandra/embedded12.clj
+++ systems/cassandra-node/src/containium/systems/cassandra/embedded12.clj
@@ -71,6 +71,10 @@
   (encode-value [value] "Encodes a value to a Cassandra encoded ByteBuffer."))

 (extend-protocol Encode
+  (Class/forName "[B")
+  (abstract-type [value] BytesType/instance)
+  (encode-value [value] (ByteBuffer/wrap value))
+
   BigDecimal
   (abstract-type [value] DecimalType/instance)
   (encode-value [value] (.decompose ^AbstractType (abstract-type value) value))


Fix test assertion

Fix test assertion

An assertion was checking containment in the wrong direction, and
therefore passing in situations where it should not.

--- test/timer_mystica/setup_test.cljs
+++ test/timer_mystica/setup_test.cljs
@@ -101,7 +101,7 @@
                            {:type    :same-color
                             :color   :gray
                             :indices [1 3]}]]
-      (is (every? #(some #{%} expected-errors) errors))))
+      (is (every? #(some #{%} errors) expected-errors))))
   (testing "It should report multiple players in variable factions"
     (let [state {:mode :setup
                  :players [(shapeshifters :green) (riverwalkers :red) witches nil nil]}


executing-killed-job? no longer used

executing-killed-job? no longer used

--- src/onyx/log/commands/kill_job.clj
+++ src/onyx/log/commands/kill_job.clj
@@ -25,9 +25,6 @@
   [entry old new]
   (second (diff (into #{} (:killed-jobs old)) (into #{} (:killed-jobs new)))))

-(defn executing-killed-job? [diff replica job-id peer-id]
-  (and diff (= (:job (peer->allocated-job (:allocations replica) peer-id)) job-id)))
-
 (defmethod extensions/reactions :kill-job
   [{:keys [args]} old new diff state]
   [])


send sentry msg when /sentry is hit

send sentry msg when /sentry is hit

--- src/open_company/api/companies.clj
+++ src/open_company/api/companies.clj
@@ -6,7 +6,8 @@
             [open-company.resources.company :as company]
             [open-company.representations.company :as company-rep]
             [open-company.config :as c]
-            [cheshire.core :as json]))
+            [cheshire.core :as json]
+            [raven-clj.core :as raven]))

 (defun add-ticker
   "Add the ticker symbol to the company properties if it's missing."
@@ -83,7 +84,16 @@
   :allowed-methods [:get]

   ;; Get a list of companies
-  :exists? (fn [_] {:sentry c/dsn})
+  :exists? (fn [_]
+              (when c/dsn
+                (raven/capture c/dsn {
+                  :message "Test Exception Message"
+                  :tags {:version "0.0.1"}
+                  :logger "main-logger"
+                  :extra {
+                    :my-key 1
+                    :some-other-value "foo bar"}}))
+              {:sentry c/dsn})
   :handle-ok (fn [ctx] (json/generate-string {:collection (array-map :sentry (:sentry ctx))} {:pretty true})))

 ;; ----- Routes -----


add docstring to org.martinklepsch.derived namespace

--- src/org/martinklepsch/derived.cljc
+++ src/org/martinklepsch/derived.cljc
@@ -1,4 +1,9 @@
-(ns org.martinklepsch.derived)
+(ns org.martinklepsch.derived
+  "An implementation of reactive derived values built on Clojure
+  atoms. Mostly inspired by rum.core/derived-atom but extended with
+  the possibility to dispose a derived value. Disposing will remove
+  relevant watches on source atoms thus making this implementation
+  suitable for dynamic use (runtime creation and disposal).")

 (defprotocol IDisposable
   (dispose! [this]))


[#12511] Fix unread indicator after opening profile modal from chat

--- src/status_im/navigation/core.cljs
+++ src/status_im/navigation/core.cljs
@@ -244,7 +244,7 @@
                                          :else
                                          (if (and (= :chat tab) platform/ios?)
                                            {:dotIndicator {:visible false}}
-                                           {:dotIndicator {:visible false} :badge nil}))}))))
+                                           {:dotIndicator {:visible false} :badge ""}))}))))

 (re-frame/reg-fx
  :pop-to-root-tab-fx


Update scala.clj

Update scala.clj

--- src/swagger_gen/language/scala.clj
+++ src/swagger_gen/language/scala.clj
@@ -53,4 +53,3 @@
       (format "case object %s" klass)
       (let [args (->> (map render-property props) (interpose ", ") (apply str))]
         (format "case class %s(%s)" klass args)))))
-


Removed read-byte-stream dispatch variants

Removed the read-byte-stream dispatch variants on String and File and
replaced their implementation as the default.

--- src/vignette/util/byte_streams.clj
+++ src/vignette/util/byte_streams.clj
@@ -21,11 +21,7 @@
   [resource length]
   (read-byte-stream-core resource length))

-(defmethod read-byte-stream java.lang.String
-  [resource length]
-  (read-byte-stream-core (clojure.java.io/input-stream resource) length))
-
-(defmethod read-byte-stream java.io.File
+(defmethod read-byte-stream :default
   [resource length]
   (read-byte-stream-core (clojure.java.io/input-stream resource) length))


[#9061] Fix balances fetching of a new keycard account

This issue wasn't properly fixed for a newly created account, balance
was properly fetched only after re-login.

--- src/status_im/hardwallet/core.cljs
+++ src/status_im/hardwallet/core.cljs
@@ -22,7 +22,8 @@
             [status-im.constants :as constants]
             [status-im.multiaccounts.update.core :as multiaccounts.update]
             [status-im.ui.components.bottom-sheet.core :as bottom-sheet]
-            [status-im.multiaccounts.recover.core :as recover]))
+            [status-im.multiaccounts.recover.core :as recover]
+            [status-im.ethereum.eip55 :as eip55]))

 (def default-pin "000000")

@@ -1747,10 +1748,12 @@
                        (assoc-in [:hardwallet :setup-step] nil)
                        (assoc :intro-wizard nil))}
               (multiaccounts.create/on-multiaccount-created
-               {:derived              {constants/path-whisper-keyword        {:publicKey whisper-public-key
-                                                                              :address   whisper-address}
-                                       constants/path-default-wallet-keyword {:publicKey wallet-public-key
-                                                                              :address   wallet-address}}
+               {:derived              {constants/path-whisper-keyword
+                                       {:publicKey whisper-public-key
+                                        :address   (eip55/address->checksum whisper-address)}
+                                       constants/path-default-wallet-keyword
+                                       {:publicKey wallet-public-key
+                                        :address   (eip55/address->checksum wallet-address)}}
                 :mnemonic             ""
                 :address              address
                 :publicKey            public-key


Create de.cljs (#1304)

Create de.cljs (#1304)

update de.cljs

--- src/status_im/translations/de.cljs
+++ src/status_im/translations/de.cljs
@@ -8,11 +8,20 @@
    :chat-name                             "Chatname"
    :notifications-title                   "Benachrichtigungen und Sounds"
    :offline                               "Offline"
+   :search-for                            "Suche nach..."
+   :cancel                                "Abbrechen"
+   :next                                  "Weiter"
+   :type-a-message                        "Schreibe eine Nachricht..."
+   :type-a-command                        "Tippe ein Kommando..."
+   :error                                 "Fehler"

    ;drawer
    :invite-friends                        "Freunde einladen"
    :faq                                   "FAQ"
    :switch-users                          "Benutzer wechseln"
+   :feedback                              "Haben Sie Feedback? Schütteln Sie einfach Ihr Mobilgerät."
+   :view-all                              "Alle ansehen"
+   :current-network                       "Aktuelles Netzwerk"

    ;chat
    :is-typing                             "tippt"
@@ -78,6 +87,16 @@
    :image-source-make-photo               "Foto machen"
    :image-source-gallery                  "Aus Galerie auswählen"
    :image-source-cancel                   "Abbrechen"
+
+   ;;sharing
+   :sharing-copy-to-clipboard             "In Zwischenablage kopieren"
+   :sharing-share                         "Teilen..."
+   :sharing-cancel                        "Abbrechen"
+
+   :browsing-title                        "Browse"
+   :browsing-browse                       "@browse"
+   :browsing-open-in-web-browser          "In Webbrowser öffnen"
+   :browsing-cancel                       "Abbrechen"

    ;sign-up
    :contacts-syncronized                  "Deine Kontakte wurden synchronisiert."
@@ -97,6 +116,12 @@
    :chats                                 "Chats"
    :new-chat                              "Neuer Chat"
    :new-group-chat                        "Neuer Gruppenchat"
+   :new-public-group-chat                 "Öffentlichem Gruppenchat beitreten"
+   :edit-chats                            "Chats bearbeiten"
+   :search-chats                          "Chats durchsuchen"
+   :empty-topic                           "Leeres Thema"
+   :topic-format                          "Falsches Format[a-z0-9\\-]+"
+   :public-group-topic                    "Thema"

    ;discover
    :discover                             "Entdecken"


fixed tests

fixed tests

--- src/status_im/translations/en.cljs
+++ src/status_im/translations/en.cljs
@@ -26,9 +26,8 @@
    :photos-access-error                   "To grant the required photos permission, please go to your system settings and make sure that Status > Photos is selected."

    ;;drawer
-   ;;not used in beta
-   ;:switch-users                          "Switch users"
-   ;:current-network                       "Current network"
+   :switch-users                          "Switch users"
+   :current-network                       "Current network"

    ;;home
    :home                                  "Home"


Prevent NPE

Prevent NPE

--- src/net/sekao/nightcode/projects.clj
+++ src/net/sekao/nightcode/projects.clj
@@ -229,17 +229,18 @@

 (defn move-tab-selection!
   [scene pref-state-atom runtime-state-atom diff]
-  (let [paths (-> @runtime-state-atom :editor-panes keys)
-        index (.indexOf paths (:selection @pref-state-atom))
-        max-index (dec (count paths))
-        new-index (+ index diff)
-        new-index (cond
-                    (neg? new-index) max-index
-                    (> new-index max-index) 0
-                    :else new-index)
-        project-tree (.lookup scene "#project_tree")]
-    (when (pos? (count paths))
-      (update-project-tree-selection! project-tree (nth paths new-index)))))
+  (when-let [selection (:selection @pref-state-atom)]
+    (let [paths (-> @runtime-state-atom :editor-panes keys)
+          index (.indexOf paths selection)
+          max-index (dec (count paths))
+          new-index (+ index diff)
+          new-index (cond
+                      (neg? new-index) max-index
+                      (> new-index max-index) 0
+                      :else new-index)
+          project-tree (.lookup scene "#project_tree")]
+      (when (pos? (count paths))
+        (update-project-tree-selection! project-tree (nth paths new-index))))))

 (defn set-selection-listener! [pref-state-atom runtime-state-atom ^Stage stage]
   (let [scene (.getScene stage)


Change style order for precedence

Change style order for precedence

- We need a higher precedence on .line-error than
  .current-subject (because we want error lines to be highlighted in
  red for the case where a line is both errored AND in the current
  subject group)

--- src/org/knotation/editor/styles.cljs
+++ src/org/knotation/editor/styles.cljs
@@ -385,12 +385,13 @@
   color: white;
 }")

-(def line-styles ".line-error { background-color: red; }
-.CodeMirror .line-error-message { border: 1px solid black; border-radius: 4px; margin-left: 5px; background-color: #f77171; }
+(def line-styles ".CodeMirror .line-error-message { border: 1px solid black; border-radius: 4px; margin-left: 5px; background-color: #f77171; }

 .current-subject { background-color: #f8f8f8; }
 .highlight { background-color: #f0f0f0; }
-.line-errors { width: .8em; }")
+.line-errors { width: .8em; }
+
+.line-error { background-color: red; }")

 (def applied? (atom false))
 (def cm-styles (atom [cm-default cm-hint-styles line-styles]))


100 tests is enough

100 tests is enough

--- test/asciinema/player/vt_test.cljc
+++ test/asciinema/player/vt_test.cljc
@@ -1896,7 +1896,7 @@
                   (not (and next-print-wraps (< new-x 20))))))

 (defspec test-dump-sgr
-  {:num-tests (* 1000 (property-tests-multiplier))}
+  {:num-tests (* 100 (property-tests-multiplier))}
   (prop/for-all [fg gen-color
                  bg gen-color
                  bold gen/boolean


Remove tv100 from tests and remove tv100 dependent tests

--- test/irresponsible/oolong_test.clj
+++ test/irresponsible/oolong_test.clj
@@ -1,7 +1,6 @@
 (ns irresponsible.oolong-test
   (:use [midje.sweet])
-  (:require [tv100 :refer :all]
-            [irresponsible.oolong :as o]
+  (:require [irresponsible.oolong :as o]
             [irresponsible.oolong.util :as u :refer :all]
             [clojure.tools.reader.edn :as edn]
             [clojure.java.io :refer [resource]])
@@ -35,9 +34,6 @@
       (facts :tvnqsym?
         (tvnqsym? 'sym) => (throws ExceptionInfo "Expected qualified symbol")
         (tvnqsym? `twice) => `twice)
-      (facts :tv->ctv
-        ((tv->ctv tvtrue?) {:form true}) => {:form true}
-        ((tv->ctv tvtrue? :baz) {:baz true}) => {:baz true})
       (facts :osym
         (osym 'nonexistent/symbol)
         => (throws ExceptionInfo "Expected loadable symbol")


fixing and adding tests around the journal-header format and filename extension format

--- test/journal_creator/core_test.clj
+++ test/journal_creator/core_test.clj
@@ -1,20 +1,35 @@
 (ns journal-creator.core-test
   (:require [clojure.test :refer :all]
-            [journal-creator.core :refer :all]))
+            [journal-creator.core :refer :all]
+            [clj-time.core :as t]))

-(deftest verify-day
-  (testing "converting january and february to 13 and 14 respectively"
-    (is (= 13 (convert-month 01)))
-    (is (= 14 (convert-month 02)))
-    (is (= 03 (convert-month 03))))
+(deftest verify-utility-functions
+  (testing "test get-journal-header return correct headers"
+    (is (= (get-journal-header (t/date-time 2017 03 18))
+           "= March 18, 2017, Saturday - <SUMMARY GOES HERE> =" ))
+    (is (= (get-journal-header (t/date-time 2017 03))
+           "= March 01, 2017, Wednesday - <SUMMARY GOES HERE> =" ))
+    (is (= (get-journal-header (t/date-time 2017 12 18))
+           "= December 18, 2017, Monday - <SUMMARY GOES HERE> =" )))

-  (testing "Given a date, return a day of the week."
-    (is (= "Monday"  (get-day-of-week 2014 3 3)))
-    (is (= "Tuesday" (get-day-of-week 2011 8 2)))
-    (is (= "Wednesday"(get-day-of-week 2017 3 1)))
-    (is (= "Thursday" (get-day-of-week 2015 2 1)))
-    (is (= "Friday" (get-day-of-week 2013 3 29)))
-    (is (= "Sunday" (get-day-of-week 2012 3 18)))
-    (is (= "Saturday" (get-day-of-week 2017 23 1)))
-    (is (= "Sunday" (get-day-of-week 2015 4 26)))
-    (is (= "Sunday" (get-day-of-week 2010 3 21)))))
+  (testing "test get-filename-extension returns correct format"
+    (is (= (get-filename-extension (t/date-time 2017 3 18))  "2017-03-18.wiki"))
+    (is (= (get-filename-extension (t/date-time 2014 2 8))   "2014-02-08.wiki"))
+    (is (= (get-filename-extension (t/date-time 2027 1 1))   "2027-01-01.wiki"))
+    (is (= (get-filename-extension (t/date-time 2017 12 14)) "2017-12-14.wiki")))
+
+  (testing "test days-in-month returns correct count of days in the month"
+    (is (= (count (days-in-month 2017 1)) 31))
+    (is (= (count (days-in-month 2017 2)) 28))
+    (is (= (count (days-in-month 2017 3)) 31))
+    (is (= (count (days-in-month 2017 4)) 30))
+    (is (= (count (days-in-month 2017 5)) 31))
+    (is (= (count (days-in-month 2017 6)) 30))
+    (is (= (count (days-in-month 2017 7)) 31))
+    (is (= (count (days-in-month 2017 8)) 31))
+    (is (= (count (days-in-month 2017 9)) 30))
+    (is (= (count (days-in-month 2017 10)) 31))
+    (is (= (count (days-in-month 2017 11)) 30))
+    (is (= (count (days-in-month 2017 12)) 31))
+))
+


[#246] Avoid destructuring in loop

[#246] Avoid destructuring in loop

--- priv/clojure/core_print.clj
+++ priv/clojure/core_print.clj
@@ -50,20 +50,22 @@
         (write w begin)
         (when-let [xs (seq sequence)]
           (if (and (not *print-dup*) *print-length*)
-            (loop [[x & xs] xs
+            (loop [xs xs
                    print-length *print-length*]
-              (if (zero? print-length)
-                (write w "...")
-                (do
-                  (print-one x w)
-                  (when xs
-                    (write w sep)
-                    (recur xs (dec print-length))))))
-            (loop [[x & xs] xs]
-              (print-one x w)
-              (when xs
-                (write w sep)
-                (recur xs)))))
+              (let [[x & xs] xs]
+                (if (zero? print-length)
+                  (write w "...")
+                  (do
+                    (print-one x w)
+                    (when xs
+                      (write w sep)
+                      (recur xs (dec print-length)))))))
+            (loop [xs xs]
+              (let [[x & xs] xs]
+                (print-one x w)
+                (when xs
+                  (write w sep)
+                  (recur xs))))))
         (write w end)))))

 (defn- print-meta [o, w]


Доработка ввода времени

Доработка ввода времени

--- radiolamp-6P3S/src/r6p3s/cpt/input_datetime.cljs
+++ radiolamp-6P3S/src/r6p3s/cpt/input_datetime.cljs
@@ -13,7 +13,7 @@
 (def date-str-format "yyyy-MM-ddTHH:mmZ")

 (defn set-date! [app d]
-  (assoc app :value (c/format-date date-str-format d)))
+  (assoc app :value (c/format-date date-str-format (or d (new js/Date)))))

 (defn parse-str-to-date [s]


Patch default cljs-devtools styles to wrap normally

We don't want to hard-code styles to make this future-proof.

--- src/day8/re_frame/trace/app_db.cljs
+++ src/day8/re_frame/trace/app_db.cljs
@@ -21,10 +21,22 @@

 (def default-cljs-devtools-prefs @devtools.prefs/default-config)

+(defn reset-wrapping [css-string]
+  (str/replace css-string #"white-space:nowrap;" ""))
+
 (def customized-cljs-devtools-prefs
-  {:header-style ""
+  {; Override some cljs-devtools default styles.
+   ; The goal here is to make default styles more flexible and wrap at the edge of our panel (we don't want horizontal
+   ; scrolling). Technically we want to remove all 'white-space:no-wrap'.
+   ; See https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/defaults.cljs
+   :header-style (reset-wrapping (:header-style default-cljs-devtools-prefs))
+   :expandable-style (reset-wrapping (:expandable-style default-cljs-devtools-prefs))
+   :item-style (reset-wrapping (:item-style default-cljs-devtools-prefs))
+   ; Hide the index spans on the left hand of collections. Shows how many elements in a collection.
    :none-style   "display: none"
-   :index-tag    [:span :none-style] ;;; Hide the index spans on the left hand of collections. Shows how many elements in a collection.
+   :index-tag    [:span :none-style]
+   ; Our JSON renderer does not have hierarchy depth limit,
+   ; See https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/formatters/budgeting.cljs
    :initial-hierarchy-depth-budget false})

 (def effective-cljs-devtools-prefs (merge default-cljs-devtools-prefs customized-cljs-devtools-prefs))


Polish segment-router

Polish segment-router

--- modules/reitit-core/src/reitit/segment.cljc
+++ modules/reitit-core/src/reitit/segment.cljc
@@ -12,12 +12,6 @@
   (-insert [this ps data])
   (-lookup [this ps params]))

-(defn- segments [^String path]
-  (mapv
-    (fn [^String p]
-      (if (impl/wild-param? p) (-> p (subs 1) keyword) p))
-    (.split path "/")))
-
 ;; TODO: catch-all
 (defn- segment
   ([]
@@ -29,22 +23,30 @@
        (-insert [_ [p & ps] data]
          (if-not p
            (segment children wilds data)
-           (let [wilds (if (keyword? p) (conj wilds p) wilds)
-                 children (update children p #(-insert (or % (segment)) ps data))]
-             (segment children wilds data))))
+           (let [wild (impl/wild-param p)
+                 wilds (if wild (conj wilds wild) wilds)
+                 children (update children (or wild p) #(-insert (or % (segment)) ps data))]
+             (segment children wilds nil))))
        (-lookup [_ [p & ps] params]
          (if (nil? p)
-           (assoc data :params params)
+           (if data (assoc data :params params))
            (or (-lookup (impl/fast-get children' p) ps params)
                (some #(-lookup (impl/fast-get children' %) ps (assoc params % p)) wilds))))))))

 (defn create [paths]
   (reduce
     (fn [segment [p data]]
-      (let [ps (segments p)]
+      (let [ps (impl/segments p)]
         (-insert segment ps (map->Match {:data data}))))
     (segment) paths))

 (defn lookup [segment ^String path]
   (let [ps (.split path "/")]
     (-lookup segment ps {})))
+
+(comment
+  (-> [["/:abba" 1]
+       ["/kikka/*kakka" 2]]
+      (create)
+      (lookup "/kikka")
+      (./aprint)))


CMR-1022: Added additional testing for multiple sensor techniques and multiple platform characteristics.

--- system-int-test/test/cmr/system_int_test/search/collection_keyword_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_keyword_search_test.clj
@@ -17,11 +17,14 @@
         psa4 (dc/psa "case" :string "up")
         p1 (dc/platform "platform_SnB" "platform_Ln B" nil
                         (dc/instrument "isnA" "ilnA"
-                                       (dc/sensor "ssnA" "slnA")))
+                                       (dc/sensor "ssnA" "slnA")
+                                       (dc/sensor "ssnD" "slnD" "techniqueD")))
         p2 (dc/platform "platform_SnA spoonA" "platform_LnA"
-                        [(dc/characteristic "char1" "char1desc")]
+                        [(dc/characteristic "char1" "char1desc")
+                         (dc/characteristic "char2" "char2desc")]
                         (dc/instrument "isnB" "ilnB"
-                                       (dc/sensor "ssnB" "slnB" "techniqueB")))
+                                       (dc/sensor "ssnB" "slnB" "techniqueB")
+                                       (dc/sensor "ssnC" "slnC" "techniqueC")))
         p3 (dc/platform "spoonA")
         pr1 (dc/projects "project-short-name")
         sk1 (dc/science-keyword {:category "Cat1"
@@ -83,7 +86,7 @@

            ;; Checking specific fields

-           ;; provier
+           ;; provider
            "PROV1" [coll1 coll2 coll3 coll23]

            ;; entry title
@@ -147,8 +150,12 @@
            "platform_ln" [coll15]
            ;; - characteristic name
            "char1" [coll11]
+           "char2" [coll11]
+           "char1 char2" [coll11]
            ;; - chracteristic description
            "char1desc" [coll11]
+           "char2desc" [coll11]
+           "char1desc char2desc" [coll11]

            ;; Instruments
            ;; - short name
@@ -163,6 +170,8 @@
            "slnB" [coll11]
            ;; - technique
            "techniqueB" [coll11]
+           "techniqueD" [coll15]
+           "techniqueB techniqueC" [coll11]

            ;; Science keywords
            ;; - category


Changed chain length in DBDA Ch09 to default.

--- test/clojure/uncomplicate/bayadera/examples/dbda/ch09_hierarchical_models_test.clj
+++ test/clojure/uncomplicate/bayadera/examples/dbda/ch09_hierarchical_models_test.clj
@@ -8,7 +8,7 @@
              [fun-mode :refer [fun-mode]]]
             [uncomplicate.commons.core :refer [with-release let-release]]
             [uncomplicate.neanderthal
-             [core :refer [row transfer dot imax imin scal! col]]
+             [core :refer [row transfer dot imax imin scal! col submatrix]]
              [real :refer [entry entry!]]
              [native :refer [sv]]]
             [uncomplicate.bayadera
@@ -50,24 +50,24 @@

 (defn analysis []
   (with-default-bayadera
-    (let [walker-count (* 256 44 16)
-          sample-count (* 8 walker-count)
+    (let [walker-count (* 256 44 32)
+          sample-count (* 16 walker-count)
           a 1 b 1
           z 9 N 12]
       (with-release [prior (distribution ch09-1mint-1coin-model)
                      prior-dist (prior (sv 2 2 100))
-                     prior-sample (dataset (sample (sampler prior-dist {:warm-up 8092 :iterations 8092 :walkers walker-count}) sample-count))
+                     prior-sample (dataset (sample (sampler prior-dist) sample-count))
                      prior-pdf (pdf prior-dist prior-sample)
                      post (posterior "posterior_ch09" binomial-likelihood prior-dist)
                      post-dist (post (binomial-lik-params N z))
-                     post-sampler (time (sampler post-dist {:warm-up 8092 :iterations 8092 :walkers walker-count}))
+                     post-sampler (time (sampler post-dist))
                      post-sample (dataset (sample post-sampler sample-count))
                      post-pdf (scal! (/ 1.0 (evidence post-dist prior-sample))
                                      (pdf post-dist post-sample))]
-        {:prior-sample (transfer (p/data prior-sample))
+        {:prior-sample (transfer (submatrix (p/data prior-sample) 0 0 2 walker-count))
          :prior-pdf (transfer prior-pdf)
          :prior-histogram (p/histogram (.dataset-eng prior-sample) (p/data prior-sample))
-         :posterior-sample (transfer (p/data post-sample))
+         :posterior-sample (transfer (submatrix (p/data post-sample) 0 0 2 walker-count))
          :posterior-pdf (transfer post-pdf)
          :posterior-histogram (p/histogram (.dataset-eng post-sample) (p/data post-sample))}))))


conditionalize cljs.analyzer/ns-side-effects, only for :clj

--- src/main/clojure/cljs/analyzer.cljc
+++ src/main/clojure/cljs/analyzer.cljc
@@ -2445,36 +2445,37 @@
           ast))
       ast)))

-(defn ns-side-effects
-  [env {:keys [op] :as ast} opts]
-  (if (= :ns op)
-    (let [{:keys [deps uses require-macros use-macros reload reloads]} ast]
-      (when (and *analyze-deps* (seq deps))
-        (analyze-deps name deps env (dissoc opts :macros-ns)))
-      (when (and *analyze-deps* (seq uses))
-        (check-uses uses env))
-      (when *load-macros*
-        (load-core)
-        (doseq [nsym (vals use-macros)]
-          (let [k (or (:use-macros reload)
-                      (get-in reloads [:use-macros nsym])
-                      (and (= nsym name) *reload-macros* :reload))]
-            (if k
-              (clojure.core/require nsym k)
-              (clojure.core/require nsym))
-            (intern-macros nsym k)))
-        (doseq [nsym (vals require-macros)]
-          (let [k (or (:require-macros reload)
-                      (get-in reloads [:require-macros nsym])
-                      (and (= nsym name) *reload-macros* :reload))]
-            (if k
-              (clojure.core/require nsym k)
-              (clojure.core/require nsym))
-            (intern-macros nsym k)))
-        (when (seq use-macros)
-          (check-use-macros use-macros env)))
-      ast)
-    ast))
+#?(:clj
+   (defn ns-side-effects
+     [env {:keys [op] :as ast} opts]
+     (if (= :ns op)
+       (let [{:keys [deps uses require-macros use-macros reload reloads]} ast]
+         (when (and *analyze-deps* (seq deps))
+           (analyze-deps name deps env (dissoc opts :macros-ns)))
+         (when (and *analyze-deps* (seq uses))
+           (check-uses uses env))
+         (when *load-macros*
+           (load-core)
+           (doseq [nsym (vals use-macros)]
+             (let [k (or (:use-macros reload)
+                       (get-in reloads [:use-macros nsym])
+                       (and (= nsym name) *reload-macros* :reload))]
+               (if k
+                 (clojure.core/require nsym k)
+                 (clojure.core/require nsym))
+               (intern-macros nsym k)))
+           (doseq [nsym (vals require-macros)]
+             (let [k (or (:require-macros reload)
+                       (get-in reloads [:require-macros nsym])
+                       (and (= nsym name) *reload-macros* :reload))]
+               (if k
+                 (clojure.core/require nsym k)
+                 (clojure.core/require nsym))
+               (intern-macros nsym k)))
+           (when (seq use-macros)
+             (check-use-macros use-macros env)))
+         ast)
+       ast)))

 (def ^:dynamic *passes* nil)


changed tmpfile

changed tmpfile


Adjust tests for new hierarchic task naming convention

--- test/cider_ci/builder/tasks_spec.clj
+++ test/cider_ci/builder/tasks_spec.clj
@@ -36,10 +36,11 @@

 (facts "build-task"
        (let [built-task (build-task
-                           test-task-definition
-                           test-task-defaults
-                           test-script-defaults)]
-         (fact (:name built-task) => "Task")
+                          test-task-definition
+                          test-task-defaults
+                          test-script-defaults
+                          "Prefix")]
+         (fact (:name built-task) => "Prefix » Task")
          (fact (:ports built-task) =>  {:web {:min 8800 :max 89999} :xvnc {:min 5900 :max 5999}})
          (fact (-> built-task :scripts :main :environment_variables) =>  {:x 1 :y 2 :z 3})
          ))
@@ -47,17 +48,17 @@
 (facts "build-tasks-for-contexts-sequence"
        (let [spec (yaml/parse-string
                     (slurp "test/data/tasks_spec.yml"))
-             tasks (build-tasks-for-contexts-sequence spec {} {})
-             task_in_l1-2-3  (some #(when (= (:name %) "Task in L1.2.3")%) tasks)
+             tasks (build-tasks-for-contexts-sequence spec {} {} "Prefix")
+             task_in_l1-2-3  (some #(when (= (:name %) "Prefix » L1 » L1.2 » L1.2.3 » Task in L1.2.3")%) tasks)
              ]
          (fact tasks => truthy)
          (fact (count tasks) => 6)
-         (fact (->> tasks (map :name) sort) =>  (sort ["Task in L1"
-                                                       "Task in L1.1"
-                                                       "Task 1 in L1.2"
-                                                       "Task 2 in L1.2"
-                                                       "Task in L1.2.3"
-                                                       "Task in L2"]))
+         (fact (->> tasks (map :name) sort) =>  (sort ["Prefix » L1 » L1.1 » Task in L1.1"
+                                                       "Prefix » L1 » L1.2 » L1.2.3 » Task in L1.2.3"
+                                                       "Prefix » L1 » L1.2 » Task 1 in L1.2"
+                                                       "Prefix » L1 » L1.2 » Task 2 in L1.2"
+                                                       "Prefix » L1 » Task in L1"
+                                                       "Prefix » L2 » Task in L2"]))
          (fact task_in_l1-2-3 => truthy)
          (fact (:scripts task_in_l1-2-3) => {:main {:environment_variables {:e 7}}})
          ))


Remove unnecessary test

Remove unnecessary test

--- test/clj_gatling/simulation_test.clj
+++ test/clj_gatling/simulation_test.clj
@@ -578,19 +578,6 @@
       (is (> (count @duration-distribution) 10))
       (is (= (sort @duration-distribution) @duration-distribution)))))

-(deftest with-rate
-  (let [progress-distribution (atom [])]
-    (run-single-scenario {:name "scenario"
-                          :steps [(step "step" true)]}
-                         :rate 100
-                         :users (range 10)
-                         :requests 100
-                         :context {:value 1})
-    (testing "Progress goes from 0 to 1"
-      (is (every? #(and (>= % 0.0) (<= % 1.0)) @progress-distribution))
-      (is #{0.1} @progress-distribution)
-      (is #{1.0} @progress-distribution)
-      (is (= (sort @progress-distribution) @progress-distribution)))))

 (deftest with-2-arity-rate-function
   (let [rate-function-called? (atom false)


Remove unsued constants from rules ns.

Remove unsued constants from rules ns.

--- src/uxbox/ui/workspace/rules.cljs
+++ src/uxbox/ui/workspace/rules.cljs
@@ -17,13 +17,8 @@

 ;; --- Constants & Helpers

-(def ^:const zoom 1)
 (def ^:const step-padding 20)
 (def ^:const step-size 10)
-(def ^:const start-width wb/canvas-start-x)
-(def ^:const start-height wb/canvas-start-y)
-(def ^:const scroll-left 0)
-(def ^:const scroll-top 0)

 (defn big-ticks-mod [zoom] (/ 100 zoom))
 (defn mid-ticks-mod [zoom] (/ 50 zoom))


Update project.clj

Update project.clj

--- quil-intro/project.clj
+++ quil-intro/project.clj
@@ -2,4 +2,4 @@
   :description "Quil Into"
   :url "http://nbeloglazov.com/2014/05/29/quil-intro.html"
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [quil "2.2.0"]])
+                 [quil "2.2.1"]])


jobs/uploadpages.clj: added minimal output & counting

--- src/org/altlaw/jobs/uploadpages.clj
+++ src/org/altlaw/jobs/uploadpages.clj
@@ -12,11 +12,15 @@
 (defn mapper-configure [this jobconf]
   (context/use-property-function (fn [name] (.get jobconf name))))

+(def *empty-bytes* (BytesWritable.))
+
 (defn mapper-map [this wkey wvalue output reporter]
   (log/debug "Mapper got file " wkey)
   (content/put-page-bytes (str wkey)
                           (Arrays/copyOf (.get wvalue) (.getSize wvalue))
-                          "text/html"))
+                          "text/html")
+  (.incrCounter reporter "org.altlaw.jobs.uploadpages" "Uploaded objects" 1)
+  (.collect output wkey *empty-bytes*))

 (defn tool-run [this args]
   (let [job (hadoop/default-jobconf this)


Remove WS middleware order restriction out-of-container

With this change the wrap-websocket middleware no longer has to appear
at the end of the middleware chain when running out-of-container. It can
go anywhere that makes sense, as its result is no longer an HttpHandler,
but a simple function.

The must-come-last restriction is still in effect in-container, however,
as the result is then a Servlet rather than a function.

--- web/src/immutant/web/websocket.clj
+++ web/src/immutant/web/websocket.clj
@@ -14,19 +14,12 @@

 (ns immutant.web.websocket
   "Provides for the creation of asynchronous WebSocket services"
-  (:require [immutant.web.internal.undertow :refer [create-http-handler]]
-            [immutant.web.internal.servlet  :as servlet]
+  (:require [immutant.web.internal.servlet  :as servlet]
             [immutant.web.async             :as async]
-            [immutant.util                  :refer [in-container?]])
-  (:import [org.projectodd.wunderboss.web.async.websocket
-            UndertowWebsocket WebsocketChannel WebsocketInitHandler]))
+            [immutant.util                  :refer [in-container?]]))

 (defn wrap-websocket
   "Middleware to attach websocket callbacks to a Ring handler.
-  Technically, it's \"endware\" since its return type is not a
-  function, but an object expected to be passed to
-  [[immutant.web/run]], so all other middleware should precede this
-  call in the chain.

   The following callbacks are supported, where `channel` is an object
   extended to [[immutant.web.async/Channel]], `handshake` is extended
@@ -38,18 +31,18 @@
   * :on-close   `(fn [channel {:keys [code reason]}])`
   * :on-error   `(fn [channel throwable])`

-  If handler is nil, 404 responses will be returned for any requests
-  without `ws://` URI schemes"
+  If handler is nil, a 404 status will be returned for any
+  non-websocket request.
+
+  If called within a servlet container, e.g. WildFly, this should be
+  the last call in your middleware chain, as its result will be a
+  servlet, not a function."
   ([handler key value & key-values]
      (wrap-websocket handler (apply hash-map key value key-values)))
   ([handler callbacks]
      (if (in-container?)
        (servlet/create-servlet handler (servlet/create-endpoint callbacks))
-       (UndertowWebsocket/createHandler
-         (reify WebsocketInitHandler
-           (shouldConnect [_ exchange endpoint-wrapper]
-             (.setEndpoint endpoint-wrapper
-               (.getEndpoint ^WebsocketChannel (async/initialize-websocket {:handler-type :undertow}
-                                                 callbacks)))
-             true))
-         (if handler (create-http-handler handler))))))
+       (fn [request]
+         (if (:websocket? request)
+           (async/as-channel request callbacks)
+           (merge {:status 404} (when handler (handler request))))))))


Ensure a search index is present in the configuration

--- src/org/spootnik/cyanite/config.clj
+++ src/org/spootnik/cyanite/config.clj
@@ -30,6 +30,9 @@
   {:enabled true
    :host    "127.0.0.1"
    :port    8080})
+
+(def default-index
+  {:use "org.spootnik.cyanite.path/lucene-memory-pathstore"})

 (defn to-seconds
   "Takes a string containing a duration like 13s, 4h etc. and
@@ -120,4 +123,6 @@
         (update-in [:carbon] (partial merge default-carbon))
         (update-in [:carbon :rollups] convert-shorthand-rollups)
         (update-in [:carbon :rollups] assoc-rollup-to)
+        (update-in [:index] (partial merge default-index))
+        (update-in [:index] get-instance :index)
         (update-in [:http] (partial merge default-http)))))


yeah, make uberjs: owl.js is ok

yeah, make uberjs: owl.js is ok

--- ext/chrome/project.clj
+++ ext/chrome/project.clj
@@ -8,33 +8,39 @@
                                     "resources/public/js/owl.js"
                                     :target-path]
   :profiles {:dev {:dependencies [[figwheel-sidecar "0.5.9"]
-                                  [com.cemerick/piggieback "0.2.1"]]}
+                                  [com.cemerick/piggieback "0.2.1"]]
+                   :cljsbuild
+                   {:builds [{:id "dev"
+                              :source-paths ["src"]
+                              :figwheel {
+                                         :open-urls ["http://localhost:3449/popup.html"]
+                                         }
+                              :compiler {:main "owl.web.core"
+                                         :externs
+                                         ["external/chrome_extensions.js"]
+                                         :asset-path "js/out"
+                                         :output-to "resources/public/js/owl.js"
+                                         :output-dir "resources/public/js/out"
+                                         :optimizations :none
+                                         }}]
+                    }
+                   }
+             :pro {:cljsbuild
+                   {:builds
+                    [{:source-paths ["src"]
+                      :compiler {:externs
+                                 ["external/chrome_extensions.js"]
+                                 :output-to "resources/public/js/owl.js"
+                                 :optimizations :advanced
+                                 :pretty-print false}
+                      }]}}
              }
+
+
   :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
-  :cljsbuild {
-              :builds {
-                       :dev {:source-paths ["src"]
-                             :compiler {:main "owl.web.core"
-                                        :externs
-                                        ["external/chrome_extensions.js"]
-                                        :asset-path "js/out"
-                                        :output-to "resources/public/js/owl.js"
-                                        :output-dir "resources/public/js/out"
-                                        :optimizations :none
-                                        }
-                             :figwheel {:open-urls ["http://localhost:3449/popup.html"]
-                                        }
-                             }
-                       :pro {:source-paths ["src"]
-                             :compiler {:externs
-                                        ["external/chrome_extensions.js"]
-                                        :output-to "resources/public/js/owl.js"
-                                        :optimizations :advanced
-                                        :pretty-print false}
-                             }
-                       }
-              }
+
   :figwheel {:css-dirs ["resources/public/css"]
-             :open-file-command "emacsclient"}
+             :open-file-command "emacsclient"
+             }
   )


Show usage of the new options in the example setup

--- example/build.boot
+++ example/build.boot
@@ -1,7 +1,7 @@
 (set-env!
   :resource-paths #{"resources"}
   :dependencies '[[org.clojure/clojure "1.8.0"]
-                  [afrey/boot-asset-fingerprint "1.0.0"]
+                  [afrey/boot-asset-fingerprint "1.1.0-SNAPSHOT"]
                   [tailrecursion/boot-jetty "0.1.3" :scope "test"]])

 (require
@@ -11,6 +11,7 @@
 (deftask dev []
   (comp
     (watch)
-    (asset-fingerprint)
+    (asset-fingerprint :extension [".css"])
+    (asset-fingerprint :extension [".html"])
     (jetty/serve :port 5000)
     (target)))


Fix typo

Fix typo

--- worker/src/clinicico/worker/main.clj
+++ worker/src/clinicico/worker/main.clj
@@ -35,6 +35,6 @@
     (when (:help options)
       (println banner)
       (System/exit 0))
-    (pirate/initialize (:file options) (:packages options) (:reserve options))
+    (pirate/initialize (:file options) (:packages options) (:rserve options))
     (tasks/initialize method (:nworkers options) run)
     (while true (Thread/sleep 100))))


Fix flakiness by waiting until projects loaded on main page.

--- test/clj/hatnik/selenium/core.clj
+++ test/clj/hatnik/selenium/core.clj
@@ -69,15 +69,22 @@
                 (select-keys [:name :actions])))]
     (map clean-project projects)))

+(defn wait-until [driver condition message]
+  (doto (WebDriverWait. driver 10)
+    (.withMessage message)
+    (.until (reify ExpectedCondition
+              (apply [this driver]
+                (condition driver))))))
+
 (defn create-and-login []
   (let [driver (create-driver)]
     (login driver)
     ; Check that initially only "Default" project is present
     ; with no actions.
-    (is (= [{:name "Default"
-             :actions []}]
-           (clean-projects (find-projects-on-page driver)))
-        "Initial state not valid.")
+    (wait-until driver #(= [{:name "Default"
+                             :actions []}]
+                           (clean-projects (find-projects-on-page %)))
+        "Initial state not valid. 'Default' project should be created.")
     driver))

 (def dialog-visible-selector {:project "#iModalProjectMenu .modal-dialog"
@@ -101,13 +108,6 @@
   ; of completed action. But it's not reliable as some om/react stuff
   ; might be async. So let's just wait for a little more longer explicitly.
   (Thread/sleep 1000))
-
-(defn wait-until [driver condition message]
-  (doto (WebDriverWait. driver 10)
-    (.withMessage message)
-    (.until (reify ExpectedCondition
-              (apply [this driver]
-                (condition driver))))))

 (defn wait-until-projects-match [driver projects]
   (wait-until driver


add format query parameter

add format query parameter

--- src/vignette/util/query_options.clj
+++ src/vignette/util/query_options.clj
@@ -1,6 +1,7 @@
 (ns vignette.util.query-options)

-(def query-opts-map {:fill "fill"})
+(def query-opts-map {:fill "fill"
+                     :format "format"})

 (defn extract-query-opts
   [request]
@@ -42,5 +43,6 @@
 (defn modify-temp-file
   [data filename]
   (cond
+    (query-opt data :format) (str (query-opt data :format) ":" filename)
     (= (query-opt data :fill) "transparent") (str "png:" filename)
     :else filename))


successful delete should return 200

successful delete should return 200

--- ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/es/es_binding.clj
+++ ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/es/es_binding.clj
@@ -86,7 +86,7 @@

 (defn- response-deleted
   [id]
-  (cu/map-response (str id " deleted") 204 id))
+  (cu/map-response (str id " deleted") 200 id))

 (defn- response-not-found
   [id]


CMR-4478 - Added one more test to cover another edge case.

--- system-int-test/test/cmr/system_int_test/ingest/service_ingest_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/service_ingest_test.clj
@@ -11,7 +11,8 @@
    [cmr.system-int-test.utils.metadata-db-util :as mdb]
    [cmr.system-int-test.utils.service-util :as service-util]))

-(use-fixtures :each (ingest/reset-fixture {"provguid1" "PROV1"}))
+(use-fixtures :each (ingest/reset-fixture {"provguid1" "PROV1"
+                                           "provguid2" "PROV2"}))

 (deftest service-ingest-test
   (testing "ingest of a new service concept"
@@ -127,14 +128,13 @@
         (is (mdb/concept-exists-in-mdb? concept-id revision-id))
         (is (= [supplied-concept-id 1] [concept-id revision-id]))))
     (testing "ingest of same native id and different providers is allowed"
-      (let [concept2 (service-util/make-service-concept
-                      (assoc metadata :provider-id "PROV2"))
-            {:keys [concept1-id revision1-id]} (ingest/ingest-concept concept)
-            {:keys [concept2-id revision2-id]} (ingest/ingest-concept concept2)]
-        (is (mdb/concept-exists-in-mdb? concept1-id revision1-id))
-        (is (= [supplied-concept-id 1] [concept1-id revision1-id]))
-        (is (mdb/concept-exists-in-mdb? concept2-id revision2-id))
-        (is (= [supplied-concept-id 1] [concept2-id revision2-id]))))
+      (let [concept2-id "S1000-PROV2"
+            concept2 (service-util/make-service-concept
+                      (assoc metadata :provider-id "PROV2"
+                                      :concept-id concept2-id))
+            {:keys [concept-id revision-id]} (ingest/ingest-concept concept2)]
+        (is (mdb/concept-exists-in-mdb? concept-id revision-id))
+        (is (= [concept-id 1] [concept-id revision-id]))))

     (testing "update the concept with the concept-id"
       (let [{:keys [concept-id revision-id]} (ingest/ingest-concept concept)]


core.async: Remove incomplete comment that you forgot to delete.

--- test/com/nomistech/clojure_the_language/core_async_mapping_etc_test.clj
+++ test/com/nomistech/clojure_the_language/core_async_mapping_etc_test.clj
@@ -185,7 +185,6 @@
                          (chan->seq-with-sentynil->nil c))
                    (do
                      ;; whatever is needed when channel is closed
-                     ;; - so don't be tempted to
                      ))))]

         (fact "In Clojure 1.6 & Clojure 1.7"


New test: get-first-day-of-week-3

New test: get-first-day-of-week-3

--- test/clj_calendar/calendar_test.clj
+++ test/clj_calendar/calendar_test.clj
@@ -448,3 +448,40 @@
             (.set calendar 2000 01 14 00 00 00)
             (is (= "2000-02-13" (get-first-day-of-week-formatted calendar))))))

+(deftest test-get-first-day-of-week-3
+    "Check the function clj-calendar.calendar/get-first-day-of-week"
+    (testing "the function clj-calendar.calendar/get-first-day-of-week"
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 1 00 00 00)
+            (is (= "2000-11-26" (get-first-day-of-week-formatted calendar))))
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 2 00 00 00)
+            (is (= "2000-11-26" (get-first-day-of-week-formatted calendar))))
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 3 00 00 00)
+            (is (= "2000-12-03" (get-first-day-of-week-formatted calendar))))
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 4 00 00 00)
+            (is (= "2000-12-03" (get-first-day-of-week-formatted calendar))))
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 5 00 00 00)
+            (is (= "2000-12-03" (get-first-day-of-week-formatted calendar))))
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 6 00 00 00)
+            (is (= "2000-12-03" (get-first-day-of-week-formatted calendar))))
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 7 00 00 00)
+            (is (= "2000-12-03" (get-first-day-of-week-formatted calendar))))
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 8 00 00 00)
+            (is (= "2000-12-03" (get-first-day-of-week-formatted calendar))))
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 9 00 00 00)
+            (is (= "2000-12-03" (get-first-day-of-week-formatted calendar))))
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 10 00 00 00)
+            (is (= "2000-12-10" (get-first-day-of-week-formatted calendar))))
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 11 11 00 00 00)
+            (is (= "2000-12-10" (get-first-day-of-week-formatted calendar))))))
+


Add slamhound to projects.

Add slamhound to projects.

--- resources/projects.clj
+++ resources/projects.clj
@@ -91,4 +91,10 @@
  :lein-hadoop
  {:name "lein-hadoop"
   :url "https://github.com/ndimiduk/lein-hadoop"
-  :description "leiningen plugin for generating hadoop-compatible jars."}}
+  :description "leiningen plugin for generating hadoop-compatible jars."}
+
+ :slamhound
+ {:name "Slamhound"
+  :url "https://github.com/technomancy/slamhound"
+  :description "Blow your namespace to bits and reconstruct it from the pieces."}
+ }


Fix setup function, should return a function to be called

--- test/powderkeg/integration_test.clj
+++ test/powderkeg/integration_test.clj
@@ -95,8 +95,9 @@
     #(.setContextClassLoader (Thread/currentThread) cl)))

 (defn keg-connection [host]
-  (keg/connect! (str "spark://" host ":7077"))
-  #(keg/disconnect!))
+  (fn []
+    (keg/connect! (str "spark://" host ":7077"))
+    #(keg/disconnect!)))

 (deftest ^:integration rdd-spark-2.1.0
   (with-resources


Added test for no effect db in on-changes

--- test/re-frame/interceptor_test.cljs
+++ test/re-frame/interceptor_test.cljs
@@ -106,14 +106,15 @@
                     (get-effect))]
     (is (= e {:db 5 :dispatch [:a]}))))

-
-
 (deftest test-on-changes
   (let [change-handler-i  (->  (fn [db v] (assoc db :a 10))
                                db-handler->interceptor)

         no-change-handler-i  (->  (fn [db v] db)
                                db-handler->interceptor)
+
+        no-db-handler-i (-> (fn [ctx v] {})
+                            fx-handler->interceptor)

         change-i   (on-changes + [:c] [:a] [:b])
         orig-db    {:a 0 :b 2}]
@@ -127,7 +128,13 @@
             (-> (context [] [] orig-db)
                 ((:before change-handler-i))       ;; cause change to :a
                 ((:after change-i))
-                (get-effect :db))))))
+                (get-effect :db))))
+
+    (is (=  ::not-found
+            (-> (context [] [] orig-db)
+                ((:before no-db-handler-i))       ;; no db effect in context
+                ((:after change-i))
+                (get-effect :db ::not-found))))))

 (deftest test-after
   (testing "when no db effect is returned"


better checks for entry resource.

better checks for entry resource.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -91,9 +91,7 @@
     true)) ; no existing entry, so this will fail existence check later

 (defn- valid-entry-revert? [entry-props]
-  (if (:revision-id entry-props)
-    true
-    false))
+  (lib-schema/valid? schema/Int (:revision-id entry-props)))

 (defn- valid-share-requests? [conn entry-uuid share-props]
   (if-let* [existing-entry (entry-res/get-entry conn entry-uuid)
@@ -274,9 +272,7 @@
     :delete true})

   ;; Existentialism
-  :exists? (fn [ctx] (if-let* [_slugs? (and (slugify/valid-slug? org-slug)
-                                            (slugify/valid-slug? board-slug))
-                               org (or (:existing-org ctx)
+  :exists? (fn [ctx] (if-let* [org (or (:existing-org ctx)
                                        (org-res/get-org conn org-slug))
                                org-uuid (:uuid org)
                                board (or (:existing-board ctx)


(SERVER-2213) Remove minimum thread default test

In recent Jetty releases the minimum threads per connector has been
changed to vary depending on the size of the server's threadpool as well
as number of virtual cores. These tests became unreliable as a connector
may require as low as a minimum of two threads, but that will change
depending on the box. There may also be one or more worker threads
consumed. I'm not completely sure why, in testing on my machine, and
Travis a server with a single connector consumes 4 threads, one with
two connectors consumes 6, but in Jenkins a server with a single
connector consumes 5 threads. However, the default size of the server's
threadpool is 200, and you should NEVER run a production server with
only 4 or 5 threads so the this work seems to have diminished returns
for a contrived test case.

--- test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_default_config_test.clj
+++ test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_default_config_test.clj
@@ -163,51 +163,3 @@
      (selector-thread-count threadpool-size)
      acceptor-thread-count))

-(defn calculate-minimum-required-threads
-  "Jetty calculates the minimum number of required threads based on the the
-  size of the machine it runs on and the number of threads in its thread pool.
-  The smaller we shrink the thread pool the fewer threads it will request.
-  This logic doesn't scale as the thread pool grows beyond 10 threads but
-  allows us to come up with a number that works for max threads that isn't
-  self referential.
-
-  (Note this works out to two overall worker threads and a selector and reserved
-  thread per connector)"
-  [num-connectors]
-  (+ 2 (* num-connectors 2)))
-
-(deftest default-min-threads-settings-test
-  ;; This test just exists to validate the advice we give for the bare
-  ;; minimum number of threads that one should account for when setting the
-  ;; 'max-threads' setting for a server instance.
-  ;;
-  ;; The tk-jetty9 server configuration allows for either one or two connectors
-  ;; to be associated with a server -- at most one plaintext port connector and
-  ;; at most one encrypted port connector.  Because of this, the test only
-  ;; validates the min-threads behavior for a server that has either one or
-  ;; two connectors.
-  (letfn [(get-server [max-threads connector-count]
-            (let [server (Server. (QueuedThreadPool. max-threads))]
-              (dotimes [_ connector-count]
-                (.addConnector server (ServerConnector. server)))
-              server))]
-    (dotimes [x 2]
-      (let [num-connectors (inc x)
-            required-threads (calculate-minimum-required-threads num-connectors)]
-        (testing (str "server with too few threads for " num-connectors " connector(s) "
-                      "fail(s) to start with expected error")
-          (let [server (-> required-threads
-                           dec
-                           (get-server num-connectors))]
-            (is (thrown-with-msg? IllegalStateException
-                                  #"Insufficient configured threads"
-                                   (tk-log-testutils/with-test-logging
-                                     (.start server))))))
-        (testing (str "server with minimum required threads for " num-connectors
-                      "connector(s) start(s) successfully")
-          (let [server (get-server required-threads num-connectors)]
-            (try
-              (tk-log-testutils/with-test-logging (.start server))
-              (is (.isStarted server))
-              (finally
-                (.stop server)))))))))


Notes on state.

Notes on state.

--- test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_010_intro.clj
+++ test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_010_intro.clj
@@ -2,12 +2,28 @@
   (:require [midje.sweet :refer :all]))

 ;;;; ___________________________________________________________________________
-;;;; State management and concurrency and without locks.
-;;;;
-;;;; References
-;;;; - There are a fair few types of reference.
-;;;;   - atoms, refs, vars, agents, promises, futures...
-;;;;     - confusing names! A ref is one kind of reference.
-;;;; - Some are primarily for managing state.
-;;;; - Some are primarily for managing concurrency.
-;;;; - Some combine the two.
+;;;; State management and concurrency and without locks
+
+;;;; Clojure is an impure functional language
+;;;; - It supports side effects
+
+;;;; Clojure has an approach to managing state
+;;;; - and sane concurrency
+
+;;;; Reference types
+;;;; - Each reference type provides a way of doing stateful and/or concurrent
+;;;;   things
+;;;; - Some are primarily for managing state
+;;;; - Some are primarily for managing concurrency
+;;;; - Some combine the two
+;;;; - Without using locks
+
+;;;; Kinds of reference type
+;;;; - atoms
+;;;; - refs (confusing -- a ref is a kind of reference)
+;;;; - vars
+;;;; - agents
+;;;; - futures
+;;;; - delays
+;;;; - promises
+


project version changes

project version changes

--- kafka-clj/project.clj
+++ kafka-clj/project.clj
@@ -1,4 +1,4 @@
-(defproject kafka-clj "3.0.1-SNAPSHOT"
+(defproject kafka-clj "3.0.2-SNAPSHOT"
   :description "fast kafka library implemented in clojure"
   :url "https://github.com/gerritjvv/kafka-fast"
   :license {:name "Eclipse Public License"


changed users into atom

changed users into atom

--- proone/dev/user.clj
+++ proone/dev/user.clj
@@ -1,5 +1,9 @@
 (ns user
   (:require [clojure.string :as cs]))
+
+(def users
+  (atom ["skadinyo" "0dsapoetra" "beleje" "calvin91" "awol" "leledumbo" "wisnuops" "dizqar"
+         "pelaut" "neilt" "azrax" "codxse" "gilangardya" "dhiamonkey"]))

 (defn progress [nama]
   (let [res (-> (slurp (str "http://www.4clojure.com/user/" nama))
@@ -8,7 +12,7 @@
     (subs res (- (count res) 2))))

 (defn all []
-  (doseq [nama ["skadinyo" "0dsapoetra" "beleje" "calvin91" "wisnuops" "dizqar" "pelaut" "neilt" "azrax" "codxse" "gilangardya" "dhiamonkey"]]
+  (doseq [nama @users]
     (println (str "Ucil : " nama))
     (println (str "Progress : " (progress nama)))
     (println "---------------------")))


State.

State.

--- test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_020_atoms.clj
+++ test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_020_atoms.clj
@@ -36,13 +36,9 @@
     ;; does this: (+ 2 10)
     (fact @my-number-atom => 12))

-(do (swap! my-number-atom + 10)
-    ;; does this: (+ 12 10)
-    (fact @my-number-atom => 22))
-
-(do (swap! my-number-atom + 10 20 30)
-    ;; does this: (+ 22 10 20 30)
-    (fact @my-number-atom => 82))
+(do (swap! my-number-atom + 1 2 3 4 5)
+    ;; does this: (+ 12 1 2 3 4 5)
+    (fact @my-number-atom => 27))

 ;;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 ;;;; Storing maps in atoms
@@ -70,11 +66,11 @@
 ;;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 ;;;; `compare-and-set!`

-(do (fact @my-number-atom => 82)
+(do (fact @my-number-atom => 27)
     (fact (compare-and-set! my-number-atom 99 42) => false)
-    (fact @my-number-atom => 82))
+    (fact @my-number-atom => 27))

-(do (fact (compare-and-set! my-number-atom 82 42) => true)
+(do (fact (compare-and-set! my-number-atom 27 42) => true)
     (fact @my-number-atom => 42))

 ;;;; ___________________________________________________________________________


db-rollback-all helper

db-rollback-all helper

--- dev/user.clj
+++ dev/user.clj
@@ -54,10 +54,20 @@
    :migrations (ragtime.jdbc/load-resources "migrations/magento")})

 (defn db-migrate []
-  (ragtime.repl/migrate (migrations-config test-db)))
+  ; always returns nil
+  (ragtime.repl/migrate (migrations-config test-db))
+  :done)

 (defn db-rollback []
-  (ragtime.repl/rollback (migrations-config test-db)))
+  ; always returns nil
+  (ragtime.repl/rollback (migrations-config test-db))
+  :done)
+
+(defn db-rollback-all []
+  ; TODO count migration files instead of just doing this 10 times
+  ; or dig into ragtime to find out how to get a more usefull return value
+  (doall (take 10 (repeatedly db-rollback)))
+  :done)

 (defn db-show-tables []
   (clojento.magento.db/raw-jdbc-fetch (:db system) "show tables;"))


Make debug_repl work.

Make debug_repl work.

--- dev/user.clj
+++ dev/user.clj
@@ -5,7 +5,9 @@
             [taoensso.timbre :refer (debug info warn error)]
             [cmr.common.lifecycle :as lifecycle])
   (:use [clojure.test :only [run-all-tests]]
-        [clojure.repl]))
+        [clojure.repl]
+        ;; Needed to make debug-repl available
+        [alex-and-georges.debug-repl]))

 ; See http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
 ; for information on why this file is setup this way


CMR-2480: Added missing namespace to migration

--- metadata-db-app/src/migrations/033_replace_tags_namespace_and_value_with_tag_key.clj
+++ metadata-db-app/src/migrations/033_replace_tags_namespace_and_value_with_tag_key.clj
@@ -1,6 +1,7 @@
 (ns migrations.033-replace-tags-namespace-and-value-with-tag-key
   (:require [clojure.java.jdbc :as j]
             [clojure.edn :as edn]
+            [clojure.string :as str]
             [config.migrate-config :as config]
             [cmr.common.util :as util]
             [config.mdb-migrate-helper :as h]))
@@ -17,7 +18,7 @@
           ;; Some rows may already have a tag-key instead of namespace and value.
           {:keys [namespace value tag-key]} metadata
           tag-key (or tag-key
-                      (lower-case (str namespace "." value)))
+                      (str/lower-case (str namespace "." value)))
           metadata (-> metadata
                        (assoc :tag-key tag-key)
                        (dissoc :namespace :value :category)


Added input field validation

Added input field validation

--- src-cljs/rmfu_ui/core.cljs
+++ src-cljs/rmfu_ui/core.cljs
@@ -1,13 +1,14 @@
 (ns ^:figwheel-always rmfu-ui.core
   (:require
+    [ajax.core :refer [POST GET PUT]]
+    [goog.events :as events]
+    [goog.history.EventType :as EventType]
     [reagent.core :as reagent :refer [atom]]
     [reagent.session :as session]
-    [secretary.core :as secretary :include-macros true]
-    [goog.events :as events]
-    [goog.history.EventType :as EventType]
-    [ajax.core :refer [POST GET PUT]]
+    [reagent.validation :as validation]
+    [rmfu-ui.createarticle :refer [createarticle]]
     [rmfu-ui.profile :refer [profile]]
-    [rmfu-ui.createarticle :refer [createarticle]])
+    [secretary.core :as secretary :include-macros true])
   (:import goog.History))

 (enable-console-print!)
@@ -51,7 +52,8 @@
                             (do
                               ;(swap! form-state assoc :show-loading (not (:show-loading @form-state)))
                               (println "res:" res)
-                              (js/alert res))
+                              (js/alert res)
+                              (secretary/dispatch! "/"))
                             )})))

 (defn request-password-reset [profile]
@@ -86,18 +88,27 @@

 (defn sign-in [profile]
   (let [{:keys [email password]} profile]
-    (swap! form-state assoc :signing-up false)
     (if-not (or (empty? email) (empty? password))
-      (post-sign-in profile))))
+      (do
+        (if (validation/is-email? email)
+          (post-sign-in profile)
+          (js/alert "Invalid Email"))
+        ))))

 (defn sign-up [profile]
   (let [{:keys [email username password]} profile]
     (if-not (or (empty? email) (empty? username) (empty? password))
-      (post-sign-up profile))))
+      (if (and  (validation/min-length? password 8) (validation/has-value? username) (validation/is-email? email) (validation/has-value? password))
+        (post-sign-up profile)
+        (js/alert "Invalid Credentials"))
+      )))

 (defn reset-password-email [profile]
   (if-not (empty? (:email profile))
-    (request-password-reset profile)))
+      (if (validation/is-email? (profile :email))
+        (request-password-reset profile)
+        (js/alert "Invalid Email")
+      )))

 ;; -------------------------
 ;; <Components/>
@@ -241,8 +252,9 @@
          [:br]
          [:button.btn.btn-default {:type     "button"
                                    :on-click (fn [e]
-                                               (if-not (empty? (:password @profile))
-                                                 (update-password @profile))
+                                               (if-not (or (empty? (:password @profile)) (not (validation/has-value? (:password @profile))))
+                                                 (update-password @profile)
+                                                 (js/alert "Invalid Password"))
                                                (.preventDefault e))
                                    } "reset"]]))))


handles signature change issues from concurrent MRs (#1366)

--- waiter/test/waiter/token_test.clj
+++ waiter/test/waiter/token_test.clj
@@ -2875,20 +2875,20 @@
              (set (json/read-str body))))
       (is (nil? (async/poll! token-watch-channels-update-chan))))
     (let [request {:request-method :get :query-string "env.E1=v0"}
-          {:keys [body status]} (handle-list-tokens-request kv-store entitlement-manager streaming-timeout-ms token-watch-channels-update-chan request)]
+          {:keys [body status]} (handle-list-tokens-request retrieve-descriptor-fn kv-store entitlement-manager streaming-timeout-ms token-watch-channels-update-chan request)]
       (is (= http-200-ok status))
       (is (= #{{"maintenance" false, "owner" "owner3", "token" "token8"}
                {"maintenance" true, "owner" "owner3", "token" "token9"}}
              (set (json/read-str body))))
       (is (nil? (async/poll! token-watch-channels-update-chan))))
     (let [request {:request-method :get :query-string "env.P2=v2"}
-          {:keys [body status]} (handle-list-tokens-request kv-store entitlement-manager streaming-timeout-ms token-watch-channels-update-chan request)]
+          {:keys [body status]} (handle-list-tokens-request retrieve-descriptor-fn kv-store entitlement-manager streaming-timeout-ms token-watch-channels-update-chan request)]
       (is (= http-200-ok status))
       (is (= #{{"maintenance" true, "owner" "owner3", "token" "token9"}}
              (set (json/read-str body))))
       (is (nil? (async/poll! token-watch-channels-update-chan))))
     (let [request {:request-method :get :query-string "env.V1=e1&metadata.f1=m1"}
-          {:keys [body status]} (handle-list-tokens-request kv-store entitlement-manager streaming-timeout-ms token-watch-channels-update-chan request)]
+          {:keys [body status]} (handle-list-tokens-request retrieve-descriptor-fn kv-store entitlement-manager streaming-timeout-ms token-watch-channels-update-chan request)]
       (is (= http-200-ok status))
       (is (= #{{"maintenance" false, "owner" "owner3", "token" "token5"}}
              (set (json/read-str body))))


Made test key less ambiguous.

Made test key less ambiguous.

--- test/forma/source/hdf_test.clj
+++ test/forma/source/hdf_test.clj
@@ -33,7 +33,7 @@

     "If a key is missing, the generated function throws an assertion
 error."
-    (test-keys #{:ndv}) => (throws AssertionError)))
+    (test-keys #{:missingkey}) => (throws AssertionError)))

 (tabular
  (let [src (io/hfs-wholefile hdf-path)


CMR-1805: Commented revision-date field in collection mapping

--- indexer-app/src/cmr/indexer/data/index_set.clj
+++ indexer-app/src/cmr/indexer/data/index_set.clj
@@ -163,7 +163,9 @@
                 :properties (merge {:deleted (stored bool-field-mapping) ; deleted=true is a tombstone
                                     :native-id (stored string-field-mapping)
                                     :native-id.lowercase string-field-mapping
-                                    ;; TODO Figure out where this comes from and comment source
+                                    ;; This comes from the metadata db column of the same name
+                                    ;; and is by default equal to the Oracle system time at the
+                                    ;; time the revision record is written
                                     :revision-date         date-field-mapping
                                     :permitted-group-ids (stored string-field-mapping)
                                     :concept-id   (stored string-field-mapping)


Fix incorrect gobo cue linkage.

Fix incorrect gobo cue linkage.

--- src/afterglow/examples.clj
+++ src/afterglow/examples.clj
@@ -670,7 +670,7 @@
                  (cues/function-cue :t1-gobo-moving :gobo-moving-clockwise (show/fixtures-named "torrent-1")
                                     :effect-name "T1 Moving Gobos Swap CW" :color (create-color :green)))
     (ct/set-cue! (:cue-grid *show*) 7 10
-                 (cues/function-cue :t2-gobo-fixed :gobo-moving-clockwise (show/fixtures-named "torrent-2")
+                 (cues/function-cue :t2-gobo-moving :gobo-moving-clockwise (show/fixtures-named "torrent-2")
                                     :effect-name "T2 Moving Gobos Swap CW" :color (create-color :green)))
     (ct/set-cue! (:cue-grid *show*) 6 9
                  (cues/function-cue :t1-gobo-rotation :gobo-rotation-clockwise (show/fixtures-named "torrent-1")


Cleanup

Cleanup

--- src/angelic/search/summary_graphs_newer.clj
+++ src/angelic/search/summary_graphs_newer.clj
@@ -141,43 +141,6 @@
   (reset! (:summary-atom n) s))

-
-;; TODO: just try lumping all together for now?
-;; Called when child is just added as new child of parent.
-;; Status of child may increase status of parent.
-;; Propagate this upwards as status increases and cost does not decrease.
-;; Cost increases are not allowed.  This must only change statuses in the
-;; tree (and perhaps children?) -- rewards must not change.
-;; However, can use some other intuitions as well?
-;; I.e., when a node marked solved, its cost must be right (ie no cycles)
-;; Same is true for blocked.
-
-
-;; its new summary may be better, due to inconsistencies.
-(comment
- (defn status-increased! [parent child]
-   (when @(:summary-atom parent) ;; TODO: correct?
-     (let [cs (summary child)
-           ops (summary parent)]
-       ;; also false due to incons.
-       ;;      (util/assert-is (>= (summary/max-reward ops) (summary/max-reward cs)) (str parent child))
-       (when (> (summary/status-val (summary/status cs))
-                (summary/status-val (summary/status ops)))
-         (let [nps (summarize parent)]
-           #_ (println "SI" (:name parent) (:name child) cs ops nps
-                       (map summary (parent-nodes parent))
-                       (map summarize (parent-nodes parent))
-                       )
-
-                                        ;        (println parent ops nps) (Thread/sleep 100)
-           (when (>= (summary/max-reward nps) (summary/max-reward ops)) ;; accomodate pair case.
-             ;; may not be true due to inconsistencies.
-             ;;(util/assert-is (= (summary/max-reward nps) (summary/max-reward ops)) "%s" (def *bad* [parent child]))
-             (set-summary! parent nps) #_ (reset! (:summary-atom parent) nps)
-             (when (> (summary/status-val (summary/status nps))
-                      (summary/status-val (summary/status ops)))
-               (doseq [gp (doall (seq (parent-nodes parent)))] ;; TODO: comodification in pair -- safe?
-                 (status-increased! gp parent))))))))))

 ;; Just increase status, if you can do it without making parent worse.


+"read"

+"read"

--- src/babel/english/lab.cljc
+++ src/babel/english/lab.cljc
@@ -104,7 +104,7 @@
 (defn basecamp []
   (let [tree the-static-tree]
     (-> tree
-        (basecamp-at [:head :head] (first (take 1 (shuffle ["see"]))))
+        (basecamp-at [:head :head] (first (take 1 (shuffle ["see" "read"]))))
         (u/dissoc-paths [[:head :head]])
         (basecamp-at [:head :comp :head :head] (first (take 1 (shuffle ["game" "word" "book"]))))
         (u/dissoc-paths [[:head :comp :head :head]])


update useful

update useful

--- build.boot
+++ build.boot
@@ -1,21 +1,23 @@
 (set-env!
-  :dependencies '[[org.clojure/clojure       "1.6.0"          :scope "provided"]
-                  [boot/core                 "2.0.0-pre5"     :scope "provided"]
-                  [tailrecursion/boot-useful "0.1.0-SNAPSHOT" :scope "test"]
-                  [org.clojure/clojurescript "0.0-2371"       :scope "test"]])
-
-(def +VERSION+ "0.0-2371-3")
+  :dependencies '[[org.clojure/clojure       "1.6.0"      :scope "provided"]
+                  [boot/core                 "2.0.0-pre5" :scope "provided"]
+                  [tailrecursion/boot-useful "0.1.1"      :scope "test"]
+                  [org.clojure/clojurescript "0.0-2371"   :scope "test"]])

 (require '[tailrecursion.boot-useful :refer :all])

+(def +version+ "0.0-2371-3")
+
+(useful! +version+)
+
 (task-options!
-  pom  [:project        'tailrecursion/boot-cljs
-        :version        +VERSION+
-        :description    "Boot task to compile ClojureScript applications."
-        :url            "https://github.com/tailrecursion/boot-cljs"
-        :scm            {:url "https://github.com/tailrecursion/boot-cljs"}
-        :license        {:name "Eclipse Public License"
-                         :url  "http://www.eclipse.org/legal/epl-v10.html"}])
+  pom  [:project     'tailrecursion/boot-cljs
+        :version     +version+
+        :description "Boot task to compile ClojureScript applications."
+        :url         "https://github.com/tailrecursion/boot-cljs"
+        :scm         {:url "https://github.com/tailrecursion/boot-cljs"}
+        :license     {:name "Eclipse Public License"
+                      :url  "http://www.eclipse.org/legal/epl-v10.html"}])

 (deftask build
   "Build jar and install to local repo."


Add a comment explaining why load-modules! is a macro

--- src/braid/core/modules.clj
+++ src/braid/core/modules.clj
@@ -23,6 +23,10 @@
     (require (symbol (namespace v)))
     ((helpers/get! provides k) (resolve! v))))

+;; This is a macro so that we can make the modules be read in at
+;; compile time, so that when generating an uberjar, the module
+;; information is fetched at uberjar-ing time, since we won't be able
+;; to access the module.edn files in the source tree at runtime
 (defmacro load-modules!
   []
   `(let [modules# (quote ~(doall (helpers/read-all-modules)))]


Removed left over capture/reveal

Removed left over capture/reveal

--- system-int-test/test/cmr/system_int_test/search/collection_concept_revision_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/collection_concept_revision_search_test.clj
@@ -48,12 +48,6 @@
     ;; Added the 'is' wrapper so I can see the respective sets + difference when a test fails.
     (is (= umm-concept-map-set result-set))))

-(comment
-
-  (cmr.common.dev.capture-reveal/reveal coll1-tombstone)
-
-  )
-
 (deftest retrieve-collection-concept-revisions-by-params

   (let [umm-coll1-1 (dc/collection {:entry-title "et1"
@@ -77,8 +71,6 @@
         _ (ingest/tombstone-concept {:concept-id (:concept-id coll1-2)
                                      :revision-id (inc (:revision-id coll1-2))})
         coll1-tombstone (merge coll1-2 {:deleted true :revision-id (inc (:revision-id coll1-2))})
-
-        _ (cmr.common.dev.capture-reveal/capture coll1-tombstone)

         ;; Ingest collection once, tombstone, then ingest again - latest should be deleted=false.
         coll2-1 (d/ingest "PROV1" umm-coll2-1)
@@ -150,10 +142,6 @@
               [coll3+metadata]
               {:entry-title "et3" :latest true}

-              "entry-id - latest=true"
-              [coll2-3]
-              {:entry-id "s2_v6" :exclude-metadata true :latest true}
-
               "find none - bad provider-id"
               []
               {:provider-id "PROV_NONE" :exclude-metadata true :latest true}


improve robustness of tag scanner

improve robustness of tag scanner

--- src/clj/apollo/scanner.clj
+++ src/clj/apollo/scanner.clj
@@ -5,7 +5,8 @@
             [apollo.db.schema :as db]
             [apollo.utils :refer [canonicalize]]
             [pantomime.mime :refer [mime-type-of]]
-            [clojure.tools.logging :as log])
+            [clojure.tools.logging :as log]
+            [clojure.string :as string])
   (:import org.jaudiotagger.audio.AudioFileFilter
            org.jaudiotagger.audio.AudioFileIO))

@@ -13,6 +14,30 @@
            java.util.logging.Level/OFF)

 (def file-filter (new org.jaudiotagger.audio.AudioFileFilter false))
+
+(def field-keys (map #(.name %) (.getEnumConstants org.jaudiotagger.tag.FieldKey)))
+
+(defn get-tag-from-file [f]
+  (.getTag (org.jaudiotagger.audio.AudioFileIO/read f)))
+
+(defn ->constant [k]
+  (.get (.getField org.jaudiotagger.tag.FieldKey k) nil))
+
+(defn keywordify [k]
+  (keyword (string/replace (string/lower-case k) #"_" "-")))
+
+(defn retrieve-field [tag k]
+  (let [v (try
+            (.getFirst tag (->constant k))
+            (catch java.lang.NullPointerException e
+              (log/info (format "%s is null" k))
+              nil))]
+    (when-not (empty? v)
+      (vector (keywordify k) v))))
+
+(defn read-tag [f]
+  (when-let [tag (.getTag (org.jaudiotagger.audio.AudioFileIO/read f))]
+    (into {} (remove nil? (map (partial retrieve-field tag) field-keys)))))

 (defn is-audio-file? [f]
   (.accept file-filter f))
@@ -36,10 +61,11 @@
 (defn get-info [f]
   (log/info (format "reading tags from %s" (.getAbsolutePath f)))
   (let [id3tags (some identity [(try
-                                  (id3/read-tag f)
+                                  (read-tag f)
                                   (catch  Exception e
                                     (log/error e (format "problems reading tags from %s" (.getAbsolutePath f)))
-                                    {})) {}])
+                                    {}))
+                                {}])
         id3tags-fixed (hm-filter-null id3tags)
         result (assoc id3tags-fixed
                       :path (.getAbsolutePath f)


desugared cljs.repl.node/repl-env*, remove some dead code

--- src/clj/cljs/repl/node.clj
+++ src/clj/cljs/repl/node.clj
@@ -56,8 +56,7 @@
   (node-eval repl-env (slurp url)))

 (defn setup [repl-env]
-  (let [env   (ana/empty-env)
-        scope (:scope repl-env)]
+  (let [env (ana/empty-env)]
     (repl/load-file repl-env "cljs/core.cljs")
     (swap! (:loaded-libs repl-env) conj "cljs.core")
     (repl/evaluate-form repl-env
@@ -78,11 +77,9 @@
   (-tear-down [this]
     (close-socket socket)))

+(defn repl-env* [{:keys [host port] :or {host "localhost" port 5001}}]
+  (NodeEnv. (socket host port) (atom {})))
+
 (defn repl-env
-  [& {:keys [host port] :or {host "localhost" port 5001}}]
-  (let [repl-env (NodeEnv. (socket host port) (atom {}))
-        base     (io/resource "goog/base.js")
-        deps     (io/resource "goog/deps.js")]
-    (node-eval repl-env (slurp (io/reader base)))
-    (node-eval repl-env (slurp (io/reader deps)))
-    repl-env))
+  [& options]
+  (repl-env* options))


don't try to parse empty string as integer

--- src/clj_money/coercion.clj
+++ src/clj_money/coercion.clj
@@ -45,7 +45,10 @@
             %))
        value))

-(register-coerce-fn :integer    #(if (integer? %) % (Integer. %)))
+(register-coerce-fn :integer    #(if (integer? %)
+                                   %
+                                   (when (re-matches #"\A\d+\z" %)
+                                     (Integer. %))))
 (register-coerce-fn :decimal    #(if (decimal? %) % (try
                                                       (bigdec %)
                                                       (catch NumberFormatException e


FIX: clojure config

FIX: clojure config

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1 +1 @@
-{:user {:plugins [[cider/cider-nrepl "0.6.0"]]}}
+{:user {:plugins [[cider/cider-nrepl "0.7.0-SNAPSHOT"]]}}


CMR-4537: Resolved jar file conflicts for ingest app.

--- ingest-app/project.clj
+++ ingest-app/project.clj
@@ -1,8 +1,11 @@
 (defproject nasa-cmr/cmr-ingest-app "0.1.0-SNAPSHOT"
   :description "Ingest is an external facing CMR service facilitating providers to create and  update their concepts in CMR. Internally it delegates concept persistence operations to metadata db and indexer micro services."
   :url "https://github.com/nasa/Common-Metadata-Repository/tree/master/ingest-app"
+  :exclusions [
+    [commons-io]]
   :dependencies [
     [clj-http "2.0.0"]
+    [commons-io "2.6"]
     [compojure "1.5.1"]
     [drift "1.5.3"]
     [nasa-cmr/cmr-acl-lib "0.1.0-SNAPSHOT"]


Removed unnecessary dependency

Removed unnecessary dependency

--- src/descent/pom_parser.clj
+++ src/descent/pom_parser.clj
@@ -1,6 +1,5 @@
 (ns descent.pom-parser
-  (:use [clojure.xml :only (parse)])
-  (:require [clojure.java.io :as io]))
+  (:use [clojure.xml :only (parse)]))

 ;;;; Access the project dependencies through the following logic:


Made code->key an atom for key-mapping. Added key-mapping function.

--- src/divergence/system.cljs
+++ src/divergence/system.cljs
@@ -174,6 +174,17 @@
       (aset (.-position ref) "y" y)
       (aset ref "rotation" rot))))

+(defn play-time-travel [entities]
+  (doseq [e entities
+          :let [actions (:actions @e)
+                prev-actions (:prev-actions @e)]]
+    (when (and (actions :travel-back)
+               (not (prev-actions :travel-back)))
+          (a/play-sound :time)
+      )
+    (swap! e assoc :prev-actions actions)
+    ))
+
 ;;------------------------------------------------
 ;;ENTITY EVENTS-----------------------------------
 ;;------------------------------------------------
@@ -294,30 +305,31 @@
 ;;KEYLISTENER AND KEY EVENTS----------------------
 ;;------------------------------------------------
 (def code->key
-  {32 :up
-   87 :up
-   37 :left
-   65 :left
-   38 :up
-   39 :right
-   68 :right
-   40 :down
-   83 :down
-   77 :item
-   80 :p
-   16 :travel-back ;; :shift
-   })
+  (atom {
+       32 :up
+       87 :up
+       37 :left
+       65 :left
+       38 :up
+       39 :right
+       68 :right
+       40 :down
+       83 :down
+       77 :item
+       80 :p
+       16 :travel-back ;; :shift
+   }))

 (def key-inputs (atom #{}))

 (aset js/document.body "onkeydown" (fn [e]
-                                     (let [k (code->key (.-keyCode e))]
+                                     (let [k (@code->key (.-keyCode e))]
                                        (when k
                                          (.preventDefault e)
                                          (swap! key-inputs conj k)))))

 (aset js/document.body "onkeyup" (fn [e]
-                                     (let [k (code->key (.-keyCode e))]
+                                     (let [k (@code->key (.-keyCode e))]
                                        (when k
                                          (.preventDefault e)
                                          (swap! key-inputs disj k)))))
@@ -376,16 +388,17 @@
           )
         (swap! e assoc-in [:acceleration] [0 0 0])))))

-(defn play-time-travel [entities]
-  (doseq [e entities
-          :let [actions (:actions @e)
-                prev-actions (:prev-actions @e)]]
-    (when (and (actions :travel-back)
-               (not (prev-actions :travel-back)))
-          (a/play-sound :time)
-      )
-    (swap! e assoc :prev-actions actions)
-    ))
+
+(defn change-key-code
+  "Change code->key mapping"
+  [keyCode newKeyCode]
+  (let [value (@code->key keyCode)]
+    (swap! code->key dissoc keyCode)
+    (swap! code->key assoc newKeyCode value)))
+
+;;------------------------------------------------
+;;PERIPHERAL FUNCTIONS----------------------------
+;;------------------------------------------------

 (defn movement-caps [entities]
   (doseq [e entities]


Implement part 2 of the Clojure day 3 solution.

--- clojure/src/advent2016/day3.clj
+++ clojure/src/advent2016/day3.clj
@@ -2,18 +2,25 @@
   (:require [clojure.java.io :as io]
             [clojure.string :as s]))

+(def puzzle (line-seq (io/reader "../day3.data")))
+
+
 (defn read-sides [line]
   (map #(Integer/parseInt %) (remove s/blank? (s/split line #" "))))
-

 (defn valid-triangle? [[a b c]]
   (and (> (+ a b) c)
        (> (+ a c) b)
        (> (+ b c) a)))

-(def solution (->> "../day3.data"
-                 io/reader
-                 line-seq
-                 (map read-sides)
-                 (filter valid-triangle?)
-                 count))
+(def solution1 (->> puzzle
+                    (map read-sides)
+                    (filter valid-triangle?)
+                    count))
+
+(def solution2 (->> puzzle
+                    (map read-sides)
+                    (apply mapcat vector)
+                    (partition 3)
+                    (filter valid-triangle?)
+                    count))


core.clj; parse belanno

core.clj; parse belanno

--- clojure/src/dataloader/core.clj
+++ clojure/src/dataloader/core.clj
@@ -84,6 +84,32 @@
     (def val-block false)
     ; for keyword, type, description, and usage
     (def ad-block false)
+      (doseq [line (line-seq rdr)]
+        (if (true? val-block)
+          (do
+            (def tokens (split line #"\|"))
+            (def value (tokens 0))
+            (def values (conj values value))))
+        (if (true? ad-block)
+          (do
+            (def tokens (split line #"="))
+            (if (= "Keyword" (tokens 0))
+              (def annomap (merge annomap {:keyword (tokens 1)})))
+            (if (= "TypeString" (tokens 0))
+              (def annomap (merge annomap {:type (tokens 1)})))
+            (if (= "DescriptionString" (tokens 0))
+              (def annomap (merge annomap {:description (tokens 1)})))
+            (if (= "UsageString" (tokens 0))
+              (def annomap (merge annomap {:usage (tokens 1)})))))
+        (if (re-matches #"\[.*\]" line)
+          (do
+            (def ad-block false)
+            (def val-block false)
+            (if (= line "[Values]")
+              (def val-block true))
+            (if (= line "[AnnotationDefinition]")
+              (def ad-block true))))))
+    (merge annomap {:valaues values}))

   ;   (doseq [line (line-seq rdr)]
   ;     (if (true? val-block)


Update help

Update help

--- src/export_server/core.clj
+++ src/export_server/core.clj
@@ -55,7 +55,7 @@
 ;====================================================================================
 ; Common usage summary
 ;====================================================================================
-(defn usage [common-summary cmd-summary server-summary]
+(defn usage [common-summary server-summary cmd-summary]
   (->> [server-name
         ""
         "Usage: java -jar anychart-export.jar action [options]"
@@ -69,11 +69,11 @@
         "Common options:"
         common-summary
         ""
+        "Server options:"
+        server-summary
+        ""
         "CMD options:"
         cmd-summary
-        ""
-        "Server options:"
-        server-summary
         ""
         "Please, see http://docs.anychart.com for more info."
         ]


syphonstuff not fixed

syphonstuff not fixed

--- src/bossig/kaos.clj
+++ src/bossig/kaos.clj
@@ -72,6 +72,7 @@
   (q/background [ 1 128 0]

                 (bassdrum [state]))
+  (.sendScreen @server)
   )

 (defn draw1 [state]


Puts everything in two columns for maximum efficiency

--- src/hphelper/live/view.clj
+++ src/hphelper/live/view.clj
@@ -86,41 +86,53 @@
               [:meta {:http-equiv "refresh" :content 5}]
               ]
              [:body
-              [:div
-               [:h3 "Current Sector Indicies"]
-               (html-print-indicies-table (first (:indicies g)) 13)
+              [:table
+               [:tr
+                [:td ;; Left column Begin
+                 [:div
+                  [:h3 "Current Sector Indicies"]
+                  (html-print-indicies-table (first (:indicies g)) 13)
+                  ]
+                 [:div
+                  [:h3 "Sector News"]
+                  (map (fn [n] [:div n])
+                       (:news g))
+                  ]
+                 [:div
+                  [:h3 "Upcoming cbay auctions"]
+                  (map (fn [^String i] [:div i]) (:cbay g))
+                  ]
+                 ;; Society messages
+                 (if-let [missions (:missions (lapi/get-player-society-missions guid uuid))]
+                   (do
+                     [:div
+                      [:h3 "Private message summary"]
+                      (map (fn [{ss_id :ss_id text :ssm_text}]
+                             [:div (str (sql/get-ss-by-id ss_id) ": " text)])
+                           (sort-by :ss_id missions))
+                      ]
+                     )
+                   )
+                 ;; Extra Messages
+                 (if-let [messages (:msgs u)]
+                   [:div
+                    (map (fn [^String msg] [:div msg]) messages)
+                    ]
+                   )
+                 [:hr] ;; Player Sheet
+                 (if u
+                   [:div
+                    [:h3 "Character Sheet"]
+                    (cprint/html-print-sheet u)]
+                   nil
+                   )
+                 ]
+                [:td ;; Right column Begin
+                 ;; Minions
+                 (map print-service-group (:serviceGroups (lapi/get-minions guid uuid)))
+                 ]
+                ]
                ]
-              [:div
-               [:h3 "Sector News"]
-               (map (fn [n] [:div n])
-                    (:news g))
-               ]
-              ;; Society messages
-              (if-let [missions (:missions (lapi/get-player-society-missions guid uuid))]
-                (do
-                  [:div
-                   [:h3 "Private message summary"]
-                   (map (fn [{ss_id :ss_id text :ssm_text}]
-                          [:div (str (sql/get-ss-by-id ss_id) ": " text)])
-                        (sort-by :ss_id missions))
-                   ]
-                  )
-                )
-              ;; Extra Messages
-              (if-let [messages (:msgs u)]
-                [:div
-                 (map (fn [^String msg] [:div msg]) messages)
-                 ]
-                )
-              [:hr] ;; Player Sheet
-              (if u
-                [:div
-                 [:h3 "Character Sheet"]
-                 (cprint/html-print-sheet u)]
-                nil
-                )
-              [:hr] ;; Minions
-              (map print-service-group (:serviceGroups (lapi/get-minions guid uuid)))
               ]
              ]
             )


CMR-6672 fixed test (#1033)

CMR-6672 fixed test (#1033)

--- search-app/test/cmr/search/services/query_execution/facets/granule_v2_facets_test.clj
+++ search-app/test/cmr/search/services/query_execution/facets/granule_v2_facets_test.clj
@@ -112,7 +112,7 @@
                     :has_children true})}]}]
              result))))

-  (testing "cycle"
+  (testing "Spatial"
     (let [result (v2-facets/create-v2-facets-by-concept-type
                    :granule
                    "http://localhost:3003/granules.json"
@@ -122,8 +122,9 @@
                    {:cycle {:buckets [{:key 3.0 :doc_count 6}
                                       {:key 42.0 :doc_count 2}]}}
                    nil)]
-      (is (= "Cycle" (:title (first result))))
-      (is (= 2 (count (:children (first result)))))))
+      (is (= "Spatial" (:title (first result))))
+      (is (= 1 (count (:children (first result)))))
+      (is (= "Cycle" (:title (first (:children (first result))))))))
   (testing "cycle and pass"
     (let [result (v2-facets/create-v2-facets-by-concept-type
                    :granule


require instead of use

require instead of use

--- src/jasons_game/routes.clj
+++ src/jasons_game/routes.clj
@@ -1,8 +1,8 @@
 (ns jasons-game.routes
-  (:use compojure.core)
   (:require [clojure.edn :as edn]
             [clojure.java.io :refer [file reader]]
             [clojure.pprint :refer [pprint]]
+            [compojure.core :refer :all]
             [compojure.handler :as handler]
             [compojure.route :as route]
             [ring.middleware.format-response :refer [wrap-clojure-response]]))