adding todo comment...

adding todo comment...

--- src/clojure/my/company/superapp/main.clj
+++ src/clojure/my/company/superapp/main.clj
@@ -31,6 +31,7 @@
              (res/get-string R$string/your_input_fmt input))
            :long)))

+
 (defn init-httpd
   [bind-address port]
   (let [httpd (proxy [NanoHTTPD] [bind-address port]
@@ -59,10 +60,8 @@
     )
   )

-(def wsd-sessions (atom {}))
-
 (defn init-wsd
-  [bind-address port]
+  [bind-address port wsd-sessions]
   (let [wsd (proxy [NanoWSD] [bind-address port]
               (openWebSocket
                 [handshake]
@@ -70,6 +69,7 @@
                 (let [web-socket (proxy [NanoWSD$WebSocket] [handshake]
                                    (onOpen []
                                      (log/i "onOpen")
+                                     ;; TODO - need to check how to get session-id
                                      (swap! wsd-sessions :sessiond handshake))
                                    (onClose [code, reason, initiated-by-remote]
                                      (log/i "onClose"))
@@ -88,9 +88,58 @@
     )
 )

-;;Define httpd and wsg instances as a global variables
-(def httpd (init-httpd "0.0.0.0" 5557))
-(def wsd (init-wsd "0.0.0.0" 5558))
+;; --API-- ;;
+(defprotocol I-HTTPD-WSD
+  "HTTPD and WSD APIs"
+  (init-servers
+    [this])
+  (start-servers
+    [this])
+)
+
+(defrecord HTTPD-WSD
+    ;; :httpd-port     PORT number that will be use for HTTPD server
+    ;; :wsd-port       PORT number that will be use for WSD server
+    ;; :bind-address   IP address for binding both HTTPD and WSD servers
+    ;; :httpd          Reference to httpd instance
+    ;; :wsd            Reference to wsd instance
+    ;; :wsd-sessions   MAP wsc to rooms for easy broadcasing
+
+  [httpd-port wsd-port bind-address httpd wsd wsd-sessions]
+  I-HTTPD-WSD
+
+  (start-servers
+      [this]
+
+    (log/i (str "starting HTTPD server: " bind-address ":" httpd-port))
+    (.start httpd)
+    (log/i (str "starting WSD server: " bind-address ":" wsd-port))
+    (.start wsd -1)
+    )
+)
+
+(defn new-httpd-wsd
+ "Constractor for HTTPD-WSD
+  :httpd-port     PORT number that will be use for HTTPD server
+  :wsd-port       PORT number that will be use for WSD server
+  :bind-address   IP address for binding both HTTPD and WSD servers"
+
+ [httpd-port wsd-port bind-address]
+
+ (let [wsd-sessions (atom {})]
+
+   (map->HTTPD-WSD{:httpd-port httpd-port
+                                 :wsd-port wsd-port
+                                 :bind-address bind-address
+                                 :wsd-sessions wsd-sessions
+                                 :httpd (init-httpd bind-address httpd-port)
+                                 :wsd (init-wsd bind-address wsd-port wsd-sessions)
+                                 })
+   )
+)
+
+;; Create HTTPD-WSD instance
+(def httpd-wsd (new-httpd-wsd (int 5557) (int 5558) "0.0.0.0"))

 ;; This is how an Activity is defined. We create one and specify its onCreate
 ;; method. Inside we create a user interface that consists of an edit and a
@@ -100,12 +149,9 @@

   (onCreate [this bundle]
     (.superOnCreate this bundle)
-    (toast "starting HTTPD server..." :long)
-    (log/i "staring httpd server")
-    (.start httpd)
-    (log/i "starting wsd server")
-    ;; starting wsd server with with a negative SOCKET_READ_TIMEOUT that will set no timeout
-    (.start wsd -1)
+    ;; starting servers
+    (toast "starting HTTPD-WSD servers" :long)
+    (start-servers httpd-wsd)
     (neko.debug/keep-screen-on this)
     (on-ui
       (set-content-view! (*a)


Account for parent2 as well in random-screen genetic criteria.

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -99,10 +99,12 @@
      (case (:criterion random-screen)
        ;
        :genetic-similarity-to-parent
-       (sequence-similarity genome (:genome parent1))
+       (max (sequence-similarity genome (:genome parent1))
+            (sequence-similarity genome (:genome parent2)))
        ;
        :genetic-difference-from-parent
-       (- 1 (sequence-similarity genome (:genome parent1)))
+       (- 1 (max (sequence-similarity genome (:genome parent1))
+                 (sequence-similarity genome (:genome parent2))))
        ;
        :reproductive-similarity-to-parent
        (if (:dummy parent1)


Allow gene-selection to take multiple rates

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -821,12 +821,13 @@
   "Takes each gene from a selected parent, with re-selection for each gene with probability
   gene-selection-rate."
   [initial-parent {:keys [gene-selection-rate population maintain-ancestors] :as argmap}]
-  (let [new-genome (loop [parent-genome (:genome initial-parent)
+  (let [rate (random-element-or-identity-if-not-a-collection gene-selection-rate)
+        new-genome (loop [parent-genome (:genome initial-parent)
                           index 0
                           child-genome []]
                      (if (> (inc index) (count parent-genome))
                        child-genome
-                       (recur (if (>= gene-selection-rate (lrand))
+                       (recur (if (>= rate (lrand))
                                 (:genome (select population argmap))
                                 parent-genome)
                               (inc index)


hint mesh fn

hint mesh fn

--- mesh.clj
+++ mesh.clj
@@ -4,10 +4,10 @@

 (defn gobj? [x] (instance? UnityEngine.GameObject x))

-(defn vertices [gob]
+(defn vertices [^UnityEngine.GameObject gob]
   (.vertices (.mesh (.GetComponent gob UnityEngine.MeshFilter))))

-(defn vertices! [gob ar]
+(defn vertices! [^UnityEngine.GameObject gob ^UnityEngine.Vector3|[]| ar]
   (set! (.vertices (.mesh (.GetComponent gob UnityEngine.MeshFilter))) ar))

 (defn vertex-color! [gob col]


Create editor pane with nightcode function

--- desktop/src/clojure/nightmod/core/desktop_launcher.clj
+++ desktop/src/clojure/nightmod/core/desktop_launcher.clj
@@ -32,7 +32,7 @@
 (defn create-layered-pane
   "Returns the pane with the editors."
   []
-  (let [pane (s/card-panel :id :editor-pane :items [["" :default-card]])]
+  (let [pane (core/create-editor-pane)]
     (doto (JLayeredPane.)
       (.setPreferredSize (Dimension. editor-width window-height))
       (.addComponentListener (proxy [ComponentAdapter] []


cleanup after execution

cleanup after execution

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -265,11 +265,12 @@
     (while (:pause @state) (Thread/sleep 5))
     (event-fn)))

-(defn stop-acq []
-  (swap! state assoc :stop true))
-
-(defn pause-acq []
-  (swap! state assoc :pause true))
+(defn cleanup []
+  (.update (:display @state))
+  (swap! state assoc :running false)
+  (when (core isSequenceRunning)
+    (core stopSequenceAcquisition))
+  (core setAutoShutter (@state :init-auto-shutter)))

 (defn run-acquisition [this settings out-queue]
   (def acq-settings settings)
@@ -288,9 +289,7 @@
 			 (def acq-sequence acq-seq)
 			 (def last-state state)
 			 (execute (mapcat #(make-event-fns % out-queue) acq-seq))
-			 (.update (:display @state))
-			 (swap! state assoc :running false)
-			 (core setAutoShutter (@state :init-auto-shutter)))))
+			 (cleanup))))

 (defn convert-settings [^SequenceSettings settings]
   (-> settings


rudimentary multi-channel snapping mda

rudimentary multi-channel snapping mda

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -303,16 +303,24 @@
     (Thread/sleep 5)))

 (defn collect-snap-image [event out-queue]
-  (let [image
-         {:pix (core getImage)
-          :tags nil}]
-    (do (log "collect-snap-image: "
+  (log "collect-snap-image")
+  (let [num-camera-channels (core getNumberOfCameraChannels)]
+    (doall
+      (for [camera-channel (range num-camera-channels)]
+        (let [image
+              {:pix (core getImage camera-channel)
+               :tags nil}]
+          (log "collect-snap-image: "
                (select-keys event [:position-index :frame-index
                                    :slice-index :channel-index]))
-      (when out-queue
-          (.put out-queue
-                (make-TaggedImage (annotate-image image event @state (elapsed-time @state))))))
-    image))
+          (log camera-channel)
+          (let [super-channel-index (+ camera-channel (* num-camera-channels (event :channel-index)))
+                event1 (assoc event :channel-index super-channel-index)]
+            (log "super-channel-index:" super-channel-index)
+            (when out-queue
+              (.put out-queue
+                    (make-TaggedImage (annotate-image image event1 @state (elapsed-time @state))))))
+          image)))))

 (defn return-config []
   (dorun (map set-property
@@ -544,14 +552,16 @@

 (defn make-summary-metadata [settings]
   (let [depth (int (core getBytesPerPixel))
-        channels (settings :channels)]
+        channels (settings :channels)
+        num-camera-channels (core getNumberOfCameraChannels)
+        super-channels (flatten (for [channel channels] (repeat num-camera-channels channel)))]
      (JSONObject. {
       "BitDepth" (core getImageBitDepth)
-      "Channels" (count (settings :channels))
-      "ChNames" (JSONArray. (map :name channels))
-      "ChColors" (JSONArray. (map #(.getRGB (:color %)) channels))
-      "ChContrastMax" (JSONArray. (repeat (count channels) Integer/MIN_VALUE))
-      "ChContrastMin" (JSONArray. (repeat (count channels) Integer/MAX_VALUE))
+      "Channels" (count super-channels)
+      "ChNames" (JSONArray. (map :name super-channels))
+      "ChColors" (JSONArray. (map #(.getRGB (:color %)) super-channels))
+      "ChContrastMax" (JSONArray. (repeat (count super-channels) Integer/MIN_VALUE))
+      "ChContrastMin" (JSONArray. (repeat (count super-channels) Integer/MAX_VALUE))
       "Comment" (settings :comment)
       "ComputerName" (.. InetAddress getLocalHost getHostName)
       "Depth" (core getBytesPerPixel)


remove debugging statements

remove debugging statements

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -524,7 +524,6 @@
         z (get-z-stage-position default-z-drive)
         xy (get-xy-stage-position default-xy-stage)
         exposure (core getExposure)]
-    (println "shutter-open prepare-state" (core getShutterOpen))
     (swap! (.state this) assoc
              :pause false
              :stop false
@@ -556,7 +555,6 @@
   (try
     (attempt-all
       (log "cleanup")
-      (println "cleanup")
       ; (do-when #(.update %) (:display @state))
       (state-assoc! :finished true :display nil)
       (when (core isSequenceRunning)
@@ -566,7 +564,6 @@
       (core setAutoShutter (@state :init-auto-shutter))
       (set-exposure (core getCameraDevice) (@state :init-exposure))
       (set-stage-position (@state :default-z-drive) (@state :init-z-position))
-      (println "blah" (@state :init-shutter-state))
       (set-shutter-open (@state :init-shutter-state))
       (when (and (@state :init-continuous-focus)
                  (not (core isContinuousFocusEnabled)))


removing the lowercase text since it was not being used

--- src/clj/baconator/server/handler.clj
+++ src/clj/baconator/server/handler.clj
@@ -28,8 +28,7 @@
 (def ^:dynamic *callback*
   (AsyncStreamingCallback.
    (fn [_resp payload]
-      (let [tweet (parse-string (str payload) true)
-            lower (.toLowerCase (:text tweet))]
+      (let [tweet (parse-string (str payload) true)]
         (when (:coordinates tweet)
           (let [coordinates (:coordinates (:coordinates tweet))
                 user (:screen_name (:user tweet))]


Rename omnisearch symbol to opensearch

Rename omnisearch symbol to opensearch

--- src/clj/clojuredocs/pages/common.clj
+++ src/clj/clojuredocs/pages/common.clj
@@ -126,7 +126,7 @@
           :href (str "/css/font-awesome.min.css?"
                      (md5-path "resources/public/css/font-awesome.min.css"))}])

-(def omnisearch-link
+(def opensearch-link
   [:link {:rel "search"
           :href "/opensearch.xml"
           :type "application/opensearchdescription+xml"
@@ -148,7 +148,7 @@
     [:meta {:name "apple-mobile-web-app-title" :content "ClojureDocs"}]
     [:meta {:name "google-site-verification" :content "XjzqkjEPtcgtLjhnqAvtnVSeveEccs-O_unFGGlbk4g"}]
     [:title (or title "Community-Powered Clojure Documentation and Examples | ClojureDocs")]
-    omnisearch-link
+    opensearch-link
     font-awesome-link
     bootstrap-link
     app-link


`timetable-day-get-nr-rows` - indent params on new line

That is the convention we are following

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -449,7 +449,8 @@
   (count (timetable-get-day day)))

 ; Argument is a Timetable row returned by the `tiemtable-get-day-row` function
-(defmethod timetable-day-get-nr-rows false [ttDay]
+(defmethod timetable-day-get-nr-rows false
+  [ttDay]
   (count ttDay))

 (def ^{:doc     "HTML string for the <td> elements in a <tr> on the Timetable


Set url hash to canonical representation on program initialization

So that the url hash looks more organized.

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -2,6 +2,7 @@
   cljs-nusmods.timetable
   (:use [jayq.core :only [$ attr children hide is prevent show text width]])
   (:require [clojure.set]
+            [clojure.string]
             [cljs-nusmods.select2 :as select2]
             [cljs-nusmods.time    :as time-helper]))

@@ -340,6 +341,22 @@
     (= lessonTypeShortForm "T2")  "TUTORIAL TYPE 2"
     (= lessonTypeShortForm "T3")  "TUTORIAL TYPE 3"))

+(def ^{:doc     "Converts a long form lesson type string to its short form"
+       :private true}
+  Lesson-Type-Long-To-Short-Form
+  {"DESIGN LECTURE"             "DL",
+   "LECTURE"                    "L",
+   "LABORATORY"                 "LAB",
+   "PACKAGED LECTURE"           "PL",
+   "PACKAGED TUTORIAL"          "PT",
+   "RECITATION"                 "R",
+   "SEMINAR-STYLE MODULE CLASS" "SEM",
+   "SECTIONAL TEACHING"         "ST",
+   "TUTORIAL"                   "T",
+   "TUTORIAL TYPE 2"            "T2",
+   "TUTORIAL TYPE 3"            "T3"
+   })
+
 (defn- get-module-info-from-url-hash-module-info
   "Computes the final module info sequence for modules added via the url hash
    on page initialization.
@@ -420,6 +437,30 @@
                          :lessonGroup lessonGroup}))
                     (keys lessonTypesMap))))
            moduleCodesSeq))))
+
+(defn- set-document-location-hash
+  "Sets document.location.hash to a canonical representation.
+
+   NOTE: This function should only be called by the
+         `add-module-lesson-groups-from-url-hash` function"
+  [moduleInfoSeq]
+  (let [sortedModInfo (sort (fn [modInfoA modInfoB]
+                              (let [moduleCodeA (:moduleCode modInfoA)
+                                    moduleCodeB (:moduleCode modInfoB)]
+                                (if (not= moduleCodeA moduleCodeB)
+                                    (< moduleCodeA moduleCodeB)
+                                    (< (:lessonType modInfoA)
+                                       (:lessonType modInfoB)))))
+                            moduleInfoSeq)]
+    (aset (aget js/document "location") "hash"
+          (clojure.string/join "&"
+            (map (fn [modInfo]
+                   (str (:moduleCode modInfo)
+                        "_"
+                        (Lesson-Type-Long-To-Short-Form (:lessonType modInfo))
+                        "="
+                        (:lessonGroup modInfo)))
+                 sortedModInfo)))))

 (defn add-module-lesson-groups-from-url-hash
   "Adds the module lesson groups available in the url hash. Erroneous lesson
@@ -486,7 +527,10 @@
         (add-module-lesson-group moduleCode
                                  (:lessonType modInfo)
                                  (:lessonGroup modInfo)
-                                 bgColorCssClass)))))
+                                 bgColorCssClass)))
+
+    ; Update url hash
+    (set-document-location-hash moduleInfoFinal)))

 (defn remove-module
   "Removes a module from the timetable.


Put together a first pass at the subscriptions network for the reader

--- src/cljs/comic_reader/ui/reader.cljs
+++ src/cljs/comic_reader/ui/reader.cljs
@@ -1,6 +1,7 @@
 (ns comic-reader.ui.reader
   (:require [re-frame.core :as re-frame]
-            [comic-reader.ui.image :as image]))
+            [comic-reader.ui.image :as image]
+            [comic-reader.api :as api]))

 (defn partitioned-images [images current-location]
   (if (seq images)
@@ -34,6 +35,19 @@
      (assoc app-db :current-location current-location)))

   (re-frame/reg-sub
+   :buffer-size
+   (fn [app-db _]
+     (:buffer-size app-db)))
+
+  (re-frame/reg-event-db
+   :set-buffer-size
+   (fn [app-db [_ n]]
+     (assoc app-db :buffer-size n)))
+
+
+  ;; Level two subscription
+
+  (re-frame/reg-sub
    :partitioned-images
    :<- [:images]
    :<- [:current-location]
@@ -41,28 +55,76 @@
      (partitioned-images images current-location)))

   (re-frame/reg-sub
-   :preceding-images-count
-   :<- [:partitioned-images]
-   (fn [[preceding _ _] _]
-     (count preceding)))
+   :comic-coordinates
+   :<- [:site-id]
+   :<- [:comic-id]
+   (fn [[site-id comic-id] _]
+     {:site-id site-id
+      :comic-id comic-id}))

   (re-frame/reg-sub
-   :following-images-count
+   :first-image-location
+   :<- [:images]
+   (fn [[images] _]
+     (:image/location (first images))))
+
+  (re-frame/reg-sub
+   :last-image-location
+   :<- [:images]
+   (fn [[images] _]
+     (:image/location (last images))))
+
+
+  ;; Level three subscriptions
+
+  (re-frame/reg-sub
+   :before-images-count
    :<- [:partitioned-images]
-   (fn [[_ _ following] _]
-     (count following)))
+   (fn [[before _ _] _]
+     (count before)))
+
+  (re-frame/reg-sub
+   :after-images-count
+   :<- [:partitioned-images]
+   (fn [[_ _ after] _]
+     (count after)))
+
+  (re-frame/reg-sub
+   :loading-before-buffer
+   :<- [:comic-coordinates]
+   :<- [:buffer-size]
+   :<- [:first-image-location]
+   :<- [:before-images-count]
+   (fn [[comic-coord buffer-size first-location before-buffer-size] _]
+     (when (> buffer-size before-buffer-size)
+       (api/get-images-before (:site-id comic-coord)
+                              (:comic-id comic-coord)
+                              first-location
+                              buffer-size
+                              {:on-success #(re-frame/dispatch [:add-images-before %])})
+       true)))
+
+  (re-frame/reg-sub
+   :loading-after-buffer
+   :<- [:comic-coordinates]
+   :<- [:buffer-size]
+   :<- [:last-image-location]
+   :<- [:after-images-count]
+   (fn [[comic-coord buffer-size last-location after-buffer-size] _]
+     (when (> buffer-size after-buffer-size)
+       (api/get-images-after (:site-id comic-coord)
+                             (:comic-id comic-coord)
+                             last-location
+                             buffer-size
+                             {:on-success #(re-frame/dispatch [:add-images-after %])})
+       true)))

   (re-frame/reg-sub
    :current-images
    :<- [:partitioned-images]
-   :<- [:preceding-images-count]
-   :<- [:following-images-count]
-   (fn [[partitioned-images preceding-count following-count] [_ n]]
-     (when (> (/ n 2) preceding-count)
-       )
-     (when (> (/ n 2) following-count)
-       )
-     (current-images partitioned-images n))))
+   :<- [:buffer-size]
+   (fn [[partitioned-images buffer-size] _]
+     (current-images partitioned-images buffer-size))))

 (defn- image-id [image]
   (:image/location image))


Removed test file.

Removed test file.

--- src/clojush/environments_testing.clj
+++ src/clojush/environments_testing.clj
@@ -1,26 +0,0 @@
-(ns clojush.environments-testing
-  (:use [clojush.evaluate]
-        [clojush.individual]
-        [clojush.globals]
-        [clojush.interpreter]
-        [clojush.pushstate]
-        [clojush.util]
-        [clojush.pushgp.pushgp]
-        ))
-
-
-(run-push '(5 2 29999 4.3 2.3
-              environment_new (integer_add float_mult return_frominteger)
-              integer_sub)
-          (push-item "hi" :auxiliary
-                     (push-item "hi" :string
-                                (make-push-state)))
-          true)
-
-(run-push '(3 environment_begin 4 return_frominteger environment_end 5 6)
-          (make-push-state)
-          true)
-
-(run-push '(5 environment_new (2999 return_frominteger return_integer_pop))
-          (make-push-state)
-          true)


minors

minors

--- src/code/hashobject/views/common.clj
+++ src/code/hashobject/views/common.clj
@@ -13,7 +13,7 @@
       [:ul
        [:li [:a {:href "http://hashobject.com"} "Home"]]
        [:li.active [:a {:href "http://blog.hashobject.com"} "Blog"]]
-       [:li [:a {:href "http://os.hashobject.com"} "Open Source"]]
+       [:li [:a {:href "http://code.hashobject.com"} "Code"]]
        [:li [:a {:href "http://labs.hashobject.com"} "Labs"]]]]
     [:p.license.small-12.columns "Except as otherwise noted, the content of this site is licensed
      under the Creative Commons Attribution 3.0 License,


Remove unused var

Remove unused var

--- src/io/aviso/rook/client.clj
+++ src/io/aviso/rook/client.clj
@@ -15,8 +15,6 @@
     [clojure.tools.logging :as l]
     [clojure.string :as str]
     [io.aviso.rook [utils :as utils]]))
-
-(def edn "application/edn")

 (defn new-request
   "New request through the handler.


Now able to create headers for each day of a month

--- src/journal_creator/core.clj
+++ src/journal_creator/core.clj
@@ -1,7 +1,8 @@
 (ns journal-creator.core
-  (require [clj-time.core :as t]
-           [clj-time.local :as l]
-           [clj-time.format :as f]))
+  (require [clj-time.core     :as t]
+           [clj-time.local    :as l]
+           [clj-time.periodic :as p]
+           [clj-time.format   :as f]))

 (def days {0 "Saturday"
            1 "Sunday"
@@ -41,19 +42,75 @@
 (defn get-day-of-week [y m d]
   (get days (zeller-congruence y m d) "Unknown"))

+(defn time-range
+  [start end step]
+  (let [inf-range (p/periodic-seq start step)
+        below-end? (fn [t] (t/within? (t/interval start end) t))]
+    (take-while below-end? inf-range)))
+
+(defn month-seq
+  [start end step]
+  (time-range start end step))
+
+(defn number-of-days-in-month
+  [year month]
+  (let [current-date (t/date-time year month)
+        end-date     (t/plus current-date (t/months 1))]
+    (month-seq current-date end-date (t/days 1))))
+
+(def journal-format (fn [] "MMMM dd, yyyy, EEEE"))
+(def filename-date-format "yyyy-MM-dd")
+
+(defn get-today []
+  (t/to-time-zone (t/now) (t/default-time-zone)))
+
 (defn unparse-today [formatter]
-  (f/unparse formatter (t/to-time-zone (t/now) (t/default-time-zone))))
+  (f/unparse formatter (get-today)))

-(defn custom-formatter [format] (f/formatter-local format))
-(def get-journal-header (comp #(str "= " %1 " - <SUMMARY GOES HERE> =") unparse-today custom-formatter))
-(def journal-format "MMMM dd, yyyy, EEEE")
+(defn custom-formatter [format]
+  (f/formatter-local format))
+
+(defn journal-header-format [date]
+  (str "= " date " - <SUMMARY GOES HERE> ="))
+
+(defn file-format [file]
+  (str file ".wiki"))
+
+(defn add-x-days-to-today [x]
+  (t/plus (get-today) (t/days x)))
+
+(defn get-journal-header [date]
+  (journal-header-format (f/unparse (f/formatter-local  "MMMM dd, yyyy, EEEE") date )))
+
+;; (def get-journal-header
+  ;; (comp journal-header-format unparse-today custom-formatter))
+
+(def get-filename
+  (comp file-format unparse-today custom-formatter))

 (defn -main
   [& args]
-  ; (println "Today is: " (get-today (custom-formatter journal-format)))
-  (println "Today is: " (get-journal-header journal-format))
-  (loop [i (read-line)]
-    (println "row " i)
+  (println "Today is: " (get-journal-header (get-today)))
+  ;; (println "file format is: " (get-filename filename-date-format))
+  ;; (spit (get-filename filename-date-format) (get-journal-header journal-format))
+  ;; (loop [i 1]
+    ;; (println (add-x-days-to-today i))
+    ;; (if (< i 10)
+      ;; (recur (inc i))))
+ (prn "time-range")
+ (loop [days (number-of-days-in-month 2017 03)]
+   (when (not (empty? days))
+     (let [day (first days)
+           journal-header (get-journal-header day)
+           ;; filename (formate-date file-format day)
+           ]
+       (prn "remaining:" (count days) "journal-header: " journal-header)
+       ;; (prn "filename: " filename)
+       ;; (spit filename journal-header)
+       (recur (rest days)))))
+
+ (loop [i (read-line)]
+    (println "row " (type i) i)
     (if (= i "bye")
       (println "All done!")
       (recur (read-line)))))


Drop PageUpdateHandler.

Drop PageUpdateHandler.

--- src-cljs/pepa/workflows/inbox2.cljs
+++ src-cljs/pepa/workflows/inbox2.cljs
@@ -29,24 +29,6 @@
 (defprotocol ColumnDropTarget
   (accepts-drop? [_ state])     ;can't get data in drag-over
   (accept-drop!  [_ state pages]))
-
-(comment
-  (defprotocol PageUpdateHandler
-    (-update-pages [_ state pages]
-      "Function called to notify a column of page updates. `pages' is a
-    list of updated pages. There is no guarantee that `pages' only
-    contains pages relevant for the implementor. Implementations
-    should do the necessary updates on themselves and return the
-    updated versions."))
-
-  (defn update-pages!
-  "Notify columns in Inbox that pages in `pages' were updated on the server."
-  [state pages]
-  (om/transact! state [:inbox :columns]
-                (fn [columns]
-                  (->> columns
-                       (map #(-update-pages % state pages))
-                       (into (empty columns)))))))

 (defrecord InboxColumnSource [id]
   ColumnSource


Remove invalid comment

Remove invalid comment

--- src/main/clojure/cascade/internal/viewbuilder.clj
+++ src/main/clojure/cascade/internal/viewbuilder.clj
@@ -25,7 +25,6 @@
   "Checks the result of invoking a rendering function (or evaluating a symbol), to ensure that only
    acceptible values are returned."
   (cond
-    ; A map is assumed to be a DOM node
     (dom-node? any) any
     (string? any) (text-node any)
     (number? any) (raw-node (str any))


Fit-Button changes images

Fit-Button changes images

and now calls the appropriate hook.

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

--- src/conexp/contrib/draw/lattices.clj
+++ src/conexp/contrib/draw/lattices.clj
@@ -92,7 +92,7 @@
     (add-callback-for-hook scn :image-changed
                            (fn []
                              (let [new-radius (Double/parseDouble (.getText node-radius)),
-                                   length (min (scene-height scn) (scene-width scn))]
+                                   length     (min (scene-height scn) (scene-width scn))]
                                (do-nodes [n scn]
                                  (set-node-radius! n (/ (* length new-radius) 400))))))
     (action-on node-radius
@@ -118,7 +118,9 @@
                  "inf-add"  inf-additive-layout},
         ^JButton fit (make-button buttons "Fit"),
         ^JComboBox combo-box (make-combo-box buttons (keys layouts))]
-    (action-on fit (fit-scene-to-layout scn))
+    (action-on fit
+               (fit-scene-to-layout scn)
+               (call-hook-with scn :image-changed))
     (action-on combo-box
                (let [selected (.. evt getSource getSelectedItem),
                      layout-fn (get layouts selected)]


Slightly improve readability with destructuring

--- src/onyx/scheduling/balanced_job_scheduler.clj
+++ src/onyx/scheduling/balanced_job_scheduler.clj
@@ -34,15 +34,13 @@
   then tries to balance by peer count"
   [replica jobs]
   (->> jobs
-       (sort-by (fn [job]
-                  (let [peer-count (val job)
-                        covered (max 0 (- (cjs/job-lower-bound replica (key job)) peer-count))]
+       (sort-by (fn [[job-id peer-count :as job]]
+                  (let [covered (max 0 (- (cjs/job-lower-bound replica job-id) peer-count))]
                     (vector covered
                             peer-count
                             (.indexOf ^clojure.lang.PersistentVector (vec (:jobs replica)) job)))))
-       (remove (fn [job]
-                 (let [peer-count (val job)]
-                   (>= peer-count (cjs/job-upper-bound replica (key job))))))
+       (remove (fn [[job-id peer-count]]
+                 (>= peer-count (cjs/job-upper-bound replica job-id))))
        (ffirst)))

 (defmethod cjs/equivalent-allocation? :onyx.job-scheduler/balanced


CMR-3639: Initial change to fix replicated BLOBs.

--- bootstrap-app/src/cmr/bootstrap/services/replication.clj
+++ bootstrap-app/src/cmr/bootstrap/services/replication.clj
@@ -32,12 +32,19 @@
    [clj-time.coerce :as cr]
    [clj-time.core :as t]
    [clojure.java.jdbc :as j]
+   [clojure.string :as str]
    [cmr.bootstrap.data.bulk-index :as bulk-index]
    [cmr.common.config :refer [defconfig]]
-   [cmr.common.date-time-parser :as p]
    [cmr.common.jobs :refer [def-stateful-job]]
+   [cmr.common.log :refer [debug info warn error]]
+   [cmr.metadata-db.data.providers :as providers]
+   [cmr.metadata-db.services.concept-service :as s]
+   [cmr.metadata-db.services.provider-validation :as pv]
    [cmr.oracle.connection :as oracle]
-   [cmr.oracle.sql-utils :as su :refer [select from]]))
+   [cmr.oracle.sql-utils :as su :refer [select from]]
+   [inflections.core :as inf])
+  (:import
+   (cmr.oracle.connection OracleStore)))

 (def replication-status-table
   "The name of the database table where replication status is stored."
@@ -53,18 +60,137 @@
   inserted into the database in chronological order."
   20)

+;; ----------------------------
+;; Helpers for querying the METADATA_DB tables
+;; Code taken from mdb-migrate-helper, concept-tables, and Oracle providers namespaces.
+(defn dbresult->provider
+  "Converts a map result from the database to a provider map"
+  [{:keys [provider_id short_name cmr_only small]}]
+  {:provider-id provider_id
+   :short-name short_name
+   :cmr-only (== 1 cmr_only)
+   :small (== 1 small)})
+
+(extend-protocol providers/ProvidersStore
+  OracleStore
+
+  (get-providers
+    [db]
+    (map dbresult->provider
+         (j/query db ["SELECT * FROM METADATA_DB.providers"]))))
+
+(def all-provider-concept-types
+  "All the concept types that have tables for each (non-small) provider"
+  [:collection :granule :service])
+
+(defmulti get-table-name
+  "Get the name for the table for a given provider and concept-type"
+  (fn [provider-id concept-type]
+    concept-type))
+
+(defmethod get-table-name :access-group
+  [_ _]
+  "METADATA_DB.cmr_groups")
+
+(defmethod get-table-name :acl
+  [_ _]
+  "METADATA_DB.cmr_acls")
+
+(defmethod get-table-name :tag
+  [_ _]
+  "METADATA_DB.cmr_tags")
+
+(defmethod get-table-name :tag-association
+  [_ _]
+  "METADATA_DB.cmr_tag_associations")
+
+(defmethod get-table-name :humanizer
+  [_ _]
+  "METADATA_DB.cmr_humanizers")
+
+(defmethod get-table-name :default
+  [provider concept-type]
+  ;; Dont' remove the next line - needed to prevent SQL injection
+  (pv/validate-provider provider)
+  (let [{:keys [provider-id small]} provider
+        db-provider-id (if small pv/small-provider-id provider-id)]
+    (format "METADATA_DB.%s_%s" (str/lower-case db-provider-id) (inf/plural (name concept-type)))))
+
+(defn get-collection-tablenames
+  "Gets a list of all the collection tablenames. Primarily for enabling migrations of existing
+  provider tables."
+  [db]
+  (distinct (map #(get-table-name % :collection) (providers/get-providers db))))
+
+(defn get-granule-tablenames
+  "Gets a list of all the granule tablenames. Primarily for enabling migrations of existing
+  provider tables."
+  [db]
+  (distinct (map #(get-table-name % :granule) (providers/get-providers db))))
+
+(defn get-concept-tablenames
+  "Returns a sequence of table names for the given concept types, or all concept types
+  if none are specified, for all the existing providers."
+  ([db]
+   ;; use all concept types
+   (apply get-concept-tablenames db (keys s/num-revisions-to-keep-per-concept-type)))
+  ([db & concept-types]
+   (distinct
+    (->
+     (for [provider (providers/get-providers db)
+           concept-type concept-types]
+       (get-table-name provider concept-type))
+      ;; Ensure that we return the small provider tables even if there are no providers in our
+      ;; system yet.
+     (into (when (contains? (set concept-types) :collection) ["METADATA_DB.small_prov_collections"]))
+     (into (when (contains? (set concept-types) :granule) ["METADATA_DB.small_prov_granules"]))
+     (into (when (contains? (set concept-types) :service) ["METADATA_DB.small_prov_services"]))
+     (into (when (contains? (set concept-types) :access-group) ["METADATA_DB.cmr_groups"]))
+     (into (when (contains? (set concept-types) :tag) ["METADATA_DB.cmr_tags"]))))))
+
+(defconfig source-database-link
+  "Database link used for retrieving metadata from the source database to correct replication errors
+  caused by DMS in the target database."
+  {:default "localhost" :type String})
+
+(defn fix-null-replicated-concepts-query-str
+  "Query to fix the NULL replicated concepts. Needs 4 parameters - replicated destination table,
+  source table, database link, revision date time."
+  [table revision-datetime]
+  (format "update %s c1 set metadata = (select c2.metadata from %s@%s c2 where c2.id = c1.id) where c1.metadata is null and c1.deleted = 0 and c1.revision_date > to_timestamp ('%s', 'YYYY-MM-DD HH24:MI:SS.FF')"
+          table
+          table
+          (source-database-link)
+          (.toString (cr/to-sql-time revision-datetime))))
+
+(defn- fix-null-replicated-blobs
+  "AWS DMS is replicating BLOBs that are over 4K in size as NULL. We need to identify all of them
+  and fix them."
+  [db revision-datetime]
+  (let [
+        all-tables (conj (get-concept-tablenames db :collection) "METADATA_DB.NSIDC_ECS_GRANULES")]
+    (doseq [table all-tables]
+      (let [curr-time (System/currentTimeMillis)
+            stmt (fix-null-replicated-concepts-query-str table revision-datetime)]
+        (debug "Fixing replicated BLOBs for:" table "starting with statement:" stmt)
+        (j/db-do-commands db stmt)
+        (debug "Fixing replicated BLOBs for:" table "with revision-datetime" revision-datetime "took" (- (System/currentTimeMillis) curr-time)) "ms"))))
+
 (defn index-replicated-concepts
   "Indexes recently replicated concepts."
   [context]
   ;; Get the latest replicated revision date from the database
-  (let [db (get-in context [:system :db])
+  (let [bootstrap-db (get-in context [:system :db])
+        metadata-db (get-in context [:system :embedded-systems :metadata-db :db])
         revision-datetime (j/with-db-transaction
-                            [conn db]
+                            [conn bootstrap-db]
                             (->> (su/find-one conn (select [(csk/->kebab-case-keyword
                                                              replication-date-column)]
                                                            (from replication-status-table)))
                                  :last_replicated_revision_date
                                  (oracle/oracle-timestamp->clj-time conn)))
+        ;; Fix any NULL replicated BLOBs
+        _ (fix-null-replicated-blobs metadata-db revision-datetime)
         ;; Perform the indexing
         {:keys [max-revision-date]} (bulk-index/index-data-later-than-date-time
                                      (:system context)
@@ -72,7 +198,7 @@
     ;; Update the latest replicated revision date in the database
     (when max-revision-date
       (let [stmt (format "UPDATE %s SET %s = ?" replication-status-table replication-date-column)]
-        (j/db-do-prepared db stmt [(cr/to-sql-time max-revision-date)])))))
+        (j/db-do-prepared bootstrap-db stmt [(cr/to-sql-time max-revision-date)])))))

 (defconfig recently-replicated-interval
   "How often to index recently replicated concepts."
@@ -94,3 +220,20 @@
 (def index-recently-replicated-job
   {:job-type IndexRecentlyReplicatedJob
    :interval (recently-replicated-interval)})
+
+(comment
+ (defn connect-to-db
+   "Creates and returns a database connection"
+   [connection-name db-url user password]
+   (cmr.common.lifecycle/start
+    (cmr.oracle.connection/create-db (cmr.oracle.connection/db-spec connection-name db-url false "" user password)) nil))
+
+ (def wl-rds-db
+    "RDS WL instance connection"
+    (connect-to-db "NGAP-ORACLE-WL-RDS2" "thin:@url" "METADATA_DB" "xxxxx"))
+
+ (fix-null-replicated-blobs wl-rds-db "3016-01-01T10:00:00Z")
+
+ (let [boot-sys (cmr.bootstrap.system/create-system)
+       db (cmr.common.lifecycle/start (get-in boot-sys [:embedded-systems :metadata-db :db]) boot-sys)]
+   (fix-null-replicated-blobs db "3016-01-01T10:00:00Z")))


[#1193] Added support for geopoint/geoshape to dataset merges

--- backend/src/akvo/lumen/transformation/merge_datasets.clj
+++ backend/src/akvo/lumen/transformation/merge_datasets.clj
@@ -1,11 +1,12 @@
 (ns akvo.lumen.transformation.merge-datasets
   (:require [akvo.lumen.transformation.engine :as engine]
+            [akvo.lumen.import.common :as import]
             [clojure.java.jdbc :as jdbc]
             [clojure.set :as set]
             [clojure.string :as s]
             [hugsql.core :as hugsql])
-  (:import [akvo.lumen.import.common Geoshape Geopoint]
-           [java.sql Timestamp]))
+  (:import [java.sql Timestamp]
+           [org.postgis PGgeometry]))

 (hugsql/def-db-fns "akvo/lumen/transformation.sql")
 (hugsql/def-db-fns "akvo/lumen/transformation/engine.sql")
@@ -46,24 +47,25 @@
           (or aggregationColumn mergeColumn)
           aggregationDirection))

-#_(defn to-sql-types [row merge-columns]
-    ;; For now we only need to change date types.
-    (let [date-columns (filter #(= "date" (get % "type")) merge-columns)]
-      (reduce (fn [result-row {:strs [columnName]}]
-                (update result-row columnName #(when % (Timestamp. %))))
-              row
-              date-columns)))
+(defn ->pggeometry [value]
+  (doto
+    (PGgeometry/geomFromString value)
+    (.setSrid 4326)))

-(defn to-sql-types [row merge-columns]
-  (let [columns-requiring-cast (filter #(contains? #{"date" "geoshape" "geopoint" }
-                                                   (get % "type"))
-                                       merge-columns)]
+(defn ->timestamp [value]
+  (Timestamp. value))
+
+(defn to-sql-types
+  [row merge-columns]
+  (let [requires-cast? #(contains? #{"date" "geopoint" "geoshape"} (get % "type"))
+        columns-requiring-cast (filter requires-cast? merge-columns)]
     (reduce (fn [result-row {:strs [columnName type]}]
-              (update result-row columnName (fn [v]
-                                              (when v (case type
-                                                        "date" (Timestamp. v)
-                                                        "geoshape" (Geoshape. v)
-                                                        "geopoint" (Geopoint. v))))))
+              (update result-row columnName
+                      (fn [v]
+                        (when v (case type
+                                  "date" (->timestamp v)
+                                  "geopoint" (->pggeometry v)
+                                  "geoshape" (->pggeometry v))))))
             row
             columns-requiring-cast)))


test hook

test hook

--- src/main/cawala/api/read.clj
+++ src/main/cawala/api/read.clj
@@ -6,7 +6,7 @@
                      :person/relation :friend}
                  2  {:db/id 2 :person/name "Sally" :person/age 22
                      :person/relation :friend}
-                 3  {:db/id 3 :person/name "Allie" :person/age 59
+                 3  {:db/id 3 :person/name "Allie" :person/age 58
                      :person/relation :enemy}
                  4  {:db/id 4 :person/name "Zoe" :person/age 32
                      :person/relation :friend}


bug #4963 - removed balance from asset suggestion box to prevent text overlap

Signed-off-by: Julien Eluard <c768e13f1ba4c3ebed2909a1fc1e4b50bb021a2f@gmail.com>

--- src/status_im/chat/views/api/choose_asset.cljs
+++ src/status_im/chat/views/api/choose_asset.cljs
@@ -21,8 +21,10 @@
                      :style  styles/asset-icon}]
        [react/text {:style styles/asset-symbol} symbol]
        [react/text {:style styles/asset-name} name]]
-      [react/text {:style styles/asset-balance}
-       (str (money/internal->formatted amount symbol decimals))]]]))
+      ;;TODO(goranjovic) : temporarily disabled to fix https://github.com/status-im/status-react/issues/4963
+      ;;until the resolution of https://github.com/status-im/status-react/issues/4972
+      #_[react/text {:style styles/asset-balance}
+         (str (money/internal->formatted amount symbol decimals))]]]))

 (def assets-separator [react/view styles/asset-separator])


Bump Dirac

Bump Dirac

--- resources/leiningen/new/lambone/common/dev/boot.clj
+++ resources/leiningen/new/lambone/common/dev/boot.clj
@@ -59,7 +59,7 @@

 (def dirac-repl-deps
   '[[binaryage/devtools "0.6.1" :scope "test"]
-    [binaryage/dirac "0.4.0" :scope "test"]
+    [binaryage/dirac "0.6.0" :scope "test"]
     [jupl/boot-cljs-devtools "0.1.1-SNAPSHOT" :scope "test"]])

 (defn add-repl-deps


Load storage collection icons on sidebar icons component is mounted.

--- src/uxbox/main/ui/workspace/sidebar/icons.cljs
+++ src/uxbox/main/ui/workspace/sidebar/icons.cljs
@@ -41,6 +41,7 @@
   [own]
   (let [local (:rum/local own)]
     (rs/emit! (udi/fetch-collections))
+    (rs/emit! (udi/fetch-icons nil))
     (add-watch local ::key (fn [_ _ _ {:keys [id]}]
                              (rs/emit! (udi/fetch-icons id))))
     own))


remove validator from validation namespace

--- src/navigator/validation.clj
+++ src/navigator/validation.clj
@@ -13,15 +13,6 @@
                     (s/optional-key :final-score)       s/Str
                     (s/optional-key :score-denominator) s/Int
                     (s/optional-key :score-type)        s/Keyword}})
-
-(defn validator
-  [entity-type data]
-  (let [validation (entity-type validations)]
-    (try
-      (s/validate
-       validation
-       data)
-      (catch Exception e (.getMessage e)))))

 (comment


Lock publications when creating new pub #389

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -177,26 +177,22 @@

 (defrecord TrackedPub [publication last-used])

-(defn get-publication [messenger {:keys [channel] :as conn-info}]
-  ;; FIXME, race condition may cause two publications to be created
-  (if-let [pub (get @(:publications messenger) channel)]
+(defn get-publication [{:keys [publications] :as messenger} {:keys [channel] :as conn-info}]
+  (if-let [pub (get @publications channel)]
     (do
       (reset! (:last-used pub) (System/currentTimeMillis))
       (:publication pub))
-    (let [stream-id (:stream-id conn-info)
-          pub-manager (-> (pubm/new-publication-manager channel
-                                                        stream-id
-                                                        (:send-idle-strategy messenger)
-                                                        (:write-buffer-size messenger)
-                                                        (fn []
-                                                          (swap! (:publications messenger) dissoc channel)))
-                          (pubm/connect)
-                          (pubm/start))]
-      (swap! (:publications messenger)
-             assoc
-             channel
-             (->TrackedPub pub-manager (atom (System/currentTimeMillis))))
-      pub-manager)))
+    (locking publications
+      (let [stream-id (:stream-id conn-info)
+            pub-manager (-> (pubm/new-publication-manager channel
+                                                          stream-id
+                                                          (:send-idle-strategy messenger)
+                                                          (:write-buffer-size messenger)
+                                                          (fn [] (swap! publications dissoc channel)))
+                            (pubm/connect)
+                            (pubm/start))]
+        (swap! publications assoc channel (->TrackedPub pub-manager (atom (System/currentTimeMillis))))
+        pub-manager))))

 (defn opts->port [opts]
   (or (:onyx.messaging/peer-port opts)


Handle case where precondition isn't specified.

--- src/onyx/static/analyzer.clj
+++ src/onyx/static/analyzer.clj
@@ -100,12 +100,20 @@
   {:error-type :invalid-key
    :path path})

+(defn determine-predicates [path ve]
+  (let [x (first @(.-expectation-delay ve))]
+    (if (= x 'matches-some-precondition?)
+      (map (partial classify-schema path)
+           (map :schema (:options (.schema ve))))
+      [x])))
+
 (defmethod classify-error schema.spec.variant.VariantSpec
   [job path ve]
+  (prn (first @(.-expectation-delay ve)))
   {:error-type :conditional-failed
    :error-key (if (seq path) (last path) (first (keys (.value ve))))
    :error-value (.value ve)
-   :predicates [(first @(.-expectation-delay ve))]
+   :predicates (determine-predicates path ve)
    :path path})

 (defmethod classify-error schema.core.Constrained


take name of multi count's scope

take name of multi count's scope

--- src/clj/marceline/storm/metrics.clj
+++ src/clj/marceline/storm/metrics.clj
@@ -72,7 +72,7 @@
 (defn multi-count-metric
   []
   (let [mcm (MultiCountMetric.)]
-    {:fn (fn [k] (.incr (.scope mcm k)))
+    {:fn (fn [k] (.incr (.scope mcm (name k))))
      :m mcm}))

 (defn register-metrics


Don't loop-read from a closed channel

Don't loop-read from a closed channel

--- src/cljs/asciinema_player/core.cljs
+++ src/cljs/asciinema_player/core.cljs
@@ -40,7 +40,8 @@
   (let [events (chan)]
     (go
       (loop []
-        (process-event (<! events) state)
-        (recur)))
+        (when-let [event (<! events)]
+          (process-event event state)
+          (recur))))
     (reagent/render-component [view/player state events] dom-node)
     (clj->js {:toggle (fn [] toggle-play state)})))


Storing user id into local storage + bugfixes

--- src/cljs/catsocket_client/core.cljs
+++ src/cljs/catsocket_client/core.cljs
@@ -6,7 +6,7 @@
             )
   (:require-macros [cljs.core.async.macros :refer [go]]))

-(defonce app-state (atom {:text "Hello Chestnut!"}))
+(defonce app-state (atom {:text "CatSocket client"}))

 (defn log [& args]
   (.apply (.-log js/console) js/console (clj->js args)))
@@ -22,76 +22,92 @@
 (defn guid "Generates a random GUID" []
   (str (s4) (s4) "-" (s4) "-" (s4) "-" (s4) "-" (s4) (s4) (s4)))

+
+(defn user
+  []
+  (let [user "user"
+        result (.getItem js/localStorage user)]
+    (if result
+      result
+      (do
+        (let [id (guid)]
+          (.setItem js/localStorage user id)
+          id)))))
+
+
 (declare send on-message)

-(def socket (atom nil))
-(def connected? (atom false))
-(def identified? (atom false))
-(def queue (atom []))
-(def sent-messages (atom {}))
-
 (defn on-open
-  [socket event]
-  (reset! connected? true)
-  (send socket "identify" {}))
+  [cat event]
+  (swap! cat assoc :connected? true)
+  (send cat "identify" {}))

 (defn init []
   (let [url "ws://localhost:9000/api/ws"
-        s (js/WebSocket. url)]
-    (set! (.-onopen s ) (partial on-open s))
-    (set! (.-onmessage s ) #(on-message (.parse js/JSON (.-data %))))
+        s (js/WebSocket. url)
+        cat (atom {:socket s
+                   :connected? false
+                   :identified? false
+                   :queue []
+                   :sent-messages {}})]
+    (set! (.-onopen s ) #(on-open cat %))
+    (set! (.-onmessage s ) #(on-message cat (.parse js/JSON (.-data %))))

-    (reset! socket s)))
+    cat))

-(defn send [socket action data]
+(defn send [cat action data]
   (let [params {:api_key "foo"
-                :user (guid)
+                :user (user)
                 :action action
                 :data data
                 :id (guid)
                 :timestamp (.getTime (js/Date.))}]
-    (if @connected?
+    (if (:connected? @cat)
       (do
-        (log "sending via socket, waiting for ACK")
-        (swap! sent-messages assoc (:id params) params)
-        (.send socket (stringify params)))
+        (log "sending" (clj->js params))
+        (swap! cat update-in [:sent-messages] assoc (:id params) params)
+        (.send (:socket @cat) (stringify params)))
       (do
         (log "enqueing")
-        (swap! queue conj params)))))
+        (swap! cat update-in [:queue] conj params)))))

-(defn flush-queue []
-  (log "identified flushing queue")
-  (doseq [item @queue]
-    (log "sending" (clj->js item))
-    (.send @socket (stringify item)))
-  (reset! queue []))
+(defn flush-queue [cat]
+  (log "identified, flushing queue")

-(defn on-message [data]
+  (let [q (:queue @cat)]
+    (swap! cat assoc :queue [])
+
+    (doseq [item q]
+      (log "sending" (clj->js item))
+      (.send (:socket @cat) (stringify item)))))
+
+(defn on-message [cat data]
   (condp = (.-action data)
     "ack" (do
             (let [id (.-id data)]
-              (when (= "identify" (get-in @sent-messages [id :action]))
-                (reset! identified? true)
-                (flush-queue))
-              (swap! sent-messages dissoc id)))
+              (when (= "identify" (get-in @cat [:sent-messages id :action]))
+                (swap! cat assoc :identified? true)
+                (flush-queue cat))
+
+              (log "ACK received: " data)
+              (swap! cat update-in [:sent-messages] dissoc id)))
     (log "unrecognized message" data)))

-(defn join [room]
-  (send @socket "join" {:room room}))
+(defn join [cat room]
+  (send cat "join" {:room room}))

-(defn leave [room]
-  (send @socket "leave" {:room room}))
+(defn leave [cat room]
+  (send cat "leave" {:room room}))

-(defn broadcast [room msg]
-  (send @socket "broadcast" {:room room :message msg}))
+(defn broadcast [cat room msg]
+  (send cat "broadcast" {:room room :message msg}))

 ;;

 (defn main []
-  (init)
-  (join "test")
-  (broadcast "test" "hello!")
-
+  (let [cat (init)]
+    (join cat "test")
+    (broadcast cat "test" "hello!"))

   (om/root
@@ -99,6 +115,6 @@
       (reify
         om/IRender
         (render [_]
-          (dom/h1 nil (str "nuf " (:text app))))))
+          (dom/h1 nil (:text app)))))
     app-state
     {:target (. js/document (getElementById "app"))}))


Add ability to change name of player.

Add ability to change name of player.

--- src/cljs/munchkin_toolbox/core.cljs
+++ src/cljs/munchkin_toolbox/core.cljs
@@ -45,6 +45,46 @@
              :on-click #(put! level-changed-c ::inc)}
             "+"]]])))))

+(defn editable-label
+  [label-key]
+  (fn [data owner]
+    (reify
+      om/IInitState
+      (init-state [_]
+        {:edit? false
+         :label-changed (chan)})
+      om/IWillMount
+      (will-mount [_]
+        (let [label-changed-c (om/get-state owner :label-changed)]
+          (go (loop []
+                (let [name (<! label-changed-c)]
+                  (om/update! data label-key name)
+                  (om/set-state! owner :edit? false)
+                  (recur))))))
+      om/IRenderState
+      (render-state [_ state]
+        (let [{:keys [edit? label label-changed]} state
+              label (or label (get data label-key ""))]
+          (html
+           [:div {:class "row"}
+            [:div {:class "col-sm-12"}
+             (if edit?
+               [:div {:class "form-inline" :role "form"}
+                [:input
+                 {:type "text"
+                  :class "form-control"
+                  :placeholder "Player's name"
+                  :on-change
+                  #(om/set-state! owner :label (.. % -target -value))
+                  :value label}]
+                [:button
+                 {:class "btn btn-warning"
+                  :on-click #(put! label-changed label)}
+                 "Save"]]
+               [:label
+                {:on-click #(om/set-state! owner :edit? true)}
+                (get data label-key "")])]]))))))
+
 (defmulti change-level identity)
 (defmethod change-level ::inc [op] (fn [l] (if (< l 10) (inc l) l)))
 (defmethod change-level ::dec [op] (fn [l] (if (> l 1) (dec l) l)))
@@ -54,7 +94,8 @@
   [{:keys [name level] :as player} owner]
   (reify
     om/IInitState
-    (init-state [_] {:level-changed (chan)})
+    (init-state [_]
+      {:level-changed (chan)})
     om/IWillMount
     (will-mount [_]
       (let [level-changed-c (om/get-state owner :level-changed)]
@@ -66,9 +107,7 @@
     (render-state [_ state]
       (html
        [:div {:class "row"}
-        [:div {:class "row"}
-         [:div {:class "col-sm-12"}
-          name]]
+        (om/build (editable-label :name) player)
         (om/build level-counter
                   level
                   {:init-state (select-keys state [:level-changed])})
@@ -109,7 +148,7 @@
          [:div {:class "row"}
           [:div {:class "col-sm-12"}
            [:button
-            {:class "btn btn-default"
+            {:class "btn btn-info"
              :on-click #(put! player-added-c true)}
             "Add a new player"]]])))))


moving things around so they work

moving things around so they work

--- src/clojure/neveragain/pdaparse.clj
+++ src/clojure/neveragain/pdaparse.clj
@@ -2,6 +2,8 @@
   (:require
     (clojure [string :as string]
              [set :as mset])))
+
+(def alpha (set (map char (concat (range 65 91) (range 97 123)))))

 (def paren-balancer
   "A PDA that accepts any string with balanced paren pairs."
@@ -27,12 +29,12 @@
 (defn coll-flatten
   "Flatten any nested coll structure"
   [coll]
-  (apply concat
+  (apply concat
          (map (fn [x] (if (coll? x) (coll-flatten x) [x]))
               coll)))

 (defn cfg-to-ndpda
-  "Takes the description of a context free grammar and returns a
+  "Takes the description of a context free grammar and returns a
   non-deterministic push down automaton that recognizes the language generated
   by the context free grammar"
   [cfg]
@@ -44,12 +46,12 @@
          Σ '()
          [[p-sym rules] & remaining] (-> cfg :prod-rules seq)]
     (if p-sym
-      ; For each rule S -> s make a transition from q1 to q1 popping and
+      ; For each rule S -> s make a transition from q1 to q1 popping and
       ; reading nothing and pushing s onto stack so whenever we see S in stack
       ; it will be "replaced" by s
-      (recur
+      (recur
         (if (every? char? rules)
-          ; If this transition only adds non-terminal characters we can
+          ; If this transition only adds non-terminal characters we can
           ; optimize by making the input symbol a set and making the push
           ; symbol be whatever the input symbol was. The presence of :<> tells
           ; the intrepreter to not pop from the input string as well.
@@ -63,7 +65,7 @@
         remaining)
       ; All NDPFAs will look like q0 -> q1 -> q2 with the same accepting
       ; configuration and transitions save those form q1 to itself.
-      {:start-state :q0
+      {:start-state :q0
        ; First move will always be to transform the stack to (first-symbol :Z)
        ; where :Z will designate the end of string symbol.
        :program {:q0 [[:q1 :ε :ε (list (:start-symbol cfg) :Z)]]
@@ -71,7 +73,7 @@
                  ; make a q1 -> q1 transtion poping the same symbol from stack
                  ; and input for every terminal symbol.
                  :q1 (concat q1
-                             (map (fn [x] [:q1 x x :ε])
+                             (map (fn [x] [:q1 x x :ε])
                                   (mset/difference (set (coll-flatten Σ))
                                                    (set (keys (:prod-rules cfg)))
                                                    #{:ε})))
@@ -79,8 +81,12 @@
                  :q2 []}
        :accepting #{:q2}})))

-
-(defn ε=
+(defn ε?
+  "Returns true if `x` is the epsilon keyword."
+  [x]
+  (= x :ε))
+
+(defn ε=
   "Returns true if `a` and `b` are equal, either is a set which contains the
   other, or either or both are :ε. Behaviour on two sets is undefined."
   [a b]
@@ -103,14 +109,9 @@
   "Pushes all non :ε members of x into y, preserving order of x. X may also be
   a non collecton."
   [x y]
-  (if-not (coll? x)
+  (if-not (coll? x)
     (εconj y x)
     (apply εconj y (reverse x))))
-
-(defn ε?
-  "Returns true if `x` is the epsilon keyword."
-  [x]
-  (= x :ε))

 (defn last-index
   "Return the index of the last item in coll where (pred x) is logical true."
@@ -138,10 +139,10 @@
         stack (εpush (if (= p-sym :<>) next-sym p-sym) stack)
         cap-hist (if will-capture (conj cap-hist [s-sym (count i-string) nil])
                    cap-hist)
-        close-target (if capture-close
+        close-target (if capture-close
                        (last-index (fn [[_ __ x]] (nil? x)) cap-hist) 0)
-        cap-hist (if capture-close (assoc cap-hist
-                                          close-target
+        cap-hist (if capture-close (assoc cap-hist
+                                          close-target
                                           (assoc (get cap-hist close-target)
                                                  2 (count input-string)))
                    cap-hist)]
@@ -149,8 +150,8 @@
     (list pda i-string next-state stack captures cap-hist)))

 (defn first-accepted
-  "Calls pred on each member of coll. Expects pred to return a sequential
-  datum. Returns the first value of pred that where (first (pred x)) is
+  "Calls pred on each member of coll. Expects pred to return a sequential
+  datum. Returns the first value of pred that where (first (pred x)) is
   logically true. If none are, returns nil."
   [pred [f & remaining]]
   (if-not f
@@ -158,18 +159,10 @@
     (let [v (pred f)]
       (if (first v) v (recur pred remaining)))))

-(defn accepts?
-  "Takes a description of a PDA and a string, returns true if the PDA accepts
-  the string and false otherwise."
-  [pda s]
-  (-> (parse pda s #{})
-      first
-      true?))
-
 (defn parse
   "Takes a description of a PDA, a string, and optionally a set of non-terminal
   symbols which will be captured and returned. Returned value is a two item
-  list of (accepted, captured) where captured is a map from non-terminal
+  list of (accepted, captured) where captured is a map from non-terminal
   symbols to their value within the string."
   ([pda s captures]
    (parse pda (seq s) (:start-state pda) '() captures []))
@@ -211,6 +204,13 @@
                                             cap-hist)))
            valid-trans))))))

+(defn accepts?
+  "Takes a description of a PDA and a string, returns true if the PDA accepts
+  the string and false otherwise."
+  [pda s]
+  (-> (parse pda s #{})
+      first
+      true?))

 (defn extract [s parts]
   "Takes a string and a collection of three tuples of the form [name start
@@ -222,8 +222,8 @@
            r {}]
       (if-not part
         r
-        (recur remaining
-               (assoc r part
+        (recur remaining
+               (assoc r part
                       (conj (get r part)
                             (subs s (- len start) (dec (- len end))))))))))


Deprecated time parser namespace.

Deprecated time parser namespace.

--- src/cmr/common/date_time_parser.clj
+++ src/cmr/common/date_time_parser.clj
@@ -2,8 +2,18 @@
   "Contains helper to parse datetime string to clj-time"
   (:require [clj-time.format :as f]))

+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DEPRECATED
+;; Each project should do it's own time parsing using clj-time.format
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
 ;; Define the regex for datetime parsing. It will match something like "1986-10-14T04:03:27.456-05:00Z"
 (def datetime-regex #"^(\d\d\d\d-(\d)?\d-(\d)?\dT(\d)?\d:(\d)?\d:(\d)?\d(\.\d+)?)(([+-]\d\d:\d\d)|Z)?$")
+
+(def formatter
+  "The formatter used to parse date time strings"
+  (f/formatters :date-hour-minute-second-fraction))

 (defn string->datetime
   "Convert datetime string to Joda DateTime"
@@ -11,5 +21,5 @@
   (if-let [matches (re-find datetime-regex value)]
     (let [match (get matches 1)
           conformed-value (if (re-find #"\." match) match (str match ".000"))]
-      (f/parse (f/formatters :date-hour-minute-second-fraction) conformed-value))
+      (f/parse formatter conformed-value))
     (throw (Exception. (format "Invalid DateTime string: %s" value)))))


Add more scales (discovered in the SCLang source)

--- src/overtone/music/pitch.clj
+++ src/overtone/music/pitch.clj
@@ -235,32 +235,81 @@
         rotate-ionian   (fn [offset]
                           (take ionian-len
                                 (drop offset (cycle ionian-sequence))))]
-  {:diatonic          ionian-sequence
-   :ionian            (rotate-ionian 0)
-   :major             (rotate-ionian 0)
-   :dorian            (rotate-ionian 1)
-   :phrygian          (rotate-ionian 2)
-   :lydian            (rotate-ionian 3)
-   :mixolydian        (rotate-ionian 4)
-   :aeolian           (rotate-ionian 5)
-   :minor             (rotate-ionian 5)
-   :locrian           (rotate-ionian 6)
-   :pentatonic        [2 3 2 2 3]
-   :major-pentatonic  [2 2 3 2 3]
-   :minor-pentatonic  [3 2 2 3 2]
-   :whole-tone        [2 2 2 2 2 2]
-   :chromatic         [1 1 1 1 1 1 1 1 1 1 1 1]
-   :harmonic-minor    [2 1 2 2 1 3 1]
-   :melodic-minor-asc [2 1 2 2 2 2 1]
-   :hungarian-minor   [2 1 3 1 1 3 1]
-   :octatonic         [2 1 2 1 2 1 2 1]
-   :messiaen1         [2 2 2 2 2 2]
-   :messiaen2         [1 2 1 2 1 2 1 2]
-   :messiaen3         [2 1 1 2 1 1 2 1 1]
-   :messiaen4         [1 1 3 1 1 1 3 1]
-   :messiaen5         [1 4 1 1 4 1]
-   :messiaen6         [2 2 1 1 2 2 1 1]
-   :messiaen7         [1 1 1 2 1 1 1 1 2 1]}))
+    {:diatonic           ionian-sequence
+     :ionian             (rotate-ionian 0)
+     :major              (rotate-ionian 0)
+     :dorian             (rotate-ionian 1)
+     :phrygian           (rotate-ionian 2)
+     :lydian             (rotate-ionian 3)
+     :mixolydian         (rotate-ionian 4)
+     :aeolian            (rotate-ionian 5)
+     :minor              (rotate-ionian 5)
+     :locrian            (rotate-ionian 6)
+     :major-pentatonic   [2 2 3 2 3]
+     :minor-pentatonic   [3 2 2 3 2]
+     :whole-tone         [2 2 2 2 2 2]
+     :whole              [2 2 2 2 2 2]
+     :chromatic          [1 1 1 1 1 1 1 1 1 1 1 1]
+     :harmonic-minor     [2 1 2 2 1 3 1]
+     :melodic-minor-asc  [2 1 2 2 2 2 1]
+     :hungarian-minor    [2 1 3 1 1 3 1]
+     :octatonic          [2 1 2 1 2 1 2 1]
+     :messiaen1          [2 2 2 2 2 2]
+     :messiaen2          [1 2 1 2 1 2 1 2]
+     :messiaen3          [2 1 1 2 1 1 2 1 1]
+     :messiaen4          [1 1 3 1 1 1 3 1]
+     :messiaen5          [1 4 1 1 4 1]
+     :messiaen6          [2 2 1 1 2 2 1 1]
+     :messiaen7          [1 1 1 2 1 1 1 1 2 1]
+     :super-locrian      [1 2 1 2 2 2 2]
+     :hirajoshi          [2 1 4 1 4]
+     :kumoi              [2 1 4 2 3]
+     :phrygian           [1 2 2 2 1 2 2]
+     :neapolitan-major   [1 2 2 2 2 2 1]
+     :bartok             [2 2 1 2 1 2 2]
+     :lydian             [2 2 2 1 2 2 1]
+     :bhairav            [1 3 1 2 1 3 1]
+     :locrian-major      [2 2 1 1 2 2 2]
+     :gong               [2 2 3 2 3]
+     :hex-phrygian       [1 2 2 3 2 2]
+     :ahirbhairav        [1 3 1 2 2 1 2]
+     :yu                 [3 2 2 3 2]
+     :enigmatic          [1 3 2 2 2 1 1]
+     :neapolitan-minor   [1 2 2 2 1 3 1]
+     :pelog              [1 2 4 1 4]
+     :augmented2         [1 3 1 3 1 3]
+     :scriabin           [1 3 3 2 3]
+     :harmonic-major     [2 2 1 2 1 3 1]
+     :melodic-minor-desc [2 1 2 2 1 2 2]
+     :hex-dorian         [2 1 2 2 3 2]
+     :romanian-minor     [2 1 3 1 2 1 2]
+     :hindu              [2 2 1 2 1 2 2]
+     :iwato              [1 4 1 4 2]
+     :melodic-minor      [2 1 2 2 2 2 1]
+     :harmonic-minor     [2 1 2 2 1 3 1]
+     :diminished2        [2 1 2 1 2 1 2 1]
+     :marva              [1 3 2 1 2 2 1]
+     :melodicmajor       [2 2 1 2 1 2 2]
+     :indian             [4 1 2 3 2]
+     :hex-major6         [2 2 1 2 2 3]
+     :spanish            [1 3 1 2 1 2 2]
+     :prometheus         [2 2 2 5 1]
+     :diminished         [1 2 1 2 1 2 1 2]
+     :hex-aeolian        [3 2 2 1 2 2]
+     :ritusen            [2 3 2 2 3]
+     :hexSus             [2 3 2 2 1 2]
+     :todi               [1 2 3 1 1 3 1]
+     :ionian             [2 2 1 2 2 2 1]
+     :zhi                [2 3 2 2 3]
+     :leading-whole      [2 2 2 2 2 1 1]
+     :augmented          [3 1 3 1 3 1]
+     :shang              [2 3 2 3 2]
+     :jiao               [3 2 3 2 2]
+     :egyptian           [2 3 2 3 2]
+     :purvi              [1 3 2 1 1 3 1]
+     :hex-major7         [2 2 3 2 2 1]
+     :chinese            [4 2 1 4 1]
+     :lydian-minor       [2 2 2 1 1 2 2]}))

 (defn resolve-scale
   "Either looks the scale up in the map of SCALEs if it's a keyword or


Start logging node run information into plan output

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -1047,6 +1047,11 @@

 ; region reader3

+(defn reader3-node-log! [{::keys [run-plan*] :as env} {::pcp/keys [node-id]} event]
+  (if run-plan*
+    (swap! run-plan* pcp/update-node node-id ::run-trace #(p.misc/vconj % (assoc event ::pt/timestamp (pt/now)))))
+  env)
+
 (defn reader3-run-next-node [env plan {::pcp/keys [run-next]}]
   (if run-next
     (reader3-run-node env plan (pcp/get-node plan run-next))))
@@ -1079,7 +1084,9 @@
     ::pcp/keys [input params]
     :as        node}]
   (if (reader3-all-requires-ready? env node)
-    (reader3-run-next-node env plan node)
+    (do
+      (reader3-node-log! env node {::pt/event ::skip-node-requires-ready})
+      (reader3-run-next-node env plan node))
     (let [input'     (into #{} (keys input))
           {::keys [cache?] :or {cache? true} :as resolver}
           (cond-> (get-in indexes [::index-resolvers sym])
@@ -1098,10 +1105,24 @@
                        (if async-parser?
                          (async-read-cache-read env e trace-data input')
                          (serial-cache-resolver-call env e))
-                       (call-resolver env e))]
+                       (try
+                         (let [r (call-resolver env e)]
+                           (reader3-node-log! env node {::pt/event ::node-resolver-success})
+                           r)
+                         (catch #?(:clj Throwable :cljs :default) e
+                           (reader3-node-log! env node {::pt/event       ::node-resolver-error
+                                                        ::resolver-error e})
+                           (throw e))))]
       (if async-parser?
-        (go-catch
-          (let [response (<?maybe response)]
+        (go-promise
+          (let [response (try
+                           (let [r (<?maybe response)]
+                             (reader3-node-log! env node {::pt/event ::node-resolver-success})
+                             r)
+                           (catch #?(:clj Throwable :cljs :default) e
+                             (reader3-node-log! env node {::pt/event       ::node-resolver-error
+                                                          ::resolver-error e})
+                             (throw e)))]
             (if (reader3-merge-resolver-response env sym response)
               (<?maybe (reader3-run-next-node env plan node)))))
         (if (reader3-merge-resolver-response env sym response)
@@ -1213,19 +1234,23 @@
             process-start  (pt/trace-enter env {::pt/event ::reader3-execute})
             plan           (reader3-compute-run-graph
                              (merge env indexes {:edn-query-language.ast/node ast
-                                                 ::pcp/available-data         available-data}))]
+                                                 ::pcp/available-data         available-data}))
+            plan*          (atom plan)
+            env            (assoc env ::run-plan* plan*)]
         (if-let [root (pcp/get-root-node plan)]
           (let []
             (if async-parser?
               (go-promise
                 (<?maybe (reader3-run-node env plan root))
                 (pt/trace-leave env process-start {::pt/event ::reader3-execute
-                                                   ::plan     plan
+                                                   ::plan     @plan*
                                                    ::pt/style {:fill "#6ac5ec"}})
                 (<?maybe (p/reader (update env ::reader3-computed-plans p.misc/sconj path))))
               (do
                 (reader3-run-node env plan root)
-                (pt/trace-leave env process-start {::pt/event ::reader3-execute})
+                (pt/trace-leave env process-start {::pt/event ::reader3-execute
+                                                   ::plan     @plan*
+                                                   ::pt/style {:fill "#6ac5ec"}})
                 (p/reader (update env ::reader3-computed-plans p.misc/sconj path)))))
           ::p/continue)))))


remove comments

remove comments

--- src/pc/views/blog/common.clj
+++ src/pc/views/blog/common.clj
@@ -74,27 +74,6 @@
            (when (coll? prop)
              {:data-subprop (str/join "," (rest prop))}))))

-; (defn dribbble-card [username]
-;   (let [props ["comments_received_count" "bio" "shots_count" "can_upload_shot" "followings_count"
-;                "followers_url" "likes_received_count" "avatar_url" "username" "buckets_count"
-;                "pro" "id" "projects_url" "name" "likes_url" "location" "buckets_url" "updated_at"
-;                "html_url" "teams_count" "links" "likes_count" "shots_url" "following_url" "type"
-;                "created_at" "teams_url" "followers_count" "rebounds_received_count" "projects_count"]
-;         class-map (zipmap props (repeatedly #(str (UUID/randomUUID))))]
-;     [:div {:class "dribbble-card"}
-;      (dribbble-card-script class-map username)
-;      [:img (dribbble-attrs class-map "avatar_url" "src")]
-;      [:div
-;       "Shots: "
-;       [:span (dribbble-attrs class-map "shots_count" "innerText"
-;                              :class "shots-count")]]
-;      [:div
-;       "Followers: "
-;       [:span (dribbble-attrs class-map "followers_count" "innerText"
-;                              :class "followers-count")]]]))
-
-
-
 (defn dribbble-card [username]
   (let [props ["comments_received_count" "bio" "shots_count" "can_upload_shot" "followings_count"
                "followers_url" "likes_received_count" "avatar_url" "username" "buckets_count"
@@ -126,6 +105,4 @@
         [:strong (dribbble-attrs class-map "name" "innerText")]]]
       [:div.dribbble-link
        [:a.dribbble-site (dribbble-attrs class-map ["links" "web"] "href")
-        ; [:span "unfold.co"]
-        [:span (dribbble-attrs class-map ["links" "web"] "innerText")]]]]
-     (demo-with-blank-canvas (cdn-path "/blog/private-docs-early-access/grant-access.gif") "Grant someone access with their email address.")]))
+        [:span (dribbble-attrs class-map ["links" "web"] "innerText")]]]]]))


Fixing error with t-norm function for fuzzy logics

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

--- src/conexp/contrib/fuzzy/logics.clj
+++ src/conexp/contrib/fuzzy/logics.clj
@@ -16,7 +16,7 @@
 (defmulti t-norm
   "Returns the t-norm and it's residuum corresponding to the name given."
   {:arglists '[(t-norm-name)]}
-  identity)
+  first)

 (defmethod t-norm :default
   [norm]


Wrong wait arg for ES recovery

Wrong wait arg for ES recovery

--- src/kixi/datastore/elasticsearch.clj
+++ src/kixi/datastore/elasticsearch.clj
@@ -139,7 +139,7 @@
                 (pos? tries))
          (do
            (warn (str "ES exception encountered type: " (:type resp) ", id: " id))
-           (Thread/sleep recoverable-error-attempts)
+           (Thread/sleep recoverable-error-wait)
            (recur (dec tries)))
          resp)))))


Add new to jsth

Add new to jsth

--- src/aurora/compiler/jsth.cljs
+++ src/aurora/compiler/jsth.cljs
@@ -83,6 +83,8 @@
                        (str "(function (" (join ", " (map name->string (nth x 1))) ") {\n"
                             (indent (statement->string (nth x 2))) "\n"
                             "})"))
+   (= "new" (head x)) (do (check (= (count x) 2))
+                        (str "new " (expression->string (nth x 1))))
    (seq? x) (do (check (>= (count x) 1))
               (let [f (expression->string (nth x 0))
                     args (map expression->string (rest x))]


hide too many tweets in ph launch post

hide too many tweets in ph launch post

--- src/pc/views/blog/we_made_precursor_for_teams.clj
+++ src/pc/views/blog/we_made_precursor_for_teams.clj
@@ -74,11 +74,11 @@
     [:figure
      (common/tweet "PrecursorApp" "592941206104985600") ; export
      (common/tweet "PrecursorApp" "592801576714121216") ; voice
-     (common/tweet "PrecursorApp" "586568570298957824") ; github embed
-     (common/tweet "PrecursorApp" "585537704760324099") ; sms
-     (common/tweet "PrecursorApp" "584082725901967360") ; space pan
+     ; (common/tweet "PrecursorApp" "586568570298957824") ; github embed
+     ; (common/tweet "PrecursorApp" "585537704760324099") ; sms
+     ; (common/tweet "PrecursorApp" "584082725901967360") ; space pan
      (common/tweet "PrecursorApp" "582964084850757632") ; replay
-     (common/tweet "PrecursorApp" "582719313410326528") ; text sizing
+     ; (common/tweet "PrecursorApp" "582719313410326528") ; text sizing
      (common/tweet "PrecursorApp" "581525258764754944") ; read only
      (common/tweet "PrecursorApp" "580407786300801024") ; arrows


generate all semantic senses of a verb: use its rather than just by root

--- src/babel/italiano/writer.clj
+++ src/babel/italiano/writer.clj
@@ -19,23 +19,7 @@
 (defn rewrite-lexicon []
   (write-lexicon "it" lexicon))

-(defn generate-one-verb [root-form & [count]]
-  (log/info (str "generating examples with root-form:" root-form))
-  (writer/generate-from-spec
-   small
-   {:root {:italiano {:italiano root-form}}}
-   [{:synsem {:sem {:tense :conditional}}}
-    {:synsem {:sem {:tense :future}}}
-    {:synsem {:sem {:tense :present}}}
-    {:synsem {:sem {:aspect :progressive
-                    :tense :past}}}
-    {:synsem {:sem {:aspect :perfect
-                    :tense :past}}}]
-   [{:gender :masc}
-    {:gender :fem}]
-   [:1st :2nd :3rd]
-   [:sing :plur]
-   count))
+(declare generate-one-verb)

 (defn tutti [ & [count lexeme]]
   (let [count (if count (Integer. count) 10)
@@ -66,8 +50,32 @@
     (log/info (str "generating examples with this many verbs:"
                    (.size tutti)))
     (.size (pmap (fn [verb]
-                   (log/trace (str "verb: " (strip-refs verb)))
+                   (log/debug (str "verb: " (strip-refs verb)))
                    (let [root-form (get-in verb [:italiano :italiano])]
-                     (generate-one-verb root-form count)))
+                     (generate-one-verb (unify
+                                         {:synsem {:sem
+                                                   (get-in verb [:synsem :sem] :top)}}
+                                         {:root {:italiano {:italiano root-form}}})
+                                        count)))
                  tutti))))

+(defn generate-one-verb [spec & [count]]
+  (log/debug (str "generate-one-verb with spec:" spec "; count=" count))
+  (writer/generate-from-spec
+   small
+   (strip-refs spec)
+
+   [{:synsem {:sem {:tense :conditional}}}
+    {:synsem {:sem {:tense :future}}}
+    {:synsem {:sem {:tense :present}}}
+    {:synsem {:sem {:aspect :progressive
+                    :tense :past}}}
+    {:synsem {:sem {:aspect :perfect
+                    :tense :past}}}]
+   [{:gender :masc}
+    {:gender :fem}]
+   [:1st :2nd :3rd]
+   [:sing :plur]
+   count))
+
+


Document job-fn namespace.

Document job-fn namespace.

--- src/fhofherr/simple/core/job_fn.clj
+++ src/fhofherr/simple/core/job_fn.clj
@@ -1,27 +1,37 @@
 (ns fhofherr.simple.core.job-fn
+  "Create and manage Simple CI job functions.
+
+  A job function is the central element of a Simple CI job. In essence it is a
+  function of that takes a [[job-execution-context]], manipulates it, and
+  returns a modified version of it.
+
+  Job functions are created by joining multiple job step functions using
+  the [[make-job-fn]] function. This is the only way to create a job function."
   (:require [clojure.tools.logging :as log]
             [fhofherr.simple.core [job-execution-context :as ex-ctx]]))

 (defn ^:dynamic *log-step-execution*
-  "TODO document me"
+  "Log the execution of a job step. The deault implementation writes an info
+  level message to Simple CI's log file. The return value of this function is
+  ignored."
   [step-desc ctx]
   (if (ex-ctx/failed? ctx)
     (log/info (format "Step %s FAILED!" step-desc))
     (log/info (format "Step %s completed successfully." step-desc))))

 (defn job-step-fn?
-  "TODO document me"
+  "Test if `obj` is a job step function."
   [obj]
   (boolean (::job-step-fn? (meta obj))))

 (defn job-step-description
-  "TODO document me"
+  "Obtain the description of a job step function."
   [obj]
   {:pre [(job-step-fn? obj)]}
   (::job-step-description (meta obj)))

 (defn make-job-step-fn
-  "TODO document me"
+  "Create a job step function."
   [description f]
   {:pre [(fn? f)]}
   (letfn [(step-fn [ctx]


remove TODO

remove TODO

--- test/clj/backtype/storm/transactional_test.clj
+++ test/clj/backtype/storm/transactional_test.clj
@@ -16,8 +16,6 @@
 ;; Testing TODO:
 ;; * Test that it repeats the meta for a partitioned state (test partitioned emitter on its own)
 ;; * Test that partitioned state emits nothing for the partition if it has seen a future transaction for that partition (test partitioned emitter on its own)
-
-;; TODO: test that FailedBatchException works

 (defn mk-coordinator-state-changer [atom]
   (TransactionalSpoutCoordinator.


added test for getting previous reconciled balance

--- test/clj_money/models/reconciliations_test.clj
+++ test/clj_money/models/reconciliations_test.clj
@@ -269,4 +269,27 @@
         reconciliation (reconciliations/find-working storage-spec (:id checking))]
     (is reconciliation "A reconciliation is returned")))

+(def previous-balance-context
+  (assoc reconciliation-context
+         :reconciliations
+         [{:account-id "Checking"
+           :end-of-period (t/local-date 2017 1 1)
+           :balance 1000M
+           :status :completed
+           :item-ids [{:transaction-date (t/local-date 2017 1 1)
+                       :amount 1000M}]}
+          {:account-id "Checking"
+           :end-of-period (t/local-date 2017 1 2)
+           :balance 1500M
+           :status :new
+           :item-ids [{:transaction-date (t/local-date 2017 1 2)
+                       :amount 500M}]}]))
+
+(deftest find-the-previous-reconciled-balance
+  (let [context (serialization/realize storage-spec previous-balance-context)
+        checking (-> context :accounts first)]
+    (is (= 1000M (reconciliations/previous-balance storage-spec (:id checking)))
+        "The previous balance is the balance of the last completed reconciliation")))
+
 ; Test that any given transaction item cannot be included in more than one reconciliation at the validation level
+; Test that the transaction item references the account being reconciled


Update Jetty version to 9.4.31 (fixes #411)

--- ring-jetty-adapter/project.clj
+++ ring-jetty-adapter/project.clj
@@ -7,7 +7,7 @@
   :dependencies [[org.clojure/clojure "1.7.0"]
                  [ring/ring-core "1.8.1"]
                  [ring/ring-servlet "1.8.1"]
-                 [org.eclipse.jetty/jetty-server "9.4.28.v20200408"]]
+                 [org.eclipse.jetty/jetty-server "9.4.31.v20200723"]]
   :aliases {"test-all" ["with-profile" "default:+1.8:+1.9:+1.10" "test"]}
   :profiles
   {:dev  {:dependencies [[clj-http "3.10.0"]]


simple cell grid support

simple cell grid support

Signed-off-by: Yen-Chin Lee <082d453d72dce940e12089a4ad48b97cfe1f3ec4@gmail.com>

--- src/clj/brains_brain/core.clj
+++ src/clj/brains_brain/core.clj
@@ -1,23 +1,49 @@
 (ns brains-brain.core
-  (:require [seesaw.core :refer :all])
+  (:require [seesaw.core :refer :all]
+            [seesaw.graphics :refer [draw rect style]]
+            [seesaw.border :refer [line-border]]
+            [clojure.string :as str]
+            )
   (:gen-class))

 (native!)

+;; actual board size is 90 x 90
+(def board-size 180)

-(def main-frame
-  (frame :title "Brian's Brain" :on-close :exit))
+;; board size with grid
+(def size (+ 3 (* 2 (- board-size 1))))

-(def field-x (text "1"))
-(def field-y (text "2"))

-(def result-label (label ""))
+(defn draw-grid [c g]
+  (let [cellw 3
+        cellh 3
+        ]
+    (doseq [x (range 1 size 2)
+            y (range 1 size 2)]
+      (draw g
+            (rect x y 1 1)
+            (style :background :white ;; "#F03232"
+                   )
+            )
+      )))

-(config! main-frame :content
-         (border-panel
-          :north (horizontal-panel :items [field-x field-y])
-          :center result-label
-          :border 5))
+(defn make-ui
+  []
+  (config!
+   (frame :title "Brian's Brain" :on-close :exit)
+   :content (border-panel
+             :center (canvas :id :canvas
+                             ;; :size [270 :by 270]
+                             :size [ size :by size ]
+                             :background :black
+                             :border (line-border :thickness 2 :color :white)
+                             :paint draw-grid
+                             )
+             :border 5)
+   ))
+

 (defn -main [& args]
-  (-> main-frame pack! show!))+  (let [ui (make-ui)]
+    (-> ui pack! show!)))


Added submaps procedure.

Added submaps procedure.

--- src/clj/clongra/core/algo.clj
+++ src/clj/clongra/core/algo.clj
@@ -351,6 +351,17 @@
   ([coll]
      (powerset-eseq clojure.core/identity ;; enthtrans
                     coll)))
+
+
+;; SUBMAPS (BASED ON POWERSET OF KEYS)
+
+(defn submaps ;:- {} -> ({})
+  "Returns all submaps of m, including m (first) and {} (last)."
+  [m]
+  (when (boolean-not (map? m))
+    (throw (IllegalArgumentException. "m|(map? m) required")))
+
+  (->> m keys powerset (map #(apply dissoc m %))))

 ;; CARTESIAN PRODUCT


Only start download supervisor if we actually have shard loaders and a download throttle.

--- src/clj/elephantdb/loader.clj
+++ src/clj/elephantdb/loader.clj
@@ -119,6 +119,7 @@
     (future
       (log-message "Starting download supervisor")
       (reset! (:finished-loaders state) 0)
-      (if (> max-kbs 0) ;; only monitor if there's an actual download throttle
+      (if (and (> amount-shards 0) ;; only monitor if there's an actual download throttle
+               (> max-kbs 0))      ;; and shards to be downloaded
         (supervise-downloads amount-shards max-kbs-val interval-ms state))
       (log-message "Download supervisor finished"))))


moved test files up to top.

moved test files up to top.

--- src/clj/forma/source/fire.clj
+++ src/clj/forma/source/fire.clj
@@ -4,6 +4,9 @@
         [forma.source.modis :only (latlon->modis)])
   (:require [forma.hadoop.predicate :as p]
             [cascalog.ops :as c]))
+
+(def prepath "/Users/sritchie/Desktop/FORMA/FIRE/")
+(def testfile (str prepath "MCD14DL.2011074.txt"))

 (defmapop [format-datestring [t-res]]
   [datestring]
@@ -32,9 +35,6 @@
         (c/max ?kelvin :> ?max-t)
         (c/count ?fire-count))))

-(def prepath "/Users/sritchie/Desktop/FORMA/FIRE/")
-(def testfile (str prepath "MCD14DL.2011074.txt"))
-
 (defn run-rip
   "Rips apart fires!"
   [count]


Fluidum

Fluidum

--- src/clj/mokkameister/brew.clj
+++ src/clj/mokkameister/brew.clj
@@ -31,6 +31,7 @@
    ["nespressomaskina" 5]
    ["grutkokaren" 5]
    ["grutpresså" 5]
+   ["fluidumgeneratoren" 5]
    ["kaffikokaren" 30]])

 (defn- coffee-message-starting [{:keys [brew-time]} today-count]


weird goog/base.js appearing in clsure third party jar

--- src/clj/shadow/cljs/build.clj
+++ src/clj/shadow/cljs/build.clj
@@ -367,7 +367,7 @@
     (throw (ex-info "finalize config first" {})))

   (println "Compiling cljs.core")
-  (when-not (get-in state [:sources "goog/base.js"])
+  (when-not (get-in state [:sources goog-base-name])
      (throw (ex-info (str "couldn't find " goog-base-name) {})))

   (time
@@ -689,10 +689,14 @@
             (json/write-str))))))

 (defn closure-defines-and-base [{:keys [public-path] :as state}]
-  (let [goog-base (get-in state [:sources "goog/base.js" :js-source])]
+  (let [goog-base (get-in state [:sources goog-base-name :js-source])]
     (when-not (seq goog-base)
       (throw (ex-info "no goog/base.js" {})))
-
+
+    (when (< (count goog-base) 500)
+      (throw (ex-info "probably not the goog/base.js you were expecting"
+                      (get-in state [:sources goog-base-name]))))
+
     ;; TODO: defines should be actually defineable
     (str "var CLOSURE_NO_DEPS = true;\n"
          ;; goog.findBasePath_() requires a base.js which we dont have


Fiddle order and whitespace.

Fiddle order and whitespace.

--- src/kolmogorov_music/kolmogorov.clj
+++ src/kolmogorov_music/kolmogorov.clj
@@ -45,27 +45,27 @@

 (comment (take 10000 (repeat (* 1000 1000 1000 1000) \G)))

-(defmacro description-length [expr]
-  (-> expr print-str count))
+
+(defmacro description-length [expression]
+  (-> expression print-str count))
+
+(defn result-length [expression]
+  (-> expression print-str count))
+

 (fact "The description-length is how long the string representation of the expression is."
   (description-length (repeat 65 \G)) => 13)

-(defn result-length [result]
-  (-> result print-str count))
-
 (fact "The result-length is how long the string representation of the evaluated result is."
   (result-length (repeat 65 \G)) => 131)

-(defmacro randomness [expr]
-  `(/ (description-length ~expr) (result-length ~expr)))
+
+(defmacro randomness [expression]
+  `(/ (description-length ~expression) (result-length ~expression)))

 (fact "Kolmogorov randomness is the compression ratio between the description and the result."
   (randomness (repeat 65 \G)) => 13/131
   (randomness (->> 71 char repeat first)) => 26)
-
-
-

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Analysis by compression ;;;
@@ -96,6 +96,7 @@
   (live/jam (var row-row))
 )

+
 (defmacro definitionally [macro sym]
   (let [value (-> sym repl/source-fn read-string last)]
     `(~macro ~value)))
@@ -104,7 +105,6 @@
   (definitionally description-length row-row) => 281
   (definitionally result-length row-row) => 2037
   (definitionally randomness row-row) => 281/2037)
-

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; The Library of Babel ;;;


correct number format for period count

correct number format for period count

--- src/clj_money/web/budgets.clj
+++ src/clj_money/web/budgets.clj
@@ -79,7 +79,8 @@
     (select-field budget :period [{:value :week    :caption "Week"}
                                   {:value :month   :caption "Month"}
                                   {:value :quarter :caption "Quarter"}])
-    (number-input-field budget :period-count)
+    (number-input-field budget :period-count {:step "1"
+                                              :format-fn #(format-number % {:format :integer})})
     (text-input-field budget :start-date {:class "date-field"
                                           :format-fn format-date})
     [:button.btn.btn-primary {:type :submit} "Save"]


Make traversing ocean and surf decrease will to live

--- src/cljc/robinson/update.cljc
+++ src/cljc/robinson/update.cljc
@@ -1921,67 +1921,73 @@
 (defn decrease-will-to-live
   "Decrease the player's will-to-live depending on circumstances."
   [state]
-  (if (= (rw/current-state state) :sleep)
-    (let [[cell _ _] (rw/player-cellxy state)
-          bedroll?   (contains? (set (map :id (get cell :items []))) :bedroll)]
+  (let [[cell _ _] (rw/player-cellxy state)
+        bedroll?   (contains? (set (map :id (get cell :items []))) :bedroll)
+        in-water?  (contains? #{:ocean :surf} (get cell :type))]
+    (if (= (rw/current-state state) :sleep)
       (if bedroll?
         (rp/player-update-wtl state
           (fn [will-to-live] (+ 0.05 will-to-live)))
-        state))
-    (-> state
-      (rp/player-update-wtl
-        (fn [will-to-live]
-          (let [dwtl       0.001 ;; you've been on the island. It sucks and you want to get off.
-                ;; if it is night and the player is not within range of a fire, things are extra tough.
-                dwtl       (if (and (rw/is-night? state)
-                                    (not-any? #(= (get % :type) :fire)
-                                              (rw/cells-in-range-of-player state 3)))
-                             (+ dwtl 0.002)
-                             dwtl)
-                hp         (rp/player-hp state)
-                max-hp     (rp/player-max-hp state)
-                _          (log/info "hp" hp "max-hp" max-hp)
-                dwtl       (+ dwtl (if (> 0.5 (/ hp max-hp))
-                                     0.1
-                                     0))
-                hunger     (rp/player-hunger state)
-                max-hunger (rp/player-max-hunger state)
-                _          (log/info "hunger" hunger "max-hunger" max-hunger)
-                dwtl       (+ dwtl (if (> (/ hunger max-hunger) 0.8)
-                                     0.1
-                                     0))
-                thirst     (rp/player-thirst state)
-                max-thirst (rp/player-max-thirst state)
-                _          (log/info "thirst" thirst "max-thirst" max-thirst)
-                dwtl       (+ dwtl (if (> (/ thirst max-thirst) 0.5)
-                                     0.1
-                                     0))
-                wounded    (rp/player-wounded? state)
-                _          (log/info "wounded" wounded)
-                dwtl       (+ dwtl (if wounded
-                                     0.21
-                                     0))
-                poisoned   (rp/player-poisoned? state)
-                _          (log/info "poisoned" poisoned)
-                dwtl       (+ dwtl (if poisoned
-                                     0.3
-                                     0))
-                infected   (rp/player-infected? state)
-                _          (log/info "infected" infected)
-                dwtl       (+ dwtl (if infected
-                                     0.41
-                                     0))]
-          (log/info "dwtl" dwtl "will-to-live" will-to-live)
-          (- will-to-live dwtl))))
-      (update-in [:world :player :status]
-                 (fn [status]
-                   (set (if (neg? (rp/player-wtl state))
-                          (conj status :dead)
-                          status))))
-      (as-> state
-        (if (rp/player-status-contains? state :dead)
-          (rp/update-player-died state :zero-will-to-live)
-          state)))))
+        state)
+      (-> state
+        (rp/player-update-wtl
+          (fn [will-to-live]
+            (let [dwtl       0.001 ;; you've been on the island. It sucks and you want to get off.
+                  ;; if it is night and the player is not within range of a fire, things are extra tough.
+                  dwtl       (if (and (rw/is-night? state)
+                                      (not-any? #(= (get % :type) :fire)
+                                                (rw/cells-in-range-of-player state 3)))
+                               (+ dwtl 0.002)
+                               dwtl)
+                  ;; in water, cold and wet - less will to live.
+                  dwtl       (+ dwtl
+                                (if in-water?
+                                  0.1
+                                  0))
+                  hp         (rp/player-hp state)
+                  max-hp     (rp/player-max-hp state)
+                  _          (log/info "hp" hp "max-hp" max-hp)
+                  dwtl       (+ dwtl (if (> 0.5 (/ hp max-hp))
+                                       0.1
+                                       0))
+                  hunger     (rp/player-hunger state)
+                  max-hunger (rp/player-max-hunger state)
+                  _          (log/info "hunger" hunger "max-hunger" max-hunger)
+                  dwtl       (+ dwtl (if (> (/ hunger max-hunger) 0.8)
+                                       0.1
+                                       0))
+                  thirst     (rp/player-thirst state)
+                  max-thirst (rp/player-max-thirst state)
+                  _          (log/info "thirst" thirst "max-thirst" max-thirst)
+                  dwtl       (+ dwtl (if (> (/ thirst max-thirst) 0.5)
+                                       0.1
+                                       0))
+                  wounded    (rp/player-wounded? state)
+                  _          (log/info "wounded" wounded)
+                  dwtl       (+ dwtl (if wounded
+                                       0.21
+                                       0))
+                  poisoned   (rp/player-poisoned? state)
+                  _          (log/info "poisoned" poisoned)
+                  dwtl       (+ dwtl (if poisoned
+                                       0.3
+                                       0))
+                  infected   (rp/player-infected? state)
+                  _          (log/info "infected" infected)
+                  dwtl       (+ dwtl (if infected
+                                       0.41
+                                       0))]
+            (log/info "dwtl" dwtl "will-to-live" will-to-live)
+            (- will-to-live dwtl))))
+        (update-in [:world :player :status]
+                   (fn [status]
+                     (set (if (neg? (rp/player-wtl state))
+                            (conj status :dead)
+                            status))))
+        (as-> state
+          (if (rp/player-status-contains? state :dead)
+            (rp/update-player-died state :zero-will-to-live)
+            state))))))

 (defn log-will-to-live-flavor
   "Log a flavor message when will-to-live increases or decreases by a lot."


Remove those silly declares

Remove those silly declares

--- src/cljs/iframe_app/core.cljs
+++ src/cljs/iframe_app/core.cljs
@@ -21,10 +21,6 @@
                                        :slave-fields #{}
                                        :user-type    :agent
                                        :ticket-form  nil}}))
-
-(declare render-state)
-(declare init-state)
-(declare will-mount)

 (defn remove-condition
   "Takes a list of conditions, and returns all the ones that don't include


Add color input and flesh out line/room prop choosers.

--- src/cljs/mazes/web/views.cljs
+++ src/cljs/mazes/web/views.cljs
@@ -49,6 +49,24 @@
          :max max
          :on-change #(dispatch [:update :size-spacing-ratio (/ % 100)])]]])))

+;; Given a keypath such as [:top] or [:top :node :leaf], returns an input field
+;; which accepts only a color hex, which alters this value in the app db.
+(defn color [ks {:keys [label]}]
+  (let [value (subscribe [(first ks)])
+        target-value (fn [top] (get-in top (rest ks)))]
+    (fn []
+      [re-com/v-box
+       :children
+       [[re-com/label :label label]
+        [re-com/input-text
+         :model (target-value @value)
+         :on-change #(dispatch [:update ks %])
+         ]
+        ]]
+      )
+    )
+  )
+
 (def rounded-panel
   (merge {:background-color "white"
           :border           "1px solid lightgray"
@@ -69,7 +87,8 @@
        :panel-1
        [re-com/v-box
         :style (merge rounded-panel
-                      {:width "100%"})
+                      {:width "100%"
+                       :overflow "auto"})
         :gap "2rem"
         :children
         [[:h2 "Left Pane"]
@@ -81,8 +100,11 @@
          [size-spacing-ratio-slider {:label "Size/Spacing Ratio" :min 25 :max 75}]
          [:h3 "Lines"]
          [slider [:line-attributes :stroke-width] {:label "Thickness" :min 1 :max 100}]
+         [color [:line-attributes :stroke] {:label "Color"}]
          [:h3 "Rooms"]
-         ; TODO
+         [slider [:rect-attributes :stroke-width] {:label "Stroke Thickness" :min 1 :max 100}]
+         [color [:rect-attributes :stroke] {:label "Stroke Color"}]
+         [color [:rect-attributes :fill] {:label "Fill Color"}]
          [re-com/button
           :label "Generate Maze"
           :on-click #(dispatch [:generate-maze])]


Fix bug found when every article has the same refs

--- src/clojournal/models/tag.clj
+++ src/clojournal/models/tag.clj
@@ -27,5 +27,5 @@
      (when (seq refs)
        (let [min (double (apply min refs))
              max (double (apply max refs))
-             f (fn [n] (/ (- n min) (- max min)))]
+             f (fn [n] (if (= min max) 1 (/ (- n min) (- max min))))]
          (map #(assoc % :group (f (:refs %))) tags))))))


fix Wrong method implementation of count in sql.clj #54

fix Wrong method implementation of count in sql.clj #54

--- src/clojure/sparkling/sql.clj
+++ src/clojure/sparkling/sql.clj
@@ -76,7 +76,7 @@
 (defn count
   "grouped data count"
   [cols grouped-data]
-  (.max grouped-data (into-array cols)))
+  (.count grouped-data (into-array cols)))

 (defn max
   "grouped data max"