Do not wait activity handler.

Do not wait activity handler.

--- src/planviz/actions.cljs
+++ src/planviz/actions.cljs
@@ -1314,27 +1314,17 @@
       (my-user-action {:type :menu :tag tag :info info})))
   (menu-click-handled e))

-(defn cancel-activity-or-htn-node
+(defn cancel-activity
   "option is m. See add-url-options method
   e is event object"
   [node edge option e]
-  ;(println "cancel-activity-or-htn-node")
-  ;(println "node")
-  ;(pprint node)
-  ;(println "edge")
-  ;(pprint edge)
-  ;(println "option")
-  ;(pprint option)
-  ;(println "e")
-  ;(pprint e)
-  (when node
-    (println "Impl cancel for htn node"))
   (when edge
-    ;(println "Cancel activity" (select-keys edge #{:edge/id}))
-    ;(println "network-id" (:plan/plid edge))
-    ;(println "edge-id" (:edge/id edge))
-
     (rmethod {} :cancel-activity {:plid (:plan/plid edge) :uid (:edge/id edge)}))
+  (menu-click-handled e))
+
+(defn do-not-wait-activity [node edge option e]
+  (when edge
+    (rmethod {} :do-not-wait-activity {:plid (:plan/plid edge) :uid (:edge/id edge)}))
   (menu-click-handled e))

 ;; https://developer.mozilla.org/en-US/docs/Web/API/Window/open#Position_and_size_features
@@ -2192,11 +2182,12 @@
     (loop [options options a (first url-config) more (rest url-config)]
       (if-not a
         (conj options
-              (if node-id
-                {:tag :info :text (str "✋ Cancel activities for node. Not yet impl " node-id)
-                 :fn  cancel-activity-or-htn-node}
-                {:tag :info :text (str "✋ Cancel this activity " edge-id)
-                 :fn  cancel-activity-or-htn-node})
+              (if edge-id
+                {:tag :info :text (str "✋ Do not wait! " edge-id)
+                 :fn  do-not-wait-activity})
+              (if edge-id
+                {:tag :info :text (str "✋ Cancel activity! " edge-id)
+                 :fn  cancel-activity})
               (if node-id
                 {:tag :info :text (str "✋ node information for " node-id)
                  :fn  info-menu-fn}


remove unnecessary comments

remove unnecessary comments

--- src/subrosa/commands.clj
+++ src/subrosa/commands.clj
@@ -181,11 +181,6 @@
             :msg ":No origin specified"})))

-;;; Whois send these three commands:
-;;;:holmes.freenode.net 311 dakrone dakrone ~dakrone rrcs-10-10-10-10.midsouth.biz.rr.com * :dakrone
-;;;:holmes.freenode.net 319 dakrone dakrone :#sonian-devops #sonian-safe #sonian #clojure
-;;;:holmes.freenode.net 318 dakrone dakrone :End of /WHOIS list.
-x
 (defcommand whois [channel username]
   (if (not (empty? username))
     (when-let [user (user-for-nick username)]


Clarify `lua-script` docstring

Clarify `lua-script` docstring

--- src/taoensso/carmine.clj
+++ src/taoensso/carmine.clj
@@ -192,7 +192,10 @@

 (defn lua-script
   "All singing, all dancing Lua script helper. Like `eval*` but allows script
-  to use \"_:my-var\"-style named keys and args."
+  to use \"_:my-var\"-style named keys and args.
+
+  Keys are given separately from other args as an implementation detail for
+  clustering purposes."
   [script key-vars-map arg-vars-map]
   (let [{:keys [script eval-args]}
         (interpolate-script script key-vars-map arg-vars-map)]


Adjust function name to clarify purpose

Adjust function name to clarify purpose

Change-Id: Ieba67fa8a045be69985142a5bf03f8022c6a17e9

--- src/qcast/infoq/site.clj
+++ src/qcast/infoq/site.clj
@@ -29,20 +29,22 @@

 ;;; Internals

-(defn- url-prefix-protocol [url]
-  (if (.startsWith url "//") (clojure.string/join ["http:" url]) url))
+(defn- ensure-url-schema [url]
+  (if (.startsWith url "//")
+    (str "https:" url)
+    url))

 (defn- HEAD [url & [opts]]
   (debug :head url opts)
-  (http/head (url-prefix-protocol url) (merge http-options {:follow-redirects false} opts)))
+  (http/head (ensure-url-schema url) (merge http-options {:follow-redirects false} opts)))

 (defn- GET [url & [opts]]
   (debug :get url opts)
-  (http/get (url-prefix-protocol url) (merge http-options opts)))
+  (http/get (ensure-url-schema url) (merge http-options opts)))

 (defn- POST [url & [opts]]
   (debug :post url opts)
-  (http/post (url-prefix-protocol url) (merge http-options opts)))
+  (http/post (ensure-url-schema url) (merge http-options opts)))

 (defn- overview-ids [dom]
   (html/select-all [:.itemtitle :> :a] #(html/attr :href %) dom))


Prefer inc/dec to +1, -1

Prefer inc/dec to +1, -1

--- src/tile_game/board.cljc
+++ src/tile_game/board.cljc
@@ -82,7 +82,7 @@
       (recur (apply assoc dmap costs)
              next
              (set/union seen coords)
-             (+ cost 1)))))
+             (inc cost)))))

 (defn distance-map [board goal avoid]
   (dijkstra-map (vec (repeat (count board) (count board)))
@@ -127,12 +127,12 @@
   (= (count board) (count (solved-tiles board))))

 (defn goal-coord [board tile]
-  (index->coords board (- (if (= tile 0)
-                            (count board)
-                            tile) 1)))
+  (index->coords board (dec (if (= tile 0)
+                              (count board)
+                              tile))))

 (defn last-on-row? [board [x y]]
-  (= x (- (dimension board) 1)))
+  (= x (dec (dimension board))))

 (defn move-sequence [board [tile goal solved] & more]
   (let [path (move-to board tile goal solved)]
@@ -148,11 +148,11 @@
       (if (last-on-row? board goal)
         (let [row-min (coords->tile board [0 y])]
           (move-sequence board
-                         [tile [x (+ y 1)] solved]
+                         [tile [x (inc y)] solved]
                          [0 [0 y] (conj (disj solved row-min) tile)]
                          [0 [x y] #{}]
                          [tile [x y] solved]
-                         [0 [(- x 1) y] #{tile}]
+                         [0 [(dec x) y] #{tile}]
                          [row-min [0 y] #{tile}]
                          ))
         (move-to board tile goal solved)))))
@@ -160,5 +160,5 @@
 (defn solve-next [board]
   (if (solved? board)
     []
-    (let [next (+ 1 (count (solved-tiles board)))]
+    (let [next (inc (count (solved-tiles board)))]
       (solve-tile board next))))


fix docstrings

fix docstrings

--- user.clj
+++ user.clj
@@ -7,12 +7,14 @@
 ; =======
 ; Utilities: general purpose fns to be used mostly inside other fns

-(defn sym-to-var [sym]
+(defn sym-to-var
   "Converts a symbol to var"
+  [sym]
   ((ns-interns ((meta (resolve sym)) :ns)) sym))

-(defn command-exists? [cmd]
+(defn command-exists?
   "Determines if command exists in $PATH"
+  [cmd]
   (some
     #(-> (str % "/" cmd) clojure.java.io/file .isFile)
     (-> (System/getenv "PATH") (clojure.string/split #":"))))


(SERVER-1183) Changed thread-last macro to inline function call

This commit changes a small snippet of code in the
`mark-environment-expired!` function to embed parameters in a single
form instead of using a thread-last macro.

--- src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
+++ src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
@@ -451,9 +451,8 @@
   all environment entries in the environment class info cache as expired."
   [context :- jruby-schemas/PoolContext
    environment-class-info-cache :- (schema/atom EnvironmentClassInfoCache)]
-  (->> invalidated-environment-class-info-entry
-       (partial ks/mapvals)
-       (swap! environment-class-info-cache))
+  (swap! environment-class-info-cache
+         (partial ks/mapvals invalidated-environment-class-info-entry))
   (doseq [jruby-instance (registered-instances context)]
     (-> jruby-instance
         :environment-registry


exclusions is needed because of app, yay

--- pedestal-app/project.clj
+++ pedestal-app/project.clj
@@ -4,9 +4,8 @@
                  [org.clojure/clojurescript "0.0-1847"]
                  [domina "1.0.1"]
                  [crate "0.2.1"]
-                 ;; TODO - remove
-                 [ch.qos.logback/logback-classic "1.0.7" :exclusions [org.slf4j/slf4j-api]]
-                 [io.pedestal/pedestal.app "0.2.0"]
+                 ;; exclusions necessary until app gets its logback act together
+                 [io.pedestal/pedestal.app "0.2.0" :exclusions [org.slf4j/slf4j-api]]
                  [io.pedestal/pedestal.app-tools "0.2.0"]]
   :profiles {:dev {:source-paths ["dev"]
                    :plugins [[com.cemerick/austin "0.1.0"]]}}


Add spacings

Add spacings

--- frontend/src/cruncher/utils/lib.cljs
+++ frontend/src/cruncher/utils/lib.cljs
@@ -114,6 +114,7 @@
    (om/transact! reconciler `[(user/logged-in {:status ~bool})]))
   ([] (logged-in! true)))

+
 ;;;; About views
 (defn current-view
   "Return current selected view."
@@ -136,6 +137,7 @@
    (om/transact! reconciler `[(app/loading {:status ~bool})]))
   ([] (loading! true)))

+
 ;;;; Error messages
 (defn error?
   "Return boolean if there is an error message."


one more nesting fix for blog article

one more nesting fix for blog article

--- src/pc/views/blog/diagramming_with_precursor.clj
+++ src/pc/views/blog/diagramming_with_precursor.clj
@@ -68,9 +68,8 @@
        "available as a read-only doc"]
       ". If you want to use it as a starting point, just select the parts you want, hit Cmd+c or Ctrl+c to copy, and Cmd+v or Ctrl+v to paste them into a new document."]]

-    [:h3 "Tools review"]
-
     [:article
+     [:h3 "Tools review"]
      [:p "Connect shapes with an arrow by holding \"A\" and clicking on the borders of shapes to connect them."]
      [:p "Copy and paste shapes by selecting them and hitting your system's copy/paste shortcut (Ctrl+c/Ctrl+v on Windows, Cmd+c/Cmd+v on mac)."]
      [:p "Hold \"Alt\" and scroll to zoom in. You can do more precise placement when zoomed."]


One more (aspect-field ?aspect ?field) -> (aspect ?aspect)(type-field ?aspect-field)

--- EkekoAspectJ/src/damp/ekeko/aspectj/assumptions.clj
+++ EkekoAspectJ/src/damp/ekeko/aspectj/assumptions.clj
@@ -107,7 +107,7 @@
   [?aspect ?entryadvice ?exitadvice]
   (l/fresh [?instvar]
     (aspect-advice ?aspect ?entryadvice)
-    (aspect-field ?aspect ?instvar)
+    (type-field ?aspect ?instvar)
     (advice-writesto ?entryadvice ?instvar) ;NOT IMPLEMENTED YET
     (aspect-advice ?aspect ?exitadvice)
     (advice-readsfrom ?exitadvice ?instvar)));NOT IMPLEMENTED YET
@@ -144,7 +144,8 @@
 (defn
   brokenwormhole-entry-exit-field
   [?aspect ?entryadvice ?exitadvice ?field]
-  (aspect-field ?aspect ?field)
+  (aspect ?aspect)
+  (type-field ?aspect ?field)
   (aspect-advice ?aspect ?entryadvice)
   (aspect-advice ?aspect ?exitadvice)
   (l/fresh [?icfg]


Add ordered collections library.

Add ordered collections library.

--- clstreams/project.clj
+++ clstreams/project.clj
@@ -18,7 +18,8 @@
                  [bidi "2.1.0"]
                  [clansi "1.0.0"]
                  [yada "1.2.6"]
-                 [com.rpl/specter "1.0.2"]]
+                 [com.rpl/specter "1.0.2"]
+                 [org.flatland/ordered "1.5.6"]]

   :main ^:skip-aot clstreams.core
   :target-path "target/%s"


* fixed a test bound to closely to a certain environment.

--- test/flambo/api_test.clj
+++ test/flambo/api_test.clj
@@ -141,7 +141,8 @@
         (-> (f/parallelize c [0 1 2 3 4 5 6 7 8 9])
             (f/sample false 0.1 2)
             f/collect
-            vec) => [6])
+            vec
+            count) => 1)

       (fact
         "combine-by-key returns an RDD by combining the elements for each key using a custom


Use monkey-robot.com:27017 as MongoDB test URL

Unlike whitman.monkey-robot.com, monkey-robot.com actually exists, so it
won't throw an error when trying to connect.

--- test/whitman/db_test.clj
+++ test/whitman/db_test.clj
@@ -7,9 +7,9 @@
     (is (= (db/db-url cfg) "mongodb://localhost:27017/test"))))

 (deftest test-db-url-when-specified
-  (let [cfg {"connection" "whitman.monkey-robot.com:27017"
+  (let [cfg {"connection" "monkey-robot.com:27017"
              "database" "test"}]
-    (is (= (db/db-url cfg) "mongodb://whitman.monkey-robot.com:27017/test"))))
+    (is (= (db/db-url cfg) "mongodb://monkey-robot.com:27017/test"))))

 (deftest test-db-with-default
   (let [cfg {"database" "test"}]
@@ -20,7 +20,7 @@
         is)))

 (deftest test-db-when-specified
-  (let [cfg {"connection" "whitman.monkey-robot.com:27017"
+  (let [cfg {"connection" "monkey-robot.com:27017"
              "database" "test"}]
     (-> cfg
         db/db


[CS] Rabbit messages on processing success/failure

--- src/vip/data_processor/pipeline.clj
+++ src/vip/data_processor/pipeline.clj
@@ -1,6 +1,7 @@
 (ns vip.data-processor.pipeline
   (:require [clojure.tools.logging :as log]
-            [clojure.stacktrace :as stacktrace]))
+            [clojure.stacktrace :as stacktrace]
+            [vip.data-processor.queue :as q]))

 (defn try-processing-fn
   "Attempt to run the processing function on the context. If the
@@ -47,8 +48,15 @@
         result (run-pipeline ctx)]
     (log/info result)
     (when-let [ex (:exception result)]
+      (q/publish {:initial-input initial-input
+                  :status :error
+                  :message (str ex)}
+                 "processing.error")
       (log/error (with-out-str (stacktrace/print-stack-trace ex)))
       (throw (ex-info "Exception during processing" {:exception ex
                                                      :initial-ctx ctx
                                                      :final-ctx result})))
+    (q/publish {:initial-input initial-input
+                :status :success}
+               "processing.complete")
     result))


Spec explain really works now

Spec explain really works now

--- src/spec_tools/core.cljc
+++ src/spec_tools/core.cljc
@@ -163,11 +163,16 @@
     x)
   (explain* [this path via in x]
     (let [problems (cond
+
                      (s/spec? spec)
-                     (s/explain* spec path via in (s/conform* this x))
+                     (let [conformed (s/conform* this x)
+                           val (if (= conformed +invalid+) x (s/unform spec conformed))]
+                       (s/explain* spec path via in val))

                      (s/regex? spec)
-                     (s/explain* (s/specize* spec) path via in (s/unform spec (s/conform* this x)))
+                     (let [conformed (s/conform* this x)
+                           val (if (= conformed +invalid+) x (s/unform spec conformed))]
+                       (s/explain* (s/specize* spec) path via in val))

                      :else
                      (when (= +invalid+ (if (and (fn? spec) (spec (s/conform* this x))) x +invalid+))


Add missing email on the license header on format ns.

--- src/suricatta/format.clj
+++ src/suricatta/format.clj
@@ -1,4 +1,4 @@
-;; Copyright (c) 2014, Andrey Antukh
+;; Copyright (c) 2014, Andrey Antukh <niwi@niwi.nz>
 ;; All rights reserved.
 ;;
 ;; Redistribution and use in source and binary forms, with or without


add hook

add hook

--- src/tamaki/hook/hook.clj
+++ src/tamaki/hook/hook.clj
@@ -1,5 +1,9 @@
 (ns tamaki.hook.hook
-    (:require [me.raynes.fs :as fs]))
+    (:require [me.raynes.fs :as fs]
+              [tamaki.page.page :as tpage]
+              [tamaki.post.post :as tpost]
+              )
+  )

 (defn clean [config]
   (fs/delete-dir (:build config)))
@@ -13,12 +17,22 @@
       (fs/copy entity (:build config)))))

 (defn do-compilation [config]
-
-  (println "current"))
+  (tpage/compile-pages (:page-dir config)
+                       (:site-prefix config)
+                       (:build config)
+                       (:renderers config))
+  (tpost/write-posts (:site-prefix config)
+                     (:post-root config)
+                     (:build config)
+                     (:posts config)
+                     (:renderers config)
+                     (:pagenate-url config)
+                     (:postnum-per-page config)
+                     (:pagenate-template config)))

 (def hooks
   (letfn [(cat [tail] (str "tamaki.hook.hook/" tail))]
    {:clean '((cat "clean"))
     :initialize '((cat "initialize"))
-    :initialize '((cat "process-resources"))
-    :initialize '((cat "do-compilation"))}))+    :process-resources '((cat "process-resources"))
+    :do-compilation '((cat "do-compilation"))}))


:consumed-capacity -> :cc-units

:consumed-capacity -> :cc-units

--- src/taoensso/faraday.clj
+++ src/taoensso/faraday.clj
@@ -169,13 +169,13 @@
 (defmacro ^:private am-item-result [result get-form]
   `(when-let [get-form# ~get-form]
      (with-meta (db-item->clj-item get-form#)
-       {:consumed-capacity (cc-units (.getConsumedCapacity ~result))})))
+       {:cc-units (cc-units (.getConsumedCapacity ~result))})))

 (defmacro ^:private am-query|scan-result [result & [meta]]
   `(let [result# ~result]
      (merge {:items (mapv db-item->clj-item (.getItems result#))
              :count (.getCount result#)
-             :consumed-capacity (cc-units (.getConsumedCapacity result#))
+             :cc-units (cc-units (.getConsumedCapacity result#))
              :last-prim-kvs (as-map (.getLastEvaluatedKey result#))}
             ~meta)))

@@ -211,14 +211,14 @@

   BatchGetItemResult
   (as-map [r]
-    {:items             (utils/keyword-map as-map (.getResponses r))
-     :unprocessed       (.getUnprocessedKeys r)
-     :consumed-capacity (cc-units (.getConsumedCapacity r))})
+    {:items       (utils/keyword-map as-map (.getResponses r))
+     :unprocessed (.getUnprocessedKeys r)
+     :cc-units    (cc-units (.getConsumedCapacity r))})

   BatchWriteItemResult
   (as-map [r]
-    {:unprocessed       (.getUnprocessedItems r)
-     :consumed-capacity (cc-units (.getConsumedCapacity r))})
+    {:unprocessed (.getUnprocessedItems r)
+     :cc-units    (cc-units (.getConsumedCapacity r))})

   DescribeTableResult
   (as-map [r]


new article

new article

--- articles.clj
+++ articles.clj
@@ -103,4 +103,53 @@

 As you can imagine, it will take some manpower to run all these games, so we are
 looking for volunteers to help as refs during the games. Let us know if you're
-interested!"}]
+interested!"}
+ {:title "Sauerbraten Day of Sobriety I"
+  :author "mefisto"
+  :date (tc/to-date (date-time 2013 10 11 17 15))
+  :category "home"
+  :content "
+We are proud to announce the first tournament!
+
+##Day of Sobriety I##
+
+![Last drink...](/img/last-shot-regular.jpg)
+
+### When ###
+
+Sunday, October 20th.
+
+- 1:00 PM Eastern US Time
+- 5:00 PM UTC
+- 7:00 PM Germany Time
+
+### Modes ###
+
+- 1v1 Insta
+- 2v2 Teamplay FFA
+- 3v3 Efficiency CTF
+
+### What Next ###
+
+Registration for the tournament will be on the SDoS website, and it will be
+available soon! Just as soon as we finish writing the code for it! If you sign
+up for email updates using the form on the left, we will send out an email when
+registration is open.
+
+### Other Important Info ###
+
+We will be using a protected anti-cheat client, which will be available for
+download through this site before the tournament.
+
+Map selection for each game will be done using a veto system, from a
+pre-selected map pool. We will announce the map pool soon.
+
+### Contact ###
+
+For any questions or concerns, you can either:
+- Email mefisto. The address is his nick, at sauerworld dot org.
+- Come and see us on IRC. We're in #sdos channel on Gamesurge.
+
+"
+  }
+ ]


Better ip/port

Better ip/port

--- src/word_keeper/core.clj
+++ src/word_keeper/core.clj
@@ -58,6 +58,8 @@
 (defn -main [& args]
   (let [handler (if (in-dev?)
                   (reload/wrap-reload (site #'routes))
-                  (site routes))]
-    (run-server handler {:port 8000})
-    (println "Head to localhost:8000")))
+                  (site routes))
+        port (Integer/parseInt (get (System/getenv) "OPENSHIFT_CLOJURE_HTTP_PORT" "8080"))
+        ip (get (System/getenv) "OPENSHIFT_CLOJURE_HTTP_IP" "0.0.0.0")]
+    (run-server handler {:ip ip :port port})
+    (println "Application run " ip ":" port)))


crudely avoid placing duplicate words in the orthogonal orientation

--- src/xrosslexior/core.clj
+++ src/xrosslexior/core.clj
@@ -252,20 +252,32 @@
   (let [squares-traversed (comprising-squares across-address)]
     (map #(containing-address-down puzzle %) squares-traversed)))

-(defn down-prefix-admissibles [puzzle across-address]
+(defn down-prefix-admissibles [puzzle across-address & {:keys [used]
+                                                        :or {used #{}}}]
   (let [down-addresses (down-addresses-athwart-across puzzle across-address)
         down-wordspans (map #(read-wordspan puzzle %) down-addresses)
         prefixes (map #(filter identity %) down-wordspans)
-        trees (map #(letter-tree-search (n-prefix-tree (:length %1)) %2)
+        trees (map (fn [address prefix]
+                     (letter-tree-search (n-prefix-tree (:length address))
+                                         prefix))
                    down-addresses prefixes)
-        spot-admissibles (map #(keys (:children %)) trees)]
-    (apply cartesian-product spot-admissibles)))
-
-(defn admissibles [puzzle across-address]
+        spot-admissibles (map #(keys (:children %)) trees)
+        ;; a fairly ad hoc technique to avoid placing duplicate words
+        ;; in the orthogonal direction
+        spot-admissible-uniquelies ;\
+        (map-indexed
+         (fn [index admissibles]
+           (filter (fn [admissible]
+                     (not (used (conj (vec (nth prefixes index)) admissible))))
+                   admissibles))
+         spot-admissibles)]
+    (apply cartesian-product spot-admissible-uniquelies)))
+
+(defn admissibles [puzzle across-address & {:keys [used] :or {used #{}}}]
   (filter (n-dictionary (:length across-address))
-          (down-prefix-admissibles puzzle across-address)))
-
-(defn solve-puzzle [puzzle & {:keys [spy]}]
+          (down-prefix-admissibles puzzle across-address :used used)))
+
+(defn solve-puzzle [puzzle & {:keys [used spy] :or {used #{} spy false}}]
   (when spy
     (println "spying ...")
     (display-puzzle puzzle))
@@ -273,8 +285,8 @@
     puzzle
     (let [next-across-address (first-blank-across-address puzzle)]
       (some identity
-            (let [admissible-words (admissibles puzzle next-across-address)]
+            (let [admissible-words (admissibles puzzle next-across-address
+                                                :used used)]
               (for [word admissible-words]
-                (solve-puzzle (write-wordspan puzzle
-                                              next-across-address
-                                              word) :spy spy)))))))
+                (solve-puzzle (write-wordspan puzzle next-across-address word)
+                              :spy spy :used (conj used word))))))))


Change resize to use box filter

Change resize to use box filter

--- src/zaffre/imageutil.clj
+++ src/zaffre/imageutil.clj
@@ -77,10 +77,17 @@
                                                       (* s height)
                                                       channels))]
     (when (zero?
-            (STBImageResize/stbir_resize_uint8
+            (STBImageResize/stbir_resize_uint8_generic
               byte-buffer width height 0
               scaled-bytes (* s width) (* s height) 0
-              channels))
+              channels
+              (if (= channels 4)
+                3
+                STBImageResize/STBIR_ALPHA_CHANNEL_NONE)
+              0
+              STBImageResize/STBIR_EDGE_ZERO
+              STBImageResize/STBIR_FILTER_BOX
+              STBImageResize/STBIR_COLORSPACE_LINEAR))
       (throw (RuntimeException. "Error scaling image")))
     (log/info "scaled-bytes" scaled-bytes)
     (->Image (* s width) (* s height) channels scaled-bytes)))


Add logging to debug infinite project spinner bug

This bug has been a strange combination of things that makes it almost
impossible to track down. So far I have confirmed:
1. The infinite spinner is caused because the :projects key is nil, but
the projects api call is clearly made, and returns a non-nil response.
2. It only happens for specific users or users within specific orgs,
but happens deterministically for them.
3. It only happens with advanced compilation turned on. Appending
`om-build-id=whitespace` to circleci.com makes the issue go away.
4. Using advanced compilation and prod.circlehost and impersonating one
of the affected users, the issue also seems to go away.

Given those conditions, the only next step I can think of is to deploy
the logging to production. This will be removed once the issue is
solved.

--- src-cljs/frontend/controllers/api.cljs
+++ src-cljs/frontend/controllers/api.cljs
@@ -124,7 +124,15 @@
                                          {})]]
           (merge new-project
                  (select-keys matching-project [:recent-builds :build-timing])))]
+    (js/console.log (str "PROJECT API RESP: " resp))
+    (js/console.log (str "PROJECT API NEW PROJECTS: " new-projects))
+    (js/console.log (str "PROJECT API LOOKUP: " (str old-projects-lookup)))
+    (js/console.log (str "PROJECT API PROCESSED PROJECTS: " processed-new-projects))
     (assoc-in current-state state/projects-path processed-new-projects)))
+
+(defmethod api-event [:projects :failed]
+  [target message status args state]
+  (js/console.log "PROJECT API FAILED"))

 (defmethod post-api-event! [:projects :success]
   [target message status args previous-state {:keys [navigation-point] :as current-state} comms]


implemeting status wait

implemeting status wait

--- src/aws/provider.clj
+++ src/aws/provider.clj
@@ -1,5 +1,6 @@
 (ns aws.provider
   (:require [aws.sdk.ec2 :as ec2])
+  (:import java.util.UUID)
   (:use
     [trammel.core :only  (defconstrainedrecord)]
     [celestial.provider :only (str? vec?)]
@@ -23,31 +24,43 @@

 (def ids (synched-map :aws-keys))

+(defn wait-for-status [s instance & {:keys [timeout] :or {timeout }}]
+ (while (not (= status (.status Instance)))
+
+   )
+  )
+
 (defconstrainedrecord Instance [endpoint conf uuid]
   "An Ec2 instance, uuid used for instance-id tracking"
-  [(empty? (:errors (validate conf instance-valid))) (not (nil? endpoint))]
+  [(empty? (:errors (validate conf instance-valid)))
+   (not (nil? endpoint)) (instance? UUID uuid)]
   Vm
   (create [this]
-          (debug "creating" conf)
-          (debug (ec2/run-instances (creds) conf)))
+      (debug "creating" conf)
+      (swap! ids assoc uuid (-> (ec2/run-instances (creds) conf) :instances first :id))
+      this)
   (delete [this]
-          (debug "deleting"))
+          (debug "deleting" uuid)
+          (ec2/terminate-instances (creds) (@ids uuid))
+          )
   (start [this]
-         (debug "starting" )
-         (ec2/start-instances (creds)  "i-8843dec2"))
+         (debug "starting" uuid)
+         (ec2/start-instances (creds) (@ids uuid)))
   (stop [this]
         (debug "stopping" )
-        (ec2/stop-instances (creds)  "i-8843dec2"))
+        (ec2/stop-instances (creds)  (@ids uuid)))
   (status [this]
-          (ec2/describe-instances (creds))))
+      (-> (ec2/describe-instances (creds) (ec2/instance-id-filter (@ids uuid)))
+          first :instances first :state :name
+          )))

 (defmethod translate :aws [{:keys [aws machine]}]
-   [(dissoc aws :endpoint) (java.util.UUID/randomUUID) (aws :endpoint) ] )
+  [(aws :endpoint) (dissoc aws :endpoint) (UUID/randomUUID)])

 (defmethod vconstruct :aws [{:keys [aws] :as spec}]
-  (let [[conf endpoint uuid] (translate spec)]
-    (->Instance endpoint conf uuid)))
+    (apply ->Instance (translate spec)))

-; (use 'celestial.fixtures)
-; (.create (vconstruct redis-ec2-spec))
+; (def m (.create (vconstruct celestial.fixtures/redis-ec2-spec)))

+; (.status m)
+


remove diagnostic code that caused exceptions

--- src/babel/forest.clj
+++ src/babel/forest.clj
@@ -220,17 +220,7 @@
               (do
                 (log/debug (str " add-complement took " run-time " msec, but found no lexical complements for "
                                (morph from-bolt)
-                               ". Complements tried were: " (morph complement-candidate-lexemes)))
-
-                ;; TODO: show warn about not finding any phrasal complements, as well as not finding any lexical complements.
-                (vec (map (fn [lexeme]
-                            (do
-                              (log/debug (str " path in bolt: " path))
-                              (log/debug (str " cat@" path " = " (strip-refs (get-in bolt (concat path [:synsem :cat])))))
-                              (log/trace (str " sem@" path " = " (strip-refs (get-in bolt (concat path [:synsem :sem])))))
-                              (log/debug (str " pred@" path " = " (strip-refs (get-in bolt (concat path [:synsem :sem :pred])))))
-                              (log/debug (str " agr@" path " = " (strip-refs (get-in bolt (concat path [:synsem :agr])))))))
-                          complement-candidate-lexemes))))
+                               ". Complements tried were: " (morph complement-candidate-lexemes)))))
             (do (log/trace (str "add-complement after adding complement: "
                                 (string/join ","
                                              (map (fn [each]


don't index path=:top

don't index path=:top

--- src/babel/index.cljc
+++ src/babel/index.cljc
@@ -160,9 +160,8 @@
     (let [pred (first vals-at-path)]
       (merge {pred
               (filter (fn [lexeme]
-                        (or (= :top (get-in lexeme path :top))
-                            (= pred
-                               (get-in lexeme path))))
+                        (= pred
+                           (get-in lexeme path)))
                       lexemes)}
              (map-subset-by-path2 (rest vals-at-path)
                                   lexemes


log formatting

log formatting

--- src/babel/parse.cljc
+++ src/babel/parse.cljc
@@ -124,9 +124,10 @@
    language-independent tokenizer to turn the string into a sequence of tokens."
   ([input model & [original-input]]
    (let [original-input (if original-input original-input input)]
-     (log/info (str "parsing input: '" input "'"))
      (cond (string? input)
-           (parse (filter #(not (empty? %)) (string/split input tokenizer)) model original-input)
+           (do
+             (log/info (str "parsing input: '" input "'"))
+             (parse (filter #(not (empty? %)) (string/split input tokenizer)) model original-input))

            (or (seq? input) (vector? input))
            ;; assume input is a list of tokens.


{:city false} should be within :prop

{:city false} should be within :prop

--- src/babel/reader.clj
+++ src/babel/reader.clj
@@ -121,7 +121,7 @@
                              (fn [x] x))

         basic-spec {:synsem {:subcat []
-                             :sem {:subj {:city false}}
+                             :sem {:subj {:prop {:city false}}}
                              :cat :verb}
                     :modified false}
         target-spec (unify target-spec basic-spec)


Start recording results of actions.

Start recording results of actions.

--- src/circle/proto.clj
+++ src/circle/proto.clj
@@ -10,6 +10,9 @@
   (:require [clojure.string :as string])
   (:require [clojure.contrib.seq-utils :as seq-utils])
   (:use circle.utils.except)
+  (:require [clj-time.core :as time])
+  (:use [circle.db :only (with-conn)])
+  (:require [circle.model.shell-command :as model])
   (:require [fs]))

 (defn strip-dots
@@ -82,10 +85,30 @@
                           (for [name exe-names path (env-paths)]
                             (fs/join path name)))))

+(defn record-program-start
+  "Record that a program has started, with pertinent information"
+  [args env timestamp]
+  (model/insert {:args args :env env :starting-time timestamp}))
+
+(defn record-program-end
+  "Records that a program has ended, with the result of that program"
+  [program-id out err exit timestamp]
+  (model/update {:id program-id :out out :err err :exit exit :ending-time timestamp}))
+
+(defn fetch-keyword-argument
+  "If the given keyword is in the argument list, return the value that follows it, else nil"
+  [values keyword]
+  (second (drop-while #(not= % keyword) values)))
+
 (defn shell-out [& args]
-  (let [{:keys [out err exit]} (apply shell/sh :return-map true args)]
-    (throw-if-not (and (= exit 0) (= err ""))
-                  (throwf "Failed (%d): %s\n%s\n%s" exit args out err))))
+  (with-conn
+    (let [passed-env (fetch-keyword-argument args :env)
+          env (apply shell/sh "env" passed-env)
+          program-id (record-program-start args env (time/now))
+          {:keys [out err exit]} (apply shell/sh :return-map true args)
+          _ (record-program-end program-id out err exit (time/now))]
+      (throw-if-not (and (= exit 0) (= err ""))
+                    (throwf "Failed (%d): %s\n%s\n%s" exit args out err)))))

 ; there is a program called autogen.sh on sourceforge that apparently
 ; does magic here
@@ -205,13 +228,14 @@

 (defn init [& argv]
   (circle.repl/init)
+  (circle.db/init)
   (clean-scratch-directory)
-  (def configuration (-> argv
+  (let [configuration (-> argv
                           first
                           io/reader
                           slurp
-                          yaml/parse-string))
-  (process-configurations configuration))
+                          yaml/parse-string)]
+    (process-configurations configuration)))

 (defn -main []


Fix main.

Fix main.

--- src/clj_elm/main.clj
+++ src/clj_elm/main.clj
@@ -18,6 +18,4 @@
         H (hidden-layer-output-matrix ass bs xss)
         T (class-label dataset)
         betas (to-vect (mmult (pseudo-inverse-matrix H) T))]
-    (do (println (matrix H))
-        (println betas))
     (map #(output betas ass bs %) xss)))


Fixed typo.

Fixed typo.

--- src/clojush/args.clj
+++ src/clojush/args.clj
@@ -372,7 +372,7 @@
     (doseq [instr (registered-for-stacks [:integer :boolean :exec :genome :float])]
       (when (not (some #{instr} (:atom-generators @push-argmap)))
         (swap! push-argmap assoc :atom-generators (conj (:atom-generators @push-argmap) instr))))
-    (swap@ push-argmap assoc :atom-generators (conj (:atom-generators @push-argmap) (fn [] (lrand))))
+    (swap! push-argmap assoc :atom-generators (conj (:atom-generators @push-argmap) (fn [] (lrand))))
     (dotimes [n (:autoconstructive-integer-rand-enrichment @push-argmap)]
       (swap! push-argmap assoc :atom-generators (conj (:atom-generators @push-argmap) 'autoconstructive_integer_rand)))
     (if (neg? (:autoconstructive-integer-rand-enrichment @push-argmap))


Properly shutdown clojure after it ends

Properly shutdown clojure after it ends

In order to make the integrations tests not exit after each one,
I removed the java call to exit the program after clojush finishes.

however, then it wouldn't stop when threads were still open, so we
add this call to stop all threads and then clojush will exit properly
again

--- src/clojush/core.clj
+++ src/clojush/core.clj
@@ -44,4 +44,5 @@
       (println "Parameters set at command line or in problem file argmap; may or may not be default:")
       (print-params (into (sorted-map) params))
       (println "######################################")
-      (pushgp params))))
+      (pushgp params)
+      (shutdown-agents))))


add notes about more tests for unrealized-gains

--- test/clj_money/models/lots_test.clj
+++ test/clj_money/models/lots_test.clj
@@ -165,3 +165,7 @@
         "The result contains no validation errors")
     (is (= 70M (:shares-owned retrieved))
         "The retrieved map contains the updated value")))
+
+; Test unrealized-gains with:
+;   Date that precedes some purchases
+;   Date that precedes some sales


add test for recursive navigation with params

--- test/com/rpl/specter/core_test.cljx
+++ test/com/rpl/specter/core_test.cljx
@@ -614,6 +614,23 @@
            ))
   )

+(declarepath map-key-walker [akey])
+
+(providepath map-key-walker
+  [s/ALL
+   (s/if-path [s/FIRST (paramsfn [akey] [curr] (= curr akey))]
+     s/LAST
+     [s/LAST (s/params-reset map-key-walker)])])
+
+(deftest recursive-params-path-test
+  (is (= #{1 2 3} (set (s/select (map-key-walker :aaa)
+                                 {:a {:aaa 3  :b {:c {:aaa 2} :aaa 1}}}))))
+  (is (= {:a {:aaa 4 :b {:c {:aaa 3} :aaa 2}}}
+         (s/transform (map-key-walker :aaa) inc
+                      {:a {:aaa 3  :b {:c {:aaa 2} :aaa 1}}})))
+  (is (= {:a {:c {:b "X"}}})
+      (s/setval (map-key-walker :b) "X" {:a {:c {:b {:d 1}}}}))
+  )

 (deftest all-map-test
   (is (= {3 3} (s/transform [s/ALL s/FIRST] inc {2 3})))


clojure: symmetry function computes node signatures only once

--- clojure/org/gavrog/clojure/pgraph_morphisms.clj
+++ clojure/org/gavrog/clojure/pgraph_morphisms.clj
@@ -98,14 +98,6 @@
                  :when (= v (.source e))]
              [[(.differenceVector net e) (sigs (.target e))] e])))

-(defn extend-matrix [M]
-  (let [n (.numberOfRows M)
-        m (.numberOfColumns M)
-        M* (Matrix/zero (inc n) (inc m))]
-    (.setSubMatrix M* 0 0 M)
-    (.set M* n m (Whole/ONE))
-    M*))
-
 (defn matched-incidences [net v w op sigs]
   (let [nv (incidences-by-signature net v sigs)
         nw (incidences-by-signature net w sigs)]
@@ -115,42 +107,54 @@
                   e2 (.get nw [(.times d op) (map-sig op sig)])]]
         [e1 e2]))))

