continuing changes

continuing changes

--- src/rester/utils.clj
+++ src/rester/utils.clj
@@ -1,15 +1,68 @@
 (ns rester.utils
-  (:require [clojure.spec.alpha :as s]
-            [rester.specs :as rs :refer [http-verbs]]
-            [yaml.core :as yaml]
+  (:require [clojure.data.csv :as csv]
+            [clojure.java.io :as io]
+            [clojure.set :refer [union]]
+            [clojure.spec.alpha :as s]
+            [clojure.string :as str]
+            [clojure.tools.logging :as log]
             [dk.ative.docjure.spreadsheet
              :refer
              [load-workbook read-cell row-seq select-sheet sheet-seq]]
-            [clojure.string :as str]))
+            [rester.specs :as rs :refer [http-verbs]]
+            [yaml.core :as yaml])
+  (:import java.text.SimpleDateFormat
+           java.util.Calendar))

 (def ^:const fields [:suite :name :url :verb :headers :payload :params :exp-status :exp-body
                      :exp-headers :options :extractions :priority])

+(def ^:const placeholder-pattern #"\$(\p{Alpha}[^\$]*)\$")
+(def ^:const date-operand-pattern #"\s*(\+|-)\s*(\d+)\s*(\p{Alpha}+)")
+(def ^:const date-exp-pattern #"(\p{Alpha}+)((\s*(\+|-)\s*\d+\s*\p{Alpha}+)*)(:(.+))?")
+(def ^:const date-fields {"days" Calendar/DATE "day" Calendar/DATE "week" Calendar/WEEK_OF_YEAR
+                          "weeks" Calendar/WEEK_OF_YEAR "year" Calendar/YEAR "years" Calendar/YEAR
+                          "month" Calendar/MONTH "months" Calendar/MONTH
+                          "hour" Calendar/HOUR "hours" Calendar/HOUR
+                          "min" Calendar/MINUTE "mins" Calendar/MINUTE
+                          "sec" Calendar/SECOND "secs" Calendar/SECOND})
+
+(defn- to-int [s]
+  (try
+    (if (empty? s) 0
+        (Integer/parseInt s))
+    (catch Exception e 0)))
+
+(defn- eval-date-exp [cal [num name]]
+  (.add cal (date-fields name Calendar/DATE) num))
+
+(defn- date-from-name [name]
+  (let [cal (Calendar/getInstance)]
+    (case name
+      "now" cal
+      "today" cal
+      "tomorrow" (do (.add cal Calendar/DATE 1) cal)
+      nil)))
+
+(defn parse-date-exp [s]
+  (if-let [[_ name operands _ _ _ fmt] (re-matches date-exp-pattern s)]
+    (if-let [cal (date-from-name name)]
+      (let [operations (for [[_ op n name] (re-seq date-operand-pattern operands)]
+                         [(* (if (= op "+") 1 -1) (Integer/parseInt n)) name])]
+        (doseq [op operations]
+          (eval-date-exp cal op))
+        (.format (SimpleDateFormat. (or fmt "yyyy-MM-dd")) (.getTime cal))))))
+
+(defn parse-options [options]
+  (into {} (for [opt (str/split options #"\s*,\s*")
+                 :let[[_ key _ _ value] (re-find #"\s*([^:=\s]+)\s*((:|=)\s*([^\s]+))?\s*" opt) ]
+                 :when key]
+             [(keyword (str/lower-case key)) (or value true)])))
+
+(defn- replace-opts [s opts]
+  (when s
+    (str/replace s placeholder-pattern
+                 #(str (or (opts (second %) (parse-date-exp (second %)))
+                           (log/error "missing argument:" (second %)) "")))))
 (defn str->map
   ([s sep] (str->map s sep {} false))
   ([s sep opts include-empty]
@@ -22,6 +75,12 @@
             (filter #(or include-empty (not (str/blank? (second %)))))
             (into {}))))))

+(defn parse-options [options]
+  (into {} (for [opt (str/split options #"\s*,\s*")
+                 :let[[_ key _ _ value] (re-find #"\s*([^:=\s]+)\s*((:|=)\s*([^\s]+))?\s*" opt) ]
+                 :when key]
+             [(keyword (str/lower-case key)) (or value true)])))
+
 (defn- to-test-case
   "convert yaml/json to test-case format"
   [params]
@@ -33,30 +92,35 @@
         data))
     {:error (str "missing request verb/url:" (:suite params) "/" (:name params))}))

+(defn- parse-test [t]
+  (-> t
+      (update :priority to-int)
+      (dissoc :exp-status :exp-body :exp-headers :extractors)
+      (assoc :expect
+             (into {} [[:status (:exp-status t)]
+                       (some->> t :exp-body not-empty (vector :body))
+                       (some->> t :exp-headers not-empty #(str->map % #":")
+                                (vector :headers))]))
+      (assoc :options
+             (into (or (some-> t :options not-empty parse-options) {})
+                   [[:priority (or (some-> t :priority not-empty to-int) 0)]
+                    (some->> t :extractors not-empty #(str->map #"\s*=\s*") (vector :extractors))]))))
+
 (defn- rows->test-cases
   "converts rows into test-cases"
   [rows]
   (loop [suite "(Ungrouped Tests)"
          id 0
-         row (first rows)
+         rows rows
          tests []]
-    (let [t (zipmap fields row)
-          suite (or (:suite t) suite)]
-      (conj tests  (-> t (assoc :suite suite :id id )
-                       (update :priority to-int)
-                       (dissoc :exp-status :exp-body :exp-headers)
-                       (assoc :expect
-                              (into {} [[:status (:exp-status t)]
-                                        (cond->> (:exp-body t)
-                                          (comp not str/blank?) (vector :body))
-                                        (cond->> (:exp-headers t)
-                                          (comp not str/blank?) #(vector :headers (str->map % #":")))]))))))
-  (for [row [rows]])
-  (->> xs (map #(zipmap fields %)))
-  (filter #(not (str/blank? (:test %))))
-  (map #(update % :priority to-int))
-
-  )
+    (if (empty? rows)
+      tests
+      (let [t (zipmap fields (first rows))
+            suite (or (:suite t) suite)
+            t (parse-test (assoc t :suite suite :id id))
+            t (if (s/valid? ::rs/test-case t) t
+                  (assoc t :invalid (s/explain-str ::rs/test-case t)))]
+        (recur suite (inc id) (rest rows) (conj tests t))))))

 (defn from-yaml
   "Parses tests from a yaml file"
@@ -90,7 +154,7 @@
   (with-open [in-file (io/reader file)]
     (doall (rest (csv/read-csv in-file)))))

-(defmethod load-tests-from :yaml [file]
+(defmethod load-tests-from :yaml [file _]
   (from-yaml file))

 (defn parse-options [options]
@@ -105,6 +169,9 @@
         (Integer/parseInt s))
     (catch Exception e 0)))

+(defn placeholders [s]
+  (set (map second (re-seq placeholder-pattern s))))
+
 (defn placeholders-of [{:keys[url headers params payload exp-body]}]
   (apply union (map placeholders [url headers params payload exp-body])))

@@ -115,11 +182,9 @@
        (some #(cyclic? deps % (conj visited x)) (deps x)))))

 (defn tests-from [file sheet]
-  (let [tests (->> (map #(zipmap fields %) (read-rows file sheet))
-                   (filter #(not (str/blank? (:test %))))
-                   (map #(update % :priority to-int))
-                   (map-indexed #(-> %2 (assoc :placeholders (placeholders-of %2) :id %1)
-                                     (update :extractions str->map #"\s*=\s*"))))
+  (let [tests (load-tests-from file sheet)
+        valid-tests (map #(assoc :placeholders (placeholders-of %))
+                         (remove :invalid tests))
         extractors (for [t tests :when (:extractions t)] [(:id t) (map first (:extractions t))])
         tests (map (fn [{:keys[placeholders options] :as test}]
                      (assoc test :deps (for [[i extractions] extractors


250 stars more spread out

250 stars more spread out

--- src/splash/core.cljs
+++ src/splash/core.cljs
@@ -43,13 +43,13 @@
 )

-(def num-stars 500)
+(def num-stars 250)
 (def stars-set (sort-by
                 :z
                 (map (fn [n]
                        (let [depth (math/rand-between 0 8)]
-                         {:x (math/rand-between 0 400)
-                          :y (math/rand-between 0 300)
+                         {:x (math/rand-between 0 2048)
+                          :y (math/rand-between 0 2048)
                           :z (+ depth (rand))
                           :depth depth})) (range num-stars))))


add generate-tag-html test

add generate-tag-html test

--- test/misaki/test/core.clj
+++ test/misaki/test/core.clj
@@ -147,6 +147,19 @@
       "

foo

"
       (html (generate-html file2)))))

+;;; generate-tag-html
+(deftest* generate-tag-html-test
+  (are [x y] (= x y)
+    ; tag1
+    "
tag1

bar

"
+    (html (generate-tag-html "tag1"))
+    ; tag2
+    "
tag2

bar

foo

"
+    (html (generate-tag-html "tag2"))
+    ; tagX
+    "
tagX

"
+    (html (generate-tag-html "tagX"))))
+

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


Fixing compile

Fixing compile

--- metrics-clojure-ring/src/metrics/ring/expose.clj
+++ metrics-clojure-ring/src/metrics/ring/expose.clj
@@ -85,8 +85,8 @@
 (defn expose-metrics-as-json
   ([handler] (expose-metrics-as-json handler "/metrics"))
   ([handler uri]
-   (let [request-uri (:uri request)]
-     (fn [request]
+   (fn [request]
+     (let [request-uri (:uri request)]
        (if (or (.startsWith request-uri (sanitize-uri uri))
                (= request-uri uri))
          (metrics-json request)


Cleaning out dead code

Cleaning out dead code

--- src/tropology/db.clj
+++ src/tropology/db.clj
@@ -119,8 +119,7 @@
   [records]
   (->>
     (if (not-empty records)
-      (insert pages (values records))                       ; Doesn't return all records created, just the last one
-      )
+      (insert pages (values records)))                      ; Doesn't return all records created, just the last one
     (prof/p :create-all)))

@@ -201,38 +200,7 @@
              (assoc :is-redirect true)
              save-page!))
        ))
-
-
-
-    #_ (let [code    (lower-case (:code node))
-          all     (conj links code)
-          main-st (str "MERGE (p:Article {code:{maincode}}) SET "
-                       " p.url = {url}, p.category = {category}, p.host = {host}, "
-                       " p.title = {title}, p.image = {image}, p.type = {type}, "
-                       " p.nextUpdate = {nextUpdate}, p.timeStamp = {timeStamp}, "
-                       " p.display = {display}, "
-                       " p.hasError = {hasError}, p.is-redirect = {is-redirect} "
-                       (if (some? links)
-                         (str "FOREACH (link in {links} |"
-                              " MERGE (p2:Article {code:link}) "
-                              " ON CREATE SET p2.nextUpdate = {timeStamp}, p2.hasError = false, p2.is-redirect = false, p2.timeStamp = {timeStamp} "
-                              " CREATE UNIQUE (p)-[" rel "]->(p2))"))
-                       )
-          p       (-> (merge {:host b/base-host :category (b/category-from-code code) :image nil :has-error false :is-redirect false} node) ; Add defaults
-                      timestamp-next-update
-                      (assoc :maincode code :links links))]
-      (tx/in-transaction
-        conn
-        (tx/statement main-st p)
-        (tx/statement "MATCH ()-[r:LINKSTO]->(n:Article) WHERE n.code in {links} WITH n, COUNT(r) as incoming SET n.incoming = incoming" {:links all})
-        (tx/statement (str "MATCH " (code-to-match "n") "-[r:LINKSTO]->() WITH n, COUNT(r) as outgoing SET n.outgoing = outgoing") {:id code})
-        (tx/statement "MATCH (n:Article) WHERE n.outgoing is null AND n.code in {links} WITH n SET n.outgoing = 0" {:links all})
-        (tx/statement "MATCH (n:Article) WHERE n.incoming is null AND n.code in {links} WITH n SET n.incoming = 0" {:links all})
-        (if is-redirect
-          (tx/statement "MERGE (p:Article {code:{code}}) SET p.is-redirect = true, p.nextUpdate = 0, p.timeStamp = {timeStamp}, p.hasError = false"
-                        {:code redirector, :time-stamp (:time-stamp node)})))
-      ))
-  )
+    ))

 ;
@@ -302,7 +270,6 @@
   ([^String common-code codes-from]
    (query-common-nodes-from common-code codes-from :LINKSTO 1000))
   ([^String common-code codes-from rel incoming-link-limit]
-    ; PROFILE MATCH (n:Article {code:"Anime/CowboyBebop"})--(m:Article {code:"Main/NoHoldsBarredBeatdown"})-[r:LINKSTO]->(o:Article)--(n) WHERE o.incoming < 1000 RETURN DISTINCT o;
    (let [code  (lower-case common-code)
          rels  (->>
                  (union


Add more validators to schema.

Add more validators to schema.

--- src/uxbox/schema.clj
+++ src/uxbox/schema.clj
@@ -33,6 +33,29 @@
   {:default-message-format "%s must be a function."}
   [v]
   (fn? v))
+
+(def ^:const +email-re+
+  #"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$")
+
+(v/defvalidator email
+  "Validate if `v` is a valid email."
+  {:default-message-format "% must be a valid email."}
+  [v]
+  (clojure.core/boolean (re-seq +email-re+ v)))
+
+(v/defvalidator max-len
+  "Validate if `v` is at least smaller that `n`."
+  {:default-message-format "% must be lees than the maximum."}
+  [v n]
+  (let [len (count v)]
+    (>= len v)))
+
+(v/defvalidator min-len
+  "Validate if `v` is at least larger that `n`."
+  {:default-message-format "% must be greater than the minimum."}
+  [v n]
+  (let [len (count v)]
+    (>= v len)))

 (def required v/required)
 (def number v/number)


Remove a magic number in get-key.

Remove a magic number in get-key.

--- src/constraint/edit.cljs
+++ src/constraint/edit.cljs
@@ -1,6 +1,7 @@
 (ns constraint.edit
   (:require [constraint.common :refer [edge-id]]))

+(def edge-id-len (count edge-id))

 (defn where-svg-was-clicked [event]
   (let [svg-rect (.getBoundingClientRect (dommy.core/sel1 :svg))
@@ -17,7 +18,7 @@

 (defn get-key [edge-str]
   (->> edge-str
-       (drop 4)
+       (drop edge-id-len)
        (apply str)
        (js/parseInt)))


Add equality check to series

Add equality check to series

--- src/dataframe/series.clj
+++ src/dataframe/series.clj
@@ -13,11 +13,27 @@
 ;
 ; All items in the index must be unique.
 ;
+; https://gist.github.com/david-mcneil/1684980
+;
 (deftype ^{:protected true} Series [data index lookup]
+
+  java.lang.Object
+  (equals [this other]
+    (cond (nil? other) false
+          (not (= Series (class other))) false
+          :else (every? true?
+                        [(= (. this data ) (. other data))
+                         (= (. this index ) (. other index))])))

   clojure.lang.ILookup
   (valAt [_ k] (get lookup k))
-  (valAt [_ k or-else] (get lookup k or-else)))
+  (valAt [_ k or-else] (get lookup k or-else))
+
+  java.lang.Iterable
+  (iterator [this]
+    (.iterator (zip (index data))))
+
+  )

 ; Constructor
 (defn series
@@ -48,6 +64,10 @@
   [^Series srs]
   (. srs index))

+(defn data
+  [^Series srs]
+  (. srs data))
+
 (defn ix
   "Takes a series and an index and returns
   the item in the series corresponding
@@ -60,13 +80,8 @@
 (defn srs->map
   [^Series srs]
   (into (sorted-map) (zip (. srs index) (. srs data))))
-;
-;
-;(defn filter
-;  [srs & args]
-;  (let [filters (map #(every? boolean %) (zip args))
-;        data (:data srs)
-;        index (:index srs)
-;        data-filtered (vec (for [[keep? item] (zip filters data) :when keep?] item))
-;        index-filtered (vec (for [[keep? item] (zip filters index) :when keep?] item))]
-;    (series data-filtered :index index-filtered :name (:name srs))))+
+
+(defn set-index
+  [^Series srs index]
+  (series (data srs) index))


Get proper hostname for new 404 image

Get proper hostname for new 404 image

--- src/foreclojure/ring.clj
+++ src/foreclojure/ring.clj
@@ -7,7 +7,7 @@
   (:use     [compojure.core            :only [GET routes]]
             [hiccup.core               :only [html]]
             [foreclojure.version-utils :only [strip-version-number]]
-            [foreclojure.ring-utils    :only [get-host]]
+            [foreclojure.ring-utils    :only [get-host static-url]]
             [useful.debug              :only [?]]
             [ring.util.response        :only [response]]))

@@ -68,7 +68,7 @@
    [:body
     [:div {:style "margin-left: auto; margin-right: auto; width: 300px;"}
      [:p {:style "text-align: center; width: 100%; margin-top: 45px; font-family: helvetica; color: gray; font-size: 25px;"} "404 — Page not found."]
-     [:img {:style "margin-left: 18px;" :src "/images/4clj-gus-confused-small.png"}]]]))
+     [:img {:style "margin-left: 18px;" :src (static-url "images/4clj-gus-confused-small.png")}]]]))

 (defn wrap-404 [handler]
   (routes handler


Comment out testing code

Comment out testing code

--- src/hodgepodge/core.cljs
+++ src/hodgepodge/core.cljs
@@ -52,20 +52,21 @@

 (defn clear! [storage] (.clear storage))

-(clear! local-storage)
-(clear! session-storage)
+(comment
+  (clear! local-storage)
+  (clear! session-storage)

-(assert (= 0 (count local-storage)))
-(assert (= 0 (count session-storage)))
+  (assert (= 0 (count local-storage)))
+  (assert (= 0 (count session-storage)))

-(assoc! local-storage :foo :bar)
-(assert (= 1 (count local-storage)))
-(assert (= 0 (count session-storage)))
-(print (get local-storage :foo))
+  (assoc! local-storage :foo :bar)
+  (assert (= 1 (count local-storage)))
+  (assert (= 0 (count session-storage)))

-(print (js/Date.))
-(print (type (js/Date.)))
-(assoc! local-storage {:foo :bar} (js/Date.))
-(assert (= 2 (count local-storage)))
-(assert (= 0 (count session-storage)))
-(print (get local-storage {:foo :bar}))
+  (dissoc! local-storage :foo)
+  (assert (= 0 (count local-storage)))
+  (assert (= 0 (count session-storage)))
+
+  (assoc! local-storage {:foo :bar} (js/Date.))
+  (assert (= 1 (count local-storage)))
+  (assert (= 0 (count session-storage))))


Make uncalled look less obnoxious

Make uncalled look less obnoxious

--- src/midje/semi_sweet.clj
+++ src/midje/semi_sweet.clj
@@ -104,40 +104,6 @@
   [& _]
   (parse-data-fakes/to-lexical-map-form &form))

-
-;;; Because not-called is deprecated, leaving this code lying around.
-(letfn [(make-fake-map [call-form arrow rhs fnref special-to-fake-type user-override-pairs]
-          (let [common-to-all-fakes `{:var ~(fnref/fnref-call-form fnref)
-                                      :call-count-atom (atom 0)
-                                      :position (user-file-position)
-
-                                      ;; for Midje tool creators:
-                                      :call-form '~call-form
-                                      :arrow '~arrow
-                                      :rhs '~rhs}]
-            (merge
-              common-to-all-fakes
-              special-to-fake-type
-              (apply hash-map-duplicates-ok user-override-pairs)))) ]
-
-  (defn- not-called* [var-sym & overrides]
-    (make-fake-map nil nil nil ;; deprecated, so no support for fields for tool creators
-      var-sym
-      `{:call-text-for-failures (str '~var-sym " was called.")
-        :result-supplier (constantly nil)
-        :type :not-called}
-      overrides)))
-
-(defmacro not-called
-  "Creates an fake map that a function will not be called.
-   Example: (not-called f))
-   DEPRECATED: Prefer `:times 0` annotation to `fake`, ex. (provided (f) => 4 :times 0))"
-  {:deprecated "1.3-alpha2"
-   :arglists '([var-sym & overrides])}
-  [forms]
-  (deprecate "`not-called` will be removed in 1.6. Use `(provided (f) => 4 :times 0)` instead.")
-  (not-called* forms))
-
 (defn- ^{:testable true } a-fake? [x]
   (and (seq? x)
        (semi-sweet-keyword? (first x))))
@@ -157,3 +123,36 @@
                          [fakes overrides] (separate-by a-fake? fakes+overrides)
                          _ (validate fakes)]
       (expect-expansion call-form arrow expected-result fakes overrides))))
+
+
+(defmacro not-called
+  "Creates an fake map that a function will not be called.
+   Example: (not-called f))
+   DEPRECATED: Prefer `:times 0` annotation to `fake`, ex. (provided (f) => 4 :times 0))"
+  {:deprecated "1.3-alpha2"
+   :arglists '([var-sym & overrides])}
+  [forms]
+  (letfn [(make-fake-map [call-form arrow rhs fnref special-to-fake-type user-override-pairs]
+            (let [common-to-all-fakes `{:var ~(fnref/fnref-call-form fnref)
+                                        :call-count-atom (atom 0)
+                                        :position (user-file-position)
+
+                                        ;; for Midje tool creators:
+                                        :call-form '~call-form
+                                        :arrow '~arrow
+                                        :rhs '~rhs}]
+              (merge
+               common-to-all-fakes
+               special-to-fake-type
+               (apply hash-map-duplicates-ok user-override-pairs))))
+
+          (not-called* [var-sym & overrides]
+            (make-fake-map nil nil nil ;; deprecated, so no support for fields for tool creators
+                           var-sym
+                           `{:call-text-for-failures (str '~var-sym " was called.")
+                             :result-supplier (constantly nil)
+                             :type :not-called}
+                           overrides))]
+    (deprecate "`not-called` will be removed in 1.6. Use `(provided (f) => 4 :times 0)` instead.")
+    (not-called* forms)))
+


added group count

added group count

--- src/ophion/aggregate.clj
+++ src/ophion/aggregate.clj
@@ -112,6 +112,11 @@
        (assoc project label (str "$_history." label)))
      {} labels)}])

+(defn group-count
+  [state path]
+  [{:$group {:_id (str "$" path) :count {:$sum 1}}}
+   {:$project {:key "$_id" :count "$count"}}])
+
 (def steps
   {:where has
    :from-edge from-edge
@@ -121,7 +126,8 @@
    :from from
    :to to
    :mark mark
-   :select select})
+   :select select
+   :group-count group-count})

 (defn apply-step
   [steps step state]


input and aoutput-vector

input and aoutput-vector

--- src/paulkrake/mlprep.clj
+++ src/paulkrake/mlprep.clj
@@ -20,26 +20,33 @@
     (reduce (fn [a [h g hg gg]]
               (assoc a [h g] [hg gg])) {} x)))

+(defn flag-fn [b] (if b 1 0))
+
+(defn spieltag-as-list [[s t :as spieltag] alle-vereine]
+  (let [sp (reduce (fn [a [h g hg gg]]
+                     (as-> a x
+                       (assoc x h hg)
+                       (assoc x g gg))) {} (dc/spieltag s t))]
+    (as-> alle-vereine x
+      (map (fn [v] (get sp v -1)) x))))
+
+(defn spieltag-heim-gast-as-list [[s t :as spieltag] alle-vereine]
+  (let [sp (reduce (fn [a [h g hg gg]]
+                     (as-> a x
+                       (assoc x h 1)
+                       (assoc x g -1))) {} (dc/spieltag s t))]
+    (as-> alle-vereine x
+      (map (fn [v] (get sp v 0)) x))))
+
 (defn input-vector [[s t :as spieltag] alle-vereine]
-  (let [flag-fn (fn [b] (if b 1 0))
-
-        this-spieltag (spieltag-to-map s t )
-        [ns nt] (dc/spieltag-after s t)
-        next-spieltag (spieltag-to-map  ns nt)
-        m1 (for [h alle-vereine g alle-vereine :when (not= h g)]
-             (let [[hg gg] (get this-spieltag [h g] [0 0])]
-               (vector (flag-fn (contains? this-spieltag [h g]))
-                       hg gg
-                       (flag-fn (contains? next-spieltag [h g])))))]
-    (as-> m1 x
-      (apply concat x))))
+  (let [this-heim-gast-liste (spieltag-heim-gast-as-list spieltag alle-vereine)
+        spieltag (spieltag-as-list spieltag alle-vereine)
+        next-heim-gast-liste (spieltag-heim-gast-as-list (dc/spieltag-after s t)
+                                                         alle-vereine)]
+    (concat this-heim-gast-liste spieltag next-heim-gast-liste)))

-(defn output-vector [[s t :as spieltag]]
-  (let [[ns nt] (dc/spieltag-after s t)
-        next-spieltag (sort-by first (dc/spieltag  ns nt))
-        m1 (map (fn [[h g hg gg]] [hg gg]) next-spieltag)]
-    (as-> m1 x
-      (apply concat x))))
+(defn output-vector [[s t :as spieltag] alle-vereine]
+  (spieltag-as-list (dc/spieltag-after s t) alle-vereine))

 #_(as-> (dc/spieltag 1516 1) x


add a couple of todos

add a couple of todos

--- src/pc/http/datomic2.clj
+++ src/pc/http/datomic2.clj
@@ -39,6 +39,9 @@
 (defn chat-cust-name? [[type e a v :as transaction]]
   (= a :chat/cust-name))

+;; TODO: only let creators mark things as private
+;; TODO: only let people on the white list make things as private
+
 (defn transact!
   "Takes datoms from tx-data on the frontend and applies them to the backend. Expects datoms to be maps.
    Returns backend's version of the datoms."


Simplify ns :require's

Simplify ns :require's

--- src/pinpointer/core.cljc
+++ src/pinpointer/core.cljc
@@ -1,9 +1,8 @@
 (ns pinpointer.core
-  (:require #?@(:clj [[clojure.spec :as s]
-                      [rewrite-clj.zip :as z]
+  (:require [clojure.spec :as s]
+            #?@(:clj [[rewrite-clj.zip :as z]
                       clansi]
-                :cljs [[cljs.spec :as s]
-                       [rewrite-clj.zip :as z]])
+                :cljs [[rewrite-clj.zip :as z]])
             [pinpointer.printer :as pp]))

 (defn extract* [z [k & more :as in]]


Removed :refer in require according to clojure style guide.

--- evermind.web/src/evermind/web/core.cljs
+++ evermind.web/src/evermind/web/core.cljs
@@ -1,6 +1,6 @@
 (ns evermind.web.core
- (:require-macros [cljs.core.async.macros :refer [go]])
- (:require [cljs.core.async :refer [put! chan <!]]
+ (:require-macros [cljs.core.async.macros :as asyncmacros])
+ (:require [cljs.core.async :as async]
            [evermind.domain.core :as d]
            [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true]))
@@ -61,7 +61,7 @@
     om/IRenderState
     (render-state [this {:keys [select]}]
         (dom/g #js {:key (str "group-" (:key node))}
-          (dom/text #js {:onClick (fn [e] (put! select node))
+          (dom/text #js {:onClick (fn [e] (async/put! select node))
                          :fontSize "3pt"
                          :fill (if (-> node :attributes :selected) "red" "black")
                          :x (-> node :visu :x)
@@ -246,16 +246,16 @@
   (reify
     om/IInitState
     (init-state [_]
-       {:select (chan)})
+       {:select (async/chan)})
     om/IWillMount
     (will-mount [_]
        (let [select (om/get-state owner :select)]
-         (go (loop []
-               (let [selected (<! select)]
-                  (om/transact! data [:mindmap]
-                                (fn [m]
-                                  (select-node m selected)))
-                  (recur))))))
+         (asyncmacros/go (loop []
+                          (let [selected (async/<! select)]
+                               (om/transact! data [:mindmap]
+                                             (fn [m]
+                                               (select-node m selected)))
+                               (recur))))))
     om/IRenderState
     (render-state [this {:keys [select]}]
         (let [mindmap (update-node (:mindmap data))]


Fix syntax quote for without-attr-multi-vs

Without this fix, using this macro produces an error:

  Attempting to call unbound fn: #'clojure.core/unquote-splicing

Since the call to unquote-splicing is not within a syntax quote.

--- src/taoensso/faraday.clj
+++ src/taoensso/faraday.clj
@@ -1070,7 +1070,7 @@
   Ref. https://github.com/ptaoussanis/faraday/issues/63)." nil)

 (defmacro with-attr-multi-vs    [& body] `(binding [*attr-multi-vs?*  true] ~@body))
-(defmacro without-attr-multi-vs [& body] ~(binding [*attr-multi-vs?* false] ~@body))
+(defmacro without-attr-multi-vs [& body] `(binding [*attr-multi-vs?* false] ~@body))

 (defn- attr-multi-vs
   "Implementation detail.


Draw from and sample a Pareto distribution

--- src/test_utils/core.cljc
+++ src/test_utils/core.cljc
@@ -56,6 +56,21 @@
   ([n] (sample-normal n 0.0 1.0))
   ([n mu sigma] (ksd/sample n (ksd/normal {:mu mu :sd sigma}))))

+(defn draw-pareto
+  "Draw a single value from a pareto distribution with `scale`
+   (default log base 4 of 5) and shape (default 1)."
+  ([] (draw-pareto (/ (Math/log 5) (Math/log 4)) 1))
+  ([shape scale] (ksd/draw (ksd/pareto {:shape shape
+                                        :scale scale}))))
+
+(defn sample-pareto
+  "Return a sample of n (default 3) values from the pareto distribution
+  with shape, `shape` (default log base 4 of 5), and scale, `scale` (default 1.0)."
+  ([] (sample-pareto 3))
+  ([n] (sample-pareto n (/ (Math/log 5) (Math/log 4)) 1.0))
+  ([n shape scale] (ksd/sample n (ksd/pareto {:shape shape
+                                              :scale scale}))))
+
 (defn two-digit-zero-pad [number]
   (if (>= number 10)
     number


Detect winning game states

Detect winning game states

--- src/tic_tac_toe/core.clj
+++ src/tic_tac_toe/core.clj
@@ -1,10 +1,6 @@
 (ns tic-tac-toe.core
   (:gen-class))

-(defn -main
-  "I don't do a whole lot ... yet."
-  [& args]
-  (println "Hello, World!"))

 (def blank-board
   [\- \- \-
@@ -18,6 +14,20 @@
    \- \o \-
    \- \- \-])

+(def board-x-wins
+  [\x \- \o
+   \- \x \o
+   \- \- \x])
+
+(def board-o-wins
+  [\x \- \o
+   \- \x \o
+   \- \- \o])
+
+(def board-draw
+  [\x \o \o
+   \o \x \x
+   \x \o \o])

 (def poses (range 9))

@@ -31,7 +41,42 @@
   (doseq [row (partition 3 board)]
     (println (apply str row))))

+(defn zip [rest]
+  (apply map vector rest))
+
+(defn winning-partitions [board]
+  (let [rows (partition 3 board)
+        cols (zip rows)
+        diagonals [(apply concat (partition 1 4 board))
+                   (->> board
+                        (drop 2)
+                        (partition 1 2)
+                        (take 3)
+                        (apply concat))]]
+    (concat rows cols diagonals)))
+
+;;
+;; (apply concat (partition 1 4 (apply concat (map reverse (partition 3 (range 9))))))
+
 (defn possible-moves [board player]
   (doseq [pos (available-squares board)]
     (println)
     (print-board (place-piece board player pos))))
+
+(defn player-has-won [player partitions]
+  (some (fn [partition] (every? #(= player %) partition)) partitions))
+
+(defn winner
+  "Return one of x, o, nil, :draw"
+  ([board]
+     (let [partitions (winning-partitions board)]
+       (cond
+        (player-has-won \x partitions) \x
+        (player-has-won \o partitions) \o
+        (empty? (available-squares board)) :draw
+        :else nil))))
+
+
+;;0 1 2
+;;3 4 5
+;;6 7 8


whitespace

whitespace

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -123,8 +123,7 @@
         (do
           (log/info (str "generate: generating from spec: "
                          (strip-refs spec)))
-          (let [expression
-                (first (take 1 (generate-all spec grammar lexicon index morph)))]
+          (let [expression (first (take 1 (generate-all spec grammar lexicon index morph)))]
             (if expression
               (do
                 (log/info (str "generate: generated "


Omit Go.cd job name if matches stage name. Useful if aggregating jobs

--- src/buildviz/gosync.clj
+++ src/buildviz/gosync.clj
@@ -160,6 +160,11 @@

 ;; upload

+(defn- job-name [pipeline-name stage-name job-name]
+  (if (= stage-name job-name)
+    (format "%s %s" pipeline-name stage-name)
+    (format "%s %s %s" pipeline-name stage-name job-name)))
+
 (defn- stage-instances->builds [{pipeline-name :pipelineName
                                  pipeline-run :pipelineRun
                                  stage-name :stageName
@@ -171,7 +176,7 @@
              end :end
              name :name
              junit-xml :junit-xml}]
-         {:job-name (format "%s %s %s" pipeline-name stage-name name)
+         {:job-name (job-name pipeline-name stage-name name)
           :build-id (format "%s %s" pipeline-run stage-run)
           :junit-xml junit-xml
           :build {:start start


naming arg to provision

naming arg to provision

--- src/celestial/tasks.clj
+++ src/celestial/tasks.clj
@@ -20,10 +20,10 @@
     (assert (= (.status ct) "running"))
     (info "done system setup")))

-(defn puppetize [{:keys [server module] :as spec} ]
-  (info "starting to provision" spec)
+(defn puppetize [{:keys [server module] :as provision} ]
+  (info "starting to provision" provision)
   (.apply- (Standalone. server module) )
-  (info "done provisioning" spec))
+  (info "done provisioning" provision))

 (defn full-cycle
   ([{:keys [system hypervisor provision]}] (full-cycle system hypervisor))


add ':scm' key to ancient-clj's project.clj.

--- ancient-clj/project.clj
+++ ancient-clj/project.clj
@@ -18,6 +18,7 @@
                  [commons-logging "1.2"]
                  [joda-time "2.9.2"]
                  [potemkin "0.4.3"]]
+  :scm {:dir ".."}
   :profiles {:dev {:dependencies [[midje "1.8.3"]
                                   [clj-time "0.11.0"]
                                   [http-kit "2.1.19"]]


CMR-688: Fixed contact name logic for DIF.

--- umm-lib/src/cmr/umm/dif/collection.clj
+++ umm-lib/src/cmr/umm/dif/collection.clj
@@ -55,12 +55,18 @@
 (defn- xml-elem->contact-name
   "Returns the contact name from a parsed Collection XML structure"
   [xml-struct]
-  (let [last-name (or (cx/string-at-path xml-struct [:Personnel :Last_Name])
-                      (cx/string-at-path xml-struct [:DataCenter :Personnel :Last_Name]))
-        first-name (or (cx/string-at-path xml-struct [:Personnel :First_Name])
-                       (cx/string-at-path xml-struct [:DataCenter :Personnel :First_Name]))]
-    (if (and first-name last-name)
-      (str first-name " " last-name)
+  (let [last-name-personnel (cx/string-at-path xml-struct [:Personnel :Last_Name])
+        last-name-datacenter (cx/string-at-path xml-struct [:DataCenter :Personnel :Last_Name])
+        first-name-personnel (cx/string-at-path xml-struct [:Personnel :First_Name])
+        first-name-datacenter (cx/string-at-path xml-struct [:DataCenter :Personnel :First_Name])]
+    (cond
+      (and first-name-personnel last-name-personnel)
+      (str first-name-personnel " " last-name-personnel)
+
+      (and first-name-datacenter last-name-datacenter)
+      (str first-name-datacenter " " last-name-datacenter)
+
+      :else
       "undefined")))

 (defn- xml-elem->Collection


umm-lib -> umm-spec-lib

umm-lib -> umm-spec-lib

--- umm-spec-lib/src/cmr/umm_spec/util.clj
+++ umm-spec-lib/src/cmr/umm_spec/util.clj
@@ -133,7 +133,7 @@
      value)))

 (defn default-value?
-  "Does the given value match umm-lib default?"
+  "Does the given value match umm-spec-lib default?"
   [value]
   (= value not-provided))


updated breadcrumb widget

updated breadcrumb widget

--- src-cljs/mappt/components/header_breadcrumb.cljs
+++ src-cljs/mappt/components/header_breadcrumb.cljs
@@ -3,13 +3,18 @@
             [sablono.core :as html :refer-macros [html]]
             [secretary.core :as secretary]))

-(defn click-handler [url e]
+(defn append-breadcrumb!
+  "appends a breadcrumb to the list of breadcrumbs"
+  [state name url]
+  (swap! state update-in [:breadcrumbs] conj {:name name :url url}))
+
+(defn click-handler [state url e]
   (.log js/console "breadcrumb clicked! - " url))

-(defn gen-breadcrumb [crumb]
+(defn gen-breadcrumb [state crumb]
   [:a {:href (crumb :url)
        :class "breadcrumb"
-       :on-click (partial click-handler (crumb :url))}
+       :on-click (partial click-handler state (crumb :url))}
    (crumb :name)])

 (defn widget [data owner]
@@ -17,8 +22,12 @@
     om/IRender
     (render [this]
       (html [:div {:class "breadcrumb-tree"}
-             (let [crumbs-dom (map gen-breadcrumb (data :breadcrumbs))
-                   crumbs (interpose
-                           [:span {:class "breadcrumb-separator"} ">"]
-                           crumbs-dom)]
+             (let [gen-partial
+                   (partial gen-breadcrumb data)
+                   crumbs-dom
+                   (map gen-partial (data :breadcrumbs))
+                   crumbs
+                   (interpose
+                    [:span {:class "breadcrumb-separator"} ">"]
+                    crumbs-dom)]
                crumbs)]))))


Route / to the in-production view

Route / to the in-production view

--- src/cljs/mdr2/core.cljs
+++ src/cljs/mdr2/core.cljs
@@ -42,7 +42,7 @@
            [:div#nav-menu.navbar-menu
             {:class (when @expanded? :is-active)}
             [:div.navbar-start
-             [nav-link "#/in-production" "Productions" :in-production]
+             [nav-link "#/" "Productions" :in-production]
              [nav-link "#/archived" "Archived" :archived]
              (when (seq (set/intersection #{:it :catalog} roles))
                  [nav-link "#/encoded" "Encoded" :encoded])
@@ -65,7 +65,10 @@

 (def router
   (reitit/router
-    [["/login" {:name :login
+   [["/" {:name :in-production
+          :view #'in-production/page
+          :controllers [{:start (fn [_] (rf/dispatch [::in-production/fetch-productions]))}]}]
+    ["/login" {:name :login
                 :view #'auth/login-page}]
      ["/productions/:id" {:name :production
                           :view #'production/page
@@ -77,9 +80,6 @@
                                  :controllers [{:stop (fn [_]
                                                         (rf/dispatch [::production/clear-current])
                                                         (rf/dispatch [::in-production/clear-upload-file]))}]}]
-     ["/in-production" {:name :in-production
-                        :view #'in-production/page
-                        :controllers [{:start (fn [_] (rf/dispatch [::in-production/fetch-productions]))}]}]
      ["/archived" {:name :archived
                    :view #'archived/page
                    :controllers [{:start (fn [_] (rf/dispatch [::archived/fetch-productions]))}]}]


Improve point transformation helpers.

Improve point transformation helpers.

--- frontend/src/uxbox/util/geom/point.cljs
+++ frontend/src/uxbox/util/geom/point.cljs
@@ -94,6 +94,12 @@
     (Point. (/ (:x p) (:x other))
             (/ (:y p) (:y other)))))

+(defn negate
+  [p]
+  {:pre [(point? p)]}
+  (let [{:keys [x y]} (-point p)]
+    (Point. (- x) (- y))))
+
 (defn distance
   "Calculate the distance between two points."
   [p other]
@@ -161,7 +167,7 @@

 (defn transform
   "Transform a point applying a matrix transfomation."
-  [{:keys [x y] :as p} {:keys [a b c d tx ty] :as m}]
-  (Point. (+ (* x a) (* y c) tx)
-          (+ (* x b) (* y d) ty)))
-
+  [pt {:keys [a b c d tx ty] :as m}]
+  (let [{:keys [x y]} (point pt)]
+    (Point. (+ (* x a) (* y c) tx)
+            (+ (* x b) (* y d) ty))))


Fix tests regarding color

Fix tests regarding color

--- test/archi/core_test.clj
+++ test/archi/core_test.clj
@@ -54,12 +54,11 @@
   (is (= "desc" (path-desc ["desc" 1 2 3]))))

 (deftest make-feature-edge-test
-  (let [feature {:id :fid :descriptions ["1st" "2nd"]}
+  (let [feature {:id :fid :descriptions ["1st" "2nd"] :color "#color"}
         path ["pd" 1 2]
         n1 {:id :n1}
         n2 {:id :n2}]
-    (with-redefs [gensym (fn [id] (str "gen" id))
-                  random-color (fn [] "#color")]
+    (with-redefs [gensym (fn [id] (str "gen" id))]
       (is (= [:n1 :n2 {:id "genedge"
                        :feature :fid
                        :color "#color"
@@ -69,7 +68,8 @@
              (make-feature-edge feature path n1 n2))))))

 (deftest feature->edges-test
-  (with-redefs [make-feature-edge (fn [feature path n1 n2] (vector (first path) n1 n2))]
+  (with-redefs [make-feature-edge (fn [feature path n1 n2] (vector (first path) n1 n2))
+                random-color (fn [] "#color")]
     (is (= [["pd1" 1 2] ["pd1" 2 3] ["pd2" 1 3]]
            (feature->edges {:paths [["pd1" 1 2 3]
                                     ["pd2" 1 3]]})))))


Name the dummy jobs in this test. (#768)

--- scheduler/test/cook/test/mesos/util.clj
+++ scheduler/test/cook/test/mesos/util.clj
@@ -361,18 +361,21 @@
       ;; test less flaky
       (let [start-time (Date.)
             job1 (create-dummy-job conn
+                                   :name "job1"
                                    :user "u1"
                                    :job-state state
                                    :submit-time (Date.)
                                    :custom-executor? false)
             ; this job should never be returned.
             _ (create-dummy-job conn
+                                :name "job1.5"
                                 :user "u1"
                                 :job-state state
                                 :submit-time (Date.)
                                 :custom-executor? true)
             _ (Thread/sleep 5)
             job2 (create-dummy-job conn
+                                   :name "job2"
                                    :user "u1"
                                    :job-state state
                                    :submit-time (Date.)
@@ -380,12 +383,14 @@
             _ (Thread/sleep 5)
             half-way-time (Date.)
             job3 (create-dummy-job conn
+                                   :name "job3"
                                    :user "u2"
                                    :job-state state
                                    :submit-time (Date.)
                                    :custom-executor? false)
             _ (Thread/sleep 5)
             job4 (create-dummy-job conn
+                                   :name "job4"
                                    :user "u1"
                                    :job-state state
                                    :submit-time (Date.)


fixed mastersign.geom/area

fixed mastersign.geom/area

--- src/mastersign/geom.clj
+++ src/mastersign/geom.clj
@@ -55,10 +55,10 @@
   ([] (Area.))
   ([s] (Area. s))
   ([s & shapes]
-   (let [a (Area. s)]
+   (let [*a* (Area. s)]
      (doseq [s shapes]
-       (.add a (Area. s))
-       a))))
+       (.add *a* (Area. s)))
+     *a*)))

 (defn translate-area
   ([area o]


cleaned imports

cleaned imports

--- src/ontrail/summary.clj
+++ src/ontrail/summary.clj
@@ -1,11 +1,10 @@
 (ns ontrail.summary
-  (:use ontrail.mongodb ontrail.formats))
-
-(require '[monger.core]
-         '[monger.conversion]
-         '[clj-time.core :as time]
-         '[monger.joda-time]
-         '[monger.collection :as mc])
+  (:use ontrail.mongodb ontrail.formats)
+  (:require [monger.core]
+            [monger.conversion]
+            [clj-time.core :as time]
+            [monger.joda-time]
+            [monger.collection :as mc]))

 (defn avghr [db-retmap]
   (let [hrcount (get db-retmap :hrcount)]


make production aspect/compilation testable

This was done to catch any regressions with externs. Ironically,
this doesn't handle that case yet because the only code that uses externed js, spinner,
doesn't live in simulated.* which is what is required for tests (because
file path apps don't allow CORS).

--- pedestal-app/app/src/semtag_web/tasks.clj
+++ pedestal-app/app/src/semtag_web/tasks.clj
@@ -31,17 +31,25 @@
       (as-> new-body
         (spit file new-body))))

+(defn- modify-config [config aspect]
+  (if-not (System/getenv "TEST")
+    config
+    (assoc-in config [:aspects aspect :main] 'semtag_web.simulated.start)))
+
 (defn build-app
   "Builds an aspect, :test if no argument is given. It also prepares it to be standalone html,
-  adds debugging for the test aspect and updates services/base-uri if $API_URI is set."
+  adds debugging for the test aspect and updates services/base-uri if $API_URI is set.
+  If $TEST is set, the current aspect prepares a builds as if it were a test aspect and forces
+  using simulated services."
   [& args]
   (let [aspect (keyword (or (first args) "test"))
         {html-file :uri js-file :out-file} (-> dev/config vals first :aspects aspect)
-        transform-js-fn (if (= aspect :test) (comp ensure-relative-paths add-log-capturing) ensure-relative-paths)]
+        transform-js-fn (if (or (System/getenv "TEST") (= aspect :test))
+                          (comp ensure-relative-paths add-log-capturing) ensure-relative-paths)]
     (when-not html-file (throw (ex-info "This aspect does not exist!" {:aspect aspect})))

     (println (format "Building %s app..." aspect))
-    (time (build/build! (-> dev/config vals first) aspect))
+    (time (build/build! (-> dev/config vals first (modify-config aspect)) aspect))

     (println "Writing" (str "out/public" html-file))
     (modify-file (str "out/public" html-file) transform-js-fn)


Update docstring for cookie-store

Update docstring for cookie-store

--- ring-core/src/ring/middleware/session/cookie.clj
+++ ring-core/src/ring/middleware/session/cookie.clj
@@ -90,7 +90,11 @@
     (seal secret-key {})))

 (defn cookie-store
-  "Creates an encrypted cookie storage engine."
+  "Creates an encrypted cookie storage engine. Takes an optional map options
+   which takes the following key:
+   - key: The secret key to encrypt the session cookie. Must be exactly 16 bytes
+   If no key is provided then a random key will be generated. Note that in that
+   case a server restart will invalidate all existing session cookies."
   ([] (cookie-store {}))
   ([options]
     (CookieStore. (get-secret-key options))))


Card applicators

Card applicators

--- src/clj/funstructor/cards_functions.clj
+++ src/clj/funstructor/cards_functions.clj
@@ -1,6 +1,20 @@
 (ns funstructor.cards-functions
   (:require
-   [funstructor.utils :as u]))
+   [funstructor.utils :as u]
+   [funstructor.cards :as c]))
+
+(defn- apply-to-cards
+  "Get access to cards"
+  [game-map player-key]
+  (partial update-in game-map [player-key :cards]))
+
+(defn- apply-to-funstruct
+  "Get access to funstruct"
+  [game-map player-key]
+  (partial update-in game-map [player-key :funstruct]))
+
+(defn- gap []
+  {:terminal :gap})

 ;; Functions to operate on game state

@@ -20,24 +34,50 @@

 (defmethod apply-card
   :terminal
-  [game-map player card & args]
+  [game-map player-key card & args]
   (let [[pos & _] args]
-    (update-in game-map [player :funstruct]
-               (fn [funstruct]
-                 (assoc funstruct pos
-                        {:type
-                         (get-in c/cards-description [card :value])})))))
+    ((apply-to-funstruct game-map player-key)
+     (fn [funstruct]
+       (assoc funstruct pos
+              {:terminal
+               (get-in c/cards [card :value])})))))

+(defmethod apply-card
+  :terminal-param
+  [game-map player-key card & args]
+  (let [[pos param & _] args]
+    ((apply-to-funstruct game-map player-key)
+     (fn [funstruct]
+       (assoc funstruct pos
+              {:terminal
+               (get-in c/cards [card :value])
+               :value param})))))

+(defmethod apply-card
+  :mutator-right-gap
+  [game-map player-key card & args]
+  ((apply-to-funstruct game-map player-key)
+   (fn [funstruct]
+     (conj funstruct (gap)))))

-(declare apply-card)
+(defmethod apply-card
+  :mutator-left-gap
+  [game-map player-key card & args]
+  ((apply-to-funstruct game-map player-key)
+   (fn [funstruct]
+     (vec (concat [(gap)] funstruct)))))
+
+(defmethod apply-card
+  :mutator-position-gap
+  [game-map player-key card & args]
+  (let [[pos & _] args]
+    ((apply-to-funstruct game-map player-key)
+     (fn [funstruct]
+       (vec (concat (take pos funstruct)
+                    [{:type :gap}]
+                    (drop pos funstruct)))))))

 ;; Cards Accessor
-
-(defn- apply-to-cards
-  "Get access to clojure"
-  [game-map player-key]
-  (partial update-in game-map [player-key :cards]))

 (defn- take-card
   "Add card to player state"


Create dedicated functions for generation and web service.

--- src/clj/mx/roads/forgotten/blog/cli.clj
+++ src/clj/mx/roads/forgotten/blog/cli.clj
@@ -7,7 +7,7 @@
             [dragon.web :as web]
             [mx.roads.forgotten.blog.cli.new :as new]
             [mx.roads.forgotten.blog.cli.show :as show]
-            [mx.roads.forgotten.blog.routes :refer [routes]]
+            [mx.roads.forgotten.blog.routes :refer [gen-routes routes]]
             [taoensso.timbre :as log]
             [trifl.core :refer [sys-prop]]
             [trifl.docs :as docs]))
@@ -21,6 +21,16 @@
   (let [version (System/getProperty "blog.version")
         build (util/get-build)]
     (print (format "FRMX Blog version %s, build %s\n" version build))))
+
+(defn generate
+  []
+  (gen/run (gen-routes (config/posts-path)) (config/output-dir)))
+
+(defn web
+  []
+  (web/run (routes (config/posts-path))
+                  (config/port)
+                  (config/output-dir)))

 (defn run
   "
@@ -54,8 +64,8 @@
   (case cmd
     :new (new/run args)
     :show (show/run args)
-    :gen (gen/run (routes (config/posts-path)) (config/output-dir))
-    :run (web/run (routes (config/posts-path)) (config/port) "blog")
+    :gen (generate)
+    :run (web)
     :help (help-cmd args)
     :version (version-cmd)
     ;; Aliases


more succinct

more succinct

--- src/cljs/infinitelives/pixi/canvas.cljs
+++ src/cljs/infinitelives/pixi/canvas.cljs
@@ -237,15 +237,7 @@
     (.render renderer stage)

     (let [
-          render-fn (fn []
-
-                      (.render renderer stage)
-                      ;; (doall (for [l layers]
-                      ;;          (do
-                      ;;            (.log js/console "rendering:" l)
-                      ;;            (.render renderer (l layer)))))
-
-                      )
+          render-fn #(.render renderer stage)
           resize-fn (fn [width height]
                       (.resize renderer width height)
                       (doall (map (fn [[name layer-obj]]


lone set-x set-y's

lone set-x set-y's

--- src/cljs/infinitelives/pixi/sprite.cljs
+++ src/cljs/infinitelives/pixi/sprite.cljs
@@ -51,6 +51,12 @@
      (set-pos! sprite (pos 0) (pos 1))
      (set-pos! sprite (aget pos 0) (aget pos 1)))))

+(defn set-x! [sprite x]
+  (set! (.-x sprite) x))
+
+(defn set-y! [sprite y]
+  (set! (.-y sprite) y))
+
 (defn set-anchor! [sprite x y]
   (set! (.-anchor sprite) (make-point x y)))


Changes from @annapawlicka's suggestions.

Better success and error handlers.

--- src-cljs/kixi/hecuba/tabs/hierarchy/devices.cljs
+++ src-cljs/kixi/hecuba/tabs/hierarchy/devices.cljs
@@ -176,11 +176,12 @@

 (defn delete-device [entity_id device_id event-chan refresh-chan]
   (delete-resource (str "/4/entities/" entity_id "/devices/" device_id)
-                   #(log "Deleted " entity_id ":" device_id))
-  (js/alert (str "Deleted! " device_id))
-  (put! refresh-chan {:event :property})
-  (put! event-chan {:event :editing :value false})
-  (put! event-chan {:event :selected :value nil}))
+                   (fn []
+                     (js/alert (str "Device " device_id " deleted!"))
+                     (put! refresh-chan {:event :property})
+                     (put! event-chan {:event :editing :value false})
+                     (put! event-chan {:event :selected :value nil}))
+                   #(js/alert (str "Unable to delete " device_id))))

 (defn sensor-edit-div [cursor owner]
   (let [sensor-type (:type cursor)]


Fix/update broken test

Fix/update broken test

--- qanal/test/qanal/utils_test.clj
+++ qanal/test/qanal/utils_test.clj
@@ -10,16 +10,12 @@

 (facts "About execute-if-elapsed"
        (with-state-changes [(before :facts (reset! called? nil))]
-                           (fact "execute if :last-time-executed isn't present"
-                                 (execute-if-elapsed {} 5000 callme) @called? => truthy)
-                           (fact "return :last-time-executed when not present"
-                                 (execute-if-elapsed {} 5000 callme) => (contains {:last-time-executed number?}))
                            (fact "execute if elapsed is greater than window"
-                                 (execute-if-elapsed {:last-time-executed (- (System/currentTimeMillis) 7000)} 5000 callme)
+                                 (execute-if-elapsed callme (- (System/currentTimeMillis) 7000) 5000)
                                  @called?
                                  => truthy)
                            (fact "don't execute if elapsed is less than window"
-                                 (execute-if-elapsed {:last-time-executed (- (System/currentTimeMillis) 3000)} 5000 callme)
+                                 (execute-if-elapsed callme (- (System/currentTimeMillis) 3000) 5000)
                                  @called?
                                  => falsey)))


(The bug why my buttons did not work is now fixed.)

--- src/conexp/contrib/gui/editors/util.clj
+++ src/conexp/contrib/gui/editors/util.clj
@@ -225,7 +225,7 @@
     (doseq [l listeners] (.removeActionListener button l))
     (let [action (proxy [ActionListener] []
                    (actionPerformed [event]
-                     (with-swing-threads* handler)))]
+                     (with-swing-threads* (handler))))]
       (.addActionListener button action))))


Fix ellipses not appearing on long event history items

--- src/day8/re_frame_10x/view/history.cljs
+++ src/day8/re_frame_10x/view/history.cljs
@@ -17,8 +17,11 @@
       :margin           "2px"
       :padding          "5px"
       :font-weight      "600"
+      :cursor           "pointer"
       :text-overflow    "ellipsis"
-      :cursor           "pointer"}
+      :white-space      "nowrap"
+      :overflow         "hidden"
+      :flex-shrink      0}
      [:&:hover
       {:color common/history-item-hover-color}]]
     [:.history-item.active


Revert "Add a repl target to the build. Expand templates more efficiently inside (defview) and (block)."

This reverts commit fe8d496786e57621ea3392a96f08651388e24030.

--- src/main/clojure/com/howardlewisship/cascade.clj
+++ src/main/clojure/com/howardlewisship/cascade.clj
@@ -18,7 +18,7 @@
     (com.howardlewisship.cascade.internal utils viewbuilder parse-functions)))

 (defmacro inline
-  "Defines a block of template that renders inline. Evaluates to a seq of DOM nodes."
+  "Defines a block of template that renders inline."
   [& template]
   (parse-embedded-template template))

@@ -27,17 +27,15 @@
   preceding the parameters vectors. The functions forms are an implicit inline block."
   [& forms]
   (let [[fn-name fn-params template] (parse-function-def forms)
-        full-meta (merge ^fn-name {:cascade-type :view})
-        expanded-template (parse-embedded-template template)]
-    `(defn ~fn-name ~full-meta ~fn-params ~expanded-template)))
+        full-meta (merge ^fn-name {:cascade-type :view})]
+  `(defn ~fn-name ~full-meta ~fn-params (inline ~@template))))

 (defmacro block
   "Defines a block of template that renders with11 an environment controlled by its container. The result is a function
 that takes a single parameter (the env map)."
   [fn-params & template]
   (fail-unless (and (vector? fn-params) (= 1 (count fn-params))) "Blocks require that exactly one parameter be defined.")
-  (let [expanded (parse-embedded-template template)]
-    `(fn ~fn-params ~expanded)))
+    `(fn ~fn-params (inline ~@template)))

 (def #^{:doc "A DOM text node for a line break."}
   linebreak


add benchmark for multi-transform

add benchmark for multi-transform

--- scripts/benchmarks.clj
+++ scripts/benchmarks.clj
@@ -285,3 +285,16 @@
     (reduce conj #{} (traverse ALL data))
     ))

+(defn mult-10 [v] (* 10 v))
+
+(let [data [1 2 3 4 5 6 7 8 9]]
+  (run-benchmark "multi-transform vs. consecutive transforms, one shared nav" 300000
+    (->> data (transform [ALL even?] mult-10) (transform [ALL odd?] dec))
+    (multi-transform [ALL (multi-path [even? (terminal mult-10)] [odd? (terminal dec)])] data)
+    ))
+
+(let [data [[1 2 3 4 :a] [5] [6 7 :b 8 9] [10 11 12 13]]]
+  (run-benchmark "multi-transform vs. consecutive transforms, three shared navs" 150000
+    (->> data (transform [ALL ALL number? even?] mult-10) (transform [ALL ALL number? odd?] dec))
+    (multi-transform [ALL ALL number? (multi-path [even? (terminal mult-10)] [odd? (terminal dec)])] data)
+    ))


feat(cmd): multi-file, --no-state /w timeline

- -f option dropped in favour of optionless file list
- --no-state doest mean no timeline anymore. It is possible to have a
  timeline in this situation, which is necessary for extract generation

--- src/main/clojure/pdok/featured/core.clj
+++ src/main/clojure/pdok/featured/core.clj
@@ -12,23 +12,26 @@

 (declare cli-options)

-(defn execute [{:keys [json-file
+(defn execute [{:keys [json-files
                        dataset-name
                        no-projectors
                        no-timeline
                        no-state
                        projection]}]
-  (log/info (str "start" (when dataset-name (str " - dataset: " dataset-name)) " - file: " json-file
+  (log/info (str "start" (when dataset-name (str " - dataset: " dataset-name))
                  (when no-projectors " without projectors")
+                 (when no-state " without state")
                  (when projection (str " as " projection))))
   (let [persistence (if no-state (pers/make-no-state) (config/persistence))
         projectors (cond-> [] (not no-projectors) (conj (config/projectors persistence projection))
-                           (not (or no-timeline no-state)) (conj (config/timeline persistence)))
+                           (not no-timeline) (conj (config/timeline persistence)))
         processor (processor/create persistence projectors)]
-    (with-open [s (if json-file (file-stream json-file) (clojure.java.io/reader *in*))]
-      (dorun (consume processor (features-from-stream s :dataset dataset-name)))
-      (do (log/info "Shutting down.")
-          (shutdown processor))))
+    (doseq [json-file json-files]
+      (log/info "Processing " json-file)
+      (with-open [s (clojure.java.io/reader json-file)]
+        (dorun (consume processor (features-from-stream s :dataset dataset-name)))))
+    (do (log/info "Shutting down.")
+        (shutdown processor)))
   (log/info "done")
   )

@@ -41,16 +44,19 @@
   (let [{:keys [options arguments summary options]} (parse-opts args cli-options)]
     (cond
       (:help options) (exit 0 summary)
-      (not (or (:json-file options) (:std-in options))) (exit 0 "json-file or std-in required")
-      :else (execute options))))
+      (not (or (seq arguments) (:std-in options))) (exit 0 "json-file or std-in required")
+      :else
+      (let [files (if (:std-in options)
+                    [*in*]
+                    arguments)]
+        (execute (assoc options :json-files files))))))

 (def cli-options
-  [["-f" "--json-file FILE" "required JSON-file with features"]
-   [nil "--std-in" "Read from std-in"]
+  [[nil "--std-in" "Read from std-in"]
    ["-d" "--dataset-name DATASET" "dataset"]
    [nil "--no-projectors"]
    [nil "--no-timeline"]
-   [nil "--no-state" "Also sets --no-timeline. Use only with no nesting and action :new only"]
+   [nil "--no-state" "Use only with no nesting and action :new"]
    [nil "--projection PROJ" "RD / ETRS89 / SOURCE"]
    ["-h" "--help"]])


Fix date-bucketing ranges to account for inclusive BETWEEN [ci drivers]

--- src/metabase/query_processor/expand.clj
+++ src/metabase/query_processor/expand.clj
@@ -301,20 +301,19 @@
     (filter {} (time-interval (field-id 100) :current :day)) "
   [f n unit]
   (if-not (integer? n)
-    (let [n (normalize-token n)]
-      (case n
-        :current (recur f  0 unit)
-        :last    (recur f -1 unit)
-        :next    (recur f  1 unit)))
+    (case (normalize-token n)
+      :current (recur f  0 unit)
+      :last    (recur f -1 unit)
+      :next    (recur f  1 unit))
     (let [f (datetime-field f unit)]
       (cond
         (core/= n  0) (= f (value f (relative-datetime :current)))
         (core/= n -1) (= f (value f (relative-datetime -1 unit)))
         (core/= n  1) (= f (value f (relative-datetime  1 unit)))
-        (core/< n -1) (between f (value f (relative-datetime (dec n) unit))
-                                 (value f (relative-datetime      -1 unit)))
-        (core/> n  1) (between f (value f (relative-datetime       1 unit))
-                               (value f (relative-datetime (inc n) unit)))))))
+        (core/< n -1) (between f (value f (relative-datetime  n unit))
+                                 (value f (relative-datetime -1 unit)))
+        (core/> n  1) (between f (value f (relative-datetime  1 unit))
+                                 (value f (relative-datetime  n unit)))))))

 (s/defn ^:ql ^:always-validate filter
   "Filter the results returned by the query.


convert to js to that it works

convert to js to that it works

--- frontend/intercom.cljs
+++ frontend/intercom.cljs
@@ -19,4 +19,4 @@
            (second path)))))

 (defn track [event & [metadata]]
-  (utils/swallow-errors (js/Intercom "trackEvent" (name event) metadata)))
+  (utils/swallow-errors (js/Intercom "trackEvent" (name event) (clj->js metadata))))


(SERVER-2213) Update thread defaults test

--- test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_default_config_test.clj
+++ test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_default_config_test.clj
@@ -88,18 +88,25 @@
           "Unexpected default for proxy 'idle-timeout'")
       (.stop client))))

-(def selector-thread-count
-  "The number of selector threads that should be allocated per connector.  See:
-   https://github.com/eclipse/jetty.project/blob/jetty-9.4.1.v20170120/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java#L223
-   and
-   https://github.com/eclipse/jetty.project/blob/jetty-9.4.1.v20170120/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java#L403-L408
-   The number of selectors is twice the number of selector threads."
-  (* 2 (max 1 (min 4 (int (/ (ks/num-cpus) 2))))))
+(defn selector-thread-count
+  [max-threads]
+  "The number of selectors and selecto threads that should be allocated per
+  connector.
+   https://github.com/eclipse/jetty.project/blob/jetty-9.4.11.v20180605/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java#L70-L74"
+  (max 1
+       (min (int (/ max-threads 16))
+            (int (/ (ks/num-cpus) 2)))))

 (def acceptor-thread-count
   "The number of acceptor threads that should be allocated per connector.  See:
-   https://github.com/eclipse/jetty.project/blob/jetty-9.4.1.v20170120/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java#L194"
+   https://github.com/eclipse/jetty.project/blob/jetty-9.4.11.v20180605/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java#L202"
   (max 1 (min 4 (int (/ (ks/num-cpus) 8)))))
+
+(defn reserved-thread-count
+  [max-threads]
+  (max 1
+       (min (ks/num-cpus)
+            (int (/ max-threads 10)))))

 (deftest default-connector-settings-test
   (let [connector (ServerConnector. (Server.))]
@@ -111,8 +118,8 @@
         "Unexpected default for 'idle-timeout-milliseconds'")
     (is (= acceptor-thread-count (.getAcceptors connector))
         "Unexpected default for 'acceptor-threads' and 'ssl-acceptor-threads'")
-    (is (= selector-thread-count
-           (* 2 (.getSelectorCount (.getSelectorManager connector))))
+    (is (= (selector-thread-count (-> connector .getExecutor .getMaxThreads))
+           (.getSelectorCount (.getSelectorManager connector)))
         "Unexpected default for 'selector-threads' and 'ssl-selector-threads'")))

 (defn get-max-threads-for-server
@@ -143,15 +150,22 @@
                                  (get-server-thread-pool-queue server)))
         "Unexpected default for 'queue-max-size'")))

-(def threads-per-connector
+(defn required-threads-for-sized-threadpool
+  [threadpool-size]
   "The total number of threads needed per attached connector."
-  (+ acceptor-thread-count selector-thread-count))
+  (+ (reserved-thread-count threadpool-size)
+     (selector-thread-count threadpool-size)
+     acceptor-thread-count))

 (defn calculate-minimum-required-threads
-  "Calculate the minimum number threads that a single Jetty Server instance
-  needs.  See: https://github.com/eclipse/jetty.project/blob/jetty-9.4.1.v20170120/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java#L384-L414"
-  [connectors]
-  (+ 1 (* connectors threads-per-connector)))
+  "Jetty calculates the minimum number of required threads based on the the
+  size of the machine it runs on and the number of threads in its thread pool.
+  The smaller we shrink the thread pool the fewer threads it will request.
+  This logic doesn't scale as the thread pool grows beyond 10 threads but
+  allows us to come up with a number that works for the max threads that isn't
+  self referential."
+  [num-connectors]
+  (+ 2 (* num-connectors 2)))

 (deftest default-min-threads-settings-test
   ;; This test just exists to validate the advice we give for the bare
@@ -163,37 +177,28 @@
   ;; at most one encrypted port connector.  Because of this, the test only
   ;; validates the min-threads behavior for a server that has either one or
   ;; two connectors.
-  (letfn [(get-server [max-threads connectors]
+  (letfn [(get-server [max-threads connector-count]
             (let [server (Server. (QueuedThreadPool. max-threads))]
-              (dotimes [_ connectors]
+              (dotimes [_ connector-count]
                 (.addConnector server (ServerConnector. server)))
-              server))
-          (insufficient-threads-msg [server]
-            (let [connectors (count (.getConnectors server))]
-              (re-pattern (str "Insufficient threads: max="
-                               (get-max-threads-for-server server)
-                               " < needed\\(acceptors="
-                               (* acceptor-thread-count connectors)
-                               " \\+ selectors="
-                               (* selector-thread-count connectors)
-                               " \\+ request=1\\)"))))]
+              server))]
     (dotimes [x 2]
-      (let [connectors       (inc x)
-            required-threads (calculate-minimum-required-threads connectors)]
-        (testing (str "server with too few threads for " connectors " connector(s) "
+      (let [num-connectors  (inc x)
+            required-threads (calculate-minimum-required-threads num-connectors)]
+        (testing (str "server with too few threads for " num-connectors " connector(s) "
                       "fail(s) to start with expected error")
           (let [server (-> required-threads
                            dec
-                           (get-server connectors))]
+                           (get-server num-connectors))]
             (is (thrown-with-msg? IllegalStateException
-                                  (insufficient-threads-msg server)
-                                  (tk-log-testutils/with-test-logging
-                                   (.start server))))))
-        (testing (str "server with minimum required threads for " connectors
+                                  #"Insufficient configured threads"
+                                   (tk-log-testutils/with-test-logging
+                                     (.start server))))))
+        (testing (str "server with minimum required threads for " num-connectors
                       "connector(s) start(s) successfully")
-          (let [server (get-server required-threads connectors)]
+          (let [server (get-server required-threads num-connectors)]
             (try
-              (.start server)
+              (tk-log-testutils/with-test-logging (.start server))
               (is (.isStarted server))
               (finally
                 (.stop server)))))))))


Fix update-containers-image

Fix update-containers-image

--- src/puppeteer/domain/usecase/deploy.clj
+++ src/puppeteer/domain/usecase/deploy.clj
@@ -12,11 +12,11 @@
                          [image-name image])
                        (:images conf)
                        (:images build)))]
-    (println job)
-    (println images)
     (map
       #(assoc % :image
-              (->> % :name keyword (get images)))
+              (or
+                (->> % :name keyword (get images))
+                (:image %)))
       containers)))

 (defn- prepare-deployment


(PDB-1960) Don't block startup on the post migration vacuum

This commit moves the post migration vacuum analyze to a future so that
we don't block startup on the analyze which can take a while on large
databases.

--- src/puppetlabs/puppetdb/scf/migrate.clj
+++ src/puppetlabs/puppetdb/scf/migrate.clj
@@ -1594,9 +1594,10 @@
     (into (sorted-map)
           (select-keys migrations pending))))

-(defn- sql-or-die [f]
+(defn- sql-or-die
   "Calls (f) and returns its result.  If f throws an SQLException,
   logs the exception and its parent and then calls (System/exit 1)"
+  [f]
   ;; Here we've preserved existing behavior, but this may warrant
   ;; further consideration later.  If possible, we might want to
   ;; avoid System/exit in favor of careful exception
@@ -1605,9 +1606,8 @@
     (f)
     (catch java.sql.SQLException e
       (log/error e "Caught SQLException during migration")
-      (let [next (.getNextException e)]
-        (when-not (nil? next)
-          (log/error next "Unravelled exception")))
+      (when-let [next (.getNextException e)]
+        (log/error next "Unravelled exception"))
       (binding [*out* *err*] (flush)) (flush)
       (System/exit 1))))

@@ -1634,13 +1634,21 @@
         ;; Make sure we're creating a new connection (the new
         ;; clojure.jdbc API will re-use an existing one).
         (assert (not (:connection db-connection-pool)))
-        (jdbc/with-db-connection db-connection-pool
-          (log/info "Analyzing database")
-          (sql-or-die (fn []
-                        (-> (doto (:connection (jdbc/db)) (.setAutoCommit true))
-                            .createStatement
-                            (.execute "vacuum (analyze, verbose)")))))))
-    (log/info "There are no pending migrations")))
+        ;; We don't want to stay in maintenance mode while we vaccum analyze,
+        ;; i.e. refuse http requests as this can take quite some time on large
+        ;; databases
+        (future
+          (jdbc/with-db-connection db-connection-pool
+            (log/info "Analyzing database")
+            (try
+              (-> (doto (:connection (jdbc/db)) (.setAutoCommit true))
+                  .createStatement
+                  (.execute "vacuum (analyze, verbose)"))
+              (catch java.sql.SQLException e
+                (log/error e "Caught SQLException during migration")
+                (when-let [next (.getNextException e)]
+                  (log/error next "Unravelled exception")))))))
+      (log/info "There are no pending migrations"))))

 ;; SPECIAL INDEX HANDLING


(MAINT) Add  exception to additional log messages

--- src/puppetlabs/ring_middleware/core.clj
+++ src/puppetlabs/ring_middleware/core.clj
@@ -117,7 +117,7 @@
     type :- utils/ResponseType]
    (let [code 400
          response (fn [e]
-                    (log/error (trs "Submitted data is invalid: {0}" (:msg e)))
+                    (log/error e (trs "Submitted data is invalid: {0}" (:msg e)))
                     (case type
                       :json (utils/json-response code e)
                       :plain (utils/plain-response code (:msg e))))]
@@ -142,7 +142,7 @@
     type :- utils/ResponseType]
    (let [code 503
          response (fn [e]
-                    (log/error (trs "Service Unavailable:" (:msg e)))
+                    (log/error e (trs "Service Unavailable:" (:msg e)))
                     (case type
                       :json (utils/json-response code e)
                       :plain (utils/plain-response code (:msg e))))]
@@ -161,7 +161,7 @@
     type :- utils/ResponseType]
    (let [code 400
          response (fn [e]
-                    (log/error (trs "Bad Request:" (:msg e)))
+                    (log/error e (trs "Bad Request:" (:msg e)))
                     (case type
                       :json (utils/json-response code e)
                       :plain (utils/plain-response code (:msg e))))]
@@ -181,7 +181,7 @@
          response (fn [e]
                     (let [msg (trs "Something unexpected happened: {0}"
                                    (select-keys e [:error :value :type]))]
-                      (log/error msg)
+                      (log/error e msg)
                       (case type
                         :json (utils/json-response code
                                                    {:kind :application-error


Inline and remove set-beta-program-preference!

--- src-cljs/frontend/components/account.cljs
+++ src-cljs/frontend/components/account.cljs
@@ -194,9 +194,6 @@
          (for [{:keys [name description]} available-betas]
           (card/titled {:title name} description)))]))))

-(defn set-beta-program-preference! [owner pref]
-  (raise! owner [:preferences-updated {state/user-in-beta-key pref}]))
-
 (defrender beta-terms-modal [{:keys [close-fn]} owner]
   (component
    (modal/modal-dialog {:title "Join Beta Program"
@@ -218,7 +215,7 @@
                                   (button/button
                                    {:primary? true
                                     :on-click #(do
-                                                 (set-beta-program-preference! owner true)
+                                                 (raise! owner [:preferences-updated {state/user-in-beta-key true}])
                                                  ((om/get-shared owner :track-event) {:event-type :beta-accept-terms-clicked})
                                                  (close-fn))}
                                    "Accept")]})))
@@ -261,7 +258,7 @@
                        [:p "We'd love to know what you think - " [:a {:href "mailto:beta@circleci.com"} "send us your feedback"] "!"]
                        (button/button
                         {:on-click #(do
-                                      (set-beta-program-preference! owner false)
+                                      (raise! owner [:preferences-updated {state/user-in-beta-key false}])
                                       ((om/get-shared owner :track-event) {:event-type :beta-leave-clicked}))
                          :primary? true}
                         "Leave Beta Program")]))


reverted some copy which was accidentally added on the pricing page

--- src-cljs/frontend/components/pricing.cljs
+++ src-cljs/frontend/components/pricing.cljs
@@ -143,7 +143,7 @@
                 [:div.row
                  [:div.col-sm-12
                   [:h3 "How do containers work?"]
-                  [:p "Every time you push to GitHub, we checkout your code and run your build inside ofner-count/ a container.
+                  [:p "Every time you push to GitHub, we checkout your code and run your build inside of a container.
                       If you don't have enough free containers available, then your builds queue up until other builds finish."]
                   [:p "Everyone gets their first container free and your team can run as many builds as you want with that container.
                       More containers allows faster builds through parallellism in addition shorter queue times"]


Remove commented-out debug printfs

Remove commented-out debug printfs

--- boot/worker/src/boot/watcher.clj
+++ boot/worker/src/boot/watcher.clj
@@ -88,9 +88,7 @@
                      (printf "→ DEBUG: invalid watch key %s\n" (.watchable watch-key)))
                    (Thread/sleep 500)
                    (recur))
-               (do #_(prn :-- watch-key)
-                   #_(prn :-- (.watchable watch-key))
-                   (doseq [event (.pollEvents watch-key)]
+               (do (doseq [event (.pollEvents watch-key)]
                      (let [dir     (.toFile (.watchable watch-key))
                            changed (io/file dir (str (.context event)))
                            etype   (enum->kw service (.kind event))


Do GC before requests are received

Do GC before requests are received

--- src/clojure/de/otto/tesla/serving_with_jetty.clj
+++ src/clojure/de/otto/tesla/serving_with_jetty.clj
@@ -36,7 +36,9 @@
     (let [handler-404 (comp/ANY "*" _request (resp/status (resp/response "") 404))
           all-routes  (comp/routes (handler/handler handler) handler-404)
           options     (jetty-options (:config self))
+          _           (System/gc)
           server      (jetty/run-jetty all-routes (merge {:port (port config) :join? false :configurator instrument-jetty} options))]
+      (log/info "-> server started")
       (assoc self :jetty server)))
   (stop [{jetty :jetty :as self}]
     (log/info "<- stopping server")


Add bombs

Add bombs

--- src/clojure/playasophy/wonderdome/mode/bombs.clj
+++ src/clojure/playasophy/wonderdome/mode/bombs.clj
@@ -16,16 +16,35 @@
     (Math/sqrt (+ (Math/pow vertical-distance 2) (Math/pow circle-distance 2)))))

+(defn- overlay
+  ([layers]
+   (reduce (fn [c1 c2] (if (= c2 color/none) c1 c2)) layers)))
+
+(defn- bomb-color
+  [barrel-radius pixel bomb]
+  (do
+    #_(log/warn pixel bomb)
+    (let [delta (distance barrel-radius (:center bomb) (:barrel pixel))
+          radius (* (:age bomb) 0.00003)]
+      (if (<= delta radius)
+        (color/rainbow (/ delta radius))
+        color/none))))
+
 (defrecord BombsMode
-  [barrel-radius barrel-height cursor-position]
+  [barrel-radius barrel-height cursor-position bombs]

   mode/Mode

   (update
     [this event]
     (condp = [(:type event) (:input event)]
-      [:button/press :L]
-      this
+      [:time/tick nil]
+      (let [elapsed (or (:elapsed event) 0.0)]
+        (assoc this :bombs
+          (map (fn [bomb]
+                 (let [age' (+ (:age bomb) elapsed)]
+                   (assoc bomb :age age')))
+               (filter #(< (:age %) 10000) bombs))))

       [:axis/direction :y-axis]
       (assoc-in this [:cursor-position :z]
@@ -35,8 +54,7 @@
                              :max-val barrel-height))

       [:axis/direction :x-axis]
-      (assoc-in
-        this [:cursor-position :theta]
+      (assoc-in this [:cursor-position :theta]
         (let [theta' (control/adjust-wrapped
                        (:theta cursor-position) event
                        :rate sphere/pi
@@ -44,13 +62,21 @@
                        :max-val sphere/tau)]
           (if (>= theta' sphere/tau) 0.0 theta')))

+      [:button/press :A]
+      (assoc-in this [:bombs]
+        (conj bombs {:center cursor-position :age 0}))
+
       this))

   (render
     [this pixel]
-    (let [delta (distance barrel-radius (:barrel pixel) cursor-position)]
-      (if (< delta 0.04) (color/gray 1.0) color/none))))
+    (do
+      #_(log/warn pixel bombs)
+      (let [bomb-colors (map (partial bomb-color barrel-radius pixel) bombs)
+            cursor-delta (distance barrel-radius (:barrel pixel) cursor-position)
+            cursor-color (if (< cursor-delta 0.04) (color/gray 1.0) color/none)]
+        (overlay (conj bomb-colors cursor-color))))))

 (defn init
@@ -58,4 +84,4 @@
   ([]
    (init 0.099 (* 0.068 8) {:theta 0 :z 0.20}))
   ([barrel-radius barrel-height cursor-position]
-   (BombsMode. barrel-radius barrel-height cursor-position)))
+   (BombsMode. barrel-radius barrel-height cursor-position [])))


school/grade done.

school/grade done.

--- clojure/grade-school/school.clj
+++ clojure/grade-school/school.clj
@@ -3,3 +3,7 @@
 (defn add
   [db name grade]
   (merge-with concat db {grade [name]}))
+
+(defn grade
+  [db grade]
+  (get db grade []))


Add repo properties to build-project-clicked event

--- src-cljs/frontend/components/add_projects.cljs
+++ src-cljs/frontend/components/add_projects.cljs
@@ -109,9 +109,11 @@
             login (get-in settings [:add-projects :selected-org :login])
             type (get-in settings [:add-projects :selected-org :type])
             repo-id (repo-model/id repo)
+            repo-url (vcs-url/project-path (:vcs_url repo))
             tooltip-id (str "view-project-tooltip-" (string/replace repo-id #"[^\w]" ""))
             settings (:settings data)
             building-on-circle? (repo-model/building-on-circle? repo)
+            repo-name (vcs-url/repo-name (:vcs_url repo))
             title-el (repo-title repo building-on-circle?)]
         (html
          (cond (repo-model/can-follow? repo)
@@ -127,7 +129,10 @@
                                         (when (not building-on-circle?)
                                           (om/set-state! owner :building? true)
                                           ((om/get-shared owner :track-event)
-                                            {:event-type :build-project-clicked})))
+                                            {:event-type :build-project-clicked
+                                             :properties {:project-vcs-url repo-url
+                                                          :repo repo-name
+                                                          :org login}})))
                            :title (if building-on-circle?
                                     "This project is currently building on CircleCI. Clicking will cause builds for this project to show up for you in the UI."
                                     "This project is not building on CircleCI. Clicking will cause CircleCI to start building the project.")


Test-endpoint for new coffee button

Test-endpoint for new coffee button

--- src/clj/mokkameister/resources/button.clj
+++ src/clj/mokkameister/resources/button.clj
@@ -1,13 +1,14 @@
 (ns mokkameister.resources.button
   (:require [liberator.core :refer [defresource]]
             [mokkameister.brew :refer [start-brewing!]]
+            [mokkameister.slack :refer [notify]]
             [mokkameister.system :refer [system]]))

 (defn- valid-button-token? [ctx]
   (let [token (get-in ctx [:request :params :secret])]
     (= token (system :button-token))))

-(defn- handle-button-post [ctx]
+(defn- handle-old-button-post [ctx]
   (let [brew {:channel "#penthouse"
               :slack-user "nokon"
               :brew-time 5
@@ -15,8 +16,15 @@
     (start-brewing! brew))
   "OK")

+(defn- handle-button-get [ctx]
+  ;; New button uses GET, seems like SendToHTTP
+  ;; command is very basic :(
+  (notify "Kaffi!" :channel "#testroompleaseignore")
+  "OK")
+
 (defresource coffee-button
   :available-media-types ["text/plain"]
   :allowed-methods [:post]
   :authorized? valid-button-token?
-  :post! handle-button-post)
+  :post! handle-old-button-post
+  :handle-ok handle-button-get)


Fixing comments.

Fixing comments.

--- src/clj/think/image/data_augmentation.clj
+++ src/clj/think/image/data_augmentation.clj
@@ -369,6 +369,10 @@

 (defn affine-scale
+  "Interpolation is one of:
+  :bicubic
+  :bilinear
+  :nearest-neighbor."
   ^BufferedImage [^BufferedImage src scale-x scale-y & {:keys [interpolation]}]
   (let [tx (AffineTransform.)
         src-width (think-image/width src)


Fix send-new-action.

Fix send-new-action.

--- src/cljs/hatnik/web/client/z_actions.cljs
+++ src/cljs/hatnik/web/client/z_actions.cljs
@@ -73,6 +73,16 @@
    :body (:gh-issue-body data-pack)
    :library (:artifact-value data-pack)})

+(defn build-gh-pull-request [data-pack]
+  {:project-id (:project-id data-pack)
+   :library (:artifact-value data-pack)
+   :type "github-pull-request"
+   :repo (:gh-repo data-pack)
+   :title (:gh-pull-title data-pack)
+   :body (:gh-pull-body data-pack)
+   :commit-message (:gh-comm-msg data-pack)
+   :operations (:gh-operations data-pack)})
+
 (defn build-noop-action [data-pack]
   {:type "noop"
    :project-id (:project-id data-pack)
@@ -88,13 +98,20 @@
    :github-issue {:build build-gh-issue-action
                   :schema schm/GithubIssueAction
                   :text-progress "Creating test issue on Github..."
-                  :text-done "The issue is created. Check out your project."}})
+                  :text-done "The issue is created. Check out your project."}
+   :github-pull-request {:build build-gh-pull-request
+                         :schema schm/GithubPullRequestAction
+                         :text-progress "Creating pull request on Github..."
+                         :text-done "The pull request is created. Check out your project."
+                         }})

 (defn send-new-action [data-pack]
   (let [{:keys [build schema]} (actions-config (:type data-pack))
         data (build data-pack)]
     (if (s/check schema data)
-      (msg/danger default-error-message)
+      (do
+        (.log js/console (s/check schema data))
+        (msg/danger default-error-message))
       (do
         (.modal ($ :#iModalAddAction) "hide")
         (ajax "/api/actions" "POST" data


remove steps from pipeline that were just removed

--- src/devops_101_pipeline/meta/pipeline.clj
+++ src/devops_101_pipeline/meta/pipeline.clj
@@ -10,7 +10,4 @@
        wait-for-repo)
      (with-repo
        build
-       deploy)
-     lambdacd.steps.manualtrigger/wait-for-manual-trigger
-     stop-to-restart
-  ))
+       deploy)))


DM + CW | #139 | fix comment history link

--- src/objective8/front_end/templates/objective.clj
+++ src/objective8/front_end/templates/objective.clj
@@ -245,14 +245,13 @@

               [:.clj-comment-list] (html/content (pf/comment-list context))

-
-              [:.clj-comment-history-link] (html/set-attr :href comment-history-link)
-
               [:.clj-comment-create] (html/content (pf/comment-create context :objective))}

              [:.clj-comment-list] (if next-comments
                                     (html/append comment-history-snippet)
-                                    identity))))
+                                    identity)
+
+             [:.clj-comment-history-link] (html/set-attr :href comment-history-link))))

 (defn objective-page [context]
   (->> (produce-objective-page context)


Remove refreshToken

Remove refreshToken

--- src/puppeteer/infra/client/container_builder.clj
+++ src/puppeteer/infra/client/container_builder.clj
@@ -24,7 +24,7 @@
     (println ";; Starting ContainerBuilderClientComponent")
     (-> this
         (assoc :project-id (ServiceOptions/getDefaultProjectId))
-        (assoc :access-token (-> (doto (GoogleCredential/getApplicationDefault) .refreshToken)
+        (assoc :access-token (-> (GoogleCredential/getApplicationDefault)
                                  .getAccessToken))
         (assoc :client (-> (CloudBuild$Builder. (GoogleNetHttpTransport/newTrustedTransport)
                                                 (JacksonFactory.)


"la too": add "case:acc" for noun sense of the word (e.g. 'la bottegla è la tua')

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -1306,6 +1306,7 @@
               :sem {:number :sing
                     :person :2nd}}}
     {:synsem {:cat :noun
+              :case :acc
               :pronoun true
               :def :possessive
               :agr {:gender :fem


don't use if

don't use if

--- src/bracketolojy/tournament.clj
+++ src/bracketolojy/tournament.clj
@@ -69,23 +69,23 @@
 (defn- update-round [rnd node]
   (assoc-in node [:data :round] rnd))

-(defn- compute-round [loc]
-  (dbg loc)
+(defn- compute-round [max-rnd loc]
   (if (zip/end? loc)
     loc
-    (if-let [parent-round (some-> (zip/up loc)
-                                  zip/node
-                                  (get-in [:data :round]))]
-      (recur (zip/next (zip/edit loc (partial update-round (dec parent-round)))))
-      (recur (zip/next loc)))))
+    (let [rnd (or (some-> (zip/up loc)
+                          zip/node
+                          (get-in [:data :round])
+                          dec)
+                  max-rnd)]
+      (recur max-rnd (zip/next (zip/edit loc (partial update-round rnd)))))))

 (defn round-info [max-rounds tree]
-  (->> (update-round max-rounds tree)
-       (zip/zipper
+  (->> (zip/zipper
          branch?
          children
-         make-node)
-       compute-round
+         make-node
+         tree)
+       (compute-round max-rounds)
        zip/root))

 (defn weighted-pairing-log5


Make left-header links square

Make left-header links square

--- src/braid/ui/styles/header.cljs
+++ src/braid/ui/styles/header.cljs
@@ -141,7 +141,8 @@
          :font-weight "bold"}]

        [:a
-        {:padding [[0 (m/* vars/pad 0.5)]]
+        {:width header-height
+         :text-align "center"
          :text-decoration "none"}

         [:&:hover


Make site-tree a function and optionally passed in via multimethod arguments.

--- src/clj/freestuffly/scraper.clj
+++ src/clj/freestuffly/scraper.clj
@@ -27,7 +27,8 @@
        freecycle-results-per-page
        "&showall=off&include_offers=off&include_wanteds=off&include_receiveds=off&include_takens=off"))

-(def ^:private site-tree
+(defn- site-tree
+  []
   (-> (client/get my-group-urls) :body h/parse h/as-hickory))

 (defn- parsed-html
@@ -55,8 +56,5 @@
                     (map vals results))))

 (defn scraped-content
-  []
-  (presentable
-    (interesting-finds
-      (content-for
-        (parsed-html site-tree)))))
+  ([] (scraped-content site-tree))
+  ([content-hash] (presentable (interesting-finds (content-for (parsed-html (content-hash)))))))


implement Bookmark

implement Bookmark

--- src/clj/game/cards-hardware.clj
+++ src/clj/game/cards-hardware.clj
@@ -25,6 +25,20 @@
    {:effect (effect (gain :memory 2)) :leave-play (effect (lose :memory 2))
     :events {:expose {:msg (msg "attempt to force the rez of " (:title target))
                       :effect (effect (rez :corp target))}}}
+
+   "Bookmark"
+   {:abilities [{:label "Host 3 cards from your Grip facedown"
+                 :cost [:click 1] :msg "host up to 3 cards from their Grip facedown"
+                 :choices {:max 3 :req #(and (:side % "Runner") (= (:zone %) [:hand]))}
+                 :effect (req (doseq [c targets]
+                                 (host state side (get-card state card) c {:facedown true})))}
+                {:label "Add all hosted cards to Grip" :cost [:click 1] :msg "add all hosted cards to their Grip"
+                 :effect (req (doseq [c (:hosted card)]
+                                (move state side c :hand)))}
+                {:label "[Trash]: Add all hosted cards to Grip" :msg "add all hosted cards to their Grip"
+                 :effect (req (doseq [c (:hosted card)]
+                                (move state side c :hand))
+                              (trash state side card {:cause :ability-cost}))}]}

    "Box-E"
    {:effect (effect (gain :memory 2 :max-hand-size 2))


Removed unnecessary spaces

Removed unnecessary spaces

--- src/clj_fileutils/fileutils.clj
+++ src/clj_fileutils/fileutils.clj
@@ -20,9 +20,9 @@
 (defn print-slurp-exception
     "Print warning message to the standard output."
     ([filename]
-        (println "Warning: cannot read content of the following file: " filename))
+        (println "Warning: cannot read content of the following file:" filename))
     ([directory filename]
-        (println "Warning: cannot read content of the following file: " directory "/" filename)))
+        (println "Warning: cannot read content of the following file:" directory "/" filename)))

 (defn slurp-
     "Alternative (slurp) implementation that does not throw an exception, but returns nil instead."


Fix starting area generation

Fix starting area generation

--- src/cljc/robinson/worldgen.cljc
+++ src/cljc/robinson/worldgen.cljc
@@ -329,9 +329,11 @@
         volcano-pos           (get-in state [:world :volcano-pos])
         lava-xys              (get-in state [:world :lava-points])
         starting-pos          (rp/player-starting-pos state)
-        encounter             (if (rc/farther-than? starting-pos (rp/player-pos state) 80)
+        player-pos            (get-in state [:world :player :pos] starting-pos)
+        encounter             (if (and starting-pos
+                                       (rc/farther-than? starting-pos player-pos 80))
                                 :normal
-                                (rand-nth [:normal :pirate-ship]))]
+                                (rand-nth [:normal #_:pirate-ship]))]
     {:seed seed
      :pos {:x x :y y}
      :spawned-monsters {}


Fix keyword mismatch

Fix keyword mismatch

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -89,7 +89,7 @@
        (case @page
          :sites "Display the sites."
          :comics "Display the comics available."
-         :reading "Display the comic itself!"
+         :read "Display the comic itself!"
          [four-oh-four])])))

 (defn ^:export run []


Split Either in two types: Right and Left.

--- src/cljx/cats/monad/either.cljx
+++ src/cljx/cats/monad/either.cljx
@@ -33,7 +33,7 @@
 ;; Type constructor and functions
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(deftype Either [v type]
+(deftype Right [v]
   proto/Context
   (get-context [_] either-monad)
   (get-value [_] v)
@@ -42,49 +42,73 @@
   Object
   #+clj
   (equals [self other]
-    (if (instance? Either other)
-      (and (= v (.-v other))
-         (= type (.-type other)))
+    (if (instance? Right other)
+      (= v (.-v other))
       false))

   #+clj
   (toString [self]
-    (with-out-str (print [v type])))
+    (with-out-str (print [v])))

   #+cljs
   cljs.core/IEquiv
   #+cljs
   (-equiv [self other]
-    (if (instance? Either other)
-      (and (= v (.-v other))
-           (= type (.-type other)))
+    (if (instance? Right other)
+      (= v (.-v other))
       false)))

-(defn either?
-  [v]
-  (instance? Either v))
+(deftype Left [v]
+  proto/Context
+  (get-context [_] either-monad)
+  (get-value [_] v)
+
+  #+clj
+  Object
+  #+clj
+  (equals [self other]
+    (if (instance? Left other)
+      (= v (.-v other))
+      false))
+
+  #+clj
+  (toString [self]
+    (with-out-str (print [v])))
+
+  #+cljs
+  cljs.core/IEquiv
+  #+cljs
+  (-equiv [self other]
+    (if (instance? Left other)
+      (= v (.-v other))
+      false)))

 (defn left
   "Left constructor for Either type."
+  ([]
+     (Left. nil))
   ([v]
-     (Either. v :left))
-  ([]
-     (Either. nil :left)))
+     (Left. v)))

 (defn right
   "Right constructor for Either type."
+  ([]
+     (Right. nil))
   ([v]
-     (Either. v :right))
-  ([]
-     (Either. nil :right)))
+     (Right. v)))

 (defn left?
   [mv]
-  (= (.-type mv) :left))
+  (instance? Left mv))

 (defn right?
   [mv]
-  (= (.-type mv) :right))
+  (instance? Right mv))
+
+(defn either?
+  [mv]
+  (or (left? mv)
+      (right? mv)))

 (defn from-either
   "Return inner value of either monad."


Ignore errors when deleting files

Ignore errors when deleting files

--- src/clojure/nightcode/utils.clj
+++ src/clojure/nightcode/utils.clj
@@ -200,7 +200,7 @@
   (let [f (io/file path)]
     (when (and (= 0 (count (.listFiles f)))
                (not (contains? project-set path)))
-      (io/delete-file f)
+      (io/delete-file f true)
       (->> f
            .getParentFile
            .getCanonicalPath


Support {:x/y-axis {:title "..."}} styling

--- src/com/hypirion/clj_xchart.clj
+++ src/com/hypirion/clj_xchart.clj
@@ -380,7 +380,9 @@
        (set-axes-style! styling))
      (doto-cond
       chart
-      title (.setTitle title)))))
+      title (.setTitle title)
+      (-> styling :x-axis :title) (.setXAxisTitle (-> styling :x-axis :title))
+      (-> styling :y-axis :title) (.setYAxisTitle (-> styling :y-axis :title))))))

 (defn category-chart*
   "Returns a raw category chart. Prefer `category-chart` unless you run into
@@ -409,7 +411,10 @@
        (set-axes-style! styling))
      (doto-cond
       chart
-      title (.setTitle title)))))
+      title (.setTitle title)
+      (-> styling :x-axis :title) (.setXAxisTitle (-> styling :x-axis :title))
+      (-> styling :y-axis :title) (.setYAxisTitle (-> styling :y-axis :title))))))
+
 ;; Utility functions

 (defn- normalize-category-series
@@ -522,7 +527,9 @@
        (set-axes-style! styling))
      (doto-cond
       chart
-      title (.setTitle title)))))
+      title (.setTitle title)
+      (-> styling :x-axis :title) (.setXAxisTitle (-> styling :x-axis :title))
+      (-> styling :y-axis :title) (.setYAxisTitle (-> styling :y-axis :title))))))

 (defn pie-chart
   "Returns a pie chart"
@@ -550,7 +557,9 @@
      (set-default-style! (.getStyler chart) styling)
      (doto-cond
       chart
-      title (.setTitle title)))))
+      title (.setTitle title)
+      (-> styling :x-axis :title) (.setXAxisTitle (-> styling :x-axis :title))
+      (-> styling :y-axis :title) (.setYAxisTitle (-> styling :y-axis :title))))))

 (defn as-buffered-image
   "Converts a chart into a java.awt.image.BufferedImage"


Revise test allowing for different env error messages

--- planck-cljs/test/planck/shell_test.cljs
+++ planck-cljs/test/planck/shell_test.cljs
@@ -63,7 +63,9 @@
   (try
     (planck.shell/sh "env" "abc")
     (catch :default e
-      (is (= {:exit 127, :out "", :err "env: abc: No such file or directory\n"}
-            (ex-data e)))
-      (is (= "env: abc: No such file or directory"
-            (ex-message e))))))
+      (let [expected-errors #{"env: abc: No such file or directory"
+                              "env: ‘abc’: No such file or directory"}]
+        (is (= 127 (:exit (ex-data e))))
+        (is (= "" (:out (ex-data e))))
+        (is (contains? expected-errors (string/trim (:err (ex-data e)))))
+        (is (contains? expected-errors (ex-message e)))))))


fix: Character generator actually says character

--- src/hphelper/chargen/select.clj
+++ src/hphelper/chargen/select.clj
@@ -13,11 +13,11 @@
   "Prints a page for selecting individual crisises"
   ([baseURL]
    (html [:html
-          [:head [:title "HPHelper Scenario Generator"]]
+          [:head [:title "HPHelper Character Generator"]]
           [:body
-           [:h3 "Scenario Generator"]
+           [:h3 "Character Generator"]
            [:form {:action (str baseURL "/char/gen/")}
-            "Generate New Scenario:"
+            "Generate New Character:"
             [:input {:type "submit" :value "New Character"}]
             ]
            [:br]


remove 'related' requirement from 'unfinished' table (close #126)

--- src/main/cljs_api_gen/write.clj
+++ src/main/cljs_api_gen/write.clj
@@ -606,7 +606,7 @@
                        :examples (non-empty-seq? examples)
                        :related (non-empty-seq? related)}))
         done? (fn [{:keys [ref cljsdoc description examples related]}]
-                (and ref cljsdoc description examples related))
+                (and ref cljsdoc description examples))
         symbols (->> (vals (:symbols result))
                      (map make-item)
                      (remove done?)


typo when-let not core/when-let

typo when-let not core/when-let

--- src/main/clojure/cljs/core.cljc
+++ src/main/clojure/cljs/core.cljc
@@ -2201,7 +2201,7 @@
                                              (let [~k (-nth ~chunksym ~isym)]
                                                ~subform-chunk
                                                ~@(core/when needrec [recform-chunk]))
-                                             (core/when-let [~seqsym (seq ~seqsym)]
+                                             (when-let [~seqsym (seq ~seqsym)]
                                                (if (chunked-seq? ~seqsym)
                                                  (let [c# (chunk-first ~seqsym)]
                                                    (recur (chunk-rest ~seqsym) c#