Make Midje docs accessible by `doc`

Make Midje docs accessible by `doc`

--- src/midje/doc.clj
+++ src/midje/doc.clj
@@ -6,18 +6,267 @@
             [midje.util.ecosystem :as ecosystem]))

 (def appropriate? ecosystem/running-in-repl?)
-(def for-sweet '[midje-help
-                 midje-configuration-help
-                 print-level-help
+
+(defn repl-notice []
+  (println (color/note "Run `(doc midje-repl)` for descriptions of Midje repl functions.")))
+
+(defn midje-notice []
+  (println (color/note "Run `(doc midje)` for Midje usage.")))
+
+
+(def for-sweet '[midje
+                 midje-facts
+                 midje-fact
+                 midje-checkers
+                 midje-prerequisites
+                 midje-arrows
+                 midje-setup
+                 midje-teardown
+
+                 midje-configuration
+                 midje-print-level
+                 midje-print-levels
                  guide])
-(def for-repl  '[midje-repl-help])
-
-(defn repl-notice []
-  (println (color/note "Run `(midje-repl-help)` for descriptions of Midje repl functions.")))
-
-(defn midje-notice []
-  (println (color/note "For Midje usage, run `(midje-help)`."))
-  (println (color/note "For Midje configuration options, run `(midje-configuration-help)`.")))
+(def for-repl  '[midje-repl])
+
+(def ^{:doc "
+   Detailed help:
+   (doc midje-facts)         -- The basic form.
+   (doc midje-prerequisites) -- For top-down test-driven design.
+   (doc midje-checkers)      -- Predefined predicates to use with arrows.
+   (doc midje-arrows)        -- Alternate ways of describing the relationship
+                             -- between actual and expected values.
+   (doc midje-setup)         -- Setup and teardown for facts and checkers.
+   (doc midje-configuration) -- Changing Midje's defaults.
+   (doc midje-print-levels)  -- Changing Midje's verbosity.
+
+   See also the `(guide)` macro, which takes you to pages in the
+   user's guide.
+   "} midje)
+
+
+;; midje-repl
+(def ^{:doc
+  "
+  Here are Midje repl functions. Use `doc` for more info.
+  To control verbosity of output, use print levels described by
+  `(doc midje-print-levels)`.
+
+  ----- Loading facts
+  You load facts by namespace.
+  (load-facts <ns> <ns>...)
+  (load-facts 'midje.util.*)      ; Load all namespaces below midje.util.
+  (load-facts <ns> :integration)  ; Apply filters to facts.
+
+  ----- Checking facts, once loaded
+  (check-facts)                     ; in current namespace
+  (check-facts <ns> <ns>...)        ; in given namespaces
+  (check-facts :all)                ; all defined facts
+  (check-facts :all :integration)   ; all integration tests
+  (check-facts \"partial\")         ; in this namespace when
+                                    ; name contains \"partial\"
+  There are other filter arguments.
+
+  ----- Rerunning facts
+  (recheck-fact)                ; Check just-checked fact again.
+  (rcf)                         ; Synonym for above.
+
+  Note: facts with `:check-only-at-load-time`metadata do not get
+  stored for rechecking.
+
+  ----- Forgetting facts
+  Same notation as the `check-facts` family, but with
+  \"forget\" instead of \"check\"
+
+  ----- Fetching facts
+  Same notation as the `check-facts` family, but with
+  \"fetch\" instead of \"check\".
+  To check the returned facts,use `check-one-fact`:
+     (map check-one-fact (fetch-facts :all))
+
+  In addition, you can fetch the last fact checked with
+  `(last-fact-checked)`. `(source-of-last-fact-checked)`
+  gives you its source.
+
+  To query fact metadata more easily, use these:
+  -- (fact-name <ff>)                ; result might be nil
+  -- (fact-source <ff>)
+  -- (fact-file <ff>)
+  -- (fact-line <ff>)
+  -- (fact-namespace <ff>)
+  -- (fact-description <ff>)         ; the doc string; might be nil
+  "} midje-repl)
+
+;; print-levels
+(def ^{:doc "
+  The `load-facts`, `check-facts`, and `recheck-fact`
+  functions normally print any fact failures and a final
+  summary. The detail printed can be adjusted by passing
+  either certain keywords or corresponding numbers to the
+  functions. (The numbers are easier to remember.)
+  For example, here's how you check all facts in the most
+  verbose way:
+    (check-facts :all 2)
+    (check-facts :all :print-facts)
+
+  Here are all the variants:
+
+  :print-normally     (0)  -- failures and a summary.
+  :print-no-summary  (-1)  -- failures only.
+  :print-nothing     (-2)  -- nothing is printed.
+                           -- (but return value can be checked)
+  :print-namespaces   (1)  -- print the namespace for each group of facts.
+  :print-facts        (2)  -- print fact descriptions in addition to namespaces.
+"} midje-print-levels)
+
+(def midje-print-level midje-print-levels)
+
+(def ^{:doc "
+  * A common form:
+    (fact \"fact name / doc string\"
+      (let [result (prime-ish 5)]
+        result => odd?
+        result => (roughly 13)))
+
+  * Nested facts
+    (facts \"about life\"
+      (facts \"about birth\"...)
+      (facts \"about childhood\"...)
+      ...)
+
+  * Metadata
+    (fact :integration ...)
+    (fact {:priority 5} ...)
+"} midje-facts)
+(def midje-fact midje-facts)
+
+
+(def ^{:doc "
+  (facts \"about checkers\"
+    (f) => truthy
+    (f) => falsey
+    (f) => irrelevant ; or `anything`
+    (f) => (exactly odd?) ; when function is returned
+    (f) => (roughly 10 0.1)
+    (f) => (throws SomeException \"with message\")
+    (f) => (contains [1 2 3]) ; works with strings, maps, etc.
+    (f) => (contains [1 2 3] :in-any-order :gaps-ok)
+    (f) => (just [1 2 3])
+    (f) => (has every? odd?)
+    (f) => (nine-of odd?) ; must be exactly 9 odd values.
+    (f) => (every-checker odd? (roughly 9)) ; both must be true
+    (f) => (some-checker odd? (roughly 9))) ; one must be true
+  "} midje-checkers)
+
+
+(def ^{:doc "
+  * Prerequisites and top-down TDD:
+    (unfinished char-value chars)
+    (fact \"a row value is composed of character values\"
+       (row-value ..row..) => \"53\"
+       (provided
+         (chars ..row..) => [..five.. ..three..]
+         (char-value ..five..) => \"5\"
+         (char-value ..three..) => \"3\"))
+
+  * Prerequisites can be defaulted for claims within a fact:
+    (fact \"No one is ready until everyone is ready.\"
+      (against-background
+         (pilot-ready) => true,
+         (copilot-ready) => true,
+         (flight-engineer-ready) => true)
+      (ready) => truthy
+      (ready) => falsey (provided (pilot-ready) => false)
+      (ready) => falsey (provided (copilot-ready) => false)
+      (ready) => falsey (provided (flight-engineer-ready) => false))
+
+  * Prerequisites can also be wrapped around facts.
+    (against-background [(pilot-ready) => true
+                         (copilot-ready) => true
+                         (flight-engineer-ready) => true]
+      (fact \"No one is ready until everyone is ready.\"
+         (ready) => truthy
+         (ready) => falsey (provided (pilot-ready) => false)
+         (ready) => falsey (provided (copilot-ready) => false)
+         (ready) => falsey (provided (flight-engineer-ready) => false)))
+"} midje-prerequisites)
+
+
+(def ^{:doc
+       "
+  Setup and Teardown
+  * Before, after, and around facts
+    (against-background [(before :facts (do-this))
+                         (after :facts (do-that))
+                         (around :facts (wrapping-around ?form))]
+      (fact ...)
+      (fact ...))
+
+  * Before, after, and around checks
+    (against-background [(before :checks (do-this))
+                         (after :checks (do-that))
+                         (around :checks (wrapping-around ?form))]
+      (fact
+        (something) => truthy
+        (something-else) => falsey))
+
+  * Setup/teardown can be placed within fact bodies
+    (fact
+      (against-background
+        (before :checks (do-this))
+        (after :checks (do-that))
+        (around :checks (wrapping-around ?form)))
+       ...)
+"} midje-setup)
+
+(def midje-teardown midje-setup)
+
+
+(def ^{:doc "
+  * For checks
+    5     =not=>    even?      ; Invert the check. Synonym: =deny=>
+    (f)   =future=> :halts?    ; don't check, but issue reminder.
+    (m x) =expands-to=> form   ; expand macro and check result
+
+  * In prerequisites
+    ..meta.. =contains=> {:a 1} ; partial specification of map-like object
+    (f)      =streams=>  (range 5 1000)
+    (f)      =throws=>   (IllegalArgumentException. \"boom\")
+"} midje-arrows)
+
+(def ^{:doc "
+  On startup, Midje loads ${HOME}/.midje.clj and ./.midje.clj
+  (in that order). To affect the default configuration, use
+  code like this:
+      (override-with :visible-deprecation false
+                     :visible-future false
+                     :print-level :print-namespaces)
+
+  You can temporarily override the configuration like this:
+      (midje.config/with-augmented-config {:print-level :print-no-summary}
+         <forms>...)
+
+  ------ Configuration keywords
+  :print-level                  ; Verbosity of printing.
+                                ; See `(print-level-help)`
+
+  :check-after-creation         ; Should facts be checked as they're loaded?
+                                ; Default true.
+
+  :visible-deprecation          ; Whether information about deprecated
+                                ; features or functions is printed.
+                                ; Default true.
+
+  :visible-future               ; Whether future facts produce output.
+                                ; Default true.
+                                ; More: `(guide future-facts)`
+
+  :partial-prerequisites        ; Whether the real function can be used.
+                                ; Default false.
+                                ; More: `(guide partial-prerequisites)`
+"} midje-configuration)
+
+

 (def guide-topics {
@@ -27,255 +276,14 @@

 (defmacro guide
   "Open a web page that addresses a particular topic"
-  [topic]
-  `(if-let [url# (guide-topics '~topic)]
-     (browse/browse-url url#)
-     (do
-       (println "There is no such topic. Did you mean one of these?")
-       (doseq [topic# (keys guide-topics)]
-         (println "   " topic#)))))
-
-
-(defn midje-repl-help
-  "Midje repl help"
-  []
-  (println)
-  (println "Here are Midje repl functions. Use `doc` for more info.")
-  (println "To control verbosity of output, use print levels defined ")
-  (println "by `(print-level-help)`.")
-  (println)
-  (println "----- Loading facts")
-  (println "You load facts by namespace. Namespace names need not be quoted.")
-  (println "(load-facts <ns> <ns>...)")
-  (println "(load-facts midje.util.*)       ; Load all namespaces below midje.util.")
-  (println "(load-facts <ns> :integration)  ; Apply filters to facts.")
-  (println)
-  (println "----- Running facts")
-  (println "(check-facts)                   ; in current namespace")
-  (println "(check-facts <ns> <ns>...)      ; in given namespaces")
-  (println "(check-facts :all)              ; all defined facts")
-  (println "(check-facts :all :integration) ; all integration tests")
-  (println "(check-facts \"partial\"        ; in this namespace when")
-  (println "                                ; name contains \"partial\"")
-  (println "There are other filter arguments.")
-  (println)
-  (println "----- Rerunning facts")
-  (println "(recheck-fact)                ; Check just-checked fact again.")
-  (println "(rcf)                         ; Synonym for above.")
-  (println)
-  (println "Note: facts with `:check-only-at-load-time`")
-  (println "metadata do not get stored for rerunning.")
-  (println)
-  (println "----- Forgetting facts")
-  (println "Same notation as the `check-facts` family, but with")
-  (println "\"forget\" instead of \"check\"")
-  (println)
-  (println "----- Fetching facts")
-  (println "Same notation as the `check-facts` family, but with")
-  (println "\"fetch\" instead of \"check\". The return value is a")
-  (println "sequence of functions. To check the corresponding facts,")
-  (println "use `check-one-fact`:")
-  (println "   (check-one-fact <fact-function>)")
-  (println)
-  (println "In addition you can fetch the last fact checked with")
-  (println "`(last-fact-checked)`. `(source-of-last-fact-checked)`")
-  (println "gives you its source.")
-  (println)
-  (println "To query fact function metadata, use these:")
-  (println "-- (fact-name <ff>)                ; result might be nil")
-  (println "-- (fact-source <ff>)")
-  (println "-- (fact-file <ff>)")
-  (println "-- (fact-line <ff>)")
-  (println "-- (fact-namespace <ff>)")
-  (println "-- (fact-description <ff>)         ; the doc string; might be nil")
-  (println)
-  (println "----- Overriding the configuration")
-  (println "(midje.config/with-augmented-config")
-  (println "    {:visible-deprecation false, :check-after-creation false}")
-  (println "  (load-facts midje.ideas.*))")
-  (println)
-  (println "See `(midje-configuration-help)` for a description of the")
-  (println "configuration keywords and values.")
-  )
-
-(defn print-level-help
-  "Description of print levels."
-  []
-  (println "The `load-facts`, `check-facts`, and `recheck-fact`")
-  (println "functions normally print any fact failures and a final")
-  (println "summary. The detail printed can be adjusted by passing")
-  (println "either certain keywords or corresponding numbers to the")
-  (println "functions. (The numbers are easier to remember.)")
-  (println "For example, here's how you check all facts in the most")
-  (println "verbose way:")
-  (println "  (check-facts :all 2)")
-  (println "  (check-facts :all :print-facts)")
-  (println)
-  (println "Here are all the variants:")
-  (println)
-  (println ":print-normally     (0)  -- failures and a summary.")
-  (println ":print-no-summary  (-1)  -- failures only.")
-  (println ":print-nothing     (-2)  -- nothing is printed.")
-  (println "                         -- (but return value can be checked)")
-  (println ":print-namespaces   (1)  -- print the namespace for each group of facts.")
-  (println ":print-facts        (2)  -- print fact descriptions in addition to namespaces.")
-  )
-
-
-
-(defn midje-help
-  "Midje help"
-  [& args]
-  (if (empty? args)
-    (do
-      (println "** Topics:")
-      (println "* (midje-help :checkers)")
-      (println "* (midje-help :prerequisites)  ; deferring coding of helper functions.")
-      (println "* (midje-help :setup)          ; and teardown too")
-      (println "* (midje-help :arrows)         ; variants on =>")
-      (println)
-      (println "** About facts")
-      (println "* A common form:")
-      (println "(fact ")
-      (println "  (let [result (prime-ish 5)]")
-      (println "    result => odd?")
-      (println "    result => (roughly 13)")
-      (println)
-      (println "* Nested facts")
-      (println "(facts \"about life\"")
-      (println "  (facts \"about birth\"...)")
-      (println "  (facts \"about childhood\"...)")
-      (println "  ...)")
-      (println)
-      (println "* metadata")
-      (println "(fact :integration ...)")
-      (println "(fact {priority 5} ...)"))
-    (doseq [topic args]
-      (condp = topic
-        :checkers
+  ([topic]
+     `(if-let [url# (guide-topics '~topic)]
+        (browse/browse-url url#)
         (do
-          (println "** Checkers:")
-          (println "(facts \"about checkers\"")
-          (println "  (f) => truthy")
-          (println "  (f) => falsey")
-          (println "  (f) => irrelevant ; or `anything`")
-          (println "  (f) => (exactly odd?) ; when function is returned")
-          (println "  (f) => (roughly 10 0.1)")
-          (println "  (f) => (throws SomeException \"with message\")")
-          (println "  (f) => (contains [1 2 3]) ; works with strings, maps, etc.")
-          (println "  (f) => (contains [1 2 3] :in-any-order :gaps-ok)")
-          (println "  (f) => (just [1 2 3])")
-          (println "  (f) => (has every? odd?)")
-          (println "  (f) => (nine-of odd?) ; must be exactly 9 odd values.")
-          (println "  (f) => (every-checker odd? (roughly 9)) ; both must be true")
-          (println "  (f) => (some-checker odd? (roughly 9)) ; one must be true")
-          (println))
-
-        :prerequisites
-        (do
-          (println "** Prerequisites")
-          (println "* Prerequisites and top-down TDD:")
-          (println "(unfinished char-value chars)")
-          (println "(fact \"a row value is composed of character values\"")
-          (println "   (row-value ..row..) => \"53\"")
-          (println "   (provided")
-          (println "     (chars ..row..) => [..five.. ..three..]")
-          (println "     (char-value ..five..) => \"5\"")
-          (println "     (char-value ..three..) => \"3\"))")
-          (println)
-          (println "* Prerequisites can be defaulted for claims within a fact:")
-          (println "(fact \"No one is ready until everyone is ready.\"")
-          (println "  (against-background")
-          (println "     (pilot-ready) => true, (copilot-ready) => true,")
-          (println "     (flight-engineer-ready) => true)")
-          (println)
-          (println "   (ready) => truthy")
-          (println "   (ready) => falsey (provided (pilot-ready) => false)")
-          (println "   (ready) => falsey (provided (copilot-ready) => false)")
-          (println "   (ready) => falsey (provided (flight-engineer-ready) => false)")
-          (println)
-          (println "* Prerequisites can also be wrapped around facts.")
-          (println "(against-background [(pilot-ready) => true")
-          (println "                     (copilot-ready) => true")
-          (println "                     (flight-engineer-ready) => true]")
-          (println "  (fact \"No one is ready until everyone is ready.\"")
-          (println "    (ready) => truthy")
-          (println "    (ready) => falsey (provided (pilot-ready) => false)")
-          (println "    (ready) => falsey (provided (copilot-ready) => false)")
-          (println "    (ready) => falsey (provided (flight-engineer-ready) => false))")
-          (println))
-
-        :setup
-        (do
-          (println "** Setup/Teardown")
-          (println "* Around facts")
-          (println "(against-background [(before :facts (do-this))")
-          (println "                     (after :facts (do-that))")
-          (println "                     (around :facts (wrapping-around ?form))]")
-          (println "   (fact ...)")
-          (println "   (fact ...)")
-          (println)
-          (println "* Around checks")
-          (println "(against-background [(before :checks (do-this))")
-          (println "                     (after :checks (do-that))")
-          (println "                     (around :checks (wrapping-around ?form))]")
-          (println "   (fact ...)")
-          (println "   (fact ...)")
-          (println)
-          (println "* Setup/teardown can be placed within fact bodies")
-          (println "(fact ")
-          (println "  (against-background")
-          (println "     (before :checks (do-this))")
-          (println "     (after :checks (do-that))")
-          (println "     (around :checks (wrapping-around ?form)))")
-          (println "  ...)")
-          (println))
-
-        :arrows
-        (do
-          (println "** Arrow forms")
-          (println "* Claims")
-          (println "5     =not=>    even?      ; Invert the check. Synonym: =deny=>")
-          (println "(f)   =future=> :halts?    ; don't check, but issue reminder.")
-          (println "(m x) =expands-to=> form   ; expand macro and check result")
-          (println)
-          (println "* Prerequisites")
-          (println "..meta.. =contains=> {:a 1} ; partial specification of map-like object")
-          (println "(f)      =streams=>  (range 5 1000)")
-          (println "(f)      =throws=>   (IllegalArgumentException. \"boom\")"))))))
-
-(defn midje-configuration-help
-  "What can go in the .midje.clj files."
-  []
-  (println "On startup, Midje loads ${HOME}/.midje.clj and ./.midje.clj")
-  (println "(in that order). To affect the default configuration, use")
-  (println "code like this:")
-  (println "    (override-with :visible-deprecation false")
-  (println "                   :visible-future false")
-  (println "                   :print-level :print-namespaces)")
-  (println)
-  (println "You can temporarily override the configuration like this:")
-  (println "    (midje.config/with-augmented-config {:print-level :print-no-summary}")
-  (println "       <forms>...)")
-  (println)
-  (println "------ Configuration keywords")
-  (println ":print-level                  ; Verbosity of printing.")
-  (println "                              ; See `(print-level-help)`")
-  (println)
-  (println ":check-after-creation         ; Should facts be checked as they're loaded?")
-  (println "                              ; Default true.")
-  (println)
-  (println ":visible-deprecation          ; Whether information about deprecated")
-  (println "                              ; features or functions is printed.")
-  (println "                              ; Default true.")
-  (println)
-  (println ":visible-future               ; Whether future facts produce output.")
-  (println "                              ; Default true.")
-  (println "                              ; More: `(guide future-facts)`")
-  (println)
-  (println ":partial-prerequisites        ; Whether the real function can be used.")
-  (println "                              ; Default false.")
-  (println "                              ; More: `(guide partial-prerequisites)`")
-  (println)
-  )
-
+          (println "There is no such topic. Did you mean one of these?")
+          (doseq [topic# (keys guide-topics)]
+            (println "   " topic#)))))
+  ([]
+     `(guide :no-such-topic)))
+
+


spacing

spacing

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/method_configs/launch_analysis.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/method_configs/launch_analysis.cljs
@@ -139,8 +139,8 @@
       {:text "Launch Analysis..."
        :disabled? (:disabled? props)
        :onClick #(modal/push-modal
-                 [Form (select-keys props [:config-id :workspace-id
-                                           :root-entity-type :on-success :cromwell-version])])}])})
+                  [Form (select-keys props [:config-id :workspace-id
+                                            :root-entity-type :on-success :cromwell-version])])}])})

 (defn render-button [props]


add a group field with better default text

--- ssclj/jar/src/com/sixsq/slipstream/ssclj/resources/session_template_internal.clj
+++ ssclj/jar/src/com/sixsq/slipstream/ssclj/resources/session_template_internal.clj
@@ -15,6 +15,7 @@
                        :instance    authn-method
                        :name        "Internal"
                        :description "Internal Authentication via Username/Password"
+                       :group       "Login with Username/Password"
                        :username    "username"
                        :password    "password"
                        :acl         p/resource-acl})


Fixed a small bug in german named-day match for Tuesday - as it was it (#113)

matched every capital "D", leading to many false positives.

--- resources/languages/de/rules/time.clj
+++ resources/languages/de/rules/time.clj
@@ -34,7 +34,7 @@
   (day-of-week 1)

   "named-day"
-  #"(?i)die?nstag|di?\.?"
+  #"(?i)die?nstag|di\.?"
   (day-of-week 2)

   "named-day"


removed enrolled beta from analytics/init-user since its not in use


CIRCLE-718 Allow textarea in admin settings (#1386)

--- src-cljs/frontend/components/admin.cljs
+++ src-cljs/frontend/components/admin.cljs
@@ -327,18 +327,24 @@
              (when (:updating item)
                [:div.loading-spinner common/spinner])]))))

+(defn get-input-box-type [display-type]
+  (case display-type
+    "text" :input.form-control
+    "textarea" :textarea.form-control))
+
 (defn- setting-entry [item owner type]
   (reify
     om/IRender
     (render [_]
-      (let [field-ref (str (:name item) "-input")
+      (let [input-type (get-input-box-type (or (:display_type item) "text"))
+            field-ref (str (:name item) "-input")
             get-field-value #(some->> field-ref
                                       (om/get-node owner)
                                       .-value
                                       type)]
         (html
          [:div.form-group.details
-          [:input.form-control
+          [input-type
            {:type "text"
             :default-value (:value item)
             :ref field-ref}]


Underscores ):

Underscores ):

--- src-cljs/frontend/components/admin.cljs
+++ src-cljs/frontend/components/admin.cljs
@@ -120,10 +120,10 @@
                 (let [container-totals (->> fleet-state
                                           (map #(select-keys % [:free :busy :total]))
                                           (apply merge-with +))
-                    queued-builds (+ (get-in summary-counts [:usage-queue :builds])
-                                     (get-in summary-counts [:run-queue :builds]))
-                    queue-container-count (+ (get-in summary-counts [:usage-queue :containers])
-                                             (get-in summary-counts [:run-queue :containers]))]
+                    queued-builds (+ (get-in summary-counts [:usage_queue :builds])
+                                     (get-in summary-counts [:run_queue :builds]))
+                    queue-container-count (+ (get-in summary-counts [:usage_queue :containers])
+                                             (get-in summary-counts [:run_queue :containers]))]
                 [:div
                  [:div "capacity"
                   [:ul [:li "total containers: " (:total container-totals)]]]


Small typo in warning

Small typo in warning

--- src/adzerk/boot_cljs.clj
+++ src/adzerk/boot_cljs.clj
@@ -23,7 +23,7 @@
       ; org.clojure/clojurescript in project (non-transitive) deps - do nothing
       cljs-dep?    nil
       ; cljs.core on classpath, org.clojure/clojurescript not in project deps
-      cljs-exists? (do (warn "WARNING: No ClojureScript in project dependencies but ClojureScript was found in classpath. Adding direct dependency is adviced.\n") nil)
+      cljs-exists? (do (warn "WARNING: No ClojureScript in project dependencies but ClojureScript was found in classpath. Adding direct dependency is advised.\n") nil)
       ; no cljs on classpath, no project dep, add cljs dep to pod
       :else        ['org.clojure/clojurescript cljs-version])))


Add support for cmd.config args

Add support for cmd.config args

--- src/aerobio/pgmgraph.clj
+++ src/aerobio/pgmgraph.clj
@@ -205,6 +205,32 @@
                     Ins ovec))
           {} edges))

+(defn merge-arg-sets [argcard argset cmdargs]
+  #_(println :MERGE argcard argset cmdargs)
+  (if (or (= argcard {}) (= cmdargs {})
+          (= argcard nil) (= cmdargs nil))
+    (vec argset)
+    (loop [args []
+           argset argset
+           cmdargs cmdargs]
+      (if (not (seq argset))
+        (->> cmdargs (map (fn[[k v]] (if (= 0 (argcard k)) k [k v])))
+             (conj (seq args))
+             flatten #_(filter #(-> % nil? not)) vec)
+        (let [arg (first argset)
+              cnt (inc (argcard arg 0))
+              argval (cmdargs arg)
+              argval (if argval
+                       argval
+                       (when (> cnt 1)
+                         (->> argset (drop 1) (take (dec cnt)))))
+              thearg (cond (= argval :rmv) []
+                           (and argval (> cnt 1)) [arg argval]
+                           :else [arg])]
+          (recur (conj args thearg)
+                 (drop cnt argset)
+                 (dissoc cmdargs arg)))))))
+
 (defn node-graph [graph get-toolinfo inputs args]
   #_(prn :GRAPH graph :INPUTS inputs :ARGS args)
   (let [nodes (->> graph (filter (fn[[k v]] (v :type))) (into {}))
@@ -214,12 +240,16 @@
                    (into {}))
         tools (->> tools
                    (map (fn[[k v]]
-                          (let [{:keys [graph path func src repeat]}
+                          (let [{:keys [graph path func src repeat
+                                        args argcard]}
                                 (get-toolinfo (or (v :name) (v :path)))]
                             [k (merge {:inpipes [], :outpipes []
                                        :id (gensym (or (v :name) (v :path)))
                                        :func func :src src :repeat repeat
-                                       :tool (v :path)} v)])))
+                                       :tool (v :path)}
+                                      v
+                                      {:args (merge-arg-sets
+                                              argcard (v :args) args)})])))
                    (into {}))
         edges (or (graph :edges) {})
         ins (edges->ins edges)


rename internal SQLTemplate to SQLTemplateStatic

--- src/asphalt/internal.clj
+++ src/asphalt/internal.clj
@@ -536,13 +536,13 @@
                                    (.close ^Connection conn))))

-(defrecord SQLTemplate
+(defrecord SQLTemplateStatic
   [^String sql-name ^String sql ^objects param-keys ^bytes param-types ^bytes result-types]
   clojure.lang.Named
   (getName [_] sql-name))

-(defmethod print-method SQLTemplate [^SQLTemplate obj ^Writer w]
+(defmethod print-method SQLTemplateStatic [^SQLTemplateStatic obj ^Writer w]
   (let [m {:name         (.-sql-name obj)
            :sql          (.-sql obj)
            :param-keys   (vec (.-param-keys obj))
@@ -556,17 +556,18 @@
   sql - \"SELECT name, salary FROM emp WHERE salary > ? AND dept = ?\"
   param-pairs - [[:salary :int] [:dept]]
   result-column-types - [:string :int]"
-  ^SQLTemplate [sql-name sql param-pairs result-column-types]
+  ^SQLTemplateStatic [sql-name sql param-pairs result-column-types]
   (when-not (string? sql)
     (expected "SQL string" sql))
   (let [param-keys (map first param-pairs)
         param-types (map second param-pairs)]
-    (->SQLTemplate sql-name sql (object-array param-keys) (byte-array param-types) (byte-array result-column-types))))
+    (->SQLTemplateStatic
+      sql-name sql (object-array param-keys) (byte-array param-types) (byte-array result-column-types))))

 (extend-protocol t/ISqlSource
   ;;=========
-  SQLTemplate
+  SQLTemplateStatic
   ;;=========
   (get-sql    [template] (.-sql template))
   (set-params [template ^PreparedStatement prepared-statement params]


fix bugs in implementation of (new-entries)

--- src/babel/lexiconfn.cljc
+++ src/babel/lexiconfn.cljc
@@ -700,7 +700,7 @@
      (concat
       vals
       (remove fail?
-              (map #(modify-with %)
+              (map #(modify-with (unifyc unify-with %))
                    vals))))))

 (defn if-has [lexicon path value-at-path unify-with]


start on some house cleaning

start on some house cleaning

--- src/block_chain/http.clj
+++ src/block_chain/http.clj
@@ -1,18 +1,11 @@
 (ns block-chain.http
-  (:require [compojure.core :refer :all]
-            [ring.adapter.jetty :as jetty]
-            [block-chain.utils :as utils]
+  (:require [ring.adapter.jetty :as jetty]
             [compojure.api.sweet :as sweet]
             [ring.util.http-response :refer :all]
-            [ring.util.response :refer [response]]
-            [ring.middleware.json :refer [wrap-json-response]]
-            [ring.middleware.keyword-params :refer [wrap-keyword-params]]
             [block-chain.message-handlers :as h]
             [schema.core :as s]
             [block-chain.schemas :refer :all]
             [compojure.route :as route]))
-
-

 (def test-api
   (sweet/api
@@ -78,13 +71,13 @@
                :return {:pong s/Int}
                :body-params [ping :- s/Int]
                :summary "Ping with a timestamp and receive a Pong with a corresponding timestamp"
-               (ok {:pong (:ping (utils/read-json (slurp (:body req))))}))
+               (ok {:pong ping}))

    (sweet/POST "/balance" req
                :return {:message String :payload {:address s/Str :balance s/Int}}
                :body-params [address :- s/Str]
                :summary "Get balance for a given ClarkeCoin address (DER-encoded RSA public key)."
-               (ok (h/handler {:message "get_balance" :payload (:address (utils/read-json (slurp (:body req))) )} {})))
+               (ok (h/handler {:message "get_balance" :payload address} {})))

    (sweet/POST "/blocks" req
                :return {:message String :payload Block}
@@ -100,10 +93,6 @@
    (route/not-found {:status 404 :body {:error "not found"}})
    ))

-(defn json-body [handler]
-  (fn [request]
-    (handler (update request :body (comp utils/read-json slurp)))))
-
 (defonce server (atom nil))

 (defn stop! [] (if-let [server @server] (.stop server)))
@@ -116,37 +105,3 @@
      (reset! server s))))

 (start!)
-
-#_(defroutes my-routes
-  (GET "/blocks" req (response (h/handler {:message "get_blocks" :payload {}} {})))
-  (GET "/peers" req (response (h/handler {:message "get_peers" :payload {}} {})))
-  (GET "/pending_transactions" req (response (h/handler {:message "get_transaction_pool" :payload {}} {})))
-  (GET "/blocks/:block-hash" [block-hash] (response (h/handler {:message "get_block" :payload block-hash} {})))
-  (GET "/latest_block" [] (response (h/handler {:message "get_latest_block" :payload {}} {})))
-  (GET "/block_height" [] (response (h/handler {:message "get_block_height" :payload {}} {})))
-  (GET "/transactions/:txn-hash" [txn-hash] (response (h/handler {:message "get_transaction" :payload txn-hash} {})))
-  (POST "/echo" req (response (h/handler {:message "echo" :payload (:body req)} {})))
-  (POST "/ping" req (response (h/handler {:message "ping" :payload (:body req)} {})))
-  (POST "/balance" req (response (h/handler {:message "get_balance" :payload (:address (:body req) )} {})))
-  (POST "/blocks" req (response (h/handler {:message "submit_block" :payload (:body req)} {})))
-  (POST "/pending_transactions" req (response (h/handler {:message "submit_transaction" :payload (:body req)} {})))
-  (route/not-found "
Page not found
"))
-#_(def app (-> my-routes
-             (json-body)
-             (wrap-json-response)))
-
-;; {"echo" echo X
-;;    "ping" ping X
-;;    "get_peers" get-peers X
-;;    "add_peer" add-peer
-;;    "remove_peer" remove-peer
-;;    "get_balance" get-balance X
-;;    "get_block_height" get-block-height X
-;;    "get_latest_block" get-latest-block X
-;;    "get_transaction_pool" get-transaction-pool X
-;;    "get_blocks" get-blocks X
-;;    "get_block" get-block X
-;;    "get_transaction" get-transaction X
-;;    "submit_transaction" submit-transaction X
-;;    "submit_block" submit-block X
-;;    "generate_payment" generate-payment}


dropping middle path

dropping middle path

--- src/celestial/common.clj
+++ src/celestial/common.clj
@@ -8,7 +8,7 @@

 (def path
   (first (filter #(.exists (file %))
-    ["/etc/celestial/celestial.edn" (<< "~(System/getProperty \"user.home\")/.celestial.edn")])))
+    ["/etc/celestial.edn" (<< "~(System/getProperty \"user.home\")/.celestial.edn")])))

 (def config
    (if path


CLJ-2100 s/nilable form should retain original spec form

Signed-off-by: Stuart Halloway <4dc50fc3bc007be011b5445f3f79298b9eeb51b7@cognitect.com>

--- src/clj/clojure/spec.clj
+++ src/clj/clojure/spec.clj
@@ -1798,7 +1798,7 @@
                [[1 (gen/delay (gen/return nil))]
                 [9 (gen/delay (gensub pred overrides (conj path ::pred) rmap form))]])))
      (with-gen* [_ gfn] (nilable-impl form pred gfn))
-     (describe* [_] `(nilable ~(describe* @spec))))))
+     (describe* [_] `(nilable ~(res form))))))

 (defmacro nilable
   "returns a spec that accepts nil and values satisfying pred"


DRY up inc-and-update-progrss calls

DRY up inc-and-update-progrss calls

--- src/clj_money/import.clj
+++ src/clj_money/import.clj
@@ -156,21 +156,15 @@

 (defmethod process-record :account
   [context account _]
-  (-> context
-      (import-account account)
-      (inc-and-update-progress :account)))
+  (import-account context account))

 (defmethod process-record :transaction
   [context transaction _]
-  (-> context
-      (import-transaction transaction)
-      (inc-and-update-progress :transaction)))
+  (import-transaction context transaction))

 (defmethod process-record :budget
   [context budget _]
-  (-> context
-      (import-budget budget)
-      (inc-and-update-progress :budget)))
+  (import-budget context budget))

 (defmethod process-record :price
   [{:keys [storage entity] :as context} price _]
@@ -181,8 +175,7 @@
                        first)]
     (prices/create storage (-> price
                                (assoc :commodity-id (:id commodity))
-                               (dissoc :exchange :symbol))))
-  (inc-and-update-progress context :price))
+                               (dissoc :exchange :symbol)))))

 (defmethod process-record :commodity
   [{:keys [entity storage] :as context} commodity _]
@@ -202,8 +195,11 @@
   If the record is nil, processing is skipped but
   the progress is updated."
   [context record record-type]
-  (swap! context #(if record
-                    (process-record % record record-type)
+  (swap! context #(cond-> %
+                    record
+                    (process-record record record-type)
+
+                    true
                     (inc-and-update-progress % record-type))))

 (defn import-data


Needs to be quoted

Needs to be quoted

--- src/cljs/go/compiler.clj
+++ src/cljs/go/compiler.clj
@@ -56,7 +56,7 @@
   (if (= "" (str x))
     (emits "(js.RegExp{\"\"})")
     (let [[_ flags pattern] (re-find #"^(?:\(\?([idmsux]*)\))?(.*)" (str x))]
-      (emits "(js.RegExp{\"" (.replaceAll (re-matcher #"/" pattern) "\\\\/") ", " flags "\"}"))))
+      (emits "(js.RegExp{\"" (.replaceAll (re-matcher #"/" pattern) "\\\\/") "\", \"" flags "\"}"))))

 (defn emits-keyword [kw]
   (let [ns   (namespace kw)


Default to export visible version of the name in def

--- src/cljs/go/compiler.clj
+++ src/cljs/go/compiler.clj
@@ -260,10 +260,9 @@
       ;; this change was primarily for REPL interactions - David
       ;(emits " = (typeof " mname " != 'undefined') ? " mname " : undefined")
       (when-not (= :expr (:context env)) (emitln))
-
-      (when export
-        (let [export (last (string/split (str (munge export)) #"\."))]
-          (emitln "var "(str (string/upper-case (subs (str (munge export)) 0 1)) (subs (str (munge export)) 1)) " = " (last (string/split (str mname) #"\."))))))))
+      (let [export (or (and export (last (string/split (str (munge export)) #"\.")))
+                       (last (string/split (str mname) #"\.")))]
+        (emitln "var "(str (string/upper-case (subs (str (munge export)) 0 1)) (subs (str (munge export)) 1)) " = " (last (string/split (str mname) #"\.")))))))

 (defn emit-apply-to
   [{:keys [name params env]}]


Refactor td

Refactor td

--- src/cljs/ufo/client.cljs
+++ src/cljs/ufo/client.cljs
@@ -98,6 +98,11 @@
                 cols)]))))
 (def thead-row (om/factory THeadRow))

+(defn td [row id kw]
+  (let [td-fn (or (kw {:abrev (om/factory TdAbrev {:keyfn :react-key})})
+                  (om/factory Td {:keyfn :react-key}))]
+    (td-fn {:react-key (str id "-" (name kw)) :val (kw row)})))
+
 (defui TBodyRow
   ;; static om/Ident (ident [this {:keys [id]}] [:rows/by-id id])
   ;; static om/IQuery (query [this] '[:id :fname :lname])
@@ -107,11 +112,7 @@
    (let [{:keys [row cols]} (om/props this)
          id (:id row)]
      (html
-      [:tr (map (fn [kw]
-                  (let [td-fn (or (kw {:abrev (om/factory TdAbrev {:keyfn :react-key})})
-                                  (om/factory Td {:keyfn :react-key}))]
-                    (td-fn {:react-key (str id "-" (name kw)) :val (kw row)})))
-                cols)]))))
+      [:tr (map (fn [kw] (td row id kw)) cols)]))))
 (def tbody-row (om/factory TBodyRow))

 (defn will-mount [widget]


Experiment more with meta-errors

Experiment more with meta-errors

--- src/clojush/evaluate.clj
+++ src/clojush/evaluate.clj
@@ -698,6 +698,34 @@
                          (< e (max p1e p2e)) 3
                          (= e (max p1e p2e)) 4
                          :else 5)))
+                (vec (repeat (count (:errors ind)) 5)))
+              #_(if (and (:parent1-errors ind)
+                       (:parent2-errors ind))
+                (vec (for [[e p1e p2e] (mapv #(vector %1 %2 %3)
+                                             (:errors ind)
+                                             (:parent1-errors ind)
+                                             (:parent2-errors ind))]
+                       (cond
+                         (zero? e) 1
+                         (< e (min p1e p2e)) 1
+                         (= e (min p1e p2e)) 2
+                         (< e (max p1e p2e)) 3
+                         (= e (max p1e p2e)) 4
+                         :else 5)))
+                (vec (repeat (count (:errors ind)) 5)))
+              #_(if (and (:parent1-errors ind)
+                       (:parent2-errors ind))
+                (vec (for [[e p1e p2e] (mapv #(vector %1 %2 %3)
+                                             (:errors ind)
+                                             (:parent1-errors ind)
+                                             (:parent2-errors ind))]
+                       (cond
+                         (zero? e) 0
+                         (< e (min p1e p2e)) 1
+                         (= e (min p1e p2e)) 2
+                         (< e (max p1e p2e)) 3
+                         (= e (max p1e p2e)) 5
+                         :else 4)))
                 (vec (repeat (count (:errors ind)) 5)))
               ;
               (= cat :error-neglect)


whitespace.

whitespace.

--- src/cavm/h2.clj
+++ src/cavm/h2.clj
@@ -1211,8 +1211,8 @@
         cache (atom {})
         fetch (fn [rows field] (fetch-rows cache rows (fields field)))]
   (evaluate (apply sorted-set (range N)) {:fetch fetch
-                       :fetch-indexed (partial fetch-indexed fields)
-                       :indexed? (partial has-index? fields)} exp)))
+                                          :fetch-indexed (partial fetch-indexed fields)
+                                          :indexed? (partial has-index? fields)} exp)))

 ;(jdbcd/with-connection @(:db cavm.core/testdb)
 ;   (eval-sql {:select ["sampleID"] :from ["BRCA1"] :where [:in "sampleID"


whitespace.

whitespace.

--- src/cavm/h2.clj
+++ src/cavm/h2.clj
@@ -1181,7 +1181,7 @@
 ; fetch-indexed doesn't cache, and it's unclear
 ; if we should cache the indexed fields during 'restrict'.
 ; h2 also has caches, so it might be better to rely on them,
-; simply doing the query again if we need it.
+; simply doing the query again if we need it.

 ; Otherwise, we might want to inform the cache of what columns are
 ; required later during 'restrict', or in 'project', so


Clean up experimental left-overs.

Clean up experimental left-overs.


Coerce single union to no-op

Coerce single union to no-op

--- src/main/clojure/pigpen/raw.clj
+++ src/main/clojure/pigpen/raw.clj
@@ -273,7 +273,9 @@
 ;; TODO single union -> first relation
 (defn union$
   [ancestors opts]
-  (command :union ancestors (-> ancestors first :fields) opts))
+  (if (= 1 (count ancestors))
+    (first ancestors)
+    (command :union ancestors (-> ancestors first :fields) opts)))

 ;; ********** Join **********


Make button correctly change the :flips-matter?

--- src/constraint/core.cljs
+++ src/constraint/core.cljs
@@ -99,6 +99,15 @@
                       "go auto")
   (update-in world-state [:random?] not))

+
+(defn toggle-flips
+  [world-state]
+  (toggle-button-text :#flips
+                      (:flips-matter? world-state)
+                      "flips matter"
+                      "flips do not matter")
+  (update-in world-state [:flips-matter?] not))
+
 (defn handle-playing [clicked-what world-state]
   (let [clicked-edge? (re-matches #"edge.*" clicked-what)]
     (if clicked-edge?
@@ -108,12 +117,14 @@

 (defn handle-button-click
   [clicked-what world-state]
-  (let [clicked-edit? (re-matches #"edit" clicked-what)
-        clicked-auto? (re-matches #"auto" clicked-what)]
+  (let [clicked-edit?  (re-matches #"edit" clicked-what)
+        clicked-auto?  (re-matches #"auto" clicked-what)
+        clicked-flips? (re-matches #"flips" clicked-what)]
       (cond
-        clicked-edit? (toggle-editing world-state)
-        clicked-auto? (toggle-random world-state)
-        :else         world-state)))
+        clicked-edit?  (toggle-editing world-state)
+        clicked-auto?  (toggle-random world-state)
+        clicked-flips? (toggle-flips world-state)
+        :else          world-state)))

 (defn clicked-button?
@@ -144,17 +155,18 @@

 (defn is-legal?
   [world-state move]
-  (if (:flips-matter? world-state)
-    (and
-     (ok-to-flip? world-state (second move))
-     (pos? (last (second move))))
-    (ok-to-flip? world-state (second move))))
+  (and
+   (ok-to-flip? world-state move)
+   (if (:flips-matter? world-state)
+     (pos? (last move))
+     true)
+   ))

 (defn get-legal-moves
   [world-state]
   (filter
-   (partial is-legal? world-state)
+   (comp (partial is-legal? world-state) second)
    (world-state :edges)))

 (defn get-random-legal-move-name
@@ -209,7 +221,7 @@
 (defn make-flips-matter
   [world-state]
   (merge world-state
-         {:flips-matter? false}))
+         {:flips-matter? true}))

 (defn parse-state


Commented Mikera optimisation placeholder

--- src/cortex/optimise.cljc
+++ src/cortex/optimise.cljc
@@ -121,6 +121,42 @@
    (println "Adadelta constructor with param count has been deprecated")
    (->AdaDelta)))

+;; ==============================================
+;; Mikera optimiser
+;; TODO: complete conversion of algorithm
+
+;(def ^:const MIKERA-DEFAULT-LEARN-RATE 0.01)
+;(def ^:const MIKERA-DEFAULT-DECAY 0.95)
+;
+;(defn mikera-optimiser
+;  "Constructs a new mikera optimiser of the given size (parameter length)"
+;  ([size]
+;    (sgd-optimiser size nil))
+;  ([size {:keys [learn-rate decay] :as options}]
+;    (MikeraOptimiser. (new-mutable-vector size)
+;                      (new-mutable-vector size)
+;                      (new-mutable-vector size)
+;                      (new-mutable-vector size)
+;                      nil
+;                      options)))
+;
+;(defrecord MikeraOptimiser [parameters
+;                            mean-x
+;                            mean-g2
+;                            dx]
+;  cp/PGradientOptimiser
+;    (compute-parameters [this gradient parameters]
+;      (let [learn-rate (double (or (:learn-rate this) MIKERA-DEFAULT-LEARN-RATE))
+;            decay (double (or (:decay this) MIKERA-DEFAULT-DECAY))]
+;
+;        (m/assign! dx parameters)
+;        (m/sub! dx mean-x)
+;
+;        ;; accumulate the latest gradient
+;        (m/add-scaled! dx gradient (* -1.0 learn-rate))
+;
+;        ;; return the updated adadelta record. Mutable gradients have been updated
+;        (assoc this :parameters (m/add parameters dx)))))

 ;; ==============================================
 ;; SGD optimiser with momentum


Removed lein-autodoc plugin

Removed lein-autodoc plugin

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -3,7 +3,6 @@
         :plugins [
             [lein-exec "0.2.0"]
             [lein-swank "1.4.4"]
-            [lein-autodoc "0.9.0"]
             [org.clojure/clojure "1.3.0"]
         ]
     }


matcher-combinators: Improve `explicit-use-of-default-matchers-test`

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_106_matcher_combinators/matcher_generators_test.clj
@@ -130,14 +130,16 @@
 ;;;; ___________________________________________________________________________
 ;;;; ---- Explicit matchers ----

-(deftest explicit-matchers-test
+(deftest explicit-use-of-default-matchers-test
   (testing "Some examples that I think are never needed -- these are the defaults for the data types (TODO: Are there contexts where you would need these?)"
     (is (match? (m/equals 37)
                 (+ 29 8)))
     (is (match? (m/regex #"fox")
                 "The quick brown fox jumps over the lazy dog"))
     (is (match? (m/pred even?)
-                1234))))
+                1234))
+    (is (match? (m/embeds {:a 1})
+                {:a 1 :b 2}))))

 (deftest explicit-use-of-equals-test


Process-whitelist and process-blacklist

Process-whitelist and process-blacklist

--- src/zg/server.clj
+++ src/zg/server.clj
@@ -72,7 +72,21 @@
     (let [params         (:params request)
           word           (get params "word")
           search-results (if (not (empty? word)) (db-interface/read-words-for-pattern word))]
-        (finish-processing request search-results nil title)))
+        (finish-processing request search-results nil title :whitelist)))
+
+(defn process-whitelist
+    [request title]
+    (let [params         (:params request)
+          word           (get params "word")
+          search-results (if (not (empty? word)) (db-interface/read-words-for-pattern word))]
+        (finish-processing request search-results nil title :whitelist)))
+
+(defn process-blacklist
+    [request title]
+    (let [params         (:params request)
+          word           (get params "word")
+          search-results (if (not (empty? word)) (db-interface/read-words-for-pattern word))]
+        (finish-processing request search-results nil title :blacklist)))

 (defn store-word
     [word description user-name]
@@ -293,6 +307,8 @@
             "/smearch.css"       (return-file "smearch.css" "text/css")
             "/bootstrap.min.js"  (return-file "bootstrap.min.js" "application/javascript")
             "/"                  (process-front-page    request title)
+            "/whitelist"         (process-whitelist     request title)
+            "/blacklist"         (process-blacklist     request title)
             "/all-words"         (process-all-words     request title)
             "/deleted-words"     (process-deleted-words request title)
             "/active-words"      (process-active-words  request title)


More convenient db fns

More convenient db fns


move merging of form-render-info outside

--- cljs/src/main/quark/cogs/editor/layouter.cljs
+++ cljs/src/main/quark/cogs/editor/layouter.cljs
@@ -32,7 +32,7 @@
 (defn extract-selectables-from-docs [docs-infos]
   (flatten (map (fn [info] [(:id info) info]) docs-infos)))

-(defn form-layout-info [old-info loc]
+(defn form-layout-info [loc]
   (let [node (zip/node loc)
         analysis (->> {}
                    (analyze-scopes node)
@@ -44,16 +44,14 @@
         tokens (apply hash-map (extract-tokens code-info))
         selectables (apply hash-map (concat (extract-selectables-from-code code-info) (extract-selectables-from-docs docs-info)))]
     (debug-print-analysis node analysis)
-    (merge
-      old-info
-      {:id          (:id node)
-       :text        (zip/string loc)
-       :analysis    analysis
-       :tokens      tokens                                  ; will be used for soup generation
-       :selectables selectables                             ; will be used for selections
-       :skelet      {:code    code-info
-                     :docs    docs-info
-                     :headers headers-info}})))
+    {:id          (:id node)
+     :text        (zip/string loc)
+     :analysis    analysis
+     :tokens      tokens                                    ; will be used for soup generation
+     :selectables selectables                               ; will be used for selections
+     :skelet      {:code    code-info
+                   :docs    docs-info
+                   :headers headers-info}}))

 (defn prepare-top-level-forms [editor]
   (let [tree (:parse-tree editor)
@@ -62,7 +60,7 @@
         right-siblinks (collect-all-right loc)
         old-forms (get-in editor [:render-state :forms])
         find-old (fn [{:keys [id]}] (some #(if (= (:id %) id) %) old-forms))]
-    (map #(form-layout-info (find-old (first %)) %) right-siblinks)))
+    (map #(merge (find-old (first %)) (form-layout-info %)) right-siblinks)))

 (defn analyze-with-delay [editor-id delay]
   (go


fixed #143

fixed #143

--- src/frontend/player.cljs
+++ src/frontend/player.cljs
@@ -48,6 +48,12 @@
   (.resume (:current-sound @app-state/app-state))
   (swap! app-state/app-state assoc :paused? false))

+(defn get-duration []
+  (if (nil? (:current-sound @app-state/app-state))
+    0
+    (.-duration (:current-sound @app-state/app-state))))
+
+
 (defn load-track! [sound-url sound-id on-load-fn]
   (.createSound js/soundManager #js {:id sound-id
                                      :url sound-url
@@ -67,11 +73,13 @@
   (defn on-play []
     (if (nil? position)
       (.setPosition (:current-sound @app-state/app-state) (.-MAX_SAFE_INTEGER js/Number))))
-
+  (println "DURATION" (get-duration))
   (.play (:current-sound @app-state/app-state)
                #js {:whileplaying while-playing
                     :onplay on-play
-                    :from position})
+                    :from (if (> (get-duration) position)
+                            position
+                            (get-duration))})

   (println "POSITION:" position)
   (if (:paused? @app-state/app-state)
@@ -109,11 +117,6 @@
     0
     (.-position (:current-sound @app-state/app-state))))

-(defn get-duration []
-  (if (nil? (:current-sound @app-state/app-state))
-    0
-    (.-duration (:current-sound @app-state/app-state))))
-
 (defn is-sound-loaded? []
   (not (nil? (:current-sound @app-state/app-state))))


simplify

simplify

--- src/hodgepodge/core.cljs
+++ src/hodgepodge/core.cljs
@@ -2,33 +2,16 @@
   (:require [cljs.reader :as reader]))

 (enable-console-print!)
-
-; Storages
+(set! *print-readably* false)

 (def local-storage js/localStorage)
 (def session-storage js/sessionStorage)

-; Serialization & deserialization
+(def serialize pr-str)

-(defmulti serialize type)
-(defmethod serialize :default
-   [v]
-   (str v))
+(def deserialize reader/read-string)

-(defmethod serialize js/Date
-  [date]
-  (str {:type :js/date
-        :value (.toString date)}))
-
-(defmulti deserialize (comp :type reader/read-string))
-(defmethod deserialize :js/date
-  [v]
-  (let [{:keys [value]} (reader/read-string  v)]
-    (js/Date.  (.parse js/Date value))))
-
-(defmethod deserialize :default
-  [v]
-  (reader/read-string v))
+(defn clear! [storage] (.clear storage))

 (extend-type js/Storage
   ICounted
@@ -58,9 +41,7 @@
          not-found)))
 )

-(defn clear! [storage] (.clear storage))
-
-(comment
+ (comment
   (clear! local-storage)
   (clear! session-storage)

@@ -80,4 +61,14 @@
   (assert (= 1 (count local-storage)))
   (assert (contains? local-storage {:foo :bar}))
   (assert (= 0 (count session-storage)))
+
+  (def val {:bar 42 :timestamp {:bar (js/Date.) :baz :safd :frob #{1 2 3}}})
+  (assoc! local-storage :foo val)
+  (assert (= val (get local-storage :foo)))
+
+  (assoc! local-storage val :foo)
+  (assert (= :foo (get local-storage val)))
+
+  (def date (js/Date.))
+  (assoc! local-storage :date date)
 )


include onyx.api require

include onyx.api require

--- src/leiningen/new/onyx_app/src/onyx_app/jobs/sample_submit_job.clj
+++ src/leiningen/new/onyx_app/src/onyx_app/jobs/sample_submit_job.clj
@@ -6,7 +6,8 @@
               [{{app-name}}.tasks.file-input :refer [add-seq-file-input]]
               [{{app-name}}.lifecycles.sample-lifecycle :refer [add-logging add-metrics build-lifecycles]]
               [{{app-name}}.workflows.sample-workflow :refer [build-workflow]]
-              [aero.core :refer [read-config]]))
+              [aero.core :refer [read-config]]
+              [onyx.api]))

 ;;;;
 ;; Lets build a job


CMR-2412: Fixing dependencies for access control.

--- access-control-app/project.clj
+++ access-control-app/project.clj
@@ -5,11 +5,8 @@
    :cmr-transmit-lib "0.1.0-SNAPSHOT"
    :cmr-elastic-utils-lib "0.1.0-SNAPSHOT"
    :cmr-message-queue-lib "0.1.0-SNAPSHOT"
-   :cmr-common-app-lib "0.1.0-SNAPSHOT"})
-
-(def dev-projects
-  "A map of development time projects to their versions"
-  {:cmr-metadata-db-app "0.1.0-SNAPSHOT"
+   :cmr-common-app-lib "0.1.0-SNAPSHOT"
+   :cmr-metadata-db-app "0.1.0-SNAPSHOT"
    :cmr-mock-echo-app "0.1.0-SNAPSHOT"})

 (defn project-map->dependencies
@@ -37,7 +34,7 @@
                            [ring/ring-json "0.4.0"]]
                            ;; Temporarily fix broken build. The dev-projects depenedencies should
                            ;; not be overall depenedencies
-                         (project-map->dependencies (merge projects dev-projects)))
+                         (project-map->dependencies (merge projects projects)))
   :plugins [[lein-test-out "0.3.1"]
             [lein-shell "0.4.0"]
             [lein-exec "0.3.4"]]


show more from the callback error

show more from the callback error

--- src/bzzz/core.clj
+++ src/bzzz/core.clj
@@ -74,7 +74,7 @@
                      (try
                        (async/>!! c (jr body))
                        (catch Throwable e
-                         (async/>!! c {:exception (ex-str e)})))))
+                         (async/>!! c {:exception (str status headers error (ex-str e))})))))
         resolved (peer-resolve (first part))]
     (log/trace "<" input "> in part <" part "> to resolved <" resolved ">")
     (try


Add console logging to loader.

Add console logging to loader.

--- src/cavm/core.clj
+++ src/cavm/core.clj
@@ -81,19 +81,33 @@
   (server/start port {:mode :dev
                       :ns 'cavm}))

+(defn- timefn [fn]
+  (with-out-str (time (fn))))
+
+(defn- load-tsv-report [file]
+  (try
+    (load-tsv-file file)
+    (catch java.lang.Throwable e
+      (binding [*out* *err*]
+        (println "Error loading file" file)
+        (throw e)))))  ; XXX should show traceback and continue
+
 (defn- loadfiles [args]
   (when (not (> (count args) 0))
     (println "Usage\nload <filename>")
     (System/exit 0))

   ; Skip files outside the designated path, which for now is CWD.
-  (let [in-path (group-by in-data-path args)]
-    (when (in-path false)
+  (let [{in-path true, not-in-path false} (group-by in-data-path args)]
+    (when not-in-path
       (binding [*out* *err*]
         (println "These files are outside the CAVM data path and will not be served:")
         (println (string/join "\n" (in-path false)))))
     (create)
-    (dorun (map load-tsv-file (in-path true)))))
+    (println "Loading " (count in-path) " file(s)")
+    (dorun (map #(do (print %2 %1 "") (time (load-tsv-report %1)))
+                in-path
+                (range (count in-path) 0 -1)))))

 (def ^:private argspec
   [["-s" "Start web server" :flag true :default false]


adds integration test to verify service-id changes when defaults are specified explicitly (#401)

--- waiter/integration/waiter/basic_test.clj
+++ waiter/integration/waiter/basic_test.clj
@@ -36,6 +36,19 @@
           (make-request-with-debug-info
             {:x-waiter-name (rand-name)}
             #(make-kitchen-request waiter-url % :path "/hello"))]
+
+      (testing "explicitly specifying default parameter resolves to different service"
+        (let [{:keys [service-description-defaults]} (waiter-settings waiter-url)
+              request-headers (walk/stringify-keys request-headers)]
+          (doseq [[k v] service-description-defaults]
+            (let [parameter-key (str "x-waiter-" (name k))]
+              (when-not (or (contains? request-headers parameter-key)
+                            (map? v)
+                            (vector? v))
+                (let [new-request-headers (assoc request-headers parameter-key v)
+                      new-service-id (retrieve-service-id waiter-url new-request-headers)]
+                  (is (not= service-id new-service-id)
+                      (str {:new-parameter [k v] :request-headers request-headers}))))))))

       (testing "secrun"
         (log/info (str "Basic test using endpoint: /secrun"))


guard for null pointer exception

guard for null pointer exception

--- sidecar/src/figwheel_sidecar/core.clj
+++ sidecar/src/figwheel_sidecar/core.clj
@@ -333,8 +333,10 @@
   (send-message! st :compile-warning { :message msg }))

 (defn initial-check-sums [state]
-  (doseq [df (dependency-files state)]
-    (file-changed? state df))
+  (when (and (:output-dir state)
+             (:output-to state))
+    (doseq [df (dependency-files state)]
+      (file-changed? state df)))
   (:file-md5-atom state))


:ring-handler to remember var, not value

--- sidecar/src/figwheel_sidecar/core.clj
+++ sidecar/src/figwheel_sidecar/core.clj
@@ -453,7 +453,7 @@
   (when ring-handler (require (symbol (namespace (symbol ring-handler)))))
   (assoc opts :ring-handler
          (when ring-handler
-           (eval (symbol ring-handler)))))
+           (resolve (symbol ring-handler)))))

 (defn start-server
   ([] (start-server {}))


Enable to specify number of threads on command

--- src/cljam/cli.clj
+++ src/cljam/cli.clj
@@ -172,12 +172,15 @@
 ;; ### index command

 (def ^:private index-cli-options
-  [["-h" "--help"]])
+  [["-t" "--thread THREAD" "Number of threads (0 is auto)"
+    :default 0
+    :parse-fn #(Integer/parseInt %)]
+   ["-h" "--help"]])

 (defn- index-usage [options-summary]
   (->> ["Index sorted alignment for fast random access."
         ""
-        "Usage: cljam index <in.bam>"
+        "Usage: cljam index [-t THREAD] <in.bam>"
         ""
         "Options:"
         options-summary]
@@ -190,7 +193,7 @@
      (not= (count arguments) 1) (exit 1 (index-usage summary))
      errors (exit 1 (error-msg errors)))
     (let [f (first arguments)]
-      (bai/create-index f (str f ".bai"))))
+      (bai/create-index f (str f ".bai") :n-threads (:thread options))))
   nil)

 ;; ### pileup command


remove :lei and :lei from semantics of reflexive pronoun "si"

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -1828,12 +1828,10 @@
               ;; masculine singular
               {:synsem {:agr {:person :3rd
                               :gender :masc
-                              :number :sing}
-                        :sem {:pred :lui}}}
+                              :number :sing}}}
               ;; plural: unspecified gender
               {:synsem {:agr {:person :3rd
-                              :number :plur}
-                        :sem {:pred :loro}}}])
+                              :number :plur}}}])

    "sistemare" {:synsem {:cat :verb
                          :sem {:pred :organize}}}


added pred go-upstairs to salire

added pred go-upstairs to salire

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -1764,16 +1764,16 @@
                           :comparative false
                           :physical-object true
                           :human false}}})
-
-   "salire"
-    {:italiano {:italiano "salire"
-                :essere true
-                :present {:1sing "salgo"
-                          :3plur "salgono"}}
-     :synsem {:cat :verb
-              :essere true
-              :sem {:subj {:animate true}
-                    :pred :get-on}}}
+
+   "salire" (let [common {:synsem {:cat :verb}
+                                   :essere true
+                                   :sem {:subj {:animate true}}
+                          :italiano {:italiano "salire"
+                                     :present {:1sing "salgo"
+                                               :3plur "salgono"}}}]
+             [(merge common {:synsem {:sem {:pred :get-on}}})
+              (merge common {:synsem {:sem {:pred :go-upstairs}}})])
+

    "scappare"  {:synsem {:cat :verb
                          :sem {:pred :escape}}}


fix display of example input

fix display of example input

--- src/babel/italiano/workbook.clj
+++ src/babel/italiano/workbook.clj
@@ -191,7 +191,7 @@
       [:div.hints
        [:h3 "Try:"]
        [:div "(expr X)"]
-       [:div "(parse 'I speak')"]
+       [:div "(parse \"io parlo\")"]

        ]


adding upmap

adding upmap

--- src/flax/core.clj
+++ src/flax/core.clj
@@ -24,6 +24,13 @@
               (for [[k v] (System/getenv)]
                 [(keyword k) v]))))
 (def logger (ClojureToolsLogger.))
+
+
+(defn upmap
+  [fn coll]
+  (doall
+    (for [p (doall (map #(future (fn %)) coll))]
+      @p)))

 (defn bool?
@@ -369,7 +376,7 @@
                 (if (nil? yield)
                   (recur (drop 1 args))
                   yield))))
-
+
           ;; Functions
           (let [yield (apply (resolve fun) (evaluate (-> m first val) config))]
             (if (coll? yield)
@@ -426,12 +433,13 @@
         exit (when-let [main (:main program)]
                (doall (pmap #(evaluate % config) main)))]
     (println "before destroying all nodes")
-    (doall
-      (pmap
-        (fn [[k n]]
-          (when (-> @(:node n) :options :destroy-on-exit true?)
-            (destroy n)))
-        @(-> config :node-manager :nodes)))
+    (doseq [f (remove nil?
+                (map
+                  (fn [[k n]]
+                    (when (-> @(:node n) :options :destroy-on-exit true?)
+                      (future (destroy n))))
+                  @(-> config :node-manager :nodes)))]
+      @f)
     exit
     ))


Adding posh to views

Adding posh to views

--- src/catalysis/client/views.cljs
+++ src/catalysis/client/views.cljs
@@ -1,5 +1,6 @@
 (ns catalysis.client.views
-  (:require [catalysis.client.ws :as socket]))
+  (:require [catalysis.client.ws :as socket]
+            [posh.core :as posh]))

 ;; TODO build application view here


update run position if Parasite trashes ICE during a run

--- src/clj/game/cards-programs.clj
+++ src/clj/game/cards-programs.clj
@@ -440,7 +440,8 @@
                            (when (get-in card [:special :installing])
                              (update! state side (update-in card [:special] dissoc :installing))
                              (trigger-event state side :runner-install card))
-                           (trash state side target))
+                           (trash state side target)
+                           (trash-ice-in-run state))
               :msg (msg "trash " (:title target))}}}

    "Paricia"


remove all automation from Pawn

remove all automation from Pawn

--- src/clj/game/cards-programs.clj
+++ src/clj/game/cards-programs.clj
@@ -457,26 +457,32 @@
    {:recurring 2}

    "Pawn"
-   {:abilities [{:prompt "Host Pawn on the outermost ICE of a central server" :cost [:click 1]
+   {:abilities [{:label "Host Pawn on the outermost ICE of a central server"
+                 :prompt "Host Pawn on the outermost ICE of a central server" :cost [:click 1]
                  :choices {:req #(and (ice? %)
                                       (= (last (:zone %)) :ices)
-                                      (some #{:hq :rd :archives} (rest (butlast (:zone %)))))}
+                                      (is-central? (second (:zone %))))}
                  :msg (msg "host it on " (card-str state target))
-                 :effect (effect (host target card))}]
-    :events {:successful-run
-             {:req (req (ice? card))
-              :effect (req (let [i (ice-index state (:host card))
-                                 nextice (when (> i 0) (nth (get-in @state
-                                                            (vec (concat [:corp] (:zone (:host card))))) (dec i)))]
-                             (if (pos? i)
-                               (host state side nextice card)
-                               (do (resolve-ability state side
-                                     {:prompt "Choose a Caïssa program to install from your Grip or Heap"
-                                      :show-discard true
-                                      :choices {:req #(and (has-subtype? % "Caïssa")
-                                                           (#{[:hand] [:discard]} (:zone %)))}
-                                      :effect (effect (runner-install target {:no-cost true}))} card nil)
-                                    (trash state side card)))))}}}
+                 :effect (effect (host target card))}
+                {:label "Advance to next ICE"
+                 :prompt "Choose the next innermost ICE to host Pawn on it"
+                 :choices {:req #(and (ice? %)
+                                      (= (last (:zone %)) :ices)
+                                      (is-central? (second (:zone %))))}
+                 :msg (msg "host it on " (card-str state target))
+                 :effect (effect (host target card))}
+                {:label "Trash Pawn and install a Caïssa from your Grip or Heap, ignoring all costs"
+                 :effect (req (let [this-pawn (:cid card)]
+                                (resolve-ability
+                                  state side
+                                  {:prompt "Choose a Caïssa program to install from your Grip or Heap"
+                                   :show-discard true
+                                   :choices {:req #(and (has-subtype? % "Caïssa")
+                                                        (not= (:cid %) this-pawn)
+                                                        (#{[:hand] [:discard]} (:zone %)))}
+                                   :msg (msg "install " (:title target))
+                                   :effect (effect (runner-install target {:no-cost true}))} card nil)
+                                (trash state side card)))}]}

    "Pheromones"
    {:recurring (req (when (< (get card :rec-counter 0) (:counter card))


Wrap guts of main function in `document-ready`

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/main.cljs
+++ src/cljs/cljs_nusmods/main.cljs
@@ -394,95 +394,97 @@
 ; Main entry point of the program
 (defn ^:export init []
   ; Globals
-  (let [$document     ($ js/document)
-        $window       ($ js/window)
-        MODULES       (aget js/window "MODULES")]
-
-    (aset js/window "Exhibit3_Initialized" false)
-    (aset js/window "Exhibit3_Loaded" false)
-    (aset js/window "ActiveTab" TIMETABLE-TAB-INDEX)
-    (aset js/window "ModulesMap" (build-timetable-module-map MODULES))
-
-    ; initialize `WEEK-TEXT-ARRAY`
-    (timetable/set-WEEK-TEXT-ARRAY! (aget MODULES "weekText"))
-    ; initialize `EXAM-DATE-ARRAY`
-    (timetable/set-EXAM-DATE-ARRAY! (aget MODULES "examDates"))
-
-    ; Initialize timetable
-    (timetable/timetable-create!)
-
-    ; Iniialize Select2
-    (select2/init-select2-element select2/$Select2-Box)
-    (init-dom-clear-modules select2/$Select2-Box)
-
-    (one $document "scriptsLoaded.exhibit"
-         (fn []
-           (aset js/window "Exhibit3_Loaded" true)))
-
-    ; Code for tabs
-    (hide ($ :#module-finder))
-    (.click ($ :#module-finder-tab-link)
-            (fn []
-              (if (not MODULE-FINDER-SCRIPTS-STARTED-DL?)
-                  (do
-                    (set! MODULE-FINDER-SCRIPTS-STARTED-DL? true)
-                    (done ($when (getScript "js/auxmodinfo.js")
-                                  (getScript "js/vendor/exhibit3-all.min.js")
-                                  ($deferred (fn [deferred]
-                                               ($ (resolve deferred nil)))))
-                          (fn []
-                            (set! MODULE-FINDER-SCRIPTS-DLED? true)))))
-              (if (and (not (aget js/window "Exhibit3_Initialized"))
-                       (nil? INITIALIZE-EXHIBIT3-INTERVAL-VAL))
-                (set! INITIALIZE-EXHIBIT3-INTERVAL-VAL
-                      (js/setInterval check-and-initialize-exhibit3 1000)))
-              (hide ($ :#timetable-builder))
-              (show ($ :#module-finder))
-              (.removeClass (parent ($ :#timetable-builder-tab-link)) "active")
-              (.addClass (parent ($ :#module-finder-tab-link)) "active")
-              (aset js/window "ActiveTab" MODULEFINDER-TAB-INDEX)
-              (select2/shift-select2-container-to "timetable-builder-controls"
-                                                  "module-finder-sidebar")))
-
-    (.click ($ :#timetable-builder-tab-link)
-            timetable-builder-tab-click-handler)
-
-    ; Add module lesson groups from the hash of the url
-    (let [urlHash (aget (aget js/document "location") "hash")]
-      (if (and (not (empty? urlHash))
-               (= (first urlHash) "#")
-               (> (.-length urlHash) 1))
-          (timetable/add-module-lesson-groups-from-url-hash!
-            (.substring urlHash 1))))
-
-    ; Add click event handler for `Add` module buttons on Module Finder page
-    (.on ($ "body")
-         "click"
-         ".add-module-btn"
-         (fn [evt]
-           (prevent evt)
-           (this-as this
-                    (let [$this        ($ this)
-                          moduleCode   (.data $this "module-code")
-                          qtipContent  (timetable/add-module! moduleCode)
-
-                          tooltip
-                          (.qtip $this
-                                 (js-obj "content"   qtipContent
-                                         "overwrite" true
-
-                                         ; show qtip immediately
-                                         "show"      (js-obj "ready" true)
-
-                                         ; dont hide the qtip
-                                         "hide"      (js-obj "event" false)
-
-                                         "position"
-                                         (js-obj "my" "bottom center"
-                                                 "at" "top center"
-                                                 "viewport" $window)))
-
-                          api          (.qtip tooltip "api")]
-                      ; destroy qTip after 2s.
-                      ; For some reason this works even if we set a new qTip
-                      (js/setTimeout (fn [] (.destroy api)) 2000)))))))
+  (document-ready
+    (fn []
+      (let [$document     ($ js/document)
+            $window       ($ js/window)
+            MODULES       (aget js/window "MODULES")]
+
+        (aset js/window "Exhibit3_Initialized" false)
+        (aset js/window "Exhibit3_Loaded" false)
+        (aset js/window "ActiveTab" TIMETABLE-TAB-INDEX)
+        (aset js/window "ModulesMap" (build-timetable-module-map MODULES))
+
+        ; initialize `WEEK-TEXT-ARRAY`
+        (timetable/set-WEEK-TEXT-ARRAY! (aget MODULES "weekText"))
+        ; initialize `EXAM-DATE-ARRAY`
+        (timetable/set-EXAM-DATE-ARRAY! (aget MODULES "examDates"))
+
+        ; Initialize timetable
+        (timetable/timetable-create!)
+
+        ; Iniialize Select2
+        (select2/init-select2-element select2/$Select2-Box)
+        (init-dom-clear-modules select2/$Select2-Box)
+
+        (one $document "scriptsLoaded.exhibit"
+             (fn []
+               (aset js/window "Exhibit3_Loaded" true)))
+
+        ; Code for tabs
+        (hide ($ :#module-finder))
+        (.click ($ :#module-finder-tab-link)
+                (fn []
+                  (if (not MODULE-FINDER-SCRIPTS-STARTED-DL?)
+                      (do
+                        (set! MODULE-FINDER-SCRIPTS-STARTED-DL? true)
+                        (done ($when (getScript "js/auxmodinfo.js")
+                                      (getScript "js/vendor/exhibit3-all.min.js")
+                                      ($deferred (fn [deferred]
+                                                   ($ (resolve deferred nil)))))
+                              (fn []
+                                (set! MODULE-FINDER-SCRIPTS-DLED? true)))))
+                  (if (and (not (aget js/window "Exhibit3_Initialized"))
+                           (nil? INITIALIZE-EXHIBIT3-INTERVAL-VAL))
+                    (set! INITIALIZE-EXHIBIT3-INTERVAL-VAL
+                          (js/setInterval check-and-initialize-exhibit3 1000)))
+                  (hide ($ :#timetable-builder))
+                  (show ($ :#module-finder))
+                  (.removeClass (parent ($ :#timetable-builder-tab-link)) "active")
+                  (.addClass (parent ($ :#module-finder-tab-link)) "active")
+                  (aset js/window "ActiveTab" MODULEFINDER-TAB-INDEX)
+                  (select2/shift-select2-container-to "timetable-builder-controls"
+                                                      "module-finder-sidebar")))
+
+        (.click ($ :#timetable-builder-tab-link)
+                timetable-builder-tab-click-handler)
+
+        ; Add module lesson groups from the hash of the url
+        (let [urlHash (aget (aget js/document "location") "hash")]
+          (if (and (not (empty? urlHash))
+                   (= (first urlHash) "#")
+                   (> (.-length urlHash) 1))
+              (timetable/add-module-lesson-groups-from-url-hash!
+                (.substring urlHash 1))))
+
+        ; Add click event handler for `Add` module buttons on Module Finder page
+        (.on ($ "body")
+             "click"
+             ".add-module-btn"
+             (fn [evt]
+               (prevent evt)
+               (this-as this
+                        (let [$this        ($ this)
+                              moduleCode   (.data $this "module-code")
+                              qtipContent  (timetable/add-module! moduleCode)
+
+                              tooltip
+                              (.qtip $this
+                                     (js-obj "content"   qtipContent
+                                             "overwrite" true
+
+                                             ; show qtip immediately
+                                             "show"      (js-obj "ready" true)
+
+                                             ; dont hide the qtip
+                                             "hide"      (js-obj "event" false)
+
+                                             "position"
+                                             (js-obj "my" "bottom center"
+                                                     "at" "top center"
+                                                     "viewport" $window)))
+
+                              api          (.qtip tooltip "api")]
+                          ; destroy qTip after 2s.
+                          ; For some reason this works even if we set a new qTip
+                          (js/setTimeout (fn [] (.destroy api)) 2000)))))))))


Add category coloring

Add category coloring

--- src/cljs/clojure_rest/core.cljs
+++ src/cljs/clojure_rest/core.cljs
@@ -14,9 +14,10 @@

 (defn create-card
   "Create a card to display in the dash-board"
-  [title description status & tasks]
+  [title description category status & tasks]
   {:title title
    :description description
+   :category category
    :status status
    :tasks (into [] tasks)})

@@ -28,6 +29,13 @@
     :done "Done"
     :else "Unknown"))

+(defn category->color
+  [category]
+  (condp = category
+    :bug-fix "#BD8D31"
+    :enhancement "#3A7E28"
+    :else "#eee"))
+
 (defn filter-by-status
   [status cards]
   (filter #(= status (:status %)) cards))
@@ -38,21 +46,25 @@
   [(create-card
      "1st card"
      "This is my first description"
+     :bug-fix
      :backlog
      (create-task "Done some stuff" true))
    (create-card
      "2nd card"
      "This is my second description"
+     :enhancement
      :under-dev
      (create-task "Done some stuff" true)
      (create-task "Done some more stuff" false))
    (create-card
      "3nd card"
      "This is my third description"
+     :bug-fix
      :under-dev)
    (create-card
      "4th card"
      "This is my fourth description"
+     :enhancement
      :done)])

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -71,6 +83,12 @@
    [:ul (map render-task tasks)]
   ])

+(defn card-side-color
+  [card]
+  {:position "absolute" :zindex -1 :top 0 :bottom 0 :left 0 :width 7
+   :backgroundColor (-> card :category category->color)
+  })
+
 (defn render-card
   []
   (let [show-details (r/atom false)
@@ -78,6 +96,7 @@
         title-style #(if % :div.card__title--is-open :div.card__title)]
     (fn [card]
       [:div.card
+       [:div {:style (card-side-color card)}]
        [(title-style @show-details) {:on-click toggle-details} (:title card)]
        (when @show-details
          [:div.card__details


update messages data structure

update messages data structure

--- src/cljs/minimal_chat/core.cljs
+++ src/cljs/minimal_chat/core.cljs
@@ -96,7 +96,8 @@
   (fn [db [_ username message chat-room]]
     (m/conj-in! fb-root [(-> chat-room (str/lower-case) (keyword))
                          :messages]
-                [username message])
+                {:username username
+                 :message message})
     db))

 ;; -- View Components -------
@@ -121,6 +122,13 @@
               :on-change #(reset! message (-> % .-target .-value))}]
      [:button {:type "submit"} "Send"]]))

+(defn show-messages []
+  [:div#messages
+   (for [[[k v] index] (map vector (take-last 30 @messages) (range))]
+     ^{:key (str "message-" index)}
+     (let [{:keys [username message]} v]
+       [:div [:span.username username] ": " [:span.message message]]))])
+
 ;; -- Views -----------------

 (defn on-going-chat []
@@ -128,10 +136,7 @@
    [:label "Your username: "]
    [username-input]

-   [:div#messages
-    (for [[message index] (map vector (take-last 30 @messages) (range))]
-      ^{:key (str "message-" index)}
-      [:div [:span.username (first message) ": "] [:span.message (second message)]])]
+   [show-messages]

    [message-form]])


fix namespace

fix namespace

--- src/gol/core.cljs
+++ src/gol/core.cljs
@@ -1,4 +1,4 @@
-(ns quil-cljs-demo.core
+(ns gol.core
   (:require [quil.core :as q :include-macros true]
             [quil.middlewares.fun-mode :refer [fun-mode]]))


Make room intro list things in the room.

--- src/isla/talk.clj
+++ src/isla/talk.clj
@@ -37,7 +37,16 @@
 (defn room-intro [room connected-rooms]
   (str "You are in the " (:name room) ". "
        (:summary room) " "
-       (list-rooms connected-rooms)))
+       (list-things (:items room)
+                    "There are no items in this room."
+                    "You can see "
+                    "You can see "
+                    "a") " "
+       (list-things connected-rooms
+                    "There is no way out of this room."
+                    "You can see a door to"
+                    "You can see doors to"
+                    "the")))

 (defn room-already [name] (str "You are already in the " name "."))
 (defn room-not-allowed [name] (str "You cannot go into the " name "."))


Fix error when sidebar is not rendered

Fix error when sidebar is not rendered

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/method_config_editor.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/method_config_editor.cljs
@@ -257,9 +257,11 @@
         :canned-response {:responseText (utils/->json-string (build-mock-config (:config props)))
                           :status 200 :delay-ms (rand-int 2000)}})
      (set! (.-onScrollHandler this)
-       (fn [] (let [visible (common/is-in-view (.getDOMNode (@refs "sidebar")))]
-                (when-not (= visible (:sidebar-visible? @state))
-                  (swap! state assoc :sidebar-visible? visible)))))
+           (fn []
+             (when-let [sidebar (@refs "sidebar")]
+               (let [visible (common/is-in-view (.getDOMNode sidebar))]
+                 (when-not (= visible (:sidebar-visible? @state))
+                   (swap! state assoc :sidebar-visible? visible))))))
      (.addEventListener js/window "scroll" (.-onScrollHandler this)))
    :component-will-unmount
    (fn [{:keys [this]}]


CMR-6221 added comments for fields

CMR-6221 added comments for fields

--- common-app-lib/src/cmr/common_app/services/search/query_model.clj
+++ common-app-lib/src/cmr/common_app/services/search/query_model.clj
@@ -229,10 +229,23 @@
   [])

 (defrecord MatchCondition
-  [field value])
+  [
+    ;; The field being searched
+    field
+
+    ;; The value of the field
+    value])

 (defrecord MatchFilterCondition
-  [field value filter])
+  [
+    ;; The field being searched
+    field
+
+    ;; The value of the field
+    value
+
+    ;; A filter condition for the match.
+    filter])

 (defrecord RelatedItemQueryCondition
   [


unused fn

unused fn

--- src/kvm/disks.clj
+++ src/kvm/disks.clj
@@ -35,13 +35,8 @@
        (element :path {} file)
        (element :format {:type type} nil))))

-(defn create-clone-with-backing-store []
-
-  )
-
 (defn clone-name [name idx]
   (str name "-" (str idx) ".qcow2"))
-

 (defn clone-disks [c name root]
   (let [volumes  (map-indexed vector (map (partial into-volume c) (get-disks root)))]


CMR-2939 remove some debug logging

CMR-2939 remove some debug logging

--- dev-system/src/cmr/dev_system/system.clj
+++ dev-system/src/cmr/dev_system/system.clj
@@ -157,8 +157,6 @@

 (defmethod create-echo :external
   [type]
-  (error "will start mock echo on port: " (transmit-config/mock-echo-port))
-
   (transmit-config/set-echo-rest-port! external-echo-port)
   (transmit-config/set-echo-system-token! (external-echo-system-token))
   (transmit-config/set-echo-rest-context! "/echo-rest"))


Fix phases of square bar and phrase oscillators.

--- src/afterglow/effects/oscillators.clj
+++ src/afterglow/effects/oscillators.clj
@@ -168,8 +168,8 @@
   (fn [^afterglow.rhythm.MetronomeSnapshot snapshot]
     (let [reached (adjust-phase (rhythm/snapshot-bar-phase snapshot bar-ratio) phase)]
       (if (< reached width)
-        0.0
-        1.0))))
+        1.0
+        0.0))))

 (defn square-phrase
   "Returns an oscillator which generates a square wave relative to the phase
@@ -186,8 +186,8 @@
   (fn [^afterglow.rhythm.MetronomeSnapshot snapshot]
     (let [reached (adjust-phase (rhythm/snapshot-phrase-phase snapshot phrase-ratio) phase)]
       (if (< reached width)
-        0.0
-        1.0))))
+        1.0
+        0.0))))

 (defn sine-beat
   "Returns an oscillator which generates a sine wave relative to the phase


Remove unused code as part of M002 release.

--- src/app/clj/one/sample/dev_server.clj
+++ src/app/clj/one/sample/dev_server.clj
@@ -95,21 +95,3 @@
   "Start the development server on port 8080."
   []
   (run-jetty (var app) {:join? false :port 8080}))
-
-(defn cljs-repl
-  "Start a ClojureScript REPL which can connect to the development
-  version of the application. The REPL will not work until the
-  development page connects to it, so you will need to either open or
-  refresh the development page after calling this function."
-  []
-  (repl (repl-env)))
-
-(comment
-  ;; One.Sample.the server.
-  (use 'one.sample.dev-server :reload-all)
-  (run-server)
-  ;; Start a REPL.
-  (cljs-repl)
-  ;; Don't forget to open the development page, or refresh it if it's
-  ;; already open, or the REPL won't work
-  )


Ring middleware: `rmj/wrap-json-params` then `rmj/wrap-json-body`

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_800_web/ss_020_ring.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_800_web/ss_020_ring.clj
@@ -43,7 +43,7 @@
 ;;;; ---- Single wrappings ----

 (facts "Single wrappings"
-
+
   (fact "`rmp/wrap-params`"
     ((-> identity-handler
          rmp/wrap-params)
@@ -56,7 +56,7 @@
                              "q2" "b"}
               :params       {"q1" "a"
                              "q2" "b"}}))
-
+
   (fact "`rmj/wrap-json-params`"
     ((-> identity-handler
          rmj/wrap-json-params)
@@ -94,29 +94,22 @@
                            :q2 "b"}}))

 ;;;; ___________________________________________________________________________
+;;;; ---- `rmj/wrap-json-params` then `rmj/wrap-json-body` ----

-;;;; TODO
+(fact "`rmj/wrap-json-params` then `rmj/wrap-json-body` is no good"
+  ((-> identity-handler
+       rmj/wrap-json-body
+       rmj/wrap-json-params)
+   (make-my-request))
+  => (just {:headers      {"content-type" "application/json; charset=utf-8"}
+            :query-string "q1=a&q2=b"
+            :body         nil ; Not what I'd want
+            :json-params  {"user" "Fred"}
+            :params       {"user" "Fred"}}))

-;;;; From MPS:
+;;;; ___________________________________________________________________________

-(def mps-middlewares
-  [#(rmj/wrap-json-body %
-                        {:keywords? true
-                         :bigdecimals? true})
-   rmj/wrap-json-response
-   rmp/wrap-params
-   rmk/wrap-keyword-params])
-
-;;;; From minimal-clojure-service
-
-(defn minimal-clojure-service-handler
-  [routes]
-  (cm/wrap-canonical-redirect
-   (-> routes
-       (cc/wrap-routes rmj/wrap-json-params)
-       (cc/wrap-routes rmj/wrap-json-response)
-       (cc/wrap-routes rmp/wrap-params)
-       (cc/wrap-routes rmk/wrap-keyword-params))))
+;;;; TODO Still need to revisit the following.

 ;;;; ___________________________________________________________________________
 ;;;; ---- rmj/wrap-json-response ----


Ring stuff: Get rid of `json->request`

Ring stuff: Get rid of `json->request`

--- test/com/nomistech/clojure_the_language/c_800_libraries/s_800_web/ss_020_ring.clj
+++ test/com/nomistech/clojure_the_language/c_800_libraries/s_800_web/ss_020_ring.clj
@@ -4,6 +4,12 @@
             [ring.middleware.json :refer [wrap-json-body
                                           wrap-json-response]]
             [ring.util.response :refer [response]]))
+
+;;;; ___________________________________________________________________________
+
+;;;; NOTES
+;;;; - In requests, "content-type: must be lower case, but `wrap-json-response`
+;;;;   produces "Content-Type". WTF?

 ;;;; ___________________________________________________________________________
 ;;;; ---- Request test helpers ----
@@ -14,14 +20,6 @@
    (-> s
        (.getBytes encoding)
        (java.io.ByteArrayInputStream.))))
-
-;; NOTES
-;; - content-type must be lower case.
-;;   - but `wrap-json-response` produces "Content-Type". WTF?
-
-(defn json->request [string]
-  {:headers {"content-type" "application/json; charset=utf-8"}
-   :body (string->stream string)})

 ;;;; ___________________________________________________________________________
 ;;;; ---- wrap-json-response ----
@@ -62,7 +60,8 @@
       :body "Uploaded 'Fred'."})

 (fact "Wrapped handler with request whose body is JSON"
-  (app-002 (json->request "{\"user\":\"Fred\"}"))
+  (app-002 {:headers {"content-type" "application/json; charset=utf-8"}
+            :body (string->stream "{\"user\":\"Fred\"}")})
   => {:status 200
       :headers {}
       :body "Uploaded 'Fred'."})


Fix datomic project URL

Fix datomic project URL

--- modules/datomic/project.clj
+++ modules/datomic/project.clj
@@ -2,7 +2,7 @@

 (defproject juxt.modular/datomic "0.2.1"
   :description "A modular extension that provides support for Datomic"
-  :url "https://github.com/juxt/modular/tree/master/modules/bidi"
+  :url "https://github.com/juxt/modular/tree/master/modules/datomic"
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
   :dependencies [[prismatic/schema "0.2.1"]


#21 - Started bucket object delete implementation.

--- src/biblecli/commands/bucketsync.cljs
+++ src/biblecli/commands/bucketsync.cljs
@@ -15,13 +15,12 @@
 (ns biblecli.commands.bucketsync
   (:require-macros [cljs.core.async.macros :refer [go]])
   (:require [cljs.core.async :refer [to-chan chan put! tap mult <!]]
-            [cljs.nodejs :refer [require]]
+            [cljs.nodejs :refer [require process]]
             [clojure.string :as s]))

-(def AWS (js/require "aws-sdk"))
-(def fs (js/require "fs"))
-(def path (js/require "path"))
-(def process js/process)
+(def AWS (require "aws-sdk"))
+(def fs (require "fs"))
+(def path (require "path"))

 (defn readdir [dir]
   (let [chan (chan)
@@ -123,24 +122,45 @@
         (filter (fn [[_ _ etag]] (not= etag :notfound)))
         (vec))])

+(defn delete-files [s3 onlyremote delete whatif verbose]
+  (go
+    (println onlyremote)
+    (let [parts (partition-all 1000 onlyremote)]
+      (loop [part (first parts)
+             next (rest parts)]
+        (if (not part)
+          [nil true]
+          (do
+            (doseq [key part]
+              (println (str (if whatif "Whatif: " "") "Deleting '" key "' from remote bucket.")))
+            (recur (first next) (rest next))))))))
+
+(defn copy-files [s3 onlylocal whatif]
+  (go))
+
+(defn update-files-if-changed [s3 filelist whatif force verbose]
+  (go))
+
 (defn bucketsync
   {:summary "Synchronize a remote Amazon S3 bucket with a local asset directory."
-   :doc "usage: biblecli bucketsync [--force] [-f] [--whatif] [--bucket <bucket>] [--region <region>] [--profile <profile>] <dir>
+   :doc "usage: biblecli bucketsync [--force] [-f] [--whatif] [--delete] [--verbose] [--bucket <bucket>] [--region <region>] [--profile <profile>] <dir>
    -f,
    --force               Upload all files, changed and unchanged, generally to refresh the http headers.
    --whatif              Print bucket changes that would be made without actually making changes.
+   --delete              Remote files that do not exist locally will be deleted.
+   --verbose             Print verbose status messages.
    --bucket <bucket>     S3 bucket id. Defaults to kingjames-beta.
    --region <region>     S3 region. Defaults to us-east-1.
    --profile <profile>   S3 credentials profile. Uses the default profile if not specified.
    <dir>                 Source asset directory."
    :async true
-   :cmdline-opts {:boolean ["force" "whatif"]
+   :cmdline-opts {:boolean ["force" "whatif" "delete" "verbose"]
                   :string ["bucket" "region" "profile"]
-                  :alias {:force "f"}
+                  :alias {:force "f" :verbose "v"}
                   :default {:bucket "kingjames-beta"
                             :region "us-east-1"
                             :profile "default"}}}
-  [{dir :_ force :force whatif :whatif bucket :bucket region :region profile :profile}]
+  [{dir :_ force :force whatif :whatif delete :delete bucket :bucket region :region profile :profile verbose :verbose}]
   (go
     (if (not= (count dir) 1)
       ["<dir> parameter required." nil]
@@ -149,13 +169,18 @@
             s3ObjectsTask (s3-list-objects s3)
             filesTask (readdir-recursive dir)
             [err1 s3keys] (<! s3ObjectsTask)
-            [err2 files] (<! filesTask)]
-        (cond
-          err1 [err1 nil]
-          err2 [err2 nil]
-          :else
-            (let [[onlyremote onlylocal both] (partition-files s3keys files)]
-              (println "Remote: " (s/join onlyremote " | "))
-              (println "Local: " (s/join onlylocal " | "))
-              (println "Both: " (s/join both " | "))
-              [nil true]))))))+            [err2 files] (<! filesTask)
+            firstErr (or err1 err2)]
+        (if firstErr
+          [firstErr nil]
+          (let [[onlyremote onlylocal both] (partition-files s3keys files)
+                deleteTask (delete-files s3 onlyremote delete whatif verbose)
+                copyTask (copy-files s3 onlylocal whatif)
+                updateTask (update-files-if-changed s3 both whatif force verbose)
+                [deleteErr _] (<! deleteTask)
+                [copyErr _] (<! copyTask)
+                [updateErr _] (<! updateTask)
+                firstErr (or deleteErr copyErr updateErr)]
+            (if firstErr
+              [firstErr nil]
+              [nil true])))))))


refine trans update

refine trans update

--- src/clj_money/models/transactions.clj
+++ src/clj_money/models/transactions.clj
@@ -132,6 +132,7 @@
   (cond-> item
     true (update-in [:value] #(or % (:amount item)))
     true (assoc :balance (bigdec 0))
+    true (update-in [:index] (fnil identity (Integer/MAX_VALUE)))
     (string? (:account-id item)) (update-in [:account-id] #(Integer. %))
     (nil? (:id item)) (dissoc :id)
     (and
@@ -737,10 +738,13 @@
                                                       (map #(get-previous-item storage %)))

               ; current items
-              _ (doseq [item (:items validated)]
-                  (upsert-item storage (before-save-item item)))
-
-              current-base-items (->> (:items validated)
+              upserted-items (mapv #(as-> % i
+                                      (assoc i :transaction-id (:id validated))
+                                      (before-save-item i)
+                                      (upsert-item storage i))
+                                   (:items validated))
+
+              current-base-items (->> upserted-items
                                       (map (fn [current-item]
                                              (let [existing-item (some #(= (:id %) (:id current-item))(:items existing))]
                                                (if (> 0 (compare (:transaction-date current-item)
@@ -756,8 +760,7 @@
                                                    dereferenced-account-id-base-items))

               ; update the transaction record itself
-              updated (update-transaction storage validated)
-              ]
+              updated (update-transaction storage validated)]
           (reload storage validated)))

         #_(let [dereferenced-base-items (process-removals


add previous end-of-period for rec. form

--- src/clj_money/web/reconciliations.clj
+++ src/clj_money/web/reconciliations.clj
@@ -58,10 +58,17 @@
         [:div.col-md-4
          (date-input-field reconciliation :end-of-period {:autofocus true})
          [:div.form-group
+          [:label.control-label {:for :end-of-previous-period} "End of prev. period"]
+          [:input.form-control {:name :end-of-previous-period
+                                :value (when last-completed
+                                         (util/format-date (:end-of-period last-completed)))
+                                :disabled true}]]
+         [:div.form-group
           [:label.control-label {:for :previous-balance} "Previous balance"]
           [:input.form-control {:name :previous-balance
                                 :value (util/format-number previous-balance)
                                 :disabled true}]]
+         [:div.form-group
           [:label.control-label {:for :reconciled-balance} "Reconciled balance"]
           [:input.form-control {:name :reconciled-balance
                                 :value (util/format-number
@@ -69,7 +76,7 @@
                                            0M
                                            (+ previous-balance
                                               reconciled-item-total)))
-                                :disabled true}]
+                                :disabled true}]]
          (number-input-field reconciliation :balance)
          [:input.btn.btn-primary {:type :submit
                                   :name :submit