DeviceInfo implemented.

DeviceInfo implemented.

--- src/clojure/uncomplicate/clojurecl/core.clj
+++ src/clojure/uncomplicate/clojurecl/core.clj
@@ -20,7 +20,7 @@
 (def device-types-table
   (into {} (map (fn [[k v]] [v k]) device-types)))

-(def platform-info-names
+(def platform-info-table
   {:profile CL/CL_PLATFORM_PROFILE
    :version CL/CL_PLATFORM_VERSION
    :name CL/CL_PLATFORM_NAME
@@ -28,7 +28,7 @@
    :extensions CL/CL_PLATFORM_EXTENSIONS
    :icd-suffix-khr CL/CL_PLATFORM_ICD_SUFFIX_KHR})

-(def context-prop-names
+(def context-prop-table
   {:platform CL/CL_CONTEXT_PLATFORM
    :interop-user-sync CL/CL_CONTEXT_INTEROP_USER_SYNC
    :gl CL/CL_GL_CONTEXT_KHR
@@ -61,6 +61,20 @@
            (String. res# 0 (dec size#))
            (throw (error err#))))
        (throw (error err#)))))
+
+(defmacro info-mask* [method clobject info table]
+  `(let [mask# (info-long* ~method ~clobject ~info)]
+     (fmap (fn [^long config#]
+             (not= 0 (bit-and mask# config#)))
+           ~table)))
+
+(defmacro info-mask-one* [method clobject info table]
+  `(let [mask# (info-long* ~method ~clobject ~info)]
+     (some (fn [[k# v#]]
+             (if (= 0 (bit-and mask# (long v#)))
+               false
+               k#))
+           ~table)))

 (let [pointer-to-buffer (fn [^ByteBuffer b]
                           (Pointer/to b))]
@@ -136,12 +150,44 @@
 (defn platform-info
   ([platform info]
    (info-string* CL/clGetPlatformInfo platform
-                 (platform-info-names info)))
+                 (platform-info-table info)))
   ([platform]
    (fmap #(info-string* CL/clGetPlatformInfo platform %)
-         platform-info-names)))
+         platform-info-table)))

 ;; =============== Device ==========================================
+(def fp-config-table
+  {:denorm CL/CL_FP_DENORM
+   :inf-nan CL/CL_FP_INF_NAN
+   :round-to-nearest CL/CL_FP_ROUND_TO_NEAREST
+   :round-to-zero CL/CL_FP_ROUND_TO_ZERO
+   :round-to-inf CL/CL_FP_ROUND_TO_INF
+   :fma CL/CL_FP_FMA
+   :correctly-rounded-divide-sqrt CL/CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT
+   :soft-float CL/CL_FP_SOFT_FLOAT})
+
+(def exec-capabilities-table
+  {:kernel CL/CL_EXEC_KERNEL
+   :native-kernel CL/CL_EXEC_NATIVE_KERNEL})
+
+(def cache-type-table
+  {:none CL/CL_NONE
+   :read-only CL/CL_READ_ONLY_CACHE
+   :read-write CL/CL_READ_WRITE_CACHE})
+
+(def mem-type-table
+  {:none CL/CL_NONE
+   :global CL/CL_GLOBAL
+   :local CL/CL_LOCAL})
+
+(def affinity-domain-table
+  {:numa CL/CL_DEVICE_AFFINITY_DOMAIN_NUMA
+   :l4-cache CL/CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE
+   :l3-cache CL/CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE
+   :l2-cache CL/CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE
+   :l1-cache CL/CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE
+   :next-partitionable CL/CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE})
+
 (defn info-address-bits [device]
   (info-int* CL/clGetDeviceInfo device CL/CL_DEVICE_ADDRESS_BITS))

@@ -149,14 +195,19 @@
   (info-bool* CL/clGetDeviceInfo device CL/CL_DEVICE_AVAILABLE))

 (defn info-built-in-kernels [device]
-  (info-string* CL/clGetDeviceInfo device CL/CL_DEVICE_BUILT_IN_KERNELS))
+  (let [res (info-string* CL/clGetDeviceInfo device
+                          CL/CL_DEVICE_BUILT_IN_KERNELS)]
+    (if (str/blank? res)
+      []
+      (str/split res #" "))))

 (defn info-compiler-available [device]
   (info-bool* CL/clGetDeviceInfo device CL/CL_DEVICE_COMPILER_AVAILABLE))

-;;TODO
 (defn info-double-fp-config [device]
-  (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_DOUBLE_FP_CONFIG))
+  (info-mask* CL/clGetDeviceInfo device
+              CL/CL_DEVICE_DOUBLE_FP_CONFIG
+              fp-config-table))

 (defn info-endian-little [device]
   (info-bool* CL/clGetDeviceInfo device CL/CL_DEVICE_ENDIAN_LITTLE))
@@ -164,20 +215,23 @@
 (defn info-error-correction-support [device]
   (info-bool* CL/clGetDeviceInfo device CL/CL_DEVICE_ERROR_CORRECTION_SUPPORT))

-;;TODO
 (defn info-execution-capabilities [device]
-  (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_EXECUTION_CAPABILITIES))
-
-;;TODO partition the string
+  (info-mask* CL/clGetDeviceInfo device
+              CL/CL_DEVICE_DOUBLE_FP_CONFIG
+              exec-capabilities-table))
+
 (defn info-extensions [device]
-  (info-string* CL/clGetDeviceInfo device CL/CL_DEVICE_EXTENSIONS))
+  (str/split (info-string* CL/clGetDeviceInfo device
+                           CL/CL_DEVICE_EXTENSIONS)
+             #" "))

 (defn info-global-mem-cache-size [device]
   (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_GLOBAL_MEM_CACHE_SIZE))

-;;TODO
 (defn info-global-mem-cache-type [device]
-  (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_GLOBAL_MEM_CACHE_TYPE))
+  (info-mask-one* CL/clGetDeviceInfo device
+                  CL/CL_DEVICE_GLOBAL_MEM_CACHE_TYPE
+                  cache-type-table))

 (defn info-global-mem-cacheline-size ^long [device]
   (info-int* CL/clGetDeviceInfo device CL/CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE))
@@ -224,9 +278,10 @@
 (defn info-local-mem-size [device]
   (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_LOCAL_MEM_SIZE))

-;;TODO
 (defn info-local-mem-type [device]
-  (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_LOCAL_MEM_TYPE))
+  (info-mask-one* CL/clGetDeviceInfo device
+                  CL/CL_DEVICE_LOCAL_MEM_TYPE
+                  mem-type-table))

 (defn info-max-clock-frequency [device]
   (info-int* CL/clGetDeviceInfo device CL/CL_DEVICE_MAX_CLOCK_FREQUENCY))
@@ -314,13 +369,25 @@
     {:version (info 2)
      :vendor-specific-info (get info 3)}))

-;;TODO
 (defn info-parent-device [device]
-  (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_PARENT_DEVICE))
-
-;;TODO
+  (let [parent (cl_device_id.)
+        id (info-long* CL/clGetDeviceInfo device
+                       CL/CL_DEVICE_PARENT_DEVICE)]
+    (if (= 0 id)
+      nil
+      (let [parent (cl_device_id.)
+            err (CL/clGetDeviceInfo device CL/CL_DEVICE_PARENT_DEVICE
+                                    Sizeof/cl_device_id
+                                    (Pointer/to parent)
+                                    nil)]
+        (if (= 0 err)
+          parent
+          (throw (error err)))))))
+
 (defn info-partition-affinity-domain [device]
-  (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_PARTITION_AFFINITY_DOMAIN))
+  (info-mask* CL/clGetDeviceInfo device
+              CL/CL_DEVICE_PARTITION_AFFINITY_DOMAIN
+              affinity-domain-table))

 (defn info-partition-max-sub-devices [device]
   (info-int* CL/clGetDeviceInfo device CL/CL_DEVICE_PARTITION_MAX_SUB_DEVICES))
@@ -406,9 +473,10 @@
 (defn info-reference-count [device]
   (info-int* CL/clGetDeviceInfo device CL/CL_DEVICE_REFERENCE_COUNT))

-;;TODO
 (defn info-single-fp-config [device]
-  (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_SINGLE_FP_CONFIG))
+  (info-mask* CL/clGetDeviceInfo device
+              CL/CL_DEVICE_SINGLE_FP_CONFIG
+              fp-config-table))

 (defn info-spir-versions [device]
   nil)
@@ -419,9 +487,10 @@
 (defn info-terminate-capability-khr [device]
   nil)

-;;TODO
 (defn info-device-type [device]
-  (info-long* CL/clGetDeviceInfo device CL/CL_DEVICE_TYPE))
+  (info-mask-one* CL/clGetDeviceInfo device
+                  CL/CL_DEVICE_TYPE
+                  device-types))

 (defn info-vendor [device]
   (info-string* CL/clGetDeviceInfo device CL/CL_DEVICE_VENDOR))
@@ -568,7 +637,7 @@
 ;; ============= Context ===========================================
 (defn context-properties [props]
   (reduce (fn [^cl_context_properties cp [p v]]
-            (doto cp (.addProperty (context-prop-names p) v)))
+            (doto cp (.addProperty (context-prop-table p) v)))
           (cl_context_properties.)
           props))


Fix bug when there is no xy stage present.

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -118,6 +118,11 @@
 (defn get-z-stage-position [stage]
   (if-not (empty? stage) (core getPosition stage) 0))

+(defn get-xy-stage-position [stage]
+  (if-not (empty? stage)
+    (let [xy (.getXYStagePosition gui)]
+      [(.x xy) (.y xy)])))
+
 (defn set-z-stage-position [stage pos]
   (when-not (empty? stage)
     (when (and (core isContinuousFocusEnabled)
@@ -330,20 +335,23 @@

 (defn prepare-state [this]
   (let [default-z-drive (core getFocusDevice)
-        z (get-z-stage-position default-z-drive)]
+        default-xy-stage (core getXYStageDevice)
+        z (get-z-stage-position default-z-drive)
+        xy (get-xy-stage-position default-xy-stage)]
     (swap! (.state this) assoc
       :pause false
       :stop false
       :running true
       :finished false
       :last-wake-time (clock-ms)
-      :last-positions {default-z-drive z}
+      :last-positions {default-z-drive z
+                       default-xy-stage xy}
       :reference-z-position z
       :start-time (clock-ms)
       :init-auto-shutter (core getAutoShutter)
       :init-exposure (core getExposure)
       :default-z-drive default-z-drive
-      :default-xy-stage (core getXYStageDevice)
+      :default-xy-stage default-xy-stage
       :init-z-position z
       :init-system-state (get-system-config-cached)
       :init-continuous-focus (core isContinuousFocusEnabled)


show all in edit-mode

show all in edit-mode

--- src/cljs/iwaswhere_web/ui/entry/briefing.cljs
+++ src/cljs/iwaswhere_web/ui/entry/briefing.cljs
@@ -312,10 +312,8 @@
                   (fn [_]
                     (when-not edit-mode?
                       (swap! local update-in [:selected] #(if (= k %) nil k))))]
-              (when (or (pos? allocation)
-                        (get actual-times k) edit-mode?)
-                (when (or (not filtered?)
-                          (pos? remaining))
+              (when (or (pos? allocation) (get actual-times k) edit-mode?)
+                (when (or (not filtered?) (pos? remaining) edit-mode?)
                   ^{:key (str :time-allocation k)}
                   [:tr {:on-click click
                         :class    (when (= k (:selected @local)) "selected")}


test/train keys for display features

test/train keys for display features

--- src/clojure/zensols/model/eval_classifier.clj
+++ src/clojure/zensols/model/eval_classifier.clj
@@ -75,28 +75,33 @@
   [[with-model-conf]].

   For the non-zero-arg form, see [[with-model-conf]]."
-  ([]
-   (let [{:keys [feature-metas-fn display-feature-metas-fn
-                 class-feature-meta-fn create-feature-sets-fn]} (model-config)
-         display-feature-metas-fn (or display-feature-metas-fn feature-metas-fn)]
-     (feature-matrix (display-feature-metas-fn)
-                     (class-feature-meta-fn)
-                     (create-feature-sets-fn))))
-  ([feature-metas class-feature-meta feature-sets]
-   (let [keys (map first (concat (list class-feature-meta) feature-metas))]
-     (->> feature-sets
-          (map (fn [tok]
-                 (map (fn [tkey]
-                        (get tok tkey))
-                      keys)))
-          (hash-map :column-names (map name keys) :data)))))
+  [& {:keys [max] :as adb-keys
+      :or {max Integer/MAX_VALUE}}]
+  (let [{:keys [feature-metas-fn display-feature-metas-fn
+                class-feature-meta-fn create-feature-sets-fn]} (model-config)
+        display-feature-metas-fn (or display-feature-metas-fn feature-metas-fn)
+        feature-metas (display-feature-metas-fn)
+        class-feature-meta (class-feature-meta-fn)
+        adb-keys (if adb-keys
+                   (->> (dissoc adb-keys :max)
+                        (apply into [])))
+        feature-sets (->> adb-keys
+                          (apply create-feature-sets-fn)
+                          (take max))]
+    (let [keys (map first (concat (list class-feature-meta) feature-metas))]
+      (->> feature-sets
+           (map (fn [tok]
+                  (map (fn [tkey]
+                         (get tok tkey))
+                       keys)))
+           (hash-map :column-names (map name keys) :data)))))

 (defn display-features
   "Display features as configured in a model with [[with-model-conf]].

   For the non-zero-arg form, see [[with-model-conf]]."
-  []
-  (let [{:keys [column-names data]} (feature-matrix)]
+  [& adb-keys]
+  (let [{:keys [column-names data]} (apply feature-matrix adb-keys)]
     (dr/display-results data :column-names column-names)))

 (defn features-file


implemented a new quick-sort + move on on functional chapter 7

--- src/clojure_learning/with-clojure-playing.clj
+++ src/clojure_learning/with-clojure-playing.clj
@@ -817,12 +817,11 @@
   [container]
   (lazy-seq
      (let [[pivot & tail-items :as curr-container] container
-            smaller? #(<= %1 pivot)
+            smaller? #(< %1 pivot)
             pivot-less (remove #(= pivot %1) curr-container)
             smaller-parts (filter smaller? pivot-less)
             higher-parts (remove smaller? pivot-less)]
-         (if (nil? pivot)
-            []
+         (when pivot
             (flatten (conj (cons pivot (qsort smaller-parts)) (qsort higher-parts)))))))

 ;; demo:
@@ -838,3 +837,49 @@
 (doc remove); -> the oponent of filter true -> returns items for which the pred returned falsy
 (list* 1 2 3 [34 4]); 1 2 3 34 4
 (list* [1 2 3] [4]); ([1 2 3] 4)
+
+(defn quick-sorter
+  [container]
+  (let [pivot (first container)
+        smaller? #(< %1 pivot)
+        higher? #(> %1 pivot)]
+    (when pivot
+      (lazy-cat
+       (quick-sorter (filter smaller? container))
+       (list pivot)
+       (quick-sorter (filter higher? container))))))
+
+(quick-sorter [31 2 1 212 3 4 9 8 6 7]); (1 2 3 4 7 8 9 31 212)
+
+(use 'clojure.repl)
+(doc lazy-cat);  (lazy-cat xs ys zs) === (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs))
+
+
+;;;;;;;;;;;;;;;;; emulating lazy + eager loading using clojure's: delay + force Objects ;;;;;;;;;;;;;;
+(doc when)
+(doc when-let)
+(when-let [foo false]
+    (println foo)
+    "returning this")
+(when false (println "true") "returning this")
+
+(defn emulate-lazy-expr
+  [eager-interpr lazy-interpret]
+    (if (force eager-interpr)
+      (println "this is so eager that will be printed...")
+      (force lazy-interpret)))
+(emulate-lazy-expr (delay false) (delay (do (println "going to sleep for a little") (Thread/sleep 3000))))
+(emulate-lazy-expr (delay "eager-evaluation") (delay (do (Thread/sleep 10000))))
+
+(lazy-cat [3 5 7] [2 3]); (3 5 7 2 3)
+(doc lazy-cat); (lazy-cat xs ys zs) === (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs))
+;;;;;;;;;;;;;;;;;;;;;;
+
+;; Chapter 7:: Functional Programming;;
+;; Composite data-structures in clojure are functions; their content can be passed as arguments to
+;; the composite-types:
+([:a :b] 1); :b
+
+(map [:a :b :c :d] #{0 1}); (:a :b)
+;; use a vector as a function in the map-operation over the given set ds
+


No need for snapshots anymore

No need for snapshots anymore

--- build.boot
+++ build.boot
@@ -1,8 +1,5 @@
 (set-env!
  :resource-paths   #{"src"}
- :repositories
-  #(into % {"sonatype snapshots"
-            {:url "https://oss.sonatype.org/content/repositories/snapshots"}})
  :dependencies
  '[[org.clojure/clojure "1.7.0"]
    [com.google.auto.value/auto-value "1.2-rc1"]


73 prefs moved to bottom

73 prefs moved to bottom

--- src/etaoin/api.clj
+++ src/etaoin/api.clj
@@ -2656,10 +2656,10 @@
         _ (when url (swap! driver drv/set-url url))
         _ (when headless (swap! driver drv/set-headless))
         _ (when args (swap! driver drv/set-options-args args))
-        _ (when prefs (swap! driver drv/set-prefs prefs))
         _ (when profile (swap! driver drv/set-profile profile))
         _ (when path-browser (swap! driver drv/set-binary path-browser))
         _ (when download-dir (swap! driver drv/set-download-dir download-dir))
+        _ (when prefs (swap! driver drv/set-prefs prefs))
         proc-args (drv/get-args @driver)
         _ (log/debugf "Starting process: %s" (str/join \space proc-args))
         process (proc/run proc-args)]


Better handle malformed URLs in markov chains

--- src/engulf/formulas/http_benchmark_runner.clj
+++ src/engulf/formulas/http_benchmark_runner.clj
@@ -78,7 +78,7 @@
     ;; Ensure required keys
     (let [diff (cset/difference #{:concurrency :limit} params)]
       (when (not (empty? diff))
-        (throw (Exception. (str "Invalid parameters! Missing keys: " diff ". Got: " str-params)))))
+        (throw (Exception. (str "Invalid parameters! Missing keys: " diff ".")))))

     (when (> node-count (int-val (:concurrency params)))
       (throw (Exception. "Concurrency cannot be < node-count! Use a higher concurrency setting!")))


Remove support info call; FIXME later

Remove support info call; FIXME later

--- src-cljs/frontend/components/pieces/topbar.cljs
+++ src-cljs/frontend/components/pieces/topbar.cljs
@@ -73,7 +73,8 @@
                  [:a (html/open-ext {:href "https://discuss.circleci.com/"})
                   "Discuss"]]
                 [:li
-                 [:a support-info
+                 ;; FIXME: NEED TO ADD THIS AGAIN IN THE DEFN
+                 [:a.support-info
                   "Support"]]]]

               [:li.dropdown.user-menu


Layout manager #41

Layout manager #41

--- src/flatgui/samples/forms/layoutdemopanel.clj
+++ src/flatgui/samples/forms/layoutdemopanel.clj
@@ -20,18 +20,22 @@
             [flatgui.widgets.scrollpanel :as scrollpanel]))

 (def layout-cfg
+  [
+   [:name-label       [:name-editor :-]]
+   ]
   ;[[:name-label       [:name-editor :-]]
   ; [:password-label   [:password-textfield :-]               :show-chars-btn]
   ; [:position-label   [:x :y :-]                             :edit-pos-btn]
   ; [:dimensions-label [:w-label [:w :---] :h-label [:h :--]] :edit-dim-btn]
   ; [[:one :two :']    [:notes-entry :-|]]
-  ; [[:upper-ed :-']   [:notes-entry]]
+  ; [[:upper-ed :-']   [:notes-entry]]     <--- :notes-entry takes more than one row
   ; [[:three :four]    [:notes-entry]]
   ; [[:five :six :-.]  [:notes-entry]]
+  ; [[:long-editor]    [:long-editor]] <--- :long-editor takes two columns
   ; [:bottom-labels    [[:bleft :<] [:bright :>]]]]
-
-  [:name-label       [:name-editor :-]]
-
+  ;                   /|\
+  ;                    | Need to know width of first column to align x coord for second.
+  ;                      Same is with rows
   )

 (def demo-window
@@ -83,7 +87,7 @@
 (def layout-window
   (fg/defcomponent
     window/window
-    :hello
+    :config
     {:clip-size (m/defpoint 5.125 5.5)
      :position-matrix (m/translation 1 1)
      :text "Config"}


Buggy version of string splitting

Buggy version of string splitting

--- src/harnocode/core.cljs
+++ src/harnocode/core.cljs
@@ -107,22 +107,24 @@
    (map invert-row img)))

 ;; TODO: break long string literals into several of form "abc" + "def"
-(comment defn split-string-literal [token l result]
- (let [[h t] (split-at l (:value token))]
-  (if (empty? h) result
+(defn split-string-literal [token l result]
+ (let [[[quote & hrest :as h] t] (split-at l (:value token))]
+  (println h)
+  (if (empty? hrest)
+   (butlast result)
    (recur
-    {:value t :type "String"}
-    (concat result
-     {:value h :type "String"}
+    {:value (str quote (:value t)) :type "String"}
+    l
+    (conj result
+     {:value (str h quote) :type "String"}
      {:value "+" :type "Punctuator"})))))

 (defn split-string-literals [tokens l]
   (let [split-token (fn [token]
                      (if (not= (:type token) "String")
                       [token]
-                      (comment split-string-literal token l [])))]
-  (comment mapcat split-token tokens)
-  tokens))
+                      (split-string-literal token l [])))]
+  (mapcat split-token tokens)))

 ;; Tries hard to make piece of code look like img
 ;; code -- string
@@ -130,7 +132,7 @@
 ;; w    -- int, width of output, in chars
 (defn harnify [code img w]
   (let [tokens (js->clj (js/esprima.tokenize code) :keywordize-keys true)
-        ts (tokens-to-text (split-string-literals tokens 4) [])]
+        ts (tokens-to-text (split-string-literals tokens 5) [])]
     (string/join "\n" (reverse (arrange-tokens ts img)))              ; img must be resized by now, no need in w
     ))

@@ -189,20 +191,7 @@
             }
         }
     }"
-      img [[0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]
-           [0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]]
+      img @img
       width (count (first img))
       harnocode (harnify code img width)]
   (show-harnocode! harnocode))


Documentation updates

Documentation updates

--- src/h5gal/core.clj
+++ src/h5gal/core.clj
@@ -1,41 +1,46 @@
 (ns h5gal.core
   (:gen-class))

-;;;; Gallery Generator built to learn Clojure
+;;;; # Gallery Generator built to learn Clojure
+;;;;
+;;;; ## Where To Put Your Images
+;;;;
+;;;; Pictures should be stored beneath a git-annex routeconforming to the
+;;;; following directory structure.
+;;;;
+;;;;     <datadir>/2011/04/28/Tokyo Trip/Picture3425.jpg
+;;;;
+;;;; The first three levels of directory outside of the <datadir> are the date
+;;;; in reverse order. The next "Tokyo Trip" is the name of the specific event.
+;;;; These combined should give enough information to supply a title and a date
+;;;; of a set of pictures, which might be enough for lots of people.
+;;;;
+;;;; ## Describing What The Set Of Pictures Is About
+;;;;
+;;;; Should you wish to describe what the set if pictures is about in detail you
+;;;; can include a README within the event directory. It should be formatted
+;;;; using Markdown.
+;;;;
+;;;;     <datadir>/2011/04/28/Tokyo Trip/README.md
+;;;;
+;;;; ## Describing A Specific Picture
+;;;;
+;;;; If you want to add a description of what is in the individual picture
+;;;; create a markdown document with the same name but with a md (markdown)
+;;;; extension
+;;;;
+;;;;     <datadir>/2011/04/28/Tokyo Trip/Picture3425.md
+;;;;
+;;;; ## Photo Editing
+;;;;
+;;;; It may be that you want to keep an originals of all images for posterity
+;;;; but also want to touch up and experiment with photo editing. To do this
+;;;; append a .edited to the end of the name component of the filename as shown
+;;;; below.
+;;;;
+;;;;     <datadir>/2011/04/28/Tokyo Trip/Picture3425/Picture3425.edited.jpg
+;;;;

-;;; Directory strucutre example:
-;;;
-;;;     <datadir>/2011/04/28/Tokyo Trip/Picture3425.jpg
-;;;
-;;; The location of photo's, the first three levels of directory outside of the
-;;; <datadir> are teh date in reverse order. The next "Tokyo Trip" is the name
-;;; of the specific event. These combined should give enough information to
-;;; supply a title and a date of a set of pictures, which might be enough for
-;;; lots of people.
-;;;
-;;;     <datadir>/2011/04/28/Tokyo Trip/README.md
-;;;
-;;; Should you wish to describe the event in detail you can include a README
-;;; within the event directory. It should be formatted using Markdown.
-;;;
-;;;     <datadir>/2011/04/28/Tokyo Trip/Picture3425/README.md
-;;;
-;;; If you want to add a description of what is in the individual picture
-;;; create a directory of the same name, but without the extension and add a
-;;; README file there.
-;;;
-;;;     <datadir>/2011/04/28/Tokyo Trip/Picture3425/_default.jpg
-;;;     <datadir>/2011/04/28/Tokyo Trip/Picture3425/_thumb_small.jpg
-;;;     <datadir>/2011/04/28/Tokyo Trip/Picture3425/_thumb_medium.jpg
-;;;     <datadir>/2011/04/28/Tokyo Trip/Picture3425/_thumb_large.jpg
-;;;
-;;; NOTE: These files will be created automatically for displaying within the
-;;; browser.
-;;;
-;;;     <datadir>/2011/04/28/Tokyo Trip/Picture3425/override.jpg
-;;;
-;;; But if it seems a file called override it will show this within the browser
-;;; instead as well as use it for thumbnails.

 (use '[clojure.java.io])
 (use 'clj-time.core)


dorun is the proper way to do this

dorun is the proper way to do this

--- project/scrape-summitpost-data/src/scrape_summitpost_data/search_result.clj
+++ project/scrape-summitpost-data/src/scrape_summitpost_data/search_result.clj
@@ -99,4 +99,4 @@
   necessary."
   [data-dir search-link]
   (.mkdir (io/file data-dir))
-  (last (map (partial save-summitpost-item! data-dir) (get-urls search-link))))
+  (dorun (map (partial save-summitpost-item! data-dir) (get-urls search-link))))


:shaved_ice:

--- src/main/clj/agency/irl/instagrammer/core.clj
+++ src/main/clj/agency/irl/instagrammer/core.clj
@@ -118,9 +118,10 @@

     (unsubscribe/all-sync)

-    (let [geo-sub-1 (subscribe/geo :lng 74.0059 :lat 40.7127 :radius 5000)
-          geo-sub-2 (subscribe/geo :lat 40.7127 :lng 74.0059 :radius 5000)
-          tag-sub (subscribe/tag :tag "yolo")]))
+    (let [geo-sub-1 (subscribe/geo :lng 74.0059 :lat -40.7127 :radius 5000)
+          geo-sub-2 (subscribe/geo :lng -40.7127 :lat 74.0059 :radius 5000)
+          tag-sub-1 (subscribe/tag :tag "picoftheday")
+          tag-sub-1 (subscribe/tag :tag "yolo")]))

 ; ; Bind client info


remove possibility of a NullPointerException, fixes #4

--- src/clj/com/matthiasnehlsen/inspect/matcher.clj
+++ src/clj/com/matthiasnehlsen/inspect/matcher.clj
@@ -21,14 +21,14 @@

 (defn strip-uid
   "for some reason, the :client-uuid is longer than expected. This strips the
-   uuid string to the expected length as used elsewhere"
+  uuid string to the expected length as used elsewhere"
   [client-uuid]
   (subs client-uuid 0 36))

 (defn get-next-items
   "start listener for all event types, limited to the next n for each"
   [client-map full-event]
-  (log/info client-map)
+  (log/info "client-map" client-map)
   (let [uid (strip-uid (:client-uuid full-event))]
     (swap! client-maps assoc-in [uid] client-map)))

@@ -80,7 +80,12 @@
                   (doseq [uid (:any @uids)]
                     (when (pos? (get-in @client-maps [uid origin] 0))
                       (chsk-send! uid [:info/msg (assoc msg :payload (with-out-str (pp/pprint (:payload msg))))])
-                      (swap! client-maps update-in [uid origin] dec)
+                      (swap! client-maps
+                             (fn [prev]
+                               (let [client-map (get-in prev [uid origin])]
+                                 (if client-map ;; check if exists, may have been changed
+                                   (update-in prev [uid origin] dec)
+                                   prev))))
                       (chsk-send! uid [:info/client-map (get-in @client-maps [uid])])))
                   (recur)))))


Add btns to devcards

Add btns to devcards

--- src/devcards/discuss/components/references.cljs
+++ src/devcards/discuss/components/references.cljs
@@ -4,11 +4,14 @@
             [discuss.views :as views]
             [sablono.core :as html :refer-macros [html]]
             [discuss.components.tooltip :as tooltip]
-            [discuss.references.integration :as rint]))
+            [discuss.references.integration :as rint]
+            [discuss.references.main :as ref]))

 (defcard buttons
   (html [:div
-         [:div.btn.btn-primary {:onClick rint/request-references} "Request References"]]))
+         [:div.btn.btn-primary {:onClick rint/request-references} "Request References"]
+         " "
+         [:div.btn.btn-primary {:onClick #(ref/query-reference-details 5)} "Details for Refence 5"]]))

 (defcard sample-passage
   "<p id='discuss-text'>Currently, the city council discusses to close the University Park, because of its high running expenses of about $100.000 per year. But apparently there is an anonymous investor ensuring to pay the running costs for at least the next five years. Thanks to this anonymous person, the city does not loose a beautiful park, but this again fires up the discussion about possible savings for the future. </p>")


Update _test/check_exercises.clj

Update _test/check_exercises.clj

Make the code slightly more elegant (maybe).

--- _test/check_exercises.clj
+++ _test/check_exercises.clj
@@ -1,11 +1,14 @@
 (ns check-exercises
   (:require [cheshire.core :as json]
             [clojure.string :as string]
-            [clojure.test :refer :all]))
+            [clojure.test :refer [deftest is run-tests successful?]]))
+
+(defn- ->snake_case [s] (string/replace s \- \_))

 (deftest check-exercises
-  (doseq [problem (-> (slurp "config.json") (json/parse-string true) :problems)
-          :let [str-problem #(apply str problem %&)]]
-    (load-file (str-problem "/example.clj"))
-    (load-file (str-problem "/" (string/replace problem \- \_) "_test.clj"))
-    (is (successful? (run-tests (symbol (str-problem "-test")))))))
+  (doseq [problem ((json/parse-string (slurp "config.json")) "problems")
+          :let [path-to-problem (partial str problem "/")
+                problem-tests   (symbol (str problem "-test"))]]
+    (load-file (path-to-problem "example.clj"))
+    (load-file (path-to-problem (->snake_case problem) "_test.clj"))
+    (is (successful? (run-tests problem-tests)))))


Add not found route

Add not found route

--- src/leiningen/new/clanhr_service/routes.clj
+++ src/leiningen/new/clanhr_service/routes.clj
@@ -19,7 +19,7 @@
   (GET "/healthcheck" [] (healthcheck/handler)))

 (defroutes private-routes
-  )
+  (route/not-found (reply/not-found {:success false :data "not-found"})))

 (defn- wrap-exception-handler
   [handler]


Add test for large dispatch tables

Add test for large dispatch tables

--- spec/rook/dispatcher_spec.clj
+++ spec/rook/dispatcher_spec.clj
@@ -57,6 +57,28 @@
   (fn [request]
     (swap! atom inc)
     (handler request)))
+
+
+(defn generate-huge-resource-namespace [ns-name size]
+  (if-let [ns (find-ns ns-name)]
+    (throw
+      (ex-info
+        (str
+          "It so happens that we already have a namespace named "
+          ns-name
+          "; I probably shouldn't touch it.")
+        {:ns-name ns-name :ns ns})))
+  (let [ns (create-ns ns-name)]
+    (doseq [i (range size)
+            :let [foo (str "foo" i)]]
+      (intern ns
+        (with-meta (symbol foo)
+          {:route-spec [:get [foo :x]]
+           :arglists (list '[request x])})
+        (fn [request x]
+          {:status  200
+           :headers {}
+           :body    (str foo "/" x)})))))

 (create-ns 'example.foo)
@@ -284,4 +306,21 @@
         (should= HttpServletResponse/SC_BAD_REQUEST (:status response))
         (should= "validation-error" (-> response :body :error))
         ;; TODO: Not sure that's the exact format I want sent back to the client!
-        (should= "{:name missing-required-key}" (-> response :body :failures))))))
+        (should= "{:name missing-required-key}" (-> response :body :failures)))))
+
+  (describe "handlers with a large number of endpoints"
+
+    (it "should compile and handle requests as expected"
+      (should= {:status 200 :headers {} :body "foo0/123"}
+        ((let [size 100]
+           (remove-ns 'rook.example.huge)
+           (generate-huge-resource-namespace 'rook.example.huge size)
+           (dispatcher/compile-dispatch-table
+             (dispatcher/namespace-dispatch-table [] 'rook.example.huge)))
+         {:request-method :get
+          :uri "/foo0/123"
+          :server-name "127.0.0.1"
+          :port 8080
+          :remote-addr "127.0.0.1"
+          :scheme :http
+          :headers {}})))))


make sure HUD is on top (#196)

make sure HUD is on top (#196)

--- src/main/shadow/cljs/devtools/client/hud.cljs
+++ src/main/shadow/cljs/devtools/client/hud.cljs
@@ -214,6 +214,7 @@
             [:div
              {:id hud-id
               :style {:position "absolute"
+                      :z-index "10000"
                       :left "0px"
                       :bottom "0px"
                       :right "0px"


add some fusion instruction

add some fusion instruction

--- src/kondolisp/compiler.clj
+++ src/kondolisp/compiler.clj
@@ -34,13 +34,21 @@
        (:VM_VSET lispval-symbol)	  ;; overwrite symbol(operand) by %val

        ;; basic arithmetic operation
-       (:VM_LT nil)
-       (:VM_GT nil)
-       (:VM_LE nil)
-       (:VM_GE nil)
-       (:VM_EQ nil)
-       (:VM_PLUS nil)
-       (:VM_MINUS nil)
+       (:VM_LT nil)	;; (< <%val> <stack-top>)
+       (:VM_GT nil)	;; (> <%val> <stack-top>)
+       (:VM_LE nil)	;; (<= <%val> <stack-top>)
+       (:VM_GE nil)	;; (>= <%val> <stack-top>)
+       (:VM_EQ nil)	;; (= <%val> <stack-top>)
+       (:VM_PLUS nil)	;; (+ <stack-top> <%val>)
+       (:VM_MINUS nil)	;; (- <stack-top> <%val>)
+
+       (:VM_IVAL_LT lispval-integer)
+       (:VM_IVAL_GT lispval-integer)
+       (:VM_IVAL_LE lispval-integer)
+       (:VM_IVAL_GE lispval-integer)
+       (:VM_IVAL_EQ lispval-integer)
+       (:VM_IVAL_PLUS lispval-integer)
+       (:VM_IVAL_MINUS lispval-integer)

        ;; lisp data operation
        (:VM_CONS nil)	      ;; (cons <stack-top> <%val>)
@@ -193,6 +201,7 @@
       (condp = inst-operand-type
 	    nil (println ")")
 	    'lispval-symbol (println (format " '%s)" (decode-sym inst-operand)))
+            'lispval-integer (println (format " '%d)" (decode-num inst-operand)))
 	    'lispval (println (format " %s)" (lispval-str inst-operand)))
 	    inst-operand-type (println (format " %d)" inst-operand))
 	    )


updater runner to support executables with multiple params (like 'java -jar')

--- src/lopare/handlers.clj
+++ src/lopare/handlers.clj
@@ -7,15 +7,20 @@

 (defn run-shell
   [job-config additional-param]
-  (let [executable (:exec job-config)
-        entry (:entry job-config)
-        path-to-job-dir (str "./jobs/" (:name job-config))
-        result (shell/sh executable entry (json/write-str job-config) additional-param :dir path-to-job-dir)]
-    (if (not= (:exit result) 0)
-      (do
-        (error (:name job-config) additional-param "Error: " result)
-        (assoc job-config :error (:err result)))
-      job-config)))
+  (try
+    (let [executable (clojure.string/split (:exec job-config) #" ")
+          entry (:entry job-config)
+          path-to-job-dir (str "./jobs/" (:name job-config))
+          shell-params (concat executable [entry (json/write-str job-config) additional-param :dir path-to-job-dir])
+          result (apply shell/sh shell-params)]
+      (if (not= (:exit result) 0)
+        (do
+          (error (:name job-config) additional-param "Error: " result)
+          (assoc job-config :error (:err result)))
+        job-config))
+    (catch Exception e (do
+                         (error e)
+                         {:name (:name job-config) :error e}))))

 (defn pre-job
   [time job-config]


throw a popup to confirm if you want to update

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- src/lt/objs/deploy.cljs
+++ src/lt/objs/deploy.cljs
@@ -111,6 +111,14 @@
     "http://app.kodowa.com/latest-version/nw-edge"
     "http://app.kodowa.com/latest-version/nw"))

+(defn should-update-popup [data]
+  (popup/popup! {:header "There's a newer version of Light Table!"
+                 :body (str "Would you like us to download and install version " data "?")
+                 :buttons [{:label "Cancel"}
+                           {:label "Download and install"
+                            :action (fn []
+                                      (fetch-and-deploy data))}]}))
+
 (defn check-version [& [notify?]]
   (fetch/xhr (version-url) {}
              (fn [data]
@@ -118,11 +126,12 @@
                  (if (and (not= data "")
                           (not= data (:version version))
                           (is-newer? (:version version) data)
-                          (not= js/localStorage.fetchedVersion data))
+                          (or notify?
+                              (not= js/localStorage.fetchedVersion data)))
                    (do
                      (set! js/localStorage.fetchedVersion data)
                      (set! version (assoc version :version data))
-                     (fetch-and-deploy data))
+                     (should-update-popup data))
                    (when notify?
                      (notifos/set-msg! (str "At latest version: " (:version version)))))))))


Grammar: it's a thing.

Grammar: it's a thing.

--- src/midje/parsing/2_to_lexical_maps/fakes.clj
+++ src/midje/parsing/2_to_lexical_maps/fakes.clj
@@ -35,7 +35,7 @@
   (when-not (or (list? funcall)
                 (seq? funcall))
     (error/report-error form
-                        "The left-hand-side of a prerequisite must look like a function call or metaconstant."
+                        "The left-hand side of a prerequisite must look like a function call or metaconstant."
                         (cl-format nil "`~S` doesn't." funcall))))


Add unconstrain-asplan-env

Add unconstrain-asplan-env

--- src/angelic/search/action_set/asplan.clj
+++ src/angelic/search/action_set/asplan.clj
@@ -251,7 +251,7 @@

 ; Ideally, should prefer top-most top-down, bottom-most bottom-up, or something...

-(defrecord ASPlanEnv [init actions actions-fn g-map
+(defrecord ASPlanEnv [base-sas-env init actions actions-fn g-map
                     ; Following stuff is used by hierarchy.
                     causal-graph dtgs ancestor-var-map child-var-map acyclic-succ-fn]
   env/Env
@@ -274,7 +274,8 @@
         acyclic-succ-fn (partial possibly-acyclic-successors (HashMap.) simple-dtgs)]
     (assert (graphs/dag? causal-graph))
 ;    (clojure.inspector/inspect-tree child-var-map)
-    (ASPlanEnv.
+    (ASPlanEnv.
+     sas-problem
      (expand-initial-state (env/initial-state sas-problem) child-var-map (goal-action dtgs))
      (concat
       (for [a (:actions sas-problem)] (make-add-action-action a))
@@ -330,6 +331,15 @@
             ))) )
      (env/goal-map sas-problem)
      causal-graph dtgs av-map child-var-map acyclic-succ-fn)))
+
+(defn unconstrain-asplan-env
+  "Replace the actions-fn in asplan-env with one that generates all legal actions,
+   with no partitioning or pruning."
+  [env]
+  (assoc env
+    :actions-fn
+    (sas/make-simple-successor-generator (keys (env/initial-state env)) (:actions env))))
+

 (defn asplan-solution-name [sol]
   (map second (filter #(= (first %) ::GreedyFire) sol)))


not sure why that tab is in there.

not sure why that tab is in there.

--- src/metabase/driver.clj
+++ src/metabase/driver.clj
@@ -247,7 +247,7 @@
   (doseq [namespce (filter (fn [ns-symb]
                              (re-matches #"^metabase\.driver\.[a-z0-9_]+$" (name ns-symb)))
                            (ns-find/find-namespaces (classpath/classpath)))]
-    (log/info "\tloading driver namespace: " namespce)
+    (log/info "loading driver namespace: " namespce)
     (require namespce)))

 (defn is-engine?


Specify Content-Type charset=utf-8 for HTML pages :unamused:

--- src/metabase/routes.clj
+++ src/metabase/routes.clj
@@ -15,7 +15,7 @@
                                {:bootstrap_json (json/generate-string (public-settings/public-settings))})
         (slurp (io/resource "frontend_client/init.html")))
       resp/response
-      (resp/content-type "text/html")))
+      (resp/content-type "text/html; charset=utf-8")))

 ;; Redirect naughty users who try to visit a page other than setup if setup is not yet complete
 (defroutes ^{:doc "Top-level ring routes for Metabase."} routes


Document flatten-step-result-outputs

Document flatten-step-result-outputs

--- src/clj/lambdacd/stepresults/flatten.clj
+++ src/clj/lambdacd/stepresults/flatten.clj
@@ -1,6 +1,19 @@
-(ns lambdacd.stepresults.flatten)
+(ns lambdacd.stepresults.flatten
+  "Functions to convert a nested step result and transform it into a flat list")

-(defn flatten-step-result-outputs [outputs]
+(defn flatten-step-result-outputs
+  "Takes a nested step-result map (like those returned by a step or sent in a:pipeline-finished event)
+  and converts it into a flat map of step results where every step is accessible with its step-id:
+  ```
+  > (flatten-step-result-outputs {[1] {:status :success}
+                                  [2] {:status  :success
+                                       :outputs {[1 2] {:status :success :step [1 2]}}}})
+  {[1]   {:status :success}
+   [2]   {:status  :success
+          :outputs {[1 2] {:status :success :step [1 2]}}}
+   [1 2] {:status :success :step [1 2]}}
+  ```"
+  [outputs]
   (into {}
         (for [[k v] outputs]
           (if (:outputs v)


:revolving-house:

:revolving-house:

--- src/clj/mokkameister/resources/slack.clj
+++ src/clj/mokkameister/resources/slack.clj
@@ -16,7 +16,7 @@
    4 "Femte gong? "})

 (def ^:private mokkameister-link
-  "<https://revolver.house/kaffi/|Mokkameister>")
+  "<https://revolverhuset.no/kaffi/|Mokkameister>")

 (defn- coffee-message-starting [{:keys [slack-user brew-time]} today-count]
   (format "God nyhendnad folket! %s%s starta nett traktaren, kaffi om %d minuttar!"


Shuffling code around in embedded ai

Shuffling code around in embedded ai

--- src/clj/zetawar/players/embedded_ai.cljs
+++ src/clj/zetawar/players/embedded_ai.cljs
@@ -39,6 +39,16 @@
           (recur (<! player-chan))))))
   (stop [player]
     (async/close! player-chan)))
