cleaned up code a bit

cleaned up code a bit

--- src/frontend/uploads.cljs
+++ src/frontend/uploads.cljs
@@ -129,16 +129,15 @@
 (defn handle-unpause! [uploads uploads-order upload-slots active-uploads upload-id]
   (if (> (count (active-uploads uploads-order uploads))
           upload-slots)
-    (let [uploads-order-after-id (uploads-after-id uploads-order upload-id)
-          upload-to-stop-id (last (active-uploads uploads-order uploads))]
+    (let [upload-to-stop-id (last (active-uploads uploads-order uploads))
+          upload-to-stop (uploads upload-to-stop-id)]
       (println "upload-to-stop" upload-to-stop-id)
-      (if-let [upload-to-stop (uploads upload-to-stop-id)]
-        (swap! app-state/app-state
-               assoc
-               :uploads
-               (assoc (:uploads @app-state/app-state)
-                      upload-to-stop-id
-                      (stop-upload upload-to-stop)))))
+      (swap! app-state/app-state
+             assoc
+             :uploads
+             (assoc (:uploads @app-state/app-state)
+                    upload-to-stop-id
+                    (stop-upload upload-to-stop))))
     (if-not (active? (uploads upload-id))
       (swap! app-state/app-state
              assoc


Remove `path` from MetricSnapshot as it's never used

Avoid using atoms within nbhm, as nbhm updates are already atomic.

--- src/io/cyanite/engine.clj
+++ src/io/cyanite/engine.clj
@@ -27,7 +27,7 @@
   (let [p (:precision resolution)]
     (* p (quot now p))))

-(defrecord MetricSnapshot [path time mean min max sum])
+(defrecord MetricSnapshot [time mean min max sum])

 (defrecord MetricMonoid [count minv maxv sum]
   Ingester
@@ -38,24 +38,26 @@
                    (+ sum val)))
   Snapshoter
   (snapshot! [this now]
-    (MetricSnapshot. nil now (double (/ sum count)) minv maxv sum)))
+    (MetricSnapshot. now (double (/ sum count)) minv maxv sum)))
+
+(defn new-monoid
+  []
+  (MetricMonoid. 0 nil nil 0))

 (defrecord MetricResolution [resolution slots]
   Ingester
   (ingest! [this metric]
     (let [val        (:metric metric)
           slot       (time-slot resolution (:time metric))
-          new-monoid #(atom (MetricMonoid. 0 nil nil 0))
           monoid     (or (get slots slot) (new-monoid))]
-      (assoc-if-absent! slots slot monoid)
-      (swap! monoid ingest! val)))
+      (.assoc slots slot (ingest! monoid val))))
   Snapshoter
   (snapshot! [this now]
     (let [floor    (time-slot resolution now)
           to-purge (filter #(< (key %) floor) (entries slots))]
       (doseq [slot (map key to-purge)]
         (remove! slots slot))
-      (mapv #(snapshot! @(val %) (key %)) to-purge))))
+      (mapv #(snapshot! (val %) (key %)) to-purge))))

 (defn make-resolutions
   [rules metric]


Normalize collections from clj-yaml

Normalize collections from clj-yaml

--- src/io/perun/markdown.clj
+++ src/io/perun/markdown.clj
@@ -2,8 +2,11 @@
   (:require [io.perun.core   :as perun]
             [clojure.java.io :as io]
             [clojure.string  :as str]
-            [clj-yaml.core   :as yaml])
-    (:import [org.pegdown PegDownProcessor Extensions]))
+            [clj-yaml.core   :as yaml]
+            [clojure.walk    :as walk])
+  (:import [org.pegdown PegDownProcessor Extensions]
+           [flatland.ordered.map OrderedMap]
+           [flatland.ordered.set OrderedSet]))

 ;; Extension handling has been copied from endophile.core
 ;; See https://github.com/sirthias/pegdown/blob/master/src/main/java/org/pegdown/Extensions.java
@@ -59,9 +62,21 @@
             (str/split suffix)
             first)))

+(defn normal-colls
+  "Clj-yaml keeps order of map properties by using ordered maps. These are inconvenient
+  for us as the ordered library is not necessarily available in other pods."
+  [x]
+  (walk/postwalk
+    (fn [y]
+      (cond
+        (instance? OrderedMap y) (into {} y)
+        (instance? OrderedSet y) (into #{} y)
+        :else y))
+    x))
+
 (defn parse-file-metadata [file-content]
   (if-let [metadata-str (substr-between file-content #"---\n" #"---\n")]
-    (if-let [parsed-yaml (yaml/parse-string metadata-str)]
+    (if-let [parsed-yaml (normal-colls (yaml/parse-string metadata-str))]
       ; we use `original` file flag to distinguish between generated files
       ; (e.x. created those by plugins)
       (assoc parsed-yaml :original true)
@@ -86,7 +101,7 @@
   (let [file-content (-> file :full-path io/file slurp)
         md-metadata (parse-file-metadata file-content)
         html (markdown-to-html file-content options)]
-        (merge md-metadata {:content html} file)))
+    (merge md-metadata {:content html} file)))

 (defn parse-markdown [markdown-files options]
   (let [updated-files (doall (map #(process-file % options) markdown-files))]


Unprivate for lein-plugin.

Unprivate for lein-plugin.

--- src/leiningen/uberjar.clj
+++ src/leiningen/uberjar.clj
@@ -41,8 +41,9 @@
     [(into skip-set (copy-entries zipfile out #(skip-set (.getName %))))
      (concat components (read-components zipfile))]))

-(defn- write-components [deps out]
-  ;; TODO: need documentation; I have no idea what this is for. Alex!
+(defn write-components
+  "Given a list of jarfiles, writes contents to a stream"
+  [deps out]
   (let [[_ components] (reduce (partial include-dep out)
                                [#{"META-INF/plexus/components.xml"} nil]
                                deps)]


yeeeeah save keys

yeeeeah save keys

--- src/mediakeys/hotkeys.clj
+++ src/mediakeys/hotkeys.clj
@@ -1,5 +1,5 @@
 (ns mediakeys.hotkeys
-    (:use [mediakeys.file :only [DEFAULT_KEYS]]
+    (:use [mediakeys.file :only [DEFAULT_KEYS save-keys]]
            mediakeys.rx))

 (import [com.tulskiy.keymaster.common Provider HotKeyListener])
@@ -25,7 +25,9 @@
 (defn key-config! [key-changes]
     (map key-changes
         (fn [key-update]
-            (swap! current-keys #(merge % key-update)))))
+            (swap! current-keys #(merge % key-update))
+            (save-keys @current-keys)
+            @current-keys)))

 (defn keypress-events! [key-changes]
     (-> key-changes


Cleaned up code.

Cleaned up code.

--- src/midje/ideas/facts.clj
+++ src/midje/ideas/facts.clj
@@ -56,6 +56,37 @@
                              :description @midje.internal-ideas.fact-context/nested-descriptions
                              :position (midje.internal-ideas.file-position/line-number-known ~lineno)}))))

+                                ;;; Fact processing
+
+;; There are three stages to fact processing:
+;; * Body processing: the convertion of arrow and provided forms into their
+;;   semi-sweet forms, the insertion of background data, line numbering, etc.
+;;
+;; * Compendium processing: wrapping the body in a function form that supports
+;;   rerunning and history keeping.
+;;
+;; * Load-time processing: wrapping the final form in code that does whatever
+;;   should be done the first time the fact is loaded. (Such as running it for
+;;   the first time.)
+
+;;; Support code
+
+(def ^{:dynamic true} *parse-time-fact-level* 0)
+
+(defn- working-on-top-level-fact? []
+  (= *parse-time-fact-level* 1))
+
+(defmacro given-possible-fact-nesting [& forms]
+  `(binding [*parse-time-fact-level* (inc *parse-time-fact-level*)]
+     ~@forms))
+
+(defmacro working-on-nested-facts [& forms]
+  ;; Make sure we don't treat this as a top-level fact
+  `(binding [*parse-time-fact-level* (+ 2 *parse-time-fact-level*)]
+     ~@forms))
+
+;;; Body Processing
+
 (defn to-semi-sweet
   "Convert sweet keywords into their semi-sweet equivalents.
    1) Arrow sequences become expect forms.
@@ -90,48 +121,29 @@
     sequential?  (preserve-type form (eagerly (map midjcoexpand form)))
     :else        form))

-
-;;; Macroexpansion-time support functions
-
-(def ^{:dynamic true} *parse-time-fact-level* 0)
-
-(defn- working-on-top-level-fact? []
-  (= *parse-time-fact-level* 1))
-
-(defmacro given-possible-fact-nesting [& forms]
-  `(binding [*parse-time-fact-level* (inc *parse-time-fact-level*)]
-     ~@forms))
-
-(defmacro working-on-nested-facts [& forms]
-  ;; Make sure we don't treat this as a top-level fact
-  `(binding [*parse-time-fact-level* (+ 2 *parse-time-fact-level*)]
-     ~@forms))
-
-;; ;; The rather hackish construction here is to keep
-;; ;; the expanded fact body out of square brackets because
-;; ;; `tabular` expansions use `seq-zip`.
-
-;; (defn wrap-with-creation-time-fact-recording [function-form]
-;;   (if (working-on-top-level-fact?)
-;;     `((fn [fact-function#]
-;;         (record-fact-existence fact-function#)
-;;         fact-function#)
-;;       ~function-form)
-;;     function-form))
-
-
-;; (defn convert-to-fact-function [to-be-wrapped this-function-here-symbol metadata]
-;;   `(letfn [(base-function# [] ~to-be-wrapped)
-;;            (~this-function-here-symbol []
-;;              (with-meta base-function# '~metadata))]
-;;      (~this-function-here-symbol)))
-
+(defn expand-fact-body [forms metadata]
+    (letfn [(wrap-in-runtime-fact-context [to-be-wrapped]
+              `(within-runtime-fact-context ~(:midje/description metadata)
+                                            ~to-be-wrapped))]
+      (-> forms
+          annotate-embedded-arrows-with-line-numbers
+          to-semi-sweet
+          unfold-fakes
+          surround-with-background-fakes
+          midjcoexpand
+          (multiwrap (forms-to-wrap-around :facts))
+          wrap-in-runtime-fact-context
+          report/form-providing-friendly-return-value)))
+
+
+;;; Compendium processing

 (defn convert-expanded-body-to-compendium-form
   ([expanded-body metadata]
      (convert-expanded-body-to-compendium-form expanded-body metadata
                                                (gensym 'this-function-here-)))
-
+
+  ;; Having two versions lets tests not get stuck with a gensym.
   ([expanded-body metadata this-function-here-symbol]
      (letfn [(put-check-time-fact-recording-in-body [body]
                (if (working-on-top-level-fact?)
@@ -149,45 +161,30 @@
            put-check-time-fact-recording-in-body
            make-a-form-that-returns-a-fact-function-that-knows-itself))))

-            ;; The rather hackish construction here is to keep
-            ;; the expanded fact body out of square brackets because
-            ;; `tabular` expansions use `seq-zip`.
-(defn wrap-with-creation-time-fact-recording [function-form]
-  (if (working-on-top-level-fact?)
-    `((fn [fact-function#]
-        (record-fact-existence fact-function#)
-        fact-function#)
-      ~function-form)
-    function-form))
-
-
-
-
-(defn run-after-creation [function-form]
-  `(~function-form))
-
-(defn complete-fact-transformation [metadata forms]
-  (given-possible-fact-nesting
-    (let [wrap-in-runtime-fact-context
-          (fn [to-be-wrapped]
-            `(within-runtime-fact-context ~(:midje/description metadata)
-                                          ~to-be-wrapped))
-          form-to-run (-> forms
-                          annotate-embedded-arrows-with-line-numbers
-                          to-semi-sweet
-                          unfold-fakes
-                          surround-with-background-fakes
-                          midjcoexpand
-                          (multiwrap (forms-to-wrap-around :facts))
-                          wrap-in-runtime-fact-context
-                          report/form-providing-friendly-return-value
-                          (convert-expanded-body-to-compendium-form metadata)
-                          wrap-with-creation-time-fact-recording
-                          run-after-creation)]
-      (define-metaconstants form-to-run)
-      form-to-run)))
-
-
+
+;;; Load-time processing
+
+(defn wrap-with-load-time-code [function-form]
+  (letfn [;; The rather hackish construction here is to keep
+          ;; the expanded fact body out of square brackets because
+          ;; `tabular` expansions use `seq-zip`.
+          (wrap-with-creation-time-fact-recording [function-form]
+            (if (working-on-top-level-fact?)
+              `((fn [fact-function#]
+                  (record-fact-existence fact-function#)
+                  fact-function#)
+                ~function-form)
+              function-form))
+
+          (run-after-creation [function-form]
+            `(~function-form))]
+
+    (define-metaconstants function-form)
+    (-> function-form
+        wrap-with-creation-time-fact-recording
+        run-after-creation)))
+
+;;; There could be validation here, but none has proven useful.

 (def-many-methods validate ["fact" "facts"] [[fact-or-facts & args :as form]]
   ;; Removed the check for no arrow because (1) it gives me too many false
@@ -200,4 +197,13 @@
   ;;     (format "There is no arrow in your %s form:" (name fact-or-facts)))))
   )

-
+
+;;; Ta-da!
+
+(defn complete-fact-transformation [metadata forms]
+  (given-possible-fact-nesting
+   (-> forms
+       (expand-fact-body metadata)
+       (convert-expanded-body-to-compendium-form metadata)
+       wrap-with-load-time-code)))
+


made user-file-position clojure 1.1 and 1.2 compatible

--- src/midje/unprocessed.clj
+++ src/midje/unprocessed.clj
@@ -3,7 +3,7 @@
         midje.report
         clojure.contrib.error-kit
         [clojure.contrib.ns-utils :only [immigrate]]
-        [clojure.contrib.seq-utils :only [partition-by find-first]]))
+        [clojure.contrib.seq-utils :only [find-first]]))
 (immigrate 'midje.checkers)

@@ -24,34 +24,11 @@
    	  (pairs actual-args matchers))
 )

-(defn- contains-element?
-  "Is the element in the sequence? Works for vectors."
-  [seq elt]
-  (some #{elt} seq))
-
-(defn- midje-file? [position]
-  (contains-element? ["semi_sweet.clj" "unprocessed.clj"] (first position))
-)
-
-(defn- without-java [positions]
-  (remove (fn [position] (re-find #"\.java" (first position)))
-	  positions))
-
-(defn- strip-leading-infrastructure [positions]
-  (let [ [clojure-core midje-files & more-partitions] (partition-by midje-file? positions)]
-    (first more-partitions))
-)
-
 (defn user-file-position []
   "Guesses the file position (basename and line number) that the user is
    most likely to be interested in if a test fails."
-  (try
-   (let [integers (iterate inc 1)
-	 positions (without-java (map file-position integers))
-	 above-midje-files (strip-leading-infrastructure positions)
-	 ]
-     (first above-midje-files))
-   (catch Exception e ["unknown file" 0]))
+  (second (map #(list (.getFileName %) (.getLineNumber %))
+               (.getStackTrace (Throwable.))))
 )

 (defn- unique-function-vars [expectations]


Fix partition resume on recover, ensure drain messages get flushed.

--- src/onyx/plugin/kafka.clj
+++ src/onyx/plugin/kafka.clj
@@ -200,17 +200,17 @@
                          [p (if drained? :emitted :reading)]))
                      kpartitions))
           resuming-tps (reduce-kv
-                        (fn [all k v]
+                        (fn [all part v]
                           (if (not (some #{v} #{:emitted :drained}))
-                            (conj all (TopicPartition. topic v))
+                            (conj all (TopicPartition. topic part))
                             all))
                         []
                         partition-statuses)]
       (.resume consumer resuming-tps)
-      (reset! drained partition-statuses))
-    (set! iter nil)
-    (set! partition->offset checkpoint)
-    (seek-offset! log-prefix consumer kpartitions task-map topic checkpoint)
+      (reset! drained partition-statuses)
+      (set! iter nil)
+      (set! partition->offset checkpoint)
+      (seek-offset! log-prefix consumer kpartitions task-map topic checkpoint))
     this)

   (checkpointed! [this epoch])
@@ -218,7 +218,7 @@
   p/BarrierSynchronization
   (synced? [this epoch]
     (set-lag! lag-gauge consumer)
-    true)
+    (empty? (filter (fn [[_ state]] (= state :drained)) @drained)))

   (completed? [this]
     (empty? (filter #(not= :emitted %) (vals @drained))))


Added defmethod's for instr-control-f so that we can use patterns in section control data

--- src/overtime/patterns.clj
+++ src/overtime/patterns.clj
@@ -1,7 +1,8 @@
 (ns overtime.patterns
   (:require [overtone.core :as ot]
-            [clojure.tools.logging :as log]
-            [overtime.utils :as u]))
+            [overtime.sect-control :as sect]
+            [overtime.utils :as u]
+            [clojure.tools.logging :as log]))

 (defonce ^:private patterns (atom {}))
@@ -90,10 +91,16 @@
     (swap! pattern update-in [:params] merge (apply hash-map params))
     true))

+(defn change-pattern-at [time pattern-key & params] (u/apply-by time (apply change-pattern pattern-key params)))
+
 (defn pattern-value
   [pattern-key param-key]
   (let [pattern (get-pattern pattern-key)]
     (param-key (:params @pattern))))
+
+
+(defmethod sect/instr-control-f :pat [_event-data] do-pattern-at)
+(defmethod sect/instr-control-f :patd [_event-data] change-pattern-at)

 (comment


why doesn't defonce take docstrings this is 2015

--- src/riemann/transport.clj
+++ src/riemann/transport.clj
@@ -35,7 +35,7 @@
     (java.net InetAddress
               UnknownHostException)))

-(defonce ioutil-lock
+(def ioutil-lock
   "There's a bug in JDK 6, 7, and 8 which can cause a deadlock initializing
   sse-server and netty concurrently; we serialize them with this lock.
   https://github.com/aphyr/riemann/issues/617"


perform additional checks before executing side-effects

--- src/scrum/reconciler.cljs
+++ src/scrum/reconciler.cljs
@@ -72,15 +72,21 @@
         (let [effects
               (map (fn [[cname ctrl]] [cname (ctrl)]) @queue)]
           (clear-queue! queue)
-          (when-let [state-effects (filter (comp :state second) effects)]
-            (swap! state
-              #(reduce (fn [agg [cname {cstate :state}]]
-                         (assoc agg cname cstate))
-                       % state-effects)))
-          (m/doseq [[cname effects] effects]
-            (m/doseq [[id effect] effects]
-              (when-let [handler (get effect-handlers id)]
-                (handler this cname effect))))))))
+          (let [state-effects (filter (comp :state second) effects)
+                other-effects (->> effects
+                                   (map (fn [[cname effect]]
+                                          [cname (dissoc effect :state)]))
+                                   (filter (comp seq second)))]
+            (when (seq state-effects)
+              (swap! state
+                #(reduce (fn [agg [cname {cstate :state}]]
+                           (assoc agg cname cstate))
+                         % state-effects)))
+            (when (seq other-effects)
+              (m/doseq [[cname effects] effects]
+                (m/doseq [[id effect] effects]
+                  (when-let [handler (get effect-handlers id)]
+                    (handler this cname effect))))))))))

   (dispatch-sync! [this cname action args]
     (let [effects ((get controllers cname) action args (get @state cname))]


mc: fix proj dependencies

mc: fix proj dependencies

--- memcache/project.clj
+++ memcache/project.clj
@@ -1,17 +1,22 @@
-(defproject migae/migae-memcache "0.1.0-SNAPSHOT"
+(defproject org.mobileink.migae/memcache "0.1.0-SNAPSHOT"
   :description "migae - Mobile Ink Google App Engine sdk for Clojure."
   :url "https://github.com/greynolds/migae"
   :min-lein-version "2.0.0"
   :aot [#".*"]
   :test-selectors {:stats :stats
                    :put :put
+                   :miss :miss
                    :del :del
                    :incr :incr}
   :dependencies [[org.clojure/clojure "1.5.1"]
-                 [com.google.appengine/appengine-api-1.0-sdk "1.8.3"]]
-  :profiles {:test
-             {:dependencies [[com.google.appengine/appengine-api-1.0-sdk "1.8.3"]
-                             [com.google.appengine/appengine-api-stubs "1.8.3"]
-                             [com.google.appengine/appengine-testing "1.8.3"]]}})
+                 [com.google.appengine/appengine-api-1.0-sdk "1.8.4"]
+                 [log4j "1.2.17" :exclusions [javax.mail/mail
+                                              javax.jms/jms
+                                              com.sun.jdmk/jmxtools
+                                              com.sun.jmx/jmxri]]
+                 [org.slf4j/slf4j-log4j12 "1.6.6"]
+                 [org.clojure/tools.logging "0.2.3"]]
+  :profiles {:test {:dependencies [[com.google.appengine/appengine-api-stubs "1.8.4"]
+                                   [com.google.appengine/appengine-testing "1.8.4"]
+                                   [ring-zombie "1.0.1"]]}})

-


don't accidentally move stage when trying to zoom

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

--- plugins/SlideExplorer2/src/slide_explorer/user_controls.clj
+++ plugins/SlideExplorer2/src/slide_explorer/user_controls.clj
@@ -295,7 +295,7 @@
 (defn handle-double-click [panel response-fn]
   (handle-click panel
                 (fn [e] (and (= MouseEvent/BUTTON1 (.getButton e))
-                             (not (menu-accelerator-down? e))
+                             (not (or (.isAltDown e) (menu-accelerator-down? e)))
                              (= 2 (.getClickCount e))))
                 response-fn))


Remove unnecessary clients atom

Remove unnecessary clients atom

--- src/ws_eb_sample/core.clj
+++ src/ws_eb_sample/core.clj
@@ -4,18 +4,14 @@
             [org.httpkit.server :as ws])
   (:gen-class))

