fix News Team to be forfeitable and fire from R&D

--- src/clj/game/cards-assets.clj
+++ src/clj/game/cards-assets.clj
@@ -340,15 +340,15 @@
     :effect (effect (set-prop card :rec-counter (:link runner)))}

    "News Team"
-   {:access {:req (req (not= (first (:zone card)) :deck))
-             :msg (msg "give the Runner 2 tags or -1 agenda points")
+   {:access {:msg (msg "give the Runner 2 tags or -1 agenda point")
              :effect (effect (resolve-ability
                                {:player :runner
-                                :prompt "Take 2 tags or take News Team as -1 agenda points?"
-                                :choices ["take 2 tags" "add News Team to score area"]
-                                :effect (req (if (= target "add News Team to score area")
-                                                 (do (gain state :runner :agenda-point -1)
-                                                     (move state :runner card :scored nil))
+                                :prompt "Take 2 tags or take News Team as -1 agenda point?"
+                                :choices ["Take 2 tags" "Add News Team to score area"]
+                                :effect (req (if (= target "Add News Team to score area")
+                                                 (do (as-agenda state :runner card -1)
+                                                     (system-msg state :runner
+                                                       (str "adds News Team to their score area as -1 agenda point")))
                                                  (tag-runner :runner 2)))}
                                card targets))}}


Fixed typos

Fixed typos

--- src/clj_calendar/calendar.clj
+++ src/clj_calendar/calendar.clj
@@ -85,8 +85,8 @@

 (defn format-time
     "Format given date using the following date/time format: 'HH:mm:ss'"
-    [caleldar]
-    (format-date-using-desired-format cal "HH:mm:ss"))
+    [calendar]
+    (format-date-using-desired-format calendar "HH:mm:ss"))

 (defn format-date-time
     "Format given date using the following date/time format: 'yyyy-MM-dd HH:mm:ss'"


Formatting and whitespace fixes.

Formatting and whitespace fixes.

--- src/clj_ravendb/responses.clj
+++ src/clj_ravendb/responses.clj
@@ -5,27 +5,21 @@
   [{:keys [body status]}]
   (let [results (body "Destinations")
         mapped (map (fn[i] (i "Url")) results)]
-    {
-     :status status
-     :results mapped
-     }))
+    {:status status
+     :results mapped}))

 (defn load-documents
   [{:keys [body status]}]
   (let [results (body "Results")
         mapped (map (fn
-                      [col]
+                      [col]
                       (let [metadata (col "@metadata")]
-                        {
-                         :key (metadata "@id")
-                         :doc (into {}
+                        {:key (metadata "@id")
+                         :doc (into {}
                                     (for[[k v] (dissoc col "@metadata")]
-                                      [(keyword k) v]))
-                         })) results)]
-    {
-     :status status
-     :results mapped
-     }))
+                                      [(keyword k) v]))})) results)]
+    {:status status
+     :results mapped}))

 (defn bulk-operations
   [{:keys [status]}]
@@ -44,14 +38,11 @@
   (let [results (body "Results")
         stale? (body "IsStale")
         mapped (map (fn
-                      [col]
+                      [col]
                       (let [metadata (col "@metadata")]
-                        (into {}
+                        (into {}
                               (for[[k v] (dissoc col "@metadata")]
-                                [(keyword k) v]))
-                        )) results)]
-    {
-     :status status
+                                [(keyword k) v])))) results)]
+    {:status status
      :stale? stale?
-     :results mapped
-     }))+     :results mapped}))


see if this helps

see if this helps

--- src/cljs/moon/components.cljs
+++ src/cljs/moon/components.cljs
@@ -129,7 +129,7 @@
                                                      :class "total-workout"
                                                      :min 0
                                                      :max 1
-                                                     :now (/ (- (:total-duration data)
+                                                     :now 1 #_(/ (- (:total-duration data)
                                                                 (:remaining data))
                                                              (:total-duration data))}))))


link to Mythbuilder's guide

link to Mythbuilder's guide

--- src/cljs/netrunner/about.cljs
+++ src/cljs/netrunner/about.cljs
@@ -38,7 +38,11 @@
        [:p "My PayPal account is mtgred@gmail.com. Contributions are appreciated and will help financing faster servers."]]
       [:li
        [:h4 "What is the best supported browser?"]
-       [:p "Google Chrome on a desktop/laptop is recommended. Firefox and Safari should work fine too."]]]
+       [:p "Google Chrome on a desktop/laptop is recommended. Firefox and Safari should work fine too."]]
+      [:li
+       [:h4 "Is there some documenation on how to use the jinteki.net?"]
+       [:p "A "
+        [:a {:href "https://mythbuilder.wordpress.com/2015/03/25/the-definitive-guide-to-netiquette-on-jinteki-net-wip/" :target "_blank"} "guide"] " has been written by Mythbuilder." ]]]

      [:h3 "Disclaimer"]
      [:p "Netrunner and Android are trademarks of Fantasy Flight Publishing, Inc. and/or Wizards of the Coast LLC."]


Don't use comms in api-event

Don't use comms in api-event