+
+(defmethod players/new-player ::players/embeded-ai
+  [{:as app-ctx :keys [ev-chan notify-pub]} player-type faction-color]
+  (let [player-chan (async/chan (async/dropping-buffer 10))
+        conn (d/create-conn db/schema)]
+    (EmbeddedAIPlayer. faction-color ev-chan notify-pub player-chan conn)))
+
+(defmethod handle-event ::players/start-turn
+  [{:as player :keys [faction-color conn]} _]
+  {:dispatch [[:zetawar.events.player/send-game-state faction-color]]})

 (defn get-game [db]
   (qe '[:find ?g
@@ -96,15 +106,6 @@
                (not (game/unit-at db game (:terrain/q base) (:terrain/r base))))
       [:zetawar.events.game/build-unit (:terrain/q base) (:terrain/r base) (:unit-type/id unit-type)])))

-(defmethod players/new-player ::players/embeded-ai
-  [{:as app-ctx :keys [ev-chan notify-pub]} player-type faction-color]
-  (let [player-chan (async/chan (async/dropping-buffer 10))]
-    (EmbeddedAIPlayer. faction-color ev-chan notify-pub player-chan (d/create-conn db/schema))))
-
-(defmethod handle-event ::players/start-turn
-  [{:as player :keys [conn]} _]
-  {:dispatch [[:zetawar.events.player/send-game-state (:faction-color player)]]})
-
 (defmethod handle-event ::players/update-game-state
   [{:as player :keys [conn]} [_ faction-color game-state]]
   (when (= faction-color (:faction-color player))


adding set lop level functionality

adding set lop level functionality

--- src/clojure/zensols/actioncli/log4j2.clj
+++ src/clojure/zensols/actioncli/log4j2.clj
@@ -33,6 +33,25 @@
    (log/debugf "new log level: %s" level-thing)
    (LogUtil/setAllLevel (to-level level-thing))))