-(def clients (atom {}))
-
 (defn handle-websocket [req]
   (ws/with-channel req con
     (println "Connection from" con)
-    (swap! clients assoc con true)

     (ws/on-receive con #(ws/send! con (str "You said: " %)))

     (ws/on-close con (fn [status]
-                       (println con "disconnected with status" (name status))
-                       (swap! clients dissoc con)))))
+                       (println con "disconnected with status" (name status))))))

 (defroutes routes
   (GET "/ws" [] handle-websocket))


Take 123123123123 of implicit in progress.

--- src/angelic/search/incremental/implicit_fah_astar.clj
+++ src/angelic/search/incremental/implicit_fah_astar.clj
@@ -9,7 +9,10 @@
             [angelic.hierarchy.util :as hierarchy-util]
             [angelic.hierarchy.state-set :as state-set]
             [angelic.hierarchy.angelic :as angelic]
-            [angelic.search.incremental.core :as is])
+            [angelic.search.incremental.core :as is]
+            [angelic.search.incremental.summary :as summary]
+;            [angelic.search.incremental.summaries :as summaries]
+            )
   (:import  [java.util HashMap]))

@@ -21,136 +24,192 @@

 ; ;What connection, if any, do pessimistic need with optimistic?

+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Misc. Utils ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;; Subproblem Protocols ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-
+;;Clear how costs must go
+;;How should sets go -- eager or lazy ? ? ???
+;;Can forget about sets -- switch to breakout children instead.
+
+;; Things:
+;; Action - Input - Output
+;; ActionSeq - Input
+;; RestrictedActionSeq
+
+;; How does all this change if leaves are leaves?
+;; Restricting input
+;; Where do the breaks go?
+;; Operation always =
+;; "expand 'first' or 'rest' of seq". ?
+;; expanding on the right should be automatic ?
+;; What if thing already has children?
+;; Not allowed to expand on the left until right is blocked?
+;; But this forces right-to-left spliting ?
+
+;; Think about this as subproblems, partial solutions.
+;; How do we handle case where subproblem is union, refined-output can grow over time ?
+;; Why did we need that nonsense anyway? ...
+;; ((can we get graphiness in another way?))
+;; ((what if we just allow cost decrease -- so waht ? ))
+;; Need lattice -- but it can be on the input side.
+
+(def no-children :terminal)
+
+(defprotocol Subproblem
+  (current-summary [s])
+  (child-keys      [s] "seq or no-children")
+  (get-child       [s child-key])
+  (refine-input    [s refined-input-set]))
+
+(def input-set :input-set)
+(def output-set :output-set)
+(defn get-child-map [s] (into {} (for [k (child-keys s)] [k (get-child s k)])))
+
+
+;; TODO: simple generic SimpleSubproblem record ?
+
+;; TODO: stop early on empty sets or bad rewards, etc.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Summary ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Planning Subproblems ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-;; Summary is the information passed upwards about a partial plan.
-;; For now, it consists of an (admissible) upper-bound on reward,
-;; a status enum -- :live, :blocked, or :solved,
-;; and if solved, an optimal solution.
-
-(defprotocol Summary
-  (max-reward       [s] "Admissible reward bound")
-  (live?            [s] "Can this be further refined?")
-  (optimal-solution [s] "Nil or optimal solution"))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Definition ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-
-; status is: :blocked, :solved, or :live
-;; blocked is "better" than live, since it is contagious over live w.r.t. max.
-(defn status-val [s]
-  (case s
-        :live    0
-        :blocked 1
-        :solved  2))
-
-
-(defrecord SimpleSummary [max-rew status opt-sol]
-  Summary
-  (max-reward       [s] max-rew)
-  (live?            [s] (= status :live))
-  (optimal-solution [s] (when (= status :solved) (assert opt-sol) opt-sol)))
-
-(defn make-live-summary [max-reward plan] (SimpleSummary. max-reward :live plan))
-(defn make-blocked-summary [max-reward plan] (SimpleSummary. max-reward :blocked plan))
-(defn make-solved-summary [max-reward opt-sol] (SimpleSummary. max-reward :solved opt-sol))
-
-(defn blocked? [summary]
-  (and (not (live? summary))
-       (not (optimal-solution summary))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Common Ops ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-(def +worst-summary+ (make-blocked-summary is/neg-inf []))
-(def +best-summary+  (make-live-summary is/pos-inf [])) ;; don't be too optimistic
-
-(defn better-summary? [s1 s2]
-  (or (> (max-reward s1)
-         (max-reward s2))
-      (and (= (max-reward s1)
-              (max-reward s2))
-           (> (status-val (:status s1))
-              (status-val (:status s2))))))
-
-(defn- max-compare [cf arg1 & args]
-  (if-let [[f & r] (seq args)]
-    (recur cf (if (cf f arg1) f arg1) r)
-    arg1))
-
-(defn max-summary [& stats] (apply max-compare better-summary? (cons +worst-summary+ stats) ))
-;(defn min-summary [& stats] (apply max-compare (complement better-summary?) (cons +best-summary+ stats)))
-
-(defn bound-summary [summary max-rew]
-  (when (optimal-solution summary) (util/assert-is (<= (max-reward summary) max-rew)))
-  (SimpleSummary. (min max-rew (:max-rew summary)) (:status summary) (:opt-sol summary)))
-
-(defn next-min-reward [stat min-reward] (max min-reward (max-reward stat)))
-
-(def zero-summary (SimpleSummary. 0 :solved []))
-(defn add-summaries [s1 s2]
-  (SimpleSummary. (+ (max-reward s1)
-              (max-reward s2))
-           (min-key status-val (:status s1) (:status s2))
-           #_(when (and (= (:status s1) :solved) (= (:status s2) :solved)))
-           (concat (:opt-sol s1) (:opt-sol s2))))
-
-
-(defn viable-summary? [summary]
-  (> (max-reward summary) is/neg-inf))
-
-(defn refinable-summary? [stat min-reward]
-  (and (= (:status stat) :live)
-       (>= (max-reward stat) min-reward)))
-
-(defn summary-solution [stat]
-  (when (= (:status stat) :solved)
-    (:opt-sol stat)))
-
-
-
-(defn extract-best-and-summaries
-  "Return [best-item best-summary rest-items rest-summary]"
-  [summary-fn things]
-  (assert (seq things))
-  (loop [best-thing   (first things)
-         best-summary (summary-fn (first things))
-         rest-things  []
-         rest-summary  +worst-summary+
-         more-things  (rest things)]
-      (if-let [[next-thing & even-more-things] (seq more-things)]
-        (let [next-summary (summary-fn next-thing)]
-          (if (better-summary? next-summary best-summary)
-            (recur next-thing next-summary
-                   (conj rest-things best-thing) best-summary even-more-things)
-            (recur best-thing best-summary
-                   (conj rest-things next-thing) (max-summary next-summary rest-summary) even-more-things)))
-        [best-thing best-summary rest-things rest-summary])))
-
-(defn summary-str [s] (str "Summary:" (max-reward s) (:status s) #_ (vec (:opt-sol s))))
-(defmethod print-method SimpleSummary [s o] (print-method (summary-str s) o))
-
-(defmacro assert-valid-summary-change
-  ([old-summary new-summary] ( assert-valid-summary-change old-summary new-summary ""))
-  ([old-summary new-summary msg]
-     `(do (util/assert-is (<= (max-reward ~new-summary) (max-reward ~old-summary)) "%s" [~old-summary ~new-summary ~msg])
-        (when-not (live? ~old-summary) (assert (= ~old-summary ~new-summary))))))
-
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Data Structures ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(declare make-primitive-subproblem)
+(declare make-hla-subproblem)
+(declare make-atomic-subproblem)
+(declare make-seq-subproblem)
+(declare make-wrapper-subproblem)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Primitive ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; No need to worry about supers?
+(defrecord PrimitiveSubproblem [input-set action output-set summary]
+  Subproblem
+  (current-summary [s] summary)
+  (child-keys      [s] no-children)
+  (get-child       [s child-key] (throw (RuntimeException.)))
+  (refine-input    [s refined-input-set]
+    (if (= input-set refined-input-set)
+      s
+      (make-primitive-subproblem refined-input-set action))))
+
+(defn make-primitive-subproblem [input-set action]
+  (let [[output-set rew] (angelic/optimistic-set-and-reward action input-set)]
+    (PrimitiveSubproblem. input-set action output-set (summary/make-solved-simple-summary rew action ))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; HLA ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defrecord HlaSubproblem [super-hs input-set action output-set
+                          summarizer child-map ^HashMap refinement-map]
+  Subproblem
+  (current-summary [s] ...?)
+  (child-keys      [s] (keys child-map))
+  (get-child       [s child-key] (force (util/safe-get child-map child-key)))
+  (refine-input    [s refined-input-set]
+    (if (= refined-input-set input-set)
+      s
+      (util/cache-with refinement-map refined-input-set
+                       (make-hla-subproblem s refined-input-set action)))))
+
+(defn make-constraint-primitive [constraint]
+  (env-util/make-factored-primitive [:noop] constraint {} 0))
+
+(defn simple-immediate-refinements-set [a input-set]
+  (for [[constraint ref] (angelic/immediate-refinements-set a input-set)]
+    (cons (make-constraint-primitive constraint) ref)))
+
+(defn make-refinement-subproblem [parent-hs input-set actions]
+  (let [[f & r] (util/make-safe actions)
+        left-sp (make-atomic-subproblem nil input-set a)]
+    (if (empty? r)
+      left-sp
+      ???....
+      left-sp
+      (make-refinement-subproblem parent-hs (output-set left-sp) r))))
+
+
+(defn make-hla-subproblem [super-hs input-set action]
+  (let [[opt-set rew] (angelic/optimistic-set-and-reward action input-set)]
+    (HlaSubproblem.
+     super-hs input-set action opt-set ??????summarizer
+     (cond (not (angelic/can-refine-from-set? action input-set))
+             no-children
+           (and super-hs (not (blocked??? super-hs)))
+             ??? ;reuse
+           :else
+             (into {}
+                   (for [ref (simple-immediate-refinements-set action input-set)]
+                     [(map env/action-name ref)
+                      (delay (make-refinement-subproblem this??? input-set ref))
+                      (ActionInstance. ai nil prev-aio full-ref (atom nil))])))
+     (HashMap.))))
+
+
+(defn make-atomic-subproblem [super-as input-set action]
+  (if (env/primitive? action)
+    (make-primitive-subproblem input-set action)
+    (make-hla-subproblem parent-as input-set action)))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Sequence ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;; For now, pick the right first if possible -- fix later.
+;; TODO: unfactor ?
+;; TODO: how do we wrap partial SPs?
+(defrecord SeqSubproblem [super-sp root-hs key-seq
+                          input-set left-sp right-sp output-constraint
+                          child-map]
+  Subproblem
+  (current-summary [s] ...?)
+  (child-keys      [s] (keys child-map))
+  (get-child       [s child-key] (force (util/safe-get child-map child-key)))
+  (refine-input    [s refined-input-set]
+    (if (= refined-input-set input-set)
+      s
+      (util/cache-with refinement-map refined-input-set
+                       (make-hla-subproblem s refined-input-set action)))))
+
+
+(defn make-seq-subproblem [super-sp root-hs key-seq])
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Wrapped Seq ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defrecord WrappedSubproblem [input-set wrapped-sp remaining-keys output-set]
+  Subproblem
+  (current-summary [s] ...)
+  (child-keys      [s] [(first remaining-keys)])
+  (get-child       [s child-key]
+    (assert (= child-key (first remaining-keys)))
+    (let [inner-child (get-child wrapped-sp child-key)
+          more-keys   (next remaining-keys)]
+      (if more-keys
+        (make-wrapped-subproblem inner-child more-keys output-set)
+        (do (assert (state-set/subset? (:output-set inner-child) output-set))
+            inner-child))))
+  (refine-input    [s refined-input-set]
+    ...?))
+
+(defn make-wrapped-subproblem [wrapped-sp remaining-keys output-set]
+  (WrappedSubproblem. (input-set wrapped-sp) wrapped-sp remaining-keys output-set))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

 ;; Refinements all have at least one action, constraints are new primitives.
 ;; TODO: need some superstructure to take into account initial 0-reward bound.
@@ -160,67 +219,70 @@
 ;; - assume we always evaluate supers first
 ;; - switch back to refine model from evaluate model. (but must deal with propagation)

-(defrecord ActionInstance
-  [parent-ai
-   super-ais
-   prev-aio
-   actions ; this and following in refinement.
-   output-atom ])
-
-(defrecord ActionInstanceOutput
-  [parent-aio ; Only if no more actions
-   super-aios  ;
-   source-ai
-   output-set
-   step-reward
-   next-ai-atom
-   refinents-first-ai-atom])
-
-(def +worst-aio+ (ActionInstanceOutput. nil nil nil state-set/empty-lfss is/neg-inf nil nil))
-
-(defn make-constraint-primitive [constraint]
-  (env-util/make-factored-primitive [:noop] constraint {} 0))
-
-(defn root-aio [aio]
-  (if-let [parent (:parent-aio aio)] (root-aio parent) aio))
-
-
-
-(defn evaluate-aio! [ai]
-  (let [{:keys [parent-ai super-ais prev-aio actions output-atom]} ai]
-    (assert (nil? @output-atom))
-    (let [input-set (:output-set prev-aio)
-          [a & r]   actions
-          prim?    (env/primitive? a)
-          [opt rew] (angelic/optimistic-set-and-reward a input-set)]
-      (if (or (not opt) (state-set/empty? opt) (= rew is/neg-inf))
-        +worst-aio+
-        (let [aio (ActionInstanceOutput.
-                   (when (empty? r) (-> parent-ai :output-atom deref))
-                   (ccc/-?> super-ai :output-atom deref)
-                   ai opt rew
-                   (atom nil) (atom nil))]
-          (reset! (:refinements-first-ai-atom aio)
-                  (lazy-seq
+
+(comment
+  ;; Again, sets but not costs
+ (defrecord ActionInstance
+   [parent-ai
+    super-ais
+    prev-aio
+    actions                        ; this and following in refinement.
+    output-atom ])
+
+ (defrecord ActionInstanceOutput
+   [parent-aio                          ; Only if no more actions
+    super-aios                          ;
+    source-ai
+    output-set
+    step-reward
+    next-ai-atom
+    refinents-first-ai-atom])
+
+ (def +worst-aio+ (ActionInstanceOutput. nil nil nil state-set/empty-lfss is/neg-inf nil nil))
+
+ (defn make-constraint-primitive [constraint]
+   (env-util/make-factored-primitive [:noop] constraint {} 0))
+
+ (defn root-aio [aio]
+   (if-let [parent (:parent-aio aio)] (root-aio parent) aio))
+
+
+
+ (defn evaluate-aio! [ai]
+   (let [{:keys [parent-ai super-ais prev-aio actions output-atom]} ai]
+     (assert (nil? @output-atom))
+     (let [input-set (:output-set prev-aio)
+           [a & r]   actions
+           prim?    (env/primitive? a)
+           [opt rew] (angelic/optimistic-set-and-reward a input-set)]
+       (if (or (not opt) (state-set/empty? opt) (= rew is/neg-inf))
+         +worst-aio+
+         (let [aio (ActionInstanceOutput.
+                    (when (empty? r) (-> parent-ai :output-atom deref))
+                    (ccc/-?> super-ai :output-atom deref)
+                    ai opt rew
+                    (atom nil) (atom nil))]
+           (reset! (:refinements-first-ai-atom aio)
+                   (lazy-seq
                     (let [super-fais (ccc/-?> aio :super-aio :refinements-first-ai-atom)]
                       (cond (and @super-fais (not (= @super-refs :blocked)))
-                              (for [super-fai @super-fais]
-                                (ActionInstance. ai super-fai prev-aio (:actions super-fai) (atom nil)))
+                            (for [super-fai @super-fais]
+                              (ActionInstance. ai super-fai prev-aio (:actions super-fai) (atom nil)))
                             (angelic/can-refine-from-set? a input-set)
-                              (for [[constraint ref] (angelic/immediate-refinements-set a input-set)
-                                    :let [full-ref (cons (make-constraint-primitive constraint) ref) ]]
-                                (ActionInstance. ai nil prev-aio full-ref (atom nil)))
+                            (for [[constraint ref] (angelic/immediate-refinements-set a input-set)
+                                  :let [full-ref (cons (make-constraint-primitive constraint) ref) ]]
+                              (ActionInstance. ai nil prev-aio full-ref (atom nil)))
                             :else
-                              :blocked))))
-          (reset! (:next-ai-atom aio)
-                  (let [root (root-aio aio)]
-                    (ActionInstance.
-                     (-> root :source-ai :parent-ai)
-                     (if (identical? aio root) ;; AKA this AIO has more actions
-                       (ccc/-?> ai :super-ai :output-atom deref :next-ai-atom deref)
+                            :blocked))))
+           (reset! (:next-ai-atom aio)
+                   (let [root (root-aio aio)]
+                     (ActionInstance.
+                      (-> root :source-ai :parent-ai)
+                      (if (identical? aio root) ;; AKA this AIO has more actions
+                        (ccc/-?> ai :super-ai :output-atom deref :next-ai-atom deref)

-                       )
-                     aio (-> root :source-ai :actions next) (atom nil)))))))))
+                        )
+                      aio (-> root :source-ai :actions next) (atom nil))))))))))

 ;; Super-structure always mirrors, when it exists?
 ;; But, sub-structure can get ahead, then things get out of whack. (lose track of it)


egg destroying bug

egg destroying bug

--- clojure/src/dnd/character.cljs
+++ clojure/src/dnd/character.cljs
@@ -8,8 +8,8 @@
 (defn is-character [inhabitant] (= "@" (:char inhabitant)))

 (defn move-character! [level character dx dy]
-  (let [target-block (get-in @level [dx dy])]
-    (if-let [target-block (not (:solid target-block))]
+  (if-let [target-block (get-in @level [dx dy])]
+    (if-let [not-solid (not (:solid target-block))]
       (let [{ox :x oy :y} @character
             {old-inhabitants :inhabitants} (get-in @level [ox oy])
             remove-character #(assoc % :inhabitants (remove is-character old-inhabitants))
@@ -17,9 +17,10 @@
             target-inhabitants (:inhabitants target-block)
             updated-character (swap! character assoc :x dx :y dy)
             update-habs #(assoc % :inhabitants (conj target-inhabitants updated-character))
-            updated-level (swap! level update-in [dx dy] update-habs)])
-      "can't walk there")
-    [level character]))
+            updated-level (swap! level update-in [dx dy] update-habs)]
+        [level character])
+      "can't walk through solid blocks")
+    "can't walk off the board"))

 (defn push-inhabitant! [level x y item]


special case for entry class on issues list

--- src-cljs/frontend/components/app.cljs
+++ src-cljs/frontend/components/app.cljs
@@ -60,7 +60,9 @@
                                       (when (:show-landing? app) " state-outer ")
                                       (if chat-opened? " chat-opened " " chat-closed ")
                                       (when (keyboard/pan-shortcut-active? app) " state-pan ")
-                                      (when (<= (:page-count app) 1) " entry ")
+                                      (when (and (not= (:navigation-point app) :issues-list)
+                                                 (<= (:page-count app) 1))
+                                        " entry ")
                                       (when (:outer-to-inner? app) " outer-to-inner ")
                                       (when (:menu-to-inner? app) " menu-to-inner "))}
             (om/build text-sizer {})


Add log4j dependency

Add log4j dependency

--- example/project.clj
+++ example/project.clj
@@ -2,6 +2,7 @@
   :description "Example web app using single-sign-on with couchdb"
   :dependencies [[org.clojure/clojure "1.2.0"]
                  [org.clojure/clojure-contrib "1.2.0"]
+                 [log4j/log4j "1.2.16"]
 		 [compojure "0.5.3"]
 		 [ring/ring-core "0.3.5"]
 		 [ring/ring-servlet "0.3.5"]]


Bugfix in timeslice popup tab select

Bugfix in timeslice popup tab select

--- src-cljs/tamarack/core.cljs
+++ src-cljs/tamarack/core.cljs
@@ -25,7 +25,7 @@

   (letfn [(tab-clicked [e]
             (.preventDefault e)
-            ((aget (js/jQuery (.-target e)) "tab") "show"))]
+            (.tab (js/jQuery (.-target e)) "show"))]
     (.on (js/jQuery "#date-dropdown .nav a") "click" tab-clicked))

   (init-history)


Updated app-db to start from nothing.

Updated app-db to start from nothing.

--- src-cljs/tea_time/core.cljs
+++ src-cljs/tea_time/core.cljs
@@ -71,12 +71,7 @@
 (def edit-tea-snap (reagent/atom nil))
 (def show-edit (reagent/atom false))

-(defonce app-db (reagent/atom {:teas-list nil}
-                           :new-tea nil
-                           :edit-tea-id nil
-                           :edit-tea nil
-                           :edit-tea-snap nil
-                           :show-edit false))
+(defonce app-db (reagent/atom {}))

 (defn get-teas
   "Gets the list of all teas from the website"


Remove on-content-size-change handler

Remove on-content-size-change handler

--- src/status_im/ui/screens/desktop/main/chat/views.cljs
+++ src/status_im/ui/screens/desktop/main/chat/views.cljs
@@ -170,7 +170,6 @@
                                                          (when @scroll-timer (js/clearTimeout @scroll-timer))
                                                          (reset! scroll-timer (js/setTimeout #(re-frame/dispatch [:load-more-messages]) 300)))
                                                        (reset! scroll-height (+ y (.-height (.-layoutMeasurement ne))))))
-                           :on-content-size-change #(.scrollToEnd @scroll-ref)
                            :ref                    #(reset! scroll-ref %)}
         [react/view
          (doall


CMR-669: Changed seach-paging-depth-limit to call config-value-fn.

--- src/cmr/search/services/parameters/parameter_validation.clj
+++ src/cmr/search/services/parameters/parameter_validation.clj
@@ -22,10 +22,9 @@
   (:import clojure.lang.ExceptionInfo
            java.lang.Integer))

-(defn search-paging-depth-limit
+(def search-paging-depth-limit
   "The maximum value for page-num * page-size"
-  []
-  (cfg/config-value :search-paging-depth-limit 1000000 #(Integer. %)))
+  (cfg/config-value-fn :search-paging-depth-limit 1000000 #(Integer. %)))

 (def case-sensitive-params
   "Parameters which do not allow option with ingnore_case set to true."


strip generator down to bare bones

strip generator down to bare bones

--- generator/src/generator/core.clj
+++ generator/src/generator/core.clj
@@ -2,20 +2,16 @@
   (:gen-class)
   (:require [langohr.core :as rmq]
             [langohr.channel :as lch]
-            [langohr.queue :as lq]
-            [langohr.consumers :as lc]
             [langohr.basic :as lb]))
-
-(def ^{:const true}
-  default-exchange-name "logs")

 (defn -main
   [& args]
   (let [conn (rmq/connect {:host "rabbit"})
         ch (lch/open conn)
-        qname "langohr.examples.hello-world"]
+        routing-key ""
+        exchange "logs"]
     (println (format "[main] Connected. Channel id: %d" (.getChannelNumber ch)))
-    (lb/publish ch default-exchange-name qname "Hello!" {:content-type "text/plain" :type "greetings.hi"})
+    (lb/publish ch exchange routing-key "Hello!")
     (Thread/sleep 2000)
     (println "[main] Disconnecting...")
     (rmq/close ch)


Add docs for :host and :vhost

Add docs for :host and :vhost

--- web/src/immutant/web.clj
+++ web/src/immutant/web.clj
@@ -36,7 +36,17 @@
      * :path          Maps the handler to a prefix of the url path [/]
      * :virtual-host  Virtual host name[s] (a String or a List of Strings) [nil]

-   Run calls may be threaded together, too:
+   Note the web server only binds to the loopback interface, by
+   default. To expose your handler to the network, set :host to an
+   external IP address, or use `0.0.0.0` to bind it to all interfaces.
+
+   The :virtual-host option enables name-based virtual hosting which,
+   along with the :path option, distinguishes the handlers on a single
+   server. That is, multiple handlers can run on the same `:host` and
+   `:port` as long as each has a unique combination of `:virtual-host`
+   and `:path`.
+
+   Run calls may be threaded together:

    ```
      (-> (run hello)


Add meta getter, even though it'll never return anything but nil so far.

--- lib/shin/cljs/cljs/core.cljs
+++ lib/shin/cljs/cljs/core.cljs
@@ -196,6 +196,13 @@
             (.unshift args ret)
             (.apply dissoc nil args))
           ret)))))
+
+(defn meta
+  "Returns the metadata of obj, returns nil if there is no metadata."
+  [o]
+  (when (and (not (nil? o))
+             (satisfies? IMeta o))
+    (-meta o)))

 (defn peek
   "For a list or queue, same as first, for a vector, same as, but much


[elasticsearch] Elastisch 2.1.0-rc1

[elasticsearch] Elastisch 2.1.0-rc1

--- joplin.elasticsearch/project.clj
+++ joplin.elasticsearch/project.clj
@@ -6,6 +6,6 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [clojurewerkz/elastisch "2.1.0-beta7"]
+                 [clojurewerkz/elastisch "2.1.0-rc1"]
                  [joplin.core "0.2.3-SNAPSHOT"]
                  [clj-time "0.8.0"]])


