added more on testing...datomic

added more on testing...datomic

--- src/tutorial/untangled_tutorial/K_Testing.cljs
+++ src/tutorial/untangled_tutorial/K_Testing.cljs
@@ -187,6 +187,67 @@
   the above indicates that when `f` is called it will schedule `(g)` to run 200ms from \"now\" and `(h)` to run
   300ms from \"now\". Then `f` will return `true`.

+  ## Datomic Testing Support
+
+  NOTE: Requires `untangled-datomic` in your project file.
+
+  Untangled includes top-notch utilities for doing focused integration tests against an in-memory database. This
+  allows you to quickly get your low-level database code correct without having to mess with a UI or full stack.
+
+  ### Database fixtures
+
+  The `with-db-fixture` macro creates an in-memory database with a schema of your Datomic migrations. It supports
+  the following:
+
+  - Running your migrations on an in-memory database localized to your test
+  - Seeding that database via a function you supply (which just returns transaction data)
+    - Returning a map from temporary ids in your seed data to real datomic ids in the resulting database
+
+  #### Seed functions
+
+  The seed function is very simple: Just return a list of legal Datomic transaction, but use `:datomic.id/X` in
+  place of database IDs anywhere they make sense! This allows you to create any graph of data you need:
+
+  ```
+  (defn seed1 []
+     [{:db/id :datomic.id/thing :thing/name \"Boo\" }
+      {:db/id :datomic.id/list :list/things #{:datomic.id/thing}}])
+
+  (specification \"Boo\"
+    (with-db-fixture db
+       (behavior ...)
+       :migrations \"namespace.of.migrations\"
+       :seed-fn seed1))
+  ```
+
+  The fact that the seed is a function means you can compose your seed functions for quick, DRY test data generation.
+
+  To get the remapped IDs, it helps to use something like this:
+
+  ```
+  (defn db-fixture-defs
+    \"Given a db-fixture returns a map containing:
+    `connection`: a connection to the fixture's db
+    `get-id`: give it a temp-id from seeded data, and it will return the real id from seeded data\"
+    [fixture]
+    (let [connection (udb/get-connection fixture)
+          tempid-map (:seed-result (udb/get-info fixture))
+          get-id (partial get tempid-map)]
+      {:connection connection
+       :get-id     get-id}))
+  ```
+
+  which can be combined into it like this:
+
+  ```
+  (with-db-fixture fixture
+     (let [{:keys [connection get-id]} (db-fixture-defs fixture)
+           thing-id (get-id :datomic.id/thing)
+           thing (d/entity (d/db connection) thing-id)]
+           ; check out thing
+       ))
+  ```
+
   ## Protocol Testing

   Untangled client and server include utilities to help you test network protocols without a network. The idea is to
@@ -197,3 +258,5 @@
   TODO: Document this...
   ")

+
+


:zap: Throttle layers rendering.

:zap: Throttle layers rendering.

--- frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs
+++ frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs
@@ -19,10 +19,11 @@
    [uxbox.main.data.workspace :as dw]
    [uxbox.main.refs :as refs]
    [uxbox.main.store :as st]
-   [uxbox.main.ui.components.defer :refer [deferred]]
+   [uxbox.main.ui.components.defer :refer [throttle deferred]]
    [uxbox.main.ui.hooks :as hooks]
    [uxbox.main.ui.keyboard :as kbd]
    [uxbox.main.ui.shapes.icon :as icon]
+   [uxbox.util.object :as obj]
    [uxbox.util.dom :as dom]
    [uxbox.util.timers :as ts]
    [uxbox.util.i18n :as i18n :refer [t]]
@@ -237,24 +238,11 @@
   [props]
   [:> layer-item props])

-(def ^:private layers-objects
-  (letfn [(strip-data [obj]
-            (select-keys obj [:id :name :blocked :hidden :shapes :type]))
-          (selector [{:keys [objects] :as data}]
-            (persistent!
-             (reduce-kv (fn [res id obj]
-                          (assoc! res id (strip-data obj)))
-                        (transient {})
-                        objects)))]
-  (l/derived selector refs/workspace-data =)))
-
 (mf/defc layers-tree
-  {::mf/wrap [mf/memo]}
-  []
+  {::mf/wrap [#(mf/memo % =)]}
+  [{:keys [objects] :as props}]
   (let [selected (mf/deref refs/selected-shapes)
-        objects (mf/deref layers-objects)
         root (get objects uuid/zero)]
-    ;; [:& perf/profiler {:label "layers-tree" :enabled false}
     [:ul.element-list
      (for [[index id] (reverse (d/enumerate (:shapes root)))]
        (let [obj (get objects id)]
@@ -272,16 +260,30 @@
              :objects objects
              :key id}])))]))