--- src-cljs/frontend/controllers/api.cljs
+++ src-cljs/frontend/controllers/api.cljs
@@ -296,11 +296,15 @@
   (if (empty? (:resp args))
     ;; this is the last api request, update the loading flag.
     (assoc-in state state/github-repos-loading-path false)
-    ;; otherwise trigger a fetch for the next page, and return the state
-    ;; with the items we got here added.
+    ;; Add the items on this page of results to the state.
+    (update-in state state/repos-path #(into % (:resp args)))))
+
+(defmethod post-api-event! [:github-repos :success]
+  [target message status args previous-state current-state comms]
+  (when-not (empty? (:resp args))
+    ;; fetch the next page
     (let [page (-> args :context :page)]
-      (api/get-github-repos (get-in state [:comms :api]) :page (inc page))
-      (update-in state state/repos-path #(into % (:resp args))))))
+      (api/get-github-repos (:api comms) :page (inc page)))))

 (defmethod api-event [:github-repos :failed]
   [target message status {:keys [status-code]} state]
@@ -671,10 +675,11 @@

 (defmethod api-event [:stop-building-project :success]
   [target message status {:keys [resp context]} state]
-  (let [updated-state
-        (update-in state state/projects-path (fn [projects] (remove #(= (:project-id context) (project-model/id %)) projects)))]
-    (put! (get-in state [:comms :nav]) [:navigate! {:path (routes/v1-dashboard)}])
-    updated-state))
+  (update-in state state/projects-path (fn [projects] (remove #(= (:project-id context) (project-model/id %)) projects))))
+
+(defmethod post-api-event! [:stop-building-project :success]
+  [target message status args previous-state current-state comms]
+  (put! (:nav comms) [:navigate! {:path (routes/v1-dashboard)}]))

 (defn org-selectable?
   [state org-name vcs-type]


revising copy for rebuilding flash notification

--- src-cljs/frontend/controllers/api.cljs
+++ src-cljs/frontend/controllers/api.cljs
@@ -832,7 +832,7 @@
   (let [{:keys [reponame ref-name]} context]
     (state/add-flash-notification
      state
-     (gstring/format "We are rebuilding %s %s now." reponame ref-name))))
+     (gstring/format "Rebuilding %s %s..." reponame ref-name))))

 (defmethod post-api-event! [:retry-build :success]
   [target message status {:keys [resp context] :as args} previous-state current-state comms]


Handle when :exposure value is nil.

Handle when :exposure value is nil.

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

--- acqEngine/src/org/micromanager/sequence_generator.clj
+++ acqEngine/src/org/micromanager/sequence_generator.clj
@@ -54,7 +54,7 @@
              (or (apply = s)
                  (and (core isPropertySequenceable d p)
                       (<= (count s) (core getPropertySequenceMaxLength d p)))))))
-    (apply == (map :exposure channels))))
+    (apply = (map :exposure channels))))

 (defn select-triggerable-sequences [property-sequences]
   (into (sorted-map)


fix route

fix route

--- src/cljs/tumblrsearch/components/header.cljs
+++ src/cljs/tumblrsearch/components/header.cljs
@@ -46,7 +46,7 @@
         {:onClick (fn [e]
                     (.preventDefault e)
                     (.setToken (om/get-state owner :history)
-                               (str "search/" query))
+                               (str "/search/" query))
                     (new-search data ajax-chan query)
                     )} "Search")
       (when (= (:current-state data) :loading) (dom/h2 "Loading"))


[#389] typo tennant -> tenant (#390)

[#389] typo tennant -> tenant (#390)

--- backend/src/org/akvo/lumen/transformation/engine.clj
+++ backend/src/org/akvo/lumen/transformation/engine.clj
@@ -90,67 +90,67 @@
    - \"op\" : operation to perform
    - \"args\" : map with arguments to the operation
    - \"onError\" : Error strategy"
-  (fn [tennant-conn table-name columns op-spec]
+  (fn [tenant-conn table-name columns op-spec]
     (keyword (get op-spec "op"))))

 (defmethod apply-operation :default
-  [tennant-conn table-name columns op-spec]
+  [tenant-conn table-name columns op-spec]
   {:success? false
    :message (str "Unknown operation " (get op-spec "op"))})

 (defmethod apply-operation :core/to-titlecase
-  [tennant-conn table-name columns op-spec]
-  (db-to-titlecase tennant-conn {:table-name table-name
+  [tenant-conn table-name columns op-spec]
+  (db-to-titlecase tenant-conn {:table-name table-name
                                  :column-name (get-column-name op-spec)})
   {:success? true
    :columns columns})

 (defmethod apply-operation :core/to-lowercase
-  [tennant-conn table-name columns op-spec]
-  (db-to-lowercase tennant-conn {:table-name table-name
+  [tenant-conn table-name columns op-spec]
+  (db-to-lowercase tenant-conn {:table-name table-name
                                  :column-name (get-column-name op-spec)})
   {:success? true
    :columns columns})

 (defmethod apply-operation :core/to-uppercase
-  [tennant-conn table-name columns op-spec]
-  (db-to-upercase tennant-conn {:table-name table-name
-                                :column-name (get-column-name op-spec)})
+  [tenant-conn table-name columns op-spec]
+  (db-to-upercase tenant-conn {:table-name table-name
+                               :column-name (get-column-name op-spec)})
   {:success? true
    :columns columns})

 (defmethod apply-operation :core/trim
-  [tennant-conn table-name columns op-spec]
-  (db-trim tennant-conn {:table-name table-name
-                         :column-name (get-column-name op-spec)})
+  [tenant-conn table-name columns op-spec]
+  (db-trim tenant-conn {:table-name table-name
+                        :column-name (get-column-name op-spec)})
   {:success? true
    :columns columns})

 (defmethod apply-operation :core/trim-doublespace
-  [tennant-conn table-name columns op-spec]
-  (db-trim-double tennant-conn {:table-name table-name
-                                :column-name (get-column-name op-spec)})
+  [tenant-conn table-name columns op-spec]
+  (db-trim-double tenant-conn {:table-name table-name
+                               :column-name (get-column-name op-spec)})
   {:success? true
    :columns columns})

 (defmethod apply-operation :core/sort-column
-  [tennant-conn table-name columns op-spec]
+  [tenant-conn table-name columns op-spec]
   (let [col-name (get-column-name op-spec)
         idx-name (str table-name "_" col-name)
         new-cols (column-metadata-operation columns op-spec)]
-    (db-create-index tennant-conn {:index-name idx-name
-                                   :column-name col-name
-                                   :table-name table-name})
+    (db-create-index tenant-conn {:index-name idx-name
+                                  :column-name col-name
+                                  :table-name table-name})
     {:success? true
      :columns new-cols}))

 (defmethod apply-operation :core/remove-sort
-  [tennant-conn table-name columns op-spec]
+  [tenant-conn table-name columns op-spec]
   (let [col-name (get-column-name op-spec)
         idx-name (str table-name "_" col-name)
         new-cols (column-metadata-operation columns op-spec)]
-    (db-drop-index tennant-conn {:index-name idx-name})
+    (db-drop-index tenant-conn {:index-name idx-name})
     {:success? true
      :columns new-cols}))

@@ -162,12 +162,12 @@

 (defmethod apply-operation :core/change-datatype
-  [tennant-conn table-name columns op-spec]
+  [tenant-conn table-name columns op-spec]
   (let [new-cols (column-metadata-operation columns op-spec)]
     (try
-      (let [result (db-change-data-type tennant-conn {:table-name table-name
-                                                      :args (get op-spec "args")
-                                                      :on-error (get op-spec "onError")})
+      (let [result (db-change-data-type tenant-conn {:table-name table-name
+                                                     :args (get op-spec "args")
+                                                     :on-error (get op-spec "onError")})
             exec-log (vec (:lumen_change_data_type result))]
         {:success? true
          :execution-log exec-log


:tada: Add :project-file query.

:tada: Add :project-file query.

--- backend/src/uxbox/services/queries/project_files.clj
+++ backend/src/uxbox/services/queries/project_files.clj
@@ -22,9 +22,7 @@
 (s/def ::project-id ::us/uuid)
 (s/def ::user ::us/uuid)

-;; --- Query: Project Files
-
-(def ^:private sql:project-files
+(def ^:private sql:generic-project-files
   "select pf.*,
           array_agg(pp.id) as pages
      from project_files as pf
@@ -32,10 +30,15 @@
     inner join project_users as pu on (p.id = pu.project_id)
      left join project_pages as pp on (pf.id = pp.file_id)
     where pu.user_id = $1
-      and pu.project_id = $2
       and pu.can_edit = true
     group by pf.id
-    order by pf.created_at asc;")
+    order by pf.created_at asc")
+
+;; --- Query: Project Files
+
+(def ^:private sql:project-files
+  (str "with files as (" sql:generic-project-files ")"
+       " select * from files where project_id = $2"))

 (s/def ::project-files
   (s/keys :req-un [::user ::project-id]))
@@ -45,6 +48,20 @@
   (-> (db/query db/pool [sql:project-files user project-id])
       (p/then' (partial mapv decode-row))))

+;; --- Query: Project File (By ID)
+
+(def ^:private sql:project-file
+  (str "with files as (" sql:generic-project-files ")"
+       " select * from files where id = $2"))
+
+(s/def ::project-file
+  (s/keys :req-un [::user ::id]))
+
+(sq/defquery ::project-file
+  [{:keys [user id] :as params}]
+  (-> (db/query-one db/pool [sql:project-file user id])
+      (p/then' decode-row)))
+
 ;; --- Helpers

 (defn decode-row


CMR-5659: Added logging of number of variables whose fingerprints are updated/verified on provider level.

--- bootstrap-app/src/cmr/bootstrap/data/fingerprint.clj
+++ bootstrap-app/src/cmr/bootstrap/data/fingerprint.clj
@@ -52,7 +52,7 @@
 (defn- fingerprint-by-provider
   "Update the fingerprints of variables of the given provider if necessary."
   [system provider]
-  (info "Updating fingerprints of variables for provider: " (:provider-id provider))
+  (info "Updating fingerprints of variables for provider" (:provider-id provider))
   (let [db (helper/get-metadata-db-db system)
         {:keys [provider-id]} provider
         params {:concept-type :variable
@@ -61,9 +61,15 @@
                                                                 provider
                                                                 params
                                                                 (find-variables-sql provider-id)
-                                                                (:db-batch-size system))]
-    (dorun
-     (pmap #(fingerprint-variable-batch db provider %) variable-batches))))
+                                                                (:db-batch-size system))
+        num-variables (reduce (fn [num batch]
+                                (fingerprint-variable-batch db provider batch)
+                                (+ num (count batch)))
+                              0
+                              variable-batches)]
+    (info (format "Updated fingerprints of %d variable(s) for provider %s"
+                  num-variables provider-id))
+    (info (format "Updating fingerprints of variables for provider %s completed." provider-id))))

 (defn- fingerprint-by-provider-id
   "Update the fingerprints of variables for the given provider id if necessary."


Add utils for working w/ artifacts DNS

Add utils for working w/ artifacts DNS

--- backend/src/circle/backend/nodes/circle_artifact.clj
+++ backend/src/circle/backend/nodes/circle_artifact.clj
@@ -11,7 +11,9 @@
    [pallet.crate.automated-admin-user :as automated-admin-user]
    [pallet.crate.git :as git]
    [pallet.crate.ssh-key :as ssh-key]
-   [pallet.thread-expr :as thread-expr]))
+   [pallet.thread-expr :as thread-expr])
+  (:require circle.dns)
+  (:require [circle.backend.ec2 :as ec2]))

 (def circle-artifact-group
   (pallet.core/group-spec
@@ -23,4 +25,9 @@
                       :security-groups ["artifacts-server"]
                       :username "ubuntu"
                       :public-key (slurp "www.id_rsa.pub")
-                      :private-key (slurp "www.id_rsa")}))+                      :private-key (slurp "www.id_rsa")}))
+
+(defn update-dns
+  "Updates the DNS record for artifacts.circle.com to point at the given instance id"
+  [instance-id]
+  (circle.dns/update-record {:name "artifacts.circleci.com."} {:value (ec2/public-ip instance-id)}))


Only get exposure from channels when they are there!

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

--- acqEngine/src/org/micromanager/sequence_generator.clj
+++ acqEngine/src/org/micromanager/sequence_generator.clj
@@ -341,7 +341,7 @@
                                       triggers position-index]
   (let [numChannels (max 1 (count channels))
         numFrames (max 1 numFrames)
-        exposure (if (pos? numChannels)
+        exposure (if-not (empty? channels)
                    (:exposure (first channels))
                    default-exposure)
         events
@@ -365,7 +365,8 @@
                     :channel (get channels c)
                     :slice-index 0
                     :metadata (make-channel-metadata (get channels c))))))]
-    ;(println "events:" events)
+    ;(println "events:" events "channels:" channels)
+    ;(println "default-exposure" default-exposure)
     (lazy-seq
       (list
         (assoc (first events)
@@ -391,7 +392,7 @@
         num-positions (count positions)
         property-sequences (make-property-sequences (map :properties channels))]
     (cond
-      (and (< 1 numFrames)
+      (and ;(< 1 numFrames)
            (or time-first
                (> 2 num-positions))
            (> 2 (count slices))


sql config parser fix

sql config parser fix

--- src/clj_hypergraph_db/sql_parser/sql_config_parser.clj
+++ src/clj_hypergraph_db/sql_parser/sql_config_parser.clj
@@ -5,36 +5,43 @@
 (defn database
   [type & metadata]
   (def-item :database
-    :metadata metadata))
+            :metadata metadata))

 (defn default-credentials
   [database-name user-name password]
   (def-item :credentials
-    :database-name database-name
-    :user-name user-name
-    :password password))
+            :database-name database-name
+            :user-name user-name
+            :password password))

 (defn table
   [table-name table-definition & columns]
   (def-item :table
-    :table-name table-name :table-definition table-definition :columns columns))
+            :table-name table-name
+            :table-definition table-definition
+            :columns columns))

 (defn column
   [column-name column-definition & flags]
   (def-item :column
-    :column-name column-name :column-definition column-definition :flags flags))
+            :column-name column-name
+            :column-definition column-definition
+            :flags flags))

 (defn relation
   [relation-name relation-definition between-tables reffering-columns]
   (def-item :relation
-    :relation-name relation-name :relation-definition relation-definition :between between-tables :reffering reffering-columns))
+            :relation-name relation-name
+            :relation-definition relation-definition
+            :between between-tables
+            :reffering reffering-columns))

 (defn between
   [between-tables]
   (def-item :between-tables
-    between-tables))
+            :betbetween-tables between-tables))

 (defn referring
   [reffering-columns]
   (def-item :reffering-columns
-    reffering-columns))+            :referring-columns reffering-columns))


fix backend route pattern

fix backend route pattern

--- src/cljs/swarmpit/component/service/form_settings.cljs
+++ src/cljs/swarmpit/component/service/form_settings.cljs
@@ -23,7 +23,7 @@
 (defn registry-tags-handler
   [registry repository]
   (handler/get
-    (routes/path-for-backend :repository-tags {:registry registry})
+    (routes/path-for-backend :registry-repository-tags {:registry registry})
     {:params     {:repository repository}
      :on-success (fn [response]
                    (reset! tags response))}))


[#2437] Refactor

[#2437] Refactor

--- backend/test/akvo/lumen/lib/transformation_test.clj
+++ backend/test/akvo/lumen/lib/transformation_test.clj
@@ -449,7 +449,6 @@
         (is (= tag ::lib/ok))
         (is (every? number? (map :d4 (latest-data dataset-id))))))

-
     (testing "derive to number column"
       (let [[tag res] (apply-transformation {:type :transformation
                                              :transformation
@@ -460,10 +459,7 @@
                                                                   ::transformation.engine.s/onError "fail"})})]
         (is (= tag ::lib/ok))
         (is (every? number? (map :d5 (latest-data dataset-id))))))
-
-
-
-
+
     (testing "Valid type check"
       (let [[tag _ status] (apply-transformation {:type :transformation
                                                   :transformation
@@ -513,7 +509,6 @@
                                                                 ::transformation.derive.s/newColumnType "text"
                                                                 ::transformation.engine.s/onError "fail"})})]
         (is (= tag ::lib/bad-request))))