Avoid Nullpo

Avoid Nullpo

--- src/antlion_clojure/bot.clj
+++ src/antlion_clojure/bot.clj
@@ -244,7 +244,7 @@
   [{:keys [user channel text]
     :as res}]
   (let [self (redis/get-self)
-        txt (-> (split text #"\s+" 2) second)]
+        txt (some-> text (split #"\s+" 2) second)]
     (when (slack/message-for-me? res self)
       (cond
         (redis/get-checking-question? user)


Refactored tests

Refactored tests

Created a case where the actual cert signing is tested independently of
the function which filters extensions

--- test/puppetlabs/master/certificate_authority_test.clj
+++ test/puppetlabs/master/certificate_authority_test.clj
@@ -1,7 +1,6 @@
 (ns puppetlabs.master.certificate-authority-test
   (:import (java.io StringReader ByteArrayInputStream)
-           (java.security MessageDigest)
-           (org.bouncycastle.asn1.x509 SubjectPublicKeyInfo))
+           (java.security MessageDigest))
   (:require [puppetlabs.master.certificate-authority :refer :all]
             [puppetlabs.trapperkeeper.testutils.logging :as logutils]
             [puppetlabs.certificate-authority.core :as utils]
@@ -625,7 +624,7 @@
                             :value    subject-pub}]]
         (is (= (set exts) (set exts-expected)))))

-    (testing "trusted fact extensions are copied from CSR"
+    (testing "trusted fact extensions are properly unfiltered"
       (let [csr-exts [(utils/puppet-node-image-name "imagename" false)
                       (utils/puppet-node-uid "UUUU-IIIII-DDD" false)]
             csr      (utils/generate-certificate-request
@@ -659,7 +658,8 @@
         (is (= exts exts-expected))))

     (testing "only puppet extensions are copied from CSR to cert"
-      (let [csr-exts [(utils/subject-dns-alt-names ["onefish"] false)]
+      (let [csr-exts [(utils/subject-dns-alt-names ["onefish"] false)
+                      (utils/puppet-node-uid "AAAA-BBBB-CCCC-DDDD" false)]
             csr      (utils/generate-certificate-request
                        subject-keys subject-dn csr-exts)
             exts (create-agent-extensions csr issuer-pub)
@@ -681,5 +681,8 @@
                             :value #{:digital-signature :key-encipherment}}
                            {:oid "2.5.29.14"
                             :critical false
-                            :value subject-pub}]]
+                            :value subject-pub}
+                           {:critical false
+                            :oid      "1.3.6.1.4.1.34380.1.1.1"
+                            :value    "AAAA-BBBB-CCCC-DDDD"}]]
         (is (= exts exts-expected))))))


implemented day 13 part 2 2016

implemented day 13 part 2 2016

--- 2016/day-13/src/day_13/core.clj
+++ 2016/day-13/src/day_13/core.clj
@@ -52,7 +52,7 @@
   [{:keys [visited d seed next-pts end] :as state}]
   (cond
     (some #{end} next-pts) (assoc state :done true)
-    (= d 10000000) (assoc state :done true)
+    (= d 50) (assoc state :done true)
     :else (let [{next-pts :next-pts
                  visited :visited}
                 (reduce
@@ -82,9 +82,25 @@
     first
     :d))

+(defn mindist-2
+  [seed pos end]
+  (->>
+    (iterate
+      breadth-first-iter
+      {:visited #{pos}
+       :d 0
+       :seed seed
+       :next-pts [pos]
+       :end end
+       :done false})
+    (drop-while #(not (% :done)))
+    first
+    :visited
+    count))
+
 (defn -main
   "I don't do a whole lot."
   [& args]
   (->
-    (mindist 1350 [1 1] [31 39])
+    (mindist-2 1350 [1 1] [31 39])
     println))


speed up canvas1 on Mac using double buffering

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

--- plugins/SlideExplorer2/src/slide_explorer/canvas1.clj
+++ plugins/SlideExplorer2/src/slide_explorer/canvas1.clj
@@ -15,6 +15,7 @@
                           Rectangle2D$Double
                           RoundRectangle2D$Double))
     (:require [slide-explorer.widgets :as widgets]
+              [slide-explorer.paint :as paint]
               [slide-explorer.bind :as bind]))

 ; Create a default font render context, that can be rebound.
@@ -30,6 +31,11 @@
 (defn show [x]
   (do (pr x)
       x))
+
+(defn now []
+  (System/currentTimeMillis))
+
+(def degrees-to-radians (/ Math/PI 180))

 (defn clip-value
   "Clips a value between min-value and max-value."
@@ -183,8 +189,6 @@

 ;; widgets ;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(def degrees-to-radians (/ Math/PI 180))
-
 (defn update-in-if
   "Like update-in, but only applies the
    function if the keys are present. Otherwise
@@ -476,6 +480,8 @@
           :top 20
           :text (.getMessage e)}]))

+(def count-paints (atom 0))
+
 (defn canvas
   "Create a blank JPanel \"canvas\" for automatic painting. The
   canvas is automatically updated with the graphics description
@@ -485,17 +491,25 @@
         panel (proxy [JPanel clojure.lang.IReference] []
                 (paintComponent [^Graphics graphics]
                   (proxy-super paintComponent graphics)
-                  (try
-                    (draw graphics @reference)
-                    (catch Throwable e (draw-error graphics e))))
+                   ; (println "draw" (now))
+                  (paint/paint-buffered graphics
+                  #(try
+                     (draw % @reference)
+                    (catch Throwable e (draw-error % e)))))
                 (alterMeta [alter args]
                   (apply swap! meta-atom alter args))
                 (resetMeta [m]
                   (reset! meta-atom m))
                 (meta []
                   @meta-atom))]