+(defn- strip-objects
+  [objects]
+  (let [strip-data #(select-keys % [:id :name :blocked :hidden :shapes :type])]
+    (persistent!
+     (reduce-kv (fn [res id obj]
+                  (assoc! res id (strip-data obj)))
+                (transient {})
+                objects))))
+
+(mf/defc layers-tree-wrapper
+  {::mf/wrap-props false
+   ::mf/wrap [#(throttle % 200) mf/memo]}
+  [props]
+  (let [objects (obj/get props "objects")
+        objects (strip-objects objects)]
+    [:& layers-tree {:objects objects}]))

 ;; --- Layers Toolbox
-
-;; NOTE: we need to consider using something like react window for
-;; only render visible items instead of all.

 (mf/defc layers-toolbox
   {:wrap [mf/memo]}
   [{:keys [page] :as props}]
-  (let [locale (i18n/use-locale)
+  (let [locale   (mf/deref i18n/locale)
+        data     (mf/deref refs/workspace-data)
         on-click #(st/emit! (dw/toggle-layout-flag :layers))]
     [:div#layers.tool-window
      [:div.tool-window-bar
@@ -289,4 +291,5 @@
       [:span (:name page)]
       #_[:div.tool-window-close {:on-click on-click} i/close]]
      [:div.tool-window-content
-      [:& layers-tree {:key (:id page)}]]]))
+      [:& layers-tree-wrapper {:key (:id page)
+                               :objects (:objects data)}]]]))


[#1212] Round aggregation to 5 places

[#1212] Round aggregation to 5 places

--- backend/src/akvo/lumen/lib/visualisation/map_config.clj
+++ backend/src/akvo/lumen/lib/visualisation/map_config.clj
@@ -161,7 +161,7 @@
     (format "
             SELECT
               %s
-              _aggregation,
+              round(_aggregation, 5) as _aggregation,
               shapefill,
               %s.%s
             FROM


lein: update cider to unstable version

lein: update cider to unstable version

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1 +1,3 @@
-{:user {:plugins [[cider/cider-nrepl "0.9.1"]]}}
+{:user {:plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]]}
+ :repl {:dependencies [[org.clojure/tools.nrepl "0.2.12"]]} ;emacs cider want specific repl <https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#replacing-default-repl-dependencies>
+ }


Added region-query-serial

Added region-query-serial

--- src/pscan/core.clj
+++ src/pscan/core.clj
@@ -1,6 +1,41 @@
-(ns pscan.core)
+(ns pscan.core
+  (:require [clojure.core.reducers :as r]
+            [clojure.set :as s]))

-(defn foo
-  "I don't do a whole lot."
-  [x]
-  (println x "Hello, World!"))
+(def pts [[0 0] [0 1] [0 2] [1 0] [1 1] [1 2] [2 0] [2 1] [2 2]])
+
+(defn r2-dist
+  "Euclidian distance for points in R^2 (for testing)
+   pt is a vector of length 2"
+  [a b]
+  (if (or (nil? a) (nil? b))
+    Double/POSITIVE_INFINITY
+  ;else
+    (let [dx (- (a 0) (b 0))
+          dy (- (a 1) (b 1))]
+      (Math/sqrt (+ (* dx dx) (* dy dy))))))
+
+(defn region-query-serial
+  "Serial region query; returns all pts within eps of pt by metric."
+  [pt pts metric eps]
+  (letfn [(is-local? [x] (<= (metric pt x) eps))]
+    (into [] (filter is-local? pts))))
+
+
+(comment
+(def x (into [] (take 10000000 (repeatedly rand))))
+
+(time (into [] (filter #(> % 0.999999) x)))
+
+(time (into #{} (filter #(> % 0.999999) x)))
+
+(time (r/fold (r/monoid into vector) conj (r/filter #(> % 0.999999) x)))
+
+(time (r/fold (r/monoid into hash-set) conj (r/filter #(> % 0.999999) x)))
+
+(time (r/fold (r/monoid s/union hash-set) conj (r/filter #(> % 0.999999) x)))
+
+(region-query-serial [0 0] pts r2-dist 2)
+
+  )
+


working solution

working solution

--- src/hackerrank/security/security_key_spaces.clj
+++ src/hackerrank/security/security_key_spaces.clj
@@ -9,18 +9,21 @@
   (Integer/parseInt string))

 ;; solution idea:
+;; shift after n times

 (defn key-spaces
   ([]
-    (def before (seq "0123456789"))
-    (def after (seq "1234567890"))
-    (def zipped (into {} (map hash-map before after)))
-    (let [message (trim (read-line))
-          e (parseInt (read-line))]
-      (apply str (map zipped (seq message)))))
+   (let [message (trim (read-line))
+         e (parseInt (read-line))
+
+         before (seq "0123456789")
+         after (take (count before) (drop e (cycle before)))
+         zipped (into {} (map hash-map before after))]
+
+      (join (map zipped (seq message)))))

   ([input]
    (with-in-str input
      (key-spaces))))

-(key-spaces "391\n2")+(key-spaces "391\n3")


CMR-1901: Re-added 'deleted' to argument list

--- indexer-app/src/cmr/indexer/data/concepts/collection.clj
+++ indexer-app/src/cmr/indexer/data/concepts/collection.clj
@@ -49,7 +49,7 @@
 (defn- get-elastic-doc-for-full-collection
   "Get all the fields for a normal collection index operation."
   [context concept collection]
-  (let [{:keys [concept-id revision-id provider-id native-id revision-date format]} concept
+  (let [{:keys [concept-id revision-id provider-id native-id revision-date deleted format]} concept
         {{:keys [short-name long-name version-id processing-level-id collection-data-type]} :product
          :keys [entry-id entry-title summary temporal related-urls spatial-keywords associated-difs
                 temporal-keywords access-value personnel distribution]} collection


Added url-encoding & default topic

Added url-encoding & default topic

--- src/mickopedia/core.clj
+++ src/mickopedia/core.clj
@@ -1,5 +1,6 @@
 (ns mickopedia.core
   (:require
+   [bidi.bidi :refer [url-encode]]
    [yada.yada :refer [listener resource as-resource] :as yada]
    [yada.resources.classpath-resource :refer [new-classpath-resource]]
    [mickopedia.mickify :refer [mickify]])
@@ -16,7 +17,9 @@
                     :response (fn [ctx]
                                 (let [{:keys [topic]}
                                       (get-in ctx [:parameters :query])]
-                                  (mickify topic)))}}}))
+                                  (if (not= topic "")
+                                    (mickify (url-encode topic))
+                                    (mickify (url-encode "St Patrick")))))}}}))

 (def handler
   "A BIDI map of URLs to resources."


Temporarily set :undeclared-var as non-fatal

--- planck-cljs/script/build.clj
+++ planck-cljs/script/build.clj
@@ -11,7 +11,7 @@
     (transit/write writer cache)
     (spit (io/file out-path) (.toString out))))

-(def non-fatal-warnings #{:protocol-impl-recur-with-target})
+(def non-fatal-warnings #{:undeclared-var :protocol-impl-recur-with-target})

 (cljs.analyzer/with-warning-handlers
   [(fn [warning-type env extra]


Change serve image route fn to handle request

--- src/silly_image_store/handler.clj
+++ src/silly_image_store/handler.clj
@@ -13,19 +13,19 @@
   (route/not-found (str "No image '" image "' found")))

 ; TODO refactor links stuff
-(defn list-images [{scheme :scheme, {host "host"} :headers}]
+(defn- list-images-route [{scheme :scheme, {host "host"} :headers}]
   (let [image-names (store/list-images images-dir)
         base-url (str (name scheme) "://" host "/images/")
         to-json (fn [n] {:name n :link (str base-url n)})]
     (map to-json image-names)))

-(defn serve-image [image]
+(defn- serve-image-route [{{image :image} :params}]
   (let [image-file (store/load-image images-dir image)]
     (or image-file (image-not-found image))))

 (defroutes app-routes
-  (GET "/images" request list-images)
-  (GET "/images/:image" [image] (serve-image image)) ; TODO handler as list-image
+  (GET "/images" request list-images-route)
+  (GET "/images/:image" request serve-image-route)
   (route/resources "/")
   (route/not-found "Not Found"))


CIDER no longer requires global injection

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,8 +1,7 @@
 {:user #=(merge
           {:plugins [[lein-try "0.4.1"]
                      [lein-pprint "1.1.1"]
-                     [lein-datomic-pro "0.0.1-SNAPSHOT"]
-                     [cider/cider-nrepl "0.10.0-SNAPSHOT"]]}
+                     [lein-datomic-pro "0.0.1-SNAPSHOT"]]}
           #=(eval (try (read-string (slurp (str (System/getProperty "user.home")
                                                 "/.config/datomic.clj")))
                        (catch Exception e {}))))}


Update lein config.

Update lein config.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1 +1,5 @@
-{:user {:plugins [[lein-pprint "1.2.0"]]}}
+{:user {:dependencies [[pjstadig/humane-test-output "0.8.3"]]
+        :injections [(require 'pjstadig.humane-test-output)
+                     (pjstadig.humane-test-output/activate!)]
+        :plugins [[lein-ancient "0.6.12"]
+                  [lein-pprint "1.2.0"]]}}


add effect-queue, effect-messages and service-fn

--- src/rohm/core.cljs
+++ src/rohm/core.cljs
@@ -5,6 +5,7 @@

 ;; Pedestal style input queue
 (def ^:private input-queue (chan))
+(def ^:private effect-queue (chan))

 ;; Pedestal style route resolver
 (defn- de-route [type topic routes]
@@ -13,32 +14,45 @@

 ;; Pedestal style route resolver
 (defn- handle-mesg [{:keys [type topic] :as mesg} app-state routes]
-  (let [old-value (get-in @app-state topic)]
+  (let [old-value (if topic (get-in @app-state topic))]
     (if-let [func (de-route type topic routes)]
       (let [new-value (func old-value mesg)]
+        ;(.info js/console (pr-str "handle-mesg topic " topic new-value))
         (swap! app-state update-in topic (fn [_ nv] nv) new-value)
         )
       (.warn js/console (pr-str "handle-mesg: no routing for " type topic)))))

-;; called from the web-app in the will-mount function of the overall app
+(defn- handle-effect-mesg [{:keys [type topic] :as mesg} service]
+  (service mesg input-queue)
+  )
+
 (defn handle-messages
   "Call this in your app's will-mount function with your global state (atom) and routes table (Pedestal
-  style vector-of-vectors)."
-  [app-state routes]
+  style vector-of-vectors).
+  Optionally takes a service-fn that receives a message from the effect queue.
+  service-fn can do remote services calls and put results with put-msg"
+  [app-state routes & [service]]
   (go (while true
-        (handle-mesg (<! input-queue) app-state routes))))
+        (handle-mesg (<! input-queue) app-state routes)))
+  (when service
+    (go (while true
+          (handle-effect-mesg (<! effect-queue) service)))))

 (defn put-msg
   "Puts a Pedestal style message onto the input-queue.
   The type is a keyword and the topic is resolved as the path part of the cursor."
-  [type cursor & opts]
-  ;(.info js/console (pr-str "put-msg " type cursor opts))
-  (put! input-queue (merge {:type type :topic (:om.core/path (meta cursor))} opts)))
+  [type cursor-or-topic & opts]
+  (put! input-queue (merge {:type type :topic (or (:om.core/path (meta cursor-or-topic)) cursor-or-topic)} opts)))

 (defn extract-refs
   "Helper to extract all the refs of the owner into a map of their keywordized names and values."
   [owner]
   (let [ks (keys (js->clj (.-refs owner)))
         m (into {} (map #(vector (keyword %) (.-value (om/get-node owner %))) ks))]
-    ;(.info js/console (pr-str "handle-submit " ks m))
     m))
+
+(defn effect-messages
+  "Pedestal style: pass effect messages produced by effect functions to the effect-queue"
+  [messages]
+  (doseq [mesg messages]
+    (put! effect-queue mesg)))


fix dependency conflict (#1115)

fix dependency conflict (#1115)

--- db-binding/build.boot
+++ db-binding/build.boot
@@ -42,6 +42,14 @@
                    [org.elasticsearch.client/transport]
                    [ring/ring-json]
                    [superstring]
+
+                   ;;
+                   ;; This dependency is included explicitly to avoid having
+                   ;; ring/ring-json pull in an old version of ring-core that
+                   ;; conflicts with the more recent one.
+                   ;;
+                   [ring/ring-core]
+

                    ;; boot tasks
                    [boot-environ]


Add usage option.

Add usage option.

--- src/cavm/core.clj
+++ src/cavm/core.clj
@@ -97,6 +97,7 @@

 (def ^:private argspec
   [["-s" "Start web server" :flag true :default false]
+   ["-h" "--help" "Show help" :default false :flag true]
    ["-d" "Database to use" :default "file:///data/TCGA/craft/h2/cavm.h2"]
    ["-t" "Load test data  <name> <samples> <probes>" :flag true]])

@@ -104,6 +105,7 @@
   (let [[opts extra usage] (apply cli (cons args argspec))]
     (with-db (create-db (:d opts))
       (cond
+        (:help opts) (println usage)
         (:s opts) (serv)
         (:t opts) (if (not (= 3 (count extra)))
                     (println usage)


Fix test code

Fix test code

--- test/cljam/io/bigwig_test.clj
+++ test/cljam/io/bigwig_test.clj
@@ -177,7 +177,7 @@
        (= (:auto-sql ah) (:auto-sql bh))
        (= (:extended-header ah) (:extended-header bh))
        (= (:bpt-header ah) (:bpt-header bh))
-       (apply = (map #(map (juxt :name :id :size) (:bbi-chrom-info %))) [ah bh])
+       (apply = (map #(map (juxt :name :id :size) (:bbi-chrom-info %)) [ah bh]))
        (= (:cir-tree ah) (:cir-tree bh))
        (let [eps 1e-4
              x (:total-summary ah)


index possibly-publishes-as field in person

--- src/wb_es/datomic/data/person.clj
+++ src/wb_es/datomic/data/person.clj
@@ -11,8 +11,10 @@
   (data [this]
     {:wbid (:person/id entity)
      :label (:person/standard-name entity)
-     :other_names (cons (:person/full-name entity)
-                        (:person/also-known-as entity))
+     :other_names (concat [(:person/full-name entity)]
+                          (:person/also-known-as entity)
+                          (->> (:person/possibly-publishes-as entity)
+                               (map :author/id)))
      :institution (->> (:person/address entity)
                        (:address/institution)
                        (clojure.string/join "\n"))}))


Generate random uuid for kafka client

Generate random uuid for kafka client

--- src/zoo_event/component/kafka.clj
+++ src/zoo_event/component/kafka.clj
@@ -5,10 +5,12 @@
             [com.stuartsierra.component :as component]
             [cheshire.core :refer [parse-string]]))

+(defn uuid [] (str (java.util.UUID/randomUUID)))
+
 (defn- kafka-config
   [zk group-id]
   {"zookeeper.connect" zk
-   "group.id" group-id
+   "group.id" uuid
    "auto.offset.reset" "largest"
    "auto.commit.enable" "true"})


fast-image-saving-test

fast-image-saving-test

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

--- acqEngine/src/org/micromanager/test.clj
+++ acqEngine/src/org/micromanager/test.clj
@@ -4,7 +4,8 @@
            (mmcorej TaggedImage)
            (org.json JSONArray JSONObject)
            (org.micromanager MMStudioMainFrame)
-           (org.micromanager.api DataProcessor))
+           (org.micromanager.api DataProcessor)
+           (org.micromanager.acquisition TaggedImageStorageMultipageTiff))
   (:require [org.micromanager.mm :as mm])
   (:use [org.micromanager.mm :only (edt load-mm core gui mmc)]))

@@ -211,26 +212,44 @@
       (when (zero? (mod i 100))
         (println i "|" (core getRemainingImageCount) "|" (count queue))))))

-
 (defn image-test-summary [filename num-frames]
-  (JSONObject. {"SlicesFirst" true
-                "TimeFirst" true
-                "NumSlices" 1
-                "NumPositions" 1
-                "NumChannels" 1
-                "NumFrames" num-frames
-                "Positions" 1
-                "PixelType" (mm/get-pixel-type)
-                "Width" (core getImageWidth)
-                "Height" (core getImageHeight)
-                "Prefix" filename
-                "ChColors" (JSONArray. [1])
-                "ChNames" (JSONArray. ["ch"])
-                "ChMins" (JSONArray. [0])
-                "ChMaxes" (JSONArray. [100])}))
+  (mm/to-json
+    {"SlicesFirst" true
+     "TimeFirst" true
+     "NumSlices" 1
+     "NumPositions" 1
+     "NumChannels" 1
+     "NumFrames" num-frames
+     "Positions" 1
+     "PixelType" (mm/get-pixel-type)
+     "Width" (core getImageWidth)
+     "Height" (core getImageHeight)
+     "Prefix" filename
+     "ChColors" [1]
+     "ChNames" ["ch"]
+     "ChMins" [0]
+     "ChMaxes" [100]}))

-(defn fast-image-saving-test []
-  )
+(defn save-images-fast [image n]
+  (let [tags (.tags image)
+        summary (image-test-summary "test1" 1)
+        storage (TaggedImageStorageMultipageTiff.
+                  "fast" true summary false true)]
+    (time
+      (dotimes [i n]
+        (.put tags "Frame" i)
+        (.put tags "Slice" 0)
+        (.put tags "ChannelIndex" 0)
+        (.put tags "PositionIndex" 0)
+        (.put tags "PixelType" "GRAY16")
+        (.putImage storage image)))
+    (doto storage .finished .close)))
+
+ (defn fast-image-saving-test [n]
+   (fill-circular-buffer 1 true)
+   (let [image (core popNextTaggedImage)]
+     (println "Start saving procedure...")
+       (save-images-fast image n)))
+

-
-
+


allow both audio and control busses to have names, and also implement print-methods for them

--- src/overtone/sc/bus.clj
+++ src/overtone/sc/bus.clj
@@ -14,18 +14,36 @@
 ;; but in SC they are implemented using a simple integer referenced
 ;; array of float values.

-(defrecord AudioBus [id n-channels rate]
+(defrecord AudioBus [id n-channels rate name]
   to-sc-id*
   (to-sc-id [this] (:id this)))

-(defrecord ControlBus [id n-channels rate]
+(defrecord ControlBus [id n-channels rate name]
   to-sc-id*
   (to-sc-id [this] (:id this)))
+
+(defmethod print-method AudioBus [b w]
+  (.write w (format "#<audio-bus: %s %s %d>"
+                    (:name b)
+                    (cond
+                     (= 1 (:n-channels b)) "mono"
+                     (= 2 (:n-channels b)) "stereo"
+                     :else (str (:n-channels b) " channels"))
+                    (:id b))))
+
+(defmethod print-method ControlBus [b w]
+  (.write w (format "#<control-bus: %s %s %d>"
+                    (:name b)
+                    (cond
+                     (= 1 (:n-channels b)) "1 channel"
+                     :else (str (:n-channels b) " channels"))
+                    (:id b))))

 (derive AudioBus ::bus)
 (derive ControlBus ::bus)

 (defn bus?
+
   "Returns true if the specified bus is a map representing a bus (either control
   or audio) "
   [bus]
@@ -42,18 +60,34 @@
   (isa? (type bus) AudioBus))

 (defn control-bus
-  "Allocate one or more control busses."
-  ([] (control-bus 1))
-  ([n-channels]
+  "Allocate one or more successive control busses. By default, just one
+   bus is allocated. However, if you specify a number of channels, a
+   successive range of that length will be allocated.
+
+   You may also specify a name for the bus for labelling purposes."
+  ([] (control-bus 1 ""))
+  ([n-channels-or-name]  (if (string? n-channels-or-name)
+                          (control-bus 1 n-channels-or-name)
+                          (control-bus n-channels-or-name "")))
+  ([n-channels name]
      (let [id (alloc-id :control-bus n-channels)]
-       (ControlBus. id n-channels :control))))
+       (ControlBus. id n-channels :control name))))

 (defn audio-bus
-  "Allocate one or more audio busses."
-  ([] (audio-bus 1))
-  ([n-channels]
+  "Allocate one or more successive audio busses. By default, just one
+   bus is allocated. However, if you specify a number of channels, a
+   successive range of that length will be allocated.
+
+   For example, to allocate a stereo bus: (audio-bus 2)
+
+   You may also specify a name for the bus for labelling purposes."
+  ([] (audio-bus 1 ""))
+  ([n-channels-or-name] (if (string? n-channels-or-name)
+                          (audio-bus 1 n-channels-or-name)
+                          (audio-bus n-channels-or-name "")))
+  ([n-channels name]
      (let [id (alloc-id :audio-bus n-channels)]
-       (AudioBus. id n-channels :audio))))
+       (AudioBus. id n-channels :audio name))))

 (defn free-bus
   "Free the id of specified bus for reuse."


Complete first pass of osc message type checker.

--- src/overtone/sc/osc.clj
+++ src/overtone/sc/osc.clj
@@ -1,11 +1,12 @@
 (ns
-    ^{:doc "The Overtone <-> scsynth OSC messaging infrasructure.
+    ^{:doc "The Overtone <-> scsynth OSC messaging infrastructure.
             Contains type signatures and checkers for all major scsynth
-            OSC messages."
+            OSC messages to reduce the number of bogus messages that may
+            potentially crash the server."
       :author "Sam Aaron"}
   overtone.sc.osc
   (:require [overtone.log :as log])
-  (:use  osc))
+  (:use osc))

 (def TYPES
   {
@@ -15,7 +16,68 @@
    :int              {:desc "an integer"
                       :validator (fn [val] (integer? val))}

+   :sample-idx       {:desc "an integer 0 or greater representing the index of a sample"
+                      :validator (fn [val] (and (integer? val)
+                                               (>= val 0)))}
+
+   :sample-val       {:desc "a float representing the value of a sample"
+                      :validator (fn [val] (float? val))}
+
+   :frame-start      {:desc "an integer 0 or greater representing the starting frame"
+                      :validator (fn [val] (and (integer? val)
+                                               (>=  val 0)))}
+
+   :chan-idx         {:desc "an integer 0 or greater representing a channel index"
+                      :validator (fn [val] (and (integer? val)
+                                               (>=  val 0)))}
+
+   :num-frames       {:desc "an integer -1 or greater representing the number of frames"
+                      :validator (fn [val] (and (integer? val)
+                                               (>=  val -1)))}
+
+   :buf-num          {:desc "an integer representing a buffer number"
+                      :validator (fn [val] (integer? val))}
+
+   :ugen-idx         {:desc "an integer representing the index of a ugen"
+                      :validator (fn [val] (integer? val))}
+
+   :count            {:desc "a positive integer representing the cardinality of elements"
+                      :validator (fn [val] (and (integer? val)
+                                               (> val 0)))}
+
+   :node-id          {:desc "an integer (-1 upwards) representing a node id."
+                      :validator (fn [val] (and (integer? val)
+                                               (>= val -1)))}
+
+   :group-id          {:desc "an integer (-1 upwards) representing a group id."
+                      :validator (fn [val] (and (integer? val)
+                                               (>= val -1)))}
+
+   :synth-id         {:desc "an integer (-1 upwards) representing a synth id."
+                      :validator (fn [val] (and (integer? val)
+                                               (>= val -1)))}
+
+   :ctl-val          {:desc "a float representing a control value"
+                      :validator (fn [val] (float? val ))}
+
    :string           {:desc "a string"
+                      :validator (fn [val] (string? val))}
+
+   :cmd-name         {:desc "a string representing a command name"
+                      :validator (fn [val] (string? val))}
+
+   :ctl-handle       {:desc "an integer or a string representing a control"
+                      :validator (fn [val] (or (integer? val)
+                                              (string? val)))}
+
+   :ctl-bus-idx      {:desc "an integer (-1 or greater) representing a control bus index"
+                      :validator (fn [val] (and (integer? val)
+                                               (>= val -1)))}
+
+   :pathname         {:desc "a string representing a pathname"
+                      :validator (fn [val] (string? val))}
+
+   :synthdef-name    {:desc "a string representing the name of a synthdef"
                       :validator (fn [val] (string? val))}

    :bytes            {:desc "a buffer of bytes"
@@ -23,14 +85,116 @@

    :zero-to-three    {:desc "an integer in the range 0 -> 3 inclusive"
                       :validator (fn [val] (and (integer? val)
-                                               (> val -1)
-                                               (< val 4)))}
+                                               (>= val 0)
+                                               (<= val 3)))}
+
+   :zero-to-four     {:desc "an integer in the range 0 -> 4 inclusive"
+                      :validator (fn [val] (and (integer? val)
+                                               (>= val 0)
+                                               (<= val 4)))}

    :minus-two-to-one {:desc "an integer in the range -2 -> 1 inclusive"
                       :validator (fn [val] (and (integer? val)
-                                              (> val -3)
-                                              (< val 2)))}
-   })
+                                               (>= val -2)
+                                               (<= val 1)))}
+
+   :zero-or-one      {:desc "an integer that's either 0 or 1"
+                      :validator (fn [val] (or (= 0 val)
+                                              (= 1 val)))}
+
+   :header-format    {:desc "a string representing the sound header format - one of \"aiff\", \"next\", \"wav\", \"ircam\"\", \"raw\""
+                      :validator (fn [val] (or (= val "aiff")
+                                              (= val "next")
+                                              (= val "wav")
+                                              (= val "ircam")
+                                              (- val "raw")))}
+
+   :sample-format    {:desc "a string representing the sound sample format - one of \"int8\", \"int16\", \"int24\", \"int32\", \"float\", \"double\", \"mulaw\", \"alaw\""
+                      :validator (fn [val] (or (= val "int8")
+                                              (= val "int16")
+                                              (= val "int24")
+                                              (= val "int32")
+                                              (= val "float")
+                                              (= val "double")
+                                              (= val "mulaw")
+                                              (= val "alaw")))}})
+
+(def OSC-TYPE-SIGNATURES
+  {
+   ;;Master Controls
+   "/quit"               []
+   "/notify"             [:zero-or-one]
+   "/status"             []
+   "/cmd"                [:int :anything*]
+   "/dumpOSC"            [:zero-to-three]
+   "/sync"               [:int]
+   "/clearSched"         []
+   "/error"              [:minus-two-to-one]
+
+   ;;Synth Definition Commands
+   "/d_recv"             [:bytes]
+   "/d_load"             [:pathname]
+   "/d_loadDir"          [:pathname]
+   "/d_free"             [:synthdef-name]
+
+   ;;Node Commands
+   "/n_free"             [:node-id]
+   "/n_run"              [:node-id :zero-or-one]
+   "/n_set"              [:node-id :ctl-handle :ctl-val]
+   "/n_setn"             [:node-id :ctl-handle :count :ctl-val*]
+   "/n_fill"             [:node-id :ctl-handle :count :ctl-val]
+   "/n_map"              [:node-id :ctl-handle :ctl-bus-idx]
+   "/n_mapn"             [:node-id :ctl-handle :ctl-bus-idx :count]
+   "/n_mapa"             [:node-id :ctl-handle :ctl-bus-idx]
+   "/n_mapan"            [:node-id :ctl-handle :ctl-bus-idx :count]
+   "/n_before"           [:node-id :node-id]
+   "/n_after"            [:node-id :node-id]
+   "/n_query"            [:node-id]
+   "/n_trace"            [:node-id]
+   "/n_order"            [:zero-to-three :node-id :node-id]
+
+   ;;Synth Commands
+   "/s_new"              [:synthdef-name :synth-id :zero-to-four :node-id :ALTERNATING-ctl-handle-THEN-ctl-val*]
+   "/s_get"              [:synth-id :ctl-handle]
+   "/s_getn"             [:synth-id :ctl-handle :count]
+   "/s_noid"             [:synth-id]
+
+   ;;Group Commands
+   "/g_new"              [:group-id :zero-to-four :node-id]
+   "/g_head"             [:group-id :node-id]
+   "/g_tail"             [:group-id :node-id]
+   "/g_freeAll"          [:group-id]
+   "/g_deepFree"         [:group-id]
+   "/g_dumpTree"         [:group-id :zero-or-one]
+   "/g_queryTree"        [:group-id :zero-or-one]
+
+   ;;Unit Generator Commands
+   "/u_cmd"              [:node-id :ugen-idx :cmd-name :anything*]
+
+   ;;Buffer Commands
+   "/b_alloc"            [:buf-num :num-frames :count]
+   "/b_allocRead"        [:buf-num :pathname :frame-start :num-frames]
+   "/b_allocReadChannel" [:buf-num :pathname :frame-start :num-frames :chan-idx*]
+   "/b_read"             [:buf-num :pathname :frame-start :num-frames :frame-start :zero-or-one]
+   "/b_readChannel"      [:buf-num :pathname :frame-start :num-frames :frame-start :zero-or-one :chan-idx*]
+   "/b_write"            [:buf-num :pathname :header-format :sample-format :num-frames :frame-start :zero-or-one]
+   "/b_free"             [:buf-num]
+   "/b_zero"             [:buf-num]
+   "/b_set"              [:buf-num :sample-idx :sample-val]
+   "/b_setn"             [:buf-num :sample-idx :count :sample-val*]
+   "/b_fill"             [:buf-num :sample-idx :count :sample-val]
+   "/b_gen"              [:buf-num :cmd-name :anything*]
+   "/b_close"            [:buf-num]
+   "/b_query"            [:buf-num]
+   "/b_get"              [:buf-num :sample-idx]
+   "/b_getn"             [:buf-num :sample-idx :count]
+
+   ;;Control Bus Commands
+   "/c_set"              [:ctl-bus-idx :ctl-val]
+   "/c_setn"             [:ctl-bus-idx :count :ctl-val*]
+   "/c_fill"             [:ctl-bus-idx :count :ctl-val]
+   "/c_get"              [:ctl-bus-idx]
+   "/c_getn"             [:ctl-bus-idx :count]})

 (defn description
   [type]
@@ -40,37 +204,42 @@
   [type val]
   (if-let [type-info (TYPES type)]
     (apply (:validator type-info) [val])
-    (throw (IllegalArgumentException. (str "Unknown OSC arg type " type ". Expecting one of " (keys TYPES))))))
-
-(def OSC-TYPE-SIGNATURES
-  {
-   "/quit"       []
-   "/notify"     [:int]
-   "/status"     []
-
-   "/cmd"        [:int :anything*]
-   "/dumpOSC"    [:zero-to-three]
-   "/sync"       [:int]
-   "/clearSched" []
-   "/error"      [:minus-two-to-one]
-   "/d_recv"     [:bytes]
-   "/d_load"     [:string]
-
-   "/n_free"     [:int]
-   })
+    (let [err-str (str "Unknown OSC arg type " type ". Expecting one of " (keys TYPES))]
+      (log/error err-str)
+      (throw (IllegalArgumentException. err-str)))))

 (defn many-type?
   [type]
-  (.endsWith (str type) "*"))
+  (.endsWith (name type) "*"))

 (defn many-type->type
   [many-type]
   (let [n (name many-type)]
     (keyword (.substring n 0 (dec (.length n))))))

