Made all internal functions private

Made all internal functions private

--- src/hiccup/core.clj
+++ src/hiccup/core.clj
@@ -26,7 +26,7 @@

 (def h escape-html)  ;; Alias for escape-html

-(defn tag-end
+(defn- tag-end
   "Return the ending part of a self-closing tag."
   []
   (if (= *html-mode* :xml)
@@ -38,7 +38,7 @@
   [name value]
   (str " " (as-str name) "=\"" (escape-html value) "\""))

-(defn render-attrs
+(defn- render-attrs
   "Turn a map into a string of sorted HTML attributes."
   [attrs]
   (apply str
@@ -61,12 +61,12 @@
       (and (seq? x)
            (not= (first x) `quote))))

-(defn compile-attrs
+(defn- compile-attrs
   "Turn a map with unevaluated symbols into an expression that will render the
   corresponding attributes."
   [attrs]
   (if (some uneval? (mapcat identity attrs))
-    `(render-attrs ~attrs)
+    `(#'render-attrs ~attrs)
     (render-attrs attrs)))

 (defvar- re-tag
@@ -97,7 +97,7 @@

 (declare render-html)

-(defn render-tag
+(defn- render-tag
   "Render a HTML tag represented as a vector."
   [element]
   (let [[tag attrs content] (parse-element element)]
@@ -107,7 +107,7 @@
            "</" tag ">")
       (str "<" tag (render-attrs attrs) (tag-end)))))

-(defn render-html
+(defn- render-html
   "Render a Clojure data structure to a string of HTML."
   [data]
   (cond
@@ -127,7 +127,7 @@
   (if-let [hint (-> x meta :tag)]
     (isa? (eval hint) type)))

-(defn literal?
+(defn- literal?
   "True if x is a literal value that can be rendered as-is."
   [x]
   (and (not (uneval? x))
@@ -153,16 +153,16 @@
             ~(str "</" tag ">"))
       `(str "<" ~tag ~(compile-attrs attrs) ~(tag-end)))))

-(defn compile-lit-tag
+(defn- compile-lit-tag
   "Compile an element when only the tag is literal."
   [tag [attrs & content :as element]]
   (let [[tag tag-attrs _] (parse-element [tag])]
     `(if (map? ~attrs)
        ~(if (or content (container-tags tag))
-          `(str ~(str "<" tag) (render-attrs (merge ~tag-attrs ~attrs)) ">"
+          `(str ~(str "<" tag) (#'render-attrs (merge ~tag-attrs ~attrs)) ">"
                 ~@(compile-html content)
                 ~(str "</" tag ">"))
-          `(str ~(str "<" tag) (render-attrs (merge ~tag-attrs ~attrs))
+          `(str ~(str "<" tag) (#'render-attrs (merge ~tag-attrs ~attrs))
                 ~(tag-end)))
        ~(if (or element (container-tags tag))
           `(str ~(str "<" tag (render-attrs tag-attrs) ">")
@@ -187,7 +187,7 @@
     (literal? tag)
       (compile-lit-tag tag (cons attrs content))
     :else
-      `(render-tag
+      `(#'render-tag
          [~(first element)
           ~@(for [x (rest element)]
               (if (vector? x)
@@ -209,7 +209,7 @@

 (defmethod compile-form :default
   [expr]
-  `(render-html ~expr))
+  `(#'render-html ~expr))

 (defn- collapse-strs
   "Collapse nested str expressions into one, where possible."
@@ -234,7 +234,7 @@
       (hint? expr String) expr
       (hint? expr Number) expr
       (seq? expr) (compile-form expr)
-      :else `(render-html ~expr))))
+      :else `(#'render-html ~expr))))

 (defmacro html
   "Render Clojure data structures to a string of HTML."


Fix comment.

Fix comment.

--- src/oc/storage/api/topics.clj
+++ src/oc/storage/api/topics.clj
@@ -90,7 +90,7 @@

 (defn routes [sys]
   (let [db-pool (-> sys :db-pool :pool)]
-    ;; Requests are also routed here from enties-api's routes
+    ;; Requests are also routed here from entries-api's routes (see: dispatch fn)
     (compojure/routes
       ;; Topic list operations
       (OPTIONS "/orgs/:org-slug/boards/:board-slug/topics/new" [org-slug board-slug]


Be explicit about device type being bound.

--- src/afterglow/controllers/ableton_push.clj
+++ src/afterglow/controllers/ableton_push.clj
@@ -1774,7 +1774,7 @@
                     (let [port-in (first (amidi/filter-devices device-filter (amidi/open-inputs-if-needed!)))
                           port-out (first (amidi/filter-devices device-filter (amidi/open-outputs-if-needed!)))]
                       (when (every? some? [port-in port-out])  ; We found our Push! Bind to it in the background.
-                        (timbre/info "Auto-binding to" device)
+                        (timbre/info "Auto-binding to Ableton Push" device)
                         (future
                           (reset! controller (bind-to-show show :device-filter device-filter
                                                            :refresh-interval refresh-interval


map github with first email match

map github with first email match

--- auth/src/com/sixsq/slipstream/auth/github.clj
+++ auth/src/com/sixsq/slipstream/auth/github.clj
@@ -34,11 +34,9 @@
   (if-let [user-name-mapped (db/find-username-by-authn "github" (:login github-user-info))]
     (user-already-mapped user-name-mapped)
     (let [user-names-same-email (db/find-usernames-by-email (:email github-user-info))]
-      (condp = (count user-names-same-email)
-        0 (create-slipstream-user-from-github! github-user-info)
-        1 (map-slipstream-github! (first user-names-same-email) (:login github-user-info))
-        ;; TODO multiple emails match github email
-        "joe"))))
+      (if (empty? user-names-same-email)
+        (create-slipstream-user-from-github! github-user-info)
+        (map-slipstream-github! (first user-names-same-email) (:login github-user-info))))))

 (defn callback-github
   [request redirect-server]


Handle effect ending while adjusting, full list.

--- src/afterglow/controllers/ableton_push.clj
+++ src/afterglow/controllers/ableton_push.clj
@@ -692,7 +692,9 @@
   variable map."
   [controller cue v]
   (with-show (:show controller)
-    (show/get-variable (find-cue-variable-keyword controller cue v))))
+    (when-let [k (find-cue-variable-keyword controller cue v)]
+      ;; Effect is still running to look up value
+      (show/get-variable k))))

 (defn- set-cue-variable-value
   "Sets the current value of a cue variable, which may be directly
@@ -700,18 +702,21 @@
   for the cue, whose name needs to be looked up in the effect's
   variable map."
   [controller cue v value]
-  (with-show (:show controller)
-    (show/set-variable! (find-cue-variable-keyword controller cue v) value)))
+  (when-let [k (find-cue-variable-keyword controller cue v)]
+    (with-show (:show controller)
+      (show/set-variable! k value))))

 (defn- fit-cue-variable-value
   "Truncates the current value of a cue variable to fit available
   space."
   [controller cue v len]
   (let [val (find-cue-variable-value controller cue v)
-        formatted (case (:type v)
-                    :integer (int val)
-                    ;; If we don't know what else to do, at least turn ratios to floats
-                    (float val))
+        formatted (if val
+                    (case (:type v)
+                      :integer (int val)
+                      ;; If we don't know what else to do, at least turn ratios to floats
+                      (float val))
+                    "<ended>")
         padding (apply str (repeat len " "))]
     (apply str (take len (str formatted padding)))))

@@ -1299,6 +1304,13 @@
         delta (* (sign-velocity (:velocity message)) resolution)]
     (set-cue-variable-value controller cue v (max low (min high (+ value delta))))))

+(defn- same-effect-active
+  "See if the specified effect is still active with the same id."
+  [controller cue id]
+  (with-show (:show controller)
+    (let [effect-found (show/find-effect (:key cue))]
+      (and effect-found (= (:id effect-found) id)))))
+
 (defn- display-encoder-touched
   "One of the eight encoders above the text display was touched."
   [controller note]
@@ -1306,7 +1318,7 @@
         fx-info @(:active-effects (:show controller))
         fx (:effects fx-info)
         fx-meta (:meta fx-info)
-        offset (- 4 room)
+        offset (if (<= (count fx) room) (- 4 room) 0)
         x (quot note 2)
         index (- x offset)
         var-index (rem note 2)]
@@ -1324,8 +1336,9 @@
                              (captured-controls [this] #{(control-for-top-encoder-note note)})
                              (captured-notes [this] #{note paired-note})
                              (adjust-interface [this controller]
-                               (draw-variable-gauge controller x 17 0 cue (first (:variables cue)))
-                               true)
+                               (when (same-effect-active controller cue (:id info))
+                                 (draw-variable-gauge controller x 17 0 cue (first (:variables cue)))
+                                 true))
                              (handle-control-change [this controller message]
                                (adjust-variable-value controller message cue (first (:variables cue))))
                              (handle-note-on [this controller message]
@@ -1339,9 +1352,10 @@
                            (captured-controls [this] #{(control-for-top-encoder-note note)})
                            (captured-notes [this] #{note})
                            (adjust-interface [this controller]
-                             (draw-variable-gauge controller x 8 (* 9 var-index)
-                                                  cue (get (:variables cue) var-index))
-                             true)
+                             (when (same-effect-active controller cue (:id info))
+                               (draw-variable-gauge controller x 8 (* 9 var-index)
+                                                    cue (get (:variables cue) var-index))
+                               true))
                            (handle-control-change [this controller message]
                              (adjust-variable-value controller message cue (get (:variables cue) var-index)))
                            (handle-note-on [this controller message]


Improve styling of auth-view

Improve styling of auth-view

--- src/braid/client/register/styles/user.cljs
+++ src/braid/client/register/styles/user.cljs
@@ -17,9 +17,6 @@
       (vars/small-button-mixin)]]

     [:.authed-user
-
-     [:p
-      {:text-align "center"}]

      [:.profile
       (vars/padded-with-border-mixin)
@@ -42,7 +39,11 @@
          :font-weight "bold"}]

        [:.email
-        {}]]]]
+        {}]]]
+
+     [:p
+      {:text-align "center"
+       :margin-top "2rem"}]]

     [:.checking
      :.authorizing


fix delay default value

fix delay default value

--- src/clj/swarmpit/docker/mapper/inbound.clj
+++ src/clj/swarmpit/docker/mapper/inbound.clj
@@ -104,7 +104,7 @@
   [service]
   (let [update-config (get-in service [:Spec :UpdateConfig])]
     {:parallelism   (:Parallelism update-config)
-     :delay         (:Delay update-config)
+     :delay         (or (:Delay update-config) 0)
      :failureAction (:FailureAction update-config)}))

 (defn ->service-replicas-running


don't need a named function for this

don't need a named function for this

--- src/cljx/jamesmacaulay/zelkova/signal.cljx
+++ src/cljx/jamesmacaulay/zelkova/signal.cljx
@@ -22,10 +22,6 @@
             [alandipert.kahn :as kahn])
   (:require-macros [cljs.core.async.macros :refer [go go-loop]]))

-(defn gen-topic
-  []
-  (keyword (gensym)))
-
 (defrecord Event
   [topic value])

@@ -92,7 +88,7 @@
                            topic))

 (defn input
-  ([init] (input init (gen-topic)))
+  ([init] (input init (keyword (gensym))))
   ([init topic]
    (map->Signal {:init init
                  :message-emitter (event-relay #{topic})}))


Added new generic error message.

Added new generic error message.

--- src/cmr/exchange/common/results/errors.clj
+++ src/cmr/exchange/common/results/errors.clj
@@ -28,6 +28,9 @@

 (def invalid-parameter
   "One or more of the parameters provided were invalid.")
+
+(def missing-parameters
+  "The following required parameters are missing from the request:")

 (def status-map
   "This is a lookup data structure for how HTTP status/error codes map to CMR


Parallelize catalog retrieval during export

--- src/com/puppetlabs/puppetdb/cli/export.clj
+++ src/com/puppetlabs/puppetdb/cli/export.clj
@@ -61,22 +61,40 @@
     ;;  version of a command is.  We should improve that.
     {:replace-catalog 2}})

+(defn get-catalog-for-node
+  "Utility function for retrieving catalog data from the PuppetDB web service.
+  Returns a map containing the node name and the corresponding catalog; this
+  allows us to run this function against multiple nodes in parallel, and still
+  be able to identify which node we've retrieved the data for when it returns."
+  [host port node]
+  {:pre  [(string? host)
+          (integer? port)
+          (string? node)]
+   :post [(map? %)
+          (contains? % :node)
+          (contains? % :catalog)]}
+  {:node    node
+   :catalog (catalog-for-node host port node)})
+
 (defn -main
   [& args]
-  (let [specs       [["-o" "--outfile" "Path to backup file (required)"]
-                     ["-H" "--host" "Hostname of PuppetDB server" :default "localhost"]
-                     ["-p" "--port" "Port to connect to PuppetDB server" :default 8080]]
-        required    [:outfile]
+  (let [specs          [["-o" "--outfile" "Path to backup file (required)"]
+                        ["-H" "--host" "Hostname of PuppetDB server" :default "localhost"]
+                        ["-p" "--port" "Port to connect to PuppetDB server" :default 8080]]
+        required       [:outfile]
         [{:keys [outfile host port]} _] (cli! args specs required)
-        nodes       (get-active-node-names host port)]
+        nodes          (get-active-node-names host port)
+        get-catalog-fn (partial get-catalog-for-node host port)]
 ;; TODO: do we need to deal with SSL or can we assume this only works over a plaintext port?

     (with-open [tar-writer (archive/tarball-writer outfile)]
       (archive/add-entry tar-writer
         (.getPath (io/file export-root-dir export-metadata-file-name))
         (json/generate-string export-metadata {:pretty true}))
-      (doseq [node nodes]
-        (println (format "Exporting catalog for node '%s'" node))
+      ;; we can use a pmap call to retrieve the catalogs in parallel, so long
+      ;; as we only touch the tar stream from a single thread.
+      (doseq [{:keys [node catalog]} (pmap get-catalog-fn nodes)]
+        (println (format "Writing catalog for node '%s'" node))
         (archive/add-entry tar-writer
           (.getPath (io/file export-root-dir "catalogs" (format "%s.json" node)))
-          (catalog-for-node host port node))))))
+          catalog)))))


load non-text returns as error

load non-text returns as error

--- src/ads_txt_crawler/process.clj
+++ src/ads_txt_crawler/process.clj
@@ -60,7 +60,8 @@
             (.println *err* (format "Error: headers are blank for %s" url))
             ;; the content-type needs to be text/plain
             (if (is-text url headers)
-              (remove nil? (map process-line (clojure.string/split-lines body))))))
+              (remove nil? (map process-line (clojure.string/split-lines body)))
+              (.println *err* (format "Error: non-text result for %s" url)))))
         (.println *err* (format "Error: Unknown issue calling %s" url))))))

 (defn build-url [domain]


Reformat

Reformat

--- src/aphyr_clojure_book/core.clj
+++ src/aphyr_clojure_book/core.clj
@@ -7,29 +7,29 @@
                             SimpleXmlSerializer]))

 ; Steps functions