-

     (testing "Disallow anonymous functions"
       (let [[tag _] (apply-transformation {:type :transformation


Clarify that env isn't used

Clarify that env isn't used

--- src/desdemona/launcher/launch_prod_peers.clj
+++ src/desdemona/launcher/launch_prod_peers.clj
@@ -14,7 +14,7 @@
   (let [n-peers (Integer/parseInt n)
         {:keys [peer-config env-config]} (utils/read-config!)
         peer-group (onyx.api/start-peer-group peer-config)
-        env (onyx.api/start-env env-config)
+        _ (onyx.api/start-env env-config)
         peers (onyx.api/start-peers n-peers peer-group)]
     (println "Connecting to Zookeeper: " (:zookeeper/address peer-config))
     (utils/add-shutdown-hook! (fn []


Use atom to hold the ref to proc-fn.

Use atom to hold the ref to proc-fn.

--- src/dsbdp/local_data_processing_pipeline.clj
+++ src/dsbdp/local_data_processing_pipeline.clj
@@ -153,18 +153,19 @@

 (defn create-local-processing-element
-  ([^BlockingQueue in-queue proc-fn]
-    (create-local-processing-element in-queue proc-fn nil))
-  ([^BlockingQueue in-queue proc-fn id]
+  ([^BlockingQueue in-queue initial-proc-fn]
+    (create-local-processing-element in-queue initial-proc-fn nil))
+  ([^BlockingQueue in-queue initial-proc-fn id]
     (let [running (atom true)
           out-queue (create-queue)
           out-counter (Counter.)
           out-drop-counter (Counter.)
+          proc-fn (atom initial-proc-fn)
           handler-fn (fn []
                        (try
                          (let [^LocalTransferContainer c (take-from-queue in-queue)
                                new-out (if (not (nil? c))
-                                         (proc-fn (.getIn c) (.getOut c)))]
+                                         (@proc-fn (.getIn c) (.getOut c)))]
                            (when (not (nil? new-out))
                              (.setOut c new-out)
                              (enqueue out-queue c out-counter out-drop-counter)))


Bring back test cases, now failing

Bring back test cases, now failing

--- test/graphql_clj/parser_test.clj
+++ test/graphql_clj/parser_test.clj
@@ -34,6 +34,53 @@
     (doseq [{:keys [result]} (schema-parser-tests "test/scenarios/cats/validation/DefaultValuesOfCorrectType.yaml")]
       (is (= :passes result)))))

+(def type-fields-kv-example
+  "type Hello {
+     world(flag: Boolean = true): String!
+     this: Int
+   }")
+
+(def input-type-fields-kv-example
+  "input Hello {
+    world: String!
+    this: Int
+   }")
+
+(def variable-kv-example
+  "query WithDefaultValues(
+     $a: Int = 1,
+     $b: String! = \"ok\",
+     $c: ComplexInput = { requiredField: true, intField: 3 }) {
+       dog { name }
+     }")
+
+(deftest parse-kv-pairs
+  (testing "we can convert type-fields to a map"
+    (is (= (-> (parser/parse type-fields-kv-example) :type-system-definitions first :fields)
+           [{:node-type :type-field
+             :field-name "world"
+             :type-name "String"
+             :required true
+             :arguments [{:node-type :type-field-argument
+                          :argument-name "flag"
+                          :type-name "Boolean"
+                          :default-value true}]}
+            {:node-type :type-field
+             :field-name "this"
+             :type-name "Int"}])))
+  (testing "we can convert input-type-fields to a map"
+      (is (= (-> (parser/parse input-type-fields-kv-example) :type-system-definitions first :fields)
+             [{:node-type :input-type-field
+               :field-name "world"
+               :type-name "String"
+               :required true}
+              {:node-type :input-type-field :field-name "this" :type-name "Int"}])))
+  (testing "we can convert variables to a map"
+      (is (= (-> (parser/parse variable-kv-example) :operation-definitions first :variable-definitions)
+             [{:node-type :variable-definition :variable-name "a" :type-name "Int" :default-value 1}
+              {:node-type :variable-definition :variable-name "b" :type-name "String" :required true :default-value "ok"}
+              {:node-type :variable-definition :variable-name "c" :type-name "ComplexInput" :default-value {"requiredField" true "intField" 3}}]))))
+
 ;;;;; Test Helpers for visualizing the parsed tree ;;;;;

 (defn render-parsed! [to-filename parsed-data]


Fix to swagger-ui

Fix to swagger-ui

--- dev/src/yada/dev/system.clj
+++ dev/src/yada/dev/system.clj
@@ -75,7 +75,7 @@
          (make new-web-resources config
                :key :swagger-ui
                :uri-context "/swagger-ui"
-               :resource-prefix "META-INF/resources/webjars/swagger-ui/2.1.0")))
+               :resource-prefix "META-INF/resources/webjars/swagger-ui/2.1.1")))

 (defn http-server-components [system config]
   (assoc system


fix reload-macros check, broken in 2.3.7

--- src/main/shadow/cljs/devtools/server/reload_macros.clj
+++ src/main/shadow/cljs/devtools/server/reload_macros.clj
@@ -30,7 +30,7 @@
       false

       :else
-      (util/url-last-modified rc-url)
+      (> (util/url-last-modified rc-url) last-loaded)
       )))

 (defn check-macros! [system-bus]


fix clock

fix clock

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/aurora/runtime/timers.cljs
+++ src/aurora/runtime/timers.cljs
@@ -43,7 +43,7 @@
             (js/clearTimeout (:timer aurora-refresh)))
           (set! aurora-refresh {:wait refresh
                                 :timer (js/setInterval (fn []
-                                                         (queue (stdlib/map->fact {:ml :aurora/refresh-tick})))
+                                                         (queue (stdlib/map->fact {:ml :aurora/refresh})))
                                                        refresh)})))
       (do
         (js/clearTimeout (:timer aurora-refresh))


consolidate rules

consolidate rules

--- src/babel/english/grammar.cljc
+++ src/babel/english/grammar.cljc
@@ -345,53 +345,26 @@
                                      :cat :verb
                                      :sem {:aspect :progressive
                                            :tense :present}}})
-                   ;; TODO: consolidate all of these "h21" rules into a single rule.
+
                    (unify-check h21
-                           {:rule "vp-infinitive"
-                            :synsem {:aux false
-                                     :infl :infinitive
-                                     :cat :verb}})
+                                root-is-head
+                                {:rule "transitive-vp"
+                                 :head {:phrasal false}
+                                 :synsem {:aux false
+                                          :cat :verb}})
                    (unify-check h21
-                           {:rule "vp-conditional"
-                            :synsem {:aux false
-                                     :infl :conditional
-                                     :cat :verb}})
-                   (unify-check h21
-                           {:rule "vp-future"
-                            :synsem {:aux false
-                                     :infl :future
-                                     :cat :verb}})
-                   (unify-check h21
-                          {:rule "vp-imperfect"
-                           :synsem {:aux false
-                                    :infl :imperfect
-                                    :cat :verb}})
-                   (unify-check h21
-                          {:rule "vp-past"
-                           :synsem {:aux false
-                                    :infl :past
-                                    :cat :verb}})
-                   (unify-check h21
+                                root-is-head-root
+                                {:rule "transitive-vp"
+                                 :head {:phrasal true}
+                                 :synsem {:aux false
+                                          :cat :verb}})
+
+                   (unify-check h32
                            root-is-head
-                           {:rule "vp-present"
-                            :synsem {:aux false
-                                     :infl :present
-                                     :sem {:tense :present}
-                                     :cat :verb}})
-                   (unify-check h21
-                           root-is-head
-                           {:comp {:phrasal false
-                                   :synsem {:cat :noun
-                                            :pronoun true}}
-                            :rule "vp-pronoun"
+                           {:rule "vp32"
+                            :head {:phrasal-verb true}
                             :synsem {:aux false
                                      :cat :verb}})
-
-                   (unify-check h32
-                           root-is-head
-                          {:rule "vp32"
-                           :synsem {:aux false
-                                    :cat :verb}})

                    (unify-check h10
                            {:head {:phrasal false


Expanded tests: ensuring we are respecting the node count limit

--- test/tropefest/test/db_nodes.clj
+++ test/tropefest/test/db_nodes.clj
@@ -46,8 +46,32 @@
                          ))))

+(deftest test-query-nodes-when-empty
+  (wipe-test-db)
+  (is (= (count (query-nodes-to-crawl (get-test-connection) 100)) 0))
+  (is (= (query-nodes-to-crawl (get-test-connection) 100) '())))
+
+
+(defn create-test-nodes [n isredirect]
+  (dotimes [i n]
+    (create-node! (get-test-connection) "TestNode" {:id         (str "TestNode/" i)
+                                                    :nextupdate i
+                                                    :isredirect isredirect})))
+
+(deftest test-query-nodes-node-limit
+  (wipe-test-db)
+  (create-test-nodes 30 false)                              ; Create non-redirect nodes
+  (is (= (count (query-nodes-to-crawl (get-test-connection) 100)) 30))
+  (is (= (count (query-nodes-to-crawl (get-test-connection) 15)) 15))
+  (is (= (query-nodes-to-crawl (get-test-connection) 0) '())))
+
+
+
+
+
+
 (deftest test-relate-nodes
-  ; We don' wipe the db to ensure association works even if there were previous nodes
+  ; We don't wipe the db to ensure association works even if there were previous nodes
   (let [conn (get-test-connection)
         n1 (create-node! conn "TestNode" {:id "TestNode/N1"})
         n2 (create-node! conn "TestNode" {:id "TestNode/N2"})


Dashboard: Fix column-spec for 'Edit in Inbox'.

--- src-cljs/pepa/navigation.cljs
+++ src-cljs/pepa/navigation.cljs
@@ -56,7 +56,7 @@
   {:pre [(:id document)]}
   (->>
    ;; TODO: This strings needs to be generated from pepa.inbox2
-   {:columns (str "i,d:" (:id document) ",s")}
+   {:columns (str "i,d:" (:id document) ",n")}
    (workflow-route :inbox)))

 (defn nav->route [navigation]


Allow false for diff-paths

Allow false for diff-paths

--- src/spec/cljc/mikron/compiler/core_spec.cljc
+++ src/spec/cljc/mikron/compiler/core_spec.cljc
@@ -82,7 +82,7 @@
                  :record      (s/map-of keyword? ::paths)
                  :multi       (s/map-of any? ::paths)
                  :coll-or-map (s/keys :req-un [:paths/all])
-                 :true        true?)
+                 :boolean     boolean?)
            (s/conformer second)))

   (s/def :paths/all


Revert "downgrade groovy runner version"

--- jvm-runner/test/codewars/runners/groovy_test.clj
+++ jvm-runner/test/codewars/runners/groovy_test.clj
@@ -1,10 +1,8 @@
 (ns codewars.runners.groovy-test
   (:require [clojure.test :refer :all]
-            [clojure.test.junit :refer [with-junit-output]]
             [cheshire.core :as json]
             [codewars.core :refer [-main] :as core]
-            [codewars.utils :refer [with-java-out-str]]
-  )
+            [codewars.utils :refer [with-java-out-str]]))

 (deftest groovy-code-only
   (testing "-main can handle a groovy code with no fixture"
@@ -12,39 +10,12 @@
       (json/generate-string
        {:language "groovy"
         :code "1 + 1"})
-      (is (= 2 (-main)))
-    )
-  )
-)
+      (is (= 2 (-main))))))

 (deftest groovy-java-out
   (testing "-main can handle a groovy code with no setup code but no fixture"
     (with-in-str
       (json/generate-string
        {:language "groovy"
-        :code "print 'Hello Groovy!'"}
-      )
-      (is (= "Hello Groovy!" (with-java-out-str (-main))) )
-    )
-  )
-)
-
-(deftest groovy-java-fixt
-  (testing "-main can handle a groovy code with no setup code but no fixture"
-    (with-in-str
-      (json/generate-string
-       {:language "groovy"
-        :code "class Greeter { static greet = { name -> 'Hello '+name } }"
-        :fixture "class MyTestCase extends GroovyTestCase { void testGreet(){def result = Greeter.greet('Ruslan');assert result == 'Hello Ruslan';println 'Lets sum'}}"}
-      )
-      ;(with-java-out-str (run-all-tests))
-
-     (let [test-out-string (with-java-out-str (-main))]
-        (is (.contains test-out-string "<DESCRIBE::>testGreet(MyTestCase)"))
-        (is (.contains test-out-string "Lets sum"))
-        (is (.contains test-out-string "<PASSED::>Test Passed<:LF:>"))
-     )
-
-    )
-  )
-)
+        :code "print 'Hello Groovy!'"})
+      (is (= "Hello Groovy!" (with-java-out-str (-main)))))))


changed tense names to english (future and imperfect found)

--- babel/italiano/morphology.clj
+++ babel/italiano/morphology.clj
@@ -55,7 +55,7 @@

 (declare get-string)

-(defn stem-per-futuro [infinitive drop-e]
+(defn stem-per-futueo [infinitive drop-e]
   "turn an infinitive form into a stem that can be conjugated in the future tense."

   ;; e.g.: lavarsi => lavare
@@ -97,7 +97,7 @@
      true
      infinitive)))