+(defn expand-many
+  [many-type]
+  (repeat (many-type->type many-type)))
+
+(defn expand-alternating
+  [type]
+  (let [[[_ a b]] (re-seq #"ALTERNATING-(.*)-THEN-(.*)?\*" (name type))]
+    (cycle [(keyword a) (keyword b)])))
+
+(defn alternating?
+  [type]
+  (.startsWith (name type) "ALTERNATING"))
+
+(defn expand-type
+  [type]
+  (cond
+   (alternating? type) (expand-alternating type)
+   (many-type? type) (expand-many type)
+   :else type))
+
 (defn expand-type-sig
   [sig]
-  (flatten (map #(if (many-type? %) (repeat (many-type->type %)) %) sig)) )
+  (flatten (map #(expand-type %) sig)) )

 (defn sig-arity
   [name]


Defined paramatised transformations.

Defined paramatised transformations.

--- src/overtunes/pitch.clj
+++ src/overtunes/pitch.clj
@@ -66,12 +66,11 @@
 (def raise #(+ % octave))
 (def lower #(- % octave))

-; Qualities
-(def major (select-keys major-scale [:i :iii :v]))
-(def minor (update-in major [:iii] flat))
-(def augmented (update-in major [:v] sharp))
-(def diminished (update-in minor [:v] flat))
-(def power (select-keys major-scale [:i :v :viii]))
+; Paramatisesd transformations
+(defn flattened [key] #(update-in % [key] flat))
+(defn sharpened [key] #(update-in % [key] sharp))
+(defn raised [key] #(update-in % [key] raise))
+(defn lowered [key] #(update-in % [key] lower))

 ; Transformations
 (def suspended-second #(assoc % :iii (:ii major-scale)))
@@ -85,6 +84,13 @@
 (def first-inversion #(update-values % (keys-except % [:i]) lower))
 (def second-inversion #(update-values % (keys-except % [:i :iii]) lower))

+; Qualities
+(def major (select-keys major-scale [:i :iii :v]))
+(def minor ((flattened :iii) major))
+(def augmented ((sharpened :v) major))
+(def diminished ((flattened :v) minor))
+(def power (select-keys major-scale [:i :v :viii]))
+
 ; Let's play!
 (def note# sampled-piano)
 (def chord# #(map note# %))


Added eight tests into server_test module

--- test/hurvinek/server_test.clj
+++ test/hurvinek/server_test.clj
@@ -147,3 +147,50 @@
         (is (callable? 'hurvinek.server/process-delete-component))))

+(deftest test-get-output-format-existence
+    "Check that the hurvinek.server/get-output-format definition exists."
+    (testing "if the hurvinek.server/get-output-format definition exists."
+        (is (callable? 'hurvinek.server/get-output-format))))
+
+
+(deftest test-mime-type-existence
+    "Check that the hurvinek.server/mime-type definition exists."
+    (testing "if the hurvinek.server/mime-type definition exists."
+        (is (callable? 'hurvinek.server/mime-type))))
+
+
+(deftest test-process-list-of-products-existence
+    "Check that the hurvinek.server/process-list-of-products definition exists."
+    (testing "if the hurvinek.server/process-list-of-products definition exists."
+        (is (callable? 'hurvinek.server/process-list-of-products))))
+
+
+(deftest test-process-list-of-chapters-existence
+    "Check that the hurvinek.server/process-list-of-chapters definition exists."
+    (testing "if the hurvinek.server/process-list-of-chapters definition exists."
+        (is (callable? 'hurvinek.server/process-list-of-chapters))))
+
+
+(deftest test-process-list-of-groups-existence
+    "Check that the hurvinek.server/process-list-of-groups definition exists."
+    (testing "if the hurvinek.server/process-list-of-groups definition exists."
+        (is (callable? 'hurvinek.server/process-list-of-groups))))
+
+
+(deftest test-process-list-of-components-existence
+    "Check that the hurvinek.server/process-list-of-components definition exists."
+    (testing "if the hurvinek.server/process-list-of-components definition exists."
+        (is (callable? 'hurvinek.server/process-list-of-components))))
+
+
+(deftest test-return-file-existence
+    "Check that the hurvinek.server/return-file definition exists."
+    (testing "if the hurvinek.server/return-file definition exists."
+        (is (callable? 'hurvinek.server/return-file))))
+
+
+(deftest test-handler-existence
+    "Check that the hurvinek.server/handler definition exists."
+    (testing "if the hurvinek.server/handler definition exists."
+        (is (callable? 'hurvinek.server/handler))))
+


cap-url should be a thing

cap-url should be a thing

--- test/icecap/e2e/http_test.clj
+++ test/icecap/e2e/http_test.clj
@@ -46,7 +46,7 @@
         exercise-result @(execute-cap cap-url)]
     (is (= (select-keys create-result [:code])
            {:code 201}))
-    (is (= cap-url nil))))
+    (is (some? cap-url))))

 (deftest invalid-http-step-tests
   (are [step expected] (= (get-body @(create-cap step)) {:error expected})


More warnings

More warnings

--- test/midje/t_sweet.clj
+++ test/midje/t_sweet.clj
@@ -82,17 +82,17 @@
 (fact "key-value pairs can be passed to override normal behavior"
   (always-one 3) => 3 :expected-result 1)

-(defn some-fn [n] n)
+(defn a-fun [n] n)
 ; http://github.com/marick/Midje/issues/#issue/5
 (doseq [v (range 5)]
   (fact
     (str "It should be the identity for value " v) ;; doc string needn't be constant
-    (some-fn v) => v))
+    (a-fun v) => v))

 ; http://github.com/marick/Midje/issues/#issue/2
 (fact
   (expect (always-one 5) => 1
-          (not-called some-fn)))
+          (not-called a-fun)))

 (binding [midje.semi-sweet/*include-midje-checks* false]
   (load "sweet_compile_out"))
@@ -237,23 +237,26 @@
  ;;; return values

-(def *fact-retval* (fact
+(def ^{:dynamic true}
+     *fact-retval* (fact
                      (+ 1 1) => 2
                      "some random return value"))
 (fact "fact returns true on success"
    *fact-retval* => true)

-(def *fact-retval* (fact
+(def ^{:dynamic true}
+     *fact-retval* (fact
                      (midje.util.report/note-failure-in-fact)
                      "some random return value"))
 (fact "fact returns false on failure"
   *fact-retval* => false)

-(def *fact-retval* (fact
-                      (+ 1 1) => 2
-                      "some random return value"))
+(def ^{:dynamic true}
+     *fact-retval* (fact
+                     (+ 1 1) => 2
+                     "some random return value"))
 (fact "a fact's return value is not affected by previous failures"
   *fact-retval* => true)


neue signaturen

neue signaturen

--- src/paulkrake/goals.clj
+++ src/paulkrake/goals.clj
@@ -30,11 +30,15 @@
 (defn new-rating-goals [data games]
   (s/new-rating data games goals-to-score-fn))

-(defn goals-data [saison spieltag-nr]
-  (as-> (s/initial-rating-data (s/vereine (dc/spieltag saison 1))) x
-        (reduce (fn [a i] (new-rating-goals a
-                                           (dc/spieltag saison i)))
-                x (range 1 spieltag-nr))))
+(defn goals-data
+  ([saison spieltag-nr-von spieltag-nr-bis]
+     (as-> (s/initial-rating-data (s/vereine (dc/spieltag saison 1))) x
+           (reduce (fn [a i] (new-rating-goals a
+                                              (dc/spieltag saison i)))
+                   x (range spieltag-nr-von spieltag-nr-bis))))
+  ([saison spieltag-nr-bis]
+     (goals-data saison 1 spieltag-nr-bis)))
+

 (defn predict-goals-on-data
   ([data games]


bugfix error handling

bugfix error handling

--- src/spq/server.clj
+++ src/spq/server.clj
@@ -81,7 +81,7 @@
                                                        :retry-timeout-minutes retry-timeout-minutes})))
                (catch AssertionError ex
                  (timbre/debug "task-id collission, looping. count:" i id)
-                 (if (> i 1000)
+                 (when (> i 1000)
                    (timbre/fatal "failed to find unique id for task, this should never happen")
                    (lib/shutdown))
                  ::fail))


correct :nrepl-middleware option

correct :nrepl-middleware option

--- dev/src/clj/user.clj
+++ dev/src/clj/user.clj
@@ -32,8 +32,8 @@
                        :server-ip "127.0.0.1"           ;; default
                        :css-dirs ["resources/public/css"]
                        :ring-handler 'om-next-leaflet.server/app
-                       :server-logfile "log/figwheel.log"}
-    :repl-options {:nrepl-middleware ['cemerick.piggieback/wrap-cljs-repl]}
+                       :server-logfile "log/figwheel.log"
+                       :nrepl-middleware ['cemerick.piggieback/wrap-cljs-repl]}
     :build-ids ["dev"]
     :all-builds
     [{:id "dev"


cleanup

cleanup

--- src/babel/italiano/morphology/verbs.cljc
+++ src/babel/italiano/morphology/verbs.cljc
@@ -14,17 +14,7 @@
       (-> (clojure.java.io/resource "babel/italiano/morphology/verbs/future.edn")
           slurp
           read-string)]
-  (def regular-future-patterns
-    (compile-patterns
-     {:synsem {:infl :future}}
-     regular-future-source))
-
-  (defonce regular-future-generate-patterns
-    (compile-patterns
-     {:synsem {:infl :future}}
-     regular-future-source))
-
-  (defonce patterns-future-tense
+  (defonce patterns-future
     (compile-patterns
      {:synsem {:infl :future}}
      regular-future-source)))
@@ -37,7 +27,7 @@
   (let [unifying-patterns
         (remove nil? (mapcat #(if (not (= :fail (unify (:u %) word)))
                                 (:g %))
-                             regular-future-generate-patterns))
+                             patterns-future))
         infinitive (get-in word [:italiano])]
     (first (remove nil? (do-replace-on infinitive unifying-patterns)))))
 ;; </future>
@@ -47,12 +37,7 @@
       (-> (clojure.java.io/resource "babel/italiano/morphology/verbs/imperfetto.edn")
           slurp
           read-string)]
-  (defonce regular-imperfect-generate-patterns
-    (compile-patterns
-     {:synsem {:infl :imperfect}}
-     regular-imperfect-source))
-
-  (defonce patterns-imperfect-past-tense
+  (defonce patterns-imperfect
     (compile-patterns
      {:synsem {:infl :imperfect}}
      regular-imperfect-source)))
@@ -66,7 +51,7 @@
   (let [unifying-patterns
         (remove nil? (mapcat #(if (not (= :fail (unify (:u %) word)))
                                 (:g %))
-                             regular-imperfect-generate-patterns))
+                             patterns-imperfect))
         infinitive (get-in word [:italiano])]
     (first (remove nil? (do-replace-on infinitive unifying-patterns)))))
 ;; </imperfect>
@@ -76,12 +61,7 @@
       (-> (clojure.java.io/resource "babel/italiano/morphology/verbs/present.edn")
           slurp
           read-string)]
-  (defonce regular-present-generate-patterns
-    (compile-patterns
-     {:synsem {:infl :present}}
-     regular-present-source))
-
-  (defonce patterns-present-tense
+  (defonce patterns-present
     (compile-patterns
      {:synsem {:infl :present}}
      regular-present-source)))
@@ -435,9 +415,9 @@
         ;; if more are added in the future, please
         ;; preserve alphabetical ordering.
         patterns-conditional-tense
-        patterns-future-tense
+        patterns-future
         patterns-gerund
-        patterns-imperfect-past-tense
+        patterns-imperfect
         patterns-past-tense
         patterns-present-subjunctive
         patterns-present-tense)))
@@ -884,7 +864,7 @@
   (let [stem (get-in word '(:future-stem))
         number (get-in word [:agr :number])
         person (get-in word [:agr :person])
-        patterns patterns-future-tense]
+        patterns patterns-future]
     (-> patterns
         (map (fn [pattern]
                (let [[from to] (nth (:g pattern))]


wrap :agr in {:agr}

wrap :agr in {:agr}

--- src/babel/italiano/morphology/verbs.cljc
+++ src/babel/italiano/morphology/verbs.cljc
@@ -10,14 +10,22 @@
    #?(:cljs [babel.logjs :as log])))

 ;; <conditional>
-(let [source
+(let [patterns
       (-> (clojure.java.io/resource "babel/italiano/morphology/verbs/conditional.edn")
           slurp
-          read-string)]
+          read-string)
+      patterns-with-agr
+      (map (fn [{g :g
+                 agr :agr
+                 p :p}]
+             {:g g
+              :p p
+              :agr {:agr agr}})
+           patterns)]
   (defonce patterns-conditional
     (compile-patterns
      {:synsem {:infl :conditional}}
-     source)))
+     patterns-with-agr)))

 (defn regular-conditional? [word]
   (and (= (get-in word [:infl]) :conditional)


Bump verison

Bump verison

--- re-view-template/project.clj
+++ re-view-template/project.clj
@@ -1,4 +1,4 @@
-(defproject re-view/lein-template "0.1.5"
+(defproject re-view/lein-template "0.1.6"
   :description "Template for creating re-view apps."
   :url "https://www.github.com/re-view/re-view"
   :license {:name "Eclipse Public License"


basic command repl works

basic command repl works

--- src/todos/core.clj
+++ src/todos/core.clj
@@ -23,8 +23,33 @@
     (storage/save-data ((todolist :plain)))
     ))

+(def todolist
+  (t-item/todo-load-from-plain
+    (storage/load-data
+      (((t-item/todo-create "< t o d o s >") :plain)) ; if file cant be read this is the default.
+      )))
+
+(def current-stack (atom '() )) ; this have the subpath of opened todos. (subpath in todolist)
+
+(defn command-repl
+  []
+  (do
+    (doseq [i @current-stack]
+      (println (format "> %s <" ((i :name)) )))
+    (let [[cmd & args] (inp/user-cmd-input ">> ")]
+      (cond
+        (= cmd "ls")
+        (( ;evaluate the print of current todolist
+          (or (first @current-stack) todolist)
+          :print) "")
+        )
+      ; exit clause
+      (if (not= cmd "exit")
+        (recur))
+      )))
+
 (defn -main
   "Start the demo ..."
   [& args]
-  (demo))
+  (command-repl))


finished run_trends -- this'll go away, but it's a first pass at a job that runs trends on all timeseries.

--- src/clj/forma/hadoop/jobs/run_trends.clj
+++ src/clj/forma/hadoop/jobs/run_trends.clj
@@ -1,2 +1,18 @@
 (ns forma.hadoop.jobs.run-trends
-  (:use cascalog.api))
+  (:use cascalog.api)
+  (:require [cascalog.ops :as c]))
+
+(def ndvi-file
+  "/Users/sritchie/Dropbox/N_drive/misc/ndvi_2808_0_59.csv")
+
+(defn split
+  [line]
+  (int-array (map #(Float. %)
+                  (.split line "\\s+"))))
+
+#_(defn count-tseries [path]
+  (let [source (hfs-textline path)]
+    (?<- (stdout) [?count]
+         (source ?textline)
+         (split ?textline :> ?t-series)
+         (whizbang ?t-series :> ?coef ?t-test))))


fix cljx/jar file compile

fix cljx/jar file compile

--- src/clj/rksm/cloxp_cljs/ns/internals.clj
+++ src/clj/rksm/cloxp_cljs/ns/internals.clj
@@ -4,7 +4,9 @@
             [rksm.cloxp-cljs.filemapping :as fm]
             [rksm.cloxp-cljs.compilation :as comp]
             [rksm.system-files :as sf]
-            [rksm.system-files.cljx.File :as sfx]
+            [rksm.system-files.jar-util :as jar]
+            [rksm.system-files.cljx :as sfx]
+            [rksm.system-files.cljx.File :as sfx-file]
             [rksm.cloxp-source-reader.core :as src-rdr]
             [clojure.data.json :as json]
             [clojure.string :as s]
@@ -48,7 +50,7 @@
                            (update-in [:name] (comp symbol name)))]
         (binding [tr/*data-readers* cljs-literals/*cljs-data-readers*
                   tr/*alias-map* (apply merge ((juxt :requires :require-macros) file-data))
-                  sfx/*output-mode* :cljx]
+                  sfx-file/*output-mode* :cljx]
           (let [rdr (sf/source-reader-for-ns ns-name file #"\.clj(s|x)$")]
             (some->> [file-data]
               (src-rdr/add-source-to-interns-with-reader rdr)
@@ -123,7 +125,7 @@
 (defn namespace-info
   [ns-name & [file]]
   (let [file (or file (fm/find-file-for-ns-on-cp ns-name))]
-    (if-let [data (analyze-cljs-ns! ns-name)
+    (if-let [data (analyze-cljs-ns! ns-name file)
              ;  data (env/with-compiler-env cenv
              ;         (if file
              ;           (ana/analyze-file
@@ -190,8 +192,14 @@
   (create-ns ns-sym)
   (let [cenv-atom (or env/*compiler* (:compiler-env (ensure-default-cljs-env)) (env/default-compiler-env))
         file (fm/find-file-for-ns-on-cp ns-sym file)
-        ; cljx? (and cljs-ana-file (re-find #"\.cljx$" (str cljs-ana-file)))
-        ]
+        ; FIXME: right now jar files won't support the auto cljx translation,
+        ; try to find cljs file instead
+        file (if (and (jar/jar-url-string?
+                       (-> (if (string? file) file (str (.getCanonicalPath file)))))
+                      (sfx/cljx-file? file))
+               (sf/file-for-ns ns-sym nil #"\.cljs")
+               file)]
+    [ns-sym file]
     (if-not file (throw (Exception. (str "Cannot find cljs or cljx file for namespace " ns-sym))))
     (env/with-compiler-env cenv-atom
       (env/ensure


support max players

support max players

--- src/clj/wombats_api/controllers/game.clj
+++ src/clj/wombats_api/controllers/game.clj
@@ -53,16 +53,21 @@

 (defn add-player
   [game-id {:keys [_id login] :as identity} repo]
-  (let [game (db/get-game game-id)
-        player-not-registered? (empty? (filter #(= (:_id %) _id) (:players game)))
+  (let [{:keys [configuration players] :as game} (db/get-game game-id)
+        {:keys [max-players]} configuration
+        game-open? (< (count players) max-players)
+        player-registered? (not (empty? (filter #(= (:_id %) _id) players)))
         player {:_id (str _id)
                 :login login
-                :bot-repo repo}
-        update (if player-not-registered?
-                 (db/add-player-to-game game-id player))]
-    (if player-not-registered?
-      (db/get-game game-id)
-      (bad-request! "You are already registered in this game."))))
+                :bot-repo repo}]
+    ;; Add player if criteria is met
+    (when (and (not player-registered?) game-open?)
+      (db/add-player-to-game game-id player))
+    ;; Response
+    (cond
+      (not game-open?) (bad-request! "The game you are trying to join is now full.")
+      player-registered? (bad-request! "You are already registered in this game.")
+      :else (db/get-game game-id))))

 (defn get-players
   ([game-id]


Replace navbar-brand class with tailwind

--- src/cljs/my_money/components/navbar.cljs
+++ src/cljs/my_money/components/navbar.cljs
@@ -29,7 +29,7 @@
   (let [collapsed? (r/atom true)]
     (fn [e!]
       [:nav.navbar-expand-lg.navbar-dark.mb-2.relative.flex.items-center.px-4.py-2.bg-black.bg-opacity-75
-       [:a.navbar-brand {:href "#"} "my-money"]
+       [:a.text-white.inline-block.whitespace-nowrap.text-lg.mr-4 {:href "#"} "my-money"]
        [:button.navbar-toggler {:type "button"
                                 :on-click #(swap! collapsed? not)}
         [:span.navbar-toggler-icon]]


refactor dashboard init

refactor dashboard init

--- src/cljs/salava/social/ui/dashboard.cljs
+++ src/cljs/salava/social/ui/dashboard.cljs
@@ -12,13 +12,18 @@
             [reagent.session :as session]
             [salava.core.helper :refer [dump]]
             [salava.user.ui.helper :refer [profile-picture]]
-            [salava.core.ui.notactivated :refer [not-activated-banner]]))
+            [salava.core.ui.notactivated :refer [not-activated-banner]]
+            [salava.badge.ui.pending :as pb]))
+
+

 (defn init-dashboard [state]
+  (stream/init-data state)
+  (pb/init-data state)
   (ajax/GET
     (path-for (str "/obpv1/user/dashboard"))
     {:handler (fn [data]
-                (reset! state data))}))
+                (swap! state merge data))}))

 (defn follow-event-badge [event state]
   (let [{:keys [subject verb image_file message ctime event_id name object]}  event
@@ -149,7 +154,7 @@
        ;(prn @state)
        [:div.notifications-block.row_1.notifications;.block-content
         [:div.heading_1 [:i.fa.fa-rss.icon]
-         [:a {:href "social/stream"} [:span.title "notifications"]] [:span.badge (:events_count @state)]]
+         [:a {:href "social/stream"} [:span.title "notifications"]] [:span.badge (count (:events @state))]]
         (reduce (fn [r event]
                   (conj r [:div.notification-div.ax_default
                            (cond
@@ -207,7 +212,7 @@
             (reduce (fn [r badge]
                       (conj r [:a {:href "#" :on-click #(do
                                                           (.preventDefault %)
-                                                          (mo/open-modal [:badge :info] {:badge-id (:id badge )}))} [:img {:src (str "/" (:image_file badge)) :alt (:name badge) :title (:name badge)}]])
+                                                          (mo/open-modal [:badge :info] {:badge-id (:id badge )} {:hidden (fn [] (init-dashboard state))}))} [:img {:src (str "/" (:image_file badge)) :alt (:name badge) :title (:name badge)}]])
                       ) [:div] badges)
             ]
            [latest-earnable-badges]]]]]])))


small fix

small fix

--- src/cljs/salava/social/ui/dashboard.cljs
+++ src/cljs/salava/social/ui/dashboard.cljs
@@ -341,7 +341,7 @@
              [:i.fa.fa-map-marker.icon]
              [:div.text
               (when-not hidden? [:p.num (get-in @state [:gallery :map :all] 0)])
-              [:p.desc (if (> (get-in @state [:gallery :map :all] 0) 1)(t :admin/Users) (t :location/Map))]]]]]]
+              [:p.desc (t :location/Map)]]]]]]
          [:div.since-last-login]]]]]]]]))


Fix bugs in *-children-differently diversification constraints

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -1234,7 +1234,7 @@
   [ind argmap]
   (let [g (:genome ind)
         child1 (produce-child-genome-by-autoconstruction g g argmap)
-        child2 (produce-child-genome-by-autoconstruction child1 g g argmap)]
+        child2 (produce-child-genome-by-autoconstruction g g argmap)]
     ;(println "1:" (:made-by (meta child1)))
     ;(println "2:" (:made-by (meta child2)))
     (assoc ind :diversifying
@@ -1245,7 +1245,7 @@
   [ind argmap]
   (let [g (:genome ind)
         child1 (produce-child-genome-by-autoconstruction g g argmap)
-        child2 (produce-child-genome-by-autoconstruction child1 g g argmap)
+        child2 (produce-child-genome-by-autoconstruction g g argmap)
         gc1 (produce-child-genome-by-autoconstruction child1 g g argmap)
         gc2 (produce-child-genome-by-autoconstruction child2 g g argmap)]
     (assoc ind :diversifying


Remove silent autoconstruction but retain clarified control via cond in process-genome-for-autoconstruction

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -770,20 +770,18 @@
                    (some #{instruction}
                          '(a0 a1 a2 d0 d1 d2 d3 d4 d5 d6 d7)))))] ;; from mux problems
     (mapv (fn [instruction-map]
-            (assoc (cond
-                     (input-instruction? (:instruction instruction-map))
-                     (assoc instruction-map :instruction 'code_noop)
-                     ;
-                     (= (:instruction instruction-map) 'autoconstructive_integer_rand)
-                     (assoc instruction-map :instruction 'integer_rand)
-                     ;
-                     (= (:instruction instruction-map) 'autoconstructive_boolean_rand)
-                     (assoc instruction-map :instruction 'boolean_rand)
-                     ;
-                     :else
-                     instruction-map)
-              :silent
-              (not (:silent instruction-map))))
+            (cond
+              (input-instruction? (:instruction instruction-map))
+              (assoc instruction-map :instruction 'code_noop)
+              ;
+              (= (:instruction instruction-map) 'autoconstructive_integer_rand)
+              (assoc instruction-map :instruction 'integer_rand)
+              ;
+              (= (:instruction instruction-map) 'autoconstructive_boolean_rand)
+              (assoc instruction-map :instruction 'boolean_rand)
+              ;
+              :else
+              instruction-map))
          genome)))

 (defn produce-child-genome-by-autoconstruction
@@ -1196,4 +1194,3 @@
                            :ancestors ()
                            :is-random-replacement true))))))

-


Fix the where macro for clojure 1.9

Fix the where macro for clojure 1.9

--- src/riemann/streams.clj
+++ src/riemann/streams.clj
@@ -1720,7 +1720,7 @@
         [true-kids else-kids] (where-partition-clauses children)]
     `(let [true-kids# ~true-kids
            else-kids# ~else-kids]
-       (fn stream [event#]
+       (fn stream# [event#]
          (let [value# (let [~'event event#] ~p)]
            (if value#
              (call-rescue event# true-kids#)


STORM-297: remove param thread-name when we know we are consuming from a disruptor queue, just use queue name as thread name will suffice

--- storm-core/src/clj/backtype/storm/disruptor.clj
+++ storm-core/src/clj/backtype/storm/disruptor.clj
@@ -83,8 +83,7 @@
 (defn halt-with-interrupt! [^DisruptorQueue queue]
   (.haltWithInterrupt queue))

-(defnk consume-loop* [^DisruptorQueue queue handler :kill-fn (fn [error] (halt-process! 1 "Async loop died!"))
-                      :thread-name nil]
+(defnk consume-loop* [^DisruptorQueue queue handler :kill-fn (fn [error] (halt-process! 1 "Async loop died!"))]
   (let [ret (async-loop
               (fn []
                 (consume-batch-when-available queue handler)
@@ -98,5 +97,5 @@

 (defmacro consume-loop [queue & handler-args]
   `(let [handler# (handler ~@handler-args)]
-     (consume-loop* ~queue handler# :thread-name (.getName queue))
+     (consume-loop* ~queue handler#)
      ))


Bump the nREPL dep to 0.2.13

Bump the nREPL dep to 0.2.13

That's the current stable version of nREPL.

--- boot/pod/src/boot/repl.clj
+++ boot/pod/src/boot/repl.clj
@@ -8,7 +8,7 @@
     [boot.from.io.aviso.exception :refer [*fonts*]]))

 (def ^:dynamic *default-dependencies*
-  (atom '[[org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]]]))
+  (atom '[[org.clojure/tools.nrepl "0.2.13" :exclusions [[org.clojure/clojure]]]]))

 (defn ^:private disable-exception-colors
   [handler]


re-order methods.

re-order methods.

--- src/shelver/handler.clj
+++ src/shelver/handler.clj
@@ -68,6 +68,20 @@

 (def resolve-redirect-next (partial resolve-redirect "next"))

+(defn logout [request]
+  (let [updated-session (dissoc (:session request) :identity)]
+    (-> (redirect "/")
+        (render request)
+        (assoc :session updated-session))))
+
+(defn login [datomic crypto-client request]
+  (when (user/login datomic crypto-client (:params request))
+    (let [updated-session (-> (:session request)
+                              (assoc :identity (get-in request [:params :email])))]
+      (-> (redirect "/")
+          (render request)
+          (assoc :session updated-session)))))
+
 (defn wrap-check-auth [handler login-path]
   (fn [req]
     (if (authenticated? req)
@@ -82,21 +96,7 @@
 (defn authenticated-routes [{:keys [datomic crypto-client oauth-client] :as deps}]
   (-> (routes
         (GET "/confirm" [oauth_token authorize :as request] (html/confirm datomic oauth-client oauth_token authorize request)))
-      (wrap-routes #(wrap-check-auth % "/sign-up"))))
-
-(defn logout [request]
-  (let [updated-session (dissoc (:session request) :identity)]
-    (-> (redirect "/")
-        (render request)
-        (assoc :session updated-session))))
-
-(defn login [datomic crypto-client request]
-  (when (user/login datomic crypto-client (:params request))
-    (let [updated-session (-> (:session request)
-                              (assoc :identity (get-in request [:params :email])))]
-      (-> (redirect "/")
-          (render request)
-          (assoc :session updated-session)))))
+      (wrap-routes #(wrap-check-auth % "/sign-up#signin"))))

 (defn public-routes [{:keys [datomic crypto-client oauth-client] :as deps}]
   (routes


update

update

--- src/site/navigation.clj
+++ src/site/navigation.clj
@@ -36,6 +36,7 @@
               :color (get-in palette [:em :color])
               :padding "9px 20px"
               :border "1px solid transparent"}
+          (s/&text :bold)
           (undecorate)
           [:&:hover {:color (get-in palette [:em :color])
                      :border-color (get-in palette [:em :color])}]]]]])


change to removeBackpressure (java version)

--- storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
+++ storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
@@ -1598,7 +1598,7 @@
             (transition-name! nimbus storm-name [:kill wait-amt] true)
             (notify-topology-action-listener nimbus storm-name operation))
           (if (topology-conf TOPOLOGY-BACKPRESSURE-ENABLE)
-            (.remove-backpressure! (:storm-cluster-state nimbus) storm-id))
+            (.removeBackpressure (:storm-cluster-state nimbus) storm-id))
           (add-topology-to-history-log (get-storm-id (:storm-cluster-state nimbus) storm-name)
             nimbus topology-conf)))


Updated tooltips

Updated tooltips

--- src/day8/re_frame/trace/view/app_db.cljs
+++ src/day8/re_frame/trace/view/app_db.cljs
@@ -87,7 +87,7 @@
                    :height "31px"
                    :class  "noselect"
                    :style  {:cursor "pointer"}
-                   :attr   {:title    (str (if @*pod-open "close" "open") " this pod")
+                   :attr   {:title    (str (if @*pod-open "Close" "Open") " the pod bay doors, HAL")
                             :on-click (rc/handler-fn
                                         (swap! *pod-open not)
                                         (println "Clicked [arrow]"))}


(TK-202) Wrap comments to 80 characters

(TK-202) Wrap comments to 80 characters

--- test/puppetlabs/trapperkeeper/services_test.clj
+++ test/puppetlabs/trapperkeeper/services_test.clj
@@ -194,9 +194,11 @@
         (ks-testutils/with-no-jvm-shutdown-hooks
          (let [app (internal/throw-app-error-if-exists!
                     (bootstrap-services-with-empty-config services))]
-           ; We can't use the with-app-with-empty-config macro because we don't want to use its implicit tk-app/stop call
-           ; We're asserting that the stop will happen because of the exception. So instead, we use the tk/run-app here to
-           ; block on the app until the restart is called an explodes in an exception.
+           ; We can't use the with-app-with-empty-config macro because we don't
+           ; want to use its implicit tk-app/stop call. We're asserting that
+           ; the stop will happen because of the exception. So instead, we use
+           ; the tk/run-app here to block on the app until the restart is
+           ; called an explodes in an exception.
            (let [app-running (future (tk/run-app app))]
              (is (= [:init-service1 :init-service2 :init-service3
                      :start-service1 :start-service2 :start-service3]


fixed compile issue

fixed compile issue

--- main/src/dda/pallet/dda_backup_crate/app.clj
+++ main/src/dda/pallet/dda_backup_crate/app.clj
@@ -29,7 +29,7 @@

 (def BackupConfig domain/BackupConfig)

-(def BackupConfigResolved domain/ResolvedBackupConfig)
+(def BackupConfigResolved domain/BackupConfigResolved)

 (def InfraResult
   (merge


Putting the channel last feels more idiomatic

--- test-cljs/frontend/test_send.cljs
+++ test-cljs/frontend/test_send.cljs
@@ -316,7 +316,7 @@
        (doto to (put! v) (close!)))))
   to)

-(defn resolve [channel env query-or-ast]
+(defn resolve [env query-or-ast channel]
   (let [ast (if (vector? query-or-ast)
               (om/query->ast query-or-ast)
               query-or-ast)
@@ -352,9 +352,9 @@

    :root/user
    (fn [env ast]
-     (resolve (chan)
-              (assoc env :user/name (:user/name (:params ast)))
-              ast))
+     (resolve (assoc env :user/name (:user/name (:params ast)))
+              ast
+              (chan)))

    :user/name
    (fn [env ast]
@@ -388,9 +388,9 @@
    (fn [env ast]
      (p/alet [get-user (get-in env [:apis :get-user])
               user (p/await (get-user {:name (:user/name env)}))]
-       (resolve (chan)
-                (assoc env :user/name (:favorite-fellow-user-name user))
-                ast)))})
+       (resolve (assoc env :user/name (:favorite-fellow-user-name user))
+                ast
+                (chan))))})

 (deftest new-thing-works
   (async done
@@ -417,8 +417,7 @@
                                            {:name "Otis"
                                             :species :pet-species/dog
                                             :description "pug"}]}
-          data-chan (resolve (chan)
-                             {:apis {:get-user
+          data-chan (resolve {:apis {:get-user
                                      (memoize
                                       (fn [params]
                                         (p/do*
@@ -451,7 +450,8 @@
                                                               :user/favorite-number]}]}
                                {(:jamie {:< :root/user :user/name "jburnford"})
                                 [:user/name
-                                 :user/favorite-color]}])]
+                                 :user/favorite-color]}]
+                             (chan))]
       (take!
        (async/into #{} data-chan)
        (fn [v]


[Fix #52] Ensure decryption functions throw an exception when verifications fails.

--- test/caesium/crypto/aead_test.clj
+++ test/caesium/crypto/aead_test.clj
@@ -3,7 +3,8 @@
             [caesium.test-utils :refer [const-test]]
             [caesium.vectors :as v]
             [clojure.test :refer [is deftest]]
-            [caesium.byte-bufs :as bb])
+            [caesium.byte-bufs :as bb]
+            [caesium.randombytes :as r])
   (:import (java.nio ByteBuffer)))

 (const-test
@@ -113,6 +114,18 @@
     (doseq [^ByteBuffer k ks]
       (is (= aead/chacha20poly1305-keybytes (.limit k))))))

+(deftest decryption-fns-invalid-ciphertext-test
+  (let [decryption-fns (filter #(clojure.string/includes? (key %) "decrypt")
+                               (ns-publics 'caesium.crypto.aead))
+        k (r/randombytes 32)
+        ctext (r/randombytes 16)
+        ad (r/randombytes 12)
+        nonce (r/randombytes 12)]
+    (doseq [[fn-name decryption-fn] decryption-fns]
+      (is (thrown? RuntimeException
+                   (decryption-fn ctext ad nonce k))
+          (str "Function `" fn-name "` should throw an exception when given an invalid ciphertext.")))))
+
 (def aead-xchacha20poly1305-ietf-vector
   (comp v/hex-resource (partial str "vectors/aead/xchacha20poly1305ietf/")))


namespace needs to be required in CLJS

namespace needs to be required in CLJS

- figwheel was complaining

--- src-cljs/frontend/controllers/navigation.cljs
+++ src-cljs/frontend/controllers/navigation.cljs
@@ -4,6 +4,7 @@
             [frontend.analytics :as analytics]
             [frontend.async :refer [put!]]
             [frontend.api :as api]
+            [frontend.api.path :as api-path]
             [frontend.components.documentation :as docs]
             [frontend.favicon]
             [frontend.models.feature :as feature]
@@ -111,12 +112,12 @@
                        :context {:project-name (str (:org args) "/" (:repo args))})
             (when (:read-settings scopes)
               (ajax/ajax :get
-                         (frontend.api.path/settings-path args)
+                         (api-path/settings-path args)
                          :project-settings
                          api-ch
                          :context {:project-name (str (:org args) "/" (:repo args))})
               (ajax/ajax :get
-                         (frontend.api.path/settings-plan args)
+                         (api-path/settings-plan args)
                          :project-plan
                          api-ch
                          :context {:project-name (str (:org args) "/" (:repo args))}))))))


Keep track of all moves thus far

Keep track of all moves thus far

--- src/tile_game/grid.cljs
+++ src/tile_game/grid.cljs
@@ -14,14 +14,19 @@

 (defonce app-state
   (r/atom {:board (b/create-board 4 :shuffle)
+           :moves []
            :size 4
            :analysis-mode false}))

 (defn new-board! [& args]
-  (swap! app-state assoc :board (apply b/create-board (:size @app-state) args)))
+  (swap! app-state assoc
+         :board (apply b/create-board (:size @app-state) args)
+         :moves []))

 (defn slide! [arg]
-  (swap! app-state update-in [:board] b/slide arg))
+  (swap! app-state assoc
+         :board (b/slide (:board @app-state) arg)
+         :moves (conj (:moves @app-state) arg))) ; note this appends direction or tile

 (defn board-size-slider [size command]
   [:div
@@ -55,7 +60,7 @@
     [:tr [:td "S"] [:td "Solve next piece"]]]])

 (defn tile-grid [command]
-  (let [{:keys [board size analysis-mode]} @app-state
+  (let [{:keys [board size analysis-mode moves]} @app-state
         dim (b/dimension board)]
     [:center
      [:h1 "Tile Puzzle"]
@@ -64,6 +69,7 @@
         (let [tile (nth board (+ (* y dim) x))]
           (render-tile [x y] tile command)))]
      [:h4 (if (b/solved? board) "Solved!" "Slide tiles with arrow keys or clicking on tile")]
+     [:details [:summary (str (count moves) " moves.")] (str moves)]
      (board-size-slider size command)
      [:div
       [:label "Analysis Mode"]


statuscalculation bug is fixed -> there cant be more than 100%

--- src/todos/todo_item.clj
+++ src/todos/todo_item.clj
@@ -13,7 +13,7 @@
                                                     (count @sub-todos))
                                                  (if @done 1 0))
                                         (for [i @sub-todos] ((i :status-done)) ))
-                                 (inc (count  @sub-todos))
+                                 (+ (count  @sub-todos) 2)
                                  )))
         ]
     {:name        (fn [] @todo-name)           ; fn Get name


Alphabetical orderings

Alphabetical orderings

--- src/leiningen/new/mr_clojure/project.clj
+++ src/leiningen/new/mr_clojure/project.clj
@@ -34,7 +34,8 @@
             [lein-release "1.0.5"]
             [lein-ring "0.8.12"]]

-  :env {:environment-name "poke"
+  :env {:auto-reload true
+        :environment-name "poke"
         :graphite-enabled false
         :graphite-host ""
         :graphite-port 2003
@@ -53,8 +54,7 @@
         :service-url "http://localhost:%s"
         :shutdown-timeout-millis 5000
         :start-timeout-seconds 120
-        :threads 254
-        :auto-reload true}
+        :threads 254}

   :lein-release {:deploy-via :shell
                  :shell ["lein" "do" "clean," "uberjar," "pom," "rpm"]}


Fix passing of properties into QueryExecution

--- sherpa-clojure/src/main/clojure/sherpa/sherpa_client.clj
+++ sherpa-clojure/src/main/clojure/sherpa/sherpa_client.clj
@@ -48,7 +48,8 @@
         (let [execution (QueryExecution. query-api)
               ;; each item in the iter is a collection of values in
               ;; the same order as the vars array
-              _ (.query execution sparql params props)
+              str-props (zipmap (map (comp name first) props) (map second props))
+              _ (.query execution sparql params str-props)
               data-iter (.iterator execution)
               tuple-generator (partial zipmap (map keyword (.getVars execution)))]
           {:query-handle execution


Remove unneeded do.

Remove unneeded do.

--- modules/messaging/src/main/clojure/immutant/messaging.clj
+++ modules/messaging/src/main/clojure/immutant/messaging.clj
@@ -74,9 +74,8 @@
    re-use the JMS Connection created by this function unless the
    nested calls' connection-related options differ."
   [options & body]
-  `(do
-     (let [opts# (validate-options with-connection ~options)]
-       (immutant.messaging.core/with-connection (fn [] ~@body) opts#))))
+  `(let [opts# (validate-options with-connection ~options)]
+    (immutant.messaging.core/with-connection (fn [] ~@body) opts#)))

 (defn
   ^{:valid-options


Docstring.

Docstring.

--- src/african_polyphony_and_polyrhythm/talk.clj
+++ src/african_polyphony_and_polyrhythm/talk.clj
@@ -259,7 +259,9 @@
                    (-> pitch (/ 18) dec -))]
     (assoc note :pan position)))

-(defn ndereje-balendoro [] ; p 343
+(defn ndereje-balendoro
+  "Linda horn music - page 316"
+  []
   (->> [tete ta ha tulule bongo
         (big tete) (big ta) (big ha) (big tulule) (big bongo)
         (big (big tete)) (big (big ta)) (big (big ha)) (big (big tulule)) (big (big bongo))


Add timeout parameter to websocket call

Add timeout parameter to websocket call

--- src/onyx/lifecycle/metrics/websocket.clj
+++ src/onyx/lifecycle/metrics/websocket.clj
@@ -3,7 +3,7 @@
             [clojure.core.async :refer [chan >!! <!! close! sliding-buffer]]
             [gniazdo.core :as ws]))

-(defn websocket-sender [lifecycle ch]
+(defn websocket-sender [lifecycle ch _]
   (future
     (let [conn (ws/connect (:websocket/address lifecycle))]
       (loop []


Made make-lattice to take both order and inf/sup

Also added standard-context for lattices.

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

--- conexp/fca/lattices.clj
+++ conexp/fca/lattices.clj
@@ -1,21 +1,55 @@
 (ns conexp.fca.lattices
   (:use conexp.base
-	[conexp.fca.contexts :only (concepts)])
+	conexp.fca.contexts)
   (:gen-class
    :name "conexp.fca.Lattice"
    :prefix "Lattice-"
    :init init
-   :constructors { [ Object Object ] [] }
+   :constructors { [ Object Object ] []            ; relational lattices (<=)
+		   [ Object Object Object ] [] }   ; functional lattices (inf, sup)
    :state state))

-(defn Lattice-init [base-set order]
-  [ [] {:base-set base-set :order order} ])
+;;; Datastructure
+
+(defn Lattice-init
+  ([base-set order]
+     [ [] {:base-set base-set, :order order, :inf nil, :sup nil} ])
+  ([base-set inf sup]
+     [ [] {:base-set base-set, :order nil,   :inf inf, :sup sup} ]))

 (defn base-set [lattice]
   ((.state lattice) :base-set))

 (defn order [lattice]
-  ((.state lattice) :order))
+  (or ((.state lattice) :order)
+      (let [sup ((.state lattice) :sup)]
+	(set-of [x y] [x (base-set lattice)
+		       y (base-set lattice)
+		       :when (= y (sup x y))]))))
+
+(defn inf [lattice]
+  (or ((.state lattice) :inf)
+      (let [order (order lattice)
+	    base  (base-set lattice)]
+	(fn [x y]
+	  (first (set-of z [z base
+			    :when (and (order [z x])
+				       (order [z y])
+				       (forall [a base]
+					       (=> (and (order [a x]) (order [a y]))
+						   (order [a z]))))]))))))
+
+(defn sup [lattice]
+  (or ((.state lattice) :sup)
+      (let [order (order lattice)
+	    base  (base-set lattice)]
+	(fn [x y]
+	  (first (set-of z [z base
+			    :when (and (order [x z])
+				       (order [y z])
+				       (forall [a base]
+					       (=> (and (order [x a]) (order [y a]))
+						   (order [z a]))))]))))))

 (defn Lattice-toString [this]
   (str "Lattice on " (count (base-set this)) " elements."))
@@ -32,44 +66,30 @@
     (seq? thing) ::seq
     :else        ::invalid))

-(defmulti make-lattice (fn [base-set order] [(type-of base-set) (type-of order)]))
+(defmulti make-lattice (fn [& args] (vec (map type-of args))))

 (defmethod make-lattice [::set ::set] [base-set order]
   (conexp.fca.Lattice. base-set (union (set-of [x x] [x base-set])
 				       (transitive-closure order))))

-(defmethod make-lattice [::set ::fn] [base-set order2]
-  (make-lattice base-set (set-of [x y] [x base-set y base-set :when (order2 x y)])))
+(defmethod make-lattice [::set ::fn] [base-set order]
+  (make-lattice base-set (set-of [x y] [x base-set y base-set :when (order x y)])))

-(defmethod make-lattice :default [base-set order]
-  (illegal-argument "The arguments " base-set " and " order " are not valid for a Lattice."))
+(defmethod make-lattice [::set ::fn ::fn] [base-set inf sup]
+  (conexp.fca.Lattice. base-set inf sup))

-(defn inf [lat x y]
-  (let [order (order lat)
-	base  (base-set lat)]
-    (first (set-of z [z base
-		      :when (and (order [z x])
-				 (order [z y])
-				 (forall [a base]
-				   (=> (and (order [a x]) (order [a y]))
-				       (order [a z]))))]))))
+(defmethod make-lattice :default [& args]
+  (illegal-argument "The arguments " args " are not valid for a Lattice."))

-(defn sup [lat x y]
-  (let [order (order lat)
-	base  (base-set lat)]
-    (first (set-of z [z base
-		      :when (and (order [x z])
-				 (order [y z])
-				 (forall [a base]
-				   (=> (and (order [x a]) (order [y a]))
-				       (order [z a]))))]))))
+
+;;; Standard Lattice Theory

 (defn dual-lattice [lat]
   (make-lattice (base-set lat) (set-of [y x] [[x y] (order lat)])))

 (defn distributive? [lat]
-  (let [inf  (partial inf lat)
-	sup  (partial sup lat)
+  (let [inf  (inf lat)
+	sup  (sup lat)
 	base (base-set lat)]
     (forall [x base
 	     y base
@@ -78,8 +98,8 @@
 	 (inf (sup x y) (sup x z))))))

 (defn modular? [lat]
-  (let [inf  (partial inf lat)
-	sup  (partial sup lat)
+  (let [inf  (inf lat)
+	sup  (sup lat)
 	base (base-set lat)
 	ordr (order lat)]
     (forall [x base
@@ -131,7 +151,15 @@
   (intersection (lattice-sup-irreducibles lat)
 		(lattice-inf-irreducibles lat)))

+
+;;; FCA
+
 (defn concept-lattice [ctx]
   (make-lattice (concepts ctx)
 		(fn [[A _] [X _]]
 		  (subset? A X))))
+
+(defn standard-context [lat]
+  (make-context (lattice-sup-irreducibles lat)
+		(lattice-inf-irreducibles lat)
+		(order lat)))


(PDB-4743) Fix migration check when there's more than one db

Comparison was backward, and also didn't consult "migrate=?" settings.

fixes: 7a52d73801a38be79b725a25aa74bcfe1d847bcb

--- src/puppetlabs/puppetdb/cli/services.clj
+++ src/puppetlabs/puppetdb/cli/services.clj
@@ -656,10 +656,12 @@
     (when-let [v (version/version)]
       (log/info (trs "PuppetDB version {0}" v)))

-    (when (> (count (conf/section-subsections database)) 1)
-      (throw
-       (ex-info "Currently unable to migrate multiple databases (see config)"
-                {:kind ::must-migrate-multiple-databases})))
+    (let [db-cfgs (conf/section-subsections database)]
+      (when (and (> (count db-cfgs) 1)
+                 (some :migrate (vals db-cfgs)))
+        (throw
+         (ex-info "Currently unable to migrate multiple databases (see config)"
+                  {:kind ::must-migrate-multiple-databases}))))

     (init-with-db database config)


progress in getting DataBrowser to read summary metadata from imagecache

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

--- plugins/DataBrowser/src/org/micromanager/browser/core.clj
+++ plugins/DataBrowser/src/org/micromanager/browser/core.clj
@@ -39,7 +39,7 @@
                    create-alphanumeric-comparator
                    super-location? get-file-parent)]
         [clojure.data.json :only (read-json json-str)]
-        [org.micromanager.mm :only (load-mm gui)]))
+        [org.micromanager.mm :only (load-mm gui json-to-data)]))

 (def browser (atom nil))

@@ -196,19 +196,14 @@
         selected-paths (set (map row-index-to-path selected-rows))]
     (.. table getModel fireTableDataChanged)
     (doseq [selected-row selected-rows]
-      (.addRowSelectionInterval table selected-row selected-row))
-;    (doseq [row (range (.getRowCount table))]
-;      (when (selected-paths (row-index-to-path row))
-;        (.addRowSelectionInterval table row row)))))
-))
-
-(defn add-browser-table-row [new-row]
+      (.addRowSelectionInterval table selected-row selected-row))))
+
+(defn add-data [new-row]
   (let [row-vec (vec new-row)
         location (row-vec (.indexOf tags "Location"))]
     (dosync
       (if (or (contains? @current-locations location) (= location ""))
-        (alter current-data refresh-row row-vec))))
-  (awt-event (update-browser-table)))
+        (alter current-data refresh-row row-vec)))))

 (defn remove-location [loc]
   (dosync
@@ -216,8 +211,7 @@
     (let [location-column (.indexOf tags "Location")]
       (alter current-data
              (fn [coll] (vec (remove #(= (nth % location-column) loc) coll))))))
-  (awt-event (update-browser-table)
-             (-> @settings-window :locations :table .getModel .fireTableDataChanged)
+  (awt-event (-> @settings-window :locations :table .getModel .fireTableDataChanged)
 ))

 (defn remove-selected-locations []
@@ -238,10 +232,10 @@
   (awt-event (update-browser-status)))

 (defn find-data-sets [root-dir]
-  (map #(.getParent %)
     (->> (File. root-dir)
-      file-seq
-      (filter #(= (.getName %) "metadata.txt")))))
+         file-seq
+         (filter #(= (.getName %) "display_and_comments.txt"))
+         (map #(.getParent %))))

 (defn get-frame-index [file-name]
   (try (Integer/parseInt (second (.split file-name "_")))
@@ -258,15 +252,25 @@
   (let [f (File. data-set "display_and_comments.txt")]
     (if (.exists f) (read-json (slurp f) false) nil)))

-(defn read-summary-map [data-set]
-  (-> (->> (File. data-set "metadata.txt")
-           FileReader. BufferedReader. line-seq
-           (take-while #(not (.startsWith % "},")))
-           (apply str))
-      (.concat "}}") (read-json false) (get "Summary")))
+;(defn read-summary-map [data-set]
+;  (-> (->> (File. data-set "metadata.txt")
+;           FileReader. BufferedReader. line-seq
+;           (take-while #(not (.startsWith % "},")))
+;           (apply str))
+;      (.concat "}}") (read-json false) (get "Summary")))
+
+(defn read-summary-map [path]
+  (try
+  (-> gui
+      (.openAcquisitionData path false false)
+      .getImageCache
+      .getSummaryMetadata
+      json-to-data)
+  (catch Exception e nil)))

 (defn get-summary-map [data-set location]
-  (let [raw-summary-map (read-summary-map data-set)]
+  (println data-set)
+  (when-let [raw-summary-map (read-summary-map data-set)]
     (merge raw-summary-map
       (if-let [frames (count-frames data-set)]
         {"Frames" frames})
@@ -278,7 +282,7 @@
             position (get raw-summary-map "Position")
             path (if (or (.. data-dir getName (startsWith "Snap"))
                          (not (empty? position))
-                         (and position-count (pos? position-count)))
+                         (and position-count (< 1 position-count)))
                    (get-file-parent data-dir)
                    (.getAbsolutePath data-dir))]
         {"Path"     path
@@ -289,7 +293,8 @@
   (doseq [pending-data-set pending-data-sets]
     (when (super-location? (first pending-data-set) (get summary-map "Path"))
       (.remove pending-data-sets pending-data-set)
-      (println "removed " pending-data-set))))
+      (println "removed " pending-data-set)
+      )))

 (def default-headings ["Path" "Time" "Frames" "Comment" "Location"])

@@ -324,8 +329,8 @@
                       (let [loc (second data-set)]
                         (when (or (= loc "") (contains? @current-locations loc))
                           (let [m (apply get-summary-map data-set)]
-                            (add-browser-table-row (map #(get m %) tags))
-                            (remove-sibling-positions m)
+                            (add-data (map #(get m %) tags))
+                            ;(remove-sibling-positions m)
                             (awt-event (update-browser-status))))
                         (recur))))))
               (catch Exception e (.printStackTrace e))
@@ -704,6 +709,9 @@
             (close-window (@settings-window :frame))
             (.setVisible frame false)))))
     (persist-window-shape prefs "browser-shape" frame)
+    (add-watch current-data "updater" (fn [_ _ old new]
+                                        (when (not= old new)
+                                          (awt-event (update-browser-table)))))
     (gen-map frame table scroll-pane settings-button search-field
              collection-menu refresh-button)))

@@ -731,4 +739,6 @@
     (start-browser)
     (.show (@browser :frame))))

-
+(defn test-browser []
+  (load-mm (org.micromanager.MMStudioMainFrame/getInstance))
+  (start-browser))


Refactor require statements

Refactor require statements

--- src/clj/freestuffly/gumtree/result_parser.clj
+++ src/clj/freestuffly/gumtree/result_parser.clj
@@ -1,9 +1,10 @@
 (ns freestuffly.gumtree.result-parser
-  (:require [hickory.core :as h])
-  (:require [clojure.set :as cset])
-  (:require [clojure.string :as string])
-  (:require [clj-yaml.core :as yaml])
-  (:require [hickory.select :as s]))
+  (:require [hickory.core :as h]
+            [clojure.set :as cset]
+            [clojure.string :as string]
+            [selmer.parser :as parser]
+            [clj-yaml.core :as yaml]
+            [hickory.select :as s]))

 (def ^:private config (yaml/parse-string (slurp "config/gumtree.yml")))

@@ -45,8 +46,7 @@
 (defn- presentable
   [results]
   (str "FOUND\n\n\n\n"
-       (string/join "\n\n\n"
-                    (map vals results))))
+    (parser/render-file "/email/gumtree/results.html" {:results (string/join "\n\n\n" (map vals results))})))

 (defn parsed
   [scraped-html]


pvt filter applied to habits

pvt filter applied to habits

--- src/cljs/iwaswhere_web/ui/entry/briefing.cljs
+++ src/cljs/iwaswhere_web/ui/entry/briefing.cljs
@@ -53,10 +53,18 @@
         books (reaction (:books @options))
         entries-map (subscribe [:entries-map])
         results (subscribe [:results])
-        waiting-habits (reaction
-                         (let [entries-map @entries-map]
-                           (map (fn [ts] (get entries-map ts))
-                                (:waiting-habits @results))))
+        cfg (subscribe [:cfg])
+
+        waiting-habits
+        (reaction
+          (let [entries-map @entries-map
+                conf (merge @cfg @options)
+                entries (map (fn [ts] (get entries-map ts))
+                             (:waiting-habits @results))]
+            (if (:show-pvt @cfg)
+              entries
+              (filter (u/pvt-filter conf entries-map) entries))))
+
         input-fn
         (fn [entry]
           (fn [ev]


Fix some copy and paste errors in core docs.

--- src/clojure/uncomplicate/neanderthal/core.clj
+++ src/clojure/uncomplicate/neanderthal/core.clj
@@ -193,7 +193,7 @@
    (vctr factory (cons x xs))))

 (defn view-vctr
-  "Attach a dense vector to the raw data of `x`, with optional stride multiplicator `stride-mult`.
+  "Attach a dense vector to the raw data of `x`, with optional stride multiplier `stride-mult`.

   Changes to the resulting object affect the source `x`, even the parts of data that might not
   be accessible by `x`. Use with caution!
@@ -277,7 +277,7 @@
    (transfer (api/factory factory) a)))

 (defn view-ge
-  "Attach a GE matrix to the raw data of `a`, with optional dimensions and/or stride multiplicator.
+  "Attach a GE matrix to the raw data of `a`, with optional dimensions and/or stride multiplier.

   Changes to the resulting object affect the source `a`, even the parts of data that might not
   be accessible by a. Use with caution!
@@ -401,7 +401,7 @@

 (defn gb
   "Creates a general banded matrix (GB) in the context of `factory`, with `m` rows, `n` columns,
-  `kl` sub (lower) diagonals, and `ku` super (upper) diagonals.
+  `kl` sub (lower) diagonals and `ku` super (upper) diagonals.

   If `source` is provided, transfers the data to the result. `source` is typically a sequence,
   a matrix, or another structure that can be transferred to the context of `factory`.
@@ -436,7 +436,7 @@

 (defn sb
   "Creates a symmetric banded matrix (SB) in the context of `factory`, with `n` rows and columns,
-  `k` sub (lower)  or super (upper) diagonals.
+  `k` sub (lower) and 'k' super (upper) diagonals.

   If `source` is provided, transfers the data to the result. `source` is typically a sequence,
   a matrix, or another structure that can be transferred to the context of `factory`.
@@ -518,7 +518,7 @@

   If `source` is provided, transfers the data to the result. `source` is typically a sequence,
   a matrix, or another structure that can be transferred to the context of `factory`.
-  If `source` is a matrix, dimensions `n` and `k` are not mandatory.
+  If `source` is a matrix, dimension `n` is not mandatory.

   The internal structure can be specified with a map of options: `:layout` (`:column` or `:row`),
   `:uplo` (`:upper` or `:lower`), and `:diag` (`:unit` or `:non-unit`).
@@ -548,7 +548,7 @@

   If `source` is provided, transfers the data to the result. `source` is typically a sequence,
   a matrix, or another structure that can be transferred to the context of `factory`.
-  If `source` is a matrix, dimensions `n` and `k` are not mandatory.
+  If `source` is a matrix, dimension `n` is not mandatory.

   The internal structure can be specified with a map of options: `:layout` (`:column` or `:row`),
   and `:uplo` (`:upper` or `:lower`).


fixed migration services (#1197)

fixed migration services (#1197)

> Close #https://github.com/advthreat/iroh/issues/6296

Init the migration task with `start-ctia` for building services.

--- src/ctia/task/migration/migrate_es_stores.clj
+++ src/ctia/task/migration/migrate_es_stores.clj
@@ -7,6 +7,7 @@
             [clojure.tools.logging :as log]
             [ctia.entity.entities :as entities]
             [ctia.entity.sighting.schemas :refer [StoredSighting]]
+            [ctia.features-service :as features-svc]
             [ctia.properties :as p]
             [ctia.stores.es.crud :refer [coerce-to-fn]]
             [ctia.stores.es.store :refer [StoreMap]]
@@ -313,9 +314,10 @@
     (let [_ (log/info "starting CTIA Stores...")
           config (p/build-init-config)
           get-in-config (partial get-in config)
-          services {:ConfigService {:get-config (fn [] config)
-                                    :get-in-config get-in-config}}
-          _ (mst/setup! services)]
+          app (ctia.init/start-ctia! {:services [features-svc/features-service]
+                                      :config config})
+          services (puppetlabs.trapperkeeper.app/service-graph app)]
+      (mst/setup! services)
       (doto (-> (get-in-config [:ctia :migration])
                 (into options)
                 prepare-params)


Use system-slash-exit

Use system-slash-exit

--- src/desdemona/launcher/aeron_media_driver.clj
+++ src/desdemona/launcher/aeron_media_driver.clj
@@ -3,7 +3,8 @@
   (:require
    [desdemona.launcher.utils :as utils]
    [clojure.tools.cli :refer [parse-opts]]
-   [clojure.string :as s])
+   [clojure.string :as s]
+   [com.gfredericks.system-slash-exit :as system-slash-exit])
   (:import
    [uk.co.real_logic.aeron.driver MediaDriver MediaDriver$Context]))

@@ -48,7 +49,7 @@
   "Prints lines to *out* and exit with status."
   [status lines]
   (println (s/join \newline lines))
-  (System/exit status))
+  (system-slash-exit/exit status))

 (defn -main [& args]
   (let [{:keys [options errors summary]} (parse-opts args cli-options)]


Probe batch methods (ReactNative, ReactDOM, no batching) (closes #77)

--- src/rum/core.cljs
+++ src/rum/core.cljs
@@ -151,6 +151,10 @@

 (def empty-queue [])
 (def render-queue (volatile! empty-queue))
+(def ^:private batch
+  (or (when (exists? js/ReactNative) js/ReactNative.unstable_batchedUpdates)
+      (when (exists? js/ReactDOM) js/ReactDOM.unstable_batchedUpdates)
+      (fn [f a] (f a))))

 (defn render-all [queue]
   (doseq [comp queue
@@ -160,7 +164,7 @@
 (defn render []
   (let [queue @render-queue]
     (vreset! render-queue empty-queue)
-    (js/ReactDOM.unstable_batchedUpdates render-all queue)))
+    (batch render-all queue)))

 (defn request-render [component]
   (when (empty? @render-queue)


CMR-5067 Cleanup.

CMR-5067 Cleanup.

--- umm-spec-lib/test/cmr/umm_spec/test/umm_g/granule.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/umm_g/granule.clj
@@ -100,5 +100,3 @@
 (deftest parse-granule-test
   (testing "parse granule"
     (is (= expected-granule (core/parse-metadata {} :granule :umm-json sample-umm-g-granule)))))
-
-(comment (def sample-umm-g-granule #cmr.umm.umm_granule.UmmGranule{:granule-ur "!", :data-provider-timestamps #cmr.umm.umm_granule.DataProviderTimestamps{:insert-time #=(cmr.common.joda-time/date-time 0 "UTC"), :update-time #=(cmr.common.joda-time/date-time 0 "UTC"), :delete-time nil}, :collection-ref #cmr.umm.umm_granule.CollectionRef{:entry-title nil, :short-name "p", :version-id "pAk1f", :entry-id nil}, :data-granule nil, :access-value nil, :temporal #cmr.umm.umm_granule.GranuleTemporal{:range-date-time #cmr.umm.umm_collection.RangeDateTime{:beginning-date-time #=(cmr.common.joda-time/date-time 0 "UTC"), :ending-date-time nil}, :single-date-time nil}, :spatial-coverage nil, :orbit-calculated-spatial-domains nil, :measured-parameters nil, :platform-refs nil, :project-refs [#cmr.umm.umm_granule.ProjectRef{:short-name "!", :campaigns nil}], :related-urls nil, :product-specific-attributes nil, :cloud-cover nil, :two-d-coordinate-system nil}))


remove debugging console message

remove debugging console message

--- pedestal-app/app/src/semtag_web/services.cljs
+++ pedestal-app/app/src/semtag_web/services.cljs
@@ -16,7 +16,7 @@
                               msg/topic [:search-results]
                               :value results}))
 (defn alert
-  "Creates an alert partial for given type"
+  "Adds an alert box at the top of the page"
   [msg alert-type]
   (dom/prepend! (dom/by-id "main")
                 (partials/alert msg (str "alert-" (name alert-type)))))
@@ -27,10 +27,10 @@
                :request-method "GET"
                :on-success success-fn
                :on-error (fn [{:keys [xhr] :as msg}]
-                           (.log js/console "Request failed with:" (.getResponse xhr))
                            (alert (format "Request '%s' failed with: %s"
                                           uri
-                                          (.getResponse xhr)) :error))))
+                                          (.getResponse xhr))
+                                  :error))))

 (defn services-fn [message input-queue]
   (.log js/console (str "Sending query to server: " message))


PDOK-1025: fix nested-feature if no extra attributes present

--- src/main/clojure/pdok/featured/projectors.clj
+++ src/main/clojure/pdok/featured/projectors.clj
@@ -77,6 +77,9 @@
         rec (apply conj!-when rec (fn [_] true) attr-vals)
         rec (conj! rec id)]
     (persistent! rec)))
+
+(defn- all-fields-constructor [attributes]
+  (if (empty? attributes) (constantly nil) (apply juxt (map #(fn [col] (get col %)) attributes))))

 (defn- gs-add-feature
   ([db all-attributes-fn features]
@@ -87,11 +90,9 @@
        (doseq [[{:keys [dataset collection]} grouped-features] per-dataset-collection]
          (j/with-db-connection [c db]
            (let [all-attributes (all-attributes-fn dataset collection)
-                 all-fields-constructor (apply juxt (map #(fn [col] (get col %)) all-attributes))
-                 records (map #(feature-to-sparse-record % all-fields-constructor) grouped-features)
+                 records (map #(feature-to-sparse-record % (all-fields-constructor all-attributes)) grouped-features)
                  fields (concat [:_id :_geometry] (map (comp keyword pg/quoted) all-attributes))]
-             (apply
-              (partial j/insert! c (str dataset "." (pg/quoted collection)) fields) records)))))
+                          (apply (partial j/insert! c (str dataset "." (pg/quoted collection)) fields) records)))))
       (catch java.sql.SQLException e (j/print-sql-exception-chain e))))
   )