-(defn download
-    [uri to-file]
-    (with-open [in (io/input-stream uri)
-                out (io/output-stream to-file)]
-        (io/copy in out)))
+(defn download
+  [uri to-file]
+  (with-open [in (io/input-stream uri)
+              out (io/output-stream to-file)]
+    (io/copy in out)))

 (defn clean
-    [^java.io.File in ^java.io.File out]
-    (let [props (CleanerProperties.)]
-        (doto props
-            (.setTranslateSpecialEntities false)
-            (.setTransResCharsToNCR false)
-            (.setOmitComments false))
-        (let [cleaner (HtmlCleaner. props)
-              cleaned (.clean cleaner in)]
-            (let [serializer (SimpleXmlSerializer. props)]
-                (.writeToFile serializer cleaned (.getPath out) "utf-8")))))
+  [^java.io.File in ^java.io.File out]
+  (let [props (CleanerProperties.)]
+    (doto props
+      (.setTranslateSpecialEntities false)
+      (.setTransResCharsToNCR false)
+      (.setOmitComments false))
+    (let [cleaner (HtmlCleaner. props)
+          cleaned (.clean cleaner in)]
+      (let [serializer (SimpleXmlSerializer. props)]
+        (.writeToFile serializer cleaned (.getPath out) "utf-8")))))

-(defn transform
-    [input xsl output]
-    (let [comp-input (xml/compile-xml input)
-          comp-xsl (xml/compile-xslt xsl)]
-        (xml/serialize (comp-xsl comp-input) output [[:method "xml"]])))
+(defn transform
+  [input xsl output]
+  (let [comp-input (xml/compile-xml input)
+        comp-xsl (xml/compile-xslt xsl)]
+    (xml/serialize (comp-xsl comp-input) output [[:method "xml"]])))


give video sim source on command-line

give video sim source on command-line

--- src/sormilla/video_sim.clj
+++ src/sormilla/video_sim.clj
@@ -40,8 +40,8 @@
     (catch java.io.EOFException _
       nil)))

-(defn load-frames []
-  (with-open [i (io/input-stream (io/file "capture.h264"))]
+(defn load-frames [source]
+  (with-open [i (io/input-stream (io/file source))]
     (doall (take-while identity (repeatedly (partial read-frame i))))))

 (defn serve-client! [^Socket s frames]
@@ -72,7 +72,7 @@

 (defn -main [& args]
   (println "video server initializing....")
-  (let [frames (load-frames)]
+  (let [frames (load-frames (or (first args) "capture.h264"))]
     (println "Loaded " (count frames) "frames.")
     (println "Server starting...")
     (start-server! frames)


Better styles for table heading

Better styles for table heading

--- src/arachnida/html_renderer.clj
+++ src/arachnida/html_renderer.clj
@@ -87,39 +87,46 @@
             [:div {:class "container"}
                 (render-navigation-bar-section)
                 [:h1 (str "Product: " product-name)]
-                [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
-                    (for [repository repositories]
-                        [:tr
-                            [:td (:name repository)]
-                            [:td (:url  repository)]])
-                ]
-                [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
-                    [:tr [:th {:colspan 2} "Summary for 2015"]]
-                    [:tr [:td "Commits:"]
-                         [:td (:commits_count statistic)]]
-                    [:tr [:td "Insertions:"]
-                         [:td (:insertions statistic)]]
-                    [:tr [:td "Deletions:"]
-                         [:td (:deletions statistic)]]
-                    [:tr [:td "Changed files:"]
-                         [:td (:files_changed statistic)]]
-                ]
-                [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
-                    [:tr [:th {:colspan 5} "Per repository statistic"]]
-                    [:tr [:th "Repository"] [:th {:colspan "4"} "Statistic"]]
-                    [:tr [:th " "]
-                         [:th "Commits"]
-                         [:th "Files"]
-                         [:th "Insertions"]
-                         [:th "Deletions"]]
-                    (for [pr product-repo]
-                        [:tr [:td (:reponame pr)]
-                             [:td (:commits_count pr)]
-                             [:td (:files_changed pr)]
-                             [:td (:insertions pr)]
-                             [:td (:deletions pr)]
-                        ]
-                    )]
+                [:div {:class "panel panel-primary"}
+                    [:div {:class "panel-heading"}
+                        "Repositories"]
+                    [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
+                        (for [repository repositories]
+                            [:tr
+                                [:td (:name repository)]
+                                [:td (:url  repository)]])
+                    ]]
+                [:div {:class "panel panel-primary"}
+                    [:div {:class "panel-heading"}
+                        "Summary for 2015"]
+                    [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
+                        [:tr [:td "Commits:"]
+                             [:td (:commits_count statistic)]]
+                        [:tr [:td "Insertions:"]
+                             [:td (:insertions statistic)]]
+                        [:tr [:td "Deletions:"]
+                             [:td (:deletions statistic)]]
+                        [:tr [:td "Changed files:"]
+                             [:td (:files_changed statistic)]]
+                    ]]
+                [:div {:class "panel panel-primary"}
+                    [:div {:class "panel-heading"}
+                        "Per repository statistic"]
+                    [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
+                        [:tr [:th "Repository"] [:th {:colspan "4"} "Statistic"]]
+                        [:tr [:th " "]
+                             [:th "Commits"]
+                             [:th "Files"]
+                             [:th "Insertions"]
+                             [:th "Deletions"]]
+                        (for [pr product-repo]
+                            [:tr [:td (:reponame pr)]
+                                 [:td (:commits_count pr)]
+                                 [:td (:files_changed pr)]
+                                 [:td (:insertions pr)]
+                                 [:td (:deletions pr)]
+                            ]
+                        )]]
                 [:br][:br][:br][:br]
                 (render-html-footer)
             ] ; </div class="container">
@@ -138,17 +145,19 @@
             [:div {:class "container"}
                 (render-navigation-bar-section)
                 [:h1 (str "Author: " author-name)]
-                [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
-                    [:tr [:th {:colspan 2} "Summary for 2015"]]
-                    [:tr [:td "Commits:"]
-                         [:td (:commits_count statistic)]]
-                    [:tr [:td "Insertions:"]
-                         [:td (:insertions statistic)]]
-                    [:tr [:td "Deletions:"]
-                         [:td (:deletions statistic)]]
-                    [:tr [:td "Changed files:"]
-                         [:td (:files_changed statistic)]]
-                ]
+                [:div {:class "panel panel-primary"}
+                    [:div {:class "panel-heading"}
+                        "Summary for 2015"]
+                    [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
+                        [:tr [:td "Commits:"]
+                             [:td (:commits_count statistic)]]
+                        [:tr [:td "Insertions:"]
+                             [:td (:insertions statistic)]]
+                        [:tr [:td "Deletions:"]
+                             [:td (:deletions statistic)]]
+                        [:tr [:td "Changed files:"]
+                             [:td (:files_changed statistic)]]
+                    ]]
                 [:h3 "Week stat"]
                 (flotr/line-chart "weeks statistic" "800px" "300px" week-graph-data
                                   :horizontal-lines true
@@ -161,26 +170,29 @@
                                   :vertical-lines true
                                   :show-legend true
                                   :legend-positon "sw")
-                [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
-                    [:tr [:th {:colspan 3} "Week statistic"]]
-                    [:tr [:th "Week"] [:th "From"] [:th "To"] [:th {:colspan "4"} "Statistic"]]
-                    [:tr [:th " "] [:th " "] [:th " "]
-                         [:th "Commits"]
-                         [:th "Files"]
-                         [:th "Insertions"]
-                         [:th "Deletions"]]
-                (for [week-stat weeks-stat]
-                    [:tr
-                         (if (= (str (:week week-stat)) selected-week) {:style "background-color:yellow"})
-                         (week-td author-name week-stat (:week week-stat))
-                         (week-td author-name week-stat (:first-day week-stat))
-                         (week-td author-name week-stat (:last-day week-stat))
-                         [:td {:style "text-align:right"} (:commits-count (:stat-for-author week-stat))]
-                         [:td {:style "text-align:right"} (:files-changed (:stat-for-author week-stat))]
-                         [:td {:style "text-align:right"} (:insertions (:stat-for-author week-stat))]
-                         [:td {:style "text-align:right"} (:deletions (:stat-for-author week-stat))]
-                     ])
-                ]
+                [:br]
+                [:div {:class "panel panel-primary"}
+                    [:div {:class "panel-heading"}
+                        "Week statistic"]
+                    [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
+                        [:tr [:th "Week"] [:th "From"] [:th "To"] [:th {:colspan "4"} "Statistic"]]
+                        [:tr [:th " "] [:th " "] [:th " "]
+                             [:th "Commits"]
+                             [:th "Files"]
+                             [:th "Insertions"]
+                             [:th "Deletions"]]
+                    (for [week-stat weeks-stat]
+                        [:tr
+                             (if (= (str (:week week-stat)) selected-week) {:style "background-color:yellow"})
+                             (week-td author-name week-stat (:week week-stat))
+                             (week-td author-name week-stat (:first-day week-stat))
+                             (week-td author-name week-stat (:last-day week-stat))
+                             [:td {:style "text-align:right"} (:commits-count (:stat-for-author week-stat))]
+                             [:td {:style "text-align:right"} (:files-changed (:stat-for-author week-stat))]
+                             [:td {:style "text-align:right"} (:insertions (:stat-for-author week-stat))]
+                             [:td {:style "text-align:right"} (:deletions (:stat-for-author week-stat))]
+                         ])
+                    ]]
                 [:br][:br][:br][:br]
                 (render-html-footer)
             ] ; </div class="container">
@@ -196,8 +208,10 @@
                 (render-navigation-bar-section)
                 [:h1 (str "Author: " author-name)]
                 [:h3 (str "Status for week: " selected-week)]
+                [:div {:class "panel panel-primary"}
+                    [:div {:class "panel-heading"}
+                        "Week statistic"]
                 [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
-                    [:tr [:th {:colspan 3} "Week statistic"]]
                     [:tr [:th "Product"] [:th "Repository"] [:th "Commits"] [:th "Files"] [:th "Insertions"] [:th "Deletions"]]
                 (for [s (:statistic-for-week stat-for-week)]
                     [:tr
@@ -208,7 +222,7 @@
                          [:td (:insertions s)]
                          [:td (:deletions s)]
                      ])
-                ]
+                ]]
                 [:br][:br][:br][:br]
                 (render-html-footer)
             ] ; </div class="container">
@@ -226,19 +240,22 @@
                 [:h3 (str "Status for week: " selected-week)]
                 [:h3 (str "Product " product)]
                 [:h3 (str "Repository: " repo)]
-                [:br][:br][:br][:br]
-                [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
-                    [:tr [:th "Date"] [:th "Message"] [:th "sha"]]
-                (for [c (:commits-for-week stat-for-week) :when (and (= repo (:repo c))
-                                                                     (= product (:product c)))]
-                    [:tr
-                         [:td (:date c)]
-                         [:td (:message c)]
-                         [:td (:sha c)]
-                     ])
-                ]
-                (render-html-footer)
-            ] ; </div class="container">
-        ] ; </body>
-    ))
-
+                [:br]
+                [:div {:class "panel panel-primary"}
+                    [:div {:class "panel-heading"}
+                        "Commits"]
+                    [:table {:class "table table-condensed table-hover table-bordered" :rules "all"}
+                        [:tr [:th "Date"] [:th "Message"] [:th "sha"]]
+                    (for [c (:commits-for-week stat-for-week) :when (and (= repo (:repo c))
+                                                                         (= product (:product c)))]
+                        [:tr
+                             [:td (:date c)]
+                             [:td (:message c)]
+                             [:td (:sha c)]
+                         ])
+                ]]
+                (render-html-footer)
+            ] ; </div class="container">
+        ] ; </body>
+    ))
+