-(defn stem-per-imperfetto [infinitive]
+(defn stem-per-imperfect [infinitive]
   "_infinitive_ should be a string (italian verb infinitive form)"
   ;; e.g.: lavarsi => lavare
   (let [infinitive (if (re-find #"[aei]rsi$" infinitive)
@@ -285,10 +285,10 @@
           (string? (get-in word '(:italiano))))
      (get-in word '(:italiano))

-     ;; futuro: 1) irregular
-     (and
-      (= (get-in word '(:infl)) :futuro)
-      (map? (get-in word '(:futuro))))
+     ;; future 1) irregular
+     (and
+      (= (get-in word '(:infl)) :future)
+      (map? (get-in word '(:future))))
      (let [infinitive (get-in word '(:italiano))
            ;; e.g.: lavarsi => lavare
            infinitive (if (re-find #"[aei]rsi$" infinitive)
@@ -298,31 +298,31 @@
            number (get-in word '(:agr :number))]
        (cond
         (and (= person :1st) (= number :sing))
-        (get-in word '(:futuro :1sing))
+        (get-in word '(:future :1sing))
         (and (= person :2nd) (= number :sing))
-        (get-in word '(:futuro :2sing))
+        (get-in word '(:future :2sing))
         (and (= person :3rd) (= number :sing))
-        (get-in word '(:futuro :3sing))
+        (get-in word '(:future :3sing))
         (and (= person :1st) (= number :plur))
-        (get-in word '(:futuro :1plur))
+        (get-in word '(:future :1plur))
         (and (= person :2nd) (= number :plur))
-        (get-in word '(:futuro :2plur))
+        (get-in word '(:future :2plur))
         (and (= person :3rd) (= number :plur))
-        (get-in word '(:futuro :3plur))
-
-        (and (= (get-in word '(:infl)) :futuro)
+        (get-in word '(:future :3plur))
+
+        (and (= (get-in word '(:infl)) :future)
              (string? (get-in word '(:italiano))))
-        (str (get-in word '(:italiano)) " (futuro)")
+        (str (get-in word '(:italiano)) " (future)")

         true ;; failthrough: should usually not get here:
         ;; TODO: describe when it might be ok, i.e. why log/warn not log/error.
         (do (log/warn (str "get-string-1 could not match: " word))
         word)))

-     ;; futuro: 2) futuro-stem specified
-     (and (= (get-in word '(:infl)) :futuro)
-          (get-in word '(:futuro-stem)))
-     (let [stem (get-in word '(:futuro-stem))]
+     ;; future: 2) futueo-stem specified
+     (and (= (get-in word '(:infl)) :future)
+          (get-in word '(:future-stem)))
+     (let [stem (get-in word '(:future-stem))]
        (cond
         (and (= person :1st) (= number :sing))
         (str stem "ò")
@@ -342,8 +342,8 @@
         (and (= person :3rd) (= number :plur))
         (str stem "anno")))

-     ;; futuro 3) regular inflection of futuro.
-     (and (= (get-in word '(:infl)) :futuro)
+     ;; future 3) regular inflection of future.
+     (and (= (get-in word '(:infl)) :future)
           (get-in word '(:italiano)))

      (let [infinitive (get-in word '(:italiano))
@@ -354,7 +354,7 @@
            person (get-in word '(:agr :person))
            number (get-in word '(:agr :number))
            drop-e (get-in word '(:italiano :drop-e) false)
-           stem (stem-per-futuro infinitive drop-e)]
+           stem (stem-per-future infinitive drop-e)]
        (cond
         (and (= person :1st) (= number :sing))
         (str stem "ò")
@@ -379,8 +379,8 @@

      ;; regular inflection of conditional
      (and (= (get-in word '(:infl)) :conditional)
-          (string? (get-in word '(:futuro-stem) :none)))
-     (let [stem (get-in word '(:futuro-stem))
+          (string? (get-in word '(:future-stem) :none)))
+     (let [stem (get-in word '(:future-stem))
            person (get-in word '(:agr :person))
            number (get-in word '(:agr :number))
            drop-e (get-in word '(:italiano :drop-e) false)]
@@ -415,7 +415,7 @@
            person (get-in word '(:agr :person))
            number (get-in word '(:agr :number))
            drop-e (get-in word '(:italiano :drop-e) false)
-           stem (stem-per-futuro infinitive drop-e)]
+           stem (stem-per-future infinitive drop-e)]

        (cond
         (and (= person :1st) (= number :sing))
@@ -439,50 +439,50 @@
         :else
         (get-in word '(:italiano))))

-     ;; irregular imperfetto sense:
+     ;; irregular imperfect sense:
      ;; 1) use irregular based on number and person.
      (and
-      (= (get-in word '(:infl)) :imperfetto)
+      (= (get-in word '(:infl)) :imperfect)
       (= :sing (get-in word '(:agr :number)))
       (= :1st (get-in word '(:agr :person)))
-      (string? (get-in word '(:imperfetto :1sing))))
-     (get-in word '(:imperfetto :1sing))
-
-     (and
-      (= (get-in word '(:infl)) :imperfetto)
+      (string? (get-in word '(:imperfect :1sing))))
+     (get-in word '(:imperfect :1sing))
+
+     (and
+      (= (get-in word '(:infl)) :imperfect)
       (= :sing (get-in word '(:agr :number)))
       (= :2nd (get-in word '(:agr :person)))
-      (string? (get-in word '(:imperfetto :2sing))))
-     (get-in word '(:imperfetto :2sing))
-
-     (and
-      (= (get-in word '(:infl)) :imperfetto)
+      (string? (get-in word '(:imperfect :2sing))))
+     (get-in word '(:imperfect :2sing))
+
+     (and
+      (= (get-in word '(:infl)) :imperfect)
       (= :sing (get-in word '(:agr :number)))
       (= :3rd (get-in word '(:agr :person)))
-      (string? (get-in word '(:imperfetto :3sing))))
-     (get-in word '(:imperfetto :3sing))
-
-     (and
-      (= (get-in word '(:infl)) :imperfetto)
+      (string? (get-in word '(:imperfect :3sing))))
+     (get-in word '(:imperfect :3sing))
+
+     (and
+      (= (get-in word '(:infl)) :imperfect)
       (= :plur (get-in word '(:agr :number)))
       (= :1st (get-in word '(:agr :person)))
-      (string? (get-in word '(:imperfetto :1plur))))
-     (get-in word '(:imperfetto :1plur))
-     (and
-      (= (get-in word '(:infl)) :imperfetto)
+      (string? (get-in word '(:imperfect :1plur))))
+     (get-in word '(:imperfect :1plur))
+     (and
+      (= (get-in word '(:infl)) :imperfect)
       (= :plur (get-in word '(:agr :number)))
       (= :2nd (get-in word '(:agr :person)))
-      (string? (get-in word '(:imperfetto :2plur))))
-     (get-in word '(:imperfetto :2plur))
-     (and
-      (= (get-in word '(:infl)) :imperfetto)
+      (string? (get-in word '(:imperfect :2plur))))
+     (get-in word '(:imperfect :2plur))
+     (and
+      (= (get-in word '(:infl)) :imperfect)
       (= :plur (get-in word '(:agr :number)))
       (= :3rd (get-in word '(:agr :person)))
-      (string? (get-in word '(:imperfetto :3plur))))
-     (get-in word '(:imperfetto :3plur))
-
-     ;; regular imperfetto sense
-     (and (= (get-in word '(:infl)) :imperfetto)
+      (string? (get-in word '(:imperfect :3plur))))
+     (get-in word '(:imperfect :3plur))
+
+     ;; regular imperfect sense
+     (and (= (get-in word '(:infl)) :imperfect)
           (get-in word '(:italiano)))
      (let [infinitive (get-in word '(:italiano))
            ;; e.g.: lavarsi => lavare
@@ -491,7 +491,7 @@
                         infinitive)
            person (get-in word '(:agr :person))
            number (get-in word '(:agr :number))
-           stem (stem-per-imperfetto infinitive)]
+           stem (stem-per-imperfect infinitive)]
        (cond
         (and (= person :1st) (= number :sing))
         (str stem "vo")
@@ -1222,32 +1222,32 @@
    ;; future
    #"cherò$"
    {:replace-with "care"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :sing
                                   :person :1st}}}}
    #"cherai$"
    {:replace-with "care"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :sing
                                   :person :2nd}}}}
    #"cherà$"
    {:replace-with "care"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :sing
                                   :person :3rd}}}}
    #"cheremo$"
    {:replace-with "care"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :plur
                                   :person :1st}}}}
    #"cherete$"
    {:replace-with "care"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :plur
                                   :person :2nd}}}}
    #"cheranno$"
    {:replace-with "care"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :plur
                                   :person :3rd}}}}})

@@ -1257,32 +1257,32 @@
    ;; future
    #"ò$"
    {:replace-with "e"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :sing
                                   :person :1st}}}}
    #"ai$"
    {:replace-with "e"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :sing
                                   :person :2nd}}}}
    #"à$"
    {:replace-with "e"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :sing
                                   :person :3rd}}}}
    #"emo$"
    {:replace-with "e"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :plur
                                   :person :1st}}}}
    #"ete$"
    {:replace-with "e"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :plur
                                   :person :2nd}}}}
    #"anno$"
    {:replace-with "e"
-    :unify-with {:italiano {:infl :futuro
+    :unify-with {:italiano {:infl :future
                             :agr {:number :plur
                                   :person :3rd}}}}})

@@ -1413,19 +1413,19 @@
    ;; e.g.: "bevevo/bevevi/..etc" => "bere"
    #"vevo$"
    {:replace-with "re"
-    :unify-with {:italiano {:infl :imperfetto
+    :unify-with {:italiano {:infl :imperfect
                             :agr {:number :sing
                                   :person :1st}}}}

    #"vevi$"
    {:replace-with "re"
-    :unify-with {:italiano {:infl :imperfetto
+    :unify-with {:italiano {:infl :imperfect
                             :agr {:number :sing
                                   :person :2nd}}}}

    #"veva$"
    {:replace-with "re"
-    :unify-with {:italiano {:infl :imperfetto
+    :unify-with {:italiano {:infl :imperfect
                             :agr {:number :sing
                                   :person :3rd}}}}
    })


#26 - Improved (for mobile) table of contents where chapter nums are hidden until book selected.

--- src/biblecli/commands/staticpages.cljs
+++ src/biblecli/commands/staticpages.cljs
@@ -77,33 +77,31 @@
   text-indent: 0;
   text-align: center;
 }
-.tocp {
-  border: none;
-  border-collapse: collapse;
-
-}
-.chapter {
-    font-size: 120%;
-    font-weight: bold;
-    vertical-align: top;
-    padding: 4px 0px 4px 2px;
-}
-.chapters {
-    display: flex;
-    flex-wrap: wrap;
-    margin-bottom: 10px;
-}
-.chapters a {
-    display: inline-flex;
-    justify-content: center;
-    align-items: center;
-    min-width: 32px;
-    min-height: 32px;
-    padding: 2px;
-    margin: 2px;
-    background-color: rgba(0,0,0,0.03);
-}
-.hilite {
+
+.book h3 {
+  margin: 0;
+  min-height: 32px;
+}
+.book .chapters {
+  display: none;
+  margin-bottom: 8px;
+}
+.book .chapters a {
+  display: inline-block;
+  display: inline-flex;
+  justify-content: center;
+  align-items: center;
+  min-width: 32px;
+  min-height: 32px;
+  padding: 2px;
+  margin: 2px;
+  background-color: rgba(0,0,0,0.03);
+}
+.book.active .chapters {
+  display: block;
+}
+
+.verses .active {
   background-color: #FFFF99;
 }
 .about {
@@ -199,19 +197,13 @@

 var lastElem = null;

-function RemoveHilite(el) {
+function SetActiveElem(el, isActive) {
     if(el) {
         var t = el.className;
-        t = t.replace('hilite', '').trim();
-        el.className = t;
-    }
-}
-
-function AddHilite(el) {
-    if(el) {
-        var t = el.className;
-        t = t.replace('hilite', '').trim();
-        t += ' hilite';
+        t = t.replace('active', '').trim();
+        if(isActive) {
+          t += ' active';
+        }
         el.className = t;
     }
 }
@@ -221,17 +213,17 @@
     return id === null ? null : document.getElementById(id);
 }

-function SetHilight()
+function SetActive()
 {
     var el;
     el = FindElem(lastElem);
-    RemoveHilite(el);
+    SetActiveElem(el, false);

     var id = '_' + window.location.hash.substr(1);
     el = FindElem(id);
     if(el) {
         lastElem = id;
-        AddHilite(el);
+        SetActiveElem(el, true);
     } else {
         lastElem = null;
     }
@@ -251,11 +243,11 @@
 }

 window.addEventListener('hashchange', function(e) {
-  SetHilight();
+  SetActive();
 });

 window.addEventListener('load', function() {
-  SetHilight();
+  SetActive();
   window.setTimeout(function() { CenterElem(FindElem(lastElem)); }, 1);
 });

@@ -373,12 +365,17 @@
     (rel-url book-id chap-num chap-cnt)))

 (defn toc-book [b]
-  [:tr {:id (str "_" (book-elem-id (:id b)))}
-    [:td.chapter (book-name-nbsp (:id b))]
-    [:td.chapters
-    (->> (:chapters b)
-      (map (fn [ch]
-        (list [:a {:href (rel-url (:id b) (:num ch) (count (:chapters b)))} (:num ch)]))))]])
+  (let [chapters (:chapters b)
+        chapcount (count chapters)
+        id (:id b)
+        bookid (book-elem-id id)]
+     [:div.book {:id (str "_" bookid)}
+     [:h3.chapter [:a {:href (if (> chapcount 1) (str "#" bookid) bookid)} (book-name-nbsp id)]]
+     [:div.chapters
+      (->> chapters
+           (map (fn [ch]
+                  (list [:a {:href (rel-url (:id b) (:num ch) chapcount)} (:num ch)]))))]]))
+

 (defn toc [m baseurl canonical]
   (str "<!DOCTYPE html>"
@@ -391,22 +388,21 @@
           [:link {:rel "stylesheet" :type "text/css" :href "styles.css"}]
           [:link {:rel "canonical" :href canonical}]]
         [:body
-          [:div.content
+          [:div.content.toc
             [:h1 "The King James Bible"]

             [:div#votd.votd]
             [:script "(function(w,d,t,u,v,i,n,l){w['VotdObject']=v;w[v]=w[v]||{};w[v].i=i;n=d.createElement(t),l=d.getElementsByTagName(t)[0];n.async=1;n.src=u;l.parentNode.insertBefore(n,l)})(window,document,'script','votd/votd.js','votd','votd');"]

-            [:table.tocp
-              [:tr [:td {:colspan 2} [:h2 "The Old Testament"]]]
-              (->> m
-                (take 39)
-                (map toc-book))
-
-              [:tr [:td {:colspan 2} [:h2 "The New Testament"]]]
-              (->> m
-                (drop 39)
-                (map toc-book))]
+            [:h2 "The Old Testament"]
+            (->> m
+              (take 39)
+              (map toc-book))
+
+            [:h2 "The New Testament"]
+            (->> m
+              (drop 39)
+              (map toc-book))

             [:div.about [:a {:href "https://github.com/pstephens/kingjames.bible/blob/master/README.md"} "About " baseurl ]]]
           [:script {:type "text/javascript" :src "hiliter.js"}]]])))
@@ -525,7 +521,7 @@
           [:link {:rel "stylesheet" :type "text/css" :href "styles.css"}]
           [:link {:rel "canonical" :href (join-url canonical (rel-url ch))}]]
         [:body
-          [:div.content
+          [:div.content.verses
             [:div.menu
               [:div.menu2
                 [:a {:href (str ".#" (book-elem-id book-id))} (chapter-name ch)]


add redirect to index html again

add redirect to index html again

--- backend/src/lambdaui/core.clj
+++ backend/src/lambdaui/core.clj
@@ -25,6 +25,7 @@
             (context "/api" [] (old-api/rest-api pipeline))
             (GET "/old" [] (old-ui/ui-page pipeline))
             (route/resources "/" {:root "public"})
+            (GET "/" [] (ring.util.response/redirect "/ui/index.html"))
             (route/resources "/ui" {:root "public/target"})
             )))


add send-child-for-item function

add send-child-for-item function

--- src/ca_recipe/family_async.clj
+++ src/ca_recipe/family_async.clj
@@ -40,3 +40,10 @@
      (alter assignments assoc child item)
      (alter shopping-list disj item))
     item))
+
+(defn send-child-for-item
+  "eventually shop for an item"
+  [child item q]
+  (println child "is searching for" item) (dawdle)
+  (collect-assignment child)
+  (>!! q child))


Script value can be string coerced to body; include timeout default

--- src/cider_ci/builder/tasks.clj
+++ src/cider_ci/builder/tasks.clj
@@ -8,7 +8,7 @@
     [cider-ci.builder.task :as task]
     [cider-ci.builder.util :as util]
     [cider-ci.utils.config-loader :as config-loader]
-    [cider-ci.utils.map :as map]
+    [cider-ci.utils.map :as map :refer [deep-merge]]
     [cider-ci.utils.map :refer [convert-to-array]]
     [cider-ci.utils.messaging :as messaging]
     [cider-ci.utils.rdbms :as rdbms]
@@ -51,19 +51,35 @@
     scripts
     (throw (IllegalStateException. (str ":scripts must a map " scripts)))))

+(def ^:private script-base-defaults
+  {:timeout (* 15 60)
+   })
+
+(defn- coerce-script-value [value]
+  (cond
+    (map? value) (deep-merge script-base-defaults value)
+    (string? value) (deep-merge  script-base-defaults {:body value})
+    :else (throw (IllegalStateException.
+                   (str "don't know how to handle type " (type value))))))
+
+(defn- build-base-script [[script-key value]]
+  [script-key (coerce-script-value value)])
+
+;(build-base-script (into [] {:x "test a = a"}))
+
 (defn build-scripts [task script-defaults]
   (->> task
        :scripts
        (#(or % {}))
-       assert-scripts-is-a-map!
-       (map (fn [[k v]] [k (util/deep-merge script-defaults v)]))
+       (map build-base-script)
+       (map (fn [[k v]] [k (deep-merge script-defaults v)]))
        (into {})))

 ;(build-scripts {:scripts [{:x 5}]} {:x 7 :y 9})
 ;(build-scripts {:scripts {:blah {:x 5}}} {:x 7 :y 9})

 (defn build-task [task-spec task-defaults script-defaults]
-  (let [merged-task (util/deep-merge task-defaults task-spec)]
+  (let [merged-task (deep-merge task-defaults task-spec)]
     (assoc merged-task :scripts (build-scripts merged-task script-defaults))))

 ; build-tasks-for-single-context and build-tasks-for-contexts-sequence
@@ -89,10 +105,10 @@
          (map
            (fn [context]
              (logging/debug {:context context})
-             (let [task-defaults (util/deep-merge inherited-task-defaults
+             (let [task-defaults (deep-merge inherited-task-defaults
                                                   (or (:task-defaults context)
                                                       {}))
-                   script-defaults (util/deep-merge inherited-script-defaults
+                   script-defaults (deep-merge inherited-script-defaults
                                                     (or (:script-defaults context)
                                                         {}))]
                (build-tasks-for-single-context context


Make db connection actually work each time

--- src/clj/herder/web/handler.clj
+++ src/clj/herder/web/handler.clj
@@ -24,8 +24,8 @@

 (defn wrap-db [f]
   (fn [req]
-    (if-let [sys-db (:db system)]
-      (kd/with-db sys-db
+    (if-let [sys-db-spec (:db-spec (:db system))]
+      (kd/with-db (kd/create-db sys-db-spec)
         (f req))
       (f req))))


Construct ConsoleReader using System/in and System/out

This allows reply to work with JVMs launched using flatland/decaf.
Otherwise, reply uses the original stdin, which is already closed.

--- src/clj/reply/reader/jline.clj
+++ src/clj/reply/reader/jline.clj
@@ -30,7 +30,7 @@
 (defn make-reader [options]
   (when (= "dumb" (System/getenv "TERM"))
     (.setProperty (Configuration/getProperties) "jline.terminal" "none"))
-  (let [reader (ConsoleReader.)
+  (let [reader (ConsoleReader. System/in System/out)
         history (FileHistory. (make-history-file (:history-file options)))
         completer (jline.completion/make-completer reply.initialization/eval-in-user-ns #())]
     (.setBlinkMatchingParen (.getKeys reader) true)


Rename :skip to :skipped in XML test reports.

Nosetest produces results in a more-or-less canonical JUnit format, but uses a
different term for skipped tests.

--- src/clj/runbld/tests/junit.clj
+++ src/clj/runbld/tests/junit.clj
@@ -2,6 +2,7 @@
   (:require [runbld.schema :refer :all]
             [schema.core :as s])
   (:require [clojure.java.io :as io]
+            [clojure.set :refer [rename-keys]]
             [clojure.string :as str]
             [net.cgrand.enlive-html :as x]))

@@ -12,6 +13,7 @@
                   (x/attr= :tests)]])
       first
       :attrs
+      (rename-keys {:skip :skipped}) ;; for nosetest
       (update :errors   #(Integer/parseInt %))
       (update :failures #(Integer/parseInt %))
       (update :tests    #(Integer/parseInt %))


Support :layout-margin-... attributes in Linear and Relative layout

--- src/clojure/neko/ui/traits.clj
+++ src/clojure/neko/ui/traits.clj
@@ -194,6 +194,16 @@

 ;; ### Layout parameters attributes

+(def ^:private margin-attributes [:layout-margin-left :layout-margin-top
+                                  :layout-margin-right :layout-margin-bottom])
+
+(defn- apply-margins-to-layout-params
+  "Takes a LayoutParams object that implements MarginLayoutParams
+  class and an attribute map, and sets margins for this object."
+  [params attribute-map]
+  (let [[l t r b] (map #(to-dimension (attribute-map % 0)) margin-attributes)]
+    (.setMargins params l t r b)))
+
 (deftrait :default-layout-params
   "Takes `:layout-width` and `:layout-height` attributes and sets
    LayoutParams, if the container type is not specified."
@@ -205,18 +215,21 @@
    (.setLayoutParams wdg (ViewGroup$LayoutParams. width height))))

 (deftrait :linear-layout-params
-  "Takes `:layout-width`, `:layout-height` and `:layout-weight`
-  attributes and sets LinearLayout.LayoutParams if current container
-  is LinearLayout. Values could be either numbers of `:fill` or
-  `:wrap`."
-  {:attributes [:layout-width :layout-height :layout-weight :layout-gravity]
+  "Takes `:layout-width`, `:layout-height`, `:layout-weight`,
+  `:layout-gravity` and different layout margin attributes and sets
+  LinearLayout.LayoutParams if current container is LinearLayout.
+  Values could be either numbers of `:fill` or `:wrap`."
+  {:attributes (concat margin-attributes [:layout-width :layout-height
+                                          :layout-weight :layout-gravity])
    :applies? (= (kw/keyword-by-classname container-type) :linear-layout)}
-  [^View wdg, {:keys [layout-width layout-height layout-weight layout-gravity]}
+  [^View wdg, {:keys [layout-width layout-height layout-weight layout-gravity]
+               :as attributes}
    {:keys [container-type]}]
   (let [width  (kw/value :layout-params (or layout-width  :wrap))
         height (kw/value :layout-params (or layout-height :wrap))
         weight (or layout-weight 0)
         params (LinearLayout$LayoutParams. width height weight)]
+    (apply-margins-to-layout-params params attributes)
     (when layout-gravity
       (set! (. params gravity)
             (kw/value :layout-params layout-gravity :gravity)))
@@ -257,7 +270,7 @@
          (map keys (vals relative-layout-attributes))))

 (deftrait :relative-layout-params
-  {:attributes all-relative-attributes
+  {:attributes (concat all-relative-attributes margin-attributes)
    :applies? (= (kw/keyword-by-classname container-type) :relative-layout)}
   [^View wdg, {:keys [layout-width layout-height
                       layout-align-with-parent-if-missing] :as attributes}
@@ -273,6 +286,7 @@
     (doseq [[attr-name attr-id] (:with-id relative-layout-attributes)]
       (when (contains? attributes attr-name)
         (.addRule lp attr-id (to-id (attr-name attributes)))))
+    (apply-margins-to-layout-params lp attributes)
     (.setLayoutParams wdg lp)))

 (deftrait :padding


warn 99 expiration

warn 99 expiration

--- src/clojure/nossal/coupons.clj
+++ src/clojure/nossal/coupons.clj
@@ -41,7 +41,7 @@
              :description "💲 Ganhe R$10,00 de desconto na primeira corrida 99 (99POP também)! ✅"
              :text [:p "Ganhe " [:span.value "R$10,00"]" de desconto na sua " [:strong "primeira"] " viagem no 99! " [:ruby "🎉 " [:rt "ta-da!"]]
                      [:small"Este cupom pode ser utilizado apenas uma vez por pessoa, em sua primeira corrida. Ganhe até " [:span.value "100%"] " de desconto na sua viagem."]
-                     [:p.warn [:span "Seja rápido!"] " você tem " [:strong "até 15 dias"] "para fazer a sua primeira viagem antes do cupom expirar. 😨"]]}
+                     [:p.warn [:span "Seja rápido!"] " Você tem " [:strong "até 15 dias"] "para fazer a sua primeira viagem antes do cupom expirar. 😨"]]}
    "picpay" {:code "PKTA9D"
              :title ["PicPay"]
              :url "http://www.picpay.com/convite?!PKTA9D"


More idiomatic approach for render-package-descriptions

--- src/clouseau/text_renderer.clj
+++ src/clouseau/text_renderer.clj
@@ -1,7 +1,7 @@
 ;;;
 ;;;   Clouseau
 ;;;
-;;;    Copyright (C) 2015 Pavel Tisnovsky <ptisnovs@redhat.com>
+;;;    Copyright (C) 2015, 2016  Pavel Tisnovsky <ptisnovs@redhat.com>
 ;;;
 ;;; Clouseau is free software; you can redistribute it and/or modify
 ;;; it under the terms of the GNU General Public License as published by
@@ -41,9 +41,13 @@
 (defn render-package-descriptions
     [package-descriptions]
     (let [sorted-descriptions (into (sorted-map) package-descriptions)]
-        (for [p sorted-descriptions]
-            (str "[" (key p) "]\n"
-                     (val p) "\n\n"))))
+        (map #(str "[" (key %) "]\n"
+                       (val %) "\n\n") sorted-descriptions)))
+
+;       ; older implementation, not idiomatic :)
+;       (for [p sorted-descriptions]
+;           (str "[" (key p) "]\n"
+;                    (val p) "\n\n"))))

 (defn render-front-page
     [products package package-descriptions ccs-description products-per-descriptions products-without-descriptions new-description user-name]


Remove unnecessary join condition for certname_catalogs

Now that we don't use a subselect when querying resources, we're
*always* going to join against certname_catalogs in our main query, as
it has columns we always want to select. So it's not necessary to add
another join. Also, this code was broken anyway, as the
certname_catalogs condition was always returning an empty string for the
join expression.

The only legal table remaining to join on is certnames, which is still
optional, as it's only involved in the query if we're querying based on
node activity.

--- src/com/puppetlabs/puppetdb/query/resource.clj
+++ src/com/puppetlabs/puppetdb/query/resource.clj
@@ -16,9 +16,9 @@

 (defn build-join-expr
   "Builds an inner join expression between catalog_resources and the given
-  `table`. The only acceptable tables are `certnames` and `certname_catalogs`,
-  each of which *must* have rows corresponding to the `catalog_resources`
-  table. Thus this operation is safe."
+  `table`. The only currently acceptable table is `certnames`,
+  which *must* have rows corresponding to the `catalog_resources`
+  table, ensuring the INNER JOIN won't lose any rows."
   [table]
   (condp = table
     ;; We will always also join to certname_catalogs if we're joining to
@@ -26,11 +26,7 @@
     ;; certname_catalogs, and don't want duplicate joins. I wish this were more
     ;; generic.
     :certnames
-    "INNER JOIN certnames ON certname_catalogs.certname = certnames.name"
-
-    :certname_catalogs
-    ""
-    (count "INNER JOIN certname_catalogs USING(catalog)")))
+    "INNER JOIN certnames ON certname_catalogs.certname = certnames.name"))

 (defn query->sql
   "Compile a query into an SQL expression."
@@ -83,13 +79,12 @@

          ;; node join.
          [["node" "name"]]
-         {:joins [:certname_catalogs]
-          :where "certname_catalogs.certname = ?"
+         {:where "certname_catalogs.certname = ?"
           :params [value]}

          ;; {in,}active nodes.
          [["node" "active"]]
-         {:joins [:certname_catalogs :certnames]
+         {:joins [:certnames]
           :where (format "certnames.deactivated IS %s" (if value "NULL" "NOT NULL"))}

          ;; param joins.


add console table log to entity

add console table log to entity

--- src/cljs/flow_editor/views/entity.cljs
+++ src/cljs/flow_editor/views/entity.cljs
@@ -1,7 +1,7 @@
 (ns flow-editor.views.entity
   (:require [re-frame.core :refer [subscribe dispatch]]
             [reagent.core :as r]
-            [flow-editor.utils.graph-ui :refer [e-node]]
+            [flow-editor.utils.graph-ui :refer [e-node e-node-id]]
             [flow-editor.views.utils.codemirror :refer [cm]]
             [flow-editor.views.value-types.core :refer [value-editors]]
             [re-com.core :refer [title horizontal-bar-tabs
@@ -71,7 +71,9 @@
                     [md-icon-button
                      :md-icon-name "zmdi-search"
                      :tooltip "inspect in console"
-                     :on-click #(dispatch [:flow-runtime/log-entity eid])]
+                     :on-click #(if (.-ctrlKey %)
+                                  (dispatch [:flow-runtime/log-table-entity eid])
+                                  (dispatch [:flow-runtime/log-entity eid]))]
                     [gap :size "10px"]
                     [line]
                     [gap :size "10px"]
@@ -152,7 +154,7 @@
             modes (value-tabs entity)
             initial-value? (r/atom (not= (:json entity) nil))]
         [v-box
-         :class "entity-component"
+         :class (str "entity-component " (e-node-id eid))
          :gap "10px"
          :attr {:on-mouse-enter #(dispatch [:graph-ui/set-active-node (e-node eid)])}
          :children [[header entity minified]


Add missing copyright notice on accessrules ns.

--- src/clojure/buddy/auth/accessrules.clj
+++ src/clojure/buddy/auth/accessrules.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013-2015 Andrey Antukh <niwi@niwi.be>
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License")
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;;     http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
 (ns buddy.auth.accessrules
   (:require [buddy.auth :refer [throw-unauthorized]]
             [ring.util.response :as ring]


Add deprecation note on :by-method router directive.

Is already removed from documentation for some time ago.
Surely will be removed in near future releases.

--- src/clojure/catacumba/impl/routing.clj
+++ src/clojure/catacumba/impl/routing.clj
@@ -81,6 +81,10 @@
   [^Chain chain [_ & handlers]]
   (let [callback #(reduce attach-route % handlers)]
     (.insert chain ^Action (hp/fn->action callback))))
+
+;; WARN: this route directive should be considered deprecated because
+;; you are already allowed to setup different handlers for the same
+;; path but different http method.

 (defmethod attach-route :by-method
   [^Chain chain [_ handlersmap]]


Renamed elasticsearch namespace to connect.

--- src/cmr/indexer/data/elasticsearch.clj
+++ src/cmr/indexer/data/elasticsearch.clj
@@ -7,7 +7,7 @@
             [clj-http.client :as client]
             [cmr.common.log :as log :refer (debug info warn error)]
             [cmr.common.services.errors :as errors]
-            [cmr.elastic-utils.elasticsearch :as es]
+            [cmr.elastic-utils.connect :as es]
             [cmr.transmit.index-set :as index-set]
             [cmr.indexer.data.index-set :as idx-set]
             [cmr.system-trace.core :refer [deftracefn]]


Fixing the updated-since date time parsing.

--- src/cmr/search/services/parameters.clj
+++ src/cmr/search/services/parameters.clj
@@ -3,7 +3,7 @@
   (:require [clojure.set :as set]
             [cmr.common.services.errors :as errors]
             [cmr.search.models.query :as qm]
-            [clj-time.format :as f]
+            [cmr.common.date-time-parser :as dt-parser]
             [cmr.common.util :as u]))

 (def param-aliases
@@ -80,8 +80,8 @@
   [concept-type param value options]
   (qm/map->DateRangeCondition
     {:field param
-     :start-date (f/parse (f/formatters :date-time-no-ms)
-                          (if (sequential? value) (first value) value))
+     :start-date (dt-parser/parse-datetime
+                   (if (sequential? value) (first value) value))
      :end-date nil}))

 (defmethod parameter->condition :boolean


slurp-body now respects character encoding

--- src/compojure/http/request.clj
+++ src/compojure/http/request.clj
@@ -14,7 +14,8 @@
   (:use compojure.control)
   (:use clojure.contrib.duck-streams)
   (:use clojure.contrib.str-utils)
-  (:import java.net.URLDecoder))
+  (:import java.net.URLDecoder)
+  (:import java.io.InputStreamReader))

 (defn- assoc-vec
   "Associate a key with a value. If the key already exists in the map, create a
@@ -47,11 +48,22 @@
   (if-let [query (request :query-string)]
     (parse-params query)))

+(defn get-character-encoding
+  [request]
+  (or (request :character-encoding) *default-encoding*))
+
+(defn slurp-body
+  "Slurp the request body into a string."
+  [request]
+  (let [encoding (get-character-encoding request)]
+    (if-let [body (request :body)]
+      (slurp* (InputStreamReader. body encoding)))))
+
 (defn get-body-params
   "Parse parameters from the request body."
   [request]
-  (if-let [body (request :body)]
-    (parse-params (slurp* body))))
+  (if-let [body (slurp-body request)]
+    (parse-params body)))

 (defmacro with-request-bindings
   "Add shortcut bindings for the keys in a request map."


Drop unused columns, and separate index creation.

--- src/cavm/h2.clj
+++ src/cavm/h2.clj
@@ -106,7 +106,7 @@
 ; XXX Include original json
 (def experiments-table
   ["CREATE TABLE IF NOT EXISTS `experiments` (
-   `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+   `id` INT NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL UNIQUE,
    `probeMap` varchar(255),
    `shortTitle` varchar(255),
@@ -114,9 +114,10 @@
    `groupTitle` varchar(255),
    `platform` varchar(255),
    `security` varchar(255),
-   `dataSubType` varchar (255),
+   `gain` double DEFAULT NULL,
    `text` varchar (65535),
-   `gain` double DEFAULT NULL)"])
+   `dataSubType` varchar (255))"
+   "ALTER TABLE `experiments` ADD CONSTRAINT IF NOT EXISTS `experiments_id` PRIMARY KEY (`id`)"])

 ;
 ; experiments in making a macro for metadata tables


Don't reallocate off a RR scheduler.

Don't reallocate off a RR scheduler.

--- src/onyx/log/commands/volunteer_for_task.clj
+++ src/onyx/log/commands/volunteer_for_task.clj
@@ -150,6 +150,10 @@
   (fn [scheduler old new job state]
     scheduler))

+(defmethod reallocate-from-task? :onyx.task-scheduler/round-robin
+  [scheduler old new job state]
+  false)
+
 (defmethod reallocate-from-task? :onyx.task-scheduler/percentage
   [scheduler old new job state]
   (let [allocation (common/peer->allocated-job (:allocations new) (:id state))]
@@ -167,7 +171,10 @@

 (defmethod reallocate-from-task? :default
   [scheduler old new job state]
-  false)
+  (throw (ex-info
+          (format "Task scheduler %s not recognized. Check that you have not supplied a job scheduler instead."
+                  scheduler)
+          {:scheduler scheduler})))

 (defmethod extensions/reactions :volunteer-for-task
   [{:keys [args]} old new diff peer-args]


trigger SU bot messages if user wants to share via slack

--- src/open_company/api/stakeholder_updates.clj
+++ src/open_company/api/stakeholder_updates.clj
@@ -3,6 +3,7 @@
             [compojure.core :refer (routes OPTIONS GET POST DELETE)]
             [liberator.core :refer (defresource by-method)]
             [open-company.db.pool :as pool]
+            [open-company.lib.bot :as bot]
             [open-company.api.common :as common]
             [open-company.resources.company :as company-res]
             [open-company.resources.stakeholder-update :as su-res]
@@ -91,7 +92,6 @@
                                      :post nil})
   :allowed-methods [:options :get :post]
   :exists? (fn [_] (list-stakeholder-updates conn company-slug))
-  :malformed? false
   :processable? true

   :allowed? (by-method {
@@ -101,7 +101,10 @@

   ;; Create a new stakeholder update
   :post-to-missing? false ; 404 if company doesn't exist
-  :post! (fn [ctx] {:stakeholder-update (create-stakeholder-update conn ctx)})
+  :post! (fn [ctx] (let [ctx' (assoc ctx :stakeholder-update (create-stakeholder-update conn ctx))]
+                     (when (-> ctx :data :slack)
+                       (bot/send-trigger! (bot/ctx->trigger :stakeholder-update ctx')))
+                     ctx'))

   ;; Handlers
   :handle-not-acceptable (common/only-accept 406 su-rep/collection-media-type)


Use new event map constructor to properly compile flow conditions.

--- test/onyx/flow_conditions/flow_conditions_gen_test.clj
+++ test/onyx/flow_conditions/flow_conditions_gen_test.clj
@@ -100,10 +100,9 @@
                       (flow-to-tasks-gen)
                       (true-flow-condition-gen))))
     other-downstream-tasks (gen/vector gen/keyword)]
-   (let [compiled (c/compile-fc-norms flow-conditions :a)
-         target-tasks (mapcat :flow/to flow-conditions)
+   (let [target-tasks (mapcat :flow/to flow-conditions)
          downstream (into other-downstream-tasks target-tasks)
-         event {:onyx.core/compiled-norm-fcs compiled}
+         event (c/flow-conditions->event-map {} flow-conditions :a)
          results (r/route-data event nil nil flow-conditions downstream)]
      (is (= (into #{} target-tasks) (into #{} (:flow results))))
      (is (nil? (:action results))))))
@@ -124,8 +123,7 @@
                      (false-flow-condition-gen)))]
    (let [flow-conditions (into true-fcs false-fcs)
          downstream (mapcat :flow/to true-fcs false-fcs)
-         compiled (c/compile-fc-norms flow-conditions :a)
-         event {:onyx.core/compiled-norm-fcs compiled}
+         event (c/flow-conditions->event-map {} flow-conditions :a)
          results (r/route-data event nil nil flow-conditions downstream)]
      (is (= (into #{} (mapcat :flow/to true-fcs)) (into #{} (:flow results))))
      (is (nil? (:action results))))))
@@ -159,8 +157,7 @@
                      (maybe-predicate)))]
    (let [flow-conditions (into (into (into false-1 true-1) false-1) mixed-1)
          downstream (mapcat :flow/to flow-conditions)
-         compiled (c/compile-fc-norms flow-conditions :a)
-         event {:onyx.core/compiled-norm-fcs compiled}
+         event (c/flow-conditions->event-map {} flow-conditions :a)
          results (r/route-data event nil nil flow-conditions downstream)]
      (is (= (into #{} (:flow/to (first true-1))) (into #{} (:flow results))))
      (is (nil? (:action results))))))
@@ -205,8 +202,7 @@
    (let [all [retry-false retry-true retry-mixed ss exceptions mixed]
          flow-conditions (apply concat all)
          downstream (mapcat :flow/to flow-conditions)
-         compiled (c/compile-fc-norms flow-conditions :a)
-         event {:onyx.core/compiled-norm-fcs compiled}
+         event (c/flow-conditions->event-map {} flow-conditions :a)
          results (r/route-data event nil nil flow-conditions downstream)]
      (is (not (seq (:flow results))))
      (is (= :retry (:action results))))))
@@ -226,8 +222,7 @@
                        (flow-to-tasks-gen)
                        (false-flow-condition-gen))]))]
    (let [downstream (mapcat :flow/to mixed)
-         compiled (c/compile-fc-norms mixed :a)
-         event {:onyx.core/compiled-norm-fcs compiled}
+         event (c/flow-conditions->event-map {} mixed :a)
          results (r/route-data event nil nil mixed downstream)
          matches (filter :pred/val mixed)
          excluded-keys (mapcat :flow/exclude-keys matches)]
@@ -261,8 +256,7 @@
                      (maybe-predicate)))]
    (let [fcs [false-all true-all mixed-all mixed-none]
          downstream (mapcat :flow/to fcs)
-         compiled (c/compile-fc-norms fcs :a)
-         event {:onyx.core/compiled-norm-fcs compiled}
+         event (c/flow-conditions->event-map {} fcs :a)
          results (r/route-data event nil nil fcs downstream)]
      (is (= (into #{} downstream) (into #{} (:flow/to results))))
      (is (nil? (:action results))))))
@@ -294,8 +288,7 @@
                      (maybe-predicate)))]
    (let [fcs [false-none true-none mixed-none mixed]
          downstream (mapcat :flow/to fcs)
-         compiled (c/compile-fc-norms fcs :a)
-         event {:onyx.core/compiled-norm-fcs compiled}
+         event (c/flow-conditions->event-map {} fcs :a)
          results (r/route-data event nil nil fcs downstream)]
      (is (not (seq (:flow/to results))))
      (is (nil? (:action results))))))
@@ -326,8 +319,7 @@
                      (maybe-predicate)))]
    (let [fcs [false-xform true-xform mixed]
          downstream (mapcat :flow/to fcs)
-         compiled (c/compile-fc-norms fcs :a)
-         event {:onyx.core/compiled-norm-fcs compiled}
+         event (c/flow-conditions->event-map {} fcs :a)
          results (r/route-data event nil nil fcs downstream)
          xform (:flow/post-transformation (first true-xform))]
      (is (= xform (:post-transformation results)))
@@ -348,10 +340,7 @@
    (let [inner-error (ex-info "original error" {})
          message (ex-info "exception" {:exception inner-error})
          downstream (mapcat :flow/to fcs)
-         compiled-hp (c/compile-fc-norms fcs :a)
-         compiled-ex (c/compile-fc-exs fcs :a)
-         event {:onyx.core/compiled-norm-fcs compiled-hp
-                :onyx.core/compiled-ex-fcs compiled-ex}
+         event (c/flow-conditions->event-map {} fcs :a)
          routes (r/route-data event nil message fcs downstream)]
      (is (= message (r/flow-conditions-transform message routes fcs event))))))

@@ -370,10 +359,7 @@
    (let [inner-error (ex-info "original error" {})
          message (ex-info "exception" {:exception inner-error})
          downstream (mapcat :flow/to fcs)
-         compiled-hp (c/compile-fc-norms fcs :a)
-         compiled-ex (c/compile-fc-exs fcs :a)
-         event {:onyx.core/compiled-norm-fcs compiled-hp
-                :onyx.core/compiled-ex-fcs compiled-ex}
+         event (c/flow-conditions->event-map {} fcs :a)
          routes (r/route-data event nil message fcs downstream)
          transformed (reduce dissoc post-transformed-segment (:exclusions routes))]
      (is (= transformed (r/flow-conditions-transform message routes fcs event))))))
@@ -389,8 +375,7 @@
                      (maybe-predicate)))]
    (let [segment (zipmap (mapcat :flow/exclude-keys fcs) (repeat 0))
          downstream (mapcat :flow/to fcs)
-         compiled-hp (c/compile-fc-norms fcs :a)
-         event {:onyx.core/compiled-norm-fcs compiled-hp}
+         event (c/flow-conditions->event-map {} fcs :a)
          routes (r/route-data event nil segment fcs downstream)
          exclusions (mapcat :flow/exclude-keys (filter :pred/val fcs))
          filtered-segment (reduce dissoc segment exclusions)]


new test for jetty-adapter request translation This ensures that the ring-jetty-adapter calls the handler with a ring request map that is compliant with the ring SPEC

--- ring-jetty-adapter/test/ring/adapter/test/jetty.clj
+++ ring-jetty-adapter/test/ring/adapter/test/jetty.clj
@@ -16,6 +16,11 @@
    {:status  200
     :headers {"Content-Type" content-type}
     :body    ""}))
+
+(defn- echo-handler [request]
+  {:status 200
+   :headers {"request-map" (str (dissoc request :body))}
+   :body (:body request)})

 (defmacro with-server [app options & body]
   `(let [server# (run-jetty ~app ~(assoc options :join? false))]
@@ -81,4 +86,22 @@
     (with-server (content-type-handler "text/plain;charset=UTF-16;version=1") {:port 4347}
       (let [response (http/get "http://localhost:4347")]
         (is (= (get-in response [:headers "content-type"])
-               "text/plain;charset=UTF-16;version=1"))))))
+               "text/plain;charset=UTF-16;version=1")))))
+
+  (testing "request translation"
+    (with-server echo-handler {:port 4347}
+      (let [response (http/get "http://localhost:4347/foo/bar/baz?surname=jones&age=123" {:body "hello"})]
+        (is (= (:status response) 200))
+        (is (= (:body response) "hello"))
+        (let [request-map (read-string (get-in response [:headers "request-map"]))]
+          (is (= (:query-string request-map) "surname=jones&age=123"))
+          (is (= (:uri request-map) "/foo/bar/baz"))
+          (is (= (:content-length request-map) 5))
+          (is (= (:character-encoding request-map) "UTF-8"))
+          (is (= (:request-method request-map) :get))
+          (is (= (:content-type request-map) "text/plain; charset=UTF-8"))
+          (is (= (:remote-addr request-map) "127.0.0.1"))
+          (is (= (:scheme request-map) :http))
+          (is (= (:server-name request-map) "localhost"))
+          (is (= (:server-port request-map) 4347))
+          (is (= (:ssl-client-cert request-map) nil)))))))


(PDB-4897) Correct :source-tables for catalog inputs queries

Fix the :source-tables metadata for the catalog inputs queries They
were incorrectly using :source-table and providing a string, not a
set, but given the current uses of the data, that may not have
affected anything.

--- src/puppetlabs/puppetdb/query_eng/engine.clj
+++ src/puppetlabs/puppetdb/query_eng/engine.clj
@@ -901,7 +901,7 @@
      :entity :catalog-input-contents
      :alias "catalog_input_contents"
      :subquery? false
-     :source-table "catalog_inputs"}))
+     :source-tables #{"catalog_inputs"}}))

 (def catalog-inputs-query
   "Query for the catalog-inputs entity"
@@ -909,35 +909,35 @@
    {::which-query :catalog-inputs
     :can-drop-unused-joins? true
     :projections
-     {"certname" {:type :string
-                  :queryable? true
-                  :field :certnames.certname
-                  :join-deps #{:certnames}}
-      "producer_timestamp" {:type :timestamp
-                            :queryable? true
-                            :field :certnames.catalog_inputs_timestamp
-                            :join-deps #{:certnames}}
-      "catalog_uuid" {:type :string
-                      :queryable? true
-                      :field (hsql-uuid-as-str :certnames.catalog_inputs_uuid)
-                      :join-deps #{:certnames}}
-      "inputs" {:type :array
-                :queryable? true
-                :field :ci.inputs
-                :join-deps #{:ci}}}
-     :selection {:from [:certnames]
-                 :join [[{:select [:certname_id
-                                   [(hcore/raw "array_agg(array[catalog_inputs.type, name])") :inputs]]
-                          :from [:catalog_inputs]
-                          :group-by [:certname_id]} :ci]
-                        [:= :certnames.id :ci.certname_id]]
-                 :where [:<> :certnames.catalog_inputs_timestamp nil]}
-     :relationships certname-relations
-
-     :entity :catalog-inputs
-     :alias "catalog_inputs"
-     :subquery? false
-     :source-table "certnames"}))
+    {"certname" {:type :string
+                 :queryable? true
+                 :field :certnames.certname
+                 :join-deps #{:certnames}}
+     "producer_timestamp" {:type :timestamp
+                           :queryable? true
+                           :field :certnames.catalog_inputs_timestamp
+                           :join-deps #{:certnames}}
+     "catalog_uuid" {:type :string
+                     :queryable? true
+                     :field (hsql-uuid-as-str :certnames.catalog_inputs_uuid)
+                     :join-deps #{:certnames}}
+     "inputs" {:type :array
+               :queryable? true
+               :field :ci.inputs
+               :join-deps #{:ci}}}
+    :selection {:from [:certnames]
+                :join [[{:select [:certname_id
+                                  [(hcore/raw "array_agg(array[catalog_inputs.type, name])") :inputs]]
+                         :from [:catalog_inputs]
+                         :group-by [:certname_id]} :ci]
+                       [:= :certnames.id :ci.certname_id]]
+                :where [:<> :certnames.catalog_inputs_timestamp nil]}
+    :relationships certname-relations
+
+    :entity :catalog-inputs
+    :alias "catalog_inputs"
+    :subquery? false
+    :source-tables #{"certnames"}}))

 (def edges-query
   "Query for catalog edges"


fix typo and indent for readability

fix typo and indent for readability

--- src/babel/english/lexicon.clj
+++ src/babel/english/lexicon.clj
@@ -1230,16 +1230,16 @@
                           :sem {:pred :understand}}}

    "understand (deeply)" {:synsem {:cat :verb
-                            :sem {:pred :understand-deeply}}
-                   :english {:present {:3sing "understands (deeply)"}
-                             :past "understood (deeply)"
-                             :participle "understanding (deeply)"}}
+                                   :sem {:pred :understand-deeply}}
+                          :english {:present {:3sing "understands (deeply)"}
+                                    :past "understood (deeply)"
+                                    :participle "understanding (deeply)"}}

-"understand (simply)" {:synsem {:cat :verb
-                            :sem {:pred :understand-deeply}}
-                   :english {:present {:3sing "understands (simply)"}
-                             :past "understood (simply)"
-                             :participle "understanding (simply)"}}
+   "understand (simply)" {:synsem {:cat :verb
+                                   :sem {:pred :understand-simply}}
+                          :english {:present {:3sing "understands (simply)"}
+                                    :past "understood (simply)"
+                                    :participle "understanding (simply)"}}

    "upload"  {:synsem {:cat :verb
                        :sem {:pred :caricare}}}


remove dead code

remove dead code

--- src/babel/francais/writer.clj
+++ src/babel/francais/writer.clj
@@ -13,10 +13,6 @@

 (defn rewrite-lexicon []
   (write-lexicon "fr" lexicon))
-
-(defn expression [& [spec]]
-  (let [spec (if spec spec :top)]
-    (generate/generate spec medium)))

 (defn tout [ & [count]]
   (let [use-map-fn map


add TODO comment

add TODO comment

--- src/babel/italiano/writer.clj
+++ src/babel/italiano/writer.clj
@@ -59,12 +59,28 @@
                                                                 (let [spec (unify spec
                                                                                {:comp {:synsem {:agr {:number number}}}})]
                                                                   (log/debug (str "generating from spec: " spec))
-                                                                  (process [{:fill-one-language
-                                                                             {:count 1
-                                                                              :spec spec
-                                                                              :model small
-                                                                              }}]
-                                                                "it")))
+                                                                  (try
+                                                                    (process [{:fill-one-language
+                                                                               {:count 1
+                                                                                :spec spec
+                                                                                :model small
+                                                                                }}]
+                                                                             "it")
+                                                                    (catch Exception e
+                                                                      (cond
+
+                                                                       ;; TODO: make this conditional on
+                                                                       ;; there being a legitimate reason for the exception -
+                                                                       ;; e.g. the verb is "funzionare" (which takes a non-human
+                                                                       ;; subject), but we're trying to generate with
+                                                                       ;; {:agr {:person :1st or :2nd}}, for which the only lexemes
+                                                                       ;; are human.
+                                                                       true
+
+                                                                       (log/warn (str "ignoring exception: " e))
+                                                                       false
+                                                                       (throw e))))
+                                                                  ))
                                                               [:sing :plur]))))
                                                     [:1st :2nd :3rd]))))
                                           (cond (= tense


BUGFIX: custom css and js files should be appended to the end of the list to be able to override default behavior

--- src/de/otto/oscillator/view/layout.clj
+++ src/de/otto/oscillator/view/layout.clj
@@ -57,22 +57,22 @@
     [:li (link/nav-link-vertical-button url-params {:until "-1min"} "0")]]])

 (defn css-files [context-path]
-  (map #(str context-path %)
-       ["/stylesheets/rickshaw/layout.css"
-        "/stylesheets/rickshaw/graph.css"
-        "/stylesheets/rickshaw/detail.css"
-        "/stylesheets/rickshaw/legend.css"
-        "/stylesheets/rickshaw/annotations.css"
-        "/stylesheets/base.css"
-        "/stylesheets/navigation.css"
-        "/stylesheets/button.css"]))
+  (into [] (map #(str context-path %)
+                ["/stylesheets/rickshaw/layout.css"
+                 "/stylesheets/rickshaw/graph.css"
+                 "/stylesheets/rickshaw/detail.css"
+                 "/stylesheets/rickshaw/legend.css"
+                 "/stylesheets/rickshaw/annotations.css"
+                 "/stylesheets/base.css"
+                 "/stylesheets/navigation.css"
+                 "/stylesheets/button.css"])))

 (defn js-files [context-path]
-  (map #(str context-path %)
-       ["/javascript/vendor/d3.v3.js"
-        "/javascript/vendor/jquery-2.1.4.min.js"
-        "/javascript/vendor/rickshaw.js"
-        "/javascript/gen/oscillator.js"]))
+  (into [] (map #(str context-path %)
+                ["/javascript/vendor/d3.v3.js"
+                 "/javascript/vendor/jquery-2.1.4.min.js"
+                 "/javascript/vendor/rickshaw.js"
+                 "/javascript/gen/oscillator.js"])))

 (defn common [& {:keys [context-path title pages environments page-identifier add-js-files add-css-files url-params content]}]
   (h/html5


Pass volume number and year encoded in brl:class names

--- src/catalog/layout/dtbook.clj
+++ src/catalog/layout/dtbook.clj
@@ -3,6 +3,7 @@
   XML](http://www.daisy.org/z3986/2005/Z3986-2005.html) to be
   converted to Braille later in the tool chain"
   (:require [catalog.layout.common :as layout]
+            [clj-time.coerce :as time.coerce]
             [clj-time.core :as time.core]
             [clojure.data.xml :as xml]))

@@ -50,7 +51,7 @@
                 {:keys [creator volume date language]
                  :or {creator "SBS Schweizerische Bibliothek für Blinde, Seh- und Lesebehinderte"
                       volume (layout/volume-number (time.core/today))
-                      date (layout/format-date (time.core/now))
+                      date (time.coerce/to-date (time.core/today))
                       language "de"}}]
   [:dtbook {:xmlns "http://www.daisy.org/z3986/2005/dtbook/"
             :xmlns:brl "http://www.daisy.org/z3986/2009/braille/"
@@ -69,8 +70,8 @@
      [:doctitle title]
      [:docauthor creator]
      [:level1 [:h1]
-      [:p {:class "Heftnummer"} volume]
-      [:p {:class "Datum"} date]]]
+      [:p {:brl:class (format "nr_%s" volume)}]
+      [:p {:brl:class (format "jr_%s" (layout/year date))}]]]
     [:bodymatter
      [:level1 [:h1 "Editorial"] [:p]]
      (for [genre layout/braille-genres] (genre-entries genre items))


Let all user actions (run, abort, retry...) be traceable

--- src/cider_ci/builder/jobs.clj
+++ src/cider_ci/builder/jobs.clj
@@ -59,8 +59,8 @@
          (rdbms/get-ds)
          :jobs
          (select-keys params
-                      [:tree_id, :job_specification_id,
-                       :name, :description, :priority, :key]))
+                      [:tree_id, :job_specification_id, :created_by
+                       :name, :description, :priority, :key, :user_id]))
        first))

@@ -73,7 +73,7 @@
                        {:key job-key :name job-key}
                        (select-keys spec [:name, :description, :priority])
                        {:job_specification_id spec-id}
-                       (select-keys params [:tree_id :priority]))
+                       (select-keys params [:tree_id :priority :created_by]))
           job (persist-job job-params)]
       (invoke-create-tasks-and-trials job))))


Update web-server (#5097)

Update web-server (#5097)

--- frameworks/Clojure/reitit/project.clj
+++ frameworks/Clojure/reitit/project.clj
@@ -1,7 +1,7 @@
 (defproject hello "reitit"
   :description "pohjavirta, reitit, jsonista & porsas"
   :dependencies [[org.clojure/clojure "1.10.1"]
-                 [metosin/pohjavirta "0.0.1-alpha4"]
+                 [metosin/pohjavirta "0.0.1-alpha5"]
                  [metosin/porsas "0.0.1-alpha13"]
                  [metosin/jsonista "0.2.4"]
                  [metosin/reitit "0.3.9"]


Don't call method Java.startsWith directly in the module emender-jenkins/server

--- src/emender_jenkins/server.clj
+++ src/emender_jenkins/server.clj
@@ -18,6 +18,7 @@

 (require '[emender-jenkins.config   :as config])
 (require '[emender-jenkins.rest-api :as rest-api])
+(use     '[emender-jenkins.utils])

 (defn return-file
     "Creates HTTP response containing content of specified file.
@@ -45,12 +46,12 @@
     "Retrieve the actual command from the API call."
     [uri prefix]
     (if uri
-        (if (.startsWith uri prefix)
+        (if (startsWith uri prefix)
             (let [uri-without-prefix (subs uri (count prefix))]
                 (if (empty? uri-without-prefix) ; special handler for a call with / only
                     ""
                  (let [api-part (re-find #"/[^/]*" (subs uri (count prefix)))]
-                    (if (and api-part (.startsWith api-part "/"))
+                    (if (and api-part (startsWith api-part "/"))
                         (subs api-part 1)
                         api-part)))))))

@@ -113,7 +114,7 @@
           :else
         (let [uri    (:uri request)
               method (:request-method request)]
-             (if (.startsWith uri (config/get-api-prefix request))
+             (if (startsWith uri (config/get-api-prefix request))
                  (api-call-handler     request uri method)
                  (non-api-call-handler request uri)))))


load the chunks model without having to specify the database connection

--- src/bitfondue/models/chunks.clj
+++ src/bitfondue/models/chunks.clj
@@ -5,13 +5,9 @@
 (defn insert-chunk!
   "Insert a chunk into the database"
   [chunk]
-  (database/insert-chunk<! config/database
-                           (:title chunk)
-                           (:url chunk)
-                           (:description_full chunk)
-                           (:uid chunk)))
+  (database/insert-chunk<! chunk))

 (defn get-chunks
   "Retrieve chunks"
   []
-  (database/get-chunks config/database))
+  (database/get-chunks))


update version

update version

--- kafka-clj/src/kafka_clj/consumer/work_organiser.clj
+++ kafka-clj/src/kafka_clj/consumer/work_organiser.clj
@@ -229,8 +229,6 @@

         consume-step2 (if consume-step consume-step (get conf :consume-step 100000))]

-    (info "send-offsets-if-any!: group-name " group-name " offset-data2: " offset-data2)
-
     (doseq [{:keys [offset partition saved-offset all-offsets]} offset-data2]
       (swap! work-assigned-flag inc)


use filterv as told by kibit

use filterv as told by kibit

--- src/ctia/stores/atom/common.clj
+++ src/ctia/stores/atom/common.clj
@@ -82,14 +82,14 @@
      filter-map :- {s/Any s/Any}]

     (when-not (empty? filter-map)
-      (vec (filter (fn [model]
-                     (every? (fn [[k v]]
-                               (let [found-v (if (sequential? k)
-                                               (get-in model k ::not-found)
-                                               (get model k ::not-found))]
-                                 (match? found-v v)))
-                             filter-map))
-                   (vals (deref state)))))))
+      (filterv (fn [model]
+                 (every? (fn [[k v]]
+                           (let [found-v (if (sequential? k)
+                                           (get-in model k ::not-found)
+                                           (get model k ::not-found))]
+                             (match? found-v v)))
+                         filter-map))
+               (vals (deref state))))))

 (defn list-handler [Model]
   (s/fn :- (list-response-schema Model)