-(defn morphism [net v w M]
-  (when (.isUnimodularIntegerMatrix M)
-    (let [sigs (node-signatures net)
-          d (.minus (first (first (sigs w))) (first (first (sigs v))))
-          op (.times (Operator. (extend-matrix M)) (Operator. d))]
-      (loop [src2img {}
-             q (conj empty-queue [v w])]
-        (let [[a b] (first q)]
-          (cond
-            (empty? q)
-            [M src2img]
+(defn extend-matrix [M]
+  (let [n (.numberOfRows M)
+        m (.numberOfColumns M)
+        M* (Matrix/zero (inc n) (inc m))]
+    (.setSubMatrix M* 0 0 M)
+    (.set M* n m (Whole/ONE))
+    M*))

-            (nil? b)
-            nil
+(defn morphism
+  ([net v w M sigs]
+    (when (.isUnimodularIntegerMatrix M)
+      (let [d (.minus (first (first (sigs w))) (first (first (sigs v))))
+            op (.times (Operator. (extend-matrix M)) (Operator. d))]
+        (loop [src2img {}
+               q (conj empty-queue [v w])]
+          (let [[a b] (first q)]
+            (cond
+              (empty? q)
+              [M src2img]
+
+              (nil? b)
+              nil

-            (= b (src2img a))
-            (recur src2img (pop q))
+              (= b (src2img a))
+              (recur src2img (pop q))

-            (not (nil? (src2img a)))
-            nil
+              (not (nil? (src2img a)))
+              nil

-            (instance? IEdge a)
-            (recur (assoc src2img a b) (conj (pop q) [(.target a) (.target b)]))
+              (instance? IEdge a)
+              (recur (assoc src2img a b)
+                     (conj (pop q) [(.target a) (.target b)]))

-            :else
-            (when-let [matches (matched-incidences net a b op sigs)]
-              (recur (assoc src2img a b) (into (pop q) matches)))))))))
+              :else
+              (when-let [matches (matched-incidences net a b op sigs)]
+                (recur (assoc src2img a b) (into (pop q) matches)))))))))
+  ([net v w M]
+    (morphism net v w M (node-signatures net))))

