work on in/out/stdin/stdout

work on in/out/stdin/stdout

--- src/nml/core.clj
+++ src/nml/core.clj
@@ -4,18 +4,19 @@
   (:require [clojure.tools.cli :as cli   ])
   (:gen-class))

-(declare nml-get nml-name nml-set nml-str)
-
-; defs
+(declare nml-get nml-name nml-parse nml-set nml-str)
+
+;; defs

 (def debug false)

 (def msgs
-  {0 "-i/--in-place has no effect when no input file is specified."
-   1 "Input file required for get operations."
-   2 "-n/--no-prefix has no effect on set operations."
-   3 "Do not mix get and set operations."
-   4 "-i/--in-place has no effect on get operations."})
+  {
+   :create+in     "-i/--in not valid with -c/--create."
+   :get+out       "-o/--out may not be used with -g/--get."
+   :get+set       "-g/--get and -s/--set may not be mixed."
+   :set+no-prefix "-n/--no-prefix not valid with -s/--set."
+   })

 (def parse (insta/parser (clojure.java.io/resource "grammar")))

@@ -26,13 +27,8 @@
 (defn- fail [& lines]
   (binding [*out* *err*]
     (doseq [line lines]
-      (println line))
+      (println (str "nml: " line)))
     (System/exit 1)))
-
-(defn- warn [& lines]
-  (binding [*out* *err*]
-    (doseq [line lines]
-      (println (str "WARNING: " line)))))

 (defn- usage [summary]
   (doseq [x [""
@@ -49,7 +45,7 @@

 (defn- nml-add [tree parent child match proxy]
   (let [missing  (fn [children] (not-any? #(= (nml-name %) match) children))
-        vnew    #(parse proxy :start child)
+        vnew    #(nml-parse proxy child)
         f        (fn [& children] (if (missing children)
                                     (into [parent (vnew)] children)
                                     (into [parent       ] children)))]
@@ -60,9 +56,22 @@
     (let [val (nml-get tree nml key)]
       (println (if no-prefix val (str nml ":" key "=" val))))))

+;;(defn- nml-map [tree]
+;; (let [f (fn [& children] nil)]
+;;       (insta/transform ))
+
 (defn- nml-name [x]
   (nml-str (second x)))

+(defn- nml-parse [s start]
+  (let [result (parse s :start start)]
+    (if (insta/failure? result)
+      (let [{t :text l :line c :column} result]
+        (fail (str "Parse error at line " l " column " c ":")
+              t
+              (str (apply str (repeat (- c 1) " ")) "^")))
+      result)))
+
 (defn- nml-sets [tree sets]
   (loop [t tree s sets]
     (if (empty? s)
@@ -145,13 +154,17 @@
     [nml key val]))

 (def cliopts
-  [["-g" "--get n:k"   "Get value of key 'k' in namelist 'n'"         :assoc-fn assoc-get :parse-fn parse-get]
+  [
+   ["-c" "--create"    "Create new namelist file"                                                            ]
+   ["-g" "--get n:k"   "Get value of key 'k' in namelist 'n'"         :assoc-fn assoc-get :parse-fn parse-get]
    ["-h" "--help"      "Show usage information"                                                              ]
-   ["-i" "--in-place"  "Edit namelist file in place"                                                         ]
+   ["-i" "--in file"   "Input filename"                                                                      ]
    ["-n" "--no-prefix" "Report values without 'namelist:key=' prefix"                                        ]
+   ["-o" "--out file"  "Output filename                             "                                        ]
    ["-s" "--set n:k=v" "Set value of key 'k' in namelist 'n' to 'v'"  :assoc-fn assoc-set :parse-fn parse-set]
-   ["-v" "--version"   "Show version information"                                                            ]])
-
+   ["-v" "--version"   "Show version information"                                                            ]
+   ])
+
 ;; nml public defns

 (defn nml-get [tree nml key]
@@ -166,22 +179,17 @@
         match  (if sub (string/lower-case key) (string/lower-case nml))
         parent (if sub :nvseq :s)
         proxy  (if sub (str match "=0") (str "&" match " /"))
-        vnew   (if sub (fn [tree] (parse val :start :values)) #(nml-set % nml key val true))
+        vnew   (if sub (fn [tree] (nml-parse val :values)) #(nml-set % nml key val true))
         f      (fn
                  ([k v] (if (= (nml-str k) match) [child k (vnew v  )] [child k v]))
                  ([k  ] (if (= (nml-str k) match) [child k (vnew nil)] [child k  ])))]
     (insta/transform {child f} (nml-add tree parent child match proxy))))

 (defn nml-tree [s]
-  (let [result (parse s)
-        child  :nvseq
-        f      (fn [& v] (into [child] (nml-uniq v)))]
-    (if (insta/failure? result)
-      (let [{t :text l :line c :column} result]
-        (fail (str "Parse error at line " l " column " c ":")
-              t
-              (str (apply str (repeat (- c 1) " ")) "^")))
-      (insta/transform {child f} result))))
+  (let [tree  (nml-parse s :s)
+        child :nvseq
+        f     (fn [& v] (into [child] (nml-uniq v)))]
+      (insta/transform {child f} tree)))

 ;; main

@@ -189,29 +197,30 @@
   (alter-var-root #'*read-eval* (constantly false))
   (let [{:keys [options arguments summary]} (cli/parse-opts args cliopts)
         gets (:get options)
-        sets (:set options)]
+        sets (:set options)
+        in   (or (:in  options) *in* )
+        out  (or (:out options) *out*)]
     (if (:help options) (usage summary))
     (if (:version options) (do (println version) (System/exit 0)))
-    (if (and gets sets) (fail (msgs 3)))
-    (if (and gets (:in-place options)) (warn (msgs 4)))
-    (if (and sets (:no-prefix options)) (warn (msgs 2)))
-    (let [file (first arguments)
-          s    (if file
-                 (try (slurp file)
-                      (catch Exception e
-                        (if (:in-place options)
-                          ""
-                          (fail (str "Could not read from file '" file "'.")))))
-                 "")
-          tree (nml-tree s)]
-      (if (and gets (not file)) (fail (msgs 1)))
-      (if (and (:in-place options) (not file)) (warn (msgs 0)))
+    (if (and gets (:out options)) (fail (msgs :get+out)))
+    (if (and gets sets) (fail (msgs :get+set)))
+    (if (and sets (:no-prefix options)) (fail (msgs :set+no-prefix)))
+    (if (and (:create options) (:in options)) (fail (msgs :create+in)))
+    (let [tree (nml-tree
+                (if (:create options)
+                  ""
+                  (try (slurp in)
+                       (catch Exception e
+                         (fail (str "Could not read from '" in "'."))))))]
       (if debug (println tree))
       (cond gets  (nml-gets tree gets (:no-prefix options))
-            sets  (let [out (nml-str (nml-sets tree sets))]
-                    (if (and file (:in-place options))
-                      (try (spit file out)
+            sets  (let [s (nml-str (nml-sets tree sets))]
+                    (if (= out *out*)
+                      (println (string/trim s))
+                      (try (spit out s)
                            (catch Exception e
-                             (fail (str "Could not write to file '" file "'."))))
-                      (println (string/trim out))))
+                             (fail (str "Could not write to '" out "'."))))))
             :else (println (string/trim (nml-str tree)))))))
+
+;; TODO add assoc fn for -i and -i preventing multiple specifications
+;; TODO update README.md with new options


Fix health check

Fix health check

--- src/nube/app.clj
+++ src/nube/app.clj
@@ -122,8 +122,9 @@
            (recur (dec n))))))))

 (defn health-check-instances []
-  (doseq [i (vals (:instances @router))]
-    (health-check-host i 80)))
+  (doseq [l (vals (:instances @router))]
+    (doseq [i l]
+      (health-check-host i 80))))

 (defn pull-docker-image [host image]
   (let [[image tag] (ssplit image)]


Ack the shutdown channel if the peer will never reboot.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -1,6 +1,6 @@
 (ns onyx.api
   (:require [clojure.string :refer [split]]
-            [clojure.core.async :refer [chan >!! <!! close! alts!! timeout go]]
+            [clojure.core.async :refer [chan >!! <!! close! alts!! timeout go promise-chan]]
             [com.stuartsierra.component :as component]
             [taoensso.timbre :refer [info warn fatal error]]
             [onyx.log.entry :refer [create-log-entry]]
@@ -281,9 +281,10 @@
               (= ch restart-ch)
               (do (component/stop live)
                   (Thread/sleep (or (:onyx.peer/retry-start-interval config) 2000))
-                  (when-let [live (restart-peer live shutdown-ch)]
+                  (if-let [live (restart-peer live shutdown-ch)]
                     (do (reset! started-peer live)
-                        (recur live))))
+                        (recur live))
+                    (>!! ack-ch true)))
               :else (throw (ex-info "Read from a channel with no response implementation" {})))))
     (catch Throwable e
       (fatal "Peer lifecycle threw an exception")
@@ -305,8 +306,8 @@
      (fn [_]
        (let [v-peer (system/onyx-peer peer-group monitoring-config)
              live (component/start v-peer)
-             shutdown-ch (chan 1)
-             ack-ch (chan)
+             shutdown-ch (promise-chan)
+             ack-ch (promise-chan)
              started-peer (atom live)]
          {:peer-lifecycle (future (peer-lifecycle started-peer config shutdown-ch ack-ch))
           :started-peer started-peer


add missing debug cli opts, these are for debugging "release" only

--- src/main/shadow/cljs/devtools/cli_opts.cljc
+++ src/main/shadow/cljs/devtools/cli_opts.cljc
@@ -30,7 +30,9 @@
     (fn [opts k v]
       (update opts :dependencies conj-vec v))]
    ;; generic
-   [nil "--debug"]
+   [nil "--source-maps" "temporarily enable source-maps for release debugging"]
+   [nil "--pseudo-names" "temporarily enable pseudo-names for release debugging. DO NOT SHIP THIS CODE!"]
+   [nil "--debug" "enable source-maps + pseudo-names. DO NOT SHIP THIS CODE!"]
    ["-v" "--verbose" "verbose build log"]
    [nil "--cli-info" "prints a bunch of information"]
    ["-h" "--help"]])


when, unless docstring updates

when, unless docstring updates

--- src/cats/core.cljc
+++ src/cats/core.cljc
@@ -159,16 +159,18 @@
     (reduce (partial p/fapply ctx) af avs)))

 (defn when
-  "If the expression is true, returns the monadic value.
-  Otherwise, yields nil in a monadic context."
+  "Given an expression and a monadic value,
+  if the expression is logical true, return the monadic value.
+  Otherwise, return nil in a monadic context."
   ([b mv]
    (when (ctx/get-current mv) b mv))
   ([ctx b mv]
    (if b mv (return ctx nil))))

 (defn unless
-  "If the expression is false, returns the monadic value.
-  Otherwise, yields nil in a monadic context."
+  "Given an expression and a monadic value,
+  if the expression is not logical true, return the monadic value.
+  Otherwise, return nil in a monadic context."
   [b mv]
   (when-not b
     mv))


Make clicking on the user name show the user info popover

Link just went to a search that would never find anything

--- src/braid/core/client/ui/views/message.cljs
+++ src/braid/core/client/ui/views/message.cljs
@@ -5,6 +5,8 @@
     [braid.core.client.routes :as routes]
     [braid.core.client.ui.views.mentions :refer [tag-mention-view user-mention-view]]
     [braid.core.client.ui.views.card-border :refer [card-border-view]]
+    [braid.core.client.ui.views.user-hover-card :refer [user-hover-card-view]]
+    [braid.popovers.helpers :as popover]
     [cljsjs.highlight.langs.clojure]
     [cljsjs.highlight.langs.css]
     [cljsjs.highlight.langs.javascript]