-    (add-watch reference panel (fn [_ _ _ _]
-                                 (.repaint panel)))
+    ;(.setDoubleBuffered panel true)
+    (add-watch reference panel (fn [_ _ old-val new-val]
+                                 (swap! count-paints inc)
+                                 ;(println "count: " @count-paints)
+                                 ;(clojure.pprint/pprint new-val)
+                                 (when (not= old-val new-val)
+                                   ;(println "repaint")
+                                   (.repaint panel))))
     (alter-meta! panel assoc ::data-source reference)
     panel))

@@ -531,9 +545,11 @@
        (match-shapes [x y])))

 (defn handle-mouse-move [e reference canvas]
+  ;(println "move" (now))
   (let [data @reference
         last-widgets-under-mouse ((meta canvas) ::last-widgets-under-mouse)
-        widgets-under-mouse (set (map #(select-keys % [:mouse-in :mouse-out :shape]) (mouse-is-over [(.getX e) (.getY e)] data)))
+        widgets-under-mouse (set (map #(select-keys % [:mouse-in :mouse-out :shape])
+                                      (mouse-is-over [(.getX e) (.getY e)] data)))
         in (clojure.set/difference widgets-under-mouse last-widgets-under-mouse)
         out (clojure.set/difference last-widgets-under-mouse widgets-under-mouse)]
     (alter-meta! canvas assoc ::last-widgets-under-mouse
@@ -583,10 +599,11 @@

 ;; animation

-(defn now []
-  (System/currentTimeMillis))
-
-(defn animate! [reference value-address duration min-val max-val]
+
+(defn animate!
+  "Slowly alters reference at value-address, linearly
+   with time from min-val to max-val."
+  [reference value-address duration min-val max-val]
   (let [start-time (now)]
     (loop []
       (let [elapsed (- (now) start-time)


simplified gen-add-toggle-pattern

simplified gen-add-toggle-pattern

--- test/unit/todos.cljs
+++ test/unit/todos.cljs
@@ -58,20 +58,22 @@
        (reductions + add-pattern)))

 (defn gen-add-toggle-pattern
-  "Generator which turns every :available-ids into random :toggle-pattern."
-  [adds-with-ids]
+  "Generator which replaces each :available-ids with random :toggle-pattern."
+  [add-pattern-with-available-ids]
   (letfn [(gen-toggle-pattern [available-ids]
             (gen/vector
               (gen/elements available-ids)
-              1 7))]
-    ; TODO: try to use gen/let to unwind this code?
-    (apply gen/tuple
-           (map (fn [pattern]
-                  (gen/fmap #(-> pattern
-                                 (dissoc :available-ids)
-                                 (assoc :toggle-pattern %))
-                            (gen-toggle-pattern (:available-ids pattern))))
-                adds-with-ids))))
+              1 7))
+
+          (gen-chunk-with-toggle-pattern [chunk]
+            (gen/let
+              [toggle-pattern (gen-toggle-pattern (:available-ids chunk))]
+              (-> chunk
+                  (dissoc :available-ids)
+                  (assoc :toggle-pattern toggle-pattern))))]
+    (->> add-pattern-with-available-ids
+         (map gen-chunk-with-toggle-pattern)
+         (apply gen/tuple))))

 (defn signals-toggles
   [toggle-pattern]


prettified test.chuck output by using pprint and not printing the full app structure

--- test/unit/todos.cljs
+++ test/unit/todos.cljs
@@ -11,10 +11,9 @@
 (defmethod ct/report [::ct/default :my-shrunk] [m]
   (newline)
   (println "\nPROPERTY TEST FAILED"
-           "\nSmallest case:" (pr-str (-> m :shrunk :smallest))
-           "\nDETAILS:"
+           "\nCase:" (with-out-str (cljs.pprint/pprint (:fail m)))
+           "\nShrunk:" (with-out-str (cljs.pprint/pprint (-> m :shrunk :smallest)))
            "\nNum tests:" (:num-tests m)
-           "\nCase:" (pr-str (:fail m))
            "\nSeed:" (:seed m)))

 (defn my-shrunk-report [m]
@@ -28,7 +27,12 @@
                                              #_ui/wrap-log)
                                          [])]
     (dorun (map (:dispatch-signal app) signals))
-    app))
+
+    (specify! app
+      IPrintWithWriter
+      ; do not print the full app structure in test reports
+      (-pr-writer [_ writer _opts]
+        (-write writer "#<App>")))))

 (defn ids-unique?
   [app]


private->public

private->public

--- src/cljs/main/broadfcui/components/buttons.cljs
+++ src/cljs/main/broadfcui/components/buttons.cljs
@@ -102,7 +102,7 @@
          text]]))})