-(defn symmetry-from-base-pair [net b1 b2]
+(defn symmetry-from-base-pair [net b1 b2 sigs]
   (let [start #(.source (.get % 0))
         mat #(.differenceMatrix net %)]
-    (morphism net (start b1) (start b2) (Matrix/solve (mat b1) (mat b2)))))
+    (morphism net (start b1) (start b2) (Matrix/solve (mat b1) (mat b2)) sigs)))

 (defn symmetries [net]
-  (assert (node-signatures net))
-  (let [bases (iterator-seq (.iterator (.characteristicBases net)))]
-    (->> bases
-      (map (partial symmetry-from-base-pair net (first bases)))
-      (filter identity))))
+  (let [sigs (node-signatures net)]
+    (assert sigs)
+    (let [bases (iterator-seq (.iterator (.characteristicBases net)))]
+      (->> bases
+        (map #(symmetry-from-base-pair net (first bases) % sigs))
+        (filter identity)))))


1.3-ifying examples.mux

1.3-ifying examples.mux

--- src/examples/mux.clj
+++ src/examples/mux.clj
@@ -13,7 +13,8 @@
 ;; in this file before running it.

 (ns examples.mux
-  (:use [clojush] [clojure.contrib.math]))
+  (:use [clojush]
+	[clojure.math.numeric-tower]))

 ;;; HACKS to Clojush stuff for experimentation here
 ;;; Hacks for collecting and printing full ancestor lists