@@ -220,8 +222,10 @@
      :info nil
      :name (if (nil? sender)
              [:span.nickname "[DELETED]"]
-             [:a.nickname {:tab-index -1
-                           :href sender-path}
+             [:span.nickname {:on-click (popover/on-mouse-enter
+                                          (fn []
+                                            [user-hover-card-view (:id sender)]))
+                              :style {:cursor "pointer"}}
               (:nickname sender)])}))

 (defn message-view


Log should track when first page is viewed

(i.e. as more log messages stream in)

--- src/cljs/onyx_dashboard/components/log.cljs
+++ src/cljs/onyx_dashboard/components/log.cljs
@@ -21,7 +21,7 @@
           (t/table {:striped? true :bordered? true :condensed? true :hover? true}
                    (dom/thead (dom/tr (dom/th "#") (dom/th "ID") (dom/th "fn") (dom/th "Time")))
                    (dom/tbody (map (fn [entry]
-                                     (om/build log-entry-row entry {}))
+                                     (om/build log-entry-row entry {:react-key (str (:message-id entry))}))
                                    entries)))))

 (def entries-per-page 20)
@@ -67,18 +67,22 @@
                                                     {:on-click (fn [_]
                                                                  (om/set-state! owner
                                                                                :entry-index
-                                                                                (min max-id
-                                                                                (+ current-index entries-per-page))))}))
+                                                                                (let [new-index (min max-id
+                                                                                (+ current-index entries-per-page))]
+                                                                                (if (= new-index max-id)
+                                                                                nil
+                                                                                new-index))))}))
                                                 (for [pg (range 0 num-pages)]
                                                   (pg/page (if (= current-page pg)
                                                              {:active? true}
                                                              {:on-click (fn [_]
                                                                           (om/set-state! owner
                                                                                :entry-index
-                                                                                (max 0
-                                                                                (min max-id
-                                                                                (- max-id
-                                                                                (* pg entries-per-page))))))})
+                                                                                (let [new-index (max 0
+                                                                                (min max-id
+                                                                                (- max-id
+                                                                                (* pg entries-per-page))))]
+                                                                                (if (= new-index max-id) nil new-index))))})
                                                            (str (inc pg))))
                                                 (pg/next
                                                   (if (= current-page (dec num-pages))


function composition:: short explanations of the created func

--- src/clojure_learning/4clojure-exercises.clj
+++ src/clojure_learning/4clojure-exercises.clj
@@ -581,4 +581,10 @@
 ((comp-> str - +) 1 2 3)

 ;; explanation:
-
+;; take a seq of functions, and create a new local binding of those functions by reversing the functions
+;; sequence -> so that ops start from left-> right. The "ret-closure" is the returned closure which
+;; takes the actual operands. A local binding using seq-destructuring is used to take the 1st function
+;; that is the initial right-most func and [apply] it on the sequence of args passed. With this init-result
+;; using [reduce] and the "tail-funcs" remained and the initial accumulator -> reduce the result by
+;; calling the rest funcs on that init-result.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


nrepl debug

nrepl debug

--- src/com/billpiel/sayid/nrepl_middleware.clj
+++ src/com/billpiel/sayid/nrepl_middleware.clj
@@ -17,6 +17,9 @@

 (defn reply:clj->nrepl
   [msg out]
+  (println "=============================")
+  (println (clj->nrepl out))
+  (println "=============================")
   (try (t/send (:transport msg)
                (response-for msg
                              :value (clj->nrepl out)))


Add example code on how to use raw reporter

--- test/clj_gatling/core_test.clj
+++ test/clj_gatling/core_test.clj
@@ -31,3 +31,22 @@
                      {:reporters [th/a-reporter th/b-reporter]
                       :concurrency 1})]
     (is (= summary {:a 1 :b 1}))))
+
+;This code can be used to test raw reporter in repl
+(comment
+  (let [average (fn [coll]
+                  (long (/ (reduce + coll) (count coll))))
+        map-vals (fn [f m]
+                   (reduce-kv #(assoc %1 %2 (f %3)) {} m))
+        calculate-averages (fn [data]
+                             (map-vals #(average (map (fn [{:keys [start end]}]
+                                                        (- end start)) %))
+                                       (group-by :name (mapcat :requests data))))
+        summary (run (simulation "test-raw")
+                     {:reporters [raw-reporter/file-reporter]
+                     ;{:reporters [raw-reporter/in-memory-reporter]
+                      :requests 100
+                      :concurrency 1})]
+    (calculate-averages (:raw summary))
+    )
+  )


js/Buffer warns that `new` keyword must be used