-(defn- x-button [dismiss]
+(defn x-button [dismiss]
   [:div {:style {:float "right" :marginRight "-28px" :marginTop "-1px"}}
    [:a {:data-test-id "x-button"
         :style {:color (:text-light style/colors)}


about books

about books

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -148,6 +148,9 @@

    {:pred :bird}     {:animate true
                       :human false}
+
+   {:pred :book}     {:artifact true
+                      :legible true}

    {:pred :bread}    {:artifact true
                       :edible true}


handle inputs which are keywords

handle inputs which are keywords

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -203,9 +203,8 @@
                              (log/debug (str "original call of sem-impl: (" (get-in input [:pred]) ")" (strip-refs input)))
                              input))]
     (cond
+      (keyword? input) input
       (empty? input) {}
-      (= input :top) input
-      (= input :fail) :fail
       true
       (let [merged
             (unify input


+(defn impl-list)

+(defn impl-list)

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -113,6 +113,25 @@
 (defn get-encyc [input k]
   (get encyc {k (get-in input [k])} {}))

+(defn impl-list [input]
+  [input
+   (get-encyc input :activity)
+   (get-encyc input :animate)
+   (get-encyc input :artifact)
+   (get-encyc input :buyable)
+   (get-encyc input :city)
+   (get-encyc input :clothing)
+   (get-encyc input :consumable)
+   (get-encyc input :drinkable)
+   (get-encyc input :edible)
+   (get-encyc input :furniture)
+   (get-encyc input :human)
+   (get-encyc input
+              :part-of-human-body)
+   (get-encyc input :pet)
+   (get-encyc input :place)
+   (get-encyc input :time)])
+
 (defn sem-impl [input & [original-input]]
   "expand input feature structures with semantic (really cultural) implicatures, e.g., if human, then not buyable or edible"
   (let [original-input (if original-input original-input


Stop Panel padding

Stop Panel padding

--- src/cljs/gtfve/components/side_panel.cljs
+++ src/cljs/gtfve/components/side_panel.cljs
@@ -32,29 +32,29 @@
             query (:stops-query panel)]
         (html
          [:div {:className (tab-class tab :stops)}
-          [:form.form-horizontal
-           {:on-submit #(do
-                          (raise! owner [:stops-search-submitted {:query query}])
-                          (.preventDefault %))}
-           [:fieldset
-            [:div.form-group
-             [:label.col-sm-2.control-label {:for "inputSearch"} "Stop"]
-             [:div.col-sm-10
-              [:input.form-control#inputSearch
-               {:type "text"
-                :placeholder "Search"
-                :value query
-                :on-change #(utils/edit-input owner :input-stops-search %)}]]]]]
-          (into [:div.list-group]
-                (map (fn [stop]
-                       [:a.list-group-item {:key (:db/id stop)
-                                            :href "#"}
-                        [:h5.list-group-item-heading (:stop/name stop)]
-                        [:p.list-group-item-text (str (:stop/latitude stop)
-                                                      "/"
-                                                      (:stop/longitude stop))]])
-                     data))
-          ])))))
+          [:div.tab-content-wrapper
+           [:form.form-horizontal
+            {:on-submit #(do
+                           (raise! owner [:stops-search-submitted {:query query}])
+                           (.preventDefault %))}
+            [:fieldset
+             [:div.form-group
+              [:label.col-sm-2.control-label {:for "inputSearch"} "Stop"]
+              [:div.col-sm-10
+               [:input.form-control#inputSearch
+                {:type "text"
+                 :placeholder "Search"
+                 :value query
+                 :on-change #(utils/edit-input owner :input-stops-search %)}]]]]]
+           (into [:div.list-group]
+                 (map (fn [stop]
+                        [:a.list-group-item {:key (:db/id stop)
+                                             :href "#"}
+                         [:h5.list-group-item-heading (:stop/name stop)]
+                         [:p.list-group-item-text (str (:stop/latitude stop)
+                                                       "/"
+                                                       (:stop/longitude stop))]])
+                      data))]])))))

 (defn route-panel [{:keys [panel data]} owner]
   (reify


Wrap all api call callbacks to wrap-error-alert.

--- src/cljs/hatnik/web/client/z_actions.cljs
+++ src/cljs/hatnik/web/client/z_actions.cljs
@@ -6,12 +6,11 @@
 (defn get-data-from-input [id]
   (.-value (.getElementById js/document id)))

-(defn create-new-project-callback [name reply]
-  (let [resp (js->clj reply)]
-    (if (= "ok" (get resp "result"))
-      (state/add-new-project (get resp "id") name)
-      (js/alert (str "Sorry. Project " name " can't be created.")))))
-
+(defn wrap-error-alert [callback]
+  (fn [reply]
+    (let [resp (js->clj reply)]
+      (when (= "error" (get resp "result")) (js/alert (get resp "message")))
+      (callback reply))))

 (defn ajax [url type data callback]
   (jq/ajax url
@@ -23,6 +22,12 @@
             :async false
             :success callback}))

+(defn create-new-project-callback [name reply]
+  (let [resp (js->clj reply)]
+    (when (= "ok" (get resp "result"))
+      (state/add-new-project (get resp "id") name))))
+
+
 (defn send-new-project-request []
   (let [name (.-value (.getElementById js/document "project-name-input"))]
     (if (= "" name)
@@ -31,11 +36,10 @@

 (defn create-new-email-action-callback [data reply]
   (let [resp (js->clj reply)]
-    (if (= "ok" (get resp "result"))
+    (when (= "ok" (get resp "result"))
       (state/update-project-actions (assoc data
                                       "id" (get resp "id")
-                                      "last-processed-version" (get rest "last-processed-version")))
-      (js/alert "Action don't created."))))
+                                      "last-processed-version" (get rest "last-processed-version"))))))

 (defn send-new-email-action [project-id]
@@ -55,7 +59,8 @@

       (do
         (.modal ($ :#iModal) "hide")
-        (ajax "/api/actions" "POST" data #(create-new-email-action-callback data %))))))
+        (ajax "/api/actions" "POST" data
+              (wrap-error-alert #(create-new-email-action-callback data %)))))))

 (defn test-new-email-action [project-id]
@@ -75,13 +80,8 @@
          (= "" email-body))
       (js/alert "Wrong data! Check out fields!")

-      (ajax "/api/actions/test" "POST" data (fn [e])))))
-
-(defn wrap-error-alert [callback]
-  (fn [reply]
-    (let [resp (js->clj reply)]
-      (when (= "error" (get resp "result")) (js/alert (get resp "message")))
-      (callback reply))))
+      (ajax "/api/actions/test" "POST" data
+            (wrap-error-alert (fn [e]))))))

 (defn common-update-callback [msg data reply]


(SERVER-2550) Add `crl-issued-by-cert?` function

This commit adds a function to determine whether the given CRL was issued by
the given certificate. This will be used to verify CRLs against certificate
chains, particularly when consuming CRL updates from an external root.

--- src/clojure/puppetlabs/ssl_utils/core.clj
+++ src/clojure/puppetlabs/ssl_utils/core.clj
@@ -579,13 +579,20 @@
   (with-open [r (reader pem)]
     (SSLUtils/pemToCRLs r)))

+(schema/defn ^:always-validate crl-issued-by-cert? :- schema/Bool
+  "Given a CRL and a certificate, determine whether the CRL was issued by the
+  certificate."
+  [crl :- X509CRL
+   cert :- X509Certificate]
+  (= (.getIssuerX500Principal crl)
+     (.getSubjectX500Principal cert)))
+
 (schema/defn ^:always-validate pem->ca-crl :- X509CRL
   "Given a CRL chain and CA certificate, extract the CRL issued by the
   certificate"
   [crl-chain :- Readerable
    ca-cert :- X509Certificate]
-  (let [match-ca-cert? (fn [crl] (= (.getIssuerX500Principal crl)
-                                    (.getSubjectX500Principal ca-cert)))
+  (let [match-ca-cert? (fn [crl] (crl-issued-by-cert? crl ca-cert))
         crls (pem->crls crl-chain)
         crl (first (filter match-ca-cert? crls))]
     (if (nil? crl)


Added log statement upon completion.

Added log statement upon completion.

--- src/cmr/bootstrap/data/bulk_migration.clj
+++ src/cmr/bootstrap/data/bulk_migration.clj
@@ -132,7 +132,8 @@
   (delete-provider provider-id)
   (create-provider provider-id)
   (copy-collection-data db provider-id)
-  (copy-granule-data-for-provider db provider-id))
+  (copy-granule-data-for-provider db provider-id)
+  (info "Processing of provider" provider-id "completed."))

 ;; Background task to handle requests
 (defn handle-copy-requests


Refactor transact!

Refactor transact!

--- src/braid/client/store.cljs
+++ src/braid/client/store.cljs
@@ -5,7 +5,8 @@
             [clojure.set :as set]
             [schema.core :as s :include-macros true]
             [braid.common.schema :as app-schema]
-            [reagent.core :as r]))
+            [reagent.core :as r]
+            [braid.client.state.helpers :as helpers]))

 (defonce app-state
   (r/atom
@@ -62,17 +63,16 @@

 (defn transact! [v]
   (let [old-state @app-state]
-    (reset! app-state v)
-    (try
-      (check-app-state! @app-state)
-      (catch ExceptionInfo e
-        (errorf "State consistency error: %s"
+   (try
+     (do
+       (check-app-state! v)
+       (reset! app-state v))
+     (catch ExceptionInfo e
+       (errorf "State consistency error: %s"
                 (:error (ex-data e)))
-        (println (ex-data e))
-        (reset! app-state old-state)
-        ; Not just calling display-error! to avoid possibility of infinite loop
-        (swap! app-state update-in [:errors] conj
-               [(str :internal-consistency (rand-int 100)) "Something has gone wrong" :error])))))
+       (swap! app-state helpers/display-error
+              (gensym :internal-consistency)
+              "Something has gone wrong")))))

 ; GETTERS


remove now-addressed comment

remove now-addressed comment

--- src/braid/server/invite.clj
+++ src/braid/server/invite.clj
@@ -92,7 +92,6 @@

 (defn upload-avatar
   [f]
-  ; TODO: resize avatar to something reasonable
   (let [creds {:access-key (config :aws-access-key)
                :secret-key (config :aws-secret-key)}
         ext (case (f :content-type)


Wrap overly long lines in the text catalog

--- src/catalog/layout/text.clj
+++ src/catalog/layout/text.clj
@@ -64,7 +64,8 @@
 (defn- ausleihe
   [library-signature]
   (when library-signature
-    (str "Ausleihe: " (layout/braille-signatures library-signature))))
+    (wrap-line
+     (str "Ausleihe: " (layout/braille-signatures library-signature)))))

 (defn- ausleihe-simple
   [library-signature]
@@ -74,9 +75,10 @@
 (defn- verkauf
   [{:keys [product-number price price-on-request?]}]
   (when (or product-number price-on-request?)
-    (str "Verkauf: "
-         (wrap price "" ". " false)
-         (layout/braille-signatures product-number))))
+    (wrap-line
+     (str "Verkauf: "
+          (wrap price "" ". " false)
+          (layout/braille-signatures product-number)))))

 (defn- description-str
   [description]


simplify selectors implementations

simplify selectors implementations

--- src/chessground/common.cljs
+++ src/chessground/common.cljs
@@ -18,14 +18,10 @@
 (defn has-class [dom-element class] (.contains (.-classList dom-element) class))

 (defn $ [selector context]
-  (if context
-    (.querySelector context selector)
-    (.querySelector js/document selector)))
+  (.querySelector (or context js/document) selector))

 (defn $$ [selector context]
-  (if context
-    (.querySelectorAll context selector)
-    (.querySelectorAll js/document selector)))
+  (.querySelectorAll (or context js/document) selector))

 ; is there a better way to do that?
 (def is-touch-device (js* "'ontouchstart' in document"))


Disallow comparable

Disallow comparable

--- src/clj/introspect/type.clj
+++ src/clj/introspect/type.clj
@@ -23,8 +23,8 @@
 (defn have-common-ancestor?
   "Checks if two classes have a common ancestor"
   [inst1 inst2]
-  (let [ancestors1 (disj (ancestors inst1) Object java.io.Serializable)
-        ancestors2 (disj (ancestors inst2) Object java.io.Serializable)]
+  (let [ancestors1 (disj (ancestors inst1) Object java.io.Serializable java.lang.Comparable)
+        ancestors2 (disj (ancestors inst2) Object java.io.Serializable java.lang.Comparable)]
     (not (empty? (s/intersection ancestors1 ancestors2)))))

 (defn every-pair?


Rollback db insert of production if directories cannot be created

--- src/clj/mdr2/production.clj
+++ src/clj/mdr2/production.clj
@@ -5,6 +5,7 @@
             [babashka.fs :as fs]
             [java-time :as time]
             [clojure.core.async :refer [>!!]]
+            [conman.core :as conman]
             [mdr2.queues :as queues]
             [mdr2.db.core :as db]
             [mdr2.dtb :as dtb]
@@ -144,16 +145,17 @@
 (defn create!
   "Create a production"
   [production]
-  ;; FIXME: make sure nothing is inserted in the db if we cannot create the dirs
-  ;;  (transaction)
-  (let [p (-> production
-              add-default-meta-data
-              db/insert-production)]
-    (create-dirs p)
-    (when (:product_number p)
-      ;; notify the erp of the status change
-      (>!! queues/notify-abacus p))
-    p))
+  ;; make sure nothing is inserted in the db if we cannot create the
+  ;; dirs
+  (conman/with-transaction [db/*db*]
+    (let [p (-> production
+                add-default-meta-data
+                db/insert-production)]
+      (create-dirs p)
+      (when (:product_number p)
+        ;; notify the erp of the status change
+        (>!! queues/notify-abacus p))
+      p)))

 (defn remove-null-values [production]
   (medley/remove-vals nil? production))


Remove errant console.log

Remove errant console.log

--- src/cljs/dato/lib/core.cljs
+++ src/cljs/dato/lib/core.cljs
@@ -346,7 +346,6 @@
                                               (update-in [:tx/intent] (fn [intent]
                                                                         (or intent event))))]
                        (when-not (:tx/transient? full-tx-meta)
-                         (js/console.log "dato-keys: " (pr-str (keys payload)))
                          (js/console.log "\tevent: " (pr-str event))
                          (js/console.log "\ttx-data: " (pr-str tx-data))
                          (js/console.log "\ttx-meta: " (pr-str full-tx-meta)))


new icons rollback, restart, logs, ..

new icons rollback, restart, logs, ..


Broken D3 line graph - work in progress

Broken D3 line graph - work in progress

--- src/cljs/om_sente/core.cljs
+++ src/cljs/om_sente/core.cljs
@@ -199,24 +199,40 @@
   (reify
     om/IInitState
     (init-state [this]
-                (println "d3 init")
-                {:data (map vector (range 100) (repeatedly 100 #(rand-int 100)))})
+                {:data (vec (repeatedly 100 #(rand-int 100)))})
     om/IDidMount
     (did-mount [this]
-               (println "d3 did-mount")
-               (let [svg (-> js/d3 (.select "#d3-node") (.append "svg")
-                             (.attr #js {:width 960 :height 500}))]
-                 (-> svg (.append "circle")
-                     (.attr #js {:cx 350 :cy 200 :r 200 :class "left"}))
-                 (-> svg (.append "circle")
-                     (.attr #js {:cx 550 :cy 200 :r 200 :class "right"}))
-                 (-> svg (.append "circle")
-                     (.attr #js {:cx 450 :cy 300 :r 200 :class "bottom"}))))
+               (let [h 500 w 960 m 20
+                     d-raw (om/get-state owner :data)
+                     d (clj->js d-raw)
+                     y (.. js/d3 -scale linear
+                           (domain #js [0 (apply max d-raw)])
+                           (range #js [(+ 0 m) (- h m)]))
+                     x (.. js/d3 -scale linear
+                           (domain #js [0 (count d-raw)])
+                           (range #js [(+ 0 m) (- w m)]))
+                     svg (.. js/d3 (select "#d3-node") (append "svg")
+                             (attr #js {:width w :height h}))
+                     g (.. svg (append "g")
+                           (attr "transform" (str "transform(0, " h ")")))
+                     l (.. js/d3 -svg line (x (fn [d i] (x i)))
+                           (y (fn [d] (- (y d)))))]
+                 (println l)
+                 (.. g (append "path") (attr "d" (l d)))
+                 (.. g (append "line") (attr "x1" (x 0))
+                     (attr "y1" (- (y 0)))
+                     (attr "x2" (x w))
+                     (attr "y2" (- (y 0))))
+                 (.. g (append "line") (attr "x1" (x 0))
+                     (attr "y1" (- (y 0)))
+                     (attr "x2" (x 0))
+                     (attr "y2" (- (y (apply max d-raw)))))
+
+                 ))
     om/IRender
     (render [this]
             (println "d3 render state")
-            (dom/div #js {:react-key "d3-test-graph" :id "d3-node"}))
-))
+            (dom/div #js {:react-key "d3-test-graph" :id "d3-node"}))))

 (defn secured-application
   "Component that represents the secured portion of our application."


simplify the ai trigger mechanism

simplify the ai trigger mechanism

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -96,18 +96,14 @@
   []
   (let [game-on-xf (fn [_] (not @end-of-game))
         is-human-xf (fn [_] (not (is-ai? @current-player)))
-        is-ai-xf (fn [_] (is-ai? @current-player))
-        ai-events (chan 1 (comp (filter game-on-xf) (filter is-ai-xf)))
         player-events (chan 1 (comp (filter game-on-xf) (filter is-human-xf)))
         game-events (chan 1)]
-
     (go
       (while true
         (alt!
           game-events ([msg] (handle-game-event! msg))
           player-events ([coord] (update-game! turn/play-move coord))
-          ai-events ([msg] (when (= msg :ai-play) (handle-ai!)))
-          (async/timeout ai-move-delay) ([_] (put! ai-events :ai-play))
+          (async/timeout ai-move-delay) ([_] (if (is-ai? @current-player) (handle-ai!)))
           )))

     {:player-events player-events


Simplify implementation of `subcontext?'

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/fca/contexts.clj
+++ src/conexp/fca/contexts.clj
@@ -218,9 +218,9 @@
         atts-2 (attributes ctx-2)]
     (and (subset? objs-1 objs-2)
          (subset? atts-1 atts-2)
-         (forall [[g m] (incidence-relation ctx-1)]
-           (=> (and (contains? objs-1 g)
-                    (contains? atts-1 m))
+         (forall [g (objects ctx-1)
+                  m (attributes ctx-1)]
+           (=> ((incidence ctx-1) [g m])
                ((incidence ctx-2) [g m]))))))

 (defn restrict-concept


Add the removal of the context-path from the :uri in a request map.

--- src/containium/http_kit.clj
+++ src/containium/http_kit.clj
@@ -42,7 +42,8 @@
   "Evaluates to a match form, used by the make-app function."
   [{:keys [host-regex context-path]} uri-sym server-name-sym]
   (let [host-test `(re-matches ~host-regex ~server-name-sym)
-        context-test `(.startsWith ~uri-sym ~context-path)]
+        context-test `(and (.startsWith ~uri-sym ~context-path)
+                           (= (get ~uri-sym ~(count context-path)) \/))]
     `(and ~@(remove nil? (list (when host-regex host-test)
                                (when context-path context-test))))))

@@ -58,9 +59,13 @@
                                          ~'server-name (:server-name ~'request)]
                                      (or ~@(for [app sorted]
                                              `(when (matcher ~(:ring-conf app) ~'uri ~'server-name)
-                                                (boxure/call-in-box ~(:box app)
-                                                                    ~(:handler-fn app)
-                                                                    ~'request))))))]
+                                                (boxure/call-in-box
+                                                 ~(:box app)
+                                                 ~(:handler-fn app)
+                                                 ~(if-let [cp (-> app :ring-conf :context-path)]
+                                                    `(update-in ~'request [:uri]
+                                                                #(subs % ~(count cp)))
+                                                    ~'request)))))))]
                     (eval fn-form))
                   (constantly {:status 503 :body "no apps loaded"}))]
     (alter-var-root #'app (constantly handler))))
@@ -71,7 +76,12 @@
 (defn- clean-ring-conf
   "Updates the ring-conf, in order to ensure some properties of the values."
   [ring-conf]
-  (update-in ring-conf [:context-path] #(when % (if (= (last %) \/) % (str % "/")))))
+  (let [result ring-conf
+        result (update-in result [:context-path]
+                          #(when % (if (= (last %) \/) (apply str (butlast %)) %)))
+        result (update-in result [:context-path]
+                          #(when % (if (= (first %) \/) % (str "/" %))))]
+    result))

 (defn upstart-box
@@ -80,7 +90,7 @@
   configuration. A required key is :handler-sym, which, when evaluated
   inside the box, should be the ring handler function. Optional keys
   are :context-path and :host-regex. The first acts as a filter for
-  the first element(s) in the request URI, for example \"/api/v1/\".
+  the first element(s) in the request URI, for example \"/api/v1\".
   The second is a regular expression, which is matched against the
   server name of the request, for example \".*containium.com\"."
   [{:keys [name project] :as box}]


Update core.clj

Update core.clj

--- src/hasta_la_vista/core.clj
+++ src/hasta_la_vista/core.clj
@@ -142,7 +142,9 @@
             ^java.lang.String                         design-document-name  (:design-document-name view-config)
             ^java.lang.String                         view-name             (:view-name view-config)
             ^clojure.lang.PersistentHashMap           query-options         (:query-options view-config)
-            ^java.lang.Long                           batch-size            (:batch-size view-config)  ]
+            ^java.lang.Long                           batch-size            (:batch-size view-config)
+                                                      thread-count          (get-in config [:ok :hasta-la-vista :thread-count])
+                                                      thread-timeout        (get-in config [:ok :hasta-la-vista :thread-timeout])]
     ;; (println (client/get-client-status client))
     (log/info (client/get-available-servers client))
     ;; creating N async threads


main check

main check


New test: second attempt to create job with improper name

--- test/emender_jenkins/rest_api_test.clj
+++ test/emender_jenkins/rest_api_test.clj
@@ -521,3 +521,17 @@
                                                            :headers {"Content-Type" "application/json"}
                                                            :body "{\"status\":\"error\",\"jobName\":\"xxx-Test_Product-1.0-Test_Book-en-US (preview)\",\"command\":\"create_job\",\"message\":\"The name of job is wrong\"}"})))))

+(deftest test-create-job-bad-job-name-2
+    "Check the function emender-jenkins.rest-api/create-job."
+    (testing "the function emender-jenkins.rest-api/create-job."
+        (with-redefs [jenkins-api/create-job (fn [jenkins-url jenkins-auth include-jenkins-reply? job-name git-repo branch credentials-id metadata-directory metadata]
+                                                 (jenkins-api/ok-response-structure job-name "create_job" include-jenkins-reply? "created"))
+                      jenkins-api/start-job  (fn [jenkins-url jenkins-auth include-jenkins-reply? job-name]
+                                                 (jenkins-api/ok-response-structure job-name "build" include-jenkins-reply? "added to queue"))
+                      read-request-body      (fn [request] create-job-postdata-bad-job-name-2)
+                      reload-job-list        (fn [response request] response)
+                      send-response          (fn [response request] response)]
+                      (is (= (create-job default-request) {:status  400
+                                                           :headers {"Content-Type" "application/json"}
+                                                           :body "{\"status\":\"error\",\"jobName\":\"test-Test_Product-1.0-Test_Book-en-US\",\"command\":\"create_job\",\"message\":\"The name of job is wrong\"}"})))))
+


Test for thread interruption in usb-hid read loop.

--- src/org/playasophy/wonderdome/input/usb_hid.clj
+++ src/org/playasophy/wonderdome/input/usb_hid.clj
@@ -47,15 +47,16 @@
       (try
         (loop [start (System/currentTimeMillis)
                old-state nil]
-          (let [len (.readTimeout device buffer 100)
-                new-state (if (pos? len)
-                            (read-state buffer len)
-                            old-state)
-                now (System/currentTimeMillis)
-                elapsed (- now start)
-                events (state-events old-state new-state elapsed)]
-            (dorun (map (partial >!! channel) (remove nil? events)))
-            (recur now new-state)))
+          (when-not (Thread/interrupted)
+            (let [len (.readTimeout device buffer 100)
+                  new-state (if (pos? len)
+                              (read-state buffer len)
+                              old-state)
+                  now (System/currentTimeMillis)
+                  elapsed (- now start)
+                  events (state-events old-state new-state elapsed)]
+              (dorun (map (partial >!! channel) (remove nil? events)))
+              (recur now new-state))))
         (catch InterruptedException e
           nil)))))


Ensure that validation works on empty trees

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -31,7 +31,8 @@
   (into [this result]
         (.into root result))
   (valid! [this]
-          (.valid! root max-keys)
+          (when (> (alength (.-keys root)) 0) ;; the empty tree does not obey most invariants
+            (.valid! root max-keys))
           true)
   (pretty-print [this]
                 (prn :root)
@@ -370,7 +371,7 @@
   (let [tree (apply-to-tree (tree min-keys) actions)
         sorted-map (apply-to-sorted-map (sorted-map-by #(cond (== %1 %2) 0 (lt %1 %2) -1 (gt %1 %2) 1)) actions)]
     (and (= (seq (map vec tree)) (seq sorted-map))
-         (or (empty? tree) (.valid! tree)))))
+         (.valid! tree))))

 (defn building-prop [gen]
   (prop/for-all [min-keys gen/s-pos-int


Adds call to ensure-indexes function.

Adds call to ensure-indexes function.

--- src/cadence/model.clj
+++ src/cadence/model.clj
@@ -5,6 +5,8 @@
   (:use clojure.walk
         [cemerick.friend.credentials :only [hash-bcrypt]]))

+(defn- ensure-indexes []
+  (mc/ensure-index "users" {:username 1}))

 (defn connect [connection-info]
   (if (:uri connection-info)
@@ -14,7 +16,8 @@
     (mg/authenticate db-name
                      (:username connection-info)
                      (into-array Character/TYPE (:password connection-info)))
-    (mg/set-db! (mg/get-db db-name))))
+    (mg/set-db! (mg/get-db db-name))
+    (ensure-indexes)))

 (defn get-user [username]
   (keywordize-keys (into {} (mc/find-one "users" {:username username}))))


Map escape over the fields to display

Map escape over the fields to display

--- src/catalog/latex.clj
+++ src/catalog/latex.clj
@@ -112,44 +112,32 @@

 (defmethod catalog-entry :hörfilm
   [{:keys [title personel-name description source_publisher source_date genre library_signature]}]
-  (format "\\begin{description}
+  (apply
+   format "\\begin{description}
 \\item[%s] Regie: %s %s %s \\\\ %s %s
 \\end{description}"
-          (escape title) (escape personel-name)
-          (escape source_date) (translations genre)
-          (escape description) (escape library_signature)))
+   (map escape
+        [title personel-name source_date (translations genre) description library_signature])))

 (defmethod catalog-entry :hörbuch
-  [{:keys [title creator description source_publisher source_date genre duration narrator
+  [{:keys [creator title description source_publisher source_date genre duration narrator
            producer producer_place produced_commercially
            library_signature]}]
-  (format "\\begin{description}
+  (apply
+   format "\\begin{description}
 \\item[%s] %s %s %s %s \\\\ %s \\\\ %s Gelesen von: %s %s %s %s %s
 \\end{description}"
-          (escape title)
-          (escape creator)
-          (escape source_publisher)
-          (escape source_date)
-          (translations genre)
-          (escape description)
-          (escape duration)
-          (escape narrator)
-          (escape producer)
-          (escape producer_place)
-          (escape produced_commercially)
-          (escape library_signature)))
+   (map escape [title creator source_publisher source_date (translations genre)
+                description duration narrator producer producer_place produced_commercially
+                library_signature])))

 (defmethod catalog-entry :default
   [{:keys [title creator description source_publisher source_date genre]}]
-  (format "\\begin{description}
+  (apply
+   format "\\begin{description}
 \\item[%s] %s %s %s %s \\\\ %s
 \\end{description}"
-          (escape title)
-          (escape creator)
-          (escape source_publisher)
-          (escape source_date)
-          (translations genre)
-          (escape description)))
+   (map escape [creator title source_publisher source_date (translations genre) description])))

 (defn catalog-entries [items]
   (for [item items] (catalog-entry item)))


Use the empty string as an invalid genre and sub-genre

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -242,8 +242,8 @@
            braille-grade
            directed-by actors personel-text
            accompanying-material braille-music-grade] :as item
-    :or {genre "x01" ; an invalid genre
-         genre-code "x0"}}] ; an invalid genre-code
+    :or {genre "" ; an invalid genre
+         genre-code ""}}] ; an invalid genre-code
   (let [fmt (get-format format)
         ;; tactile books aren't properly tagged in the format field.
         ;; They are tagged as :ludo and their library signature starts


Add Hörbücherei der Stimme der Hoffnung

Add Hörbücherei der Stimme der Hoffnung

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -146,6 +146,7 @@
    9   "EBS, Marburg"
    10  "CFB, Hamburg"
    11  "DKBB, Bonn"
+   12  "Hörbücherei der Stimme der Hoffnung"
    13  "SBS, Zürich"
    24  "DZB, Leipzig"
    25  "CAB, Landschlacht"


Some code comments.

Some code comments.

--- src/cbfg/zgo/core.clj
+++ src/cbfg/zgo/core.clj
@@ -7,15 +7,11 @@

 (def OUT-WIDTH 50)

-(defn word-wrap [width s]
+(defn word-wrap [width s] ; Returns a sequence of strings from word-wrapping s.
   (re-seq (re-pattern (str ".{0," width "}\\s")) s))

-(defn ljust [width s]
+(defn ljust [width s] ; Left justify a string.
   (format (str "%-" width "s:") s))
-
-(defn pprintm [x]
-  (binding [*print-meta* true]
-    (pprint x)))

 (defn read-model-file [fname]
     {:fname fname
@@ -34,7 +30,7 @@
 (def MAX-LINE 0x8FFFFFF)
 (def MIN-LINE -1)

-(defn line-range [form]
+(defn line-range [form] ; Returns the source [line-beg line-end] nums for a form.
   (if (coll? form)
     (reduce (fn [[min-line-beg max-line-end] v]
               (let [[line-beg line-end] (line-range v)]
@@ -45,8 +41,7 @@
     [(or (:line (meta form)) MAX-LINE)
      (or (:end-line (meta form)) MIN-LINE)]))

-(defn j [v]
-  (string/join " " (flatten v)))
+(defn j [v] (string/join " " (flatten v)))

 (defn process-top-level-form [smodel form]
   (let [[op name & rest] form]
@@ -96,7 +91,6 @@
   (println "hello world from zgo")
   (let [smodel (read-model-file "src/cbfg/fence.cljs")
         pmodel (process-top-level-forms smodel)]
-    (pprintm smodel)
-    (pprintm pmodel)
+    (pprint smodel)
     (emit (:lines smodel) pmodel)))


* src/clj/cljs/core.clj: fix property access

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -254,12 +254,12 @@
     (if (seq impls)
       `(do
          (deftype* ~t ~fields)
-         (set! (.cljs$core$IPrintable$_pr_seq ~t) (fn [this#] (list ~(str r))))
+         (set! (.-cljs$core$IPrintable$_pr_seq ~t) (fn [this#] (list ~(str r))))
          (extend-type ~t ~@(dt->et impls))
          ~t)
       `(do
          (deftype* ~t ~fields)
-         (set! (.cljs$core$IPrintable$_pr_seq ~t) (fn [this#] (list ~(str r))))
+         (set! (.-cljs$core$IPrintable$_pr_seq ~t) (fn [this#] (list ~(str r))))
          ~t))))

 (defn- emit-defrecord
@@ -364,7 +364,7 @@
   (let [r (:name (cljs.compiler/resolve-var (dissoc &env :locals) rsym))]
     `(let []
        ~(emit-defrecord rsym r fields impls)
-       (set! (.cljs$core$IPrintable$_pr_seq ~r) (fn [this#] (list ~(str r))))
+       (set! (.-cljs$core$IPrintable$_pr_seq ~r) (fn [this#] (list ~(str r))))
        ~(build-positional-factory rsym r fields)
        ~(build-map-factory rsym r fields)
        ~r)))


some REPLs may want to further configure compilation, -setup is the last chance they get to do this. add :merge-opts support for the return value of -setup, these will get merged into the original opts.

--- src/clj/cljs/repl.clj
+++ src/clj/cljs/repl.clj
@@ -554,8 +554,10 @@
              is-special-fn? (set (keys special-fns))
              request-prompt (Object.)
              request-exit (Object.)
-             read-error (Object.)]
-         (-setup repl-env opts)
+             read-error (Object.)
+             opts (if-let [merge-opts (:merge-opts (-setup repl-env opts))]
+                    (merge opts merge-opts)
+                    opts)]
          (evaluate-form repl-env env "<cljs repl>"
            (with-meta
              '(ns cljs.user


read edn from dedicated namespace

read edn from dedicated namespace

--- src/clj/neb/types.clj
+++ src/clj/neb/types.clj
@@ -1,5 +1,6 @@
 (ns neb.types
-  (:require [taoensso.nippy :as nippy])
+  (:require [taoensso.nippy :as nippy]
+            [clojure.edn :as edn])
   (:import [org.shisoft.neb.io Writer Reader type_lengths]
            (java.util UUID Date)
            (java.nio.charset Charset)))
@@ -128,7 +129,7 @@
              :example [{:a 1 :b 2}]}
    :edn     {:id      21 :dynamic? true
              :encoder (fn [obj] (.getBytes (pr-str obj) string-encoding))
-             :decoder (fn [^bytes byte-arr] (read-string (String. byte-arr string-encoding)))
+             :decoder (fn [^bytes byte-arr] (edn/read-string (String. byte-arr string-encoding)))
              :dep :bytes
              :example [{:a 1 :b 2}]}})


cleanup service info layout

cleanup service info layout

--- src/cljs/swarmpit/component/service/info.cljs
+++ src/cljs/swarmpit/component/service/info.cljs
@@ -2,7 +2,6 @@
   (:require [material.component :as comp]
             [material.icon :as icon]
             [swarmpit.url :refer [dispatch!]]
-            [swarmpit.component.mixin :as mixin]
             [swarmpit.component.handler :as handler]
             [swarmpit.component.service.form-ports :as ports]
             [swarmpit.component.service.form-networks :as networks]
@@ -38,30 +37,6 @@
                    (message/error
                      (str "Service removing failed. Reason: " (:error response))))}))

-(defn- service-tasks-handler
-  [service-id]
-  (handler/get
-    (routes/path-for-backend :service-tasks {:id service-id})
-    {:on-success (fn [response]
-                   (reset! service-tasks response))}))
-
-(defn- service-networks-handler
-  [service-id]
-  (handler/get
-    (routes/path-for-backend :service-networks {:id service-id})
-    {:on-success (fn [response]
-                   (reset! service-networks response))}))
-
-(defn- init-state
-  [service]
-  (service-tasks-handler (:id service))
-  (service-networks-handler (:id service)))
-
-(def init-state-mixin
-  (mixin/init
-    (fn [data]
-      (init-state data))))
-
 (rum/defc form-settings < rum/static [service]
   [:div.form-view-group
    (comp/form-section "General settings")
@@ -77,61 +52,61 @@
   (when (not-empty ports)
     [:div.form-view-group
      (comp/form-section "Ports")
-     (comp/list-table ports/headers
-                      ports
-                      ports/render-item
-                      ports/render-item-keys
-                      nil)]))
+     (comp/list-table-auto ports/headers
+                           ports
+                           ports/render-item
+                           ports/render-item-keys
+                           nil)]))

 (rum/defc form-networks < rum/static [networks]
   (when (not-empty networks)
     [:div.form-view-group
      (comp/form-section "Networks")
-     (comp/list-table networks/headers
-                      networks
-                      networks/render-item
-                      networks/render-item-keys
-                      nil)]))
+     (comp/list-table-auto networks/headers
+                           networks
+                           networks/render-item
+                           networks/render-item-keys
+                           networks/onclick-handler)]))

 (rum/defc form-mounts < rum/static [mounts]
   (when (not-empty mounts)
     [:div.form-view-group
      (comp/form-section "Mounts")
-     (comp/list-table mounts/headers
-                      mounts
-                      mounts/render-item
-                      mounts/render-item-keys
-                      nil)]))
+     (comp/list-table-auto mounts/headers
+                           mounts
+                           mounts/render-item
+                           mounts/render-item-keys
+                           nil)]))

 (rum/defc form-secrets < rum/static [secrets]
   (when (not-empty secrets)
     [:div.form-view-group
      (comp/form-section "Secrets")
-     (comp/list-table secrets/headers
-                      secrets
-                      secrets/render-item
-                      secrets/render-item-keys
-                      nil)]))
+     (comp/list-table-auto secrets/headers
+                           secrets
+                           secrets/render-item
+                           secrets/render-item-keys
+                           secrets/onclick-handler)]))

 (rum/defc form-variables < rum/static [variables]
   (when (not-empty variables)
     [:div.form-view-group
      (comp/form-section "Environment variables")
-     (comp/list-table variables/headers
-                      variables
-                      variables/render-item
-                      variables/render-item-keys
-                      nil)]))
+     (comp/list-table-auto variables/headers
+                           variables
+                           variables/render-item
+                           variables/render-item-keys
+                           nil)]))

 (rum/defc form-labels < rum/static [labels]
   (when (not-empty labels)
     [:div.form-view-group
      (comp/form-section "Labels")
-     (comp/list-table labels/headers
-                      labels
-                      labels/render-item
-                      labels/render-item-keys
-                      nil)]))
+     (comp/list-table-auto labels/headers
+                           labels
+                           labels/render-item
+                           labels/render-item-keys
+                           nil)]))

 (rum/defc form-deployment < rum/static [deployment]
   (let [autoredeloy (:autoredeploy deployment)
@@ -172,16 +147,14 @@
 (rum/defc form-tasks < rum/static [tasks]
   [:div.form-view-group
    (comp/form-section "Tasks")
-   (comp/list-table tasks/headers
-                    (filter #(not (= "shutdown" (:state %))) tasks)
-                    tasks/render-item
-                    tasks/render-item-keys
-                    tasks/onclick-handler)])
+   (comp/list-table-auto tasks/headers
+                         (filter #(not (= "shutdown" (:state %))) tasks)
+                         tasks/render-item
+                         tasks/render-item-keys
+                         tasks/onclick-handler)])

-(rum/defc form < rum/reactive
-                 init-state-mixin [service]
-  (let [networks (rum/react service-networks)
-        tasks (rum/react service-tasks)
+(rum/defc form < rum/static [data]
+  (let [{:keys [service networks tasks]} data
         ports (:ports service)
         mounts (:mounts service)
         secrets (:secrets service)


removing korma dependency

removing korma dependency

--- project.clj
+++ project.clj
@@ -10,7 +10,6 @@
                  [ring/ring-json "0.3.1"]
                  [jumblerg/ring.middleware.cors "1.0.1"]
                  [compojure "1.1.8"]
-                 [korma "0.3.2"]
                  [yesql "0.4.0"]
                  [org.clojure/java.jdbc "0.3.3"]
                  [mysql/mysql-connector-java "5.1.6"]


Release ancient-clj 0.3.1

Release ancient-clj 0.3.1

--- project.clj
+++ project.clj
@@ -11,7 +11,7 @@
                  [tentacles "0.3.0"]
                  [com.taoensso/timbre "3.3.1"]
                  [com.novemberain/monger "2.0.0"]
-                 [ancient-clj "0.3.0"]
+                 [ancient-clj "0.3.1"]
                  [com.draines/postal "1.11.3"]
                  [version-clj "0.1.1"]
                  [clojurewerkz/quartzite "2.0.0"]