Test with uuid in tx batch.

Test with uuid in tx batch.

--- test/onyx/plugin/tx_output_test.clj
+++ test/onyx/plugin/tx_output_test.clj
@@ -51,6 +51,12 @@
     :db/unique :db.unique/identity
     :db/cardinality :db.cardinality/one
     :db.install/_attribute :db.part/db}
+
+   {:db/id #db/id [:db.part/db]
+    :db/ident :uuid
+    :db/valueType :db.type/uuid
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}

    {:db/id #db/id [:db.part/db]
     :db/ident :age
@@ -74,7 +80,7 @@
 (def txes
   [{:tx schema}
    {:tx (map #(assoc % :db/id (d/tempid :db.part/user))
-        [{:name "Mike" :age 27}
+        [{:name "Mike" :age 27 :uuid #uuid "f47ac10b-58cc-4372-a567-0e02b2c3d479"}
          {:name "Dorrene" :age 21}
          {:name "Benti" :age 10}
          {:name "Kristen"}
@@ -126,12 +132,12 @@

 (let [db (d/db datomic-conn)]
   (def results
-    (map (comp (juxt :name :age) (partial d/entity db)) (apply concat (d/q '[:find ?e :where [?e :name]] db)))))
+    (map (comp (juxt :name :age :uuid) (partial d/entity db)) (apply concat (d/q '[:find ?e :where [?e :name]] db)))))

 (doseq [v-peer v-peers]
   (onyx.api/shutdown-peer v-peer))

 (onyx.api/shutdown-env env)

-(fact (set results) => #{["Mike" 30] ["Dorrene" nil] ["Benti" 18] ["Kristen" nil] ["Derek" nil]})
+(fact (set results) => #{["Mike" 30 #uuid "f47ac10b-58cc-4372-a567-0e02b2c3d479"] ["Dorrene" nil nil] ["Benti" 18 nil] ["Kristen" nil nil] ["Derek" nil nil]})


linty fix

linty fix

--- src/metabase/driver/generic_sql/query_processor.clj
+++ src/metabase/driver/generic_sql/query_processor.clj
@@ -93,17 +93,17 @@
     ([this]
      (formatted this false))
     ([{:keys [table-name field-name base-type special-type]} include-as?]
-     (let [quot (partial i/quote-name (:driver *query*))]
+     (let [quote-name (partial i/quote-name (:driver *query*))]
        (cond
-         (contains? #{:DateField :DateTimeField} base-type) `(raw ~(str (format "CAST(%s.%s AS DATE)" (quot table-name) (quot field-name))
+         (contains? #{:DateField :DateTimeField} base-type) `(raw ~(str (format "CAST(%s.%s AS DATE)" (quote-name table-name) (quote-name field-name))
                                                                         (when include-as?
-                                                                          (format " AS %s" (quot field-name)))))
+                                                                          (format " AS %s" (quote-name field-name)))))
          (= special-type :timestamp_seconds)                `(raw ~(str (i/cast-timestamp-to-date (:driver *query*) table-name field-name :seconds)
                                                                         (when include-as?
-                                                                          (format " AS %s" (quot field-name)))))
+                                                                          (format " AS %s" (quote-name field-name)))))
          (= special-type :timestamp_milliseconds)           `(raw ~(str (i/cast-timestamp-to-date (:driver *query*) table-name field-name :milliseconds)
                                                                         (when include-as?
-                                                                          (format " AS %s" (quot field-name)))))
+                                                                          (format " AS %s" (quote-name field-name)))))
          :else                                              (keyword (format "%s.%s" table-name field-name))))))


Remove SIGINT interruption delay

Remove SIGINT interruption delay

--- src/clj/reply/eval_modes/standalone/concurrency.clj
+++ src/clj/reply/eval_modes/standalone/concurrency.clj
@@ -26,7 +26,6 @@
   (let [thread (:thread @action)]
     (when thread (.interrupt thread))
     (when hard-kill-allowed
-      (Thread/sleep 2000)
       (when (and @action (not (:completed @action)) (.isAlive thread))
         (println ";;;;;;;;;;")
         (println "; Sorry, have to call Thread.stop on this command.")


Compose two update-in calls into one.

Compose two update-in calls into one.


Lists are *slightly* cheaper than sets

Lists are *slightly* cheaper than sets

--- src/kevin/search.clj
+++ src/kevin/search.clj
@@ -17,12 +17,14 @@
 (defn search [db & people]
   (mapv (partial name-or-search db) people))

+(let [add (fnil conj #{})]
+  (defn- add-reducer
+    ([] {})
+    ([map [key val]]
+     (update-in map [key] add val))))
+
 (defn- map-set-pairs [map pairs]
-  (let [add (fnil conj #{})]
-    (reduce (fn [map [key val]]
-              (update-in map [key] add val))
-            map
-            pairs)))
+  (reduce add-reducer map pairs))

 (defn paths
   "Returns a lazy seq of all non-looping path vectors starting with
@@ -49,17 +51,17 @@
 (defn bidirectional-bfs [start end neighbors]
   (loop [preds {start nil}
          succs {end nil}
-         q1 #{start}
-         q2 #{end}
+         q1 (list start)
+         q2 (list end)
          iter 1]
-    (when (and (seq q1) (seq q2) (< iter 10))
+    (when (and (seq q1) (seq q2) (< iter 11)) ; 5 "hops" or fewer
       (if (<= (count q1) (count q2))
         (let [pairs (for [node q1
                           nbr (neighbors node)
                           :when (not (contains? preds nbr))]
                       [nbr node])
               preds (map-set-pairs preds pairs)
-              q1 (set (map first pairs))]
+              q1 (map first pairs)]
           (if-let [all (seq (filter #(contains? succs %) q1))]
             (find-paths preds succs all)
             (recur preds succs q1 q2 (inc iter))))
@@ -69,7 +71,7 @@
                           :when (not (contains? succs nbr))]
                       [nbr node])
               succs (map-set-pairs succs pairs)
-              q2 (set (map first pairs))]
+              q2 (map first pairs)]
           (if-let [all (seq (filter #(contains? preds %) q2))]
             (find-paths preds succs all)
             (recur preds succs q1 q2 (inc iter))))))))


Fix definition order in kiries.redis

Fix definition order in kiries.redis

Previously did not compile.

--- src/kiries/redis.clj
+++ src/kiries/redis.clj
@@ -2,14 +2,6 @@
   (:use [clojure.tools.logging :only (info error debug warn)])
   (:require [taoensso.carmine :as car]
             [clj-json.core :as json]))
-
-(defn publish
-  "Returns a function which publishes a single event as JSON, to the
-  spcified redis server and key."
-  [conn key]
-  (let [f (spublish conn key)]
-    (fn [e]
-      (f [e]))))

 (defn spublish
   "Returns a function which takes a sequence of events or other
@@ -33,3 +25,11 @@
                     )
           (catch Exception e
             (warn "Unable to publish" key "to" conn ":" e)))))))
+
+(defn publish
+  "Returns a function which publishes a single event as JSON, to the
+  spcified redis server and key."
+  [conn key]
+  (let [f (spublish conn key)]
+    (fn [e]
+      (f [e]))))


fixed variable name

fixed variable name

--- src/maqueta/core.clj
+++ src/maqueta/core.clj
@@ -16,7 +16,7 @@
 (def channel (.createChannel control))

 (defn walk
-  [name is-pressed tpf]
+  [app is-pressed tpf]
   (if (not is-pressed)
     (doto channel
       (.setAnim "Walk" 0.5)


simplify filtering and clarify pmap function

--- src/shuppet/core.clj
+++ src/shuppet/core.clj
@@ -98,9 +98,7 @@

 (defn- filter-tooling-services
   [names]
-  (clojure.set/difference
-   (set names)
-   (set (split (env :service-tooling-applications) #","))))
+  (remove (set (split (env :service-tooling-applications) #","))  names))

 (defn update-configs
   [environment]
@@ -108,8 +106,10 @@
         names (if (= environment "prod")
                 (filter-tooling-services names)
                 names)]
-    (pmap #(with-ent-bindings environment
-             (shuppet/apply-config environment %)) names)))
+    (pmap (fn [app-name]
+            (with-ent-bindings environment
+              (shuppet/apply-config environment app-name)))
+          names)))

 (defn configure-apps
   [environment]


[#8160] "this.props.onPress is not a function" on tapping back from transaction details screen

Signed-off-by: Andrey Shovkoplyas <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/ui/screens/wallet/transactions/views.cljs
+++ src/status_im/ui/screens/wallet/transactions/views.cljs
@@ -255,9 +255,7 @@
     [react/view {:style components.styles/flex}
      [status-bar/status-bar]
      [toolbar/toolbar {}
-      [toolbar/nav-button (actions/back
-                           ;;TODO temporary fix to update wallet balance, should be fixed properly later
-                           (utils/set-timeout #(re-frame/dispatch [:update-wallet]) 500))]
+      toolbar/default-nav-back
       [toolbar/content-title (i18n/label :t/transaction-details)]
       (when transaction [toolbar/actions (details-action hash url)])]
      [react/scroll-view {:style components.styles/main-container}


includes java version in server info block (#1479)

--- waiter/src/waiter/handler.clj
+++ waiter/src/waiter/handler.clj
@@ -1149,7 +1149,8 @@
                             (update :headers headers/truncate-header-values))
                   (seq trailers)
                   (assoc :trailers (headers/truncate-header-values trailers)))))
-            include-server-info (assoc :server-info {:jetty-version Jetty/VERSION}))
+            include-server-info (assoc :server-info {:java-version (System/getProperty "java.version")
+                                                     :jetty-version Jetty/VERSION}))
           utils/clj->json-response))
     (catch Throwable th
       (utils/exception->response th request))))


fix type transaltion

fix type transaltion

--- src/hu/ssh/github_changelog/formatters/markdown.clj
+++ src/hu/ssh/github_changelog/formatters/markdown.clj
@@ -12,7 +12,7 @@

 (s/defn translate-type :- s/Str
   [type :- s/Str]
-  (or ((keyword type) type-name-map) type))
+  (get type-name-map (keyword type) type))

 (s/defn format-change :- s/Str
   [change :- Change]


Refactor

Refactor

--- backend/test/akvo/lumen/lib/transformation_test.clj
+++ backend/test/akvo/lumen/lib/transformation_test.clj
@@ -45,6 +45,7 @@
                     vec
                     (update-in [1 "args"] dissoc "parseFormat")))

+
 (deftest op-validation
   (testing "op validation"
     (doseq [op ops]


Wire up the backend interface

Wire up the backend interface

--- src/doctopus/storage.clj
+++ src/doctopus/storage.clj
@@ -1,5 +1,6 @@
 (ns doctopus.storage
-  "Defines how Doctopus speaks to different places it can store generated HTML")
+  "Defines how Doctopus speaks to different places it can store generated HTML"
+  (:require [doctopus.storage-impls :as storage-impls]))

 ;; ## Storage
 ;; Doctopus shouldn't really care _where_ it puts generated HTML; it
@@ -19,9 +20,9 @@
 ;; At time of writing, I'm thinking of loading and saving one Tentacle worth of
 ;; documents all at once.

+;; P. Sure I'm not using this
 ;; Control atom for Backend functions.
-(def *backend* (atom "temp-fs"))
-
+;;(def *backend* (atom "temp-fs"))
 ;; (defn load-documents [k] (load-from-storage @*backend* k))
 ;; (defn save-documents [k docs] (save-to-storage @*backend* k docs))

@@ -41,11 +42,20 @@

 ;; The actual interface to a backend.
 (defrecord Backend
-    [default-backend available-backends load-fn save-fn]
+    [backend available-backends]
   DoctopusBackend
+  (set-backend! [this backend]
+    (if (contains? (this :available-backends) backend)
+      (assoc this :backend backend)
+      (throw (java.lang.RuntimeException.
+              (str "Cannot use declared storage backend: " backend)))))
   (load-from-storage [this k]
-    (let [{:keys [conf load-fn]} this]
-      (load-fn conf k)))
+    (let [load-fn (get-in this [:backend :load-fn])]
+      (load-fn k)))
   (save-to-storage [this k v]
-    (let [{:keys [conf save-fn]} this]
-      (save-fn conf k v))))
+    (let [save-fn (get-in this [:backend :save-fn])]
+      (save-fn k v))))
+
+(def available-backends {:temp-fs storage-impls/temp-fs-backend})
+
+(def backend (Backend. storage-impls/temp-fs-backend available-backends))


CMR-4500: Updated logging message.

CMR-4500: Updated logging message.

--- bootstrap-app/src/cmr/bootstrap/data/bulk_index.clj
+++ bootstrap-app/src/cmr/bootstrap/data/bulk_index.clj
@@ -131,7 +131,7 @@
                           :provider-id (:provider-id provider)}
                          (:db-batch-size system))
         num-variables (bulk-index-variable-batches system concept-batches)]
-    (info (format "Indexing of %s variables completed." num-variables))))
+    (info (format "Indexing of %s variable revisions completed." num-variables))))

 (defn index-variables
   "Bulk index variables for the given provider-id."
@@ -165,7 +165,7 @@
                           :provider-id (:provider-id provider)}
                          (:db-batch-size system))
         num-services (bulk-index-service-batches system concept-batches)]
-    (info (format "Indexing of %s services completed." num-services))))
+    (info (format "Indexing of %s service revisions completed." num-services))))

 (defn index-services
   "Bulk index services for the given provider-id."


Update dependencies on debugging example.

--- profiles.clj
+++ profiles.clj
@@ -73,7 +73,7 @@

  :debugging-example
  [:examples
-  {:dependencies [[funcool/catacumba-prone "0.2.1"]]
+  {:dependencies [[funcool/catacumba-prone "0.3.0"]]
    :source-paths ["examples/debugging/src"]
    :resource-paths ["examples/debugging/resources"]
    :main ^:skip-aot debugging.core}]


home..

home..

--- generateme/home.clj
+++ generateme/home.clj
@@ -11,9 +11,9 @@
   (:import [net.jafama FastMath]))

-(def p1 (p/load-pixels "generateme/sold/sold.jpg"))
+(def p1 (p/load-pixels "generateme/lucas/lucas.jpg"))

-(def p2 (p/load-pixels "generateme/sold/soldr.jpg"))
+(def p2 (p/load-pixels "generateme/lucas/lucas1.jpg"))

 (def p3 (p/load-pixels "generateme/ooo/ooo.jpg"))

@@ -34,7 +34,7 @@
   (println b2)
   (p/set-canvas-pixels canvas (p/filter-channels p/equalize-filter false
                                                  (p/filter-channels p/normalize-filter false
-                                                                    (g/blend-machine p4 p1 b)))))
+                                                                    (g/blend-machine p2 (g/blend-machine p4 p1 b) b2)))))

 (quick-bench (p/filter-channels p/dilate-filter false p1))