+(defmacro with-log-level
+  "Set the the log level to **level-thing** (see [[change-log-level]]) for the
+  execution of **body**.
+
+  The **log-name** parameter is one of the following:
+
+  * the string package or namespace name of the logger (usual log name)
+  * `:ns` for the current namespace's logger"
+  {:style/indent 2}
+  [log-name level-thing & body]
+  `(let [lname# (if (= :ns ~log-name)
+                  (->> (ns-name *ns*) name)
+                  ~log-name)
+         old# (change-log-level lname# ~level-thing)]
+     (try
+       ~@body
+       (finally
+         (change-log-level lname# old#)))))
+
 (defn configure
   "Congigure the Log4j2 system with **res**, which can be anything usable
   with [[clojure.java.io/input-stream]].  If **res** is a string, interpret as


Morning work-in-progress

Morning work-in-progress

--- src/pamela/htn.clj
+++ src/pamela/htn.clj
@@ -260,8 +260,8 @@
   (let [hem (get-htn-object (first ancestry-path))
         ;; DEBUG
         _ (println "  RPC0" plant-class "METHOD" method
-           "\nRPCHEM" (dissoc hem :subtasks :ancestry-path
-                              :expansion-method :subtask-constraints)
+           "\nRPCHEM" (pr-str (dissoc hem :subtasks :ancestry-path
+                                      :expansion-method :subtask-constraints))
            "\nhem-pclass" hem-pclass
            "pargs" pargs
            "plant-class" plant-class
@@ -310,24 +310,27 @@
                         :else
                         plant-class))
         {:keys [argument-mappings]} hem
-         _ (println "  RPC1" plant-class "argument-mappings" argument-mappings) ;; DEBUG
-        resolve-pc (fn [arg]
-                     (if (and (variable? arg) (not (empty? argument-mappings)))
-                       (get argument-mappings arg)
-                       arg))
-        p (resolve-pc plant-class)
-        _ (println "  RPC2" p) ;; DEBUG
-        p (if (variable? p)
-            (resolve-plant-class ir hem-pclass pargs p method task-type
-              irks nil (nthrest ancestry-path 2))
-            p)
-        _ (println "  RPC3" p) ;; DEBUG
-        ;; if method is not primitive in p then return nil to
-        ;; indicate this is NOT actually a primitive method
-        p (if (and (map? p)
-                (= (:type p) :pclass-ctor)
-                (get-in ir [(:pclass p) :methods method :primitive]))
-            p)]
+        ;;  _ (println "  RPC1" plant-class "argument-mappings" argument-mappings) ;; DEBUG
+        ;; resolve-pc (fn [arg]
+        ;;              (if (and (variable? arg) (not (empty? argument-mappings)))
+        ;;                (get argument-mappings arg)
+        ;;                arg))
+        ;; p (resolve-pc plant-class)
+        ;; _ (println "  RPC2" p) ;; DEBUG
+        ;; p (if (variable? p)
+        ;;     (resolve-plant-class ir hem-pclass pargs p method task-type
+        ;;       irks nil (nthrest ancestry-path 2))
+        ;;     p)
+        ;; _ (println "  RPC3" p) ;; DEBUG
+        ;; ;; if method is not primitive in p then return nil to
+        ;; ;; indicate this is NOT actually a primitive method
+        ;; p (if (and (map? p)
+        ;;         (= (:type p) :pclass-ctor)
+        ;;         (get-in ir [(:pclass p) :methods method :primitive]))
+        ;;     p)
+        ;; FIX recursive argument resolution later
+        p plant-class
+        ]
     (println "RPC" plant-class "=>" p) ;; DEBUG
     p))

@@ -1283,8 +1286,8 @@
             args (if (pos? unresolved)
                       (resolve-arguments arguments ancestry-path)
                       arguments)
-            _ (println "plant-class" plant-class)
-            _ (println "get-in" pclass name)
+            _ (println "PD plant-class" plant-class)
+            _ (println "PD get-in" pclass name)
             formal-args (mapv str (get-in ir [pclass :methods name :args]))
             _ (println "PD ARGS" args "FORMAL-ARGS" formal-args) ;;:: DEBUG
             argsmap (zipmap formal-args args)]
@@ -1388,12 +1391,12 @@
             parallel? (not sequential?)
             choice? (and (not parallel?) (> m-task-expansions 1))
             ;; DEBUG
-            ;; _ (println "SUBTASK primitive?" primitive?
-            ;;     "type" type
-            ;;     "plant-class" plant-class
-            ;;     "parallel?" parallel?
-            ;;     "choice?" choice?
-            ;;     "ST" (dissoc subtask :ancestry-path :task-expansions))
+            _ (println "SUBTASK primitive?" primitive?
+                "type" type
+                "plant-class" plant-class
+                "parallel?" parallel?
+                "choice?" choice?
+                "ST" (dissoc subtask :ancestry-path :task-expansions))
             ;; add in details for the plant for primitive tasks...
             ;;_ (println "plant-details" pargs subtask plant-class primitive?) ;;DEBUG
             details (plant-details ir pargs subtask plant-class primitive?)


Minor cleanup

Minor cleanup

--- src/pamela/htn.clj
+++ src/pamela/htn.clj
@@ -269,7 +269,6 @@
             "pclass" pclass
             "task-type" task-type
             "(:pclass henpt)" (:pclass henpt)
-            ;;"ancestry-path" ancestry-path
             )
         _ (if-not (htn-isa? task-type :htn-nonprimitive-task)
             (dbg-println :debug "  RPC HENPT" (dissoc henpt :subtasks :ancestry-path
@@ -302,27 +301,16 @@
                                (get-in ir [caller-pclass :fields (:field caller_) :initial]))
                              (if (= name 'this)
                                ;;Use the ancestry-path to resolve the pclass of the caller
-                               (let [[this-hem
-                                      parent-subtask_
-                                      parent-hem
-                                      parent-henpt] ancestry-path
-                                     ;; parent-subtask_ (nth ancestry-path 1)
-                                     ;; parent-hem (nth ancestry-path 2)
-                                     ;; parent-henpt (nth ancestry-path 3)
+                               (let [[_ parent-subtask_ parent-hem parent-henpt] ancestry-path
                                      parent-hem-pclass (get-in parent-hem [:irks 0])
-                                     ;; st 0
-                                     ;; parent-subtask_ (get-in parent-hem [:subtasks st])
-
                                      _ (dbg-println :debug "RPC Recursing on ancestry-path"
                                          (mapv #(list (:uid %) (or (:label %) (:name %)))
                                            ancestry-path))
                                      _ (dbg-println :debug "parent-hem-pclass" parent-hem-pclass)
-                                     ;; {:error :unresolved-pclass-ctor-need-ancestry-path}
                                      pc_ (resolve-plant-class
                                            ir parent-hem-pclass pargs parent-henpt parent-subtask_)

                                      ]
-
                                  ;; (dbg-println :debug "RPC this"
                                  ;;              (with-out-str (pprint ancestry-path)))
                                  ;; (dbg-println :debug "RPC parent-hem"
@@ -332,10 +320,6 @@
                                  _ (dbg-println :debug "RPC Recursion result" pc_)
                                  pc_
                                  ))
-                             ;;In the case of this.methodname, we need to find the pclass-ctor
-                             ;; (if (and (= (:type caller_) :plant-fn-symbol)
-                             ;;          (= (:name caller_) 'this))
-                             ;;   )
                              {:error :unresolved-pclass-ctor}))

                        (= type :delay)
@@ -345,81 +329,8 @@
                        (do
                          (dbg-println :error "ERROR, not currently supported plant-fn type=" type)
                          nil))
-        _ (dbg-println :trace "RPC pclass-ctor_" pclass-ctor_)
-        ;; pclass-ctor_ (cond
-        ;;                (= pclass ::unknown) ;; matching method in pargs?
-        ;;                ;; (let [plant-fn_ (get-in ir irks)
-        ;;                ;;       param (:name plant-fn)
-        ;;                ;;       pc (first (filter #(= (:param %) param) pargs))
-        ;;                ;;       plant (:pclass pc)
-        ;;                ;;       plant-method (get-in ir [plant :methods name])]
-        ;;                ;;   (println "UNKNOWN PARAM" param ;; DEBUG
-        ;;                ;;     "PLANT" plant
-        ;;                ;;     "PLANT-METHOD" plant-method
-        ;;                ;;     "PC" pc)
-        ;;                ;;   (if (and plant-method pc)
-        ;;                ;;     pc ;; plant parameter
-        ;;                ;;     param)) ;; must be a method parameter
-        ;;                (do
-        ;;                  (println "ERROR, not currently supported" pclass)
-        ;;                  nil)
-        ;;                (keyword? pclass) ;; field
-        ;;                (let [initial (get-in ir
-        ;;                                [hem-pclass :fields
-        ;;                                 pclass :initial])
-        ;;                      {:keys[type name id plant-part interface]} initial
-        ;;                      initial-pclass (:pclass initial)]
-        ;;                  (cond
-        ;;                    (= type :arg-reference) ;; look in pargs
-        ;;                    ;; (first (filter #(= (:param %) name) pargs))
-        ;;                    (do
-        ;;                      (println "ERROR, not currently supported :arg-reference")
-        ;;                      nil)
-        ;;                    (= type :pclass-ctor)
-        ;;                    ;; initial-pclass
-        ;;                    initial
-        ;;                    :else
-        ;;                    ;; pclass
-        ;;                    (do
-        ;;                      (println "ERROR, not currently supported keyword pclass without ctor" pclass)
-        ;;                      nil)
-
-        ;;                    ))
-        ;;                (and (not (htn-isa? task-type :htn-nonprimitive-task))
-        ;;                  henpt (:pclass henpt))
-        ;;                ;; (:pclass henpt)
-        ;;                (do
-        ;;                  (println "ERROR, not currently supported henpt" pclass)
-        ;;                  nil)
-        ;;                :else
-        ;;                ;; pclass
-        ;;                (do
-        ;;                  (println "ERROR, not currently supported raw pclass" pclass)
-        ;;                  nil))
-        ;;  {:keys [argument-mappings]} hem
-        ;; _ (println "  RPC1" pclass "argument-mappings" argument-mappings)
-        ;; resolve-pclass (fn [arg]
-        ;;                  (if (and (variable? arg)
-        ;;                        (not (empty? argument-mappings)))
-        ;;                    (get argument-mappings arg arg)
-        ;;                    arg))
-        ;; pclass (resolve-pclass pclass)
-        ;; _ (println "  RPC2" pclass) ;; DEBUG
-        ;; pclass (if (variable? pclass)
-        ;;          (resolve-pclass ir hem-pclass pargs p name task-type
-        ;;            irks nil (nthrest ancestry-path 2))
-        ;;          pclass)
-        ;; primitive? (if pclass (get-in ir [pclass :names name :primitive]))
-        ;; _ (println "  RPC3" pclass "primitive?" primititive?) ;; DEBUG
-        ;; REVIEW BELOW...
-        ;; ;; if name is not primitive in p then return nil to
-        ;; ;; indicate this is NOT actually a primitive method
-        ;; p (if (and (map? p)
-        ;;         (= (:type p) :pclass-ctor)
-        ;;         (get-in ir [(:pclass p) :methods name :primitive]))
-        ;;     p)
-        ;; FIX recursive argument resolution later
         ]
+    (dbg-println :trace "RPC pclass-ctor_" pclass-ctor_)
     pclass-ctor_))

 ;; name-with-argvals multi-methods --------------------------------------
@@ -1503,12 +1414,7 @@
             pclass-ctor_ (if primitive?
                            (resolve-plant-class ir hem-pclass pargs
                                                 henpt subtask_))
-            ;; DEBUG
-            _ (dbg-println :debug "pclass-ctor_" pclass-ctor_)
-            ;; add in details for the plant for primitive tasks...
-            ;;_ (dbg-println :debug "plant-details" pargs subtask pclass-ctor_ primitive?) ;;DEBUG
             details_ (plant-details ir pargs subtask_ pclass-ctor_ primitive?)
-            ;; OLD: label (name-with-argvals subtask)
             subtask-map (merge
                          (assoc
                           (dissoc subtask_ :pclass :pargs :arguments


added disabled state for create contact button

Former-commit-id: b5ea433420517a88bb8aba43d1eab928baf0070d

--- src/status_im/contacts/views/new_contact.cljs
+++ src/status_im/contacts/views/new_contact.cljs
@@ -1,6 +1,7 @@
 (ns status-im.contacts.views.new-contact
   (:require-macros [status-im.utils.views :refer [defview]])
   (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]]
+            [clojure.string :as str]
             [status-im.components.react :refer [view
                                                 text
                                                 text-input
@@ -30,6 +31,9 @@
   [view toolbar-title-container
    [text {:style toolbar-title-text}
     (label :t/add-new-contact)]])
+
+(defn valid-form? [name address]
+  (and (not (str/blank? name)) (not (str/blank? address))))

 (defview contact-name-input [name]
   []
@@ -63,7 +67,9 @@
                                          :style  icon-back}
                                :handler  #(dispatch [:navigate-back])}
               :custom-content   toolbar-title
-              :action           {:image   {:source {:uri :icon_ok_blue}
+              :action           {:image   {:source {:uri (if (valid-form? name whisper-identity)
+                                                           :icon_ok_blue
+                                                           :icon_ok_disabled)}
                                            :style  icon-search}
                                  :handler #(dispatch [:add-new-contact new-contact])}}]
     [view st/form-container


in :verbose, print the source map JSON

in :verbose, print the source map JSON

--- src/main/cljs/cljs/js.cljs
+++ src/main/cljs/cljs/js.cljs
@@ -356,6 +356,7 @@
                        json (sm/encode {src (:source-map smd)}
                               {:lines (+ (:gen-line smd) 3)
                                :file file :sources-content [source]})]
+                   (when (:verbose opts) (debug-prn json))
                    (.append sb
                      (str "\n//# sourceURL=repl-" t ".js"
                           "\n//# sourceMappingURL=data:application/json;base64,"


run tests in runner fns do-with-dbspec and do-with-sjt

--- src/test/clj/org/bituf/fountain/test_jdbc.clj
+++ src/test/clj/org/bituf/fountain/test_jdbc.clj
@@ -55,6 +55,22 @@
   ([] (is false)))

+(defn do-with-dbspec
+  [f] {:post [(mu/not-fn? %)]
+       :pre  [(fn? f)]}
+  (let [g (sp/wrap-dbspec dbspec f)]
+    (g)))
+
+
+(defn do-with-sjt
+  "Execute f in the context of datasource and SimpleJdbcTemplate"
+  [f] {:post [(mu/not-fn? %)]
+       :pre  [(fn? f)]}
+  (let [g (sp/wrap-dbspec dbspec
+            (jd/wrap-sjt f))]
+    (g)))
+
+
 (defn query-for-int-test
   []
   (setup)
@@ -63,11 +79,11 @@
   (is (= 30 (jd/query-for-int "SELECT age FROM sample WHERE age = :age"
               {:age 30}))))

+
 (deftest test-query-for-int
   (testing "test-query-for-int"
-    ((sp/wrap-dbspec dbspec
-       (jd/wrap-sjt
-         query-for-int-test)))))
+    (do-with-sjt
+      query-for-int-test)))

 (defn query-for-long-test
@@ -81,8 +97,8 @@

 (deftest test-query-for-long
   (testing "test-query-for-long"
-    ((sp/wrap-dbspec dbspec
-       (jd/wrap-sjt query-for-long-test)))))
+    (do-with-sjt
+      query-for-long-test)))

 (defn query-for-map-test
@@ -98,8 +114,8 @@

 (deftest test-query-for-map
   (testing "test-query-for-map"
-    ((sp/wrap-dbspec dbspec
-       (jd/wrap-sjt query-for-map-test)))))
+    (do-with-sjt
+      query-for-map-test)))

 (defn query-for-list-test
@@ -116,8 +132,8 @@

 (deftest test-query-for-list
   (testing "test-query-for-list"
-    ((sp/wrap-dbspec dbspec
-       (jd/wrap-sjt query-for-list-test)))))
+    (do-with-sjt
+      query-for-list-test)))

 (defn update-test
@@ -131,8 +147,8 @@

 (deftest test-update
   (testing "test-update"
-    ((sp/wrap-dbspec dbspec
-       (jd/wrap-sjt update-test)))))
+    (do-with-sjt
+      update-test)))

 (defn batch-update-test
@@ -146,8 +162,8 @@

 (deftest test-batch-update
   (testing "test-batch-update"
-    ((sp/wrap-dbspec dbspec
-       (jd/wrap-sjt batch-update-test)))))
+    (do-with-sjt
+      batch-update-test)))

 (defn insert-test
@@ -158,8 +174,11 @@

 (deftest test-insert
   (testing "test-insert"
-    ((sp/wrap-dbspec dbspec
-       (jd/wrap-sjt insert-test)))))
+    (do-with-dbspec
+      insert-test)
+    ;((sp/wrap-dbspec dbspec
+    ;   (jd/wrap-sjt insert-test)))
+    ))

 (defn insert-give-id-test
@@ -171,8 +190,8 @@

 (deftest test-insert-give-id
   (testing "test-insert-give-id"
-    ((sp/wrap-dbspec dbspec
-       (jd/wrap-sjt insert-give-id-test)))))
+    (do-with-dbspec
+      insert-give-id-test)))

 (defn insert-give-idmap-test
@@ -189,8 +208,8 @@

 (deftest test-insert-give-idmap
   (testing "test-insert-give-idmap"
-    ((sp/wrap-dbspec dbspec
-       (jd/wrap-sjt insert-give-idmap-test)))))
+    (do-with-dbspec
+      insert-give-idmap-test)))

 (defn insert-batch-test
@@ -204,8 +223,8 @@

 (deftest test-insert-batch
   (testing "test-insert-batch"
-    ((sp/wrap-dbspec dbspec
-       (jd/wrap-sjt insert-batch-test)))))
+    (do-with-dbspec
+      insert-batch-test)))

 (defn test-ns-hook []


Fix docstring.

Fix docstring.

--- project/scrape-trs/src/scrape_trs/core.clj
+++ project/scrape-trs/src/scrape_trs/core.clj
@@ -21,7 +21,7 @@
 (defn get-trip-reports
   "
   url: url of list-page or the site it was retrieved from. Must correspond to
-       a supported url in (list-implementation-urls).
+       a supported url in (list-supported-urls).
   list-page: page (as a string) that lists trip reports

   Scrape all trip reports from the list-page, paging through pagination if


Multiline textfield

Multiline textfield

--- src/flatgui/samples/forms/textwindow.clj
+++ src/flatgui/samples/forms/textwindow.clj
@@ -10,6 +10,7 @@
   (:require [flatgui.util.matrix :as m]
             [flatgui.base :as fg]
             [flatgui.awt :as awt]
+            [flatgui.theme]
             [flatgui.widgets.window :as window]
             [flatgui.widgets.textfield :as textfield]
             [flatgui.widgets.panel :as panel]
@@ -32,14 +33,16 @@
        :children {:content-pane (fg/defcomponent
                                   scrollpanel/scrollpanelcontent
                                   :content-pane
-                                  {:evolvers {:content-size (fg/accessorfn (get-property component [:this :textfield] :clip-size))}
+                                  {:evolvers {:content-size (fg/accessorfn (get-property component [:this :textfield] :clip-size))
+                                              :viewport-matrix textfield/auto-scroll-evolver}
                                    :children {:textfield (fg/defcomponent
                                                            textfield/textfield
                                                            :textfield
                                                            {:clip-size (m/defpoint 4.875 4.375)
                                                             :position-matrix (m/translation 0 0)
                                                             :multiline true
-                                                            :auto-size true})}})}})
+                                                            :auto-size true
+                                                            :paint-border false})}})}})

     (fg/defcomponent
       textfield/textfield
@@ -51,7 +54,8 @@
   (fg/defcomponent
     panel/panel
     :main
-    {:clip-size (m/defpoint 40 20)
+    {:theme flatgui.theme/dark
+     :clip-size (m/defpoint 40 20)
      :background (awt/color 9 17 26)

      ;; TODO this should be a part defroot probably


use a syntax that the compiler is happy with

--- src-cljs/frontend/routes.cljs
+++ src-cljs/frontend/routes.cljs
@@ -41,9 +41,9 @@
   (defroute new-doc "/new" {:keys [query-params]}
     (put! nav-ch [:new {:query-params query-params}]))

-  (defroute document #"/document/(\d+)" [doc-id {:keys [query-params]}]
+  (defroute document #"/document/(\d+)" [doc-id args]
     (put! nav-ch [:document {:document/id (long doc-id)
-                             :query-params query-params}])))
+                             :query-params (:query-params args)}])))

 (defn define-routes! [state]
   (let [nav-ch (get-in @state [:comms :nav])]


fixing description of ping

fixing description of ping

--- src/main/clojure/jarvis/plugins/ping.clj
+++ src/main/clojure/jarvis/plugins/ping.clj
@@ -1,6 +1,6 @@
 (ns jarvis.plugins.flows)

-(defn ^{:description "ping - I will respond if I am available."
+(defn ^{:description "I will respond if I am available."
         :command "ping"
         :author "Jonathan Chauncey"
         :plugin true}


[scamp] make 'comment example more flexible

--- modules/scamp/test/world/main_test.clj
+++ modules/scamp/test/world/main_test.clj
@@ -220,12 +220,14 @@

 (comment
   (def mesh-size 100)
-  (spit "/tmp/mesh.dot" (str "digraph {"
-                             (apply str
-                                    (apply concat
-                                           (filter (complement nil?)
-                                                   (for [s (range mesh-size)]
-                                                     (for [d (range mesh-size)]
-                                                       (when (not= s d)
-                                                         (str s "->" d ";"))))))) "}"))
+  (let [mesh-size 100]
+    (println "dot -Tpng -O /tmp/mesh.dot")
+    (spit "/tmp/mesh.dot" (str "digraph {"
+                               (apply str
+                                      (apply concat
+                                             (filter (complement nil?)
+                                                     (for [s (range mesh-size)]
+                                                       (for [d (range mesh-size)]
+                                                         (when (not= s d)
+                                                           (str s "->" d ";"))))))) "}")))
   )


Add facts for get-spans

Add facts for get-spans

--- test/cljam/t_bam_index.clj
+++ test/cljam/t_bam_index.clj
@@ -1,4 +1,5 @@
 (ns cljam.t-bam-index
+  "Tests for cljam.bam-index."
   (:require [midje.sweet :refer :all]
             [cljam.t-common :refer :all]
             [cljam.bam-index :as bai]))
@@ -15,6 +16,16 @@
                                                                                :end number?}))}))
                                 :linear-index (has every? number?)}))))

+(let [bai* (bai/bam-index test-bai-file)]
+ (fact "get-spans returns a sequence including regions."
+   (bai/get-spans bai* 0 0 100) => seq?
+   (bai/get-spans bai* 0 0 100) => (has every? (just number? number?)))
+ (fact "get-spans returns correct regions."
+   (bai/get-spans bai* 0 0 100) => '((97 555))
+   (bai/get-spans bai* 1 0 100) => '((555 29163520))))
+
+;;; Tests for a large-size file.
+
 (with-state-changes [(before :facts (prepare-cavia!))]
   (fact "read-index is done without errors with a large file" :slow :heavy
     (bai/read-index (bai/bam-index test-large-bai-file)) => anything))


Added jayq/bootstrap datatable example

Added jayq/bootstrap datatable example

--- src/leiningen/new/fwrum/core.cljs
+++ src/leiningen/new/fwrum/core.cljs
@@ -3,29 +3,67 @@
               [cljs.reader :as reader]
               [clojure.set :refer (intersection)]
               [cljsjs.react]
-              ))
+              [jayq.core :refer ($)]
+              )
+    (:require-macros [jayq.macros :refer [ready]])
+)

 (enable-console-print!)

-;; define game state once so it doesn't re-initialise on reload
-(defonce game (atom {:title "Hello {{name}}"}))
+;;;
+;; define game state once so it doesn't re-initialise on reload.
+;; figwheel counter is a placeholder for any state affected by figwheel live reload events
+;;;
+(defonce game (atom {:title "Hello {{name}}"
+                     :__figwheel_counter 0}))

 (defn el [id] (.getElementById js/document id))
+
+;;;
+;; Sample jQuery usage:
+;;  Attach the jQuery plugin only after React has mounted the selected element and jQuery has loaded.
+;;;
+(defn home-did-mount
+  "attach DataTable plugin to the example table. Adds search, filter, sorts, and pagination."
+  [state]
+  (ready
+   (.DataTable ($ :#example)))
+  state)
+
+;; data-table mixin - adds jQuery DataTable code on jQuery ready
+(def data-table {:did-mount home-did-mount})
+
+(r/defc home < r/reactive data-table []
+  [:div.row
+    [:div.col-md-6
+     [:table#example.table.table-striped.table-bordered {:cell-spacing "0" :width "100%"}
+      [:thead
+       [:tr [:th "Name"]
+        [:th "Age"]]]
+      [:tbody
+       [:tr [:td "Matthew"]
+        [:td "26"]]
+       [:tr [:td "Anna"]
+        [:td "24"]]
+       [:tr [:td "Michelle"]
+        [:td "42"]]
+       [:tr [:td "Frank"]
+        [:td "46"]]]]]]
+   ])

 ;;
 ;; Put the app/game in here
 ;;
 (r/defc game-container < r/reactive []
   [:div#box
-   [:h1 (:title (r/react game))]])
-
+   [:h1 (:title (r/react game))]
+   (home)])

 ;;
 ;; mount main component on html game element
 ;;
 (r/mount (game-container) (el "game"))

-
 ;;
 ;; optionally do something on game reload
 ;;


CLJS-1268: cljc support for cljs.closure/compile-file

--- src/main/clojure/cljs/closure.clj
+++ src/main/clojure/cljs/closure.clj
@@ -371,9 +371,10 @@
     (if output-file
       (let [out-file (io/file (util/output-directory opts) output-file)]
         (compiled-file (comp/compile-file file out-file opts)))
-      (binding [ana/*cljs-file* (.getPath ^File file)]
-        (with-open [rdr (io/reader file)]
-          (compile-form-seq (ana/forms-seq* rdr))))))
+      (let [path (.getPath ^File file)]
+        (binding [ana/*cljs-file* path]
+          (with-open [rdr (io/reader file)]
+            (compile-form-seq (ana/forms-seq* rdr path)))))))

 (defn compile-dir
   "Recursively compile all cljs files under the given source


implementing naive (and incorrect) version of add & search for B+Tree

--- sample/src/sample/btree.clj
+++ sample/src/sample/btree.clj
@@ -10,19 +10,17 @@

 (defrecord B+Tree [b key-fn
-                   slots root? leaf?])
-
-(extend-type B+Tree
+                   slots root? leaf?]

   TreeModify

-  (add [{:keys [key-fn slots] :as this} v]
-    (assoc slots (key-fn v) v))
+  (add [this v]
+    (->B+Tree b key-fn (assoc slots (key-fn v) v) root? leaf?))

   TreeSearch

   (search [this k]
-    ))
+    (get slots k)))

 (defn b+tree [b key-fn & {:keys [root? leaf?]


Allow om-root options from a component

Allow om-root options from a component

Allow a component to contribute to the options in the om root (eg. to
passed :shared values).

--- om-root/src/com/palletops/bakery/om_root.cljs
+++ om-root/src/com/palletops/bakery/om_root.cljs
@@ -7,10 +7,10 @@
    [om.core :as om :include-macros true]
    [schema.core :as schema]))

-(defrecord OmRoot [f value options]
+(defrecord OmRoot [f value options options-component]
   Startable
   (start [_]
-    (om/root f value options))
+    (om/root f value (merge options (:value options-component))))
   Stoppable
   (stop [_]
     (om/detach-root (:target options))))
@@ -20,13 +20,18 @@
 (def OmRootOptions
   {:f OmRootFun
    :value schema/Any
-   :options {schema/Keyword schema/Any}})
+   :options {schema/Keyword schema/Any}
+   :options-component schema/Any})

 (defn-api om-root
   "Return an om-root component"
   {:sig [[OmRootOptions :- OmRoot]
-         [OmRootFun schema/Any {schema/Keyword schema/Any} :- OmRoot]]}
+         [OmRootFun schema/Any {schema/Keyword schema/Any} :- OmRoot]
+         [OmRootFun schema/Any {schema/Keyword schema/Any} schema/Any
+          :- OmRoot]]}
   ([f value options]
-     (->OmRoot f value options))
-  ([{:keys [f value options] :as args}]
-     (map->OmRoot args)))
+   (->OmRoot f value options nil))
+  ([f value options options-component]
+   (->OmRoot f value options options-component))
+  ([{:keys [f value options options-component] :as args}]
+   (map->OmRoot args)))


Add --with-meta option

Add --with-meta option

--- src/main/hbase_region_inspector/core.clj
+++ src/main/hbase_region_inspector/core.clj
@@ -17,6 +17,9 @@

 ;;; Whether we should allow region relocation or not
 (defonce read-only? (atom false))
+
+;;; Whether we should include meta region or not
+(defonce with-meta? (atom false))

 ;;; Cache the result of previous inspection
 (defonce cached (atom {:updated-at nil :regions []}))
@@ -122,9 +125,9 @@

 (defn regions-by-servers
   "Generates output for /server_regions.json. Regions grouped by their servers."
-  [regions servers metric sort tables]
+  [regions servers metric sort tables {:keys [with-meta?] :or {with-meta? false}}]
   (let [;; Exclude meta regions
-        all-regions (remove :meta? regions)
+        all-regions (if with-meta? regions (remove :meta? regions))

         ;; Sort the tables in descending order by the sum of the given metric
         all-tables (keys (sort-by
@@ -165,9 +168,9 @@

 (defn regions-by-tables
   "Generates output for /table_regions.json. Regions grouped by their tables."
-  [regions metric sort]
+  [regions metric sort {:keys [with-meta?] :or {with-meta? false}}]
   (let [;; Exclude hbase:meta table
-        all-regions (filter (complement :meta?) regions)
+        all-regions (if with-meta? regions (remove :meta? regions))
         ;; Sort the regions
         sorted-regions (if (= sort :metric)
                          (reverse (sort-by metric all-regions))
@@ -255,13 +258,15 @@
              tables (if (instance? String tables) [tables] tables)]
          (response
            (regions-by-servers (:regions @cached) (:servers @cached)
-                               (keyword metric) (keyword sort) tables))))
+                               (keyword metric) (keyword sort) tables
+                               {:with-meta? @with-meta?}))))
   (GET "/table_regions.json"
        {{:keys [sort metric]
          :or {sort "metric" metric "store-file-size-mb"}} :params}
        (response
          (regions-by-tables (:regions @cached)
-                            (keyword metric) (keyword sort))))
+                            (keyword metric) (keyword sort)
+                            {:with-meta? @with-meta?})))
   (PUT "/move_region" {{:keys [src dest region]} :params}
        (when @read-only?
          (throw (Exception. "Read-only mode. Not allowed.")))
@@ -316,13 +321,14 @@

 (defn exit [message]
   (println message)
-  (println "usage: hbase-region-inspector [--read-only] QUORUM[/ZKPORT] PORT")
+  (println "usage: hbase-region-inspector [--read-only --with-meta] QUORUM[/ZKPORT] PORT")
   (System/exit 1))

 (defn -main [& args]
   (let [[opts args] ((juxt filter remove) #(.startsWith % "-") args)
         opts (set (map #(keyword (str/replace % #"^-*" "")) opts))]
     (reset! read-only? (contains? opts :read-only))
+    (reset! with-meta? (contains? opts :with-meta))
     (when (not= 2 (count args)) (exit "invalid number of arguments"))
     (try
       (let [[zk port] args


remove old email ns

remove old email ns

--- src/polismath/email.clj
+++ src/polismath/email.clj
@@ -1,20 +0,0 @@
-(ns polismath.email
-  (:require [polismath.env :as env]
-            [clojure.tools.logging :as log]
-            [clj-http.client :as client]))
-
-(def ^:dynamic *mailgun-key* (:mailgun-api-key env/env))
-(def ^:dynamic *mailgun-url* (:mailgun-url env/env))
-
-(defn send-email!
-  ([{:keys [from to subject text html] :as params}]
-   (log/info "Sending email to:" to)
-   (log/debug "  have mailgun key?" (boolean *mailgun-key*))
-   (try
-     (client/post *mailgun-url*
-                  {:basic-auth ["api" *mailgun-key*]
-                   :query-params params})
-     (catch Exception e (.printStackTrace e))))
-  ([from to subject text html] (send-email! {:from from :to to :subject subject :text text :html html}))
-  ([from to subject text] (send-email! {:from from :to to :subject subject :text text})))
-


Another substitution

Another substitution

--- src/mickopedia/mickify.clj
+++ src/mickopedia/mickify.clj
@@ -57,6 +57,7 @@
       (s/replace "Wikipedia" "Mickopedia")
       (s/replace #"\bbroken\b" "banjaxed")
       (s/replace #"\bpunch\b" "clatter")
+      (s/replace #"\bmother\b" "mammy")
       (s/replace " a " (random-collection-choice aReps " a "))
       (s/replace " the " (random-collection-choice theReps " the "))
       (s/replace "." (random-collection-choice phrases "."))))


Rework buffer to use functional style defaults

--- src/overtone/sc/buffer.clj
+++ src/overtone/sc/buffer.clj
@@ -8,16 +8,16 @@
 ; size is in samples
 (defn buffer
   "Allocate a new buffer for storing audio data."
-  [size & [channels]]
-  (let [channels (or channels 1)
-        id (alloc-id :audio-buffer)
-        ready? (atom false)]
-    (on-done "/b_alloc" #(reset! ready? true))
-    (snd "/b_alloc" id size channels)
-    (with-meta {:id id
-                :size size
-                :ready? ready?}
-               {:type ::buffer})))
+  ([size] (buffer size 1))
+  ([size num-channels]
+     (let [id     (alloc-id :audio-buffer)
+           ready? (atom false)]
+       (on-done "/b_alloc" #(reset! ready? true))
+       (snd "/b_alloc" id size num-channels)
+       (with-meta {:id id
+                   :size size
+                   :ready? ready?}
+         {:type ::buffer}))))

 (defn buffer-ready?
   "Check whether a sample or a buffer has completed allocating and/or loading data."


Changed the default population size down to 500 so it doesn't take forever to run.

--- src/simple_symbolic_regression_clojure/core.clj
+++ src/simple_symbolic_regression_clojure/core.clj
@@ -19,13 +19,13 @@

 (def initial-sine-population
-  (score-population (random-population 5000 random-sine-guess) sine-rubrics))
+  (score-population (random-population 500 random-sine-guess) sine-rubrics))

 (defn print-generation-report
   [population]
   (println (str "Min error: "
-                (apply min (map :score population)))))
+                (apply min (map get-score population)))))

 (defn -main


Fix the session-by-webdriver-id route pattern.

--- src/shale/resources.clj
+++ src/shale/resources.clj
@@ -258,7 +258,8 @@
     (ANY ["/sessions/:id", :id #"(?:[a-zA-Z0-9]{4,}-)*[a-zA-Z0-9]{4,}"]
       [id]
       (session-resource id))
-    (ANY ["/sessions/webdriver/:webdriver-id", :id #"(?:[a-zA-Z0-9]{4,}-)*[a-zA-Z0-9]{4,}"]
+    (ANY ["/sessions/webdriver/:webdriver-id",
+          :webdriver-id #"(?:[a-zA-Z0-9]{4,}-)*[a-zA-Z0-9]{4,}"]
       [webdriver-id]
       (session-by-webdriver-id webdriver-id))
     (ANY ["/sessions/:id/refresh", :id #"(?:[a-zA-Z0-9]{4,}-)*[a-zA-Z0-9]{4,}"]


Added importer that filters lots of the other junk.

--- src/simulacrum/util.clj
+++ src/simulacrum/util.clj
@@ -1,5 +1,6 @@
 (ns simulacrum.util
   (:require [clojure.java.io :as io]
+            [clojure.data.json :as json]
             [clojure.string :as string]
             [clj-http.client :as client]
             [net.cgrand.enlive-html :as html]
@@ -90,6 +91,13 @@
   (remove-trailing-non-ascii
     (remove-spaces-and-newlines text)))

+(defn import-lite []
+  (map (fn[x] {:question (x :question)
+               :domain-key (keyword (x :domain-key))
+               :facet-key (keyword (x :facet-id))
+               :reversed? (:x :reversed?)})
+       (json/read-str
+         (slurp "target/json/ipip-newo-pi-r.json")
+         :key-fn keyword)))

-


preds of take grab carry

preds of take grab carry

--- src/babel/english/lexicon.clj
+++ src/babel/english/lexicon.clj
@@ -1133,10 +1133,15 @@
    "support" {:synsem {:cat :verb
                        :sem {:pred :support}}}

-   "take"  {:synsem {:cat :verb
-                     :sem {:pred :take}}
-            :english {:past "took"
-                      :past-participle "taken"}}
+   "take" (let [common {:synsem {:cat :verb}
+                        :english {:past "took"
+                                  :past-participle "taken"}}]
+            [{:synsem {:sem {:pred :carry}}
+              :english {:note "carry"}}
+
+             {:synsem {:sem {:pred :grab}}
+              :english {:note "grab"}}])
+

    "take advantage of" {:english {:past "took advantage of"
                                   :participle "taking advantage of"


use the threading macro to make the code clearer

--- src/build_monitor_clj/app.clj
+++ src/build_monitor_clj/app.clj
@@ -10,14 +10,18 @@
             [compojure.core :refer :all])
   (:gen-class))

+(defn- as-response [body]
+  {:content-type "application/json"
+   :body         (generate-string body)})
+
 (defroutes main-routes
            (GET "/" [] (clojure.java.io/resource "public/index.html"))
-           (GET "/all" [] {:content-type "application/json"
-                           :body         (generate-string (reducer/aggregate
-                                                            (parser/get-projects (cctray-url))))})
-           (GET "/interesting" [] {:content-type "application/json"
-                                   :body         (generate-string (reducer/show-selected-projects
-                                                                    (parser/get-interesting-projects (cctray-url))))})
+           (GET "/all" [] (-> (parser/get-projects (cctray-url))
+                              (reducer/aggregate)
+                              (as-response)))
+           (GET "/interesting" [] (-> (parser/get-interesting-projects (cctray-url))
+                                      (reducer/show-selected-projects)
+                                      (as-response)))
            (route/resources "/"))

 (def app


Change a POST request to return json

Change a POST request to return json

--- src/clj/decktouch/handler.clj
+++ src/clj/decktouch/handler.clj
@@ -19,7 +19,8 @@
          (mtg-card-master/get-cards-matching-query query)))
   (POST "/data/card" request
         (let [card-name ((request :params) "card-name")]
-          (str (mtg-card-master/get-card-info card-name))))
+          (json/write-str
+            (mtg-card-master/get-card-info card-name))))
   (resources "/")
   (not-found "Not Found"))


fires now successfully aggregate into months.


fix Isabel McGuire, Rex Campaign :msg, Worlds Plaza bug

--- src/clj/game/cards-assets.clj
+++ src/clj/game/cards-assets.clj
@@ -231,8 +231,10 @@
     :abilities [{:msg "do 1 net damage" :effect (effect (damage :net 1 {:card card}))}]}

    "Isabel McGuire"
-   {:abilities [{:label "Add an installed card to HQ" :choices {:req #(= (first (:zone %)) :servers)}
-                 :msg (msg "move " (:title target) " to HQ") :effect (effect (move target :hand))}]}
+   {:abilities [{:cost [:click 1] :label "Add an installed card to HQ"
+                 :choices {:req #(= (first (:zone %)) :servers)}
+                 :msg (msg "move " (if (:rezzed target) (:title target) "a card") " to HQ")
+                 :effect (effect (move target :hand))}]}

    "IT Department"
    {:abilities [{:counter-cost 1 :label "Add strength to a rezzed ICE"
@@ -423,11 +425,13 @@
                              (resolve-ability state side
                                               {:prompt "Remove 1 bad publicity or gain 5 [Credits]?"
                                                :choices ["Remove 1 bad publicity" "Gain 5 [Credits]"]
-                                               :msg (msg (.toLowerCase target))
+                                               :msg (msg (if (= target "Remove 1 bad publicity")
+                                                           "remove 1 bad publicity" "gain 5 [Credits]"))
                                                :effect (req (if (= target "Remove 1 bad publicity")
                                                               (lose state side :bad-publicity 1)
                                                               (gain state side :credit 5)))}
                                               card targets)))}}}
+
    "Ronald Five"
    {:events {:runner-trash {:req (req (and (= (:side target) "Corp") (> (:click runner) 0)))
                             :msg "force the runner to lose 1 [Click]" :effect (effect (lose :runner :click 1))}}}
@@ -486,7 +490,7 @@
                                                         :effect (effect (trash-cards targets))) shat nil)))}}}}

    "Shi.Kyū"
-   {:access
+   {:access
     {:optional {:req (req (not= (first (:zone card)) :deck))
                 :prompt "Pay [Credits] to use Shi.Kyū?"
                 :yes-ability {:prompt "How many [Credits] for Shi.Kyū?" :choices :credit
@@ -498,7 +502,7 @@
                                 :effect (let [dmg target]
                                           (req (if (= target "Add Shi.Kyū to score area")
                                                  (do (or (move state :runner (assoc card :agendapoints -1) :scored) ; if the runner did not trash the card on access, then this will work
-                                                         (move state :runner (assoc card :agendapoints -1 :zone [:discard]) :scored)) ;if the runner did trash it, then this will work
+                                                         (move state :runner (assoc card :agendapoints -1 :zone [:discard]) :scored)) ;if the runner did trash it, then this will work
                                                    (gain-agenda-point state :runner -1)
                                                    (system-msg state side
                                                     (str "adds Shi.Kyū to their score area as -1 agenda point")))
@@ -618,4 +622,4 @@
                               (host state side card target)
                               (rez-cost-bonus state side -2) (rez state side (last (:hosted (get-card state card))))
                               (when (:rezzed (last (:hosted (get-card state card))))
-                                (update! state side (dissoc (get-card state (last (:hosted card)) :facedown)))))}]}})
+                                (update! state side (dissoc (get-card state (last (:hosted card))) :facedown))))}]}})


Style tab-content

Style tab-content

--- src/clj/gtfve/styles/core.clj
+++ src/clj/gtfve/styles/core.clj
@@ -30,7 +30,10 @@
                    :border-radius 0
                    :border :none
                    :box-shadow :none}]
-   [:.tab-content
+   [:.nav.nav-tabs
+    [:+
+     [:.tab-content {:height "calc(100% - 43px)"}]]]
+   [:.tab-content {:overflow :auto}
     [:>
      [:.tab-wrapper {:position :relative
                      :height (percent 100)


WebSocket send.

WebSocket send.

--- src/clj/http/async/client.clj
+++ src/clj/http/async/client.clj
@@ -17,7 +17,7 @@
 (ns http.async.client
   "Asynchronous HTTP Client - Clojure"
   {:author "Hubert Iwaniuk"}
-  (:refer-clojure :exclude [await])
+  (:refer-clojure :exclude [await send])
   (:use [http.async.client request headers util])
   (:import (java.io ByteArrayOutputStream)
            (java.util.concurrent LinkedBlockingQueue)
@@ -302,63 +302,82 @@
       (-sendText ws text)
       (-sendByte ws byte))))

+(defn ws-lifecycle-listener
+  "Registers WebSocketListener to handle lifecycle of WebSocket.
+
+   Stores active socket in atom."
+  [ws openf closef errorf]
+  (reify
+    WebSocketCloseCodeReasonListener
+    (onClose [_ ws code reason]
+      (when closef (closef ws code reason))
+      (reset! ws nil))
+
+    WebSocketListener
+    (^{:tag void} onOpen [_ #^WebSocket soc]
+     (reset! ws soc)
+     (when openf (openf soc)))
+    (^{:tag void} onClose [_ #^WebSocket soc])
+    (^{:tag void} onError [_ #^Throwable t]
+     (reset! ws nil)
+     (when errorf (errorf @ws t)))))
+
+(defn create-ws-close-listener
+  "Creates WebSocket close listener."
+  [f]
+  (reify
+    WebSocketCloseCodeReasonListener
+    (onClose [_ ws code reason]
+      (println "closing")
+      (f ws code reason))
+
+    WebSocketListener
+    (^{:tag void} onOpen [_ #^WebSocket _])
+    (^{:tag void} onClose [_ #^WebSocket _]
+     (println "closing2"))
+    (^{:tag void} onError [_ #^Throwable _])))
+
 (defn create-ws-text-listener
   "Creates WebSocket text listener."
-  [cb]
+  [soc f]
   (reify
     WebSocketTextListener
     (^{:tag void} onMessage [_ #^String s]
-      (println "ws msg:" s)
-      (cb s))
-    (^{:tag void} onFragment [_ #^String s #^boolean last]
-      (println "ws frag:" s ", last:" last))
+     (f @soc s))
+    (^{:tag void} onFragment [_ #^String s #^boolean last])

     WebSocketListener
-    (^{:tag void} onOpen [_ #^WebSocket ws]
-      (println "ws open:" ws))
-    (^{:tag void} onClose [_ #^WebSocket ws]
-      (println "ws close:" ws))
-    (^{:tag void} onError [_ #^Throwable t]
-      (println "ws error:" t))
-
-
-    WebSocketCloseCodeReasonListener
-    (onClose [_ ws code reason]
-      (println "ws close:" ws ", code:" code ", reason:" reason))
-    ))
+    (^{:tag void} onOpen [_ #^WebSocket _])
+    (^{:tag void} onClose [_ #^WebSocket _])
+    (^{:tag void} onError [_ #^Throwable _])))

 (defn create-ws-byte-listener
   "Creates WebSocket binary listner."
-  [cb]
+  [soc f]
   (reify
     WebSocketByteListener
     (^{:tag void} onMessage [_ #^bytes b]
-      (println "ws msg:" (alength b))
-      (cb b))
-    (^{:tag void} onFragment [_ #^bytes b #^boolean last]
-      (println "ws frag:" (alength b) ", last:" last))
+     (f @soc b))
+    (^{:tag void} onFragment [_ #^bytes b #^boolean last])

     WebSocketListener
-    (^{:tag void} onOpen [_ #^WebSocket ws]
-      (println "ws open:" ws))
-    (^{:tag void} onClose [_ #^WebSocket ws]
-      (println "ws close:" ws))
-    (^{:tag void} onError [_ #^Throwable t]
-      (println "ws error:" t))
-
-
-    WebSocketCloseCodeReasonListener
-    (onClose [_ ws code reason]
-      (println "ws close:" ws ", code:" code ", reason:" reason))
-    ))
+    (^{:tag void} onOpen [_ #^WebSocket _])
+    (^{:tag void} onClose [_ #^WebSocket _])
+    (^{:tag void} onError [_ #^Throwable _])))

 (defn websocket
   "Opens WebSocket connection."
   {:tag WebSocket}
-  [client #^String url & {text-cb :text byte-cb :byte}]
-  (let [b (WebSocketUpgradeHandler$Builder.)]
-    (when text-cb (.addWebSocketListener b (create-ws-text-listener text-cb)))
-    (when byte-cb (.addWebSocketListener b (create-ws-byte-listener byte-cb)))
+  [client #^String url & {text-cb  :text
+                          byte-cb  :byte
+                          open-cb  :open
+                          close-cb :close
+                          error-cb :error}]
+  (let [b (WebSocketUpgradeHandler$Builder.)
+        ws (atom nil)]
+    (.addWebSocketListener b (ws-lifecycle-listener ws open-cb close-cb error-cb))
+    (when text-cb (.addWebSocketListener b (create-ws-text-listener ws text-cb)))
+    (when byte-cb (.addWebSocketListener b (create-ws-byte-listener ws byte-cb)))
     (.get (.executeRequest client (prepare-request :get url) (.build b)))))

 ;; closing


Format

Format

--- src/cljs/koeeoadi/config.cljs
+++ src/cljs/koeeoadi/config.cljs
@@ -24,19 +24,19 @@
    {:color/id 9 :color/hex "#93a1a1"}])

 (def faces-list
-  [{:face/id 0 :face/name "background"                  :face/color-fg {:color/id 8  :color/hex  "#073642"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 1 :face/name "default"                     :face/color-fg {:color/id 9  :color/hex  "#93a1a1"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 2 :face/name "builtin"                     :face/color-fg {:color/id 0  :color/hex  "#6c71c4"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 3 :face/name "comment"                     :face/color-fg {:color/id 1  :color/hex  "#586e75"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 4 :face/name "comment-delimiter"           :face/color-fg {:color/id 1  :color/hex  "#586e75"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 5 :face/name "constant"                    :face/color-fg {:color/id 2  :color/hex  "#268bd2"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 6 :face/name "doc"                         :face/color-fg {:color/id 3  :color/hex  "#d33682"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 7 :face/name "function-name"               :face/color-fg {:color/id 4  :color/hex  "#b58900"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 8 :face/name "keyword"                     :face/color-fg {:color/id 5  :color/hex  "#859900"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 9 :face/name "preprocessor"                :face/color-fg {:color/id 3  :color/hex  "#d33682"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 10 :face/name "string"                     :face/color-fg {:color/id 0  :color/hex  "#6c71c4"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 11 :face/name "type"                       :face/color-fg {:color/id 2  :color/hex  "#268bd2"} :face/underline nil :face/bold nil :face/italic nil}
-   {:face/id 12 :face/name "variable-name"              :face/color-fg {:color/id 0  :color/hex  "#6c71c4"} :face/underline nil :face/bold nil :face/italic nil}])
+  [{:face/id 0  :face/name "background"        :face/color-fg {:color/id 8 :color/hex "#073642"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 1  :face/name "default"           :face/color-fg {:color/id 9 :color/hex "#93a1a1"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 2  :face/name "builtin"           :face/color-fg {:color/id 0 :color/hex "#6c71c4"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 3  :face/name "comment"           :face/color-fg {:color/id 1 :color/hex "#586e75"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 4  :face/name "comment-delimiter" :face/color-fg {:color/id 1 :color/hex "#586e75"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 5  :face/name "constant"          :face/color-fg {:color/id 2 :color/hex "#268bd2"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 6  :face/name "doc"               :face/color-fg {:color/id 3 :color/hex "#d33682"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 7  :face/name "function-name"     :face/color-fg {:color/id 4 :color/hex "#b58900"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 8  :face/name "keyword"           :face/color-fg {:color/id 5 :color/hex "#859900"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 9  :face/name "preprocessor"      :face/color-fg {:color/id 3 :color/hex "#d33682"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 10 :face/name "string"            :face/color-fg {:color/id 0 :color/hex "#6c71c4"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 11 :face/name "type"              :face/color-fg {:color/id 2 :color/hex "#268bd2"} :face/underline nil :face/bold nil :face/italic nil}
+   {:face/id 12 :face/name "variable-name"     :face/color-fg {:color/id 0 :color/hex "#6c71c4"} :face/underline nil :face/bold nil :face/italic nil}])

 (def initial-code "c")


fix button colors, fix number format

fix button colors, fix number format

--- src/cljs/takarabako/core.cljs
+++ src/cljs/takarabako/core.cljs
@@ -178,7 +178,7 @@
                              (js/isNaN input-value))]
       [:button
        {:className (str "big-button " (when (not input-not-valid?)
-                                        (if input-type-toggle "add-income-button" "add-expense-button")) )
+                                        (if input-type-toggle "add-expense-button" "add-income-button")) )
         :disabled input-not-valid?
         :on-click (fn [e]
                     (let [new-tx {:description input-description
@@ -265,9 +265,9 @@
            [:h3 "Overview"]
            [:table
             [:tbody
-             [:tr [:td.balance-key "Balance"] [:td.value (:sum balance)]]
+             [:tr [:td.balance-key "Balance"] [:td.value (.toFixed (:sum balance) 2)]]
              [:tr [:td.balance-key "Transactions"] [:td.value (:count balance)]]
-             [:tr [:td.balance-key "Mean"] [:td.value (:mean balance)]]]]]]
+             [:tr [:td.balance-key "Mean"] [:td.value (.toFixed (:mean balance) 2)]]]]]]
          [:div.base-widget
           [:div.widget.chart-widget
            [:h3 "Daily"]


[ISSUE-20]: fix compiler warning in utils.clj

--- src/clojure/duratom/utils.clj
+++ src/clojure/duratom/utils.clj
@@ -1,4 +1,5 @@
 (ns duratom.utils
+  (:refer-clojure :exclude [identity])
   (:require [clojure.java.io :as jio]
             [clojure.edn :as edn]
             [duratom.readers :as readers])


Allow `pg/input` to handle a vector of `:input` nodes.

--- src/clojure/parkour/graph.clj
+++ src/clojure/parkour/graph.clj
@@ -5,9 +5,9 @@
             [clojure.core.reducers :as r]
             [clojure.tools.logging :as log]
             [parkour (conf :as conf) (fs :as fs) (cstep :as cstep)
-                     (wrapper :as w) (mapreduce :as mr) (reducers :as pr)]
+             ,        (wrapper :as w) (mapreduce :as mr) (reducers :as pr)]
             [parkour.io (dseq :as dseq) (dsink :as dsink)
-                        (mux :as mux) (dux :as dux)]
+             ,          (mux :as mux) (dux :as dux)]
             [parkour.util.shutdown :as shutdown]
             [parkour.util :refer
              [ignore-errors returning doto-let prev-reset!]])
@@ -93,16 +93,18 @@
     [] (swap! id inc)))

 (defn input
-  "Return a fresh `:input`-stage job graph node consuming from the provided
-`dseq`.  If instead provided a `:input`-stage node, will return it."
-  [dseq]
-  (if (identical? :input (:stage dseq))
-    dseq
-    {:stage :input,
-     :input-id (gen-id),
-     :config [(dseq/dseq dseq)],
-     :requires [],
-     }))
+  "Return a fresh `:input`-stage job graph node consuming from the provided dseq
+`node`.  If instead provided an `:input`-stage node or vector of such nodes,
+acts as the identity function."
+  [node]
+  (let [input? #(identical? :input (:stage %))]
+    (if (or (input? node) (and (vector? node) (every? input? node)))
+      node
+      {:stage :input,
+       :input-id (gen-id),
+       :config [(dseq/dseq node)],
+       :requires [],
+       })))

 (def
   ^{:deprecated true, :arglists '([dseq])}