Update function for Processing 2.0.

Update function for Processing 2.0.

--- src/quil/core.clj
+++ src/quil/core.clj
@@ -999,10 +999,10 @@
     :added "1.0"}
   create-graphics
   "Creates and returns a new PGraphics object of the types :p2d, :p3d,
-  :java2d, :pdf. Use this class if you need to draw into an off-screen
-  graphics buffer. It's not possible to use create-graphics with the
-  :opengl renderer, because it doesn't allow offscreen use. The :pdf
-  renderer requires the filename parameter.
+  :java2d, :pdf. By default :java2d is used. Use this class if you
+  need to draw into an off-screen graphics buffer. It's not possible
+  to use create-graphics with the :opengl renderer, because it doesn't
+  allow offscreen use. The :pdf renderer requires the filename parameter.

   It's important to call any drawing commands between begin-draw and
   end-draw statements. This is also true for any commands that affect
@@ -1015,6 +1015,8 @@
   graphics object will be honored. Note that transparency levels are
   binary: pixels are either complete opaque or transparent. This means
   that text characters will be opaque blocks."
+  ([w h]
+     (.createGraphics (current-applet) (int w) (int h)))
   ([w h renderer]
      (.createGraphics (current-applet) (int w) (int h) (resolve-constant-key renderer graphic-render-modes)))
   ([w h renderer path]
@@ -1508,7 +1510,7 @@
   completed (or after setup completes if called during the setup
   method). "
   []
-  (applet-safe-exit (current-applet)))
+  (applet-close (current-applet)))

 (defn
   ^{:requires-bindings false
@@ -1604,10 +1606,10 @@
                the level parameter."
   ([mode]
      (let [mode (resolve-constant-key mode filter-modes)]
-       (.filter (current-applet) (int mode))))
+       (.filter (current-surface) (int mode))))
   ([mode level]
      (let [mode (resolve-constant-key mode filter-modes)]
-       (.filter (current-applet) (int mode) (float level)))))
+       (.filter (current-surface) (int mode) (float level)))))

 (defn
   ^{:requires-bindings true
@@ -1695,25 +1697,6 @@
   ([] (.get (current-surface)))
   ([x y] (.get (current-surface) (int x) (int y)))
   ([x y w h] (.get (current-surface) (int x) (int y) (int w) (int h))))
-
-(declare load-pixels)
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "pixels[]"
-    :category "Image"
-    :subcategory "Pixels"
-    :added "1.0"}
-  pixels
-  "Array containing the values for all the pixels in the display
-  window. This array is therefore the size of the display window. If
-  this array is modified, the update-pixels fn must be called to update
-  the changes. Calls load-pixels before obtaining the pixel array.
-
-  Only works with P2D and P3D renderer."
-  []
-  (load-pixels)
-  (.-pixels (current-surface)))

 (defn
   ^{:requires-bindings true
@@ -1740,17 +1723,6 @@
   geeky debugging sessions much happier. "
   ([val] (PApplet/hex (int val)))
   ([val num-digits] (PApplet/hex (int val) (int num-digits))))
-
-(defn
-  ^{:require-binding false
-    :processing-name "hex()"
-    :category "Data"
-    :subcategory "Conversion"}
-  unhex
-  "Converts a String representation of a hexadecimal number to its
-  equivalent integer value."
-  [hex-str]
-  (PApplet/unhex (str hex-str)))

 (defn
   ^{:requires-bindings true
@@ -2088,19 +2060,6 @@

 (defn
   ^{:requires-bindings true
-    :processing-name "loadBytes()"
-    :category "Input"
-    :subcategory "Files"
-    :added "1.0"}
-  load-bytes
-  "Reads the contents of a file or url and places it in a byte
-  array. The filename parameter can also be a URL to a file found
-  online."
-  [filename]
-  (.loadBytes (current-applet) (str filename)))
-
-(defn
-  ^{:requires-bindings true
     :processing-name "loadFont()"
     :category "Typography"
     :subcategory "Loading & Displaying"
@@ -2194,17 +2153,6 @@
   "Load a geometry from a file as a PShape."
   [filename]
   (.loadShape (current-applet) filename))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "loadStrings()"
-    :category "Input"
-    :subcategory "Files"
-    :added "1.0"}
-  load-strings
-  "Load data from a file and shove it into a String array."
-  [filename]
-  (.loadStrings (current-applet) filename))

 (defn
   ^{:requires-bindings false
@@ -2616,8 +2564,10 @@
   and right are the minimum and maximum x values, top and bottom are
   the minimum and maximum y values, and near and far are the minimum
   and maximum z values. If no parameters are given, the default is
-  used: ortho(0, width, 0, height, -10, 10)."
+  used: (ortho 0 width 0 height -10 10)"
   ([] (.ortho (current-surface)))
+  ([left right bottom top]
+   (.ortho (current-surface) (float left) (float right) (float bottom) (float top)))
   ([left right bottom top near far]
      (.ortho (current-surface) (float left) (float right) (float bottom) (float top) (float near) (float far))))

@@ -2646,6 +2596,23 @@

 (defn
   ^{:requires-bindings true
+    :processing-name "pixels[]"
+    :category "Image"
+    :subcategory "Pixels"
+    :added "1.0"}
+  pixels
+  "Array containing the values for all the pixels in the display
+  window. This array is therefore the size of the display window. If
+  this array is modified, the update-pixels fn must be called to update
+  the changes. Calls load-pixels before obtaining the pixel array.
+
+  Only works with P2D and P3D renderer."
+  []
+  (load-pixels)
+  (.-pixels (current-surface)))
+
+(defn
+  ^{:requires-bindings true
     :processing-name "pmouseX"
     :category "Input"
     :subcategory "Mouse"
@@ -2875,6 +2842,22 @@
   ([max] (.random (current-applet) (float max)))
   ([min max] (.random (current-applet) (float min) (float max))))

+(defn
+  ^{:requires-bindings true
+    :processing-name "randomGaussian()"
+    :category "Math"
+    :subcategory "Random"
+    :added "2.0"}
+  random-gaussian
+  "Returns a float from a random series of numbers having a mean of 0 and
+  standard deviation of 1. Each time the randomGaussian() function is called,
+  it returns a number fitting a Gaussian, or normal, distribution.
+  There is theoretically no minimum or maximum value that randomGaussian()
+  might return. Rather, there is just a very low probability that values far
+  from the mean will be returned; and a higher probability that numbers near
+  the mean will be returned. ."
+  []
+  (.randomGaussian (current-applet)))

 (defn
   ^{:requires-bindings true
@@ -2923,8 +2906,13 @@
    parameters set the location of the upper-left corner, the third
    sets the width, and the fourth sets the height. These parameters
    may be changed with rect-mode."
-  [x y width height]
-  (.rect (current-surface) (float x) (float y) (float width) (float height)))
+  ([x y width height]
+     (.rect (current-surface) (float x) (float y) (float width) (float height)))
+  ([x y width height r]
+     (.rect (current-surface) (float x) (float y) (float width) (float height) (float r)))
+  ([x y width height top-left-r top-right-r bottom-right-r bottom-left-r]
+     (.rect (current-surface) (float x) (float y) (float width) (float height)
+            (float top-left-r) (float top-right-r) (float bottom-right-r) (float bottom-left-r))))

 (def ^{:private true}
   rect-modes {:corner PApplet/CORNER
@@ -3201,7 +3189,8 @@
   as the renderer. This function can be further controlled by
   push-matrix and pop-matrix."
   ([s] (.scale (current-surface) (float s)))
-  ([sx sy] (.scale (current-surface) (float sx) (float sy))))
+  ([sx sy] (.scale (current-surface) (float sx) (float sy)))
+  ([sx sy sz] (.scale (current-surface) (float sx) (float sy) (float sz))))

 (defn- ^java.awt.Dimension current-screen
   []
@@ -3282,7 +3271,7 @@

 (defn
   ^{:requires-bindings false
-    :processing-name "seconds()"
+    :processing-name "second()"
     :category "Input"
     :subcategory "Time & Date"
     :added "1.0"}
@@ -3459,12 +3448,6 @@
   [angle]
   (PApplet/sin (float angle)))

-(defn size
-  "Not supported. Use :size key in applet or defapplet"
-  [& args]
-  (println "Deprecated - size should be specified as a :size key to applet or defapplet")
-  nil)
-
 (defn
   ^{:requires-bindings true
     :processing-name "smooth()"
@@ -3476,9 +3459,18 @@
   down the frame rate of the application, but will enhance the visual
   refinement.

+  The level parameter (int) increases the level of smoothness with the P2D and P3D
+  renderers. This is the level of over sampling applied to the graphics buffer.
+  The value '2' will double the rendering size before scaling it down to the
+  display size. This is called '2x anti-aliasing.' The value 4 is used for 4x
+  anti-aliasing and 8 is specified for 8x anti-aliasing. If level is set to 0,
+  it will disable all smoothing; it's the equivalent of the function noSmooth().
+  The maximum anti-aliasing level is determined by the hardware of the machine
+  that is running the software.
+
   Note that smooth will also improve image quality of resized images."
-  []
-  (.smooth (current-surface)))
+  ([] (.smooth (current-surface)))
+  ([level] (.smooth (current-surface) (int level))))

 (defn
   ^{:requires-bindings true
@@ -3503,7 +3495,7 @@
     :subcategory "3D Primitives"
     :added "1.0"}
   sphere
-  "Genarates a hollow ball made from tessellated triangles."
+  "Generates a hollow ball made from tessellated triangles."
   [radius] (.sphere (current-surface) (float radius)))

 (defn
@@ -3747,7 +3739,7 @@
   text-align fn, which gives the option to draw to the left, right, and
   center of the coordinates.

-  The x1, y1, x2 and y2 (and optional z) parameters define a
+  The x1, y1, x2 and y2 parameters define a
   rectangular area to display within and may only be used with string
   data. For text drawn inside a rectangle, the coordinates are
   interpreted based on the current rect-mode setting.
@@ -3756,8 +3748,7 @@
   in 2D at the surface of the window."
   ([^String s x y] (.text (current-surface) s (float x) (float y)))
   ([^String s x y z] (.text (current-surface) s (float x) (float y) (float z)))
-  ([^String s x1 y1 x2 y2] (.text (current-surface) s (float x1) (float y1) (float x2) (float y2)))
-  ([^String s x1 y1 x2 y2 z] (.text (current-surface) s (float x1) (float y1) (float x2) (float y2) (float z))))
+  ([^String s x1 y1 x2 y2] (.text (current-surface) s (float x1) (float y1) (float x2) (float y2))))

 (def ^{:private true}
   horizontal-alignment-modes {:left PApplet/LEFT
@@ -3875,8 +3866,7 @@

 (def ^{:private true}
   text-modes {:model PConstants/MODEL
-              :shape PConstants/SHAPE
-              :screen PConstants/SCREEN})
+              :shape PConstants/SHAPE})

 (defn
   ^{:requires-bindings true
@@ -3886,21 +3876,10 @@
     :added "1.0"}
   text-mode
   "Sets the way text draws to the screen - available modes
-  are :model, :shape and :screen
+  are :model and :shape

   In the default configuration (the :model mode), it's possible to
   rotate, scale, and place letters in two and three dimensional space.
-
-  Changing to :screen mode draws letters directly to the front of the
-  window and greatly increases rendering quality and speed when used
-  with the :p2d and :p3d renderers. :screen with :opengl
-  and :java2d (the default) renderers will generally be slower, though
-  pixel accurate with :p2d and :p3d. With :screen, the letters draw at
-  the actual size of the font (in pixels) and therefore calls to
-  text-size will not affect the size of the letters. To create a font
-  at the size you desire, use create-font. When using :screen, any
-  z-coordinate passed to a text command will be ignored, because your
-  computer screen is...flat!

   The :shape mode draws text using the the glyph outlines of
   individual characters rather than as textures. This mode is only
@@ -4100,11 +4079,22 @@
     :category "Data"
     :subcategory "Conversion"
     :added "1.0"}
-    unbinary
+  unbinary
   "Unpack a binary string to an integer. See binary for converting
   integers to strings."
   [str-val]
   (PApplet/unbinary (str str-val)))
+
+(defn
+  ^{:require-binding false
+    :processing-name "hex()"
+    :category "Data"
+    :subcategory "Conversion"}
+  unhex
+  "Converts a String representation of a hexadecimal number to its
+  equivalent integer value."
+  [hex-str]
+  (PApplet/unhex (str hex-str)))

 (defn
   ^{:requires-bindings true


Correct an client error that was causing full duration fetches all the time.

--- metlog-vault/src-client/metlog_client/server.cljs
+++ metlog-vault/src-client/metlog_client/server.cljs
@@ -45,6 +45,7 @@

 (defn- points-range [ data ]
   (and data
+       (> (count (:series-points data)) 0)
        (let [ series-points (:series-points data) ]
          {:begin-t (:t (get series-points 0))
           :end-t (:t (get series-points (- (count series-points) 1)))})))
@@ -104,7 +105,8 @@
           (let [ updated-data
                 (-> current-data
                     (merge-series-data (<! (<<< fetch-series-data series-name (historical-query current-data range))))
-                    (merge-series-data (<! (<<< fetch-series-data series-name (update-query current-data range)))))]
+                    (merge-series-data (<! (<<< fetch-series-data series-name (update-query current-data range))))
+                    )]
             (when updated-data
               (update-fn updated-data))
             (recur current-time (:query-window message) updated-data )))


Fix issue in variable scope (let)

Fix issue in variable scope (let)

--- src/clj/jest/compiler/NativeJestCompiler.clj
+++ src/clj/jest/compiler/NativeJestCompiler.clj
@@ -396,7 +396,7 @@
   [this ^JestParser$VarScopeContext ctx]
   (let [names (into [] (map #(symbol (. % getText)) (. ctx name)))
         vals (into [] (map #(.. this (visitExpression %)) (. ctx exp)))
-        bindings (flatten (zip names vals))
+        bindings (apply concat (zip names vals))
         expressions (into [] (map #(. this (visitStatementTerm %)) (. ctx terms)))]
     `(let [~@bindings] ~@expressions)))


ratio features

ratio features

--- src/clojure/zensols/nlparse/feature/char.clj
+++ src/clojure/zensols/nlparse/feature/char.clj
@@ -208,16 +208,26 @@
     * **:caps-capitalized** number of capitalied tokens (i.e. `Yes`)
     * **:caps-all** number of all caps tokens (i.e. `YES`)"
   [tokens]
-  (let [[cap capitalized caps] (StringUtils/countCapitals tokens)]
-    {:caps-first-char cap
-     :caps-capitalized capitalized
-     :caps-all caps
-     :cap-utterance (->> tokens first first
-                         (#(and % (Character/isUpperCase %))))}))
+  (let [toks (map :text tokens)
+        [cap capitalized caps] (StringUtils/countCapitals (into-array toks))
+        tlen (count toks)]
+    {:caps-first-char-count cap
+     :caps-first-char-ratio (/ cap tlen)
+     :caps-capitalized-count capitalized
+     :caps-capitalized-ratio (/ capitalized tlen)
+     :caps-all-count caps
+     :caps-all-ratio (/ caps tlen)
+     :cap-utterance (->> toks first first
+                         (#(and % (Character/isUpperCase %)))
+                         (#(if % true false)))}))

 (defn capital-feature-metas
   "See [[capital-features]]."
   []
-  [[:caps-first-char 'numeric]
-   [:caps-capitalized 'numeric]
-   [:caps-all 'numeric]])
+  [[:caps-first-char-count 'numeric]
+   [:caps-first-char-ratio 'numeric]
+   [:caps-capitalized-count 'numeric]
+   [:caps-capitalized-ratio 'numeric]
+   [:caps-all-count 'numeric]
+   [:caps-all-ratio 'numeric]
+   [:cap-utterance 'boolean]])


another ch3 ex

another ch3 ex

--- docs/sc-book/sc-three.clj
+++ docs/sc-book/sc-three.clj
@@ -1,5 +1,26 @@
 (ns sc-three
   (:use [overtone.live]))
+
+;; This is the default synth. Is it accessible from Overtone?
+(comment
+                SynthDef(\default, { arg out=0, freq=440, amp=0.1, pan=0, gate=1;
+                                var z;
+                                z = LPF.ar(
+                                                Mix.new(VarSaw.ar(freq + [0, Rand(-0.4,0.0), Rand(0.0,0.4)], 0, 0.3, 0.3)),
+                                                XLine.kr(Rand(4000,5000), Rand(2500,3200), 1)
+                                        ) * Linen.kr(gate, 0.01, 0.7, 0.3, 2);
+                                OffsetOut.ar(out, Pan2.ar(z, pan, amp));
+                }, [\ir])
+)
+
+(defsynth s [out 0 freq 440 amp 0.1 pan 0 gate 1]
+  (let [z (* (lpf (mix (var-saw [freq (+ freq (ranged-rand -0.4 0.0)) (+ freq (ranged-rand 0.0 0.4))] 0 0.3 0.3))
+                  (x-line:kr (ranged-rand 4000 5000) (ranged-rand 2500 3200) 1))
+             (linen:kr gate 0.01 0.7 0.3 2))]
+    (offset-out out (pan2 z pan amp))))
+
+(defn release [x releaseTime]
+  (ctl x :gate (- releaseTime)))

 ;; Page 83
 ;; "foo" repeats every second
@@ -40,11 +61,6 @@
   )
 )

-;; Is there a \default synthesizer in Overtone?
-(defsynth s [freq 440]
-  (let [src (* 0.3 (sin-osc freq))]
-    (out 0 src)))
-
 ;; Is there a better way?
 (do
   (def cont (atom 0))
@@ -69,3 +85,77 @@

 (go)
 (go)
+
+
+;; Page 88
+///////////////////////////////////////////////////////////////
+// Figure 3.3 Nesting tasks inside routines
+(comment
+(
+r = Routine({
+        c = TempoClock.new; // make a TempoClock
+        // start a 'wobbly' loop
+        t = Task({
+                loop({
+                        x.release(0.1);
+                        x = Synth(\default, [freq: 61.midicps, amp: 0.2]);
+                        0.2.wait;
+                        x.release(0.1);
+                        x = Synth(\default, [freq: 67.midicps, amp: 0.2]);
+                        rrand(0.075, 0.25).wait; // random wait from 0.1 to 0.25 seconds
+                });
+        }, c); // use the TempoClock to play this Task
+        t.start;
+        nil.yield;
+
+        // now add some notes
+        y = Synth(\default, [freq: 73.midicps, amp: 0.3]);
+        nil.yield;
+        y.release(0.1);
+        y = Synth(\default, [freq: 79.midicps, amp: 0.3]);
+        c.tempo = 2; // double time
+        nil.yield;
+        t.stop; y.release(1); x.release(0.1); // stop the Task and Synths
+});
+)
+
+r.next; // start loop
+r.next; // first note
+r.next; // second note; loop goes 'double time'
+r.next; // stop loop and fade
+)
+
+(do
+  (def cont (atom true))
+  (def x (atom nil))
+  (def y (atom nil))
+  (def t (atom 1))
+
+  (defn go1 []
+   (loop []
+     (when (not (nil? @x)) (release @x 0.1))
+     (when @cont
+       (reset! x (s :freq (midi->hz 61) :amp 0.2))
+       (Thread/sleep (/ 200 @t))
+       (release @x 0.1)
+       (reset! x (s :freq (midi->hz 67) :amp 0.2))
+       (Thread/sleep (/ (ranged-rand 75 250) @t))
+       (recur))))
+
+  (defn go2 []
+    (reset! y (s :freq (midi->hz 73) :amp 0.3)))
+
+  (defn go3 []
+    (when (not (nil? @y)) (release @y 0.1))
+    (reset! y (s :freq (midi->hz 79) :amp 0.3))
+    (reset! t 2))
+
+  (defn go4 []
+    (when (not (nil? @y)) (release @y 0.1))
+    (reset! cont false))
+)
+
+(go1)
+(go2)
+(go3)
+(go4)


Updated for new data model.

Updated for new data model.

--- src/com/lemondronor/orbital_detector/geo.clj
+++ src/com/lemondronor/orbital_detector/geo.clj
@@ -29,10 +29,8 @@
     :else b))

-(defn point [r]
-  (spatial/spatial4j-point
-   (:lat (:position r))
-   (:lon (:position r))))
+(defn point [lat lon]
+  (spatial/spatial4j-point lat lon))

 (defn rad2deg [r]


Remove with-env! macro

Remove with-env! macro

- The with-env! macro wasn't much use because tasks defer their
  operations until the pipeline actually runs and the env is not usually
  captured in a let binding. So setting the env when you construct the
  task doesn't really have the effect you'd hope it would.

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -622,16 +622,6 @@
       (reset-build!)
       ((task-stack #(do (sync! %) %)) (commit! (reset-fileset))))))

-(defmacro with-env!
-  "Given an env map and some body expressions, evaluates the body in the
-  given env (via set-env!). The current env is then restored. Note that
-  not all env settings are idempotent and/or reversible, so be careful."
-  [env & body]
-  `(let [env# (get-env)]
-     (try (set-env! ~env)
-          ~@body
-          (finally (set-env! env#)))))
-
 (defmacro boot
   "The REPL equivalent to the command line 'boot'. If all arguments are
   strings then they are treated as if they were given on the command line.


Add another approach to word-count example in clj

--- assignments/clojure/word-count/example.clj
+++ assignments/clojure/word-count/example.clj
@@ -9,3 +9,15 @@
        (group-by identity)
        (reduce (fn [acc [word occurrences]]
                  (assoc acc word (count occurrences))) {})))
+
+;; Another approach
+(ns phrase
+ (:require [clojure.string :refer [split lower-case]]))
+
+(defn- sanitize-and-split [phrase]
+  (-> (lower-case phrase)
+      (split #"\W+")))
+
+(defn word-count [phrase]
+  (-> (sanitize-and-split phrase)
+      (frequencies)))


Fix tests

Fix tests

--- backend/test/akvo/lumen/endpoints_test.clj
+++ backend/test/akvo/lumen/endpoints_test.clj
@@ -344,7 +344,9 @@
               (is (= email (-> invitation :recipients first)))
               (is (= "Akvo Lumen invite" (-> invitation :email (get "Subject"))))
               (let [url (str/replace (re-find #"https.*+" (-> invitation :email (get "Text-part"))) "https://t1.lumen.local" "")
-                    res-verify (h (get* url))]
+                    [url auth-flag] (str/split url #"\?")
+                    auth (last (str/split auth-flag #"&"))
+                    res-verify (h (get* url {"auth" auth}))]
                 (is (= 302 (:status res-verify))))
               (let [users (-> (h (get* (api-url "/admin/users"))) body-kw :users)]
                 (is (= 200 (:status (h (del* (api-url "/admin/users" (:id (first (filter #(= email (:email %)) users))))))))))))))


add some more comments to DimDraw

add some more comments to DimDraw

--- src/main/clojure/conexp/layouts/dim_draw.clj
+++ src/main/clojure/conexp/layouts/dim_draw.clj
@@ -43,6 +43,11 @@

 (defn is-compatible
+  "Checks if two edges are compatible.
+
+  For an ordering given as graph and two edges e1 and e2 this means that the
+  transitive closure of the graph with both edges added does not contain a
+  (non-trivial) cycle."
   [digraph e1 e2]
   (let [tc (transitive-closure
              (uber/add-directed-edges digraph e1 e2))]
@@ -51,6 +56,10 @@
                 (not (lg/has-edge? tc (lg/dest e) (lg/src e)))))))

 (defn tig
+  "Returns the \"transitive incompatibility graph\" (tig) for a given ordering
+  (given ad graph).
+
+  See Section 3, Dürrschnabel, Hanika, Stumme (2019) https://arxiv.org/abs/1903.00686"
   [graph]
   (let [ccg (co-comparability (lg/nodes graph) #(lg/has-edge? graph %1 %2))
         tig-nodes (map edge->vec (lg/edges ccg))]
@@ -131,7 +140,7 @@
                    CAtom (atom ())]
                ;(println "<=CAtom: " @<=CAtom)
                (while (= @<=CAtom nil)
-                 (swap! CAtom
+                 (swap! CAtom                               ; update C in each iteration
                         (fn [C] (let [I (tig (transitive-edge-union P <= C))]
                                   ;(println "(transitive-edge-union P <= C):")
                                   ;(uber/pprint (transitive-edge-union P <= C))
@@ -140,20 +149,20 @@
                                   ;(println C " <-- C ; new -->" (sat-reduction I))
                                   (union C (map reverse (sat-reduction I))))))
                  (let [C @CAtom
-                       <=CNew (compute-conjugate-order (transitive-edge-union P <= C))]
+                       <=CNew (compute-conjugate-order (transitive-edge-union P <= C))] ; compute new value for <=C
                    ;(println "C: " C)
                    ;(println "C size: " (count C))
                    ;(println "<=CNew: " <=CNew)
-                   (reset! <=CAtom
+                   (reset! <=CAtom                          ; set new value
                            <=CNew)))
                @<=CAtom)
          <=1 (map edge->vec (lg/edges (transitive-edge-union P <= <=C)))
          <=2 (map edge->vec (lg/edges (transitive-edge-union P <= (map reverse <=C))))
-         elements-less (fn [le elem] (- (count (filter #(some #{[% elem]} le) P)) 1))
+         elements-less (fn [le elem] (- (count (filter #(some #{[% elem]} le) P)) 1)) ; util function used to compute |{x' | x' <= x}| - 1 for given <= and x
          coords (map #(let
                         [x1 (elements-less <=1 %) x2 (elements-less <=2 %)]
                         [% [x1 x2]]) P)]
-     coords)))
+     coords)))                                              ; return coordinates in x1-x2-coordinate-system

 (defn dim-draw-layout
   "Returns a layout for a given lattice.
@@ -180,6 +189,8 @@
   (if (> i 1) (replicate-str (str s s) (/ i 2)) s))

 (defn draw-ascii
+  "Given coordinates in the form `[[e1 [x1 y1]] [e2 [x2 y2]] ...]`, prints
+  the elements in the console."
   [coords]
   (let [x-step 2
         size (count coords)


Remove console report namespace using old result types

--- src/main/clojure/lazytest/report/console.clj
+++ src/main/clojure/lazytest/report/console.clj
@@ -1,61 +0,0 @@
-(ns lazytest.report.console
-  (:use [lazytest.result :only (success?)]
-	[clojure.pprint :only (pprint)]
-	[lazytest.report.color :only (colorize)]
-	[clojure.stacktrace :only (print-cause-trace)]
-	[clojure.java.io :only (file)]))
-
-(defn indent [level]
-  (dotimes [i level] (print "    ")))
-
-(defprotocol ConsoleTestReport
-  (p [r l] "Print result r to the console, indented to level l"))
-
-(defn docs [r]
-  (:doc (meta (:source r))))
-
-(defn location [r]
-  (let [m (meta (:source r))]
-    (str (:file m) ":" (:line m))))
-
-(extend-protocol ConsoleTestReport
-  lazytest.result.TestResultGroup
-  (p [r l]
-     (when (seq (docs r))
-       (indent l)
-       (println (colorize (docs r) (if (success? r) :green :red))))
-     (let [sub-indent (if (seq (docs r)) (inc l) l)]
-       (doseq [c (:children r)]
-	 (p c sub-indent))))
-
-  lazytest.result.Pass
-  (p [r l]
-     (indent l)
-     (println (colorize (docs r) :green)))
-
-  lazytest.result.Fail
-  (p [r l]
-     (indent l)
-     (println (colorize (docs r) :red))
-     (println "at" (location r))
-     (pprint (:reason r)))
-
-  lazytest.result.Thrown
-  (p [r l]
-     (indent l)
-     (println (colorize (docs r) :red))
-     (println "at" (location r))
-     (print-cause-trace (:throwable r)))
-
-  lazytest.result.Skip
-  (p [r l]
-     (indent l)
-     (println (colorize (docs r) :blue)))
-
-  lazytest.result.Pending
-  (p [r l]
-     (indent l)
-     (println (colorize (docs r)) :blue)))
-
-(defn report [results]
-  (doseq [r results] (p r 0)))


Whitespace trimming.

Whitespace trimming.

--- src-cljs/kixi/hecuba/tabs/sensors.cljs
+++ src-cljs/kixi/hecuba/tabs/sensors.cljs
@@ -142,7 +142,7 @@
                      :defaultChecked (get row :actual_annual "")
                      :on-change #(om/set-state! owner [:sensor :actual_annual] (.-checked (.-target %)))}]]]]])))))

-(defn form-row [data chart history table-id editing-chan]
+(defn form-row [data chart history table-id editing-chan]
   (fn [cursor owner]
     (reify
       om/IRender
@@ -224,7 +224,7 @@
                (sorting-th owner "Earliest Event" :lower_ts)
                (sorting-th owner "Last Event" :upper_ts)
                (sorting-th owner "Status" :status)]]
-             [:tbody
+             [:tbody
               (for [row (if sort-asc
                           (sort-by sort-key flattened-sensors)
                           (reverse (sort-by sort-key flattened-sensors)))]
@@ -281,7 +281,7 @@
           [:div {:id "sensors-table"}
            (om/build (sensors-table editing-chan) data {:opts {:histkey :sensors
                                                                :path    :readings}})]
-
+
           [:div {:id "sensor-edit-div" :class (if editing "" "hidden")}
            (om/build (sensor-edit-form data) (:sensor-edit data))]
           ;; FIXME: We should have better handling for IE8 here.
@@ -298,4 +298,3 @@
             [:div.col-md-12.text-center
              [:p.lead {:style {:padding-top 30}}
               "Charting in Internet Explorer version " agent/VERSION " coming soon."]])])))))
-


whoops that was a test

whoops that was a test

--- src/main/shadow/cljs/devtools/cljs_specs.clj
+++ src/main/shadow/cljs/devtools/cljs_specs.clj
@@ -4,12 +4,8 @@

 ;; FIXME: remove once this is in cljs.core

-(s/def ::bindings
-  (s/and #(even? (count %))
-         ::cs/bindings))
-
-(s/fdef clojure.core/let
-  :args (s/cat :bindings ::bindings
+(s/fdef cljs.core/let
+  :args (s/cat :bindings ::cs/bindings
                :body (s/* any?)))

 (s/fdef cljs.core/let


fix(repl): re-enable style coloring of input when copied to log

--- ccw.core/src/clj/ccw/repl/view_helpers.clj
+++ ccw.core/src/clj/ccw/repl/view_helpers.clj
@@ -50,7 +50,8 @@
      :out [default-log-style nil]
      :value [(partial set-style-range #(colored-style value-rgb-key)) nil]
      :pprint-out [(partial set-style-range #(colored-style value-rgb-key)) nil]
-     :in-expr [default-log-style :highlight-background]}))
+     :in-expr [:skip   ;; skip :in-expr styling because it's done upstream
+               :highlight-background]}))

 (defn- cursor-at-end
   "Puts the cursor at the end of the text in the given widget."
@@ -59,15 +60,15 @@

 (defn log
   [^ccw.repl.REPLView repl-view ^StyledText log ^String s type]
-  ;; We don't log values if it has already been pprinted by the back-end
   (ui-sync
     (let [charcnt (.getCharCount log)
           [log-style highlight-background] (get log-styles type [default-log-style nil])
            linecnt (.getLineCount log)
            new-content (if (re-find #"(\n|\r)$" s) s (str s \newline))]
       ; Add styles before adding text to the log panel
-      (let [style (log-style charcnt (.length new-content))]
-        (-> repl-view .logPanelStyleCache (.setStyleRange style)))
+      (when-not (= :skip log-style)
+        (let [style (log-style charcnt (.length new-content))]
+          (-> repl-view .logPanelStyleCache (.setStyleRange style))))
       (.append log new-content)
       (doto log
         cursor-at-end


added profiter de

added profiter de

--- src/babel/francais/lexicon.cljc
+++ src/babel/francais/lexicon.cljc
@@ -527,8 +527,9 @@
                          :imperfect "peign"}
               :synsem {:cat :verb
                        :sem {:pred :paint}}}
-;  "profiter (de)" {:synsem {:cat :verb
-;                            :sem {:pred :take-advantage-of}}}
+
+   "profiter (de)" {:synsem {:cat :verb
+                             :sem {:pred :take-advantage-of}}}

   "prendre" [{:synsem {:cat :verb
                        :past-participle "pris"


move aux default rules to beginning of verb default rules

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -153,90 +153,6 @@
       ;; </noun default rules>

       ;; <verb default rules>
-      (default ;; a verb's first argument's case is nominative.
-       {:synsem {:cat :verb
-                 :subcat {:1 {:cat :noun
-                              :case :nom}}}})
-
-      (default ;; a verb's second argument's case is accusative.
-       {:synsem {:cat :verb
-                 :subcat {:2 {:cat :noun
-                              :case :acc}}}})
-
-      (default ;;  a verb's first argument defaults to the semantic subject of the verb.
-       (let [subject-semantics (atom :top)]
-         {:synsem {:cat :verb
-                   :subcat {:1 {:sem subject-semantics}}
-                   :sem {:subj subject-semantics}}}))
-
-      (new-entries ;; remove the second argument and semantic object to make verbs intransitive.
-       {:synsem {:cat :verb
-                 :aux false
-                 :sem {:obj {:top :top}
-                       :reflexive false}
-                 :subcat {:2 {:cat :noun}
-                          :3 '()}}}
-       (fn [lexeme]
-         (dissoc-paths lexeme [[:synsem :sem :obj]
-                               [:synsem :subcat :2]])))
-
-      (default ;; reflexive defaults to false..
-       {:synsem {:cat :verb
-                 :aux false
-                 :sem {:reflexive false}}})
-
-      (default ;; ..but if a verb *is* reflexive:
-       (let [subject-semantics (atom {:animate true})
-             subject-agr (atom :top)]
-         {:synsem {:cat :verb
-                   :essere true
-                   :sem {:subj subject-semantics
-                         :obj subject-semantics
-                         :reflexive true}
-                   :subcat {:1 {:agr subject-agr
-                                :sem subject-semantics}
-                            :2 {:agr subject-agr
-                                :pronoun true
-                                :reflexive true
-                                :sem subject-semantics}}}}))
-
-      (default ;; a verb defaults to intransitive.
-       {:synsem {:cat :verb
-                 :subcat {:1 {:top :top}
-                          :2 '()}}})
-
-      (default ;; intransitive verbs' :obj is :unspec.
-       {:synsem {:cat :verb
-                 :subcat {:1 {:top :top}
-                          :2 '()}
-                 :sem {:obj :unspec}}})
-
-      (default ;;  a verb's second argument (if there is one)
-       ;; defaults to the semantic object of the verb.
-       (let [object-semantics (atom :top)]
-         {:synsem {:cat :verb
-                   :subcat {:2 {:sem object-semantics}}
-                   :sem {:obj object-semantics}}}))
-
-      (default ;; a verb defaults to transitive if not intransitive..
-       {:synsem {:cat :verb
-                 :subcat {:1 {:top :top}
-                          :2 {:top :top}
-                          :3 '()}}})
-
-      (default ;;  but if there *is* a third argument, it defaults
-       ;; to the semantic indirect object of the verb.
-       (let [indirect-object-semantics (atom :top)]
-         {:synsem {:cat :verb
-                   :subcat {:3 {:sem indirect-object-semantics}}
-                   :sem {:iobj indirect-object-semantics}}}))
-
-      (default ;; a verb agrees with its first argument
-       (let [subject-agreement (atom :top)]
-         {:synsem {:cat :verb
-                   :subcat {:1 {:agr subject-agreement}}
-                   :agr subject-agreement}}))
-
       (default ;; aux defaults to false..
        {:synsem {:cat :verb
                  :aux false}})
@@ -260,6 +176,90 @@
                                 :infl :past
                                 :subcat {:1 subject}
                                 :sem sem}}}}))
+
+      (default ;; a verb's first argument's case is nominative.
+       {:synsem {:cat :verb
+                 :subcat {:1 {:cat :noun
+                              :case :nom}}}})
+
+      (default ;; a verb's second argument's case is accusative.
+       {:synsem {:cat :verb
+                 :subcat {:2 {:cat :noun
+                              :case :acc}}}})
+
+      (default ;;  a verb's first argument defaults to the semantic subject of the verb.
+       (let [subject-semantics (atom :top)]
+         {:synsem {:cat :verb
+                   :subcat {:1 {:sem subject-semantics}}
+                   :sem {:subj subject-semantics}}}))
+
+      (new-entries ;; remove the second argument and semantic object to make verbs intransitive.
+       {:synsem {:cat :verb
+                 :aux false
+                 :sem {:obj {:top :top}
+                       :reflexive false}
+                 :subcat {:2 {:cat :noun}
+                          :3 '()}}}
+       (fn [lexeme]
+         (dissoc-paths lexeme [[:synsem :sem :obj]
+                               [:synsem :subcat :2]])))
+
+      (default ;; reflexive defaults to false..
+       {:synsem {:cat :verb
+                 :aux false
+                 :sem {:reflexive false}}})
+
+      (default ;; ..but if a verb *is* reflexive:
+       (let [subject-semantics (atom {:animate true})
+             subject-agr (atom :top)]
+         {:synsem {:cat :verb
+                   :essere true
+                   :sem {:subj subject-semantics
+                         :obj subject-semantics
+                         :reflexive true}
+                   :subcat {:1 {:agr subject-agr
+                                :sem subject-semantics}
+                            :2 {:agr subject-agr
+                                :pronoun true
+                                :reflexive true
+                                :sem subject-semantics}}}}))
+
+      (default ;; a verb defaults to intransitive.
+       {:synsem {:cat :verb
+                 :subcat {:1 {:top :top}
+                          :2 '()}}})
+
+      (default ;; intransitive verbs' :obj is :unspec.
+       {:synsem {:cat :verb
+                 :subcat {:1 {:top :top}
+                          :2 '()}
+                 :sem {:obj :unspec}}})
+
+      (default ;;  a verb's second argument (if there is one)
+       ;; defaults to the semantic object of the verb.
+       (let [object-semantics (atom :top)]
+         {:synsem {:cat :verb
+                   :subcat {:2 {:sem object-semantics}}
+                   :sem {:obj object-semantics}}}))
+
+      (default ;; a verb defaults to transitive if not intransitive..
+       {:synsem {:cat :verb
+                 :subcat {:1 {:top :top}
+                          :2 {:top :top}
+                          :3 '()}}})
+
+      (default ;;  but if there *is* a third argument, it defaults
+       ;; to the semantic indirect object of the verb.
+       (let [indirect-object-semantics (atom :top)]
+         {:synsem {:cat :verb
+                   :subcat {:3 {:sem indirect-object-semantics}}
+                   :sem {:iobj indirect-object-semantics}}}))
+
+      (default ;; a verb agrees with its first argument
+       (let [subject-agreement (atom :top)]
+         {:synsem {:cat :verb
+                   :subcat {:1 {:agr subject-agreement}}
+                   :agr subject-agreement}}))

       (default ;; essere defaults to false.
        {:synsem {:cat :verb


added leaf handling for nicer data setup

--- src/bracketolojy/tournament.clj
+++ src/bracketolojy/tournament.clj
@@ -29,11 +29,14 @@
 (defmulti compute-matchup
           "Compute a matchup."
           (fn [pick-scoring upset-scoring field]
-            (and (coll? field) (= (count field) 2)
-                 (coll? (first field)) (coll? (last field)))))
+            (cond
+              (and (coll? field) (= (count field) 2) (record? (first field)) (record? (last field)))
+              :leaf
+              (and (coll? field) (= (count field) 2) (coll? (first field)) (coll? (last field)))
+              :branch)))
 (defmethod compute-matchup :default [_ _ matchup]
   matchup)
-(defmethod compute-matchup true [pick-scoring upset-scoring [[upper-field _] [lower-field _] :as fields]]
+(defmethod compute-matchup :branch [pick-scoring upset-scoring [[upper-field] [lower-field] :as fields]]
   (let [round (count upper-field)
         pick-pts (get pick-scoring round)
         upset-pts (get upset-scoring round)]
@@ -49,19 +52,21 @@
               (assoc %1 name %2)))
         {})
       vals
-      (#(vector % fields))
-      )))
+      (#(vector % fields)))))
+(defmethod compute-matchup :leaf [pick-scoring upset-scoring [a b]]
+  (compute-matchup pick-scoring upset-scoring [[[a]] [[b]]]))
+

 (def sample-data
   [
     [
-      [[(->Team "Florida" 1 0.9502 1 \_)] \_]
-      [[(->Team "Albany" 16 0.4698 1 \_)] \_]
+      (->Team "Florida" 1 0.9502 1 0)
+      (->Team "Albany" 16 0.4698 1 0)
       ]

     [
-      [[(->Team "Colorado" 8 0.7156 1 \_)] \_]
-      [[(->Team "Pittsburgh" 9 0.8848 1 \_)] \_]
+      (->Team "Colorado" 8 0.7156 1 0)
+      (->Team "Pittsburgh" 9 0.8848 1 0)
       ]
    ])


[WM] pass server config to start-http-server

--- resources/leiningen/new/kraken_http_api/server.clj
+++ resources/leiningen/new/kraken_http_api/server.clj
@@ -19,5 +19,5 @@

 (defn -main [& args]
   (let [rabbit-resources (queue/initialize)]
-    (start-http-server)
+    (start-http-server (config [:server]))
     (immutant/at-exit (partial shutdown rabbit-resources))))


Comments

Comments

--- src/cljs/clojure_rest/core.cljs
+++ src/cljs/clojure_rest/core.cljs
@@ -156,7 +156,9 @@
                    (doall
                      (map #(swap! % update-in [::show-details] not) card-refs))
                  )
-        ; !!! The following handler works when given @cards but no refresh occurs
+        ; !!! The following handler works when given @cards
+        ; But no refresh occurs! And the screen is blocked
+        ; This is probably because the cursors must be re-created
         ; on-click2 (fn [] (swap! card-refs #(map toggle %)))
         ]
     [:button.header-button


Improved docstring on core.hash ns functions.

--- src/clojure/buddy/core/hash.clj
+++ src/clojure/buddy/core/hash.clj
@@ -6,8 +6,9 @@

 (defn digest
   "Generic function for create cryptographic hash. Given an algorithm
-name and many parts as byte array. Returns a computed hash as byte array.
-This function hides java api to `java.security.MessageDigest`"
+name and many parts of any type that implements ByteArray protocol,
+return a computed hash as byte array. This function hides java api
+to `java.security.MessageDigest`"
   [algorithm & parts]
   (let [md (MessageDigest/getInstance algorithm)]
     (doseq [part parts]
@@ -24,7 +25,7 @@
 (def make-md5 (partial digest "MD5"))

 ;; Alias of same secure hash algorithms previously
-;; defined but return human readable hexadecimal
+;; defined but return human readable hexadecimal
 ;; encoded output.
 (def sha256 (comp bytes->hex make-sha256))
 (def sha384 (comp bytes->hex make-sha384))


Removed a debug message

Removed a debug message

--- web-app/src/cljs/potato/core.cljs
+++ web-app/src/cljs/potato/core.cljs
@@ -660,7 +660,6 @@

 (defn toggle-hidden [message]
   (let [hidden (message-hidden-p message)]
-    (cljs.pprint/cl-format true "Hidden → ~s" (not hidden))
     (send-update-hidden (:id message) (not hidden))))

 (defn gear-menu [message owner opts]


bb: fix priority queue

bb: fix priority queue

--- src/java_time/graph.cljc
+++ src/java_time/graph.cljc
@@ -198,6 +198,7 @@
               add #?(:bb #(swap! q (fn [prev]
                                      (sort-by (fn [^ConversionPath p]
                                                 [(.cost p) (count (.path p))])
+                                              #(compare %2 %1)
                                               (conj prev %))))
                      :default #(.add q %))
               poll #?(:bb #(-> (swap-vals! q next) first first)


перейменовано сталу на постійну

перейменовано сталу на постійну

--- src/uawa/core.clj
+++ src/uawa/core.clj
@@ -1,43 +1,65 @@
 (ns uawa.core)
 ;; (use 'uawa.core)
-(defmacro стала "defonce" [назва значення] `(let [v# (def ~назва)](when-not (.hasRoot v#) (def ~назва ~значення))))

-(defmacro вираз "same as defn" [назви & описи] (list* `defn (with-meta назви (assoc (meta назви) :private false)) описи))
+;; макроси
+(defmacro постійна "див. defonce" [назва значення] `(let [v# (def ~назва)](when-not (.hasRoot v#) (def ~назва ~значення))))

-(defmacro якщо ([умова то] `(if ~умова ~то nil)) ([умова то інакше] `(if ~умова ~то ~інакше)))
+(defmacro функція "див. defn" [назви & описи] (list* `defn (with-meta назви (assoc (meta назви) :private false)) описи))

-(стала істина true)
+(defmacro якщо "див. if"([умова то] `(if ~умова ~то nil)) ([умова то інакше] `(if ~умова ~то ~інакше)))

-(стала фальш false)
+(defmacro для "див. for" [set-expr body-expr] `(for ~set-expr body-expr))

-(вираз ні? "not" [x] (not x))
-
-(вираз кожен? "and" ([x y] (and x y)) ([x y & more] (reduce кожен? (кожен? x y) more)))
-
-(вираз якийсь? "or" ([x y] (or x y)) ([x y & more] (reduce якийсь? (якийсь? x y) more)))
-
-(вираз дай-випадкове "rand-int" [максимальне] (rand-int максимальне))
-
-(вираз друкуй "println" [& більше]  (binding [*print-readably* nil] (apply prn більше)))
-
-(вираз менше?  ([x] true) ([x y] (. clojure.lang.Numbers (lt x y))) ([x y & more]   (if (< x y)     (if (next more)       (recur y (first more) (next more))       (< y (first more))) false)))
-
-;; (якщо (менше? (дай-випадкове 3) 4) (друкуй "українська") (друкуй "ураиский русский))
+(defmacro коли  "див. when" [test & body] (when ~test ~body))

-(вираз вихід ([] (вихід 0)) ([статус] (System/exit статус)))
+;; умови

-(defmacro для "у циклі for" [set-expr body-expr] `(for ~set-expr body-expr))
+(постійна істина true)

+(постійна фальш false)
+
+(функція ні? "not" [x] (not x))
+
+(функція та? "and" ([x y] (and x y)) ([x y & більше] (reduce та? (та? x y) більше)))
+
+(функція кожен? "див. every?" ([умова колекція] (every? умова колекція)))
+
+(функція або? "or" ([x y] (or x y)) ([x y & більше] (reduce або? (або? x y) більше)))
+
+;; системні
+
+(функція вихід ([] (вихід 0)) ([статус] (System/exit статус)))

 (defn використай [& args] (use args))

-(defmacro коли
-  "When, Evaluates test. If logical true, evaluates body in an implicit do."
-  [test & body] (when ~test ~body))

-(defn відобрази "map" [функція] (map функція))
-(defn відобрази "map" [функція список] (map функція список))
-(defn відобрази "map" [функція с1 с2] (map функція с1 с2))
-(defn відобрази "map" [функція с1 с2 с3] (map функція с1 с2 с3))
-(defn відобрази "map" [функція с1 с2 с3 &список] (map функція с1 с2 с3 &список))
+;; колекції
+
+(функція пуста? "див. empty" [колекція] (empty колекція))
+
+(функція відфільтруй-різні "див. distinct" [колекція] (distinct колекція))
+
+(функція розмір "див count" [колекція] (count колекція))
+
+(функція фільтруй [pred] (filter pred))
+(функція фільтруй [pred coll] (filter pred coll))
+
+(функція перетвори "див. map" [функція] (map функція))
+(функція перетвори "див. map" [функція список] (map функція список))
+(функція перетвори "див. map" [функція с1 с2] (map функція с1 с2))
+(функція перетвори "див. map" [функція с1 с2 с3] (map функція с1 с2 с3))
+(функція перетвори "див. map" [функція с1 с2 с3 &список] (map функція с1 с2 с3 &список))
+
+(функція зменш "див. reduce" [функція колекція] (reduce функція колекція))
+(функція зменш "див. reduce" [функція значення колекція] (reduce функція значення колекція))
+
+;; різні
+
+(функція дай-випадкове "див. rand-int" [максимальне] (rand-int максимальне))
+
+(функція друкуй "див. println" [& більше]  (binding [*print-readably* nil] (apply prn більше)))
+
+(функція менше?  ([x] true) ([x y] (. clojure.lang.Numbers (lt x y))) ([x y & more]   (if (< x y)     (if (next more)       (recur y (first more) (next more))       (< y (first more))) false)))
+
+;; (якщо (менше? (дай-випадкове 3) 4) (друкуй "українська") (друкуй "ураиский русский"))


Make social-light more functional

Make social-light more functional

--- spectacles/src/spectacles/social_light.clj
+++ spectacles/src/spectacles/social_light.clj
@@ -3,12 +3,8 @@
             [quil.middleware :as m])
   (:import [wordcram WordCram]))

-(defn setup []
-  (q/color-mode :hsb)
-  (q/background 0)
-  (q/frame-rate 2)
-
-  (let [wc (WordCram. (quil.applet/current-applet))]
+(defn initialize-wordcram [applet]
+  (let [wc (WordCram. applet)]
     (-> wc
         ;;(.fromWebPage "https://twitter.com/WinCityMain")
         ;;(.fromTextString (into-array String ["Life In Lights Winchester"]))
@@ -16,11 +12,24 @@
         (.withColors (int-array [(q/color 220) (q/color 140) (q/color (q/random 255) 240 200)]))
         (.sizedByWeight 5 80)
         (.withFont"Copse")
-        (.angledBetween (float -1.6) (float 1.6)))
-    {:wordcram wc})
+        (.angledBetween (float -1.6) (float 1.6))))
   )

-(defn update-state [state] state)
+(defn setup []
+  (q/color-mode :hsb)
+  (q/background 0)
+  (q/frame-rate 4)
+
+  {:wordcram (initialize-wordcram (quil.applet/current-applet))}
+)
+
+(defn update-state [state]
+  (if (= 0 (mod (q/frame-count) 120))
+    (do
+      (q/background 0)
+      {:wordcram (initialize-wordcram (quil.applet/current-applet))})
+    state)
+  )

 (defn draw-state [state]
   (if (.hasMore (:wordcram state))
@@ -39,5 +48,3 @@
   :middleware [m/fun-mode]
   :features [:keep-on-top :present :no-start]
   :bgcolor 0)
-
-


Fix p5js links test as it was returning 403 with slurp.

--- test/clj/fn_metas.clj
+++ test/clj/fn_metas.clj
@@ -46,7 +46,8 @@
        (contains? #{"method" "property"})))

 (defn p5js-method-names []
-  (let [items (-> (slurp "https://p5js.org/reference/data.min.json")
+  (let [items (-> (http/get "https://p5js.org/reference/data.min.json")
+                  :body
                   (json/parse-string)
                   (get "classitems"))
         method-names (->> items


Refine to check type

Refine to check type


turn on mouse sharing by default

turn on mouse sharing by default

--- src-cljs/frontend/sente.cljs
+++ src-cljs/frontend/sente.cljs
@@ -21,6 +21,10 @@
   (send-msg sente-state [:frontend/subscribe {:document-id document-id}] 2000
             (fn [{:keys [document layers client-uuid]}]
               (swap! app-state assoc :client-uuid client-uuid)
+              ;; TODO: if this is a good idea, then make it the default
+              (put! (get-in @app-state [:comms :controls])
+                    [:show-mouse-toggled {:client-uuid client-uuid
+                                          :show-mouse? true}])
               (d/transact (:db @app-state)
                           ;; hack to prevent loops
                           (conj layers {:db/id -1 :server/update true})))))


Factor-out mini-text mixin

Factor-out mini-text mixin

--- src/braid/client/ui/styles/mixins.cljs
+++ src/braid/client/ui/styles/mixins.cljs
@@ -6,14 +6,16 @@
 (def flex
   {:display #{:flex :-webkit-flex}})

+(defn mini-text []
+  {:font-size (em 0.75)
+   :text-transform "uppercase"
+    :letter-spacing (em 0.1)})
+
 (def pill-box
   [:&
-   {:font-size (em 0.75)
-    :display "inline-block"
+   {:display "inline-block"
     :padding [[0 (em 0.5)]]
     :border-radius (em 0.5)
-    :text-transform "uppercase"
-    :letter-spacing (em 0.1)
     :background-color "#222"
     :border [[(px 1) "solid" "#222"]]
     :height (em 1.75)
@@ -26,6 +28,7 @@
     :cursor "pointer"
     :text-decoration "none"
     :text-align "center"}
+   (mini-text)
   [:&.on
    {:color [["white" "!important"]]}]
   [:&.off


Include a channel for closing for fb->chan

--- src/cljs/hacker_agent/hacker-base.cljs
+++ src/cljs/hacker_agent/hacker-base.cljs
@@ -50,19 +50,22 @@
    (let [events [:child_added :child_changed :child_removed]
          chans (map (fn [event]
                       (fb->chan fbref event))
-                    events)]
-     (merge chans)))
+                    events)
+         event-chans (map first chans)
+         close-chans (map second chans)]
+     [(merge event-chans) (merge close-chans)]))
   ([fbref event]
-   (let [c (chan)]
+   (let [event-chan (chan)
+         close-chan (chan)]
      (.on fbref (clojure.core/name event)
           (fn [snapshot]
-            (put! c [event
-                     (keyword (.key snapshot))
-                     (js->clj (.val snapshot))])))
-     c)))
+            (put! event-chan [event
+                              (keyword (.key snapshot))
+                              (js->clj (.val snapshot))])))
+     [event-chan close-chan])))

 (defn- id->fb-chan [id]
-  (fb->chan (id->fbref id)))
+  (first (fb->chan (id->fbref id))))

 (defn id->atom
   ([id] (id->atom (atom {}) id))


Cleanup

Cleanup

--- src/cljs/hacker_agent/hacker-base.cljs
+++ src/cljs/hacker_agent/hacker-base.cljs
@@ -6,6 +6,12 @@
 (defonce url "https://hacker-news.firebaseio.com/v0")

 (defonce root (js/Firebase. url))
+
+(defn- walk-root [r keys]
+  (let [[k & ks] keys]
+    (if ks
+      (recur (.child r (clojure.core/name k)) ks)
+      (.child r (clojure.core/name k)))))

 (defonce channel-closers (atom {}))

@@ -20,12 +26,6 @@
     (when-let [close-chan (get-in @channel-closers identifier)]
       (put! close-chan :close)
       (swap! channel-closers dissoc-in identifier))))
-
-(defn- walk-root [r keys]
-  (let [[k & ks] keys]
-    (if ks
-      (recur (.child r (clojure.core/name k)) ks)
-      (.child r (clojure.core/name k)))))

 (defn- id->fbref [id]
   (walk-root root [:item (str id)]))
@@ -56,23 +56,6 @@
   ([id] (id->fb-chan id (chan)))
   ([id close-chan]
    (fb->chan (id->fbref id) close-chan)))
-
-(defn id->atom
-  ([id] (id->atom (atom {}) id))
-  ([data id] (id->atom data id []))
-  ([data id path]
-   (let [fbc (id->fb-chan id)]
-     (go-loop []
-       (when-let [msg (<! fbc)]
-         (let [[event key val] msg
-               child-path (conj path key)]
-           (case event
-             :child_added (swap! data assoc-in child-path val)
-             :child_changed (swap! data assoc-in child-path val)
-             :child_removed (swap! data update-in path dissoc key)
-             (.log js/console (clj->js [event key val]))))
-         (recur)))
-     data)))

 (defn unbind-item-sync!
   [data path]


Flow all docs

Flow all docs

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -456,6 +456,12 @@
                         (filter matches? (public-syms ns)))))
             (all-ns)))))

+(defn- print-doc
+  [m]
+  (repl/print-doc (update m :doc (if (user-interface-idiom-ipad?)
+                                   identity
+                                   reflow))))
+
 (defn- doc*
   [sym]
   (if-let [special-sym ('{&       fn
@@ -465,22 +471,18 @@
     (cond

       (special-doc-map sym)
-      (repl/print-doc (special-doc sym))
+      (print-doc (special-doc sym))

       (repl-special-doc-map sym)
-      (repl/print-doc (repl-special-doc sym))
+      (print-doc (repl-special-doc sym))

       (get-namespace sym)
-      (cljs.repl/print-doc
+      (print-doc
         (select-keys (get-namespace sym) [:name :doc]))

       (get-var (get-aenv) sym)
-      (repl/print-doc
+      (print-doc
         (let [var (get-var (get-aenv) sym)
-              var (update var
-                    :doc (if (user-interface-idiom-ipad?)
-                           identity
-                           reflow))
               var (assoc var :forms (-> var :meta :forms second)
                              :arglists (-> var :meta :arglists second))
               m   (select-keys var


Added get-latest-concepts to in-memory db

--- src/cmr/metadata_db/data/memory_db.clj
+++ src/cmr/metadata_db/data/memory_db.clj
@@ -99,6 +99,26 @@
                    (concepts/get-concept this concept-type provider-id concept-id revision-id))
                  concept-id-revision-id-tuples)))

+  (get-latest-concepts
+    [db concept-type provider-id concept-ids]
+    (let [concept-id-set (set concept-ids)
+          concept-map (reduce (fn [concept-map {:keys [concept-id revision-id] :as concept}]
+                                (if (contains? concept-id-set concept-id)
+                                  (cond
+
+                                    (nil? (get concept-map concept-id))
+                                    (assoc concept-map concept-id concept)
+
+                                    (> revision-id (:revision-id (get concept-map concept-id)))
+                                    (assoc concept-map concept-id concept)
+
+                                    :else
+                                    concept-map)
+                                  concept-map))
+                              {}
+                              @concepts-atom)]
+      (keep (partial get concept-map) concept-ids)))
+
   (find-concepts
     [db params]
     (let [{:keys [concept-type provider-id]} params


CMR-191: Adding support for entry-id search param.

--- src/cmr/search/services/parameters.clj
+++ src/cmr/search/services/parameters.clj
@@ -20,6 +20,7 @@
 (def concept-param->type
   "A mapping of param names to query condition types based on concept-type"
   {:collection {:entry-title :string
+                :entry-id :string
                 :provider :string
                 :short-name :string
                 :version :string


relax update-layout-node-in-focused-form for nodes without layout

--- cljs/src/main/plastic/cogs/editor/model.cljs
+++ cljs/src/main/plastic/cogs/editor/model.cljs
@@ -341,12 +341,11 @@

 (defn update-layout-node-in-focused-form [editor node-id value-node]
   (let [form-id (get-focused-form-id editor)
-        layout (get-layout-for-form editor form-id)
-        _ (assert layout)
-        node (get layout node-id)
-        _ (assert node)
-        updated-layout (assoc layout node-id (assoc node :text (layout/prepare-node-text value-node)))]
-    (set-layout-for-form editor form-id updated-layout)))
+        layout (get-layout-for-form editor form-id)]
+    (if-let [node (get layout node-id)]
+      (let [updated-layout (assoc layout node-id (assoc node :text (layout/prepare-node-text value-node)))]
+        (set-layout-for-form editor form-id updated-layout))
+      editor)))

 (defn get-first-form-id [editor]
   (first (get-render-order editor)))


Check for proper words for the whitelist mode

--- src/zg/server.clj
+++ src/zg/server.clj
@@ -110,7 +110,7 @@

 (defn proper-word?
     [word]
-    (re-matches #"[A-Za-z0-9'\-\s_]+" word))
+    (re-matches #"[A-Za-z0-9.'\-\s_]+" word))

 (defn process-add-word
     [request]
@@ -125,12 +125,13 @@

 (defn process-add-words
     [request]
-    (let [input     (-> (:params request) (get "new-words"))
-          words     (split-words input)
-          user-name (get-user-name request)
-          message   (add-words-message words)]
-          (if (seq words)
-              (store-words words user-name))
+    (let [input        (-> (:params request) (get "new-words"))
+          words        (split-words input)
+          proper-words (filter proper-word? words)
+          user-name    (get-user-name request)
+          message      (add-words-message proper-words)]
+          (if (seq proper-words)
+              (store-words proper-words user-name))
         (finish-processing request nil message nil)))

 (defn perform-operation


updating gui examples

updating gui examples

--- examples/gui.clj
+++ examples/gui.clj
@@ -1,10 +1,10 @@
 (ns examples.gui
   (:use overtone.core
-        [overtone.gui info control wavetable sequencer]
+        [overtone.gui info control wavetable sequencer mixer]
         [overtone.inst synth drum]))

 ; Show the server info window
-(server-window)
+(server-info-window)

 ; Create a synth with metadata that can be used to generate a GUI controller
 (defsynth foo [note {:default 60 :min 0 :max 120 :step 1}
@@ -24,6 +24,7 @@

 ; Start the synth looping, and play with the GUI to hear it change live
 (foo-player (m))
+(stop)

 ; Works with instruments too, as long as they have all the necessary metadata.
 (definst bar [note {:default 60 :min 0 :max 120 :step 1}
@@ -48,7 +49,7 @@

 ; Create a buffer to use for our wavetable
 (def b (buffer 1024))
-(waveform-editor b)
+(waveform-editor b true)

 (defsynth table-player
   [buf 0 freq 440]
@@ -56,11 +57,13 @@

 (table-player b 660)

-(def table (wave-table 12 1024))
-(wave-table-editor table)
+;(def waves (load-samples "waveforms/AKWF_cello/*.wav"))
+(def table (wavetable 12 1024))
+(wavetable-editor table)

 ; Up the tempo, and try the step sequencer out on a couple of drums
 (m :bpm 128)
 (step-sequencer m 8 ks1 ping)

-)
+(use 'overtone.gui.mixer)
+(mixing-console)


hash-map generator makes maps with values that match the generators supplied

--- src/simple_check/generators.clj
+++ src/simple_check/generators.clj
@@ -443,7 +443,16 @@
   (let [input (vector (tuple key-gen val-gen))]
     (fmap (partial into {}) input)))

-(def hash-map map)
+(defn hash-map
+  "Like clojure.core/hash-map, except the values are generators.
+   Returns a generator that makes maps with the supplied keys and
+   values generated using the supplied generators."
+  [& kvs]
+  (assert (even? (count kvs)))
+  (let [ks (take-nth 2 kvs)
+        vs (take-nth 2 (rest kvs))]
+    (fmap (partial zipmap ks)
+          (apply tuple vs))))

 (def char
   "Generates character from 0-255."


Fix about component grid

Fix about component grid

--- app/src/cljs/app/components.cljs
+++ app/src/cljs/app/components.cljs
@@ -1,14 +1,10 @@
 (ns app.components)

 (defn section-component
-  [content header]
+  [content]
   [:div.singlecard
    [:div.mdl-card.mdl-shadow--2dp.ressection
-    [:div.mdl-grid
-     [:div.sectionheader.mdl-cell--1-offset-desktop.mdl-cell--3-col-desktop.mdl-cell--12-col-phone
-      [:h3 header]]
-     [:div.sectioncontent.mdl-cell--9-col.mdl-cell--middle
-      content]]]])
+    content]])

@@ -16,10 +12,12 @@
   [description]
   [:div#about
    [section-component
-    [:div.about
-     [:div.aboutdescription
-      description]]
-    "About"]])
+    [:div.mdl-grid
+     [:div.mdl-cell.mdl-cell--3-col-desktop.mdl-cell--12-col-phone.mdl-card__title
+      [:h3 "About"]]
+     [:div.mdl-cell.mdl-cell--8-col.mdl-cell--12-col-phone
+      description]]]])
+

 (defn navlink-component
   "navigation link component.
@@ -56,7 +54,7 @@
        [:p phone]]
       [:div.mdl-cell.mdl-cell--4-col
        [:p email]]]]
-    "Contact"]])
+    ]])

 (defn single-project-component
   [project]


smaller named functions.

smaller named functions.

--- clojure/word-count/word-count.clj
+++ clojure/word-count/word-count.clj
@@ -10,10 +10,13 @@
 (defn- filter-words [str]
   (filter non-blank? (tokenize str)))

+(defn- add-count-for [word counts]
+  (assoc counts word (inc (get counts word 0))))
+
 (defn- count [words counts]
   (if (empty? words)
     counts
-    (count (rest words) (assoc counts (first words) (inc (get counts (first words) 0))))))
+    (count (rest words) (add-count-for (first words) counts))))

 (defn word-count [str]
   (count (filter-words str) {}))


(PE-4198) Proper string->int serial conversion

--- src/clj/puppetlabs/master/certificate_authority.clj
+++ src/clj/puppetlabs/master/certificate_authority.clj
@@ -119,7 +119,7 @@
   for the awful, gory details."
   [serial-number]
   {:post [(integer? %)]}
-  (read-string (str "0x" serial-number)))
+  (Integer/parseInt serial-number 16))

 (defn get-serial-number!
   "Reads the serial number file from disk and returns the serial number."


Get rid of dependency warnings

Get rid of dependency warnings

--- resources/leiningen/new/lambone/common/build.boot
+++ resources/leiningen/new/lambone/common/build.boot
@@ -6,7 +6,8 @@
                      [adzerk/env "0.3.0" :scope "test"]
                      [pandeiro/boot-http "0.7.3" :scope "test"]])
 <% if all backend frontend %>
-(def common-deps '[[org.clojure/clojure "1.8.0" :scope "provided"]])
+(def common-deps '[[org.clojure/clojure "1.8.0" :scope "provided"]
+                   [adzerk/env "0.3.0" :scope "test"]])

 (def backend-deps (into common-deps
                         '[[org.clojure/tools.namespace "0.2.10"]
@@ -23,8 +24,7 @@
                           [robert/hooke "1.3.0"]
                           [cprop "0.1.7"]
                           ;; dev only
-                          [adzerk/boot-test "1.1.1" :scope "test"]
-                          [adzerk/env "0.3.0" :scope "test"]]))
+                          [adzerk/boot-test "1.1.1" :scope "test"]]))
 <% endif %><% if not all backend frontend %>
 (def backend-deps '[[org.clojure/clojure "1.8.0" :scope "provided"]
                     [org.clojure/tools.namespace "0.2.10"]
@@ -41,14 +41,13 @@
                     [robert/hooke "1.3.0"]
                     [cprop "0.1.7"]
                     ;; dev only
-                    [adzerk/boot-test "1.1.1" :scope "test"]
-                    [adzerk/env "0.3.0" :scope "test"]])
+                    [adzerk/boot-test "1.1.1" :scope "test"]])
 <% endif %><% if any frontend %>
 ;; All the deps are "test" because they are only need for compiling to
 ;; JavaScript, not "real" project dependencies.
 (def frontend-deps (into common-deps
                          '[[org.clojure/clojurescript "1.8.51" :scope "test"]
-                           [adzerk/cljs-console "0.1.1" :scope "test"]
+                           [adzerk/cljs-console "0.1.1" :exclusions [adzerk/env] :scope "test"]
                            ;; dev only
                            [adzerk/boot-cljs "1.7.228-1" :scope "test"]
                            [adzerk/boot-cljs-repl "0.3.0" :scope "test"]
@@ -64,7 +63,7 @@
 <% endif %>
 (set-env! :source-paths #{"dev"}
           :dependencies cmd-line-deps
-          :exclusions '#{org.clojure/clojure})
+          :exclusions '#{org.clojure/clojure com.google.guava/guava})

 (require 'boot
          '[clojure.pprint :refer [pprint]]


Added first implementation of stem base

Added first implementation of stem base

seems attribute exploration is not far away from now...

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

--- conexp/fca/implications.clj
+++ conexp/fca/implications.clj
@@ -5,7 +5,8 @@
    :init init
    :constructors { [ clojure.lang.PersistentHashSet clojure.lang.PersistentHashSet ] [] }
    :state state)
-  (:use conexp.util
+  (:use clojure.set
+	conexp.util
 	conexp.base
 	conexp.fca.contexts))

@@ -34,4 +35,67 @@

 (defn holds? [impl ctx]
   (forall [intent (context-intents ctx)]
-	  (respects? intent impl)))+	  (respects? intent impl)))
+
+(defn add-immediate-elements
+  ([implications set]
+     (add-immediate-elements implications set #{}))
+
+  ([implications new-set old-set]
+     (if (= new-set old-set)
+       new-set
+       (let [conclusions-to-add (for [impl implications
+				      :when (and (subset? (premise impl) new-set)
+						 (exists [x (premise impl)] (not (old-set x))))]
+				  (conclusion impl))]
+	 (apply union new-set conclusions-to-add)))))
+
+(defn close-under-implications [implications set]
+  (first (first (drop-while (fn [[old new]] (not= old new))
+			    (iterate (fn [[old new]]
+				       [new (add-immediate-elements implications new old)])
+				     [#{} set])))))
+
+(defn clop-by-implications [implications]
+  (partial close-under-implications implications))
+
+(defn follows-semantically? [implication implications]
+  (subset? (conclusion implication) (close-under-implications implications (premise implication))))
+
+;;; copied, thus needs a good idea for refactoring
+(defn add-immediate-elements*
+  ([implications set]
+     (add-immediate-elements* implications set #{}))
+
+  ([implications new-set old-set]
+     (if (= new-set old-set)
+       new-set
+       (let [conclusions-to-add (for [impl implications
+				      :when (and (proper-subset? (premise impl) new-set)
+						 (exists [x (premise impl)] (not (old-set x))))]
+				  (conclusion impl))]
+	 (apply union new-set conclusions-to-add)))))
+
+(defn close-under-implications* [implications set]
+  (first (first (drop-while (fn [[old new]] (not= old new))
+			    (iterate (fn [[old new]]
+				       [new (add-immediate-elements* implications new old)])
+				     [#{} set])))))
+
+(defn clop-by-implications* [implications]
+  (partial close-under-implications* implications))
+
+(defn stem-base [ctx]
+  (let [double-prime (partial context-attribute-closure ctx)
+	attributes   (attributes ctx)]
+    (loop [implications #{}
+	   last         #{}]
+      (let [conclusion-from-last (double-prime last)
+	    implications (if (not= last conclusion-from-last)
+			   (conj implications (make-implication last conclusion-from-last))
+			   implications)
+	    clop (clop-by-implications* implications)
+	    next (next-closed-set attributes clop last)]
+	(if next
+	  (recur implications next)
+	  implications)))))


changed dir

changed dir

--- src/leiningen/new/figwheel/project.clj
+++ src/leiningen/new/figwheel/project.clj
@@ -28,7 +28,7 @@
                          :cache-analysis true }}
              {:id "min"
               :source-paths ["src"]
-              :compiler {:output-to "www/{{sanitized}}.min.js"
+              :compiler {:output-to "resources/public/{{sanitized}}.min.js"
                          :optimizations :advanced
                          :pretty-print false}}]}


fixed validation for security definition

--- src/io/sarnowski/swagger1st/schemas/swagger_2_0.clj
+++ src/io/sarnowski/swagger1st/schemas/swagger_2_0.clj
@@ -155,7 +155,7 @@
    (s/optional-key "parameters")        [(s/either parameter-object reference-object)]
    (s/optional-key "schemes")           [s-string]
    (s/optional-key "deprecated")        s-boolean
-   (s/optional-key "security")          security-requirement-object
+   (s/optional-key "security")          [security-requirement-object]
    (s/optional-key (s/pred extension?)) s/Any})

 (def path-object


Destroyer implementation

Destroyer implementation

--- src/node/game/cards.cljs
+++ src/node/game/cards.cljs
@@ -976,11 +976,23 @@
                 {:cost [:credit 1] :msg "add 1 strength" :effect (effect (pump card 1))}]}

    ;; ICE
+   "Archer"
+   {:abilities [{:msg "gain 2 [Credits]" :effect (effect (gain :credit 2))}
+                {:prompt "Choose a program to trash" :label "Trash a program"
+                 :msg (msg "trash " (:title target))
+                 :choices (req (get-in runner [:rig :program])) :effect (effect (trash target))}
+                {:msg "end the run" :effect (effect (end-run))}]}
+
    "Ashigaru"
    {:abilities [{:msg "end the run" :effect (effect (end-run))}]}

    "Bastion"
    {:abilities [{:msg "end the run" :effect (effect (end-run))}]}
+
+   "Burke Bugs"
+   {:abilities [{:prompt "Choose a program to trash" :label "Trash a program"
+                 :msg (msg "trash " (:title target))
+                 :choices (req (get-in runner [:rig :program])) :effect (effect (trash target))}]}

    "Caduceus"
    {:abilities [{:msg "gain 3 [Credits]" :effect (effect (gain :credit 3))}
@@ -1026,7 +1038,10 @@
    {:abilities [{:msg "end the run" :effect (effect (end-run))}]}

    "Grim"
-   {:effect (effect (gain :bad-publicity 1) (system-msg "takes 1 bad publicity"))}
+   {:effect (effect (gain :bad-publicity 1) (system-msg "takes 1 bad publicity"))
+    :abilities [{:prompt "Choose a program to trash" :msg (msg "trash " (:title target))
+                 :label "Trash a program" :choices (req (get-in runner [:rig :program]))
+                 :effect (effect (trash target))}]}

    "Guard"
    {:abilities [{:msg "end the run" :effect (effect (end-run))}]}
@@ -1061,6 +1076,20 @@
    "Ice Wall"
    {:advanceable :always :abilities [{:msg "end the run" :effect (effect (end-run))}]}

+   "Ichi 1.0"
+   {:abilities [{:prompt "Choose a program to trash" :msg (msg "trash " (:title target))
+                 :label "Trash a program" :choices (req (get-in runner [:rig :program]))
+                 :effect (effect (trash target))}
+                {:msg "give the runner 1 tag and do 1 brain"
+                 :effect (effect (damage :brain 1) (gain :runner :tag 1))}]}
+
+   "Ichi 2.0"
+   {:abilities [{:prompt "Choose a program to trash" :msg (msg "trash " (:title target))
+                 :label "Trash a program" :choices (req (get-in runner [:rig :program]))
+                 :effect (effect (trash target))}
+                {:msg "give the runner 1 tag and do 1 brain"
+                 :effect (effect (damage :brain 1) (gain :runner :tag 1))}]}
+
    "IQ"
    {:abilities [{:msg "end the run" :effect (effect (end-run))}]}

@@ -1070,8 +1099,19 @@
    "Komainu"
    {:abilities [{:msg "do 1 net damage" :effect (effect (damage :net 1))}]}

+   "Lancelot"
+   {:abilities [{:prompt "Choose a program to trash" :msg (msg "trash " (:title target))
+                 :label "Trash a program" :choices (req (get-in runner [:rig :program]))
+                 :effect (effect (trash target))}]}
+
    "Lotus Field"
    {:abilities [{:msg "end the run" :effect (effect (end-run))}]}
+
+   "Lycan"
+   {:advanceable :always
+    :abilities [{:prompt "Choose a program to trash" :msg (msg "trash " (:title target))
+                 :label "Trash a program" :choices (req (get-in runner [:rig :program]))
+                 :effect (effect (trash target))}]}

    "Mamba"
    {:abilities [{:msg "do 1 net damage" :effect (effect (damage :net 1))}
@@ -1108,8 +1148,14 @@
    {:abilities [{:msg "end the run" :effect (effect (end-run))}]}

    "Rototurret"
-   {:abilities [{:msg "trash 1 program"}
+   {:abilities [{:prompt "Choose a program to trash" :msg "Trash a program" :label "Trash a program"
+                 :choices (req (get-in runner [:rig :program])) :effect (effect (trash target))}
                 {:msg "end the run" :effect (effect (end-run))}]}
+
+   "Sagittarius"
+   {:abilities [{:prompt "Choose a program to trash" :msg (msg "trash " (:title target))
+                 :label "Trash a program" :choices (req (get-in runner [:rig :program]))
+                 :effect (effect (trash target))}]}

    "Salvage"
    {:advanceable :while-rezzed
@@ -1125,20 +1171,30 @@

    "Swarm"
    {:advanceable :always
-    :abilities [{:msg "trash 1 program unless the Runner pays 3 [Credits]"}]}
+    :abilities [{:prompt "Choose a program to trash" :msg (msg "trashes " (:title target))
+                 :label "Trash a program" :choices (req (get-in runner [:rig :program]))
+                 :effect (effect (trash target))}]}

    "Swordsman"
-   {:abilities [{:msg "do 1 net damage" :effect (effect (damage :net 1))}]}
+   {:abilities [{:msg "do 1 net damage" :effect (effect (damage :net 1))}
+                {:prompt "Choose an AI program to trash" :msg (msg "trashes " (:title target))
+                 :label "Trash an AI program" :effect (effect (trash target))
+                 :choices (req (filter #(has? % :subtype "AI") (get-in runner [:rig :program])))}]}
+
+   "Taurus"
+   {:abilities [{:prompt "Choose a Hardware to trash" :msg (msg "trash " (:title target))
+                 :label "Trash a Hardware" :choices (req (get-in runner [:rig :hardware]))
+                 :effect (effect (trash target))}]}
+
+   "TMI"
+   {:abilities [{:msg "end the run" :effect (effect (end-run))}]}
+
+   "Tollbooth"
+   {:msg "force the runner to lose 3 [Credits]" :effect (effect (lose :runner :credit 3))
+    :abilities [{:msg "end the run" :effect (effect (end-run))}]}

    "Tyrant"
    {:advanceable :while-rezzed
-    :abilities [{:msg "end the run" :effect (effect (end-run))}]}
-
-   "TMI"
-   {:abilities [{:msg "end the run" :effect (effect (end-run))}]}
-
-   "Tollbooth"
-   {:msg "force the runner to lose 3 [Credits]" :effect (effect (lose :runner :credit 3))
     :abilities [{:msg "end the run" :effect (effect (end-run))}]}

    "Universal Connectivity Fee"


correct cursor position after typing (close #6)

--- src/parinfer/editor.cljs
+++ src/parinfer/editor.cljs
@@ -52,10 +52,18 @@
     (.scrollTo cm scroll-x scroll-y)))

 (defn update-cursor!
+  "Correctly position cursor after text that was just typed.
+  We need this since reformatting the text can shift things forward past our cursor."
   [cm change]
-  (let [text (join "\n" (.-text change))]
-    ;; TODO: correct cursor position here
-    ))
+  (when (= "+input" (.-origin change))
+    (let [text (join "\n" (.-text change))
+          from-x (.. change -from -ch)
+          line-no (.. change -from -line)
+          line (.getLine cm line-no)
+          insert-x (.indexOf line text from-x)]
+      (if (= -1 insert-x)
+        (.setCursor cm line-no from-x)
+        (.setCursor cm line-no (+ insert-x (count text)))))))

 ;;----------------------------------------------------------------------
 ;; Life Cycle events


fix: api.clj reflection warnings

fix: api.clj reflection warnings

--- src/main/clojure/pdok/featured/api.clj
+++ src/main/clojure/pdok/featured/api.clj
@@ -21,13 +21,13 @@
             [ring.middleware.json :refer :all]
             [ring.util.response :as r]
             [schema.core :as s])
-   )
+  (:import [com.fasterxml.jackson.core JsonGenerator]))

 (extend-protocol cheshire.generate/JSONable
   org.joda.time.DateTime
-  (to-json [t jg] (.writeString jg (str t)))
+  (to-json [t ^JsonGenerator jg] (.writeString jg (str t)))
   schema.utils.ValidationError
-  (to-json [t jg] (.writeString jg (pr-str t))))
+  (to-json [t ^JsonGenerator jg] (.writeString jg (pr-str t))))

 (defn uri [str]
   (try


Cleanup

Cleanup

--- src/re_demo/welcome.cljs
+++ src/re_demo/welcome.cljs
@@ -1,6 +1,6 @@
 (ns re-demo.welcome
   (:require [re-com.core   :refer [h-box v-box box gap line title label hyperlink-href input-text]]
-            [re-demo.utils :refer [panel-title component-title paragraphs]]))
+            [re-demo.utils :refer [panel-title title2 paragraphs]]))

 (defn named-params
   []
@@ -55,9 +55,7 @@
                  :target "_blank"]
                 "."]
                [:p "It contains the sort of layout and controls you'd need to build a desktop-class app."]]
-               ;[gap :size "10px"]
                [this-app]
-               ;[gap :size "10px"]
                [line]
                [named-params]
                ]])


[#83] Add sys-val control

[#83] Add sys-val control

--- src/taoensso/carmine.clj
+++ src/taoensso/carmine.clj
@@ -12,8 +12,8 @@
              (commands    :as commands)]))

 (if (vector? taoensso.encore/encore-version)
-  (enc/assert-min-encore-version [2 111 0])
-  (enc/assert-min-encore-version  2.111))
+  (enc/assert-min-encore-version [2 127 0])
+  (enc/assert-min-encore-version  2.127))

 ;;;; Connections

@@ -164,12 +164,32 @@

   However folks starting with Carmine after v2.6.1 and who have
   never pre-serialized Nippy data written with Carmine may prefer
-  to disable the workaround (use `alter-var-root`).
+  to disable the workaround.

   If you're not sure what this is or if it's safe to change, you
-  should probably leave it at the default setting. Or Ref.
-  https://github.com/ptaoussanis/carmine/issues/83 for more details."
-  true)
+  should probably leave it at the default (true) value.
+
+  To change the default (true) value:
+
+    - Call `(alter-var-root #'taoensso.carmine/issue-83-workaround? (fn [_] false))`,
+    - or set one of the following to \"false\" or \"FALSE\":
+      - `taoensso.carmine.issue-83-workaround` JVM property
+      - `TAOENSSO_CARMINE_ISSUE-83-WORKAROUND` env var
+
+  Ref. https://github.com/ptaoussanis/carmine/issues/83 for more info."
+
+  (if-let [sv (enc/get-sys-val
+                "taoensso.carmine.issue-83-workaround"
+                "TAOENSSO_CARMINE_ISSUE-83-WORKAROUND")]
+
+    (case sv
+      ("true"  "TRUE")  true
+      ("false" "FALSE") false
+      (throw
+        (ex-info "Unexpected `issue-83-workaround?` value"
+          {:value sv})))
+
+    true))

 (defn thaw-if-possible-nippy-bytes
   "If given agrgument is a byte-array starting with apparent NPY header,


Fix initialization tests.

Fix initialization tests.

--- test/blocks/store/init_test.clj
+++ test/blocks/store/init_test.clj
@@ -3,6 +3,7 @@
     [blocks.store :as store]
     [blocks.store.file]
     [blocks.store.memory]
+    [clojure.string :as str]
     [clojure.test :refer :all])
   (:import
     blocks.store.file.FileBlockStore
@@ -26,13 +27,13 @@
                  (store/initialize "foo://something"))))
   (testing "memory init"
     (let [store (store/initialize "mem:-")]
-      (is (instance? (Class/forName "blocks.store.memory.MemoryBlockStore") store))))
+      (is (instance? MemoryBlockStore store))))
   (testing "file init"
     (testing "absolute path"
       (let [store (store/initialize "file:///foo/bar/baz")]
-        (is (instance? (Class/forName "blocks.store.file.FileBlockStore") store))
+        (is (instance? FileBlockStore store))
         (is (= (absolute-path "foo" "bar" "baz") (str (:root store))))))
     (testing "relative path"
       (let [store (store/initialize "file://foo/bar/baz")]
-        (is (instance? (Class/forName "blocks.store.file.FileBlockStore") store))
+        (is (instance? FileBlockStore store))
         (is (= (relative-path "foo" "bar" "baz") (str (:root store))))))))


Handle dev msg in test

Handle dev msg in test


Track when show is started on another interface.

We were not clearing the stop-mode flag when removing the overlay when
the show was restarted elsewhere, which meant we would not notice when
the show was stopped again.

--- src/afterglow/controllers/ableton_push.clj
+++ src/afterglow/controllers/ableton_push.clj
@@ -1171,7 +1171,9 @@
                           assoc (:stop control-buttons)
                           (button-state (:stop control-buttons) :bright))
                    (with-show (:show controller)
-                     (not (show/running?))))
+                     (when (show/running?)
+                       (reset! (:stop-mode controller) false))
+                     @(:stop-mode controller)))
                  (handle-control-change [this controller message]
                    (when (pos? (:velocity message))
                      ;; End stop mode


cosmetic cleanup

cosmetic cleanup

--- test/dalap/test/cljsrc_walk.clj
+++ test/dalap/test/cljsrc_walk.clj
@@ -111,15 +111,14 @@
       clj-path output-path "cljs" cljs-default-transform-rules
       (constantly true)))

-  ([clj-path output-path extension rules file-filter]
+  ([clj-path output-path extension rules file-predicate]
      (doseq [f (find-clj-sources-in-dir (File. clj-path))]
-       (if (file-filter f)
+       (when (file-predicate f)
          (let [generated-f (File. (-> (.getPath f)
                                       (string/replace clj-path output-path)
                                       (string/replace #"clj$" extension)))]
            (make-parents generated-f)
-           (spit generated-f
-                 (transform-file f rules)))))))
+           (spit generated-f (transform-file f rules)))))))

 (comment
   (transform-directory "src/dalap" ".generated")
@@ -130,33 +129,31 @@

 ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (deftest test-source-transformation
-  (let [visitor ((gen-decorator
-                  (concat
-                   ['something 'something-else
-                   'dalap.html.selector 'dalap.cljs.selector
-                   ] cljs-core-transform-rules))
-                 visit-form)
-        vis #(walk % visitor)
+  (let [rules (concat
+               ['something 'something-else
+                'dalap.html.selector 'dalap.cljs.selector
+                ] cljs-core-transform-rules)
+        transform #(cljs-transform % rules)
         ]
-    (is (= (vis '(something ^{:cljs something-else-cljs}
-                            foobar))
+    (is (= (transform '(something ^{:cljs something-else-cljs}
+                                  foobar))
            '(something-else something-else-cljs)))

-    (is (= (vis '(abcd ^:clj foobar))
+    (is (= (transform '(abcd ^:clj foobar))
            '(abcd)))

-    (is (= (vis '(ns dalap.test.html.selector
-                   (:use clojure.test)
-                   (:use [clojure.pprint :only (pprint)])
+    (is (= (transform '(ns dalap.test.html.selector
+                         (:use clojure.test)
+                         (:use [clojure.pprint :only (pprint)])

-                   (:require [dalap.html :as html])
+                         (:require [dalap.html :as html])

-                   ^{:cljs (:require [dalap.cljs.defaults :as defaults])}
-                   (:require [dalap.defaults :as defaults])
+                         ^{:cljs (:require [dalap.cljs.defaults :as defaults])}
+                         (:require [dalap.defaults :as defaults])

-                   (:use dalap.html.selector)
-                   (:use [dalap.walk :only [walk]])
-                   (:use [dalap.html :only [add-class]])))
+                         (:use dalap.html.selector)
+                         (:use [dalap.walk :only [walk]])
+                         (:use [dalap.html :only [add-class]])))
            '(ns dalap.test.html.selector
               (:use clojure.test)
               (:use [clojure.pprint :only (pprint)])


Name redux in progress.

Name redux in progress.

--- src/angelic/search/implicit/dash_astar.clj
+++ src/angelic/search/implicit/dash_astar.clj
@@ -52,6 +52,8 @@
 ;; TODO: wrapping names don't match pair-stub1.  Get rid of norm-name hack?
 ;; TODO: subsumptin should be sets, not lists?

+;; TODO TODO: fix names.
+;; TODO: turn kill back on

 (set! *warn-on-reflection* true)
@@ -442,15 +444,25 @@

 ;; Note: we must always wrap in S-A stub to get effects out of logger.
 (defmethod get-stub :Atomic [[_ fs :as n] inp-set]
-  (let [full-name [n (if *state-abstraction* (fs/extract-context fs inp-set) inp-set)]
+  (let [cache-key [n (if *state-abstraction* (fs/extract-context fs inp-set) inp-set)]
         make-stub #(let [r (make-atomic-stub n %)]
                      (if *collect-equal-outputs* (make-output-collecting-stub r) r))]
      (if-let [^HashMap dc *decompose-cache*]
        (if *state-abstraction*
-         (let [stub (util/cache-with dc full-name (make-stub (fs/get-logger fs inp-set)))]
+         (let [stub (util/cache-with dc cache-key (make-stub (fs/get-logger fs inp-set)))]
            (make-state-abstracted-stub stub inp-set))
-         (util/cache-with dc full-name (make-stub inp-set)))
+         (util/cache-with dc cache-key (make-stub inp-set)))
        (make-stub inp-set))))
+
+(comment
+ (defmethod get-stub :OC [[_ inner-n :as n] inp-set]
+            (make-output-collecting-stub (get-stub inner-n inp-set)))
+
+;; Gotta go all the way in.
+ (defmethod get-stub :SA [[_ inner-n :as n] inp-set]
+            (make-state-abstracted-stub (get-stub inner-n (fs/get-logger )))
+
+            (make-output-collecting-stub (get-stub inner-n inp-set))))


RR -> balanced.

RR -> balanced.

--- test/onyx/plugin/input_test.clj
+++ test/onyx/plugin/input_test.clj
@@ -118,7 +118,7 @@
 (onyx.api/submit-job
  peer-config
  {:catalog catalog :workflow workflow
-  :task-scheduler :onyx.task-scheduler/round-robin})
+  :task-scheduler :onyx.task-scheduler/balanced})

 (def results (take-segments! out-chan))


try new scale mode method

try new scale mode method

--- src/cljs/infinitelives/pixi/resources.cljs
+++ src/cljs/infinitelives/pixi/resources.cljs
@@ -92,11 +92,14 @@
         ;; linear version
         ;; SEE: https://github.com/GoodBoyDigital/pixi.js/issues/1724
         nearest (js/PIXI.Texture.fromImage
-                 (str url "#") true (aget js/PIXI.scaleModes "NEAREST"))
+                 url)
+                 ;(str url "#") true (aget js/PIXI.scaleModes "NEAREST")
+

         textures {:linear linear
                   :nearest nearest
                   :image img}]
+    (set! (.-scaleMode url) js/PIXI.SCALE_MODES.NEAREST)
     (swap! !texture-store assoc (string/url-keyword url) textures)
     textures))


node list spacing to 16 instead of 40

node list spacing to 16 instead of 40

--- src/cljs/swarmpit/component/node/list.cljs
+++ src/cljs/swarmpit/component/node/list.cljs
@@ -159,7 +159,7 @@
         filtered-items
         (comp/grid
           {:container true
-           :spacing   40}
+           :spacing   16}
           (map-indexed
             (fn [index item]
               (node-item item index)) (sort-by :nodeName filtered-items)))


CMR-202: used git/return for single value

--- src/cmr/umm/test/generators/collection.clj
+++ src/cmr/umm/test/generators/collection.clj
@@ -40,15 +40,11 @@
 (def org-names
   (ext-gen/string-ascii 1 80))

-(def archive-center-org-type (gen/elements ["archive-center"]))
-
-(def processing-center-org-type (gen/elements ["processing-center"]))
-
 (def archive-center-organizations
-  (ext-gen/model-gen c/->Organization archive-center-org-type org-names))
+  (ext-gen/model-gen c/->Organization (gen/return "archive-center") org-names))

 (def processing-center-organizations
-  (ext-gen/model-gen c/->Organization processing-center-org-type org-names))
+  (ext-gen/model-gen c/->Organization (gen/return "processing-center") org-names))

 (def collections
   (gen/fmap (fn [[entry-title product temporal psa campaigns two-ds proc-org archive-org]]


Got the shim mostly working

Got the shim mostly working

--- src/clojure/funcatron/tron/routers/shim_router.clj
+++ src/clojure/funcatron/tron/routers/shim_router.clj
@@ -5,9 +5,9 @@
             [io.sarnowski.swagger1st.core :as s1st]
             [io.sarnowski.swagger1st.util.security :as s1stsec]
             [io.sarnowski.swagger1st.context :as s1ctx])
-  (:import (java.net ServerSocket Socket)
+  (:import (java.net ServerSocket Socket SocketException)
            (java.util Base64 UUID)
-           (java.io BufferedWriter OutputStreamWriter BufferedReader InputStreamReader OutputStream InputStream ByteArrayInputStream)))
+           (java.io BufferedWriter OutputStreamWriter BufferedReader InputStreamReader OutputStream InputStream ByteArrayInputStream IOException)))

 (set! *warn-on-reflection* true)
@@ -17,16 +17,56 @@
 (defonce ^:private sync-obj (Object.))

+
+
+
+(defn- shutdown-socket
+  "Close the server-socket"
+  []
+  (locking sync-obj
+    (let [ss @shim-socket]
+      (swap! shim-socket #(-> %
+                              (dissoc ::swagger)
+                              (dissoc ::input)
+                              (dissoc ::output)
+                              (dissoc ::socket)))
+      (when-let [inputa (::input ss)]
+        (doseq
+          [input [inputa]]
+          (try
+            (.close ^InputStream input)
+            (catch Exception e nil)))
+        )
+      (when-let [outputs (::output ss)]
+        (doseq [output [outputs]]
+          (try
+            (.close ^OutputStream output)
+            (catch Exception e nil)))
+        )
+      (when-let [sockets (::socket ss)]
+        (doseq [socket [sockets]]
+          (try
+            (.close ^Socket socket)
+            (catch Exception e nil)))
+        )
+      )))

 (defn send-message
   [message]
   (let [b64 (fu/encode-body message)]
-    (doseq [out-x (::output @shim-socket)]
-      (let [out (BufferedWriter. (OutputStreamWriter. ^OutputStream out-x "UTF-8"))]
-        (locking sync-obj
-          (.write out b64)
-          (.write out "\n")
-          (.flush out))))))
+    (try
+      (doseq [out-x (filter identity [(::output @shim-socket)])]
+        (let [out (BufferedWriter. (OutputStreamWriter. ^OutputStream out-x "UTF-8"))]
+          (locking sync-obj
+            (.write out b64)
+            (.write out "\n")
+            (.flush out))))
+      (catch IOException io
+        (do
+          (clojure.tools.logging/log :error io "Failed to send message")
+          (shutdown-socket)
+          ))
+      )))

 (defn- shutdown
   "Close the server-socket"
@@ -36,19 +76,19 @@
       (reset! shim-socket nil)
       (when-let [inputa (::input ss)]
         (doseq
-          [input inputa]
+          [input [inputa]]
           (try
             (.close ^InputStream input)
             (catch Exception e nil)))
         )
       (when-let [outputs (::output ss)]
-        (doseq [output outputs]
+        (doseq [output [outputs]]
           (try
             (.close ^OutputStream output)
             (catch Exception e nil)))
         )
       (when-let [sockets (::socket ss)]
-        (doseq [socket sockets]
+        (doseq [socket [sockets]]
           (try
             (.close ^Socket socket)
             (catch Exception e nil)))
@@ -62,22 +102,22 @@
   [swagger-str]
   (swap! shim-socket dissoc ::swagger)
   (when-let [sd (try
-             (s1ctx/load-swagger-definition
-               :yaml
-               swagger-str
-               )
-             (catch Exception e1
-               (try
-                 (s1ctx/load-swagger-definition
-                   :json
-                   swagger-str
-                   )
-                 (catch Exception e2
-                   (do
-                     (clojure.tools.logging/log :error e1 "Failed to parse as YAML")
-                     (clojure.tools.logging/log :error e2 "Failed to parse as JSON")
-                     nil
-                     )))))]
+                  (s1ctx/load-swagger-definition
+                    :yaml
+                    swagger-str
+                    )
+                  (catch Exception e1
+                    (try
+                      (s1ctx/load-swagger-definition
+                        :json
+                        swagger-str
+                        )
+                      (catch Exception e2
+                        (do
+                          (clojure.tools.logging/log :error e1 "Failed to parse as YAML")
+                          (clojure.tools.logging/log :error e2 "Failed to parse as JSON")
+                          nil
+                          )))))]
     (swap! shim-socket assoc ::swagger sd)
     ))

@@ -92,70 +132,89 @@
 (defn- listen-to-input
   "Listen to the incoming socket"
   [^InputStream input]
-  (let [in (BufferedReader. (InputStreamReader. input "UTF-8"))]
+  (let [in (BufferedReader. (InputStreamReader. input "UTF-8"))
+        continue (atom true)]
     (try
-      (while true
-        (when-let [line (.readLine in)]
-          (let [bytes (.decode (Base64/getDecoder) line)
-                map (json/parse-stream (BufferedReader. (InputStreamReader. (ByteArrayInputStream. bytes) "UTF-8")))
-                map (fu/keywordize-keys map)
-                cmd (:cmd map)]
-            (cond
-              (= "setSwagger" cmd)
-              (set-swagger (:swagger map))
-
-              (= "hello" cmd)
-              (clojure.tools.logging/log :info "We got hello from the client")
-
-              (= "reply" cmd)
-              (do-reply map)
-
-              :else nil
+      (while @continue
+        (let [line (.readLine in)]
+          (if line
+            (let [bytes (.decode (Base64/getDecoder) line)
+                  map (json/parse-stream (BufferedReader. (InputStreamReader. (ByteArrayInputStream. bytes) "UTF-8")))
+                  map (fu/keywordize-keys map)
+                  cmd (:cmd map)]
+              (cond
+                (= "setSwagger" cmd)
+                (set-swagger (:swagger map))
+
+                (= "hello" cmd)
+                (clojure.tools.logging/log :info "We got hello from the client")
+
+                (= "reply" cmd)
+                (do-reply map)
+
+                :else nil
+                )
               )
+            (reset! continue false)
             )))
-      (finally (println "Exiting input loop"))
+      (finally
+        (shutdown-socket)
+        )
       )))

 (defn- listen-to-socket
   "Accept socket connections"
   [^ServerSocket server-socket]
+  (shutdown)
   (reset! shim-socket {::server-socket server-socket
-                       ::socket []
-                       ::input []
-                       ::requests {}
-                       ::output []})
+                       ::socket        nil
+                       ::input         nil
+                       ::requests      {}
+                       ::output        nil})
   (try
     (while (not (.isClosed server-socket))
       (let [socket (.accept server-socket)
             input (.getInputStream socket)
             output (.getOutputStream socket)
             thread (Thread. (fn [] (listen-to-input input)) "Input Listener")]
-        (swap! shim-socket #(merge-with into % {::socket [socket]
-                                                ::input  [input]
-                                                ::output [output]}))
+        (swap! shim-socket #(merge % {::socket socket
+                                      ::input  input
+                                      ::output output}))
         (.start thread)
         )

       )
-    (catch Exception e (clojure.tools.logging/log :error e "Closed server socket" ))
-    (finally (shutdown)))
+    (catch SocketException se nil)                          ;; don't worry about closed socket closing
+    (catch Exception e (clojure.tools.logging/log :error e "Closed server socket"))
+    (finally
+      (shutdown)))
   )

 (defn exec-app
   [op-i req]
-  (println "In exec app for " op-i)
-  (let [uuid (.toString (UUID/randomUUID))
-        p (promise)]
-    (swap! shim-socket assoc-in [::requests uuid] p)
-    (send-message {:cmd     "invoke"
-                   :headers (:headers req)
-                   :class op-i
-                   :replyTo uuid
-                   :body    (if (:body req) (fu/encode-body (:body req)) nil)})
-    (let [answer (deref p 10000 ::failed)]
-      (if (= ::failed answer)
-        {:status 500 :body "Didn't get the answer"}
-        answer))))
+  (let [req2 (dissoc req :swagger)
+        req2 (assoc req2 :body (get-in req [:parameters :body]))]
+    (let [uuid (.toString (UUID/randomUUID))
+          p (promise)]
+      (swap! shim-socket assoc-in [::requests uuid] p)
+      (send-message {:cmd     "invoke"
+                     :headers (:headers req)
+                     :class   op-i
+                     :replyTo uuid
+                     :body    (if (:body req2) (json/generate-string (:body req2)) nil)})
+      (let [answer (deref p 10000 ::failed)]
+        (if (= ::failed answer)
+          {:status 500 :headers {"Content-Type" "text/plain"} :body "Didn't get the answer"}
+          (let [response (:response answer)
+                response (update response :headers fu/stringify-keys)
+                response (if (and (:body response) (:decodeBody answer))
+                           (assoc response
+                             :body
+                             (ByteArrayInputStream. (.decode (Base64/getDecoder) ^String (:body response))))
+                           response)
+                ]
+            response
+            ))))))

 (defn resolve-app
   [req]
@@ -189,9 +248,11 @@
 (defn http-handler
   [req]
   (if-let [swagger (::swagger @shim-socket)]
-    (let [app (make-app swagger)]
-      (app req))
-    {:status 404 :body "I'm swagger-less"}
+    (let [app (make-app swagger)
+          resp (app req)]
+      resp
+      )
+    {:status 404 :headers {"Content-Type" "text/plain"} :body "No Swagger Defined. Unable to route request\n"}
     ))

 (defonce end-server (atom nil))


allow :repl-init to be a function or form

--- dev/bake/repl.clj
+++ dev/bake/repl.clj
@@ -7,7 +7,9 @@
 (defmacro with-wrapper [& forms]
   `(((or (eval (:repl-wrapper *project*)) identity)
      (fn []
-       (eval (:repl-init *project*))
+       (let [init# (eval (:repl-init *project*))]
+         (when (fn? init#)
+           (init#)))
        ~@forms))))

 (defn repl [marker]


Remove debug prn

Remove debug prn

--- tutorial.moan/src/tutorial/moan/http_api.clj
+++ tutorial.moan/src/tutorial/moan/http_api.clj
@@ -34,7 +34,6 @@
                                    "application/edn")
                         (assoc-in [k :response]
                                   (fn [ctx]
-                                    (println ctx)
                                     (def ctx ctx)
                                     (if-let [params (::params v)]
                                       ((resolve sym)


CMR-2354 Removes extraneous TODO

CMR-2354 Removes extraneous TODO

--- umm-spec-lib/src/cmr/umm_spec/versioning.clj
+++ umm-spec-lib/src/cmr/umm_spec/versioning.clj
@@ -10,8 +10,6 @@
   "A sequence of valid UMM Schema versions, with the newest one last. This sequence must be updated
    when new schema versions are added to the CMR."
   ["1.0" "1.1"])
-
-;; TODO look into how to automatically get a list of versions from resources

 (def current-version
   "The current version of the UMM schema."