--- test/hildebrand/test/core.cljc
+++ test/hildebrand/test/core.cljc
@@ -28,7 +28,7 @@
       (let [in #? (:clj
                    (.getBytes "\u00a5123Hello" "utf8")
                    :cljs
-                   (js/Buffer "\u00a5123Hello" "utf8"))]
+                   (js/Buffer. "\u00a5123Hello" "utf8"))]
         (go-catching
           (<? (h/put-item! creds table {:name "binary-roundtrip" :attr in}))
           (is (= (ba->seq in)


[Fix #199] Rebuild file path from scratch with out-dir

The fix makes sure that the path in render is calculated from the right
individual pieces if out-dir is specified (and therefore not matching
:doc-root). The permalinks are now correctly generated.

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -805,11 +805,11 @@
     (letfn [(render-paths [fileset]
               (let [entries (filter-meta-by-ext fileset options)]
                 (reduce
-                 (fn [result {:keys [path out-dir] :as entry}]
+                 (fn [result {:keys [out-dir filename path] :as entry}]
                    (let [content (slurp (boot/tmp-file (boot/tmp-get fileset path)))
-                         path-args (if (= out-dir (:out-dir options))
+                         path-args (if (= out-dir (:out-dir options)) ;; if custom out-dir we cannot rely on pre-built :path
                                      [path]
-                                     [(:out-dir options) path])
+                                     [out-dir (:out-dir options) filename])
                          new-path (apply perun/create-filepath path-args)
                          new-entry (merge entry
                                           meta


close #9

close #9

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -65,9 +65,11 @@
   (let [pod (create-pod ttr-deps)]
     (boot/with-pre-wrap fileset
       (let [files (get-meta fileset)
-            updated-metadata (pod/with-call-in @pod
+            updated-files (pod/with-call-in @pod
                                 (io.perun.ttr/calculate-ttr ~files))
-            fs-with-meta (with-meta fileset {:metadata updated-metadata})]
+            fs-with-meta (with-meta fileset {:metadata updated-files})]
+       (u/dbug "Generated time-to-read:\n%s\n"
+              (pr-str (map :ttr (vals updated-files))))
         fs-with-meta))))

 (deftask draft


change header text to Item

change header text to Item

--- src/cljs/org/broadinstitute/firecloud_ui/page/method_config_importer.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/method_config_importer.cljs
@@ -230,7 +230,7 @@
    (fn [{:keys [props state]}]
      [table/Table
       {:columns [{:header "Type" :starting-width 100}
-                 {:header "Name" :starting-width 450 :as-text #(% "name")
+                 {:header "Item" :starting-width 450 :as-text #(% "name")
                   :sort-by (fn [m]
                              [(m "namespace") (m "name") (int (m "snapshotId"))])
                   :sort-initial :asc


Update puppetserver to tk-j9 0.7.5

Update puppetserver to tk-j9 0.7.5

--- configs/puppetserver/puppetserver.clj
+++ configs/puppetserver/puppetserver.clj
@@ -2,7 +2,7 @@
   :description "Release artifacts for puppet-server"
   :pedantic? :abort
   :dependencies [[puppetlabs/puppet-server "{{{puppet-server-version}}}"]
-                 [puppetlabs/trapperkeeper-webserver-jetty9 "0.7.3"]]
+                 [puppetlabs/trapperkeeper-webserver-jetty9 "0.7.5"]]

   :uberjar-name "puppet-server-release.jar"


Add tests for mpileup.

Add tests for mpileup.


Yet another stupid bug with this column width

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspaces_list.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspaces_list.cljs
@@ -163,7 +163,7 @@
            :header "Workspace" :starting-width (min 500 (* max-workspace-name-length 10))
            :content-renderer (fn [data] [WorkspaceCell {:data data
                                                         :nav-context (:nav-context props)}])}
-          {:header "Description" :starting-width (min 500 (* max-description-length 10))
+          {:header "Description" :starting-width (max 200 (min 500 (* max-description-length 10)))
            :content-renderer (fn [description]
                                [:div {:style {:padding "0 0 16px 14px"}}
                                 (if description description


Calculate min-widths based on content

Calculate min-widths based on content

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspaces_list.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspaces_list.cljs
@@ -86,11 +86,26 @@
       [:div {:style {:padding "1em 0 0 1em" :fontWeight 600}}
        (get-in props [:data :name])]])})

+(defn- get-workspace-name-string [ws]
+  (str (get-in ws ["workspace" "namespace"]) "/" (get-in ws ["workspace" "name"])))
+
+(defn- get-max-workspace-name-length [workspaces]
+  (apply max (map count (map #(get-workspace-name-string %) workspaces))))
+
+(defn- get-workspace-description [ws]
+  (get-in ws ["workspace" "attributes" "description"]))
+
+(defn- get-max-workspace-description-length [workspaces]
+  (apply max (map count (cons (map #(get-workspace-description %) workspaces) ["No description provided"]))))

 (react/defc WorkspaceTable
   {:render
    (fn [{:keys [state props]}]
-     (let [border-style (str "1px solid " (:line-gray style/colors))]
+     (let [border-style (str "1px solid " (:line-gray style/colors))
+           max-workspace-name-length (get-max-workspace-name-length (:workspaces props))
+           max-description-length (get-max-workspace-description-length (:workspaces props))]
+       (utils/cljslog (str "max-workspace-name-length: " max-workspace-name-length))
+       (utils/cljslog (str "max-description-length: " max-description-length))
        [table/Table
         {:empty-message "No workspaces to display."
          :cell-padding-left nil
@@ -121,9 +136,9 @@
            :header [:div {:style {:marginLeft -6}} "Status"] :starting-width 60
            :content-renderer (fn [data] [StatusCell {:data data}])}
           {:as-text :name :sort-by :text
-           :header "Workspace" :starting-width 450
+           :header "Workspace" :starting-width  (* max-workspace-name-length 10)
            :content-renderer (fn [data] [WorkspaceCell {:data data}])}
-          {:header "Description" :starting-width 400
+          {:header "Description" :starting-width (* max-description-length 10)
            :content-renderer (fn [description]
                                [:div {:style {:padding "1.1em 0 0 14px"
                                               :fontStyle (when-not description "oblique")}}
@@ -138,8 +153,7 @@
          :->row (fn [ws]
                   [{:status (:status ws)
                     :onClick #((:onWorkspaceSelected props) (ws "workspace"))}
-                   {:name (str (get-in ws ["workspace" "namespace"])
-                               "/" (get-in ws ["workspace" "name"]))
+                   {:name (get-workspace-name-string ws)
                     :status (:status ws)
                     :onClick #((:onWorkspaceSelected props) (ws "workspace"))}
                    (get-in ws ["workspace" "attributes" "description"])


(maint) Remove duplicate require in jruby-puppet-pool-int-test

--- test/integration/puppetlabs/services/jruby/jruby_puppet_pool_int_test.clj
+++ test/integration/puppetlabs/services/jruby/jruby_puppet_pool_int_test.clj
@@ -33,7 +33,6 @@
             [puppetlabs.trapperkeeper.services.protocols.metrics :as metrics-protocol]
             [puppetlabs.trapperkeeper.services.webserver.jetty9-service :as jetty9]
             [puppetlabs.trapperkeeper.testutils.bootstrap :as tk-testutils]
-            [puppetlabs.trapperkeeper.testutils.logging :as logging]
             [puppetlabs.trapperkeeper.testutils.logging :as logutils])
   (:import (com.codahale.metrics MetricRegistry)
            (java.io ByteArrayOutputStream)
@@ -287,7 +286,7 @@
            (is (= 200 (:status ping-before-stop))
                "environment request before stop failed")
            (let [start (System/currentTimeMillis)]
-             (logging/with-test-logging
+             (logutils/with-test-logging
               (while (and
                       (< (- (System/currentTimeMillis) start) 10000)
                       (not= 503 (:status (ping-environment))))
@@ -296,7 +295,7 @@
              (is (not= :timed-out (timed-deref stop-complete?))
                  (str "timed out waiting for the stop to complete, stack:\n"
                       (get-all-stack-traces-as-str)))
-             (logging/with-test-logging
+             (logutils/with-test-logging
               (is (= 503 (:status (ping-environment)))))))
          (finally
            ;; Stop the tk app.  In success cases, this will end up being done
@@ -335,7 +334,7 @@
            "environment request before stop failed")
        (is (= "our env request has been mocked!" (:body ping-before-stop))
            "environment response did not have our mock response body")
-       (logging/with-test-logging
+       (logutils/with-test-logging
         (let [start (System/currentTimeMillis)]
           (while (and
                   (< (- (System/currentTimeMillis) start) 10000)
@@ -610,7 +609,7 @@
                   (fn [instance]
                     (log/info "In cleanup fn")
                     (.terminate (:jruby-puppet instance)))]
-      (logging/with-test-logging
+      (logutils/with-test-logging
         (tk-testutils/with-app-with-config
          app
          jruby-testutils/jruby-service-and-dependencies
@@ -624,7 +623,7 @@
            (await pool-agent)
            (is (logged? #"In cleanup fn")))))))
   (testing "flushing the pool does not leave orphaned timeout threads"
-    (logging/with-test-logging
+    (logutils/with-test-logging
       (tk-testutils/with-app-with-config
        app
        jruby-testutils/jruby-service-and-dependencies
@@ -663,7 +662,7 @@

 (deftest compat-version-in-config-throws-exception-test
   (testing "compat-version setting in configuration throws exception"
-    (logging/with-test-logging
+    (logutils/with-test-logging
      (is (thrown-with-msg?
           IllegalArgumentException
           #"jruby-puppet.compat-version setting no longer supported"


fixed timer

fixed timer

--- desktop/src-common/con_world/core.clj
+++ desktop/src-common/con_world/core.clj
@@ -10,7 +10,7 @@
             [con-world.cell :as cell]
             [con-world.utils :as u]))

-(declare main-screen con-world intro-screen game-over-screen)
+(declare main-screen con-world intro-screen game-over-screen score-screen)

@@ -38,11 +38,7 @@
                 (doto player
                   (body-position! 0 0 0)
                   (body! :set-linear-velocity 0 0))
-                #_(assoc (label (str (:life player))
-                              (color :white)
-                              :set-width 30)
-                  :y (- u/w-height 16)
-                  :score? true)]))
+                ]))

            :on-render
            (fn [screen entities]
@@ -85,8 +81,7 @@
            (fn [screen entities]
              (let [coliding-entities [(first-entity screen entities) (second-entity screen entities)]
                    {p-width :width :as player} (cell/find-cell coliding-entities)
-                   {e-width :width :as enemy} (cell/find-enemy coliding-entities)
-                   score (cell/find-score entities)]
+                   {e-width :width :as enemy} (cell/find-enemy coliding-entities)]
                (if (and player enemy)
                  (if (< p-width e-width)
                    (let [new-life (- (:life player) 5)
@@ -97,15 +92,12 @@
                                      20 4
                                      25 5
                                      (:level player))]
-                     (->> entities
-                          (replace {player (assoc player :life new-life :level new-level)})
-                          #_(replace {score (doto score
-                                            (label! :set-text (str new-life)))})))
+                     (run! score-screen :update-score :score new-life)
+                     (replace {player (assoc player :life new-life :level new-level)} entities))
                    (let [new-life (inc (:life player))]
+                     (run! score-screen :update-score :score new-life)
                      (->> entities
                           (remove #(= % enemy))
-                          #_(replace {score (doto score
-                                            (label! :set-text (str new-life)))})
                           (replace {player (assoc player :life new-life)}))))
                  entities)))

@@ -118,6 +110,7 @@
                               (.getWorldManifold)
                               (.getNormal))
                    disable-contact (and (not in-zone?)
+                                        #_(cell/in-rectangle? enemy (rectangle 0 0 u/z-width u/z-height))
                                         (or
                                           (and (= z-side :right) (= normal (vector-2 1.0 0.0)))
                                           (and (= z-side :bottom) (= normal (vector-2 0.0 -1.0)))
@@ -129,10 +122,31 @@

            :on-timer
            (fn [screen entities]
-             (println "\n------ O N  T I M E R ------------\n")
              (if (= :spawn-enemy (:id screen))
                (conj entities (cell/spawn-enemy screen))
                entities)))
+
+(defscreen score-screen
+           :on-show
+           (fn [screen _]
+             (update! screen :renderer (stage) :camera (orthographic))
+             (assoc (label "" (color :white))
+               :y (- u/w-height 16)
+               :score? true))
+
+           :on-render
+           (fn [screen entities]
+             (render! screen entities))
+
+           :update-score
+           (fn [{:keys [score]} entities]
+             (let [score-label (cell/find-score entities)]
+               (replace {score-label (doto score-label (label! :set-text (str score)))} entities)))
+
+           :on-resize
+           (fn [screen entities]
+             (size! screen (game :width) (game :height))
+             entities))

 (defscreen intro-screen
            :on-show
@@ -147,7 +161,7 @@

            :on-key-down
            (fn [_ entities]
-             (set-screen! con-world main-screen)
+             (set-screen! con-world main-screen score-screen)
              entities)

            :on-resize
@@ -168,7 +182,7 @@

            :on-key-down
            (fn [_ entities]
-             (set-screen! con-world main-screen)
+             (set-screen! con-world main-screen score-screen)
              entities)

            :on-resize


Add unpack-entities db helper

Add unpack-entities db helper

--- src/trak/db.cljs
+++ src/trak/db.cljs
@@ -13,3 +13,12 @@
                               }))

+;
+; If you have a collection of entites (as it's usually
+; returned by datascript queries), unpack them into entities
+; (so we have (1 2 3) instead of #{[1] [2] [3]} etc.)
+;
+(defn unpack-entities [db collection-of-ids]
+  (->> collection-of-ids
+       (map first)
+       (map #(d/entity db %))))


Some more comments and help.

Some more comments and help.

--- clojure-functional/src/test/clojure/no/knowit/clojure_functional/intro.clj
+++ clojure-functional/src/test/clojure/no/knowit/clojure_functional/intro.clj
@@ -106,12 +106,14 @@

 (deftest dealing-with-lists
   (are [x y] (= x y)
+  ;; Should be able to use one simple function call to get result
        (first '(1 2 3 4))  1
        (last '(1 2 3 4 5)) 5
        (take 2 '(1 2 3 4)) '(1 2)))

 (deftest operating-on-lists
   (are [x y] (= x y)
+  ;; Here you should try to apply the correct function to get the expected result
        (apply + [1 2 3 4]) 10
        (apply - [4 3 2 1]) -2
        (apply * [1 2 3 4]) 24
@@ -120,11 +122,19 @@

 (deftest how-to-filter-out-the-stuff-you-want
   (are [x y] (= x y)
+  ;; Filter is cool. Can you write or use a cool function to get correct result?
     (filter odd? '(1 2 3 4 5)) '(1 3 5)
     (filter even? '(1 2 3 4 5)) '(2 4)))

+(deftest use-map-to-double-all-numbers-in-a-sequence
+  ;; Write a function in the let form that doubles its input
+  (let [double (fn [x] (* 2 x))]
+    (are [x y] (= x y)
+      (map double '(1 2 3)) '(2 4 6)
+      (map double '(5 10 15)) '(10 20 30))))

 (deftest define-a-function-that-checks-string-longer-than
+  ;; Write a function in the let form that that checks that the input String is longer than number input.
   (let [longer-than? (fn [str len] (> (count str) len))]
     (are [x y] (= x y)
          (longer-than? "long string" 5) true
@@ -132,11 +142,4 @@
          (longer-than? nil 2) false)))

-(deftest use-map-to-double-all-numbers-in-a-sequence
-  (let [double (fn [i] (* 2 i))]
-    (are [x y] (= x y)
-         (map double '(1 2 3)) '(2 4 6)
-         (map double '(5 10 15)) '(10 20 30))))
-
-
 (run-tests)


Restart system if changed migrations

Restart system if changed migrations

--- build.boot
+++ build.boot
@@ -143,7 +143,7 @@
    (figwheel)
    (run-figwheel)
    (watch)
-   (system :sys #'dev-system :auto true :files ["handler.clj"])))
+   (system :sys #'dev-system :auto true :files ["lobos.clj" "handler.clj"])))

 (deftask watch-tests []
   (comp


Add task options

Add task options

--- build.boot
+++ build.boot
@@ -7,15 +7,20 @@
 (require
   '[net.sekao.nightcode.core :as app])

+(task-options!
+  pom {:project 'nightcode
+       :version "1.0.0-SNAPSHOT"}
+  aot {:namespace '#{net.sekao.nightcode.core}}
+  jar {:main 'net.sekao.nightcode.core
+       :manifest {"Description" "An IDE for Clojure and ClojureScript"
+                  "Url" "https://github.com/oakes/Nightcode"}})
+
 (deftask run []
-  (with-pre-wrap fileset
-    (app/-main)
-    fileset))
+  (comp
+    (aot)
+    (with-pre-wrap fileset
+      (app/-main)
+      fileset)))

 (deftask build []
-  (comp
-   (aot :namespace '#{net.sekao.nightcode.core})
-   (pom :project 'nightcode
-        :version "1.0.0-SNAPSHOT")
-   (uber)
-   (jar :main 'net.sekao.nightcode.core)))
+  (comp (aot) (pom) (uber) (jar)))


0.0.30-SNAPSHOT

--- build.boot
+++ build.boot
@@ -15,7 +15,7 @@
          '[zilti.boot-typed :refer [typed]]
          '[adzerk.bootlaces :refer :all])

-(def +version+ "0.0.21-SNAPSHOT")
+(def +version+ "0.0.30-SNAPSHOT")
 (bootlaces! +version+)

 (task-options!


(SERVER-1148) Bumped jruby-pool-int promise deref timeout to 4 minutes

This commit bumps the promise deref timeout, generally used to wait for
pool flushes to complete, from 2 minutes to 4 minutes.  At 2 minutes,
some tests were periodically failing because the time out was reached
when running in Travis CI.

--- test/integration/puppetlabs/services/jruby/jruby_pool_int_test.clj
+++ test/integration/puppetlabs/services/jruby/jruby_pool_int_test.clj
@@ -43,7 +43,7 @@

 (defn timed-deref
   [ref]
-  (deref ref 120000 :timed-out))
+  (deref ref 240000 :timed-out))

 (def script-to-check-if-constant-is-defined
   "! $instance_id.nil?")


namespace keys in storage

namespace keys in storage

--- src/shoutout.clj
+++ src/shoutout.clj
@@ -102,18 +102,24 @@
     [storage  ^String feature-name ^String serialized]
     "write a serialized feature to the storage"))

+(defn prefix-feature-name
+  "prefixes \"shoutout_feature\" onto a string"
+  [raw]
+  (str "shoutout_feature" raw))
+
 (defn get-from-storage
   "retrieve a deserialized feature from storage"
   [storage feature-name]
-  (parse-feature feature-name (read-from-storage storage feature-name)))
+  (parse-feature (prefix-feature-name feature-name) (read-from-storage storage feature-name)))

 (defn update-in-storage
   "alter a feature using the supplied function f. handles reading, serializing,
   deserializing, you just write f to modify the feature as wanted"
   [storage feature-name f]
   (let [feature (get-from-storage storage feature-name)]
-    (write-to-storage storage feature-name (serialize-feature
-                                             (f feature)))))
+    (write-to-storage storage
+                      (prefix-feature-name feature-name)
+                      (serialize-feature (f feature)))))

 (defn activate
   "completely activate a feature for all users"


Fix make-site-entry test for changed name of test site

--- test/clj/comic_reader/site_scraper_test.clj
+++ test/clj/comic_reader/site_scraper_test.clj
@@ -8,11 +8,11 @@
   (t/is (= (sut/make-site-entry "non-existent")
            ["non-existent" nil]))

-  (let [test-file (io/as-file "resources/sites/test-site.clj")]
+  (let [test-file (io/as-file "resources/sites/test.site.edn")]
     (spit test-file "{}")
-    (let [[label opts] (sut/make-site-entry "test-site")]
+    (let [[label opts] (sut/make-site-entry "test")]
       (t/is (= label
-               "test-site"))
+               "test"))
       (t/is (= (class opts)
                MangaSite)))
     (io/delete-file test-file)))


Removing gecode, as it doesn't exist yet

--- config/projects/chef-server-full.clj
+++ config/projects/chef-server-full.clj
@@ -19,7 +19,7 @@

 (project "chef-server-full" "0.10.4" "1"
          :build-order [ "prep" "autoconf" "zlib" "libiconv" "db" "gdbm" "ncurses" "openssl"
-                        "libxml2" "libxslt" "ruby" "rsync" "gecode" "chef" "chef-server"
+                        "libxml2" "libxslt" "ruby" "rsync" "chef" "chef-server"
                         "erlang" "icu" "spidermonkey" "curl" "couchdb"])


fix flaky test

fix flaky test

--- cimi/test/com/sixsq/slipstream/auth/utils/db_test.clj
+++ cimi/test/com/sixsq/slipstream/auth/utils/db_test.clj
@@ -10,17 +10,18 @@

 (use-fixtures :each ltu/with-test-server-fixture)

-(deftest test-user-creation
-  (is (= "st" (db/create-user! {:authn-method "github"
-                                :authn-login  "st"
-                                :email        "st@s.com"
-                                :roles        "alpha-role, beta-role"
-                                :firstname    "first"
-                                :lastname     "last"
-                                :organization "myorg"})))
-
-
-
+(deftest test-user-creation-standard-username
+  (let [identifier "st"]
+    (is (= identifier (db/create-user! {:authn-method "github"
+                                        :authn-login  identifier
+                                        :email        "st@s.com"
+                                        :roles        "alpha-role, beta-role"
+                                        :firstname    "first"
+                                        :lastname     "last"
+                                        :organization "myorg"})))))
+
+
+(deftest test-user-creation-uuid
   (let [uuid (u/random-uuid)]
     (is (= uuid (db/create-user! {:authn-method   "github"
                                   :authn-login    uuid
@@ -31,20 +32,22 @@
                                   :lastname       "last"
                                   :organization   "myorg"})))

-    (let [user-names (db/existing-user-names)
-          user (db/get-user (first user-names))]
-      (is (= 2 (count user-names)))
+    (let [usernames (db/existing-user-names)
+          user (db/get-user (first usernames))]
+
+      (is (= 1 (count usernames)))
       (is (= "alpha-role, beta-role" (:roles user)))
       (is (= false (:deleted user)))
       (is (= "st@s.com" (:emailAddress user)))
       (is (= false (:isSuperUser user)))
-      (is (= "st" (:username user)))
+      (is (= uuid (:username user)))
       (is (= "ACTIVE" (:state user)))
       (is (= "first" (:firstName user)))
       (is (= "last" (:lastName user)))
       (is (:password user))
       (is (:created user))
       (is (= "USER ANON" (db/find-roles-for-username "st"))))))
+

 (deftest test-user-creation-avoids-user-same-name
   (th/add-user-for-test! {:username     "stef"
@@ -66,6 +69,7 @@
   (let [users-created (db/get-active-users)]
     (is (= 3 (count users-created)))))

+
 (defn create-users
   [n]
   (doseq [i (range n)]
@@ -76,10 +80,12 @@
                 :emailAddress "a@b.c"}]
       (th/add-user-for-test! user))))

+
 (deftest test-existing-user-names
   (is (= [] (db/existing-user-names)))
   (create-users 3)
   (is (= 3 (count (db/existing-user-names)))))
+

 (deftest test-name-no-collision
   (is (= "_" (db/name-no-collision "_" [])))
@@ -96,6 +102,7 @@
   (is (= "joe_11" (db/name-no-collision "joe_10" ["joe_10"])))
   (is (= "joe_1_2_4" (db/name-no-collision "joe_1_2_3" ["joe_1_2_3"]))))

+
 (deftest test-users-by-email-skips-deleted
   (th/add-user-for-test! {:username     "jack"
                           :password     "123456"
@@ -104,6 +111,7 @@

   (is (= #{} (db/find-usernames-by-email "unknown@xxx.com")))
   (is (= #{} (db/find-usernames-by-email "jack@sixsq.com"))))
+

 (deftest test-users-by-email
   (th/add-user-for-test! {:username     "jack"
@@ -119,6 +127,7 @@
   (is (= #{} (db/find-usernames-by-email "unknown@xxx.com")))
   (is (= #{"jack"} (db/find-usernames-by-email "jack@sixsq.com")))
   (is (= #{"joe" "joe-alias"} (db/find-usernames-by-email "joe@sixsq.com"))))
+

 (deftest test-users-by-authn-skips-deleted
   (th/add-user-for-test! {:username     "joe-slipstream"
@@ -127,6 +136,7 @@
                           :githublogin  "joe"
                           :state        "DELETED"})
   (is (nil? (db/find-username-by-authn :githublogin "joe"))))
+

 (deftest test-users-by-authn
   (th/add-user-for-test! {:username     "joe-slipstream"
@@ -161,6 +171,7 @@
                           :githublogin  "joe"})
   (is (thrown-with-msg? Exception #"one result for joe"
                         (db/find-username-by-authn :githublogin "joe"))))
+

 (deftest check-user-exists?
   (let [test-username "some-long-random-user-name-that-does-not-exist"
@@ -185,6 +196,7 @@
     (is (true? (db/user-exists? test-username-deleted)))
     (is (nil? (db/get-active-user-by-name test-username-deleted)))))

+
 (deftest test-find-password-for-username
   (let [username "testuser"
         password "password"
@@ -194,6 +206,7 @@
     (th/add-user-for-test! user)
     (is (= pass-hash (db/find-password-for-username username)))))

+
 (deftest test-find-roles-for-username
   (let [username "testuser"
         user {:username    username


Fixed start error

Fixed start error

Fn was not declared in right place

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -36,6 +36,30 @@
   (catch Exception e
     (str "Error connecting to database: " (.getMessage e))))

+
+
+
+
+
+
+
+
+
+
+
+(defn dissoc-in
+  "Dissociates an entry from a nested associative structure returning a new
+  nested structure. keys is a sequence of keys. Any empty maps that result
+  will not be present in the new structure."
+  [m [k & ks :as keys]]
+  (if ks
+    (if-let [nextmap (get m k)]
+      (let [newmap (dissoc-in nextmap ks)]
+        (if (seq newmap)
+          (assoc m k newmap)
+          (dissoc m k)))
+      m)
+    (dissoc m k)))

@@ -733,7 +757,7 @@
         update-request           (if update-request-atom  @update-request-atom)
         ]
     (println (str "      update-request: " update-request))
-    (swap! update-request-atom dissoc-in [:records table-name record-id])
+    (swap! update-request-atom  dissoc-in  [:records table-name record-id])
   ))

@@ -793,7 +817,7 @@
         (if (not cached-record)
           (get-record-from-database    db-table id fields)
           (do
-            (delete-record-from-realtime-update  db-table    id     client-id)
+            ;(delete-record-from-realtime-update  db-table    id     client-id)
             ;(println "Use cached value " id ":" cached-record)
             (get cached-record :value)
             )
@@ -1128,23 +1152,6 @@

-(defn dissoc-in
-  "Dissociates an entry from a nested associative structure returning a new
-  nested structure. keys is a sequence of keys. Any empty maps that result
-  will not be present in the new structure."
-  [m [k & ks :as keys]]
-  (if ks
-    (if-let [nextmap (get m k)]
-      (let [newmap (dissoc-in nextmap ks)]
-        (if (seq newmap)
-          (assoc m k newmap)
-          (dissoc m k)))
-      m)
-    (dissoc m k)))
-
-
-
-
 (defn delete-query-from-realtime-update  [ query-key     data-session-id ]
   (let [client-data-atom         (if server-side-realtime-clients  (get @server-side-realtime-clients  data-session-id))
         response-atom            (if client-data-atom  client-data-atom )


Drop pattern as a :require since it's unused

--- src/oxcart.clj
+++ src/oxcart.clj
@@ -23,8 +23,7 @@
             [clojure.string :as s]
             [clojure.tools.reader :as r]
             [clojure.tools.reader.reader-types :as readers]
-            [oxcart.util :as util]
-            [oxcart.pattern :as patern])
+            [oxcart.util :as util])
   (:import clojure.lang.IFn))


Added endlessly macro

Added endlessly macro

--- src/poller.clj
+++ src/poller.clj
@@ -20,6 +20,12 @@
     (kdb/postgres settings)))

+(defmacro endlessly [interval & forms]
+  `(doseq [~'x (range)]
+     ~@forms
+     (Thread/sleep ~interval)))
+
+
 (defn -main []
   (let [poll-interval 1000
         db-url (env/env :database-url)


Fix room dimensions for today's demo.

Fix room dimensions for today's demo.

--- src/afterglow/examples.clj
+++ src/afterglow/examples.clj
@@ -207,12 +207,13 @@
   grids, and the like."
   []
   (swap! osc-server (fn [server] (or server (osc/osc-server 16010 "Afterglow"))))
+  (show/set-variable! :y (tf/inches 118))
   (osc/osc-handle @osc-server "/aim" (fn [msg]
-                                       (let [left -2.5
-                                             right 1.65
+                                       (let [left (tf/inches -88)
+                                             right (tf/inches 86)
                                              width (- right left)
-                                             front -0.7
-                                             rear 3.1
+                                             front (tf/inches -21)
+                                             rear (tf/inches 295)
                                              depth (- rear front)]
                                          (show/set-variable! :x (+ left (* width (first (:args msg)))))
                                          (show/set-variable! :z (+ front (* depth (second (:args msg))))))


Fix commented example.

Fix commented example.

--- src/afterglow/examples.clj
+++ src/afterglow/examples.clj
@@ -39,8 +39,9 @@
 ;;(show/add-function! sample-show :master (master-cue 255))

 ;; Get a little fancier with some beat-driven fades
-;;(show/add-function! sample-show :master
-;;                    (afterglow.effects.dimmer/sawtooth-beat (show/all-fixtures sample-show)))
+;; (show/add-function! sample-show :master
+;;                     (dimmer-oscillator (oscillators/sawtooth-beat)
+;;                                        (show/all-fixtures sample-show)))

 ;; This is for testing the enhance multi-beat and fractional-beat phase calculations I am implementing;


Add raw pan/tilt oscillator cues.

Add raw pan/tilt oscillator cues.

--- src/afterglow/examples.clj
+++ src/afterglow/examples.clj
@@ -1149,6 +1149,44 @@
                                  (when isolated? {:start 0.0}))]
               :color color :priority 1)))

+(defn- build-pan-tilt-osc-cue
+  "Build a raw pan/tilt oscillator cue."
+  [fixture-key]
+  (cues/cue (keyword (str "p-t-" (name fixture-key)))
+              (fn [var-map]
+                (let [pan-osc (oscillators/sine :interval :bar :interval-ratio (:pan-bars var-map)
+                                                :phase (:pan-phase var-map))
+                      pan-param (oscillators/build-oscillated-param pan-osc :min (:pan-min var-map)
+                                                                    :max (:pan-max var-map))
+                      tilt-osc (oscillators/sine :interval :bar :interval-ratio (:tilt-bars var-map)
+                                                :phase (:tilt-phase var-map))
+                      tilt-param (oscillators/build-oscillated-param tilt-osc :min (:tilt-min var-map)
+                                                                    :max (:tilt-max var-map))]
+                  (fx/scene (str "P/T " (name fixture-key))
+                            (chan-fx/channel-effect
+                             "pan" pan-param
+                             (afterglow.channels/extract-channels (show/fixtures-named fixture-key)
+                                                                  #(= (:type %) :pan)))
+                            (chan-fx/channel-effect
+                             "tilt" tilt-param
+                             (afterglow.channels/extract-channels (show/fixtures-named fixture-key)
+                                                                  #(= (:type %) :tilt))))))
+              :variables [{:key "pan-min" :name "Pan min" :min 0 :max 255
+                           :centered true :resolution 0.5 :start 0}
+                          {:key "pan-max" :name "Pan max" :min 0 :max 255
+                           :centered true :resolution 0.5 :start 255}
+                          {:key "pan-bars" :name "Pan bars" :min 1 :max 16
+                           :type :integer :start 1}
+                          {:key "pan-phase" :name "Pan phase" :min 0.0 :max 1.0 :start 0.0}
+                          {:key "tilt-min" :name "Tilt min" :min 0 :max 255
+                           :centered true :resolution 0.5 :start 0}
+                          {:key "tilt-max" :name "Tilt max" :min 0 :max 255
+                           :centered true :resolution 0.5 :start 255}
+                          {:key "tilt-bars" :name "Tilt bars" :min 1 :max 16
+                           :type :integer :start 1}
+                          {:key "tilt-phase" :name "Tilt phase" :min 0.0 :max 1.0 :start 0.0}]
+              :color :green :priority 1))
+
 (defn- make-main-direction-cues
   "Create a page of cues for aiming lights in particular directions,
   individually and in groups."
@@ -1175,14 +1213,19 @@
         (let [fixture (first fixtures)]
           ;; Disconnected individual direction cues
           (show/set-cue! (+ x-base index) y-base (build-direction-cue fixture nil false :white))
+
           ;; Group A untransformed direction cues
           (show/set-cue! (+ x-base index) (inc y-base) (build-direction-cue fixture "a" false :blue))
           ;; Group A transformed direction cues
           (show/set-cue! (+ x-base index) (+ y-base 2) (build-direction-cue fixture "a" true :cyan))
+
           ;; Group B untransformed direction cues
           (show/set-cue! (+ x-base index) (+ y-base 3) (build-direction-cue fixture "b" false :red))
           ;; Group B transformed direction cues
-          (show/set-cue! (+ x-base index) (+ y-base 4) (build-direction-cue fixture "b" true :orange)))
+          (show/set-cue! (+ x-base index) (+ y-base 4) (build-direction-cue fixture "b" true :orange))
+
+          ;; Raw pan/tilt oscillated cues
+          (show/set-cue! (+ x-base index) (+ y-base 7) (build-pan-tilt-osc-cue fixture)))
         (recur (rest fixtures) (inc index))))

     ;; Transformation modifiers for group A


fix bugs in usage queued builds

fix bugs in usage queued builds

--- frontend/components/build_head.cljs
+++ frontend/components/build_head.cljs
@@ -27,15 +27,15 @@
         (html
          (if-not builds
            [:div.loading-spinner common/spinner]
-           [:div
+           [:div.build-queue.active
             (when-not usage-queued?
-              [:p (str "Circle "
-                       (when run-queued? "has") " spent "
-                       (om/build common/updating-duration {:start (:queued_at build)
-                                                           :stop (or (:start_time build) (:stop_time build))})
-                       " acquiring containers for this build")])
+              [:p "Circle " (when run-queued? "has") " spent "
+               (om/build common/updating-duration {:start (:queued_at build)
+                                                   :stop (or (:start_time build) (:stop_time build))})
+               " acquiring containers for this build."])
             (when (< 10000 (build-model/run-queued-time build))
-              [:p "We're sorry; this is our fault. Typically you should only see this when load spikes overwhelm our auto-scaling; waiting to acquire containers should be brief and infrequent."])
+              [:p#circle_queued_explanation
+               "We're sorry; this is our fault. Typically you should only see this when load spikes overwhelm our auto-scaling; waiting to acquire containers should be brief and infrequent."])

             (when (seq builds)
               (list
@@ -45,7 +45,9 @@
                                                     :stop (or (:queued_at build) (:stop_time build))})]

                (om/build builds-table/builds-table builds {:opts {:show-actions? true}})))
-            (when (and plan (< 10000 (build-model/usage-queued-time build)))
+            (when (and plan
+                       (< 10000 (build-model/usage-queued-time build))
+                       (> 10000 (build-model/run-queued-time build)))
               [:p#additional_containers_offer
                "Too much waiting? You can " [:a {:href (routes/v1-org-settings-subpage {:org (:org_name plan)
                                                                                :subpage "containers"})}


remove logging

remove logging

--- examples/tilemap/src/tilemap/core.cljs
+++ examples/tilemap/src/tilemap/core.cljs
@@ -118,8 +118,6 @@
                             (tm/make-tile-map key-for)
                             (tm/make-tile-sprites tile-set)
                             )]
-      (log "tile-set:" tile-set)
-      (log "tile-sprites:" tile-sprites)
       (m/with-sprite :tilemap
         [tile-map (tm/make-tilemap tile-sprites
                                    :scale 4


avoid unnecessary string concatenation

avoid unnecessary string concatenation

--- src/bract/core/inducer.clj
+++ src/bract/core/inducer.clj
@@ -170,7 +170,7 @@
   (if (kdef/ctx-launch? context)
     (let [launcher (-> (kdef/ctx-config context)
                      kdef/cfg-launcher)]
-      (echo/echo (str "Launcher name: " launcher))
+      (echo/echo "Launcher name: " launcher)
       (launcher context))
     (do
       (echo/echo "Launch not enabled, skipping launch.")


Changed concat-strs to append-strs. Useful to keep the StringBuffer around

--- src/hiccup.clj
+++ src/hiccup.clj
@@ -72,25 +72,25 @@
   [s]
   (or (nil? s) (= s "")))

-(defmacro concat-strs
-  "An way of concatenating strings that precompiles functions with literal
-  arguments for efficiency."
-  [& forms]
-  (let [buffer (gensym "sb")]
-   `(let [~buffer (StringBuffer.)]
-     ~@(remove nil?
-         (for [form forms]
-           (if (or (literal? form) (every? literal? (rest form)))
-             (let [value (eval form)]
-               (if-not (blank? value)
-                 `(.append ~buffer ~value)))
-            `(.append ~buffer ~form))))
-       (.toString ~buffer))))
+(defmacro append-strs
+  "Append strings to a string buffer, pre-compiling functions with literal
+  arguments."
+  [buffer & forms]
+  `(do
+    ~@(remove nil?
+        (for [form forms]
+          (if (and (list? form) (every? literal? (rest form)))
+            (let [value (eval form)]
+              (if-not (blank? value)
+               `(.append ~buffer ~value)))
+             `(.append ~buffer ~form))))))

 (defmacro html-tag
   "Efficiently create a HTML tag."
   [tag & content]
-  (concat-strs
-    (make-start-tag tag)
-    (make-tag-attrs (first content))
-    ">"))
+  `(let [buffer# (StringBuffer.)]
+     (append-strs buffer#
+       (make-start-tag ~tag)
+       (make-tag-attrs ~(first content))
+       ">")
+     (.toString buffer#)))


force tag if it already exists

force tag if it already exists

--- src/cake/tasks/version.clj
+++ src/cake/tasks/version.clj
@@ -55,5 +55,5 @@
   (let [version (:version *project*)]
     (if (.endsWith version "SNAPSHOT")
       (println "refusing to create tag for snapshot version:" version)
-      (do (git "tag" "-a" version "-m" (format "'version %s'" version))
+      (do (git "tag" "-fa" version "-m" (format "'version %s'" version))
           (log "created git tag" version)))))


Add a tiny bit of space before h3

Add a tiny bit of space before h3

--- src/catalog/layout/fop.clj
+++ src/catalog/layout/fop.clj
@@ -23,7 +23,7 @@
         :break-before "page" :font-size "25pt" :role "H1"}
    :h2 {:font-weight "bold" :keep-with-next "always" :space-before "25pt" :space-after "11pt"
         :font-size "17pt" :role "H2"}
-   :h3 {:font-weight "bold" :keep-with-next "always" :space-before "11pt" :space-after "14pt"
+   :h3 {:font-weight "bold" :keep-with-next "always" :space-before "14pt" :space-after "14pt"
         :font-size "14pt" :role "H3"}
    :header {:text-align-last "justify" :font-weight "bold" :border-bottom "thin solid"}})


Small layout tweaks to the covers

Small layout tweaks to the covers

to make sure it all lines up properly

--- src/catalog/layout/fop.clj
+++ src/catalog/layout/fop.clj
@@ -452,8 +452,10 @@
   (let [volume-number (layout/volume-number date)
         fill-color (format "fill:%s device-%s" (color-rgb volume-number) (color volume-number))]
     [:fo:page-sequence {:id "cover-recto" :master-reference "cover-recto"
-                        :force-page-count "no-force"}
+                        :force-page-count "no-force"
+                        :font-family  "StoneSansSemibold"}
      [:fo:static-content {:flow-name "xsl-region-start" :role "artifact"}
+      [:fo:block]
       [:fo:block-container {:absolute-position "fixed" :width "210mm" :height "297mm"}
        (block {:font-size "0"}
               [:fo:external-graphic
@@ -484,33 +486,32 @@
               :style fill-color :id "kreis"}]]]]]]]]
      [:fo:flow {:flow-name"xsl-region-body"}
       [:fo:wrapper {:role "artifact"}
-       [:fo:block-container {:absolute-position "fixed" :width "32mm" :height "15mm"
-                             :left "57mm" :top "135mm" :text-align "center"
-                             :display-align "center"}
-        (block {:font-size "42pt" :line-height "1" :color (color :white)
+       [:fo:block-container {:absolute-position "fixed" :width "33mm" :height "15mm"
+                             :left "56mm" :top "135mm" :display-align "center"
+                             :background-color "transparent"}
+        (block {:font-size "42pt" :line-height "1"
+                :text-align "center" :color (color :white)
                 :role "H2"}
                "neu")]]
       (block {:start-indent "3mm" :end-indent "3mm"
-              :font-family  "StoneSansSemibold" :font-size "90pt"
-              :color (color :warmgrey) :line-height "0.9"
+              :font-size "90pt" :color (color :warmgrey) :line-height "0.9"
               :text-align "start" :hyphenate "false"
               :role "H1"}
              title)
       [:fo:block-container {:absolute-position "fixed"
                             :width "297mm" :height "25mm"
                             :left "0mm" :top "0mm" :reference-orientation "90"}
-       (block {:text-align "end"
-               :font-family  "StoneSansSemibold" :font-size "46pt"
+       (block {:text-align "end" :font-size "46pt"
                :color (color :white) :hyphenate "false"
                :start-indent "10mm" :end-indent "10mm"
                :space-before "8mm" :space-before.conditionality "retain"
                :role "H2"}
               (layout/format-date date))]
       [:fo:block-container {:absolute-position "fixed" :width "53mm" :height "53mm"
-                            :left "141mm" :top "119mm" :text-align "center"
-                            :display-align "center"}
-       (block {:font-size "120pt" :font-family  "StoneSansSemibold"
-               :color (color :white)
+                            :left "142mm" :top "119mm" :display-align "center"
+                            :background-color "transparent"}
+       (block {:font-size "120pt" :color (color :white)
+               :text-align "center"
                :fox:alt-text (format "%s Ausgabe" (layout/ordinal volume-number))}
               (str volume-number))]]]))


Tweak resolution and centering keyword.

Tweak resolution and centering keyword.

--- src/afterglow/effects/cues.clj
+++ src/afterglow/effects/cues.clj
@@ -77,14 +77,17 @@
     others in the future. If omitted or unrecognized, `:float` is
     assumed.

-  * `:pan` is supplied with a true value requests that the gauge
+  * `:centered` supplied with a true value requests that the gauge
     displayed when adjusting this variable's value be like a pan
     gauge, showing deviation from a central value.

   * `:resolution` specifies the smallest amount by which the variable
-    will be incremented or decremented when the user adjusts it for
-    controllers with continuous encoders. If not specified, 1/200
-    of the range from `:min` to `:max` is used.
+     will be incremented or decremented when the user adjusts it for
+     controllers with continuous encoders. If not specified the
+     resolution is up to the controller, but 1/256 of the range from
+     `:min` to `:max` is a recommended default implementation, since that
+     allows access to the full DMX parameter space for channel-oriented
+     values.

   * `:aftertouch` accompanied by a true value enables the variable to
   be adjusted by aftertouch values on pressure-sensitive controllers.
@@ -182,18 +185,20 @@
         variable? (some #(= (:range %) :variable) specs)]
     (if variable?
       ;; Introduce a variable for conveniently adjusting the function level
-      (cue show-key (fn [var-map] (chan/function-effect effect-name function (params/bind-keyword-param
-                                                                              (:level var-map level) Number level)
-                                                        fixtures :htp? htp?))
-                :short-name short-name
-                :color color
-                :end-keys end-keys
-                :priority priority
-                :held held
-                :variables [(merge {:key "level" :min 0 :max 100 :start level}
-                                   (when aftertouch {:aftertouch aftertouch})
-                                   (when aftertouch-min {:aftertouch-max aftertouch-min})
-                                   (when aftertouch-max {:aftertouch-max aftertouch-max}))])
+      (let [label (or (:label (first specs)) (:short-label (first specs)) "Level")
+            short-label (or (:short-label (first specs)) (:label (first specs)) "Level")]
+        (cue show-key (fn [var-map] (chan/function-effect effect-name function (params/bind-keyword-param
+                                                                                (:level var-map level) Number level)
+                                                          fixtures :htp? htp?))
+             :short-name short-name
+             :color color
+             :end-keys end-keys
+             :priority priority
+             :held held
+             :variables [(merge {:key "level" :min 0 :max 100 :start level :name label :short-name short-label}
+                                (when aftertouch {:aftertouch aftertouch})
+                                (when aftertouch-min {:aftertouch-max aftertouch-min})
+                                (when aftertouch-max {:aftertouch-max aftertouch-max}))]))
       ;; It's a fixed function, no variable required
       (cue show-key (fn [_] (chan/function-effect effect-name function (params/bind-keyword-param level Number 0)
                                                   fixtures :htp? htp?))


Fix failing test (#425)

Fix failing test (#425)

--- exercises/concept/log-levels/test/log_levels_test.clj
+++ exercises/concept/log-levels/test/log_levels_test.clj
@@ -11,7 +11,7 @@
 (deftest message-info-test
   (is (= (log-levels/message "[INFO]: File moved") "File moved")))

-(deftest message-trim whitespace-test
+(deftest message-trim-whitespace-test
   (is (= "Timezone not set" (log-levels/message "[WARNING]:   \tTimezone not set  \r\n"))))

 (deftest log-level-error-test


Getting rid of scratch and minimal.

Getting rid of scratch and minimal.

--- src/brevis/scratch/minimal.clj
+++ src/brevis/scratch/minimal.clj
@@ -1,155 +0,0 @@
-(ns brevis.scratch.minimal
-  (:require [penumbra.app :as app]
-            [clojure.math.numeric-tower :as math]
-            [penumbra.text :as text]
-            [penumbra.data :as data]
-            [penumbra.opengl.frame-buffer :as fb]
-            [penumbra.opengl.effects :as glfx])
-  (:use [brevis.graphics.basic-3D]
-        [brevis.physics collision core space utils]
-        [brevis.shape box sphere cone]
-        [brevis osd vector globals input utils]
-        [brevis.core]))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; ## Swarm
-;;
-;; ![](img/brevis_example_swarm.png?raw=true)
-;;
-;; Swarm simulations are models of flocking behavior in collections of organisms.
-;;
-;; These algorithms were first explored computationally in:
-;;
-;;   Reynolds, Craig W. "Flocks, herds and schools: A distributed behavioral model." ACM SIGGRAPH Computer Graphics. Vol. 21. No. 4. ACM, 1987.
-;;
-;; Todo:
-;; - auto-centering of camera (and skybox?)
-;;
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; ## Globals
-
-(def num-birds 500)
-
-(def avoidance-distance (atom 10))
-
-(def speed 25)
-(def max-acceleration 100)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; ## Birds
-
-(defn bird?
-  "Is a thing a bird?"
-  [thing]
-  (= (get-type thing) "bird"))
-
-(defn random-bird-position
-  "Returns a random valid bird position."
-  []
-  (let [w num-birds
-        h w]
-    (vec3 (- (rand w) (/ w 2))
-          (+ 59.5 (rand 10));; having this bigger than the neighbor radius will help with speed due to neighborhood computation
-          (- (rand h) (/ h 2)))))
-
-(defn make-bird
-  "Make a new bird with the specified program. At the specified location."
-  [position]
-  (move (make-real {:type :bird
-                    :color (vec4 1 0 0 1)
-                    :shape (create-cone 2.2 1.5)})
-        position))
-
-(defn random-bird
-  "Make a new random bird."
-  []
-  (make-bird (random-bird-position)))
-
-(defn bound-acceleration
-  "Keeps the acceleration within a reasonable range."
-  [v]
-  (if (> (length v) max-acceleration)
-    (mul (div v (length v)) max-acceleration)
-    v))
-
-(defn fly
-  "Change the acceleration of a bird."
-  [bird dt nbrs]
-  (let [nbrs (filter bird? (get-neighbor-objects bird))
-        ;tmp (println (count nbrs))
-        ;tmp (do (doseq [nbr nbrs] (print (get-position nbr))) (println))
-        closest-bird (when-not (empty? nbrs)
-                       (first nbrs)
-                       #_(rand-nth nbrs))
-        new-acceleration (if-not closest-bird
-                           ;; No neighbor, move randomly
-                           (elmul (vec3 (- (rand) 0.5) (- (rand) 0.5) (- (rand) 0.5))
-                                  (mul (get-position bird) -1.0))
-                           (let [dvec (sub (get-position bird) (get-position closest-bird))
-                                 len (length dvec)]
-                             (add (sub (get-velocity closest-bird) (get-velocity bird)); velocity matching
-                                  (if (<= len @avoidance-distance)
-                                    ;; If far from neighbor, get closer
-                                    dvec
-                                    ;; If too close to neighbor, move away
-                                    (add (mul dvec -1.0)
-                                         (vec3 (rand 0.1) (rand 0.1) (rand 0.1)))))));; add a small random delta so we don't get into a loop
-        new-acceleration (if (zero? (length new-acceleration))
-                           new-acceleration
-                           (mul new-acceleration (/ 1 (length new-acceleration))))]
-    (set-acceleration
-      (if (> (length (get-position bird)) 500)
-        (move bird (vec3 0 25 0))
-        bird)
-      (add (mul (get-acceleration bird) 0.5)
-           (mul new-acceleration speed)))))
-
-(enable-kinematics-update :bird); This tells the simulator to move our objects
-(add-update-handler :bird fly); This tells the simulator how to update these objects
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; ## Collision handling
-;;
-;; Collision functions take [collider collidee] and return [collider collidee]
-;;   Both can be modified; however, two independent collisions are actually computed [a b] and [b a].
-
-(defn bump
-  "Collision between two birds. This is called on [bird1 bird2] and [bird2 bird1] independently
-so we only modify bird1."
-  [bird1 bird2]
-  [(set-color bird1 (vec4 (rand) (rand) (rand) 1))
-   bird2])
-
-(defn land
-  "Collision between a bird and the floor."
-  [bird floor]
-  [(set-velocity (set-acceleration bird (vec3 0 10.5 0)) (vec3 0 0 0));; maybe move as well
-   floor])
-
-(add-collision-handler :bird :bird bump)
-(add-collision-handler :bird :floor land)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; ## brevis control code
-
-(defn initialize-simulation
-  "This is the function where you add everything to the world."
-  []
-  (init-world)
-  (init-view)
-  (set-dt 0.1)
-  (set-neighborhood-radius 1000)
-  (default-display-text)
-  (add-object (make-floor 500 500))
-  (dotimes [_ num-birds]
-    (add-object (random-bird))))
-
-;; Start zee macheen
-(defn -main [& args]
-  (start-gui initialize-simulation))
-
-;; For autostart with Counterclockwise in Eclipse
-(when (find-ns 'ccw.complete)
-  (-main))
-;(-main :nogui)


Make manga-url-suffix-pattern fail correctly when not set

--- src/clj/comic_reader/sites.clj
+++ src/clj/comic_reader/sites.clj
@@ -58,7 +58,8 @@
   "A regular expression to match the comic-id portion of a comics
   chapter list URL."
   []
-  (str (:manga-url-suffix-pattern options)))
+  (when-let [suffix-pattern (:manga-url-suffix-pattern options)]
+    (str suffix-pattern)))

 (defn comic->url-format
   "A format string that when used to format the manga URL and a comic


rework Accelerated Beta Test to use recursive installs

--- src/clj/game/cards-agendas.clj
+++ src/clj/game/cards-agendas.clj
@@ -2,13 +2,21 @@

 (def cards-agendas
   {"Accelerated Beta Test"
-   {:optional {:prompt "Look at the top 3 cards of R&D?"
-               :yes-ability {:msg (msg (let [c (count (filter #(= (:type %) "ICE") (take 3 (:deck corp))))]
-                                         (str "install " c " ICE and trash " (- 3 c) " cards")))
-                             :effect (req (doseq [c (take 3 (:deck corp))]
-                                           (if (= (:type c) "ICE")
-                                             (corp-install state side c nil {:no-install-cost true :install-state :rezzed})
-                                             (trash state side c))))}}}
+   (let [abthelper (fn abt [n i] {:prompt "Select a piece of ICE to install"
+                                  :choices {:req #(and (:side % "Corp") (= (:type %) "ICE") (= (:zone %) [:play-area]))}
+                                  :effect (req (corp-install state side target nil {:no-install-cost true :install-state :rezzed})
+                                                 (when (< n i)
+                                                   (resolve-ability state side (abt (inc n) i) card nil)))})]
+     {:optional {:prompt "Look at the top 3 cards of R&D?"
+                 :yes-ability {:effect (req (let [numice (count (filter #(= (:type %) "ICE") (take 3 (:deck corp))))]
+                                         (resolve-ability state side
+                                           {:msg (msg "install " numice " ICE and trash " (- 3 numice) " cards")
+                                            :effect (req (doseq [c (take 3 (:deck corp))]
+                                                           (if (= (:type c) "ICE")
+                                                             (move state side c :play-area)
+                                                             (trash state side c)))
+                                                         (resolve-ability state side (abthelper 1 numice) card nil))}
+                                          card nil)))}}})

    "Ancestral Imager"
    {:events {:jack-out {:msg "do 1 net damage" :effect (effect (damage :net 1))}}}


small fix for Improved Tracers

small fix for Improved Tracers

--- src/clj/game/cards-agendas.clj
+++ src/clj/game/cards-agendas.clj
@@ -189,7 +189,8 @@
                  :effect (effect (damage :net 1 {:card card}))}]}

    "Improved Tracers"
-   {:events {:pre-ice-strength {:req (req (has? target :subtype "Tracer"))
+   {:effect (req (update-all-ice state side))
+    :events {:pre-ice-strength {:req (req (has? target :subtype "Tracer"))
                                 :effect (effect (ice-strength-bonus 1))}}}

    "Labyrinthine Servers"


correct transaction links in accounts/show

--- src/clj_money/web/accounts.clj
+++ src/clj_money/web/accounts.clj
@@ -143,12 +143,13 @@
       "Add"])))

 (defn- transaction-item-row
-  [{:keys [transaction
-           description
+  [{:keys [description
            polarized-quantity
            reconciled?
            account-id
-           balance] :as item}]
+           balance]
+    {:keys [id transaction-date] :as transaction} :transaction
+    :as item}]
   [:tr
    [:td.text-right (:transaction-date transaction)]
    [:td (:description transaction)]
@@ -161,14 +162,14 @@
     [:span.btn-group
      (when (allowed? :update transaction)
        (glyph-button :pencil
-                     (-> (path "/transactions" (:id transaction) "edit")
+                     (-> (path "/transactions" transaction-date id "edit")
                          (query {:redirect (url-encode (format "/accounts/%s" account-id))})
                          format-url)
                      {:level :info
                       :size :extra-small
                       :title "Click here to edit this transaction."}))
      (glyph-button :paperclip
-                   (-> (path "/transactions" (:id transaction) "attachments")
+                   (-> (path "/transactions" id "attachments")
                        (query {:redirect (url-encode (format "/accounts/%s" account-id))})
                        format-url)
                    {:level :default
@@ -177,7 +178,7 @@
      (when (allowed? :delete transaction)
        (let [can-delete? (transactions/can-delete? transaction)]
          (glyph-button :remove
-                       (-> (path "/transactions" (:id transaction) "delete")
+                       (-> (path "/transactions" transaction-date id "delete")
                            (query {:redirect (url-encode (format "/accounts/%s" account-id))})
                            format-url)
                        {:level :danger


Correct condition for enabling syntax highlighting after merging try-doc-listbox2 changes to latest master

--- src/clj_ns_browser/browser.clj
+++ src/clj_ns_browser/browser.clj
@@ -15,6 +15,7 @@
             [clojure.java.shell]
             [clojure.java.io]
             [clojure.pprint]
+            [clojure.set :as set]
             [clojure.string :as str]
             [clj-info.doc2map :as d2m]
             [clj-ns-browser.inspector]
@@ -997,12 +998,15 @@
     ;;
     ;; turn syntax-highlighting on/off - only on for Source
     (b/bind
-      (b/selection (id :doc-cbx))
+      (b/selection (id :doc-lb) {:multi? true})
       (b/transform (fn [o]
         (when (= (.getName (type (id :doc-ta))) "org.fife.ui.rsyntaxtextarea.RSyntaxTextArea")
-          (if (or (= "Source" o) (= "Examples" o) (= "Meta" o))
-            (config! (id :doc-ta) :syntax :clojure)
-            (config! (id :doc-ta) :syntax :none))))))
+          (let [selected-set (set o)]
+            (if (= selected-set
+                   (set/intersection selected-set
+                                     #{"Source" "Examples" "Meta"}))
+              (config! (id :doc-ta) :syntax :clojure)
+              (config! (id :doc-ta) :syntax :none)))))))
     ;;
     ;; bring up browser with url
     (b/bind


Test new token.

Test new token.

--- src/cljs/beatha/automaton.cljs
+++ src/cljs/beatha/automaton.cljs
@@ -203,7 +203,8 @@
                         :corp-3 :worker-3 :corp-4 :worker-4}
         worker? #((into #{:worker} (vals company-worker)) %)
         company-of-worker (fn [s] (or ((set/map-invert company-worker) s) s))
-        worker-of-company (fn [s] (or (company-worker s) s))]
+        worker-of-company (fn [s] (or (company-worker s) s))
+        test 1]
     (reify
       AutomatonSpecification
       (default-cell [_] {:state :worker})


Fixes bug in add-key-value-pair.

Fixes bug in add-key-value-pair.

add-key-value turned out to have a major bug: The current node
would become stale (point to a node in the old game rather than the
new). Also adds support for pre-comments for all game nodes.

--- src/clojure/clj_chess/game.clj
+++ src/clojure/clj_chess/game.clj
@@ -66,6 +66,22 @@
   [game]
   (-> game :current-node :board))

+(defn find-node-matching
+  "Finds the first (as found by a depth-first search) game tree node
+  matching the given predicate. If no such node is found, returns nil."
+  [game predicate & [start-node]]
+  (let [start-node (or start-node (game :root-node))]
+    (if (predicate start-node)
+      start-node
+      (first (filter identity
+                     (map #(find-node-matching game predicate %)
+                          (start-node :children)))))))
+
+(defn find-node
+  "Returns the node with the given node id, or nil if no such node exists."
+  [game node-id]
+  (find-node-matching game #(= node-id (% :node-id))))
+
 (defn- game-zip
   "Creates a zipper for traversing a game. By default, the zipper
   is initialized to the root node of the game tree. The optional
@@ -144,8 +160,9 @@
   node id is supplied, the key value pair is added at the current node."
   [game key value & [node-id]]
   (let [z (-> (game-zip game (or node-id (-> game :current-node :node-id)))
-              (zip-add-key-value-pair key value))]
-    (assoc game :root-node (zip/root z))))
+              (zip-add-key-value-pair key value))
+        g (assoc game :root-node (zip/root z))]
+    (assoc g :current-node (find-node g (-> g :current-node :node-id)))))

 (defn add-comment
@@ -166,17 +183,6 @@
   [game cmt & [node-id]]
   (add-key-value-pair game :pre-comment cmt node-id))

-
-(defn find-node-matching
-  "Finds the first (as found by a depth-first search) game tree node
-  matching the given predicate. If no such node is found, returns nil."
-  [game predicate & [start-node]]
-  (let [start-node (or start-node (game :root-node))]
-    (if (predicate start-node)
-      start-node
-      (first (filter identity
-                     (map #(find-node-matching game predicate %)
-                          (start-node :children)))))))

 (defn goto-node-matching
@@ -300,6 +306,10 @@
               (str
                 (when children
                   (str
+                    ;; Pre-comment for first child move:
+                    (when include-comments?
+                      (when-let [c ((first children) :pre-comment)]
+                        (str "{" c "} ")))
                     ;; SAN of first child move (main variation):
                     (let [m (-> (first children) :board board/last-move)
                           wtm (= :white (board/side-to-move board))]
@@ -335,11 +345,7 @@
                                   (rest children))))
                     ;; Game continuation after first child move:
                     (node-to-string (first children)))))))]
-    (str
-      (when include-comments?
-        (when-let [c (-> game :root-node :pre-comment)]
-          (str "{" c "}")))
-      (node-to-string (game :root-node)))))
+    (node-to-string (game :root-node))))

 (defn to-pgn


Hecks yez, TLS for SMTP lives.

Hecks yez, TLS for SMTP lives.

--- src/clojure/neveragain/tls.clj
+++ src/clojure/neveragain/tls.clj
@@ -6,24 +6,25 @@
     (less.awful [ssl :as las]))
   (:import (javax.net.ssl SSLSocketFactory)))

-(def verb-handler-map {
-	"STARTTLS" (fn [msg conn envl]
-		(let [sock (.createSocket (.getSocketFactory (las/ssl-context
-                                     (:key settings/keyfiles)
-                                     (:cert settings/keyfiles)
-                                     (:ca settings/keyfiles)))
-                   (:socket conn)
-                   (.getHostAddress (.getInetAddress (:socket conn)))
-                   (.getPort (:socket conn))
-                   true)]
-      (.setEnabledProtocols sock las/enabled-protocols)
-      (make-conn sock)))
-  })
+(defn handle-starttls [msg conn envl]
+  (write-out (:out conn) "220 Ready to start TLS")
+  (let [sock (.createSocket (.getSocketFactory (las/ssl-context
+                                   (:key settings/keyfiles)
+                                   (:cert settings/keyfiles)
+                                   (:ca settings/keyfiles)))
+                 (:socket conn)
+                 (.getHostName (.getRemoteSocketAddress (:socket conn)))
+                 (.getPort (:socket conn))
+                 true)]
+    (.setUseClientMode sock false)
+    (.setEnabledProtocols sock las/enabled-protocols)
+    (.startHandshake sock)
+    (make-conn sock)))

 (def extension-description {
 	:name "STARTTLS"
 	:advertise true
 	:install-handlers (fn [v-map]
-		(merge v-map verb-handler-map))
+		(merge v-map {"STARTTLS" handle-starttls}))
 	})


warn 99 expiration

warn 99 expiration

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


http-kit/clojure: Add two helper functions.

--- src/clojure/src/dnsresolvh.clj
+++ src/clojure/src/dnsresolvh.clj
@@ -53,6 +53,21 @@
 (defmacro DMN-COPYRIGHT-- [] "Copyright (C) 2017-2019"                )
 (defmacro DMN-AUTHOR      [] "Radislav Golubtsov <ragolubtsov@my.com>")

-; TODO: Implement further helper stuff.
+(defn cleanups-fixate
+    "Helper function. Makes final buffer cleanups, closes streams, etc."
+    [log]
+
+    ; Closing the system logger.
+    ; TODO: Implement closing the system logger.
+)
+
+(defn separator-draw
+    "Helper function. Draws a horizontal separator banner."
+    [banner-text]
+
+    (let [i (count banner-text)]
+
+    (print (apply str (for [_ (range 0 i)] "=")))) (newline)
+)

 ; vim:set nu et ts=4 sw=4:


WIP: remove redirection from ssclj to Java

--- ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/app/server.clj
+++ ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/app/server.clj
@@ -62,7 +62,7 @@

       wrap-cookies

-      (wrap-proxy-redirect ["/api" "/auth"] "http://localhost:8080")
+     ;; (wrap-proxy-redirect ["/api" "/auth"] "http://localhost:8080")

       wrap-logger)


some more degree analysis

some more degree analysis

--- src/clj/ceres/analyzer.clj
+++ src/clj/ceres/analyzer.clj
@@ -30,7 +30,7 @@
 (defn short-metrics [coll]
   {:mean (mean coll)
    :std (Math/sqrt (variance coll))
-   :quantiles (quantile coll)})
+   :quantiles (quantile coll :probs [0.0 0.001 0.25 0.5 0.75 0.999 1.0])})

 (defn find-reactions [pid]


add test for tmi

add test for tmi

--- src/clj/test/cards-ice.clj
+++ src/clj/test/cards-ice.clj
@@ -31,4 +31,31 @@
       (core/trash state :corp (get-in @state [:corp :hand 0]))
       (is (= (get-in @state [:corp :discard 0 :title]) "Architect"))
       (is (= (get-in @state [:corp :discard 1 :title]) "Architect"))
+      )))
+
+(deftest tmi
+  "TMI ICE test"
+  (do-game
+    (new-game (default-corp [(qty "TMI" 3)])
+              (default-runner))
+    (play-from-hand state :corp "TMI" "HQ")
+    (let [tmi (get-in @state [:corp :servers :hq :ices 0])]
+      (core/rez state :corp tmi)
+      (prompt-choice :corp 0)
+      (prompt-choice :runner 0)
+      (is (get-in (refresh tmi) [:rezzed]))
+      )))
+
+
+(deftest tmi-derez
+  "TMI ICE trace derez"
+  (do-game
+    (new-game (default-corp [(qty "TMI" 3)])
+              (make-deck "Sunny Lebeau: Security Specialist" [(qty "Blackmail" 3)]))
+    (play-from-hand state :corp "TMI" "HQ")
+    (let [tmi (get-in @state [:corp :servers :hq :ices 0])]
+      (core/rez state :corp tmi)
+      (prompt-choice :corp 0)
+      (prompt-choice :runner 0)
+      (is (not (get-in (refresh tmi) [:rezzed])))
       )))


New function: send-message

New function: send-message

--- src/clj_mrazik/irc_bot.clj
+++ src/clj_mrazik/irc_bot.clj
@@ -53,9 +53,15 @@
            host    :host
            command :command} incoming-message]
            (println "Received message from" nick "to" target ":" text "(" host command ")")
+           (println incoming-message)
            (if (message-for-me? @bot-nick incoming-message)
                (irc/reply connection (create-reply incoming-message)
                                      (prepare-reply-text incoming-message nick text)))))
+
+(defn send-message
+    [recipients target message-text]
+    (let [message {:target target :command "PRIVMSG"}]
+        (irc/reply @connection message (str recipients " " message-text))))

 (defn start-irc-bot
     [configuration]


Add line breaks to make it more presentation like

--- src/clj_tutorials/core.clj
+++ src/clj_tutorials/core.clj
@@ -5,7 +5,78 @@

+
+
+
+
+
+
 ;;; Load testing using core.async (@mhjort) ;;;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(def ping-scenario
+  {:name "Ping scenario"
+   :requests [{:name "Ping endpoint" :http "http://localhost:8080/ping"}]})
+
+(def options
+  {:requests 200 :timeout-in-ms 90})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

@@ -18,6 +89,42 @@
     (doseq [c cs]
       (go (>! c (step))))))

+;; "go transforms your sequential code into a state machine
+;;  way more complicated than you could ever write yourself."
+;;
+;;  -- LispCast
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

 ;STEP 2
@@ -26,6 +133,35 @@
     (doseq [c cs]
       (go (>! c (step))))
     (repeatedly concurrency #(first (alts!! cs)))))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

 ;STEP 3
@@ -42,6 +178,26 @@

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 ;STEP 4
 (defn http-get [url]
   (fn []
@@ -52,6 +208,28 @@
     (doseq [c cs]
       (go (>! c (bench (http-get url)))))
     (repeatedly concurrency #(first (alts!! cs)))))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

@@ -71,6 +249,25 @@
     (doseq [c cs]
       (go (async-http-get url c)))
     (repeatedly concurrency #(first (alts!! cs)))))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

 ; (STEP 6 "With timeout")
@@ -93,6 +290,30 @@
     (repeatedly concurrency #(first (alts!! cs)))))

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 ; (STEP 7 "Constantly")

 (defn run-constantly [concurrency number-of-requests timeout url]
@@ -102,8 +323,21 @@
         (async-http-get-with-timeout url timeout c))
     (go-loop [i 0]
       (let [[result c] (alts! cs)]
-        (chan-http-get-with-timeout url timeout c)
+        (async-http-get-with-timeout url timeout c)
         (>! results result)
         (when (<= i number-of-requests)
           (recur (inc i)))))
     (repeatedly number-of-requests #(<!! results))))
+
+
+
+
+
+
+
+
+
+
+
+
+


make it thinner

make it thinner

--- src/cljs/cezanne/core.cljs
+++ src/cljs/cezanne/core.cljs
@@ -14,7 +14,7 @@
                     0.1
                     1000)
         renderer (js/THREE.WebGLRenderer.)
-        geometry (js/THREE.CubeGeometry. 2 2 2)
+        geometry (js/THREE.CubeGeometry. 2 2 1e-2)
         material (js/THREE.MeshNormalMaterial. )
         cube (js/THREE.Mesh. geometry material)
         cube-2 (js/THREE.Mesh. geometry material)


Avoid nested go blocks

Avoid nested go blocks

--- src/cljs/ji/websocket.cljs
+++ src/cljs/ji/websocket.cljs
@@ -11,33 +11,32 @@
   :in   Channel to write values to socket on
   :out  Channel to recieve socket data on"
   ([uri] (connect! uri {}))
-  ([uri {:keys [in out]
-         :or {in chan out chan}}]
+  ([uri {:keys [in out] :or {in chan out chan}}]
    (let [on-connect (chan)]
-     (go
-       (let [in (in)
-             out (out)
-             ws (js/WebSocket. uri)]
-         (doto ws
-           (aset "onopen"
-                 (fn []
-                   (close! on-connect)
-                   (go (loop []
-                         (let [data (<! in)]
-                           (if-not (nil? data)
-                             (do (.send ws (pr-str data))
-                                 (recur))
-                             (do (close! out)
-                                 (.close ws))))))))
-           (aset "onmessage"
-                 (fn [m]
-                   (when-let [data (read-string (.-data m))]
-                     (put! out data))))
-           (aset "onclose"
-                 (fn []
-                   (close! in)
-                   (close! out))))
+     (let [in (in)
+           out (out)
+           ws (js/WebSocket. uri)]
+       (doto ws
+         (aset "onopen"
+               (fn []
+                 (close! on-connect)
+                 (go (loop []
+                       (let [data (<! in)]
+                         (if-not (nil? data)
+                           (do (.send ws (pr-str data))
+                               (recur))
+                           (do (close! out)
+                               (.close ws))))))))
+         (aset "onmessage"
+               (fn [m]
+                 (when-let [data (read-string (.-data m))]
+                   (put! out data))))
+         (aset "onclose"
+               (fn []
+                 (close! in)
+                 (close! out))))

+       (go
          (<! on-connect)
          ;; swap in/out for more intuitive naming for receiver
          {:uri uri :ws ws :out in :in out})))))


Include base-type in :bases map

Include base-type in :bases map

--- src/cljs/zetawar/data.cljs
+++ src/cljs/zetawar/data.cljs
@@ -733,7 +733,7 @@
       :terrain-type :deep-water}
      {:q 1
       :r 4
-      :terrain-type :seaport #_:mountains
+      :terrain-type :mountains
       }
      {:q 2
       :r 4
@@ -854,7 +854,7 @@
       :terrain-type :deep-water}
      {:q 5
       :r 8
-      :terrain-type :seaport #_:mountains}
+      :terrain-type :mountains}
      {:q 6
       :r 8
       :terrain-type :plains}
@@ -1532,10 +1532,12 @@
     :max-count-per-unit 10
     :credits-per-base 100
     :bases
-    [{:q 1 :r 2}
-     {:q 2 :r 1}
-     {:q 5 :r 7}
-     {:q 7 :r 6}]
+    [{:q 1 :r 2 :base-type :base}
+     {:q 1 :r 4 :base-type :seaport}
+     {:q 2 :r 1 :base-type :base}
+     {:q 5 :r 7 :base-type :base}
+     {:q 5 :r 8 :base-type :seaport}
+     {:q 7 :r 6 :base-type :base}]
     :factions
     [{:color :blue
       :credits 300


Add heavy tank data

Add heavy tank data

--- src/cljs/zetawar/data.cljs
+++ src/cljs/zetawar/data.cljs
@@ -351,7 +351,32 @@
             {:personnel 10
              :armored   10}
             :zoc
-            [:personnel :armored]}}}})
+            [:personnel :armored]}
+     :heavytank {:description "Heavy Tank"
+                 :cost 500
+                 :movement 12
+                 :can-capture false
+                 :can-repair #{}
+                 :min-range 1
+                 :max-range 1
+                 :armor-type :armored
+                 :armor 15
+                 :repair 1
+                 :state-map :move-attack
+                 :image "tilesets/elite-command/units/heavytank-COLOR.png"
+                 :terrain-effects
+                 {:plains {:movement-cost 4 :armor-bonus  0 :attack-bonus 0}
+                  :woods  {:movement-cost 6 :armor-bonus -3 :attack-bonus 0}
+                  :desert {:movement-cost 5 :armor-bonus  0 :attack-bonus 0}
+                  :tundra {:movement-cost 7 :armor-bonus  0 :attack-bonus 0}
+                  :swamp  {:movement-cost 8 :armor-bonus -4 :attack-bonus 0}
+                  :ford   {:movement-cost 8 :armor-bonus -2 :attack-bonus 0}
+                  :base   {:movement-cost 3 :armor-bonus -2 :attack-bonus 0}}
+                 :attack-strengths
+                 {:personnel 15
+                  :armored   12}
+                 :zoc
+                 [:personnel :armored]}}}})

 ;; TODO: remove redundant id keys (?)
 (def maps


fix syntax def retriever to use string names

--- src/cljs_api_gen/parse.clj
+++ src/cljs_api_gen/parse.clj
@@ -459,7 +459,7 @@
        :syntax-form (str "#" name-)
        :type "tagged literal"
        :source (:source map-form)
-       :extra-sources [(:source (get defs func-name))]})))
+       :extra-sources [(:source (get defs (str func-name)))]})))

 ;;--------------------------------------------------------------------------------
 ;; Parse syntax readers
@@ -495,7 +495,7 @@
                        :extra-sources (if (and (list? func)
                                                (= 'wrapping-reader (first func)))
                                         [(:source wrapping-reader)]
-                                        (when-let [f (get items func)]
+                                        (when-let [f (get items (str func))]
                                           [(:source f)])))))))
             make-single
             (fn [info func]


parse-all instead of parse-string for co.nclk.linen.data

--- src/co/nclk/linen/data.clj
+++ src/co/nclk/linen/data.clj
@@ -14,7 +14,7 @@
             (clojure.string/replace
               s #"~" (str (System/getProperty "user.home")))
             s)]
-    (-> s slurp yaml/parse-string)))
+    (-> s slurp yaml/parse-all)))

 (defrecord FileDataConnector []


Make the test pass

Make the test pass

--- src/desdemona/ui/core.cljs
+++ src/desdemona/ui/core.cljs
@@ -3,3 +3,5 @@
 (defn -main
   []
   (.log js/console "Hello, Desdemona!"))
+
+(def add +)


fixed issue #27 - highlight track bug

fixed issue #27 - highlight track bug

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -113,21 +113,26 @@
 (om/root current-track-tags-view core/app-state {:target (. js/document (getElementById "current-track-tags"))})

 (defn track-view [data owner]
+  (defn update-state []
+    (let [state (om/get-state owner)
+          playing? (:playing? state)
+          track-id (.-id data)
+          current-track-id (:current-track-id @core/app-state)]
+      (if (= track-id current-track-id)
+        (if-not playing?
+          (om/set-state! owner (merge state {:playing? true})))
+        (if playing?
+          (om/set-state! owner (merge state {:playing? false}))))))
   (reify
     om/IInitState
     (init-state [_]
       {:playing? false})
     om/IWillReceiveProps
     (will-receive-props [_ _]
-      (let [state (om/get-state owner)
-            playing? (:playing? state)
-            track-id (.-id data)
-            current-track-id (:current-track-id @core/app-state)]
-        (if (= track-id current-track-id)
-          (if-not playing?
-            (om/set-state! owner (merge state {:playing? true})))
-          (if playing?
-            (om/set-state! owner (merge state {:playing? false}))))))
+      (update-state))
+    om/IDidUpdate
+    (did-update [_ _ _]
+      (update-state))
     om/IRenderState
     (render-state [_ state]
       (let [tags (.-tags data)


CMR-6346: Renamed variable based on review comment.

--- access-control-app/src/cmr/access_control/data/acl_json_results_handler.clj
+++ access-control-app/src/cmr/access_control/data/acl_json_results_handler.clj
@@ -64,13 +64,13 @@

 (defmethod elastic-results/elastic-result->query-result-item [:acl :json]
   [context query elastic-result]
-  (let [item (:_source elastic-result)
-        item (if-let [acl-gzip (:acl-gzip-b64 item)]
-               (-> item
+  (let [result-source (:_source elastic-result)
+        item (if-let [acl-gzip (:acl-gzip-b64 result-source)]
+               (-> result-source
                    (assoc :acl (edn/read-string (util/gzip-base64->string acl-gzip)))
                    (dissoc :acl-gzip-b64)
                    (apply-legacy-group-guid-feature context query))
-               item)]
+               result-source)]
     (-> item
         (set/rename-keys {:display-name :name})
         (assoc :location (str (reference-root context) (:concept-id item)))