render-html-header and render-html-footer

--- src/arachnida/html_renderer.clj
+++ src/arachnida/html_renderer.clj
@@ -1,2 +1,23 @@
 (ns arachnida.html-renderer)

+(defn render-html-header
+    "Renders part of HTML page - the header."
+    []
+    [:head
+        [:title "Arachnida"]
+        [:meta {:name "Author"    :content "Pavel Tisnovsky"}]
+        [:meta {:name "Generator" :content "Clojure"}]
+        [:meta {:http-equiv "Content-type" :content "text/html; charset=utf-8"}]
+        ;(page/include-css "http://torment.usersys.redhat.com/openjdk/style.css")]
+        (page/include-css "bootstrap.min.css")
+        (page/include-css "smearch.css")
+        (page/include-js  "bootstrap.min.js")
+    ] ; head
+)
+
+(defn render-html-footer
+    "Renders part of HTML page - the footer."
+    []
+    [:div (str "

Author: Pavel Tisnovsky <ptisnovs@redhat.com>   "
+          "
")])
+


cleanup code that was unnecessarily complicated due to efforts to fix deferred model construction

--- src/babel/reader.clj
+++ src/babel/reader.clj
@@ -163,42 +163,29 @@
                   ;; set to true or false, while subjects in English, at present, lack this
                   ;; (though this key might be added to the English lexicon later at
                   ;;  some point).
-                  (let [sanity (log/error (str "type of target-expression:" (type target-expression)))]
-                    (let [result (deserialize (read-string (:target target-expression)))]
+                  (let [result (deserialize (read-string (:target target-expression)))
                         ;; TODO: allow queries that have refs - might be
                         ;; useful for modeling anaphora and binding.
-                      (let [target-semantics (get-in result [:synsem :sem])]
-                        (let [source-language-keyword (keyword source-language)]
-                          (let [target-language-keyword (keyword target-language)]
-                            (let [semantic-correspondence
-                                  (if (or true (nil? @((:en models source-language-keyword))))
-                                    (do
-                                      (log/error (str "type of models:" (type models)))
-                                      (log/error (str "type of italian model:" (type (get models :it))))
-                                      (log/error (str "well it's too bad that dereferencing the model won't work. instead we'll used a hard-wired semantic-correspondence."))
-                                      [[:obj :null]
-                                       [:obj :number]
-                                       [:shared-with-obj]
-                                       [:subj :null]
-                                       [:subj :number]])
-                                    (do
-                                      (log/error (str "wow, for some reason the model is non-null as I would hope."))
-                                      (-> @((models source-language-keyword))
-                                          :semantic-correspondence
-                                          target-language-keyword)))]
-                              (let [source-semantics (-> result
-                                                         (get-in [:synsem :sem])
-                                                         (dissoc-paths semantic-correspondence)
-                                                         strip-refs)]
-                                (let [json-target-semantics (json/write-str (strip-refs (get-in result [:synsem :sem])))]
-                                  (let [json-source-semantics (json/write-str (strip-refs source-semantics))]
-                                    (log/debug (str "target expression:" (:surface result)))
-                                    (log/debug (str "target semantics:" (strip-refs (get-in result [:synsem :sem]))))
-                                    (log/debug (str "source semantics:" (strip-refs source-semantics)))
-                                    (log/debug (str "json target semantics:" json-target-semantics))
-                                    (log/debug (str "json source:" json-source-semantics))
-                                    (let [results
-                                          (db/exec-raw [(str "SELECT source.surface AS source, source.id AS source_id,
+                        target-semantics (get-in result [:synsem :sem])
+                        source-language-keyword (keyword source-language)
+                        target-language-keyword (keyword target-language)
+                        semantic-correspondence
+                        (-> @((models source-language-keyword))
+                            :semantic-correspondence
+                            target-language-keyword)
+                        source-semantics (-> result
+                                             (get-in [:synsem :sem])
+                                             (dissoc-paths semantic-correspondence)
+                                             strip-refs)
+                        json-target-semantics (json/write-str (strip-refs (get-in result [:synsem :sem])))
+                        json-source-semantics (json/write-str (strip-refs source-semantics))]
+                    (log/debug (str "target expression:" (:surface result)))
+                    (log/debug (str "target semantics:" (strip-refs (get-in result [:synsem :sem]))))
+                    (log/debug (str "source semantics:" (strip-refs source-semantics)))
+                    (log/debug (str "json target semantics:" json-target-semantics))
+                    (log/debug (str "json source:" json-source-semantics))
+                    (let [results
+                          (db/exec-raw [(str "SELECT source.surface AS source, source.id AS source_id,
                                              target.surface AS target,target.root AS target_root,
                                              source.structure AS structure,
                                              target.structure::text AS target_structure
@@ -209,7 +196,7 @@
                                                WHERE source.language=?
                                                  AND source.active=true
                                                  AND source.structure->'synsem'->'sem' @> '"
-                                                                        json-source-semantics "' LIMIT 1) AS source
+                                             json-source-semantics "' LIMIT 1) AS source
                                   INNER JOIN (SELECT DISTINCT surface, target.structure->'synsem'->'sem' AS sem,
                                                               root,structure
                                                          FROM expression_with_root AS target
@@ -219,8 +206,8 @@
                                                            ON (source.surface IS NOT NULL)
                                                           AND (target.surface IS NOT NULL)
                                                           AND (true)")
-                                                                   [source-language target-language]]
-                                                                  :results)]
+                                        [source-language target-language]]
+                                       :results)]
                       (if (nil? (first (map :source results)))
                         (let [sql (str "SELECT surface FROM expression_with_root AS source WHERE "
                                        " source.structure->'synsem'->'sem' @> '" json-source-semantics "'")
@@ -242,7 +229,7 @@
                         {:source-id (first (map :source_id results))
                          :source (first (map :source results))
                          :target-spec target-spec
-                         :targets (map :target results)}))))))))))))))))))
+                         :targets (map :target results)}))))))))))

 (defn get-lexeme [canonical language & [ spec ]]
   "get a lexeme from the database given the canonical form, given a


If reload fails, then throw away the classloader

--- src/cake/project.clj
+++ src/cake/project.clj
@@ -80,9 +80,13 @@

 (defn reload []
   (when *classloader*
-    (eval-in *classloader* '(bake.reload/reload)))
+    (try
+      (eval-in *classloader* '(bake.reload/reload))
+      (catch Exception _ (reset-classloader!))))
   (when test-classloader
-    (eval-in test-classloader '(bake.reload/reload))))
+    (try
+      (eval-in test-classloader '(bake.reload/reload))
+      (catch Exception _ (reset-test-classloader!)))))

 (defmacro with-classloader [paths & forms]
   `(binding [*classloader* (make-classloader ~@paths)]


Fixed unit test step in ci

Fixed unit test step in ci

--- ci/src/gator/steps.clj
+++ ci/src/gator/steps.clj
@@ -11,5 +11,5 @@
 (defn with-repo [& steps]
   (git/with-git repo-uri steps))

-(defn scoville-unit-tests [args ctx]
-  (shell/bash ctx (:cwd args) "py.test test/unitTests"))
+(defn single-gates-unit-tests [args ctx]
+  (shell/bash ctx (:cwd args) "./runTests.sh unitTestsSimulation"))


+TODOs and add reflexive=true => essere=true

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -688,7 +688,14 @@
                    :infl :future}}
          {:synsem {:cat :verb
                    :sem {:tense :conditional}
-                   :infl :conditional}}]]
+                   :infl :conditional}}
+         ;; </inflection-semantics correspondences>
+
+         ;; reflexive expressions are always essere=true.
+         {:synsem {:cat :verb
+                   :sem {:reflexive true}
+                   :essere true}}]]
+
     (let [with-defaults
           (remove #(= :fail %)
                   (map (fn [default]


Changing uppercase 'Cache' back to lowercase.

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -720,7 +720,7 @@
       "edit" (list user-link " (updated project settings)")
       "first-build" (list user-link " (first build)")
       "retry"  (list user-link " (retried " retry-link
-                                (when-not cache? " without Cache")")")
+                                (when-not cache? " without cache")")")
       "ssh" (list user-link " (retried " retry-link " with SSH)")
       "auto-retry" (list "CircleCI (auto-retry of " retry-link ")")
       "trigger" (if (:user build)
@@ -1223,16 +1223,16 @@
         {:rebuild-status "Rebuild"
          :actions
          {:rebuild
-          {:text  "Rebuild with Cache"
+          {:text  "Rebuild with cache"
            :title "Retry the same tests"
            :action #(do (rebuild! [:retry-build-clicked (merge rebuild-args {:no-cache? false})])
-                        (update-status! "Rebuilding with Cache"))}
+                        (update-status! "Rebuilding with cache"))}

           :without_cache
-          {:text  "Rebuild without Cache"
-           :title "Retry without Cache"
+          {:text  "Rebuild without cache"
+           :title "Retry without cache"
            :action #(do (rebuild! [:retry-build-clicked (merge rebuild-args {:no-cache? true})])
-                        (update-status! "Rebuilding without Cache"))}
+                        (update-status! "Rebuilding without cache"))}

           :with_ssh
           {:text  "Rebuild with SSH"


Include earl in output

Include earl in output

--- src/layzee/core.clj
+++ src/layzee/core.clj
@@ -2,13 +2,18 @@
   (:gen-class)
   (:require [clojure.test :refer :all]
             [layzee.adapters.twitter :refer :all :as twitter]
-            [layzee.adapters.settings :refer :all :as settings]))
+            [layzee.adapters.settings :refer :all :as settings]
+            [clj-http.util :as util]))

 (defn- clean[text]
   (.replace text "\n" ""))

+(defn- earl[t]
+  ;; https://twitter.com/marick/status/633460947193978880
+  (format "https://twitter.com/%s/status/%s" (util/url-encode (-> t :user :name)) (-> t :id)))
+
 (defn- view[t]
-  (format "[%s] %s -- %s" (:created_at t) (-> t :text clean) (-> t :user :name)))
+  (format "[%s] %s -- %s %s" (earl t) (:created_at t) (-> t :text clean) (-> t :user :name)))

 (def no-retweets
      #(nil? (:retweeted_status %1)))


Remove enterprise.cljs (dead code)

Remove enterprise.cljs (dead code)

--- src-cljs/frontend/components/enterprise.cljs
+++ src-cljs/frontend/components/enterprise.cljs
@@ -1,291 +0,0 @@
-(ns frontend.components.enterprise
-  (:require [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer close!]]
-            [clojure.string :as str]
-            [frontend.async :refer [raise!]]
-            [frontend.components.common :as common]
-            [frontend.components.contact-form :as contact-form]
-            [frontend.components.shared :as shared]
-            [frontend.state :as state]
-            [frontend.stefon :as stefon]
-            [frontend.utils :as utils :include-macros true]
-            [frontend.utils.ajax :as ajax]
-            [goog.string :as gstr]
-            [om.core :as om :include-macros true])
-  (:require-macros [frontend.utils :refer [defrender html inspect]]
-                   [cljs.core.async.macros :as am :refer [go go-loop alt!]]))
-
-(defn arrow [name]
-  [:img.arrow {:class name
-               :src (utils/cdn-path (str "/img/outer/enterprise/arrow-" name ".svg"))}])
-
-(defn language [name]
-  [:img.background.language {:class name
-                             :src (utils/cdn-path (str "/img/outer/languages/language-" name ".svg"))}])
-
-
-(def contact-form
-  (contact-form/contact-form-builder
-   {:id "contact-form"
-    :class "form-horizontal"
-    :action "/about/contact"}
-   {:params-filter (fn [{:strs [name email company phone developer-count]}]
-                     {:name name
-                      :email email
-                      :message (->> [["Company" company]
-                                     ["Phone" phone]
-                                     ["Developer count" developer-count]
-                                     []
-                                     ["Form URL" js/location.href]
-                                     []]
-                                    (map (fn [[k v]] (if k (gstr/format "%s: %s" k (or v "not set")) "")))
-                                    (str/join "\n"))
-                      :enterprise true})}
-   (fn [control notice form-state]
-     (list
-      [:div.row.contact-form
-       [:div.col-sm-8.col-sm-offset-2
-        [:div.row
-         [:div.col-sm-6
-          (control :input.input-lg
-                   {:type "text"
-                    :name "company"
-                    :required true
-                    :disabled (= :loading form-state)
-                    :placeholder "Company"})]
-         [:div.col-sm-6
-          (control :input.input-lg.blue-focus-border
-                   {:type "text"
-                    :name "phone"
-                    :disabled (= :loading form-state)
-                    :placeholder "Phone"})]]
-        [:div.row
-         [:div.col-sm-6
-          (control :input.input-lg
-                   {:type "text"
-                    :name "name"
-                    :required true
-                    :disabled (= :loading form-state)
-                    :placeholder "Name"})]
-         [:div.col-sm-6
-          (control :input.input-lg
-                   {:type "text"
-                    :name "developer-count"
-                    :required true
-                    :disabled (= :loading form-state)
-                    :placeholder "# of Developers"})]]
-        [:div.row
-         [:div.col-sm-6
-          (control :input.input-lg
-                   {:type "email"
-                    :name "email"
-                    :required true
-                    :disabled (= :loading form-state)
-                    :placeholder "Email"})]
-         [:div.col-sm-6
-          [:div.telephone-info
-           "Or call "
-           [:a.telephone-number {:href "tel:+14155800944"} "415.580.0944"]
-           " for an Enterprise quote."]]]]]
-      (om/build contact-form/transitionable-height
-                {:class "notice"
-                 :children (html
-                            (when notice
-                              [:div {:class (:type notice)}
-                               (:message notice)]))})
-      [:div.row
-       [:div.col-xs-12.text-center
-        (om/build contact-form/morphing-button {:text "Get In Touch..." :form-state form-state})
-        [:div.success-message
-         {:class (when (= :success form-state) "success")}
-         "Thank you for submitting your information."
-         [:br]
-         "Someone from our Enterprise team will contact you soon, usually within one business day."]]]))))
-
-(def enterprise-bg
-  (map arrow ["left-a-1"
-              "left-a-2"
-              "left-a-3"
-              "left-a-4"
-              "right-a-1"
-              "right-a-2"
-              "right-a-3"
-              "right-a-4"]))
-
-(defn enterprise [app owner]
-  (reify
-    om/IRender
-    (render [_]
-      (html
-       [:div#enterprise
-        [:div.jumbotron
-         enterprise-bg
-         [:section.container
-          [:div.row
-           [:article.hero-title.center-block
-            [:div.text-center
-             [:img.hero-logo {:src (utils/cdn-path "/img/outer/enterprise/logo-circleci.svg")}]]
-            [:h1.text-center "CircleCI power behind your firewall"]
-            [:h3.text-center "CircleCI Enterprise delivers the same Continuous Integration and Deployment platform that developers love with the added security and configurability that comes from running inside your private cloud or data center."]]]
-          [:div.row.text-center
-           [:a.btn.btn-cta {:href "#contact-form"} "Get More Info"]]]]
-        ;; need this wrapper for border-top to span the full screen
-        [:div.outer-section
-         [:div.container
-          [:section.row
-           [:div.col-xs-4
-            [:article
-             (common/feature-icon "circle")
-             [:h2.text-center "Fewer Headaches"]
-             [:p "Reduce DevOps management overhead and ship with confidence. CircleCI Enterprise has all the modern, powerful, and easily managed "
-              [:a {:href "/features"} "CircleCi.com features"]
-              " that are trusted by tens of thousands of developers around the world, so your teams can quickly and securely build, test, and deploy with confidence."]]
-            ]
-           [:div.col-xs-4
-            [:article
-             (common/feature-icon "security")
-             [:h2.text-center "World-Class Security"]
-             [:p
-              "Secure your software assets for peace of mind. CircleCI Enterprise runs in your private cloud or data center and uses modern security practice, so your internal and regulatory security requirements can be met."]]]
-           [:div.col-xs-4
-            [:article
-             (common/feature-icon "controls")
-             [:h2.text-center "Total Control"]
-             [:p
-              "Ship faster and easier. With CircleCI Enterprise you can customize your build environment and optimize the configuration and scale of the computing power of your build fleet specifically to the needs of your software teams."]]]]]]
-         [:div.outer-section
-          [:div.container
-           [:section.row
-            [:div.col-xs-8.col-xs-offset-2.enterprise-section
-             [:h2.text-center "Supported Installation Environments"]
-              [:p "CircleCI Enterprise is currently available for deployment on "
-               [:a {:href "/enterprise/aws"} "AWS"]
-               " and "
-               [:a {:href "/enterprise/azure"} "Azure"]
-               ". Support for others such as VMware and OpenStack will be available soon. "
-               [:a {:href "#contact-form"} "Get in touch"]
-               " to let us know what deployment environment you would like to see available next."]]]
-           [:section.row
-            [:div.col-xs-8.col-xs-offset-2.enterprise-section
-             [:h2.text-center "Integrations"]
-             [:p "CircleCI is built for unlimited flexibility. From hosting options to test frameworks or programming frameworks, we let you use the technology you need. Easily integrate directly with GitHub.com and GitHub Enterprise, Docker, SauceLabs, Heroku, and many more."]]]]]
-        [:section.outer-section.outer-section-condensed
-          (map language ["rails-1"
-                         "clojure-1"
-                         "java-1"
-                         "php-1"])
-         [:div.container
-          [:div.row
-           [:div.col-xs-8.col-xs-offset-2
-            [:div.testimonial
-             [:img.customer-header {:src (utils/cdn-path "/img/outer/customers/customer-shopify.svg")
-                                    :alt "Shopify"}]
-             [:div.customer-quote {:class "quote-shopify"}
-              [:blockquote "CircleCI lets us be more agile and ship product faster. We can focus on delivering value to our customers, not maintaining CI Infrastructure."]]
-             [:div.customer-citation
-              [:div.customer-employee-name "John Duff"]
-              [:div
-               "Director of Engineering at "
-               [:span.customer-company-name "Shopify"]
-               " – "
-               [:a.customer-story {:href "/stories/shopify"}
-                "Read the story"]]]]]]]]
-
-        [:div.outer-section
-         [:section.container
-          (common/feature-icon "phone")
-          [:h2.text-center "Learn More About CircleCI Enterprise"]
-          [:div.col-xs-8.col-xs-offset-2
-           [:p "CircleCI Enterprise is available for a free, no obligation, 30 day trial.   Simply fill out the form below to reach out, tell us a little about your team, and we will follow-up to provide you with access and a trial key."]]
-          [:div.enterprise-cta-contact
-           (om/build contact-form nil)]]]]))))
-
-(defrender enterprise-azure [app owner]
-  (html [:div#enterprise
-         [:div.jumbotron
-          enterprise-bg
-          [:section.container
-           [:div.row
-            [:article.hero-title.center-block
-             [:h1.text-center "Next-Generation CI and CD on"
-              [:img.inline-logo {:src (utils/cdn-path "/img/outer/enterprise/logo-windows.png")}]]
-             [:h3.text-center "Access all of the functionality of CircleCI with all of the security and control of your own Virtual Network."]]]
-
-           [:div.row.text-center
-            [:a.btn.btn-cta {:href "#contact-form"} "Get More Info"]]]]
-         [:div.outer-section
-          [:div.container
-           [:section.row
-            [:div.col-xs-6
-             [:article
-              (common/feature-icon "github")
-              [:h2.text-center "Works with GitHub Enterprise"]
-              [:p.text-center "CircleCI has integrated seamlessly with GitHub from the very beginning, and CircleCI Enterprise is no different. Sign in with GitHub Enterprise, view build status right from PR pages, and quickly navigate from builds on CircleCI to corresponding commits and PRs on GitHub Enterprise."]]]
-            [:div.col-xs-6
-             [:article
-              (common/feature-icon "key-hole")
-              [:h2.text-center "Sign in with Active Directory"]
-              [:p.text-center "Building on GiHub Enterprise's first-class support for Active Directory authentication, you can now manage access to your own CircleCI installation with AD or other LDAP or SAML-based services."]]]]
-           [:section.row.extra-row
-            [:div.col-xs-6
-             [:article
-              (common/feature-icon "circle")
-              [:h2.text-center "We come to you"]
-              [:p.text-center "Run your own CircleCI installation together with your existing Azure infrastructure. You've invested time, money, and people in your cloud infrastructure. CircleCI Enterprise on Azure makes those investments pay dividends by integrating seamlessly with your existing setup."]]]
-            [:div.col-xs-6
-             [:article
-              (common/feature-icon "security")
-              [:h2.text-center "Security first"]
-              [:p.text-center "CircleCI runs in your own VPC, where you have control over security and network settings.  Now you don't have to choose between using state-of-the-art CI and CD tools and complying with your company security policies."]]]]]]
-         [:div.outer-section
-          [:section.container
-           (common/feature-icon "phone")
-           [:h2.text-center "Learn More About CircleCI Enterprise"]
-           [:div.enterprise-cta-contact
-            (om/build contact-form nil)]]]]))
-
-(defrender enterprise-aws [app owner]
-  (html [:div#enterprise
-         [:div.jumbotron
-          enterprise-bg
-          [:section.container
-           [:div.row
-            [:article.hero-title.center-block
-             [:div.text-center]
-             [:h1.text-center "Next-Generation CI and CD on"
-              [:img.inline-logo {:src (utils/cdn-path "/img/outer/enterprise/logo-aws.svg")
-                                 :style {:margin-left "20px"}}]]
-             [:h3.text-center "Everything you love about CircleCI combined with everything you love about AWS, all on your own Virtual Private Cloud."]]]
-
-           [:div.row.text-center
-            [:a.btn.btn-cta {:href "#contact-form"} "Get More Info"]]]]
-         [:div.outer-section
-          [:div.container
-           [:section.row
-            [:div.col-xs-6
-             [:article
-              (common/feature-icon "github")
-              [:h2.text-center "Integrates with GitHub Enterprise"]
-              [:p.text-center "CircleCI has worked seamlessly with GitHub from the very beginning, and the same is true for CircleCI Enterprise. Enjoy the same PR status intgegration and navigation from CircleCI builds to GitHub commits that is available on circleci.com."]]]
-            [:div.col-xs-6
-             [:article
-              (common/feature-icon "aws")
-              [:h2.text-center "CircleCI knows AWS"]
-              [:p.text-center
-               "The public CircleCI.com offering itself runs on AWS, so you can take advantage of our extensive experience with AWS machines. We've run literally millions of builds using CircleCI AWS hardware, and we can help you choose the best hardware for any workload."]]]]
-           [:section.row.extra-row
-            [:div.col-xs-6
-             [:article
-              (common/feature-icon "circle")
-              [:h2.text-center "Don't go anywhere"]
-              [:p.text-center "You can run your own CircleCI installation right on your existing AWS account. Whether you manage your infrastructure with AWS CloudFormation, Chef, Puppet, Terraform, or none of the above, we'll meet you where you are and integrate seamlessly with your setup."]]]
-            [:div.col-xs-6
-             [:article
-              (common/feature-icon "security")
-              [:h2.text-center "Built for Security"]
-              [:p.text-center "CircleCI runs in your own Virtual Private Cloud, where everything from firewall settings to IAM privileges are under your control. CircleCI only requires a few simple resource types and network settings, so you can get started quickly and securely."]]]]]]
-         [:div.outer-section
-          [:section.container
-           (common/feature-icon "phone")
-           [:h2.text-center "Learn More About CircleCI Enterprise"]
-           [:div.enterprise-cta-contact
-            (om/build contact-form nil)]]]]))


Fix migration to cider/piggieback

Fix migration to cider/piggieback

--- main/aliases/nrepl/nrepl.clj
+++ main/aliases/nrepl/nrepl.clj
@@ -2,7 +2,7 @@
   (:require
    [clojure.tools.nrepl.server :as nrepl.server]
    [cider.nrepl]
-   [cemerick.piggieback]
+   [cider.piggieback]
    [refactor-nrepl.middleware :as refactor.nrepl]
    [io.aviso.ansi]))

@@ -15,7 +15,7 @@
           (apply nrepl.server/default-handler
                  (conj (map #'cider.nrepl/resolve-or-fail cider.nrepl/cider-middleware)
                        #'refactor.nrepl/wrap-refactor
-                       #'cemerick.piggieback/wrap-cljs-repl)))]
+                       #'cider.piggieback/wrap-cljs-repl)))]
     (spit ".nrepl-port" (:port server))
     (println (io.aviso.ansi/yellow (str "[Edge] nREPL client can be connected to port " (:port server))))
     server))


Refactor put attachment (slightly)

Refactor put attachment (slightly)

--- src/cider_ci/ex/attachments.clj
+++ src/cider_ci/ex/attachments.clj
@@ -15,22 +15,25 @@
     [me.raynes.fs :as fs]
     ))

+(defn put-file [file abs-working-dir base-url content-type]
+  (with/suppress-and-log-warn
+    (let [relative (apply str (drop (inc (count (str abs-working-dir)))
+                                    (seq (str file))))
+          url (str base-url relative)]
+      (logging/debug "putting attachment"
+                     {:file file :nomalized (fs/normalized file)
+                      :name (fs/name file) :base-name (fs/base-name file)
+                      :relative relative :url url})
+      (http/put url {:body file  :content-type content-type})
+      )))
+
+
 (defn put [working-dir attachments base-url]
   (let [abs-working-dir (fs/absolute (fs/file working-dir))]
     (doseq [[_ {glob :glob content-type :content-type}] attachments]
       (fs/with-cwd abs-working-dir
         (doseq [file (fs/glob glob)]
-          (with/suppress-and-log-warn
-            (let [relative (apply str (drop (inc (count (str abs-working-dir)))
-                                            (seq (str file))))
-                  url (str base-url relative)]
-              (logging/debug "putting attachment"
-                             {:file file :nomalized (fs/normalized file)
-                              :name (fs/name file) :base-name (fs/base-name file)
-                              :relative relative :url url})
-              (let [result (http/put url {:body file
-                                          :content-type content-type})]
-                (logging/debug "result: " result)))))))))
+          (put-file file abs-working-dir base-url content-type))))))

 ;### Debug ####################################################################
 ;(debug/debug-ns *ns*)


Removing dummy facts

Removing dummy facts

--- src/civs/logic/demographics.clj
+++ src/civs/logic/demographics.clj
@@ -117,7 +117,8 @@
         men-availability-factor (men-availability-factor young-men young-women)
         women-fertility         (* young-women 1.1 (perturbate-high prosperity))
         births                  (round (* women-fertility men-availability-factor))]
-    (fact :births {:tribe (.id tribe) :n births})
+    (when (> births 0)
+      (fact :births {:tribe (.id tribe) :n births}))
     (Population. births 0 0 0 0)))

 (defn update-children
@@ -128,9 +129,12 @@
         n-children (-> tribe :population :children)
         [dead, grown] (rsplit-by n-children mortality)
         [men, women] (rsplit-by grown 0.5)]
-    (fact :children-dead {:tribe (.id tribe) :n dead})
-    (fact :children-grown-as-men {:tribe (.id tribe) :n men})
-    (fact :children-grown-as-women {:tribe (.id tribe) :n women})
+    (when (> dead 0)
+      (fact :children-dead {:tribe (.id tribe) :n dead}))
+    (when (> men 0)
+      (fact :children-grown-as-men {:tribe (.id tribe) :n men}))
+    (when (> women 0)
+      (fact :children-grown-as-women {:tribe (.id tribe) :n women}))
     (Population. (* -1 n-children) men women 0 0)))

 (defn update-young-population
@@ -145,10 +149,14 @@
         [dead-w, alive-w] (rsplit-by n-young-women mortality-women)
         [grown-m, _]      (rsplit-by alive-m 0.25)
         [grown-w, _]      (rsplit-by alive-w 0.25)]
-    (fact :young-men-dead {:tribe (.id tribe) :n dead-m})
-    (fact :young-women-dead {:tribe (.id tribe) :n dead-w})
-    (fact :young-men-grew-old {:tribe (.id tribe) :n grown-m})
-    (fact :young-women-grew-old {:tribe (.id tribe) :n grown-w})
+    (when (> dead-m 0)
+      (fact :young-men-dead {:tribe (.id tribe) :n dead-m}))
+    (when (> dead-w 0)
+      (fact :young-women-dead {:tribe (.id tribe) :n dead-w}))
+    (when (> grown-m 0)
+      (fact :young-men-grew-old {:tribe (.id tribe) :n grown-m}))
+    (when (> grown-w 0)
+      (fact :young-women-grew-old {:tribe (.id tribe) :n grown-w}))
     (Population. 0 (* -1 (+ dead-m grown-m)) (* -1 (+ dead-w grown-w)) grown-m grown-w)))

 (defn update-old-population
@@ -161,8 +169,10 @@
         n-old-women (-> tribe :population :old-women)
         [dead-m, alive-m] (rsplit-by n-old-men mortality-men)
         [dead-w, alive-w] (rsplit-by n-old-women mortality-women)]
-    (fact :old-men-dead {:tribe (.id tribe) :n dead-m})
-    (fact :old-women-dead {:tribe (.id tribe) :n dead-w})
+    (when (> dead-m 0)
+      (fact :old-men-dead {:tribe (.id tribe) :n dead-m}))
+     (when (> dead-w 0)
+      (fact :old-women-dead {:tribe (.id tribe) :n dead-w}))
     (Population. 0 0 0 (* -1 dead-m) (* -1 dead-w))))


Fix uberjaring. Require on ns-load.

Fix uberjaring. Require on ns-load.

--- src/clj/sally/checkers/core.clj
+++ src/clj/sally/checkers/core.clj
@@ -1,7 +1,6 @@
 (ns sally.checkers.core
   (:require (clojure [string :as s]
                      [test :refer [are with-test]])))
-

 (with-test
   (defn- sym-to-var-form [sym]
@@ -20,15 +19,17 @@
        'hey/there 'hey
        'some.cool.ns/func 'some.cool.ns))

-(defmacro defcheckers [& checkers]
-  (let [checker-namespaces (into '() (set (map ns-sym-from-sym checkers)))
-        checker-vars (map sym-to-var-form checkers)]
-    `(defn ~'load-checkers [& {:keys [~'reload] :or {~'reload true}}]
-       (doseq [~'checker-ns '~checker-namespaces]
-         (if ~'reload
-           (require :reload ~'checker-ns)
-           (require ~'checker-ns)))
-       ~(vec checker-vars))))
+(defmacro ^:private defcheckers [& checkers]
+  (let [ns-syms (into '() (set (map ns-sym-from-sym checkers)))
+        checker-var-forms (map sym-to-var-form checkers)]
+    `(do
+       (defn ~'load-checkers [& {:keys [~'reload] :or {~'reload true}}]
+         (doseq [~'checker-ns '~ns-syms]
+           (if ~'reload
+             (require :reload ~'checker-ns)
+             (require ~'checker-ns))))
+       (~'load-checkers :reload true)
+       (def ~'checkers ~(vec checker-var-forms)))))

 (defcheckers
   sally.checkers.kibit)
@@ -37,4 +38,4 @@
   ([checkable checkers]
    (into {} (for [checker checkers]
               [checker (checker checkable)])))
-  ([checkable] (check checkable (load-checkers))))
+  ([checkable] (check checkable checkers)))


[NH] Add argument preconditions to encode function.

--- src/clj/turbovote/imbarcode.clj
+++ src/clj/turbovote/imbarcode.clj
@@ -29,8 +29,21 @@
    section 3.1.3 of the IMb spec for a detailed description of the
    parameters."
   ([barcode service customer-number routing]
+     {:pre [(every? string? [barcode service customer-number routing])
+            (= (count barcode) 2)
+            (= (count service) 3)
+            (= (count customer-number) 15)
+            (#{0 5 9 11} (count routing))]}
      (encode-binary-data
       (binary-encode barcode service customer-number routing)))
   ([barcode service mailer serial-number routing]
+     {:pre [(every? string? [barcode service mailer serial-number routing])
+            (= (count barcode) 2)
+            (= (count service) 3)
+            (or (and (= (count mailer) 6)
+                     (= (count serial-number) 9))
+                (and (= (count mailer) 9)
+                     (= (count serial-number) 6)))
+            (#{0 5 9 11} (count routing))]}
      (encode-binary-data
       (binary-encode barcode service mailer serial-number routing))))


Fix misplaced :language key

Fix misplaced :language key

--- src/cljs/db_quiz/analytics.cljs
+++ src/cljs/db_quiz/analytics.cljs
@@ -18,8 +18,8 @@
 (defn report-spoiler
   "Send a custom event to Google Analytics"
   []
-  (let [{{:keys [despoilerify? language]} :options
-         :keys [board current-field]} @app-state
+  (let [{{:keys [despoilerify?]} :options
+         :keys [board current-field language]} @app-state
         subject-uri (get-in board [current-field :subject])]
     (ga "send" "event" "report-spoiler" subject-uri (str (name language) "-"
                                                          (if despoilerify? "true" "false")))))


print mapquest response

print mapquest response

--- src/cljs/montheway/mmodern.cljs
+++ src/cljs/montheway/mmodern.cljs
@@ -192,6 +192,7 @@
                       :end-lat end-lat
                       :end-lng end-lng})
                    (partition 4 2 steps))]
+     (dommy/append! (sel1 :body) [:p (str  "Mapquest data:" response)])
      lat-lngs)))

 (defn direction-steps [m to from]


should handle the case without :sub aggregation

--- src/cljs/searchbot/parsets.cljs
+++ src/cljs/searchbot/parsets.cljs
@@ -11,7 +11,7 @@
   [terms sub-aggs]
   (reduce (fn [agg-query a-term]
             {:aggs {(keyword a-term) (merge {:terms {:field a-term}} agg-query)}})
-          {:aggs sub-aggs} terms))
+          (if sub-aggs {:aggs sub-aggs} {}) terms))

 (defn- walk-buckets [de-buck bucket prefix steps value-path]
   (map #(de-buck % de-buck prefix (first steps) (rest steps) value-path)


reload dokku for tls

reload dokku for tls

--- src/cljs/secret_shame/core.cljs
+++ src/cljs/secret_shame/core.cljs
@@ -63,9 +63,9 @@
      [:div.list-group.item.widget.widget-card
       [:p.list-group-item-text "Occupation"]
       (if-not @editing?
-        [:h4.list-group-item-heading "Thief"]
+        [:h4.list-group-item-heading "Reformed Thief"]
         [:input.list-group-item-heading.editing
-         {:onChange (fn [e] (.log js/console "occupation changed"))
+         {:onChange (fn [e] (.log js/console "occupation has changed"))
           :value "Thief"}])]

      [:div.list-group.item.widget.widget-card


[n.u.mapping] Inherit classname from parent in defelement

--- src/clojure/neko/ui/mapping.clj
+++ src/clojure/neko/ui/mapping.clj
@@ -178,9 +178,14 @@
   Optional arguments
   - :classname, :inherits, :traits, :values, :attributes, :container-type."
   [kw-name & {:as args}]
-  (swap! keyword-mapping assoc kw-name
-         (if-not (contains? args :inherits)
-           (assoc args :inherits :view)
-           args))
+  (swap! keyword-mapping
+         #(assoc % kw-name
+                 (let [parent (if (contains? args :inherits)
+                                (:inherits args)
+                                :view)
+                       classname (if (contains? args :classname)
+                                   (:classname args)
+                                   (get-in % [parent :classname]))]
+                   (assoc args :inherits parent :classname classname))))
   (if-let [classname (:classname args)]
     (swap! reverse-mapping assoc classname kw-name)))


Let's set the CORS allow origin for all HTTP verbs ...

--- src/cmr/graph/rest/response.clj
+++ src/cmr/graph/rest/response.clj
@@ -36,6 +36,4 @@
                  (response/header "Access-Control-Allow-Methods" "POST, PUT, GET, DELETE, OPTIONS")
                  (response/header "Access-Control-Allow-Headers" "Content-Type")
                  (response/header "Access-Control-Max-Age" "2592000"))
-    :get (response/header response "Access-Control-Allow-Origin" "*")
-    :post (response/header response "Access-Control-Allow-Origin" "*")
-    response))
+    (response/header response "Access-Control-Allow-Origin" "*")))


add date to key

add date to key

--- src/uswitch/bifrost/s3.clj
+++ src/uswitch/bifrost/s3.clj
@@ -29,7 +29,7 @@
             prefix
             date-str
             suffix
-            (format "%010d" first-offset))))
+            (format "%s-%010d" date-str first-offset))))

 (def caching-rate-gauge (memoize rate-gauge))


add use of (truncate) to improve performance of generation

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -165,7 +165,9 @@
       (log/debug (str "generate-all: first expression generated for spec:" (strip-refs spec) " ):"
                      "'" (morph (first expressions)) "'"))
       (log/debug (str "generate-all: no expressions could be generated for spec:" (strip-refs expressions))))
-    expressions))
+    (map (fn [expr]
+           (truncate expr [[:head][:comp]]))
+         expressions)))

 (defn candidate-parents [rules spec]
   "find subset of _rules_ for which each member unifies successfully with _spec_"


~(defn add-to-bolt-at-path): simplify and (copy bolt)

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -183,29 +183,15 @@
 (defn add-to-bolt-at-path
   "bolt + path => partial trees"
   [bolt path model]
-  (let [complements (gen (get-in bolt path) model 0)]
-    (if (empty? complements)
-      (let [error-message
-            (str "(improve grammar): no complements found for: "
-                 ((:morph-ps model) bolt) "; path: [" (string/join "/" path) "]"
-                 "; spec=" (show-spec
-                            (get-in bolt path)))]
-        ;;        (throw (Exception. error-message)))
-        (log/warn (str error-message)))
-      (->>
-       ;; set of all complements at _path_ for _bolt_:
-       complements
-
-       ;; add each member _each_comp_ of this set to _bolt_:
-       (map (fn [each-comp]
-              (let [result
-                    (dag_unify.core/assoc-in! bolt path each-comp)]
-                (->
-                 result
-                 ((fn [tree]
-                    (if (:default-fn model)
-                      ((:default-fn model) tree)
-                      tree)))))))))))
+  ;; add each complement to _bolt_:
+  (map (fn [each-comp]
+         (->
+          (dag_unify.core/assoc-in! (dag_unify.core/copy bolt) path each-comp)
+          ((fn [tree]
+             (if (:default-fn model)
+               ((:default-fn model) tree)
+               tree)))))
+       (gen (get-in bolt path) model 0)))

 (defn get-lexemes [model spec]
   "Get lexemes matching the spec. Use a model's index if available, where the index is a function that we call with _spec_ to get a set of indices. otherwise use the model's entire lexeme."


Cleanup code

Cleanup code

--- src/beehive/service.clj
+++ src/beehive/service.clj
@@ -130,8 +130,7 @@
            failure-threshold
            failure-percentage-threshold
            backoff-time-millis
-           health-refresh-millis]
-    :as breaker-config}]
+           health-refresh-millis]}]
   (DefaultCircuitBreaker.
     ^BreakerConfig (.build (cond-> (BreakerConfigBuilder.)
                              trailing-period-millis (.trailingPeriodMillis trailing-period-millis)


add 'invoke' utility fn

add 'invoke' utility fn

--- src/bract/core/util.clj
+++ src/bract/core/util.clj
@@ -209,6 +209,12 @@
                      (expected "java.io.PrintStream or java.io.PrintWriter instance" out))))))

+(defn invoke
+  "Invoke first argument as a function on the remaining arguments."
+  [f & args]
+  (apply f args))
+
+
 ;; conversion


Find best matching tile from Kd-tree

Find best matching tile from Kd-tree

--- src/mosaic/core.clj
+++ src/mosaic/core.clj
@@ -64,6 +64,15 @@
 	i (:tile t)]
     (img/sub-image (:coord i) (:image i))))

+(defn- best-match-2 [n tree ^BufferedImage b]
+  "Find the best matching tile to image b.
+  Applies sub-image to the resulting tile
+  to return a BufferedImage."
+  (let [s (img/get-samples (img/rescale n n b))
+	t (meta (kdtree/nearest-neighbor tree s))
+	i (:tile t)]
+    (img/sub-image (:coord i) (:image i))))
+
 (defn- gen-canvas [n w ^BufferedImage b]
   "Rescale and crop image b to evenly fit tiles of
    size n, with w tiles across."
@@ -77,10 +86,11 @@
 	      w  ; width in tiles
 	      s] ; sample size (actual sample regions are s^2)
   (let [^BufferedImage canvas (gen-canvas n w target)
-	tiles (sample-tiles s (gen-tiles-coll n tiles ns))]
+	tiles (sample-tiles s (gen-tiles-coll n tiles ns))
+        tree (index-tiles tiles)]
     ; Replace each tile in canvas with the best match from tiles coll.
     (dorun (map #(img/insert!
-		  (best-match n tiles (img/sub-image % canvas))
+		  (best-match-2 n tree (img/sub-image % canvas))
 		  canvas (first %) (second %))
 		(grid n (.getWidth canvas) (.getHeight canvas))))
     canvas))


Add eval-in

Add eval-in

--- src/oxcart/util.clj
+++ src/oxcart/util.clj
@@ -132,3 +132,17 @@
   {:pre  [(var? v)]
    :post [(symbol? %)]}
   (-> v .ns ns-name))
+
+
+(defn eval-in
+  "(λ Sexpr → Env) → Any
+
+  Helper for evaluating a given sexpr in another namespace as specified by a
+  TANAL env record/map. Returns the result of evaluating the sexpr in the other
+  environment."
+  [form {other-ns :ns :as env}]
+  (let [this (.name *ns*)]
+    (in-ns other-ns)
+    (let [res (clojure.core/eval form)]
+      (in-ns this)
+      res)))


Indentation fixes

Indentation fixes

--- src/skat/ai.clj
+++ src/skat/ai.clj
@@ -28,15 +28,15 @@
   (reify Player
          (id [this] id)
          (play-1st-card [this { :keys [cards-allowed] :as situation }]
-            (first cards-allowed))
+           (first cards-allowed))
          (play-2nd-card [this { :keys [cards-allowed] :as situation } c1]
-            (first cards-allowed))
+           (first cards-allowed))
          (play-3rd-card [this { :keys [cards-allowed] :as situation } c1 c2]
             (first cards-allowed))
          (place-bid [this cards last-bid]
-            (if (> max-bid-value last-bid)
-              (next-bid-value last-bid)
-              auction/passed-game-value))
+           (if (> max-bid-value last-bid)
+             (next-bid-value last-bid)
+             auction/passed-game-value))
          (respond-to-bid [this cards bid] (> max-bid-value bid))
          (declare-suit [this cards final-bid] :grand)
          (declare-hand [this cards final-bid] false)
@@ -44,4 +44,4 @@
          (declare-schwarz [this cards final-bid] false)
          (declare-ouvert [this cards final-bid] false)
          (skat-swapping [this config skat-owned cards-owned skat-card]
-            (first cards-owned))))
+           (first cards-owned))))


CMR-2362: Fixed bug in get-concept-tablenames

--- metadata-db-app/src/config/mdb_migrate_helper.clj
+++ metadata-db-app/src/config/mdb_migrate_helper.clj
@@ -52,7 +52,7 @@
   ([]
    ;; use all concept types
    (apply get-concept-tablenames (keys s/num-revisions-to-keep-per-concept-type)))
-  ([& concept-types]
+  ([& concept-types
     (distinct
      (->
       (for [provider (p/get-providers (config/db))
@@ -62,7 +62,9 @@
       ;; system yet.
       (into (when (contains? (set concept-types) :collection) ["small_prov_collections"]))
       (into (when (contains? (set concept-types) :granule) ["small_prov_granules"]))
-      (into (when (contains? (set concept-types) :service) ["small_prov_services"]))))))
+      (into (when (contains? (set concept-types) :service) ["small_prov_services"]))
+      (into (when (contains? (set concept-types) :access-group) ["cmr_groups"]))
+      (into (when (contains? (set concept-types) :tag) ["cmr_tags"]))))]))

 (defn get-collection-tablenames
   "Gets a list of all the collection tablenames. Primarily for enabling migrations of existing


Change styling

Change styling

--- src/yorck_ratings/view.clj
+++ src/yorck_ratings/view.clj
@@ -11,18 +11,25 @@
      [:title "Yorck movies with IMDB ratings"]
      [:meta {:charset "utf-8"}]
      [:meta {:name "viewport" :content "width=device-width, initial-scale=1"}]
-     [:style "body {
+     [:style "* + * { margin-top: 1.5em; }
+              body {
                 font-size: 16px;
+                font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;
                 line-height: 1.4rem;
-                margin: 0;
+                margin-left: 5%;
+                margin-right: 5%;
+              }
+              h1 {
+                font-size: 1rem;
+                font-weight: normal;
               }
               ol {
                 list-style: none;
                 padding: 0;
-                margin: 2.8rem 10%;
               }
               li {
                 padding: .1rem;
+                margin-top: 0;
               }
               a { color: black; }
               .highlighted {
@@ -33,6 +40,7 @@
                 padding-right: .4rem;
                }"]]
     [:body
+     [:h1 "IMDB rated Yorck movies"]
      [:ol
       (for [movie movies]
         [:li


loop -> reduce

loop -> reduce

--- src/voke/state.cljs
+++ src/voke/state.cljs
@@ -14,16 +14,13 @@
 (sm/defn process-update-events :- GameState
   [state :- GameState
    update-events]
-  (let [updated-entities (loop [events update-events
-                                entities (transient (state :entities))]
-                           (if (seq events)
-                             (let [event (first events)
-                                   entity-id (event :entity-id)]
-                               (recur (rest events)
-                                      (assoc! entities
-                                              entity-id
-                                              ((event :fn) (get entities entity-id)))))
-                             entities))]
+  (let [updated-entities (reduce (fn [entities event]
+                                   (let [entity-id (event :entity-id)]
+                                     (assoc! entities
+                                             entity-id
+                                             ((event :fn) (get entities entity-id)))))
+                                 (transient (state :entities))
+                                 update-events)]
     (assoc state
            :entities
            (persistent! updated-entities))))


+ it translation

+ it translation

--- src/wlmmap/i18n.clj
+++ src/wlmmap/i18n.clj
@@ -35,4 +35,20 @@
                  :g ", disponibles sous licence libre."
                  :h "Le code derrière ce site web est disponible depuis "
                  :i "J'apprécie les remarques, critiques et suggestions! "
-                 :j "Envoyez-moi un e-mail"}}}})
+                 :j "Envoyez-moi un e-mail"}}
+    :it {:main {:show "Mostra"
+                :stop "Stop"
+                :here "Qui"
+                :about "About"
+                :links "Links"}
+         :links {:intro "Questi links mostrano i monumenti sulla mappa."}
+         :about {:a "About"
+                 :b "Questa mappa è stata sviluppata durante "
+                 :c "Ti permette di esplorare i tesori del patrimonio culturale di tutto il mondo."
+                 :d "I segnalini blu indicano i monumenti con foto."
+                 :e "I segnalini rossi indicano i monumenti senza foto."
+                 :f "Tutte le foto vengono da "
+                 :g ", e sono rilasciate con una licenza libera."
+                 :h "Il codice sorgente di questo sito è disponibile su "
+                 :i "Apprezzo ogni feedback ogni suggerimento! "
+                 :j "Mandami una mail."}}}})


updating the fs library

updating the fs library

--- support/project.clj
+++ support/project.clj
@@ -11,7 +11,7 @@
     :exclusions [org.apache.ant/ant]]
    [org.clojure/core.async "0.1.278.0-76b25b-alpha"]
    ;; devserver
-   [fs "1.1.2"]
+   [me.raynes/fs "1.4.4"]
    [ring "1.2.1"]
    [http-kit "2.1.16"]
    [compojure "1.1.6"]


Restore show/hidden functionality.

Restore show/hidden functionality.

--- src/uxbox/ui/shapes/core.cljs
+++ src/uxbox/ui/shapes/core.cljs
@@ -44,7 +44,8 @@
   [own id]
   (let [shape-l (focus-shape id)
         shape (rum/react shape-l)]
-    (render-component own shape)))
+    (when-not (:hidden shape)
+      (render-component own shape))))

 (def ^:const shape
   (mx/component


Add gen-class to directive to main ns.

Add gen-class to directive to main ns.


Clojurescript commit e7e79f21a12b2fa17499f7914a803a39aa382451 has prepended es6- to iterator and entries-iterator symbol names, as well as ES6- to Iterator and EntriesIterator symbols. Made corresponding changes to DataScript.

--- src/datascript/impl/entity.cljs
+++ src/datascript/impl/entity.cljs
@@ -53,11 +53,11 @@

   ;; js/map interface
   (keys [this]
-    (iterator (keys this)))
+    (es6-iterator (keys this)))
   (entries [this]
-    (entries-iterator (js-seq this)))
+    (es6-entries-iterator (js-seq this)))
   (values [this]
-    (iterator (map second (js-seq this))))
+    (es6-iterator (map second (js-seq this))))
   (has [this attr]
     (not (nil? (.get this attr))))
   (get [this attr]
@@ -145,5 +145,5 @@
 (goog/exportSymbol "datascript.impl.entity.Entity.prototype.values"    (.-values    (.-prototype Entity)))
 (goog/exportSymbol "datascript.impl.entity.Entity.prototype.entries"   (.-entries   (.-prototype Entity)))

-(goog/exportSymbol "cljs.core.Iterator.prototype.next"        (.-next (.-prototype cljs.core/Iterator)))
-(goog/exportSymbol "cljs.core.EntriesIterator.prototype.next" (.-next (.-prototype cljs.core/EntriesIterator)))
+(goog/exportSymbol "cljs.core.ES6Iterator.prototype.next"        (.-next (.-prototype cljs.core/ES6Iterator)))
+(goog/exportSymbol "cljs.core.ES6EntriesIterator.prototype.next" (.-next (.-prototype cljs.core/ES6EntriesIterator)))


Functions render-edn-data, add-new-results, and store-results

--- src/emender_service/results.clj
+++ src/emender_service/results.clj
@@ -12,5 +12,23 @@

 (ns emender-service.results)

-(def results (atom nil))
+(require '[emender-service.file-utils :as file-utils])

+(def results (atom {}))
+
+(defn render-edn-data
+    "Render EDN data to be used as off-memory cache."
+    [output-data]
+    (with-out-str (clojure.pprint/pprint output-data)))
+
+(defn add-new-results
+    [job-name new-results]
+    (swap! results assoc job-name new-results))
+
+(defn store-results
+    []
+    (let [edn-data (render-edn-data @results)]
+        (spit "results2.edn" edn-data)
+        ; rename files atomically (on the same filesystem)
+        (file-utils/mv-file "results2.edn" "results.edn")))
+


Stop all the busted URLs and silliness

Stop all the busted URLs and silliness

--- src/exploud/asgard.clj
+++ src/exploud/asgard.clj
@@ -177,10 +177,19 @@
   "Converts an Asgard task to a desired form"
   (update-in task [:log] (fn [log] (map split-log-message log))))

+(defn- break-url [url]
+  (let [split-by-question-mark (clojure.string/split url #"\?" 2)
+        url (str (first split-by-question-mark) ".json")]
+    (if-let [query-part (second split-by-question-mark)]
+      (let [query-params (into {} (map (fn [[k v]] {(keyword k) (codec/url-decode v)}) (map #(clojure.string/split % #"=") (clojure.string/split query-part #"&"))))]
+        {:url url :query-params query-params})
+      {:url url})))
+
 (defn task-by-url
   "Retrieves a task directly from its URL."
-  [url]
-  (let [{:keys [body status]} (http/simple-get url)]
+  [task-url]
+  (let [{:keys [url query-params]} (break-url task-url)
+        {:keys [body status]} (http/simple-get url query-params)]
     (when (= status 200)
       (munge-task (json/parse-string body true)))))

@@ -222,9 +231,6 @@
         (log/warn e)
         (reschedule)))))

-(defn- task-info-from-url [url]
-  (into {} (map (fn [[k v]] {(keyword k) (codec/url-decode v)}) (map #(clojure.string/split % #"=") (clojure.string/split (nth (clojure.string/split url #"\?" 2) 1) #"&")))))
-
 (defn applications []
   (let [application-list (application-list)]
     (map :name application-list)))
@@ -339,7 +345,6 @@
 ;(task "eu-west-1" "120DqQWqEBYsOK5Vaj6sK8b4YErobn8sF61FcN7OA63t0=" "b7287ace-cfd3-41b6-9618-189534d9f207")
 ;(last-launch-configuration-name "eu-west-1" "skeleton")
 ;(last-security-groups "eu-west-1" "skeleton")
-;(task-info-from-url "http://asgard.brislabs.com:8080/task/show?runId=12lyXMu%2FrpdVtZ%2FpgbUQ7hpuAEzizQ9QKa0fnpj7G8fwE%3D&workflowId=a99a149d-be24-47c8-93c0-d10e00334dee")
 ;(application "eu-west-1" "missing")
 ;(upsert-application "somethingnew" {:description "Updated from Exploud" :email "neil.prosser@gmail.com" :owner "someone"})
 ;(applications)


base64url: fix "+" match

base64url: fix "+" match

The original match argument was "\\+", which would be correct if the
match was a regex pattern (because we want to replace the "+"
character), but we're dealing with simple string substitution, so match
should just be "+".


Add :box-remove functionallity.

Add :box-remove functionallity.


Improve output formatting

Improve output formatting

--- library/src/doo/core.clj
+++ library/src/doo/core.clj
@@ -64,8 +64,10 @@
          " and we got: " js-env)))

 (defn print-env [js-env]
+  (println "")
   (println ";;" (str/join "" (take 70 (repeat "="))))
-  (println (str ";; Testing with " (str/capitalize (name js-env)) ":")))
+  (println (str ";; Testing with " (str/capitalize (name js-env)) ":"))
+  (println ""))

 ;; ======================================================================
 ;; Runners


slight wording change

slight wording change

--- src/pronouns/pages.clj
+++ src/pronouns/pages.clj
@@ -61,7 +61,7 @@
 (defn examples-block
   [subject object possessive-determiner possessive-pronoun reflexive]
   [:div {:class "examples"}
-   [:p [:h1 "Usage examples:"]]
+   [:p [:h1 "Here are some usage examples for my pronouns:"]]
    (subject-example subject)
    (object-example object)
    (posessive-determiner-example subject possessive-determiner)


notify with error if cannot find a proper tag

--- src/pump/template.cljs
+++ src/pump/template.cljs
@@ -56,6 +56,8 @@
   (let [[tag-type tag-fn attrs content] (normalize-element elem-def)
         attrs (exclude-empty attrs)
         attrs (if (= tag-type :vanilla) (clj->js attrs) attrs)]
+    (if (nil? tag-fn)
+      (throw (str "Element definition '" (pr-str elem-def) "' could not be parsed")))
     (tag-fn attrs (clj->js (as-content content)))))

 (defn html [& tags]


pass secret key when running the bot

pass secret key when running the bot


config/include also takes absolute paths

Fixed a regression which cause riemann to be unable to load absolute
paths. You can now refer to relative or absolute paths at any level of
the config. Fixes #127.

--- src/riemann/config.clj
+++ src/riemann/config.clj
@@ -160,6 +160,20 @@
   "The config file currently being included."
   nil)

+(defn config-file-path
+  "Computes the full path to a config file. Absolute paths are returned
+  unchanged. Relative paths are expanded relative to *config-file*. Returns a
+  string."
+  [path]
+  (if (-> path (file) (.isAbsolute))
+    path
+    (let [dir (-> (or *config-file* "ZARDOZ")
+                (file)
+                (.getCanonicalPath)
+                (file)
+                (.getParent))]
+      (str (file dir path)))))
+
 (defn validate-config
   "Check that a config file has valid syntax."
   [file]
@@ -171,14 +185,13 @@
 (defn include
   "Include another config file.

-  (include \"foo.clj\")"
-  [filename]
-  (let [dir (-> (or *config-file* "ZARDOZ")
-              (file)
-              (.getCanonicalPath)
-              (file)
-              (.getParent))
-        path (str (file dir filename))]
+  ; Relative to the current config file, or cwd
+  (include \"foo.clj\")
+
+  ; Absolute path
+  (include \"/foo/bar.clj\")"
+  [path]
+  (let [path (config-file-path path)]
     (binding [*config-file* path
               *ns* (find-ns 'riemann.config)]
       (validate-config path)


Adding todo

Adding todo

--- src/helda/handlers/entities.clj
+++ src/helda/handlers/entities.clj
@@ -95,6 +95,7 @@
     data :- hs/Entity
     ]
   ;todo add-entity
+  ;todo validate and add actions
   (success
     (storage/save-entity db data)
     )


CMR-2133 removes get-group-acls

CMR-2133 removes get-group-acls

--- access-control-app/src/cmr/access_control/services/auth_util.clj
+++ access-control-app/src/cmr/access_control/services/auth_util.clj
@@ -32,13 +32,6 @@
       (filter #(= target-guid (-> % :single-instance-object-identity :target-guid))
               (acl/get-permitting-acls context :single-instance-object "GROUP" permission)))))

-(defn- get-group-acls
-  "Returns any group ACLs that grant the context user the given permission on group."
-  [context permission group]
-  (or (get-instance-acls context permission group)
-      (get-provider-acls context permission group)
-      (get-system-acls context permission)))
-
 (defn- describe-group
   [group]
   (let [{:keys [provider-id]} group]
@@ -58,7 +51,9 @@
   "Throws a permission service error if no ACLs exist that grant the desired permission to the
   context user on group."
   [context permission group]
-  (when-not (get-group-acls context permission group)
+  (when-not (or (get-instance-acls context permission group)
+                (get-provider-acls context permission group)
+                (get-system-acls context permission))
     (throw-group-permission-error permission group)))

 (defn verify-can-create-group


Test match-state.

Test match-state.

Update tests, which almost work, except for one.

--- src/chapter3/match.cljs
+++ src/chapter3/match.cljs
@@ -32,16 +32,17 @@
   (is (not (match '(1 (! x) 3) '(1 (2) 3))))
   (is (not (match '((? x) 3) '(1 2)))))
 (defn =1? [x] (= x 1))
-(defn function-pattern-match-test [match]
-  (is (= {'x 1 'y 2} (match '((chapter3.match/=1? x) (? y) 3) '(1 2 3))))
-  (is (not (match '((chapter3.match/=1? x) 2 3) '(2 2 3)))))
-(defn star-pattern-match-test [match]
+(defn =1?-state [d x] (and (= x 1) (assoc d 'x 'is-1)))
+(defn function-pattern-match-test [match f]
+  (is (= {'x 1 'y 2} (match (cons (cons f '(x)) '((? y) 3)) '(1 2 3))))
+  (is (not (match (cons (cons f '(x)) '(2 3)) '(2 2 3)))))
+(defn star-pattern-match-test [match f]
   (is (= {'x '(the whole thing)} (match '((* x)) '(the whole thing))))
   (is (= {'x '(whole thing) 'y 'the} (match '((? y) (* x)) '(the whole thing))))
   (is (not (match '(this (* x)) '(the whole thing))))
   (is (= {'x '(thing) 'y 'whole} (match '(the (? y) (* x)) '(the whole thing))))
   (is (= {'x '()} (match '(the whole thing (* x)) '(the whole thing))))
-  (is (not (match '(the (chapter3.match/=1? y) thing (* x)) '(the whole thing)))))
+  (is (not (match (cons 'the (cons (cons f '(y)) (cons 'thing ()))) '(the whole thing)))))

 (with-test
   (defn match2 [p s]
@@ -120,7 +121,7 @@
   (basic-match-test match5)
   (basic-pattern-match-test match5)
   (is (= {} (match5 '(1 (2) 3) '(1 (2) 3))))
-  (function-pattern-match-test match5))
+  (function-pattern-match-test match5 chapter3.match/=1?))
 (with-test
   (defn match
   "Note: ClojureScript doesn't have resolve so arbitrary predicates won't work there."
@@ -174,47 +175,58 @@
   (basic-match-test match)
   (basic-pattern-match-test match)
   (is (not (match '(1 (2) 3) '(1 (2) 3))) "malformed pattern")
-  (function-pattern-match-test match)
-  (star-pattern-match-test match))
-(defn match-state
+  (function-pattern-match-test match chapter3.match/=1?)
+  (star-pattern-match-test match chapter3.match/=1?))
+(with-test
+  (defn match-state
   "Note: ClojureScript doesn't have resolve so arbitrary predicates won't work there."
-  [p s]
-  (def variables (atom {}))
-  (defn match-helper [p s]
-    (cond
-      (empty? p) (empty? s)
-      (atom? (first p))
-      (and (not (empty? s))
-           (= (first p) (first s))
-           (match-helper (rest p) (rest s)))
-      ; complex patterns
-      (and (not (empty? s))
-           (= (first (first p)) '?))
-      (when (match-helper (rest p) (rest s))
-        (swap! variables (fn [vs] (assoc vs (second (first p)) (first s))))
-        true)
-      (= (first (first p)) '*)
-      (cond
-        (and (not (empty? s))
+    [p s]
+    (def variables (atom {}))
+    (defn match-helper [p s]
+      (cond
+        (or (atom? p) (atom? s)) false
+        (empty? p) (empty? s)
+        (atom? (first p))
+        (and (not (empty? s))
+             (= (first p) (first s))
              (match-helper (rest p) (rest s)))
-        (do
-          (swap! variables (fn [vs] (assoc vs (second (first p)) (list (first s)))))
-          true)
-        (match-helper (rest p) s)
-        (do
-          (swap! variables (fn [vs] (assoc vs (second (first p)) (list))))
-          true)
-        (and (not (empty? s))
-             (match-helper p (rest s)))
-        (do
-          (swap! variables (fn [vs] (assoc vs
-                                           (second (first p))
-                                           (cons (first s) (vs (second (first p)))))))
-          true))
-      (not (empty? s))
-      (when-let [update-d ((resolve (first (first p))) @variables (first s))]
+        ; complex patterns
+        (and (not (empty? s))
+             (= (count (first p)) 2)
+             (= (first (first p)) '?))
         (when (match-helper (rest p) (rest s))
-          (swap! variables (fn [vs] (assoc (merge vs update-d) (second (first p)) (first s))))
-          true))
-      :else false))
-  (if (match-helper p s) @variables false))
+          (swap! variables (fn [vs] (assoc vs (second (first p)) (first s))))
+          true)
+        (and (= (count (first p)) 2)
+             (= (first (first p)) '*))
+        (cond
+          (and (not (empty? s))
+               (match-helper (rest p) (rest s)))
+          (do
+            (swap! variables (fn [vs] (assoc vs (second (first p)) (list (first s)))))
+            true)
+          (match-helper (rest p) s)
+          (do
+            (swap! variables (fn [vs] (assoc vs (second (first p)) (list))))
+            true)
+          (and (not (empty? s))
+               (match-helper p (rest s)))
+          (do
+            (swap! variables (fn [vs] (assoc vs
+                                             (second (first p))
+                                             (cons (first s) (vs (second (first p)))))))
+            true))
+        (and (not (empty? s))
+             (= (count (first p)) 2)
+             (resolve (first (first p))))
+        (when-let [update-d ((resolve (first (first p))) @variables (first s))]
+          (when (match-helper (rest p) (rest s))
+            (swap! variables (fn [vs] (assoc (merge vs update-d) (second (first p)) (first s))))
+            true))
+        :else false))
+    (if (match-helper p s) @variables false))
+  (basic-match-test match-state)
+  (basic-pattern-match-test match-state)
+  (is (not (match-state '(1 (2) 3) '(1 (2) 3))) "malformed pattern")
+  (function-pattern-match-test match-state chapter3.match/=1?-state)
+  (star-pattern-match-test match-state chapter3.match/=1?-state))


Finish full match function

Finish full match function

--- src/chapter3/match.cljs
+++ src/chapter3/match.cljs
@@ -28,7 +28,7 @@
       (do
         (swap! variables (fn [vs] (assoc vs (first (rest (first p))) (first s))))
         true)
-    :else false))
+      :else false))
   (if (match-helper p s) @variables false))
 (defn match5
   "Note: ClojureScript doesn't seem to have resolve (or eval) so this code
@@ -63,21 +63,40 @@
   (def variables (atom {}))
   (defn match-helper [p s]
     (cond
-      (or (atom? p) (atom? s)) false
+      ; (or (atom? p) (atom? s)) false
       (empty? p) (empty? s)
-      (= (first p) (first s)) (match5 (rest p) (rest s))
-      (and
-       (= (count (first p)) 2)
-       (= (first (first p)) '?)
-       (match5 (rest p) (rest s)))
-      (do
+      (atom? (first p))
+      (and (not (empty? s))
+           (= (first p) (first s))
+           (match (rest p) (rest s)))
+      ; complex patterns
+      (and (not (empty? s))
+           (= (first (first p)) '?))
+      (when (match (rest p) (rest s))
         (swap! variables (fn [vs] (assoc vs (first (rest (first p))) (first s))))
         true)
+      (= (first (first p)) '*)
+      (cond
+        (and (not (empty? s))
+             (match (rest p) (rest s)))
+        (do
+          (swap! variables (fn [vs] (assoc vs (first (rest (first p))) (list (first s)))))
+          true)
+        (match (rest p) s)
+        (do
+          (swap! variables (fn [vs] (assoc vs (first (rest (first p))) (list))))
+          true)
+        (and (not (empty? s))
+             (match p (rest s)))
+        (do
+          (swap! variables (fn [vs] (assoc vs
+                                           (first (rest (first p)))
+                                           (cons (first s) (vs (first (rest (first p))))))))
+          true))
       (and
-       (= (count (first p)) 2)
-       (not (= (first (first p)) '?))
+       (not (empty? s))
        ((resolve (first (first p))) (first s))
-       (match5 (rest p) (rest s)))
+       (match (rest p) (rest s)))
       (do
         (swap! variables (fn [vs] (assoc vs (first (rest (first p))) (first s))))
         true)