@@ -46,16 +46,18 @@
                    (o/render-noise noise-overlay)
                    (o/render-spots spots-overlay))))

-(core/save-canvas canvas (core/next-filename "generateme/sold/res" ".jpg"))
+(core/save-canvas canvas (core/next-filename "generateme/lukas/res" ".jpg"))

 (p/set-canvas-pixels canvas p4)

 (def p4 (p/get-canvas-pixels canvas))

+(def p5 (p/get-canvas-pixels canvas))
+
 (do
   (def palette (g/color-reducer-machine))
   (println palette)
-  (p/set-canvas-pixels canvas (g/color-reducer-machine p4 palette)))
+  (p/set-canvas-pixels canvas (g/color-reducer-machine p5 palette)))

 ;; slitscan
@@ -65,14 +67,14 @@
       f (comp v1 v2)]

   (binding [p/*pixels-edge* :wrap]
-    (p/set-canvas-pixels canvas (p/filter-channels (g/make-slitscan2-filter f 2.0)
-                                                   (g/make-slitscan2-filter f 1.9)
-                                                   (g/make-slitscan2-filter f 2.1) nil p1))))
+    (p/set-canvas-pixels canvas (p/filter-channels (g/make-slitscan2-filter f 1.0)
+                                                   (g/make-slitscan2-filter f 0.95)
+                                                   (g/make-slitscan2-filter f 1.05) nil p4))))

 ;; full process without use of filter-channels
 (time (let [effect (make-effect :dj-eq {:lo (m/drand -20 20) :mid (m/drand -20 20) :hi (m/drand -20 20) :peak_bw 1.3 :shelf_slope 1.5 :rate (m/irand 4000 100000)})
-            in (signal-from-pixels p1 {:layout :planar
-                                      :coding :ulaw
+            in (signal-from-pixels p4 {:layout :planar
+                                      :coding :alaw
                                       :signed true
                                       :channels [2 0 1]
                                       :bits 8})


Update util.clj

Update util.clj


Use map instead of for in 'for-files'.

Use map instead of for in 'for-files'.


mo better debuggin

mo better debuggin

--- dev/user.clj
+++ dev/user.clj
@@ -1,6 +1,8 @@
 (ns user
   (:require [immutant.util :refer [in-immutant?] :as util]
             [immutant.dev :refer [reload-project!] :as dev]
+            [immutant.messaging :as msg]
+            [clojure.data.json :as json]
             [clojure.java.io :as io]
             [clojure.string :as str]
             [clojure.pprint :refer (pprint)]


removing deleted require

removing deleted require

--- dev/user.clj
+++ dev/user.clj
@@ -2,8 +2,7 @@
   (:require (vignette.storage [core :refer (create-image-storage)]
                               [local :refer [create-local-storage-system]]
                               [s3 :refer [create-s3-storage-system storage-creds]])
-            (vignette.api.legacy [routes :as alr]
-                                 [test :as t])
+            [vignette.api.legacy.routes :as alr]
             (vignette.http [routes :as r])
             (vignette.util [integration :as itg]
                            [thumbnail :as u]


comment

comment

--- src/babel/english/grammar.cljc
+++ src/babel/english/grammar.cljc
@@ -99,7 +99,7 @@
     :comment "c11"}))

 ;; TODO: names like "c11-comp-subcat-1" have no human-discernible meaning:
-;; sound like construction droid names or something..
+;; sound like droid names or something..
 (def c11-comp-subcat-1
   (let [subcat (atom :top)]
     (unify-check


~(defn vocab-entry-to-lexeme) don't replace parentheses from surface: handled elsewhere

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -720,7 +720,7 @@
                               structure :structure}]
   (log/debug (str "calling vocab-entry-to-lexeme with "
                   "surface=" surface " and structure=" structure))
-  (let [surface (clojure.string/replace surface #"\s*\(.*$" "")]
+  (let [surface surface] ;; (clojure.string/replace surface #"\s*\(.*$" "")
     (cond (clojure.string/starts-with? vocab-cat "noun")
           (let [base-unify
                 {:synsem {:sem {:pred (keyword pred)}


+pronoun default lexical rules

+pronoun default lexical rules

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -121,7 +121,20 @@
     {:synsem {:cat :noun
               :pronoun false
               :reflexive false}})
-
+
+   (default ;; a propernoun takes no args.
+    {:synsem {:cat :noun
+              :pronoun false
+              :propernoun true
+              :subcat '()}})
+
+   (default ;; a propernoun is agr=3rd singular
+    {:synsem {:cat :noun
+              :pronoun false
+              :propernoun true
+              :agr {:number :sing
+                    :person :3rd}}})
+
    ;; </noun default rules>

    ;; <verb default rules>


come: subject is animate

come: subject is animate

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -422,7 +422,8 @@
                      :sem {:pred :close}}}

    "come" {:synsem {:cat :verb
-                    :sem {:pred :come}}
+                    :sem {:pred :come
+                          :subj {:animate true}}}
            :english {:past "came"}}

    "comment" {:synsem {:cat :verb


+TODO about current workaround

+TODO about current workaround

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -638,9 +638,14 @@
 (defn vocab-entry-to-lexeme [{surface :surface
                               pred :pred
                               vocab-cat :vocab_cat}]
+  ;; add some additional constraints that we should not need (should be in compile-lex)
+  ;; TODO: remove need to add these constraints.
   (cond (= vocab-cat "noun1")
         {surface
          [{:synsem {:sem {:pred (keyword pred)}
+                    :propernoun false
+                    :pronoun false
+                    :subcat {:1 {:agr {:person :3rd}
+                                 :cat :det}}
                     :cat :noun}}]}
         true {}))
-


Add test for ref inside set

Add test for ref inside set

Fix #50


minor bug fixed on aleph component

minor bug fixed on aleph component

--- src/clj/hellhound/components/aleph.clj
+++ src/clj/hellhound/components/aleph.clj
@@ -36,9 +36,9 @@
   "Returns a new aleph component by given `routes` and optional `config`
   map. For details about `config` map checkout aleph docs."
   ([routes]
-   (aleph routes (hellhound/get-config :http)))
+   (factory routes (hellhound/get-config :http)))
   ([routes config]
    (spec/validate ::aleph-config config "Aleph configuration is invalid.")
    {:hellhound.component/name ::aleph
-    :hellhound.component/start-fn (aleph-start1 routes config)
+    :hellhound.component/start-fn (aleph-start! routes config)
     :hellhound.component/stop-nf aleph-stop!}))


logging

logging

--- src/clojure/zensols/nlparse/config.clj
+++ src/clojure/zensols/nlparse/config.clj
@@ -353,6 +353,7 @@
                        (re-find #"\[([^/]+)\/(.*)\]")
                        rest
                        (map symbol))]
+    (log/tracef "fv: %s / %s" ns name)
     {:fn-namespace ns
      :fn-name name
      :fn-var (ns-resolve ns name)}))


cleanup

cleanup

--- test/spq/server_test.clj
+++ test/spq/server_test.clj
@@ -3,7 +3,7 @@
             [clojure.test :refer :all]
             [confs.core :as confs :refer [conf]]
             [compojure
-             [core :as compojure :refer [GET POST]]
+             [core :refer [GET POST]]
              [route :as route]]
             [spq
              [lib :as lib]


(maint) Drop client without ssl test

(maint) Drop client without ssl test

The websocket client now validates the server certificate, which means
to retain this test we'd need to configure an SSLContext with a CA cert
but no client cert. We don't have utilities available for that, and we
test rejected certs in pxp-agent acceptance tests.

--- test/integration/puppetlabs/pcp/broker/service_test.clj
+++ test/integration/puppetlabs/pcp/broker/service_test.clj
@@ -20,25 +20,6 @@
                                          :error (fn [ws e])
                                          :open (fn [ws] (deliver connected true)))]
         (is (= true (deref connected (* 2 1000) false)) "Connected within 2 seconds")))))
-
-(deftest it-expects-ssl-client-auth-test
-  (with-app-with-config app broker-services broker-config
-    (let [closed (promise)]
-      (with-open [client (http/create-client)
-                  ws (http/websocket client
-                                     "wss://localhost:58142/pcp/v2.0"
-                                     :close (fn [ws code reason] (deliver closed code)))]
-        ;; NOTE(richardc): This test should only check for close-code 4003, but it
-        ;; is a little unreliable and so may sometimes yield the close-code 1006 due
-        ;; to a race between the client (netty) becoming connected and the server (jetty)
-        ;; closing a connected session because we asked it to.
-        ;; This failure is more commonly observed when using Linux
-        ;; than on OSX, so we suspect the underlying races to be due
-        ;; to thread scheduling.
-        ;; See the comments of http://tickets.puppetlabs.com/browse/PCP-124 for more.
-        (is (contains? #{4003 1006}
-                       (deref closed (* 2 1000) false))
-            "Disconnected due to no client certificate")))))

 (defn connect-and-close
   "Connect to the broker, wait up to delay ms after connecting


Tidy.

Tidy.

--- test/clojure_the_language/clojure_numerics_test.clj
+++ test/clojure_the_language/clojure_numerics_test.clj
@@ -9,20 +9,18 @@
 ;;; mathematics. So, for example, 2 and 2.0 are equivalent values.

 ;;;; ___________________________________________________________________________
-;;;; ---- Numeric types ----
-
-;;; Clojure's numeric types (some of which are Java types)
-
-(fact "Certain Clojure types are from java.lang"
+;;;; ---- Clojure's numeric types ----
+
+(fact "Some of Clojure's numeric types are from java.lang"
   (fact (= Long   java.lang.Long)   => true)
   (fact (= Double java.lang.Double) => true)
   (fact (= Byte   java.lang.Byte)   => true)
   (fact (= Short  java.lang.Short)  => true))

-(fact "Certain Clojure types are from java.math"
+(fact "Some of Clojure's numeric types are from java.math"
   (fact (= BigDecimal java.math.BigDecimal) => true))

-(fact "Certain Clojure types are from clojure.lang"
+(fact "Some of Clojure's numeric types are from clojure.lang"
   ;; These are not available without the clojure.lang. prefix
   (fact clojure.lang.BigInt => clojure.lang.BigInt)
   (fact clojure.lang.Ratio  => clojure.lang.Ratio))


use (apply + ...) instead of reduce

use (apply + ...) instead of reduce

--- src/brainbot/nozzle/manage.clj
+++ src/brainbot/nozzle/manage.clj
@@ -31,7 +31,7 @@

 (defn num-messages-from-queue-state
   [queue-state vhost rkmap]
-  (reduce + (map :messages (filter-by-rkmap rkmap (filter-by-vhost vhost queue-state)))))
+  (apply + (map :messages (filter-by-rkmap rkmap (filter-by-vhost vhost queue-state)))))

 (defn start-synchronization


Properties passed to analytics events cannot be maps Using strings instead.

--- src-cljs/frontend/components/pages/build.cljs
+++ src-cljs/frontend/components/pages/build.cljs
@@ -103,8 +103,8 @@
               [:a.build-action
                {:href (routes/v1-project-settings-path (:navigation-data data))
                 :on-click #((om/get-shared owner :track-event) {:event-type :build-page-project-settings-clicked
-                                                                :properties {:project project
-                                                                             :user user}})}
+                                                                :properties {:project (:vcs_url project)
+                                                                             :user (:login user)}})}
                [:i.material-icons "settings"]
                "Project Settings"]])])))))


Add insights icon to devcard

Add insights icon to devcard

--- src-cljs/frontend/components/pieces/icon.cljs
+++ src-cljs/frontend/components/pieces/icon.cljs
@@ -141,4 +141,5 @@
     (icon-card [#'git-pull-request]))

   (defcard navigation
-    (icon-card [#'settings])))
+    (icon-card [#'settings
+                #'insights])))


Missed adding new system arg to user ns

Missed adding new system arg to user ns

--- dev/user.clj
+++ dev/user.clj
@@ -8,13 +8,13 @@
   ([]
    (start {} nil))
   ([overrides component-subset]
-   (start "local" overrides component-subset))
-  ([profile overrides component-subset]
+   (start "config.edn" "local" overrides component-subset))
+  ([config-location profile overrides component-subset]
    (when-not @app/system
      (reset! app/profile (keyword (env :system-profile profile)))
      (try
        (prn "Starting system")
-       (->> (system/new-system (keyword (env :system-profile profile)))
+       (->> (system/new-system config-location (keyword (env :system-profile profile)))
             (#(merge % overrides))
             (#(if component-subset
                 (select-keys % component-subset)


Remove unused import of sites.read

Remove unused import of sites.read

--- src/clj/comic_reader/sites.clj
+++ src/clj/comic_reader/sites.clj
@@ -3,7 +3,6 @@
             [clojure.string :as str]
             [comic-reader.scrape :as scrape]
             [comic-reader.sites.protocol :refer :all]
-            [comic-reader.sites.read :as site-read]
             [comic-reader.sites.util :as util]
             [comic-reader.util :refer [safe-read-string]]
             [com.stuartsierra.component :as component]))


Set different domain status for initial loading and when live updating.

--- src/clj/elephantdb/service.clj
+++ src/clj/elephantdb/service.clj
@@ -23,11 +23,13 @@
           [domain (domain/init-domain-info (domain-shards domain))]
           ))))

-(defn load-and-sync-status-of-domain [domain domains-info loader-fn]
+(defn load-and-sync-status-of-domain [domain domains-info update? loader-fn]
   (future
     (try
       (domain/set-domain-status! (domains-info domain)
-                                 (thrift/loading-status))
+                                 (if update?
+                                   (thrift/ready-status true)
+                                   (thrift/loading-status)))
       (let [domain-data (loader-fn domain)]
         (if domain-data
           (domain/set-domain-data! (domains-info domain)
@@ -42,11 +44,11 @@
          (thrift/failed-status t))))))

 (defn load-and-sync-status
-  ([domains-info loader-fn]
-     (load-and-sync-status (keys domains-info) domains-info loader-fn))
-  ([domains domains-info loader-fn]
+  ([domains-info update? loader-fn]
+     (load-and-sync-status (keys domains-info) domains-info update? loader-fn))
+  ([domains domains-info update? loader-fn]
      (let [loaders (dofor [domain domains]
-                          (load-and-sync-status-of-domain domain domains-info loader-fn))]
+                          (load-and-sync-status-of-domain domain domains-info update? loader-fn))]
        (with-ret (future-values loaders)
          (log-message "Successfully loaded domains: " (str-utils/str-join ", " domains))))))

@@ -103,6 +105,7 @@

 (defn sync-data-updated [domains-info global-config local-config]
   (load-and-sync-status domains-info
+                        false
                         (fn [domain]
                           (use-cache-or-update domain domains-info global-config local-config))))

@@ -152,6 +155,7 @@
                       (assoc global-config :domains domains-map))]
     (future
       (load-and-sync-status domains-info
+                            false
                             (fn [domain]
                               (open-domain
                                local-config
@@ -196,7 +200,7 @@
     new-data))

 (defn- update-domains [all-domains domains-info global-config local-config]
-  (let [max-kbs 1024
+  (let [max-kbs 8192
         all-shards (domain/all-shards domains-info)
         domain-shards (into {} (map (fn [domain]
                                       [domain (all-shards domain)])
@@ -212,6 +216,7 @@
         (try
           (load-and-sync-status
            all-domains domains-info
+           true
            (fn [domain]
              (close-if-updated domain
                                domains-info


removed bad if-let statement.

removed bad if-let statement.

--- src/clj/elephantdb/service.clj
+++ src/clj/elephantdb/service.clj
@@ -42,11 +42,12 @@
          ;; Actually, we should be checking the same condition as
          ;; close-if-updated, and swapping first.

-         (if-let [domain-data (loader-fn domain)]
-
+         (let [domain-data (loader-fn domain)]
+
            ;; Here, we finally do the swap.
-           (domain/set-domain-data! (domains-info domain)
-                                    domain-data)
+           (when domain-data
+             (domain/set-domain-data! (domains-info domain)
+                                      domain-data))
            (domain/set-domain-status!
             (domains-info domain)
             (thrift/ready-status false)))
@@ -55,27 +56,6 @@
            (domain/set-domain-status!
             (domains-info domain)
             (thrift/failed-status t))))))
-
-#_(defn load-and-sync-status-of-domain
-  [domain domains-info update? loader-fn]
-  (future
-    (try
-      (domain/set-domain-status! (domains-info domain)
-                                 (if update?
-                                   (thrift/ready-status true)
-                                   (thrift/loading-status)))
-      (let [domain-data (loader-fn domain)]
-        (when domain-data
-          (domain/set-domain-data! (domains-info domain)
-                                   domain-data))
-        (domain/set-domain-status!
-         (domains-info domain)
-         (thrift/ready-status false)))
-      (catch Throwable t
-        (log-error t "Error when loading domain " domain)
-        (domain/set-domain-status!
-         (domains-info domain)
-         (thrift/failed-status t))))))

 (defn load-and-sync-status
   ([domains-info update? loader-fn]


Cleanup

Cleanup

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- src/cljparse/config/parser.clj
+++ src/cljparse/config/parser.clj
@@ -16,23 +16,22 @@
 (defn fqp [_loc]
   (loop [loc _loc
          path ()]
+
     (cond
+      (= loc nil)
+      (vec path)

-         (= loc nil)
-         (into [] path)
-
-         :else
-         (recur (zip/up loc) (->> loc zip/node nodename (conj path))))))
+      :else
+      (recur (zip/up loc) (->> loc zip/node nodename (conj path))))))

 (defn find [path tree]
   (loop [loc tree]
     (cond
-
       (zip/end? loc)
       nil

       (= (fqp loc) path)
-      (rest (zip/node loc))
+      (->> loc zip/node rest vec)

       :else
       (recur (zip/next loc)))))


Allow for possible event values in maps listen

--- src/cljs/gtfve/utils/maps.cljs
+++ src/cljs/gtfve/utils/maps.cljs
@@ -17,5 +17,5 @@
   ([gmap type]
    (listen gmap type (chan)))
   ([gmap type c]
-   (.. Maps -event (addListener gmap type (fn [] (put! c (js/Date.)))))
+   (.. Maps -event (addListener gmap type (fn [e] (put! c (if e e (js/Date.))))))
    c))


Rename some private functions on kdf ns.

--- src/clojure/buddy/core/kdf.clj
+++ src/clojure/buddy/core/kdf.clj
@@ -21,7 +21,7 @@
   of kdf implemented in buddy."
   (generate-bytes! [_ length] "Generate bytes"))

-(defn- generate-bytes-impl
+(defn- generate-byte-array
   [impl length]
   (let [buffer (byte-array length)]
     (.generateBytes impl buffer 0 length)
@@ -45,7 +45,7 @@
     (reify
       KDFType
       (generate-bytes! [_ length]
-        (generate-bytes-impl kdfimpl length)))))
+        (generate-byte-array kdfimpl length)))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; KDF1/2 interface
@@ -61,7 +61,7 @@
     (reify
       KDFType
       (generate-bytes! [_ length]
-        (generate-bytes-impl kdfimpl length)))))
+        (generate-byte-array kdfimpl length)))))

 (defn kdf2
   "DF2 generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033"
@@ -73,7 +73,7 @@
     (reify
       KDFType
       (generate-bytes! [_ length]
-        (generate-bytes-impl kdfimpl length)))))
+        (generate-byte-array kdfimpl length)))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Counter mode KDF
@@ -91,7 +91,7 @@
     (reify
       KDFType
       (generate-bytes! [_ length]
-        (generate-bytes-impl kdfimpl length)))))
+        (generate-byte-array kdfimpl length)))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Feedback mode KDF
@@ -114,7 +114,7 @@
     (reify
       KDFType
       (generate-bytes! [_ length]
-        (generate-bytes-impl kdfimpl length)))))
+        (generate-byte-array kdfimpl length)))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Feedback mode KDF
@@ -134,4 +134,4 @@
     (reify
       KDFType
       (generate-bytes! [_ length]
-        (generate-bytes-impl kdfimpl length)))))
+        (generate-byte-array kdfimpl length)))))


prototypes() -> parents()

prototypes() -> parents()

--- src/clojure/confgraph/core.clj
+++ src/clojure/confgraph/core.clj
@@ -5,17 +5,16 @@
            org.jgrapht.EdgeFactory
            org.jgrapht.graph.DefaultDirectedGraph
            org.jgrapht.graph.DefaultEdge
-           org.yaml.snakeyaml.Yaml))
+           org.yaml.snakeyaml.Yaml)
+  (:refer-clojure :exclude [parents]))

-(def defs       (filter #(.isFile %) (.listFiles (File. "defs/runs"))))
-(def vertices   (map #(.getName %) defs))
-(def yaml       (Yaml. (ExtendedConstructor.)))
-(def extends    (fn [x] (.get (.load yaml (slurp (.getPath x))) "ddts_extends")))
-(def prototypes (map extends defs))
-(def edges      (into {} (filter val (zipmap vertices prototypes))))
-
-(def rootpath
-  (memoize #(let [x (edges %)] (if x (conj {% x} (rootpath x)) {}))))
+(def defs     (filter #(.isFile %) (.listFiles (File. "defs/runs"))))
+(def vertices (map #(.getName %) defs))
+(def yaml     (Yaml. (ExtendedConstructor.)))
+(def extends  (fn [x] (.get (.load yaml (slurp (.getPath x))) "ddts_extends")))
+(def parents  (map extends defs))
+(def edges    (into {} (filter val (zipmap vertices parents))))
+(def rootpath (memoize #(let [x (edges %)] (if x (conj {% x} (rootpath x)) {}))))

 (defn graph [re]
   (let [g (DefaultDirectedGraph. DefaultEdge)


Detect clojurescript projects differently

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -197,7 +197,7 @@

 (defn run-project-task
   [path project]
-  (when (:cljsbuild project)
+  (when (clojurescript-project? path)
     (leiningen.cljsbuild/cljsbuild project "once"))
   (cond
     (android-project? path)


Revert "Don't read project.clj multiple times during build commands"

This reverts commit 06ad4e2f89804b5d6ec7aa441ee462db506a393d.

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -30,6 +30,13 @@

 ; utilities

+(defn java-project-map?
+  [project]
+  (or (:java-only project)
+      (= (count (:source-paths project)) 0)
+      (clojure.set/subset? (set (:source-paths project))
+                           (set (:java-source-paths project)))))
+
 (defn read-file
   [path]
   (let [length (.length (io/file path))]
@@ -91,16 +98,13 @@
   (or (.exists (io/file path "AndroidManifest.xml"))
       (.exists (io/file path "AndroidManifest.template.xml"))))

-(defn java-project-map?
-  [project]
-  (or (:java-only project)
-      (= (count (:source-paths project)) 0)
-      (clojure.set/subset? (set (:source-paths project))
-                           (set (:java-source-paths project)))))
+(defn ios-project?
+  [path]
+  (.exists (io/file path "Info.plist.xml")))

 (defn java-project?
   [path]
-  (-> path read-project-clj java-project-map?))
+  (some-> path read-project-clj java-project-map?))

 (defn clojurescript-project?
   [path]
@@ -114,19 +118,16 @@
   [path]
   (-> path read-project-clj :clr some?))

-(defn ring-project-map?
-  [project]
-  (let [{:keys [ring main]} project]
+(defn ring-project?
+  [path]
+  (let [{:keys [ring main]} (read-project-clj path)]
     (and (some? ring) (nil? main))))

-(defn ring-project?
-  [path]
-  (-> path read-project-clj ring-project-map?))
-
 (defn valid-project?
   [path]
-  (not (and (sandbox/get-dir)
-            (android-project? path))))
+  (and (not (ios-project? path))
+       (or (not (android-project? path))
+           (not (sandbox/get-dir)))))

 ; start/stop thread/processes

@@ -202,9 +203,11 @@
     (android-project? path)
     (some-> (read-android-project project)
             (leiningen.droid/doall []))
-    (:clr project)
+    (ios-project? path)
+    nil
+    (clr-project? path)
     (leiningen.clr/clr project "run")
-    (ring-project-map? project)
+    (ring-project? path)
     (leiningen.ring/ring project "server")
     :else
     (leiningen.run/run project)))
@@ -217,7 +220,7 @@
       (doseq [cmd ["deploy" "repl"]]
         (leiningen.droid/execute-subtask project cmd [])
         (Thread/sleep 10000)))
-    (:clr project)
+    (clr-project? path)
     (leiningen.clr/clr project "repl")
     :else
     (leiningen.repl/repl project)))
@@ -230,9 +233,11 @@
             read-android-project
             (assoc-in [:android :build-type] :release)
             leiningen.droid/doall)
-    (:clr project)
+    (ios-project? path)
+    nil
+    (clr-project? path)
     (leiningen.clr/clr project "compile")
-    (:gwt project)
+    (gwt-project? path)
     (leiningen.gwt/gwt project "compile")
     :else
     (leiningen.uberjar/uberjar project)))
@@ -245,7 +250,7 @@
                              (if (:cljsbuild project) "check-cljs" "check"))
       (catch Exception _)))
   (cond
-    (:clr project)
+    (clr-project? path)
     (leiningen.clr/clr project "test")
     :else
     (leiningen.test/test project)))
@@ -253,7 +258,7 @@
 (defn clean-project-task
   [path project]
   (cond
-    (:clr project)
+    (clr-project? path)
     (leiningen.clr/clr project "clean")
     :else
     (leiningen.clean/clean project)))


Clear console pane when resetting it

Clear console pane when resetting it

--- src/clojure/nightcode/repl.clj
+++ src/clojure/nightcode/repl.clj
@@ -21,8 +21,9 @@
   [console]
   (let [process (atom nil)
         run! (fn [& _]
-               (s/request-focus! (-> console .getViewport .getView))
-               (run-repl! process (ui/get-io! console)))
+               (.setText (.getTextArea console) "")
+               (run-repl! process (ui/get-io! console))
+               (s/request-focus! (-> console .getViewport .getView)))
         pane (s/config! console :id :repl-console)]
     (utils/set-accessible-name! (.getTextArea pane) :repl-console)
     ; start the repl


Use more generic prompt

Use more generic prompt

--- src/clojure/nightmod/utils.clj
+++ src/clojure/nightmod/utils.clj
@@ -50,7 +50,7 @@
   [template]
   (s/invoke-now
     (dialogs/show-text-field-dialog!
-      (nc-utils/get-string :enter-game-name)
+      (nc-utils/get-string :enter-project-name)
       (nc-utils/get-string template))))

 (defn new-project-dir!


Support special `::mr/map-output` named output.

--- src/clojure/parkour/io/dux.clj
+++ src/clojure/parkour/io/dux.clj
@@ -157,17 +157,22 @@
   ([f oname]
      (fn [context coll]
        (with-close-rws context
-         (let [sink (get-sink context oname)]
+         (let [sink (if (identical? ::mr/map-output oname)
+                      (mr/wrap-sink context)
+                      (get-sink context oname))]
            (reduce (fn [_ t]
                      (f sink t))
                    nil coll)))))
   ([f context coll]
-     (with-close-rws context
-       (reduce (fn [_ [oname k v :as x]]
-                 (let [t (if (= 2 (count x)) k [k v])
-                       sink (get-sink context oname)]
-                   (f sink t)))
-               nil coll))))
+     (let [wcontext (mr/wrap-sink context)]
+       (with-close-rws context
+         (reduce (fn [_ [oname k v :as x]]
+                   (let [t (if (= 2 (count x)) k [k v])
+                         sink (if (identical? ::mr/map-output oname)
+                                wcontext
+                                (get-sink context oname))]
+                     (f sink t)))
+                 nil coll)))))

 (def ^{:arglists '([oname] [context coll])}
   named-keyvals


http-kit/clojure: Simplify/speed up elem extracting.

--- src/clojure/src/dnsresolvd.clj
+++ src/clojure/src/dnsresolvd.clj
@@ -17,9 +17,9 @@
 (defn startup
     "Starts up the daemon." [args]

-    (let [port-number (first             args  )]
-    (let [daemon-name (first       (rest args ))]
-    (let [log         (first (rest (rest args)))]
+    (let [port-number (nth args 0)]
+    (let [daemon-name (nth args 1)]
+    (let [log         (nth args 2)]

     (println   (str (AUX/MSG-SERVER-STARTED-1) port-number (AUX/NEW-LINE)
                     (AUX/MSG-SERVER-STARTED-2)))


http-kit/clojure: Get rid of intermediate debug output.

--- src/clojure/src/dnsresolvd.clj
+++ src/clojure/src/dnsresolvd.clj
@@ -48,8 +48,6 @@
             (AUX/EMPTY-STRING)
     )]

-    (println params-)
-
     (let [params (clojure.walk/keywordize-keys
         (try
             (apply hash-map (clojure.string/split params- (AUX/PARAMS-SEPS)))
@@ -60,8 +58,6 @@
             }
         ))
     )]
-
-    (println params)

     (let [hostname
         (let [hostname0 (get params :h)]
@@ -78,9 +74,6 @@
             (AUX/PRM-FMT-HTML)
             (AUX/PRM-FMT-JSON)
         ))) (AUX/PRM-FMT-JSON) fmt-)]
-
-    (println hostname)
-    (println fmt     )
     ; -------------------------------------------------------------------------
     ; --- Parsing and validating request params - End -------------------------
     ; -------------------------------------------------------------------------


Fix bench printing

Fix bench printing

--- benchmarks/caesium/crypto/secretbox_benchmark.clj
+++ benchmarks/caesium/crypto/secretbox_benchmark.clj
@@ -77,7 +77,7 @@
          (print-title ~prefix
                       f#
                       (fmt-bytes size#)
-                      (mapv type [out# msg# nonce# key#]))
+                      (mapv type [out# ptext# nonce# key#]))
          (bench (f# out# ptext# nonce# key#))))))

 (deftest ^:benchmark to-buf!-benchmarks


Adds run-description to test metrics collection (#861)

--- waiter/test/waiter/test_helpers.clj
+++ waiter/test/waiter/test_helpers.clj
@@ -67,6 +67,9 @@

 (defonce ^:private test-metrics-run-id
          (System/getenv "TEST_METRICS_RUN_ID"))
+
+(defonce ^:private test-metrics-run-description
+         (System/getenv "TEST_METRICS_RUN_DESCRIPTION"))

 (defonce ^:private git-repo
          (when test-metrics-url
@@ -199,6 +202,7 @@
                                         :host hostname
                                         :project "waiter"
                                         :result result
+                                        :run-description test-metrics-run-description
                                         :run-id test-metrics-run-id
                                         :runtime-milliseconds elapsed-millis
                                         :test-name name


Make sound more realistic on default play.

--- src/african_polyphony_and_polyrhythm/talk.clj
+++ src/african_polyphony_and_polyrhythm/talk.clj
@@ -282,7 +282,7 @@
 ; Instruments ;
 ;;;;;;;;;;;;;;;

-(definst drum [freq 440 vol 0.5 pan 0]
+(definst drum [freq 110 vol 0.5 pan 0]
   (-> (* 2/3 (brown-noise))
       (+ (* 1/2 (sin-osc (* 3 freq))))
       (+ (* 1/5 (sin-osc (* 5 freq))))
@@ -301,7 +301,7 @@
 (defmethod live/play-note :father [_]
   (drum 75 :pan 0 :vol 1.0))

-(definst whistle [freq 440 vol 0.5 pan 0 dur 1.0]
+(definst whistle [freq 660 vol 0.5 pan 0 dur 0.5]
   (-> (sin-osc freq)
       (+ (* 1/2 (sin-osc 3) (sin-osc (* 3.01 freq))))
       (+ (* 1/5 (sin-osc (* 2 freq))))


change commit to do auto-validation

change commit to do auto-validation

--- src/client/untangled/components/ui/forms.cljs
+++ src/client/untangled/components/ui/forms.cljs
@@ -303,28 +303,29 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defn reset-from-entity!
-  "Reset the form from a given entity in your application database using an Om transaction. This assumes your entity and form match on field names. If remote
-   is supplied then the indicated entity is first loaded from the server (via a direct entity ident join query to the server). You
-   may compose your own Om transactions and use `(untangled.components.form/reset-from-entity! {:entity-ident [:id id] :form-id fid})` directly."
-  ([comp-or-reconciler form] (reset-from-entity! comp-or-reconciler form false))
-  ([comp-or-reconciler form remote]                         ; FIXME: No remote yet
-   (let [form-id (form-id form)]
-     ; FIXME: post mutation needs ability to take args! UNTESTED!!!!
-     ;(df/load comp-or-reconciler entity-ident entity-class {:post-mutation 'untangled.components.form/reset-from-entity! :post-mutation-params params})
-     (om/transact! comp-or-reconciler `[(untangled.components.form/reset-from-entity! ~{:form-id form-id})
-                                        (untangled.components.form/validate-form! ~{:form-id form-id}) :ui/form-root]))))
+  "Reset the form from a given entity in your application database using an Om transaction and update the validation state.
+   You may compose your own Om transactions and use `(untangled.components.form/reset-from-entity! {:form-id [:entity id]})` directly."
+  [comp-or-reconciler form]
+  (let [form-id (form-id form)]
+    (om/transact! comp-or-reconciler `[(untangled.components.form/reset-from-entity! ~{:form-id form-id})
+                                       (untangled.components.form/validate-form! ~{:form-id form-id}) :ui/form-root])))

 (defn commit-to-entity!
   "Copy the given form state into the given entity. If remote is supplied, then it will optimistically update the app
-  database and also post the entity to the server. For remotes to work you must implement
-  `(untangled.components.form/commit-to-entity! {:ident [:id id] :value {...})` on the server. "
+  database and also post the entity to the server.
+
+  IMPORTANT: This function checks the validity of the form. If it is invalid, it will NOT commit the changes, but will
+  instead trigger an update of the form in the UI to show validation errors.
+
+  For remotes to work you must implement `(untangled.components.form/commit-to-entity! {:form-id [:id id] :value {...})`
+  on the server. "
   ([comp-or-reconciler form] (commit-to-entity! comp-or-reconciler form false))
   ([comp-or-reconciler form remote]
    (let [validated-form (validate-fields form)]
      (if (valid? validated-form)
        (let [form-id (form-id form)]
          (om/transact! comp-or-reconciler `[(untangled.components.form/commit-to-entity! ~{:form-id form-id :remote remote}) :ui/form-root]))
-       (log/error "Cannot commit. Form did not validate.")))))
+       (om/transact! comp-or-reconciler `[(untangled.components.form/validate-form! ~{:form-id form-id}) :ui/form-root])))))

 ;; Mutation for moving form data from the form into an entity
 (defmethod m/mutate 'untangled.components.form/commit-to-entity! [{:keys [state ast]} k {:keys [form-id remote]}]


some lazyness is not bad :)

some lazyness is not bad :)

--- src/clojure_learning/with-clojure-playing.clj
+++ src/clojure_learning/with-clojure-playing.clj
@@ -715,3 +715,38 @@
 (let [[_ & tail-args] (range 9)]
   (-> tail-args
       last)); 8
+
+;; how to build a lazy iteration using recursion:: simulating the [range] func again
+(defn lazy-range
+  [start-bound upper-bound]
+  (lazy-seq
+     (when (< start-bound upper-bound)
+       (cons start-bound (lazy-range (inc start-bound) upper-bound)))))
+
+(lazy-range 0 10); (0 1 2 .. 9)
+(class (lazy-range 0 10)); clojure.lang.LazySeq
+;; how to read this in clojure: mark the returned sequence using the top-level lazy-seq macro, providing
+;; it's body; [when] returns [nil] when the cond fails when the function is called.
+;; taking 0 10 -> (...cons 9 (nil))
+;; cons 9 is the last condition that mets the [when] clause, while [nil] is the returned expression of the
+;; failing-when condition for start-bound being equal to upper-bound;
+;; this opens the gate that in clojure: cons 1 nil -> will treat nil as an empty container: and return (1)
+(cons 1 nil); 1
+;; therefore: recursive invocation... (cons 1 (...cons 9 (nil))) -> (cons 1 (...(cons 8 (9))))
+;; cons -> will push on the start of the sequence each number; the recursivity is BUILDING the
+;; actual sequence
+
+#_(let [r (range 1e9)]
+  (first r)
+  (last r))
+
+#_(let [r (range 1e9)]
+  (first r)
+  (last r))
+
+;; if those sequences are executed one after the other -> then OutOfMemoryError is triggered, since the compiler
+;; do NOT rearrange the code in Clojure, because the ORDER MIGHT MATTER!
+;; we can keep a sequence in memory if we bind the head of that sequence to a local variable. In this case
+;; the reference to the sequence is lost right after the [last] invocation completes -> the in-memory obejcts are cleared
+;; by the compiler with force brute. The second binding, again creates that in memory ds, but when the [last] func returns
+;; the compiler is overflooded. and crashes, because it will NOT perform any rearranging on the code.


Whitespace fix

Whitespace fix

--- benchmarks/caesium/crypto/secretbox_benchmark.clj
+++ benchmarks/caesium/crypto/secretbox_benchmark.clj
@@ -63,7 +63,6 @@
   (.crypto_secretbox_easy sodium out msg (.remaining msg) nonce key)
   out)

-
 (def sizes (map (partial bit-shift-left 1) [6 8 10 12 20 24]))

 (defmacro bench-secretnonce


Fixed bug in explicit regress-state

Fixed bug in explicit regress-state

--- src/edu/berkeley/ai/angelic/descriptions_and_valuations.clj
+++ src/edu/berkeley/ai/angelic/descriptions_and_valuations.clj
@@ -316,7 +316,7 @@

 (defmethod regress-state    [::ExplicitValuation ::FinishDescription ::Valuation] [state preval desc postval]
   (if-let [s (util/find-first #(envs/satisfies-condition? % (util/safe-get desc :goal))
-			 (keys (explicit-valuation-map val)))]
+			 (keys (explicit-valuation-map preval)))]
     [s 0]))


fix stdout link (#567)

fix stdout link (#567)

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/monitor/workflow_details.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/monitor/workflow_details.cljs
@@ -112,10 +112,8 @@
               (create-field "Ended" (moncommon/render-date (data "end")))
               [IODetail {:label "Inputs" :data (data "inputs")}]
               [IODetail {:label "Outputs" :data (data "outputs")}]
-              (let [stdout-name (last (string/split (data "stdout") #"/"))
-                    stderr-name (last (string/split (data "stderr") #"/"))]
-              (create-field "stdout" (display-value (data "stdout") stdout-name))
-              (create-field "stderr" (display-value (data "stderr") stderr-name)))
+              (create-field "stdout" (display-value (data "stdout") (last (string/split (data "stdout") #"/"))))
+              (create-field "stderr" (display-value (data "stderr") (last (string/split (data "stderr") #"/"))))
               (backend-logs data)]])
           (:data props)))])})


Fix a place where failed to redirect output to WebDAV.

--- Clojure/src/ambly/repl/jsc.clj
+++ Clojure/src/ambly/repl/jsc.clj
@@ -185,6 +185,7 @@
       ;; for all compiled namespaces
       (apply closure/output-unoptimized
         (assoc opts
+          :output-dir webdav-mount-point
           :output-to (.getPath (io/file output-dir "ambly_repl_deps.js")))
         deps))
     ;; Set up CLOSURE_IMPORT_SCRIPT function, injecting path


:nail_care:

--- src/com/wsscode/pathom/connect/run_graph.cljc
+++ src/com/wsscode/pathom/connect/run_graph.cljc
@@ -138,33 +138,38 @@
         (update-in [::index-syms (pc-sym node)] disj node-id)
         (update ::nodes dissoc node-id))))

+(defn merge-node-requires [out target-node-id {::keys [requires]}]
+  (update-in out [::nodes target-node-id ::requires] merge-io requires))
+
+(defn merge-node-provides [out target-node-id {::keys [provides]}]
+  (update-in out [::nodes target-node-id ::provides] merge-io provides))
+
 (defn add-branch-node
   [{::keys [root] :as out}
    {::keys [branch-type] :as env}
-   {::keys [node-id] :as node}]
-  (let [merge-node-id (find-dynamic-node-to-merge out env node)]
+   {::keys [node-id]}]
+  (let [node          (get-node out node-id)
+        merge-node-id (find-dynamic-node-to-merge out env node)]
     (if merge-node-id
-      (let [{::keys [requires provides] :as node} (get-node out node-id)]
-        (-> out
-            (update-in [::nodes merge-node-id ::requires] merge-io requires)
-            (update-in [::nodes merge-node-id ::provides] merge-io provides)
-            (update-in [::nodes root ::requires] merge-io requires)
-            (remove-node node)
-            (propagate-provides {::node-id merge-node-id})
-            (simplify-branch env)))
-      (let [optimize-next? (optimize-merge? out node)]
-        (-> out
-            (update-in [::nodes root branch-type] conj node-id)
-            (update-in [::nodes root ::provides] merge-io (get-in out [::nodes node-id ::provides]))
-            (update-in [::nodes node-id] assoc ::after-node root)
-            (cond->
-              (= branch-type ::run-and)
-              (-> (update-in [::nodes root ::requires] merge-io (get-in out [::nodes node-id ::requires])))
-
-              optimize-next?
-              (-> (update-in [::nodes node-id] dissoc ::run-next)
-                  (update-in [::nodes node-id] reset-provides env)))
-            (simplify-branch env))))))
+      (-> out
+          (merge-node-requires merge-node-id node)
+          (merge-node-provides merge-node-id node)
+          (merge-node-requires root node)
+          (remove-node node)
+          (propagate-provides {::node-id merge-node-id})
+          (simplify-branch env))
+      (-> out
+          (update-in [::nodes root branch-type] conj node-id)
+          (merge-node-provides root node)
+          (update-in [::nodes node-id] assoc ::after-node root)
+          (cond->
+            (= branch-type ::run-and)
+            (merge-node-requires root node)
+
+            (optimize-merge? out node)
+            (-> (update-in [::nodes node-id] dissoc ::run-next)
+                (update-in [::nodes node-id] reset-provides env)))
+          (simplify-branch env)))))

 (defn create-branch-node
   [{::keys [root] :as out} env node branch-node]
@@ -271,7 +276,7 @@
                   (assoc ::index-syms (::index-syms new-out))
                   (assoc-in [::nodes node-id ::run-next] (::root new-out))
                   (assoc-in [::nodes (::root new-out) ::after-node] node-id)
-                  (update-in [::nodes node-id ::provides] merge-io (::provides next-node))
+                  (merge-node-provides node-id next-node)
                   (propagate-provides node)
                   (update ::extended-nodes p.misc/sconj node-id)))))
         out


Delete example endpoint

Delete example endpoint

--- webapp/src/org/teamweek/webapp/endpoint/example.clj
+++ webapp/src/org/teamweek/webapp/endpoint/example.clj
@@ -1,8 +0,0 @@
-(ns org.teamweek.webapp.endpoint.example
-  (:require [compojure.core :refer :all]
-            [clojure.java.io :as io]))
-
-(defn example-endpoint [config]
-  (context "/example" []
-    (GET "/" []
-      (io/resource "org/teamweek/webapp/endpoint/example/example.html"))))


prep for using component names in class names; failing devcards tests

--- src/devcards/om_css/devcards/core.cljs
+++ src/devcards/om_css/devcards/core.cljs
@@ -30,8 +30,8 @@
 (deftest namespaced-classnames-in-dom
   (testing "classnames are namespace qualified"
     (let [c (gdom/getElement "ns-test")]
-      (is (not (nil? (gdom/getElementByClass "om_css_devcards_core_root"))))
-      (is (not (nil? (gdom/getElementByClass "om_css_devcards_core_section"))))
+      (is (not (nil? (gdom/getElementByClass "om_css_devcards_core_Foo_root"))))
+      (is (not (nil? (gdom/getElementByClass "om_css_devcards_core_Foo_section"))))
       (is (not (nil? (gdom/getElementByClass "preserved")))))))

 (defui Bar